]>
Commit | Line | Data |
---|---|---|
d53bf4ac | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: Baldo Sahlmueller, Friederike Bock * | |
5 | * Version 1.0 * | |
6 | * * | |
7 | * * | |
8 | * Permission to use, copy, modify and distribute this software and its * | |
9 | * documentation strictly for non-commercial purposes is hereby granted * | |
10 | * without fee, provided that the above copyright notice appears in all * | |
11 | * copies and that both the copyright notice and this permission notice * | |
12 | * appear in the supporting documentation. The authors make no claims * | |
13 | * about the suitability of this software for any purpose. It is * | |
14 | * provided "as is" without express or implied warranty. * | |
15 | **************************************************************************/ | |
16 | ||
17 | ////////////////////////////////////////////////////////////////// | |
18 | //---------------------------------------------------------------- | |
19 | // Class used to do analysis on conversion photons + calo photons | |
20 | //---------------------------------------------------------------- | |
21 | ////////////////////////////////////////////////////////////////// | |
22 | #include "TChain.h" | |
23 | #include "TTree.h" | |
24 | #include "TBranch.h" | |
25 | #include "TFile.h" | |
26 | #include "TH1F.h" | |
27 | #include "TH2F.h" | |
28 | #include "TH3F.h" | |
29 | #include "THnSparse.h" | |
30 | #include "TCanvas.h" | |
31 | #include "TNtuple.h" | |
32 | #include "AliAnalysisTask.h" | |
33 | #include "AliAnalysisManager.h" | |
34 | #include "AliESDEvent.h" | |
35 | #include "AliESDInputHandler.h" | |
36 | #include "AliMCEventHandler.h" | |
37 | #include "AliMCEvent.h" | |
38 | #include "AliMCParticle.h" | |
39 | #include "AliCentrality.h" | |
40 | #include "AliESDVZERO.h" | |
41 | #include "AliESDpid.h" | |
42 | #include "AliAnalysisTaskGammaCalo.h" | |
43 | #include "AliVParticle.h" | |
44 | #include "AliESDtrack.h" | |
45 | #include "AliESDtrackCuts.h" | |
46 | #include "AliKFVertex.h" | |
47 | #include "AliV0ReaderV1.h" | |
48 | #include "AliGenCocktailEventHeader.h" | |
49 | #include "AliAODMCParticle.h" | |
50 | #include "AliAODMCHeader.h" | |
51 | #include "AliEventplane.h" | |
52 | #include "AliAnalysisTaskEMCALClusterizeFast.h" | |
53 | #include "AliAODEvent.h" | |
54 | #include "AliAODInputHandler.h" | |
55 | #include "AliESDEvent.h" | |
56 | #include "AliESDInputHandler.h" | |
57 | #include "AliInputEventHandler.h" | |
58 | ||
59 | ClassImp(AliAnalysisTaskGammaCalo) | |
60 | ||
61 | //________________________________________________________________________ | |
62 | AliAnalysisTaskGammaCalo::AliAnalysisTaskGammaCalo(): AliAnalysisTaskSE(), | |
63 | fV0Reader(NULL), | |
64 | fBGHandler(NULL), | |
65 | fInputEvent(NULL), | |
66 | fMCEvent(NULL), | |
67 | fMCStack(NULL), | |
68 | fCutFolder(NULL), | |
69 | fESDList(NULL), | |
70 | fBackList(NULL), | |
71 | fMotherList(NULL), | |
72 | fTrueList(NULL), | |
73 | fMCList(NULL), | |
74 | fHeaderNameList(NULL), | |
75 | fOutputContainer(NULL), | |
76 | fClusterCandidates(NULL), | |
77 | fEventCutArray(NULL), | |
78 | fEventCuts(NULL), | |
79 | fClusterCutArray(NULL), | |
80 | fCaloPhotonCuts(NULL), | |
81 | fMesonCutArray(NULL), | |
82 | fMesonCuts(NULL), | |
83 | fHistoMotherInvMassPt(NULL), | |
8c96b4f9 | 84 | fHistoMotherInvMass3ClusterPt(NULL), |
d53bf4ac | 85 | fSparseMotherInvMassPtZM(NULL), |
86 | fHistoMotherBackInvMassPt(NULL), | |
87 | fSparseMotherBackInvMassPtZM(NULL), | |
88 | fHistoMotherInvMassEalpha(NULL), | |
89 | fHistoMotherPi0PtY(NULL), | |
90 | fHistoMotherEtaPtY(NULL), | |
91 | fHistoMotherPi0PtAlpha(NULL), | |
92 | fHistoMotherEtaPtAlpha(NULL), | |
93 | fHistoMotherPi0PtOpenAngle(NULL), | |
94 | fHistoMotherEtaPtOpenAngle(NULL), | |
95 | fHistoMotherInvMassECalib(NULL), | |
96 | fHistoMotherInvMassECalibalpha(NULL), | |
97 | fHistoClusGammaPt(NULL), | |
98 | fHistoMCHeaders(NULL), | |
99 | fHistoMCAllGammaPt(NULL), | |
100 | fHistoMCDecayGammaPi0Pt(NULL), | |
101 | fHistoMCDecayGammaRhoPt(NULL), | |
102 | fHistoMCDecayGammaEtaPt(NULL), | |
103 | fHistoMCDecayGammaOmegaPt(NULL), | |
104 | fHistoMCDecayGammaEtapPt(NULL), | |
105 | fHistoMCDecayGammaPhiPt(NULL), | |
106 | fHistoMCDecayGammaSigmaPt(NULL), | |
107 | fHistoMCPi0Pt(NULL), | |
108 | fHistoMCPi0WOWeightPt(NULL), | |
109 | fHistoMCEtaPt(NULL), | |
110 | fHistoMCEtaWOWeightPt(NULL), | |
111 | fHistoMCPi0InAccPt(NULL), | |
112 | fHistoMCEtaInAccPt(NULL), | |
113 | fHistoMCPi0PtY(NULL), | |
114 | fHistoMCEtaPtY(NULL), | |
115 | fHistoMCK0sPt(NULL), | |
116 | fHistoMCK0sWOWeightPt(NULL), | |
117 | fHistoMCK0sPtY(NULL), | |
118 | fHistoMCSecPi0PtvsSource(NULL), | |
119 | fHistoMCSecPi0Source(NULL), | |
120 | fHistoMCSecEtaPt(NULL), | |
121 | fHistoMCSecEtaSource(NULL), | |
122 | fHistoTrueMotherInvMassPt(NULL), | |
123 | fHistoTrueMotherCaloPhotonInvMassPt(NULL), | |
124 | fHistoTrueMotherCaloConvertedPhotonInvMassPt(NULL), | |
125 | fHistoTrueMotherCaloMixedPhotonConvPhotonInvMassPt(NULL), | |
126 | fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL), | |
127 | fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL), | |
128 | fHistoTrueMotherCaloElectronInvMassPt(NULL), | |
129 | fHistoTrueMotherCaloMergedClusterInvMassPt(NULL), | |
130 | fHistoTrueMotherCaloMergedClusterPartConvInvMassPt(NULL), | |
131 | fHistoTruePrimaryMotherInvMassPt(NULL), | |
132 | fHistoTruePrimaryMotherW0WeightingInvMassPt(NULL), | |
133 | fProfileTruePrimaryMotherWeightsInvMassPt(NULL), | |
134 | fHistoTruePrimaryPi0MCPtResolPt(NULL), | |
135 | fHistoTruePrimaryEtaMCPtResolPt(NULL), | |
136 | fHistoTrueSecondaryMotherInvMassPt(NULL), | |
137 | fHistoTrueSecondaryMotherFromK0sInvMassPt(NULL), | |
138 | fHistoTrueK0sWithPi0DaughterMCPt(NULL), | |
139 | fHistoTrueSecondaryMotherFromEtaInvMassPt(NULL), | |
140 | fHistoTrueEtaWithPi0DaughterMCPt(NULL), | |
141 | fHistoTrueSecondaryMotherFromLambdaInvMassPt(NULL), | |
142 | fHistoTrueLambdaWithPi0DaughterMCPt(NULL), | |
143 | fHistoTrueBckGGInvMassPt(NULL), | |
144 | fHistoTrueBckContInvMassPt(NULL), | |
145 | fHistoTruePi0PtY(NULL), | |
146 | fHistoTrueEtaPtY(NULL), | |
147 | fHistoTruePi0PtAlpha(NULL), | |
148 | fHistoTrueEtaPtAlpha(NULL), | |
149 | fHistoTruePi0PtOpenAngle(NULL), | |
150 | fHistoTrueEtaPtOpenAngle(NULL), | |
151 | fHistoClusPhotonBGPt(NULL), | |
152 | fHistoClusPhotonPlusConvBGPt(NULL), | |
153 | fHistoTrueClusGammaPt(NULL), | |
154 | fHistoTrueClusUnConvGammaPt(NULL), | |
155 | fHistoTrueClusUnConvGammaMCPt(NULL), | |
156 | fHistoTrueClusElectronPt(NULL), | |
157 | fHistoTrueClusConvGammaPt(NULL), | |
158 | fHistoTrueClusConvGammaMCPt(NULL), | |
159 | fHistoTrueClusConvGammaFullyPt(NULL), | |
160 | fHistoTrueClusMergedGammaPt(NULL), | |
161 | fHistoTrueClusMergedPartConvGammaPt(NULL), | |
162 | fHistoTrueClusDalitzPt(NULL), | |
163 | fHistoTrueClusDalitzMergedPt(NULL), | |
164 | fHistoTrueClusPhotonFromElecMotherPt(NULL), | |
165 | fHistoTrueClusShowerPt(NULL), | |
166 | fHistoTrueClusSubLeadingPt(NULL), | |
167 | fHistoTrueClusNParticles(NULL), | |
168 | fHistoTrueClusEMNonLeadingPt(NULL), | |
169 | fHistoTrueNLabelsInClus(NULL), | |
170 | fHistoTruePrimaryClusGammaPt(NULL), | |
171 | fHistoTruePrimaryClusGammaESDPtMCPt(NULL), | |
172 | fHistoTruePrimaryClusConvGammaPt(NULL), | |
173 | fHistoTruePrimaryClusConvGammaESDPtMCPt(NULL), | |
174 | fHistoTrueSecondaryClusGammaPt(NULL), | |
175 | fHistoTrueSecondaryClusConvGammaPt(NULL), | |
176 | fHistoTrueSecondaryClusGammaFromXFromK0sPt(NULL), | |
177 | fHistoTrueSecondaryClusConvGammaFromXFromK0sPt(NULL), | |
178 | fHistoTrueSecondaryClusGammaFromXFromLambdaPt(NULL), | |
179 | fHistoTrueSecondaryClusConvGammaFromXFromLambdaPt(NULL), | |
180 | fHistoTrueSecondaryClusGammaFromXFromEtasPt(NULL), | |
181 | fHistoTrueSecondaryClusConvGammaFromXFromEtasPt(NULL), | |
182 | fHistoNEvents(NULL), | |
183 | fHistoNGoodESDTracks(NULL), | |
184 | fHistoNGammaCandidates(NULL), | |
185 | fHistoNGoodESDTracksVsNGammaCanditates(NULL), | |
186 | fHistoNV0Tracks(NULL), | |
187 | fProfileEtaShift(NULL), | |
188 | fEventPlaneAngle(-100), | |
189 | fRandom(0), | |
190 | fnCuts(0), | |
191 | fiCut(0), | |
192 | fIsHeavyIon(0), | |
193 | fDoMesonAnalysis(kTRUE), | |
194 | fDoMesonQA(0), | |
195 | fDoClusterQA(0), | |
196 | fIsFromMBHeader(kTRUE), | |
197 | fIsMC(kFALSE) | |
198 | { | |
199 | ||
200 | } | |
201 | ||
202 | //________________________________________________________________________ | |
203 | AliAnalysisTaskGammaCalo::AliAnalysisTaskGammaCalo(const char *name): | |
204 | AliAnalysisTaskSE(name), | |
205 | fV0Reader(NULL), | |
206 | fBGHandler(NULL), | |
207 | fInputEvent(NULL), | |
208 | fMCEvent(NULL), | |
209 | fMCStack(NULL), | |
210 | fCutFolder(NULL), | |
211 | fESDList(NULL), | |
212 | fBackList(NULL), | |
213 | fMotherList(NULL), | |
214 | fTrueList(NULL), | |
215 | fMCList(NULL), | |
216 | fHeaderNameList(NULL), | |
217 | fOutputContainer(0), | |
218 | fClusterCandidates(NULL), | |
219 | fEventCutArray(NULL), | |
220 | fEventCuts(NULL), | |
221 | fClusterCutArray(NULL), | |
222 | fCaloPhotonCuts(NULL), | |
223 | fMesonCutArray(NULL), | |
224 | fMesonCuts(NULL), | |
225 | fHistoMotherInvMassPt(NULL), | |
8c96b4f9 | 226 | fHistoMotherInvMass3ClusterPt(NULL), |
d53bf4ac | 227 | fSparseMotherInvMassPtZM(NULL), |
228 | fHistoMotherBackInvMassPt(NULL), | |
229 | fSparseMotherBackInvMassPtZM(NULL), | |
230 | fHistoMotherInvMassEalpha(NULL), | |
231 | fHistoMotherPi0PtY(NULL), | |
232 | fHistoMotherEtaPtY(NULL), | |
233 | fHistoMotherPi0PtAlpha(NULL), | |
234 | fHistoMotherEtaPtAlpha(NULL), | |
235 | fHistoMotherPi0PtOpenAngle(NULL), | |
236 | fHistoMotherEtaPtOpenAngle(NULL), | |
237 | fHistoMotherInvMassECalib(NULL), | |
238 | fHistoMotherInvMassECalibalpha(NULL), | |
239 | fHistoClusGammaPt(NULL), | |
240 | fHistoMCHeaders(NULL), | |
241 | fHistoMCAllGammaPt(NULL), | |
242 | fHistoMCDecayGammaPi0Pt(NULL), | |
243 | fHistoMCDecayGammaRhoPt(NULL), | |
244 | fHistoMCDecayGammaEtaPt(NULL), | |
245 | fHistoMCDecayGammaOmegaPt(NULL), | |
246 | fHistoMCDecayGammaEtapPt(NULL), | |
247 | fHistoMCDecayGammaPhiPt(NULL), | |
248 | fHistoMCDecayGammaSigmaPt(NULL), | |
249 | fHistoMCPi0Pt(NULL), | |
250 | fHistoMCPi0WOWeightPt(NULL), | |
251 | fHistoMCEtaPt(NULL), | |
252 | fHistoMCEtaWOWeightPt(NULL), | |
253 | fHistoMCPi0InAccPt(NULL), | |
254 | fHistoMCEtaInAccPt(NULL), | |
255 | fHistoMCPi0PtY(NULL), | |
256 | fHistoMCEtaPtY(NULL), | |
257 | fHistoMCK0sPt(NULL), | |
258 | fHistoMCK0sWOWeightPt(NULL), | |
259 | fHistoMCK0sPtY(NULL), | |
260 | fHistoMCSecPi0PtvsSource(NULL), | |
261 | fHistoMCSecPi0Source(NULL), | |
262 | fHistoMCSecEtaPt(NULL), | |
263 | fHistoMCSecEtaSource(NULL), | |
264 | fHistoTrueMotherInvMassPt(NULL), | |
265 | fHistoTrueMotherCaloPhotonInvMassPt(NULL), | |
266 | fHistoTrueMotherCaloConvertedPhotonInvMassPt(NULL), | |
267 | fHistoTrueMotherCaloMixedPhotonConvPhotonInvMassPt(NULL), | |
268 | fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL), | |
269 | fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL), | |
270 | fHistoTrueMotherCaloElectronInvMassPt(NULL), | |
271 | fHistoTrueMotherCaloMergedClusterInvMassPt(NULL), | |
272 | fHistoTrueMotherCaloMergedClusterPartConvInvMassPt(NULL), | |
273 | fHistoTruePrimaryMotherInvMassPt(NULL), | |
274 | fHistoTruePrimaryMotherW0WeightingInvMassPt(NULL), | |
275 | fProfileTruePrimaryMotherWeightsInvMassPt(NULL), | |
276 | fHistoTruePrimaryPi0MCPtResolPt(NULL), | |
277 | fHistoTruePrimaryEtaMCPtResolPt(NULL), | |
278 | fHistoTrueSecondaryMotherInvMassPt(NULL), | |
279 | fHistoTrueSecondaryMotherFromK0sInvMassPt(NULL), | |
280 | fHistoTrueK0sWithPi0DaughterMCPt(NULL), | |
281 | fHistoTrueSecondaryMotherFromEtaInvMassPt(NULL), | |
282 | fHistoTrueEtaWithPi0DaughterMCPt(NULL), | |
283 | fHistoTrueSecondaryMotherFromLambdaInvMassPt(NULL), | |
284 | fHistoTrueLambdaWithPi0DaughterMCPt(NULL), | |
285 | fHistoTrueBckGGInvMassPt(NULL), | |
286 | fHistoTrueBckContInvMassPt(NULL), | |
287 | fHistoTruePi0PtY(NULL), | |
288 | fHistoTrueEtaPtY(NULL), | |
289 | fHistoTruePi0PtAlpha(NULL), | |
290 | fHistoTrueEtaPtAlpha(NULL), | |
291 | fHistoTruePi0PtOpenAngle(NULL), | |
292 | fHistoTrueEtaPtOpenAngle(NULL), | |
293 | fHistoClusPhotonBGPt(NULL), | |
294 | fHistoClusPhotonPlusConvBGPt(NULL), | |
295 | fHistoTrueClusGammaPt(NULL), | |
296 | fHistoTrueClusUnConvGammaPt(NULL), | |
297 | fHistoTrueClusUnConvGammaMCPt(NULL), | |
298 | fHistoTrueClusElectronPt(NULL), | |
299 | fHistoTrueClusConvGammaPt(NULL), | |
300 | fHistoTrueClusConvGammaMCPt(NULL), | |
301 | fHistoTrueClusConvGammaFullyPt(NULL), | |
302 | fHistoTrueClusMergedGammaPt(NULL), | |
303 | fHistoTrueClusMergedPartConvGammaPt(NULL), | |
304 | fHistoTrueClusDalitzPt(NULL), | |
305 | fHistoTrueClusDalitzMergedPt(NULL), | |
306 | fHistoTrueClusPhotonFromElecMotherPt(NULL), | |
307 | fHistoTrueClusShowerPt(NULL), | |
308 | fHistoTrueClusSubLeadingPt(NULL), | |
309 | fHistoTrueClusNParticles(NULL), | |
310 | fHistoTrueClusEMNonLeadingPt(NULL), | |
311 | fHistoTrueNLabelsInClus(NULL), | |
312 | fHistoTruePrimaryClusGammaPt(NULL), | |
313 | fHistoTruePrimaryClusGammaESDPtMCPt(NULL), | |
314 | fHistoTruePrimaryClusConvGammaPt(NULL), | |
315 | fHistoTruePrimaryClusConvGammaESDPtMCPt(NULL), | |
316 | fHistoTrueSecondaryClusGammaPt(NULL), | |
317 | fHistoTrueSecondaryClusConvGammaPt(NULL), | |
318 | fHistoTrueSecondaryClusGammaFromXFromK0sPt(NULL), | |
319 | fHistoTrueSecondaryClusConvGammaFromXFromK0sPt(NULL), | |
320 | fHistoTrueSecondaryClusGammaFromXFromLambdaPt(NULL), | |
321 | fHistoTrueSecondaryClusConvGammaFromXFromLambdaPt(NULL), | |
322 | fHistoTrueSecondaryClusGammaFromXFromEtasPt(NULL), | |
323 | fHistoTrueSecondaryClusConvGammaFromXFromEtasPt(NULL), | |
324 | fHistoNEvents(NULL), | |
325 | fHistoNGoodESDTracks(NULL), | |
326 | fHistoNGammaCandidates(NULL), | |
327 | fHistoNGoodESDTracksVsNGammaCanditates(NULL), | |
328 | fHistoNV0Tracks(NULL), | |
329 | fProfileEtaShift(NULL), | |
330 | fEventPlaneAngle(-100), | |
331 | fRandom(0), | |
332 | fnCuts(0), | |
333 | fiCut(0), | |
334 | fIsHeavyIon(0), | |
335 | fDoMesonAnalysis(kTRUE), | |
336 | fDoMesonQA(0), | |
337 | fDoClusterQA(0), | |
338 | fIsFromMBHeader(kTRUE), | |
339 | fIsMC(kFALSE) | |
340 | { | |
341 | // Define output slots here | |
342 | DefineOutput(1, TList::Class()); | |
343 | } | |
344 | ||
345 | AliAnalysisTaskGammaCalo::~AliAnalysisTaskGammaCalo() | |
346 | { | |
347 | if(fClusterCandidates){ | |
348 | delete fClusterCandidates; | |
349 | fClusterCandidates = 0x0; | |
350 | } | |
351 | if(fBGHandler){ | |
352 | delete[] fBGHandler; | |
353 | fBGHandler = 0x0; | |
354 | } | |
355 | } | |
356 | //___________________________________________________________ | |
357 | void AliAnalysisTaskGammaCalo::InitBack(){ | |
358 | ||
359 | const Int_t nDim = 4; | |
360 | Int_t nBins[nDim] = {800,250,7,4}; | |
361 | Double_t xMin[nDim] = {0,0, 0,0}; | |
362 | Double_t xMax[nDim] = {0.8,25,7,4}; | |
363 | ||
364 | fSparseMotherInvMassPtZM = new THnSparseF*[fnCuts]; | |
365 | fSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts]; | |
366 | ||
367 | fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts]; | |
368 | ||
369 | ||
370 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
371 | if (((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){ | |
372 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); | |
373 | TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber(); | |
374 | TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
375 | ||
376 | Int_t collisionSystem = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(0,1)); | |
377 | Int_t centMin = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(1,1)); | |
378 | Int_t centMax = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(2,1)); | |
379 | ||
380 | if(collisionSystem == 1 || collisionSystem == 2 || | |
381 | collisionSystem == 5 || collisionSystem == 8 || | |
382 | collisionSystem == 9){ | |
383 | centMin = centMin*10; | |
384 | centMax = centMax*10; | |
385 | if(centMax ==0 && centMax!=centMin) centMax=100; | |
386 | } else if(collisionSystem == 3 || collisionSystem == 6){ | |
387 | centMin = centMin*5; | |
388 | centMax = centMax*5; | |
389 | } else if(collisionSystem == 4 || collisionSystem == 7){ | |
390 | centMin = ((centMin*5)+45); | |
391 | centMax = ((centMax*5)+45); | |
392 | } | |
393 | ||
394 | fBackList[iCut] = new TList(); | |
395 | fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringCalo.Data(), cutstringMeson.Data())); | |
396 | fBackList[iCut]->SetOwner(kTRUE); | |
397 | fCutFolder[iCut]->Add(fBackList[iCut]); | |
398 | ||
399 | fSparseMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax); | |
400 | fBackList[iCut]->Add(fSparseMotherBackInvMassPtZM[iCut]); | |
401 | ||
402 | fMotherList[iCut] = new TList(); | |
403 | fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringCalo.Data(),cutstringMeson.Data())); | |
404 | fMotherList[iCut]->SetOwner(kTRUE); | |
405 | fCutFolder[iCut]->Add(fMotherList[iCut]); | |
406 | ||
407 | fSparseMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax); | |
408 | fMotherList[iCut]->Add(fSparseMotherInvMassPtZM[iCut]); | |
409 | ||
410 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){ | |
411 | fBGHandler[iCut] = new AliGammaConversionAODBGHandler( | |
412 | collisionSystem,centMin,centMax, | |
413 | ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(), | |
414 | ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity()); | |
415 | } | |
416 | } | |
417 | } | |
418 | } | |
419 | //________________________________________________________________________ | |
420 | void AliAnalysisTaskGammaCalo::UserCreateOutputObjects(){ | |
421 | ||
422 | // Create histograms | |
423 | if(fOutputContainer != NULL){ | |
424 | delete fOutputContainer; | |
425 | fOutputContainer = NULL; | |
426 | } | |
427 | if(fOutputContainer == NULL){ | |
428 | fOutputContainer = new TList(); | |
429 | fOutputContainer->SetOwner(kTRUE); | |
430 | } | |
431 | ||
432 | // Array of current cut's gammas | |
433 | fClusterCandidates = new TList(); | |
434 | ||
435 | fCutFolder = new TList*[fnCuts]; | |
436 | fESDList = new TList*[fnCuts]; | |
437 | fBackList = new TList*[fnCuts]; | |
438 | fMotherList = new TList*[fnCuts]; | |
439 | fHistoNEvents = new TH1I*[fnCuts]; | |
440 | fHistoNGoodESDTracks = new TH1I*[fnCuts]; | |
441 | fHistoNGammaCandidates = new TH1I*[fnCuts]; | |
442 | fHistoNGoodESDTracksVsNGammaCanditates = new TH2F*[fnCuts]; | |
443 | fHistoNV0Tracks = new TH1I*[fnCuts]; | |
444 | fProfileEtaShift = new TProfile*[fnCuts]; | |
445 | ||
446 | if(fDoMesonAnalysis){ | |
447 | fHistoMotherInvMassPt = new TH2F*[fnCuts]; | |
8c96b4f9 | 448 | fHistoMotherInvMass3ClusterPt = new TH2F*[fnCuts]; |
d53bf4ac | 449 | fHistoMotherBackInvMassPt = new TH2F*[fnCuts]; |
450 | fHistoMotherInvMassEalpha = new TH2F*[fnCuts]; | |
451 | if (fDoMesonQA > 0){ | |
452 | fHistoMotherPi0PtY = new TH2F*[fnCuts]; | |
453 | fHistoMotherEtaPtY = new TH2F*[fnCuts]; | |
454 | fHistoMotherPi0PtAlpha = new TH2F*[fnCuts]; | |
455 | fHistoMotherEtaPtAlpha = new TH2F*[fnCuts]; | |
456 | fHistoMotherPi0PtOpenAngle = new TH2F*[fnCuts]; | |
457 | fHistoMotherEtaPtOpenAngle = new TH2F*[fnCuts]; | |
458 | } | |
459 | if(fDoMesonQA == 1){ | |
460 | fHistoMotherInvMassECalib = new TH2F*[fnCuts]; | |
461 | fHistoMotherInvMassECalibalpha = new TH2F*[fnCuts]; | |
462 | } | |
463 | } | |
464 | ||
465 | fHistoClusGammaPt = new TH1F*[fnCuts]; | |
466 | ||
467 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
468 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); | |
469 | TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber(); | |
470 | TString cutstringMeson = "NoMesonCut"; | |
471 | if(fDoMesonAnalysis)cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
472 | ||
473 | fCutFolder[iCut] = new TList(); | |
474 | fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s",cutstringEvent.Data(),cutstringCalo.Data(),cutstringMeson.Data())); | |
475 | fCutFolder[iCut]->SetOwner(kTRUE); | |
476 | fOutputContainer->Add(fCutFolder[iCut]); | |
477 | fESDList[iCut] = new TList(); | |
478 | fESDList[iCut]->SetName(Form("%s_%s_%s ESD histograms",cutstringEvent.Data(),cutstringCalo.Data(),cutstringMeson.Data())); | |
479 | fESDList[iCut]->SetOwner(kTRUE); | |
480 | fCutFolder[iCut]->Add(fESDList[iCut]); | |
481 | ||
482 | fHistoNEvents[iCut] = new TH1I("NEvents","NEvents",9,-0.5,8.5); | |
483 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted"); | |
484 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality"); | |
485 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Missing MC"); | |
486 | if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() == 4 ){ | |
487 | TString TriggerNames = "Not Trigger: "; | |
488 | TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName(); | |
489 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data()); | |
490 | } else { | |
491 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger"); | |
492 | } | |
493 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z"); | |
494 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex"); | |
495 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up"); | |
496 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD"); | |
497 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND"); | |
498 | fESDList[iCut]->Add(fHistoNEvents[iCut]); | |
499 | ||
500 | if(fIsHeavyIon == 1) fHistoNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",4000,0,4000); | |
501 | else if(fIsHeavyIon == 2) fHistoNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",400,0,400); | |
502 | else fHistoNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200); | |
503 | fESDList[iCut]->Add(fHistoNGoodESDTracks[iCut]); | |
504 | if(fIsHeavyIon == 1) fHistoNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",600,0,600); | |
505 | else if(fIsHeavyIon == 2) fHistoNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",400,0,400); | |
506 | else fHistoNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",100,0,100); | |
507 | fESDList[iCut]->Add(fHistoNGammaCandidates[iCut]); | |
508 | if(fIsHeavyIon == 1) fHistoNGoodESDTracksVsNGammaCanditates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",4000,0,4000,600,0,600); | |
509 | else if(fIsHeavyIon == 2) fHistoNGoodESDTracksVsNGammaCanditates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",400,0,400,400,0,400); | |
510 | else fHistoNGoodESDTracksVsNGammaCanditates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",200,0,200,100,0,100); | |
511 | fESDList[iCut]->Add(fHistoNGoodESDTracksVsNGammaCanditates[iCut]); | |
512 | ||
513 | ||
514 | if(fIsHeavyIon == 1) fHistoNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",30000,0,30000); | |
515 | else if(fIsHeavyIon == 2) fHistoNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",2500,0,2500); | |
516 | else fHistoNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",1500,0,1500); | |
517 | fESDList[iCut]->Add(fHistoNV0Tracks[iCut]); | |
518 | fProfileEtaShift[iCut] = new TProfile("Eta Shift","Eta Shift",1, -0.5,0.5); | |
519 | fESDList[iCut]->Add(fProfileEtaShift[iCut]); | |
520 | ||
521 | fHistoClusGammaPt[iCut] = new TH1F("ClusGamma_Pt","ClusGamma_Pt",250,0,25); | |
522 | fESDList[iCut]->Add(fHistoClusGammaPt[iCut]); | |
523 | ||
524 | ||
525 | if(fDoMesonAnalysis){ | |
526 | fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",800,0,0.8,250,0,25); | |
527 | fESDList[iCut]->Add(fHistoMotherInvMassPt[iCut]); | |
8c96b4f9 | 528 | fHistoMotherInvMass3ClusterPt[iCut] = new TH2F("ESD_Mother_InvMass3Cluster_Pt","ESD_Mother_InvMass3Cluster_Pt",800,0,0.8,250,0,25); |
529 | fESDList[iCut]->Add(fHistoMotherInvMass3ClusterPt[iCut]); | |
d53bf4ac | 530 | fHistoMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt","ESD_Background_InvMass_Pt",800,0,0.8,250,0,25); |
531 | fESDList[iCut]->Add(fHistoMotherBackInvMassPt[iCut]); | |
532 | fHistoMotherInvMassEalpha[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_alpha","ESD_Mother_InvMass_vs_E_alpha",800,0,0.8,250,0,25); | |
533 | fESDList[iCut]->Add(fHistoMotherInvMassEalpha[iCut]); | |
534 | if(fDoMesonQA == 1){ | |
535 | fHistoMotherInvMassECalib[iCut] = new TH2F("ESD_Mother_InvMass_Pt_Calib","ESD_Mother_InvMass_Pt_Calib",800,0,0.8,250,0,25); | |
536 | fESDList[iCut]->Add(fHistoMotherInvMassECalib[iCut]); | |
537 | fHistoMotherInvMassECalibalpha[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_Calib_alpha","ESD_Mother_InvMass_vs_E_Calib_alpha",800,0,0.8,250,0,25); | |
538 | fESDList[iCut]->Add(fHistoMotherInvMassECalibalpha[iCut]); | |
539 | } | |
540 | ||
541 | if (fDoMesonQA > 0 ){ | |
542 | fHistoMotherPi0PtY[iCut] = new TH2F("ESD_MotherPi0_Pt_Y","ESD_MotherPi0_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
543 | SetLogBinningXTH2(fHistoMotherPi0PtY[iCut]); | |
544 | fESDList[iCut]->Add(fHistoMotherPi0PtY[iCut]); | |
545 | fHistoMotherEtaPtY[iCut] = new TH2F("ESD_MotherEta_Pt_Y","ESD_MotherEta_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
546 | SetLogBinningXTH2(fHistoMotherEtaPtY[iCut]); | |
547 | fESDList[iCut]->Add(fHistoMotherEtaPtY[iCut]); | |
548 | fHistoMotherPi0PtAlpha[iCut] = new TH2F("ESD_MotherPi0_Pt_Alpha","ESD_MotherPi0_Pt_Alpha",150,0.03,15.,100,0,1); | |
549 | SetLogBinningXTH2(fHistoMotherPi0PtAlpha[iCut]); | |
550 | fESDList[iCut]->Add(fHistoMotherPi0PtAlpha[iCut]); | |
551 | fHistoMotherEtaPtAlpha[iCut] = new TH2F("ESD_MotherEta_Pt_Alpha","ESD_MotherEta_Pt_Alpha",150,0.03,15.,100,0,1); | |
552 | SetLogBinningXTH2(fHistoMotherEtaPtAlpha[iCut]); | |
553 | fESDList[iCut]->Add(fHistoMotherEtaPtAlpha[iCut]); | |
554 | fHistoMotherPi0PtOpenAngle[iCut] = new TH2F("ESD_MotherPi0_Pt_OpenAngle","ESD_MotherPi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi()); | |
555 | SetLogBinningXTH2(fHistoMotherPi0PtOpenAngle[iCut]); | |
556 | fESDList[iCut]->Add(fHistoMotherPi0PtOpenAngle[iCut]); | |
557 | fHistoMotherEtaPtOpenAngle[iCut] = new TH2F("ESD_MotherEta_Pt_OpenAngle","ESD_MotherEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi()); | |
558 | SetLogBinningXTH2(fHistoMotherEtaPtOpenAngle[iCut]); | |
559 | fESDList[iCut]->Add(fHistoMotherEtaPtOpenAngle[iCut]); | |
560 | } | |
561 | } | |
562 | } | |
563 | if(fDoMesonAnalysis){ | |
564 | InitBack(); // Init Background Handler | |
565 | } | |
566 | ||
567 | if(fIsMC){ | |
568 | // MC Histogramms | |
569 | fMCList = new TList*[fnCuts]; | |
570 | // True Histogramms | |
571 | fTrueList = new TList*[fnCuts]; | |
572 | // Selected Header List | |
573 | fHeaderNameList = new TList*[fnCuts]; | |
574 | fHistoMCHeaders = new TH1I*[fnCuts]; | |
575 | fHistoMCAllGammaPt = new TH1F*[fnCuts]; | |
576 | fHistoMCDecayGammaPi0Pt = new TH1F*[fnCuts]; | |
577 | fHistoMCDecayGammaRhoPt = new TH1F*[fnCuts]; | |
578 | fHistoMCDecayGammaEtaPt = new TH1F*[fnCuts]; | |
579 | fHistoMCDecayGammaOmegaPt = new TH1F*[fnCuts]; | |
580 | fHistoMCDecayGammaEtapPt = new TH1F*[fnCuts]; | |
581 | fHistoMCDecayGammaPhiPt = new TH1F*[fnCuts]; | |
582 | fHistoMCDecayGammaSigmaPt = new TH1F*[fnCuts]; | |
583 | ||
584 | fHistoClusPhotonBGPt = new TH2F*[fnCuts]; | |
585 | fHistoClusPhotonPlusConvBGPt = new TH2F*[fnCuts]; | |
586 | ||
587 | fHistoTrueClusGammaPt = new TH1F*[fnCuts]; | |
588 | fHistoTruePrimaryClusGammaPt = new TH1F*[fnCuts]; | |
589 | fHistoTruePrimaryClusGammaESDPtMCPt = new TH2F*[fnCuts]; | |
590 | fHistoTruePrimaryClusConvGammaPt = new TH1F*[fnCuts]; | |
591 | fHistoTruePrimaryClusConvGammaESDPtMCPt = new TH2F*[fnCuts]; | |
592 | fHistoTrueSecondaryClusGammaPt = new TH1F*[fnCuts]; | |
593 | fHistoTrueSecondaryClusConvGammaPt = new TH1F*[fnCuts]; | |
594 | fHistoTrueSecondaryClusGammaFromXFromK0sPt = new TH1F*[fnCuts]; | |
595 | fHistoTrueSecondaryClusConvGammaFromXFromK0sPt = new TH1F*[fnCuts]; | |
596 | fHistoTrueSecondaryClusGammaFromXFromLambdaPt = new TH1F*[fnCuts]; | |
597 | fHistoTrueSecondaryClusConvGammaFromXFromLambdaPt = new TH1F*[fnCuts]; | |
598 | fHistoTrueSecondaryClusGammaFromXFromEtasPt = new TH1F*[fnCuts]; | |
599 | fHistoTrueSecondaryClusConvGammaFromXFromEtasPt = new TH1F*[fnCuts]; | |
600 | ||
601 | ||
602 | if (fDoClusterQA > 0){ | |
603 | fHistoTrueClusUnConvGammaPt = new TH1F*[fnCuts]; | |
604 | fHistoTrueClusUnConvGammaMCPt = new TH1F*[fnCuts]; | |
605 | fHistoTrueClusElectronPt = new TH1F*[fnCuts]; | |
606 | fHistoTrueClusConvGammaPt = new TH1F*[fnCuts]; | |
607 | fHistoTrueClusConvGammaMCPt = new TH1F*[fnCuts]; | |
608 | fHistoTrueClusConvGammaFullyPt = new TH1F*[fnCuts]; | |
609 | fHistoTrueClusMergedGammaPt = new TH1F*[fnCuts]; | |
610 | fHistoTrueClusMergedPartConvGammaPt = new TH1F*[fnCuts]; | |
611 | fHistoTrueClusDalitzPt = new TH1F*[fnCuts]; | |
612 | fHistoTrueClusDalitzMergedPt = new TH1F*[fnCuts]; | |
613 | fHistoTrueClusPhotonFromElecMotherPt= new TH1F*[fnCuts]; | |
614 | fHistoTrueClusShowerPt = new TH1F*[fnCuts]; | |
615 | fHistoTrueClusSubLeadingPt = new TH1F*[fnCuts]; | |
616 | fHistoTrueClusNParticles = new TH1I*[fnCuts]; | |
617 | fHistoTrueClusEMNonLeadingPt = new TH1F*[fnCuts]; | |
618 | fHistoTrueNLabelsInClus = new TH1F*[fnCuts]; | |
619 | } | |
620 | ||
621 | if(fDoMesonAnalysis){ | |
622 | fHistoMCPi0Pt = new TH1F*[fnCuts]; | |
623 | fHistoMCPi0WOWeightPt = new TH1F*[fnCuts]; | |
624 | fHistoMCEtaPt = new TH1F*[fnCuts]; | |
625 | fHistoMCEtaWOWeightPt = new TH1F*[fnCuts]; | |
626 | fHistoMCPi0InAccPt = new TH1F*[fnCuts]; | |
627 | fHistoMCEtaInAccPt = new TH1F*[fnCuts]; | |
628 | ||
629 | fHistoTrueMotherInvMassPt = new TH2F*[fnCuts]; | |
630 | fHistoTruePrimaryMotherInvMassPt = new TH2F*[fnCuts]; | |
631 | fHistoTruePrimaryMotherW0WeightingInvMassPt = new TH2F*[fnCuts]; | |
632 | fProfileTruePrimaryMotherWeightsInvMassPt = new TProfile2D*[fnCuts]; | |
633 | fHistoTrueSecondaryMotherInvMassPt = new TH2F*[fnCuts]; | |
634 | fHistoTrueSecondaryMotherFromK0sInvMassPt = new TH2F*[fnCuts]; | |
635 | fHistoTrueSecondaryMotherFromEtaInvMassPt = new TH2F*[fnCuts]; | |
636 | fHistoTrueSecondaryMotherFromLambdaInvMassPt = new TH2F*[fnCuts]; | |
637 | if (fDoMesonQA > 0){ | |
638 | fHistoMCPi0PtY = new TH2F*[fnCuts]; | |
639 | fHistoMCEtaPtY = new TH2F*[fnCuts]; | |
640 | fHistoMCK0sPt = new TH1F*[fnCuts]; | |
641 | fHistoMCK0sWOWeightPt = new TH1F*[fnCuts]; | |
642 | fHistoMCK0sPtY = new TH2F*[fnCuts]; | |
643 | fHistoMCSecPi0PtvsSource = new TH2F*[fnCuts]; | |
644 | fHistoMCSecPi0Source = new TH1F*[fnCuts]; | |
645 | fHistoMCSecEtaPt = new TH1F*[fnCuts]; | |
646 | fHistoMCSecEtaSource = new TH1F*[fnCuts]; | |
647 | fHistoTrueMotherCaloPhotonInvMassPt = new TH2F*[fnCuts]; | |
648 | fHistoTrueMotherCaloConvertedPhotonInvMassPt= new TH2F*[fnCuts]; | |
649 | fHistoTrueMotherCaloMixedPhotonConvPhotonInvMassPt= new TH2F*[fnCuts]; | |
650 | fHistoTruePi0CaloConvertedPhotonInvMassPt = new TH2F*[fnCuts]; | |
651 | fHistoTrueEtaCaloConvertedPhotonInvMassPt = new TH2F*[fnCuts]; | |
652 | fHistoTrueMotherCaloElectronInvMassPt = new TH2F*[fnCuts]; | |
653 | fHistoTrueMotherCaloMergedClusterInvMassPt = new TH2F*[fnCuts]; | |
654 | fHistoTrueMotherCaloMergedClusterPartConvInvMassPt = new TH2F*[fnCuts]; | |
655 | fHistoTruePrimaryPi0MCPtResolPt = new TH2F*[fnCuts]; | |
656 | fHistoTruePrimaryEtaMCPtResolPt = new TH2F*[fnCuts]; | |
657 | fHistoTrueK0sWithPi0DaughterMCPt = new TH1F*[fnCuts]; | |
658 | fHistoTrueEtaWithPi0DaughterMCPt = new TH1F*[fnCuts]; | |
659 | fHistoTrueLambdaWithPi0DaughterMCPt = new TH1F*[fnCuts]; | |
660 | fHistoTrueBckGGInvMassPt = new TH2F*[fnCuts]; | |
661 | fHistoTrueBckContInvMassPt = new TH2F*[fnCuts]; | |
662 | fHistoTruePi0PtY = new TH2F*[fnCuts]; | |
663 | fHistoTrueEtaPtY = new TH2F*[fnCuts]; | |
664 | fHistoTruePi0PtAlpha = new TH2F*[fnCuts]; | |
665 | fHistoTrueEtaPtAlpha = new TH2F*[fnCuts]; | |
666 | fHistoTruePi0PtOpenAngle = new TH2F*[fnCuts]; | |
667 | fHistoTrueEtaPtOpenAngle = new TH2F*[fnCuts]; | |
668 | } | |
669 | } | |
670 | ||
671 | ||
672 | ||
673 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
674 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); | |
675 | TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber(); | |
676 | TString cutstringMeson = "NoMesonCut"; | |
677 | if(fDoMesonAnalysis)cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
678 | ||
679 | fMCList[iCut] = new TList(); | |
680 | fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms",cutstringEvent.Data(),cutstringCalo.Data(),cutstringMeson.Data())); | |
681 | fMCList[iCut]->SetOwner(kTRUE); | |
682 | fCutFolder[iCut]->Add(fMCList[iCut]); | |
683 | fHistoMCHeaders[iCut] = new TH1I("MC_Headers","MC_Headers",20,0,20); | |
684 | fMCList[iCut]->Add(fHistoMCHeaders[iCut]); | |
685 | fHistoMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25); | |
686 | fMCList[iCut]->Add(fHistoMCAllGammaPt[iCut]); | |
687 | fHistoMCDecayGammaPi0Pt[iCut] = new TH1F("MC_DecayGammaPi0_Pt","MC_DecayGammaPi0_Pt",250,0,25); | |
688 | fMCList[iCut]->Add(fHistoMCDecayGammaPi0Pt[iCut]); | |
689 | fHistoMCDecayGammaRhoPt[iCut] = new TH1F("MC_DecayGammaRho_Pt","MC_DecayGammaRho_Pt",250,0,25); | |
690 | fMCList[iCut]->Add(fHistoMCDecayGammaRhoPt[iCut]); | |
691 | fHistoMCDecayGammaEtaPt[iCut] = new TH1F("MC_DecayGammaEta_Pt","MC_DecayGammaEta_Pt",250,0,25); | |
692 | fMCList[iCut]->Add(fHistoMCDecayGammaEtaPt[iCut]); | |
693 | fHistoMCDecayGammaOmegaPt[iCut] = new TH1F("MC_DecayGammaOmega_Pt","MC_DecayGammaOmmega_Pt",250,0,25); | |
694 | fMCList[iCut]->Add(fHistoMCDecayGammaOmegaPt[iCut]); | |
695 | fHistoMCDecayGammaEtapPt[iCut] = new TH1F("MC_DecayGammaEtap_Pt","MC_DecayGammaEtap_Pt",250,0,25); | |
696 | fMCList[iCut]->Add(fHistoMCDecayGammaEtapPt[iCut]); | |
697 | fHistoMCDecayGammaPhiPt[iCut] = new TH1F("MC_DecayGammaPhi_Pt","MC_DecayGammaPhi_Pt",250,0,25); | |
698 | fMCList[iCut]->Add(fHistoMCDecayGammaPhiPt[iCut]); | |
699 | fHistoMCDecayGammaSigmaPt[iCut] = new TH1F("MC_DecayGammaSigma_Pt","MC_DecayGammaSigma_Pt",250,0,25); | |
700 | fMCList[iCut]->Add(fHistoMCDecayGammaSigmaPt[iCut]); | |
701 | ||
702 | if(fDoMesonAnalysis){ | |
703 | fHistoMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25); | |
704 | fHistoMCPi0Pt[iCut]->Sumw2(); | |
705 | fMCList[iCut]->Add(fHistoMCPi0Pt[iCut]); | |
706 | fHistoMCPi0WOWeightPt[iCut] = new TH1F("MC_Pi0_WOWeights_Pt","MC_Pi0_WOWeights_Pt",250,0,25); | |
707 | fHistoMCPi0WOWeightPt[iCut]->Sumw2(); | |
708 | fMCList[iCut]->Add(fHistoMCPi0WOWeightPt[iCut]); | |
709 | ||
710 | fHistoMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25); | |
711 | fHistoMCEtaPt[iCut]->Sumw2(); | |
712 | fMCList[iCut]->Add(fHistoMCEtaPt[iCut]); | |
713 | fHistoMCEtaWOWeightPt[iCut] = new TH1F("MC_Eta_WOWeights_Pt","MC_Eta_WOWeights_Pt",250,0,25); | |
714 | fHistoMCEtaWOWeightPt[iCut]->Sumw2(); | |
715 | fMCList[iCut]->Add(fHistoMCEtaWOWeightPt[iCut]); | |
716 | fHistoMCPi0InAccPt[iCut] = new TH1F("MC_Pi0InAcc_Pt","MC_Pi0InAcc_Pt",250,0,25); | |
717 | fHistoMCPi0InAccPt[iCut]->Sumw2(); | |
718 | fMCList[iCut]->Add(fHistoMCPi0InAccPt[iCut]); | |
719 | fHistoMCEtaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt","MC_EtaInAcc_Pt",250,0,25); | |
720 | fHistoMCEtaInAccPt[iCut]->Sumw2(); | |
721 | fMCList[iCut]->Add(fHistoMCEtaInAccPt[iCut]); | |
722 | if (fDoMesonQA > 0){ | |
723 | fHistoMCPi0PtY[iCut] = new TH2F("MC_Pi0_Pt_Y","MC_Pi0_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
724 | fHistoMCPi0PtY[iCut]->Sumw2(); | |
725 | SetLogBinningXTH2(fHistoMCPi0PtY[iCut]); | |
726 | fMCList[iCut]->Add(fHistoMCPi0PtY[iCut]); | |
727 | fHistoMCEtaPtY[iCut] = new TH2F("MC_Eta_Pt_Y","MC_Eta_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
728 | fHistoMCEtaPtY[iCut]->Sumw2(); | |
729 | SetLogBinningXTH2(fHistoMCEtaPtY[iCut]); | |
730 | fMCList[iCut]->Add(fHistoMCEtaPtY[iCut]); | |
731 | fHistoMCK0sPt[iCut] = new TH1F("MC_K0s_Pt","MC_K0s_Pt",150,0,15); | |
732 | fHistoMCK0sPt[iCut]->Sumw2(); | |
733 | fMCList[iCut]->Add(fHistoMCK0sPt[iCut]); | |
734 | fHistoMCK0sWOWeightPt[iCut] = new TH1F("MC_K0s_WOWeights_Pt","MC_K0s_WOWeights_Pt",150,0,15); | |
735 | fHistoMCK0sWOWeightPt[iCut]->Sumw2(); | |
736 | fMCList[iCut]->Add(fHistoMCK0sWOWeightPt[iCut]); | |
737 | fHistoMCK0sPtY[iCut] = new TH2F("MC_K0s_Pt_Y","MC_K0s_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
738 | fHistoMCK0sPtY[iCut]->Sumw2(); | |
739 | SetLogBinningXTH2(fHistoMCK0sPtY[iCut]); | |
740 | fMCList[iCut]->Add(fHistoMCK0sPtY[iCut]); | |
741 | ||
742 | fHistoMCSecPi0Source[iCut] = new TH1F("MC_SecPi0_Source","MC_SecPi0_Source",5000,0.,5000); | |
743 | fMCList[iCut]->Add(fHistoMCSecPi0Source[iCut]); | |
744 | fHistoMCSecEtaSource[iCut] = new TH1F("MC_SecEta_Source","MC_SecEta_Source",5000,0,5000); | |
745 | fMCList[iCut]->Add(fHistoMCSecEtaSource[iCut]); | |
746 | fHistoMCSecPi0PtvsSource[iCut] = new TH2F("MC_SecPi0_Pt_Source","MC_SecPi0_Pt_Source",250,0.0,25.,16,-0.5,15.5); | |
747 | fHistoMCSecPi0PtvsSource[iCut]->Sumw2(); | |
748 | fMCList[iCut]->Add(fHistoMCSecPi0PtvsSource[iCut]); | |
749 | fHistoMCSecEtaPt[iCut] = new TH1F("MC_SecEta_Pt","MC_SecEta_Pt",250,0,25); | |
750 | fHistoMCSecEtaPt[iCut]->Sumw2(); | |
751 | fMCList[iCut]->Add(fHistoMCSecEtaPt[iCut]); | |
752 | } | |
753 | ||
754 | } | |
755 | fTrueList[iCut] = new TList(); | |
756 | fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms",cutstringEvent.Data(),cutstringCalo.Data(),cutstringMeson.Data())); | |
757 | fTrueList[iCut]->SetOwner(kTRUE); | |
758 | fCutFolder[iCut]->Add(fTrueList[iCut]); | |
759 | ||
760 | fHistoClusPhotonBGPt[iCut] = new TH2F("ESD_TrueClusPhotonBG_Pt","ESD_TrueClusPhotonBG_Pt",250,0,25,9,-0.5,8.5); | |
761 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec"); | |
762 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 2,"Pion"); | |
763 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 3,"Proton"); | |
764 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 4,"Kaon"); | |
765 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 5,"Neutron"); | |
766 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 6,"K0s"); | |
767 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 7,"Lambda"); | |
768 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 8,"Muon"); | |
769 | fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel(9,"Rest"); | |
770 | fTrueList[iCut]->Add(fHistoClusPhotonBGPt[iCut]); | |
771 | fHistoClusPhotonPlusConvBGPt[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvBG_Pt","ESD_TrueClusPhotonPlusConvBG_Pt",250,0,25,9,-0.5,8.5); | |
772 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec"); | |
773 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 2,"Pion"); | |
774 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 3,"Proton"); | |
775 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 4,"Kaon"); | |
776 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 5,"Neutron"); | |
777 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 6,"K0s"); | |
778 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 7,"Lambda"); | |
779 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 8,"Muon"); | |
780 | fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel(9,"Rest"); | |
781 | fTrueList[iCut]->Add(fHistoClusPhotonPlusConvBGPt[iCut]); | |
782 | ||
783 | fHistoTrueClusGammaPt[iCut] = new TH1F("TrueClusGamma_Pt","ESD_TrueClusGamma_Pt",250,0,25); | |
784 | fTrueList[iCut]->Add(fHistoTrueClusGammaPt[iCut]); | |
785 | fHistoTruePrimaryClusGammaPt[iCut] = new TH1F("TruePrimaryClusGamma_Pt","ESD_TruePrimaryClusGamma_Pt",250,0,25); | |
786 | fTrueList[iCut]->Add(fHistoTruePrimaryClusGammaPt[iCut]); | |
787 | fHistoTruePrimaryClusGammaESDPtMCPt[iCut] = new TH2F("TruePrimaryClusGamma_Pt_MCPt","ESD_TruePrimaryClusGamma_MCPt",250,0,25,250,0,25); | |
788 | fTrueList[iCut]->Add(fHistoTruePrimaryClusGammaESDPtMCPt[iCut]); | |
789 | fHistoTruePrimaryClusConvGammaPt[iCut] = new TH1F("TruePrimaryClusConvGamma_Pt","ESD_TruePrimaryClusConvGamma_Pt",250,0,25); | |
790 | fTrueList[iCut]->Add(fHistoTruePrimaryClusConvGammaPt[iCut]); | |
791 | fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut] = new TH2F("TruePrimaryClusConvGamma_Pt_MCPt","ESD_TruePrimaryClusConvGamma_MCPt",250,0,25,250,0,25); | |
792 | fTrueList[iCut]->Add(fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut]); | |
793 | fHistoTrueSecondaryClusGammaPt[iCut] = new TH1F("ESD_TrueSecondaryClusGamma_Pt","ESD_TrueSecondaryClusGamma_Pt",250,0,25); | |
794 | fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaPt[iCut]); | |
795 | fHistoTrueSecondaryClusConvGammaPt[iCut] = new TH1F("ESD_TrueSecondaryClusConvGamma_Pt","ESD_TrueSecondaryClusConvGamma_Pt",250,0,25); | |
796 | fTrueList[iCut]->Add(fHistoTrueSecondaryClusConvGammaPt[iCut]); | |
797 | ||
798 | fHistoTrueSecondaryClusGammaFromXFromK0sPt[iCut] = new TH1F("ESD_TrueSecondaryClusGammaFromXFromK0s_Pt", "ESD_TrueSecondaryClusGammaFromXFromK0s_Pt",250,0,25); | |
799 | fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaFromXFromK0sPt[iCut]); | |
800 | fHistoTrueSecondaryClusConvGammaFromXFromK0sPt[iCut] = new TH1F("ESD_TrueSecondaryClusConvGammaFromXFromK0s_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromK0s_Pt",250,0,25); | |
801 | fTrueList[iCut]->Add(fHistoTrueSecondaryClusConvGammaFromXFromK0sPt[iCut]); | |
802 | fHistoTrueSecondaryClusGammaFromXFromLambdaPt[iCut] = new TH1F("ESD_TrueSecondaryClusGammaFromXFromLambda_Pt", "ESD_TrueSecondaryClusGammaFromXFromLambda_Pt",250,0,25); | |
803 | fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaFromXFromLambdaPt[iCut]); | |
804 | fHistoTrueSecondaryClusConvGammaFromXFromLambdaPt[iCut] = new TH1F("ESD_TrueSecondaryClusConvGammaFromXFromLambda_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromLambda_Pt",250,0,25); | |
805 | fTrueList[iCut]->Add(fHistoTrueSecondaryClusConvGammaFromXFromLambdaPt[iCut]); | |
806 | fHistoTrueSecondaryClusGammaFromXFromEtasPt[iCut] = new TH1F("ESD_TrueSecondaryClusGammaFromXFromEtas_Pt", "ESD_TrueSecondaryClusGammaFromXFromEtas_Pt",250,0,25); | |
807 | fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaFromXFromEtasPt[iCut]); | |
808 | fHistoTrueSecondaryClusConvGammaFromXFromEtasPt[iCut] = new TH1F("ESD_TrueSecondaryClusConvGammaFromXFromEtas_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromEtas_Pt",250,0,25); | |
809 | fTrueList[iCut]->Add(fHistoTrueSecondaryClusConvGammaFromXFromEtasPt[iCut]); | |
810 | ||
811 | ||
812 | if (fDoClusterQA > 0){ | |
813 | fHistoTrueClusUnConvGammaPt[iCut] = new TH1F("TrueClusUnConvGamma_Pt","TrueClusUnConvGamma_Pt",250,0,25); | |
814 | fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaPt[iCut]); | |
815 | fHistoTrueClusUnConvGammaMCPt[iCut] = new TH1F("TrueClusUnConvGamma_MCPt","TrueClusUnConvGamma_MCPt",250,0,25); | |
816 | fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaMCPt[iCut]); | |
817 | fHistoTrueClusElectronPt[iCut] = new TH1F("TrueClusElectron_Pt","TrueElectronGamma_Pt",250,0,25); | |
818 | fTrueList[iCut]->Add(fHistoTrueClusElectronPt[iCut]); | |
819 | fHistoTrueClusConvGammaPt[iCut] = new TH1F("TrueClusConvGamma_Pt","TrueClusConvGamma_Pt",250,0,25); | |
820 | fTrueList[iCut]->Add(fHistoTrueClusConvGammaPt[iCut]); | |
821 | fHistoTrueClusConvGammaMCPt[iCut] = new TH1F("TrueClusConvGamma_MCPt","TrueClusConvGamma_MCPt",250,0,25); | |
822 | fTrueList[iCut]->Add(fHistoTrueClusConvGammaMCPt[iCut]); | |
823 | fHistoTrueClusConvGammaFullyPt[iCut] = new TH1F("TrueClusConvGammaFullyContained_Pt","TrueClusConvGammaFullyContained_Pt",250,0,25); | |
824 | fTrueList[iCut]->Add(fHistoTrueClusConvGammaFullyPt[iCut]); | |
825 | fHistoTrueClusMergedGammaPt[iCut] = new TH1F("TrueClusMergedGamma_Pt","TrueClusMergedGamma_Pt",250,0,25); | |
826 | fTrueList[iCut]->Add(fHistoTrueClusMergedGammaPt[iCut]); | |
827 | fHistoTrueClusMergedPartConvGammaPt[iCut] = new TH1F("TrueClusMergedPartConvGamma_Pt","TrueClusMergedPartConvGamma_Pt",250,0,25); | |
828 | fTrueList[iCut]->Add(fHistoTrueClusMergedPartConvGammaPt[iCut]); | |
829 | fHistoTrueClusDalitzPt[iCut] = new TH1F("TrueClusDalitz_Pt","TrueClusDalitz_Pt",250,0,25); | |
830 | fTrueList[iCut]->Add(fHistoTrueClusDalitzPt[iCut]); | |
831 | fHistoTrueClusDalitzMergedPt[iCut] = new TH1F("TrueClusDalitzMerged_Pt","TrueClusDalitzMerged_Pt",250,0,25); | |
832 | fTrueList[iCut]->Add(fHistoTrueClusDalitzMergedPt[iCut]); | |
833 | fHistoTrueClusPhotonFromElecMotherPt[iCut] = new TH1F("TrueClusPhotonFromElecMother_Pt","TrueClusPhotonFromElecMother_Pt",250,0,25); | |
834 | fTrueList[iCut]->Add(fHistoTrueClusPhotonFromElecMotherPt[iCut]); | |
835 | fHistoTrueClusShowerPt[iCut] = new TH1F("TrueClusShower_Pt","TrueClusShower_Pt",250,0,25); | |
836 | fTrueList[iCut]->Add(fHistoTrueClusShowerPt[iCut]); | |
837 | fHistoTrueClusSubLeadingPt[iCut] = new TH1F("TrueClusSubleading_Pt","TrueClusSubleading_Pt",250,0,25); | |
838 | fTrueList[iCut]->Add(fHistoTrueClusSubLeadingPt[iCut]); | |
839 | fHistoTrueClusNParticles[iCut] = new TH1I("TrueClusNParticles","TrueClusNParticles",20,0,20); | |
840 | fTrueList[iCut]->Add(fHistoTrueClusNParticles[iCut]); | |
841 | fHistoTrueClusEMNonLeadingPt[iCut] = new TH1F("TrueClusEMNonLeading_Pt","TrueClusEMNonLeading_Pt",250,0,25); | |
842 | fTrueList[iCut]->Add(fHistoTrueClusEMNonLeadingPt[iCut]); | |
843 | fHistoTrueNLabelsInClus[iCut] = new TH1F("TrueNLabelsInClus","TrueNLabelsInClus",100,-0.5,99.5); | |
844 | fTrueList[iCut]->Add(fHistoTrueNLabelsInClus[iCut]); | |
845 | } | |
846 | ||
847 | if(fDoMesonAnalysis){ | |
848 | fHistoTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",800,0,0.8,250,0,25); | |
849 | fTrueList[iCut]->Add(fHistoTrueMotherInvMassPt[iCut]); | |
850 | fHistoTruePrimaryMotherInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMother_InvMass_Pt", "ESD_TruePrimaryMother_InvMass_Pt", 800,0,0.8,250,0,25); | |
851 | fHistoTruePrimaryMotherInvMassPt[iCut]->Sumw2(); | |
852 | fTrueList[iCut]->Add(fHistoTruePrimaryMotherInvMassPt[iCut]); | |
853 | fHistoTruePrimaryMotherW0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMotherW0Weights_InvMass_Pt", "ESD_TruePrimaryMotherW0Weights_InvMass_Pt", 800,0,0.8,250,0,25); | |
854 | fHistoTruePrimaryMotherW0WeightingInvMassPt[iCut]->Sumw2(); | |
855 | fTrueList[iCut]->Add(fHistoTruePrimaryMotherW0WeightingInvMassPt[iCut]); | |
856 | fProfileTruePrimaryMotherWeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryMotherWeights_InvMass_Pt", "ESD_TruePrimaryMotherWeights_InvMass_Pt", 800,0,0.8,250,0,25); | |
857 | fProfileTruePrimaryMotherWeightsInvMassPt[iCut]->Sumw2(); | |
858 | fTrueList[iCut]->Add(fProfileTruePrimaryMotherWeightsInvMassPt[iCut]); | |
859 | fHistoTrueSecondaryMotherInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMother_InvMass_Pt", "ESD_TrueSecondaryMother_InvMass_Pt", 800,0,0.8,250,0,25); | |
860 | fHistoTrueSecondaryMotherInvMassPt[iCut]->Sumw2(); | |
861 | fTrueList[iCut]->Add(fHistoTrueSecondaryMotherInvMassPt[iCut]); | |
862 | fHistoTrueSecondaryMotherFromK0sInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMotherFromK0s_InvMass_Pt","ESD_TrueSecondaryMotherFromK0s_InvMass_Pt",800,0,0.8,250,0,25); | |
863 | fHistoTrueSecondaryMotherFromK0sInvMassPt[iCut]->Sumw2(); | |
864 | fTrueList[iCut]->Add(fHistoTrueSecondaryMotherFromK0sInvMassPt[iCut]); | |
865 | fHistoTrueSecondaryMotherFromEtaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMotherFromEta_InvMass_Pt","ESD_TrueSecondaryMotherFromEta_InvMass_Pt",800,0,0.8,250,0,25); | |
866 | fTrueList[iCut]->Add(fHistoTrueSecondaryMotherFromEtaInvMassPt[iCut]); | |
867 | fHistoTrueSecondaryMotherFromLambdaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMotherFromLambda_InvMass_Pt","ESD_TrueSecondaryMotherFromLambda_InvMass_Pt",800,0,0.8,250,0,25); | |
868 | fTrueList[iCut]->Add(fHistoTrueSecondaryMotherFromLambdaInvMassPt[iCut]); | |
869 | if (fDoMesonQA > 0){ | |
870 | fHistoTrueMotherCaloPhotonInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloPhoton_InvMass_Pt","ESD_TrueMotherCaloPhoton_InvMass_Pt",800,0,0.8,250,0,25); | |
871 | fTrueList[iCut]->Add(fHistoTrueMotherCaloPhotonInvMassPt[iCut]); | |
872 | fHistoTrueMotherCaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloConvertedPhoton_InvMass_Pt","ESD_TrueMotherCaloConvertedPhoton_InvMass_Pt",800,0,0.8,250,0,25); | |
873 | fTrueList[iCut]->Add(fHistoTrueMotherCaloConvertedPhotonInvMassPt[iCut]); | |
874 | fHistoTrueMotherCaloMixedPhotonConvPhotonInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloMixedPhotonConvertedPhoton_InvMass_Pt","ESD_TrueMotherCaloMixedPhotonConvertedPhoton_InvMass_Pt",800,0,0.8,250,0,25); | |
875 | fTrueList[iCut]->Add(fHistoTrueMotherCaloMixedPhotonConvPhotonInvMassPt[iCut]); | |
876 | ||
877 | fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloConvertedPhoton_InvMass_Pt","ESD_TruePi0CaloConvertedPhoton_InvMass_Pt",800,0,0.8,250,0,25); | |
878 | fTrueList[iCut]->Add(fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut]); | |
879 | ||
880 | fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt","ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt",800,0,0.8,250,0,25); | |
881 | fTrueList[iCut]->Add(fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut]); | |
882 | ||
883 | fHistoTrueMotherCaloElectronInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloElectron_InvMass_Pt","ESD_TrueMotherCaloElectron_InvMass_Pt",800,0,0.8,250,0,25); | |
884 | fTrueList[iCut]->Add(fHistoTrueMotherCaloElectronInvMassPt[iCut]); | |
885 | fHistoTrueMotherCaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloMergedCluster_InvMass_Pt","ESD_TrueMotherCaloMergedCluster_InvMass_Pt",800,0,0.8,250,0,25); | |
886 | fTrueList[iCut]->Add(fHistoTrueMotherCaloMergedClusterInvMassPt[iCut]); | |
887 | fHistoTrueMotherCaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloMergedClusterPartConv_InvMass_Pt","ESD_TrueMotherCaloMergedClusterPartConv_InvMass_Pt",800,0,0.8,250,0,25); | |
888 | fTrueList[iCut]->Add(fHistoTrueMotherCaloMergedClusterPartConvInvMassPt[iCut]); | |
889 | ||
890 | fHistoTruePrimaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0_MCPt_ResolPt","ESD_TruePrimaryPi0_ResolPt_MCPt",500,0.03,25,1000,-1.,1.); | |
891 | fHistoTruePrimaryPi0MCPtResolPt[iCut]->Sumw2(); | |
892 | SetLogBinningXTH2(fHistoTruePrimaryPi0MCPtResolPt[iCut]); | |
893 | fTrueList[iCut]->Add(fHistoTruePrimaryPi0MCPtResolPt[iCut]); | |
894 | fHistoTruePrimaryEtaMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryEta_MCPt_ResolPt","ESD_TruePrimaryEta_ResolPt_MCPt",500,0.03,25,1000,-1.,1.); | |
895 | fHistoTruePrimaryEtaMCPtResolPt[iCut]->Sumw2(); | |
896 | SetLogBinningXTH2(fHistoTruePrimaryEtaMCPtResolPt[iCut]); | |
897 | fTrueList[iCut]->Add(fHistoTruePrimaryEtaMCPtResolPt[iCut]); | |
898 | fHistoTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueBckGG_InvMass_Pt","ESD_TrueBckGG_InvMass_Pt",800,0,0.8,250,0,25); | |
899 | fTrueList[iCut]->Add(fHistoTrueBckGGInvMassPt[iCut]); | |
900 | fHistoTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueBckCont_InvMass_Pt","ESD_TrueBckCont_InvMass_Pt",800,0,0.8,250,0,25); | |
901 | fTrueList[iCut]->Add(fHistoTrueBckContInvMassPt[iCut]); | |
902 | fHistoTrueK0sWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0sWithPi0Daughter_MCPt","ESD_TrueK0sWithPi0Daughter_MCPt",250,0,25); | |
903 | fTrueList[iCut]->Add(fHistoTrueK0sWithPi0DaughterMCPt[iCut]); | |
904 | fHistoTrueEtaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueEtaWithPi0Daughter_MCPt","ESD_TrueEtaWithPi0Daughter_MCPt",250,0,25); | |
905 | fTrueList[iCut]->Add(fHistoTrueEtaWithPi0DaughterMCPt[iCut]); | |
906 | fHistoTrueLambdaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueLambdaWithPi0Daughter_MCPt","ESD_TrueLambdaWithPi0Daughter_MCPt",250,0,25); | |
907 | fTrueList[iCut]->Add(fHistoTrueLambdaWithPi0DaughterMCPt[iCut]); | |
908 | ||
909 | fHistoTruePi0PtY[iCut] = new TH2F("ESD_TruePi0_Pt_Y","ESD_TruePi0_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
910 | SetLogBinningXTH2(fHistoTruePi0PtY[iCut]); | |
911 | fTrueList[iCut]->Add(fHistoTruePi0PtY[iCut]); | |
912 | fHistoTrueEtaPtY[iCut] = new TH2F("ESD_TrueEta_Pt_Y","ESD_TrueEta_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
913 | SetLogBinningXTH2(fHistoTrueEtaPtY[iCut]); | |
914 | fTrueList[iCut]->Add(fHistoTrueEtaPtY[iCut]); | |
915 | fHistoTruePi0PtAlpha[iCut] = new TH2F("ESD_TruePi0_Pt_Alpha","ESD_TruePi0_Pt_Alpha",150,0.03,15.,100,0,1); | |
916 | SetLogBinningXTH2(fHistoTruePi0PtAlpha[iCut]); | |
917 | fTrueList[iCut]->Add(fHistoTruePi0PtAlpha[iCut]); | |
918 | fHistoTrueEtaPtAlpha[iCut] = new TH2F("ESD_TrueEta_Pt_Alpha","ESD_TrueEta_Pt_Alpha",150,0.03,15.,100,0,1); | |
919 | SetLogBinningXTH2(fHistoTrueEtaPtAlpha[iCut]); | |
920 | fTrueList[iCut]->Add(fHistoTrueEtaPtAlpha[iCut]); | |
921 | ||
922 | fHistoTruePi0PtOpenAngle[iCut] = new TH2F("ESD_TruePi0_Pt_OpenAngle","ESD_TruePi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi()); | |
923 | SetLogBinningXTH2(fHistoTruePi0PtOpenAngle[iCut]); | |
924 | fTrueList[iCut]->Add(fHistoTruePi0PtOpenAngle[iCut]); | |
925 | fHistoTrueEtaPtOpenAngle[iCut] = new TH2F("ESD_TrueEta_Pt_OpenAngle","ESD_TrueEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi()); | |
926 | SetLogBinningXTH2(fHistoTrueEtaPtOpenAngle[iCut]); | |
927 | fTrueList[iCut]->Add(fHistoTrueEtaPtOpenAngle[iCut]); | |
928 | } | |
929 | } | |
930 | } | |
931 | } | |
932 | ||
933 | fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"); | |
934 | if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader | |
935 | ||
936 | if(fV0Reader) | |
937 | if((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts()) | |
938 | if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms()) | |
939 | fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms()); | |
940 | if(fV0Reader) | |
941 | if((AliConvEventCuts*)fV0Reader->GetEventCuts()) | |
942 | if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms()) | |
943 | fOutputContainer->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms()); | |
944 | ||
945 | ||
946 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
947 | if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue; | |
948 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){ | |
949 | fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()); | |
950 | } | |
951 | if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue; | |
952 | if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms()){ | |
953 | fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms()); | |
954 | } | |
955 | if(fDoMesonAnalysis){ | |
956 | if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue; | |
957 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){ | |
958 | fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()); | |
959 | } | |
960 | } | |
961 | } | |
962 | PostData(1, fOutputContainer); | |
963 | } | |
964 | //_____________________________________________________________________________ | |
965 | Bool_t AliAnalysisTaskGammaCalo::Notify() | |
966 | { | |
967 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
968 | if(!((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift()){ | |
969 | fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift())); | |
970 | continue; // No Eta Shift requested, continue | |
971 | } | |
972 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically | |
973 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName()); | |
974 | fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift())); | |
975 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once | |
976 | continue; | |
977 | } | |
978 | else{ | |
979 | printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n", | |
980 | (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()); | |
981 | fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift())); | |
982 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once | |
983 | } | |
984 | } | |
985 | ||
986 | return kTRUE; | |
987 | } | |
988 | //_____________________________________________________________________________ | |
989 | void AliAnalysisTaskGammaCalo::UserExec(Option_t *) | |
990 | { | |
991 | // | |
992 | // Called for each event | |
993 | // | |
994 | Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality(); | |
995 | if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 | |
996 | for(Int_t iCut = 0; iCut<fnCuts; iCut++){ | |
997 | fHistoNEvents[iCut]->Fill(eventQuality); | |
998 | } | |
999 | return; | |
1000 | } | |
1001 | ||
1002 | if(fIsMC) fMCEvent = MCEvent(); | |
1003 | if(fMCEvent == NULL) fIsMC = kFALSE; | |
1004 | ||
1005 | fInputEvent = InputEvent(); | |
1006 | ||
1007 | if(fIsMC && fInputEvent->IsA()==AliESDEvent::Class()){ | |
1008 | fMCStack = fMCEvent->Stack(); | |
1009 | if(fMCStack == NULL) fIsMC = kFALSE; | |
1010 | } | |
1011 | ||
1012 | // ------------------- BeginEvent ---------------------------- | |
1013 | ||
1014 | AliEventplane *EventPlane = fInputEvent->GetEventplane(); | |
1015 | if(fIsHeavyIon ==1)fEventPlaneAngle = EventPlane->GetEventplane("V0",fInputEvent,2); | |
1016 | else fEventPlaneAngle=0.0; | |
1017 | ||
1018 | for(Int_t iCut = 0; iCut<fnCuts; iCut++){ | |
1019 | ||
1020 | fiCut = iCut; | |
1021 | Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon); | |
1022 | ||
1023 | if(eventNotAccepted){ | |
1024 | // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl; | |
1025 | fHistoNEvents[iCut]->Fill(eventNotAccepted); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1 | |
1026 | continue; | |
1027 | } | |
1028 | ||
1029 | if(eventQuality != 0){// Event Not Accepted | |
1030 | //cout << "event rejected due to: " <<eventQuality << endl; | |
1031 | fHistoNEvents[iCut]->Fill(eventQuality); | |
1032 | continue; | |
1033 | } | |
1034 | ||
1035 | fHistoNEvents[iCut]->Fill(eventQuality); // Should be 0 here | |
1036 | fHistoNGoodESDTracks[iCut]->Fill(fV0Reader->GetNumberOfPrimaryTracks()); | |
1037 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->IsHeavyIon() == 2) fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()); | |
1038 | else fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C()); | |
1039 | ||
1040 | if(fIsMC){ | |
1041 | // Process MC Particle | |
1042 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){ | |
1043 | if(fInputEvent->IsA()==AliESDEvent::Class()){ | |
1044 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(), | |
1045 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(), | |
1046 | fMCEvent); | |
1047 | } | |
1048 | else if(fInputEvent->IsA()==AliAODEvent::Class()){ | |
1049 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(), | |
1050 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(), | |
1051 | fInputEvent); | |
1052 | } | |
1053 | ||
1054 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader()){ | |
1055 | for(Int_t i = 0;i<(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader())->GetEntries();i++){ | |
1056 | TString nameBin= fHistoMCHeaders[iCut]->GetXaxis()->GetBinLabel(i+1); | |
1057 | if (nameBin.CompareTo("")== 0){ | |
1058 | TString nameHeader = ((TObjString*)((TList*)((AliConvEventCuts*)fEventCutArray->At(iCut)) | |
1059 | ->GetAcceptedHeader())->At(i))->GetString(); | |
1060 | fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data()); | |
1061 | } | |
1062 | } | |
1063 | } | |
1064 | } | |
1065 | } | |
1066 | if(fIsMC){ | |
1067 | if(fInputEvent->IsA()==AliESDEvent::Class()) | |
1068 | ProcessMCParticles(); | |
1069 | if(fInputEvent->IsA()==AliAODEvent::Class()) | |
1070 | ProcessAODMCParticles(); | |
1071 | } | |
1072 | ||
1073 | // it is in the loop to have the same conversion cut string (used also for MC stuff that should be same for V0 and Cluster) | |
1074 | ProcessClusters(); // process calo clusters | |
1075 | ||
1076 | fHistoNGammaCandidates[iCut]->Fill(fClusterCandidates->GetEntries()); | |
1077 | fHistoNGoodESDTracksVsNGammaCanditates[iCut]->Fill(fV0Reader->GetNumberOfPrimaryTracks(),fClusterCandidates->GetEntries()); | |
1078 | if(fDoMesonAnalysis){ // Meson Analysis | |
1079 | ||
1080 | CalculatePi0Candidates(); // Combine Gammas from conversion and from calo | |
1081 | ||
1082 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){ | |
1083 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){ | |
1084 | CalculateBackground(); // Combinatorial Background | |
1085 | UpdateEventByEventData(); // Store Event for mixed Events | |
1086 | } | |
1087 | ||
1088 | } | |
1089 | } | |
1090 | ||
1091 | fClusterCandidates->Clear(); // delete cluster candidates | |
1092 | } | |
1093 | ||
1094 | PostData(1, fOutputContainer); | |
1095 | } | |
1096 | ||
1097 | //________________________________________________________________________ | |
1098 | void AliAnalysisTaskGammaCalo::ProcessClusters() | |
1099 | { | |
1100 | ||
1101 | Int_t nclus = 0; | |
1102 | nclus = fInputEvent->GetNumberOfCaloClusters(); | |
1103 | ||
1104 | // cout << nclus << endl; | |
1105 | ||
1106 | if(nclus == 0) return; | |
1107 | ||
1108 | // vertex | |
1109 | Double_t vertex[3] = {0}; | |
1110 | InputEvent()->GetPrimaryVertex()->GetXYZ(vertex); | |
1111 | ||
1112 | // Loop over EMCal clusters | |
1113 | for(Long_t i = 0; i < nclus; i++){ | |
1114 | ||
1115 | AliVCluster* clus = NULL; | |
1116 | clus = fInputEvent->GetCaloCluster(i); | |
1117 | if (!clus) continue; | |
1118 | if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelected(clus,fInputEvent,fIsMC)) continue; | |
1119 | // TLorentzvector with cluster | |
1120 | TLorentzVector clusterVector; | |
1121 | clus->GetMomentum(clusterVector,vertex); | |
1122 | ||
1123 | TLorentzVector* tmpvec = new TLorentzVector(); | |
1124 | tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E()); | |
1125 | ||
1126 | // convert to AODConversionPhoton | |
1127 | AliAODConversionPhoton *PhotonCandidate=new AliAODConversionPhoton(tmpvec); | |
1128 | if(!PhotonCandidate) continue; | |
1129 | ||
1130 | // Flag Photon as CaloPhoton | |
1131 | PhotonCandidate->SetIsCaloPhoton(); | |
1132 | PhotonCandidate->SetCaloClusterRef(i); | |
1133 | // get MC label | |
1134 | if(fIsMC){ | |
1135 | Int_t* mclabelsCluster = clus->GetLabels(); | |
1136 | PhotonCandidate->SetNCaloPhotonMCLabels(clus->GetNLabels()); | |
1137 | // cout << clus->GetNLabels() << endl; | |
1138 | if (clus->GetNLabels()>0){ | |
1139 | for (Int_t k =0; k< (Int_t)clus->GetNLabels(); k++){ | |
1140 | if (k< 20)PhotonCandidate->SetCaloPhotonMCLabel(k,mclabelsCluster[k]); | |
1141 | // Int_t pdgCode = fMCStack->Particle(mclabelsCluster[k])->GetPdgCode(); | |
1142 | // cout << "label " << k << "\t" << mclabelsCluster[k] << " pdg code: " << pdgCode << endl; | |
1143 | } | |
1144 | } | |
1145 | } | |
1146 | ||
1147 | fIsFromMBHeader = kTRUE; | |
1148 | // test whether largest contribution to cluster orginates in added signals | |
1149 | if (fIsMC && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCStack, fInputEvent) == 0) fIsFromMBHeader = kFALSE; | |
1150 | ||
1151 | if (fIsFromMBHeader)fHistoClusGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); | |
1152 | fClusterCandidates->Add(PhotonCandidate); // if no second loop is required add to events good gammas | |
1153 | ||
1154 | if(fIsMC){ | |
1155 | if(fInputEvent->IsA()==AliESDEvent::Class()){ | |
1156 | ProcessTrueClusterCandidates(PhotonCandidate); | |
1157 | } else { | |
1158 | ProcessTrueClusterCandidatesAOD(PhotonCandidate); | |
1159 | } | |
1160 | } | |
1161 | ||
1162 | delete tmpvec; | |
1163 | } | |
1164 | ||
1165 | } | |
1166 | ||
1167 | //________________________________________________________________________ | |
1168 | void AliAnalysisTaskGammaCalo::ProcessTrueClusterCandidates(AliAODConversionPhoton *TruePhotonCandidate) | |
1169 | { | |
1170 | ||
1171 | TParticle *Photon = NULL; | |
1172 | if (!TruePhotonCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort"); | |
1173 | fHistoTrueNLabelsInClus[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels()); | |
1174 | ||
1175 | if (TruePhotonCandidate->GetNCaloPhotonMCLabels()>0)Photon = fMCStack->Particle(TruePhotonCandidate->GetCaloPhotonMCLabel(0)); | |
1176 | else return; | |
1177 | ||
1178 | if(Photon == NULL){ | |
1179 | // cout << "no photon" << endl; | |
1180 | return; | |
1181 | } | |
1182 | ||
1183 | Int_t pdgCodeParticle = Photon->GetPdgCode(); | |
1184 | TruePhotonCandidate->SetCaloPhotonMCFlags(fMCStack); | |
1185 | ||
1186 | // True Photon | |
1187 | if(fIsFromMBHeader){ | |
1188 | if (TruePhotonCandidate->IsLargestComponentPhoton() || TruePhotonCandidate->IsLargestComponentElectron() )fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1189 | else fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1190 | if (fDoClusterQA > 0){ | |
1191 | if (TruePhotonCandidate->IsLargestComponentPhoton()){ | |
1192 | fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1193 | fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt()); | |
1194 | } | |
1195 | if (TruePhotonCandidate->IsLargestComponentElectron()) | |
1196 | fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1197 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){ | |
1198 | fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1199 | fHistoTrueClusConvGammaMCPt[fiCut]->Fill(((TParticle*)fMCStack->Particle(Photon->GetMother(0)))->Pt()); | |
1200 | } | |
1201 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion() && TruePhotonCandidate->IsConversionFullyContained()) | |
1202 | fHistoTrueClusConvGammaFullyPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1203 | if (TruePhotonCandidate->IsMerged() || TruePhotonCandidate->IsMergedPartConv() || TruePhotonCandidate->IsDalitzMerged()) | |
1204 | fHistoTrueClusMergedGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1205 | if (TruePhotonCandidate->IsMergedPartConv()) | |
1206 | fHistoTrueClusMergedPartConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1207 | if (TruePhotonCandidate->IsDalitz()) | |
1208 | fHistoTrueClusDalitzPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1209 | if (TruePhotonCandidate->IsDalitzMerged()) | |
1210 | fHistoTrueClusDalitzMergedPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1211 | if (TruePhotonCandidate->IsPhotonWithElecMother()) | |
1212 | fHistoTrueClusPhotonFromElecMotherPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1213 | if (TruePhotonCandidate->IsShower()) | |
1214 | fHistoTrueClusShowerPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1215 | if (TruePhotonCandidate->IsSubLeadingEM()) | |
1216 | fHistoTrueClusSubLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1217 | fHistoTrueClusNParticles[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMotherMCLabels()); | |
1218 | if (!TruePhotonCandidate->IsLargestComponentPhoton()) | |
1219 | FillPhotonBackgroundHist(TruePhotonCandidate,pdgCodeParticle); | |
1220 | if (!(TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) ) | |
1221 | FillPhotonPlusConversionBackgroundHist(TruePhotonCandidate,pdgCodeParticle); | |
1222 | } | |
1223 | ||
1224 | if(Photon->GetMother(0) <= fMCStack->GetNprimary()){ | |
1225 | if (TruePhotonCandidate->IsLargestComponentPhoton()){ | |
1226 | fHistoTruePrimaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1227 | fHistoTruePrimaryClusGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt()); // Allways Filled | |
1228 | } | |
1229 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){ | |
1230 | fHistoTruePrimaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1231 | fHistoTruePrimaryClusConvGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt()); // Allways Filled | |
1232 | } | |
1233 | ||
1234 | } else { | |
1235 | if (TruePhotonCandidate->IsLargestComponentPhoton()) | |
1236 | fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1237 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) | |
1238 | fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1239 | if(fMCStack->Particle(Photon->GetMother(0))->GetMother(0) > -1){ | |
1240 | if(fMCStack->Particle(fMCStack->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 3122){ | |
1241 | if (TruePhotonCandidate->IsLargestComponentPhoton()) | |
1242 | fHistoTrueSecondaryClusGammaFromXFromLambdaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1243 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) | |
1244 | fHistoTrueSecondaryClusConvGammaFromXFromLambdaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1245 | } | |
1246 | if(fMCStack->Particle(fMCStack->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 310){ | |
1247 | if (TruePhotonCandidate->IsLargestComponentPhoton()) | |
1248 | fHistoTrueSecondaryClusGammaFromXFromK0sPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1249 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) | |
1250 | fHistoTrueSecondaryClusConvGammaFromXFromK0sPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1251 | } | |
1252 | if(fMCStack->Particle(fMCStack->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 221){ | |
1253 | if (TruePhotonCandidate->IsLargestComponentPhoton()) | |
1254 | fHistoTrueSecondaryClusGammaFromXFromEtasPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1255 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) | |
1256 | fHistoTrueSecondaryClusConvGammaFromXFromEtasPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1257 | ||
1258 | } | |
1259 | } | |
1260 | } | |
1261 | } | |
1262 | return; | |
1263 | } | |
1264 | ||
1265 | ||
1266 | //________________________________________________________________________ | |
1267 | void AliAnalysisTaskGammaCalo::ProcessTrueClusterCandidatesAOD(AliAODConversionPhoton *TruePhotonCandidate) | |
1268 | { | |
1269 | AliAODMCParticle *Photon = NULL; | |
1270 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
1271 | if (AODMCTrackArray){ | |
1272 | if (!TruePhotonCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort"); | |
1273 | if (TruePhotonCandidate->GetNCaloPhotonMCLabels()>0) Photon = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->GetCaloPhotonMCLabel(0)); | |
1274 | else return; | |
1275 | } else { | |
1276 | AliInfo("AODMCTrackArray could not be loaded"); | |
1277 | return; | |
1278 | } | |
1279 | ||
1280 | if(Photon == NULL){ | |
1281 | // cout << "no photon" << endl; | |
1282 | return; | |
1283 | } | |
1284 | Int_t pdgCodeParticle = Photon->GetPdgCode(); | |
1285 | TruePhotonCandidate->SetCaloPhotonMCFlagsAOD(fInputEvent); | |
1286 | ||
1287 | // True Photon | |
1288 | if(fIsFromMBHeader){ | |
1289 | if (TruePhotonCandidate->IsLargestComponentPhoton() || TruePhotonCandidate->IsLargestComponentElectron() )fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1290 | else fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1291 | if (fDoClusterQA > 0){ | |
1292 | if (TruePhotonCandidate->IsLargestComponentPhoton()) { | |
1293 | fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1294 | fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt()); | |
1295 | } | |
1296 | if (TruePhotonCandidate->IsLargestComponentElectron()) | |
1297 | fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1298 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) { | |
1299 | fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1300 | AliAODMCParticle *Mother = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother()); | |
1301 | fHistoTrueClusConvGammaMCPt[fiCut]->Fill(Mother->Pt()); | |
1302 | } | |
1303 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion() && TruePhotonCandidate->IsConversionFullyContained()) | |
1304 | fHistoTrueClusConvGammaFullyPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1305 | if (TruePhotonCandidate->IsMerged() || TruePhotonCandidate->IsMergedPartConv() || TruePhotonCandidate->IsDalitzMerged()) | |
1306 | fHistoTrueClusMergedGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1307 | if (TruePhotonCandidate->IsMergedPartConv()) | |
1308 | fHistoTrueClusMergedPartConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1309 | if (TruePhotonCandidate->IsDalitz()) | |
1310 | fHistoTrueClusDalitzPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1311 | if (TruePhotonCandidate->IsDalitzMerged()) | |
1312 | fHistoTrueClusDalitzMergedPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1313 | if (TruePhotonCandidate->IsPhotonWithElecMother()) | |
1314 | fHistoTrueClusPhotonFromElecMotherPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1315 | if (TruePhotonCandidate->IsShower()) | |
1316 | fHistoTrueClusShowerPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1317 | if (TruePhotonCandidate->IsSubLeadingEM()) | |
1318 | fHistoTrueClusSubLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1319 | fHistoTrueClusNParticles[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMotherMCLabels()); | |
1320 | ||
1321 | if (!TruePhotonCandidate->IsLargestComponentPhoton()) | |
1322 | FillPhotonBackgroundHist(TruePhotonCandidate,pdgCodeParticle); | |
1323 | if (!(TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) ) | |
1324 | FillPhotonPlusConversionBackgroundHist(TruePhotonCandidate,pdgCodeParticle); | |
1325 | } | |
1326 | ||
1327 | if(Photon->IsPrimary()){ | |
1328 | if (TruePhotonCandidate->IsLargestComponentPhoton()){ | |
1329 | fHistoTruePrimaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1330 | fHistoTruePrimaryClusGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt()); // Allways Filled | |
1331 | } | |
1332 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){ | |
1333 | fHistoTruePrimaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1334 | fHistoTruePrimaryClusConvGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt()); // Allways Filled | |
1335 | } | |
1336 | ||
1337 | } else { | |
1338 | if (TruePhotonCandidate->IsLargestComponentPhoton()) | |
1339 | fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1340 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) | |
1341 | fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1342 | if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1){ | |
1343 | if(((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 3122){ | |
1344 | if (TruePhotonCandidate->IsLargestComponentPhoton()) | |
1345 | fHistoTrueSecondaryClusGammaFromXFromLambdaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1346 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) | |
1347 | fHistoTrueSecondaryClusConvGammaFromXFromLambdaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1348 | } | |
1349 | if(((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 310){ | |
1350 | if (TruePhotonCandidate->IsLargestComponentPhoton()) | |
1351 | fHistoTrueSecondaryClusGammaFromXFromK0sPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1352 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) | |
1353 | fHistoTrueSecondaryClusConvGammaFromXFromK0sPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1354 | } | |
1355 | if(((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 221){ | |
1356 | if (TruePhotonCandidate->IsLargestComponentPhoton()) | |
1357 | fHistoTrueSecondaryClusGammaFromXFromEtasPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1358 | if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) | |
1359 | fHistoTrueSecondaryClusConvGammaFromXFromEtasPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1360 | ||
1361 | } | |
1362 | } | |
1363 | } | |
1364 | } | |
1365 | } | |
1366 | ||
1367 | //________________________________________________________________________ | |
1368 | void AliAnalysisTaskGammaCalo::ProcessAODMCParticles() | |
1369 | { | |
1370 | ||
1371 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
1372 | ||
1373 | // Loop over all primary MC particle | |
1374 | for(Int_t i = 0; i < AODMCTrackArray->GetEntriesFast(); i++) { | |
1375 | ||
1376 | AliAODMCParticle* particle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(i)); | |
1377 | if (!particle) continue; | |
1378 | if (!particle->IsPrimary()) continue; | |
1379 | ||
1380 | Int_t isMCFromMBHeader = -1; | |
1381 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
1382 | isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent); | |
1383 | if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1384 | } | |
1385 | ||
1386 | if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(particle,AODMCTrackArray)){ | |
1387 | fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma | |
1388 | if(particle->GetMother() >-1){ // Meson Decay Gamma | |
1389 | switch((static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother())))->GetPdgCode()){ | |
1390 | case 111: // Pi0 | |
1391 | fHistoMCDecayGammaPi0Pt[fiCut]->Fill(particle->Pt()); | |
1392 | break; | |
1393 | case 113: // Rho0 | |
1394 | fHistoMCDecayGammaRhoPt[fiCut]->Fill(particle->Pt()); | |
1395 | break; | |
1396 | case 221: // Eta | |
1397 | fHistoMCDecayGammaEtaPt[fiCut]->Fill(particle->Pt()); | |
1398 | break; | |
1399 | case 223: // Omega | |
1400 | fHistoMCDecayGammaOmegaPt[fiCut]->Fill(particle->Pt()); | |
1401 | break; | |
1402 | case 331: // Eta' | |
1403 | fHistoMCDecayGammaEtapPt[fiCut]->Fill(particle->Pt()); | |
1404 | break; | |
1405 | case 333: // Phi | |
1406 | fHistoMCDecayGammaPhiPt[fiCut]->Fill(particle->Pt()); | |
1407 | break; | |
1408 | case 3212: // Sigma | |
1409 | fHistoMCDecayGammaSigmaPt[fiCut]->Fill(particle->Pt()); | |
1410 | break; | |
1411 | } | |
1412 | } | |
1413 | } | |
1414 | // Converted MC Gamma | |
1415 | if(fDoMesonAnalysis){ | |
1416 | if(particle->GetPdgCode() == 310 && fDoMesonQA > 0){ | |
1417 | Double_t mesonY = 10.; | |
1418 | if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){ | |
1419 | mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1420 | } else { | |
1421 | mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1422 | } | |
1423 | Float_t weightedK0s= 1; | |
1424 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ | |
1425 | if (particle->Pt()>0.005){ | |
1426 | weightedK0s= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, 0x0, fInputEvent); | |
1427 | //cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1428 | } | |
1429 | } | |
1430 | fHistoMCK0sPt[fiCut]->Fill(particle->Pt(),weightedK0s); | |
1431 | fHistoMCK0sWOWeightPt[fiCut]->Fill(particle->Pt()); | |
1432 | fHistoMCK0sPtY[fiCut]->Fill(particle->Pt(),mesonY,weightedK0s); | |
1433 | } | |
1434 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut)) | |
1435 | ->MesonIsSelectedAODMC(particle,AODMCTrackArray,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ | |
1436 | AliAODMCParticle* daughter0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughter(0))); | |
1437 | AliAODMCParticle* daughter1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughter(1))); | |
1438 | Float_t weighted= 1; | |
1439 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ | |
1440 | if (particle->Pt()>0.005){ | |
1441 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, 0x0, fInputEvent); | |
1442 | // if(particle->GetPdgCode() == 221){ | |
1443 | // cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1444 | // } | |
1445 | } | |
1446 | } | |
1447 | Double_t mesonY = 10.; | |
1448 | if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){ | |
1449 | mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1450 | } else{ | |
1451 | mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1452 | } | |
1453 | ||
1454 | if(particle->GetPdgCode() == 111){ | |
1455 | fHistoMCPi0Pt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0 | |
1456 | fHistoMCPi0WOWeightPt[fiCut]->Fill(particle->Pt()); | |
1457 | if (fDoMesonQA > 0) fHistoMCPi0PtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0 | |
1458 | } else if(particle->GetPdgCode() == 221){ | |
1459 | fHistoMCEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Eta | |
1460 | fHistoMCEtaWOWeightPt[fiCut]->Fill(particle->Pt()); | |
1461 | if (fDoMesonQA > 0) fHistoMCEtaPtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0 | |
1462 | } | |
1463 | ||
1464 | // Check the acceptance for both gammas | |
1465 | if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(daughter0,AODMCTrackArray) && | |
1466 | ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(daughter1,AODMCTrackArray) ){ | |
1467 | ||
1468 | if(particle->GetPdgCode() == 111){ | |
1469 | fHistoMCPi0InAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Pi0 with gamma in acc | |
1470 | } else if(particle->GetPdgCode() == 221){ | |
1471 | fHistoMCEtaInAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Eta with gamma in acc | |
1472 | } | |
1473 | } | |
1474 | } | |
1475 | } | |
1476 | } | |
1477 | ||
1478 | } | |
1479 | //________________________________________________________________________ | |
1480 | void AliAnalysisTaskGammaCalo::ProcessMCParticles() | |
1481 | { | |
1482 | // Loop over all primary MC particle | |
1483 | for(Int_t i = 0; i < fMCStack->GetNprimary(); i++) { | |
1484 | TParticle* particle = (TParticle *)fMCStack->Particle(i); | |
1485 | if (!particle) continue; | |
1486 | ||
1487 | Int_t isMCFromMBHeader = -1; | |
1488 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
1489 | isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent); | |
1490 | if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1491 | } | |
1492 | ||
1493 | if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(particle,fMCStack)){ | |
1494 | fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma | |
1495 | if(particle->GetMother(0) >-1){ // Meson Decay Gamma | |
1496 | switch(fMCStack->Particle(particle->GetMother(0))->GetPdgCode()){ | |
1497 | case 111: // Pi0 | |
1498 | fHistoMCDecayGammaPi0Pt[fiCut]->Fill(particle->Pt()); | |
1499 | break; | |
1500 | case 113: // Rho0 | |
1501 | fHistoMCDecayGammaRhoPt[fiCut]->Fill(particle->Pt()); | |
1502 | break; | |
1503 | case 221: // Eta | |
1504 | fHistoMCDecayGammaEtaPt[fiCut]->Fill(particle->Pt()); | |
1505 | break; | |
1506 | case 223: // Omega | |
1507 | fHistoMCDecayGammaOmegaPt[fiCut]->Fill(particle->Pt()); | |
1508 | break; | |
1509 | case 331: // Eta' | |
1510 | fHistoMCDecayGammaEtapPt[fiCut]->Fill(particle->Pt()); | |
1511 | break; | |
1512 | case 333: // Phi | |
1513 | fHistoMCDecayGammaPhiPt[fiCut]->Fill(particle->Pt()); | |
1514 | break; | |
1515 | case 3212: // Sigma | |
1516 | fHistoMCDecayGammaSigmaPt[fiCut]->Fill(particle->Pt()); | |
1517 | break; | |
1518 | } | |
1519 | } | |
1520 | } | |
1521 | if(fDoMesonAnalysis){ | |
1522 | if(particle->GetPdgCode() == 310 && fDoMesonQA > 0){ | |
1523 | Double_t mesonY = 10.; | |
1524 | if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){ | |
1525 | mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1526 | } else{ | |
1527 | mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1528 | } | |
1529 | Float_t weightedK0s= 1; | |
1530 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ | |
1531 | if (particle->Pt()>0.005){ | |
1532 | weightedK0s= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent); | |
1533 | //cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1534 | } | |
1535 | } | |
1536 | if (fMCStack->IsPhysicalPrimary(i)){ | |
1537 | fHistoMCK0sPt[fiCut]->Fill(particle->Pt(),weightedK0s); | |
1538 | fHistoMCK0sWOWeightPt[fiCut]->Fill(particle->Pt()); | |
1539 | fHistoMCK0sPtY[fiCut]->Fill(particle->Pt(),mesonY,weightedK0s); | |
1540 | } | |
1541 | } | |
1542 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut)) | |
1543 | ->MesonIsSelectedMC(particle,fMCStack,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ | |
1544 | TParticle* daughter0 = (TParticle*)fMCStack->Particle(particle->GetFirstDaughter()); | |
1545 | TParticle* daughter1 = (TParticle*)fMCStack->Particle(particle->GetLastDaughter()); | |
1546 | ||
1547 | Float_t weighted= 1; | |
1548 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ | |
1549 | if (particle->Pt()>0.005){ | |
1550 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent); | |
1551 | // if(particle->GetPdgCode() == 221){ | |
1552 | // cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1553 | // } | |
1554 | } | |
1555 | } | |
1556 | Double_t mesonY = 10.; | |
1557 | if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){ | |
1558 | mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1559 | } else{ | |
1560 | mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1561 | } | |
1562 | ||
1563 | if(particle->GetPdgCode() == 111){ | |
1564 | fHistoMCPi0Pt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0 | |
1565 | fHistoMCPi0WOWeightPt[fiCut]->Fill(particle->Pt()); | |
1566 | if (fDoMesonQA > 0) fHistoMCPi0PtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0 | |
1567 | } else if(particle->GetPdgCode() == 221){ | |
1568 | fHistoMCEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Eta | |
1569 | fHistoMCEtaWOWeightPt[fiCut]->Fill(particle->Pt()); | |
1570 | if (fDoMesonQA > 0) fHistoMCEtaPtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0 | |
1571 | } | |
1572 | ||
1573 | // Check the acceptance for both gammas | |
1574 | if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(daughter0,fMCStack) && | |
1575 | ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(daughter1,fMCStack) ){ | |
1576 | if(particle->GetPdgCode() == 111){ | |
1577 | fHistoMCPi0InAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Pi0 with gamma in acc | |
1578 | } else if(particle->GetPdgCode() == 221){ | |
1579 | fHistoMCEtaInAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Eta with gamma in acc | |
1580 | } | |
1581 | } | |
1582 | } | |
1583 | } | |
1584 | } | |
1585 | ||
1586 | if (fDoMesonQA){ | |
1587 | for(Int_t i = fMCStack->GetNprimary(); i < fMCStack->GetNtrack(); i++) { | |
1588 | TParticle* particle = (TParticle *)fMCStack->Particle(i); | |
1589 | if (!particle) continue; | |
1590 | ||
1591 | Int_t isMCFromMBHeader = -1; | |
1592 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
1593 | isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent); | |
1594 | if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1595 | } | |
1596 | ||
1597 | if(fDoMesonAnalysis){ | |
1598 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMC(particle,fMCStack,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ | |
1599 | Float_t weighted= 1; | |
1600 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ | |
1601 | if (particle->Pt()>0.005){ | |
1602 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent); | |
1603 | // if(particle->GetPdgCode() == 221){ | |
1604 | // cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1605 | // } | |
1606 | } | |
1607 | } | |
1608 | ||
1609 | if(particle->GetPdgCode() == 111){ | |
1610 | Int_t pdgCode = ((TParticle*)fMCStack->Particle( particle->GetFirstMother() ))->GetPdgCode(); | |
1611 | Int_t source = GetSourceClassification(111,pdgCode); | |
1612 | fHistoMCSecPi0PtvsSource[fiCut]->Fill(particle->Pt(),source,weighted); // All MC Pi0 | |
1613 | fHistoMCSecPi0Source[fiCut]->Fill(pdgCode); | |
1614 | } else if(particle->GetPdgCode() == 221){ | |
1615 | Int_t pdgCode = ((TParticle*)fMCStack->Particle( particle->GetFirstMother() ))->GetPdgCode(); | |
1616 | fHistoMCSecEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0 | |
1617 | fHistoMCSecEtaSource[fiCut]->Fill(pdgCode); | |
1618 | } | |
1619 | } | |
1620 | } | |
1621 | } | |
1622 | } | |
1623 | } | |
1624 | ||
1625 | //________________________________________________________________________ | |
1626 | void AliAnalysisTaskGammaCalo::CalculatePi0Candidates(){ | |
1627 | ||
1628 | // Conversion Gammas | |
1629 | if(fClusterCandidates->GetEntries()>0){ | |
1630 | ||
1631 | // vertex | |
1632 | Double_t vertex[3] = {0}; | |
1633 | InputEvent()->GetPrimaryVertex()->GetXYZ(vertex); | |
1634 | ||
1635 | for(Int_t firstGammaIndex=0;firstGammaIndex<fClusterCandidates->GetEntries();firstGammaIndex++){ | |
1636 | AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(firstGammaIndex)); | |
1637 | if (gamma0==NULL) continue; | |
1638 | ||
1639 | for(Int_t secondGammaIndex=0;secondGammaIndex<fClusterCandidates->GetEntries();secondGammaIndex++){ | |
8c96b4f9 | 1640 | if (firstGammaIndex == secondGammaIndex) continue; |
d53bf4ac | 1641 | AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(secondGammaIndex)); |
1642 | if (gamma1==NULL) continue; | |
8c96b4f9 | 1643 | |
d53bf4ac | 1644 | AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma0,gamma1); |
1645 | pi0cand->SetLabels(firstGammaIndex,secondGammaIndex); | |
1646 | ||
1647 | ||
1648 | ||
1649 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
1650 | fHistoMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt()); | |
1651 | // fill new histograms | |
1652 | if(pi0cand->GetAlpha()<0.1) | |
1653 | fHistoMotherInvMassEalpha[fiCut]->Fill(pi0cand->M(),pi0cand->E()); | |
1654 | ||
1655 | if (fDoMesonQA > 0){ | |
1656 | if ( pi0cand->M() > 0.05 && pi0cand->M() < 0.17){ | |
1657 | fHistoMotherPi0PtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1658 | fHistoMotherPi0PtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha()); | |
1659 | fHistoMotherPi0PtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle()); | |
1660 | } | |
1661 | if ( pi0cand->M() > 0.45 && pi0cand->M() < 0.65){ | |
1662 | fHistoMotherEtaPtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1663 | fHistoMotherEtaPtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha()); | |
1664 | fHistoMotherEtaPtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle()); | |
1665 | } | |
1666 | } | |
1667 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){ | |
1668 | Int_t zbin = 0; | |
1669 | Int_t mbin = 0; | |
1670 | ||
1671 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->BackgroundHandlerType() == 0){ | |
1672 | zbin = fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ()); | |
1673 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
1674 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks()); | |
1675 | } else { | |
1676 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fClusterCandidates->GetEntries()); | |
1677 | } | |
1678 | } | |
1679 | Double_t sparesFill[4] = {pi0cand->M(),pi0cand->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
1680 | fSparseMotherInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
1681 | } | |
1682 | ||
1683 | if(fIsMC){ | |
1684 | if(fInputEvent->IsA()==AliESDEvent::Class()) | |
1685 | ProcessTrueMesonCandidates(pi0cand,gamma0,gamma1); | |
1686 | if(fInputEvent->IsA()==AliAODEvent::Class()) | |
1687 | ProcessTrueMesonCandidatesAOD(pi0cand,gamma0,gamma1); | |
1688 | } | |
1689 | ||
1690 | if (fDoMesonQA == 1){ | |
1691 | fHistoMotherInvMassECalib[fiCut]->Fill(pi0cand->M(),gamma1->E()); | |
1692 | if(pi0cand->GetAlpha()<0.1) | |
1693 | fHistoMotherInvMassECalibalpha[fiCut]->Fill(pi0cand->M(),gamma1->E()); | |
1694 | } | |
1695 | ||
1696 | } | |
8c96b4f9 | 1697 | for (Int_t thirdGammaIndex=0;thirdGammaIndex<fClusterCandidates->GetEntries();thirdGammaIndex++){ |
1698 | if (firstGammaIndex == thirdGammaIndex || secondGammaIndex == thirdGammaIndex ) continue; | |
1699 | AliAODConversionPhoton *gamma2=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(thirdGammaIndex)); | |
1700 | if (gamma2==NULL) continue; | |
1701 | ||
1702 | AliAODConversionMother *pi0cand2 = new AliAODConversionMother(pi0cand,gamma2); | |
1703 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand2,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
1704 | fHistoMotherInvMass3ClusterPt[fiCut]->Fill(pi0cand2->M(),pi0cand2->Pt()); | |
1705 | } | |
1706 | delete pi0cand2; | |
1707 | pi0cand2=0x0; | |
1708 | ||
1709 | } | |
1710 | ||
d53bf4ac | 1711 | delete pi0cand; |
1712 | pi0cand=0x0; | |
1713 | } | |
1714 | } | |
1715 | } | |
1716 | } | |
1717 | //______________________________________________________________________ | |
1718 | void AliAnalysisTaskGammaCalo::ProcessTrueMesonCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1) | |
1719 | { | |
1720 | // Process True Mesons | |
1721 | AliStack *MCStack = fMCEvent->Stack(); | |
1722 | ||
1723 | Bool_t isTruePi0 = kFALSE; | |
1724 | Bool_t isTrueEta = kFALSE; | |
1725 | Int_t gamma0MCLabel = TrueGammaCandidate0->GetCaloPhotonMCLabel(0); // get most probable MC label | |
1726 | Int_t gamma0MotherLabel = -1; | |
1727 | ||
1728 | if(gamma0MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
1729 | TParticle * gammaMC0 = (TParticle*)MCStack->Particle(gamma0MCLabel); | |
1730 | if (TrueGammaCandidate0->IsLargestComponentPhoton() || TrueGammaCandidate0->IsLargestComponentElectron()){ // largest component is electro magnetic | |
1731 | // get mother of interest (pi0 or eta) | |
1732 | if (TrueGammaCandidate0->IsLargestComponentPhoton()){ // for photons its the direct mother | |
1733 | gamma0MotherLabel=gammaMC0->GetMother(0); | |
1734 | } else if (TrueGammaCandidate0->IsLargestComponentElectron()){ // for electrons its either the direct mother or for conversions the grandmother | |
1735 | if (TrueGammaCandidate0->IsConversion()) gamma0MotherLabel=MCStack->Particle(gammaMC0->GetMother(0))->GetMother(0); | |
1736 | else gamma0MotherLabel=gammaMC0->GetMother(0); | |
1737 | } | |
1738 | } | |
1739 | } | |
1740 | if (!TrueGammaCandidate1->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set. Aborting"); | |
1741 | ||
1742 | Int_t gamma1MCLabel = TrueGammaCandidate1->GetCaloPhotonMCLabel(0); // get most probable MC label | |
1743 | Int_t gamma1MotherLabel = -1; | |
1744 | // check if | |
1745 | ||
1746 | if(gamma1MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
1747 | // Daughters Gamma 1 | |
1748 | TParticle * gammaMC1 = (TParticle*)MCStack->Particle(gamma1MCLabel); | |
1749 | if (TrueGammaCandidate1->IsLargestComponentPhoton() || TrueGammaCandidate1->IsLargestComponentElectron()){ // largest component is electro magnetic | |
1750 | // get mother of interest (pi0 or eta) | |
1751 | if (TrueGammaCandidate1->IsLargestComponentPhoton()){ // for photons its the direct mother | |
1752 | gamma1MotherLabel=gammaMC1->GetMother(0); | |
1753 | } else if (TrueGammaCandidate1->IsLargestComponentElectron()){ // for electrons its either the direct mother or for conversions the grandmother | |
1754 | if (TrueGammaCandidate1->IsConversion()) gamma1MotherLabel=MCStack->Particle(gammaMC1->GetMother(0))->GetMother(0); | |
1755 | else gamma1MotherLabel=gammaMC1->GetMother(0); | |
1756 | } | |
1757 | } | |
1758 | } | |
1759 | ||
1760 | if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){ | |
1761 | if(((TParticle*)MCStack->Particle(gamma1MotherLabel))->GetPdgCode() == 111){ | |
1762 | isTruePi0=kTRUE; | |
1763 | } | |
1764 | if(((TParticle*)MCStack->Particle(gamma1MotherLabel))->GetPdgCode() == 221){ | |
1765 | isTrueEta=kTRUE; | |
1766 | } | |
1767 | } | |
1768 | ||
1769 | if(isTruePi0 || isTrueEta){// True Pion or Eta | |
1770 | fHistoTrueMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1771 | if (fDoMesonQA > 0){ | |
1772 | // both gammas are real gammas | |
1773 | if (TrueGammaCandidate0->IsLargestComponentPhoton() && TrueGammaCandidate1->IsLargestComponentPhoton()) | |
1774 | fHistoTrueMotherCaloPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1775 | // both particles are electrons | |
1776 | if (TrueGammaCandidate0->IsLargestComponentElectron() && TrueGammaCandidate1->IsLargestComponentElectron() ) | |
1777 | fHistoTrueMotherCaloElectronInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1778 | // both particles are converted electrons | |
1779 | if ((TrueGammaCandidate0->IsLargestComponentElectron() && TrueGammaCandidate0->IsConversion()) && (TrueGammaCandidate1->IsLargestComponentElectron() && TrueGammaCandidate1->IsConversion()) ){ | |
1780 | fHistoTrueMotherCaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1781 | if (isTruePi0 )fHistoTruePi0CaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1782 | if (isTrueEta )fHistoTrueEtaCaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1783 | } | |
1784 | // 1 gamma is converted the other one is normals | |
1785 | if ( (TrueGammaCandidate0->IsLargestComponentPhoton() && TrueGammaCandidate1->IsLargestComponentElectron() && TrueGammaCandidate1->IsConversion()) || | |
1786 | (TrueGammaCandidate1->IsLargestComponentPhoton() && TrueGammaCandidate0->IsLargestComponentElectron() && TrueGammaCandidate0->IsConversion()) | |
1787 | ) | |
1788 | fHistoTrueMotherCaloMixedPhotonConvPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1789 | ||
1790 | // at least one of the photon is merged | |
1791 | if (TrueGammaCandidate0->IsMerged() || TrueGammaCandidate0->IsMergedPartConv() || TrueGammaCandidate0->IsDalitzMerged() || TrueGammaCandidate1->IsMerged() || TrueGammaCandidate1->IsMergedPartConv() || TrueGammaCandidate1->IsDalitzMerged() ) | |
1792 | fHistoTrueMotherCaloMergedClusterInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1793 | // at least one of the photon is merged and part conv | |
1794 | if (TrueGammaCandidate1->IsMergedPartConv() || TrueGammaCandidate0->IsMergedPartConv()) | |
1795 | fHistoTrueMotherCaloMergedClusterPartConvInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1796 | } | |
1797 | ||
1798 | if (fDoMesonQA > 0){ | |
1799 | if (isTruePi0){ | |
1800 | if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){ | |
1801 | fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1802 | fHistoTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha()); | |
1803 | fHistoTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle()); | |
1804 | } | |
1805 | } else if (isTrueEta){ | |
1806 | if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){ | |
1807 | fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1808 | fHistoTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha()); | |
1809 | fHistoTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle()); | |
1810 | } | |
1811 | } | |
1812 | } | |
1813 | ||
1814 | if(gamma0MotherLabel >= MCStack->GetNprimary()){ // Secondary Meson | |
1815 | Int_t secMotherLabel = ((TParticle*)MCStack->Particle(gamma0MotherLabel))->GetMother(0); | |
1816 | Float_t weightedSec= 1; | |
1817 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, fMCStack, fInputEvent) && MCStack->Particle(secMotherLabel)->GetPdgCode()==310){ | |
1818 | weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, fMCStack, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt | |
1819 | //cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1820 | } | |
1821 | fHistoTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
1822 | if (secMotherLabel >-1){ | |
1823 | if(MCStack->Particle(secMotherLabel)->GetPdgCode()==310){ | |
1824 | fHistoTrueSecondaryMotherFromK0sInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
1825 | if (fDoMesonQA > 0)fHistoTrueK0sWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt()); | |
1826 | } | |
1827 | if(MCStack->Particle(secMotherLabel)->GetPdgCode()==221){ | |
1828 | fHistoTrueSecondaryMotherFromEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
1829 | if (fDoMesonQA > 0)fHistoTrueEtaWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt()); | |
1830 | } | |
1831 | if(MCStack->Particle(secMotherLabel)->GetPdgCode()==3122){ | |
1832 | fHistoTrueSecondaryMotherFromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
1833 | if (fDoMesonQA > 0)fHistoTrueLambdaWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt()); | |
1834 | } | |
1835 | } | |
1836 | } else { // Only primary pi0 for efficiency calculation | |
1837 | Float_t weighted= 1; | |
1838 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, fMCStack, fInputEvent)){ | |
1839 | if (((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt()>0.005){ | |
1840 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, fMCStack, fInputEvent); | |
1841 | // cout << "rec \t " <<gamma1MotherLabel << "\t" << weighted << endl; | |
1842 | } | |
1843 | } | |
1844 | fHistoTruePrimaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
1845 | fHistoTruePrimaryMotherW0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1846 | fProfileTruePrimaryMotherWeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
1847 | ||
1848 | if (fDoMesonQA > 0){ | |
1849 | if(isTruePi0){ // Only primary pi0 for resolution | |
1850 | fHistoTruePrimaryPi0MCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted); | |
1851 | } | |
1852 | if (isTrueEta){ // Only primary eta for resolution | |
1853 | fHistoTruePrimaryEtaMCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted); | |
1854 | } | |
1855 | } | |
1856 | } | |
1857 | } else if(!isTruePi0 && !isTrueEta){ // Background | |
1858 | if (fDoMesonQA > 0){ | |
1859 | if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){ // Both Tracks are Photons and have a mother but not Pi0 or Eta | |
1860 | fHistoTrueBckGGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1861 | } else { // No photon or without mother | |
1862 | fHistoTrueBckContInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1863 | } | |
1864 | } | |
1865 | } | |
1866 | ||
1867 | } | |
1868 | //______________________________________________________________________ | |
1869 | void AliAnalysisTaskGammaCalo::ProcessTrueMesonCandidatesAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1) | |
1870 | { | |
1871 | ||
1872 | // Process True Mesons | |
1873 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
1874 | Bool_t isTruePi0 = kFALSE; | |
1875 | Bool_t isTrueEta = kFALSE; | |
1876 | ||
1877 | Int_t gamma0MCLabel = TrueGammaCandidate1->GetCaloPhotonMCLabel(0); // get most probable MC label | |
1878 | Int_t gamma0MotherLabel = -1; | |
1879 | // check if | |
1880 | ||
1881 | if(gamma0MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
1882 | // Daughters Gamma 0 | |
1883 | AliAODMCParticle * gammaMC0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MCLabel)); | |
1884 | if (TrueGammaCandidate0->IsLargestComponentPhoton() || TrueGammaCandidate0->IsLargestComponentElectron()){ // largest component is electro magnetic | |
1885 | // get mother of interest (pi0 or eta) | |
1886 | if (TrueGammaCandidate0->IsLargestComponentPhoton()){ // for photons its the direct mother | |
1887 | gamma0MotherLabel=gammaMC0->GetMother(); | |
1888 | } else if (TrueGammaCandidate0->IsLargestComponentElectron()){ // for electrons its either the direct mother or for conversions the grandmother | |
1889 | if (TrueGammaCandidate0->IsConversion()){ | |
1890 | AliAODMCParticle * gammaGrandMotherMC0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gammaMC0->GetMother())); | |
1891 | gamma0MotherLabel=gammaGrandMotherMC0->GetMother(); | |
1892 | } else gamma0MotherLabel=gammaMC0->GetMother(); | |
1893 | } | |
1894 | } | |
1895 | } | |
1896 | ||
1897 | Int_t gamma1MCLabel = TrueGammaCandidate1->GetCaloPhotonMCLabel(0); // get most probable MC label | |
1898 | Int_t gamma1MotherLabel = -1; | |
1899 | // check if | |
1900 | ||
1901 | if(gamma1MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
1902 | // Daughters Gamma 1 | |
1903 | AliAODMCParticle * gammaMC1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MCLabel)); | |
1904 | if (TrueGammaCandidate1->IsLargestComponentPhoton() || TrueGammaCandidate1->IsLargestComponentElectron()){ // largest component is electro magnetic | |
1905 | // get mother of interest (pi0 or eta) | |
1906 | if (TrueGammaCandidate1->IsLargestComponentPhoton()){ // for photons its the direct mother | |
1907 | gamma1MotherLabel=gammaMC1->GetMother(); | |
1908 | } else if (TrueGammaCandidate1->IsLargestComponentElectron()){ // for electrons its either the direct mother or for conversions the grandmother | |
1909 | if (TrueGammaCandidate1->IsConversion()){ | |
1910 | AliAODMCParticle * gammaGrandMotherMC1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gammaMC1->GetMother())); | |
1911 | gamma1MotherLabel=gammaGrandMotherMC1->GetMother(); | |
1912 | } else gamma1MotherLabel=gammaMC1->GetMother(); | |
1913 | } | |
1914 | } | |
1915 | } | |
1916 | ||
1917 | if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){ | |
1918 | if(((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){ | |
1919 | isTruePi0=kTRUE; | |
1920 | } | |
1921 | if(((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 221){ | |
1922 | isTrueEta=kTRUE; | |
1923 | } | |
1924 | } | |
1925 | ||
1926 | if(isTruePi0 || isTrueEta){// True Pion or Eta | |
1927 | fHistoTrueMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1928 | if (fDoMesonQA > 0){ | |
1929 | // both gammas are real gammas | |
1930 | if (TrueGammaCandidate0->IsLargestComponentPhoton() && TrueGammaCandidate1->IsLargestComponentPhoton()) | |
1931 | fHistoTrueMotherCaloPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1932 | // both particles are electrons | |
1933 | if (TrueGammaCandidate0->IsLargestComponentElectron() && TrueGammaCandidate1->IsLargestComponentElectron() ) | |
1934 | fHistoTrueMotherCaloElectronInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1935 | // both particles are converted electrons | |
1936 | if ((TrueGammaCandidate0->IsLargestComponentElectron() && TrueGammaCandidate0->IsConversion()) && (TrueGammaCandidate1->IsLargestComponentElectron() && TrueGammaCandidate1->IsConversion()) ){ | |
1937 | fHistoTrueMotherCaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1938 | if (isTruePi0 )fHistoTruePi0CaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1939 | if (isTrueEta )fHistoTrueEtaCaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1940 | } | |
1941 | // 1 gamma is converted the other one is normals | |
1942 | if ( (TrueGammaCandidate0->IsLargestComponentPhoton() && TrueGammaCandidate1->IsLargestComponentElectron() && TrueGammaCandidate1->IsConversion()) || | |
1943 | (TrueGammaCandidate1->IsLargestComponentPhoton() && TrueGammaCandidate0->IsLargestComponentElectron() && TrueGammaCandidate0->IsConversion()) | |
1944 | ) | |
1945 | fHistoTrueMotherCaloMixedPhotonConvPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1946 | ||
1947 | // at least one of the photon is merged | |
1948 | if (TrueGammaCandidate0->IsMerged() || TrueGammaCandidate0->IsMergedPartConv() || TrueGammaCandidate0->IsDalitzMerged() || TrueGammaCandidate1->IsMerged() || TrueGammaCandidate1->IsMergedPartConv() || TrueGammaCandidate1->IsDalitzMerged() ) | |
1949 | fHistoTrueMotherCaloMergedClusterInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1950 | // at least one of the photon is merged and part conv | |
1951 | if (TrueGammaCandidate1->IsMergedPartConv() || TrueGammaCandidate0->IsMergedPartConv()) | |
1952 | fHistoTrueMotherCaloMergedClusterPartConvInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1953 | } | |
1954 | ||
1955 | if (fDoMesonQA > 0){ | |
1956 | if (isTruePi0){ | |
1957 | if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){ | |
1958 | fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1959 | fHistoTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha()); | |
1960 | fHistoTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle()); | |
1961 | } | |
1962 | } else if (isTrueEta){ | |
1963 | if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){ | |
1964 | fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1965 | fHistoTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha()); | |
1966 | fHistoTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle()); | |
1967 | } | |
1968 | } | |
1969 | } | |
1970 | if(!(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->IsPrimary())){ // Secondary Meson | |
1971 | Int_t secMotherLabel = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetMother(); | |
1972 | Float_t weightedSec= 1; | |
1973 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, 0x0, fInputEvent) && static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){ | |
1974 | weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, 0x0, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt | |
1975 | //cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1976 | } | |
1977 | fHistoTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
1978 | if (secMotherLabel >-1){ | |
1979 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){ | |
1980 | fHistoTrueSecondaryMotherFromK0sInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
1981 | if (fDoMesonQA > 0)fHistoTrueK0sWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt()); | |
1982 | } | |
1983 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==221){ | |
1984 | fHistoTrueSecondaryMotherFromEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
1985 | if (fDoMesonQA > 0)fHistoTrueEtaWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt()); | |
1986 | } | |
1987 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==3122){ | |
1988 | fHistoTrueSecondaryMotherFromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
1989 | if (fDoMesonQA > 0)fHistoTrueLambdaWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt()); | |
1990 | } | |
1991 | } | |
1992 | } else{ // Only primary pi0 for efficiency calculation | |
1993 | Float_t weighted= 1; | |
1994 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, 0x0, fInputEvent)){ | |
1995 | if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt()>0.005){ | |
1996 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, 0x0, fInputEvent); | |
1997 | // cout << "rec \t " <<gamma1MotherLabel << "\t" << weighted << endl; | |
1998 | } | |
1999 | } | |
2000 | fHistoTruePrimaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
2001 | fHistoTruePrimaryMotherW0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2002 | fProfileTruePrimaryMotherWeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
2003 | ||
2004 | if (fDoMesonQA > 0){ | |
2005 | if(isTruePi0){ // Only primary pi0 for resolution | |
2006 | fHistoTruePrimaryPi0MCPtResolPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(), | |
2007 | (Pi0Candidate->Pt()-static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted); | |
2008 | ||
2009 | } | |
2010 | if (isTrueEta){ // Only primary eta for resolution | |
2011 | fHistoTruePrimaryEtaMCPtResolPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(), | |
2012 | (Pi0Candidate->Pt()-static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted); | |
2013 | } | |
2014 | } | |
2015 | } | |
2016 | } else if(!isTruePi0 && !isTrueEta) { // Background | |
2017 | if (fDoMesonQA > 0){ | |
2018 | if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){ // Both Tracks are Photons and have a mother but not Pi0 or Eta | |
2019 | fHistoTrueBckGGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2020 | } else { // No photon or without mother | |
2021 | fHistoTrueBckContInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2022 | } | |
2023 | } | |
2024 | } | |
2025 | } | |
2026 | ||
2027 | //________________________________________________________________________ | |
2028 | void AliAnalysisTaskGammaCalo::CalculateBackground(){ | |
2029 | ||
2030 | Int_t zbin= fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ()); | |
2031 | Int_t mbin = 0; | |
2032 | ||
2033 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
2034 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks()); | |
2035 | } else { | |
2036 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fClusterCandidates->GetEntries()); | |
2037 | } | |
2038 | ||
2039 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
2040 | for(Int_t nEventsInBG=0;nEventsInBG<fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){ | |
2041 | AliGammaConversionAODVector *previousEventV0s = fBGHandler[fiCut]->GetBGGoodV0s(zbin,mbin,nEventsInBG); | |
2042 | ||
2043 | for(Int_t iCurrent=0;iCurrent<fClusterCandidates->GetEntries();iCurrent++){ | |
2044 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fClusterCandidates->At(iCurrent)); | |
2045 | for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){ | |
2046 | AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious))); | |
2047 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(¤tEventGoodV0,&previousGoodV0); | |
2048 | backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
2049 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut)) | |
2050 | ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
2051 | fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2052 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2053 | fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2054 | } | |
2055 | delete backgroundCandidate; | |
2056 | backgroundCandidate = 0x0; | |
2057 | } | |
2058 | } | |
2059 | } | |
2060 | } else { | |
2061 | for(Int_t nEventsInBG=0;nEventsInBG <fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){ | |
2062 | AliGammaConversionAODVector *previousEventV0s = fBGHandler[fiCut]->GetBGGoodV0s(zbin,mbin,nEventsInBG); | |
2063 | if(previousEventV0s){ | |
2064 | for(Int_t iCurrent=0;iCurrent<fClusterCandidates->GetEntries();iCurrent++){ | |
2065 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fClusterCandidates->At(iCurrent)); | |
2066 | for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){ | |
2067 | ||
2068 | AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious))); | |
2069 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(¤tEventGoodV0,&previousGoodV0); | |
2070 | backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
2071 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
2072 | fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2073 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2074 | fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2075 | } | |
2076 | delete backgroundCandidate; | |
2077 | backgroundCandidate = 0x0; | |
2078 | } | |
2079 | } | |
2080 | } | |
2081 | } | |
2082 | } | |
2083 | } | |
2084 | ||
2085 | //________________________________________________________________________ | |
2086 | void AliAnalysisTaskGammaCalo::RotateParticle(AliAODConversionPhoton *gamma){ | |
2087 | Int_t fNDegreesPMBackground= ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->NDegreesRotation(); | |
2088 | Double_t nRadiansPM = fNDegreesPMBackground*TMath::Pi()/180; | |
2089 | Double_t rotationValue = fRandom.Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM; | |
2090 | gamma->RotateZ(rotationValue); | |
2091 | } | |
2092 | ||
2093 | //________________________________________________________________________ | |
2094 | void AliAnalysisTaskGammaCalo::UpdateEventByEventData(){ | |
2095 | //see header file for documentation | |
2096 | if(fClusterCandidates->GetEntries() >0 ){ | |
2097 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
2098 | fBGHandler[fiCut]->AddEvent(fClusterCandidates,fInputEvent->GetPrimaryVertex()->GetX(),fInputEvent->GetPrimaryVertex()->GetY(),fInputEvent->GetPrimaryVertex()->GetZ(),fV0Reader->GetNumberOfPrimaryTracks(),fEventPlaneAngle); | |
2099 | } else { // means we use #V0s for multiplicity | |
2100 | fBGHandler[fiCut]->AddEvent(fClusterCandidates,fInputEvent->GetPrimaryVertex()->GetX(),fInputEvent->GetPrimaryVertex()->GetY(),fInputEvent->GetPrimaryVertex()->GetZ(),fClusterCandidates->GetEntries(),fEventPlaneAngle); | |
2101 | } | |
2102 | } | |
2103 | } | |
2104 | ||
2105 | ||
2106 | //________________________________________________________________________ | |
2107 | void AliAnalysisTaskGammaCalo::FillPhotonBackgroundHist(AliAODConversionPhoton *TruePhotonCandidate, Int_t pdgCode) | |
2108 | { | |
2109 | // Bck = 0 e+-, 1 pi+-, 2 p+-, 3 K+-, 4 n, 5 K0s, 6 Lambda, 7 mu+-, 8 rest | |
2110 | if(fIsFromMBHeader){ | |
2111 | if(abs(pdgCode) == 11) fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0); | |
2112 | else if( abs(pdgCode)==211) fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1); | |
2113 | else if( abs(pdgCode)==2212) fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2); | |
2114 | else if( abs(pdgCode)==321) fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3); | |
2115 | else if( abs(pdgCode)==2112) fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4); | |
2116 | else if( abs(pdgCode)==310) fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),5); | |
2117 | else if( abs(pdgCode)==3122) fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),6); | |
2118 | else if( abs(pdgCode)==13) fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),7); | |
2119 | else fHistoClusPhotonBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),8); | |
2120 | } | |
2121 | } | |
2122 | ||
2123 | //________________________________________________________________________ | |
2124 | void AliAnalysisTaskGammaCalo::FillPhotonPlusConversionBackgroundHist(AliAODConversionPhoton *TruePhotonCandidate, Int_t pdgCode) | |
2125 | { | |
2126 | // Bck = 0 e+-, 1 pi+-, 2 p+-, 3 K+-, 4 n, 5 K0s, 6 Lambda, 7 mu+-, 8 rest | |
2127 | if(fIsFromMBHeader){ | |
2128 | if(abs(pdgCode) == 11) fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0); | |
2129 | else if( abs(pdgCode)==211) fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1); | |
2130 | else if( abs(pdgCode)==2212) fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2); | |
2131 | else if( abs(pdgCode)==321) fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3); | |
2132 | else if( abs(pdgCode)==2112) fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4); | |
2133 | else if( abs(pdgCode)==310) fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),5); | |
2134 | else if( abs(pdgCode)==3122) fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),6); | |
2135 | else if( abs(pdgCode)==13) fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),7); | |
2136 | else fHistoClusPhotonPlusConvBGPt[fiCut]->Fill(TruePhotonCandidate->Pt(),8); | |
2137 | } | |
2138 | } | |
2139 | ||
2140 | ||
2141 | void AliAnalysisTaskGammaCalo::SetLogBinningXTH2(TH2* histoRebin){ | |
2142 | TAxis *axisafter = histoRebin->GetXaxis(); | |
2143 | Int_t bins = axisafter->GetNbins(); | |
2144 | Double_t from = axisafter->GetXmin(); | |
2145 | Double_t to = axisafter->GetXmax(); | |
2146 | Double_t *newbins = new Double_t[bins+1]; | |
2147 | newbins[0] = from; | |
2148 | Double_t factor = TMath::Power(to/from, 1./bins); | |
2149 | for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1]; | |
2150 | axisafter->Set(bins, newbins); | |
2151 | delete [] newbins; | |
2152 | } | |
2153 | ||
2154 | //________________________________________________________________________ | |
2155 | void AliAnalysisTaskGammaCalo::Terminate(const Option_t *) | |
2156 | { | |
2157 | ||
2158 | //fOutputContainer->Print(); // Will crash on GRID | |
2159 | } | |
2160 | ||
2161 | //________________________________________________________________________ | |
2162 | Int_t AliAnalysisTaskGammaCalo::GetSourceClassification(Int_t daughter, Int_t pdgCode){ | |
2163 | ||
2164 | if (daughter == 111) { | |
2165 | if (abs(pdgCode) == 310) return 1; // k0s | |
2166 | else if (abs(pdgCode) == 3122) return 2; // Lambda | |
2167 | else if (abs(pdgCode) == 130) return 3; // K0L | |
2168 | else if (abs(pdgCode) == 2212) return 4; // proton | |
2169 | else if (abs(pdgCode) == 2112) return 5; // neutron | |
2170 | else if (abs(pdgCode) == 211) return 6; // pion | |
2171 | else if (abs(pdgCode) == 321) return 7; // kaon | |
2172 | else if (abs(pdgCode) == 113 || abs(pdgCode) == 213 ) return 8; // rho 0,+,- | |
2173 | else if (abs(pdgCode) == 3222 || abs(pdgCode) == 3212 || abs(pdgCode) == 3112 ) return 9; // Sigma | |
2174 | else if (abs(pdgCode) == 2224 || abs(pdgCode) == 2214 || abs(pdgCode) == 2114 || abs(pdgCode) == 1114 ) return 10; // Delta | |
2175 | else if (abs(pdgCode) == 313 || abs(pdgCode) == 323 ) return 11; // K* | |
2176 | else return 15; | |
2177 | } | |
2178 | return 15; | |
2179 | ||
2180 | } |