19 #include "TParticle.h" 21 #include "TMCProcess.h" 22 #include "TDatabasePDG.h" 25 #include "TDirectory.h" 29 #include "THnSparse.h" 31 #include "AliAnalysisManager.h" 32 #include "AliESDInputHandler.h" 33 #include "AliESDtrack.h" 34 #include "AliMCEvent.h" 35 #include "AliMCEventHandler.h" 38 #include "AliESDtrackCuts.h" 39 #include "AliESDpidCuts.h" 40 #include "AliMCEvent.h" 42 #include "AliESDEvent.h" 43 #include "AliESDpid.h" 44 #include "AliKFParticle.h" 45 #include "AliMCEventHandler.h" 46 #include "AliKFVertex.h" 47 #include "AliTriggerAnalysis.h" 48 #include "AliCentrality.h" 49 #include "AliMultiplicity.h" 50 #include "AliAODEvent.h" 60 fV0ReaderName("V0ReaderV1"),
73 fSelectorNegPionIndex(0),
74 fSelectorPosPionIndex(0),
75 fGoodConvGammas(NULL),
76 fClusterCandidates(NULL),
77 fNeutralPionCandidates(NULL),
78 fNeutralPionSidebandCandidates(NULL),
79 fPosPionCandidates(NULL),
80 fNegPionCandidates(NULL),
81 fGoodVirtualParticles(NULL),
84 fClusterCutArray(NULL),
86 fNeutralPionMesonCutArray(NULL),
89 fConversionCuts(NULL),
91 fTreePiPiSameMother(NULL),
92 fTreePiPiPiSameMother(NULL),
93 fTreeEventInfoOmega(NULL),
94 fTreeEventInfoEta(NULL),
96 fSamePiPiMotherID(-1),
97 fSamePiPiMotherInvMass(-1),
98 fSamePiPiMotherPt(-1),
99 fSamePiPiPiMotherID(-1),
100 fSamePiPiPiMotherInvMass(-1),
101 fSamePiPiPiMotherPt(-1),
102 fV0MultiplicityOmegaEvent(-1),
103 fTrackMultiplicityOmegaEvent(-1),
104 fZVertexOmegaEvent(-1),
106 fV0MultiplicityEtaEvent(-1),
107 fTrackMultiplicityEtaEvent(-1),
108 fZVertexEtaEvent(-1),
111 fHistoConvGammaPt(NULL),
112 fHistoConvGammaEta(NULL),
113 fHistoClusterGammaPt(NULL),
114 fHistoClusterGammaEta(NULL),
115 fHistoNegPionPt(NULL),
116 fHistoPosPionPt(NULL),
117 fHistoNegPionPhi(NULL),
118 fHistoPosPionPhi(NULL),
119 fHistoNegPionEta(NULL),
120 fHistoPosPionEta(NULL),
121 fHistoNegPionClsTPC(NULL),
122 fHistoPosPionClsTPC(NULL),
123 fHistoPionDCAxy(NULL),
124 fHistoPionDCAz(NULL),
125 fHistoPionTPCdEdxNSigma(NULL),
126 fHistoPionTPCdEdx(NULL),
127 fHistoPionPionInvMassPt(NULL),
128 fHistoGammaGammaInvMassPt(NULL),
129 fHistoGammaGammaInvMassPtBeforeCuts(NULL),
130 fHistoMotherInvMassPt(NULL),
131 fHistoMotherInvMassPtRejectedKinematic(NULL),
132 fHistoBackInvMassPtGroup1(NULL),
133 fHistoBackInvMassPtGroup2(NULL),
134 fHistoBackInvMassPtGroup3(NULL),
135 fHistoBackInvMassPtGroup4(NULL),
136 fHistoMotherLikeSignBackInvMassPt(NULL),
137 fHistoAngleOmegaPiPlPiMi(NULL),
138 fHistoAngleOmegaPiZero(NULL),
139 fHistoAngleOmegaPiPl(NULL),
140 fHistoAngleOmegaPiMi(NULL),
141 fHistoAnglePiPlPiMi(NULL),
142 fHistoAnglePiZeroPiMi(NULL),
143 fHistoAnglePiPlPiZero(NULL),
144 fHistoAngleSum(NULL),
145 fHistoTrueAngleSum(NULL),
146 fHistoMotherInvMassSubPi0(NULL),
147 fHistoBackInvMassPtGroup1SubPi0(NULL),
148 fHistoBackInvMassPtGroup2SubPi0(NULL),
149 fHistoBackInvMassPtGroup3SubPi0(NULL),
150 fHistoBackInvMassPtGroup4SubPi0(NULL),
151 fHistoMotherLikeSignBackInvMassSubPi0Pt(NULL),
152 fHistoMotherInvMassFixedPzPi0(NULL),
153 fHistoBackInvMassPtGroup1FixedPzPi0(NULL),
154 fHistoBackInvMassPtGroup2FixedPzPi0(NULL),
155 fHistoBackInvMassPtGroup3FixedPzPi0(NULL),
156 fHistoBackInvMassPtGroup4FixedPzPi0(NULL),
157 fHistoMotherLikeSignBackInvMassFixedPzPi0Pt(NULL),
158 fHistoMCAllGammaPt(NULL),
159 fHistoMCConvGammaPt(NULL),
160 fHistoMCAllPosPionsPt(NULL),
161 fHistoMCAllNegPionsPt(NULL),
162 fHistoMCGammaFromNeutralMesonPt(NULL),
163 fHistoMCPosPionsFromNeutralMesonPt(NULL),
164 fHistoMCNegPionsFromNeutralMesonPt(NULL),
165 fHistoMCEtaPiPlPiMiPiZeroPt(NULL),
166 fHistoMCEtaPiPlPiMiPiZeroInAccPt(NULL),
167 fHistoMCOmegaPiPlPiMiPiZeroPt(NULL),
168 fHistoMCOmegaPiPlPiMiPiZeroInAccPt(NULL),
169 fHistoTrueMotherPiPlPiMiPiZeroInvMassPt(NULL),
170 fHistoTrueMotherOmegaPiPlPiMiPiZeroInvMassPt(NULL),
171 fHistoTrueMotherEtaPiPlPiMiPiZeroInvMassPt(NULL),
172 fHistoTrueMotherGammaGammaInvMassPt(NULL),
173 fHistoTrueMotherGammaGammaFromEtaInvMassPt(NULL),
174 fHistoTrueMotherGammaGammaFromOmegaInvMassPt(NULL),
175 fHistoTrueConvGammaPt(NULL),
176 fHistoTrueConvGammaFromNeutralMesonPt(NULL),
177 fHistoTrueClusterGammaPt(NULL),
178 fHistoTrueClusterGammaFromNeutralMesonPt(NULL),
179 fHistoTruePosPionPt(NULL),
180 fHistoTruePosPionFromNeutralMesonPt(NULL),
181 fHistoTrueNegPionPt(NULL),
182 fHistoTrueNegPionFromNeutralMesonPt(NULL),
183 fHistoTruePionPionInvMassPt(NULL),
184 fHistoTruePionPionFromSameMotherInvMassPt(NULL),
185 fHistoTruePionPionFromEtaInvMassPt(NULL),
186 fHistoTruePionPionFromOmegaInvMassPt(NULL),
187 fHistoTruePiPlPiMiSameMotherFromEtaInvMassPt(NULL),
188 fHistoTruePiPlPiMiSameMotherFromOmegaInvMassPt(NULL),
189 fHistoTruePiPlPiMiSameMotherFromRhoInvMassPt(NULL),
190 fHistoTruePiPlPiMiSameMotherFromEtaPrimeInvMassPt(NULL),
191 fHistoTruePiPlPiMiSameMotherFromK0sInvMassPt(NULL),
192 fHistoTruePiPlPiMiSameMotherFromK0lInvMassPt(NULL),
193 fHistoTruePiMiPiZeroSameMotherFromEtaInvMassPt(NULL),
194 fHistoTruePiMiPiZeroSameMotherFromOmegaInvMassPt(NULL),
195 fHistoTruePiMiPiZeroSameMotherFromRhoInvMassPt(NULL),
196 fHistoTruePiMiPiZeroSameMotherFromK0lInvMassPt(NULL),
197 fHistoTruePiPlPiZeroSameMotherFromEtaInvMassPt(NULL),
198 fHistoTruePiPlPiZeroSameMotherFromOmegaInvMassPt(NULL),
199 fHistoTruePiPlPiZeroSameMotherFromRhoInvMassPt(NULL),
200 fHistoTruePiPlPiZeroSameMotherFromK0lInvMassPt(NULL),
201 fHistoTruePiPlPiMiPiZeroPureCombinatoricalInvMassPt(NULL),
202 fHistoTruePiPlPiMiPiZeroContaminationInvMassPt(NULL),
203 fHistoDoubleCountTruePi0InvMassPt(NULL),
204 fHistoDoubleCountTrueEtaInvMassPt(NULL),
205 fHistoDoubleCountTrueOmegaInvMassPt(NULL),
206 fHistoDoubleCountTrueConvGammaRPt(NULL),
207 fVectorDoubleCountTruePi0s(0),
208 fVectorDoubleCountTrueEtas(0),
209 fVectorDoubleCountTrueOmegas(0),
210 fVectorDoubleCountTrueConvGammas(0),
212 fHistoNGoodESDTracks(NULL),
213 fProfileEtaShift(NULL),
214 fHistoSPDClusterTrackletBackground(NULL),
218 fNumberOfESDTracks(0),
219 fMoveParticleAccordingToVertex(kFALSE),
221 fDoMesonAnalysis(kTRUE),
223 fIsFromMBHeader(kTRUE),
225 fDoLightOutput(kFALSE),
228 fTrackMatcherRunningMode(0)
237 fV0ReaderName(
"V0ReaderV1"),
239 fBGHandlerPiPl(NULL),
240 fBGHandlerPiMi(NULL),
250 fSelectorNegPionIndex(0),
251 fSelectorPosPionIndex(0),
252 fGoodConvGammas(NULL),
253 fClusterCandidates(NULL),
254 fNeutralPionCandidates(NULL),
255 fNeutralPionSidebandCandidates(NULL),
256 fPosPionCandidates(NULL),
257 fNegPionCandidates(NULL),
258 fGoodVirtualParticles(NULL),
259 fEventCutArray(NULL),
260 fGammaCutArray(NULL),
261 fClusterCutArray(NULL),
263 fNeutralPionMesonCutArray(NULL),
264 fMesonCutArray(NULL),
266 fConversionCuts(NULL),
268 fTreePiPiSameMother(NULL),
269 fTreePiPiPiSameMother(NULL),
270 fTreeEventInfoOmega(NULL),
271 fTreeEventInfoEta(NULL),
273 fSamePiPiMotherID(-1),
274 fSamePiPiMotherInvMass(-1),
275 fSamePiPiMotherPt(-1),
276 fSamePiPiPiMotherID(-1),
277 fSamePiPiPiMotherInvMass(-1),
278 fSamePiPiPiMotherPt(-1),
279 fV0MultiplicityOmegaEvent(-1),
280 fTrackMultiplicityOmegaEvent(-1),
281 fZVertexOmegaEvent(-1),
283 fV0MultiplicityEtaEvent(-1),
284 fTrackMultiplicityEtaEvent(-1),
285 fZVertexEtaEvent(-1),
288 fHistoConvGammaPt(NULL),
289 fHistoConvGammaEta(NULL),
290 fHistoClusterGammaPt(NULL),
291 fHistoClusterGammaEta(NULL),
292 fHistoNegPionPt(NULL),
293 fHistoPosPionPt(NULL),
294 fHistoNegPionPhi(NULL),
295 fHistoPosPionPhi(NULL),
296 fHistoNegPionEta(NULL),
297 fHistoPosPionEta(NULL),
298 fHistoNegPionClsTPC(NULL),
299 fHistoPosPionClsTPC(NULL),
300 fHistoPionDCAxy(NULL),
301 fHistoPionDCAz(NULL),
302 fHistoPionTPCdEdxNSigma(NULL),
303 fHistoPionTPCdEdx(NULL),
304 fHistoPionPionInvMassPt(NULL),
305 fHistoGammaGammaInvMassPt(NULL),
306 fHistoGammaGammaInvMassPtBeforeCuts(NULL),
307 fHistoMotherInvMassPt(NULL),
308 fHistoMotherInvMassPtRejectedKinematic(NULL),
309 fHistoBackInvMassPtGroup1(NULL),
310 fHistoBackInvMassPtGroup2(NULL),
311 fHistoBackInvMassPtGroup3(NULL),
312 fHistoBackInvMassPtGroup4(NULL),
313 fHistoMotherLikeSignBackInvMassPt(NULL),
314 fHistoAngleOmegaPiPlPiMi(NULL),
315 fHistoAngleOmegaPiZero(NULL),
316 fHistoAngleOmegaPiPl(NULL),
317 fHistoAngleOmegaPiMi(NULL),
318 fHistoAnglePiPlPiMi(NULL),
319 fHistoAnglePiZeroPiMi(NULL),
320 fHistoAnglePiPlPiZero(NULL),
321 fHistoAngleSum(NULL),
322 fHistoTrueAngleSum(NULL),
323 fHistoMotherInvMassSubPi0(NULL),
324 fHistoBackInvMassPtGroup1SubPi0(NULL),
325 fHistoBackInvMassPtGroup2SubPi0(NULL),
326 fHistoBackInvMassPtGroup3SubPi0(NULL),
327 fHistoBackInvMassPtGroup4SubPi0(NULL),
328 fHistoMotherLikeSignBackInvMassSubPi0Pt(NULL),
329 fHistoMotherInvMassFixedPzPi0(NULL),
330 fHistoBackInvMassPtGroup1FixedPzPi0(NULL),
331 fHistoBackInvMassPtGroup2FixedPzPi0(NULL),
332 fHistoBackInvMassPtGroup3FixedPzPi0(NULL),
333 fHistoBackInvMassPtGroup4FixedPzPi0(NULL),
334 fHistoMotherLikeSignBackInvMassFixedPzPi0Pt(NULL),
335 fHistoMCAllGammaPt(NULL),
336 fHistoMCConvGammaPt(NULL),
337 fHistoMCAllPosPionsPt(NULL),
338 fHistoMCAllNegPionsPt(NULL),
339 fHistoMCGammaFromNeutralMesonPt(NULL),
340 fHistoMCPosPionsFromNeutralMesonPt(NULL),
341 fHistoMCNegPionsFromNeutralMesonPt(NULL),
342 fHistoMCEtaPiPlPiMiPiZeroPt(NULL),
343 fHistoMCEtaPiPlPiMiPiZeroInAccPt(NULL),
344 fHistoMCOmegaPiPlPiMiPiZeroPt(NULL),
345 fHistoMCOmegaPiPlPiMiPiZeroInAccPt(NULL),
346 fHistoTrueMotherPiPlPiMiPiZeroInvMassPt(NULL),
347 fHistoTrueMotherOmegaPiPlPiMiPiZeroInvMassPt(NULL),
348 fHistoTrueMotherEtaPiPlPiMiPiZeroInvMassPt(NULL),
349 fHistoTrueMotherGammaGammaInvMassPt(NULL),
350 fHistoTrueMotherGammaGammaFromEtaInvMassPt(NULL),
351 fHistoTrueMotherGammaGammaFromOmegaInvMassPt(NULL),
352 fHistoTrueConvGammaPt(NULL),
353 fHistoTrueConvGammaFromNeutralMesonPt(NULL),
354 fHistoTrueClusterGammaPt(NULL),
355 fHistoTrueClusterGammaFromNeutralMesonPt(NULL),
356 fHistoTruePosPionPt(NULL),
357 fHistoTruePosPionFromNeutralMesonPt(NULL),
358 fHistoTrueNegPionPt(NULL),
359 fHistoTrueNegPionFromNeutralMesonPt(NULL),
360 fHistoTruePionPionInvMassPt(NULL),
361 fHistoTruePionPionFromSameMotherInvMassPt(NULL),
362 fHistoTruePionPionFromEtaInvMassPt(NULL),
363 fHistoTruePionPionFromOmegaInvMassPt(NULL),
364 fHistoTruePiPlPiMiSameMotherFromEtaInvMassPt(NULL),
365 fHistoTruePiPlPiMiSameMotherFromOmegaInvMassPt(NULL),
366 fHistoTruePiPlPiMiSameMotherFromRhoInvMassPt(NULL),
367 fHistoTruePiPlPiMiSameMotherFromEtaPrimeInvMassPt(NULL),
368 fHistoTruePiPlPiMiSameMotherFromK0sInvMassPt(NULL),
369 fHistoTruePiPlPiMiSameMotherFromK0lInvMassPt(NULL),
370 fHistoTruePiMiPiZeroSameMotherFromEtaInvMassPt(NULL),
371 fHistoTruePiMiPiZeroSameMotherFromOmegaInvMassPt(NULL),
372 fHistoTruePiMiPiZeroSameMotherFromRhoInvMassPt(NULL),
373 fHistoTruePiMiPiZeroSameMotherFromK0lInvMassPt(NULL),
374 fHistoTruePiPlPiZeroSameMotherFromEtaInvMassPt(NULL),
375 fHistoTruePiPlPiZeroSameMotherFromOmegaInvMassPt(NULL),
376 fHistoTruePiPlPiZeroSameMotherFromRhoInvMassPt(NULL),
377 fHistoTruePiPlPiZeroSameMotherFromK0lInvMassPt(NULL),
378 fHistoTruePiPlPiMiPiZeroPureCombinatoricalInvMassPt(NULL),
379 fHistoTruePiPlPiMiPiZeroContaminationInvMassPt(NULL),
380 fHistoDoubleCountTruePi0InvMassPt(NULL),
381 fHistoDoubleCountTrueEtaInvMassPt(NULL),
382 fHistoDoubleCountTrueOmegaInvMassPt(NULL),
383 fHistoDoubleCountTrueConvGammaRPt(NULL),
384 fVectorDoubleCountTruePi0s(0),
385 fVectorDoubleCountTrueEtas(0),
386 fVectorDoubleCountTrueOmegas(0),
387 fVectorDoubleCountTrueConvGammas(0),
389 fHistoNGoodESDTracks(NULL),
390 fProfileEtaShift(NULL),
391 fHistoSPDClusterTrackletBackground(NULL),
395 fNumberOfESDTracks(0),
396 fMoveParticleAccordingToVertex(kFALSE),
398 fDoMesonAnalysis(kTRUE),
400 fIsFromMBHeader(kTRUE),
402 fDoLightOutput(kFALSE),
405 fTrackMatcherRunningMode(0)
407 DefineOutput(1, TList::Class());
416 cout<<
"Destructor"<<endl;
471 TString cutstringConvGamma =
"";
473 TString cutstringCaloGamma =
"";
479 if (
fNeutralPionMode == 0) fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
480 else if (
fNeutralPionMode == 1) fullCutString = Form(
"%i_%s_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringCaloGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
481 else if (
fNeutralPionMode == 2) fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringCaloGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
487 if(collisionSystem == 1 || collisionSystem == 2 ||
488 collisionSystem == 5 || collisionSystem == 8 ||
489 collisionSystem == 9){
490 centMin = centMin*10;
491 centMax = centMax*10;
493 else if(collisionSystem == 3 || collisionSystem == 6){
497 else if(collisionSystem == 4 || collisionSystem == 7){
498 centMin = ((centMin*5)+45);
499 centMax = ((centMax*5)+45);
522 Double_t HistoMassRange[2] = {0.4,1.0};
523 Double_t HistoMassRangeSub[2] = {0.4,1.0};
524 Double_t HistoPtRange[2] = {0.,25.};
632 TString cutstringConvGamma =
"";
635 TString cutstringCaloGamma =
"";
643 fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
645 fullCutString = Form(
"%i_%s_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringCaloGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
647 fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringCaloGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
648 TString nameCutFolder = Form(
"Cut Number %s", fullCutString.Data());
649 TString nameESDList = Form(
"%s ESD histograms", fullCutString.Data());
652 fCutFolder[iCut]->SetName(nameCutFolder.Data());
653 fCutFolder[iCut]->SetOwner(kTRUE);
657 fESDList[iCut]->SetName(nameESDList.Data());
662 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,
"Centrality");
663 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,
"Miss. MC or inc. ev.");
666 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,
"Cont. Vertex");
670 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,
"EMCAL problem");
671 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,
"SPD hits vs tracklet");
672 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,
"Out-of-Bunch pileup Past-Future");
673 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,
"Pileup V0M-TPCout Tracks");
692 fHistoConvGammaPt[iCut] =
new TH1F(
"ESD_ConvGamma_Pt",
"ESD_ConvGamma_Pt",250,0,25);
696 fHistoConvGammaEta[iCut] =
new TH1F(
"ESD_ConvGamma_Eta",
"ESD_ConvGamma_Eta",600,-1.5,1.5);
711 fHistoNegPionPt[iCut] =
new TH1F(
"ESD_PrimaryNegPions_Pt",
"ESD_PrimaryNegPions_Pt",1000,0,25);
715 fHistoPosPionPt[iCut] =
new TH1F(
"ESD_PrimaryPosPions_Pt",
"ESD_PrimaryPosPions_Pt",1000,0,25);
719 fHistoNegPionPhi[iCut] =
new TH1F(
"ESD_PrimaryNegPions_Phi",
"ESD_PrimaryNegPions_Phi",360,0,2*TMath::Pi());
723 fHistoPosPionPhi[iCut] =
new TH1F(
"ESD_PrimaryPosPions_Phi",
"ESD_PrimaryPosPions_Phi",360,0,2*TMath::Pi());
733 fHistoNegPionEta[iCut] =
new TH1F(
"ESD_PrimaryNegPions_Eta",
"ESD_PrimaryNegPions_Eta",600,-1.5,1.5);
737 fHistoPosPionEta[iCut] =
new TH1F(
"ESD_PrimaryPosPions_Eta",
"ESD_PrimaryPosPions_Eta",600,-1.5,1.5);
741 fHistoNegPionClsTPC[iCut] =
new TH2F(
"ESD_PrimaryNegPions_ClsTPC",
"ESD_PrimaryNegPions_ClsTPC",100,0,1,400,0.,10.);
745 fHistoPosPionClsTPC[iCut] =
new TH2F(
"ESD_PrimaryPosPions_ClsTPC",
"ESD_PrimaryPosPions_ClsTPC",100,0,1,400,0.,10.);
749 fHistoPionDCAxy[iCut] =
new TH2F(
"ESD_PrimaryPions_DCAxy",
"ESD_PrimaryPions_DCAxy",800,-4.0,4.0,400,0.,10.);
753 fHistoPionDCAz[iCut] =
new TH2F(
"ESD_PrimaryPions_DCAz",
"ESD_PrimaryPions_DCAz",800,-4.0,4.0,400,0.,10.);
761 fHistoPionTPCdEdx[iCut] =
new TH2F(
"ESD_PrimaryPions_TPCdEdxSignal",
"ESD_PrimaryPions_TPCdEdxSignal" ,150,0.05,20.0,800,0.0,200);
775 fHistoMotherInvMassPt[iCut] =
new TH2F(
"ESD_Mother_InvMass_Pt",
"ESD_Mother_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
779 fHistoMotherInvMassPtRejectedKinematic[iCut] =
new TH2F(
"ESD_Mother_InvMass_Pt_KinematicRejected",
"ESD_Mother_InvMass_Pt_KinematicRejected",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
784 fHistoBackInvMassPtGroup1[iCut] =
new TH2F(
"ESD_Background_1_InvMass_Pt",
"ESD_Background_1_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
785 fHistoBackInvMassPtGroup2[iCut] =
new TH2F(
"ESD_Background_2_InvMass_Pt",
"ESD_Background_2_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
786 fHistoBackInvMassPtGroup3[iCut] =
new TH2F(
"ESD_Background_3_InvMass_Pt",
"ESD_Background_3_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
787 fHistoBackInvMassPtGroup4[iCut] =
new TH2F(
"ESD_Background_4_InvMass_Pt",
"ESD_Background_4_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
803 fHistoMotherLikeSignBackInvMassPt[iCut] =
new TH2F(
"ESD_Background_LikeSign_InvMass_Pt",
"ESD_Background_LikeSign_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
809 fHistoMotherInvMassSubPi0[iCut] =
new TH2F(
"ESD_InvMass_Mother_Sub_InvMass(NeutralPion)_Pt",
"ESD_Mother_InvMass_Sub_InvMass(NeutralPion)_Pt",HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
810 fHistoMotherInvMassSubPi0[iCut]->GetXaxis()->SetTitle(
"M_{#pi^{+} #pi^{-} #pi^{0}} - (M_{#pi^{0}}-M_{#pi^{0},PDG}) (GeV/c^{2})");
815 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
817 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
819 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
821 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
838 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
844 fHistoMotherInvMassFixedPzPi0[iCut] =
new TH2F(
"ESD_InvMass_Mother_FixedPz(NeutralPion)_Pt",
"ESD_Mother_InvMass_FixedPz(NeutralPion)_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
849 fHistoBackInvMassPtGroup1FixedPzPi0[iCut] =
new TH2F(
"ESD_Background_1_InvMass_FixedPz(NeutralPion)_Pt",
"ESD_Background_1_InvMass_FixedPz(NeutralPion)_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
850 fHistoBackInvMassPtGroup2FixedPzPi0[iCut] =
new TH2F(
"ESD_Background_2_InvMass_FixedPz(NeutralPion)_Pt",
"ESD_Background_2_InvMass_FixedPz(NeutralPion)_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
851 fHistoBackInvMassPtGroup3FixedPzPi0[iCut] =
new TH2F(
"ESD_Background_3_InvMass_FixedPz(NeutralPion)_Pt",
"ESD_Background_3_InvMass_FixedPz(NeutralPion)_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
852 fHistoBackInvMassPtGroup4FixedPzPi0[iCut] =
new TH2F(
"ESD_Background_4_InvMass_FixedPz(NeutralPion)_Pt",
"ESD_Background_4_InvMass_FixedPz(NeutralPion)_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
867 fHistoMotherLikeSignBackInvMassFixedPzPi0Pt[iCut] =
new TH2F(
"ESD_Background_LikeSign_InvMass_FixedPz(NeutralPion)_Pt",
"ESD_Background_LikeSign_InvMass_FixedPz(NeutralPion)_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
874 fHistoAngleOmegaPiPlPiMi[iCut] =
new TH2F(
"ESD_Mother_AngleOmegaNegPionsPosPions_Pt",
"ESD_Mother_AngleOmegaNegPionsPosPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
878 fHistoAngleOmegaPiMi[iCut] =
new TH2F(
"ESD_Mother_AngleOmegaNegPions_Pt",
"ESD_Mother_AngleOmegaNegPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
882 fHistoAngleOmegaPiPl[iCut] =
new TH2F(
"ESD_Mother_AngleOmegaPosPions_Pt",
"ESD_Mother_AngleOmegaPosPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
886 fHistoAngleOmegaPiZero[iCut] =
new TH2F(
"ESD_Mother_AngleOmegaNeutralPion_Pt",
"ESD_Mother_AngleOmegaNeutralPion_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
890 fHistoAnglePiPlPiZero[iCut] =
new TH2F(
"ESD_Mother_AnglePosPionsNeutralPion_Pt",
"ESD_Mother_AnglePosPionsNeutralPion_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
894 fHistoAnglePiPlPiMi[iCut] =
new TH2F(
"ESD_Mother_AnglePosPionsNegPions_Pt",
"ESD_Mother_AnglePosPionsNegPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
898 fHistoAnglePiZeroPiMi[iCut] =
new TH2F(
"ESD_Mother_AngleNeutralPionNegPions_Pt",
"ESD_Mother_AngleNeutralPionNegPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
902 fHistoAngleSum[iCut] =
new TH2F(
"ESD_Mother_AngleSum_Pt",
"ESD_Mother_AngleSum_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],720,0,2*TMath::Pi());
909 Int_t bins = AxisAfter->GetNbins();
910 Double_t from = AxisAfter->GetXmin();
914 Double_t factor = TMath::Power(to/from, 1./bins);
915 for(
Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
917 AxisAfter->Set(bins, newBins);
919 AxisAfter->Set(bins, newBins);
923 fCutFolder[iCut]->Add(
fESDList[iCut]);
1012 TString cutstringConvGamma =
"";
1015 TString cutstringCaloGamma =
"";
1023 fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),
1024 cutstringMeson.Data());
1026 fullCutString = Form(
"%i_%s_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringCaloGamma.Data(), cutstringNeutralPion.Data(),
1027 cutstringPion.Data(), cutstringMeson.Data());
1029 fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(), cutstringCaloGamma.Data(), cutstringNeutralPion.Data(), cutstringPion.Data(),
1030 cutstringMeson.Data());
1031 TString nameMCList = Form(
"%s MC histograms", fullCutString.Data());
1032 TString nameTrueRecList = Form(
"%s True histograms", fullCutString.Data());
1033 TString nameTrueRecTTreeList = Form(
"%s True TTrees", fullCutString.Data());
1036 fMCList[iCut]->SetName(nameMCList.Data());
1037 fMCList[iCut]->SetOwner(kTRUE);
1041 fHistoMCAllGammaPt[iCut] =
new TH1F(
"MC_AllGamma_Pt",
"MC_AllGamma_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1046 fHistoMCConvGammaPt[iCut] =
new TH1F(
"MC_ConvGamma_Pt",
"MC_ConvGamma_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1052 fHistoMCAllPosPionsPt[iCut] =
new TH1F(
"MC_AllPosPions_Pt",
"MC_AllPosPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1056 fHistoMCAllNegPionsPt[iCut] =
new TH1F(
"MC_AllNegPions_Pt",
"MC_AllNegPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1060 fHistoMCGammaFromNeutralMesonPt[iCut] =
new TH1F(
"MC_GammaFromNeutralMeson_Pt",
"MC_GammaFromNeutralMeson_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1098 fTrueList[iCut]->SetName(nameTrueRecList.Data());
1104 fHistoTrueConvGammaPt[iCut] =
new TH1F(
"ESD_TrueConvGamma_Pt",
"ESD_TrueConvGamma_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1118 fHistoTrueClusterGammaPt[iCut] =
new TH1F(
"ESD_TrueClusterGamma_Pt",
"ESD_TrueClusterGamma_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1127 fHistoTruePosPionPt[iCut] =
new TH1F(
"ESD_TruePosPion_Pt",
"ESD_TruePosPion_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1131 fHistoTrueNegPionPt[iCut] =
new TH1F(
"ESD_TrueNegPion_Pt",
"ESD_TrueNegPion_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1136 fHistoTrueNegPionFromNeutralMesonPt[iCut] =
new TH1F(
"ESD_TrueNegPionFromNeutralMeson_Pt",
"ESD_TrueNegPionFromNeutralMeson_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1140 fHistoTruePosPionFromNeutralMesonPt[iCut] =
new TH1F(
"ESD_TruePosPionFromNeutralMeson_Pt",
"ESD_TruePosPionFromNeutralMeson_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1158 fHistoTrueMotherPiPlPiMiPiZeroInvMassPt[iCut] =
new TH2F(
"ESD_TrueMotherPiPlPiMiPiZero_InvMass_Pt",
"ESD_TrueMotherPiPlPiMiPiZero_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1164 fHistoTrueMotherOmegaPiPlPiMiPiZeroInvMassPt[iCut] =
new TH2F(
"ESD_TrueMotherOmegaPiPlPiMiPiZero_InvMass_Pt",
"ESD_TrueMotherOmegaPiPlPiMiPiZero_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1165 fHistoTrueMotherEtaPiPlPiMiPiZeroInvMassPt[iCut] =
new TH2F(
"ESD_TrueMotherEtaPiPlPiMiPiZero_InvMass_Pt",
"ESD_TrueMotherEtaPiPlPiMiPiZero_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1188 fHistoTrueAngleSum[iCut] =
new TH2F(
"ESD_TrueMother_AngleSum_Pt",
"ESD_TrueMother_AngleSum_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],720,0,2*TMath::Pi());
1224 2000,0.,2.,200,0.,20.);
1324 if(!
fV0Reader){printf(
"Error: No V0 Reader");
return;}
1341 for(
Int_t iMatcherTask = 0; iMatcherTask < 3; iMatcherTask++){
1347 if(!
fPionSelector){printf(
"Error: No PionSelector");
return;}
1405 if(!
fV0Reader){printf(
"Error: No V0 Reader");
return;}
1408 if(InputEvent()->IsIncompleteDAQ()==kTRUE) eventQuality = 2;
1409 if(eventQuality == 2 || eventQuality == 3){
1417 if(!
fPionSelector){printf(
"Error: No PionSelector");
return;}
1431 Bool_t isRunningEMCALrelAna = kFALSE;
1438 if(eventNotAccepted){
1444 if(eventQuality != 0){
1453 fHistoSPDClusterTrackletBackground[iCut]->Fill(fInputEvent->GetMultiplicity()->GetNumberOfTracklets(),(fInputEvent->GetNumberOfITSClusters(0)+fInputEvent->GetNumberOfITSClusters(1)));
1530 printf(
" Eta t PiPlusPiMinus Gamma Task %s :: Eta Shift Manually Set to %f \n\n",
1553 nclus = fInputEvent->GetNumberOfCaloClusters();
1557 if(nclus == 0)
return;
1561 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1564 for(Long_t i = 0; i < nclus; i++){
1566 AliVCluster* clus = NULL;
1567 if(fInputEvent->IsA()==AliESDEvent::Class()) clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
1568 else if(fInputEvent->IsA()==AliAODEvent::Class()) clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
1570 if (!clus)
continue;
1573 TLorentzVector clusterVector;
1574 clus->GetMomentum(clusterVector,vertex);
1576 TLorentzVector* tmpvec =
new TLorentzVector();
1577 tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
1581 if(!PhotonCandidate){
delete clus;
delete tmpvec;
continue;}
1588 Int_t* mclabelsCluster = clus->GetLabels();
1591 if (clus->GetNLabels()>0){
1592 for (
Int_t k =0; k< (
Int_t)clus->GetNLabels(); k++){
1627 TParticle *Photon = NULL;
1628 if (!TruePhotonCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
1632 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
1633 Double_t mcProdVtxX = primVtxMC->GetX();
1634 Double_t mcProdVtxY = primVtxMC->GetY();
1635 Double_t mcProdVtxZ = primVtxMC->GetZ();
1680 if(!PhotonCandidate)
continue;
1685 Int_t isPosFromMBHeader
1688 Int_t isNegFromMBHeader
1691 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1712 GoodGammasStepOne->Add(PhotonCandidate);
1715 GoodGammasStepTwo->Add(PhotonCandidate);
1721 for(
Int_t i = 0;i<GoodGammasStepOne->GetEntries();i++){
1723 if(!PhotonCandidate)
continue;
1726 Int_t isPosFromMBHeader
1728 Int_t isNegFromMBHeader
1730 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1743 else GoodGammasStepTwo->Add(PhotonCandidate);
1747 for(
Int_t i = 0;i<GoodGammasStepTwo->GetEntries();i++){
1749 if(!PhotonCandidate)
continue;
1752 Int_t isPosFromMBHeader
1754 Int_t isNegFromMBHeader
1756 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1773 delete GoodGammasStepOne;
1774 GoodGammasStepOne = 0x0;
1775 delete GoodGammasStepTwo;
1776 GoodGammasStepTwo = 0x0;
1786 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
1787 Double_t mcProdVtxX = primVtxMC->GetX();
1788 Double_t mcProdVtxY = primVtxMC->GetY();
1789 Double_t mcProdVtxZ = primVtxMC->GetZ();
1792 if(posDaughter == NULL || negDaughter == NULL)
return;
1793 if(posDaughter->GetMother(0) != negDaughter->GetMother(0)){
1797 else if (posDaughter->GetMother(0) == -1){
1801 if(TMath::Abs(posDaughter->GetPdgCode())!=11 || TMath::Abs(negDaughter->GetPdgCode())!=11)
return;
1802 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode())
return;
1803 if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5)
return;
1806 if(Photon->GetPdgCode() != 22)
return;
1814 if( gammaIsPrimary ){
1828 for(
Int_t firstGammaIndex=0;firstGammaIndex<
fGoodConvGammas->GetEntries()-1;firstGammaIndex++){
1830 if (gamma0==NULL)
continue;
1831 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fGoodConvGammas->GetEntries();secondGammaIndex++){
1834 if (gamma1==NULL)
continue;
1841 pi0cand->
SetLabels(firstGammaIndex,secondGammaIndex);
1850 if(fInputEvent->IsA()==AliESDEvent::Class())
1852 if(fInputEvent->IsA()==AliAODEvent::Class())
1898 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1902 if (gamma0==NULL)
continue;
1905 if (firstGammaIndex == secondGammaIndex)
continue;
1907 if (gamma1==NULL)
continue;
1910 pi0cand->
SetLabels(firstGammaIndex,secondGammaIndex);
1959 Bool_t isTruePi0 = kFALSE;
1961 Int_t gamma0MotherLabel = -1;
1962 Int_t motherRealLabel = -1;
1964 if(gamma0MCLabel != -1){
1965 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
1969 gamma0MotherLabel=gammaMC0->GetMother(0);
1970 motherRealLabel=gammaMC0->GetFirstMother();
1972 if (TrueGammaCandidate0->
IsConversion() && gammaMC0->GetMother(0)>-1){
1973 gamma0MotherLabel=
fMCEvent->Particle(gammaMC0->GetMother(0))->GetMother(0);
1974 motherRealLabel=
fMCEvent->Particle(gammaMC0->GetMother(0))->GetMother(0);
1976 gamma0MotherLabel=gammaMC0->GetMother(0);
1977 motherRealLabel=gammaMC0->GetMother(0);
1983 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
1986 Int_t gamma1MotherLabel = -1;
1988 if(gamma1MCLabel != -1){
1990 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
1994 gamma1MotherLabel=gammaMC1->GetMother(0);
1996 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
1997 else gamma1MotherLabel=gammaMC1->GetMother(0);
2002 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
2003 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2030 if(TrueGammaCandidate0->
GetV0Index()<fInputEvent->GetNumberOfV0s()){
2031 Bool_t isTruePi0 = kFALSE;
2032 Bool_t isTruePi0Dalitz = kFALSE;
2033 Bool_t gamma0DalitzCand = kFALSE;
2034 Bool_t gamma1DalitzCand = kFALSE;
2036 Int_t gamma0MotherLabel = -1;
2037 Int_t motherRealLabel = -1;
2038 if(gamma0MCLabel != -1){
2042 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2043 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
2044 if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
2045 if(gammaMC0->GetPdgCode() == 22){
2046 gamma0MotherLabel=gammaMC0->GetFirstMother();
2047 motherRealLabel=gammaMC0->GetFirstMother();
2050 if(gammaMC0->GetPdgCode() ==111){
2051 gamma0DalitzCand = kTRUE;
2052 gamma0MotherLabel=-111;
2053 motherRealLabel=gamma0MCLabel;
2057 if(TrueGammaCandidate1->
GetV0Index()<fInputEvent->GetNumberOfV0s()){
2059 Int_t gamma1MotherLabel = -1;
2060 if(gamma1MCLabel != -1){
2064 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2065 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
2066 if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
2067 if(gammaMC1->GetPdgCode() == 22){
2068 gamma1MotherLabel=gammaMC1->GetFirstMother();
2071 if(gammaMC1->GetPdgCode() ==111 ){
2072 gamma1DalitzCand = kTRUE;
2073 gamma1MotherLabel=-111;
2077 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
2078 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2085 if (gamma1DalitzCand || gamma0DalitzCand){
2086 if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){
2087 if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE;
2089 if (gamma1DalitzCand && gamma1MCLabel >=0 && gamma1MCLabel==gamma0MotherLabel){
2090 if (gamma1MotherLabel == -111) isTruePi0Dalitz = kTRUE;
2095 if(isTruePi0 || isTruePi0Dalitz){
2117 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
2118 Bool_t isTruePi0 = kFALSE;
2119 Bool_t isTruePi0Dalitz = kFALSE;
2120 Bool_t gamma0DalitzCand = kFALSE;
2121 Bool_t gamma1DalitzCand = kFALSE;
2122 Int_t motherRealLabel = -1;
2124 if (AODMCTrackArray!=NULL && TrueGammaCandidate0 != NULL){
2125 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
2126 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
2128 Int_t gamma0MCLabel = -1;
2129 Int_t gamma0MotherLabel = -1;
2130 if(!positiveMC||!negativeMC)
2133 if(positiveMC->GetMother()>-1&&(negativeMC->GetMother() == positiveMC->GetMother())){
2134 gamma0MCLabel = positiveMC->GetMother();
2137 if(gamma0MCLabel != -1){
2139 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
2140 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
2141 if(((positiveMC->GetMCProcessCode())) == 5 && ((negativeMC->GetMCProcessCode())) == 5){
2142 if(gammaMC0->GetPdgCode() == 22){
2143 gamma0MotherLabel=gammaMC0->GetMother();
2144 motherRealLabel=gammaMC0->GetMother();
2147 if(gammaMC0->GetPdgCode() ==111){
2148 gamma0DalitzCand = kTRUE;
2149 gamma0MotherLabel=-111;
2150 motherRealLabel=gamma0MCLabel;
2154 positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelPositive()));
2155 negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelNegative()));
2157 Int_t gamma1MCLabel = -1;
2158 Int_t gamma1MotherLabel = -1;
2159 if(!positiveMC||!negativeMC)
2162 if(positiveMC->GetMother()>-1&&(negativeMC->GetMother() == positiveMC->GetMother())){
2163 gamma1MCLabel = positiveMC->GetMother();
2165 if(gamma1MCLabel != -1){
2167 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
2168 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
2169 if(((positiveMC->GetMCProcessCode())) == 5 && ((negativeMC->GetMCProcessCode())) == 5){
2170 if(gammaMC1->GetPdgCode() == 22){
2171 gamma1MotherLabel=gammaMC1->GetMother();
2174 if(gammaMC1->GetPdgCode() ==111 ){
2175 gamma1DalitzCand = kTRUE;
2176 gamma1MotherLabel=-111;
2180 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
2181 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
2188 if (gamma1DalitzCand || gamma0DalitzCand){
2189 if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){
2190 if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE;
2192 if (gamma1DalitzCand && gamma1MCLabel >=0 && gamma1MCLabel==gamma0MotherLabel){
2193 if (gamma1MotherLabel == -111) isTruePi0Dalitz = kTRUE;
2197 if(isTruePi0 || isTruePi0Dalitz){
2222 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
2226 if (gamma0==NULL)
continue;
2231 if (gamma1==NULL)
continue;
2234 AliVCluster* cluster = fInputEvent->GetCaloCluster(gamma1->
GetCaloClusterRef());
2239 pi0cand->
SetLabels(firstGammaIndex,secondGammaIndex);
2292 if(TrueGammaCandidate0->
GetV0Index()<fInputEvent->GetNumberOfV0s()){
2293 Bool_t isTruePi0 = kFALSE;
2294 Bool_t isTruePi0Dalitz = kFALSE;
2295 Bool_t gamma0DalitzCand = kFALSE;
2298 Int_t gamma0MotherLabel = -1;
2299 Int_t motherRealLabel = -1;
2300 if(gamma0MCLabel != -1){
2304 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2305 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
2306 if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
2307 if(gammaMC0->GetPdgCode() == 22){
2308 gamma0MotherLabel=gammaMC0->GetFirstMother();
2309 motherRealLabel=gammaMC0->GetFirstMother();
2312 if(gammaMC0->GetPdgCode() ==111){
2313 gamma0DalitzCand = kTRUE;
2314 gamma0MotherLabel=-111;
2315 motherRealLabel=gamma0MCLabel;
2321 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2324 Int_t gamma1MotherLabel = -1;
2327 if(gamma1MCLabel != -1){
2329 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2333 gamma1MotherLabel=gammaMC1->GetMother(0);
2335 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2336 else gamma1MotherLabel=gammaMC1->GetMother(0);
2341 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
2342 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2348 if (gamma0DalitzCand ){
2349 if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){
2350 if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE;
2354 if(isTruePi0 || isTruePi0Dalitz ){
2375 Double_t magField = fInputEvent->GetMagneticField();
2376 if( magField < 0.0 ){
2382 vector<Int_t> lGoodNegPionIndexPrev(0);
2383 vector<Int_t> lGoodPosPionIndexPrev(0);
2390 TLorentzVector *negPionforHandler =
new TLorentzVector();
2391 negPionforHandler->SetPxPyPzE(negPionCandidate->Px(), negPionCandidate->Py(), negPionCandidate->Pz(), negPionCandidate->E());
2394 delete negPionforHandler;
2403 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2404 Double_t mcProdVtxX = primVtxMC->GetX();
2405 Double_t mcProdVtxY = primVtxMC->GetY();
2406 Double_t mcProdVtxZ = primVtxMC->GetZ();
2408 Int_t labelNegPion = TMath::Abs( negPionCandidate->GetLabel() );
2410 if( labelNegPion>-1 && labelNegPion < fMCEvent->GetNumberOfTracks() ){
2411 TParticle* negPion =
fMCEvent->Particle(labelNegPion);
2412 if( negPion->GetPdgCode() == -211 ){
2415 if( negPionIsPrimary ){
2419 if( negPionIsPrimary ) {
2434 TLorentzVector *posPionforHandler =
new TLorentzVector();
2435 posPionforHandler->SetPxPyPzE(posPionCandidate->Px(), posPionCandidate->Py(), posPionCandidate->Pz(), posPionCandidate->E());
2438 delete posPionforHandler;
2446 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2447 Double_t mcProdVtxX = primVtxMC->GetX();
2448 Double_t mcProdVtxY = primVtxMC->GetY();
2449 Double_t mcProdVtxZ = primVtxMC->GetZ();
2451 Int_t labelPosPion = TMath::Abs( posPionCandidate->GetLabel() );
2453 if( labelPosPion>-1 && labelPosPion < fMCEvent->GetNumberOfTracks() ) {
2454 TParticle* posPion =
fMCEvent->Particle(labelPosPion);
2455 if( posPion->GetPdgCode() == 211 ){
2457 if( posPionIsPrimary ){
2461 if(posPionIsPrimary){
2472 for(
UInt_t i = 0; i < lGoodNegPionIndexPrev.size(); i++){
2473 AliESDtrack *negPionCandidate =
fESDEvent->GetTrack(lGoodNegPionIndexPrev[i]);
2474 AliKFParticle negPionCandidateKF( *negPionCandidate->GetConstrainedParam(), 211 );
2476 for(
UInt_t j = 0; j < lGoodPosPionIndexPrev.size(); j++){
2477 AliESDtrack *posPionCandidate =
fESDEvent->GetTrack(lGoodPosPionIndexPrev[j]);
2478 AliKFParticle posPionCandidateKF( *posPionCandidate->GetConstrainedParam(), 211 );
2482 AliKFVertex primaryVertexImproved(*fInputEvent->GetPrimaryVertex());
2484 virtualPhoton->SetProductionVertex(primaryVertexImproved);
2485 virtualPhoton->SetTrackLabels( lGoodPosPionIndexPrev[j], lGoodNegPionIndexPrev[i]);
2489 Int_t motherlabelp = 0;
2490 Int_t motherlabeln = 0;
2491 TParticle *fNegativeMCParticle =NULL;
2492 TParticle *fPositiveMCParticle =NULL;
2494 labeln=TMath::Abs(negPionCandidate->GetLabel());
2495 labelp=TMath::Abs(posPionCandidate->GetLabel());
2496 if(labeln>-1) fNegativeMCParticle =
fMCEvent->Particle(labeln);
2497 if(labelp>-1) fPositiveMCParticle =
fMCEvent->Particle(labelp);
2499 if (fNegativeMCParticle == NULL || fPositiveMCParticle == NULL)
return;
2501 motherlabeln = fNegativeMCParticle->GetMother(0);
2502 motherlabelp = fPositiveMCParticle->GetMother(0);
2503 virtualPhoton->SetMCLabelPositive(labelp);
2504 virtualPhoton->SetMCLabelNegative(labeln);
2511 if (fPositiveMCParticle && fNegativeMCParticle ) {
2514 if(TMath::Abs(fNegativeMCParticle->GetPdgCode())==211 && TMath::Abs(fPositiveMCParticle->GetPdgCode())==211){
2516 if (motherlabeln == motherlabelp){
2528 if(TMath::Abs(fNegativeMCParticle->GetPdgCode())==211 && TMath::Abs(fPositiveMCParticle->GetPdgCode())==211){
2530 if (motherlabeln == motherlabelp){
2565 Float_t dcaToVertexXYPos = -1.0;
2566 Float_t dcaToVertexZPos = -1.0;
2567 Float_t dcaToVertexXYNeg = -1.0;
2568 Float_t dcaToVertexZNeg = -1.0;
2576 posPionCandidate->GetImpactParameters(bPos,bCovPos);
2577 if (bCovPos[0]<=0 || bCovPos[2]<=0) {
2578 AliDebug(1,
"Estimated b resolution lower or equal zero!");
2579 bCovPos[0]=0; bCovPos[2]=0;
2584 posPionCandidate->GetImpactParameters(bNeg,bCovNeg);
2585 if (bCovNeg[0]<=0 || bCovNeg[2]<=0) {
2586 AliDebug(1,
"Estimated b resolution lower or equal zero!");
2587 bCovNeg[0]=0; bCovNeg[2]=0;
2590 dcaToVertexXYPos = bPos[0];
2591 dcaToVertexZPos = bPos[1];
2592 dcaToVertexXYNeg = bNeg[0];
2593 dcaToVertexZNeg = bNeg[1];
2615 delete virtualPhoton;
2625 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2626 Double_t mcProdVtxX = primVtxMC->GetX();
2627 Double_t mcProdVtxY = primVtxMC->GetY();
2628 Double_t mcProdVtxZ = primVtxMC->GetZ();
2633 TParticle* particle = (TParticle *)
fMCEvent->Particle(i);
2634 if (!particle)
continue;
2636 Int_t isMCFromMBHeader = -1;
2649 if(particle->GetMother(0) >-1){
2650 if (
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==111){
2651 if (
fMCEvent->Particle(particle->GetMother(0))->GetMother(0) > -1){
2652 if (
fMCEvent->Particle((
fMCEvent->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 221 ||
2653 fMCEvent->Particle((
fMCEvent->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 223 ){
2654 if (
fMCEvent->Particle(particle->GetMother(0))->GetNDaughters()==3 )
2664 if(particle->GetMother(0) >-1){
2665 if (
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==111){
2666 if (
fMCEvent->Particle(particle->GetMother(0))->GetMother(0) > -1){
2667 if (
fMCEvent->Particle((
fMCEvent->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 221 ||
2668 fMCEvent->Particle((
fMCEvent->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 223 ){
2669 if (
fMCEvent->Particle(particle->GetMother(0))->GetNDaughters()==3 )
2683 if( particle->GetPdgCode() == 211){
2685 if(particle->GetMother(0) >-1){
2686 if (
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==221 ||
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==223)
2690 if( particle->GetPdgCode() == -211){
2692 if(particle->GetMother(0) >-1){
2693 if (
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==221 ||
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==223 )
2702 Int_t labelNeutPion = -1;
2703 Int_t labelNegPion = -1;
2704 Int_t labelPosPion = -1;
2710 if (particle->Pt()>0.005){
2718 if(labelNeutPion>-1){
2719 TParticle *neutPion =
fMCEvent->Particle(labelNeutPion);
2720 if(neutPion->GetDaughter(0)>-1 && neutPion->GetDaughter(1)>-1){
2721 TParticle *gamma1 =
fMCEvent->Particle(neutPion->GetDaughter(0));
2722 TParticle *gamma2 =
fMCEvent->Particle(neutPion->GetDaughter(1));
2729 if( kDaughter0IsPrim && kDaughter1IsPrim && kNegPionIsPrim && kPosPionIsPrim &&
2739 if( kDaughter0IsPrim && kDaughter1IsPrim && kNegPionIsPrim && kPosPionIsPrim &&
2764 if (neutralPion==NULL)
continue;
2769 if (vParticle==NULL)
continue;
2773 mesoncand->
SetLabels(mesonIndex,virtualParticleIndex);
2777 if(negPionCandidatetmp==NULL){
delete mesoncand;
continue;}
2779 NegPiontmp->SetPxPyPzE(negPionCandidatetmp->Px(), negPionCandidatetmp->Py(), negPionCandidatetmp->Pz(), negPionCandidatetmp->E());
2782 if(posPionCandidatetmp==NULL){
delete NegPiontmp;
delete mesoncand;
continue;}
2784 PosPiontmp->SetPxPyPzE(posPionCandidatetmp->Px(), posPionCandidatetmp->Py(), posPionCandidatetmp->Pz(), posPionCandidatetmp->E());
2786 if(
KinematicCut(NegPiontmp, PosPiontmp, neutralPion, mesoncand)){
2795 fHistoAngleSum[
fiCut]->Fill(mesoncand->Pt(),((PosPiontmp->Angle(mesoncand->Vect()))+(NegPiontmp->Angle(PosPiontmp->Vect()))+(PosPiontmp->Angle(neutralPion->Vect()))));
2806 Pi0tmp->SetPxPyPzE(neutralPion->Px(), neutralPion->Py(), neutralPion->Pz(), neutralPion->Energy());
2859 Int_t NPi0Candidates = 0;
2866 for(
Int_t iCurrentPi0=0; iCurrentPi0<NPi0Candidates; iCurrentPi0++){
2886 if((EventPiMiMeson && EventPiPlMeson) == kFALSE)
continue;
2894 for(
UInt_t iCurrentPiPl = 0; iCurrentPiPl<EventPiPlMeson->size();iCurrentPiPl++){
2905 for(
UInt_t iCurrentPiMi = 0; iCurrentPiMi<EventPiMiMeson->size();iCurrentPiMi++){
2917 delete backPiPlPiMiCandidate;
2918 backPiPlPiMiCandidate = 0x0;
2921 delete backPiPlPiMiCandidate;
2922 backPiPlPiMiCandidate = 0x0;
2932 if(
KinematicCut(&EventPiMiGoodMeson, &EventPiPlGoodMeson,EventPiZeroGoodMeson,PiPlPiMiPiZeroBackgroundCandidate)){
2935 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
2940 if (nEventsInBGMi != nEventsInBGPl){
2947 }
else if(nEventsInBGMi==nEventsInBGPl){
2955 delete PiMiPiZerotmp;
2956 delete PiPlPiMiPiZerotmp;
2958 delete PiPlPiMiPiZeroBackgroundCandidate;
2959 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
2962 if(PiPlPiMiPiZeroBackgroundCandidate!=0x0){
2963 delete PiPlPiMiPiZeroBackgroundCandidate;
2964 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
2967 if(PiPlPiZeroBackgroundCandidate!=0x0){
2968 delete PiPlPiZeroBackgroundCandidate;
2969 PiPlPiZeroBackgroundCandidate = 0x0;
2985 for(
UInt_t iCurrentPiPl = 0; iCurrentPiPl<EventPiPlMeson->size();iCurrentPiPl++){
3002 delete backPiPlPiMiCandidate;
3003 backPiPlPiMiCandidate = 0x0;
3006 delete backPiPlPiMiCandidate;
3007 backPiPlPiMiCandidate = 0x0;
3017 if(
KinematicCut(&EventPiNegGoodMeson, &EventPiPlGoodMeson, EventPiZeroGoodMeson,PiPlPiMiPiZeroBackgroundCandidate)){
3021 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
3032 delete PiMiPiZerotmp;
3033 delete PiPlPiMiPiZerotmp;
3035 delete PiPlPiMiPiZeroBackgroundCandidate;
3036 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
3039 if(PiPlPiMiPiZeroBackgroundCandidate!=0x0){
3040 delete PiPlPiMiPiZeroBackgroundCandidate;
3041 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
3044 if(PiPlPiZeroBackgroundCandidate!=0x0){
3045 delete PiPlPiZeroBackgroundCandidate;
3046 PiPlPiZeroBackgroundCandidate = 0x0;
3062 for(
UInt_t iCurrentPiMi = 0; iCurrentPiMi<EventPiMiMeson->size();iCurrentPiMi++){
3082 delete backPiPlPiMiCandidate;
3083 backPiPlPiMiCandidate = 0x0;
3086 delete backPiPlPiMiCandidate;
3087 backPiPlPiMiCandidate = 0x0;
3097 if(
KinematicCut(&EventPiMiGoodMeson, &EventPiPlGoodMeson, EventPiZeroGoodMeson,PiPlPiMiPiZeroBackgroundCandidate)){
3101 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
3112 delete PiMiPiZerotmp;
3113 delete PiPlPiMiPiZerotmp;
3115 delete PiPlPiMiPiZeroBackgroundCandidate;
3116 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
3119 if(PiPlPiMiPiZeroBackgroundCandidate!=0x0){
3120 delete PiPlPiMiPiZeroBackgroundCandidate;
3121 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
3124 if(PiMiPiZeroBackgroundCandidate!=0x0){
3125 delete PiMiPiZeroBackgroundCandidate;
3126 PiMiPiZeroBackgroundCandidate = 0x0;
3141 if(iCurrentPiPl!=iCurrentPiPl2){
3151 delete backPiPlPiPlCandidate;
3152 backPiPlPiPlCandidate = 0x0;
3155 delete backPiPlPiPlCandidate;
3156 backPiPlPiPlCandidate = 0x0;
3166 if(
KinematicCut(&EventPiPlGoodMeson, &EventPiPlGoodMeson2, EventPiZeroGoodMeson,PiPlPiPlPiZeroBackgroundCandidate)){
3170 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
3181 delete PiPlPiZerotmp;
3182 delete PiPlPiPlPiZerotmp;
3184 delete PiPlPiPlPiZeroBackgroundCandidate;
3185 PiPlPiPlPiZeroBackgroundCandidate = 0x0;
3201 if(iCurrentPiMi!=iCurrentPiMi2){
3211 delete backPiMiPiMiCandidate;
3212 backPiMiPiMiCandidate = 0x0;
3215 delete backPiMiPiMiCandidate;
3216 backPiMiPiMiCandidate = 0x0;
3226 if(
KinematicCut(&EventPiMiGoodMeson, &EventPiMiGoodMeson2, EventPiZeroGoodMeson,PiMiPiMiPiZeroBackgroundCandidate)){
3230 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
3241 delete PiMiPiZerotmp;
3242 delete PiMiPiMiPiZerotmp;
3244 delete PiMiPiMiPiZeroBackgroundCandidate;
3245 PiMiPiMiPiZeroBackgroundCandidate = 0x0;
3261 if((omega->Pt())<=5.){
3262 if( (omega->Angle(pospion->Vect())) < ((2.78715*(TMath::Exp(-0.589934*(omega->Pt()))+0.0519574))*
fTolerance) &&
3263 (omega->Angle(negpion->Vect())) < ((5.94216*(TMath::Exp(-0.444428*(omega->Pt()))-0.0574076))*
fTolerance) &&
3264 (omega->Angle(neutpion->Vect())) < ((2.79529*(TMath::Exp(-0.565999*(omega->Pt()))+0.0413576))*
fTolerance) &&
3265 (pospion->Angle(negpion->Vect())) < ((3.14446*(TMath::Exp(-0.666433*(omega->Pt()))+0.0964309))*
fTolerance) &&
3266 (pospion->Angle(neutpion->Vect())) < ((3.08241*(TMath::Exp(-0.650657*(omega->Pt()))+0.0997539))*
fTolerance) &&
3267 (negpion->Angle(neutpion->Vect())) < ((3.18536*(TMath::Exp(-0.752847*(omega->Pt()))+0.1262780))*
fTolerance)
3272 if( (omega->Angle(pospion->Vect())) < ((0.459270*(TMath::Exp(-0.126007*(omega->Pt()))+0.100475))*
fTolerance) &&
3273 (omega->Angle(negpion->Vect())) < ((0.521250*(TMath::Exp(-0.152532*(omega->Pt()))+0.114617))*
fTolerance) &&
3274 (omega->Angle(neutpion->Vect())) < ((0.409766*(TMath::Exp(-0.108566*(omega->Pt()))+0.103594))*
fTolerance) &&
3275 (pospion->Angle(negpion->Vect())) < ((0.709206*(TMath::Exp(-0.149072*(omega->Pt()))+0.111345))*
fTolerance) &&
3276 (pospion->Angle(neutpion->Vect())) < ((0.662184*(TMath::Exp(-0.123397*(omega->Pt()))+0.104675))*
fTolerance) &&
3277 (negpion->Angle(neutpion->Vect())) < ((0.730228*(TMath::Exp(-0.120859*(omega->Pt()))+0.105522))*
fTolerance)
3292 Bool_t isSameMotherPiPlPiMiPiZero = kFALSE;
3293 Bool_t isSameMotherPiPlPiMi = kFALSE;
3294 Bool_t isSameMotherPiPlPiZero = kFALSE;
3295 Bool_t isSameMotherPiMiPiZero = kFALSE;
3296 Bool_t isNoSameMother = kFALSE;
3297 Bool_t isNoPiPiPi = kFALSE;
3301 Int_t virtualParticleMotherLabel = -1;
3307 if ( !(trueMesonFlag == 1 && pi0MCLabel != -1)){
3313 Int_t pi0MotherLabel =
fMCEvent->Particle(pi0MCLabel)->GetMother(0);
3318 Int_t posMotherLabelMC = positiveMC->GetMother(0);
3319 Int_t negMotherLabelMC = negativeMC->GetMother(0);
3322 if((TMath::Abs(negativeMC->GetPdgCode())==211) && (TMath::Abs(positiveMC->GetPdgCode())==211) && (
fMCEvent->Particle(pi0MCLabel)->GetPdgCode()==111)){
3324 if(virtualParticleMCLabel!=-1){
3326 virtualParticleMotherLabel = virtualParticleMCLabel;
3327 if(virtualParticleMotherLabel==pi0MotherLabel){
3329 if(
fMCEvent->Particle(pi0MotherLabel)->GetStatusCode()!=21) isSameMotherPiPlPiMiPiZero = kTRUE;
3332 if(
fMCEvent->Particle(virtualParticleMotherLabel)->GetStatusCode()!=21) isSameMotherPiPlPiMi = kTRUE;
3335 if(pi0MotherLabel==negMotherLabelMC && negMotherLabelMC != -1){
3337 if(
fMCEvent->Particle(negMotherLabelMC)->GetStatusCode()!=21) isSameMotherPiMiPiZero = kTRUE;
3338 }
else if(pi0MotherLabel==posMotherLabelMC && posMotherLabelMC != -1){
3340 if(
fMCEvent->Particle(posMotherLabelMC)->GetStatusCode()!=21) isSameMotherPiPlPiZero = kTRUE;
3343 isNoSameMother = kTRUE;
3352 if(isSameMotherPiPlPiMiPiZero){
3353 if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 221){
3358 PosPiontmp->SetPxPyPzE(positiveMC->Px(), positiveMC->Py(), positiveMC->Pz(), positiveMC->Energy());
3360 NegPiontmp->SetPxPyPzE(negativeMC->Px(), negativeMC->Py(), negativeMC->Pz(), negativeMC->Energy());
3361 if(!
fDoLightOutput)
fHistoTrueAngleSum[
fiCut]->Fill(mesoncand->Pt(),((PosPiontmp->Angle(mesoncand->Vect()))+(NegPiontmp->Angle(PosPiontmp->Vect()))+(PosPiontmp->Angle(TrueNeutralPionCandidate->Vect()))));
3363 delete PosPiontmp; PosPiontmp = 0x0;
3364 delete NegPiontmp; NegPiontmp = 0x0;
3371 fPtEta = mesoncand->Pt();
3376 }
else if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 223){
3382 PosPiontmp->SetPxPyPzE(positiveMC->Px(), positiveMC->Py(), positiveMC->Pz(), positiveMC->Energy());
3384 NegPiontmp->SetPxPyPzE(negativeMC->Px(), negativeMC->Py(), negativeMC->Pz(), negativeMC->Energy());
3385 if(!
fDoLightOutput)
fHistoTrueAngleSum[
fiCut]->Fill(mesoncand->Pt(),((PosPiontmp->Angle(mesoncand->Vect()))+(NegPiontmp->Angle(PosPiontmp->Vect()))+(PosPiontmp->Angle(TrueNeutralPionCandidate->Vect()))));
3409 if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 221){
3412 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 223){
3415 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 113){
3418 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 331){
3421 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 310){
3424 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 130){
3440 if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 221){
3443 }
else if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 223){
3446 }
else if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() ==-213){
3449 }
else if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 130){
3465 if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 221){
3468 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 223){
3471 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 213) {
3474 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 130) {
3537 Double_t dx = vertex->
fX - fInputEvent->GetPrimaryVertex()->GetX();
3538 Double_t dy = vertex->
fY - fInputEvent->GetPrimaryVertex()->GetY();
3539 Double_t dz = vertex->
fZ - fInputEvent->GetPrimaryVertex()->GetZ();
3550 Int_t signPz = particle->Pz()<0?-1:1;
3552 Double_t pz = signPz*TMath::Sqrt(TMath::Abs(pow(
fPDGMassPi0,2)-pow(energy,2)+pow(px,2)+pow(py,2)));
3553 particle->SetPxPyPzE(px,py,pz,energy);
3563 if(label<0)
return kFALSE;
3564 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
3565 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
3567 TParticle* mother =
fMCEvent->Particle( motherLabel );
3569 if( mother->GetPdgCode() != 221 )
return kFALSE;
3580 if(label<0)
return kFALSE;
3581 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
3582 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
3584 TParticle* mother =
fMCEvent->Particle( motherLabel );
3586 if( mother->GetPdgCode() != 223 )
return kFALSE;
3597 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
3599 if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223) )
return kFALSE;
3602 TParticle *posPion = 0x0;
3603 TParticle *negPion = 0x0;
3604 TParticle *neutPion = 0x0;
3606 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
3607 if(index<0)
continue;
3608 TParticle* temp = (TParticle*)
fMCEvent->Particle( index );
3610 switch( temp->GetPdgCode() ) {
3622 if( posPion && negPion && neutPion)
return kTRUE;
3632 if(label<0)
return kFALSE;
3633 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
3634 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
3636 TParticle* mother =
fMCEvent->Particle( motherLabel );
3638 if( mother->GetPdgCode() != 111 )
return kFALSE;
3640 Int_t grandMotherLabel = mother->GetMother(0);
3641 if( grandMotherLabel < 0 || grandMotherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
3642 TParticle* grandmother =
fMCEvent->Particle( grandMotherLabel );
3651 if(tobechecked > -1)
3653 vector<Int_t>::iterator it;
3654 it = find (vec.begin(), vec.end(), tobechecked);
3655 if (it != vec.end())
return true;
3657 vec.push_back(tobechecked);
TParticle * GetMCParticle(AliMCEvent *mcEvent)
Float_t fSamePiPiMotherID
Float_t fSamePiPiPiMotherID
TH2F ** fHistoTruePiPlPiMiPiZeroContaminationInvMassPt
TH1F ** fHistoTrueNegPionFromNeutralMesonPt
Int_t GetMCLabelPositive() const
void CalculateMesonCandidates()
vector< Int_t > GetReconstructedPosPionIndex()
void ProcessTrueNeutralPionCandidatesPureCalo(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
Bool_t IsPiPlPiMiPiZeroDecay(TParticle *fMCMother) const
Float_t fSamePiPiMotherInvMass
void SetCaloClusterRef(Long_t ref)
void SetLabels(Int_t label1, Int_t label2, Int_t label3=0)
TList * fNeutralPionMesonCutArray
vector< Int_t > fVectorDoubleCountTruePi0s
array of histos with double counted photons, R, pT
GammaConversionVertex * GetBGEventVertex(Int_t zbin, Int_t mbin, Int_t event)
vector< Int_t > fSelectorNegPionIndex
TH2F ** fHistoTruePiPlPiZeroSameMotherFromEtaInvMassPt
TH2F ** fHistoTruePiPlPiMiSameMotherFromEtaInvMassPt
Float_t fV0MultiplicityEtaEvent
void SetCaloPhotonMCFlags(AliMCEvent *mcEvent, Bool_t enableSort)
TH1F ** fHistoMCGammaFromNeutralMesonPt
TList * fNeutralPionCandidates
good calo gammas after selection
TH2F ** fHistoTrueMotherPiPlPiMiPiZeroInvMassPt
vector< Int_t > fVectorDoubleCountTrueOmegas
vector containing labels of validated eta
TH1F ** fHistoMCPosPionsFromNeutralMesonPt
TH2F ** fHistoTrueMotherEtaPiPlPiMiPiZeroInvMassPt
TH2F ** fHistoGammaGammaInvMassPt
TH2F ** fHistoTrueMotherGammaGammaInvMassPt
TH2F ** fHistoTruePionPionFromSameMotherInvMassPt
TH2F ** fHistoTrueMotherGammaGammaFromEtaInvMassPt
TH2F ** fHistoBackInvMassPtGroup3
TH2F ** fHistoTrueAngleSum
TH2F ** fHistoAnglePiZeroPiMi
Int_t GetNumberOfPrimaryTracks()
virtual void UserExec(Option_t *)
TH1F ** fHistoTrueConvGammaPt
Float_t fSamePiPiMotherPt
TH1F ** fHistoConvGammaEta
TH2F ** fHistoTrueMotherOmegaPiPlPiMiPiZeroInvMassPt
TH2F ** fHistoTruePiMiPiZeroSameMotherFromRhoInvMassPt
TH2F ** fHistoTruePiPlPiMiPiZeroPureCombinatoricalInvMassPt
TH1I ** fHistoNGoodESDTracks
void AddMesonEvent(TList *const eventMothers, Double_t xvalue, Double_t yvalue, Double_t zvalue, Int_t multiplicity, Double_t epvalue=-100)
TH2F ** fHistoBackInvMassPtGroup4SubPi0
TH1F ** fHistoTruePosPionPt
vector< Int_t > fVectorDoubleCountTrueEtas
vector containing labels of validated pi0
void SetProductionPoint(Double_t *point)
void SetTrueMesonValue(Int_t trueMeson)
TH2F ** fHistoTruePiPlPiZeroSameMotherFromK0lInvMassPt
TH2F ** fHistoBackInvMassPtGroup1SubPi0
void ProcessTrueMesonCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionMother *TrueNeutralPionCandidate, AliAODConversionPhoton *TrueVirtualGammaCandidate)
TParticle * GetPositiveMCDaughter(AliMCEvent *mcEvent)
Bool_t IsOmegaPiPlPiMiPiZeroDaughter(Int_t label) const
TH2F ** fHistoBackInvMassPtGroup2
void SetCaloPhotonMCLabel(Int_t i, Int_t labelCaloPhoton)
TH1F ** fHistoTruePosPionFromNeutralMesonPt
TH2F ** fHistoMotherInvMassPtRejectedKinematic
TH1F ** fHistoConvGammaPt
TList * fNeutralPionSidebandCandidates
TH2F ** fHistoBackInvMassPtGroup4FixedPzPi0
virtual void Terminate(const Option_t *)
TTree ** fTreePiPiPiSameMother
TH1F ** fHistoMCNegPionsFromNeutralMesonPt
TH1F ** fHistoMCAllGammaPt
Int_t GetTrueMesonValue() const
virtual void UserCreateOutputObjects()
Int_t fTrackMatcherRunningMode
Float_t fSamePiPiPiMotherPt
TList * fClusterCandidates
TParticle * GetNegativeMCDaughter(AliMCEvent *mcEvent)
Float_t fTrackMultiplicityOmegaEvent
TH2F ** fHistoAngleOmegaPiPlPiMi
Float_t fTrackMultiplicityEtaEvent
TH1F ** fHistoClusterGammaPt
TTree ** fTreePiPiSameMother
TH2F ** fHistoTruePionPionFromEtaInvMassPt
Class handling all kinds of selection cuts for Gamma Calo analysis.
TH2F ** fHistoTruePiPlPiMiSameMotherFromEtaPrimeInvMassPt
TH2F ** fHistoAngleOmegaPiPl
void ProcessTrueCaloPhotonCandidates(AliAODConversionPhoton *TruePhotonCandidate)
TH2F ** fHistoBackInvMassPtGroup4
TH2F ** fHistoBackInvMassPtGroup2SubPi0
void FixPzToMatchPDGInvMassPi0(AliAODConversionMother *particle)
Int_t GetTrackLabelNegative() const
std::vector< AliAODConversionMother * > AliGammaConversionMotherAODVector
TH1F ** fHistoMCAllNegPionsPt
TH2F ** fHistoBackInvMassPtGroup3FixedPzPi0
TH2F ** fHistoTruePiPlPiMiSameMotherFromK0sInvMassPt
void UpdateEventByEventData()
TH1I ** fHistoNEvents
vector containing labels of validated photons
TH2F ** fHistoPionPionInvMassPt
Int_t GetTrackLabelPositive() const
void ProcessCaloPhotonCandidates()
AliConversionPhotonCuts * GetConversionCuts()
TH2F ** fHistoTruePionPionFromOmegaInvMassPt
TH2F ** fHistoTruePiMiPiZeroSameMotherFromOmegaInvMassPt
Int_t GetTrackLabel(Int_t i) const
TH1F ** fHistoMCAllPosPionsPt
TH1F ** fHistoMCOmegaPiPlPiMiPiZeroPt
TH2F ** fHistoTruePiPlPiMiSameMotherFromK0lInvMassPt
TH2F ** fHistoTruePiMiPiZeroSameMotherFromEtaInvMassPt
TH2F ** fHistoMotherLikeSignBackInvMassPt
TH2F ** fHistoAnglePiPlPiZero
TH2F ** fHistoMotherLikeSignBackInvMassFixedPzPi0Pt
Class handling all kinds of selection cuts for Gamma Conversion analysis.
TProfile ** fProfileEtaShift
void ProcessNeutralPionCandidatesPureCalo()
TList * fPosPionCandidates
TH2F ** fHistoPosPionClsTPC
TTree ** fTreeEventInfoOmega
virtual ~AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero()
TH2F ** fHistoBackInvMassPtGroup2FixedPzPi0
TH2F ** fHistoTruePiMiPiZeroSameMotherFromK0lInvMassPt
Int_t GetMCParticleLabel(AliMCEvent *mcEvent)
TH2F ** fHistoDoubleCountTrueConvGammaRPt
array of histos with double counted omegas, invMass, pT
TH2F ** fHistoPionTPCdEdxNSigma
Bool_t IsLargestComponentElectron()
TH2F ** fHistoTruePiPlPiZeroSameMotherFromOmegaInvMassPt
Bool_t GammaIsNeutralMesonPiPlPiMiPiZeroDaughter(Int_t label) const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t GetCaloPhotonMCLabel(Int_t i)
TH2F ** fHistoBackInvMassPtGroup3SubPi0
void ProcessConversionPhotonCandidates()
TH2F ** fHistoPionTPCdEdx
Float_t fV0MultiplicityOmegaEvent
TH2F ** fHistoMotherInvMassPt
TH1F ** fHistoMCConvGammaPt
void ProcessMCParticles()
Int_t GetMCLabelNegative() const
Float_t fZVertexOmegaEvent
void ProcessTrueNeutralPionCandidatesPureConversions(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
Int_t GetNBGEvents() const
Bool_t fMoveParticleAccordingToVertex
TH2F ** fHistoBackInvMassPtGroup1
Int_t GetNCaloPhotonMCLabels()
TH2F ** fHistoMotherInvMassFixedPzPi0
Int_t GetZBinIndex(Double_t z) const
TH2F ** fHistoTrueMotherGammaGammaFromOmegaInvMassPt
TH1F ** fHistoClusterGammaEta
TList * GetCaloTrackMatcherHistograms()
TH2F ** fHistoBackInvMassPtGroup1FixedPzPi0
Double_t GetProductionZ() const
Double_t GetProductionX() const
TH2F ** fHistoTruePionPionInvMassPt