1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 // Extension to Pi0FLOw, mimicing AliPHOSHijingEfficiency
17 // by Dmitri Peressounko, 05.02.2013
18 // Authors: Henrik Qvigstad, Dmitri Peressounko
20 // Adopted for AOD analysis by Paul Batzing and Boris Polishchuk (10.03.2014).
25 #include "TObjArray.h"
32 #include "TParticle.h"
37 #include "THashList.h"
42 #include "AliAnalysisManager.h"
43 #include "AliMCEventHandler.h"
44 #include "AliMCEvent.h"
46 #include "AliAnalysisTaskSE.h"
47 #include "AliPHOSHijingEfficiency.h"
48 #include "AliCaloPhoton.h"
49 #include "AliPHOSGeometry.h"
50 #include "AliPHOSEsdCluster.h"
51 #include "AliPHOSCalibData.h"
54 #include "AliCDBManager.h"
55 #include "AliCentrality.h"
56 #include "AliEventplane.h"
59 #include "AliOADBContainer.h"
60 #include "AliAODInputHandler.h"
61 #include "AliAODMCParticle.h"
63 #include "AliAnalysisTaskPi0FlowMCAOD.h"
64 ClassImp(AliAnalysisTaskPi0FlowMCAOD);
66 const Double_t AliAnalysisTaskPi0FlowMCAOD::kRCut = 1.;
68 AliAnalysisTaskPi0FlowMCAOD::AliAnalysisTaskPi0FlowMCAOD(const char* name, AliAnalysisTaskPi0Flow::Period period)
69 : AliAnalysisTaskPi0Flow(name, period),fMcArray(0x0),kOffVertexCutSet(kTRUE)
73 AliAnalysisTaskPi0FlowMCAOD::~AliAnalysisTaskPi0FlowMCAOD()
77 void AliAnalysisTaskPi0FlowMCAOD::UserCreateOutputObjects()
79 // Do standard Pi0Flow CreateOuputObjects
80 AliAnalysisTaskPi0Flow::UserCreateOutputObjects();
82 // MC Generated histograms
84 for(Int_t cent=0; cent < fCentEdges.GetSize()-1; cent++){
85 snprintf(key,55,"hMC_rap_gamma_cen%d",cent) ;
86 fOutputContainer->Add(new TH1F(key,"Rapidity pi0",200,-1.,1.)) ;
87 snprintf(key,55,"hMC_rap_pi0_cen%d",cent) ;
88 fOutputContainer->Add(new TH1F(key,"Rapidity pi0",200,-1.,1.)) ;
89 snprintf(key,55,"hMC_rap_eta_cen%d",cent) ;
90 fOutputContainer->Add(new TH1F(key,"Rapidity eta",200,-1.,1.)) ;
91 snprintf(key,55,"hMC_phi_gamma_cen%d",cent) ;
92 fOutputContainer->Add(new TH1F(key,"Phi pi0",200,0.,TMath::TwoPi())) ;
93 snprintf(key,55,"hMC_phi_pi0_cen%d",cent) ;
94 fOutputContainer->Add(new TH1F(key,"Phi pi0",200,0.,TMath::TwoPi())) ;
95 snprintf(key,55,"hMC_phi_eta_cen%d",cent) ;
96 fOutputContainer->Add(new TH1F(key,"Phi eta",200,0.,TMath::TwoPi())) ;
97 snprintf(key,55,"hMC_all_gamma_cen%d",cent) ;
98 fOutputContainer->Add(new TH1F(key,"Rapidity photon",250,0.,25.)) ;
99 snprintf(key,55,"hMC_all_pi0_cen%d",cent) ;
100 fOutputContainer->Add(new TH1F(key,"Rapidity pi0",250,0.,25.)) ;
101 snprintf(key,55,"hMC_all_eta_cen%d",cent) ;
102 fOutputContainer->Add(new TH1F(key,"Rapidity eta",250,0.,25.)) ;
103 snprintf(key,55,"hMC_unitEta_gamma_cen%d",cent) ;
104 fOutputContainer->Add(new TH1F(key,"Pt photon",250,0.,25.)) ;
105 snprintf(key,55,"hMC_unitEta_pi0_cen%d",cent) ;
106 fOutputContainer->Add(new TH1F(key,"Rapidity eta",250,0.,25.)) ;
107 snprintf(key,55,"hMC_unitEta_eta_cen%d",cent) ;
108 fOutputContainer->Add(new TH1F(key,"Rapidity eta",250,0.,25.)) ;
110 snprintf(key,55,"hMC_all_K0S_cen%d",cent) ;
111 fOutputContainer->Add(new TH1F(key,"Rapidity photon",250,0.,25.)) ;
113 snprintf(key,55,"hMC_unitEta_K0S_cen%d",cent) ;
114 fOutputContainer->Add(new TH1F(key,"Rapidity eta",250,0.,25.)) ;
117 fOutputContainer->Add(new TH2F("hMC_gamma_vertex","Creation vertex",25,0.,25.,1000,0.,500.)) ;
118 fOutputContainer->Add(new TH2F("hMC_pi0_vertex","Creation vertex",25,0.,25.,1000,0.,500.)) ;
119 fOutputContainer->Add(new TH2F("hMC_eta_vertex","Creation vertex",25,0.,25.,1000,0.,500.)) ;
125 fOutputContainer->Add(new TH2F("Vertex","Pi0 creation vertex",nPt,ptMin,ptMax,5000,0.,500.));
126 fOutputContainer->Add(new TH3F("hSecondPi0RphiZ","Secondary pi0 vertex",450,0.,450.,100,0.,TMath::TwoPi(),200,-100.,100.));
127 fOutputContainer->Add(new TH2F("hSecondPi0RE","Secondary pi0 vertex",450,0.,450.,200,0.,20.));
128 fOutputContainer->Add(new TH3F("hMass_R","Mass vs radius any parent",50,0.,0.25,100,0.,10.,300,0.,600.));
129 fOutputContainer->Add(new TH3F("Real_pi_R","All clusters",50,0.,0.25,100,0.,10.,250,0.,500.));
130 fOutputContainer->Add(new TH3F("Real_pi_Z","All clusters",50,0.,0.25,100,0.,10.,100,-100.,100.));
131 // fOutputContainer->Add(new TH2F(Form("Real_npnp_RZ"),"All clusters",250,0.,500.,100,-100.,100.));
132 // fOutputContainer->Add(new TH3F(Form("Real_mass_R"),"All clusters",50,0.,0.25,100,0.,10.,300,0.,600.));
134 const Int_t nM = 500;
135 const Double_t mMin = 0.0;
136 const Double_t mMax = 1.0;
138 for(Int_t cen=0; cen < fCentEdges.GetSize()-1; cen++){
139 fOutputContainer->Add(new TH1F(Form("hPrimPhot_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
140 fOutputContainer->Add(new TH1F(Form("hPrimEl_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
141 fOutputContainer->Add(new TH1F(Form("hPrimPi0_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
142 fOutputContainer->Add(new TH1F(Form("hPrimEta_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
143 fOutputContainer->Add(new TH1F(Form("hPrimPipm_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
144 fOutputContainer->Add(new TH1F(Form("hPrimP_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
145 fOutputContainer->Add(new TH1F(Form("hPrimPbar_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
146 fOutputContainer->Add(new TH1F(Form("hPrimN_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
147 fOutputContainer->Add(new TH1F(Form("hPrimNbar_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
148 fOutputContainer->Add(new TH1F(Form("hPrimK0S_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
149 fOutputContainer->Add(new TH1F(Form("hPrimK0L_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
150 fOutputContainer->Add(new TH1F(Form("hPrimKpm_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
151 fOutputContainer->Add(new TH1F(Form("hPrimOther_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
153 //pairs from common parents
154 fOutputContainer->Add(new TH2F(Form("hParentAll_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
155 fOutputContainer->Add(new TH2F(Form("hParentK0s_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
156 fOutputContainer->Add(new TH2F(Form("hParentGamma_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
157 fOutputContainer->Add(new TH2F(Form("hParentEl_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
158 fOutputContainer->Add(new TH2F(Form("hParentOther_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
159 fOutputContainer->Add(new TH2F(Form("hParentPi0_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
160 fOutputContainer->Add(new TH2F(Form("hParentDirPi0_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
162 //common parent - pi0
163 fOutputContainer->Add(new TH2F(Form("hParentPi0NoPrim_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
164 fOutputContainer->Add(new TH2F(Form("hParentPi0Eta_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
165 fOutputContainer->Add(new TH2F(Form("hParentPi0Omega_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
166 fOutputContainer->Add(new TH2F(Form("hParentPi0Pipm_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
167 fOutputContainer->Add(new TH2F(Form("hParentPi0Kpm_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
168 fOutputContainer->Add(new TH2F(Form("hParentPi0Ks_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
169 fOutputContainer->Add(new TH2F(Form("hParentPi0Kl_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
170 fOutputContainer->Add(new TH2F(Form("hParentPi0pn_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
171 fOutputContainer->Add(new TH2F(Form("hParentPi0antipn_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
176 //Photon contaminations
177 fOutputContainer->Add(new TH2F("hPipmGammaConvR","Conversion radius" ,200,0.,20.,1000,0.,500.));
178 fOutputContainer->Add(new TH2F("hPipmElConvR","Conversion radius" ,200,0.,20.,1000,0.,500.));
179 fOutputContainer->Add(new TH2F("hPipmNConvR","Conversion radius" ,200,0.,20.,1000,0.,500.));
180 fOutputContainer->Add(new TH2F("hPipmOtherConvR","Conversion radius" ,200,0.,20.,1000,0.,500.));
181 fOutputContainer->Add(new TH2F("hPipmGammaConvRZ","Conversion radius" ,400,-200.,200.,1000,0.,500.));
183 const Int_t nTypes=24 ;
184 char partTypes[nTypes][55] ;
185 snprintf(partTypes[0],55,"hGammaNoPrim") ; //
186 snprintf(partTypes[1],55,"hGammaPhot") ; //
187 snprintf(partTypes[2],55,"hGammaEl") ; //
188 snprintf(partTypes[3],55,"hGammaPi0") ; //
189 snprintf(partTypes[4],55,"hGammaEta") ; //
190 snprintf(partTypes[5],55,"hhGammaOmega") ; //
191 snprintf(partTypes[6],55,"hGammaPipm") ; //
192 snprintf(partTypes[7],55,"hGammaP") ; //
193 snprintf(partTypes[8],55,"hGammaPbar") ; //
194 snprintf(partTypes[9],55,"hGammaN") ; //
195 snprintf(partTypes[10],55,"hGammaNbar") ; //
196 snprintf(partTypes[11],55,"hGammaK0S") ; //
197 snprintf(partTypes[12],55,"hGammaK0L") ; //
198 snprintf(partTypes[13],55,"hGammaKpm") ; //
199 snprintf(partTypes[14],55,"hGammaKstar") ; //
200 snprintf(partTypes[15],55,"hGammaDelta") ; //
201 snprintf(partTypes[16],55,"hGammaOtherCharged") ; //
202 snprintf(partTypes[17],55,"hGammaOtherNeutral") ; //
203 snprintf(partTypes[18],55,"hGammaPipmGamma") ; //
204 snprintf(partTypes[19],55,"hGammaPipmEl") ; //
205 snprintf(partTypes[20],55,"hGammaPipmOther") ; //
206 snprintf(partTypes[21],55,"hGammaPipmDirect") ; //
207 snprintf(partTypes[22],55,"hGammaPipmp") ; //
208 snprintf(partTypes[23],55,"hGammaPipmn") ; //
210 const Int_t nPID=12 ;
212 snprintf(cPID[0],25,"All") ;
213 snprintf(cPID[1],25,"Allcore") ;
214 snprintf(cPID[2],25,"CPV") ;
215 snprintf(cPID[3],25,"CPVcore") ;
216 snprintf(cPID[4],25,"CPV2") ;
217 snprintf(cPID[5],25,"CPV2core") ;
218 snprintf(cPID[6],25,"Disp") ;
219 snprintf(cPID[7],25,"Dispcore") ;
220 snprintf(cPID[8],25,"Disp2") ;
221 snprintf(cPID[9],25,"Disp2core") ;
222 snprintf(cPID[10],25,"Both") ;
223 snprintf(cPID[11],25,"Bothcore") ;
225 for(Int_t itype=0; itype<nTypes; itype++){
226 for(Int_t iPID=0; iPID<nPID; iPID++){
227 for(Int_t cen=0; cen < fCentEdges.GetSize()-1; cen++){
228 fOutputContainer->Add(new TH1F(Form("%s_%s_cen%d",partTypes[itype],cPID[iPID],cen),"Cluster parents",nPt,ptMin,ptMax));
233 PostData(1, fOutputContainer);
236 void AliAnalysisTaskPi0FlowMCAOD::UserExec(Option_t* option)
238 fMcArray = GetMCArray();
239 if(!fMcArray) { PostData(1, fOutputContainer); return; }
241 AliAnalysisTaskPi0Flow::UserExec(option);
245 void AliAnalysisTaskPi0FlowMCAOD::SelectPhotonClusters()
247 AliAnalysisTaskPi0Flow::SelectPhotonClusters();
249 for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
250 AliCaloPhoton * photon = (AliCaloPhoton*)fCaloPhotonsPHOS->At(i1);
251 AliVCluster* cluster = photon->GetCluster();
253 Int_t primary=FindPrimary(cluster,sure) ;
254 photon->SetPrimary(primary);
255 photon->SetWeight(PrimaryWeight(primary)) ;
258 if(kOffVertexCutSet) {
259 for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
260 AliCaloPhoton * photon = (AliCaloPhoton*)fCaloPhotonsPHOS->At(i1);
261 Int_t primary = photon->GetPrimary();
262 AliAODMCParticle* p = GetParticle(primary);
264 if(p->PdgCode()==11 || p->PdgCode()==-11) continue;
265 else { fCaloPhotonsPHOS->Remove(photon); fCaloPhotonsPHOS->Compress(); }
272 void AliAnalysisTaskPi0FlowMCAOD::FillSelectedClusterHistograms()
274 for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
275 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
277 Double_t dphiA=ph1->Phi()-fRPV0A ;
278 while(dphiA<0)dphiA+=TMath::Pi() ;
279 while(dphiA>TMath::Pi())dphiA-=TMath::Pi() ;
281 Double_t dphiC=ph1->Phi()-fRPV0C ;
282 while(dphiC<0)dphiC+=TMath::Pi() ;
283 while(dphiC>TMath::Pi())dphiC-=TMath::Pi() ;
285 Double_t dphiT=ph1->Phi()-fRP ;
286 while(dphiT<0)dphiT+=TMath::Pi() ;
287 while(dphiT>TMath::Pi())dphiT-=TMath::Pi() ;
289 Double_t pt = ph1->Pt() ;
290 Double_t ptcore = ph1->GetMomV2()->Pt() ;
291 Double_t w = ph1->GetWeight();
293 FillHistogram(Form("hPhotPhiV0AAll_cen%d",fCentBin),pt,dphiA, w) ;
294 FillHistogram(Form("hPhotPhiV0CAll_cen%d",fCentBin),pt,dphiC, w) ;
296 FillHistogram(Form("hPhotPhiTPCAll_cen%d",fCentBin),pt,dphiT, w) ;
297 FillHistogram(Form("hPhotPhiV0AAllcore_cen%d",fCentBin),ptcore,dphiA, w) ;
298 FillHistogram(Form("hPhotPhiV0CAllcore_cen%d",fCentBin),ptcore,dphiC, w) ;
300 FillHistogram(Form("hPhotPhiTPCAllcore_cen%d",fCentBin),ptcore,dphiT, w) ;
302 FillHistogram(Form("hPhotAll_cen%d",fCentBin),pt, w) ;
303 FillHistogram(Form("hPhotAllcore_cen%d",fCentBin),ptcore, w) ;
304 if(ph1->IsntUnfolded()){
305 FillHistogram(Form("hPhotAllwou_cen%d",fCentBin),pt, w) ;
306 FillHistogram(Form("hPhotPhiV0AAllwou_cen%d",fCentBin),pt,dphiA, w) ;
307 FillHistogram(Form("hPhotPhiV0CAllwou_cen%d",fCentBin),pt,dphiC, w) ;
309 FillHistogram(Form("hPhotPhiTPCAllwou_cen%d",fCentBin),pt,dphiT, w) ;
312 FillHistogram(Form("hPhotPhiV0ACPV_cen%d",fCentBin),pt,dphiA, w) ;
313 FillHistogram(Form("hPhotPhiV0CCPV_cen%d",fCentBin),pt,dphiC, w) ;
315 FillHistogram(Form("hPhotPhiTPCCPV_cen%d",fCentBin),pt,dphiT, w) ;
317 FillHistogram(Form("hPhotPhiV0ACPVcore_cen%d",fCentBin),ptcore,dphiA, w) ;
318 FillHistogram(Form("hPhotPhiV0CCPVcore_cen%d",fCentBin),ptcore,dphiC, w) ;
320 FillHistogram(Form("hPhotPhiTPCCPVcore_cen%d",fCentBin),ptcore,dphiT, w) ;
322 FillHistogram(Form("hPhotCPV_cen%d",fCentBin),pt, w) ;
323 FillHistogram(Form("hPhotCPVcore_cen%d",fCentBin),ptcore, w) ;
326 FillHistogram(Form("hPhotPhiV0ACPV2_cen%d",fCentBin),pt,dphiA, w) ;
327 FillHistogram(Form("hPhotPhiV0CCPV2_cen%d",fCentBin),pt,dphiC, w) ;
329 FillHistogram(Form("hPhotPhiTPCCPV2_cen%d",fCentBin),pt,dphiT, w) ;
331 FillHistogram(Form("hPhotPhiV0ACPV2core_cen%d",fCentBin),ptcore,dphiA, w) ;
332 FillHistogram(Form("hPhotPhiV0CCPV2core_cen%d",fCentBin),ptcore,dphiC, w) ;
334 FillHistogram(Form("hPhotPhiTPCCPV2core_cen%d",fCentBin),ptcore,dphiT, w) ;
335 FillHistogram(Form("hPhotCPV2_cen%d",fCentBin),pt, w) ;
336 FillHistogram(Form("hPhotCPV2core_cen%d",fCentBin),ptcore, w) ;
339 FillHistogram(Form("hPhotPhiV0ADisp_cen%d",fCentBin),pt,dphiA, w) ;
340 FillHistogram(Form("hPhotPhiV0CDisp_cen%d",fCentBin),pt,dphiC, w) ;
342 FillHistogram(Form("hPhotPhiTPCDisp_cen%d",fCentBin),pt,dphiT, w) ;
344 FillHistogram(Form("hPhotPhiV0ADispcore_cen%d",fCentBin),ptcore,dphiA, w) ;
345 FillHistogram(Form("hPhotPhiV0CDispcore_cen%d",fCentBin),ptcore,dphiC, w) ;
347 FillHistogram(Form("hPhotPhiTPCDispcore_cen%d",fCentBin),ptcore,dphiT, w) ;
349 if(ph1->IsntUnfolded()){
350 FillHistogram(Form("hPhotPhiV0ADispwou_cen%d",fCentBin),pt,dphiA, w) ;
351 FillHistogram(Form("hPhotPhiV0CDispwou_cen%d",fCentBin),pt,dphiC, w) ;
353 FillHistogram(Form("hPhotPhiTPCDispwou_cen%d",fCentBin),pt,dphiT, w) ;
356 FillHistogram(Form("hPhotDisp_cen%d",fCentBin),pt, w) ;
357 FillHistogram(Form("hPhotDispcore_cen%d",fCentBin),ptcore, w) ;
358 if(ph1->IsntUnfolded()){
359 FillHistogram(Form("hPhotDispwou_cen%d",fCentBin),pt, w) ;
362 FillHistogram(Form("hPhotPhiV0ABoth_cen%d",fCentBin),pt,dphiA, w) ;
363 FillHistogram(Form("hPhotPhiV0CBoth_cen%d",fCentBin),pt,dphiC, w) ;
365 FillHistogram(Form("hPhotPhiTPCBoth_cen%d",fCentBin),pt,dphiT, w) ;
367 FillHistogram(Form("hPhotPhiV0ABothcore_cen%d",fCentBin),ptcore,dphiA, w) ;
368 FillHistogram(Form("hPhotPhiV0CBothcore_cen%d",fCentBin),ptcore,dphiC, w) ;
370 FillHistogram(Form("hPhotPhiTPCBothcore_cen%d",fCentBin),ptcore,dphiT, w) ;
372 FillHistogram(Form("hPhotBoth_cen%d",fCentBin),pt, w) ;
373 FillHistogram(Form("hPhotBothcore_cen%d",fCentBin),ptcore, w) ;
376 if(ph1->IsDisp2OK()){
377 FillHistogram(Form("hPhotPhiV0ADisp2_cen%d",fCentBin),pt,dphiA, w) ;
378 FillHistogram(Form("hPhotPhiV0CDisp2_cen%d",fCentBin),pt,dphiC, w) ;
380 FillHistogram(Form("hPhotPhiTPCDisp2_cen%d",fCentBin),pt,dphiT, w) ;
381 FillHistogram(Form("hPhotPhiV0ADisp2core_cen%d",fCentBin),ptcore,dphiA, w) ;
382 FillHistogram(Form("hPhotPhiV0CDisp2core_cen%d",fCentBin),ptcore,dphiC, w) ;
384 FillHistogram(Form("hPhotPhiTPCDisp2core_cen%d",fCentBin),ptcore,dphiT, w) ;
386 FillHistogram(Form("hPhotDisp2_cen%d",fCentBin),pt, w) ;
387 FillHistogram(Form("hPhotDisp2core_cen%d",fCentBin),ptcore, w) ;
389 FillHistogram(Form("hPhotPhiV0ABoth2_cen%d",fCentBin),pt,dphiA, w) ;
390 FillHistogram(Form("hPhotPhiV0CBoth2_cen%d",fCentBin),pt,dphiC, w) ;
392 FillHistogram(Form("hPhotPhiTPCBoth2_cen%d",fCentBin),pt,dphiT, w) ;
394 FillHistogram(Form("hPhotPhiV0ABoth2core_cen%d",fCentBin),ptcore,dphiA, w) ;
395 FillHistogram(Form("hPhotPhiV0CBoth2core_cen%d",fCentBin),ptcore,dphiC, w) ;
397 FillHistogram(Form("hPhotPhiTPCBoth2core_cen%d",fCentBin),ptcore,dphiT, w) ;
399 FillHistogram(Form("hPhotBoth2_cen%d",fCentBin),pt, w) ;
400 FillHistogram(Form("hPhotBoth2core_cen%d",fCentBin),ptcore, w) ;
406 void AliAnalysisTaskPi0FlowMCAOD::ConsiderPi0s()
409 for (Int_t i1=0; i1 < fCaloPhotonsPHOS->GetEntriesFast()-1; i1++) {
410 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
411 const Double_t w1 = ph1->GetWeight();
412 for (Int_t i2=i1+1; i2<fCaloPhotonsPHOS->GetEntriesFast(); i2++) {
413 AliCaloPhoton * ph2=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i2) ;
414 TLorentzVector p12 = *ph1 + *ph2;
415 TLorentzVector pv12 = *(ph1->GetMomV2()) + *(ph2->GetMomV2());
417 const Double_t w2 = ph2->GetWeight();
418 Double_t w = TMath::Sqrt(w1*w2);
420 FillHistogram("hPHOSphi",fCentrality,p12.Pt(),p12.Phi(), w) ;
421 Double_t dphiA=p12.Phi()-fRPV0A ;
422 while(dphiA<0)dphiA+=TMath::Pi() ;
423 while(dphiA>TMath::Pi())dphiA-=TMath::Pi() ;
425 Double_t dphiC=p12.Phi()-fRPV0C ;
426 while(dphiC<0)dphiC+=TMath::Pi() ;
427 while(dphiC>TMath::Pi())dphiC-=TMath::Pi() ;
429 Double_t dphiT=p12.Phi()-fRP ;
430 while(dphiT<0)dphiT+=TMath::Pi() ;
431 while(dphiT>TMath::Pi())dphiT-=TMath::Pi() ;
433 Double_t a=TMath::Abs((ph1->E()-ph2->E())/(ph1->E()+ph2->E())) ;
435 Double_t mcore=pv12.M() ;
436 Double_t pt=p12.Pt() ;
437 Double_t ptcore=pv12.Pt() ;
438 Double_t pt1=ph1->Pt() ;
439 Double_t pt2=ph2->Pt() ;
440 Double_t ptcore1=ph1->GetMomV2()->Pt() ;
441 Double_t ptcore2=ph2->GetMomV2()->Pt() ;
443 FillHistogram(Form("hMassPtV0AAll_cen%d",fCentBin),m,pt,dphiA, w) ;
444 FillHistogram(Form("hMassPtV0CAll_cen%d",fCentBin),m,pt,dphiC, w) ;
446 FillHistogram(Form("hMassPtTPCAll_cen%d",fCentBin),m,pt,dphiT, w) ;
448 FillHistogram(Form("hMassPtV0AAllcore_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
449 FillHistogram(Form("hMassPtV0CAllcore_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
451 FillHistogram(Form("hMassPtTPCAllcore_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
454 FillHistogram(Form("hPi0All_cen%d",fCentBin),m,pt, w) ;
455 FillHistogram(Form("hPi0Allcore_cen%d",fCentBin),mcore,ptcore, w) ;
456 if(ph1->IsntUnfolded() && ph2->IsntUnfolded()){
457 FillHistogram(Form("hPi0Allwou_cen%d",fCentBin),m,pt, w) ;
458 FillHistogram(Form("hMassPtV0AAllwou_cen%d",fCentBin),m,pt,dphiA, w) ;
459 FillHistogram(Form("hMassPtV0CAllwou_cen%d",fCentBin),m,pt,dphiC, w) ;
461 FillHistogram(Form("hMassPtTPCAllwou_cen%d",fCentBin),m,pt,dphiT, w) ;
464 FillHistogram(Form("hSingleAll_cen%d",fCentBin),m,pt1, w) ;
465 FillHistogram(Form("hSingleAll_cen%d",fCentBin),m,pt2, w) ;
466 FillHistogram(Form("hSingleAllcore_cen%d",fCentBin),mcore,ptcore1, w) ;
467 FillHistogram(Form("hSingleAllcore_cen%d",fCentBin),mcore,ptcore2, w) ;
468 if(ph1->IsntUnfolded())
469 FillHistogram(Form("hSingleAllwou_cen%d",fCentBin),m,pt1, w) ;
470 if(ph2->IsntUnfolded())
471 FillHistogram(Form("hSingleAllwou_cen%d",fCentBin),m,pt2, w) ;
473 FillHistogram(Form("hSingleCPV_cen%d",fCentBin),m,pt1, w) ;
474 FillHistogram(Form("hSingleCPVcore_cen%d",fCentBin),mcore,ptcore1, w) ;
477 FillHistogram(Form("hSingleCPV_cen%d",fCentBin),m,pt2, w) ;
478 FillHistogram(Form("hSingleCPVcore_cen%d",fCentBin),mcore,ptcore2, w) ;
481 FillHistogram(Form("hSingleCPV2_cen%d",fCentBin),m,pt1, w) ;
482 FillHistogram(Form("hSingleCPV2core_cen%d",fCentBin),mcore,ptcore2, w) ;
485 FillHistogram(Form("hSingleCPV2_cen%d",fCentBin),m,pt2, w) ;
486 FillHistogram(Form("hSingleCPV2core_cen%d",fCentBin),mcore,ptcore2, w) ;
489 FillHistogram(Form("hSingleDisp_cen%d",fCentBin),m,pt1, w) ;
490 if(ph1->IsntUnfolded()){
491 FillHistogram(Form("hSingleDispwou_cen%d",fCentBin),m,pt1, w) ;
493 FillHistogram(Form("hSingleDispcore_cen%d",fCentBin),mcore,ptcore1, w) ;
496 FillHistogram(Form("hSingleDisp_cen%d",fCentBin),m,pt2, w) ;
497 if(ph1->IsntUnfolded()){
498 FillHistogram(Form("hSingleDispwou_cen%d",fCentBin),m,pt2, w) ;
500 FillHistogram(Form("hSingleDispcore_cen%d",fCentBin),mcore,ptcore2, w) ;
502 if(ph1->IsDisp2OK()){
503 FillHistogram(Form("hSingleDisp2_cen%d",fCentBin),m,pt1, w) ;
504 FillHistogram(Form("hSingleDisp2core_cen%d",fCentBin),mcore,ptcore1, w) ;
506 if(ph2->IsDisp2OK()){
507 FillHistogram(Form("hSingleDisp2_cen%d",fCentBin),m,pt2, w) ;
508 FillHistogram(Form("hSingleDisp2core_cen%d",fCentBin),mcore,ptcore1, w) ;
510 if(ph1->IsDispOK() && ph1->IsCPVOK()){
511 FillHistogram(Form("hSingleBoth_cen%d",fCentBin),m,pt1, w) ;
512 FillHistogram(Form("hSingleBothcore_cen%d",fCentBin),mcore,ptcore1, w) ;
514 if(ph2->IsDispOK() && ph2->IsCPVOK()){
515 FillHistogram(Form("hSingleBoth_cen%d",fCentBin),m,pt2, w) ;
516 FillHistogram(Form("hSingleBothcore_cen%d",fCentBin),mcore,ptcore2, w) ;
518 if(ph1->IsDisp2OK() && ph1->IsCPVOK()){
519 FillHistogram(Form("hSingleBoth2_cen%d",fCentBin),m,pt1, w) ;
520 FillHistogram(Form("hSingleBoth2core_cen%d",fCentBin),mcore,ptcore1, w) ;
522 if(ph2->IsDisp2OK() && ph2->IsCPVOK()){
523 FillHistogram(Form("hSingleBoth2_cen%d",fCentBin),m,pt2, w) ;
524 FillHistogram(Form("hSingleBoth2core_cen%d",fCentBin),mcore,ptcore2, w) ;
529 FillHistogram(Form("hPi0All_a07_cen%d",fCentBin),m,pt, w) ;
532 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
533 snprintf(key,55,"hMassPtCPV_cen%d",fCentBin) ;
534 FillHistogram(Form("hMassPtV0ACPV_cen%d",fCentBin),m,pt,dphiA, w) ;
535 FillHistogram(Form("hMassPtV0CCPV_cen%d",fCentBin),m,pt,dphiC, w) ;
537 FillHistogram(Form("hMassPtTPCCPV_cen%d",fCentBin),m,pt,dphiT, w) ;
539 FillHistogram(Form("hMassPtV0ACPVcore_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
540 FillHistogram(Form("hMassPtV0CCPVcore_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
542 FillHistogram(Form("hMassPtTPCCPVcore_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
544 FillHistogram(Form("hPi0CPV_cen%d",fCentBin),m,pt, w) ;
545 FillHistogram(Form("hPi0CPVcore_cen%d",fCentBin),mcore, ptcore, w) ;
548 FillHistogram(Form("hPi0CPV_a07_cen%d",fCentBin),m,pt, w) ;
551 if(ph1->IsCPV2OK() && ph2->IsCPV2OK()){
552 FillHistogram(Form("hMassPtV0ACPV2_cen%d",fCentBin),m,pt,dphiA, w) ;
553 FillHistogram(Form("hMassPtV0CCPV2_cen%d",fCentBin),m,pt,dphiC, w) ;
555 FillHistogram(Form("hMassPtTPCCPV2_cen%d",fCentBin),m,pt,dphiT, w) ;
556 FillHistogram(Form("hMassPtV0ACPV2core_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
557 FillHistogram(Form("hMassPtV0CCPV2core_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
559 FillHistogram(Form("hMassPtTPCCPV2core_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
561 FillHistogram(Form("hPi0CPV2_cen%d",fCentBin),m,pt, w) ;
562 FillHistogram(Form("hPi0CPV2core_cen%d",fCentBin),mcore, ptcore, w) ;
564 FillHistogram(Form("hPi0CPV2_a07_cen%d",fCentBin),m,pt, w) ;
567 if(ph1->IsDispOK() && ph2->IsDispOK()){
568 snprintf(key,55,"hMassPtDisp_cen%d",fCentBin) ;
569 FillHistogram(Form("hMassPtV0ADisp_cen%d",fCentBin),m,pt,dphiA, w) ;
570 FillHistogram(Form("hMassPtV0CDisp_cen%d",fCentBin),m,pt,dphiC, w) ;
572 FillHistogram(Form("hMassPtTPCDisp_cen%d",fCentBin),m,pt,dphiT, w) ;
574 FillHistogram(Form("hMassPtV0ADispcore_cen%d",fCentBin),mcore, ptcore,dphiA, w) ;
575 FillHistogram(Form("hMassPtV0CDispcore_cen%d",fCentBin),mcore, ptcore,dphiC, w) ;
577 FillHistogram(Form("hMassPtTPCDispcore_cen%d",fCentBin),mcore, ptcore,dphiT, w) ;
579 FillHistogram(Form("hPi0Disp_cen%d",fCentBin),m,pt, w) ;
580 FillHistogram(Form("hPi0Dispcore_cen%d",fCentBin),mcore, ptcore, w) ;
582 if(ph1->IsntUnfolded() && ph2->IsntUnfolded()){
583 FillHistogram(Form("hPi0Dispwou_cen%d",fCentBin),m,pt, w) ;
585 FillHistogram(Form("hMassPtV0ADispwou_cen%d",fCentBin),m,pt,dphiA, w) ;
586 FillHistogram(Form("hMassPtV0CDispwou_cen%d",fCentBin),m,pt,dphiC, w) ;
588 FillHistogram(Form("hMassPtTPCDispwou_cen%d",fCentBin),m,pt,dphiT, w) ;
592 FillHistogram(Form("hPi0Disp_a07_cen%d",fCentBin),m,pt, w) ;
594 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
595 FillHistogram(Form("hMassPtV0ABoth_cen%d",fCentBin),m,pt,dphiA, w) ;
596 FillHistogram(Form("hMassPtV0CBoth_cen%d",fCentBin),m,pt,dphiC, w) ;
598 FillHistogram(Form("hMassPtTPCBoth_cen%d",fCentBin),m,pt,dphiT, w) ;
600 FillHistogram(Form("hMassPtV0ABothcore_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
601 FillHistogram(Form("hMassPtV0CBothcore_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
603 FillHistogram(Form("hMassPtTPCBothcore_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
605 FillHistogram(Form("hPi0Both_cen%d",fCentBin),m,pt, w) ;
606 FillHistogram(Form("hPi0Bothcore_cen%d",fCentBin),mcore,ptcore, w) ;
609 snprintf(key,55,"hPi0Both_a07_cen%d",fCentBin) ;
610 FillHistogram(Form("hPi0Both_a07_cen%d",fCentBin),m,pt, w) ;
612 if(ph1->Module()==1 && ph2->Module()==1)
613 FillHistogram("hPi0M11", m, pt, w) ;
614 else if(ph1->Module()==2 && ph2->Module()==2)
615 FillHistogram("hPi0M22", m, pt, w) ;
616 else if(ph1->Module()==3 && ph2->Module()==3)
617 FillHistogram("hPi0M33", m, pt, w) ;
618 else if(ph1->Module()==1 && ph2->Module()==2)
619 FillHistogram("hPi0M12", m, pt, w) ;
620 else if(ph1->Module()==1 && ph2->Module()==3)
621 FillHistogram("hPi0M13", m, pt, w) ;
622 else if(ph1->Module()==2 && ph2->Module()==3)
623 FillHistogram("hPi0M23", m, pt, w) ;
630 if(ph1->IsDisp2OK() && ph2->IsDisp2OK()){
631 FillHistogram(Form("hPi0Disp2_cen%d",fCentBin),m,pt,w) ;
632 FillHistogram(Form("hPi0Disp2core_cen%d",fCentBin),mcore, ptcore, w) ;
634 FillHistogram(Form("hMassPtV0ADisp2_cen%d",fCentBin),m,pt,dphiA, w) ;
635 FillHistogram(Form("hMassPtV0CDisp2_cen%d",fCentBin),m,pt,dphiC, w) ;
637 FillHistogram(Form("hMassPtTPCDisp2_cen%d",fCentBin),m,pt,dphiT, w) ;
639 FillHistogram(Form("hMassPtV0ADisp2core_cen%d",fCentBin),mcore, ptcore,dphiA, w) ;
640 FillHistogram(Form("hMassPtV0CDisp2core_cen%d",fCentBin),mcore, ptcore,dphiC, w) ;
642 FillHistogram(Form("hMassPtTPCDisp2core_cen%d",fCentBin),mcore, ptcore,dphiT, w) ;
644 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
645 FillHistogram(Form("hMassPtV0ABoth2_cen%d",fCentBin),m,pt,dphiA, w) ;
646 FillHistogram(Form("hMassPtV0CBoth2_cen%d",fCentBin),m,pt,dphiC, w) ;
648 FillHistogram(Form("hMassPtTPCBoth2_cen%d",fCentBin),m,pt,dphiT, w) ;
650 FillHistogram(Form("hMassPtV0ABoth2core_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
651 FillHistogram(Form("hMassPtV0CBoth2core_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
653 FillHistogram(Form("hMassPtTPCBoth2core_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
655 FillHistogram(Form("hPi0Both2_cen%d",fCentBin),m,pt, w) ;
656 FillHistogram(Form("hPi0Both2core_cen%d",fCentBin),mcore,ptcore, w) ;
664 //________________________________________________________________________
665 void AliAnalysisTaskPi0FlowMCAOD::ConsiderPi0sMix()
669 TList * arrayList = GetCaloPhotonsPHOSList(fVtxBin, fCentBin, fEMRPBin);
671 for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
672 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
673 const Double_t w1 = ph1->GetWeight();
674 for(Int_t evi=0; evi<arrayList->GetEntries();evi++){
675 TObjArray * mixPHOS = static_cast<TObjArray*>(arrayList->At(evi));
676 for(Int_t i2=0; i2<mixPHOS->GetEntriesFast();i2++){
677 AliCaloPhoton * ph2=(AliCaloPhoton*)mixPHOS->At(i2) ;
678 TLorentzVector p12 = *ph1 + *ph2;
679 TLorentzVector pv12 = *(ph1->GetMomV2()) + *(ph2->GetMomV2());
681 const Double_t w2 = ph2->GetWeight();
682 Double_t w = TMath::Sqrt(w1*w2);
684 Double_t dphiA=p12.Phi()-fRPV0A ;
685 while(dphiA<0)dphiA+=TMath::Pi() ;
686 while(dphiA>TMath::Pi())dphiA-=TMath::Pi() ;
688 Double_t dphiC=p12.Phi()-fRPV0C ;
689 while(dphiC<0)dphiC+=TMath::Pi() ;
690 while(dphiC>TMath::Pi())dphiC-=TMath::Pi() ;
692 Double_t dphiT=p12.Phi()-fRP ;
693 while(dphiT<0)dphiT+=TMath::Pi() ;
694 while(dphiT>TMath::Pi())dphiT-=TMath::Pi() ;
697 Double_t a=TMath::Abs((ph1->E()-ph2->E())/(ph1->E()+ph2->E())) ;
699 Double_t mcore=pv12.M() ;
700 Double_t pt=p12.Pt() ;
701 Double_t ptcore=pv12.Pt() ;
702 Double_t pt1=ph1->Pt() ;
703 Double_t pt2=ph2->Pt() ;
704 Double_t ptcore1=ph1->GetMomV2()->Pt() ;
705 Double_t ptcore2=ph2->GetMomV2()->Pt() ;
708 snprintf(key,55,"hMiMassPtAll_cen%d",fCentBin) ;
709 FillHistogram(Form("hMiMassPtV0AAll_cen%d",fCentBin),m,pt,dphiA, w) ;
710 FillHistogram(Form("hMiMassPtV0CAll_cen%d",fCentBin),m,pt,dphiC, w) ;
712 FillHistogram(Form("hMiMassPtTPCAll_cen%d",fCentBin),m,pt,dphiT, w) ;
714 FillHistogram(Form("hMiMassPtV0AAllcore_cen%d",fCentBin),mcore, ptcore, dphiA, w) ;
715 FillHistogram(Form("hMiMassPtV0CAllcore_cen%d",fCentBin),mcore, ptcore, dphiC, w) ;
717 FillHistogram(Form("hMiMassPtTPCAllcore_cen%d",fCentBin),mcore, ptcore, dphiT, w) ;
719 FillHistogram(Form("hMiPi0All_cen%d",fCentBin),m,pt, w) ;
720 FillHistogram(Form("hMiPi0Allcore_cen%d",fCentBin),mcore,ptcore, w) ;
721 if(ph1->IsntUnfolded() && ph2->IsntUnfolded()){
722 FillHistogram(Form("hMiPi0Allwou_cen%d",fCentBin),m,pt, w) ;
723 FillHistogram(Form("hMiMassPtV0AAllwou_cen%d",fCentBin),m,pt,dphiA, w) ;
724 FillHistogram(Form("hMiMassPtV0CAllwou_cen%d",fCentBin),m,pt,dphiC, w) ;
726 FillHistogram(Form("hMiMassPtTPCAllwou_cen%d",fCentBin),m,pt,dphiT, w) ;
729 FillHistogram(Form("hMiSingleAll_cen%d",fCentBin),m,pt1, w) ;
730 FillHistogram(Form("hMiSingleAll_cen%d",fCentBin),m,pt2, w) ;
731 FillHistogram(Form("hMiSingleAllcore_cen%d",fCentBin),mcore,ptcore1, w) ;
732 FillHistogram(Form("hMiSingleAllcore_cen%d",fCentBin),mcore,ptcore2, w) ;
733 if(ph1->IsntUnfolded())
734 FillHistogram(Form("hMiSingleAllwou_cen%d",fCentBin),m,pt1, w) ;
735 if(ph2->IsntUnfolded())
736 FillHistogram(Form("hMiSingleAllwou_cen%d",fCentBin),m,pt2, w) ;
738 FillHistogram(Form("hMiSingleCPV_cen%d",fCentBin),m,pt1, w) ;
739 FillHistogram(Form("hMiSingleCPVcore_cen%d",fCentBin),mcore,ptcore1, w) ;
742 FillHistogram(Form("hMiSingleCPV_cen%d",fCentBin),m,pt2, w) ;
743 FillHistogram(Form("hMiSingleCPVcore_cen%d",fCentBin),mcore,ptcore2, w) ;
746 FillHistogram(Form("hMiSingleCPV2_cen%d",fCentBin),m,pt1, w) ;
747 FillHistogram(Form("hMiSingleCPV2core_cen%d",fCentBin),mcore,ptcore1, w) ;
750 FillHistogram(Form("hMiSingleCPV2_cen%d",fCentBin),m,pt2, w) ;
751 FillHistogram(Form("hMiSingleCPV2core_cen%d",fCentBin),mcore,ptcore2, w) ;
754 FillHistogram(Form("hMiSingleDisp_cen%d",fCentBin),m,pt1, w) ;
755 if(ph1->IsntUnfolded()){
756 FillHistogram(Form("hMiSingleDispwou_cen%d",fCentBin),m,pt1, w) ;
758 FillHistogram(Form("hMiSingleDispcore_cen%d",fCentBin),mcore,ptcore1, w) ;
761 FillHistogram(Form("hMiSingleDisp_cen%d",fCentBin),m,pt2, w) ;
762 if(ph1->IsntUnfolded()){
763 FillHistogram(Form("hMiSingleDispwou_cen%d",fCentBin),m,pt2, w) ;
765 FillHistogram(Form("hMiSingleDispcore_cen%d",fCentBin),mcore,ptcore2, w) ;
767 if(ph1->IsDisp2OK()){
768 FillHistogram(Form("hMiSingleDisp2_cen%d",fCentBin),m,pt1, w) ;
769 FillHistogram(Form("hMiSingleDisp2core_cen%d",fCentBin),mcore,ptcore1, w) ;
771 if(ph2->IsDisp2OK()){
772 FillHistogram(Form("hMiSingleDisp2_cen%d",fCentBin),m,pt2, w) ;
773 FillHistogram(Form("hMiSingleDisp2core_cen%d",fCentBin),mcore,ptcore2, w) ;
775 if(ph1->IsDispOK() && ph1->IsCPVOK()){
776 snprintf(key,55,"hMiSingleBoth_cen%d",fCentBin) ;
777 FillHistogram(key,m,pt1, w) ;
778 snprintf(key,55,"hMiSingleBothcore_cen%d",fCentBin);
779 FillHistogram(key,mcore,ptcore1, w) ;
781 if(ph2->IsDispOK() && ph2->IsCPVOK()){
782 snprintf(key,55,"hMiSingleBoth_cen%d",fCentBin);
783 FillHistogram(key,m,pt2, w) ;
784 snprintf(key,55,"hMiSingleBothcore_cen%d",fCentBin);
785 FillHistogram(key,mcore,ptcore2, w) ;
787 if(ph1->IsDisp2OK() && ph1->IsCPVOK()){
788 FillHistogram(Form("hMiSingleBoth2_cen%d",fCentBin),m,pt1, w) ;
789 FillHistogram(Form("hMiSingleBoth2core_cen%d",fCentBin),mcore,ptcore1, w) ;
791 if(ph2->IsDisp2OK() && ph2->IsCPVOK()){
792 FillHistogram(Form("hMiSingleBoth2_cen%d",fCentBin),m,pt2, w) ;
793 FillHistogram(Form("hMiSingleBoth2core_cen%d",fCentBin),mcore,ptcore2, w) ;
799 FillHistogram(Form("hMiPi0All_a07_cen%d",fCentBin),m,pt, w) ;
801 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
802 FillHistogram(Form("hMiMassPtV0ACPV_cen%d",fCentBin),m,pt,dphiA, w) ;
803 FillHistogram(Form("hMiMassPtV0CCPV_cen%d",fCentBin),m,pt,dphiC, w) ;
805 FillHistogram(Form("hMiMassPtTPCCPV_cen%d",fCentBin),m,pt,dphiT, w) ;
807 FillHistogram(Form("hMiMassPtV0ACPVcore_cen%d",fCentBin),mcore, ptcore,dphiA, w) ;
808 FillHistogram(Form("hMiMassPtV0CCPVcore_cen%d",fCentBin),mcore, ptcore,dphiC, w) ;
810 FillHistogram(Form("hMiMassPtTPCCPVcore_cen%d",fCentBin),mcore, ptcore,dphiT, w) ;
812 FillHistogram(Form("hMiPi0CPV_cen%d",fCentBin),m,pt, w) ;
813 FillHistogram(Form("hMiPi0CPVcore_cen%d",fCentBin),mcore, ptcore, w) ;
816 FillHistogram(Form("hMiPi0CPV_a07_cen%d",fCentBin),m,pt, w) ;
819 if(ph1->IsCPV2OK() && ph2->IsCPV2OK()){
820 FillHistogram(Form("hMiPi0CPV2_cen%d",fCentBin),m,pt, w) ;
821 FillHistogram(Form("hMiPi0CPV2core_cen%d",fCentBin),mcore, ptcore, w) ;
823 FillHistogram(Form("hMiMassPtV0ACPV2_cen%d",fCentBin),m,pt,dphiA, w) ;
824 FillHistogram(Form("hMiMassPtV0CCPV2_cen%d",fCentBin),m,pt,dphiC, w) ;
826 FillHistogram(Form("hMiMassPtTPCCPV2_cen%d",fCentBin),m,pt,dphiT, w) ;
827 FillHistogram(Form("hMiMassPtV0ACPV2core_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
828 FillHistogram(Form("hMiMassPtV0CCPV2core_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
830 FillHistogram(Form("hMiMassPtTPCCPV2core_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
833 FillHistogram(Form("hMiPi0CPV2_a07_cen%d",fCentBin),m,pt, w) ;
836 if(ph1->IsDispOK() && ph2->IsDispOK()){
837 FillHistogram(Form("hMiMassPtV0ADisp_cen%d",fCentBin),m,pt,dphiA, w) ;
838 FillHistogram(Form("hMiMassPtV0CDisp_cen%d",fCentBin),m,pt,dphiC, w) ;
840 FillHistogram(Form("hMiMassPtTPCDisp_cen%d",fCentBin),m,pt,dphiT, w) ;
842 FillHistogram(Form("hMiMassPtV0ADispcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiA, w) ;
843 FillHistogram(Form("hMiMassPtV0CDispcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiC, w) ;
845 FillHistogram(Form("hMiMassPtTPCDispcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiT, w) ;
848 FillHistogram(Form("hMiPi0Disp_cen%d",fCentBin),m,pt, w) ;
849 FillHistogram(Form("hMiPi0Dispcore_cen%d",fCentBin),pv12.M(),pv12.Pt(), w) ;
850 if(ph1->IsntUnfolded() && ph2->IsntUnfolded()){
851 FillHistogram(Form("hMiPi0Dispwou_cen%d",fCentBin),m,pt, w) ;
852 FillHistogram(Form("hMiMassPtV0ADispwou_cen%d",fCentBin),m,pt,dphiA, w) ;
853 FillHistogram(Form("hMiMassPtV0CDispwou_cen%d",fCentBin),m,pt,dphiC, w) ;
855 FillHistogram(Form("hMiMassPtTPCDispwou_cen%d",fCentBin),m,pt,dphiT, w) ;
859 FillHistogram(Form("hMiPi0Disp_a07_cen%d",fCentBin),m,pt, w) ;
861 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
862 FillHistogram(Form("hMiMassPtV0ABoth_cen%d",fCentBin),m,pt,dphiA, w) ;
863 FillHistogram(Form("hMiMassPtV0CBoth_cen%d",fCentBin),m,pt,dphiC, w) ;
865 FillHistogram(Form("hMiMassPtTPCBoth_cen%d",fCentBin),m,pt,dphiT, w) ;
867 FillHistogram(Form("hMiMassPtV0ABothcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiA, w) ;
868 FillHistogram(Form("hMiMassPtV0CBothcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiC, w) ;
870 FillHistogram(Form("hMiMassPtTPCBothcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiT, w) ;
872 FillHistogram(Form("hMiPi0Both_cen%d",fCentBin),m,pt, w) ;
873 FillHistogram(Form("hMiPi0Bothcore_cen%d",fCentBin),pv12.M(),pv12.Pt(), w) ;
876 FillHistogram(Form("hMiPi0Both_a07_cen%d",fCentBin),m,pt, w) ;
881 if(ph1->IsDisp2OK() && ph2->IsDisp2OK()){
882 FillHistogram(Form("hMiMassPtV0ADisp2_cen%d",fCentBin),m,pt,dphiA, w) ;
883 FillHistogram(Form("hMiMassPtV0CDisp2_cen%d",fCentBin),m,pt,dphiC, w) ;
885 FillHistogram(Form("hMiMassPtTPCDisp2_cen%d",fCentBin),m,pt,dphiT, w) ;
887 FillHistogram(Form("hMiMassPtV0ADisp2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiA, w) ;
888 FillHistogram(Form("hMiMassPtV0CDisp2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiC, w) ;
890 FillHistogram(Form("hMiMassPtTPCDisp2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiT, w) ;
893 FillHistogram(Form("hMiPi0Disp2_cen%d",fCentBin),m,pt, w) ;
894 FillHistogram(Form("hMiPi0Disp2core_cen%d",fCentBin),pv12.M(),pv12.Pt(), w) ;
896 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
897 FillHistogram(Form("hMiMassPtV0ABoth2_cen%d",fCentBin),m,pt,dphiA, w) ;
898 FillHistogram(Form("hMiMassPtV0CBoth2_cen%d",fCentBin),m,pt,dphiC, w) ;
900 FillHistogram(Form("hMiMassPtTPCBoth2_cen%d",fCentBin),m,pt,dphiT, w) ;
902 FillHistogram(Form("hMiMassPtV0ABoth2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiA, w) ;
903 FillHistogram(Form("hMiMassPtV0CBoth2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiC, w) ;
905 FillHistogram(Form("hMiMassPtTPCBoth2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiT, w) ;
907 FillHistogram(Form("hMiPi0Both2_cen%d",fCentBin),m,pt, w) ;
908 FillHistogram(Form("hMiPi0Both2core_cen%d",fCentBin),pv12.M(),pv12.Pt(), w) ;
918 void AliAnalysisTaskPi0FlowMCAOD::ProcessMC()
926 //___________________________________________________________________________
927 void AliAnalysisTaskPi0FlowMCAOD::FillMCHist(){
928 //fill histograms for efficiensy etc. calculation
930 //---------First pi0/eta-----------------------------
931 char partName[10] ; char hkey[55] ;
932 Int_t ntrack = fMcArray->GetEntriesFast();
934 for(Int_t i=0;i<ntrack;i++){
935 AliAODMCParticle* particle = GetParticle(i);
937 if(particle->PdgCode() == kPi0)
938 snprintf(partName,10,"pi0") ;
940 if(particle->PdgCode() == kEta)
941 snprintf(partName,10,"eta") ;
943 if(particle->PdgCode() == kGamma)
944 snprintf(partName,10,"gamma") ;
946 if(particle->PdgCode() == 310)
947 snprintf(partName,10,"K0S") ;
951 Double_t r = R(particle) ;
952 Double_t pt = particle->Pt() ;
953 //Distribution over vertex
954 FillHistogram(Form("hMC_%s_vertex",partName),pt,r) ;
959 Double_t phi=particle->Phi() ;
960 while(phi<0.)phi+=TMath::TwoPi() ;
961 while(phi>TMath::TwoPi())phi-=TMath::TwoPi() ;
963 Double_t phig = 180./TMath::Pi()*phi; // phi in deg
965 //Total number of pi0 with creation radius <1 cm
966 Double_t weight = PrimaryParticleWeight(particle) ;
967 snprintf(hkey,55,"hMC_all_%s_cen%d",partName,fCentBin) ;
969 FillHistogram(hkey,pt,weight) ;
971 if(TMath::Abs(particle->Y())<0.135 && phig>260. && phig<320.){
972 snprintf(hkey,55,"hMC_unitEta_%s_cen%d",partName,fCentBin) ;
973 FillHistogram(hkey,pt,weight) ;
975 snprintf(hkey,55,"hMC_rap_%s_cen%d",partName,fCentBin) ;
976 FillHistogram(hkey,particle->Y(),weight) ;
978 snprintf(hkey,55,"hMC_phi_%s_cen%d",partName,fCentBin) ;
979 FillHistogram(hkey,phi,weight) ;
987 //________________________________________________________________________
988 void AliAnalysisTaskPi0FlowMCAOD::FillSecondaries()
992 //Fill spectra of primary particles
997 Int_t ntrack = fMcArray->GetEntriesFast();
999 for(Int_t i=0; i<ntrack; i++){
1000 AliAODMCParticle* p = GetParticle(i);
1004 if( TMath::Abs(p->Pt())<1.e-6 )
1006 if(TMath::Abs(p->Y())>0.5)
1008 Double_t w = PrimaryParticleWeight(p) ;
1009 Int_t primPdgCode=p->PdgCode() ;
1010 switch(primPdgCode){
1011 case kGamma: FillHistogram(Form("hPrimPhot_cen%d",fCentBin),p->Pt(),w);
1015 FillHistogram(Form("hPrimEl_cen%d",fCentBin),p->Pt(),w);
1018 FillHistogram(Form("hPrimPi0_cen%d",fCentBin),p->Pt(),w);
1021 FillHistogram(Form("hPrimEta_cen%d",fCentBin),p->Pt(),w);
1025 FillHistogram(Form("hPrimPipm_cen%d",fCentBin),p->Pt(),w);
1028 FillHistogram(Form("hPrimP_cen%d",fCentBin),p->Pt(),w);
1030 case kProtonBar: //pbar
1031 FillHistogram(Form("hPrimPbar_cen%d",fCentBin),p->Pt(),w);
1034 FillHistogram(Form("hPrimN_cen%d",fCentBin),p->Pt(),w);
1036 case kNeutronBar: //nbar
1037 FillHistogram(Form("hPrimNbar_cen%d",fCentBin),p->Pt(),w);
1040 FillHistogram(Form("hPrimK0S_cen%d",fCentBin),p->Pt(),w);
1043 FillHistogram(Form("hPrimK0L_cen%d",fCentBin),p->Pt(),w);
1047 FillHistogram(Form("hPrimKpm_cen%d",fCentBin),p->Pt(),w);
1050 FillHistogram(Form("hPrimOther_cen%d",fCentBin),p->Pt(),w);
1054 AliInfo("Origins of secondary pi0s");
1055 //Origins of secondary pi0s
1056 for(Int_t i=0; i<ntrack; i++){
1057 AliAODMCParticle* p = GetParticle(i);
1058 if(p->PdgCode()!=111)
1060 FillHistogram("Vertex",p->Pt(),R(p));
1063 Double_t phi=p->Phi() ;
1064 while(phi<0.)phi+=TMath::TwoPi() ;
1065 while(phi>TMath::TwoPi())phi-=TMath::TwoPi() ;
1066 FillHistogram("hSecondPi0RphiZ",R(p),phi,p->Zv()) ;
1067 Double_t w = PrimaryParticleWeight(p) ;
1068 FillHistogram("hSecondPi0RE",R(p),p->Pt(),w) ;
1073 Int_t inPHOS=fCaloPhotonsPHOS->GetEntries() ;
1074 for (Int_t i1=0; i1<inPHOS-1; i1++) {
1075 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
1076 Double_t w1=ph1->GetWeight() ;
1077 for (Int_t i2=i1+1; i2<inPHOS; i2++) {
1078 AliCaloPhoton * ph2=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i2) ;
1079 TLorentzVector p12 = *ph1 + *ph2;
1080 Double_t w2=ph2->GetWeight() ;
1081 Double_t w = TMath::Sqrt(w1*w2) ;
1082 FillHistogram(Form("hParentAll_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1083 Int_t prim=FindCommonParent(ph1->GetPrimary(),ph2->GetPrimary()) ;
1085 AliAODMCParticle * particle = GetParticle(prim);
1086 FillHistogram("hMass_R",p12.M(),p12.Pt(),R(particle)) ;
1089 Int_t pdgCode=particle->PdgCode() ;
1090 if(pdgCode!=111){ //common parent - not pi0
1092 FillHistogram(Form("hParentGamma_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1094 if(pdgCode==11 || pdgCode==-11){
1095 FillHistogram(Form("hParentEl_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1098 if(InPi0mass(p12.M() ,p12.Pt())){
1099 if(fDebug >1) AliInfo(Form("Common parent: %d",pdgCode));
1101 FillHistogram(Form("hParentOther_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1104 }//Common parent not pi0
1105 else{ //common parent - pi0
1106 FillHistogram(Form("hParentPi0_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1107 FillHistogram(Form("Real_pi_R"),p12.M(),p12.Pt(),R(particle),w) ;
1108 FillHistogram(Form("Real_pi_Z"),p12.M(),p12.Pt(),particle->Zv(),w) ;
1109 if(R(particle)<kRCut && TMath::Abs(particle->Zv())<fMaxAbsVertexZ){
1110 FillHistogram(Form("hParentDirPi0_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1113 //Common particle pi0, created off-vertex
1114 Int_t primPi0 = particle->GetMother();
1116 FillHistogram(Form("hParentPi0NoPrim_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1119 Int_t primPdgCode=((AliAODMCParticle *)fMcArray->At(primPi0))->PdgCode();
1120 switch(primPdgCode){
1121 case 221: FillHistogram(Form("hParentPi0Eta_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //eta
1123 case 223: FillHistogram(Form("hParentPi0Omega_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //omega
1126 case -211: FillHistogram(Form("hParentPi0Pipm_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //
1129 case -321: FillHistogram(Form("hParentPi0Kpm_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //
1131 case 310: FillHistogram(Form("hParentPi0Ks_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; // K0S
1133 case 130: FillHistogram(Form("hParentPi0Kl_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; // K0L
1137 FillHistogram(Form("hParentPi0pn_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; // pn
1141 FillHistogram(Form("hParentPi0antipn_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; // pn
1144 FillHistogram(Form("hParentPi0Other_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //
1147 }//common parent - pi0
1148 }//there is common primary
1149 }//seond photon loop
1150 }//first photon loop
1153 //Now look at photon contaiminations
1154 for (Int_t i1=0; i1<inPHOS-1; i1++) {
1156 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
1157 Int_t iprim = ph1->GetPrimary() ;
1159 FillAllHistograms(Form("hGammaNoPrim_cen%d",fCentBin),ph1) ; //
1161 //Find primary at vertex
1162 AliAODMCParticle * primPHOS = GetParticle(iprim);
1163 Int_t iprimV = primPHOS->GetMother();
1164 AliAODMCParticle * primVtx = primPHOS ;
1165 while((iprimV>-1) && R(primVtx)>kRCut){
1166 primVtx = GetParticle(iprimV);
1167 iprimV = primVtx->GetMother();
1171 Int_t primPdgCode=primVtx->PdgCode() ;
1172 switch(primPdgCode){
1173 case 22: FillAllHistograms("hGammaPhot",ph1);
1177 FillAllHistograms("hGammaEl",ph1);
1180 FillAllHistograms("hGammaPi0",ph1);
1183 FillAllHistograms("hGammaEta",ph1);
1185 case 223: FillAllHistograms("hGammaOmega",ph1) ; //omega
1189 FillAllHistograms("hGammaPipm",ph1);
1190 //Find particle entered PHOS
1191 if(primVtx == primPHOS)
1192 FillAllHistograms("hGammaPipmDirect",ph1);
1194 Int_t primPdgPHOS=primPHOS->PdgCode() ;
1195 if(primPdgPHOS==22){
1196 FillAllHistograms("hGammaPipmGamma",ph1);
1197 FillHistogram("hPipmGammaConvR",ph1->Pt(),R(primPHOS));
1198 FillHistogram("hPipmGammaConvRZ",primPHOS->Zv(),R(primPHOS));
1201 if(TMath::Abs(primPdgPHOS)==11){
1202 FillAllHistograms("hGammaPipmEl",ph1);
1203 FillHistogram("hPipmElConvR",ph1->Pt(),R(primPHOS));
1206 if(TMath::Abs(primPdgPHOS)==2212){
1207 FillAllHistograms("hGammaPipmp",ph1);
1208 FillHistogram("hPipmNConvR",ph1->Pt(),R(primPHOS));
1211 if(TMath::Abs(primPdgPHOS)==2112){
1212 FillAllHistograms("hGammaPipmn",ph1);
1213 FillHistogram("hPipmNConvR",ph1->Pt(),R(primPHOS));
1216 FillAllHistograms("hGammaPipmOther",ph1);
1217 FillHistogram("hPipmOtherConvR",ph1->Pt(),R(primPHOS));
1221 FillAllHistograms("hGammaP",ph1);
1224 FillAllHistograms("hGammaPbar",ph1);
1227 FillAllHistograms("hGammaN",ph1);
1230 FillAllHistograms("hGammaNbar",ph1) ; // pn
1233 FillAllHistograms("hGammaK0S",ph1) ; // pn
1236 FillAllHistograms("hGammaK0L",ph1) ; // pn
1240 FillAllHistograms("hGammaKpm",ph1) ; // pn
1245 case 313: FillAllHistograms("hGammaKstar",ph1) ; // K*(892)
1248 case -2224 : //Deltas
1249 case 2224 : //Deltas
1250 case -2214 : //Deltas
1251 case 2214 : //Deltas
1252 case -2114 : //Deltas
1253 case 2114 : //Deltas
1254 case -1114 : //Deltas
1255 case 1114 : //Deltas
1256 FillAllHistograms("hGammaDelta",ph1) ; // pn
1259 if(primVtx->Charge())
1260 FillAllHistograms("hGammaOtherCharged",ph1) ; //
1262 FillAllHistograms("hGammaOtherNeutral",ph1) ; //
1270 //_____________________________________________________________________________
1271 void AliAnalysisTaskPi0FlowMCAOD::FillAllHistograms(const char * particleName,AliCaloPhoton * ph)
1273 //Fill All PID histograms
1275 Double_t w=ph->GetWeight() ;
1276 Double_t pt = ph->Pt() ;
1277 Double_t ptC=ph->GetMomV2()->Pt() ;
1278 FillHistogram(Form("%s_All_cen%d",particleName,fCentBin),pt,w) ;
1279 FillHistogram(Form("%s_Allcore_cen%d",particleName,fCentBin),ptC,w) ;
1281 FillHistogram(Form("%s_CPV_cen%d",particleName,fCentBin),pt,w) ;
1282 FillHistogram(Form("%s_CPVcore_cen%d",particleName,fCentBin),ptC,w) ;
1285 FillHistogram(Form("%s_CPV2_cen%d",particleName,fCentBin),pt,w) ;
1286 FillHistogram(Form("%s_CPV2core_cen%d",particleName,fCentBin),ptC,w) ;
1289 FillHistogram(Form("%s_Disp_cen%d",particleName,fCentBin),pt,w) ;
1290 FillHistogram(Form("%s_Dispcore_cen%d",particleName,fCentBin),ptC,w) ;
1291 if(ph->IsDisp2OK()){
1292 FillHistogram(Form("%s_Disp2_cen%d",particleName,fCentBin),pt,w) ;
1293 FillHistogram(Form("%s_Disp2core_cen%d",particleName,fCentBin),ptC,w) ;
1296 FillHistogram(Form("%s_Both_cen%d",particleName,fCentBin),pt,w) ;
1297 FillHistogram(Form("%s_Bothcore_cen%d",particleName,fCentBin),ptC,w) ;
1303 //___________________________________________________________________________
1304 Double_t AliAnalysisTaskPi0FlowMCAOD::PrimaryWeight(Int_t /* primary */){
1307 //________________________________________________________________________
1308 Double_t AliAnalysisTaskPi0FlowMCAOD::PrimaryParticleWeight(AliAODMCParticle * /* particle */){
1312 //________________________________________________________________________
1313 TClonesArray* AliAnalysisTaskPi0FlowMCAOD::GetMCArray()
1316 AliAODInputHandler* aodHandler=dynamic_cast<AliAODInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
1319 AliAODEvent *aod=aodHandler->GetEvent();
1321 fMcArray = dynamic_cast<TClonesArray*>(aod->FindListObject(AliAODMCParticle::StdBranchName()));
1322 if (!fMcArray) AliError("Could not retrieve MC array!");
1324 else AliError("Could not retrieve AOD event!");
1330 AliAODMCParticle* AliAnalysisTaskPi0FlowMCAOD::GetParticle(Int_t particlepos) {
1331 //Returns particle at given position.
1334 AliError("MC array is not initialized, run GetMCArray() first!");
1338 return (AliAODMCParticle *) fMcArray->At(particlepos);
1342 Int_t AliAnalysisTaskPi0FlowMCAOD::FindPrimary(AliVCluster*clu, Bool_t&sure){
1343 //Finds primary and estimates if it unique one?
1344 //First check can it be photon/electron
1346 const Double_t emFraction=0.9; //part of energy of cluster to be assigned to EM particle
1347 Int_t n = clu->GetNLabels();
1349 for(Int_t i=0; i<n; i++){
1350 Int_t label = clu->GetLabelAt(i);
1351 AliAODMCParticle* p= GetParticle(label) ;
1352 Int_t pdg = p->PdgCode() ;
1353 if(pdg==22 || pdg==11 || pdg == -11){
1354 if(p->E()>emFraction*clu->E()){
1361 Double_t* Ekin= new Double_t[n] ;
1363 for(Int_t i=0; i<n; i++){
1364 AliAODMCParticle* p = GetParticle(clu->GetLabelAt(i)) ;
1365 Ekin[i]=p->P() ; // estimate of kinetic energy
1366 if(p->PdgCode()==-2212 || p->PdgCode()==-2112){
1367 Ekin[i]+=1.8 ; //due to annihilation
1371 Double_t eMax=0.,eSubMax=0. ;
1372 for(Int_t i=0; i<n; i++){
1379 if(eSubMax>0.8*eMax)//not obvious primary
1384 return clu->GetLabelAt(iMax);
1387 //________________________________________________________________________
1388 Int_t AliAnalysisTaskPi0FlowMCAOD::FindCommonParent(Int_t iPart, Int_t jPart){
1389 //check if there is a common parent for particles i and j
1390 // -1: no common parent or wrong iPart/jPart
1392 Int_t ntrack = fMcArray->GetEntriesFast();
1393 if(iPart==-1 || iPart>=ntrack || jPart==-1 || jPart>=ntrack) return -1;
1395 Int_t iprim1 = iPart;
1403 iprim2 = GetParticle(iprim2)->GetMother();
1406 iprim1 = GetParticle(iprim1)->GetMother();
1411 //________________________________________________________________________
1412 Bool_t AliAnalysisTaskPi0FlowMCAOD::HaveParent(Int_t iPart, Int_t pdgParent){
1413 //check if there is a common parent for particles i and j
1414 // -1: no common parent or wrong iPart/jPart
1416 Int_t ntrack = fMcArray->GetEntriesFast();
1417 if(iPart==-1 || iPart>=ntrack) return -1;
1421 AliAODMCParticle * tmp = GetParticle(iprim1) ;
1422 if(tmp->PdgCode()==pdgParent)
1424 iprim1 = tmp->GetMother();
1428 //________________________________________________________________________
1429 Bool_t AliAnalysisTaskPi0FlowMCAOD::InPi0mass(Double_t m, Double_t /*pt*/){
1431 return TMath::Abs(m-0.135)<0.007*2.5 ;
1434 //________________________________________________________________________
1435 Double32_t AliAnalysisTaskPi0FlowMCAOD::R(AliAODMCParticle* p) {
1438 Double32_t x = p->Xv();
1439 Double32_t y = p->Yv();
1440 Double32_t z = p->Zv();
1442 return x*x + y*y + z*z;