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){
1973 if (particle->E() != TMath::Abs(particle->Pz())){
1974 ratio = (particle->E()+particle->Pz()) / (particle->E()-particle->Pz());
1976 if( !(ratio <= 0) ){
1981 if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
1982 alpha = (daughter0->E() - daughter1->E())/(daughter0->E() + daughter1->E());
1986 if(particle->GetPdgCode() == 111){
2005 if(particle->GetPdgCode() == 111){
2018 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
2019 Double_t mcProdVtxX = primVtxMC->GetX();
2020 Double_t mcProdVtxY = primVtxMC->GetY();
2021 Double_t mcProdVtxZ = primVtxMC->GetZ();
2028 TParticle* particle = (TParticle *)
fMCEvent->Particle(i);
2029 if (!particle)
continue;
2032 if(particle->GetPdgCode() == 223){
2034 Bool_t DecaysToPiPlPiMiPiZero = kFALSE;
2036 TParticle *posPion = 0x0;
2037 TParticle *negPion = 0x0;
2038 TParticle *neutPion = 0x0;
2040 for(
Int_t index= particle->GetFirstDaughter();index <= particle->GetLastDaughter();index++){
2041 if(index < 0)
continue;
2043 TParticle *temp = (TParticle*)
fMCEvent->Particle(index);
2045 switch(temp->GetPdgCode()) {
2058 if(posPion && negPion && neutPion) DecaysToPiPlPiMiPiZero = kTRUE;
2060 if(DecaysToPiPlPiMiPiZero){
2062 }
else if (particle->GetNDaughters()==2){
2063 TParticle *gamma2 = 0x0;
2064 TParticle *pi0 = 0x0;
2066 for(
Int_t index = particle->GetFirstDaughter();index <= particle->GetLastDaughter();index++){
2067 if(index < 0)
continue;
2069 TParticle *temp = (TParticle*)
fMCEvent->Particle(index);
2070 switch(temp->GetPdgCode()){
2091 Double_t alpha = (pi0->Energy() - gamma2->Energy())/(pi0->Energy() + gamma2->Energy());
2095 if(pi0->Energy() - pi0->Pz() == 0 || pi0->Energy() + pi0->Pz() == 0){
2103 if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){
2113 TVector3 omegavector = TVector3(particle->Px(),particle->Py(),particle->Pz());
2114 TVector3 pi0vector = TVector3(pi0->Px(),pi0->Py(),pi0->Pz());
2115 TVector3 gamma2vector = TVector3(gamma2->Px(),gamma2->Py(),gamma2->Pz());
2121 if (pi0->GetNDaughters()==2 && pi0->GetFirstDaughter()>-1 && pi0->GetLastDaughter()>-1){
2122 TParticle *gamma0 = (TParticle*)
fMCEvent->Particle(pi0->GetFirstDaughter());
2123 TParticle *gamma1 = (TParticle*)
fMCEvent->Particle(pi0->GetLastDaughter());
2124 if (gamma0->GetPdgCode()==22 && gamma1->GetPdgCode()==22){
2127 Double_t pi0alpha = (gamma0->Energy() - gamma1->Energy())/(gamma0->Energy() + gamma1->Energy());
2141 Int_t labelNeutPion = -1;
2142 Int_t labelGamma = -1;
2146 if (labelNeutPion > -1 && labelGamma > -1){
2147 TParticle *neutPion =
fMCEvent->Particle(labelNeutPion);
2152 if (neutPion->GetNDaughters()==2 && neutPion->GetFirstDaughter()>-1 && neutPion->GetLastDaughter()>-1){
2154 TParticle *gamma0 = (TParticle*)
fMCEvent->Particle(neutPion->GetFirstDaughter());
2155 TParticle *gamma1 = (TParticle*)
fMCEvent->Particle(neutPion->GetLastDaughter());
2156 TParticle *gamma2 = (TParticle*)
fMCEvent->Particle(labelGamma);
2158 Bool_t InAcceptance = kFALSE;
2166 InAcceptance = kTRUE;
2171 InAcceptance = kTRUE;
2179 InAcceptance = kTRUE;
2189 InAcceptance = kTRUE;
2194 InAcceptance = kTRUE;
2202 InAcceptance = kTRUE;
2215 TVector3 omegavector = TVector3(particle->Px(),particle->Py(),particle->Pz());
2216 TVector3 pi0vector = TVector3(neutPion->Px(),neutPion->Py(),neutPion->Pz());
2217 TVector3 gamma2vector = TVector3(gamma2->Px(),gamma2->Py(),gamma2->Pz());
2219 Double_t OmegaPiZeroAngle = TMath::Pi() - pi0vector.Angle(omegavector);
2220 Double_t PiZeroGammaAngle = pi0vector.Angle(gamma2vector);
2221 Double_t OmegaGammaAngle = TMath::Pi() - omegavector.Angle(gamma2vector);
2224 if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){
2230 if(neutPion->Energy() - neutPion->Pz() == 0 || neutPion->Energy() + neutPion->Pz() == 0){
2236 Double_t OmegaAlpha = (neutPion->Energy() - gamma2->Energy())/(neutPion->Energy() + gamma2->Energy());
2237 Double_t Pi0Alpha = (gamma0->Energy() - gamma1->Energy())/(gamma0->Energy() + gamma1->Energy());
2259 if (TMath::Abs(particle->Eta()) < 0.66 ){
2265 if (
fDoPhotonQA > 0 && particle->GetFirstDaughter()>-1){
2272 if(particle->GetFirstDaughter()>-1 && particle->GetLastDaughter()>-1){
2273 TParticle* daughter0 = (TParticle*)
fMCEvent->Particle(particle->GetFirstDaughter());
2274 TParticle* daughter1 = (TParticle*)
fMCEvent->Particle(particle->GetLastDaughter());
2278 if (particle->Pt()>0.005){
2288 if (particle->Energy() != TMath::Abs(particle->Pz())){
2289 ratio = (particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz());
2291 if( !(ratio <= 0) ){
2297 if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
2298 alpha = (daughter0->Energy() - daughter1->Energy())/(daughter0->Energy() + daughter1->Energy());
2301 if(particle->GetPdgCode() == 111){
2314 Bool_t InAcceptance = kFALSE;
2317 if( kDaughter0IsPrim && kDaughter1IsPrim &&
2323 InAcceptance = kTRUE;
2329 InAcceptance = kTRUE;
2334 InAcceptance = kTRUE;
2339 if(particle->GetPdgCode() == 111){
2359 if (gamma0==NULL)
continue;
2379 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2389 if (thirdGammaIndex==secondGammaIndex)
continue;
2390 Bool_t matchedgamma2wconvgamma = kFALSE;
2396 if (matchedgamma2wconvgamma){
2410 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2443 if (gamma0==NULL)
continue;
2465 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2475 if (thirdGammaIndex==firstGammaIndex)
continue;
2476 Bool_t matchedgamma1wconvgamma2 = kFALSE;
2478 if (gamma2==NULL)
continue;
2481 if (matchedgamma1wconvgamma2){
2495 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2530 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fClusterCandidates->GetEntries();secondGammaIndex++){
2541 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2550 if (thirdGammaIndex==secondGammaIndex || thirdGammaIndex==firstGammaIndex)
continue;
2562 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2595 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fClusterCandidates->GetEntries();secondGammaIndex++){
2606 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2634 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2666 if(gamma0==NULL)
continue;
2667 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fGammaCandidates->GetEntries();secondGammaIndex++){
2669 if(gamma1==NULL)
continue;
2678 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2707 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2740 if (gamma0==NULL)
continue;
2741 for(
Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<
fGammaCandidates->GetEntries();secondGammaIndex++){
2743 if (gamma1==NULL || (secondGammaIndex+1)>=(
fGammaCandidates->GetEntries()))
continue;
2752 pi0cand->SetPxPyPzE(pi0cand->Px(),pi0cand->Py(),pi0cand->Pz(),TMath::Sqrt(0.1349766*0.1349766+pi0cand->P()*pi0cand->P()));
2761 if (thirdGammaIndex==firstGammaIndex || thirdGammaIndex==secondGammaIndex)
continue;
2763 if (gamma2==NULL)
continue;
2773 if(omegacand->M()>0.7 && omegacand->M()<0.85){
2809 Int_t gamma0MCLabel = -1;
2810 Int_t gamma0MotherLabel = -1;
2813 if(gamma0MCLabel>-1){
2814 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2815 gamma0MotherLabel=gammaMC0->GetFirstMother();
2819 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2821 Int_t gamma1MotherLabel = -1;
2822 TParticle * gammaMC1 = 0x0;
2823 if(gamma1MCLabel != -1){
2825 gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2827 gamma1MotherLabel=gammaMC1->GetMother(0);
2829 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=(
fMCEvent->Particle(gammaMC1->GetMother(0)))->GetMother(0);
2830 else gamma1MotherLabel=gammaMC1->GetMother(0);
2835 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel && ((TParticle*)
fMCEvent->Particle(gamma0MotherLabel))->GetPdgCode() == 111){
2839 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2841 Int_t gamma2MotherLabel = -1;
2842 TParticle * gammaMC2 = 0x0;
2843 if(gamma2MCLabel != -1){
2845 gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
2847 gamma2MotherLabel=gammaMC2->GetMother(0);
2849 if (TrueGammaCandidate2->
IsConversion() && gammaMC2->GetMother(0)>-1) gamma2MotherLabel=
fMCEvent->Particle(gammaMC2->GetMother(0))->GetMother(0);
2850 else gamma2MotherLabel=gammaMC2->GetMother(0);
2855 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
2857 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
2887 Int_t gamma0MCLabel = -1;
2888 Int_t gamma0MotherLabel = -1;
2891 if(gamma0MCLabel>-1){
2892 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2893 gamma0MotherLabel=gammaMC0->GetFirstMother();
2897 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2899 Int_t gamma1MotherLabel = -1;
2900 TParticle * gammaMC1 = 0x0;
2901 if(gamma1MCLabel != -1){
2903 gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2905 gamma1MotherLabel=gammaMC1->GetMother(0);
2907 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2908 else gamma1MotherLabel=gammaMC1->GetMother(0);
2913 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel && ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2918 Int_t gamma2MCLabel = -1;
2919 Int_t gamma2MotherLabel = -1;
2922 if(gamma2MCLabel>-1){
2923 TParticle * gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
2924 gamma2MotherLabel = gammaMC2->GetFirstMother();
2929 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
2931 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
2961 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2963 Int_t gamma0MotherLabel = -1;
2964 TParticle * gammaMC0 = 0x0;
2965 if(gamma0MCLabel != -1){
2967 gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
2969 gamma0MotherLabel=gammaMC0->GetMother(0);
2971 if (TrueGammaCandidate0->
IsConversion() && gammaMC0->GetMother(0)>-1) gamma0MotherLabel=
fMCEvent->Particle(gammaMC0->GetMother(0))->GetMother(0);
2972 else gamma0MotherLabel=gammaMC0->GetMother(0);
2977 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2979 Int_t gamma1MotherLabel = -1;
2980 TParticle * gammaMC1 = 0x0;
2981 if(gamma1MCLabel != -1){
2983 gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
2985 gamma1MotherLabel=gammaMC1->GetMother(0);
2987 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
2988 else gamma1MotherLabel=gammaMC1->GetMother(0);
2993 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel && ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
2997 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
2999 Int_t gamma2MotherLabel = -1;
3000 TParticle * gammaMC2 = 0x0;
3001 if(gamma2MCLabel != -1){
3003 gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
3005 gamma2MotherLabel=gammaMC2->GetMother(0);
3007 if (TrueGammaCandidate2->
IsConversion() && gammaMC2->GetMother(0)>-1) gamma2MotherLabel=
fMCEvent->Particle(gammaMC2->GetMother(0))->GetMother(0);
3008 else gamma2MotherLabel=gammaMC2->GetMother(0);
3013 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
3015 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
3045 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3047 Int_t gamma0MotherLabel = -1;
3048 TParticle * gammaMC0 = 0x0;
3049 if(gamma0MCLabel != -1){
3051 gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3053 gamma0MotherLabel=gammaMC0->GetMother(0);
3055 if (TrueGammaCandidate0->
IsConversion() && gammaMC0->GetMother(0)>-1) gamma0MotherLabel=
fMCEvent->Particle(gammaMC0->GetMother(0))->GetMother(0);
3056 else gamma0MotherLabel=gammaMC0->GetMother(0);
3061 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3063 Int_t gamma1MotherLabel = -1;
3064 TParticle * gammaMC1 = 0x0;
3065 if(gamma1MCLabel != -1){
3067 gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
3069 gamma1MotherLabel=gammaMC1->GetMother(0);
3071 if (TrueGammaCandidate1->
IsConversion() && gammaMC1->GetMother(0)>-1) gamma1MotherLabel=
fMCEvent->Particle(gammaMC1->GetMother(0))->GetMother(0);
3072 else gamma1MotherLabel=gammaMC1->GetMother(0);
3077 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel && ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
3082 Int_t gamma2MCLabel = -1;
3083 Int_t gamma2MotherLabel = -1;
3086 if(gamma2MCLabel>-1){
3087 TParticle * gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
3088 gamma2MotherLabel = gammaMC2->GetFirstMother();
3093 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
3095 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
3125 Int_t gamma0MCLabel = -1;
3126 Int_t gamma0MotherLabel = -1;
3129 if(gamma0MCLabel>-1){
3130 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3131 gamma0MotherLabel=gammaMC0->GetFirstMother();
3136 Int_t gamma1MCLabel = -1;
3137 Int_t gamma1MotherLabel = -1;
3140 if(gamma1MCLabel>-1){
3141 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
3142 gamma1MotherLabel=gammaMC1->GetFirstMother();
3147 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3148 ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
3152 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3154 Int_t gamma2MotherLabel = -1;
3155 TParticle * gammaMC2 = 0x0;
3156 if(gamma2MCLabel != -1){
3158 gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
3160 gamma2MotherLabel=gammaMC2->GetMother(0);
3162 if (TrueGammaCandidate2->
IsConversion() && gammaMC2->GetMother(0)>-1) gamma2MotherLabel=
fMCEvent->Particle(gammaMC2->GetMother(0))->GetMother(0);
3163 else gamma2MotherLabel=gammaMC2->GetMother(0);
3168 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
3170 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
3200 Int_t gamma0MCLabel = -1;
3201 Int_t gamma0MotherLabel = -1;
3204 if(gamma0MCLabel>-1){
3205 TParticle * gammaMC0 = (TParticle*)
fMCEvent->Particle(gamma0MCLabel);
3206 gamma0MotherLabel=gammaMC0->GetFirstMother();
3211 Int_t gamma1MCLabel = -1;
3212 Int_t gamma1MotherLabel = -1;
3215 if(gamma1MCLabel>-1){
3216 TParticle * gammaMC1 = (TParticle*)
fMCEvent->Particle(gamma1MCLabel);
3217 gamma1MotherLabel=gammaMC1->GetFirstMother();
3222 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3223 ((TParticle*)
fMCEvent->Particle(gamma1MotherLabel))->GetPdgCode() == 111){
3227 Int_t gamma2MCLabel = -1;
3228 Int_t gamma2MotherLabel = -1;
3231 if(gamma2MCLabel>-1){
3232 TParticle * gammaMC2 = (TParticle*)
fMCEvent->Particle(gamma2MCLabel);
3233 gamma2MotherLabel=gammaMC2->GetFirstMother();
3238 Int_t pi0MotherLabel =
fMCEvent->Particle(gamma0MotherLabel)->GetMother(0);
3240 if(pi0MotherLabel>=0 && gamma2MotherLabel==pi0MotherLabel && ((TParticle*)
fMCEvent->Particle(pi0MotherLabel))->GetPdgCode() == 223){
3272 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3273 if (AODMCTrackArray == NULL)
return;
3274 Bool_t isTrueOmega = kFALSE;
3280 AliAODMCParticle *positiveMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3281 AliAODMCParticle *negativeMC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3283 Int_t gamma0MCLabel = -1;
3284 Int_t gamma0MotherLabel = -1;
3285 if(!positiveMC||!negativeMC)
3289 gamma0MCLabel = positiveMC->GetMother();
3290 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3291 gamma0MotherLabel=gammaMC0->GetMother();
3294 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3296 Int_t gamma1MotherLabel = -1;
3298 AliAODMCParticle * gammaMC1 = 0x0;
3299 if(gamma1MCLabel != -1){
3300 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3303 gamma1MotherLabel=gammaMC1->GetMother();
3306 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3307 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3308 }
else gamma1MotherLabel=gammaMC1->GetMother();
3312 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3313 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3316 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3317 Int_t pi0MotherLabel = TruePi0->GetMother();
3319 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3321 Int_t gamma2MotherLabel = -1;
3323 AliAODMCParticle * gammaMC2 = 0x0;
3324 if(gamma2MCLabel != -1){
3325 gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3328 gamma2MotherLabel=gammaMC2->GetMother();
3331 AliAODMCParticle * gammaGrandMotherMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC2->GetMother()));
3332 gamma2MotherLabel=gammaGrandMotherMC2->GetMother();
3333 }
else gamma2MotherLabel=gammaMC2->GetMother();
3337 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3338 isTrueOmega = kTRUE;
3350 AliAODMCParticle *positive0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3351 AliAODMCParticle *negative0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3353 Int_t gamma0MCLabel = -1;
3354 Int_t gamma0MotherLabel = -1;
3355 if(!positive0MC||!negative0MC)
3359 gamma0MCLabel = positive0MC->GetMother();
3360 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3361 gamma0MotherLabel=gammaMC0->GetMother();
3364 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3366 Int_t gamma1MotherLabel = -1;
3368 AliAODMCParticle * gammaMC1 = 0x0;
3369 if(gamma1MCLabel != -1){
3370 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3373 gamma1MotherLabel=gammaMC1->GetMother();
3376 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3377 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3378 }
else gamma1MotherLabel=gammaMC1->GetMother();
3382 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3383 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3386 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3387 Int_t pi0MotherLabel = TruePi0->GetMother();
3390 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3391 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3393 Int_t gamma2MCLabel = -1;
3394 Int_t gamma2MotherLabel = -1;
3395 if(!positive2MC||!negative2MC)
3399 gamma2MCLabel = positive2MC->GetMother();
3400 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3401 gamma2MotherLabel=gammaMC2->GetMother();
3404 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3405 isTrueOmega = kTRUE;
3417 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3419 Int_t gamma0MotherLabel = -1;
3421 AliAODMCParticle * gammaMC0 = 0x0;
3422 if(gamma0MCLabel != -1){
3423 gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3426 gamma0MotherLabel=gammaMC0->GetMother();
3429 AliAODMCParticle * gammaGrandMotherMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC0->GetMother()));
3430 gamma0MotherLabel=gammaGrandMotherMC0->GetMother();
3431 }
else gamma0MotherLabel=gammaMC0->GetMother();
3435 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3437 Int_t gamma1MotherLabel = -1;
3439 AliAODMCParticle * gammaMC1 = 0x0;
3440 if(gamma1MCLabel != -1){
3441 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3444 gamma1MotherLabel=gammaMC1->GetMother();
3447 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3448 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3449 }
else gamma1MotherLabel=gammaMC1->GetMother();
3453 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3454 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3457 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3458 Int_t pi0MotherLabel = TruePi0->GetMother();
3460 if (!TrueGammaCandidate2->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3462 Int_t gamma2MotherLabel = -1;
3464 AliAODMCParticle * gammaMC2 = 0x0;
3465 if(gamma2MCLabel != -1){
3466 gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3469 gamma2MotherLabel=gammaMC2->GetMother();
3472 AliAODMCParticle * gammaGrandMotherMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC2->GetMother()));
3473 gamma2MotherLabel=gammaGrandMotherMC2->GetMother();
3474 }
else gamma2MotherLabel=gammaMC2->GetMother();
3478 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3479 isTrueOmega = kTRUE;
3491 if (!TrueGammaCandidate0->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3493 Int_t gamma0MotherLabel = -1;
3495 AliAODMCParticle * gammaMC0 = 0x0;
3496 if(gamma0MCLabel != -1){
3497 gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3500 gamma0MotherLabel=gammaMC0->GetMother();
3503 AliAODMCParticle * gammaGrandMotherMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC0->GetMother()));
3504 gamma0MotherLabel=gammaGrandMotherMC0->GetMother();
3505 }
else gamma0MotherLabel=gammaMC0->GetMother();
3509 if (!TrueGammaCandidate1->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set. Aborting");
3511 Int_t gamma1MotherLabel = -1;
3513 AliAODMCParticle * gammaMC1 = 0x0;
3514 if(gamma1MCLabel != -1){
3515 gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3518 gamma1MotherLabel=gammaMC1->GetMother();
3521 AliAODMCParticle * gammaGrandMotherMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gammaMC1->GetMother()));
3522 gamma1MotherLabel=gammaGrandMotherMC1->GetMother();
3523 }
else gamma1MotherLabel=gammaMC1->GetMother();
3527 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3528 ((AliAODMCParticle*)AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){
3531 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3532 Int_t pi0MotherLabel = TruePi0->GetMother();
3535 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3536 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3538 Int_t gamma2MCLabel = -1;
3539 Int_t gamma2MotherLabel = -1;
3540 if(!positive2MC||!negative2MC)
3544 gamma2MCLabel = positive2MC->GetMother();
3545 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3546 gamma2MotherLabel=gammaMC2->GetMother();
3549 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3550 isTrueOmega = kTRUE;
3562 AliAODMCParticle *positive0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelPositive()));
3563 AliAODMCParticle *negative0MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate0->
GetMCLabelNegative()));
3565 Int_t gamma0MCLabel = -1;
3566 Int_t gamma0MotherLabel = -1;
3567 if(!positive0MC||!negative0MC)
3571 gamma0MCLabel = positive0MC->GetMother();
3572 AliAODMCParticle * gammaMC0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MCLabel));
3573 gamma0MotherLabel=gammaMC0->GetMother();
3576 AliAODMCParticle *positive1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelPositive()));
3577 AliAODMCParticle *negative1MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate1->
GetMCLabelNegative()));
3579 Int_t gamma1MCLabel = -1;
3580 Int_t gamma1MotherLabel = -1;
3581 if(!positive1MC||!negative1MC)
3585 gamma1MCLabel = positive1MC->GetMother();
3586 AliAODMCParticle * gammaMC1 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma1MCLabel));
3587 gamma1MotherLabel=gammaMC1->GetMother();
3590 if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel &&
3591 ((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){
3660 AliAODMCParticle * TruePi0 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma0MotherLabel));
3661 Int_t pi0MotherLabel = TruePi0->GetMother();
3663 AliAODMCParticle *positive2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelPositive()));
3664 AliAODMCParticle *negative2MC =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(TrueGammaCandidate2->
GetMCLabelNegative()));
3666 Int_t gamma2MCLabel = -1;
3667 Int_t gamma2MotherLabel = -1;
3668 if(!positive2MC||!negative2MC)
3672 gamma2MCLabel = positive2MC->GetMother();
3673 AliAODMCParticle * gammaMC2 =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(gamma2MCLabel));
3674 gamma2MotherLabel=gammaMC2->GetMother();
3677 if(pi0MotherLabel==gamma2MotherLabel && ((AliAODMCParticle*)AODMCTrackArray->At(gamma2MotherLabel))->GetPdgCode() == 223){
3678 isTrueOmega = kTRUE;
3712 for(
UInt_t iPi0=0;iPi0<previousPi0s->size();iPi0++){
3731 if(gamma2 == NULL)
continue;
3756 Int_t Gammambin = 0;
3766 if(BGpi0cand == NULL)
continue;
3773 for(
UInt_t igamma2=0;igamma2<previousclusters->size();igamma2++){
3792 for(
UInt_t igamma2=0;igamma2<previousV0s->size();igamma2++){
3872 if(!PhotonCandidate)
continue;
3885 Bool_t AODLabelPos = kFALSE;
3886 Bool_t AODLabelNeg = kFALSE;
3889 AliAODTrack *tempDaughter =
static_cast<AliAODTrack*
>(
fInputEvent->GetTrack(i));
3894 AODLabelPos = kTRUE;
3901 AODLabelNeg = kTRUE;
3904 if(AODLabelNeg && AODLabelPos){