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),
94 fSamePiPiMotherID(-1),
95 fSamePiPiMotherInvMass(-1),
96 fSamePiPiMotherPt(-1),
97 fSamePiPiPiMotherID(-1),
98 fSamePiPiPiMotherInvMass(-1),
99 fSamePiPiPiMotherPt(-1),
100 fHistoConvGammaPt(NULL),
101 fHistoConvGammaEta(NULL),
102 fHistoClusterGammaPt(NULL),
103 fHistoClusterGammaEta(NULL),
104 fHistoNegPionPt(NULL),
105 fHistoPosPionPt(NULL),
106 fHistoNegPionPhi(NULL),
107 fHistoPosPionPhi(NULL),
108 fHistoNegPionEta(NULL),
109 fHistoPosPionEta(NULL),
110 fHistoNegPionClsTPC(NULL),
111 fHistoPosPionClsTPC(NULL),
112 fHistoPionDCAxy(NULL),
113 fHistoPionDCAz(NULL),
114 fHistoPionTPCdEdxNSigma(NULL),
115 fHistoPionTPCdEdx(NULL),
116 fHistoPionPionInvMassPt(NULL),
117 fHistoGammaGammaInvMassPt(NULL),
118 fHistoMotherInvMassPt(NULL),
119 fHistoMotherInvMassPtRejectedKinematic(NULL),
120 fHistoBackInvMassPtGroup1(NULL),
121 fHistoBackInvMassPtGroup2(NULL),
122 fHistoBackInvMassPtGroup3(NULL),
123 fHistoBackInvMassPtGroup4(NULL),
124 fHistoMotherLikeSignBackInvMassPt(NULL),
125 fHistoAngleOmegaPiPlPiMi(NULL),
126 fHistoAngleOmegaPiZero(NULL),
127 fHistoAngleOmegaPiPl(NULL),
128 fHistoAngleOmegaPiMi(NULL),
129 fHistoAnglePiPlPiMi(NULL),
130 fHistoAnglePiZeroPiMi(NULL),
131 fHistoAnglePiPlPiZero(NULL),
132 fHistoAngleSum(NULL),
133 fHistoTrueAngleSum(NULL),
134 fHistoMotherInvMassSubPi0(NULL),
135 fHistoBackInvMassPtGroup1SubPi0(NULL),
136 fHistoBackInvMassPtGroup2SubPi0(NULL),
137 fHistoBackInvMassPtGroup3SubPi0(NULL),
138 fHistoBackInvMassPtGroup4SubPi0(NULL),
139 fHistoMotherLikeSignBackInvMassSubPi0Pt(NULL),
140 fHistoMotherInvMassFixedPzPi0(NULL),
141 fHistoBackInvMassPtGroup1FixedPzPi0(NULL),
142 fHistoBackInvMassPtGroup2FixedPzPi0(NULL),
143 fHistoBackInvMassPtGroup3FixedPzPi0(NULL),
144 fHistoBackInvMassPtGroup4FixedPzPi0(NULL),
145 fHistoMotherLikeSignBackInvMassFixedPzPi0Pt(NULL),
146 fHistoMCAllGammaPt(NULL),
147 fHistoMCConvGammaPt(NULL),
148 fHistoMCAllPosPionsPt(NULL),
149 fHistoMCAllNegPionsPt(NULL),
150 fHistoMCGammaFromNeutralMesonPt(NULL),
151 fHistoMCPosPionsFromNeutralMesonPt(NULL),
152 fHistoMCNegPionsFromNeutralMesonPt(NULL),
153 fHistoMCEtaPiPlPiMiPiZeroPt(NULL),
154 fHistoMCEtaPiPlPiMiPiZeroInAccPt(NULL),
155 fHistoMCOmegaPiPlPiMiPiZeroPt(NULL),
156 fHistoMCOmegaPiPlPiMiPiZeroInAccPt(NULL),
157 fHistoTrueMotherPiPlPiMiPiZeroInvMassPt(NULL),
158 fHistoTrueMotherOmegaPiPlPiMiPiZeroInvMassPt(NULL),
159 fHistoTrueMotherEtaPiPlPiMiPiZeroInvMassPt(NULL),
160 fHistoTrueMotherGammaGammaInvMassPt(NULL),
161 fHistoTrueMotherGammaGammaFromEtaInvMassPt(NULL),
162 fHistoTrueMotherGammaGammaFromOmegaInvMassPt(NULL),
163 fHistoTrueConvGammaPt(NULL),
164 fHistoTrueConvGammaFromNeutralMesonPt(NULL),
165 fHistoTrueClusterGammaPt(NULL),
166 fHistoTrueClusterGammaFromNeutralMesonPt(NULL),
167 fHistoTruePosPionPt(NULL),
168 fHistoTruePosPionFromNeutralMesonPt(NULL),
169 fHistoTrueNegPionPt(NULL),
170 fHistoTrueNegPionFromNeutralMesonPt(NULL),
171 fHistoTruePionPionInvMassPt(NULL),
172 fHistoTruePionPionFromSameMotherInvMassPt(NULL),
173 fHistoTruePionPionFromEtaInvMassPt(NULL),
174 fHistoTruePionPionFromOmegaInvMassPt(NULL),
175 fHistoTruePiPlPiMiSameMotherFromEtaInvMassPt(NULL),
176 fHistoTruePiPlPiMiSameMotherFromOmegaInvMassPt(NULL),
177 fHistoTruePiPlPiMiSameMotherFromRhoInvMassPt(NULL),
178 fHistoTruePiPlPiMiSameMotherFromEtaPrimeInvMassPt(NULL),
179 fHistoTruePiPlPiMiSameMotherFromK0sInvMassPt(NULL),
180 fHistoTruePiPlPiMiSameMotherFromK0lInvMassPt(NULL),
181 fHistoTruePiMiPiZeroSameMotherFromEtaInvMassPt(NULL),
182 fHistoTruePiMiPiZeroSameMotherFromOmegaInvMassPt(NULL),
183 fHistoTruePiMiPiZeroSameMotherFromRhoInvMassPt(NULL),
184 fHistoTruePiMiPiZeroSameMotherFromK0lInvMassPt(NULL),
185 fHistoTruePiPlPiZeroSameMotherFromEtaInvMassPt(NULL),
186 fHistoTruePiPlPiZeroSameMotherFromOmegaInvMassPt(NULL),
187 fHistoTruePiPlPiZeroSameMotherFromRhoInvMassPt(NULL),
188 fHistoTruePiPlPiZeroSameMotherFromK0lInvMassPt(NULL),
189 fHistoTruePiPlPiMiPiZeroPureCombinatoricalInvMassPt(NULL),
190 fHistoTruePiPlPiMiPiZeroContaminationInvMassPt(NULL),
191 fHistoDoubleCountTruePi0InvMassPt(NULL),
192 fHistoDoubleCountTrueEtaInvMassPt(NULL),
193 fHistoDoubleCountTrueOmegaInvMassPt(NULL),
194 fHistoDoubleCountTrueConvGammaRPt(NULL),
195 fVectorDoubleCountTruePi0s(0),
196 fVectorDoubleCountTrueEtas(0),
197 fVectorDoubleCountTrueOmegas(0),
198 fVectorDoubleCountTrueConvGammas(0),
200 fHistoNGoodESDTracks(NULL),
201 fProfileEtaShift(NULL),
202 fHistoSPDClusterTrackletBackground(NULL),
206 fNumberOfESDTracks(0),
207 fMoveParticleAccordingToVertex(kFALSE),
209 fDoMesonAnalysis(kTRUE),
211 fIsFromMBHeader(kTRUE),
213 fDoLightOutput(kFALSE),
224 fV0ReaderName(
"V0ReaderV1"),
226 fBGHandlerPiPl(NULL),
227 fBGHandlerPiMi(NULL),
237 fSelectorNegPionIndex(0),
238 fSelectorPosPionIndex(0),
239 fGoodConvGammas(NULL),
240 fClusterCandidates(NULL),
241 fNeutralPionCandidates(NULL),
242 fNeutralPionSidebandCandidates(NULL),
243 fPosPionCandidates(NULL),
244 fNegPionCandidates(NULL),
245 fGoodVirtualParticles(NULL),
246 fEventCutArray(NULL),
247 fGammaCutArray(NULL),
248 fClusterCutArray(NULL),
250 fNeutralPionMesonCutArray(NULL),
251 fMesonCutArray(NULL),
253 fConversionCuts(NULL),
255 fTreePiPiSameMother(NULL),
256 fTreePiPiPiSameMother(NULL),
258 fSamePiPiMotherID(-1),
259 fSamePiPiMotherInvMass(-1),
260 fSamePiPiMotherPt(-1),
261 fSamePiPiPiMotherID(-1),
262 fSamePiPiPiMotherInvMass(-1),
263 fSamePiPiPiMotherPt(-1),
264 fHistoConvGammaPt(NULL),
265 fHistoConvGammaEta(NULL),
266 fHistoClusterGammaPt(NULL),
267 fHistoClusterGammaEta(NULL),
268 fHistoNegPionPt(NULL),
269 fHistoPosPionPt(NULL),
270 fHistoNegPionPhi(NULL),
271 fHistoPosPionPhi(NULL),
272 fHistoNegPionEta(NULL),
273 fHistoPosPionEta(NULL),
274 fHistoNegPionClsTPC(NULL),
275 fHistoPosPionClsTPC(NULL),
276 fHistoPionDCAxy(NULL),
277 fHistoPionDCAz(NULL),
278 fHistoPionTPCdEdxNSigma(NULL),
279 fHistoPionTPCdEdx(NULL),
280 fHistoPionPionInvMassPt(NULL),
281 fHistoGammaGammaInvMassPt(NULL),
282 fHistoMotherInvMassPt(NULL),
283 fHistoMotherInvMassPtRejectedKinematic(NULL),
284 fHistoBackInvMassPtGroup1(NULL),
285 fHistoBackInvMassPtGroup2(NULL),
286 fHistoBackInvMassPtGroup3(NULL),
287 fHistoBackInvMassPtGroup4(NULL),
288 fHistoMotherLikeSignBackInvMassPt(NULL),
289 fHistoAngleOmegaPiPlPiMi(NULL),
290 fHistoAngleOmegaPiZero(NULL),
291 fHistoAngleOmegaPiPl(NULL),
292 fHistoAngleOmegaPiMi(NULL),
293 fHistoAnglePiPlPiMi(NULL),
294 fHistoAnglePiZeroPiMi(NULL),
295 fHistoAnglePiPlPiZero(NULL),
296 fHistoAngleSum(NULL),
297 fHistoTrueAngleSum(NULL),
298 fHistoMotherInvMassSubPi0(NULL),
299 fHistoBackInvMassPtGroup1SubPi0(NULL),
300 fHistoBackInvMassPtGroup2SubPi0(NULL),
301 fHistoBackInvMassPtGroup3SubPi0(NULL),
302 fHistoBackInvMassPtGroup4SubPi0(NULL),
303 fHistoMotherLikeSignBackInvMassSubPi0Pt(NULL),
304 fHistoMotherInvMassFixedPzPi0(NULL),
305 fHistoBackInvMassPtGroup1FixedPzPi0(NULL),
306 fHistoBackInvMassPtGroup2FixedPzPi0(NULL),
307 fHistoBackInvMassPtGroup3FixedPzPi0(NULL),
308 fHistoBackInvMassPtGroup4FixedPzPi0(NULL),
309 fHistoMotherLikeSignBackInvMassFixedPzPi0Pt(NULL),
310 fHistoMCAllGammaPt(NULL),
311 fHistoMCConvGammaPt(NULL),
312 fHistoMCAllPosPionsPt(NULL),
313 fHistoMCAllNegPionsPt(NULL),
314 fHistoMCGammaFromNeutralMesonPt(NULL),
315 fHistoMCPosPionsFromNeutralMesonPt(NULL),
316 fHistoMCNegPionsFromNeutralMesonPt(NULL),
317 fHistoMCEtaPiPlPiMiPiZeroPt(NULL),
318 fHistoMCEtaPiPlPiMiPiZeroInAccPt(NULL),
319 fHistoMCOmegaPiPlPiMiPiZeroPt(NULL),
320 fHistoMCOmegaPiPlPiMiPiZeroInAccPt(NULL),
321 fHistoTrueMotherPiPlPiMiPiZeroInvMassPt(NULL),
322 fHistoTrueMotherOmegaPiPlPiMiPiZeroInvMassPt(NULL),
323 fHistoTrueMotherEtaPiPlPiMiPiZeroInvMassPt(NULL),
324 fHistoTrueMotherGammaGammaInvMassPt(NULL),
325 fHistoTrueMotherGammaGammaFromEtaInvMassPt(NULL),
326 fHistoTrueMotherGammaGammaFromOmegaInvMassPt(NULL),
327 fHistoTrueConvGammaPt(NULL),
328 fHistoTrueConvGammaFromNeutralMesonPt(NULL),
329 fHistoTrueClusterGammaPt(NULL),
330 fHistoTrueClusterGammaFromNeutralMesonPt(NULL),
331 fHistoTruePosPionPt(NULL),
332 fHistoTruePosPionFromNeutralMesonPt(NULL),
333 fHistoTrueNegPionPt(NULL),
334 fHistoTrueNegPionFromNeutralMesonPt(NULL),
335 fHistoTruePionPionInvMassPt(NULL),
336 fHistoTruePionPionFromSameMotherInvMassPt(NULL),
337 fHistoTruePionPionFromEtaInvMassPt(NULL),
338 fHistoTruePionPionFromOmegaInvMassPt(NULL),
339 fHistoTruePiPlPiMiSameMotherFromEtaInvMassPt(NULL),
340 fHistoTruePiPlPiMiSameMotherFromOmegaInvMassPt(NULL),
341 fHistoTruePiPlPiMiSameMotherFromRhoInvMassPt(NULL),
342 fHistoTruePiPlPiMiSameMotherFromEtaPrimeInvMassPt(NULL),
343 fHistoTruePiPlPiMiSameMotherFromK0sInvMassPt(NULL),
344 fHistoTruePiPlPiMiSameMotherFromK0lInvMassPt(NULL),
345 fHistoTruePiMiPiZeroSameMotherFromEtaInvMassPt(NULL),
346 fHistoTruePiMiPiZeroSameMotherFromOmegaInvMassPt(NULL),
347 fHistoTruePiMiPiZeroSameMotherFromRhoInvMassPt(NULL),
348 fHistoTruePiMiPiZeroSameMotherFromK0lInvMassPt(NULL),
349 fHistoTruePiPlPiZeroSameMotherFromEtaInvMassPt(NULL),
350 fHistoTruePiPlPiZeroSameMotherFromOmegaInvMassPt(NULL),
351 fHistoTruePiPlPiZeroSameMotherFromRhoInvMassPt(NULL),
352 fHistoTruePiPlPiZeroSameMotherFromK0lInvMassPt(NULL),
353 fHistoTruePiPlPiMiPiZeroPureCombinatoricalInvMassPt(NULL),
354 fHistoTruePiPlPiMiPiZeroContaminationInvMassPt(NULL),
355 fHistoDoubleCountTruePi0InvMassPt(NULL),
356 fHistoDoubleCountTrueEtaInvMassPt(NULL),
357 fHistoDoubleCountTrueOmegaInvMassPt(NULL),
358 fHistoDoubleCountTrueConvGammaRPt(NULL),
359 fVectorDoubleCountTruePi0s(0),
360 fVectorDoubleCountTrueEtas(0),
361 fVectorDoubleCountTrueOmegas(0),
362 fVectorDoubleCountTrueConvGammas(0),
364 fHistoNGoodESDTracks(NULL),
365 fProfileEtaShift(NULL),
366 fHistoSPDClusterTrackletBackground(NULL),
370 fNumberOfESDTracks(0),
371 fMoveParticleAccordingToVertex(kFALSE),
373 fDoMesonAnalysis(kTRUE),
375 fIsFromMBHeader(kTRUE),
377 fDoLightOutput(kFALSE),
381 DefineOutput(1, TList::Class());
390 cout<<
"Destructor"<<endl;
445 TString cutstringConvGamma =
"";
447 TString cutstringCaloGamma =
"";
453 if (
fNeutralPionMode == 0) fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
454 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());
455 else if (
fNeutralPionMode == 2) fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringCaloGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
461 if(collisionSystem == 1 || collisionSystem == 2 ||
462 collisionSystem == 5 || collisionSystem == 8 ||
463 collisionSystem == 9){
464 centMin = centMin*10;
465 centMax = centMax*10;
467 else if(collisionSystem == 3 || collisionSystem == 6){
471 else if(collisionSystem == 4 || collisionSystem == 7){
472 centMin = ((centMin*5)+45);
473 centMax = ((centMax*5)+45);
496 Double_t HistoMassRange[2] = {0.4,1.0};
497 Double_t HistoMassRangeSub[2] = {0.1,1.0};
498 Double_t HistoPtRange[2] = {0.,25.};
603 TString cutstringConvGamma =
"";
606 TString cutstringCaloGamma =
"";
614 fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
616 fullCutString = Form(
"%i_%s_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringCaloGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
618 fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringCaloGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data());
619 TString nameCutFolder = Form(
"Cut Number %s", fullCutString.Data());
620 TString nameESDList = Form(
"%s ESD histograms", fullCutString.Data());
623 fCutFolder[iCut]->SetName(nameCutFolder.Data());
624 fCutFolder[iCut]->SetOwner(kTRUE);
628 fESDList[iCut]->SetName(nameESDList.Data());
633 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,
"Centrality");
634 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,
"Miss. MC or inc. ev.");
637 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,
"Cont. Vertex");
641 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,
"EMCAL problem");
642 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,
"SPD hits vs tracklet");
643 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,
"Out-of-Bunch pileup Past-Future");
644 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,
"Pileup V0M-TPCout Tracks");
658 fHistoConvGammaPt[iCut] =
new TH1F(
"ESD_ConvGamma_Pt",
"ESD_ConvGamma_Pt",250,0,25);
660 fHistoConvGammaEta[iCut] =
new TH1F(
"ESD_ConvGamma_Eta",
"ESD_ConvGamma_Eta",600,-1.5,1.5);
669 fHistoNegPionPt[iCut] =
new TH1F(
"ESD_PrimaryNegPions_Pt",
"ESD_PrimaryNegPions_Pt",1000,0,25);
671 fHistoPosPionPt[iCut] =
new TH1F(
"ESD_PrimaryPosPions_Pt",
"ESD_PrimaryPosPions_Pt",1000,0,25);
673 fHistoNegPionPhi[iCut] =
new TH1F(
"ESD_PrimaryNegPions_Phi",
"ESD_PrimaryNegPions_Phi",360,0,2*TMath::Pi());
675 fHistoPosPionPhi[iCut] =
new TH1F(
"ESD_PrimaryPosPions_Phi",
"ESD_PrimaryPosPions_Phi",360,0,2*TMath::Pi());
681 fHistoNegPionEta[iCut] =
new TH1F(
"ESD_PrimaryNegPions_Eta",
"ESD_PrimaryNegPions_Eta",600,-1.5,1.5);
683 fHistoPosPionEta[iCut] =
new TH1F(
"ESD_PrimaryPosPions_Eta",
"ESD_PrimaryPosPions_Eta",600,-1.5,1.5);
685 fHistoNegPionClsTPC[iCut] =
new TH2F(
"ESD_PrimaryNegPions_ClsTPC",
"ESD_PrimaryNegPions_ClsTPC",100,0,1,400,0.,10.);
687 fHistoPosPionClsTPC[iCut] =
new TH2F(
"ESD_PrimaryPosPions_ClsTPC",
"ESD_PrimaryPosPions_ClsTPC",100,0,1,400,0.,10.);
689 fHistoPionDCAxy[iCut] =
new TH2F(
"ESD_PrimaryPions_DCAxy",
"ESD_PrimaryPions_DCAxy",800,-4.0,4.0,400,0.,10.);
691 fHistoPionDCAz[iCut] =
new TH2F(
"ESD_PrimaryPions_DCAz",
"ESD_PrimaryPions_DCAz",800,-4.0,4.0,400,0.,10.);
695 fHistoPionTPCdEdx[iCut] =
new TH2F(
"ESD_PrimaryPions_TPCdEdxSignal",
"ESD_PrimaryPions_TPCdEdxSignal" ,150,0.05,20.0,800,0.0,200);
701 fHistoMotherInvMassPt[iCut] =
new TH2F(
"ESD_Mother_InvMass_Pt",
"ESD_Mother_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
703 fHistoMotherInvMassPtRejectedKinematic[iCut] =
new TH2F(
"ESD_Mother_InvMass_Pt_KinematicRejected",
"ESD_Mother_InvMass_Pt_KinematicRejected",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
706 fHistoBackInvMassPtGroup1[iCut] =
new TH2F(
"ESD_Background_1_InvMass_Pt",
"ESD_Background_1_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
707 fHistoBackInvMassPtGroup2[iCut] =
new TH2F(
"ESD_Background_2_InvMass_Pt",
"ESD_Background_2_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
708 fHistoBackInvMassPtGroup3[iCut] =
new TH2F(
"ESD_Background_3_InvMass_Pt",
"ESD_Background_3_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
709 fHistoBackInvMassPtGroup4[iCut] =
new TH2F(
"ESD_Background_4_InvMass_Pt",
"ESD_Background_4_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
717 fHistoMotherLikeSignBackInvMassPt[iCut] =
new TH2F(
"ESD_Background_LikeSign_InvMass_Pt",
"ESD_Background_LikeSign_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
721 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]);
725 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
727 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
729 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
731 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
740 HistoNMassBinsSub,HistoMassRangeSub[0],HistoMassRangeSub[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
744 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]);
747 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]);
748 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]);
749 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]);
750 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]);
758 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]);
763 fHistoAngleOmegaPiPlPiMi[iCut] =
new TH2F(
"ESD_Mother_AngleOmegaNegPionsPosPions_Pt",
"ESD_Mother_AngleOmegaNegPionsPosPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
765 fHistoAngleOmegaPiMi[iCut] =
new TH2F(
"ESD_Mother_AngleOmegaNegPions_Pt",
"ESD_Mother_AngleOmegaNegPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
767 fHistoAngleOmegaPiPl[iCut] =
new TH2F(
"ESD_Mother_AngleOmegaPosPions_Pt",
"ESD_Mother_AngleOmegaPosPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
769 fHistoAngleOmegaPiZero[iCut] =
new TH2F(
"ESD_Mother_AngleOmegaNeutralPion_Pt",
"ESD_Mother_AngleOmegaNeutralPion_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
771 fHistoAnglePiPlPiZero[iCut] =
new TH2F(
"ESD_Mother_AnglePosPionsNeutralPion_Pt",
"ESD_Mother_AnglePosPionsNeutralPion_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
773 fHistoAnglePiPlPiMi[iCut] =
new TH2F(
"ESD_Mother_AnglePosPionsNegPions_Pt",
"ESD_Mother_AnglePosPionsNegPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
775 fHistoAnglePiZeroPiMi[iCut] =
new TH2F(
"ESD_Mother_AngleNeutralPionNegPions_Pt",
"ESD_Mother_AngleNeutralPionNegPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],360,0,TMath::Pi());
777 fHistoAngleSum[iCut] =
new TH2F(
"ESD_Mother_AngleSum_Pt",
"ESD_Mother_AngleSum_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],720,0,2*TMath::Pi());
782 Int_t bins = AxisAfter->GetNbins();
783 Double_t from = AxisAfter->GetXmin();
787 Double_t factor = TMath::Power(to/from, 1./bins);
788 for(
Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
790 AxisAfter->Set(bins, newBins);
792 AxisAfter->Set(bins, newBins);
796 fCutFolder[iCut]->Add(
fESDList[iCut]);
883 TString cutstringConvGamma =
"";
886 TString cutstringCaloGamma =
"";
894 fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),
895 cutstringMeson.Data());
897 fullCutString = Form(
"%i_%s_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringCaloGamma.Data(), cutstringNeutralPion.Data(),
898 cutstringPion.Data(), cutstringMeson.Data());
900 fullCutString = Form(
"%i_%s_%s_%s_%s_%s",
fNeutralPionMode,cutstringEvent.Data(), cutstringCaloGamma.Data(), cutstringNeutralPion.Data(), cutstringPion.Data(),
901 cutstringMeson.Data());
902 TString nameMCList = Form(
"%s MC histograms", fullCutString.Data());
903 TString nameTrueRecList = Form(
"%s True histograms", fullCutString.Data());
904 TString nameTrueRecTTreeList = Form(
"%s True TTrees", fullCutString.Data());
907 fMCList[iCut]->SetName(nameMCList.Data());
908 fMCList[iCut]->SetOwner(kTRUE);
912 fHistoMCAllGammaPt[iCut] =
new TH1F(
"MC_AllGamma_Pt",
"MC_AllGamma_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
915 fHistoMCConvGammaPt[iCut] =
new TH1F(
"MC_ConvGamma_Pt",
"MC_ConvGamma_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
919 fHistoMCAllPosPionsPt[iCut] =
new TH1F(
"MC_AllPosPions_Pt",
"MC_AllPosPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
921 fHistoMCAllNegPionsPt[iCut] =
new TH1F(
"MC_AllNegPions_Pt",
"MC_AllNegPions_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
923 fHistoMCGammaFromNeutralMesonPt[iCut] =
new TH1F(
"MC_GammaFromNeutralMeson_Pt",
"MC_GammaFromNeutralMeson_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
947 fTrueList[iCut]->SetName(nameTrueRecList.Data());
953 fHistoTrueConvGammaPt[iCut] =
new TH1F(
"ESD_TrueConvGamma_Pt",
"ESD_TrueConvGamma_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
961 fHistoTrueClusterGammaPt[iCut] =
new TH1F(
"ESD_TrueClusterGamma_Pt",
"ESD_TrueClusterGamma_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
966 fHistoTruePosPionPt[iCut] =
new TH1F(
"ESD_TruePosPion_Pt",
"ESD_TruePosPion_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
968 fHistoTrueNegPionPt[iCut] =
new TH1F(
"ESD_TrueNegPion_Pt",
"ESD_TrueNegPion_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
971 fHistoTrueNegPionFromNeutralMesonPt[iCut] =
new TH1F(
"ESD_TrueNegPionFromNeutralMeson_Pt",
"ESD_TrueNegPionFromNeutralMeson_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
973 fHistoTruePosPionFromNeutralMesonPt[iCut] =
new TH1F(
"ESD_TruePosPionFromNeutralMeson_Pt",
"ESD_TruePosPionFromNeutralMeson_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
983 fHistoTrueMotherPiPlPiMiPiZeroInvMassPt[iCut] =
new TH2F(
"ESD_TrueMotherPiPlPiMiPiZero_InvMass_Pt",
"ESD_TrueMotherPiPlPiMiPiZero_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
987 fHistoTrueMotherOmegaPiPlPiMiPiZeroInvMassPt[iCut] =
new TH2F(
"ESD_TrueMotherOmegaPiPlPiMiPiZero_InvMass_Pt",
"ESD_TrueMotherOmegaPiPlPiMiPiZero_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
988 fHistoTrueMotherEtaPiPlPiMiPiZeroInvMassPt[iCut] =
new TH2F(
"ESD_TrueMotherEtaPiPlPiMiPiZero_InvMass_Pt",
"ESD_TrueMotherEtaPiPlPiMiPiZero_InvMass_Pt",HistoNMassBins,HistoMassRange[0],HistoMassRange[1],HistoNPtBins,HistoPtRange[0],HistoPtRange[1]);
1001 fHistoTrueAngleSum[iCut] =
new TH2F(
"ESD_TrueMother_AngleSum_Pt",
"ESD_TrueMother_AngleSum_Pt",HistoNPtBins,HistoPtRange[0],HistoPtRange[1],720,0,2*TMath::Pi());
1021 2000,0.,2.,200,0.,20.);
1081 if(!
fV0Reader){printf(
"Error: No V0 Reader");
return;}
1098 for(
Int_t iMatcherTask = 0; iMatcherTask < 3; iMatcherTask++){
1104 if(!
fPionSelector){printf(
"Error: No PionSelector");
return;}
1162 if(!
fV0Reader){printf(
"Error: No V0 Reader");
return;}
1165 if(InputEvent()->IsIncompleteDAQ()==kTRUE) eventQuality = 2;
1166 if(eventQuality == 2 || eventQuality == 3){
1174 if(!
fPionSelector){printf(
"Error: No PionSelector");
return;}
1188 Bool_t isRunningEMCALrelAna = kFALSE;
1195 if(eventNotAccepted){
1201 if(eventQuality != 0){
1210 fHistoSPDClusterTrackletBackground[iCut]->Fill(fInputEvent->GetMultiplicity()->GetNumberOfTracklets(),(fInputEvent->GetNumberOfITSClusters(0)+fInputEvent->GetNumberOfITSClusters(1)));
1287 printf(
" Eta t PiPlusPiMinus Gamma Task %s :: Eta Shift Manually Set to %f \n\n",
1310 nclus = fInputEvent->GetNumberOfCaloClusters();
1314 if(nclus == 0)
return;
1318 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1321 for(Long_t i = 0; i < nclus; i++){
1323 AliVCluster* clus = NULL;
1324 if(fInputEvent->IsA()==AliESDEvent::Class()) clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
1325 else if(fInputEvent->IsA()==AliAODEvent::Class()) clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
1327 if (!clus)
continue;
1330 TLorentzVector clusterVector;
1331 clus->GetMomentum(clusterVector,vertex);
1333 TLorentzVector* tmpvec =
new TLorentzVector();
1334 tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
1338 if(!PhotonCandidate){
delete clus;
delete tmpvec;
continue;}
1345 Int_t* mclabelsCluster = clus->GetLabels();
1348 if (clus->GetNLabels()>0){
1349 for (
Int_t k =0; k< (
Int_t)clus->GetNLabels(); k++){
1384 TParticle *Photon = NULL;
1385 if (!TruePhotonCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
1389 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
1390 Double_t mcProdVtxX = primVtxMC->GetX();
1391 Double_t mcProdVtxY = primVtxMC->GetY();
1392 Double_t mcProdVtxZ = primVtxMC->GetZ();
1437 if(!PhotonCandidate)
continue;
1442 Int_t isPosFromMBHeader
1445 Int_t isNegFromMBHeader
1448 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1469 GoodGammasStepOne->Add(PhotonCandidate);
1472 GoodGammasStepTwo->Add(PhotonCandidate);
1478 for(
Int_t i = 0;i<GoodGammasStepOne->GetEntries();i++){
1480 if(!PhotonCandidate)
continue;
1483 Int_t isPosFromMBHeader
1485 Int_t isNegFromMBHeader
1487 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1500 else GoodGammasStepTwo->Add(PhotonCandidate);
1504 for(
Int_t i = 0;i<GoodGammasStepTwo->GetEntries();i++){
1506 if(!PhotonCandidate)
continue;
1509 Int_t isPosFromMBHeader
1511 Int_t isNegFromMBHeader
1513 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1530 delete GoodGammasStepOne;
1531 GoodGammasStepOne = 0x0;
1532 delete GoodGammasStepTwo;
1533 GoodGammasStepTwo = 0x0;
1543 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
1544 Double_t mcProdVtxX = primVtxMC->GetX();
1545 Double_t mcProdVtxY = primVtxMC->GetY();
1546 Double_t mcProdVtxZ = primVtxMC->GetZ();
1549 if(posDaughter == NULL || negDaughter == NULL)
return;
1550 if(posDaughter->GetMother(0) != negDaughter->GetMother(0)){
1554 else if (posDaughter->GetMother(0) == -1){
1558 if(TMath::Abs(posDaughter->GetPdgCode())!=11 || TMath::Abs(negDaughter->GetPdgCode())!=11)
return;
1559 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode())
return;
1560 if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5)
return;
1563 if(Photon->GetPdgCode() != 22)
return;
1571 if( gammaIsPrimary ){
1585 for(
Int_t firstGammaIndex=0;firstGammaIndex<
fGoodConvGammas->GetEntries()-1;firstGammaIndex++){
1587 if (gamma0==NULL)
continue;
1588 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fGoodConvGammas->GetEntries();secondGammaIndex++){
1591 if (gamma1==NULL)
continue;
1598 pi0cand->
SetLabels(firstGammaIndex,secondGammaIndex);
1606 if(fInputEvent->IsA()==AliESDEvent::Class())
1608 if(fInputEvent->IsA()==AliAODEvent::Class())
1639 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1643 if (gamma0==NULL)
continue;
1646 if (firstGammaIndex == secondGammaIndex)
continue;
1648 if (gamma1==NULL)
continue;
1651 pi0cand->
SetLabels(firstGammaIndex,secondGammaIndex);
1687 Bool_t isTruePi0 = kFALSE;
1689 Int_t gamma0MotherLabel = -1;
1690 Int_t motherRealLabel = -1;
1692 if(gamma0MCLabel != -1){
1693 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
1697 gamma0MotherLabel=gammaMC0->GetMother(0);
1698 motherRealLabel=gammaMC0->GetFirstMother();
1700 if (TrueGammaCandidate0->
IsConversion() && gammaMC0->GetMother(0)>-1){
1701 gamma0MotherLabel=
fMCEvent->Particle(gammaMC0->GetMother(0))->GetMother(0);
1702 motherRealLabel=
fMCEvent->Particle(gammaMC0->GetMother(0))->GetMother(0);
1704 gamma0MotherLabel=gammaMC0->GetMother(0);
1705 motherRealLabel=gammaMC0->GetMother(0);
1711 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
1714 Int_t gamma1MotherLabel = -1;
1716 if(gamma1MCLabel != -1){
1718 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
1722 gamma1MotherLabel=gammaMC1->GetMother(0);
1724 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
1725 else gamma1MotherLabel=gammaMC1->GetMother(0);
1730 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
1731 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
1758 if(TrueGammaCandidate0->
GetV0Index()<fInputEvent->GetNumberOfV0s()){
1759 Bool_t isTruePi0 = kFALSE;
1760 Bool_t isTruePi0Dalitz = kFALSE;
1761 Bool_t gamma0DalitzCand = kFALSE;
1762 Bool_t gamma1DalitzCand = kFALSE;
1764 Int_t gamma0MotherLabel = -1;
1765 Int_t motherRealLabel = -1;
1766 if(gamma0MCLabel != -1){
1770 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
1771 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
1772 if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
1773 if(gammaMC0->GetPdgCode() == 22){
1774 gamma0MotherLabel=gammaMC0->GetFirstMother();
1775 motherRealLabel=gammaMC0->GetFirstMother();
1778 if(gammaMC0->GetPdgCode() ==111){
1779 gamma0DalitzCand = kTRUE;
1780 gamma0MotherLabel=-111;
1781 motherRealLabel=gamma0MCLabel;
1785 if(TrueGammaCandidate1->
GetV0Index()<fInputEvent->GetNumberOfV0s()){
1787 Int_t gamma1MotherLabel = -1;
1788 if(gamma1MCLabel != -1){
1792 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
1793 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
1794 if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
1795 if(gammaMC1->GetPdgCode() == 22){
1796 gamma1MotherLabel=gammaMC1->GetFirstMother();
1799 if(gammaMC1->GetPdgCode() ==111 ){
1800 gamma1DalitzCand = kTRUE;
1801 gamma1MotherLabel=-111;
1805 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
1806 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
1813 if (gamma1DalitzCand || gamma0DalitzCand){
1814 if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){
1815 if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE;
1817 if (gamma1DalitzCand && gamma1MCLabel >=0 && gamma1MCLabel==gamma0MotherLabel){
1818 if (gamma1MotherLabel == -111) isTruePi0Dalitz = kTRUE;
1823 if(isTruePi0 || isTruePi0Dalitz){
1845 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1846 Bool_t isTruePi0 = kFALSE;
1847 Bool_t isTruePi0Dalitz = kFALSE;
1848 Bool_t gamma0DalitzCand = kFALSE;
1849 Bool_t gamma1DalitzCand = kFALSE;
1850 Int_t motherRealLabel = -1;
1852 if (AODMCTrackArray!=NULL && TrueGammaCandidate0 != NULL){
1853 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
1854 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
1856 Int_t gamma0MCLabel = -1;
1857 Int_t gamma0MotherLabel = -1;
1858 if(!positiveMC||!negativeMC)
1861 if(positiveMC->GetMother()>-1&&(negativeMC->GetMother() == positiveMC->GetMother())){
1862 gamma0MCLabel = positiveMC->GetMother();
1865 if(gamma0MCLabel != -1){
1867 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
1868 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
1869 if(((positiveMC->GetMCProcessCode())) == 5 && ((negativeMC->GetMCProcessCode())) == 5){
1870 if(gammaMC0->GetPdgCode() == 22){
1871 gamma0MotherLabel=gammaMC0->GetMother();
1872 motherRealLabel=gammaMC0->GetMother();
1875 if(gammaMC0->GetPdgCode() ==111){
1876 gamma0DalitzCand = kTRUE;
1877 gamma0MotherLabel=-111;
1878 motherRealLabel=gamma0MCLabel;
1882 positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelPositive()));
1883 negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelNegative()));
1885 Int_t gamma1MCLabel = -1;
1886 Int_t gamma1MotherLabel = -1;
1887 if(!positiveMC||!negativeMC)
1890 if(positiveMC->GetMother()>-1&&(negativeMC->GetMother() == positiveMC->GetMother())){
1891 gamma1MCLabel = positiveMC->GetMother();
1893 if(gamma1MCLabel != -1){
1895 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
1896 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
1897 if(((positiveMC->GetMCProcessCode())) == 5 && ((negativeMC->GetMCProcessCode())) == 5){
1898 if(gammaMC1->GetPdgCode() == 22){
1899 gamma1MotherLabel=gammaMC1->GetMother();
1902 if(gammaMC1->GetPdgCode() ==111 ){
1903 gamma1DalitzCand = kTRUE;
1904 gamma1MotherLabel=-111;
1908 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
1909 if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
1916 if (gamma1DalitzCand || gamma0DalitzCand){
1917 if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){
1918 if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE;
1920 if (gamma1DalitzCand && gamma1MCLabel >=0 && gamma1MCLabel==gamma0MotherLabel){
1921 if (gamma1MotherLabel == -111) isTruePi0Dalitz = kTRUE;
1925 if(isTruePi0 || isTruePi0Dalitz){
1950 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1954 if (gamma0==NULL)
continue;
1959 if (gamma1==NULL)
continue;
1962 AliVCluster* cluster = fInputEvent->GetCaloCluster(gamma1->
GetCaloClusterRef());
1967 pi0cand->
SetLabels(firstGammaIndex,secondGammaIndex);
2007 if(TrueGammaCandidate0->
GetV0Index()<fInputEvent->GetNumberOfV0s()){
2008 Bool_t isTruePi0 = kFALSE;
2009 Bool_t isTruePi0Dalitz = kFALSE;
2010 Bool_t gamma0DalitzCand = kFALSE;
2013 Int_t gamma0MotherLabel = -1;
2014 Int_t motherRealLabel = -1;
2015 if(gamma0MCLabel != -1){
2019 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2020 if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){
2021 if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){
2022 if(gammaMC0->GetPdgCode() == 22){
2023 gamma0MotherLabel=gammaMC0->GetFirstMother();
2024 motherRealLabel=gammaMC0->GetFirstMother();
2027 if(gammaMC0->GetPdgCode() ==111){
2028 gamma0DalitzCand = kTRUE;
2029 gamma0MotherLabel=-111;
2030 motherRealLabel=gamma0MCLabel;
2036 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2039 Int_t gamma1MotherLabel = -1;
2042 if(gamma1MCLabel != -1){
2044 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2048 gamma1MotherLabel=gammaMC1->GetMother(0);
2050 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2051 else gamma1MotherLabel=gammaMC1->GetMother(0);
2056 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){
2057 if(((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2063 if (gamma0DalitzCand ){
2064 if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){
2065 if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE;
2069 if(isTruePi0 || isTruePi0Dalitz ){
2090 Double_t magField = fInputEvent->GetMagneticField();
2091 if( magField < 0.0 ){
2097 vector<Int_t> lGoodNegPionIndexPrev(0);
2098 vector<Int_t> lGoodPosPionIndexPrev(0);
2105 TLorentzVector *negPionforHandler =
new TLorentzVector();
2106 negPionforHandler->SetPxPyPzE(negPionCandidate->Px(), negPionCandidate->Py(), negPionCandidate->Pz(), negPionCandidate->E());
2109 delete negPionforHandler;
2118 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2119 Double_t mcProdVtxX = primVtxMC->GetX();
2120 Double_t mcProdVtxY = primVtxMC->GetY();
2121 Double_t mcProdVtxZ = primVtxMC->GetZ();
2123 Int_t labelNegPion = TMath::Abs( negPionCandidate->GetLabel() );
2125 if( labelNegPion>-1 && labelNegPion < fMCEvent->GetNumberOfTracks() ){
2126 TParticle* negPion =
fMCEvent->Particle(labelNegPion);
2127 if( negPion->GetPdgCode() == -211 ){
2130 if( negPionIsPrimary ){
2134 if( negPionIsPrimary ) {
2149 TLorentzVector *posPionforHandler =
new TLorentzVector();
2150 posPionforHandler->SetPxPyPzE(posPionCandidate->Px(), posPionCandidate->Py(), posPionCandidate->Pz(), posPionCandidate->E());
2153 delete posPionforHandler;
2161 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2162 Double_t mcProdVtxX = primVtxMC->GetX();
2163 Double_t mcProdVtxY = primVtxMC->GetY();
2164 Double_t mcProdVtxZ = primVtxMC->GetZ();
2166 Int_t labelPosPion = TMath::Abs( posPionCandidate->GetLabel() );
2168 if( labelPosPion>-1 && labelPosPion < fMCEvent->GetNumberOfTracks() ) {
2169 TParticle* posPion =
fMCEvent->Particle(labelPosPion);
2170 if( posPion->GetPdgCode() == 211 ){
2172 if( posPionIsPrimary ){
2176 if(posPionIsPrimary){
2187 for(
UInt_t i = 0; i < lGoodNegPionIndexPrev.size(); i++){
2188 AliESDtrack *negPionCandidate =
fESDEvent->GetTrack(lGoodNegPionIndexPrev[i]);
2189 AliKFParticle negPionCandidateKF( *negPionCandidate->GetConstrainedParam(), 211 );
2191 for(
UInt_t j = 0; j < lGoodPosPionIndexPrev.size(); j++){
2192 AliESDtrack *posPionCandidate =
fESDEvent->GetTrack(lGoodPosPionIndexPrev[j]);
2193 AliKFParticle posPionCandidateKF( *posPionCandidate->GetConstrainedParam(), 211 );
2197 AliKFVertex primaryVertexImproved(*fInputEvent->GetPrimaryVertex());
2199 virtualPhoton->SetProductionVertex(primaryVertexImproved);
2200 virtualPhoton->SetTrackLabels( lGoodPosPionIndexPrev[j], lGoodNegPionIndexPrev[i]);
2204 Int_t motherlabelp = 0;
2205 Int_t motherlabeln = 0;
2206 TParticle *fNegativeMCParticle =NULL;
2207 TParticle *fPositiveMCParticle =NULL;
2209 labeln=TMath::Abs(negPionCandidate->GetLabel());
2210 labelp=TMath::Abs(posPionCandidate->GetLabel());
2211 if(labeln>-1) fNegativeMCParticle =
fMCEvent->Particle(labeln);
2212 if(labelp>-1) fPositiveMCParticle =
fMCEvent->Particle(labelp);
2214 if (fNegativeMCParticle == NULL || fPositiveMCParticle == NULL)
return;
2216 motherlabeln = fNegativeMCParticle->GetMother(0);
2217 motherlabelp = fPositiveMCParticle->GetMother(0);
2218 virtualPhoton->SetMCLabelPositive(labelp);
2219 virtualPhoton->SetMCLabelNegative(labeln);
2226 if (fPositiveMCParticle && fNegativeMCParticle ) {
2229 if(TMath::Abs(fNegativeMCParticle->GetPdgCode())==211 && TMath::Abs(fPositiveMCParticle->GetPdgCode())==211){
2231 if (motherlabeln == motherlabelp){
2243 if(TMath::Abs(fNegativeMCParticle->GetPdgCode())==211 && TMath::Abs(fPositiveMCParticle->GetPdgCode())==211){
2245 if (motherlabeln == motherlabelp){
2280 Float_t dcaToVertexXYPos = -1.0;
2281 Float_t dcaToVertexZPos = -1.0;
2282 Float_t dcaToVertexXYNeg = -1.0;
2283 Float_t dcaToVertexZNeg = -1.0;
2291 posPionCandidate->GetImpactParameters(bPos,bCovPos);
2292 if (bCovPos[0]<=0 || bCovPos[2]<=0) {
2293 AliDebug(1,
"Estimated b resolution lower or equal zero!");
2294 bCovPos[0]=0; bCovPos[2]=0;
2299 posPionCandidate->GetImpactParameters(bNeg,bCovNeg);
2300 if (bCovNeg[0]<=0 || bCovNeg[2]<=0) {
2301 AliDebug(1,
"Estimated b resolution lower or equal zero!");
2302 bCovNeg[0]=0; bCovNeg[2]=0;
2305 dcaToVertexXYPos = bPos[0];
2306 dcaToVertexZPos = bPos[1];
2307 dcaToVertexXYNeg = bNeg[0];
2308 dcaToVertexZNeg = bNeg[1];
2330 delete virtualPhoton;
2340 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2341 Double_t mcProdVtxX = primVtxMC->GetX();
2342 Double_t mcProdVtxY = primVtxMC->GetY();
2343 Double_t mcProdVtxZ = primVtxMC->GetZ();
2348 TParticle* particle = (TParticle *)
fMCEvent->Particle(i);
2349 if (!particle)
continue;
2351 Int_t isMCFromMBHeader = -1;
2364 if(particle->GetMother(0) >-1){
2365 if (
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==111){
2366 if (
fMCEvent->Particle(particle->GetMother(0))->GetMother(0) > -1){
2367 if (
fMCEvent->Particle((
fMCEvent->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 221 ||
2368 fMCEvent->Particle((
fMCEvent->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 223 ){
2369 if (
fMCEvent->Particle(particle->GetMother(0))->GetNDaughters()==3 )
2379 if(particle->GetMother(0) >-1){
2380 if (
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==111){
2381 if (
fMCEvent->Particle(particle->GetMother(0))->GetMother(0) > -1){
2382 if (
fMCEvent->Particle((
fMCEvent->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 221 ||
2383 fMCEvent->Particle((
fMCEvent->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 223 ){
2384 if (
fMCEvent->Particle(particle->GetMother(0))->GetNDaughters()==3 )
2398 if( particle->GetPdgCode() == 211){
2400 if(particle->GetMother(0) >-1){
2401 if (
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==221 ||
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==223)
2405 if( particle->GetPdgCode() == -211){
2407 if(particle->GetMother(0) >-1){
2408 if (
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==221 ||
fMCEvent->Particle(particle->GetMother(0))->GetPdgCode() ==223 )
2416 Int_t labelNeutPion = -1;
2417 Int_t labelNegPion = -1;
2418 Int_t labelPosPion = -1;
2424 if (particle->Pt()>0.005){
2432 if(labelNeutPion>-1){
2433 TParticle *neutPion =
fMCEvent->Particle(labelNeutPion);
2434 if(neutPion->GetDaughter(0)>-1 && neutPion->GetDaughter(1)>-1){
2435 TParticle *gamma1 =
fMCEvent->Particle(neutPion->GetDaughter(0));
2436 TParticle *gamma2 =
fMCEvent->Particle(neutPion->GetDaughter(1));
2443 if( kDaughter0IsPrim && kDaughter1IsPrim && kNegPionIsPrim && kPosPionIsPrim &&
2453 if( kDaughter0IsPrim && kDaughter1IsPrim && kNegPionIsPrim && kPosPionIsPrim &&
2479 if (neutralPion==NULL)
continue;
2488 if (vParticle==NULL)
continue;
2492 mesoncand->
SetLabels(mesonIndex,virtualParticleIndex);
2496 if(negPionCandidatetmp==NULL){
delete mesoncand;
continue;}
2498 NegPiontmp->SetPxPyPzE(negPionCandidatetmp->Px(), negPionCandidatetmp->Py(), negPionCandidatetmp->Pz(), negPionCandidatetmp->E());
2501 if(posPionCandidatetmp==NULL){
delete NegPiontmp;
delete mesoncand;
continue;}
2503 PosPiontmp->SetPxPyPzE(posPionCandidatetmp->Px(), posPionCandidatetmp->Py(), posPionCandidatetmp->Pz(), posPionCandidatetmp->E());
2505 if(
KinematicCut(NegPiontmp, PosPiontmp, neutralPion, mesoncand)){
2514 fHistoAngleSum[
fiCut]->Fill(mesoncand->Pt(),((PosPiontmp->Angle(mesoncand->Vect()))+(NegPiontmp->Angle(PosPiontmp->Vect()))+(PosPiontmp->Angle(neutralPion->Vect()))));
2521 Pi0tmp->SetPxPyPzE(neutralPion->Px(), neutralPion->Py(), neutralPion->Pz(), neutralPion->Energy());
2575 Int_t NPi0Candidates = 0;
2582 for(
Int_t iCurrentPi0=0; iCurrentPi0<NPi0Candidates; iCurrentPi0++){
2610 if((EventPiMiMeson && EventPiPlMeson) == kFALSE)
continue;
2618 for(
UInt_t iCurrentPiPl = 0; iCurrentPiPl<EventPiPlMeson->size();iCurrentPiPl++){
2629 for(
UInt_t iCurrentPiMi = 0; iCurrentPiMi<EventPiMiMeson->size();iCurrentPiMi++){
2641 delete backPiPlPiMiCandidate;
2642 backPiPlPiMiCandidate = 0x0;
2645 delete backPiPlPiMiCandidate;
2646 backPiPlPiMiCandidate = 0x0;
2655 if(
KinematicCut(&EventPiMiGoodMeson, &EventPiPlGoodMeson,EventPiZeroGoodMeson,PiPlPiMiPiZeroBackgroundCandidate)){
2658 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
2663 if (nEventsInBGMi != nEventsInBGPl){
2670 }
else if(nEventsInBGMi==nEventsInBGPl){
2678 delete PiMiPiZerotmp;
2679 delete PiPlPiMiPiZerotmp;
2681 delete PiPlPiMiPiZeroBackgroundCandidate;
2682 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
2685 if(PiPlPiMiPiZeroBackgroundCandidate!=0x0){
2686 delete PiPlPiMiPiZeroBackgroundCandidate;
2687 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
2690 if(PiPlPiZeroBackgroundCandidate!=0x0){
2691 delete PiPlPiZeroBackgroundCandidate;
2692 PiPlPiZeroBackgroundCandidate = 0x0;
2708 for(
UInt_t iCurrentPiPl = 0; iCurrentPiPl<EventPiPlMeson->size();iCurrentPiPl++){
2725 delete backPiPlPiMiCandidate;
2726 backPiPlPiMiCandidate = 0x0;
2729 delete backPiPlPiMiCandidate;
2730 backPiPlPiMiCandidate = 0x0;
2740 if(
KinematicCut(&EventPiNegGoodMeson, &EventPiPlGoodMeson, EventPiZeroGoodMeson,PiPlPiMiPiZeroBackgroundCandidate)){
2744 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
2755 delete PiMiPiZerotmp;
2756 delete PiPlPiMiPiZerotmp;
2758 delete PiPlPiMiPiZeroBackgroundCandidate;
2759 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
2762 if(PiPlPiMiPiZeroBackgroundCandidate!=0x0){
2763 delete PiPlPiMiPiZeroBackgroundCandidate;
2764 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
2767 if(PiPlPiZeroBackgroundCandidate!=0x0){
2768 delete PiPlPiZeroBackgroundCandidate;
2769 PiPlPiZeroBackgroundCandidate = 0x0;
2785 for(
UInt_t iCurrentPiMi = 0; iCurrentPiMi<EventPiMiMeson->size();iCurrentPiMi++){
2805 delete backPiPlPiMiCandidate;
2806 backPiPlPiMiCandidate = 0x0;
2809 delete backPiPlPiMiCandidate;
2810 backPiPlPiMiCandidate = 0x0;
2820 if(
KinematicCut(&EventPiMiGoodMeson, &EventPiPlGoodMeson, EventPiZeroGoodMeson,PiPlPiMiPiZeroBackgroundCandidate)){
2824 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
2835 delete PiMiPiZerotmp;
2836 delete PiPlPiMiPiZerotmp;
2838 delete PiPlPiMiPiZeroBackgroundCandidate;
2839 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
2842 if(PiPlPiMiPiZeroBackgroundCandidate!=0x0){
2843 delete PiPlPiMiPiZeroBackgroundCandidate;
2844 PiPlPiMiPiZeroBackgroundCandidate = 0x0;
2847 if(PiMiPiZeroBackgroundCandidate!=0x0){
2848 delete PiMiPiZeroBackgroundCandidate;
2849 PiMiPiZeroBackgroundCandidate = 0x0;
2864 if(iCurrentPiPl!=iCurrentPiPl2){
2874 delete backPiPlPiPlCandidate;
2875 backPiPlPiPlCandidate = 0x0;
2878 delete backPiPlPiPlCandidate;
2879 backPiPlPiPlCandidate = 0x0;
2889 if(
KinematicCut(&EventPiPlGoodMeson, &EventPiPlGoodMeson2, EventPiZeroGoodMeson,PiPlPiPlPiZeroBackgroundCandidate)){
2893 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
2904 delete PiPlPiZerotmp;
2905 delete PiPlPiPlPiZerotmp;
2907 delete PiPlPiPlPiZeroBackgroundCandidate;
2908 PiPlPiPlPiZeroBackgroundCandidate = 0x0;
2924 if(iCurrentPiMi!=iCurrentPiMi2){
2934 delete backPiMiPiMiCandidate;
2935 backPiMiPiMiCandidate = 0x0;
2938 delete backPiMiPiMiCandidate;
2939 backPiMiPiMiCandidate = 0x0;
2949 if(
KinematicCut(&EventPiMiGoodMeson, &EventPiMiGoodMeson2, EventPiZeroGoodMeson,PiMiPiMiPiZeroBackgroundCandidate)){
2953 Pi0tmp->SetPxPyPzE(EventPiZeroGoodMeson->Px(), EventPiZeroGoodMeson->Py(), EventPiZeroGoodMeson->Pz(), EventPiZeroGoodMeson->Energy());
2964 delete PiMiPiZerotmp;
2965 delete PiMiPiMiPiZerotmp;
2967 delete PiMiPiMiPiZeroBackgroundCandidate;
2968 PiMiPiMiPiZeroBackgroundCandidate = 0x0;
2984 if((omega->Pt())<=5.){
2985 if( (omega->Angle(pospion->Vect())) < ((2.78715*(TMath::Exp(-0.589934*(omega->Pt()))+0.0519574))*
fTolerance) &&
2986 (omega->Angle(negpion->Vect())) < ((5.94216*(TMath::Exp(-0.444428*(omega->Pt()))-0.0574076))*
fTolerance) &&
2987 (omega->Angle(neutpion->Vect())) < ((2.79529*(TMath::Exp(-0.565999*(omega->Pt()))+0.0413576))*
fTolerance) &&
2988 (pospion->Angle(negpion->Vect())) < ((3.14446*(TMath::Exp(-0.666433*(omega->Pt()))+0.0964309))*
fTolerance) &&
2989 (pospion->Angle(neutpion->Vect())) < ((3.08241*(TMath::Exp(-0.650657*(omega->Pt()))+0.0997539))*
fTolerance) &&
2990 (negpion->Angle(neutpion->Vect())) < ((3.18536*(TMath::Exp(-0.752847*(omega->Pt()))+0.1262780))*
fTolerance)
2995 if( (omega->Angle(pospion->Vect())) < ((0.459270*(TMath::Exp(-0.126007*(omega->Pt()))+0.100475))*
fTolerance) &&
2996 (omega->Angle(negpion->Vect())) < ((0.521250*(TMath::Exp(-0.152532*(omega->Pt()))+0.114617))*
fTolerance) &&
2997 (omega->Angle(neutpion->Vect())) < ((0.409766*(TMath::Exp(-0.108566*(omega->Pt()))+0.103594))*
fTolerance) &&
2998 (pospion->Angle(negpion->Vect())) < ((0.709206*(TMath::Exp(-0.149072*(omega->Pt()))+0.111345))*
fTolerance) &&
2999 (pospion->Angle(neutpion->Vect())) < ((0.662184*(TMath::Exp(-0.123397*(omega->Pt()))+0.104675))*
fTolerance) &&
3000 (negpion->Angle(neutpion->Vect())) < ((0.730228*(TMath::Exp(-0.120859*(omega->Pt()))+0.105522))*
fTolerance)
3015 Bool_t isSameMotherPiPlPiMiPiZero = kFALSE;
3016 Bool_t isSameMotherPiPlPiMi = kFALSE;
3017 Bool_t isSameMotherPiPlPiZero = kFALSE;
3018 Bool_t isSameMotherPiMiPiZero = kFALSE;
3019 Bool_t isNoSameMother = kFALSE;
3020 Bool_t isNoPiPiPi = kFALSE;
3024 Int_t virtualParticleMotherLabel = -1;
3030 if ( !(trueMesonFlag == 1 && pi0MCLabel != -1)){
3034 Int_t pi0MotherLabel =
fMCEvent->Particle(pi0MCLabel)->GetMother(0);
3039 Int_t posMotherLabelMC = positiveMC->GetMother(0);
3040 Int_t negMotherLabelMC = negativeMC->GetMother(0);
3043 if((TMath::Abs(negativeMC->GetPdgCode())==211) && (TMath::Abs(positiveMC->GetPdgCode())==211) && (
fMCEvent->Particle(pi0MCLabel)->GetPdgCode()==111)){
3045 if(virtualParticleMCLabel!=-1){
3047 virtualParticleMotherLabel = virtualParticleMCLabel;
3048 if(virtualParticleMotherLabel==pi0MotherLabel){
3050 if(
fMCEvent->Particle(pi0MotherLabel)->GetStatusCode()!=21) isSameMotherPiPlPiMiPiZero = kTRUE;
3053 if(
fMCEvent->Particle(virtualParticleMotherLabel)->GetStatusCode()!=21) isSameMotherPiPlPiMi = kTRUE;
3056 if(pi0MotherLabel==negMotherLabelMC && negMotherLabelMC != -1){
3058 if(
fMCEvent->Particle(negMotherLabelMC)->GetStatusCode()!=21) isSameMotherPiMiPiZero = kTRUE;
3059 }
else if(pi0MotherLabel==posMotherLabelMC && posMotherLabelMC != -1){
3061 if(
fMCEvent->Particle(posMotherLabelMC)->GetStatusCode()!=21) isSameMotherPiPlPiZero = kTRUE;
3064 isNoSameMother = kTRUE;
3073 if(isSameMotherPiPlPiMiPiZero){
3074 if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 221){
3079 PosPiontmp->SetPxPyPzE(positiveMC->Px(), positiveMC->Py(), positiveMC->Pz(), positiveMC->Energy());
3081 NegPiontmp->SetPxPyPzE(negativeMC->Px(), negativeMC->Py(), negativeMC->Pz(), negativeMC->Energy());
3082 if(!
fDoLightOutput)
fHistoTrueAngleSum[
fiCut]->Fill(mesoncand->Pt(),((PosPiontmp->Angle(mesoncand->Vect()))+(NegPiontmp->Angle(PosPiontmp->Vect()))+(PosPiontmp->Angle(TrueNeutralPionCandidate->Vect()))));
3084 delete PosPiontmp; PosPiontmp = 0x0;
3085 delete NegPiontmp; NegPiontmp = 0x0;
3088 }
else if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 223){
3094 PosPiontmp->SetPxPyPzE(positiveMC->Px(), positiveMC->Py(), positiveMC->Pz(), positiveMC->Energy());
3096 NegPiontmp->SetPxPyPzE(negativeMC->Px(), negativeMC->Py(), negativeMC->Pz(), negativeMC->Energy());
3097 if(!
fDoLightOutput)
fHistoTrueAngleSum[
fiCut]->Fill(mesoncand->Pt(),((PosPiontmp->Angle(mesoncand->Vect()))+(NegPiontmp->Angle(PosPiontmp->Vect()))+(PosPiontmp->Angle(TrueNeutralPionCandidate->Vect()))));
3111 if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 221){
3114 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 223){
3117 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 113){
3120 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 331){
3123 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 310){
3126 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 130){
3142 if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 221){
3145 }
else if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 223){
3148 }
else if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() ==-213){
3151 }
else if(
fMCEvent->Particle(pi0MotherLabel)->GetPdgCode() == 130){
3167 if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 221){
3170 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 223){
3173 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 213) {
3176 }
else if(
fMCEvent->Particle(posMotherLabelMC)->GetPdgCode() == 130) {
3239 Double_t dx = vertex->
fX - fInputEvent->GetPrimaryVertex()->GetX();
3240 Double_t dy = vertex->
fY - fInputEvent->GetPrimaryVertex()->GetY();
3241 Double_t dz = vertex->
fZ - fInputEvent->GetPrimaryVertex()->GetZ();
3251 pi0.SetPdgCode(111);
3256 Int_t signPz = particle->Pz()<0?-1:1;
3258 Double_t pz = signPz*TMath::Sqrt(TMath::Abs(pow(PdgMass,2)-pow(energy,2)+pow(px,2)+pow(py,2)));
3259 particle->SetPxPyPzE(px,py,pz,energy);
3269 if(label<0)
return kFALSE;
3270 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
3271 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
3273 TParticle* mother =
fMCEvent->Particle( motherLabel );
3275 if( mother->GetPdgCode() != 221 )
return kFALSE;
3286 if(label<0)
return kFALSE;
3287 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
3288 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
3290 TParticle* mother =
fMCEvent->Particle( motherLabel );
3292 if( mother->GetPdgCode() != 223 )
return kFALSE;
3303 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
3305 if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223) )
return kFALSE;
3308 TParticle *posPion = 0x0;
3309 TParticle *negPion = 0x0;
3310 TParticle *neutPion = 0x0;
3312 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
3313 if(index<0)
continue;
3314 TParticle* temp = (TParticle*)
fMCEvent->Particle( index );
3316 switch( temp->GetPdgCode() ) {
3328 if( posPion && negPion && neutPion)
return kTRUE;
3338 if(label<0)
return kFALSE;
3339 Int_t motherLabel =
fMCEvent->Particle( label )->GetMother(0);
3340 if( motherLabel < 0 || motherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
3342 TParticle* mother =
fMCEvent->Particle( motherLabel );
3344 if( mother->GetPdgCode() != 111 )
return kFALSE;
3346 Int_t grandMotherLabel = mother->GetMother(0);
3347 if( grandMotherLabel < 0 || grandMotherLabel >=
fMCEvent->GetNumberOfTracks() )
return kFALSE;
3348 TParticle* grandmother =
fMCEvent->Particle( grandMotherLabel );
3357 if(tobechecked > -1)
3359 vector<Int_t>::iterator it;
3360 it = find (vec.begin(), vec.end(), tobechecked);
3361 if (it != vec.end())
return true;
3363 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
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()
Float_t fSamePiPiPiMotherPt
TList * fClusterCandidates
TParticle * GetNegativeMCDaughter(AliMCEvent *mcEvent)
TH2F ** fHistoAngleOmegaPiPlPiMi
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
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
TH2F ** fHistoMotherInvMassPt
TH1F ** fHistoMCConvGammaPt
void ProcessMCParticles()
Int_t GetMCLabelNegative() const
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
void ProcessNeutralPionCandidatesPureConversions()
AliGammaConversionMotherAODVector * GetBGGoodMesons(Int_t zbin, Int_t mbin, Int_t event)
void ProcessPionCandidates()
TH2F ** fHistoAngleOmegaPiZero
void ProcessNeutralPionCandidatesMixedConvCalo()
TH1F ** fHistoMCEtaPiPlPiMiPiZeroInAccPt
vector< Int_t > fVectorDoubleCountTrueConvGammas
vector containing labels of validated omega
Class handling all kinds of selection cuts for Gamma Conversion analysis.
TH2F ** fHistoDoubleCountTrueEtaInvMassPt
array of histos with double counted pi0s, invMass, pT
void SetNCaloPhotonMCLabels(Int_t nLabels)
TClonesArray * GetReconstructedGammas() const
AliPrimaryPionCuts * GetPrimaryPionCuts()
TH2F ** fHistoDoubleCountTrueOmegaInvMassPt
array of histos with double counted etas, invMass, pT
TH2F ** fHistoMotherInvMassSubPi0
TH2F ** fHistoTruePiPlPiZeroSameMotherFromRhoInvMassPt
Bool_t KinematicCut(AliAODConversionMother *negpion, AliAODConversionMother *pospion, AliAODConversionMother *neutpion, AliAODConversionMother *omega)
TClonesArray * fReaderGammas
Class handling all kinds of selection cuts for Gamma Conversion analysis.
TH2F ** fHistoAngleOmegaPiMi
Double_t GetProductionY() const
TH1F ** fHistoTrueConvGammaFromNeutralMesonPt
vector< Int_t > fSelectorPosPionIndex
AliConvEventCuts * GetEventCuts()
AliV0ReaderV1 * fV0Reader
Int_t GetMultiplicityBinIndex(Int_t mult) const
TH1F ** fHistoTrueNegPionPt
void MoveParticleAccordingToVertex(AliAODConversionMother *particle, const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex)
TH2F ** fHistoSPDClusterTrackletBackground
TH2F ** fHistoTruePiPlPiMiSameMotherFromOmegaInvMassPt
TH2F ** fHistoDoubleCountTruePi0InvMassPt
void ProcessTrueConversionPhotonCandidates(AliAODConversionPhoton *)
TH1F ** fHistoTrueClusterGammaFromNeutralMesonPt
TH1F ** fHistoTrueClusterGammaPt
void ProcessTrueNeutralPionCandidatesMixedConvCalo(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
AliPrimaryPionSelector * fPionSelector
TH2F ** fHistoTruePiPlPiMiSameMotherFromRhoInvMassPt
TH2F ** fHistoMotherLikeSignBackInvMassSubPi0Pt
Bool_t IsEtaPiPlPiMiPiZeroDaughter(Int_t label) const
vector< Int_t > GetReconstructedNegPionIndex()
TList * fGoodVirtualParticles
Long_t GetCaloClusterRef() const
TH2F ** fHistoAnglePiPlPiMi
TH1F ** fHistoMCEtaPiPlPiMiPiZeroPt
void CalculateDistanceOfClossetApproachToPrimVtx(const AliVVertex *primVertex)
Bool_t CheckVectorForDoubleCount(vector< Int_t > &vec, Int_t tobechecked)
Bool_t IsLargestComponentPhoton()
TH2F ** fHistoNegPionClsTPC
AliGammaConversionAODBGHandler ** fBGHandlerPiPl
void CalculateBackground()
Double_t GetConversionRadius() const
AliGammaConversionAODBGHandler ** fBGHandlerPiMi
void ProcessTrueNeutralPionCandidatesPureConversionsAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero()
TH1F ** fHistoMCOmegaPiPlPiMiPiZeroInAccPt
TList * fNegPionCandidates
Float_t fSamePiPiPiMotherInvMass