12 #include "AliESDtrack.h"
13 #include "AliAODMCParticle.h"
25 fDoSigma1OverPt(kFALSE),
26 fDoSigmaPtOverPtGen(kFALSE),
37 fNPtRelDiffHistBins(0),
38 fPtRelDiffHistBins(0),
41 f1OverPtResHistBins(0),
42 fN1OverPtResHistBins(0),
46 fParticlesPhysPrim(0),
51 SetMakeGeneralHistograms(kTRUE);
60 fDoSigma1OverPt(kFALSE),
61 fDoSigmaPtOverPtGen(kFALSE),
72 fNPtRelDiffHistBins(0),
73 fPtRelDiffHistBins(0),
76 f1OverPtResHistBins(0),
77 fN1OverPtResHistBins(0),
81 fParticlesPhysPrim(0),
161 AliFatal(
"This task needs at least one particle container!");
187 Int_t
nbins[20] = {0};
188 Double_t *binEdges[20] = {0};
191 title[dim] =
"Centrality %";
197 title[dim] =
"#it{p}_{T} (GeV/#it{c})";
213 title[dim] =
"MC Generator";
219 title[dim] =
"track type";
226 title[dim] =
"#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}";
232 title[dim] =
"#sigma(#it{p}_{T}) / #it{p}_{T}";
239 fTracks =
new THnSparseF(
"fTracks",
"fTracks",dim,nbins);
240 for (Int_t i = 0; i < dim; i++) {
241 fTracks->GetAxis(i)->SetTitle(title[i]);
242 fTracks->SetBinEdges(i, binEdges[i]);
253 Int_t
nbins[20] = {0};
254 Double_t *binEdges[20] = {0};
257 title[dim] =
"Centrality %";
263 title[dim] =
"#it{p}_{T} (GeV/#it{c})";
279 title[dim] =
"MC Generator";
285 title[dim] =
"Findable";
290 fParticlesPhysPrim =
new THnSparseF(
"fParticlesPhysPrim",
"fParticlesPhysPrim",dim,nbins);
291 for (Int_t i = 0; i < dim; i++) {
304 Int_t
nbins[20] = {0};
305 Double_t *binEdges[20] = {0};
308 title[dim] =
"Centrality %";
314 title[dim] =
"#it{p}_{T}^{gen} (GeV/#it{c})";
319 title[dim] =
"#eta^{gen}";
324 title[dim] =
"#phi^{gen}";
329 title[dim] =
"#it{p}_{T}^{det} (GeV/#it{c})";
334 title[dim] =
"#eta^{det}";
339 title[dim] =
"#phi^{det}";
345 title[dim] =
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}";
351 title[dim] =
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}";
357 title[dim] =
"track type";
362 fParticlesMatched =
new THnSparseF(
"fParticlesMatched",
"fParticlesMatched",dim,nbins);
363 for (Int_t i = 0; i < dim; i++) {
375 AliError(
"Please, first set the detector level array!");
419 Double_t sigma1OverPt, Int_t mcGen, Byte_t trackType)
421 Double_t contents[20]={0};
423 for (Int_t i = 0; i <
fTracks->GetNdimensions(); i++) {
425 if (
title==
"Centrality %")
427 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
428 contents[i] = trackPt;
429 else if (
title==
"#eta")
430 contents[i] = trackEta;
431 else if (
title==
"#phi")
432 contents[i] = trackPhi;
433 else if (
title==
"#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}")
434 contents[i] = sigma1OverPt;
435 else if (
title==
"#sigma(#it{p}_{T}) / #it{p}_{T}")
436 contents[i] = sigma1OverPt*trackPt;
437 else if (
title==
"MC Generator")
439 else if (
title==
"track type")
440 contents[i] = trackType;
442 AliWarning(Form(
"Unable to fill dimension %s of histogram %s!",
title.Data(),
fTracks->GetName()));
451 Double_t contents[20]={0};
455 if (
title==
"Centrality %")
457 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
458 contents[i] = partPt;
459 else if (
title==
"#eta")
460 contents[i] = partEta;
461 else if (
title==
"#phi")
462 contents[i] = partPhi;
463 else if (
title==
"MC Generator")
465 else if (
title==
"Findable")
466 contents[i] = findable;
476 Double_t trackEta, Double_t trackPhi, Double_t trackPt, Byte_t trackType)
478 Double_t contents[20]={0};
482 if (
title==
"Centrality %")
484 else if (
title==
"#it{p}_{T}^{gen} (GeV/#it{c})")
485 contents[i] = partPt;
486 else if (
title==
"#eta^{gen}")
487 contents[i] = partEta;
488 else if (
title==
"#phi^{gen}")
489 contents[i] = partPhi;
490 else if (
title==
"#it{p}_{T}^{det} (GeV/#it{c})")
491 contents[i] = trackPt;
492 else if (
title==
"#eta^{det}")
493 contents[i] = trackEta;
494 else if (
title==
"#phi^{det}")
495 contents[i] = trackPhi;
496 else if (
title==
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}")
497 contents[i] = (partPt - trackPt) / partPt;
498 else if (
title==
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}")
499 contents[i] = (partPt - trackPt) / trackPt;
500 else if (
title==
"track type")
501 contents[i] = (Double_t)trackType;
503 AliWarning(Form(
"Unable to fill dimension %s of histogram %s!",
title.Data(),
fParticlesMatched->GetName()));
520 AliESDtrack *esdTrack =
dynamic_cast<AliESDtrack*
>(track->
GetTrack());
521 if (esdTrack) sigma = TMath::Sqrt(esdTrack->GetSigma1Pt2());
524 Int_t label = TMath::Abs(track->
GetLabel());
535 Int_t
pdg = TMath::Abs(part->PdgCode());
537 if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) {
557 if (
fSelectHIJING && part->GetGeneratorIndex() == 0) mcGen = 0;
559 Int_t
pdg = TMath::Abs(part->PdgCode());
561 if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) findable = 1;
Double_t * fPtRelDiffHistBins
number of pt relative difference bins
void SetGeneratorLevelName(const char *name)
void SetParticlePtCut(Double_t cut)
void AllocateMatchedParticlesTHnSparse()
virtual ~AliEmcalTrackingQATask()
void SetClassName(const char *clname)
void SetDetectorLevelName(const char *name)
void SelectPhysicalPrimaries(Bool_t s)
Int_t fNPtResHistBins
pt relative difference bins
Int_t fNCentHistBins
phi bins
void SetArrayName(const char *n)
TList * fOutput
x-section from pythia header
Int_t fNPtHistBins
detector level container
AliVParticle * GetAcceptParticleWithLabel(Int_t lab)
ClassImp(AliEmcalTrackingQATask) AliEmcalTrackingQATask
Double_t * fCentHistBins
number of cent bins
TObjArray fParticleCollArray
Double_t * fPtResHistBins
number of pt res bins
Double_t * fEtaHistBins
number of eta bins
Int_t fNEtaHistBins
pt bins
void FillMatchedParticlesTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Double_t trackEta, Double_t trackPhi, Double_t trackPt, Byte_t trackType)
void FillDetectorLevelTHnSparse(Double_t cent, Double_t trackEta, Double_t trackPhi, Double_t trackPt, Double_t sigma1OverPt, Int_t mcGen, Byte_t trackType)
Int_t fNPhiHistBins
eta bins
Int_t GetCurrentID() const
void AllocateDetectorLevelTHnSparse()
AliParticleContainer * AddParticleContainer(const char *n)
Double_t fCent
trigger patch info array
AliVParticle * GetNextAcceptParticle(Int_t i=-1)
Byte_t GetTrackType() const
Double_t * f1OverPtResHistBins
pt res bins
THnSparse * fTracks
integer bins
AliVTrack * GetTrack() const
Bool_t fDoSigmaPtOverPtGen
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
void FillGeneratorLevelTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Int_t mcGen, Byte_t findable)
Int_t fNIntegerHistBins
number of 1/pt res bins
Double_t * fPtHistBins
number of pt bins
Bool_t fIsEsd
vertex selection (optional)
Double_t * fIntegerHistBins
number of integer bins
Int_t fNPtRelDiffHistBins
cent bins
void SetMakeGeneralHistograms(Bool_t g)
AliParticleContainer * fDetectorLevel
generator level container
void UserCreateOutputObjects()
Double_t * fPhiHistBins
number of phi bins
AliParticleContainer * fGeneratorLevel
Short_t GetGeneratorIndex() const
THnSparse * fParticlesPhysPrim
all tracks
void AllocateGeneratorLevelTHnSparse()
void UserCreateOutputObjects()
Int_t fN1OverPtResHistBins
1/pt res bins
THnSparse * fParticlesMatched
all physical primary particles