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 fHistoMCPi0FromAllOmegaInvMassPt(NULL),
131 fHistoMCOmegaInAccInvMassPt(NULL),
132 fHistoMCOmegaInvMassPt(NULL),
133 fHistoMCAllOmegaYPt(NULL),
134 fHistoMCOmegaInAccYPt(NULL),
135 fHistoMCAllOmegaAlphaPt(NULL),
136 fHistoMCOmegaInAccAlphaPt(NULL),
137 fHistoMCPi0FromAllOmegaAlphaPt(NULL),
138 fHistoMCPi0FromOmegaInAccAlphaPt(NULL),
139 fHistoMCPi0FromAllOmegaYPt(NULL),
140 fHistoMCPi0FromOmegaInAccYPt(NULL),
141 fHistoMCPi0FromOmegaInAccInvMassPt(NULL),
142 fHistoMCPi0FromAllOmegaEtaPhi(NULL),
143 fHistoMCPi0FromOmegaInAccEtaPhi(NULL),
144 fHistoMCAllOmegaEtaPhi(NULL),
145 fHistoMCOmegaInAccEtaPhi(NULL),
146 fHistoMCAllOmegaPiZeroAnglePt(NULL),
147 fHistoMCAllPiZeroGammaAnglePt(NULL),
148 fHistoMCAllOmegaGammaAnglePt(NULL),
149 fHistoMCInAccOmegaPiZeroAnglePt(NULL),
150 fHistoMCInAccPiZeroGammaAnglePt(NULL),
151 fHistoMCInAccOmegaGammaAnglePt(NULL),
152 fHistoMCAllOmegaInvMassPt(NULL),
153 fHistoMCAllOmegaPtPi0Pt(NULL),
154 fHistoMCInAccOmegaPtPi0Pt(NULL),
155 fHistoMCAllOmegaPtGammaPt(NULL),
156 fHistoMCInAccOmegaPtGammaPt(NULL),
157 fHistoTrueOmegaInvMassPt(NULL),
158 fHistoTrueOmegaYPt(NULL),
159 fHistoTrueOmegaAlphaPt(NULL),
160 fHistoTruePi0FromOmegaYPt(NULL),
161 fHistoTruePi0FromOmegaInvMassPt(NULL),
162 fHistoTruePi0FromOmegaAlphaPt(NULL),
163 fHistoTruePi0FromOmegaEtaPhi(NULL),
164 fHistoTruePi0FromOmegaOpenAnglePt(NULL),
165 fHistoTrueOmegaPi0AnglePt(NULL),
166 fHistoTrueOmegaGammaAnglePt(NULL),
167 fHistoTruePi0GammaAnglePt(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 fHistoMCOmegaInAccInvMassPt(NULL),
291 fHistoMCOmegaInvMassPt(NULL),
292 fHistoMCAllOmegaYPt(NULL),
293 fHistoMCOmegaInAccYPt(NULL),
294 fHistoMCAllOmegaAlphaPt(NULL),
295 fHistoMCOmegaInAccAlphaPt(NULL),
296 fHistoMCPi0FromAllOmegaAlphaPt(NULL),
297 fHistoMCPi0FromOmegaInAccAlphaPt(NULL),
298 fHistoMCPi0FromAllOmegaYPt(NULL),
299 fHistoMCPi0FromOmegaInAccYPt(NULL),
300 fHistoMCPi0FromOmegaInAccInvMassPt(NULL),
301 fHistoMCPi0FromAllOmegaEtaPhi(NULL),
302 fHistoMCPi0FromOmegaInAccEtaPhi(NULL),
303 fHistoMCAllOmegaEtaPhi(NULL),
304 fHistoMCOmegaInAccEtaPhi(NULL),
305 fHistoMCAllOmegaPiZeroAnglePt(NULL),
306 fHistoMCAllPiZeroGammaAnglePt(NULL),
307 fHistoMCAllOmegaGammaAnglePt(NULL),
308 fHistoMCInAccOmegaPiZeroAnglePt(NULL),
309 fHistoMCInAccPiZeroGammaAnglePt(NULL),
310 fHistoMCInAccOmegaGammaAnglePt(NULL),
311 fHistoMCAllOmegaInvMassPt(NULL),
312 fHistoMCAllOmegaPtPi0Pt(NULL),
313 fHistoMCInAccOmegaPtPi0Pt(NULL),
314 fHistoMCAllOmegaPtGammaPt(NULL),
315 fHistoMCInAccOmegaPtGammaPt(NULL),
316 fHistoTrueOmegaInvMassPt(NULL),
317 fHistoTrueOmegaYPt(NULL),
318 fHistoTrueOmegaAlphaPt(NULL),
319 fHistoTruePi0FromOmegaYPt(NULL),
320 fHistoTruePi0FromOmegaInvMassPt(NULL),
321 fHistoTruePi0FromOmegaAlphaPt(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 isTrueOmega = kFALSE;
3274 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3275 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3277 Int_t gamma0MCLabel = -1;
3278 Int_t gamma0MotherLabel = -1;
3279 if(!positiveMC||!negativeMC)
3283 gamma0MCLabel = positiveMC->GetMother();
3284 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3285 gamma0MotherLabel=gammaMC0->GetMother();
3288 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3290 Int_t gamma1MotherLabel = -1;
3292 AliAODMCParticle * gammaMC1 = 0x0;
3293 if(gamma1MCLabel != -1){
3294 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3297 gamma1MotherLabel=gammaMC1->GetMother();
3300 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3301 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3302 }
else gamma1MotherLabel=gammaMC1->GetMother();
3306 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3307 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3310 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3311 Int_t pi0MotherLabel = TruePi0->GetMother();
3313 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3315 Int_t gamma2MotherLabel = -1;
3317 AliAODMCParticle * gammaMC2 = 0x0;
3318 if(gamma2MCLabel != -1){
3319 gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3322 gamma2MotherLabel=gammaMC2->GetMother();
3325 AliAODMCParticle * gammaGrandMotherMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC2->GetMother()));
3326 gamma2MotherLabel=gammaGrandMotherMC2->GetMother();
3327 }
else gamma2MotherLabel=gammaMC2->GetMother();
3331 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3332 isTrueOmega = kTRUE;
3344 AliAODMCParticle *positive0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3345 AliAODMCParticle *negative0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3347 Int_t gamma0MCLabel = -1;
3348 Int_t gamma0MotherLabel = -1;
3349 if(!positive0MC||!negative0MC)
3353 gamma0MCLabel = positive0MC->GetMother();
3354 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3355 gamma0MotherLabel=gammaMC0->GetMother();
3358 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3360 Int_t gamma1MotherLabel = -1;
3362 AliAODMCParticle * gammaMC1 = 0x0;
3363 if(gamma1MCLabel != -1){
3364 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3367 gamma1MotherLabel=gammaMC1->GetMother();
3370 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3371 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3372 }
else gamma1MotherLabel=gammaMC1->GetMother();
3376 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3377 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3380 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3381 Int_t pi0MotherLabel = TruePi0->GetMother();
3384 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3385 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3387 Int_t gamma2MCLabel = -1;
3388 Int_t gamma2MotherLabel = -1;
3389 if(!positive2MC||!negative2MC)
3393 gamma2MCLabel = positive2MC->GetMother();
3394 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3395 gamma2MotherLabel=gammaMC2->GetMother();
3398 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3399 isTrueOmega = kTRUE;
3411 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3413 Int_t gamma0MotherLabel = -1;
3415 AliAODMCParticle * gammaMC0 = 0x0;
3416 if(gamma0MCLabel != -1){
3417 gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3420 gamma0MotherLabel=gammaMC0->GetMother();
3423 AliAODMCParticle * gammaGrandMotherMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC0->GetMother()));
3424 gamma0MotherLabel=gammaGrandMotherMC0->GetMother();
3425 }
else gamma0MotherLabel=gammaMC0->GetMother();
3429 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3431 Int_t gamma1MotherLabel = -1;
3433 AliAODMCParticle * gammaMC1 = 0x0;
3434 if(gamma1MCLabel != -1){
3435 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3438 gamma1MotherLabel=gammaMC1->GetMother();
3441 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3442 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3443 }
else gamma1MotherLabel=gammaMC1->GetMother();
3447 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3448 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3451 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3452 Int_t pi0MotherLabel = TruePi0->GetMother();
3454 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3456 Int_t gamma2MotherLabel = -1;
3458 AliAODMCParticle * gammaMC2 = 0x0;
3459 if(gamma2MCLabel != -1){
3460 gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3463 gamma2MotherLabel=gammaMC2->GetMother();
3466 AliAODMCParticle * gammaGrandMotherMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC2->GetMother()));
3467 gamma2MotherLabel=gammaGrandMotherMC2->GetMother();
3468 }
else gamma2MotherLabel=gammaMC2->GetMother();
3472 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3473 isTrueOmega = kTRUE;
3485 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3487 Int_t gamma0MotherLabel = -1;
3489 AliAODMCParticle * gammaMC0 = 0x0;
3490 if(gamma0MCLabel != -1){
3491 gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3494 gamma0MotherLabel=gammaMC0->GetMother();
3497 AliAODMCParticle * gammaGrandMotherMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC0->GetMother()));
3498 gamma0MotherLabel=gammaGrandMotherMC0->GetMother();
3499 }
else gamma0MotherLabel=gammaMC0->GetMother();
3503 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3505 Int_t gamma1MotherLabel = -1;
3507 AliAODMCParticle * gammaMC1 = 0x0;
3508 if(gamma1MCLabel != -1){
3509 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3512 gamma1MotherLabel=gammaMC1->GetMother();
3515 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3516 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3517 }
else gamma1MotherLabel=gammaMC1->GetMother();
3521 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3522 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3525 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3526 Int_t pi0MotherLabel = TruePi0->GetMother();
3529 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3530 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3532 Int_t gamma2MCLabel = -1;
3533 Int_t gamma2MotherLabel = -1;
3534 if(!positive2MC||!negative2MC)
3538 gamma2MCLabel = positive2MC->GetMother();
3539 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3540 gamma2MotherLabel=gammaMC2->GetMother();
3543 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3544 isTrueOmega = kTRUE;
3556 AliAODMCParticle *positive0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3557 AliAODMCParticle *negative0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3559 Int_t gamma0MCLabel = -1;
3560 Int_t gamma0MotherLabel = -1;
3561 if(!positive0MC||!negative0MC)
3565 gamma0MCLabel = positive0MC->GetMother();
3566 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3567 gamma0MotherLabel=gammaMC0->GetMother();
3570 AliAODMCParticle *positive1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelPositive()));
3571 AliAODMCParticle *negative1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelNegative()));
3573 Int_t gamma1MCLabel = -1;
3574 Int_t gamma1MotherLabel = -1;
3575 if(!positive1MC||!negative1MC)
3579 gamma1MCLabel = positive1MC->GetMother();
3580 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3581 gamma1MotherLabel=gammaMC1->GetMother();
3584 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3585 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3588 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3589 Int_t pi0MotherLabel = TruePi0->GetMother();
3591 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3593 Int_t gamma2MotherLabel = -1;
3595 AliAODMCParticle * gammaMC2 = 0x0;
3596 if(gamma2MCLabel != -1){
3597 gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3600 gamma2MotherLabel=gammaMC2->GetMother();
3603 AliAODMCParticle * gammaGrandMotherMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC2->GetMother()));
3604 gamma2MotherLabel=gammaGrandMotherMC2->GetMother();
3605 }
else gamma2MotherLabel=gammaMC2->GetMother();
3609 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3610 isTrueOmega = kTRUE;
3622 AliAODMCParticle *positive0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3623 AliAODMCParticle *negative0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3625 Int_t gamma0MCLabel = -1;
3626 Int_t gamma0MotherLabel = -1;
3627 if(!positive0MC||!negative0MC)
3631 gamma0MCLabel = positive0MC->GetMother();
3632 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3633 gamma0MotherLabel=gammaMC0->GetMother();
3636 AliAODMCParticle *positive1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelPositive()));
3637 AliAODMCParticle *negative1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelNegative()));
3639 Int_t gamma1MCLabel = -1;
3640 Int_t gamma1MotherLabel = -1;
3641 if(!positive1MC||!negative1MC)
3645 gamma1MCLabel = positive1MC->GetMother();
3646 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3647 gamma1MotherLabel=gammaMC1->GetMother();
3650 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3651 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3654 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3655 Int_t pi0MotherLabel = TruePi0->GetMother();
3657 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3658 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3660 Int_t gamma2MCLabel = -1;
3661 Int_t gamma2MotherLabel = -1;
3662 if(!positive2MC||!negative2MC)
3666 gamma2MCLabel = positive2MC->GetMother();
3667 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3668 gamma2MotherLabel=gammaMC2->GetMother();
3671 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3672 isTrueOmega = kTRUE;
3706 for(
UInt_t iPi0=0;iPi0<previousPi0s->size();iPi0++){
3725 if(gamma2 == NULL)
continue;
3750 Int_t Gammambin = 0;
3760 if(BGpi0cand == NULL)
continue;
3767 for(
UInt_t igamma2=0;igamma2<previousclusters->size();igamma2++){
3786 for(
UInt_t igamma2=0;igamma2<previousV0s->size();igamma2++){
3866 if(!PhotonCandidate)
continue;