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){
2293 if (particle->E() != TMath::Abs(particle->Pz())){
2294 ratio = (particle->E()+particle->Pz()) / (particle->E()-particle->Pz());
2296 if( !(ratio <= 0) ){
2301 if (particle->Pt()>0.005){
2312 AliAODMCParticle* daughter0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(particle->GetDaughter(0)));
2313 AliAODMCParticle* daughter1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(particle->GetDaughter(1)));
2316 if (particle->Pt()>0.005){
2325 if (particle->E() != TMath::Abs(particle->Pz())){
2326 ratio = (particle->E()+particle->Pz()) / (particle->E()-particle->Pz());
2328 if( !(ratio <= 0) ){
2333 if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
2334 alpha = TMath::Abs((daughter0->E() - daughter1->E()))/(daughter0->E() + daughter1->E());
2338 if(particle->GetPdgCode() == 111){
2345 }
else if(particle->GetPdgCode() == 221){
2360 if(particle->GetPdgCode() == 111){
2362 }
else if(particle->GetPdgCode() == 221){
2375 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2376 Double_t mcProdVtxX = primVtxMC->GetX();
2377 Double_t mcProdVtxY = primVtxMC->GetY();
2378 Double_t mcProdVtxZ = primVtxMC->GetZ();
2389 TParticle* particle = (TParticle *)
fMCEvent->Particle(i);
2390 if (!particle)
continue;
2394 Int_t isMCFromMBHeader = -1;
2423 Double_t deltaX = particle->Vx() - mcProdVtxX;
2424 Double_t deltaY = particle->Vy() - mcProdVtxY;
2425 Double_t deltaZ = particle->Vz() - mcProdVtxZ;
2427 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
2430 if( particle->GetPdgCode() == -11) {
2435 if ( particle->GetMother(0) > -1 ) {
2440 if( i >=
fMCEvent->GetNumberOfPrimaries() ){
2451 if( particle->GetPdgCode() == 11){
2455 if ( particle->GetMother(0) > -1 ) {
2461 if( i >=
fMCEvent->GetNumberOfPrimaries() ){
2478 if ( TMath::Abs(particle->Eta()) < 0.66 ){
2482 if(particle->GetMother(0) >-1){
2483 switch(
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode()){
2528 if (particle->Pt()>0.005){
2535 if(particle->GetPdgCode() == 111){
2541 }
else if(particle->GetPdgCode() == 221){
2552 Int_t labelgamma = -1;
2553 Int_t labelelectron = -1;
2554 Int_t labelpositron = -1;
2563 if (particle->Pt()>0.005){
2569 if(particle->GetPdgCode() == 111){
2573 if(particle->GetPdgCode() == 221){
2580 TParticle *gamma =
fMCEvent->Particle(labelgamma);
2581 TParticle *electron =
fMCEvent->Particle(labelelectron);
2582 TParticle *positron =
fMCEvent->Particle(labelpositron);
2594 if( kDaughElectIsPrim && kDaughPositIsPrim && kDaughGammaIsPrim &&
2600 TLorentzVector TLVEpos,TLVEneg,TLVDalitz;
2602 Double_t electronMass = TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass();
2604 TLVEpos.SetXYZM(positron->Px(),positron->Py(),positron->Pz(),electronMass);
2605 TLVEneg.SetXYZM(electron->Px(),electron->Py(),electron->Pz(),electronMass);
2606 TVector3 V3gamma(gamma->Px(),gamma->Py(),gamma->Pz());
2607 Double_t angleGammaEpos = V3gamma.Angle(TLVEpos.Vect());
2608 Double_t angleGammaEneg = V3gamma.Angle(TLVEneg.Vect());
2615 if( particle->GetPdgCode() == 111 ){
2629 if( particle->GetPdgCode() == 221 ){
2655 if (gamma==NULL)
continue;
2663 if (Vgamma==NULL)
continue;
2675 pi0cand->
SetLabels(GammaIndex,virtualGammaIndex);
2685 Double_t angleGammaPositron = -999;
2686 Double_t angleGammaElectron = -999;
2693 positronVgamma->GetConstrainedPxPyPz(momPositron);
2698 electronVgamma->GetConstrainedPxPyPz(momElectron);
2702 TVector3 vPositron(momPositron[0],momPositron[1],momPositron[2]);
2703 TVector3 vElectron(momElectron[0],momElectron[1],momElectron[2]);
2705 angleGammaPositron = vGamma.Angle(vPositron);
2706 angleGammaElectron = vGamma.Angle(vElectron);
2737 if(TMath::Abs(pi0cand->
GetAlpha())<0.1)
2769 if(TMath::Abs( pi0cand->
GetAlpha()) < 0.1 )
2804 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2805 Double_t mcProdVtxX = primVtxMC->GetX();
2806 Double_t mcProdVtxY = primVtxMC->GetY();
2807 Double_t mcProdVtxZ = primVtxMC->GetZ();
2810 Bool_t isTruePi0 = kFALSE;
2811 Bool_t isTrueEta = kFALSE;
2815 Int_t virtualGammaMotherLabel = -1;
2816 Int_t virtualGamma = -1;
2818 Bool_t motherFromShower = kFALSE;
2820 Double_t angleGammaPositron = -999;
2821 Double_t angleGammaElectron = -999;
2828 positronVgamma->GetConstrainedPxPyPz(momPositron);
2833 electronVgamma->GetConstrainedPxPyPz(momElectron);
2836 TVector3 vGamma(TrueGammaCandidate1->
GetPx(),TrueGammaCandidate1->
GetPy(),TrueGammaCandidate1->
GetPz());;
2837 TVector3 vPositron(momPositron[0],momPositron[1],momPositron[2]);
2838 TVector3 vElectron(momElectron[0],momElectron[1],momElectron[2]);
2840 angleGammaPositron = vGamma.Angle(vPositron);
2841 angleGammaElectron = vGamma.Angle(vElectron);
2847 if( virtualGammaMCLabel != -1 ){
2851 TParticle * virtualGammaMotherMC = (TParticle*)
fMCEvent->Particle(virtualGammaMCLabel);
2853 if( TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11) {
2855 if( virtualGammaMotherMC->GetPdgCode() != 22 ){
2856 virtualGammaMotherLabel=virtualGammaMCLabel;
2859 }
else if (negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
2860 virtualGammaMotherLabel=virtualGammaMotherMC->GetMother(0);
2866 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2869 Int_t gamma1MotherLabel = -1;
2872 if(gamma1MCLabel != -1){
2875 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2880 gamma1MotherLabel=gammaMC1->GetMother(0);
2882 if (TrueGammaCandidate1->
IsConversion()) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2883 else gamma1MotherLabel=gammaMC1->GetMother(0);
2887 if( gamma1MotherLabel > -1 ){
2889 Int_t pdgCodeMother = ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode();
2891 if( pdgCodeMother != 111 && pdgCodeMother != 221 ){
2894 motherFromShower = kTRUE;
2906 if(virtualGammaMotherLabel >= 0 && virtualGammaMotherLabel==gamma1MotherLabel){
2908 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2913 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 221){
2920 if(isTruePi0 || isTrueEta){
2923 if( virtualGamma == 1 ){
2943 if( motherFromShower == kTRUE && !matched ){
2948 }
else if ( motherFromShower == kFALSE && !matched ){
2990 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(virtualGammaMotherLabel))->GetMother(0);
3006 if (secMotherLabel >-1){
3007 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==310 && isTruePi0 ){
3011 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==221 && isTruePi0){
3015 if(
fMCEvent->Particle(secMotherLabel)->GetPdgCode()==3122 && isTruePi0){
3023 if (((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->Pt()>0.005){
3037 }
else if (isTrueEta) {
3057 }
else if ( virtualGamma == 0 ) {
3064 if(virtualGammaMotherLabel >=
fMCEvent->GetNumberOfPrimaries()){
3066 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(virtualGammaMotherLabel))->GetMother(0);
3080 if (((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->Pt()>0.005){
3088 }
else if (isTrueEta) {
3097 }
else if( !isTruePi0 && !isTrueEta ){
3100 if(virtualGammaMotherLabel>-1 && gamma1MotherLabel>-1 && virtualGamma == 0){
3109 if (isTrueEta && !matched){
3112 if (isTruePi0 && !matched){
3120 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3121 Double_t mcProdVtxX = primVtxMC->GetX();
3122 Double_t mcProdVtxY = primVtxMC->GetY();
3123 Double_t mcProdVtxZ = primVtxMC->GetZ();
3126 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3127 Bool_t isTruePi0 = kFALSE;
3128 Bool_t isTrueEta = kFALSE;
3130 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3131 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3133 Int_t gamma0MCLabel = -1;
3134 Int_t gamma0MotherLabel = -1;
3135 if(!positiveMC||!negativeMC)
3139 gamma0MCLabel = positiveMC->GetMother();
3140 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3141 gamma0MotherLabel=gammaMC0->GetMother();
3144 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3146 Int_t gamma1MotherLabel = -1;
3149 if(gamma1MCLabel != -1){
3151 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3155 gamma1MotherLabel=gammaMC1->GetMother();
3158 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3159 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3160 }
else gamma1MotherLabel=gammaMC1->GetMother();
3167 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
3168 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3172 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 221){
3178 if(isTruePi0 || isTrueEta){
3214 if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
3220 }
else if (isTrueEta){
3221 if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
3231 Int_t secMotherLabel =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->GetMother();
3244 if (secMotherLabel >-1){
3245 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310 && isTruePi0){
3249 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==221 && isTruePi0){
3253 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==3122 && isTruePi0){
3261 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt()>0.005){
3274 }
else if (isTrueEta){
3286 (Pi0Candidate->Pt()-
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
3291 (Pi0Candidate->Pt()-
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
3296 }
else if(!isTruePi0 && !isTrueEta) {
3298 if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){
3306 if (isTrueEta && !matched){
3309 if (isTruePi0 && !matched){
3326 if(!PhotonCandidate)
continue;
3335 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3361 GammaCandidatesStepOne->Add(PhotonCandidate);
3364 GammaCandidatesStepTwo->Add(PhotonCandidate);
3369 for(
Int_t i = 0;i<GammaCandidatesStepOne->GetEntries();i++){
3371 if(!PhotonCandidate)
continue;
3376 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3397 else GammaCandidatesStepTwo->Add(PhotonCandidate);
3403 for(
Int_t i = 0;i<GammaCandidatesStepTwo->GetEntries();i++){
3405 if(!PhotonCandidate)
continue;
3410 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
3431 delete GammaCandidatesStepOne;
3432 GammaCandidatesStepOne = 0x0;
3433 delete GammaCandidatesStepTwo;
3434 GammaCandidatesStepTwo = 0x0;
3442 if( magField < 0.0 ){
3449 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3450 if (AODMCTrackArray == NULL)
return;
3451 AliAODMCParticle *posDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->
GetMCLabelPositive());
3452 AliAODMCParticle *negDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->
GetMCLabelNegative());
3455 if(posDaughter == NULL || negDaughter == NULL)
return;
3456 Int_t pdgCode[2] = {TMath::Abs(posDaughter->GetPdgCode()),TMath::Abs(negDaughter->GetPdgCode())};
3458 if(posDaughter->GetMother() != negDaughter->GetMother()){
3463 else if(posDaughter->GetMother() == -1){
3469 if(pdgCode[0]!=11 || pdgCode[1]!=11){
3474 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()){
3479 AliAODMCParticle *Photon = (AliAODMCParticle*) AODMCTrackArray->At(posDaughter->GetMother());
3480 if(Photon->GetPdgCode() != 22){
3485 if(((posDaughter->GetMCProcessCode())) != 5 || ((negDaughter->GetMCProcessCode())) != 5){
3500 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3501 Double_t mcProdVtxX = primVtxMC->GetX();
3502 Double_t mcProdVtxY = primVtxMC->GetY();
3503 Double_t mcProdVtxZ = primVtxMC->GetZ();
3518 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3519 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 3122){
3523 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3524 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 310){
3528 if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 &&
3529 ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 221){
3540 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3541 Double_t mcProdVtxX = primVtxMC->GetX();
3542 Double_t mcProdVtxY = primVtxMC->GetY();
3543 Double_t mcProdVtxZ = primVtxMC->GetZ();
3546 if( magField < 0.0 ){
3558 if(posDaughter == NULL || negDaughter == NULL)
return;
3559 Int_t pdgCode[2] = {TMath::Abs(posDaughter->GetPdgCode()),TMath::Abs(negDaughter->GetPdgCode())};
3561 if(posDaughter->GetMother(0) != negDaughter->GetMother(0)){
3565 else if(posDaughter->GetMother(0) == -1){
3570 if(pdgCode[0]!=11 || pdgCode[1]!=11)
return;
3572 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode())
return;
3576 if(Photon->GetPdgCode() != 22){
3580 if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5)
return;
3592 fCharPhotonMCInfo = 6;
3600 fCharPhotonMCInfo = 2;
3602 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3603 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 3122){
3605 fCharPhotonMCInfo = 5;
3607 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3608 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 310){
3610 fCharPhotonMCInfo = 4;
3612 if(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0) > -1 &&
3613 fMCEvent->Particle(
fMCEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 221){
3614 fCharPhotonMCInfo = 3;
3650 for(
UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
3684 delete backgroundCandidate;
3685 backgroundCandidate = 0x0;
3692 if(previousEventV0s){
3698 for(
UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
3731 delete backgroundCandidate;
3732 backgroundCandidate = 0x0;
3743 Double_t nRadiansPM = fNDegreesPMBackground*TMath::Pi()/180;
3744 Double_t rotationValue =
fRandom.Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM;
3745 gamma->RotateZ(rotationValue);
3751 previousEventEP=previousEventEP+TMath::Pi();
3752 thisEventEP=thisEventEP+TMath::Pi();
3753 Double_t rotationValue= thisEventEP-previousEventEP;
3754 gamma->RotateZ(rotationValue);
3796 if(!PhotonCandidate)
continue;
3809 Bool_t AODLabelPos = kFALSE;
3810 Bool_t AODLabelNeg = kFALSE;
3813 AliAODTrack *tempDaughter =
static_cast<AliAODTrack*
>(
fInputEvent->GetTrack(i));
3818 AODLabelPos = kTRUE;
3825 AODLabelNeg = kTRUE;
3828 if(AODLabelNeg && AODLabelPos){
3832 if(!AODLabelPos || !AODLabelNeg){
3833 cout<<
"WARNING!!! AOD TRACKS NOT FOUND FOR"<<endl;
3847 TAxis *axisafter = histoRebin->GetXaxis();
3848 Int_t bins = axisafter->GetNbins();
3849 Double_t from = axisafter->GetXmin();
3850 Double_t to = axisafter->GetXmax();
3853 Double_t factor = TMath::Power(to/from, 1./bins);
3854 for(
Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
3855 axisafter->Set(bins, newbins);
3869 if (daughter == 111) {
3870 if (TMath::Abs(pdgCode) == 310)
return 1;
3871 else if (TMath::Abs(pdgCode) == 3122)
return 2;
3872 else if (TMath::Abs(pdgCode) == 130)
return 3;
3873 else if (TMath::Abs(pdgCode) == 2212)
return 4;
3874 else if (TMath::Abs(pdgCode) == 2112)
return 5;
3875 else if (TMath::Abs(pdgCode) == 211)
return 6;
3876 else if (TMath::Abs(pdgCode) == 321)
return 7;
3877 else if (TMath::Abs(pdgCode) == 113 || TMath::Abs(pdgCode) == 213 )
return 8;
3878 else if (TMath::Abs(pdgCode) == 3222 || TMath::Abs(pdgCode) == 3212 || TMath::Abs(pdgCode) == 3112 )
return 9;
3879 else if (TMath::Abs(pdgCode) == 2224 || TMath::Abs(pdgCode) == 2214 || TMath::Abs(pdgCode) == 2114 || TMath::Abs(pdgCode) == 1114 )
return 10;
3880 else if (TMath::Abs(pdgCode) == 313 || TMath::Abs(pdgCode) == 323 )
return 11;
3890 for (
Int_t i = 0; i < arr->GetEntriesFast();i++){
3891 TString tempStr = ((TObjString*)arr->At(i))->GetString();
3892 if (tempStr.Atoi() == tobechecked)
return kTRUE;
3900 Bool_t isContained = kFALSE;
3901 for (
Int_t i = 0; i < arr->GetEntriesFast();i++){
3902 TString tempStr = ((TObjString*)arr->At(i))->GetString();
3903 if (tempStr.Atoi() == tobechecked) isContained= kTRUE;
3905 if (!isContained)input.Append(Form(
"%i,",tobechecked));
3914 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3915 Double_t mcProdVtxX = primVtxMC->GetX();
3916 Double_t mcProdVtxY = primVtxMC->GetY();
3917 Double_t mcProdVtxZ = primVtxMC->GetZ();
3924 Int_t gamma0MotherLabel = -1;
3926 if(gamma0MCLabel != -1){
3927 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3928 gamma0MotherLabel=gammaMC0->GetFirstMother();
3929 if (gamma0MotherLabel>-1){
3930 if(((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetPdgCode() == 111){
3936 Int_t secMotherLabel = ((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetMother(0);
3945 if (((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->Pt()>0.005){
3952 }
else if(((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetPdgCode() == 221){
3956 if (((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->Pt()>0.005){
3973 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
3974 Double_t mcProdVtxX = primVtxMC->GetX();
3975 Double_t mcProdVtxY = primVtxMC->GetY();
3976 Double_t mcProdVtxZ = primVtxMC->GetZ();
3978 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3984 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0->
GetMCLabelPositive()));
3985 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0->
GetMCLabelNegative()));
3987 Int_t gamma0MCLabel = -1;
3988 Int_t gamma0MotherLabel = -1;
3989 if(!positiveMC||!negativeMC)
3993 gamma0MCLabel = positiveMC->GetMother();
3994 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3995 gamma0MotherLabel=gammaMC0->GetMother();
3997 if (gamma0MotherLabel>-1){
3998 if(((AliAODMCParticle*)AODMCTrackArray->At(gamma0MotherLabel))->GetPdgCode() == 111){
4002 Int_t secMotherLabel =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel))->GetMother();
4011 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->Pt()>0.005){
4018 }
else if(((AliAODMCParticle*)AODMCTrackArray->At(gamma0MotherLabel))->GetPdgCode() == 221){
4022 if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->Pt()>0.005){
4040 const AliVVertex* primVtxMC = 0;
4050 primVtxMC =
fMCEvent->GetPrimaryVertex();
4051 mcProdVtxX = primVtxMC->GetX();
4052 mcProdVtxY = primVtxMC->GetY();
4053 mcProdVtxZ = primVtxMC->GetZ();
4062 if( magField < 0.0 ){
4072 vector<Int_t> lGoodElectronIndexPrev(0);
4073 vector<Int_t> lGoodPositronIndexPrev(0);
4083 Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
4084 Int_t isMCFromMBHeader = -1;
4103 Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
4108 if( labelelectron >=0 && labelelectron < fMCEvent->GetNumberOfTracks() ){
4109 TParticle* electron =
fMCEvent->Particle(labelelectron);
4110 if( electron->GetPdgCode() == 11 ){
4138 Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
4139 Int_t isMCFromMBHeader = -1;
4155 Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
4159 if( labelpositron >=0 && labelpositron < fMCEvent->GetNumberOfTracks() ) {
4160 TParticle* positron =
fMCEvent->Particle(labelpositron);
4161 if( positron->GetPdgCode() == -11 ){
4179 vector<Bool_t> lElectronPsiIndex(lGoodElectronIndexPrev.size(), kTRUE);
4180 vector<Bool_t> lPositronPsiIndex(lGoodPositronIndexPrev.size(), kTRUE);
4183 for(
UInt_t i = 0; i < lGoodElectronIndexPrev.size(); i++ ) {
4184 AliESDtrack *electronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodElectronIndexPrev[i]);
4185 for(
UInt_t j = 0; j < lGoodPositronIndexPrev.size(); j++){
4187 AliESDtrack *positronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodPositronIndexPrev[j]);
4189 Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->GetConstrainedParam()->Phi()-positronCandidate->GetConstrainedParam()->Phi());
4192 lElectronPsiIndex[i] = kFALSE;
4193 lPositronPsiIndex[j] = kFALSE;
4199 vector<Int_t> lGoodElectronIndex(0);
4200 vector<Int_t> lGoodPositronIndex(0);
4202 for(
UInt_t i = 0; i < lGoodElectronIndexPrev.size(); i++ ) {
4203 if( lElectronPsiIndex[i] == kTRUE )
4204 lGoodElectronIndex.push_back( lGoodElectronIndexPrev[i] );
4207 for(
UInt_t i = 0; i < lGoodPositronIndexPrev.size(); i++ ) {
4208 if( lPositronPsiIndex[i] == kTRUE )
4209 lGoodPositronIndex.push_back( lGoodPositronIndexPrev[i] );
4213 for(
UInt_t i = 0; i < lGoodElectronIndex.size(); i++){
4215 AliESDtrack *electronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodElectronIndex[i]);
4216 AliKFParticle electronCandidateKF( *electronCandidate->GetConstrainedParam(), ::kElectron );
4218 TLorentzVector electronCandidateTLV;
4220 electronCandidateTLV.SetXYZM(electronCandidate->GetConstrainedParam()->Px(),electronCandidate->GetConstrainedParam()->Py(),electronCandidate->GetConstrainedParam()->Pz(),TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass());
4223 for(
UInt_t j = 0; j < lGoodPositronIndex.size(); j++){
4225 AliESDtrack *positronCandidate = (AliESDtrack*)
fInputEvent->GetTrack(lGoodPositronIndex[j]);
4226 AliKFParticle positronCandidateKF( *positronCandidate->GetConstrainedParam(), ::kPositron );
4227 TLorentzVector positronCandidateTLV;
4229 positronCandidateTLV.SetXYZM(positronCandidate->GetConstrainedParam()->Px(),positronCandidate->GetConstrainedParam()->Py(),positronCandidate->GetConstrainedParam()->Pz(),TDatabasePDG::Instance()->GetParticle( ::kPositron )->Mass());
4231 TLorentzVector *virtualPhotonTLV = 0;
4238 virtualPhotonTLV =
new TLorentzVector( smearelectronCandidateTLV + smearpositronCandidateTLV );
4240 vphoton->
SetMass(virtualPhotonTLV->M());
4244 AliKFVertex primaryVertexImproved(*
fInputEvent->GetPrimaryVertex());
4245 primaryVertexImproved+=*virtualPhoton;
4246 virtualPhoton->SetProductionVertex(primaryVertexImproved);
4250 vphoton->
SetTrackLabels( lGoodPositronIndex[j], lGoodElectronIndex[i]);
4253 Int_t labeln=TMath::Abs(electronCandidate->GetLabel());
4254 Int_t labelp=TMath::Abs(positronCandidate->GetLabel());
4255 TParticle *fNegativeMCParticle =
fMCEvent->Particle(labeln);
4256 TParticle *fPositiveMCParticle =
fMCEvent->Particle(labelp);
4258 if( fPositiveMCParticle && fNegativeMCParticle) {
4268 if( virtualPhoton ){
4269 delete virtualPhoton;
4272 if ( virtualPhotonTLV ){
4273 delete virtualPhotonTLV;
4274 virtualPhotonTLV=NULL;
4288 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
4290 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
4292 TParticle* mother =
fMCEvent->Particle( motherLabel );
4294 if( mother->GetPdgCode() != 111 )
return kFALSE;
4296 if(
IsDalitz( mother ) )
return kTRUE;
4314 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
4315 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
4317 TVector3 posDaughter;
4318 TVector3 negDaughter;
4320 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
4321 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
4323 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
4324 Double_t openingAngle = posDaughter.Angle( negDaughter );
4326 if( openingAngle < 1e-20 )
return 0.;
4328 Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
4336 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
4337 if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 )
return kFALSE;
4340 TParticle *positron = 0x0;
4341 TParticle *electron = 0x0;
4342 TParticle *gamma = 0x0;
4344 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
4345 TParticle* temp = (TParticle*)
fMCEvent->Particle( index );
4346 switch( temp->GetPdgCode() ) {
4359 if( positron && electron && gamma)
return kTRUE;
4369 if( particleLabel < 0 )
return -1;
4371 TParticle* particle = (TParticle*)
fMCEvent->Particle( particleLabel );
4373 if( particle->GetMother(0) < 0 )
return -1;
4375 else if ( ((TParticle*)
fMCEvent->Particle( particle->GetMother(0) ) )->GetPdgCode() == 111 ||
4376 ((TParticle*)
fMCEvent->Particle( particle->GetMother(0) ) )->GetPdgCode() == 221 ) {
4378 return particle->GetMother(0);
4389 if(tobechecked > -1)
4391 vector<Int_t>::iterator it;
4392 it = find (vec.begin(), vec.end(), tobechecked);
4393 if (it != vec.end())
return true;
4395 vec.push_back(tobechecked);