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),
305 fTrackMatcherRunningMode(0)
314 fV0ReaderName(
"V0ReaderV1"),
316 fBGClusHandler(NULL),
323 fPhotonDCAList(NULL),
326 fHeaderNameList(NULL),
327 fClusterOutputList(NULL),
330 fSelectorElectronIndex(0),
331 fSelectorPositronIndex(0),
332 fGammaCandidates(NULL),
333 fClusterCandidates(NULL),
334 fVirtualGammaCandidates(NULL),
335 fEventCutArray(NULL),
337 fGammaCutArray(NULL),
338 fElectronCutArray(NULL),
339 fConversionCuts(NULL),
340 fClusterCutArray(NULL),
341 fCaloPhotonCuts(NULL),
342 fMesonCutArray(NULL),
344 fHistoConvGammaPt(NULL),
345 fHistoConvGammaR(NULL),
346 fHistoConvGammaEta(NULL),
347 fHistoDalitzElectronPt(NULL),
348 fHistoDalitzPositronPt(NULL),
349 fHistoDalitzElectronPhi(NULL),
350 fHistoDalitzPositronPhi(NULL),
356 fCharPhotonMCInfo(0),
357 fHistoMotherInvMassPt(NULL),
358 fHistoMotherInvMassOpeningAngleGammaElectron(NULL),
359 fHistoMotherMatchedInvMassPt(NULL),
360 fSparseMotherInvMassPtZM(NULL),
361 fHistoMotherBackInvMassPt(NULL),
362 fSparseMotherBackInvMassPtZM(NULL),
363 fHistoMotherInvMassEalpha(NULL),
364 fHistoMotherPi0PtY(NULL),
365 fHistoMotherEtaPtY(NULL),
366 fHistoMotherPi0PtAlpha(NULL),
367 fHistoMotherEtaPtAlpha(NULL),
368 fHistoMotherPi0PtOpenAngle(NULL),
369 fHistoMotherEtaPtOpenAngle(NULL),
370 fHistoMotherPi0ConvPhotonEtaPhi(NULL),
371 fHistoMotherEtaConvPhotonEtaPhi(NULL),
372 fHistoMotherInvMassECalib(NULL),
373 fHistoMotherInvMassECalibalpha(NULL),
374 fHistoClusGammaPt(NULL),
375 fHistoClusOverlapHeadersGammaPt(NULL),
376 fHistoMCHeaders(NULL),
377 fHistoMCAllGammaPt(NULL),
378 fHistoMCAllGammaPi0Pt(NULL),
379 fHistoMCAllGammaEMCALAccPt(NULL),
380 fHistoMCDecayGammaPi0Pt(NULL),
381 fHistoMCDecayGammaRhoPt(NULL),
382 fHistoMCDecayGammaEtaPt(NULL),
383 fHistoMCDecayGammaOmegaPt(NULL),
384 fHistoMCDecayGammaEtapPt(NULL),
385 fHistoMCDecayGammaPhiPt(NULL),
386 fHistoMCDecayGammaSigmaPt(NULL),
387 fHistoMCConvGammaPt(NULL),
388 fHistoMCConvGammaR(NULL),
389 fHistoMCConvGammaEta(NULL),
390 fHistoMCAllPositronsPt(NULL),
391 fHistoMCDecayPositronPi0Pt(NULL),
392 fHistoMCAllElectronsPt(NULL),
393 fHistoMCDecayElectronPi0Pt(NULL),
394 fHistoMCDecayNoPrimElectronPi0DalitzR(NULL),
395 fHistoMCDecayNoPrimPositronPi0DalitzR(NULL),
396 fHistoMCDecayNoPrimElectronPi0DalitzID(NULL),
397 fHistoMCDecayNoPrimPositronPi0DalitzID(NULL),
398 fHistoMCPi0GGPt(NULL),
399 fHistoMCPi0GGWOWeightPt(NULL),
401 fHistoMCPi0WOWeightPt(NULL),
402 fHistoMCEtaGGPt(NULL),
403 fHistoMCEtaGGWOWeightPt(NULL),
405 fHistoMCEtaWOWeightPt(NULL),
406 fHistoMCPi0InAccPt(NULL),
407 fHistoMCPi0InAccOpeningAngleGammaElectron(NULL),
408 fHistoMCEtaInAccPt(NULL),
409 fHistoMCPi0PtY(NULL),
410 fHistoMCEtaPtY(NULL),
411 fHistoMCPi0PtAlpha(NULL),
412 fHistoMCEtaPtAlpha(NULL),
414 fHistoMCK0sWOWeightPt(NULL),
415 fHistoMCK0sPtY(NULL),
416 fHistoTruePi0InvMassPt(NULL),
417 fHistoTrueEtaInvMassPt(NULL),
418 fHistoTruePi0ShowerInvMassPt(NULL),
419 fHistoTrueEtaShowerInvMassPt(NULL),
420 fHistoTruePi0NoShowerInvMassPt(NULL),
421 fHistoTrueEtaNoShowerInvMassPt(NULL),
422 fHistoTruePi0OpeningAngleGammaElectron(NULL),
423 fHistoTruePi0GGInvMassPt(NULL),
424 fHistoTrueEtaGGInvMassPt(NULL),
425 fHistoTruePi0CaloPhotonInvMassPt(NULL),
426 fHistoTrueEtaCaloPhotonInvMassPt(NULL),
427 fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL),
428 fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt(NULL),
429 fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL),
430 fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt(NULL),
431 fHistoTruePi0CaloElectronInvMassPt(NULL),
432 fHistoTrueEtaCaloElectronInvMassPt(NULL),
433 fHistoTruePi0CaloMergedClusterInvMassPt(NULL),
434 fHistoTrueEtaCaloMergedClusterInvMassPt(NULL),
435 fHistoTrueMotherCaloEMNonLeadingInvMassPt(NULL),
436 fHistoTruePi0CaloMergedClusterPartConvInvMassPt(NULL),
437 fHistoTrueEtaCaloMergedClusterPartConvInvMassPt(NULL),
438 fHistoTruePrimaryPi0InvMassPt(NULL),
439 fHistoTruePrimaryPi0GGInvMassPt(NULL),
440 fHistoTruePrimaryEtaInvMassPt(NULL),
441 fHistoTruePrimaryEtaGGInvMassPt(NULL),
442 fHistoTruePrimaryPi0W0WeightingInvMassPt(NULL),
443 fHistoTruePrimaryEtaW0WeightingInvMassPt(NULL),
444 fProfileTruePrimaryPi0WeightsInvMassPt(NULL),
445 fProfileTruePrimaryEtaWeightsInvMassPt(NULL),
446 fHistoTruePrimaryPi0MCPtResolPt(NULL),
447 fHistoTruePrimaryEtaMCPtResolPt(NULL),
448 fHistoTrueMotherPi0ConvPhotonEtaPhi(NULL),
449 fHistoTrueMotherEtaConvPhotonEtaPhi(NULL),
450 fHistoTrueSecondaryPi0InvMassPt(NULL),
451 fHistoTrueSecondaryPi0GGInvMassPt(NULL),
452 fHistoTrueSecondaryPi0FromK0sInvMassPt(NULL),
453 fHistoTrueK0sWithPi0DaughterMCPt(NULL),
454 fHistoTrueSecondaryPi0FromEtaInvMassPt(NULL),
455 fHistoTrueEtaWithPi0DaughterMCPt(NULL),
456 fHistoTrueSecondaryPi0FromLambdaInvMassPt(NULL),
457 fHistoTrueLambdaWithPi0DaughterMCPt(NULL),
458 fHistoTrueBckGGInvMassPt(NULL),
459 fHistoTrueBckContInvMassPt(NULL),
460 fHistoTruePi0PtY(NULL),
461 fHistoTrueEtaPtY(NULL),
462 fHistoTruePi0PtAlpha(NULL),
463 fHistoTrueEtaPtAlpha(NULL),
464 fHistoTruePi0PtOpenAngle(NULL),
465 fHistoTrueEtaPtOpenAngle(NULL),
466 fHistoTrueConvGammaPt(NULL),
467 fHistoTrueConvPi0GammaPt(NULL),
468 fHistoTrueConvGammaEta(NULL),
469 fHistoTruePositronPt(NULL),
470 fHistoTrueElectronPt(NULL),
471 fHistoTrueSecPositronPt(NULL),
472 fHistoTrueSecElectronPt(NULL),
473 fHistoTruePi0DalitzPositronPt(NULL),
474 fHistoTruePi0DalitzElectronPt(NULL),
475 fHistoTruePi0DalitzSecPositronPt(NULL),
476 fHistoTruePi0DalitzSecElectronPt(NULL),
477 fHistoTruePrimaryConvGammaPt(NULL),
478 fHistoTruePrimaryConvGammaESDPtMCPt(NULL),
479 fHistoTrueSecondaryConvGammaPt(NULL),
480 fHistoTrueSecondaryConvGammaFromXFromK0sPt(NULL),
481 fHistoTrueSecondaryConvGammaFromXFromLambdaPt(NULL),
482 fHistoTrueClusGammaPt(NULL),
483 fHistoTrueClusUnConvGammaPt(NULL),
484 fHistoTrueClusUnConvGammaMCPt(NULL),
485 fHistoTrueClusElectronPt(NULL),
486 fHistoTrueClusConvGammaPt(NULL),
487 fHistoTrueClusConvGammaMCPt(NULL),
488 fHistoTrueClusConvGammaFullyPt(NULL),
489 fHistoTrueClusMergedGammaPt(NULL),
490 fHistoTrueClusMergedPartConvGammaPt(NULL),
491 fHistoTrueClusDalitzPt(NULL),
492 fHistoTrueClusDalitzMergedPt(NULL),
493 fHistoTrueClusPhotonFromElecMotherPt(NULL),
494 fHistoTrueClusShowerPt(NULL),
495 fHistoTrueClusSubLeadingPt(NULL),
496 fHistoTrueClusNParticles(NULL),
497 fHistoTrueClusEMNonLeadingPt(NULL),
498 fHistoTrueNLabelsInClus(NULL),
499 fHistoTruePrimaryClusGammaPt(NULL),
500 fHistoTruePrimaryClusGammaESDPtMCPt(NULL),
501 fHistoTruePi0DalitzClusGammaPt(NULL),
502 fHistoTruePi0DalitzAllClusGammaPt(NULL),
503 fHistoTruePi0DalitzClusGammaMCPt(NULL),
504 fHistoTruePrimaryPi0PhotonPairPtconv(NULL),
505 fHistoTruePrimaryPi0DCPtconv(NULL),
506 fHistoTruePrimaryPi0MissingPtconv(NULL),
507 fHistoTruePrimaryEtaPhotonPairPtconv(NULL),
508 fHistoTruePrimaryEtaDCPtconv(NULL),
509 fHistoTruePrimaryEtaMissingPtconv(NULL),
510 fHistoTrueSecondaryPi0PhotonPairPtconv(NULL),
511 fHistoTrueSecondaryPi0DCPtconv(NULL),
512 fHistoTrueSecondaryPi0MissingPtconv(NULL),
513 fStringRecTruePi0s(NULL),
514 fStringRecTrueEtas(NULL),
515 fHistoDoubleCountTruePi0InvMassPt(NULL),
516 fHistoDoubleCountTrueEtaInvMassPt(NULL),
517 fHistoDoubleCountTrueConvGammaRPt(NULL),
518 fVectorDoubleCountTruePi0s(0),
519 fVectorDoubleCountTrueEtas(0),
520 fVectorDoubleCountTrueConvGammas(0),
522 fHistoNGoodESDTracks(NULL),
523 fHistoNGammaCandidates(NULL),
524 fHistoNGoodESDTracksVsNGammaCanditates(NULL),
525 fHistoSPDClusterTrackletBackground(NULL),
526 fHistoNV0Tracks(NULL),
527 fProfileEtaShift(NULL),
528 fEventPlaneAngle(-100),
530 fNGammaCandidates(0),
541 fMoveParticleAccordingToVertex(kTRUE),
543 fDoMesonAnalysis(kTRUE),
547 fIsFromMBHeader(kTRUE),
548 fIsOverlappingWithOtherHeader(kFALSE),
551 fTrackMatcherRunningMode(0)
554 DefineOutput(1, TList::Class());
581 const Int_t nDim = 4;
582 Int_t nBins[nDim] = {800,250,7,4};
609 if(collisionSystem == 1 || collisionSystem == 2 ||
610 collisionSystem == 5 || collisionSystem == 8 ||
611 collisionSystem == 9){
612 centMin = centMin*10;
613 centMax = centMax*10;
614 if(centMax ==0 && centMax!=centMin) centMax=100;
615 }
else if(collisionSystem == 3 || collisionSystem == 6){
618 }
else if(collisionSystem == 4 || collisionSystem == 7){
619 centMin = ((centMin*5)+45);
620 centMax = ((centMax*5)+45);
626 fBackList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
634 fMotherList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
638 fSparseMotherInvMassPtZM[iCut] =
new THnSparseF(
"Back_Mother_InvMass_Pt_z_m",
"Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
647 collisionSystem,centMin,centMax,
735 TString cutstringMeson =
"NoMesonCut";
739 fCutFolder[iCut]->SetName(Form(
"Cut Number %s_%s_%s_%s_%s",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
743 fESDList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s ESD histograms", cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
749 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,
"Centrality");
750 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,
"Missing MC");
752 TString TriggerNames =
"Not Trigger: ";
754 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
759 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,
"Cont. Vertex");
763 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,
"EMCAL problem");
764 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(11,
"rejectedForJetJetMC");
765 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,
"SPD hits vs tracklet");
766 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,
"Out-of-Bunch pileup Past-Future");
767 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,
"Pileup V0M-TPCout Tracks");
799 fHistoConvGammaPt[iCut] =
new TH1F(
"ESD_ConvGamma_Pt",
"ESD_ConvGamma_Pt",250,0,25);
805 fPhotonDCAList[iCut]->SetName(Form(
"%s_%s_%s_%s Photon DCA tree",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
813 fHistoConvGammaR[iCut] =
new TH1F(
"ESD_ConvGamma_R",
"ESD_ConvGamma_R",800,0,200);
816 fHistoConvGammaEta[iCut] =
new TH1F(
"ESD_ConvGamma_Eta",
"ESD_ConvGamma_Eta",2000,-2,2);
831 fHistoDalitzElectronPhi[iCut] =
new TH1F(
"ESD_DalitzElectron_Phi",
"ESD_DalitzElectron_Phi",360,0,2*TMath::Pi());
834 fHistoDalitzPositronPhi[iCut] =
new TH1F(
"ESD_DalitzPositron_Phi",
"ESD_DalitzPositron_Phi",360,0,2*TMath::Pi());
844 fClusterOutputList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s Cluster Output",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
1078 TString cutstringMeson =
"NoMesonCut";
1082 fMCList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s MC histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
1083 fMCList[iCut]->SetOwner(kTRUE);
1150 fHistoMCPi0GGPt[iCut] =
new TH1F(
"MC_Pi0_GG_Pt",
"MC_Pi0_GG_Pt",250,0,25);
1157 fHistoMCPi0Pt[iCut] =
new TH1F(
"MC_Pi0_Pt",
"MC_Pi0_Pt",250,0,25);
1166 fHistoMCEtaGGPt[iCut] =
new TH1F(
"MC_Eta_GG_Pt",
"MC_Eta_GG_Pt",250,0,25);
1173 fHistoMCEtaPt[iCut] =
new TH1F(
"MC_Eta_Pt",
"MC_Eta_Pt",250,0,25);
1193 fHistoMCPi0PtY[iCut] =
new TH2F(
"MC_Pi0_Pt_Y",
"MC_Pi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1197 fHistoMCEtaPtY[iCut] =
new TH2F(
"MC_Eta_Pt_Y",
"MC_Eta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1208 fHistoMCK0sPt[iCut] =
new TH1F(
"MC_K0s_Pt",
"MC_K0s_Pt",150,0,15);
1214 fHistoMCK0sPtY[iCut] =
new TH2F(
"MC_K0s_Pt_Y",
"MC_K0s_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1227 fTrueList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s True histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringElectron.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
1588 fHistoTruePi0PtY[iCut] =
new TH2F(
"ESD_TruePi0_Pt_Y",
"ESD_TruePi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1593 fHistoTrueEtaPtY[iCut] =
new TH2F(
"ESD_TrueEta_Pt_Y",
"ESD_TrueEta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
1665 if(!
fV0Reader){printf(
"Error: No V0 Reader");
return;}
1676 for(
Int_t iMatcherTask = 0; iMatcherTask < 3; iMatcherTask++){
1682 if(!
fElecSelector){printf(
"Error: No ElectronSelector");
return;}
1741 printf(
" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
1758 if(eventQuality == 2 || eventQuality == 3){
1782 AliEventplane *EventPlane =
fInputEvent->GetEventplane();
1796 Bool_t isRunningEMCALrelAna = kFALSE;
1802 if(eventNotAccepted){
1808 if(eventQuality != 0){
1835 else if(
fInputEvent->IsA()==AliAODEvent::Class()){
1844 if (nameBin.CompareTo(
"")== 0){
1846 ->GetAcceptedHeader())->At(i))->GetString();
1847 fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data());
1916 if(nclus == 0)
return;
1921 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1925 for(Long_t i = 0; i < nclus; i++){
1927 AliVCluster* clus = NULL;
1928 if(
fInputEvent->IsA()==AliESDEvent::Class()) clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)
fInputEvent->GetCaloCluster(i));
1929 else if(
fInputEvent->IsA()==AliAODEvent::Class()) clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)
fInputEvent->GetCaloCluster(i));
1931 if ( !clus )
continue;
1935 TLorentzVector clusterVector;
1936 clus->GetMomentum(clusterVector,vertex);
1938 TLorentzVector* tmpvec =
new TLorentzVector();
1939 tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
1943 if(!PhotonCandidate){
delete clus;
delete tmpvec;
continue;}
1950 Int_t* mclabelsCluster = clus->GetLabels();
1953 if (clus->GetNLabels()>0){
1954 for (
Int_t k =0; k< (
Int_t)clus->GetNLabels(); k++){
1971 if (clus->GetNLabels()>1){
1972 Int_t* mclabelsCluster = clus->GetLabels();
1973 for (
Int_t l = 1; l < (
Int_t)clus->GetNLabels(); l++ ){
1992 delete PhotonCandidate;
2005 TParticle *Photon = NULL;
2006 if (!TruePhotonCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
2028 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2029 Double_t mcProdVtxX = primVtxMC->GetX();
2030 Double_t mcProdVtxY = primVtxMC->GetY();
2031 Double_t mcProdVtxZ = primVtxMC->GetZ();
2044 Int_t gammaMotherLabel = -1;
2048 gammaMotherLabel=Photon->GetMother(0);
2053 if (TruePhotonCandidate->
IsConversion()) gammaMotherLabel=
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0);
2054 else gammaMotherLabel=Photon->GetMother(0);
2058 if( gammaMotherLabel > -1 ){
2060 Int_t motherFromShower = -1;
2063 TParticle* motherGamma =
fMCEvent->Particle( gammaMotherLabel );
2066 if( motherGamma->GetPdgCode() == 111 ) {
2068 if(
IsDalitz( motherGamma ) == kTRUE ){
2080 TParticle* motherGammaShower =
fMCEvent->Particle( motherFromShower );
2085 if( motherGammaShower->GetPdgCode() == 111 ) {
2086 if(
IsDalitz ( motherGammaShower ) ) {
2122 if (TruePhotonCandidate->
IsDalitz())
2128 if (TruePhotonCandidate->
IsShower())
2144 AliAODMCParticle *Photon = NULL;
2145 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
2146 if (AODMCTrackArray){
2147 if (!TruePhotonCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
2151 AliInfo(
"AODMCTrackArray could not be loaded");
2174 AliAODMCParticle *Mother = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
2183 if (TruePhotonCandidate->
IsDalitz())
2189 if (TruePhotonCandidate->
IsShower())
2203 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2204 Double_t mcProdVtxX = primVtxMC->GetX();
2205 Double_t mcProdVtxY = primVtxMC->GetY();
2206 Double_t mcProdVtxZ = primVtxMC->GetZ();
2221 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2222 Double_t mcProdVtxX = primVtxMC->GetX();
2223 Double_t mcProdVtxY = primVtxMC->GetY();
2224 Double_t mcProdVtxZ = primVtxMC->GetZ();
2226 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
2229 for(
Int_t i = 0; i < AODMCTrackArray->GetEntriesFast(); i++) {
2231 AliAODMCParticle* particle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(i));
2232 if (!particle)
continue;
2235 if (!isPrimary)
continue;
2237 Int_t isMCFromMBHeader = -1;
2246 if (TMath::Abs(particle->Eta()) < 0.66 ){
2249 if(particle->GetMother() >-1){
2250 switch((static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother())))->GetPdgCode()){
2277 for(
Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
2278 AliAODMCParticle *tmpDaughter =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(daughterIndex));
2279 if(!tmpDaughter)
continue;
2280 if(TMath::Abs(tmpDaughter->GetPdgCode()) == 11){
2281 rConv = sqrt( (tmpDaughter->Xv()*tmpDaughter->Xv()) + (tmpDaughter->Yv()*tmpDaughter->Yv()) );
2292 if(particle->GetPdgCode() == 310 &&
fDoMesonQA > 0){
2295 if (particle->E() != TMath::Abs(particle->Pz())){
2296 ratio = (particle->E()+particle->Pz()) / (particle->E()-particle->Pz());
2298 if( !(ratio <= 0) ){
2303 if (particle->Pt()>0.005){
2314 AliAODMCParticle* daughter0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(particle->GetDaughter(0)));
2315 AliAODMCParticle* daughter1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(particle->GetDaughter(1)));
2318 if (particle->Pt()>0.005){
2327 if (particle->E() != TMath::Abs(particle->Pz())){
2328 ratio = (particle->E()+particle->Pz()) / (particle->E()-particle->Pz());
2330 if( !(ratio <= 0) ){
2335 if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
2336 alpha = TMath::Abs((daughter0->E() - daughter1->E()))/(daughter0->E() + daughter1->E());
2340 if(particle->GetPdgCode() == 111){
2347 }
else if(particle->GetPdgCode() == 221){
2362 if(particle->GetPdgCode() == 111){
2364 }
else if(particle->GetPdgCode() == 221){
2377 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2378 Double_t mcProdVtxX = primVtxMC->GetX();
2379 Double_t mcProdVtxY = primVtxMC->GetY();
2380 Double_t mcProdVtxZ = primVtxMC->GetZ();
2391 TParticle* particle = (TParticle *)
fMCEvent->Particle(i);
2392 if (!particle)
continue;
2396 Int_t isMCFromMBHeader = -1;
2425 Double_t deltaX = particle->Vx() - mcProdVtxX;
2426 Double_t deltaY = particle->Vy() - mcProdVtxY;
2427 Double_t deltaZ = particle->Vz() - mcProdVtxZ;
2429 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
2432 if( particle->GetPdgCode() == -11) {
2437 if ( particle->GetMother(0) > -1 ) {
2442 if( i >=
fMCEvent->GetNumberOfPrimaries() ){
2453 if( particle->GetPdgCode() == 11){
2457 if ( particle->GetMother(0) > -1 ) {
2463 if( i >=
fMCEvent->GetNumberOfPrimaries() ){
2480 if ( TMath::Abs(particle->Eta()) < 0.66 ){
2484 if(particle->GetMother(0) >-1){
2485 switch(
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode()){
2530 if (particle->Pt()>0.005){
2537 if(particle->GetPdgCode() == 111){
2543 }
else if(particle->GetPdgCode() == 221){
2554 Int_t labelgamma = -1;
2555 Int_t labelelectron = -1;
2556 Int_t labelpositron = -1;
2565 if (particle->Pt()>0.005){
2571 if(particle->GetPdgCode() == 111){
2575 if(particle->GetPdgCode() == 221){
2582 TParticle *gamma =
fMCEvent->Particle(labelgamma);
2583 TParticle *electron =
fMCEvent->Particle(labelelectron);
2584 TParticle *positron =
fMCEvent->Particle(labelpositron);
2596 if( kDaughElectIsPrim && kDaughPositIsPrim && kDaughGammaIsPrim &&
2602 TLorentzVector TLVEpos,TLVEneg,TLVDalitz;
2604 Double_t electronMass = TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass();
2606 TLVEpos.SetXYZM(positron->Px(),positron->Py(),positron->Pz(),electronMass);
2607 TLVEneg.SetXYZM(electron->Px(),electron->Py(),electron->Pz(),electronMass);
2608 TVector3 V3gamma(gamma->Px(),gamma->Py(),gamma->Pz());
2609 Double_t angleGammaEpos = V3gamma.Angle(TLVEpos.Vect());
2610 Double_t angleGammaEneg = V3gamma.Angle(TLVEneg.Vect());
2617 if( particle->GetPdgCode() == 111 ){
2631 if( particle->GetPdgCode() == 221 ){
2657 if (gamma==NULL)
continue;
2665 if (Vgamma==NULL)
continue;
2677 pi0cand->
SetLabels(GammaIndex,virtualGammaIndex);
2687 Double_t angleGammaPositron = -999;
2688 Double_t angleGammaElectron = -999;
2695 positronVgamma->GetConstrainedPxPyPz(momPositron);
2700 electronVgamma->GetConstrainedPxPyPz(momElectron);
2704 TVector3 vPositron(momPositron[0],momPositron[1],momPositron[2]);
2705 TVector3 vElectron(momElectron[0],momElectron[1],momElectron[2]);
2707 angleGammaPositron = vGamma.Angle(vPositron);
2708 angleGammaElectron = vGamma.Angle(vElectron);
2739 if(TMath::Abs(pi0cand->
GetAlpha())<0.1)
2771 if(TMath::Abs( pi0cand->
GetAlpha()) < 0.1 )
2806 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2807 Double_t mcProdVtxX = primVtxMC->GetX();
2808 Double_t mcProdVtxY = primVtxMC->GetY();
2809 Double_t mcProdVtxZ = primVtxMC->GetZ();
2812 Bool_t isTruePi0 = kFALSE;
2813 Bool_t isTrueEta = kFALSE;
2817 Int_t virtualGammaMotherLabel = -1;
2818 Int_t virtualGamma = -1;
2820 Bool_t motherFromShower = kFALSE;
2822 Double_t angleGammaPositron = -999;
2823 Double_t angleGammaElectron = -999;
2830 positronVgamma->GetConstrainedPxPyPz(momPositron);
2835 electronVgamma->GetConstrainedPxPyPz(momElectron);
2838 TVector3 vGamma(TrueGammaCandidate1->
GetPx(),TrueGammaCandidate1->
GetPy(),TrueGammaCandidate1->
GetPz());;
2839 TVector3 vPositron(momPositron[0],momPositron[1],momPositron[2]);
2840 TVector3 vElectron(momElectron[0],momElectron[1],momElectron[2]);
2842 angleGammaPositron = vGamma.Angle(vPositron);
2843 angleGammaElectron = vGamma.Angle(vElectron);
2849 if( virtualGammaMCLabel != -1 ){
2853 TParticle * virtualGammaMotherMC = (TParticle*)
fMCEvent->Particle(virtualGammaMCLabel);
2855 if( TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11) {
2857 if( virtualGammaMotherMC->GetPdgCode() != 22 ){
2858 virtualGammaMotherLabel=virtualGammaMCLabel;
2861 }
else if (negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
2862 virtualGammaMotherLabel=virtualGammaMotherMC->GetMother(0);
2868 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2871 Int_t gamma1MotherLabel = -1;
2874 if(gamma1MCLabel != -1){
2877 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2882 gamma1MotherLabel=gammaMC1->GetMother(0);
2884 if (TrueGammaCandidate1->
IsConversion()) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2885 else gamma1MotherLabel=gammaMC1->GetMother(0);
2889 if( gamma1MotherLabel > -1 ){
2891 Int_t pdgCodeMother = ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode();
2893 if( pdgCodeMother != 111 && pdgCodeMother != 221 ){
2896 motherFromShower = kTRUE;
2908 if(virtualGammaMotherLabel >= 0 && virtualGammaMotherLabel==gamma1MotherLabel){
2910 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2915 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 221){
2922 if(isTruePi0 || isTrueEta){
2925 if( virtualGamma == 1 ){
2945 if( motherFromShower == kTRUE && !matched ){
2950 }
else if ( motherFromShower == kFALSE && !matched ){
2992 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(virtualGammaMotherLabel))->GetMother(0);
3008 if (secMotherLabel >-1){
3009 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==310 && isTruePi0 ){
3013 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==221 && isTruePi0){
3017 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==3122 && isTruePi0){
3025 if (((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->Pt()>0.005){
3039 }
else if (isTrueEta) {
3059 }
else if ( virtualGamma == 0 ) {
3066 if(virtualGammaMotherLabel >=
fMCEvent->GetNumberOfPrimaries()){
3068 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(virtualGammaMotherLabel))->GetMother(0);
3082 if (((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->Pt()>0.005){
3090 }
else if (isTrueEta) {
3099 }
else if( !isTruePi0 && !isTrueEta ){
3102 if(virtualGammaMotherLabel>-1 && gamma1MotherLabel>-1 && virtualGamma == 0){
3111 if (isTrueEta && !matched){
3114 if (isTruePi0 && !matched){
3122 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3123 Double_t mcProdVtxX = primVtxMC->GetX();
3124 Double_t mcProdVtxY = primVtxMC->GetY();
3125 Double_t mcProdVtxZ = primVtxMC->GetZ();
3128 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3129 Bool_t isTruePi0 = kFALSE;
3130 Bool_t isTrueEta = kFALSE;
3132 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3133 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3135 Int_t gamma0MCLabel = -1;
3136 Int_t gamma0MotherLabel = -1;
3137 if(!positiveMC||!negativeMC)
3141 gamma0MCLabel = positiveMC->GetMother();
3142 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3143 gamma0MotherLabel=gammaMC0->GetMother();
3146 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3148 Int_t gamma1MotherLabel = -1;
3151 if(gamma1MCLabel != -1){
3153 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3157 gamma1MotherLabel=gammaMC1->GetMother();
3160 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3161 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3162 }
else gamma1MotherLabel=gammaMC1->GetMother();
3169 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
3170 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3174 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 221){
3180 if(isTruePi0 || isTrueEta){
3216 if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
3222 }
else if (isTrueEta){
3223 if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
3233 Int_t secMotherLabel =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->GetMother();
3246 if (secMotherLabel >-1){
3247 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310 && isTruePi0){
3251 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==221 && isTruePi0){
3255 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==3122 && isTruePi0){
3263 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt()>0.005){
3276 }
else if (isTrueEta){
3288 (Pi0Candidate->Pt()-
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
3293 (Pi0Candidate->Pt()-
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
3298 }
else if(!isTruePi0 && !isTrueEta) {
3300 if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){
3308 if (isTrueEta && !matched){
3311 if (isTruePi0 && !matched){
3328 if(!PhotonCandidate)
continue;
3337 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3363 GammaCandidatesStepOne->Add(PhotonCandidate);
3366 GammaCandidatesStepTwo->Add(PhotonCandidate);
3371 for(
Int_t i = 0;i<GammaCandidatesStepOne->GetEntries();i++){
3373 if(!PhotonCandidate)
continue;
3378 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3399 else GammaCandidatesStepTwo->Add(PhotonCandidate);
3405 for(
Int_t i = 0;i<GammaCandidatesStepTwo->GetEntries();i++){
3407 if(!PhotonCandidate)
continue;
3412 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3433 delete GammaCandidatesStepOne;
3434 GammaCandidatesStepOne = 0x0;
3435 delete GammaCandidatesStepTwo;
3436 GammaCandidatesStepTwo = 0x0;
3444 if( magField < 0.0 ){
3451 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3452 if (AODMCTrackArray == NULL)
return;
3453 AliAODMCParticle *posDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->
GetMCLabelPositive());
3454 AliAODMCParticle *negDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->
GetMCLabelNegative());
3457 if(posDaughter == NULL || negDaughter == NULL)
return;
3458 Int_t pdgCode[2] = {TMath::Abs(posDaughter->GetPdgCode()),TMath::Abs(negDaughter->GetPdgCode())};
3460 if(posDaughter->GetMother() != negDaughter->GetMother()){
3465 else if(posDaughter->GetMother() == -1){
3471 if(pdgCode[0]!=11 || pdgCode[1]!=11){
3476 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()){
3481 AliAODMCParticle *Photon = (AliAODMCParticle*) AODMCTrackArray->At(posDaughter->GetMother());
3482 if(Photon->GetPdgCode() != 22){
3487 if(((posDaughter->GetMCProcessCode())) != 5 || ((negDaughter->GetMCProcessCode())) != 5){
3502 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3503 Double_t mcProdVtxX = primVtxMC->GetX();
3504 Double_t mcProdVtxY = primVtxMC->GetY();
3505 Double_t mcProdVtxZ = primVtxMC->GetZ();
3520 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3521 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 3122){
3525 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3526 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 310){
3530 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3531 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 221){
3542 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3543 Double_t mcProdVtxX = primVtxMC->GetX();
3544 Double_t mcProdVtxY = primVtxMC->GetY();
3545 Double_t mcProdVtxZ = primVtxMC->GetZ();
3548 if( magField < 0.0 ){
3560 if(posDaughter == NULL || negDaughter == NULL)
return;
3561 Int_t pdgCode[2] = {TMath::Abs(posDaughter->GetPdgCode()),TMath::Abs(negDaughter->GetPdgCode())};
3563 if(posDaughter->GetMother(0) != negDaughter->GetMother(0)){
3567 else if(posDaughter->GetMother(0) == -1){
3572 if(pdgCode[0]!=11 || pdgCode[1]!=11)
return;
3574 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode())
return;
3578 if(Photon->GetPdgCode() != 22){
3582 if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5)
return;
3594 fCharPhotonMCInfo = 6;
3602 fCharPhotonMCInfo = 2;
3604 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3605 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 3122){
3607 fCharPhotonMCInfo = 5;
3609 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3610 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 310){
3612 fCharPhotonMCInfo = 4;
3614 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3615 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 221){
3616 fCharPhotonMCInfo = 3;
3652 for(
UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
3686 delete backgroundCandidate;
3687 backgroundCandidate = 0x0;
3694 if(previousEventV0s){
3700 for(
UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
3733 delete backgroundCandidate;
3734 backgroundCandidate = 0x0;
3745 Double_t nRadiansPM = fNDegreesPMBackground*TMath::Pi()/180;
3746 Double_t rotationValue =
fRandom.Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM;
3747 gamma->RotateZ(rotationValue);
3753 previousEventEP=previousEventEP+TMath::Pi();
3754 thisEventEP=thisEventEP+TMath::Pi();
3755 Double_t rotationValue= thisEventEP-previousEventEP;
3756 gamma->RotateZ(rotationValue);
3798 if(!PhotonCandidate)
continue;
3811 Bool_t AODLabelPos = kFALSE;
3812 Bool_t AODLabelNeg = kFALSE;
3815 AliAODTrack *tempDaughter =
static_cast<AliAODTrack*
>(
fInputEvent->GetTrack(i));
3820 AODLabelPos = kTRUE;
3827 AODLabelNeg = kTRUE;
3830 if(AODLabelNeg && AODLabelPos){
3834 if(!AODLabelPos || !AODLabelNeg){
3835 cout<<
"WARNING!!! AOD TRACKS NOT FOUND FOR"<<endl;
3849 TAxis *axisafter = histoRebin->GetXaxis();
3850 Int_t bins = axisafter->GetNbins();
3851 Double_t from = axisafter->GetXmin();
3852 Double_t to = axisafter->GetXmax();
3855 Double_t factor = TMath::Power(to/from, 1./bins);
3856 for(
Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
3857 axisafter->Set(bins, newbins);
3871 if (daughter == 111) {
3872 if (TMath::Abs(pdgCode) == 310)
return 1;
3873 else if (TMath::Abs(pdgCode) == 3122)
return 2;
3874 else if (TMath::Abs(pdgCode) == 130)
return 3;
3875 else if (TMath::Abs(pdgCode) == 2212)
return 4;
3876 else if (TMath::Abs(pdgCode) == 2112)
return 5;
3877 else if (TMath::Abs(pdgCode) == 211)
return 6;
3878 else if (TMath::Abs(pdgCode) == 321)
return 7;
3879 else if (TMath::Abs(pdgCode) == 113 || TMath::Abs(pdgCode) == 213 )
return 8;
3880 else if (TMath::Abs(pdgCode) == 3222 || TMath::Abs(pdgCode) == 3212 || TMath::Abs(pdgCode) == 3112 )
return 9;
3881 else if (TMath::Abs(pdgCode) == 2224 || TMath::Abs(pdgCode) == 2214 || TMath::Abs(pdgCode) == 2114 || TMath::Abs(pdgCode) == 1114 )
return 10;
3882 else if (TMath::Abs(pdgCode) == 313 || TMath::Abs(pdgCode) == 323 )
return 11;
3892 for (
Int_t i = 0; i < arr->GetEntriesFast();i++){
3893 TString tempStr = ((TObjString*)arr->At(i))->GetString();
3894 if (tempStr.Atoi() == tobechecked)
return kTRUE;
3902 Bool_t isContained = kFALSE;
3903 for (
Int_t i = 0; i < arr->GetEntriesFast();i++){
3904 TString tempStr = ((TObjString*)arr->At(i))->GetString();
3905 if (tempStr.Atoi() == tobechecked) isContained= kTRUE;
3907 if (!isContained)input.Append(Form(
"%i,",tobechecked));
3916 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3917 Double_t mcProdVtxX = primVtxMC->GetX();
3918 Double_t mcProdVtxY = primVtxMC->GetY();
3919 Double_t mcProdVtxZ = primVtxMC->GetZ();
3926 Int_t gamma0MotherLabel = -1;
3928 if(gamma0MCLabel != -1){
3929 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3930 gamma0MotherLabel=gammaMC0->GetFirstMother();
3931 if (gamma0MotherLabel>-1){
3932 if(((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetPdgCode() == 111){
3938 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetMother(0);
3947 if (((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->Pt()>0.005){
3954 }
else if(((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetPdgCode() == 221){
3958 if (((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->Pt()>0.005){
3975 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3976 Double_t mcProdVtxX = primVtxMC->GetX();
3977 Double_t mcProdVtxY = primVtxMC->GetY();
3978 Double_t mcProdVtxZ = primVtxMC->GetZ();
3980 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3986 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0->
GetMCLabelPositive()));
3987 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0->
GetMCLabelNegative()));
3989 Int_t gamma0MCLabel = -1;
3990 Int_t gamma0MotherLabel = -1;
3991 if(!positiveMC||!negativeMC)
3995 gamma0MCLabel = positiveMC->GetMother();
3996 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3997 gamma0MotherLabel=gammaMC0->GetMother();
3999 if (gamma0MotherLabel>-1){
4000 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma0MotherLabel))->GetPdgCode() == 111){
4004 Int_t secMotherLabel =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel))->GetMother();
4013 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->Pt()>0.005){
4020 }
else if(((AliAODMCParticle*)AODMCTrackArray->At(gamma0MotherLabel))->GetPdgCode() == 221){
4024 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->Pt()>0.005){
4042 const AliVVertex* primVtxMC = 0;
4052 primVtxMC =
fMCEvent->GetPrimaryVertex();
4053 mcProdVtxX = primVtxMC->GetX();
4054 mcProdVtxY = primVtxMC->GetY();
4055 mcProdVtxZ = primVtxMC->GetZ();
4064 if( magField < 0.0 ){
4074 vector<Int_t> lGoodElectronIndexPrev(0);
4075 vector<Int_t> lGoodPositronIndexPrev(0);
4085 Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
4086 Int_t isMCFromMBHeader = -1;
4105 Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
4110 if( labelelectron >=0 && labelelectron < fMCEvent->GetNumberOfTracks() ){
4111 TParticle* electron =
fMCEvent->Particle(labelelectron);
4112 if( electron->GetPdgCode() == 11 ){
4140 Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
4141 Int_t isMCFromMBHeader = -1;
4157 Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
4161 if( labelpositron >=0 && labelpositron < fMCEvent->GetNumberOfTracks() ) {
4162 TParticle* positron =
fMCEvent->Particle(labelpositron);
4163 if( positron->GetPdgCode() == -11 ){
4181 vector<Bool_t> lElectronPsiIndex(lGoodElectronIndexPrev.size(), kTRUE);
4182 vector<Bool_t> lPositronPsiIndex(lGoodPositronIndexPrev.size(), kTRUE);
4185 for(
UInt_t i = 0; i < lGoodElectronIndexPrev.size(); i++ ) {
4186 AliESDtrack *electronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodElectronIndexPrev[i]);
4187 for(
UInt_t j = 0; j < lGoodPositronIndexPrev.size(); j++){
4189 AliESDtrack *positronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodPositronIndexPrev[j]);
4191 Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->GetConstrainedParam()->Phi()-positronCandidate->GetConstrainedParam()->Phi());
4194 lElectronPsiIndex[i] = kFALSE;
4195 lPositronPsiIndex[j] = kFALSE;
4201 vector<Int_t> lGoodElectronIndex(0);
4202 vector<Int_t> lGoodPositronIndex(0);
4204 for(
UInt_t i = 0; i < lGoodElectronIndexPrev.size(); i++ ) {
4205 if( lElectronPsiIndex[i] == kTRUE )
4206 lGoodElectronIndex.push_back( lGoodElectronIndexPrev[i] );
4209 for(
UInt_t i = 0; i < lGoodPositronIndexPrev.size(); i++ ) {
4210 if( lPositronPsiIndex[i] == kTRUE )
4211 lGoodPositronIndex.push_back( lGoodPositronIndexPrev[i] );
4215 for(
UInt_t i = 0; i < lGoodElectronIndex.size(); i++){
4217 AliESDtrack *electronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodElectronIndex[i]);
4218 AliKFParticle electronCandidateKF( *electronCandidate->GetConstrainedParam(), ::kElectron );
4220 TLorentzVector electronCandidateTLV;
4222 electronCandidateTLV.SetXYZM(electronCandidate->GetConstrainedParam()->Px(),electronCandidate->GetConstrainedParam()->Py(),electronCandidate->GetConstrainedParam()->Pz(),TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass());
4225 for(
UInt_t j = 0; j < lGoodPositronIndex.size(); j++){
4227 AliESDtrack *positronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodPositronIndex[j]);
4228 AliKFParticle positronCandidateKF( *positronCandidate->GetConstrainedParam(), ::kPositron );
4229 TLorentzVector positronCandidateTLV;
4231 positronCandidateTLV.SetXYZM(positronCandidate->GetConstrainedParam()->Px(),positronCandidate->GetConstrainedParam()->Py(),positronCandidate->GetConstrainedParam()->Pz(),TDatabasePDG::Instance()->GetParticle( ::kPositron )->Mass());
4233 TLorentzVector *virtualPhotonTLV = 0;
4240 virtualPhotonTLV =
new TLorentzVector( smearelectronCandidateTLV + smearpositronCandidateTLV );
4242 vphoton->
SetMass(virtualPhotonTLV->M());
4246 AliKFVertex primaryVertexImproved(*
fInputEvent->GetPrimaryVertex());
4247 primaryVertexImproved+=*virtualPhoton;
4248 virtualPhoton->SetProductionVertex(primaryVertexImproved);
4252 vphoton->
SetTrackLabels( lGoodPositronIndex[j], lGoodElectronIndex[i]);
4255 Int_t labeln=TMath::Abs(electronCandidate->GetLabel());
4256 Int_t labelp=TMath::Abs(positronCandidate->GetLabel());
4257 TParticle *fNegativeMCParticle =
fMCEvent->Particle(labeln);
4258 TParticle *fPositiveMCParticle =
fMCEvent->Particle(labelp);
4260 if( fPositiveMCParticle && fNegativeMCParticle) {
4270 if( virtualPhoton ){
4271 delete virtualPhoton;
4274 if ( virtualPhotonTLV ){
4275 delete virtualPhotonTLV;
4276 virtualPhotonTLV=NULL;
4290 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
4292 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
4294 TParticle* mother =
fMCEvent->Particle( motherLabel );
4296 if( mother->GetPdgCode() != 111 )
return kFALSE;
4298 if(
IsDalitz( mother ) )
return kTRUE;
4316 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
4317 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
4319 TVector3 posDaughter;
4320 TVector3 negDaughter;
4322 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
4323 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
4325 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
4326 Double_t openingAngle = posDaughter.Angle( negDaughter );
4328 if( openingAngle < 1e-20 )
return 0.;
4330 Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
4338 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
4339 if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 )
return kFALSE;
4342 TParticle *positron = 0x0;
4343 TParticle *electron = 0x0;
4344 TParticle *gamma = 0x0;
4346 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
4347 TParticle* temp = (TParticle*)
fMCEvent->Particle( index );
4348 switch( temp->GetPdgCode() ) {
4361 if( positron && electron && gamma)
return kTRUE;
4371 if( particleLabel < 0 )
return -1;
4373 TParticle* particle = (TParticle*)
fMCEvent->Particle( particleLabel );
4375 if( particle->GetMother(0) < 0 )
return -1;
4377 else if ( ((TParticle*)
fMCEvent->Particle( particle->GetMother(0) ) )->GetPdgCode() == 111 ||
4378 ((TParticle*)
fMCEvent->Particle( particle->GetMother(0) ) )->GetPdgCode() == 221 ) {
4380 return particle->GetMother(0);
4391 if(tobechecked > -1)
4393 vector<Int_t>::iterator it;
4394 it = find (vec.begin(), vec.end(), tobechecked);