16 #include <TClonesArray.h>
19 #include <THnSparse.h>
20 #include <THashList.h>
23 #include "AliVCluster.h"
24 #include "AliVParticle.h"
56 fNConstituents(jet.GetNumberOfConstituents()),
93 fHistoType(kTHnSparse),
109 AliError(
"Tree output not implemented. Falling back to THnSparse output");
120 TString
title[30]= {
""};
121 Int_t
nbins[30] = {0};
122 Double_t min[30] = {0.};
123 Double_t max[30] = {0.};
129 title[dim] =
"Centrality (%)";
136 title[dim] =
"#phi_{jet} - #psi_{EP}";
137 nbins[dim] = nPtBins/5;
139 max[dim] = TMath::Pi();
144 title[dim] =
"#eta_{jet}";
145 nbins[dim] = nPtBins/10;
150 title[dim] =
"#phi_{jet} (rad)";
151 nbins[dim] = nPtBins/10*3;
153 max[dim] = 2*TMath::Pi();
156 title[dim] =
"#it{p}_{T} (GeV/#it{c})";
163 title[dim] =
"#it{p}_{T}^{MC} (GeV/#it{c})";
171 title[dim] =
"#it{p}_{T}^{corr} (GeV/#it{c})";
181 title[dim] =
"#it{A}_{jet}";
182 nbins[dim] = TMath::CeilNint(2.0*jetRadius*jetRadius*TMath::Pi() / 0.01 * nPtBins / 250);
184 max[dim] = 2.0*jetRadius*jetRadius*TMath::Pi();
190 nbins[dim] = nPtBins/5;
196 title[dim] =
"#it{z}_{leading}";
197 nbins[dim] = nPtBins/5;
203 title[dim] =
"No. of constituents";
210 title[dim] =
"No. of constituents";
217 title[dim] =
"#it{p}_{T,particle}^{leading} (GeV/#it{c})";
218 nbins[dim] = nPtBins/10*3;
223 TString histname = TString::Format(
"%s/fHistJetObservables", jets->
GetArrayName().Data());
224 THnSparse* hn =
fHistManager.CreateTHnSparse(histname.Data(), histname.Data(), dim,
nbins, min, max);
225 for (Int_t i = 0; i < dim; i++) {
226 hn->GetAxis(i)->SetTitle(title[i]);
241 histname = TString::Format(
"%s/fHistJetPtEtaPhi_%d", jets->
GetArrayName().Data(), i);
242 title = histname +
";#it{p}_{T} (GeV/#it{c});#eta;#phi (rad)";
243 fHistManager.CreateTH3(histname.Data(), title.Data(), 20, -1, 1, 41, 0, 2*TMath::Pi()*41/40,
nPtBins, 0,
fMaxPt);
245 histname = TString::Format(
"%s/fHistJetPtArea_%d", jets->
GetArrayName().Data(), i);
246 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{A}_{jet};counts";
249 histname = TString::Format(
"%s/fHistJetPtEP_%d", jets->
GetArrayName().Data(), i);
250 title = histname +
";#it{p}_{T} (GeV/#it{c});#phi_{jet} - #psi_{EP};counts";
253 histname = TString::Format(
"%s/fHistJetPtNEF_%d", jets->
GetArrayName().Data(), i);
254 title = histname +
";#it{p}_{T} (GeV/#it{c});NEF;counts";
257 histname = TString::Format(
"%s/fHistJetPtZ_%d", jets->
GetArrayName().Data(), i);
258 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{z}_{leading};counts";
261 histname = TString::Format(
"%s/fHistJetPtLeadingPartPt_%d", jets->
GetArrayName().Data(), i);
262 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c});counts";
266 histname = TString::Format(
"%s/fHistJetCorrPtEtaPhi_%d", jets->
GetArrayName().Data(), i);
267 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#eta;#phi (rad)";
268 fHistManager.CreateTH3(histname.Data(), title.Data(), 20, -1, 1, 41, 0, 2*TMath::Pi()*201/200, nPtBins*2, -
fMaxPt,
fMaxPt);
270 histname = TString::Format(
"%s/fHistJetCorrPtArea_%d", jets->
GetArrayName().Data(), i);
271 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#it{A}_{jet};counts";
274 histname = TString::Format(
"%s/fHistJetCorrPtEP_%d", jets->
GetArrayName().Data(), i);
275 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#phi_{jet} - #psi_{EP};counts";
278 histname = TString::Format(
"%s/fHistJetCorrPtNEF_%d", jets->
GetArrayName().Data(), i);
279 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});NEF;counts";
282 histname = TString::Format(
"%s/fHistJetCorrPtZ_%d", jets->
GetArrayName().Data(), i);
283 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#it{z}_{leading};counts";
286 histname = TString::Format(
"%s/fHistJetCorrPtLeadingPartPt_%d", jets->
GetArrayName().Data(), i);
287 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c});counts";
290 histname = TString::Format(
"%s/fHistJetPtCorrPt_%d", jets->
GetArrayName().Data(), i);
291 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{p}_{T,corr} (GeV/#it{c});counts";
295 histname = TString::Format(
"%s/fHistJetMCPtCorrPt_%d", jets->
GetArrayName().Data(), i);
296 title = histname +
";#it{p}_{T,MC} (GeV/#it{c});#it{p}_{T,corr} (GeV/#it{c});counts";
302 histname = TString::Format(
"%s/fHistJetPtMCPt_%d", jets->
GetArrayName().Data(), i);
303 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{p}_{T,MC} (GeV/#it{c});counts";
314 Int_t constituentsNbins = 250;
315 Double_t constituentsMax = 249.5;
320 constituentsNbins = 50;
321 constituentsMax = 49.5;
329 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
348 histname = TString::Format(
"%s/fHistTracksJetPt_%d", jets->
GetArrayName().Data(), i);
349 title = histname +
";#it{p}_{T,track} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});counts";
352 histname = TString::Format(
"%s/fHistTracksPtDist_%d", jets->
GetArrayName().Data(), i);
353 title = histname +
";#it{p}_{T,track} (GeV/#it{c});#it{d};counts";
354 fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins / 2, 0,
fMaxPt / 2, 100, 0, 5);
356 histname = TString::Format(
"%s/fHistTracksZJetPtJetConst_%d", jets->
GetArrayName().Data(), i);
357 title = histname +
";#it{z}_{track} (GeV/#it{c});#it{d};No. of constituents";
358 fHistManager.CreateTH3(histname.Data(), title.Data(), 120, 0.0, 1.2,
nPtBins, 0,
fMaxPt, constituentsNbins, -0.5, constituentsMax);
362 histname = TString::Format(
"%s/fHistClustersJetPt_%d", jets->
GetArrayName().Data(), i);
363 title = histname +
";#it{p}_{T,cluster} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});counts";
366 histname = TString::Format(
"%s/fHistClustersPtDist_%d", jets->
GetArrayName().Data(), i);
367 title = histname +
";#it{p}_{T,cluster} (GeV/#it{c});#it{d};counts";
368 fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins / 2, 0,
fMaxPt / 2, 100, 0, 5);
370 histname = TString::Format(
"%s/fHistClustersZJetPtJetConst_%d", jets->
GetArrayName().Data(), i);
371 title = histname +
";#it{z}_{cluster} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});No. of constituents";
372 fHistManager.CreateTH3(histname.Data(), title.Data(), 120, 0.0, 1.2,
nPtBins, 0,
fMaxPt, constituentsNbins, -0.5, constituentsMax);
375 histname = TString::Format(
"%s/fHistRejectionReason_%d", jets->
GetArrayName().Data(), i);
376 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
377 TH2* hist =
fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 100, 0, 250);
382 histname = TString::Format(
"%s/fHistRhoVsCent", jets->
GetArrayName().Data());
383 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
384 fHistManager.CreateTH2(histname.Data(), title.Data(), 101, 0, 101, 100, 0, 500);
390 while ((obj = nextElement()))
fOutput->Add(obj);
403 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
407 histname = TString::Format(
"%s/fHistRhoVsCent", jets->
GetArrayName().Data());
415 UInt_t rejectionReason = 0;
416 if (!jets->
AcceptJet(jet, rejectionReason)) {
417 histname = TString::Format(
"%s/fHistRejectionReason_%d", jets->
GetArrayName().Data(),
fCentBin);
423 Float_t corrPt = jet->
Pt() - rhoVal * jet->
Area();
425 TLorentzVector leadPart;
431 while (ep < 0) ep += TMath::Pi();
432 while (ep >= TMath::Pi()) ep -= TMath::Pi();
435 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
454 Double_t dphi = TVector2::Phi_0_2pi(track->Phi() - jet->
Phi());
455 Double_t deta = track->Eta() - jet->
Eta();
456 Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
459 fHistManager.FillTH2(histname.Data(), track->Pt(), dist);
461 histname = TString::Format(
"%s/fHistTracksZJetPtJetConst_%d", jets->
GetArrayName().Data(),
fCentBin);
473 TLorentzVector nPart;
478 cluster->GetMomentum(nPart,
fVertex);
484 Double_t dphi = TVector2::Phi_0_2pi(nPart.Phi() - jet->
Phi());
485 Double_t deta = nPart.Eta() - jet->
Eta();
486 Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
489 fHistManager.FillTH2(histname.Data(), nPart.Pt(), dist);
491 histname = TString::Format(
"%s/fHistClustersZJetPtJetConst_%d", jets->
GetArrayName().Data(),
fCentBin);
510 fHistManager.FillTH3(histname.Data(), jet.Eta(), jet.Phi_0_2pi(), jet.Pt());
524 histname = TString::Format(
"%s/fHistJetPtLeadingPartPt_%d", jets->
GetArrayName().Data(),
fCentBin);
533 histname = TString::Format(
"%s/fHistJetCorrPtEtaPhi_%d", jets->
GetArrayName().Data(),
fCentBin);
548 histname = TString::Format(
"%s/fHistJetCorrPtLeadingPartPt_%d", jets->
GetArrayName().Data(),
fCentBin);
567 AliError(
"Tree output not implemented. Falling back to THnSparse output");
578 Double_t contents[30]={0};
580 histname = TString::Format(
"%s/fHistJetObservables", jets->
GetArrayName().Data());
581 THnSparse* histJetObservables =
static_cast<THnSparse*
>(
fHistManager.FindObject(histname));
583 if (!histJetObservables)
return;
585 for (Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
586 TString
title(histJetObservables->GetAxis(i)->GetTitle());
587 if (
title==
"Centrality (%)")
588 contents[i] = jet.
fCent;
589 else if (
title==
"#phi_{jet} - #psi_{EP}")
590 contents[i] = jet.
fEP;
591 else if (
title==
"#eta_{jet}")
592 contents[i] = jet.Eta();
593 else if (
title==
"#phi_{jet} (rad)")
594 contents[i] = jet.Phi_0_2pi();
595 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
596 contents[i] = jet.Pt();
597 else if (
title==
"#it{p}_{T}^{MC} (GeV/#it{c})")
598 contents[i] = jet.
fMCPt;
599 else if (
title==
"#it{p}_{T}^{corr} (GeV/#it{c})")
601 else if (
title==
"#it{A}_{jet}")
602 contents[i] = jet.
fArea;
603 else if (
title==
"NEF")
604 contents[i] = jet.
fNEF;
605 else if (
title==
"#it{z}_{leading}")
606 contents[i] = jet.
fZ;
607 else if (
title==
"No. of constituents")
609 else if (
title==
"#it{p}_{T,particle}^{leading} (GeV/#it{c})")
612 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
615 histJetObservables->Fill(contents);
Declaration of class AliAnalysisTaskEmcalJetSpectraQA.
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Int_t fNcentBins
how many centrality bins
Double_t GetRhoVal() const
Float_t fMaxPt
Histogram pt limit.
TList * fOutput
!output list
const TString & GetRhoName() const
TObjArray fClusterCollArray
cluster collection array
EHistoType_t fHistoType
histogram type
Double_t fEPV0
!event plane V0
TObjArray fParticleCollArray
particle/track collection array
Float_t fPtBinWidth
Histogram pt bin width.
virtual void FillTHX(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
virtual void FillTHnSparse(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
AliClusterContainer * GetClusterContainer() const
TObjArray fJetCollArray
jet collection array
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
void UserCreateOutputObjects()
Overloads base class method. Creates output objects.
AliEmcalJetInfo()
Default constructor.
UShort_t GetNumberOfConstituents() const
Container for particles within the EMCAL framework.
Int_t GetDefaultClusterEnergy() const
UShort_t GetNumberOfTracks() const
virtual void AllocateTTree(const AliJetContainer *jets)
void GetMomentum(TLorentzVector &vec) const
EBeamType_t fForceBeamType
forced beam type
AliParticleContainer * GetParticleContainer() const
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
void FillJetHisto(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
Short_t ClusterAt(Int_t idx) const
UShort_t GetNumberOfClusters() const
THistManager fHistManager
Histogram manager.
UShort_t GetRejectionReasonBitPosition(UInt_t rejectionReason) const
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
Double_t fVertex[3]
!event vertex
TClonesArray * GetArray() const
virtual void FillTTree(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
Base task in the EMCAL jet framework (lighter version of AliAnalysisTaskEmcalJet) ...
Int_t fCentBin
!event centrality bin
Bool_t fJetEPaxis
whether a EP-jet axis should be included in the THnSparse
Bool_t fAreaAxis
whether the area axis should be included
AliRhoParameter * GetRhoParameter()
const TString & GetArrayName() const
AliEmcalJet * GetNextJet()
Float_t GetJetRadius() const
Short_t TrackAt(Int_t idx) const
Represent a jet reconstructed using the EMCal jet framework.
Bool_t fIsEmbedded
Embedded data present.
AliAnalysisTaskEmcalJetSpectraQA()
Default constructor for ROOT I/O purposes.
Container structure for EMCAL clusters.
void ResetCurrentID(Int_t i=-1)
virtual void AllocateTHnSparse(const AliJetContainer *jets)
void SetMakeGeneralHistograms(Bool_t g)
virtual void AllocateTHX(const AliJetContainer *jets)
Double_t fCent
!event centrality
Container for jet within the EMCAL jet framework.
Implementation of a task to perform QA on jet spectra.
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Class that encapsulates jets.