29 #include "THnSparse.h"
32 #include "AliAnalysisTask.h"
33 #include "AliAnalysisManager.h"
34 #include "AliESDEvent.h"
35 #include "AliESDInputHandler.h"
36 #include "AliMCEventHandler.h"
37 #include "AliMCEvent.h"
38 #include "AliMCParticle.h"
39 #include "AliCentrality.h"
40 #include "AliESDVZERO.h"
41 #include "AliESDpid.h"
43 #include "AliVParticle.h"
44 #include "AliESDtrack.h"
45 #include "AliESDtrackCuts.h"
46 #include "AliKFVertex.h"
47 #include "AliGenCocktailEventHeader.h"
49 #include "AliAODMCParticle.h"
50 #include "AliAODMCHeader.h"
51 #include "AliEventplane.h"
53 #include "AliAODEvent.h"
54 #include "AliAODInputHandler.h"
55 #include "AliESDEvent.h"
56 #include "AliESDInputHandler.h"
57 #include "AliInputEventHandler.h"
67 fV0ReaderName("V0ReaderV1"),
77 fClusterOutputList(NULL),
78 fOutputContainer(NULL),
80 fGammaCandidates(NULL),
81 fClusterCandidates(NULL),
86 fConversionCuts(NULL),
87 fClusterCutArray(NULL),
88 fCaloPhotonCuts(NULL),
89 fNeutralPionCutArray(NULL),
91 fHistoConvGammaPt(NULL),
92 fHistoConvGammaR(NULL),
93 fHistoConvGammaEta(NULL),
94 fHistoPhotonPairInvMassPt(NULL),
95 fHistoPhotonPairMatchedInvMassPt(NULL),
96 fHistoPhotonPairYPt(NULL),
97 fHistoPhotonPairAlphaPt(NULL),
98 fHistoPhotonPairOpenAnglePt(NULL),
99 fHistoPhotonPairEtaPhi(NULL),
100 fHistoMotherConvPhotonEtaPhi(NULL),
101 fHistoMotherInvMassPt(NULL),
102 fHistoMotherMatchedInvMassPt(NULL),
103 fHistoMotherAngleCutRejectedInvMassPt(NULL),
104 fHistoMotherYPt(NULL),
105 fHistoMotherAlphaPt(NULL),
106 fHistoMotherEtaPhi(NULL),
107 fHistoMotherPi0AnglePt(NULL),
108 fHistoMotherGammaAnglePt(NULL),
109 fHistoPi0GammaAnglePt(NULL),
110 fHistoGammaFromMotherPt(NULL),
111 fHistoDiffPi0SameGammaBackInvMassPt(NULL),
112 fHistoSamePi0DiffGammaBackInvMassPt(NULL),
113 fHistoClusGammaPt(NULL),
114 fHistoClusOverlapHeadersGammaPt(NULL),
115 fHistoMCAllGammaPt(NULL),
116 fHistoMCAllGammaEMCALAccPt(NULL),
117 fHistoMCConvGammaPt(NULL),
118 fHistoMCConvGammaR(NULL),
119 fHistoMCConvGammaEta(NULL),
121 fHistoMCPi0WOWeightPt(NULL),
122 fHistoMCPi0WOEvtWeightPt(NULL),
123 fHistoMCPi0InAccPt(NULL),
124 fHistoMCPi0WOWeightInAccPt(NULL),
125 fHistoMCPi0PtY(NULL),
126 fHistoMCPi0PtAlpha(NULL),
127 fHistoMCPi0PtJetPt(NULL),
128 fHistoMCGammaFromAllOmegaPt(NULL),
129 fHistoMCGammaFromOmegaInAccPt(NULL),
130 fHistoMCOmegaInAccInvMassPt(NULL),
131 fHistoMCOmegaInvMassPt(NULL),
132 fHistoMCAllOmegaYPt(NULL),
133 fHistoMCOmegaInAccYPt(NULL),
134 fHistoMCAllOmegaInvMassPt(NULL),
135 fHistoMCAllOmegaAlphaPt(NULL),
136 fHistoMCOmegaInAccAlphaPt(NULL),
137 fHistoMCPi0FromAllOmegaAlphaPt(NULL),
138 fHistoMCPi0FromOmegaInAccAlphaPt(NULL),
139 fHistoMCPi0FromAllOmegaYPt(NULL),
140 fHistoMCPi0FromOmegaInAccYPt(NULL),
141 fHistoMCPi0FromAllOmegaEtaPhi(NULL),
142 fHistoMCPi0FromOmegaInAccEtaPhi(NULL),
143 fHistoMCPi0FromAllOmegaInvMassPt(NULL),
144 fHistoMCPi0FromOmegaInAccInvMassPt(NULL),
145 fHistoMCAllOmegaEtaPhi(NULL),
146 fHistoMCOmegaInAccEtaPhi(NULL),
147 fHistoMCAllOmegaPiZeroAnglePt(NULL),
148 fHistoMCAllPiZeroGammaAnglePt(NULL),
149 fHistoMCAllOmegaGammaAnglePt(NULL),
150 fHistoMCInAccOmegaPiZeroAnglePt(NULL),
151 fHistoMCInAccPiZeroGammaAnglePt(NULL),
152 fHistoMCInAccOmegaGammaAnglePt(NULL),
153 fHistoMCAllOmegaPtPi0Pt(NULL),
154 fHistoMCInAccOmegaPtPi0Pt(NULL),
155 fHistoMCAllOmegaPtGammaPt(NULL),
156 fHistoMCInAccOmegaPtGammaPt(NULL),
157 fHistoTrueOmegaInvMassPt(NULL),
158 fHistoTruePi0FromOmegaInvMassPt(NULL),
159 fHistoTruePi0FromOmegaAlphaPt(NULL),
160 fHistoTruePi0FromOmegaYPt(NULL),
161 fHistoTruePi0FromOmegaEtaPhi(NULL),
162 fHistoTruePi0FromOmegaOpenAnglePt(NULL),
163 fHistoTrueOmegaPi0AnglePt(NULL),
164 fHistoTrueOmegaGammaAnglePt(NULL),
165 fHistoTruePi0GammaAnglePt(NULL),
166 fHistoTrueOmegaYPt(NULL),
167 fHistoTrueOmegaAlphaPt(NULL),
168 fHistoTrueOmegaEtaPhi(NULL),
169 fHistoTrueOmegaPtPi0Pt(NULL),
170 fHistoTrueOmegaPtGammaPt(NULL),
171 fHistoTrueGammaFromOmegaPt(NULL),
172 fVectorRecTruePi0s(0),
173 fVectorDoubleCountTruePi0s(0),
174 fHistoMultipleCountTruePi0(NULL),
175 fMapMultipleCountTruePi0s(),
177 fHistoNEventsMinGamma(NULL),
178 fHistoMCOmegaDecayChannels(NULL),
179 fHistoNEventsWOWeight(NULL),
180 fHistoNGoodESDTracks(NULL),
182 fHistoNGammaCandidates(NULL),
183 fHistoNClusterCandidates(NULL),
184 fHistoNGoodESDTracksVsNGammaCandidates(NULL),
185 fHistoSPDClusterTrackletBackground(NULL),
186 fHistoNV0Tracks(NULL),
187 fProfileEtaShift(NULL),
188 fProfileJetJetXSection(NULL),
189 fHistoJetJetNTrials(NULL),
190 fEventPlaneAngle(-100),
191 fNGammaCandidates(0),
202 fMoveParticleAccordingToVertex(kTRUE),
206 fIsFromMBHeader(kTRUE),
207 fIsOverlappingWithOtherHeader(kFALSE),
209 fSetPlotHistsExtQA(kFALSE),
211 fEnableSortForClusMC(kFALSE),
217 fDoPiZeroGammaAngleCut(kFALSE)
226 fV0ReaderName(
"V0ReaderV1"),
228 fBGClusHandler(NULL),
236 fClusterOutputList(NULL),
239 fGammaCandidates(NULL),
240 fClusterCandidates(NULL),
241 fPi0Candidates(NULL),
242 fEventCutArray(NULL),
245 fConversionCuts(NULL),
246 fClusterCutArray(NULL),
247 fCaloPhotonCuts(NULL),
248 fNeutralPionCutArray(NULL),
249 fMesonCutArray(NULL),
250 fHistoConvGammaPt(NULL),
251 fHistoConvGammaR(NULL),
252 fHistoConvGammaEta(NULL),
253 fHistoPhotonPairInvMassPt(NULL),
254 fHistoPhotonPairMatchedInvMassPt(NULL),
255 fHistoPhotonPairYPt(NULL),
256 fHistoPhotonPairAlphaPt(NULL),
257 fHistoPhotonPairOpenAnglePt(NULL),
258 fHistoPhotonPairEtaPhi(NULL),
259 fHistoMotherConvPhotonEtaPhi(NULL),
260 fHistoMotherInvMassPt(NULL),
261 fHistoMotherMatchedInvMassPt(NULL),
262 fHistoMotherAngleCutRejectedInvMassPt(NULL),
263 fHistoMotherYPt(NULL),
264 fHistoMotherAlphaPt(NULL),
265 fHistoMotherEtaPhi(NULL),
266 fHistoMotherPi0AnglePt(NULL),
267 fHistoMotherGammaAnglePt(NULL),
268 fHistoPi0GammaAnglePt(NULL),
269 fHistoGammaFromMotherPt(NULL),
270 fHistoDiffPi0SameGammaBackInvMassPt(NULL),
271 fHistoSamePi0DiffGammaBackInvMassPt(NULL),
272 fHistoClusGammaPt(NULL),
273 fHistoClusOverlapHeadersGammaPt(NULL),
274 fHistoMCAllGammaPt(NULL),
275 fHistoMCAllGammaEMCALAccPt(NULL),
276 fHistoMCConvGammaPt(NULL),
277 fHistoMCConvGammaR(NULL),
278 fHistoMCConvGammaEta(NULL),
280 fHistoMCPi0WOWeightPt(NULL),
281 fHistoMCPi0WOEvtWeightPt(NULL),
282 fHistoMCPi0InAccPt(NULL),
283 fHistoMCPi0WOWeightInAccPt(NULL),
284 fHistoMCPi0PtY(NULL),
285 fHistoMCPi0PtAlpha(NULL),
286 fHistoMCPi0PtJetPt(NULL),
287 fHistoMCGammaFromAllOmegaPt(NULL),
288 fHistoMCGammaFromOmegaInAccPt(NULL),
289 fHistoMCPi0FromAllOmegaInvMassPt(NULL),
290 fHistoMCAllOmegaYPt(NULL),
291 fHistoMCOmegaInAccYPt(NULL),
292 fHistoMCAllOmegaInvMassPt(NULL),
293 fHistoMCOmegaInvMassPt(NULL),
294 fHistoMCOmegaInAccInvMassPt(NULL),
295 fHistoMCAllOmegaAlphaPt(NULL),
296 fHistoMCOmegaInAccAlphaPt(NULL),
297 fHistoMCPi0FromAllOmegaAlphaPt(NULL),
298 fHistoMCPi0FromOmegaInAccAlphaPt(NULL),
299 fHistoMCPi0FromOmegaInAccInvMassPt(NULL),
300 fHistoMCPi0FromAllOmegaYPt(NULL),
301 fHistoMCPi0FromOmegaInAccYPt(NULL),
302 fHistoMCPi0FromAllOmegaEtaPhi(NULL),
303 fHistoMCPi0FromOmegaInAccEtaPhi(NULL),
304 fHistoMCOmegaInAccEtaPhi(NULL),
305 fHistoMCAllOmegaEtaPhi(NULL),
306 fHistoMCAllOmegaPiZeroAnglePt(NULL),
307 fHistoMCAllPiZeroGammaAnglePt(NULL),
308 fHistoMCAllOmegaGammaAnglePt(NULL),
309 fHistoMCInAccOmegaPiZeroAnglePt(NULL),
310 fHistoMCInAccPiZeroGammaAnglePt(NULL),
311 fHistoMCInAccOmegaGammaAnglePt(NULL),
312 fHistoMCAllOmegaPtPi0Pt(NULL),
313 fHistoMCInAccOmegaPtPi0Pt(NULL),
314 fHistoMCAllOmegaPtGammaPt(NULL),
315 fHistoMCInAccOmegaPtGammaPt(NULL),
316 fHistoTrueOmegaInvMassPt(NULL),
317 fHistoTrueOmegaYPt(NULL),
318 fHistoTrueOmegaAlphaPt(NULL),
319 fHistoTruePi0FromOmegaInvMassPt(NULL),
320 fHistoTruePi0FromOmegaAlphaPt(NULL),
321 fHistoTruePi0FromOmegaYPt(NULL),
322 fHistoTruePi0FromOmegaEtaPhi(NULL),
323 fHistoTruePi0FromOmegaOpenAnglePt(NULL),
324 fHistoTrueOmegaPi0AnglePt(NULL),
325 fHistoTrueOmegaGammaAnglePt(NULL),
326 fHistoTruePi0GammaAnglePt(NULL),
327 fHistoTrueOmegaEtaPhi(NULL),
328 fHistoTrueOmegaPtPi0Pt(NULL),
329 fHistoTrueOmegaPtGammaPt(NULL),
330 fHistoTrueGammaFromOmegaPt(NULL),
331 fVectorRecTruePi0s(0),
332 fVectorDoubleCountTruePi0s(0),
333 fHistoMultipleCountTruePi0(NULL),
334 fMapMultipleCountTruePi0s(),
336 fHistoNEventsMinGamma(NULL),
337 fHistoMCOmegaDecayChannels(NULL),
338 fHistoNEventsWOWeight(NULL),
339 fHistoNGoodESDTracks(NULL),
341 fHistoNGammaCandidates(NULL),
342 fHistoNClusterCandidates(NULL),
343 fHistoNGoodESDTracksVsNGammaCandidates(NULL),
344 fHistoSPDClusterTrackletBackground(NULL),
345 fHistoNV0Tracks(NULL),
346 fProfileEtaShift(NULL),
347 fProfileJetJetXSection(NULL),
348 fHistoJetJetNTrials(NULL),
349 fEventPlaneAngle(-100),
350 fNGammaCandidates(0),
361 fMoveParticleAccordingToVertex(kTRUE),
365 fIsFromMBHeader(kTRUE),
366 fIsOverlappingWithOtherHeader(kFALSE),
368 fSetPlotHistsExtQA(kFALSE),
370 fEnableSortForClusMC(kFALSE),
376 fDoPiZeroGammaAngleCut(kFALSE)
379 DefineOutput(1, TList::Class());
427 if(collisionSystem == 1 || collisionSystem == 2 ||
428 collisionSystem == 5 || collisionSystem == 8 ||
429 collisionSystem == 9){
430 centMin = centMin*10;
431 centMax = centMax*10;
432 if(centMax ==0 && centMax!=centMin) centMax=100;
433 }
else if(collisionSystem == 3 || collisionSystem == 6){
436 }
else if(collisionSystem == 4 || collisionSystem == 7){
437 centMin = ((centMin*5)+45);
438 centMax = ((centMax*5)+45);
442 collisionSystem,centMin,centMax,
447 collisionSystem,centMin,centMax,
452 collisionSystem,centMin,centMax,
468 fmaxfit =
new TF1(
"maxfit",
"4.99209 / pow(x + 1.34075, 1.65) + 0.0568024");
564 fCutFolder[iCut]->SetName(Form(
"Cut Number %s_%s_%s_%s_%s",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringNeutralPion.Data(),cutstringMeson.Data()));
568 fESDList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s ESD histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringNeutralPion.Data(),cutstringMeson.Data()));
572 fHistoNEvents[iCut] =
new TH1F(
"NEvents",
"NEvents",14,-0.5,13.5);
574 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,
"Centrality");
575 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,
"Miss. MC or inc. ev.");
577 TString TriggerNames =
"Not Trigger: ";
579 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
584 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,
"Cont. Vertex");
588 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,
"EMCAL problem");
589 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(11,
"rejectedForJetJetMC");
590 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,
"SPD hits vs tracklet");
591 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,
"Out-of-Bunch pileup Past-Future");
592 fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,
"Pileup V0M-TPCout Tracks");
608 TString TriggerNames =
"Not Trigger: ";
644 fHistoVertexZ[iCut] =
new TH1F(
"VertexZ",
"VertexZ",1000,-50,50);
674 fHistoNV0Tracks[iCut] =
new TH1F(
"V0 Multiplicity",
"V0 Multiplicity",30000,0,30000);
676 fHistoNV0Tracks[iCut] =
new TH1F(
"V0 Multiplicity",
"V0 Multiplicity",2500,0,2500);
678 fHistoNV0Tracks[iCut] =
new TH1F(
"V0 Multiplicity",
"V0 Multiplicity",1500,0,1500);
682 fHistoConvGammaPt[iCut] =
new TH1F(
"ESD_ConvGamma_Pt",
"ESD_ConvGamma_Pt",500,0,50);
705 fHistoConvGammaR[iCut] =
new TH1F(
"ESD_ConvGamma_R",
"ESD_ConvGamma_R",800,0,200);
708 fHistoConvGammaEta[iCut] =
new TH1F(
"ESD_ConvGamma_Eta",
"ESD_ConvGamma_Eta",2000,-2,2);
715 fClusterOutputList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s Cluster Output",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringNeutralPion.Data(),cutstringMeson.Data()));
819 fHistoMotherYPt[iCut] =
new TH2F(
"ESD_Mother_Y_Pt",
"ESD_Mother_Y_Pt",200,0,20,150,-1.5,1.5);
829 fHistoMotherEtaPhi[iCut] =
new TH2F(
"ESD_Mother_Eta_Phi",
"ESD_Mother_Eta_Phi",600,0,2*TMath::Pi(),200,-1,1);
956 fMCList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s MC histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringNeutralPion.Data(),cutstringMeson.Data()));
957 fMCList[iCut]->SetOwner(kTRUE);
980 fHistoMCPi0Pt[iCut] =
new TH1F(
"MC_Pi0_Pt",
"MC_Pi0_Pt",200,0,20);
1142 fHistoMCPi0PtY[iCut] =
new TH2F(
"MC_Pi0_Pt_Y",
"MC_Pi0_Pt_Y",300,0.03,30.,150,-1.5,1.5);
1201 fTrueList[iCut]->SetName(Form(
"%s_%s_%s_%s_%s True histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringNeutralPion.Data(),cutstringMeson.Data()));
1316 if(!
fV0Reader){printf(
"Error: No V0 Reader");
return;}
1331 for(
Int_t iMatcherTask = 0; iMatcherTask < 3; iMatcherTask++){
1388 printf(
" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
1409 if(
fInputEvent->IsIncompleteDAQ()==kTRUE) eventQuality = 2;
1411 if(eventQuality == 2 || eventQuality == 3){
1426 AliEventplane *EventPlane =
fInputEvent->GetEventplane();
1441 Bool_t isRunningEMCALrelAna = kFALSE;
1450 if((xsection==-1.) || (ntrials==-1.)) AliFatal(Form(
"ERROR: GetXSectionAndNTrials returned invalid xsection/ntrials, periodName from V0Reader: '%s'",
fV0Reader->
GetPeriodName().Data()));
1471 Bool_t triggered = kTRUE;
1473 if(eventNotAccepted!= 0){
1477 if (eventNotAccepted==3 &&
fIsMC > 0){
1484 if(eventQuality != 0){
1491 if (triggered==kTRUE){
1510 else if(
fInputEvent->IsA()==AliAODEvent::Class()){
1524 if (triggered==kFALSE)
continue;
1606 if(nclus == 0)
return;
1618 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1621 for(
Int_t i = 0; i < nclus; i++){
1622 AliVCluster* clus = NULL;
1623 if(
fInputEvent->IsA()==AliESDEvent::Class()) clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)
fInputEvent->GetCaloCluster(i));
1624 else if(
fInputEvent->IsA()==AliAODEvent::Class()) clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)
fInputEvent->GetCaloCluster(i));
1626 if (!clus)
continue;
1630 TLorentzVector clusterVector;
1631 clus->GetMomentum(clusterVector,vertex);
1633 TLorentzVector* tmpvec =
new TLorentzVector();
1634 tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
1638 if(!PhotonCandidate){
delete clus;
delete tmpvec;
continue;}
1645 Int_t* mclabelsCluster = clus->GetLabels();
1648 if (clus->GetNLabels()>0){
1649 for (
Int_t k =0; k<(
Int_t)clus->GetNLabels(); k++){
1665 if (clus->GetNLabels()>1){
1666 Int_t* mclabelsCluster = clus->GetLabels();
1667 for (
Int_t l = 1; l < (
Int_t)clus->GetNLabels(); l++ ){
1689 delete PhotonCandidate;
1701 TParticle *Photon = NULL;
1702 if (!TruePhotonCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
1721 AliAODMCParticle *Photon = NULL;
1722 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1723 if (AODMCTrackArray){
1724 if (!TruePhotonCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
1728 AliInfo(
"AODMCTrackArray could not be loaded");
1751 if(!PhotonCandidate)
continue;
1758 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1784 GammaCandidatesStepOne->Add(PhotonCandidate);
1787 GammaCandidatesStepTwo->Add(PhotonCandidate);
1791 for(
Int_t i = 0;i<GammaCandidatesStepOne->GetEntries();i++){
1793 if(!PhotonCandidate)
continue;
1798 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1816 }
else GammaCandidatesStepTwo->Add(PhotonCandidate);
1820 for(
Int_t i = 0;i<GammaCandidatesStepTwo->GetEntries();i++){
1822 if(!PhotonCandidate)
continue;
1827 if( (isNegFromMBHeader+isPosFromMBHeader) != 4)
fIsFromMBHeader = kFALSE;
1847 delete GammaCandidatesStepOne;
1848 GammaCandidatesStepOne = 0x0;
1849 delete GammaCandidatesStepTwo;
1850 GammaCandidatesStepTwo = 0x0;
1857 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1858 if (AODMCTrackArray == NULL)
return;
1859 AliAODMCParticle *posDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->
GetMCLabelPositive());
1860 AliAODMCParticle *negDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->
GetMCLabelNegative());
1862 if(posDaughter == NULL || negDaughter == NULL)
return;
1863 Int_t pdgCode[2] = {TMath::Abs(posDaughter->GetPdgCode()),TMath::Abs(negDaughter->GetPdgCode())};
1865 if(posDaughter->GetMother() != negDaughter->GetMother())
return;
1867 else if(posDaughter->GetMother() == -1)
return;
1869 if(pdgCode[0]!=11 || pdgCode[1]!=11)
return;
1871 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode())
return;
1873 AliAODMCParticle *Photon = (AliAODMCParticle*) AODMCTrackArray->At(posDaughter->GetMother());
1874 if(Photon->GetPdgCode() != 22)
return;
1876 if(((posDaughter->GetMCProcessCode())) != 5 || ((negDaughter->GetMCProcessCode())) != 5)
return;
1888 if(posDaughter == NULL || negDaughter == NULL)
return;
1889 Int_t pdgCode[2] = {TMath::Abs(posDaughter->GetPdgCode()),TMath::Abs(negDaughter->GetPdgCode())};
1890 if(posDaughter->GetMother(0) != negDaughter->GetMother(0))
return;
1891 else if(posDaughter->GetMother(0) == -1)
return;
1893 if(pdgCode[0]!=11 || pdgCode[1]!=11)
return;
1895 if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode())
return;
1899 if(Photon->GetPdgCode() != 22){
1903 if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5)
return;
1912 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
1913 Double_t mcProdVtxX = primVtxMC->GetX();
1914 Double_t mcProdVtxY = primVtxMC->GetY();
1915 Double_t mcProdVtxZ = primVtxMC->GetZ();
1917 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1918 if (AODMCTrackArray == NULL)
return;
1921 for(Long_t i = 0; i < AODMCTrackArray->GetEntriesFast(); i++) {
1923 AliAODMCParticle* particle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(i));
1924 if (!particle)
continue;
1927 if (!isPrimary)
continue;
1929 Int_t isMCFromMBHeader = -1;
1938 if (TMath::Abs(particle->Eta()) < 0.66 ){
1944 for(
Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
1945 AliAODMCParticle *tmpDaughter =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(daughterIndex));
1946 if(!tmpDaughter)
continue;
1947 if(TMath::Abs(tmpDaughter->GetPdgCode()) == 11){
1948 rConv = sqrt( (tmpDaughter->Xv()*tmpDaughter->Xv()) + (tmpDaughter->Yv()*tmpDaughter->Yv()) );
1960 AliAODMCParticle* daughter0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(particle->GetDaughter(0)));
1961 AliAODMCParticle* daughter1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(particle->GetDaughter(1)));
1964 if (particle->Pt()>0.005){
1972 if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){
1979 if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
1980 alpha = (daughter0->E() - daughter1->E())/(daughter0->E() + daughter1->E());
1984 if(particle->GetPdgCode() == 111){
2003 if(particle->GetPdgCode() == 111){
2016 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2017 Double_t mcProdVtxX = primVtxMC->GetX();
2018 Double_t mcProdVtxY = primVtxMC->GetY();
2019 Double_t mcProdVtxZ = primVtxMC->GetZ();
2026 TParticle* particle = (TParticle *)
fMCEvent->Particle(i);
2027 if (!particle)
continue;
2030 if(particle->GetPdgCode() == 223){
2032 Bool_t DecaysToPiPlPiMiPiZero = kFALSE;
2034 TParticle *posPion = 0x0;
2035 TParticle *negPion = 0x0;
2036 TParticle *neutPion = 0x0;
2038 for(
Int_t index= particle->GetFirstDaughter();index <= particle->GetLastDaughter();index++){
2039 if(index < 0)
continue;
2041 TParticle *temp = (TParticle*)
fMCEvent->Particle(index);
2043 switch(temp->GetPdgCode()) {
2056 if(posPion && negPion && neutPion) DecaysToPiPlPiMiPiZero = kTRUE;
2058 if(DecaysToPiPlPiMiPiZero){
2060 }
else if (particle->GetNDaughters()==2){
2061 TParticle *gamma2 = 0x0;
2062 TParticle *pi0 = 0x0;
2064 for(
Int_t index = particle->GetFirstDaughter();index <= particle->GetLastDaughter();index++){
2065 if(index < 0)
continue;
2067 TParticle *temp = (TParticle*)
fMCEvent->Particle(index);
2068 switch(temp->GetPdgCode()){
2089 Double_t alpha = (pi0->Energy() - gamma2->Energy())/(pi0->Energy() + gamma2->Energy());
2093 if(pi0->Energy() - pi0->Pz() == 0 || pi0->Energy() + pi0->Pz() == 0){
2101 if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){
2111 TVector3 omegavector = TVector3(particle->Px(),particle->Py(),particle->Pz());
2112 TVector3 pi0vector = TVector3(pi0->Px(),pi0->Py(),pi0->Pz());
2113 TVector3 gamma2vector = TVector3(gamma2->Px(),gamma2->Py(),gamma2->Pz());
2119 if (pi0->GetNDaughters()==2 && pi0->GetFirstDaughter()>-1 && pi0->GetLastDaughter()>-1){
2120 TParticle *gamma0 = (TParticle*)
fMCEvent->Particle(pi0->GetFirstDaughter());
2121 TParticle *gamma1 = (TParticle*)
fMCEvent->Particle(pi0->GetLastDaughter());
2122 if (gamma0->GetPdgCode()==22 && gamma1->GetPdgCode()==22){
2125 Double_t pi0alpha = (gamma0->Energy() - gamma1->Energy())/(gamma0->Energy() + gamma1->Energy());
2139 Int_t labelNeutPion = -1;
2140 Int_t labelGamma = -1;
2144 if (labelNeutPion > -1 && labelGamma > -1){
2145 TParticle *neutPion =
fMCEvent->Particle(labelNeutPion);
2150 if (neutPion->GetNDaughters()==2 && neutPion->GetFirstDaughter()>-1 && neutPion->GetLastDaughter()>-1){
2152 TParticle *gamma0 = (TParticle*)
fMCEvent->Particle(neutPion->GetFirstDaughter());
2153 TParticle *gamma1 = (TParticle*)
fMCEvent->Particle(neutPion->GetLastDaughter());
2154 TParticle *gamma2 = (TParticle*)
fMCEvent->Particle(labelGamma);
2156 Bool_t InAcceptance = kFALSE;
2164 InAcceptance = kTRUE;
2169 InAcceptance = kTRUE;
2177 InAcceptance = kTRUE;
2187 InAcceptance = kTRUE;
2192 InAcceptance = kTRUE;
2200 InAcceptance = kTRUE;
2213 TVector3 omegavector = TVector3(particle->Px(),particle->Py(),particle->Pz());
2214 TVector3 pi0vector = TVector3(neutPion->Px(),neutPion->Py(),neutPion->Pz());
2215 TVector3 gamma2vector = TVector3(gamma2->Px(),gamma2->Py(),gamma2->Pz());
2217 Double_t OmegaPiZeroAngle = TMath::Pi() - pi0vector.Angle(omegavector);
2218 Double_t PiZeroGammaAngle = pi0vector.Angle(gamma2vector);
2219 Double_t OmegaGammaAngle = TMath::Pi() - omegavector.Angle(gamma2vector);
2222 if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){
2228 if(neutPion->Energy() - neutPion->Pz() == 0 || neutPion->Energy() + neutPion->Pz() == 0){
2234 Double_t OmegaAlpha = (neutPion->Energy() - gamma2->Energy())/(neutPion->Energy() + gamma2->Energy());
2235 Double_t Pi0Alpha = (gamma0->Energy() - gamma1->Energy())/(gamma0->Energy() + gamma1->Energy());
2257 if (TMath::Abs(particle->Eta()) < 0.66 ){
2263 if (
fDoPhotonQA > 0 && particle->GetFirstDaughter()>-1){
2270 if(particle->GetFirstDaughter()>-1 && particle->GetLastDaughter()>-1){
2271 TParticle* daughter0 = (TParticle*)
fMCEvent->Particle(particle->GetFirstDaughter());
2272 TParticle* daughter1 = (TParticle*)
fMCEvent->Particle(particle->GetLastDaughter());
2276 if (particle->Pt()>0.005){
2284 if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){
2291 if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
2292 alpha = (daughter0->Energy() - daughter1->Energy())/(daughter0->Energy() + daughter1->Energy());
2295 if(particle->GetPdgCode() == 111){
2308 Bool_t InAcceptance = kFALSE;
2311 if( kDaughter0IsPrim && kDaughter1IsPrim &&
2317 InAcceptance = kTRUE;
2323 InAcceptance = kTRUE;
2328 InAcceptance = kTRUE;
2333 if(particle->GetPdgCode() == 111){
2353 if (gamma0==NULL)
continue;
2373 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2383 if (thirdGammaIndex==secondGammaIndex)
continue;
2384 Bool_t matchedgamma2wconvgamma = kFALSE;
2390 if (matchedgamma2wconvgamma){
2404 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2437 if (gamma0==NULL)
continue;
2459 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2469 if (thirdGammaIndex==firstGammaIndex)
continue;
2470 Bool_t matchedgamma1wconvgamma2 = kFALSE;
2472 if (gamma2==NULL)
continue;
2475 if (matchedgamma1wconvgamma2){
2489 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2524 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fClusterCandidates->GetEntries();secondGammaIndex++){
2535 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2544 if (thirdGammaIndex==secondGammaIndex || thirdGammaIndex==firstGammaIndex)
continue;
2556 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2589 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fClusterCandidates->GetEntries();secondGammaIndex++){
2600 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2628 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2660 if(gamma0==NULL)
continue;
2661 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fGammaCandidates->GetEntries();secondGammaIndex++){
2663 if(gamma1==NULL)
continue;
2672 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2701 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2734 if (gamma0==NULL)
continue;
2735 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fGammaCandidates->GetEntries();secondGammaIndex++){
2737 if (gamma1==NULL || (secondGammaIndex+1)>=(
fGammaCandidates->GetEntries()))
continue;
2746 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2755 if (thirdGammaIndex==firstGammaIndex || thirdGammaIndex==secondGammaIndex)
continue;
2757 if (gamma2==NULL)
continue;
2767 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2803 Int_t gamma0MCLabel = -1;
2804 Int_t gamma0MotherLabel = -1;
2807 if(gamma0MCLabel>-1){
2808 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2809 gamma0MotherLabel=gammaMC0->GetFirstMother();
2813 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2815 Int_t gamma1MotherLabel = -1;
2816 TParticle * gammaMC1 = 0x0;
2817 if(gamma1MCLabel != -1){
2819 gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2821 gamma1MotherLabel=gammaMC1->GetMother(0);
2823 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=(
fMCEvent->Particle(gammaMC1->GetMother(0)))->GetMother(0);
2824 else gamma1MotherLabel=gammaMC1->GetMother(0);
2829 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel && ((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetPdgCode() == 111){
2833 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2835 Int_t gamma2MotherLabel = -1;
2836 TParticle * gammaMC2 = 0x0;
2837 if(gamma2MCLabel != -1){
2839 gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
2841 gamma2MotherLabel=gammaMC2->GetMother(0);
2843 if (TrueGammaCandidate2->
IsConversion() && gammaMC2->GetMother(0)>-1) gamma2MotherLabel=
fMCEvent->Particle(gammaMC2->GetMother(0))->GetMother(0);
2844 else gamma2MotherLabel=gammaMC2->GetMother(0);
2849 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
2851 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
2881 Int_t gamma0MCLabel = -1;
2882 Int_t gamma0MotherLabel = -1;
2885 if(gamma0MCLabel>-1){
2886 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2887 gamma0MotherLabel=gammaMC0->GetFirstMother();
2891 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2893 Int_t gamma1MotherLabel = -1;
2894 TParticle * gammaMC1 = 0x0;
2895 if(gamma1MCLabel != -1){
2897 gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2899 gamma1MotherLabel=gammaMC1->GetMother(0);
2901 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2902 else gamma1MotherLabel=gammaMC1->GetMother(0);
2907 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel && ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2912 Int_t gamma2MCLabel = -1;
2913 Int_t gamma2MotherLabel = -1;
2916 if(gamma2MCLabel>-1){
2917 TParticle * gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
2918 gamma2MotherLabel = gammaMC2->GetFirstMother();
2923 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
2925 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
2955 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2957 Int_t gamma0MotherLabel = -1;
2958 TParticle * gammaMC0 = 0x0;
2959 if(gamma0MCLabel != -1){
2961 gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2963 gamma0MotherLabel=gammaMC0->GetMother(0);
2965 if (TrueGammaCandidate0->
IsConversion() && gammaMC0->GetMother(0)>-1) gamma0MotherLabel=
fMCEvent->Particle(gammaMC0->GetMother(0))->GetMother(0);
2966 else gamma0MotherLabel=gammaMC0->GetMother(0);
2971 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2973 Int_t gamma1MotherLabel = -1;
2974 TParticle * gammaMC1 = 0x0;
2975 if(gamma1MCLabel != -1){
2977 gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2979 gamma1MotherLabel=gammaMC1->GetMother(0);
2981 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2982 else gamma1MotherLabel=gammaMC1->GetMother(0);
2987 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel && ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2991 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2993 Int_t gamma2MotherLabel = -1;
2994 TParticle * gammaMC2 = 0x0;
2995 if(gamma2MCLabel != -1){
2997 gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
2999 gamma2MotherLabel=gammaMC2->GetMother(0);
3001 if (TrueGammaCandidate2->
IsConversion() && gammaMC2->GetMother(0)>-1) gamma2MotherLabel=
fMCEvent->Particle(gammaMC2->GetMother(0))->GetMother(0);
3002 else gamma2MotherLabel=gammaMC2->GetMother(0);
3007 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
3009 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
3039 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3041 Int_t gamma0MotherLabel = -1;
3042 TParticle * gammaMC0 = 0x0;
3043 if(gamma0MCLabel != -1){
3045 gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3047 gamma0MotherLabel=gammaMC0->GetMother(0);
3049 if (TrueGammaCandidate0->
IsConversion() && gammaMC0->GetMother(0)>-1) gamma0MotherLabel=
fMCEvent->Particle(gammaMC0->GetMother(0))->GetMother(0);
3050 else gamma0MotherLabel=gammaMC0->GetMother(0);
3055 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3057 Int_t gamma1MotherLabel = -1;
3058 TParticle * gammaMC1 = 0x0;
3059 if(gamma1MCLabel != -1){
3061 gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
3063 gamma1MotherLabel=gammaMC1->GetMother(0);
3065 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
3066 else gamma1MotherLabel=gammaMC1->GetMother(0);
3071 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel && ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
3076 Int_t gamma2MCLabel = -1;
3077 Int_t gamma2MotherLabel = -1;
3080 if(gamma2MCLabel>-1){
3081 TParticle * gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
3082 gamma2MotherLabel = gammaMC2->GetFirstMother();
3087 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
3089 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
3119 Int_t gamma0MCLabel = -1;
3120 Int_t gamma0MotherLabel = -1;
3123 if(gamma0MCLabel>-1){
3124 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3125 gamma0MotherLabel=gammaMC0->GetFirstMother();
3130 Int_t gamma1MCLabel = -1;
3131 Int_t gamma1MotherLabel = -1;
3134 if(gamma1MCLabel>-1){
3135 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
3136 gamma1MotherLabel=gammaMC1->GetFirstMother();
3141 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3142 ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
3146 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3148 Int_t gamma2MotherLabel = -1;
3149 TParticle * gammaMC2 = 0x0;
3150 if(gamma2MCLabel != -1){
3152 gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
3154 gamma2MotherLabel=gammaMC2->GetMother(0);
3156 if (TrueGammaCandidate2->
IsConversion() && gammaMC2->GetMother(0)>-1) gamma2MotherLabel=
fMCEvent->Particle(gammaMC2->GetMother(0))->GetMother(0);
3157 else gamma2MotherLabel=gammaMC2->GetMother(0);
3162 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
3164 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
3194 Int_t gamma0MCLabel = -1;
3195 Int_t gamma0MotherLabel = -1;
3198 if(gamma0MCLabel>-1){
3199 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3200 gamma0MotherLabel=gammaMC0->GetFirstMother();
3205 Int_t gamma1MCLabel = -1;
3206 Int_t gamma1MotherLabel = -1;
3209 if(gamma1MCLabel>-1){
3210 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
3211 gamma1MotherLabel=gammaMC1->GetFirstMother();
3216 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3217 ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
3221 Int_t gamma2MCLabel = -1;
3222 Int_t gamma2MotherLabel = -1;
3225 if(gamma2MCLabel>-1){
3226 TParticle * gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
3227 gamma2MotherLabel=gammaMC2->GetFirstMother();
3232 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
3234 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
3266 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3267 if (AODMCTrackArray == NULL)
return;
3268 Bool_t isTruePi0 = kFALSE;
3269 Bool_t isTrueOmega = kFALSE;
3275 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3276 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3278 Int_t gamma0MCLabel = -1;
3279 Int_t gamma0MotherLabel = -1;
3280 if(!positiveMC||!negativeMC)
3284 gamma0MCLabel = positiveMC->GetMother();
3285 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3286 gamma0MotherLabel=gammaMC0->GetMother();
3289 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3291 Int_t gamma1MotherLabel = -1;
3293 AliAODMCParticle * gammaMC1 = 0x0;
3294 if(gamma1MCLabel != -1){
3295 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3298 gamma1MotherLabel=gammaMC1->GetMother();
3301 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3302 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3303 }
else gamma1MotherLabel=gammaMC1->GetMother();
3307 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3308 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3312 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3313 Int_t pi0MotherLabel = TruePi0->GetMother();
3315 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3317 Int_t gamma2MotherLabel = -1;
3319 AliAODMCParticle * gammaMC2 = 0x0;
3320 if(gamma2MCLabel != -1){
3321 gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3324 gamma2MotherLabel=gammaMC2->GetMother();
3327 AliAODMCParticle * gammaGrandMotherMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC2->GetMother()));
3328 gamma2MotherLabel=gammaGrandMotherMC2->GetMother();
3329 }
else gamma2MotherLabel=gammaMC2->GetMother();
3333 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3334 isTrueOmega = kTRUE;
3346 AliAODMCParticle *positive0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3347 AliAODMCParticle *negative0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3349 Int_t gamma0MCLabel = -1;
3350 Int_t gamma0MotherLabel = -1;
3351 if(!positive0MC||!negative0MC)
3355 gamma0MCLabel = positive0MC->GetMother();
3356 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3357 gamma0MotherLabel=gammaMC0->GetMother();
3360 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3362 Int_t gamma1MotherLabel = -1;
3364 AliAODMCParticle * gammaMC1 = 0x0;
3365 if(gamma1MCLabel != -1){
3366 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3369 gamma1MotherLabel=gammaMC1->GetMother();
3372 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3373 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3374 }
else gamma1MotherLabel=gammaMC1->GetMother();
3378 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3379 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3383 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3384 Int_t pi0MotherLabel = TruePi0->GetMother();
3387 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3388 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3390 Int_t gamma2MCLabel = -1;
3391 Int_t gamma2MotherLabel = -1;
3392 if(!positive2MC||!negative2MC)
3396 gamma2MCLabel = positive2MC->GetMother();
3397 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3398 gamma2MotherLabel=gammaMC2->GetMother();
3401 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3402 isTrueOmega = kTRUE;
3414 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3416 Int_t gamma0MotherLabel = -1;
3418 AliAODMCParticle * gammaMC0 = 0x0;
3419 if(gamma0MCLabel != -1){
3420 gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3423 gamma0MotherLabel=gammaMC0->GetMother();
3426 AliAODMCParticle * gammaGrandMotherMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC0->GetMother()));
3427 gamma0MotherLabel=gammaGrandMotherMC0->GetMother();
3428 }
else gamma0MotherLabel=gammaMC0->GetMother();
3432 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3434 Int_t gamma1MotherLabel = -1;
3436 AliAODMCParticle * gammaMC1 = 0x0;
3437 if(gamma1MCLabel != -1){
3438 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3441 gamma1MotherLabel=gammaMC1->GetMother();
3444 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3445 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3446 }
else gamma1MotherLabel=gammaMC1->GetMother();
3450 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3451 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3455 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3456 Int_t pi0MotherLabel = TruePi0->GetMother();
3458 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3460 Int_t gamma2MotherLabel = -1;
3462 AliAODMCParticle * gammaMC2 = 0x0;
3463 if(gamma2MCLabel != -1){
3464 gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3467 gamma2MotherLabel=gammaMC2->GetMother();
3470 AliAODMCParticle * gammaGrandMotherMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC2->GetMother()));
3471 gamma2MotherLabel=gammaGrandMotherMC2->GetMother();
3472 }
else gamma2MotherLabel=gammaMC2->GetMother();
3476 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3477 isTrueOmega = kTRUE;
3489 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3491 Int_t gamma0MotherLabel = -1;
3493 AliAODMCParticle * gammaMC0 = 0x0;
3494 if(gamma0MCLabel != -1){
3495 gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3498 gamma0MotherLabel=gammaMC0->GetMother();
3501 AliAODMCParticle * gammaGrandMotherMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC0->GetMother()));
3502 gamma0MotherLabel=gammaGrandMotherMC0->GetMother();
3503 }
else gamma0MotherLabel=gammaMC0->GetMother();
3507 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3509 Int_t gamma1MotherLabel = -1;
3511 AliAODMCParticle * gammaMC1 = 0x0;
3512 if(gamma1MCLabel != -1){
3513 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3516 gamma1MotherLabel=gammaMC1->GetMother();
3519 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3520 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3521 }
else gamma1MotherLabel=gammaMC1->GetMother();
3525 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3526 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3530 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3531 Int_t pi0MotherLabel = TruePi0->GetMother();
3534 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3535 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3537 Int_t gamma2MCLabel = -1;
3538 Int_t gamma2MotherLabel = -1;
3539 if(!positive2MC||!negative2MC)
3543 gamma2MCLabel = positive2MC->GetMother();
3544 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3545 gamma2MotherLabel=gammaMC2->GetMother();
3548 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3549 isTrueOmega = kTRUE;
3561 AliAODMCParticle *positive0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3562 AliAODMCParticle *negative0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3564 Int_t gamma0MCLabel = -1;
3565 Int_t gamma0MotherLabel = -1;
3566 if(!positive0MC||!negative0MC)
3570 gamma0MCLabel = positive0MC->GetMother();
3571 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3572 gamma0MotherLabel=gammaMC0->GetMother();
3575 AliAODMCParticle *positive1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelPositive()));
3576 AliAODMCParticle *negative1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelNegative()));
3578 Int_t gamma1MCLabel = -1;
3579 Int_t gamma1MotherLabel = -1;
3580 if(!positive1MC||!negative1MC)
3584 gamma1MCLabel = positive1MC->GetMother();
3585 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3586 gamma1MotherLabel=gammaMC1->GetMother();
3589 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3590 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3594 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3595 Int_t pi0MotherLabel = TruePi0->GetMother();
3597 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3599 Int_t gamma2MotherLabel = -1;
3601 AliAODMCParticle * gammaMC2 = 0x0;
3602 if(gamma2MCLabel != -1){
3603 gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3606 gamma2MotherLabel=gammaMC2->GetMother();
3609 AliAODMCParticle * gammaGrandMotherMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC2->GetMother()));
3610 gamma2MotherLabel=gammaGrandMotherMC2->GetMother();
3611 }
else gamma2MotherLabel=gammaMC2->GetMother();
3615 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3616 isTrueOmega = kTRUE;
3628 AliAODMCParticle *positive0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3629 AliAODMCParticle *negative0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3631 Int_t gamma0MCLabel = -1;
3632 Int_t gamma0MotherLabel = -1;
3633 if(!positive0MC||!negative0MC)
3637 gamma0MCLabel = positive0MC->GetMother();
3638 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3639 gamma0MotherLabel=gammaMC0->GetMother();
3642 AliAODMCParticle *positive1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelPositive()));
3643 AliAODMCParticle *negative1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelNegative()));
3645 Int_t gamma1MCLabel = -1;
3646 Int_t gamma1MotherLabel = -1;
3647 if(!positive1MC||!negative1MC)
3651 gamma1MCLabel = positive1MC->GetMother();
3652 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3653 gamma1MotherLabel=gammaMC1->GetMother();
3656 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3657 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3661 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3662 Int_t pi0MotherLabel = TruePi0->GetMother();
3664 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3665 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3667 Int_t gamma2MCLabel = -1;
3668 Int_t gamma2MotherLabel = -1;
3669 if(!positive2MC||!negative2MC)
3673 gamma2MCLabel = positive2MC->GetMother();
3674 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3675 gamma2MotherLabel=gammaMC2->GetMother();
3678 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3679 isTrueOmega = kTRUE;
3713 for(
Int_t iPi0=0;iPi0<previousPi0s->size();iPi0++){
3732 if(gamma2 == NULL)
continue;
3757 Int_t Gammambin = 0;
3767 if(BGpi0cand == NULL)
continue;
3774 for(
Int_t igamma2=0;igamma2<previousclusters->size();igamma2++){
3793 for(
Int_t igamma2=0;igamma2<previousV0s->size();igamma2++){
3873 if(!PhotonCandidate)
continue;