29 #include "THnSparse.h"
32 #include "TDatabasePDG.h"
33 #include "AliAnalysisTask.h"
34 #include "AliAnalysisManager.h"
35 #include "AliESDEvent.h"
36 #include "AliESDInputHandler.h"
37 #include "AliMCEventHandler.h"
38 #include "AliMCEvent.h"
39 #include "AliMCParticle.h"
40 #include "AliCentrality.h"
41 #include "AliESDVZERO.h"
42 #include "AliESDpid.h"
44 #include "AliVParticle.h"
45 #include "AliESDtrack.h"
46 #include "AliESDtrackCuts.h"
47 #include "AliKFVertex.h"
49 #include "AliGenCocktailEventHeader.h"
51 #include "AliAODMCParticle.h"
52 #include "AliAODMCHeader.h"
53 #include "AliEventplane.h"
55 #include "AliAODEvent.h"
56 #include "AliAODInputHandler.h"
57 #include "AliESDEvent.h"
58 #include "AliESDInputHandler.h"
59 #include "AliInputEventHandler.h"
68 fV0ReaderName("V0ReaderV1"),
80 fHeaderNameList(NULL),
81 fClusterOutputList(NULL),
82 fOutputContainer(NULL),
84 fSelectorElectronIndex(0),
85 fSelectorPositronIndex(0),
86 fGammaCandidates(NULL),
87 fClusterCandidates(NULL),
88 fVirtualGammaCandidates(NULL),
92 fElectronCutArray(NULL),
93 fConversionCuts(NULL),
94 fClusterCutArray(NULL),
95 fCaloPhotonCuts(NULL),
98 fHistoConvGammaPt(NULL),
99 fHistoConvGammaR(NULL),
100 fHistoConvGammaEta(NULL),
101 fHistoDalitzElectronPt(NULL),
102 fHistoDalitzPositronPt(NULL),
103 fHistoDalitzElectronPhi(NULL),
104 fHistoDalitzPositronPhi(NULL),
110 fCharPhotonMCInfo(0),
111 fHistoMotherInvMassPt(NULL),
112 fHistoMotherInvMassOpeningAngleGammaElectron(NULL),
113 fHistoMotherMatchedInvMassPt(NULL),
114 fSparseMotherInvMassPtZM(NULL),
115 fHistoMotherBackInvMassPt(NULL),
116 fSparseMotherBackInvMassPtZM(NULL),
117 fHistoMotherInvMassEalpha(NULL),
118 fHistoMotherPi0PtY(NULL),
119 fHistoMotherEtaPtY(NULL),
120 fHistoMotherPi0PtAlpha(NULL),
121 fHistoMotherEtaPtAlpha(NULL),
122 fHistoMotherPi0PtOpenAngle(NULL),
123 fHistoMotherEtaPtOpenAngle(NULL),
124 fHistoMotherPi0ConvPhotonEtaPhi(NULL),
125 fHistoMotherEtaConvPhotonEtaPhi(NULL),
126 fHistoMotherInvMassECalib(NULL),
127 fHistoMotherInvMassECalibalpha(NULL),
128 fHistoClusGammaPt(NULL),
129 fHistoClusOverlapHeadersGammaPt(NULL),
130 fHistoMCHeaders(NULL),
131 fHistoMCAllGammaPt(NULL),
132 fHistoMCAllGammaPi0Pt(NULL),
133 fHistoMCAllGammaEMCALAccPt(NULL),
134 fHistoMCDecayGammaPi0Pt(NULL),
135 fHistoMCDecayGammaRhoPt(NULL),
136 fHistoMCDecayGammaEtaPt(NULL),
137 fHistoMCDecayGammaOmegaPt(NULL),
138 fHistoMCDecayGammaEtapPt(NULL),
139 fHistoMCDecayGammaPhiPt(NULL),
140 fHistoMCDecayGammaSigmaPt(NULL),
141 fHistoMCConvGammaPt(NULL),
142 fHistoMCConvGammaR(NULL),
143 fHistoMCConvGammaEta(NULL),
144 fHistoMCAllPositronsPt(NULL),
145 fHistoMCDecayPositronPi0Pt(NULL),
146 fHistoMCAllElectronsPt(NULL),
147 fHistoMCDecayElectronPi0Pt(NULL),
148 fHistoMCDecayNoPrimElectronPi0DalitzR(NULL),
149 fHistoMCDecayNoPrimPositronPi0DalitzR(NULL),
150 fHistoMCDecayNoPrimElectronPi0DalitzID(NULL),
151 fHistoMCDecayNoPrimPositronPi0DalitzID(NULL),
152 fHistoMCPi0GGPt(NULL),
153 fHistoMCPi0GGWOWeightPt(NULL),
155 fHistoMCPi0WOWeightPt(NULL),
156 fHistoMCEtaGGPt(NULL),
157 fHistoMCEtaGGWOWeightPt(NULL),
159 fHistoMCEtaWOWeightPt(NULL),
160 fHistoMCPi0InAccPt(NULL),
161 fHistoMCPi0InAccOpeningAngleGammaElectron(NULL),
162 fHistoMCEtaInAccPt(NULL),
163 fHistoMCPi0PtY(NULL),
164 fHistoMCEtaPtY(NULL),
165 fHistoMCPi0PtAlpha(NULL),
166 fHistoMCEtaPtAlpha(NULL),
168 fHistoMCK0sWOWeightPt(NULL),
169 fHistoMCK0sPtY(NULL),
170 fHistoTruePi0InvMassPt(NULL),
171 fHistoTrueEtaInvMassPt(NULL),
172 fHistoTruePi0ShowerInvMassPt(NULL),
173 fHistoTrueEtaShowerInvMassPt(NULL),
174 fHistoTruePi0NoShowerInvMassPt(NULL),
175 fHistoTrueEtaNoShowerInvMassPt(NULL),
176 fHistoTruePi0OpeningAngleGammaElectron(NULL),
177 fHistoTruePi0GGInvMassPt(NULL),
178 fHistoTrueEtaGGInvMassPt(NULL),
179 fHistoTruePi0CaloPhotonInvMassPt(NULL),
180 fHistoTrueEtaCaloPhotonInvMassPt(NULL),
181 fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL),
182 fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt(NULL),
183 fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL),
184 fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt(NULL),
185 fHistoTruePi0CaloElectronInvMassPt(NULL),
186 fHistoTrueEtaCaloElectronInvMassPt(NULL),
187 fHistoTruePi0CaloMergedClusterInvMassPt(NULL),
188 fHistoTrueEtaCaloMergedClusterInvMassPt(NULL),
189 fHistoTrueMotherCaloEMNonLeadingInvMassPt(NULL),
190 fHistoTruePi0CaloMergedClusterPartConvInvMassPt(NULL),
191 fHistoTrueEtaCaloMergedClusterPartConvInvMassPt(NULL),
192 fHistoTruePrimaryPi0InvMassPt(NULL),
193 fHistoTruePrimaryPi0GGInvMassPt(NULL),
194 fHistoTruePrimaryEtaInvMassPt(NULL),
195 fHistoTruePrimaryEtaGGInvMassPt(NULL),
196 fHistoTruePrimaryPi0W0WeightingInvMassPt(NULL),
197 fHistoTruePrimaryEtaW0WeightingInvMassPt(NULL),
198 fProfileTruePrimaryPi0WeightsInvMassPt(NULL),
199 fProfileTruePrimaryEtaWeightsInvMassPt(NULL),
200 fHistoTruePrimaryPi0MCPtResolPt(NULL),
201 fHistoTruePrimaryEtaMCPtResolPt(NULL),
202 fHistoTrueMotherPi0ConvPhotonEtaPhi(NULL),
203 fHistoTrueMotherEtaConvPhotonEtaPhi(NULL),
204 fHistoTrueSecondaryPi0InvMassPt(NULL),
205 fHistoTrueSecondaryPi0GGInvMassPt(NULL),
206 fHistoTrueSecondaryPi0FromK0sInvMassPt(NULL),
207 fHistoTrueK0sWithPi0DaughterMCPt(NULL),
208 fHistoTrueSecondaryPi0FromEtaInvMassPt(NULL),
209 fHistoTrueEtaWithPi0DaughterMCPt(NULL),
210 fHistoTrueSecondaryPi0FromLambdaInvMassPt(NULL),
211 fHistoTrueLambdaWithPi0DaughterMCPt(NULL),
212 fHistoTrueBckGGInvMassPt(NULL),
213 fHistoTrueBckContInvMassPt(NULL),
214 fHistoTruePi0PtY(NULL),
215 fHistoTrueEtaPtY(NULL),
216 fHistoTruePi0PtAlpha(NULL),
217 fHistoTrueEtaPtAlpha(NULL),
218 fHistoTruePi0PtOpenAngle(NULL),
219 fHistoTrueEtaPtOpenAngle(NULL),
220 fHistoTrueConvGammaPt(NULL),
221 fHistoTrueConvPi0GammaPt(NULL),
222 fHistoTrueConvGammaEta(NULL),
223 fHistoTruePositronPt(NULL),
224 fHistoTrueElectronPt(NULL),
225 fHistoTrueSecPositronPt(NULL),
226 fHistoTrueSecElectronPt(NULL),
227 fHistoTruePi0DalitzPositronPt(NULL),
228 fHistoTruePi0DalitzElectronPt(NULL),
229 fHistoTruePi0DalitzSecPositronPt(NULL),
230 fHistoTruePi0DalitzSecElectronPt(NULL),
231 fHistoTruePrimaryConvGammaPt(NULL),
232 fHistoTruePrimaryConvGammaESDPtMCPt(NULL),
233 fHistoTrueSecondaryConvGammaPt(NULL),
234 fHistoTrueSecondaryConvGammaFromXFromK0sPt(NULL),
235 fHistoTrueSecondaryConvGammaFromXFromLambdaPt(NULL),
236 fHistoTrueClusGammaPt(NULL),
237 fHistoTrueClusUnConvGammaPt(NULL),
238 fHistoTrueClusUnConvGammaMCPt(NULL),
239 fHistoTrueClusElectronPt(NULL),
240 fHistoTrueClusConvGammaPt(NULL),
241 fHistoTrueClusConvGammaMCPt(NULL),
242 fHistoTrueClusConvGammaFullyPt(NULL),
243 fHistoTrueClusMergedGammaPt(NULL),
244 fHistoTrueClusMergedPartConvGammaPt(NULL),
245 fHistoTrueClusDalitzPt(NULL),
246 fHistoTrueClusDalitzMergedPt(NULL),
247 fHistoTrueClusPhotonFromElecMotherPt(NULL),
248 fHistoTrueClusShowerPt(NULL),
249 fHistoTrueClusSubLeadingPt(NULL),
250 fHistoTrueClusNParticles(NULL),
251 fHistoTrueClusEMNonLeadingPt(NULL),
252 fHistoTrueNLabelsInClus(NULL),
253 fHistoTruePrimaryClusGammaPt(NULL),
254 fHistoTruePrimaryClusGammaESDPtMCPt(NULL),
255 fHistoTruePi0DalitzClusGammaPt(NULL),
256 fHistoTruePi0DalitzAllClusGammaPt(NULL),
257 fHistoTruePi0DalitzClusGammaMCPt(NULL),
258 fHistoTruePrimaryPi0PhotonPairPtconv(NULL),
259 fHistoTruePrimaryPi0DCPtconv(NULL),
260 fHistoTruePrimaryPi0MissingPtconv(NULL),
261 fHistoTruePrimaryEtaPhotonPairPtconv(NULL),
262 fHistoTruePrimaryEtaDCPtconv(NULL),
263 fHistoTruePrimaryEtaMissingPtconv(NULL),
264 fHistoTrueSecondaryPi0PhotonPairPtconv(NULL),
265 fHistoTrueSecondaryPi0DCPtconv(NULL),
266 fHistoTrueSecondaryPi0MissingPtconv(NULL),
267 fStringRecTruePi0s(NULL),
268 fStringRecTrueEtas(NULL),
269 fHistoDoubleCountTruePi0InvMassPt(NULL),
270 fHistoDoubleCountTrueEtaInvMassPt(NULL),
271 fHistoDoubleCountTrueConvGammaRPt(NULL),
272 fVectorDoubleCountTruePi0s(0),
273 fVectorDoubleCountTrueEtas(0),
274 fVectorDoubleCountTrueConvGammas(0),
276 fHistoNGoodESDTracks(NULL),
277 fHistoNGammaCandidates(NULL),
278 fHistoNGoodESDTracksVsNGammaCanditates(NULL),
279 fHistoSPDClusterTrackletBackground(NULL),
280 fHistoNV0Tracks(NULL),
281 fProfileEtaShift(NULL),
282 fEventPlaneAngle(-100),
284 fNGammaCandidates(0),
295 fMoveParticleAccordingToVertex(kTRUE),
297 fDoMesonAnalysis(kTRUE),
301 fIsFromMBHeader(kTRUE),
302 fIsOverlappingWithOtherHeader(kFALSE),
313 fV0ReaderName(
"V0ReaderV1"),
315 fBGClusHandler(NULL),
322 fPhotonDCAList(NULL),
325 fHeaderNameList(NULL),
326 fClusterOutputList(NULL),
329 fSelectorElectronIndex(0),
330 fSelectorPositronIndex(0),
331 fGammaCandidates(NULL),
332 fClusterCandidates(NULL),
333 fVirtualGammaCandidates(NULL),
334 fEventCutArray(NULL),
336 fGammaCutArray(NULL),
337 fElectronCutArray(NULL),
338 fConversionCuts(NULL),
339 fClusterCutArray(NULL),
340 fCaloPhotonCuts(NULL),
341 fMesonCutArray(NULL),
343 fHistoConvGammaPt(NULL),
344 fHistoConvGammaR(NULL),
345 fHistoConvGammaEta(NULL),
346 fHistoDalitzElectronPt(NULL),
347 fHistoDalitzPositronPt(NULL),
348 fHistoDalitzElectronPhi(NULL),
349 fHistoDalitzPositronPhi(NULL),
355 fCharPhotonMCInfo(0),
356 fHistoMotherInvMassPt(NULL),
357 fHistoMotherInvMassOpeningAngleGammaElectron(NULL),
358 fHistoMotherMatchedInvMassPt(NULL),
359 fSparseMotherInvMassPtZM(NULL),
360 fHistoMotherBackInvMassPt(NULL),
361 fSparseMotherBackInvMassPtZM(NULL),
362 fHistoMotherInvMassEalpha(NULL),
363 fHistoMotherPi0PtY(NULL),
364 fHistoMotherEtaPtY(NULL),
365 fHistoMotherPi0PtAlpha(NULL),
366 fHistoMotherEtaPtAlpha(NULL),
367 fHistoMotherPi0PtOpenAngle(NULL),
368 fHistoMotherEtaPtOpenAngle(NULL),
369 fHistoMotherPi0ConvPhotonEtaPhi(NULL),
370 fHistoMotherEtaConvPhotonEtaPhi(NULL),
371 fHistoMotherInvMassECalib(NULL),
372 fHistoMotherInvMassECalibalpha(NULL),
373 fHistoClusGammaPt(NULL),
374 fHistoClusOverlapHeadersGammaPt(NULL),
375 fHistoMCHeaders(NULL),
376 fHistoMCAllGammaPt(NULL),
377 fHistoMCAllGammaPi0Pt(NULL),
378 fHistoMCAllGammaEMCALAccPt(NULL),
379 fHistoMCDecayGammaPi0Pt(NULL),
380 fHistoMCDecayGammaRhoPt(NULL),
381 fHistoMCDecayGammaEtaPt(NULL),
382 fHistoMCDecayGammaOmegaPt(NULL),
383 fHistoMCDecayGammaEtapPt(NULL),
384 fHistoMCDecayGammaPhiPt(NULL),
385 fHistoMCDecayGammaSigmaPt(NULL),
386 fHistoMCConvGammaPt(NULL),
387 fHistoMCConvGammaR(NULL),
388 fHistoMCConvGammaEta(NULL),
389 fHistoMCAllPositronsPt(NULL),
390 fHistoMCDecayPositronPi0Pt(NULL),
391 fHistoMCAllElectronsPt(NULL),
392 fHistoMCDecayElectronPi0Pt(NULL),
393 fHistoMCDecayNoPrimElectronPi0DalitzR(NULL),
394 fHistoMCDecayNoPrimPositronPi0DalitzR(NULL),
395 fHistoMCDecayNoPrimElectronPi0DalitzID(NULL),
396 fHistoMCDecayNoPrimPositronPi0DalitzID(NULL),
397 fHistoMCPi0GGPt(NULL),
398 fHistoMCPi0GGWOWeightPt(NULL),
400 fHistoMCPi0WOWeightPt(NULL),
401 fHistoMCEtaGGPt(NULL),
402 fHistoMCEtaGGWOWeightPt(NULL),
404 fHistoMCEtaWOWeightPt(NULL),
405 fHistoMCPi0InAccPt(NULL),
406 fHistoMCPi0InAccOpeningAngleGammaElectron(NULL),
407 fHistoMCEtaInAccPt(NULL),
408 fHistoMCPi0PtY(NULL),
409 fHistoMCEtaPtY(NULL),
410 fHistoMCPi0PtAlpha(NULL),
411 fHistoMCEtaPtAlpha(NULL),
413 fHistoMCK0sWOWeightPt(NULL),
414 fHistoMCK0sPtY(NULL),
415 fHistoTruePi0InvMassPt(NULL),
416 fHistoTrueEtaInvMassPt(NULL),
417 fHistoTruePi0ShowerInvMassPt(NULL),
418 fHistoTrueEtaShowerInvMassPt(NULL),
419 fHistoTruePi0NoShowerInvMassPt(NULL),
420 fHistoTrueEtaNoShowerInvMassPt(NULL),
421 fHistoTruePi0OpeningAngleGammaElectron(NULL),
422 fHistoTruePi0GGInvMassPt(NULL),
423 fHistoTrueEtaGGInvMassPt(NULL),
424 fHistoTruePi0CaloPhotonInvMassPt(NULL),
425 fHistoTrueEtaCaloPhotonInvMassPt(NULL),
426 fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL),
427 fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt(NULL),
428 fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL),
429 fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt(NULL),
430 fHistoTruePi0CaloElectronInvMassPt(NULL),
431 fHistoTrueEtaCaloElectronInvMassPt(NULL),
432 fHistoTruePi0CaloMergedClusterInvMassPt(NULL),
433 fHistoTrueEtaCaloMergedClusterInvMassPt(NULL),
434 fHistoTrueMotherCaloEMNonLeadingInvMassPt(NULL),
435 fHistoTruePi0CaloMergedClusterPartConvInvMassPt(NULL),
436 fHistoTrueEtaCaloMergedClusterPartConvInvMassPt(NULL),
437 fHistoTruePrimaryPi0InvMassPt(NULL),
438 fHistoTruePrimaryPi0GGInvMassPt(NULL),
439 fHistoTruePrimaryEtaInvMassPt(NULL),
440 fHistoTruePrimaryEtaGGInvMassPt(NULL),
441 fHistoTruePrimaryPi0W0WeightingInvMassPt(NULL),
442 fHistoTruePrimaryEtaW0WeightingInvMassPt(NULL),
443 fProfileTruePrimaryPi0WeightsInvMassPt(NULL),
444 fProfileTruePrimaryEtaWeightsInvMassPt(NULL),
445 fHistoTruePrimaryPi0MCPtResolPt(NULL),
446 fHistoTruePrimaryEtaMCPtResolPt(NULL),
447 fHistoTrueMotherPi0ConvPhotonEtaPhi(NULL),
448 fHistoTrueMotherEtaConvPhotonEtaPhi(NULL),
449 fHistoTrueSecondaryPi0InvMassPt(NULL),
450 fHistoTrueSecondaryPi0GGInvMassPt(NULL),
451 fHistoTrueSecondaryPi0FromK0sInvMassPt(NULL),
452 fHistoTrueK0sWithPi0DaughterMCPt(NULL),
453 fHistoTrueSecondaryPi0FromEtaInvMassPt(NULL),
454 fHistoTrueEtaWithPi0DaughterMCPt(NULL),
455 fHistoTrueSecondaryPi0FromLambdaInvMassPt(NULL),
456 fHistoTrueLambdaWithPi0DaughterMCPt(NULL),
457 fHistoTrueBckGGInvMassPt(NULL),
458 fHistoTrueBckContInvMassPt(NULL),
459 fHistoTruePi0PtY(NULL),
460 fHistoTrueEtaPtY(NULL),
461 fHistoTruePi0PtAlpha(NULL),
462 fHistoTrueEtaPtAlpha(NULL),
463 fHistoTruePi0PtOpenAngle(NULL),
464 fHistoTrueEtaPtOpenAngle(NULL),
465 fHistoTrueConvGammaPt(NULL),
466 fHistoTrueConvPi0GammaPt(NULL),
467 fHistoTrueConvGammaEta(NULL),
468 fHistoTruePositronPt(NULL),
469 fHistoTrueElectronPt(NULL),
470 fHistoTrueSecPositronPt(NULL),
471 fHistoTrueSecElectronPt(NULL),
472 fHistoTruePi0DalitzPositronPt(NULL),
473 fHistoTruePi0DalitzElectronPt(NULL),
474 fHistoTruePi0DalitzSecPositronPt(NULL),
475 fHistoTruePi0DalitzSecElectronPt(NULL),
476 fHistoTruePrimaryConvGammaPt(NULL),
477 fHistoTruePrimaryConvGammaESDPtMCPt(NULL),
478 fHistoTrueSecondaryConvGammaPt(NULL),
479 fHistoTrueSecondaryConvGammaFromXFromK0sPt(NULL),
480 fHistoTrueSecondaryConvGammaFromXFromLambdaPt(NULL),
481 fHistoTrueClusGammaPt(NULL),
482 fHistoTrueClusUnConvGammaPt(NULL),
483 fHistoTrueClusUnConvGammaMCPt(NULL),
484 fHistoTrueClusElectronPt(NULL),
485 fHistoTrueClusConvGammaPt(NULL),
486 fHistoTrueClusConvGammaMCPt(NULL),
487 fHistoTrueClusConvGammaFullyPt(NULL),
488 fHistoTrueClusMergedGammaPt(NULL),
489 fHistoTrueClusMergedPartConvGammaPt(NULL),
490 fHistoTrueClusDalitzPt(NULL),
491 fHistoTrueClusDalitzMergedPt(NULL),
492 fHistoTrueClusPhotonFromElecMotherPt(NULL),
493 fHistoTrueClusShowerPt(NULL),
494 fHistoTrueClusSubLeadingPt(NULL),
495 fHistoTrueClusNParticles(NULL),
496 fHistoTrueClusEMNonLeadingPt(NULL),
497 fHistoTrueNLabelsInClus(NULL),
498 fHistoTruePrimaryClusGammaPt(NULL),
499 fHistoTruePrimaryClusGammaESDPtMCPt(NULL),
500 fHistoTruePi0DalitzClusGammaPt(NULL),
501 fHistoTruePi0DalitzAllClusGammaPt(NULL),
502 fHistoTruePi0DalitzClusGammaMCPt(NULL),
503 fHistoTruePrimaryPi0PhotonPairPtconv(NULL),
504 fHistoTruePrimaryPi0DCPtconv(NULL),
505 fHistoTruePrimaryPi0MissingPtconv(NULL),
506 fHistoTruePrimaryEtaPhotonPairPtconv(NULL),
507 fHistoTruePrimaryEtaDCPtconv(NULL),
508 fHistoTruePrimaryEtaMissingPtconv(NULL),
509 fHistoTrueSecondaryPi0PhotonPairPtconv(NULL),
510 fHistoTrueSecondaryPi0DCPtconv(NULL),
511 fHistoTrueSecondaryPi0MissingPtconv(NULL),
512 fStringRecTruePi0s(NULL),
513 fStringRecTrueEtas(NULL),
514 fHistoDoubleCountTruePi0InvMassPt(NULL),
515 fHistoDoubleCountTrueEtaInvMassPt(NULL),
516 fHistoDoubleCountTrueConvGammaRPt(NULL),
517 fVectorDoubleCountTruePi0s(0),
518 fVectorDoubleCountTrueEtas(0),
519 fVectorDoubleCountTrueConvGammas(0),
521 fHistoNGoodESDTracks(NULL),
522 fHistoNGammaCandidates(NULL),
523 fHistoNGoodESDTracksVsNGammaCanditates(NULL),
524 fHistoSPDClusterTrackletBackground(NULL),
525 fHistoNV0Tracks(NULL),
526 fProfileEtaShift(NULL),
527 fEventPlaneAngle(-100),
529 fNGammaCandidates(0),
540 fMoveParticleAccordingToVertex(kTRUE),
542 fDoMesonAnalysis(kTRUE),
546 fIsFromMBHeader(kTRUE),
547 fIsOverlappingWithOtherHeader(kFALSE),
552 DefineOutput(1, TList::Class());
579 const Int_t nDim = 4;
580 Int_t nBins[nDim] = {800,250,7,4};
607 if(collisionSystem == 1 || collisionSystem == 2 ||
608 collisionSystem == 5 || collisionSystem == 8 ||
609 collisionSystem == 9){
610 centMin = centMin*10;
611 centMax = centMax*10;
612 if(centMax ==0 && centMax!=centMin) centMax=100;
613 }
else if(collisionSystem == 3 || collisionSystem == 6){
616 }
else if(collisionSystem == 4 || collisionSystem == 7){
617 centMin = ((centMin*5)+45);
618 centMax = ((centMax*5)+45);
624 fBackList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
632 fMotherList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
636 fSparseMotherInvMassPtZM[iCut] =
new THnSparseF(
"Back_Mother_InvMass_Pt_z_m",
"Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
645 collisionSystem,centMin,centMax,
733 TString cutstringMeson =
"NoMesonCut";
737 fCutFolder[iCut]->SetName(Form(
"Cut Number %s_%s_%s_%s_%s",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
741 fESDList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s ESD histograms", cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
747 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,
"Centrality");
748 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,
"Missing MC");
750 TString TriggerNames =
"Not Trigger: ";
752 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
757 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,
"Cont. Vertex");
761 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,
"EMCAL problem");
762 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(11,
"rejectedForJetJetMC");
763 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,
"SPD hits vs tracklet");
764 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,
"Out-of-Bunch pileup Past-Future");
765 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,
"Pileup V0M-TPCout Tracks");
797 fHistoConvGammaPt[iCut] =
new TH1F(
"ESD_ConvGamma_Pt",
"ESD_ConvGamma_Pt",250,0,25);
803 fPhotonDCAList[iCut]->SetName(Form(
"%s_%s_%s_%s Photon DCA tree",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
811 fHistoConvGammaR[iCut] =
new TH1F(
"ESD_ConvGamma_R",
"ESD_ConvGamma_R",800,0,200);
814 fHistoConvGammaEta[iCut] =
new TH1F(
"ESD_ConvGamma_Eta",
"ESD_ConvGamma_Eta",2000,-2,2);
829 fHistoDalitzElectronPhi[iCut] =
new TH1F(
"ESD_DalitzElectron_Phi",
"ESD_DalitzElectron_Phi",360,0,2*TMath::Pi());
832 fHistoDalitzPositronPhi[iCut] =
new TH1F(
"ESD_DalitzPositron_Phi",
"ESD_DalitzPositron_Phi",360,0,2*TMath::Pi());
842 fClusterOutputList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s Cluster Output",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
1076 TString cutstringMeson =
"NoMesonCut";
1080 fMCList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s MC histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
1081 fMCList[iCut]->SetOwner(kTRUE);
1148 fHistoMCPi0GGPt[iCut] =
new TH1F(
"MC_Pi0_GG_Pt",
"MC_Pi0_GG_Pt",250,0,25);
1155 fHistoMCPi0Pt[iCut] =
new TH1F(
"MC_Pi0_Pt",
"MC_Pi0_Pt",250,0,25);
1164 fHistoMCEtaGGPt[iCut] =
new TH1F(
"MC_Eta_GG_Pt",
"MC_Eta_GG_Pt",250,0,25);
1171 fHistoMCEtaPt[iCut] =
new TH1F(
"MC_Eta_Pt",
"MC_Eta_Pt",250,0,25);
1191 fHistoMCPi0PtY[iCut] =
new TH2F(
"MC_Pi0_Pt_Y",
"MC_Pi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1195 fHistoMCEtaPtY[iCut] =
new TH2F(
"MC_Eta_Pt_Y",
"MC_Eta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1206 fHistoMCK0sPt[iCut] =
new TH1F(
"MC_K0s_Pt",
"MC_K0s_Pt",150,0,15);
1212 fHistoMCK0sPtY[iCut] =
new TH2F(
"MC_K0s_Pt_Y",
"MC_K0s_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1225 fTrueList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s True histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
1586 fHistoTruePi0PtY[iCut] =
new TH2F(
"ESD_TruePi0_Pt_Y",
"ESD_TruePi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1591 fHistoTrueEtaPtY[iCut] =
new TH2F(
"ESD_TrueEta_Pt_Y",
"ESD_TrueEta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1663 if(!
fV0Reader){printf(
"Error: No V0 Reader");
return;}
1674 for(
Int_t iMatcherTask = 0; iMatcherTask < 3; iMatcherTask++){
1680 if(!
fElecSelector){printf(
"Error: No ElectronSelector");
return;}
1739 printf(
" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
1756 if(eventQuality == 2 || eventQuality == 3){
1780 AliEventplane *EventPlane =
fInputEvent->GetEventplane();
1794 Bool_t isRunningEMCALrelAna = kFALSE;
1800 if(eventNotAccepted){
1806 if(eventQuality != 0){
1833 else if(
fInputEvent->IsA()==AliAODEvent::Class()){
1842 if (nameBin.CompareTo(
"")== 0){
1844 ->GetAcceptedHeader())->At(i))->GetString();
1845 fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data());
1914 if(nclus == 0)
return;
1919 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1923 for(Long_t i = 0; i < nclus; i++){
1925 AliVCluster* clus = NULL;
1926 if(
fInputEvent->IsA()==AliESDEvent::Class()) clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)
fInputEvent->GetCaloCluster(i));
1927 else if(
fInputEvent->IsA()==AliAODEvent::Class()) clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)
fInputEvent->GetCaloCluster(i));
1929 if ( !clus )
continue;
1933 TLorentzVector clusterVector;
1934 clus->GetMomentum(clusterVector,vertex);
1936 TLorentzVector* tmpvec =
new TLorentzVector();
1937 tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
1941 if(!PhotonCandidate){
delete clus;
delete tmpvec;
continue;}
1948 Int_t* mclabelsCluster = clus->GetLabels();
1951 if (clus->GetNLabels()>0){
1952 for (
Int_t k =0; k< (
Int_t)clus->GetNLabels(); k++){
1969 if (clus->GetNLabels()>1){
1970 Int_t* mclabelsCluster = clus->GetLabels();
1971 for (
Int_t l = 1; l < (
Int_t)clus->GetNLabels(); l++ ){
1990 delete PhotonCandidate;
2003 TParticle *Photon = NULL;
2004 if (!TruePhotonCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
2026 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2027 Double_t mcProdVtxX = primVtxMC->GetX();
2028 Double_t mcProdVtxY = primVtxMC->GetY();
2029 Double_t mcProdVtxZ = primVtxMC->GetZ();
2042 Int_t gammaMotherLabel = -1;
2046 gammaMotherLabel=Photon->GetMother(0);
2051 if (TruePhotonCandidate->
IsConversion()) gammaMotherLabel=
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0);
2052 else gammaMotherLabel=Photon->GetMother(0);
2056 if( gammaMotherLabel > -1 ){
2058 Int_t motherFromShower = -1;
2061 TParticle* motherGamma =
fMCEvent->Particle( gammaMotherLabel );
2064 if( motherGamma->GetPdgCode() == 111 ) {
2066 if(
IsDalitz( motherGamma ) == kTRUE ){
2078 TParticle* motherGammaShower =
fMCEvent->Particle( motherFromShower );
2083 if( motherGammaShower->GetPdgCode() == 111 ) {
2084 if(
IsDalitz ( motherGammaShower ) ) {
2120 if (TruePhotonCandidate->
IsDalitz())
2126 if (TruePhotonCandidate->
IsShower())
2142 AliAODMCParticle *Photon = NULL;
2143 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
2144 if (AODMCTrackArray){
2145 if (!TruePhotonCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
2149 AliInfo(
"AODMCTrackArray could not be loaded");
2172 AliAODMCParticle *Mother = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
2181 if (TruePhotonCandidate->
IsDalitz())
2187 if (TruePhotonCandidate->
IsShower())
2201 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2202 Double_t mcProdVtxX = primVtxMC->GetX();
2203 Double_t mcProdVtxY = primVtxMC->GetY();
2204 Double_t mcProdVtxZ = primVtxMC->GetZ();
2219 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2220 Double_t mcProdVtxX = primVtxMC->GetX();
2221 Double_t mcProdVtxY = primVtxMC->GetY();
2222 Double_t mcProdVtxZ = primVtxMC->GetZ();
2224 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
2227 for(
Int_t i = 0; i < AODMCTrackArray->GetEntriesFast(); i++) {
2229 AliAODMCParticle* particle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(i));
2230 if (!particle)
continue;
2233 if (!isPrimary)
continue;
2235 Int_t isMCFromMBHeader = -1;
2244 if (TMath::Abs(particle->Eta()) < 0.66 ){
2247 if(particle->GetMother() >-1){
2248 switch((static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother())))->GetPdgCode()){
2275 for(
Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
2276 AliAODMCParticle *tmpDaughter =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(daughterIndex));
2277 if(!tmpDaughter)
continue;
2278 if(TMath::Abs(tmpDaughter->GetPdgCode()) == 11){
2279 rConv = sqrt( (tmpDaughter->Xv()*tmpDaughter->Xv()) + (tmpDaughter->Yv()*tmpDaughter->Yv()) );
2290 if(particle->GetPdgCode() == 310 &&
fDoMesonQA > 0){
2292 if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){
2299 if (particle->Pt()>0.005){
2310 AliAODMCParticle* daughter0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(particle->GetDaughter(0)));
2311 AliAODMCParticle* daughter1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(particle->GetDaughter(1)));
2314 if (particle->Pt()>0.005){
2322 if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){
2329 if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
2330 alpha = TMath::Abs((daughter0->E() - daughter1->E()))/(daughter0->E() + daughter1->E());
2334 if(particle->GetPdgCode() == 111){
2341 }
else if(particle->GetPdgCode() == 221){
2356 if(particle->GetPdgCode() == 111){
2358 }
else if(particle->GetPdgCode() == 221){
2371 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2372 Double_t mcProdVtxX = primVtxMC->GetX();
2373 Double_t mcProdVtxY = primVtxMC->GetY();
2374 Double_t mcProdVtxZ = primVtxMC->GetZ();
2385 TParticle* particle = (TParticle *)
fMCEvent->Particle(i);
2386 if (!particle)
continue;
2390 Int_t isMCFromMBHeader = -1;
2419 Double_t deltaX = particle->Vx() - mcProdVtxX;
2420 Double_t deltaY = particle->Vy() - mcProdVtxY;
2421 Double_t deltaZ = particle->Vz() - mcProdVtxZ;
2423 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
2426 if( particle->GetPdgCode() == -11) {
2431 if ( particle->GetMother(0) > -1 ) {
2436 if( i >=
fMCEvent->GetNumberOfPrimaries() ){
2447 if( particle->GetPdgCode() == 11){
2451 if ( particle->GetMother(0) > -1 ) {
2457 if( i >=
fMCEvent->GetNumberOfPrimaries() ){
2474 if ( TMath::Abs(particle->Eta()) < 0.66 ){
2478 if(particle->GetMother(0) >-1){
2479 switch(
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode()){
2524 if (particle->Pt()>0.005){
2531 if(particle->GetPdgCode() == 111){
2537 }
else if(particle->GetPdgCode() == 221){
2548 Int_t labelgamma = -1;
2549 Int_t labelelectron = -1;
2550 Int_t labelpositron = -1;
2559 if (particle->Pt()>0.005){
2565 if(particle->GetPdgCode() == 111){
2569 if(particle->GetPdgCode() == 221){
2576 TParticle *gamma =
fMCEvent->Particle(labelgamma);
2577 TParticle *electron =
fMCEvent->Particle(labelelectron);
2578 TParticle *positron =
fMCEvent->Particle(labelpositron);
2590 if( kDaughElectIsPrim && kDaughPositIsPrim && kDaughGammaIsPrim &&
2596 TLorentzVector TLVEpos,TLVEneg,TLVDalitz;
2598 Double_t electronMass = TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass();
2600 TLVEpos.SetXYZM(positron->Px(),positron->Py(),positron->Pz(),electronMass);
2601 TLVEneg.SetXYZM(electron->Px(),electron->Py(),electron->Pz(),electronMass);
2602 TVector3 V3gamma(gamma->Px(),gamma->Py(),gamma->Pz());
2603 Double_t angleGammaEpos = V3gamma.Angle(TLVEpos.Vect());
2604 Double_t angleGammaEneg = V3gamma.Angle(TLVEneg.Vect());
2611 if( particle->GetPdgCode() == 111 ){
2625 if( particle->GetPdgCode() == 221 ){
2651 if (gamma==NULL)
continue;
2659 if (Vgamma==NULL)
continue;
2671 pi0cand->
SetLabels(GammaIndex,virtualGammaIndex);
2681 Double_t angleGammaPositron = -999;
2682 Double_t angleGammaElectron = -999;
2689 positronVgamma->GetConstrainedPxPyPz(momPositron);
2694 electronVgamma->GetConstrainedPxPyPz(momElectron);
2698 TVector3 vPositron(momPositron[0],momPositron[1],momPositron[2]);
2699 TVector3 vElectron(momElectron[0],momElectron[1],momElectron[2]);
2701 angleGammaPositron = vGamma.Angle(vPositron);
2702 angleGammaElectron = vGamma.Angle(vElectron);
2733 if(TMath::Abs(pi0cand->
GetAlpha())<0.1)
2765 if(TMath::Abs( pi0cand->
GetAlpha()) < 0.1 )
2800 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2801 Double_t mcProdVtxX = primVtxMC->GetX();
2802 Double_t mcProdVtxY = primVtxMC->GetY();
2803 Double_t mcProdVtxZ = primVtxMC->GetZ();
2806 Bool_t isTruePi0 = kFALSE;
2807 Bool_t isTrueEta = kFALSE;
2811 Int_t virtualGammaMotherLabel = -1;
2812 Int_t virtualGamma = -1;
2814 Bool_t motherFromShower = kFALSE;
2816 Double_t angleGammaPositron = -999;
2817 Double_t angleGammaElectron = -999;
2824 positronVgamma->GetConstrainedPxPyPz(momPositron);
2829 electronVgamma->GetConstrainedPxPyPz(momElectron);
2832 TVector3 vGamma(TrueGammaCandidate1->
GetPx(),TrueGammaCandidate1->
GetPy(),TrueGammaCandidate1->
GetPz());;
2833 TVector3 vPositron(momPositron[0],momPositron[1],momPositron[2]);
2834 TVector3 vElectron(momElectron[0],momElectron[1],momElectron[2]);
2836 angleGammaPositron = vGamma.Angle(vPositron);
2837 angleGammaElectron = vGamma.Angle(vElectron);
2843 if( virtualGammaMCLabel != -1 ){
2847 TParticle * virtualGammaMotherMC = (TParticle*)
fMCEvent->Particle(virtualGammaMCLabel);
2849 if( TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11) {
2851 if( virtualGammaMotherMC->GetPdgCode() != 22 ){
2852 virtualGammaMotherLabel=virtualGammaMCLabel;
2855 }
else if (negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
2856 virtualGammaMotherLabel=virtualGammaMotherMC->GetMother(0);
2862 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2865 Int_t gamma1MotherLabel = -1;
2868 if(gamma1MCLabel != -1){
2871 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2876 gamma1MotherLabel=gammaMC1->GetMother(0);
2878 if (TrueGammaCandidate1->
IsConversion()) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2879 else gamma1MotherLabel=gammaMC1->GetMother(0);
2883 if( gamma1MotherLabel > -1 ){
2885 Int_t pdgCodeMother = ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode();
2887 if( pdgCodeMother != 111 && pdgCodeMother != 221 ){
2890 motherFromShower = kTRUE;
2902 if(virtualGammaMotherLabel >= 0 && virtualGammaMotherLabel==gamma1MotherLabel){
2904 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2909 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 221){
2916 if(isTruePi0 || isTrueEta){
2919 if( virtualGamma == 1 ){
2939 if( motherFromShower == kTRUE && !matched ){
2944 }
else if ( motherFromShower == kFALSE && !matched ){
2986 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(virtualGammaMotherLabel))->GetMother(0);
3002 if (secMotherLabel >-1){
3003 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==310 && isTruePi0 ){
3007 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==221 && isTruePi0){
3011 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==3122 && isTruePi0){
3019 if (((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->Pt()>0.005){
3033 }
else if (isTrueEta) {
3053 }
else if ( virtualGamma == 0 ) {
3060 if(virtualGammaMotherLabel >=
fMCEvent->GetNumberOfPrimaries()){
3062 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(virtualGammaMotherLabel))->GetMother(0);
3076 if (((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->Pt()>0.005){
3084 }
else if (isTrueEta) {
3093 }
else if( !isTruePi0 && !isTrueEta ){
3096 if(virtualGammaMotherLabel>-1 && gamma1MotherLabel>-1 && virtualGamma == 0){
3105 if (isTrueEta && !matched){
3108 if (isTruePi0 && !matched){
3116 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3117 Double_t mcProdVtxX = primVtxMC->GetX();
3118 Double_t mcProdVtxY = primVtxMC->GetY();
3119 Double_t mcProdVtxZ = primVtxMC->GetZ();
3122 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3123 Bool_t isTruePi0 = kFALSE;
3124 Bool_t isTrueEta = kFALSE;
3126 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3127 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3129 Int_t gamma0MCLabel = -1;
3130 Int_t gamma0MotherLabel = -1;
3131 if(!positiveMC||!negativeMC)
3135 gamma0MCLabel = positiveMC->GetMother();
3136 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3137 gamma0MotherLabel=gammaMC0->GetMother();
3140 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3142 Int_t gamma1MotherLabel = -1;
3145 if(gamma1MCLabel != -1){
3147 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3151 gamma1MotherLabel=gammaMC1->GetMother();
3154 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3155 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3156 }
else gamma1MotherLabel=gammaMC1->GetMother();
3163 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
3164 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3168 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 221){
3174 if(isTruePi0 || isTrueEta){
3210 if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
3216 }
else if (isTrueEta){
3217 if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
3227 Int_t secMotherLabel =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->GetMother();
3240 if (secMotherLabel >-1){
3241 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310 && isTruePi0){
3245 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==221 && isTruePi0){
3249 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==3122 && isTruePi0){
3257 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt()>0.005){
3270 }
else if (isTrueEta){
3282 (Pi0Candidate->Pt()-
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
3287 (Pi0Candidate->Pt()-
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
3292 }
else if(!isTruePi0 && !isTrueEta) {
3294 if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){
3302 if (isTrueEta && !matched){
3305 if (isTruePi0 && !matched){
3322 if(!PhotonCandidate)
continue;
3331 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3357 GammaCandidatesStepOne->Add(PhotonCandidate);
3360 GammaCandidatesStepTwo->Add(PhotonCandidate);
3365 for(
Int_t i = 0;i<GammaCandidatesStepOne->GetEntries();i++){
3367 if(!PhotonCandidate)
continue;
3372 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3393 else GammaCandidatesStepTwo->Add(PhotonCandidate);
3399 for(
Int_t i = 0;i<GammaCandidatesStepTwo->GetEntries();i++){
3401 if(!PhotonCandidate)
continue;
3406 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3427 delete GammaCandidatesStepOne;
3428 GammaCandidatesStepOne = 0x0;
3429 delete GammaCandidatesStepTwo;
3430 GammaCandidatesStepTwo = 0x0;
3438 if( magField < 0.0 ){
3445 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3446 if (AODMCTrackArray == NULL)
return;
3447 AliAODMCParticle *posDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->
GetMCLabelPositive());
3448 AliAODMCParticle *negDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->
GetMCLabelNegative());
3451 if(posDaughter == NULL || negDaughter == NULL)
return;
3452 Int_t pdgCode[2] = {TMath::Abs(posDaughter->GetPdgCode()),TMath::Abs(negDaughter->GetPdgCode())};
3454 if(posDaughter->GetMother() != negDaughter->GetMother()){
3459 else if(posDaughter->GetMother() == -1){
3465 if(pdgCode[0]!=11 || pdgCode[1]!=11){
3470 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()){
3475 AliAODMCParticle *Photon = (AliAODMCParticle*) AODMCTrackArray->At(posDaughter->GetMother());
3476 if(Photon->GetPdgCode() != 22){
3481 if(((posDaughter->GetMCProcessCode())) != 5 || ((negDaughter->GetMCProcessCode())) != 5){
3496 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3497 Double_t mcProdVtxX = primVtxMC->GetX();
3498 Double_t mcProdVtxY = primVtxMC->GetY();
3499 Double_t mcProdVtxZ = primVtxMC->GetZ();
3514 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3515 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 3122){
3519 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3520 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 310){
3524 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3525 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 221){
3536 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3537 Double_t mcProdVtxX = primVtxMC->GetX();
3538 Double_t mcProdVtxY = primVtxMC->GetY();
3539 Double_t mcProdVtxZ = primVtxMC->GetZ();
3542 if( magField < 0.0 ){
3554 if(posDaughter == NULL || negDaughter == NULL)
return;
3555 Int_t pdgCode[2] = {TMath::Abs(posDaughter->GetPdgCode()),TMath::Abs(negDaughter->GetPdgCode())};
3557 if(posDaughter->GetMother(0) != negDaughter->GetMother(0)){
3561 else if(posDaughter->GetMother(0) == -1){
3566 if(pdgCode[0]!=11 || pdgCode[1]!=11)
return;
3568 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode())
return;
3572 if(Photon->GetPdgCode() != 22){
3576 if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5)
return;
3588 fCharPhotonMCInfo = 6;
3596 fCharPhotonMCInfo = 2;
3598 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3599 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 3122){
3601 fCharPhotonMCInfo = 5;
3603 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3604 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 310){
3606 fCharPhotonMCInfo = 4;
3608 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3609 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 221){
3610 fCharPhotonMCInfo = 3;
3646 for(
UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
3680 delete backgroundCandidate;
3681 backgroundCandidate = 0x0;
3688 if(previousEventV0s){
3694 for(
UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
3727 delete backgroundCandidate;
3728 backgroundCandidate = 0x0;
3739 Double_t nRadiansPM = fNDegreesPMBackground*TMath::Pi()/180;
3740 Double_t rotationValue =
fRandom.Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM;
3741 gamma->RotateZ(rotationValue);
3747 previousEventEP=previousEventEP+TMath::Pi();
3748 thisEventEP=thisEventEP+TMath::Pi();
3749 Double_t rotationValue= thisEventEP-previousEventEP;
3750 gamma->RotateZ(rotationValue);
3792 if(!PhotonCandidate)
continue;
3805 Bool_t AODLabelPos = kFALSE;
3806 Bool_t AODLabelNeg = kFALSE;
3809 AliAODTrack *tempDaughter =
static_cast<AliAODTrack*
>(
fInputEvent->GetTrack(i));
3814 AODLabelPos = kTRUE;
3821 AODLabelNeg = kTRUE;
3824 if(AODLabelNeg && AODLabelPos){
3828 if(!AODLabelPos || !AODLabelNeg){
3829 cout<<
"WARNING!!! AOD TRACKS NOT FOUND FOR"<<endl;
3843 TAxis *axisafter = histoRebin->GetXaxis();
3844 Int_t bins = axisafter->GetNbins();
3845 Double_t from = axisafter->GetXmin();
3846 Double_t to = axisafter->GetXmax();
3849 Double_t factor = TMath::Power(to/from, 1./bins);
3850 for(
Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
3851 axisafter->Set(bins, newbins);
3865 if (daughter == 111) {
3866 if (TMath::Abs(pdgCode) == 310)
return 1;
3867 else if (TMath::Abs(pdgCode) == 3122)
return 2;
3868 else if (TMath::Abs(pdgCode) == 130)
return 3;
3869 else if (TMath::Abs(pdgCode) == 2212)
return 4;
3870 else if (TMath::Abs(pdgCode) == 2112)
return 5;
3871 else if (TMath::Abs(pdgCode) == 211)
return 6;
3872 else if (TMath::Abs(pdgCode) == 321)
return 7;
3873 else if (TMath::Abs(pdgCode) == 113 || TMath::Abs(pdgCode) == 213 )
return 8;
3874 else if (TMath::Abs(pdgCode) == 3222 || TMath::Abs(pdgCode) == 3212 || TMath::Abs(pdgCode) == 3112 )
return 9;
3875 else if (TMath::Abs(pdgCode) == 2224 || TMath::Abs(pdgCode) == 2214 || TMath::Abs(pdgCode) == 2114 || TMath::Abs(pdgCode) == 1114 )
return 10;
3876 else if (TMath::Abs(pdgCode) == 313 || TMath::Abs(pdgCode) == 323 )
return 11;
3886 for (
Int_t i = 0; i < arr->GetEntriesFast();i++){
3887 TString tempStr = ((TObjString*)arr->At(i))->GetString();
3888 if (tempStr.Atoi() == tobechecked)
return kTRUE;
3896 Bool_t isContained = kFALSE;
3897 for (
Int_t i = 0; i < arr->GetEntriesFast();i++){
3898 TString tempStr = ((TObjString*)arr->At(i))->GetString();
3899 if (tempStr.Atoi() == tobechecked) isContained= kTRUE;
3901 if (!isContained)input.Append(Form(
"%i,",tobechecked));
3910 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3911 Double_t mcProdVtxX = primVtxMC->GetX();
3912 Double_t mcProdVtxY = primVtxMC->GetY();
3913 Double_t mcProdVtxZ = primVtxMC->GetZ();
3920 Int_t gamma0MotherLabel = -1;
3922 if(gamma0MCLabel != -1){
3923 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3924 gamma0MotherLabel=gammaMC0->GetFirstMother();
3925 if (gamma0MotherLabel>-1){
3926 if(((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetPdgCode() == 111){
3932 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetMother(0);
3941 if (((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->Pt()>0.005){
3948 }
else if(((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetPdgCode() == 221){
3952 if (((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->Pt()>0.005){
3969 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3970 Double_t mcProdVtxX = primVtxMC->GetX();
3971 Double_t mcProdVtxY = primVtxMC->GetY();
3972 Double_t mcProdVtxZ = primVtxMC->GetZ();
3974 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3980 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0->
GetMCLabelPositive()));
3981 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0->
GetMCLabelNegative()));
3983 Int_t gamma0MCLabel = -1;
3984 Int_t gamma0MotherLabel = -1;
3985 if(!positiveMC||!negativeMC)
3989 gamma0MCLabel = positiveMC->GetMother();
3990 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3991 gamma0MotherLabel=gammaMC0->GetMother();
3993 if (gamma0MotherLabel>-1){
3994 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma0MotherLabel))->GetPdgCode() == 111){
3998 Int_t secMotherLabel =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel))->GetMother();
4007 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->Pt()>0.005){
4014 }
else if(((AliAODMCParticle*)AODMCTrackArray->At(gamma0MotherLabel))->GetPdgCode() == 221){
4018 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->Pt()>0.005){
4036 const AliVVertex* primVtxMC = 0;
4046 primVtxMC =
fMCEvent->GetPrimaryVertex();
4047 mcProdVtxX = primVtxMC->GetX();
4048 mcProdVtxY = primVtxMC->GetY();
4049 mcProdVtxZ = primVtxMC->GetZ();
4058 if( magField < 0.0 ){
4068 vector<Int_t> lGoodElectronIndexPrev(0);
4069 vector<Int_t> lGoodPositronIndexPrev(0);
4079 Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
4080 Int_t isMCFromMBHeader = -1;
4099 Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
4104 if( labelelectron >=0 && labelelectron < fMCEvent->GetNumberOfTracks() ){
4105 TParticle* electron =
fMCEvent->Particle(labelelectron);
4106 if( electron->GetPdgCode() == 11 ){
4134 Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
4135 Int_t isMCFromMBHeader = -1;
4151 Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
4155 if( labelpositron >=0 && labelpositron < fMCEvent->GetNumberOfTracks() ) {
4156 TParticle* positron =
fMCEvent->Particle(labelpositron);
4157 if( positron->GetPdgCode() == -11 ){
4175 vector<Bool_t> lElectronPsiIndex(lGoodElectronIndexPrev.size(), kTRUE);
4176 vector<Bool_t> lPositronPsiIndex(lGoodPositronIndexPrev.size(), kTRUE);
4179 for(
UInt_t i = 0; i < lGoodElectronIndexPrev.size(); i++ ) {
4180 AliESDtrack *electronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodElectronIndexPrev[i]);
4181 for(
UInt_t j = 0; j < lGoodPositronIndexPrev.size(); j++){
4183 AliESDtrack *positronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodPositronIndexPrev[j]);
4185 Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->GetConstrainedParam()->Phi()-positronCandidate->GetConstrainedParam()->Phi());
4188 lElectronPsiIndex[i] = kFALSE;
4189 lPositronPsiIndex[j] = kFALSE;
4195 vector<Int_t> lGoodElectronIndex(0);
4196 vector<Int_t> lGoodPositronIndex(0);
4198 for(
UInt_t i = 0; i < lGoodElectronIndexPrev.size(); i++ ) {
4199 if( lElectronPsiIndex[i] == kTRUE )
4200 lGoodElectronIndex.push_back( lGoodElectronIndexPrev[i] );
4203 for(
UInt_t i = 0; i < lGoodPositronIndexPrev.size(); i++ ) {
4204 if( lPositronPsiIndex[i] == kTRUE )
4205 lGoodPositronIndex.push_back( lGoodPositronIndexPrev[i] );
4209 for(
UInt_t i = 0; i < lGoodElectronIndex.size(); i++){
4211 AliESDtrack *electronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodElectronIndex[i]);
4212 AliKFParticle electronCandidateKF( *electronCandidate->GetConstrainedParam(), ::kElectron );
4214 TLorentzVector electronCandidateTLV;
4216 electronCandidateTLV.SetXYZM(electronCandidate->GetConstrainedParam()->Px(),electronCandidate->GetConstrainedParam()->Py(),electronCandidate->GetConstrainedParam()->Pz(),TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass());
4219 for(
UInt_t j = 0; j < lGoodPositronIndex.size(); j++){
4221 AliESDtrack *positronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodPositronIndex[j]);
4222 AliKFParticle positronCandidateKF( *positronCandidate->GetConstrainedParam(), ::kPositron );
4223 TLorentzVector positronCandidateTLV;
4225 positronCandidateTLV.SetXYZM(positronCandidate->GetConstrainedParam()->Px(),positronCandidate->GetConstrainedParam()->Py(),positronCandidate->GetConstrainedParam()->Pz(),TDatabasePDG::Instance()->GetParticle( ::kPositron )->Mass());
4227 TLorentzVector *virtualPhotonTLV = 0;
4234 virtualPhotonTLV =
new TLorentzVector( smearelectronCandidateTLV + smearpositronCandidateTLV );
4236 vphoton->
SetMass(virtualPhotonTLV->M());
4240 AliKFVertex primaryVertexImproved(*
fInputEvent->GetPrimaryVertex());
4241 primaryVertexImproved+=*virtualPhoton;
4242 virtualPhoton->SetProductionVertex(primaryVertexImproved);
4246 vphoton->
SetTrackLabels( lGoodPositronIndex[j], lGoodElectronIndex[i]);
4249 Int_t labeln=TMath::Abs(electronCandidate->GetLabel());
4250 Int_t labelp=TMath::Abs(positronCandidate->GetLabel());
4251 TParticle *fNegativeMCParticle =
fMCEvent->Particle(labeln);
4252 TParticle *fPositiveMCParticle =
fMCEvent->Particle(labelp);
4254 if( fPositiveMCParticle && fNegativeMCParticle) {
4264 if( virtualPhoton ){
4265 delete virtualPhoton;
4268 if ( virtualPhotonTLV ){
4269 delete virtualPhotonTLV;
4270 virtualPhotonTLV=NULL;
4284 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
4286 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
4288 TParticle* mother =
fMCEvent->Particle( motherLabel );
4290 if( mother->GetPdgCode() != 111 )
return kFALSE;
4292 if(
IsDalitz( mother ) )
return kTRUE;
4310 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
4311 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
4313 TVector3 posDaughter;
4314 TVector3 negDaughter;
4316 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
4317 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
4319 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
4320 Double_t openingAngle = posDaughter.Angle( negDaughter );