12 #include "AliESDtrack.h"
13 #include "AliAODMCParticle.h"
24 fDoSigma1OverPt(kFALSE),
25 fDoSigmaPtOverPtGen(kFALSE),
36 fNPtRelDiffHistBins(0),
37 fPtRelDiffHistBins(0),
40 f1OverPtResHistBins(0),
41 fN1OverPtResHistBins(0),
45 fParticlesPhysPrim(0),
50 SetMakeGeneralHistograms(kTRUE);
58 fDoSigma1OverPt(kFALSE),
59 fDoSigmaPtOverPtGen(kFALSE),
70 fNPtRelDiffHistBins(0),
71 fPtRelDiffHistBins(0),
74 f1OverPtResHistBins(0),
75 fN1OverPtResHistBins(0),
79 fParticlesPhysPrim(0),
159 AliFatal(
"This task needs at least one particle container!");
187 title[dim] =
"Centrality %";
193 title[dim] =
"#it{p}_{T} (GeV/#it{c})";
208 title[dim] =
"MC Generator";
213 title[dim] =
"track type";
220 title[dim] =
"#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}";
226 title[dim] =
"#sigma(#it{p}_{T}) / #it{p}_{T}";
233 fTracks =
new THnSparseF(
"fTracks",
"fTracks",dim,nbins);
234 for (
Int_t i = 0; i < dim; i++) {
235 fTracks->GetAxis(i)->SetTitle(title[i]);
236 fTracks->SetBinEdges(i, binEdges[i]);
251 title[dim] =
"Centrality %";
257 title[dim] =
"#it{p}_{T} (GeV/#it{c})";
272 title[dim] =
"MC Generator";
277 title[dim] =
"Findable";
282 fParticlesPhysPrim =
new THnSparseF(
"fParticlesPhysPrim",
"fParticlesPhysPrim",dim,nbins);
283 for (
Int_t i = 0; i < dim; i++) {
300 title[dim] =
"Centrality %";
306 title[dim] =
"#it{p}_{T}^{gen} (GeV/#it{c})";
311 title[dim] =
"#eta^{gen}";
316 title[dim] =
"#phi^{gen}";
321 title[dim] =
"#it{p}_{T}^{det} (GeV/#it{c})";
326 title[dim] =
"#eta^{det}";
331 title[dim] =
"#phi^{det}";
337 title[dim] =
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}";
343 title[dim] =
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}";
349 title[dim] =
"track type";
354 fParticlesMatched =
new THnSparseF(
"fParticlesMatched",
"fParticlesMatched",dim,nbins);
355 for (
Int_t i = 0; i < dim; i++) {
367 AliError(
"Please, first set the detector level array!");
415 if (
title==
"Centrality %")
417 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
418 contents[i] = trackPt;
419 else if (
title==
"#eta")
420 contents[i] = trackEta;
421 else if (
title==
"#phi")
422 contents[i] = trackPhi;
423 else if (
title==
"#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}")
424 contents[i] = sigma1OverPt;
425 else if (
title==
"#sigma(#it{p}_{T}) / #it{p}_{T}")
426 contents[i] = sigma1OverPt*trackPt;
427 else if (
title==
"MC Generator")
429 else if (
title==
"track type")
430 contents[i] = trackType;
432 AliWarning(Form(
"Unable to fill dimension %s of histogram %s!",
title.Data(),
fTracks->GetName()));
445 if (
title==
"Centrality %")
447 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
448 contents[i] = partPt;
449 else if (
title==
"#eta")
450 contents[i] = partEta;
451 else if (
title==
"#phi")
452 contents[i] = partPhi;
453 else if (
title==
"MC Generator")
455 else if (
title==
"Findable")
456 contents[i] = findable;
472 if (
title==
"Centrality %")
474 else if (
title==
"#it{p}_{T}^{gen} (GeV/#it{c})")
475 contents[i] = partPt;
476 else if (
title==
"#eta^{gen}")
477 contents[i] = partEta;
478 else if (
title==
"#phi^{gen}")
479 contents[i] = partPhi;
480 else if (
title==
"#it{p}_{T}^{det} (GeV/#it{c})")
481 contents[i] = trackPt;
482 else if (
title==
"#eta^{det}")
483 contents[i] = trackEta;
484 else if (
title==
"#phi^{det}")
485 contents[i] = trackPhi;
486 else if (
title==
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}")
487 contents[i] = (partPt - trackPt) / partPt;
488 else if (
title==
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}")
489 contents[i] = (partPt - trackPt) / trackPt;
490 else if (
title==
"track type")
493 AliWarning(Form(
"Unable to fill dimension %s of histogram %s!",
title.Data(),
fParticlesMatched->GetName()));
511 AliESDtrack *esdTrack =
dynamic_cast<AliESDtrack*
>(track);
512 if (esdTrack) sigma = TMath::Sqrt(esdTrack->GetSigma1Pt2());
515 Int_t label = TMath::Abs(track->GetLabel());
518 if (label==0 || track->GetGeneratorIndex() == 0) mcGen = 0;
525 if (part->GetGeneratorIndex() == 0) {
526 Int_t pdg = TMath::Abs(part->PdgCode());
528 if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) {
536 AliError(Form(
"Track %d has type %d not recognized!",
fDetectorLevel->GetCurrentID(), type));
549 if (part->GetGeneratorIndex() == 0) mcGen = 0;
551 Int_t pdg = TMath::Abs(part->PdgCode());
553 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)
AliTrackContainer * fDetectorLevel
generator level container
void AllocateMatchedParticlesTHnSparse()
virtual ~AliEmcalTrackingQATask()
Base task in the EMCAL framework.
Container with name, TClonesArray and cuts for particles.
void SetDetectorLevelName(const char *name)
Int_t fNPtResHistBins
pt relative difference bins
Int_t fNCentHistBins
phi bins
Int_t fNPtHistBins
detector level container
ClassImp(AliEmcalTrackingQATask) AliEmcalTrackingQATask
Double_t * fCentHistBins
number of cent bins
TObjArray fParticleCollArray
particle/track collection array
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
void AllocateDetectorLevelTHnSparse()
virtual AliAODMCParticle * GetAcceptMCParticleWithLabel(Int_t lab)
BeamType fForceBeamType
forced beam type
virtual AliAODMCParticle * GetNextAcceptMCParticle()
Double_t fCent
!event centrality
Double_t * f1OverPtResHistBins
pt res bins
THnSparse * fTracks
integer bins
AliMCParticleContainer * AddMCParticleContainer(const char *n)
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)
virtual AliVTrack * GetNextAcceptTrack()
AliEmcalList * fOutput
!output list
Int_t fNIntegerHistBins
number of 1/pt res bins
AliMCParticleContainer * fGeneratorLevel
Char_t GetTrackType(const AliVTrack *track) const
Double_t * fPtHistBins
number of pt bins
Bool_t fIsEsd
!whether it's an ESD analysis
AliTrackContainer * AddTrackContainer(const char *n)
Double_t * fIntegerHistBins
number of integer bins
void SelectPhysicalPrimaries(Bool_t s)
Int_t fNPtRelDiffHistBins
cent bins
void SetMakeGeneralHistograms(Bool_t g)
void UserCreateOutputObjects()
Double_t * fPhiHistBins
number of phi bins
THnSparse * fParticlesPhysPrim
all tracks
Container for MC-true particles within the EMCAL framework.
void AllocateGeneratorLevelTHnSparse()
void UserCreateOutputObjects()
Int_t fN1OverPtResHistBins
1/pt res bins
THnSparse * fParticlesMatched
all physical primary particles