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