11 #include "AliESDtrack.h"
12 #include "AliAODTrack.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";
219 title[dim] =
"#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}";
225 title[dim] =
"#sigma(#it{p}_{T}) / #it{p}_{T}";
231 fTracks =
new THnSparseF(
"fTracks",
"fTracks",dim,nbins);
232 for (
Int_t i = 0; i < dim; i++) {
233 fTracks->GetAxis(i)->SetTitle(title[i]);
234 fTracks->SetBinEdges(i, binEdges[i]);
249 title[dim] =
"Centrality %";
255 title[dim] =
"#it{p}_{T} (GeV/#it{c})";
270 title[dim] =
"MC Generator";
275 title[dim] =
"Findable";
280 fParticlesPhysPrim =
new THnSparseF(
"fParticlesPhysPrim",
"fParticlesPhysPrim",dim,nbins);
281 for (
Int_t i = 0; i < dim; i++) {
298 title[dim] =
"Centrality %";
304 title[dim] =
"#it{p}_{T}^{gen} (GeV/#it{c})";
309 title[dim] =
"#eta^{gen}";
314 title[dim] =
"#phi^{gen}";
319 title[dim] =
"#it{p}_{T}^{det} (GeV/#it{c})";
324 title[dim] =
"#eta^{det}";
329 title[dim] =
"#phi^{det}";
335 title[dim] =
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}";
341 title[dim] =
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}";
347 title[dim] =
"track type";
352 fParticlesMatched =
new THnSparseF(
"fParticlesMatched",
"fParticlesMatched",dim,nbins);
353 for (
Int_t i = 0; i < dim; i++) {
365 AliError(
"Please, first set the detector level array!");
413 if (
title==
"Centrality %")
415 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
416 contents[i] = trackPt;
417 else if (
title==
"#eta")
418 contents[i] = trackEta;
419 else if (
title==
"#phi")
420 contents[i] = trackPhi;
421 else if (
title==
"#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}")
422 contents[i] = sigma1OverPt;
423 else if (
title==
"#sigma(#it{p}_{T}) / #it{p}_{T}")
424 contents[i] = sigma1OverPt*trackPt;
425 else if (
title==
"MC Generator")
427 else if (
title==
"track type")
428 contents[i] = trackType;
430 AliWarning(Form(
"Unable to fill dimension %s of histogram %s!",
title.Data(),
fTracks->GetName()));
443 if (
title==
"Centrality %")
445 else if (
title==
"#it{p}_{T} (GeV/#it{c})")
446 contents[i] = partPt;
447 else if (
title==
"#eta")
448 contents[i] = partEta;
449 else if (
title==
"#phi")
450 contents[i] = partPhi;
451 else if (
title==
"MC Generator")
453 else if (
title==
"Findable")
454 contents[i] = findable;
470 if (
title==
"Centrality %")
472 else if (
title==
"#it{p}_{T}^{gen} (GeV/#it{c})")
473 contents[i] = partPt;
474 else if (
title==
"#eta^{gen}")
475 contents[i] = partEta;
476 else if (
title==
"#phi^{gen}")
477 contents[i] = partPhi;
478 else if (
title==
"#it{p}_{T}^{det} (GeV/#it{c})")
479 contents[i] = trackPt;
480 else if (
title==
"#eta^{det}")
481 contents[i] = trackEta;
482 else if (
title==
"#phi^{det}")
483 contents[i] = trackPhi;
484 else if (
title==
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}")
485 contents[i] = (partPt - trackPt) / partPt;
486 else if (
title==
"(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}")
487 contents[i] = (partPt - trackPt) / trackPt;
488 else if (
title==
"track type")
491 AliWarning(Form(
"Unable to fill dimension %s of histogram %s!",
title.Data(),
fParticlesMatched->GetName()));
505 track = trackIterator.second;
512 AliESDtrack *esdTrack =
dynamic_cast<AliESDtrack*
>(track);
513 if (esdTrack) sigma = TMath::Sqrt(esdTrack->GetSigma1Pt2());
517 AliAODTrack *aodtrack =
dynamic_cast<AliAODTrack*
>(track);
518 if(!aodtrack) AliFatal(
"Not a standard AOD");
520 AliExternalTrackParam exParam;
524 aodtrack->GetCovMatrix(cov);
526 aodtrack->PxPyPz(pxpypz);
528 aodtrack->GetXYZ(xyz);
529 Short_t sign = aodtrack->Charge();
530 exParam.Set(xyz,pxpypz,cov,sign);
532 sigma = TMath::Sqrt(exParam.GetSigma1Pt2());
536 Int_t label = TMath::Abs(track->GetLabel());
539 if (label==0 || track->GetGeneratorIndex() == 0) mcGen = 0;
546 if (part->GetGeneratorIndex() == 0) {
547 Int_t pdg = TMath::Abs(part->PdgCode());
549 if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) {
557 AliError(Form(
"Track %d has type %d not recognized!",
fDetectorLevel->GetCurrentID(), type));
563 AliAODMCParticle* part;
565 part = partIterator.second;
570 if (part->GetGeneratorIndex() == 0) mcGen = 0;
572 Int_t pdg = TMath::Abs(part->PdgCode());
574 if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) findable = 1;
Double_t * fPtRelDiffHistBins
number of pt relative difference bins
Bool_t FillHistograms()
Function filling histograms.
void SetGeneratorLevelName(const char *name)
void SetParticlePtCut(Double_t cut)
AliTrackContainer * fDetectorLevel
generator level container
void AllocateMatchedParticlesTHnSparse()
const AliMCParticleIterableMomentumContainer accepted_momentum() const
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
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 ExecOnce()
Perform steps needed to initialize the analysis.
void AllocateDetectorLevelTHnSparse()
virtual AliAODMCParticle * GetAcceptMCParticleWithLabel(Int_t lab)
BeamType fForceBeamType
forced beam type
Double_t fCent
!event centrality
Double_t * f1OverPtResHistBins
pt res bins
THnSparse * fTracks
integer bins
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
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)
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)
Create new track container and attach it to the task.
Double_t * fIntegerHistBins
number of integer bins
void SelectPhysicalPrimaries(Bool_t s)
Int_t fNPtRelDiffHistBins
cent bins
void SetMakeGeneralHistograms(Bool_t g)
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
const AliTrackIterableMomentumContainer accepted_momentum() const
void UserCreateOutputObjects()
Main initialization function on the worker.
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