16 #include <TClonesArray.h> 19 #include <THnSparse.h> 20 #include <THashList.h> 22 #include <AliAnalysisManager.h> 23 #include <AliVEventHandler.h> 26 #include "AliVCluster.h" 27 #include "AliVParticle.h" 112 AliError(
"Tree output not implemented. Falling back to THnSparse output");
132 title[dim] =
"Centrality (%)";
139 title[dim] =
"#phi_{jet} - #psi_{EP}";
140 nbins[dim] = nPtBins/5;
142 max[dim] = TMath::Pi();
147 title[dim] =
"#eta_{jet}";
148 nbins[dim] = nPtBins/10;
153 title[dim] =
"#phi_{jet} (rad)";
154 nbins[dim] = nPtBins/10*3;
156 max[dim] = 2*TMath::Pi();
159 title[dim] =
"#it{p}_{T} (GeV/#it{c})";
166 title[dim] =
"#it{p}_{T}^{MC} (GeV/#it{c})";
174 title[dim] =
"#it{p}_{T}^{corr} (GeV/#it{c})";
184 title[dim] =
"#it{A}_{jet}";
185 nbins[dim] = TMath::CeilNint(2.0*jetRadius*jetRadius*TMath::Pi() / 0.01 * nPtBins / 250);
187 max[dim] = 2.0*jetRadius*jetRadius*TMath::Pi();
193 nbins[dim] = nPtBins/5;
199 title[dim] =
"#it{z}_{leading}";
200 nbins[dim] = nPtBins/5;
206 title[dim] =
"No. of constituents";
213 title[dim] =
"No. of constituents";
220 title[dim] =
"#it{p}_{T,particle}^{leading} (GeV/#it{c})";
221 nbins[dim] = nPtBins/10*3;
226 TString histname = TString::Format(
"%s/fHistJetObservables", jets->GetArrayName().Data());
228 for (
Int_t i = 0; i < dim; i++) {
229 hn->GetAxis(i)->SetTitle(title[i]);
244 histname = TString::Format(
"%s/fHistJetPtEtaPhi_%d", jets->GetArrayName().Data(), i);
245 title = histname +
";#it{p}_{T} (GeV/#it{c});#eta;#phi (rad)";
246 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, -1, 1, 41, 0, 2*TMath::Pi()*41/40,
nPtBins, 0,
fMaxPt);
248 histname = TString::Format(
"%s/fHistJetPtArea_%d", jets->GetArrayName().Data(), i);
249 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{A}_{jet};counts";
252 histname = TString::Format(
"%s/fHistJetPtEP_%d", jets->GetArrayName().Data(), i);
253 title = histname +
";#it{p}_{T} (GeV/#it{c});#phi_{jet} - #psi_{EP};counts";
256 histname = TString::Format(
"%s/fHistJetPtNEF_%d", jets->GetArrayName().Data(), i);
257 title = histname +
";#it{p}_{T} (GeV/#it{c});NEF;counts";
260 histname = TString::Format(
"%s/fHistJetPtZ_%d", jets->GetArrayName().Data(), i);
261 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{z}_{leading};counts";
264 histname = TString::Format(
"%s/fHistJetPtLeadingPartPt_%d", jets->GetArrayName().Data(), i);
265 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c});counts";
269 histname = TString::Format(
"%s/fHistJetCorrPtEtaPhi_%d", jets->GetArrayName().Data(), i);
270 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#eta;#phi (rad)";
271 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, -1, 1, 41, 0, 2*TMath::Pi()*201/200, nPtBins*2, -
fMaxPt,
fMaxPt);
273 histname = TString::Format(
"%s/fHistJetCorrPtArea_%d", jets->GetArrayName().Data(), i);
274 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#it{A}_{jet};counts";
277 histname = TString::Format(
"%s/fHistJetCorrPtEP_%d", jets->GetArrayName().Data(), i);
278 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#phi_{jet} - #psi_{EP};counts";
281 histname = TString::Format(
"%s/fHistJetCorrPtNEF_%d", jets->GetArrayName().Data(), i);
282 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});NEF;counts";
285 histname = TString::Format(
"%s/fHistJetCorrPtZ_%d", jets->GetArrayName().Data(), i);
286 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#it{z}_{leading};counts";
289 histname = TString::Format(
"%s/fHistJetCorrPtLeadingPartPt_%d", jets->GetArrayName().Data(), i);
290 title = histname +
";#it{p}_{T,corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c});counts";
293 histname = TString::Format(
"%s/fHistJetPtCorrPt_%d", jets->GetArrayName().Data(), i);
294 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{p}_{T,corr} (GeV/#it{c});counts";
298 histname = TString::Format(
"%s/fHistJetMCPtCorrPt_%d", jets->GetArrayName().Data(), i);
299 title = histname +
";#it{p}_{T,MC} (GeV/#it{c});#it{p}_{T,corr} (GeV/#it{c});counts";
305 histname = TString::Format(
"%s/fHistJetPtMCPt_%d", jets->GetArrayName().Data(), i);
306 title = histname +
";#it{p}_{T} (GeV/#it{c});#it{p}_{T,MC} (GeV/#it{c});counts";
317 Int_t maxTracks = 6000;
318 Int_t constituentsNbins = 250;
323 constituentsNbins = 50;
324 constituentsMax = 49.5;
329 constituentsNbins = 100;
330 constituentsMax = 99.5;
360 histname = TString::Format(
"%s/fHistTracksJetPt_%d", jets->GetArrayName().Data(), i);
361 title = histname +
";#it{p}_{T,track} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});counts";
364 histname = TString::Format(
"%s/fHistTracksPtDist_%d", jets->GetArrayName().Data(), i);
365 title = histname +
";#it{p}_{T,track} (GeV/#it{c});#it{d};counts";
368 histname = TString::Format(
"%s/fHistTracksZJetPtJetConst_%d", jets->GetArrayName().Data(), i);
369 title = histname +
";#it{z}_{track} (GeV/#it{c});#it{d};No. of constituents";
370 fHistManager.
CreateTH3(histname.Data(), title.Data(), 120, 0.0, 1.2,
nPtBins, 0,
fMaxPt, constituentsNbins, -0.5, constituentsMax);
374 histname = TString::Format(
"%s/fHistClustersJetPt_%d", jets->GetArrayName().Data(), i);
375 title = histname +
";#it{p}_{T,cluster} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});counts";
378 histname = TString::Format(
"%s/fHistClustersPtDist_%d", jets->GetArrayName().Data(), i);
379 title = histname +
";#it{p}_{T,cluster} (GeV/#it{c});#it{d};counts";
382 histname = TString::Format(
"%s/fHistClustersZJetPtJetConst_%d", jets->GetArrayName().Data(), i);
383 title = histname +
";#it{z}_{cluster} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});No. of constituents";
384 fHistManager.
CreateTH3(histname.Data(), title.Data(), 120, 0.0, 1.2,
nPtBins, 0,
fMaxPt, constituentsNbins, -0.5, constituentsMax);
387 histname = TString::Format(
"%s/fHistRejectionReason_%d", jets->GetArrayName().Data(), i);
388 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
393 histname = TString::Format(
"%s/fHistLeadJetPtVsCent", jets->GetArrayName().Data());
394 title = histname +
";Centrality (%);#it{p}_{T,jet} (GeV/#it{c});counts";
397 histname = TString::Format(
"%s/fHistLeadJetPtVsNTracks", jets->GetArrayName().Data());
398 title = histname +
";no. of tracks;#it{p}_{T,jet} (GeV/#it{c});counts";
402 histname = TString::Format(
"%s/fHistRhoVsCent", jets->GetArrayName().Data());
403 title = histname +
";Centrality (%);#rho (GeV/#it{c} rad^{-1});counts";
406 histname = TString::Format(
"%s/fHistRhoVsNTracks", jets->GetArrayName().Data());
407 title = histname +
";no. of tracks;#rho (GeV/#it{c} rad^{-1});counts";
410 histname = TString::Format(
"%s/fHistRhoVsLeadJetPt", jets->GetArrayName().Data());
411 title = histname +
";#it{p}_{T,jet} (GeV/#it{c});#rho (GeV/#it{c} rad^{-1});counts";
418 while ((obj = nextElement()))
fOutput->Add(obj);
430 AliError(Form(
"fCentBin is %d! fCent = %.3f. Fix the centrality bins to include all possible values of centrality.",
fCentBin,
fCent));
442 UInt_t rejectionReason = 0;
443 if (!jets->
AcceptJet(jet, rejectionReason)) {
444 histname = TString::Format(
"%s/fHistRejectionReason_%d", jets->GetArrayName().Data(),
fCentBin);
445 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
450 Float_t corrPt = jet->Pt() - rhoVal * jet->Area();
452 TLorentzVector leadPart;
458 while (ep < 0) ep += TMath::Pi();
459 while (ep >= TMath::Pi()) ep -= TMath::Pi();
462 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
471 if (jet->Pt() > leadJetPt) leadJetPt = jet->Pt();
477 for (
Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
478 AliVParticle *track = jet->TrackAt(it, tracks->GetArray());
480 histname = TString::Format(
"%s/fHistTracksJetPt_%d", jets->GetArrayName().Data(),
fCentBin);
483 Double_t dphi = TVector2::Phi_0_2pi(track->Phi() - jet->Phi());
484 Double_t deta = track->Eta() - jet->Eta();
485 Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
487 histname = TString::Format(
"%s/fHistTracksPtDist_%d", jets->GetArrayName().Data(),
fCentBin);
490 histname = TString::Format(
"%s/fHistTracksZJetPtJetConst_%d", jets->GetArrayName().Data(),
fCentBin);
498 for (
Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
499 AliVCluster *cluster = jet->ClusterAt(ic, clusters->GetArray());
502 TLorentzVector nPart;
507 cluster->GetMomentum(nPart,
fVertex);
510 histname = TString::Format(
"%s/fHistClustersJetPt_%d", jets->GetArrayName().Data(),
fCentBin);
513 Double_t dphi = TVector2::Phi_0_2pi(nPart.Phi() - jet->Phi());
514 Double_t deta = nPart.Eta() - jet->Eta();
515 Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
517 histname = TString::Format(
"%s/fHistClustersPtDist_%d", jets->GetArrayName().Data(),
fCentBin);
520 histname = TString::Format(
"%s/fHistClustersZJetPtJetConst_%d", jets->GetArrayName().Data(),
fCentBin);
528 for (
auto cont : this->
fParticleCollArray) ntracks += cont.second->GetNAcceptEntries();
530 histname = TString::Format(
"%s/fHistLeadJetPtVsCent", jets->GetArrayName().Data());
533 histname = TString::Format(
"%s/fHistLeadJetPtVsNTracks", jets->GetArrayName().Data());
537 histname = TString::Format(
"%s/fHistRhoVsCent", jets->GetArrayName().Data());
540 histname = TString::Format(
"%s/fHistRhoVsNTracks", jets->GetArrayName().Data());
543 histname = TString::Format(
"%s/fHistRhoVsLeadJetPt", jets->GetArrayName().Data());
558 histname = TString::Format(
"%s/fHistJetPtEtaPhi_%d", jets->GetArrayName().Data(),
fCentBin);
561 histname = TString::Format(
"%s/fHistJetPtArea_%d", jets->GetArrayName().Data(),
fCentBin);
564 histname = TString::Format(
"%s/fHistJetPtEP_%d", jets->GetArrayName().Data(),
fCentBin);
567 histname = TString::Format(
"%s/fHistJetPtNEF_%d", jets->GetArrayName().Data(),
fCentBin);
570 histname = TString::Format(
"%s/fHistJetPtZ_%d", jets->GetArrayName().Data(),
fCentBin);
573 histname = TString::Format(
"%s/fHistJetPtLeadingPartPt_%d", jets->GetArrayName().Data(),
fCentBin);
577 histname = TString::Format(
"%s/fHistJetPtMCPt_%d", jets->GetArrayName().Data(),
fCentBin);
582 histname = TString::Format(
"%s/fHistJetCorrPtEtaPhi_%d", jets->GetArrayName().Data(),
fCentBin);
585 histname = TString::Format(
"%s/fHistJetCorrPtArea_%d", jets->GetArrayName().Data(),
fCentBin);
588 histname = TString::Format(
"%s/fHistJetCorrPtEP_%d", jets->GetArrayName().Data(),
fCentBin);
591 histname = TString::Format(
"%s/fHistJetCorrPtNEF_%d", jets->GetArrayName().Data(),
fCentBin);
594 histname = TString::Format(
"%s/fHistJetCorrPtZ_%d", jets->GetArrayName().Data(),
fCentBin);
597 histname = TString::Format(
"%s/fHistJetCorrPtLeadingPartPt_%d", jets->GetArrayName().Data(),
fCentBin);
600 histname = TString::Format(
"%s/fHistJetPtCorrPt_%d", jets->GetArrayName().Data(),
fCentBin);
604 histname = TString::Format(
"%s/fHistJetMCPtCorrPt_%d", jets->GetArrayName().Data(),
fCentBin);
616 AliError(
"Tree output not implemented. Falling back to THnSparse output");
629 histname = TString::Format(
"%s/fHistJetObservables", jets->GetArrayName().Data());
632 if (!histJetObservables)
return;
634 for (
Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
635 TString title(histJetObservables->GetAxis(i)->GetTitle());
636 if (
title==
"Centrality (%)")
637 contents[i] = jet.
fCent;
638 else if (
title==
"#phi_{jet} - #psi_{EP}")
639 contents[i] = jet.
fEP;
640 else if (
title==
"#eta_{jet}")
641 contents[i] = jet.Eta();
642 else if (
title==
"#phi_{jet} (rad)")
644 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
645 contents[i] = jet.Pt();
646 else if (
title==
"#it{p}_{T}^{MC} (GeV/#it{c})")
647 contents[i] = jet.
fMCPt;
648 else if (
title==
"#it{p}_{T}^{corr} (GeV/#it{c})")
650 else if (
title==
"#it{A}_{jet}")
651 contents[i] = jet.
fArea;
652 else if (
title==
"NEF")
653 contents[i] = jet.
fNEF;
654 else if (
title==
"#it{z}_{leading}")
655 contents[i] = jet.
fZ;
656 else if (
title==
"No. of constituents")
658 else if (
title==
"#it{p}_{T,particle}^{leading} (GeV/#it{c})")
661 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
664 histJetObservables->Fill(contents);
702 ::Error(
"AddTaskEmcalJetSpectraQA",
"No analysis manager to connect to.");
707 AliVEventHandler* handler = mgr->GetInputEventHandler();
709 ::Error(
"AddTaskEmcalJetSpectraQA",
"This task requires an input event handler");
715 if (handler->InheritsFrom(
"AliESDInputHandler")) {
718 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
724 if (trackName ==
"usedefault") {
725 if (dataType ==
kESD) {
726 trackName =
"Tracks";
728 else if (dataType ==
kAOD) {
729 trackName =
"tracks";
736 if (clusName ==
"usedefault") {
737 if (dataType ==
kESD) {
738 clusName =
"CaloClusters";
740 else if (dataType ==
kAOD) {
741 clusName =
"caloClusters";
748 TString name(
"AliAnalysisTaskEmcalJetSpectraQA");
749 if (strcmp(suffix,
"")) {
769 mgr->AddTask(jetTask);
772 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
774 contname +=
"_histos";
775 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
776 TList::Class(),AliAnalysisManager::kOutputContainer,
777 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
778 mgr->ConnectInput (jetTask, 0, cinput1 );
779 mgr->ConnectOutput (jetTask, 1, coutput1 );
Declaration of class AliAnalysisTaskEmcalJetSpectraQA.
void SetRejectionReasonLabels(TAxis *axis)
AliClusterContainer * AddClusterContainer(std::string branchName, std::string contName="")
void UserCreateOutputObjects()
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
void SetParticlePtCut(Double_t cut)
Double_t GetRhoVal() const
Float_t fMaxPt
Histogram pt limit.
TList * fOutput
!output list
const TString & GetRhoName() const
EDataType_t
Switch for the data type.
EHistoType_t fHistoType
histogram type
static AliAnalysisTaskEmcalJetSpectraQA * AddTaskEmcalJetSpectraQA(TString ntracks="usedefault", TString nclusters="usedefault", Double_t trackPtCut=0.15, Double_t clusECut=0.30, TString suffix="")
Double_t fEPV0
!event plane V0
Float_t fPtBinWidth
Histogram pt bin width.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
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="")
Fill a 3D histogram within the container.
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
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="")
Create a new TH2 within the container.
TObject * FindObject(const char *name) const
Find an object inside the container.
THistManager fHistManager
Histogram manager.
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
Double_t Phi_0_2pi() const
Double_t fVertex[3]
!event vertex
void SetNeedEmcalGeom(Bool_t n)
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()
Int_t GetNCentBins() const
AliParticleContainer * AddParticleContainer(std::string branchName, std::string contName="")
Float_t GetJetRadius() const
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
void SetVzRange(Double_t min, Double_t max)
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.
void SetClusPtCut(Double_t cut)
AliAnalysisTaskEmcalJetSpectraQA()
Default constructor for ROOT I/O purposes.
std::map< std::string, AliJetContainer * > fJetCollArray
jet collection array
const AliJetIterableContainer accepted() const
void SetClusECut(Double_t cut)
void SetDefaultClusterEnergy(Int_t d)
std::map< std::string, AliClusterContainer * > fClusterCollArray
cluster collection array
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
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="")
Create a new TH2 within the container.
void SetClusHadCorrEnergyCut(Double_t cut)
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Class that encapsulates jets.