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());
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";
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";
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";
382 histname = TString::Format(
"%s/fHistRhoVsCent", jets->GetArrayName().Data());
383 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
390 while ((obj = nextElement()))
fOutput->Add(obj);
403 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
407 histname = TString::Format(
"%s/fHistRhoVsCent", jets->GetArrayName().Data());
413 UInt_t rejectionReason = 0;
414 if (!jets->
AcceptJet(jet, rejectionReason)) {
415 histname = TString::Format(
"%s/fHistRejectionReason_%d", jets->GetArrayName().Data(),
fCentBin);
416 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
421 Float_t corrPt = jet->Pt() - rhoVal * jet->Area();
423 TLorentzVector leadPart;
428 Double_t ep = jet->Phi() -
fEPV0;
429 while (ep < 0) ep += TMath::Pi();
430 while (ep >= TMath::Pi()) ep -= TMath::Pi();
433 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
446 for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
447 AliVParticle *track = jet->TrackAt(it, tracks->GetArray());
449 histname = TString::Format(
"%s/fHistTracksJetPt_%d", jets->GetArrayName().Data(),
fCentBin);
452 Double_t dphi = TVector2::Phi_0_2pi(track->Phi() - jet->Phi());
453 Double_t deta = track->Eta() - jet->Eta();
454 Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
456 histname = TString::Format(
"%s/fHistTracksPtDist_%d", jets->GetArrayName().Data(),
fCentBin);
459 histname = TString::Format(
"%s/fHistTracksZJetPtJetConst_%d", jets->GetArrayName().Data(),
fCentBin);
467 for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
468 AliVCluster *cluster = jet->ClusterAt(ic, clusters->GetArray());
471 TLorentzVector nPart;
476 cluster->GetMomentum(nPart,
fVertex);
479 histname = TString::Format(
"%s/fHistClustersJetPt_%d", jets->GetArrayName().Data(),
fCentBin);
482 Double_t dphi = TVector2::Phi_0_2pi(nPart.Phi() - jet->Phi());
483 Double_t deta = nPart.Eta() - jet->Eta();
484 Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
486 histname = TString::Format(
"%s/fHistClustersPtDist_%d", jets->GetArrayName().Data(),
fCentBin);
489 histname = TString::Format(
"%s/fHistClustersZJetPtJetConst_%d", jets->GetArrayName().Data(),
fCentBin);
507 histname = TString::Format(
"%s/fHistJetPtEtaPhi_%d", jets->GetArrayName().Data(),
fCentBin);
510 histname = TString::Format(
"%s/fHistJetPtArea_%d", jets->GetArrayName().Data(),
fCentBin);
513 histname = TString::Format(
"%s/fHistJetPtEP_%d", jets->GetArrayName().Data(),
fCentBin);
516 histname = TString::Format(
"%s/fHistJetPtNEF_%d", jets->GetArrayName().Data(),
fCentBin);
519 histname = TString::Format(
"%s/fHistJetPtZ_%d", jets->GetArrayName().Data(),
fCentBin);
522 histname = TString::Format(
"%s/fHistJetPtLeadingPartPt_%d", jets->GetArrayName().Data(),
fCentBin);
526 histname = TString::Format(
"%s/fHistJetPtMCPt_%d", jets->GetArrayName().Data(),
fCentBin);
531 histname = TString::Format(
"%s/fHistJetCorrPtEtaPhi_%d", jets->GetArrayName().Data(),
fCentBin);
534 histname = TString::Format(
"%s/fHistJetCorrPtArea_%d", jets->GetArrayName().Data(),
fCentBin);
537 histname = TString::Format(
"%s/fHistJetCorrPtEP_%d", jets->GetArrayName().Data(),
fCentBin);
540 histname = TString::Format(
"%s/fHistJetCorrPtNEF_%d", jets->GetArrayName().Data(),
fCentBin);
543 histname = TString::Format(
"%s/fHistJetCorrPtZ_%d", jets->GetArrayName().Data(),
fCentBin);
546 histname = TString::Format(
"%s/fHistJetCorrPtLeadingPartPt_%d", jets->GetArrayName().Data(),
fCentBin);
549 histname = TString::Format(
"%s/fHistJetPtCorrPt_%d", jets->GetArrayName().Data(),
fCentBin);
553 histname = TString::Format(
"%s/fHistJetMCPtCorrPt_%d", jets->GetArrayName().Data(),
fCentBin);
565 AliError(
"Tree output not implemented. Falling back to THnSparse output");
576 Double_t contents[30]={0};
578 histname = TString::Format(
"%s/fHistJetObservables", jets->GetArrayName().Data());
581 if (!histJetObservables)
return;
583 for (Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
584 TString
title(histJetObservables->GetAxis(i)->GetTitle());
585 if (
title==
"Centrality (%)")
586 contents[i] = jet.
fCent;
587 else if (
title==
"#phi_{jet} - #psi_{EP}")
588 contents[i] = jet.
fEP;
589 else if (
title==
"#eta_{jet}")
590 contents[i] = jet.Eta();
591 else if (
title==
"#phi_{jet} (rad)")
593 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
594 contents[i] = jet.Pt();
595 else if (
title==
"#it{p}_{T}^{MC} (GeV/#it{c})")
596 contents[i] = jet.
fMCPt;
597 else if (
title==
"#it{p}_{T}^{corr} (GeV/#it{c})")
599 else if (
title==
"#it{A}_{jet}")
600 contents[i] = jet.
fArea;
601 else if (
title==
"NEF")
602 contents[i] = jet.
fNEF;
603 else if (
title==
"#it{z}_{leading}")
604 contents[i] = jet.
fZ;
605 else if (
title==
"No. of constituents")
607 else if (
title==
"#it{p}_{T,particle}^{leading} (GeV/#it{c})")
610 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
613 histJetObservables->Fill(contents);
Declaration of class AliAnalysisTaskEmcalJetSpectraQA.
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
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.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
virtual void FillTHX(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
virtual void FillTHnSparse(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
AliClusterContainer * GetClusterContainer() const
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
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.
Container for particles within the EMCAL framework.
Int_t GetDefaultClusterEnergy() const
virtual void AllocateTTree(const AliJetContainer *jets)
void GetMomentum(TLorentzVector &vec) const
THashList * CreateHistoGroup(const char *groupname, const char *parent="/")
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)
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
TObject * FindObject(const char *name) const
THistManager fHistManager
Histogram manager.
THashList * GetListOfHistograms() const
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
Double_t Phi_0_2pi() const
Double_t fVertex[3]
!event vertex
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()
Float_t GetJetRadius() const
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster *vc, Double_t mass) const
Represent a jet reconstructed using the EMCal jet framework.
Bool_t fIsEmbedded
Embedded data present.
AliAnalysisTaskEmcalJetSpectraQA()
Default constructor for ROOT I/O purposes.
const AliJetIterableContainer accepted() const
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Container structure for EMCAL clusters.
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.
TH3 * CreateTH3(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int nbinsz, double zmin, double zmax, Option_t *opt="")
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Class that encapsulates jets.