1 #ifndef ALIANLYSISTASKGAMMACALO_cxx
2 #define ALIANLYSISTASKGAMMACALO_cxx
4 #include "AliAnalysisTaskSE.h"
5 #include "AliESDtrack.h"
6 #include "AliV0ReaderV1.h"
7 #include "AliKFConversionPhoton.h"
8 #include "AliGammaConversionAODBGHandler.h"
9 #include "AliConversionAODBGHandlerRP.h"
10 #include "AliCaloPhotonCuts.h"
11 #include "AliConvEventCuts.h"
12 #include "AliConversionPhotonCuts.h"
13 #include "AliConversionMesonCuts.h"
14 #include "AliAnalysisManager.h"
15 #include "TProfile2D.h"
19 class AliAnalysisTaskGammaCalo : public AliAnalysisTaskSE {
22 AliAnalysisTaskGammaCalo();
23 AliAnalysisTaskGammaCalo(const char *name);
24 virtual ~AliAnalysisTaskGammaCalo();
26 virtual void UserCreateOutputObjects();
27 virtual Bool_t Notify();
28 virtual void UserExec(Option_t *);
29 virtual void Terminate(const Option_t*);
32 void SetIsHeavyIon(Int_t flag){
36 // base functions for selecting photon and meson candidates in reconstructed data
37 void ProcessClusters();
38 void CalculatePi0Candidates();
41 void SetIsMC(Bool_t isMC){fIsMC=isMC;}
42 void ProcessMCParticles();
43 void ProcessAODMCParticles();
44 void ProcessTrueClusterCandidates( AliAODConversionPhoton* TruePhotonCandidate);
45 void ProcessTrueClusterCandidatesAOD( AliAODConversionPhoton* TruePhotonCandidate);
46 void ProcessTrueMesonCandidates( AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1);
47 void ProcessTrueMesonCandidatesAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1);
49 // switches for additional analysis streams or outputs
50 void SetDoMesonAnalysis(Bool_t flag){fDoMesonAnalysis = flag;}
51 void SetDoMesonQA(Int_t flag){fDoMesonQA = flag;}
52 void SetDoClusterQA(Int_t flag){fDoClusterQA = flag;}
54 // Setting the cut lists for the conversion photons
55 void SetEventCutList(Int_t nCuts, TList *CutArray){
57 fEventCutArray = CutArray;
60 // Setting the cut lists for the calo photons
61 void SetCaloCutList(Int_t nCuts, TList *CutArray){
63 fClusterCutArray = CutArray;
66 // Setting the cut lists for the meson
67 void SetMesonCutList(Int_t nCuts, TList *CutArray){
69 fMesonCutArray = CutArray;
73 void CalculateBackground();
74 void CalculateBackgroundRP();
75 void RotateParticle(AliAODConversionPhoton *gamma);
76 void RotateParticleAccordingToEP(AliAODConversionPhoton *gamma, Double_t previousEventEP, Double_t thisEventEP);
77 void FillPhotonBackgroundHist(AliAODConversionPhoton *TruePhotonCandidate, Int_t pdgCode);
78 void FillPhotonPlusConversionBackgroundHist(AliAODConversionPhoton *TruePhotonCandidate, Int_t pdgCode);
79 void UpdateEventByEventData();
81 // Additional functions for convenience
82 void SetLogBinningXTH2(TH2* histoRebin);
83 Int_t GetSourceClassification(Int_t daughter, Int_t pdgCode);
86 AliV0ReaderV1 *fV0Reader; // basic photon Selection Task
87 AliGammaConversionAODBGHandler **fBGHandler; // BG handler for Conversion
88 AliVEvent *fInputEvent; // current event
89 AliMCEvent *fMCEvent; // corresponding MC event
90 AliStack *fMCStack; // stack belonging to MC event
91 TList **fCutFolder; // Array of lists for containers belonging to cut
92 TList **fESDList; // Array of lists with histograms with reconstructed properties
93 TList **fBackList; // Array of lists with BG THnSparseF
94 TList **fMotherList; // Array of lists with Signal THnSparseF
95 TList **fTrueList; // Array of lists with histograms with MC validated reconstructed properties
96 TList **fMCList; // Array of lists with histograms with pure MC information
97 TList **fHeaderNameList; // Array of lists with header names for MC header selection
98 TList *fOutputContainer; // Output container
99 TList *fClusterCandidates; //! current list of cluster candidates
100 TList *fEventCutArray; // List with Event Cuts
101 AliConvEventCuts *fEventCuts; // EventCutObject
102 TList *fClusterCutArray; // List with Cluster Cuts
103 AliCaloPhotonCuts *fCaloPhotonCuts; // CaloPhotonCutObject
104 TList *fMesonCutArray; // List with Meson Cuts
105 AliConversionMesonCuts *fMesonCuts; // MesonCutObject
107 //histograms for mesons reconstructed quantities
108 TH2F **fHistoMotherInvMassPt; //! array of histogram with signal + BG for same event photon pairs, inv Mass, pt
109 TH2F **fHistoMotherInvMass3ClusterPt; //! array of histogram with signal + BG for same event 3 cluster pairs, inv Mass, pt
110 THnSparseF **fSparseMotherInvMassPtZM; //! array of THnSparseF with signal + BG for same event photon pairs, inv Mass, pt
111 TH2F **fHistoMotherBackInvMassPt; //! array of histogram with BG for mixed event photon pairs, inv Mass, pt
112 THnSparseF **fSparseMotherBackInvMassPtZM; //! array of THnSparseF with BG for same event photon pairs, inv Mass, pt
113 TH2F **fHistoMotherInvMassEalpha; //! array of histograms with alpha cut of 0.1 for inv mass vs pt
114 TH2F **fHistoMotherPi0PtY; //! array of histograms with invariant mass cut of 0.05 && pi0cand->M() < 0.17, pt, Y
115 TH2F **fHistoMotherEtaPtY; //! array of histograms with invariant mass cut of 0.45 && pi0cand->M() < 0.65, pt, Y
116 TH2F **fHistoMotherPi0PtAlpha; //! array of histograms with invariant mass cut of 0.05 && pi0cand->M() < 0.17, pt, alpha
117 TH2F **fHistoMotherEtaPtAlpha; //! array of histograms with invariant mass cut of 0.45 && pi0cand->M() < 0.65, pt, alpha
118 TH2F **fHistoMotherPi0PtOpenAngle; //! array of histograms with invariant mass cut of 0.05 && pi0cand->M() < 0.17, pt, openAngle
119 TH2F **fHistoMotherEtaPtOpenAngle; //! array of histograms with invariant mass cut of 0.45 && pi0cand->M() < 0.65, pt, openAngle
120 TH2F **fHistoMotherInvMassECalib; //! array of histogram with signal + BG for same event photon pairs, inv Mass, energy of cluster
121 TH2F **fHistoMotherInvMassECalibalpha; //! array of histogram with signal + BG for same event photon pairs, inv Mass, energy of cluster, alpha cut 0.1
123 // histograms for rec photon clusters
124 TH1F ** fHistoClusGammaPt; //! array of histos with cluster, pt
126 //histograms for pure MC quantities
127 TH1I **fHistoMCHeaders; //! array of histos for header names
128 TH1F **fHistoMCAllGammaPt; //! array of histos with all gamma, pT
129 TH1F **fHistoMCDecayGammaPi0Pt; //! array of histos with decay gamma from pi0, pT
130 TH1F **fHistoMCDecayGammaRhoPt; //! array of histos with decay gamma from rho, pT
131 TH1F **fHistoMCDecayGammaEtaPt; //! array of histos with decay gamma from eta, pT
132 TH1F **fHistoMCDecayGammaOmegaPt; //! array of histos with decay gamma from omega, pT
133 TH1F **fHistoMCDecayGammaEtapPt; //! array of histos with decay gamma from eta', pT
134 TH1F **fHistoMCDecayGammaPhiPt; //! array of histos with decay gamma from phi, pT
135 TH1F **fHistoMCDecayGammaSigmaPt; //! array of histos with decay gamma from Sigma0, pT
136 TH1F **fHistoMCPi0Pt; //! array of histos with weighted pi0, pT
137 TH1F **fHistoMCPi0WOWeightPt; //! array of histos with unweighted pi0, pT
138 TH1F **fHistoMCEtaPt; //! array of histos with weighted eta, pT
139 TH1F **fHistoMCEtaWOWeightPt; //! array of histos with unweighted eta, pT
140 TH1F **fHistoMCPi0InAccPt; //! array of histos with weighted pi0 in acceptance, pT
141 TH1F **fHistoMCEtaInAccPt; //! array of histos with weighted eta in acceptance, pT
142 TH2F **fHistoMCPi0PtY; //! array of histos with weighted pi0, pT, Y
143 TH2F **fHistoMCEtaPtY; //! array of histos with weighted eta, pT, Y
144 TH1F **fHistoMCK0sPt; //! array of histos with weighted K0s, pT
145 TH1F **fHistoMCK0sWOWeightPt; //! array of histos with unweighted K0s, pT
146 TH2F **fHistoMCK0sPtY; //! array of histos with weighted K0s, pT, Y
147 TH2F **fHistoMCSecPi0PtvsSource; //! array of histos with secondary pi0, pT, source
148 TH1F **fHistoMCSecPi0Source; //! array of histos with secondary pi0, source
149 TH1F **fHistoMCSecEtaPt; //! array of histos with secondary eta, pT
150 TH1F **fHistoMCSecEtaSource; //! array of histos with secondary eta, source
151 // MC validated reconstructed quantities mesons
152 TH2F **fHistoTrueMotherInvMassPt; //! array of histos with validated mothers, invMass, pt
153 TH2F **fHistoTrueMotherCaloPhotonInvMassPt; //! array of histos with validated mothers, photon leading, invMass, pt
154 TH2F **fHistoTrueMotherCaloConvertedPhotonInvMassPt; //! array of histos with validated mothers, converted photon leading, invMass, pt
155 TH2F **fHistoTrueMotherCaloMixedPhotonConvPhotonInvMassPt; //! array of histos with validated mothers, converted photon leading, invMass, pt
156 TH2F **fHistoTruePi0CaloConvertedPhotonInvMassPt; //! array of histos with validated pi0, converted photon leading, invMass, pt
157 TH2F **fHistoTrueEtaCaloConvertedPhotonInvMassPt; //! array of histos with validated eta, converted photon leading, invMass, pt
158 TH2F **fHistoTrueMotherCaloElectronInvMassPt; //! array of histos with validated mothers, electron leading, invMass, pt
159 TH2F **fHistoTrueMotherCaloMergedClusterInvMassPt; //! array of histos with validated mothers, merged cluster invMass, pt
160 TH2F **fHistoTrueMotherCaloMergedClusterPartConvInvMassPt; //! array of histos with validated mothers, merged cluster part conv, invMass, pt
161 TH2F **fHistoTruePrimaryMotherInvMassPt; //! array of histos with validated weighted primary mothers, invMass, pt
162 TH2F **fHistoTruePrimaryMotherW0WeightingInvMassPt; //! array of histos with validated unweighted primary mothers, invMass, pt
163 TProfile2D **fProfileTruePrimaryMotherWeightsInvMassPt; //! array of profiles with weights for validated primary mothers, invMass, pt
164 TH2F **fHistoTruePrimaryPi0MCPtResolPt; //! array of histos with validated weighted primary pi0, MCpt, resol pt
165 TH2F **fHistoTruePrimaryEtaMCPtResolPt; //! array of histos with validated weighted primary eta, MCpt, resol pt
166 TH2F **fHistoTrueSecondaryMotherInvMassPt; //! array of histos with validated secondary mothers, invMass, pt
167 TH2F **fHistoTrueSecondaryMotherFromK0sInvMassPt; //! array of histos with validated secondary mothers from K0s, invMass, pt
168 TH1F **fHistoTrueK0sWithPi0DaughterMCPt; //! array of histos with K0s with reconstructed pi0 as daughter, pt
169 TH2F **fHistoTrueSecondaryMotherFromEtaInvMassPt; //! array of histos with validated secondary mothers from eta, invMass, pt
170 TH1F **fHistoTrueEtaWithPi0DaughterMCPt; //! array of histos with eta with reconstructed pi0 as daughter, pt
171 TH2F **fHistoTrueSecondaryMotherFromLambdaInvMassPt; //! array of histos with validated secondary mothers from Lambda, invMass, pt
172 TH1F **fHistoTrueLambdaWithPi0DaughterMCPt; //! array of histos with lambda with reconstructed pi0 as daughter, pt
173 TH2F **fHistoTrueBckGGInvMassPt; //! array of histos with pure gamma gamma combinatorial BG, invMass, pt
174 TH2F **fHistoTrueBckContInvMassPt; //! array of histos with contamination BG, invMass, pt
175 TH2F **fHistoTruePi0PtY; //! array of histos with validated pi0, pt, Y
176 TH2F **fHistoTrueEtaPtY; //! array of histos with validated eta, pt, Y
177 TH2F **fHistoTruePi0PtAlpha; //! array of histos with validated pi0, pt, alpha
178 TH2F **fHistoTrueEtaPtAlpha; //! array of histos with validated eta, pt, alpha
179 TH2F **fHistoTruePi0PtOpenAngle; //! array of histos with validated pi0, pt, openAngle
180 TH2F **fHistoTrueEtaPtOpenAngle; //! array of histos with validated eta, pt, openAngle
181 // MC validated reconstructed quantities photons
182 TH2F **fHistoClusPhotonBGPt; //! array of histos with cluster photon BG, pt, source
183 TH2F **fHistoClusPhotonPlusConvBGPt; //! array of histos with cluster photon plus conv BG, pt, source
184 TH1F **fHistoTrueClusGammaPt; //! array of histos with validated cluster (electron or photon), pt
185 TH1F **fHistoTrueClusUnConvGammaPt; //! array of histos with validated unconverted photon, pt
186 TH1F **fHistoTrueClusUnConvGammaMCPt; //! array of histos with validated unconverted photon, pt
187 TH1F **fHistoTrueClusElectronPt; //! array of histos with validated electron, pt
188 TH1F **fHistoTrueClusConvGammaPt; //! array of histos with validated converted photon, pt
189 TH1F **fHistoTrueClusConvGammaMCPt; //! array of histos with validated converted photon, pt
190 TH1F **fHistoTrueClusConvGammaFullyPt; //! array of histos with validated converted photon, fully contained, pt
191 TH1F **fHistoTrueClusMergedGammaPt; //! array of histos with validated merged photons, electrons, dalitz, pt
192 TH1F **fHistoTrueClusMergedPartConvGammaPt; //! array of histos with validated merged partially converted photons, pt
193 TH1F **fHistoTrueClusDalitzPt; //! array of histos with validated Dalitz decay, pt
194 TH1F **fHistoTrueClusDalitzMergedPt; //! array of histos with validated Dalitz decay, more than one decay product in cluster, pt
195 TH1F **fHistoTrueClusPhotonFromElecMotherPt; //! array of histos with validated photon from electron, pt
196 TH1F **fHistoTrueClusShowerPt; //! array of histos with validated shower, pt
197 TH1F **fHistoTrueClusSubLeadingPt; //! array of histos with pi0/eta/eta_prime in subleading contribution
198 TH1I **fHistoTrueClusNParticles; //! array of histos with number of different particles (pi0/eta/eta_prime) contributing to cluster
199 TH1F **fHistoTrueClusEMNonLeadingPt; //! array of histos with cluster with largest energy by hadron
200 TH1F **fHistoTrueNLabelsInClus; //! array of histos with number of labels in cluster
201 TH1F **fHistoTruePrimaryClusGammaPt; //! array of histos with validated primary photon cluster, pt
202 TH2F **fHistoTruePrimaryClusGammaESDPtMCPt; //! array of histos with validated primary photon cluster, rec Pt, MC pt
203 TH1F **fHistoTruePrimaryClusConvGammaPt; //! array of histos with validated primary conv photon cluster, pt
204 TH2F **fHistoTruePrimaryClusConvGammaESDPtMCPt; //! array of histos with validated primary conv photon cluster, rec Pt, MC pt
205 TH1F **fHistoTrueSecondaryClusGammaPt; //! array of histos with validated secondary cluster photon, pt
206 TH1F **fHistoTrueSecondaryClusConvGammaPt; //! array of histos with validated secondary cluster photon, pt
207 TH1F **fHistoTrueSecondaryClusGammaFromXFromK0sPt; //! array of histos with validated secondary cluster photon from K0s, pt
208 TH1F **fHistoTrueSecondaryClusConvGammaFromXFromK0sPt;//! array of histos with validated secondary cluster conversion photon from K0s, pt
209 TH1F **fHistoTrueSecondaryClusGammaFromXFromLambdaPt;//! array of histos with validated secondary cluster photon from Lambda, pt
210 TH1F **fHistoTrueSecondaryClusConvGammaFromXFromLambdaPt;//! array of histos with validated secondary cluster conversion photon from Lambda, pt
211 TH1F **fHistoTrueSecondaryClusGammaFromXFromEtasPt; //! array of histos with validated secondary Cluster photon from Eta, pt
212 TH1F **fHistoTrueSecondaryClusConvGammaFromXFromEtasPt;//! array of histos with validated secondary cluster conversion photon from Eta, pt
215 TH1I **fHistoNEvents; //! array of histos with event information
216 TH1I **fHistoNGoodESDTracks; //! array of histos with number of good tracks (2010 Standard track cuts)
217 TH1I **fHistoNGammaCandidates; //! array of histos with number of gamma candidates per event
218 TH2F **fHistoNGoodESDTracksVsNGammaCanditates; //! array of histos with number of good tracks vs gamma candidates
219 TH1I **fHistoNV0Tracks; //! array of histos with V0 counts
220 TProfile **fProfileEtaShift; //! array of profiles with eta shift
222 // additional variables
223 Double_t fEventPlaneAngle; // EventPlaneAngle
224 TRandom3 fRandom; // random
225 Int_t fnCuts; // number of cuts to be analysed in parallel
226 Int_t fiCut; // current cut
227 Int_t fIsHeavyIon; // switch for pp = 0, PbPb = 1, pPb = 2
228 Bool_t fDoMesonAnalysis; // flag for meson analysis
229 Int_t fDoMesonQA; // flag for meson QA
230 Int_t fDoClusterQA; // flag for cluster QA
231 Bool_t fIsFromMBHeader; // flag for MC headers
232 Bool_t fIsMC; // flag for MC information
236 AliAnalysisTaskGammaCalo(const AliAnalysisTaskGammaCalo&); // Prevent copy-construction
237 AliAnalysisTaskGammaCalo &operator=(const AliAnalysisTaskGammaCalo&); // Prevent assignment
239 ClassDef(AliAnalysisTaskGammaCalo, 1);