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
24 #include "TObjArray.h"
31 #include "TParticle.h"
36 #include "THashList.h"
41 #include "AliAnalysisManager.h"
42 #include "AliMCEventHandler.h"
43 #include "AliMCEvent.h"
45 #include "AliAnalysisTaskSE.h"
46 #include "AliPHOSHijingEfficiency.h"
47 #include "AliCaloPhoton.h"
48 #include "AliPHOSGeometry.h"
49 #include "AliPHOSEsdCluster.h"
50 #include "AliPHOSCalibData.h"
51 #include "AliESDEvent.h"
52 #include "AliESDCaloCells.h"
53 #include "AliESDVertex.h"
54 #include "AliESDtrackCuts.h"
57 #include "AliCDBManager.h"
58 #include "AliCentrality.h"
59 #include "AliESDtrackCuts.h"
60 #include "AliEventplane.h"
63 #include "AliOADBContainer.h"
66 #include "AliAnalysisTaskPi0Flow.h"
67 #include "AliAnalysisTaskPi0FlowMC.h"
69 ClassImp(AliAnalysisTaskPi0FlowMC);
73 //TODO: Geometry IHEP?
77 const Double_t AliAnalysisTaskPi0FlowMC::kRCut = 1.;
79 AliAnalysisTaskPi0FlowMC::AliAnalysisTaskPi0FlowMC(const char* name, AliAnalysisTaskPi0Flow::Period period)
80 : AliAnalysisTaskPi0Flow(name, period),
85 AliAnalysisTaskPi0FlowMC::~AliAnalysisTaskPi0FlowMC()
89 void AliAnalysisTaskPi0FlowMC::UserCreateOutputObjects()
91 // Do standard Pi0Flow CreateOuputObjects
92 AliAnalysisTaskPi0Flow::UserCreateOutputObjects();
94 // MC Generated histograms
96 for(Int_t cent=0; cent < fCentEdges.GetSize()-1; cent++){
97 snprintf(key,55,"hMC_rap_gamma_cen%d",cent) ;
98 fOutputContainer->Add(new TH1F(key,"Rapidity pi0",200,-1.,1.)) ;
99 snprintf(key,55,"hMC_rap_pi0_cen%d",cent) ;
100 fOutputContainer->Add(new TH1F(key,"Rapidity pi0",200,-1.,1.)) ;
101 snprintf(key,55,"hMC_rap_eta_cen%d",cent) ;
102 fOutputContainer->Add(new TH1F(key,"Rapidity eta",200,-1.,1.)) ;
103 snprintf(key,55,"hMC_phi_gamma_cen%d",cent) ;
104 fOutputContainer->Add(new TH1F(key,"Phi pi0",200,0.,TMath::TwoPi())) ;
105 snprintf(key,55,"hMC_phi_pi0_cen%d",cent) ;
106 fOutputContainer->Add(new TH1F(key,"Phi pi0",200,0.,TMath::TwoPi())) ;
107 snprintf(key,55,"hMC_phi_eta_cen%d",cent) ;
108 fOutputContainer->Add(new TH1F(key,"Phi eta",200,0.,TMath::TwoPi())) ;
109 snprintf(key,55,"hMC_all_gamma_cen%d",cent) ;
110 fOutputContainer->Add(new TH1F(key,"Rapidity photon",250,0.,25.)) ;
111 snprintf(key,55,"hMC_all_pi0_cen%d",cent) ;
112 fOutputContainer->Add(new TH1F(key,"Rapidity pi0",250,0.,25.)) ;
113 snprintf(key,55,"hMC_all_eta_cen%d",cent) ;
114 fOutputContainer->Add(new TH1F(key,"Rapidity eta",250,0.,25.)) ;
115 snprintf(key,55,"hMC_unitEta_gamma_cen%d",cent) ;
116 fOutputContainer->Add(new TH1F(key,"Pt photon",250,0.,25.)) ;
117 snprintf(key,55,"hMC_unitEta_pi0_cen%d",cent) ;
118 fOutputContainer->Add(new TH1F(key,"Rapidity eta",250,0.,25.)) ;
119 snprintf(key,55,"hMC_unitEta_eta_cen%d",cent) ;
120 fOutputContainer->Add(new TH1F(key,"Rapidity eta",250,0.,25.)) ;
122 snprintf(key,55,"hMC_all_K0S_cen%d",cent) ;
123 fOutputContainer->Add(new TH1F(key,"Rapidity photon",250,0.,25.)) ;
125 snprintf(key,55,"hMC_unitEta_K0S_cen%d",cent) ;
126 fOutputContainer->Add(new TH1F(key,"Rapidity eta",250,0.,25.)) ;
129 fOutputContainer->Add(new TH2F("hMC_gamma_vertex","Creation vertex",25,0.,25.,1000,0.,500.)) ;
130 fOutputContainer->Add(new TH2F("hMC_pi0_vertex","Creation vertex",25,0.,25.,1000,0.,500.)) ;
131 fOutputContainer->Add(new TH2F("hMC_eta_vertex","Creation vertex",25,0.,25.,1000,0.,500.)) ;
137 fOutputContainer->Add(new TH2F("Vertex","Pi0 creation vertex",nPt,ptMin,ptMax,5000,0.,500.));
138 fOutputContainer->Add(new TH3F("hSecondPi0RphiZ","Secondary pi0 vertex",450,0.,450.,100,0.,TMath::TwoPi(),200,-100.,100.));
139 fOutputContainer->Add(new TH2F("hSecondPi0RE","Secondary pi0 vertex",450,0.,450.,200,0.,20.));
140 fOutputContainer->Add(new TH3F("hMass_R","Mass vs radius any parent",50,0.,0.25,100,0.,10.,300,0.,600.));
141 fOutputContainer->Add(new TH3F("Real_pi_R","All clusters",50,0.,0.25,100,0.,10.,250,0.,500.));
142 fOutputContainer->Add(new TH3F("Real_pi_Z","All clusters",50,0.,0.25,100,0.,10.,100,-100.,100.));
143 // fOutputContainer->Add(new TH2F(Form("Real_npnp_RZ"),"All clusters",250,0.,500.,100,-100.,100.));
144 // fOutputContainer->Add(new TH3F(Form("Real_mass_R"),"All clusters",50,0.,0.25,100,0.,10.,300,0.,600.));
146 const Int_t nM = 500;
147 const Double_t mMin = 0.0;
148 const Double_t mMax = 1.0;
150 for(Int_t cen=0; cen < fCentEdges.GetSize()-1; cen++){
151 fOutputContainer->Add(new TH1F(Form("hPrimPhot_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
152 fOutputContainer->Add(new TH1F(Form("hPrimEl_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
153 fOutputContainer->Add(new TH1F(Form("hPrimPi0_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
154 fOutputContainer->Add(new TH1F(Form("hPrimEta_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
155 fOutputContainer->Add(new TH1F(Form("hPrimPipm_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
156 fOutputContainer->Add(new TH1F(Form("hPrimP_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
157 fOutputContainer->Add(new TH1F(Form("hPrimPbar_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
158 fOutputContainer->Add(new TH1F(Form("hPrimN_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
159 fOutputContainer->Add(new TH1F(Form("hPrimNbar_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
160 fOutputContainer->Add(new TH1F(Form("hPrimK0S_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
161 fOutputContainer->Add(new TH1F(Form("hPrimK0L_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
162 fOutputContainer->Add(new TH1F(Form("hPrimKpm_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
163 fOutputContainer->Add(new TH1F(Form("hPrimOther_cen%d",cen),"Primary spetrum",nPt,ptMin,ptMax));
165 //pairs from common parents
166 fOutputContainer->Add(new TH2F(Form("hParentAll_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
167 fOutputContainer->Add(new TH2F(Form("hParentK0s_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
168 fOutputContainer->Add(new TH2F(Form("hParentGamma_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
169 fOutputContainer->Add(new TH2F(Form("hParentEl_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
170 fOutputContainer->Add(new TH2F(Form("hParentOther_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
171 fOutputContainer->Add(new TH2F(Form("hParentPi0_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
172 fOutputContainer->Add(new TH2F(Form("hParentDirPi0_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
174 //common parent - pi0
175 fOutputContainer->Add(new TH2F(Form("hParentPi0NoPrim_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
176 fOutputContainer->Add(new TH2F(Form("hParentPi0Eta_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
177 fOutputContainer->Add(new TH2F(Form("hParentPi0Omega_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
178 fOutputContainer->Add(new TH2F(Form("hParentPi0Pipm_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
179 fOutputContainer->Add(new TH2F(Form("hParentPi0Kpm_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
180 fOutputContainer->Add(new TH2F(Form("hParentPi0Ks_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
181 fOutputContainer->Add(new TH2F(Form("hParentPi0Kl_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
182 fOutputContainer->Add(new TH2F(Form("hParentPi0pn_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
183 fOutputContainer->Add(new TH2F(Form("hParentPi0antipn_cen%d",cen),"All clusters",nM,mMin,mMax,nPt,ptMin,ptMax));
188 //Photon contaminations
189 fOutputContainer->Add(new TH2F("hPipmGammaConvR","Conversion radius" ,200,0.,20.,1000,0.,500.));
190 fOutputContainer->Add(new TH2F("hPipmElConvR","Conversion radius" ,200,0.,20.,1000,0.,500.));
191 fOutputContainer->Add(new TH2F("hPipmNConvR","Conversion radius" ,200,0.,20.,1000,0.,500.));
192 fOutputContainer->Add(new TH2F("hPipmOtherConvR","Conversion radius" ,200,0.,20.,1000,0.,500.));
193 fOutputContainer->Add(new TH2F("hPipmGammaConvRZ","Conversion radius" ,400,-200.,200.,1000,0.,500.));
195 const Int_t nTypes=24 ;
196 char partTypes[nTypes][55] ;
197 snprintf(partTypes[0],55,"hGammaNoPrim") ; //
198 snprintf(partTypes[1],55,"hGammaPhot") ; //
199 snprintf(partTypes[2],55,"hGammaEl") ; //
200 snprintf(partTypes[3],55,"hGammaPi0") ; //
201 snprintf(partTypes[4],55,"hGammaEta") ; //
202 snprintf(partTypes[5],55,"hhGammaOmega") ; //
203 snprintf(partTypes[6],55,"hGammaPipm") ; //
204 snprintf(partTypes[7],55,"hGammaP") ; //
205 snprintf(partTypes[8],55,"hGammaPbar") ; //
206 snprintf(partTypes[9],55,"hGammaN") ; //
207 snprintf(partTypes[10],55,"hGammaNbar") ; //
208 snprintf(partTypes[11],55,"hGammaK0S") ; //
209 snprintf(partTypes[12],55,"hGammaK0L") ; //
210 snprintf(partTypes[13],55,"hGammaKpm") ; //
211 snprintf(partTypes[14],55,"hGammaKstar") ; //
212 snprintf(partTypes[15],55,"hGammaDelta") ; //
213 snprintf(partTypes[16],55,"hGammaOtherCharged") ; //
214 snprintf(partTypes[17],55,"hGammaOtherNeutral") ; //
215 snprintf(partTypes[18],55,"hGammaPipmGamma") ; //
216 snprintf(partTypes[19],55,"hGammaPipmEl") ; //
217 snprintf(partTypes[20],55,"hGammaPipmOther") ; //
218 snprintf(partTypes[21],55,"hGammaPipmDirect") ; //
219 snprintf(partTypes[22],55,"hGammaPipmp") ; //
220 snprintf(partTypes[23],55,"hGammaPipmn") ; //
222 const Int_t nPID=12 ;
224 snprintf(cPID[0],25,"All") ;
225 snprintf(cPID[1],25,"Allcore") ;
226 snprintf(cPID[2],25,"CPV") ;
227 snprintf(cPID[3],25,"CPVcore") ;
228 snprintf(cPID[4],25,"CPV2") ;
229 snprintf(cPID[5],25,"CPV2core") ;
230 snprintf(cPID[6],25,"Disp") ;
231 snprintf(cPID[7],25,"Dispcore") ;
232 snprintf(cPID[8],25,"Disp2") ;
233 snprintf(cPID[9],25,"Disp2core") ;
234 snprintf(cPID[10],25,"Both") ;
235 snprintf(cPID[11],25,"Bothcore") ;
237 for(Int_t itype=0; itype<nTypes; itype++){
238 for(Int_t iPID=0; iPID<nPID; iPID++){
239 for(Int_t cen=0; cen<5; cen++){
240 fOutputContainer->Add(new TH1F(Form("%s_%s_cen%d",partTypes[itype],cPID[iPID],cen),"Cluster parents",nPt,ptMin,ptMax));
245 PostData(1, fOutputContainer);
248 void AliAnalysisTaskPi0FlowMC::UserExec(Option_t* option)
250 fStack = GetMCStack();
252 AliAnalysisTaskPi0Flow::UserExec(option);
256 void AliAnalysisTaskPi0FlowMC::SelectPhotonClusters()
258 AliAnalysisTaskPi0Flow::SelectPhotonClusters();
260 for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
261 AliCaloPhoton * photon = (AliCaloPhoton*)fCaloPhotonsPHOS->At(i1);
262 AliVCluster* cluster = photon->GetCluster();
264 Int_t primary=FindPrimary(cluster,sure) ;
265 photon->SetPrimary(primary);
266 photon->SetWeight(PrimaryWeight(primary)) ;
268 TParticle* p = fStack->Particle(primary);
271 if(p->GetPdgCode()==11 || p->GetPdgCode()==-11) continue;
272 else { fCaloPhotonsPHOS->Remove(photon); fCaloPhotonsPHOS->Compress(); }
277 void AliAnalysisTaskPi0FlowMC::FillSelectedClusterHistograms()
279 for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
280 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
282 Double_t dphiA=ph1->Phi()-fRPV0A ;
283 while(dphiA<0)dphiA+=TMath::Pi() ;
284 while(dphiA>TMath::Pi())dphiA-=TMath::Pi() ;
286 Double_t dphiC=ph1->Phi()-fRPV0C ;
287 while(dphiC<0)dphiC+=TMath::Pi() ;
288 while(dphiC>TMath::Pi())dphiC-=TMath::Pi() ;
290 Double_t dphiT=ph1->Phi()-fRP ;
291 while(dphiT<0)dphiT+=TMath::Pi() ;
292 while(dphiT>TMath::Pi())dphiT-=TMath::Pi() ;
294 Double_t pt = ph1->Pt() ;
295 Double_t ptcore = ph1->GetMomV2()->Pt() ;
296 Double_t w = ph1->GetWeight();
298 FillHistogram(Form("hPhotPhiV0AAll_cen%d",fCentBin),pt,dphiA, w) ;
299 FillHistogram(Form("hPhotPhiV0CAll_cen%d",fCentBin),pt,dphiC, w) ;
301 FillHistogram(Form("hPhotPhiTPCAll_cen%d",fCentBin),pt,dphiT, w) ;
302 FillHistogram(Form("hPhotPhiV0AAllcore_cen%d",fCentBin),ptcore,dphiA, w) ;
303 FillHistogram(Form("hPhotPhiV0CAllcore_cen%d",fCentBin),ptcore,dphiC, w) ;
305 FillHistogram(Form("hPhotPhiTPCAllcore_cen%d",fCentBin),ptcore,dphiT, w) ;
307 FillHistogram(Form("hPhotAll_cen%d",fCentBin),pt, w) ;
308 FillHistogram(Form("hPhotAllcore_cen%d",fCentBin),ptcore, w) ;
309 if(ph1->IsntUnfolded()){
310 FillHistogram(Form("hPhotAllwou_cen%d",fCentBin),pt, w) ;
311 FillHistogram(Form("hPhotPhiV0AAllwou_cen%d",fCentBin),pt,dphiA, w) ;
312 FillHistogram(Form("hPhotPhiV0CAllwou_cen%d",fCentBin),pt,dphiC, w) ;
314 FillHistogram(Form("hPhotPhiTPCAllwou_cen%d",fCentBin),pt,dphiT, w) ;
317 FillHistogram(Form("hPhotPhiV0ACPV_cen%d",fCentBin),pt,dphiA, w) ;
318 FillHistogram(Form("hPhotPhiV0CCPV_cen%d",fCentBin),pt,dphiC, w) ;
320 FillHistogram(Form("hPhotPhiTPCCPV_cen%d",fCentBin),pt,dphiT, w) ;
322 FillHistogram(Form("hPhotPhiV0ACPVcore_cen%d",fCentBin),ptcore,dphiA, w) ;
323 FillHistogram(Form("hPhotPhiV0CCPVcore_cen%d",fCentBin),ptcore,dphiC, w) ;
325 FillHistogram(Form("hPhotPhiTPCCPVcore_cen%d",fCentBin),ptcore,dphiT, w) ;
327 FillHistogram(Form("hPhotCPV_cen%d",fCentBin),pt, w) ;
328 FillHistogram(Form("hPhotCPVcore_cen%d",fCentBin),ptcore, w) ;
331 FillHistogram(Form("hPhotPhiV0ACPV2_cen%d",fCentBin),pt,dphiA, w) ;
332 FillHistogram(Form("hPhotPhiV0CCPV2_cen%d",fCentBin),pt,dphiC, w) ;
334 FillHistogram(Form("hPhotPhiTPCCPV2_cen%d",fCentBin),pt,dphiT, w) ;
336 FillHistogram(Form("hPhotPhiV0ACPV2core_cen%d",fCentBin),ptcore,dphiA, w) ;
337 FillHistogram(Form("hPhotPhiV0CCPV2core_cen%d",fCentBin),ptcore,dphiC, w) ;
339 FillHistogram(Form("hPhotPhiTPCCPV2core_cen%d",fCentBin),ptcore,dphiT, w) ;
340 FillHistogram(Form("hPhotCPV2_cen%d",fCentBin),pt, w) ;
341 FillHistogram(Form("hPhotCPV2core_cen%d",fCentBin),ptcore, w) ;
344 FillHistogram(Form("hPhotPhiV0ADisp_cen%d",fCentBin),pt,dphiA, w) ;
345 FillHistogram(Form("hPhotPhiV0CDisp_cen%d",fCentBin),pt,dphiC, w) ;
347 FillHistogram(Form("hPhotPhiTPCDisp_cen%d",fCentBin),pt,dphiT, w) ;
349 FillHistogram(Form("hPhotPhiV0ADispcore_cen%d",fCentBin),ptcore,dphiA, w) ;
350 FillHistogram(Form("hPhotPhiV0CDispcore_cen%d",fCentBin),ptcore,dphiC, w) ;
352 FillHistogram(Form("hPhotPhiTPCDispcore_cen%d",fCentBin),ptcore,dphiT, w) ;
354 if(ph1->IsntUnfolded()){
355 FillHistogram(Form("hPhotPhiV0ADispwou_cen%d",fCentBin),pt,dphiA, w) ;
356 FillHistogram(Form("hPhotPhiV0CDispwou_cen%d",fCentBin),pt,dphiC, w) ;
358 FillHistogram(Form("hPhotPhiTPCDispwou_cen%d",fCentBin),pt,dphiT, w) ;
361 FillHistogram(Form("hPhotDisp_cen%d",fCentBin),pt, w) ;
362 FillHistogram(Form("hPhotDispcore_cen%d",fCentBin),ptcore, w) ;
363 if(ph1->IsntUnfolded()){
364 FillHistogram(Form("hPhotDispwou_cen%d",fCentBin),pt, w) ;
367 FillHistogram(Form("hPhotPhiV0ABoth_cen%d",fCentBin),pt,dphiA, w) ;
368 FillHistogram(Form("hPhotPhiV0CBoth_cen%d",fCentBin),pt,dphiC, w) ;
370 FillHistogram(Form("hPhotPhiTPCBoth_cen%d",fCentBin),pt,dphiT, w) ;
372 FillHistogram(Form("hPhotPhiV0ABothcore_cen%d",fCentBin),ptcore,dphiA, w) ;
373 FillHistogram(Form("hPhotPhiV0CBothcore_cen%d",fCentBin),ptcore,dphiC, w) ;
375 FillHistogram(Form("hPhotPhiTPCBothcore_cen%d",fCentBin),ptcore,dphiT, w) ;
377 FillHistogram(Form("hPhotBoth_cen%d",fCentBin),pt, w) ;
378 FillHistogram(Form("hPhotBothcore_cen%d",fCentBin),ptcore, w) ;
381 if(ph1->IsDisp2OK()){
382 FillHistogram(Form("hPhotPhiV0ADisp2_cen%d",fCentBin),pt,dphiA, w) ;
383 FillHistogram(Form("hPhotPhiV0CDisp2_cen%d",fCentBin),pt,dphiC, w) ;
385 FillHistogram(Form("hPhotPhiTPCDisp2_cen%d",fCentBin),pt,dphiT, w) ;
386 FillHistogram(Form("hPhotPhiV0ADisp2core_cen%d",fCentBin),ptcore,dphiA, w) ;
387 FillHistogram(Form("hPhotPhiV0CDisp2core_cen%d",fCentBin),ptcore,dphiC, w) ;
389 FillHistogram(Form("hPhotPhiTPCDisp2core_cen%d",fCentBin),ptcore,dphiT, w) ;
391 FillHistogram(Form("hPhotDisp2_cen%d",fCentBin),pt, w) ;
392 FillHistogram(Form("hPhotDisp2core_cen%d",fCentBin),ptcore, w) ;
394 FillHistogram(Form("hPhotPhiV0ABoth2_cen%d",fCentBin),pt,dphiA, w) ;
395 FillHistogram(Form("hPhotPhiV0CBoth2_cen%d",fCentBin),pt,dphiC, w) ;
397 FillHistogram(Form("hPhotPhiTPCBoth2_cen%d",fCentBin),pt,dphiT, w) ;
399 FillHistogram(Form("hPhotPhiV0ABoth2core_cen%d",fCentBin),ptcore,dphiA, w) ;
400 FillHistogram(Form("hPhotPhiV0CBoth2core_cen%d",fCentBin),ptcore,dphiC, w) ;
402 FillHistogram(Form("hPhotPhiTPCBoth2core_cen%d",fCentBin),ptcore,dphiT, w) ;
404 FillHistogram(Form("hPhotBoth2_cen%d",fCentBin),pt, w) ;
405 FillHistogram(Form("hPhotBoth2core_cen%d",fCentBin),ptcore, w) ;
411 void AliAnalysisTaskPi0FlowMC::ConsiderPi0s()
414 for (Int_t i1=0; i1 < fCaloPhotonsPHOS->GetEntriesFast()-1; i1++) {
415 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
416 const Double_t w1 = ph1->GetWeight();
417 for (Int_t i2=i1+1; i2<fCaloPhotonsPHOS->GetEntriesFast(); i2++) {
418 AliCaloPhoton * ph2=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i2) ;
419 TLorentzVector p12 = *ph1 + *ph2;
420 TLorentzVector pv12 = *(ph1->GetMomV2()) + *(ph2->GetMomV2());
422 const Double_t w2 = ph2->GetWeight();
423 Double_t w = TMath::Sqrt(w1*w2);
425 FillHistogram("hPHOSphi",fCentrality,p12.Pt(),p12.Phi(), w) ;
426 Double_t dphiA=p12.Phi()-fRPV0A ;
427 while(dphiA<0)dphiA+=TMath::Pi() ;
428 while(dphiA>TMath::Pi())dphiA-=TMath::Pi() ;
430 Double_t dphiC=p12.Phi()-fRPV0C ;
431 while(dphiC<0)dphiC+=TMath::Pi() ;
432 while(dphiC>TMath::Pi())dphiC-=TMath::Pi() ;
434 Double_t dphiT=p12.Phi()-fRP ;
435 while(dphiT<0)dphiT+=TMath::Pi() ;
436 while(dphiT>TMath::Pi())dphiT-=TMath::Pi() ;
438 Double_t a=TMath::Abs((ph1->E()-ph2->E())/(ph1->E()+ph2->E())) ;
440 Double_t mcore=pv12.M() ;
441 Double_t pt=p12.Pt() ;
442 Double_t ptcore=pv12.Pt() ;
443 Double_t pt1=ph1->Pt() ;
444 Double_t pt2=ph2->Pt() ;
445 Double_t ptcore1=ph1->GetMomV2()->Pt() ;
446 Double_t ptcore2=ph2->GetMomV2()->Pt() ;
448 FillHistogram(Form("hMassPtV0AAll_cen%d",fCentBin),m,pt,dphiA, w) ;
449 FillHistogram(Form("hMassPtV0CAll_cen%d",fCentBin),m,pt,dphiC, w) ;
451 FillHistogram(Form("hMassPtTPCAll_cen%d",fCentBin),m,pt,dphiT, w) ;
453 FillHistogram(Form("hMassPtV0AAllcore_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
454 FillHistogram(Form("hMassPtV0CAllcore_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
456 FillHistogram(Form("hMassPtTPCAllcore_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
459 FillHistogram(Form("hPi0All_cen%d",fCentBin),m,pt, w) ;
460 FillHistogram(Form("hPi0Allcore_cen%d",fCentBin),mcore,ptcore, w) ;
461 if(ph1->IsntUnfolded() && ph2->IsntUnfolded()){
462 FillHistogram(Form("hPi0Allwou_cen%d",fCentBin),m,pt, w) ;
463 FillHistogram(Form("hMassPtV0AAllwou_cen%d",fCentBin),m,pt,dphiA, w) ;
464 FillHistogram(Form("hMassPtV0CAllwou_cen%d",fCentBin),m,pt,dphiC, w) ;
466 FillHistogram(Form("hMassPtTPCAllwou_cen%d",fCentBin),m,pt,dphiT, w) ;
469 FillHistogram(Form("hSingleAll_cen%d",fCentBin),m,pt1, w) ;
470 FillHistogram(Form("hSingleAll_cen%d",fCentBin),m,pt2, w) ;
471 FillHistogram(Form("hSingleAllcore_cen%d",fCentBin),mcore,ptcore1, w) ;
472 FillHistogram(Form("hSingleAllcore_cen%d",fCentBin),mcore,ptcore2, w) ;
473 if(ph1->IsntUnfolded())
474 FillHistogram(Form("hSingleAllwou_cen%d",fCentBin),m,pt1, w) ;
475 if(ph2->IsntUnfolded())
476 FillHistogram(Form("hSingleAllwou_cen%d",fCentBin),m,pt2, w) ;
478 FillHistogram(Form("hSingleCPV_cen%d",fCentBin),m,pt1, w) ;
479 FillHistogram(Form("hSingleCPVcore_cen%d",fCentBin),mcore,ptcore1, w) ;
482 FillHistogram(Form("hSingleCPV_cen%d",fCentBin),m,pt2, w) ;
483 FillHistogram(Form("hSingleCPVcore_cen%d",fCentBin),mcore,ptcore2, w) ;
486 FillHistogram(Form("hSingleCPV2_cen%d",fCentBin),m,pt1, w) ;
487 FillHistogram(Form("hSingleCPV2core_cen%d",fCentBin),mcore,ptcore2, w) ;
490 FillHistogram(Form("hSingleCPV2_cen%d",fCentBin),m,pt2, w) ;
491 FillHistogram(Form("hSingleCPV2core_cen%d",fCentBin),mcore,ptcore2, w) ;
494 FillHistogram(Form("hSingleDisp_cen%d",fCentBin),m,pt1, w) ;
495 if(ph1->IsntUnfolded()){
496 FillHistogram(Form("hSingleDispwou_cen%d",fCentBin),m,pt1, w) ;
498 FillHistogram(Form("hSingleDispcore_cen%d",fCentBin),mcore,ptcore1, w) ;
501 FillHistogram(Form("hSingleDisp_cen%d",fCentBin),m,pt2, w) ;
502 if(ph1->IsntUnfolded()){
503 FillHistogram(Form("hSingleDispwou_cen%d",fCentBin),m,pt2, w) ;
505 FillHistogram(Form("hSingleDispcore_cen%d",fCentBin),mcore,ptcore2, w) ;
507 if(ph1->IsDisp2OK()){
508 FillHistogram(Form("hSingleDisp2_cen%d",fCentBin),m,pt1, w) ;
509 FillHistogram(Form("hSingleDisp2core_cen%d",fCentBin),mcore,ptcore1, w) ;
511 if(ph2->IsDisp2OK()){
512 FillHistogram(Form("hSingleDisp2_cen%d",fCentBin),m,pt2, w) ;
513 FillHistogram(Form("hSingleDisp2core_cen%d",fCentBin),mcore,ptcore1, w) ;
515 if(ph1->IsDispOK() && ph1->IsCPVOK()){
516 FillHistogram(Form("hSingleBoth_cen%d",fCentBin),m,pt1, w) ;
517 FillHistogram(Form("hSingleBothcore_cen%d",fCentBin),mcore,ptcore1, w) ;
519 if(ph2->IsDispOK() && ph2->IsCPVOK()){
520 FillHistogram(Form("hSingleBoth_cen%d",fCentBin),m,pt2, w) ;
521 FillHistogram(Form("hSingleBothcore_cen%d",fCentBin),mcore,ptcore2, w) ;
523 if(ph1->IsDisp2OK() && ph1->IsCPVOK()){
524 FillHistogram(Form("hSingleBoth2_cen%d",fCentBin),m,pt1, w) ;
525 FillHistogram(Form("hSingleBoth2core_cen%d",fCentBin),mcore,ptcore1, w) ;
527 if(ph2->IsDisp2OK() && ph2->IsCPVOK()){
528 FillHistogram(Form("hSingleBoth2_cen%d",fCentBin),m,pt2, w) ;
529 FillHistogram(Form("hSingleBoth2core_cen%d",fCentBin),mcore,ptcore2, w) ;
534 FillHistogram(Form("hPi0All_a07_cen%d",fCentBin),m,pt, w) ;
537 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
538 snprintf(key,55,"hMassPtCPV_cen%d",fCentBin) ;
539 FillHistogram(Form("hMassPtV0ACPV_cen%d",fCentBin),m,pt,dphiA, w) ;
540 FillHistogram(Form("hMassPtV0CCPV_cen%d",fCentBin),m,pt,dphiC, w) ;
542 FillHistogram(Form("hMassPtTPCCPV_cen%d",fCentBin),m,pt,dphiT, w) ;
544 FillHistogram(Form("hMassPtV0ACPVcore_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
545 FillHistogram(Form("hMassPtV0CCPVcore_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
547 FillHistogram(Form("hMassPtTPCCPVcore_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
549 FillHistogram(Form("hPi0CPV_cen%d",fCentBin),m,pt, w) ;
550 FillHistogram(Form("hPi0CPVcore_cen%d",fCentBin),mcore, ptcore, w) ;
553 FillHistogram(Form("hPi0CPV_a07_cen%d",fCentBin),m,pt, w) ;
556 if(ph1->IsCPV2OK() && ph2->IsCPV2OK()){
557 FillHistogram(Form("hMassPtV0ACPV2_cen%d",fCentBin),m,pt,dphiA, w) ;
558 FillHistogram(Form("hMassPtV0CCPV2_cen%d",fCentBin),m,pt,dphiC, w) ;
560 FillHistogram(Form("hMassPtTPCCPV2_cen%d",fCentBin),m,pt,dphiT, w) ;
561 FillHistogram(Form("hMassPtV0ACPV2core_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
562 FillHistogram(Form("hMassPtV0CCPV2core_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
564 FillHistogram(Form("hMassPtTPCCPV2core_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
566 FillHistogram(Form("hPi0CPV2_cen%d",fCentBin),m,pt, w) ;
567 FillHistogram(Form("hPi0CPV2core_cen%d",fCentBin),mcore, ptcore, w) ;
569 FillHistogram(Form("hPi0CPV2_a07_cen%d",fCentBin),m,pt, w) ;
572 if(ph1->IsDispOK() && ph2->IsDispOK()){
573 snprintf(key,55,"hMassPtDisp_cen%d",fCentBin) ;
574 FillHistogram(Form("hMassPtV0ADisp_cen%d",fCentBin),m,pt,dphiA, w) ;
575 FillHistogram(Form("hMassPtV0CDisp_cen%d",fCentBin),m,pt,dphiC, w) ;
577 FillHistogram(Form("hMassPtTPCDisp_cen%d",fCentBin),m,pt,dphiT, w) ;
579 FillHistogram(Form("hMassPtV0ADispcore_cen%d",fCentBin),mcore, ptcore,dphiA, w) ;
580 FillHistogram(Form("hMassPtV0CDispcore_cen%d",fCentBin),mcore, ptcore,dphiC, w) ;
582 FillHistogram(Form("hMassPtTPCDispcore_cen%d",fCentBin),mcore, ptcore,dphiT, w) ;
584 FillHistogram(Form("hPi0Disp_cen%d",fCentBin),m,pt, w) ;
585 FillHistogram(Form("hPi0Dispcore_cen%d",fCentBin),mcore, ptcore, w) ;
587 if(ph1->IsntUnfolded() && ph2->IsntUnfolded()){
588 FillHistogram(Form("hPi0Dispwou_cen%d",fCentBin),m,pt, w) ;
590 FillHistogram(Form("hMassPtV0ADispwou_cen%d",fCentBin),m,pt,dphiA, w) ;
591 FillHistogram(Form("hMassPtV0CDispwou_cen%d",fCentBin),m,pt,dphiC, w) ;
593 FillHistogram(Form("hMassPtTPCDispwou_cen%d",fCentBin),m,pt,dphiT, w) ;
597 FillHistogram(Form("hPi0Disp_a07_cen%d",fCentBin),m,pt, w) ;
599 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
600 FillHistogram(Form("hMassPtV0ABoth_cen%d",fCentBin),m,pt,dphiA, w) ;
601 FillHistogram(Form("hMassPtV0CBoth_cen%d",fCentBin),m,pt,dphiC, w) ;
603 FillHistogram(Form("hMassPtTPCBoth_cen%d",fCentBin),m,pt,dphiT, w) ;
605 FillHistogram(Form("hMassPtV0ABothcore_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
606 FillHistogram(Form("hMassPtV0CBothcore_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
608 FillHistogram(Form("hMassPtTPCBothcore_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
610 FillHistogram(Form("hPi0Both_cen%d",fCentBin),m,pt, w) ;
611 FillHistogram(Form("hPi0Bothcore_cen%d",fCentBin),mcore,ptcore, w) ;
614 snprintf(key,55,"hPi0Both_a07_cen%d",fCentBin) ;
615 FillHistogram(Form("hPi0Both_a07_cen%d",fCentBin),m,pt, w) ;
617 if(ph1->Module()==1 && ph2->Module()==1)
618 FillHistogram("hPi0M11", m, pt, w) ;
619 else if(ph1->Module()==2 && ph2->Module()==2)
620 FillHistogram("hPi0M22", m, pt, w) ;
621 else if(ph1->Module()==3 && ph2->Module()==3)
622 FillHistogram("hPi0M33", m, pt, w) ;
623 else if(ph1->Module()==1 && ph2->Module()==2)
624 FillHistogram("hPi0M12", m, pt, w) ;
625 else if(ph1->Module()==1 && ph2->Module()==3)
626 FillHistogram("hPi0M13", m, pt, w) ;
627 else if(ph1->Module()==2 && ph2->Module()==3)
628 FillHistogram("hPi0M23", m, pt, w) ;
635 if(ph1->IsDisp2OK() && ph2->IsDisp2OK()){
636 FillHistogram(Form("hPi0Disp2_cen%d",fCentBin),m,pt,w) ;
637 FillHistogram(Form("hPi0Disp2core_cen%d",fCentBin),mcore, ptcore, w) ;
639 FillHistogram(Form("hMassPtV0ADisp2_cen%d",fCentBin),m,pt,dphiA, w) ;
640 FillHistogram(Form("hMassPtV0CDisp2_cen%d",fCentBin),m,pt,dphiC, w) ;
642 FillHistogram(Form("hMassPtTPCDisp2_cen%d",fCentBin),m,pt,dphiT, w) ;
644 FillHistogram(Form("hMassPtV0ADisp2core_cen%d",fCentBin),mcore, ptcore,dphiA, w) ;
645 FillHistogram(Form("hMassPtV0CDisp2core_cen%d",fCentBin),mcore, ptcore,dphiC, w) ;
647 FillHistogram(Form("hMassPtTPCDisp2core_cen%d",fCentBin),mcore, ptcore,dphiT, w) ;
649 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
650 FillHistogram(Form("hMassPtV0ABoth2_cen%d",fCentBin),m,pt,dphiA, w) ;
651 FillHistogram(Form("hMassPtV0CBoth2_cen%d",fCentBin),m,pt,dphiC, w) ;
653 FillHistogram(Form("hMassPtTPCBoth2_cen%d",fCentBin),m,pt,dphiT, w) ;
655 FillHistogram(Form("hMassPtV0ABoth2core_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
656 FillHistogram(Form("hMassPtV0CBoth2core_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
658 FillHistogram(Form("hMassPtTPCBoth2core_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
660 FillHistogram(Form("hPi0Both2_cen%d",fCentBin),m,pt, w) ;
661 FillHistogram(Form("hPi0Both2core_cen%d",fCentBin),mcore,ptcore, w) ;
669 //________________________________________________________________________
670 void AliAnalysisTaskPi0FlowMC::ConsiderPi0sMix()
674 TList * arrayList = GetCaloPhotonsPHOSList(fVtxBin, fCentBin, fEMRPBin);
676 for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
677 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
678 const Double_t w1 = ph1->GetWeight();
679 for(Int_t evi=0; evi<arrayList->GetEntries();evi++){
680 TObjArray * mixPHOS = static_cast<TObjArray*>(arrayList->At(evi));
681 for(Int_t i2=0; i2<mixPHOS->GetEntriesFast();i2++){
682 AliCaloPhoton * ph2=(AliCaloPhoton*)mixPHOS->At(i2) ;
683 TLorentzVector p12 = *ph1 + *ph2;
684 TLorentzVector pv12 = *(ph1->GetMomV2()) + *(ph2->GetMomV2());
686 const Double_t w2 = ph2->GetWeight();
687 Double_t w = TMath::Sqrt(w1*w2);
689 Double_t dphiA=p12.Phi()-fRPV0A ;
690 while(dphiA<0)dphiA+=TMath::Pi() ;
691 while(dphiA>TMath::Pi())dphiA-=TMath::Pi() ;
693 Double_t dphiC=p12.Phi()-fRPV0C ;
694 while(dphiC<0)dphiC+=TMath::Pi() ;
695 while(dphiC>TMath::Pi())dphiC-=TMath::Pi() ;
697 Double_t dphiT=p12.Phi()-fRP ;
698 while(dphiT<0)dphiT+=TMath::Pi() ;
699 while(dphiT>TMath::Pi())dphiT-=TMath::Pi() ;
702 Double_t a=TMath::Abs((ph1->E()-ph2->E())/(ph1->E()+ph2->E())) ;
704 Double_t mcore=pv12.M() ;
705 Double_t pt=p12.Pt() ;
706 Double_t ptcore=pv12.Pt() ;
707 Double_t pt1=ph1->Pt() ;
708 Double_t pt2=ph2->Pt() ;
709 Double_t ptcore1=ph1->GetMomV2()->Pt() ;
710 Double_t ptcore2=ph2->GetMomV2()->Pt() ;
713 snprintf(key,55,"hMiMassPtAll_cen%d",fCentBin) ;
714 FillHistogram(Form("hMiMassPtV0AAll_cen%d",fCentBin),m,pt,dphiA, w) ;
715 FillHistogram(Form("hMiMassPtV0CAll_cen%d",fCentBin),m,pt,dphiC, w) ;
717 FillHistogram(Form("hMiMassPtTPCAll_cen%d",fCentBin),m,pt,dphiT, w) ;
719 FillHistogram(Form("hMiMassPtV0AAllcore_cen%d",fCentBin),mcore, ptcore, dphiA, w) ;
720 FillHistogram(Form("hMiMassPtV0CAllcore_cen%d",fCentBin),mcore, ptcore, dphiC, w) ;
722 FillHistogram(Form("hMiMassPtTPCAllcore_cen%d",fCentBin),mcore, ptcore, dphiT, w) ;
724 FillHistogram(Form("hMiPi0All_cen%d",fCentBin),m,pt, w) ;
725 FillHistogram(Form("hMiPi0Allcore_cen%d",fCentBin),mcore,ptcore, w) ;
726 if(ph1->IsntUnfolded() && ph2->IsntUnfolded()){
727 FillHistogram(Form("hMiPi0Allwou_cen%d",fCentBin),m,pt, w) ;
728 FillHistogram(Form("hMiMassPtV0AAllwou_cen%d",fCentBin),m,pt,dphiA, w) ;
729 FillHistogram(Form("hMiMassPtV0CAllwou_cen%d",fCentBin),m,pt,dphiC, w) ;
731 FillHistogram(Form("hMiMassPtTPCAllwou_cen%d",fCentBin),m,pt,dphiT, w) ;
734 FillHistogram(Form("hMiSingleAll_cen%d",fCentBin),m,pt1, w) ;
735 FillHistogram(Form("hMiSingleAll_cen%d",fCentBin),m,pt2, w) ;
736 FillHistogram(Form("hMiSingleAllcore_cen%d",fCentBin),mcore,ptcore1, w) ;
737 FillHistogram(Form("hMiSingleAllcore_cen%d",fCentBin),mcore,ptcore2, w) ;
738 if(ph1->IsntUnfolded())
739 FillHistogram(Form("hMiSingleAllwou_cen%d",fCentBin),m,pt1, w) ;
740 if(ph2->IsntUnfolded())
741 FillHistogram(Form("hMiSingleAllwou_cen%d",fCentBin),m,pt2, w) ;
743 FillHistogram(Form("hMiSingleCPV_cen%d",fCentBin),m,pt1, w) ;
744 FillHistogram(Form("hMiSingleCPVcore_cen%d",fCentBin),mcore,ptcore1, w) ;
747 FillHistogram(Form("hMiSingleCPV_cen%d",fCentBin),m,pt2, w) ;
748 FillHistogram(Form("hMiSingleCPVcore_cen%d",fCentBin),mcore,ptcore2, w) ;
751 FillHistogram(Form("hMiSingleCPV2_cen%d",fCentBin),m,pt1, w) ;
752 FillHistogram(Form("hMiSingleCPV2core_cen%d",fCentBin),mcore,ptcore1, w) ;
755 FillHistogram(Form("hMiSingleCPV2_cen%d",fCentBin),m,pt2, w) ;
756 FillHistogram(Form("hMiSingleCPV2core_cen%d",fCentBin),mcore,ptcore2, w) ;
759 FillHistogram(Form("hMiSingleDisp_cen%d",fCentBin),m,pt1, w) ;
760 if(ph1->IsntUnfolded()){
761 FillHistogram(Form("hMiSingleDispwou_cen%d",fCentBin),m,pt1, w) ;
763 FillHistogram(Form("hMiSingleDispcore_cen%d",fCentBin),mcore,ptcore1, w) ;
766 FillHistogram(Form("hMiSingleDisp_cen%d",fCentBin),m,pt2, w) ;
767 if(ph1->IsntUnfolded()){
768 FillHistogram(Form("hMiSingleDispwou_cen%d",fCentBin),m,pt2, w) ;
770 FillHistogram(Form("hMiSingleDispcore_cen%d",fCentBin),mcore,ptcore2, w) ;
772 if(ph1->IsDisp2OK()){
773 FillHistogram(Form("hMiSingleDisp2_cen%d",fCentBin),m,pt1, w) ;
774 FillHistogram(Form("hMiSingleDisp2core_cen%d",fCentBin),mcore,ptcore1, w) ;
776 if(ph2->IsDisp2OK()){
777 FillHistogram(Form("hMiSingleDisp2_cen%d",fCentBin),m,pt2, w) ;
778 FillHistogram(Form("hMiSingleDisp2core_cen%d",fCentBin),mcore,ptcore2, w) ;
780 if(ph1->IsDispOK() && ph1->IsCPVOK()){
781 snprintf(key,55,"hMiSingleBoth_cen%d",fCentBin) ;
782 FillHistogram(key,m,pt1, w) ;
783 snprintf(key,55,"hMiSingleBothcore_cen%d",fCentBin);
784 FillHistogram(key,mcore,ptcore1, w) ;
786 if(ph2->IsDispOK() && ph2->IsCPVOK()){
787 snprintf(key,55,"hMiSingleBoth_cen%d",fCentBin);
788 FillHistogram(key,m,pt2, w) ;
789 snprintf(key,55,"hMiSingleBothcore_cen%d",fCentBin);
790 FillHistogram(key,mcore,ptcore2, w) ;
792 if(ph1->IsDisp2OK() && ph1->IsCPVOK()){
793 FillHistogram(Form("hMiSingleBoth2_cen%d",fCentBin),m,pt1, w) ;
794 FillHistogram(Form("hMiSingleBoth2core_cen%d",fCentBin),mcore,ptcore1, w) ;
796 if(ph2->IsDisp2OK() && ph2->IsCPVOK()){
797 FillHistogram(Form("hMiSingleBoth2_cen%d",fCentBin),m,pt2, w) ;
798 FillHistogram(Form("hMiSingleBoth2core_cen%d",fCentBin),mcore,ptcore2, w) ;
804 FillHistogram(Form("hMiPi0All_a07_cen%d",fCentBin),m,pt, w) ;
806 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
807 FillHistogram(Form("hMiMassPtV0ACPV_cen%d",fCentBin),m,pt,dphiA, w) ;
808 FillHistogram(Form("hMiMassPtV0CCPV_cen%d",fCentBin),m,pt,dphiC, w) ;
810 FillHistogram(Form("hMiMassPtTPCCPV_cen%d",fCentBin),m,pt,dphiT, w) ;
812 FillHistogram(Form("hMiMassPtV0ACPVcore_cen%d",fCentBin),mcore, ptcore,dphiA, w) ;
813 FillHistogram(Form("hMiMassPtV0CCPVcore_cen%d",fCentBin),mcore, ptcore,dphiC, w) ;
815 FillHistogram(Form("hMiMassPtTPCCPVcore_cen%d",fCentBin),mcore, ptcore,dphiT, w) ;
817 FillHistogram(Form("hMiPi0CPV_cen%d",fCentBin),m,pt, w) ;
818 FillHistogram(Form("hMiPi0CPVcore_cen%d",fCentBin),mcore, ptcore, w) ;
821 FillHistogram(Form("hMiPi0CPV_a07_cen%d",fCentBin),m,pt, w) ;
824 if(ph1->IsCPV2OK() && ph2->IsCPV2OK()){
825 FillHistogram(Form("hMiPi0CPV2_cen%d",fCentBin),m,pt, w) ;
826 FillHistogram(Form("hMiPi0CPV2core_cen%d",fCentBin),mcore, ptcore, w) ;
828 FillHistogram(Form("hMiMassPtV0ACPV2_cen%d",fCentBin),m,pt,dphiA, w) ;
829 FillHistogram(Form("hMiMassPtV0CCPV2_cen%d",fCentBin),m,pt,dphiC, w) ;
831 FillHistogram(Form("hMiMassPtTPCCPV2_cen%d",fCentBin),m,pt,dphiT, w) ;
832 FillHistogram(Form("hMiMassPtV0ACPV2core_cen%d",fCentBin),mcore,ptcore,dphiA, w) ;
833 FillHistogram(Form("hMiMassPtV0CCPV2core_cen%d",fCentBin),mcore,ptcore,dphiC, w) ;
835 FillHistogram(Form("hMiMassPtTPCCPV2core_cen%d",fCentBin),mcore,ptcore,dphiT, w) ;
838 FillHistogram(Form("hMiPi0CPV2_a07_cen%d",fCentBin),m,pt, w) ;
841 if(ph1->IsDispOK() && ph2->IsDispOK()){
842 FillHistogram(Form("hMiMassPtV0ADisp_cen%d",fCentBin),m,pt,dphiA, w) ;
843 FillHistogram(Form("hMiMassPtV0CDisp_cen%d",fCentBin),m,pt,dphiC, w) ;
845 FillHistogram(Form("hMiMassPtTPCDisp_cen%d",fCentBin),m,pt,dphiT, w) ;
847 FillHistogram(Form("hMiMassPtV0ADispcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiA, w) ;
848 FillHistogram(Form("hMiMassPtV0CDispcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiC, w) ;
850 FillHistogram(Form("hMiMassPtTPCDispcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiT, w) ;
853 FillHistogram(Form("hMiPi0Disp_cen%d",fCentBin),m,pt, w) ;
854 FillHistogram(Form("hMiPi0Dispcore_cen%d",fCentBin),pv12.M(),pv12.Pt(), w) ;
855 if(ph1->IsntUnfolded() && ph2->IsntUnfolded()){
856 FillHistogram(Form("hMiPi0Dispwou_cen%d",fCentBin),m,pt, w) ;
857 FillHistogram(Form("hMiMassPtV0ADispwou_cen%d",fCentBin),m,pt,dphiA, w) ;
858 FillHistogram(Form("hMiMassPtV0CDispwou_cen%d",fCentBin),m,pt,dphiC, w) ;
860 FillHistogram(Form("hMiMassPtTPCDispwou_cen%d",fCentBin),m,pt,dphiT, w) ;
864 FillHistogram(Form("hMiPi0Disp_a07_cen%d",fCentBin),m,pt, w) ;
866 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
867 FillHistogram(Form("hMiMassPtV0ABoth_cen%d",fCentBin),m,pt,dphiA, w) ;
868 FillHistogram(Form("hMiMassPtV0CBoth_cen%d",fCentBin),m,pt,dphiC, w) ;
870 FillHistogram(Form("hMiMassPtTPCBoth_cen%d",fCentBin),m,pt,dphiT, w) ;
872 FillHistogram(Form("hMiMassPtV0ABothcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiA, w) ;
873 FillHistogram(Form("hMiMassPtV0CBothcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiC, w) ;
875 FillHistogram(Form("hMiMassPtTPCBothcore_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiT, w) ;
877 FillHistogram(Form("hMiPi0Both_cen%d",fCentBin),m,pt, w) ;
878 FillHistogram(Form("hMiPi0Bothcore_cen%d",fCentBin),pv12.M(),pv12.Pt(), w) ;
881 FillHistogram(Form("hMiPi0Both_a07_cen%d",fCentBin),m,pt, w) ;
886 if(ph1->IsDisp2OK() && ph2->IsDisp2OK()){
887 FillHistogram(Form("hMiMassPtV0ADisp2_cen%d",fCentBin),m,pt,dphiA, w) ;
888 FillHistogram(Form("hMiMassPtV0CDisp2_cen%d",fCentBin),m,pt,dphiC, w) ;
890 FillHistogram(Form("hMiMassPtTPCDisp2_cen%d",fCentBin),m,pt,dphiT, w) ;
892 FillHistogram(Form("hMiMassPtV0ADisp2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiA, w) ;
893 FillHistogram(Form("hMiMassPtV0CDisp2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiC, w) ;
895 FillHistogram(Form("hMiMassPtTPCDisp2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiT, w) ;
898 FillHistogram(Form("hMiPi0Disp2_cen%d",fCentBin),m,pt, w) ;
899 FillHistogram(Form("hMiPi0Disp2core_cen%d",fCentBin),pv12.M(),pv12.Pt(), w) ;
901 if(ph1->IsCPVOK() && ph2->IsCPVOK()){
902 FillHistogram(Form("hMiMassPtV0ABoth2_cen%d",fCentBin),m,pt,dphiA, w) ;
903 FillHistogram(Form("hMiMassPtV0CBoth2_cen%d",fCentBin),m,pt,dphiC, w) ;
905 FillHistogram(Form("hMiMassPtTPCBoth2_cen%d",fCentBin),m,pt,dphiT, w) ;
907 FillHistogram(Form("hMiMassPtV0ABoth2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiA, w) ;
908 FillHistogram(Form("hMiMassPtV0CBoth2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiC, w) ;
910 FillHistogram(Form("hMiMassPtTPCBoth2core_cen%d",fCentBin),pv12.M(),pv12.Pt(),dphiT, w) ;
912 FillHistogram(Form("hMiPi0Both2_cen%d",fCentBin),m,pt, w) ;
913 FillHistogram(Form("hMiPi0Both2core_cen%d",fCentBin),pv12.M(),pv12.Pt(), w) ;
923 void AliAnalysisTaskPi0FlowMC::ProcessMC()
931 //___________________________________________________________________________
932 void AliAnalysisTaskPi0FlowMC::FillMCHist(){
933 //fill histograms for efficiensy etc. calculation
935 //---------First pi0/eta-----------------------------
940 for(Int_t i=0;i<fStack->GetNtrack();i++){
941 TParticle* particle = fStack->Particle(i);
942 if(particle->GetPdgCode() == kPi0)
943 snprintf(partName,10,"pi0") ;
945 if(particle->GetPdgCode() == kEta)
946 snprintf(partName,10,"eta") ;
948 if(particle->GetPdgCode() == kGamma)
949 snprintf(partName,10,"gamma") ;
951 if(particle->GetPdgCode() == 310)
952 snprintf(partName,10,"K0S") ;
957 Double_t r=particle->R() ;
958 Double_t pt = particle->Pt() ;
959 //Distribution over vertex
960 FillHistogram(Form("hMC_%s_vertex",partName),pt,r) ;
965 Double_t phi=particle->Phi() ;
966 while(phi<0.)phi+=TMath::TwoPi() ;
967 while(phi>TMath::TwoPi())phi-=TMath::TwoPi() ;
969 Double_t phig = 180./TMath::Pi()*phi; // phi in deg
971 //Total number of pi0 with creation radius <1 cm
972 Double_t weight = PrimaryParticleWeight(particle) ;
973 snprintf(hkey,55,"hMC_all_%s_cen%d",partName,fCentBin) ;
975 FillHistogram(hkey,pt,weight) ;
977 if(TMath::Abs(particle->Y())<0.135 && phig>260. && phig<320.){
978 snprintf(hkey,55,"hMC_unitEta_%s_cen%d",partName,fCentBin) ;
979 FillHistogram(hkey,pt,weight) ;
981 snprintf(hkey,55,"hMC_rap_%s_cen%d",partName,fCentBin) ;
982 FillHistogram(hkey,particle->Y(),weight) ;
984 snprintf(hkey,55,"hMC_phi_%s_cen%d",partName,fCentBin) ;
985 FillHistogram(hkey,phi,weight) ;
991 //________________________________________________________________________
992 void AliAnalysisTaskPi0FlowMC::FillSecondaries(){
995 //Fill spectra of primary particles
999 for(Int_t i=0; i<fStack->GetNtrack(); i++){
1000 TParticle * p = fStack->Particle(i) ;
1003 if( TMath::Abs(p->Pt())<1.e-6 )
1005 if(TMath::Abs(p->Y())>0.5)
1007 Double_t w = PrimaryParticleWeight(p) ;
1008 Int_t primPdgCode=p->GetPdgCode() ;
1009 switch(primPdgCode){
1010 case kGamma: FillHistogram(Form("hPrimPhot_cen%d",fCentBin),p->Pt(),w);
1014 FillHistogram(Form("hPrimEl_cen%d",fCentBin),p->Pt(),w);
1017 FillHistogram(Form("hPrimPi0_cen%d",fCentBin),p->Pt(),w);
1020 FillHistogram(Form("hPrimEta_cen%d",fCentBin),p->Pt(),w);
1024 FillHistogram(Form("hPrimPipm_cen%d",fCentBin),p->Pt(),w);
1027 FillHistogram(Form("hPrimP_cen%d",fCentBin),p->Pt(),w);
1029 case kProtonBar: //pbar
1030 FillHistogram(Form("hPrimPbar_cen%d",fCentBin),p->Pt(),w);
1033 FillHistogram(Form("hPrimN_cen%d",fCentBin),p->Pt(),w);
1035 case kNeutronBar: //nbar
1036 FillHistogram(Form("hPrimNbar_cen%d",fCentBin),p->Pt(),w);
1039 FillHistogram(Form("hPrimK0S_cen%d",fCentBin),p->Pt(),w);
1042 FillHistogram(Form("hPrimK0L_cen%d",fCentBin),p->Pt(),w);
1046 FillHistogram(Form("hPrimKpm_cen%d",fCentBin),p->Pt(),w);
1049 FillHistogram(Form("hPrimOther_cen%d",fCentBin),p->Pt(),w);
1053 AliInfo("Origins of secondary pi0s");
1054 //Origins of secondary pi0s
1055 for(Int_t i=0; i<fStack->GetNtrack(); i++){
1056 TParticle * p = fStack->Particle(i) ;
1057 if(p->GetPdgCode()!=111)
1059 FillHistogram("Vertex",p->Pt(),p->R());
1062 Double_t phi=p->Phi() ;
1063 while(phi<0.)phi+=TMath::TwoPi() ;
1064 while(phi>TMath::TwoPi())phi-=TMath::TwoPi() ;
1065 FillHistogram("hSecondPi0RphiZ",p->R(),phi,p->Vz()) ;
1066 Double_t w = PrimaryParticleWeight(p) ;
1067 FillHistogram("hSecondPi0RE",p->R(),p->Pt(),w) ;
1072 Int_t inPHOS=fCaloPhotonsPHOS->GetEntries() ;
1073 for (Int_t i1=0; i1<inPHOS-1; i1++) {
1074 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
1075 Double_t w1=ph1->GetWeight() ;
1076 for (Int_t i2=i1+1; i2<inPHOS; i2++) {
1077 AliCaloPhoton * ph2=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i2) ;
1078 TLorentzVector p12 = *ph1 + *ph2;
1079 Double_t w2=ph2->GetWeight() ;
1080 Double_t w = TMath::Sqrt(w1*w2) ;
1081 FillHistogram(Form("hParentAll_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1082 Int_t prim=FindCommonParent(ph1->GetPrimary(),ph2->GetPrimary()) ;
1084 TParticle * particle = (TParticle *)fStack->Particle(prim);
1085 FillHistogram("hMass_R",p12.M(),p12.Pt(),TMath::Sqrt(particle->R()*particle->R()+particle->Vz()*particle->Vz())) ;
1088 Int_t pdgCode=particle->GetPdgCode() ;
1089 if(pdgCode!=111){ //common parent - not pi0
1091 FillHistogram(Form("hParentGamma_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1093 if(pdgCode==11 || pdgCode==-11){
1094 FillHistogram(Form("hParentEl_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1097 if(InPi0mass(p12.M() ,p12.Pt())){
1098 if(fDebug >1) AliInfo(Form("Common parent: %d",pdgCode));
1100 FillHistogram(Form("hParentOther_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1103 }//Common parent not pi0
1104 else{ //common parent - pi0
1105 FillHistogram(Form("hParentPi0_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1106 FillHistogram(Form("Real_pi_R"),p12.M(),p12.Pt(),particle->R(),w) ;
1107 FillHistogram(Form("Real_pi_Z"),p12.M(),p12.Pt(),particle->Vz(),w) ;
1108 if(particle->R()<kRCut && TMath::Abs(particle->Vz())<fMaxAbsVertexZ){
1109 FillHistogram(Form("hParentDirPi0_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1112 //Common particle pi0, created off-vertex
1113 Int_t primPi0=particle->GetFirstMother();
1115 FillHistogram(Form("hParentPi0NoPrim_cen%d",fCentBin),p12.M(),p12.Pt(),w) ;
1118 Int_t primPdgCode=fStack->Particle(primPi0)->GetPdgCode() ;
1119 switch(primPdgCode){
1120 case 221: FillHistogram(Form("hParentPi0Eta_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //eta
1122 case 223: FillHistogram(Form("hParentPi0Omega_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //omega
1125 case -211: FillHistogram(Form("hParentPi0Pipm_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //
1128 case -321: FillHistogram(Form("hParentPi0Kpm_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //
1130 case 310: FillHistogram(Form("hParentPi0Ks_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; // K0S
1132 case 130: FillHistogram(Form("hParentPi0Kl_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; // K0L
1136 FillHistogram(Form("hParentPi0pn_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; // pn
1140 FillHistogram(Form("hParentPi0antipn_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; // pn
1143 FillHistogram(Form("hParentPi0Other_cen%d",fCentBin),p12.M(),p12.Pt(),w) ; //
1146 }//common parent - pi0
1147 }//there is common primary
1148 }//seond photon loop
1149 }//first photon loop
1152 //Now look at photon contaiminations
1153 for (Int_t i1=0; i1<inPHOS-1; i1++) {
1154 AliCaloPhoton * ph1=(AliCaloPhoton*)fCaloPhotonsPHOS->At(i1) ;
1155 Int_t iprim = ph1->GetPrimary() ;
1157 FillAllHistograms(Form("hGammaNoPrim_cen%d",fCentBin),ph1) ; //
1159 //Find primary at vertex
1160 TParticle * primPHOS = fStack->Particle(iprim) ;
1161 Int_t iprimV=primPHOS->GetFirstMother();
1162 TParticle * primVtx = primPHOS ;
1163 while((iprimV>-1) && primVtx->R()>kRCut){
1164 primVtx = fStack->Particle(iprimV) ;
1165 iprimV=primVtx->GetFirstMother();
1169 Int_t primPdgCode=primVtx->GetPdgCode() ;
1170 switch(primPdgCode){
1171 case 22: FillAllHistograms("hGammaPhot",ph1);
1175 FillAllHistograms("hGammaEl",ph1);
1178 FillAllHistograms("hGammaPi0",ph1);
1181 FillAllHistograms("hGammaEta",ph1);
1183 case 223: FillAllHistograms("hGammaOmega",ph1) ; //omega
1187 FillAllHistograms("hGammaPipm",ph1);
1188 //Find particle entered PHOS
1189 if(primVtx == primPHOS)
1190 FillAllHistograms("hGammaPipmDirect",ph1);
1192 Int_t primPdgPHOS=primPHOS->GetPdgCode() ;
1193 if(primPdgPHOS==22){
1194 FillAllHistograms("hGammaPipmGamma",ph1);
1195 FillHistogram("hPipmGammaConvR",ph1->Pt(),primPHOS->R());
1196 FillHistogram("hPipmGammaConvRZ",primPHOS->Vz(),primPHOS->R());
1199 if(TMath::Abs(primPdgPHOS)==11){
1200 FillAllHistograms("hGammaPipmEl",ph1);
1201 FillHistogram("hPipmElConvR",ph1->Pt(),primPHOS->R());
1204 if(TMath::Abs(primPdgPHOS)==2212){
1205 FillAllHistograms("hGammaPipmp",ph1);
1206 FillHistogram("hPipmNConvR",ph1->Pt(),primPHOS->R());
1209 if(TMath::Abs(primPdgPHOS)==2112){
1210 FillAllHistograms("hGammaPipmn",ph1);
1211 FillHistogram("hPipmNConvR",ph1->Pt(),primPHOS->R());
1214 FillAllHistograms("hGammaPipmOther",ph1);
1215 FillHistogram("hPipmOtherConvR",ph1->Pt(),primPHOS->R());
1219 FillAllHistograms("hGammaP",ph1);
1222 FillAllHistograms("hGammaPbar",ph1);
1225 FillAllHistograms("hGammaN",ph1);
1228 FillAllHistograms("hGammaNbar",ph1) ; // pn
1231 FillAllHistograms("hGammaK0S",ph1) ; // pn
1234 FillAllHistograms("hGammaK0L",ph1) ; // pn
1238 FillAllHistograms("hGammaKpm",ph1) ; // pn
1243 case 313: FillAllHistograms("hGammaKstar",ph1) ; // K*(892)
1246 case -2224 : //Deltas
1247 case 2224 : //Deltas
1248 case -2214 : //Deltas
1249 case 2214 : //Deltas
1250 case -2114 : //Deltas
1251 case 2114 : //Deltas
1252 case -1114 : //Deltas
1253 case 1114 : //Deltas
1254 FillAllHistograms("hGammaDelta",ph1) ; // pn
1257 if(primVtx->GetPDG()->Charge())
1258 FillAllHistograms("hGammaOtherCharged",ph1) ; //
1260 FillAllHistograms("hGammaOtherNeutral",ph1) ; //
1267 //_____________________________________________________________________________
1268 void AliAnalysisTaskPi0FlowMC::FillAllHistograms(const char * particleName,AliCaloPhoton * ph)
1270 //Fill All PID histograms
1272 Double_t w=ph->GetWeight() ;
1273 Double_t pt = ph->Pt() ;
1274 Double_t ptC=ph->GetMomV2()->Pt() ;
1275 FillHistogram(Form("%s_All_cen%d",particleName,fCentBin),pt,w) ;
1276 FillHistogram(Form("%s_Allcore_cen%d",particleName,fCentBin),ptC,w) ;
1278 FillHistogram(Form("%s_CPV_cen%d",particleName,fCentBin),pt,w) ;
1279 FillHistogram(Form("%s_CPVcore_cen%d",particleName,fCentBin),ptC,w) ;
1282 FillHistogram(Form("%s_CPV2_cen%d",particleName,fCentBin),pt,w) ;
1283 FillHistogram(Form("%s_CPV2core_cen%d",particleName,fCentBin),ptC,w) ;
1286 FillHistogram(Form("%s_Disp_cen%d",particleName,fCentBin),pt,w) ;
1287 FillHistogram(Form("%s_Dispcore_cen%d",particleName,fCentBin),ptC,w) ;
1288 if(ph->IsDisp2OK()){
1289 FillHistogram(Form("%s_Disp2_cen%d",particleName,fCentBin),pt,w) ;
1290 FillHistogram(Form("%s_Disp2core_cen%d",particleName,fCentBin),ptC,w) ;
1293 FillHistogram(Form("%s_Both_cen%d",particleName,fCentBin),pt,w) ;
1294 FillHistogram(Form("%s_Bothcore_cen%d",particleName,fCentBin),ptC,w) ;
1300 //___________________________________________________________________________
1301 Double_t AliAnalysisTaskPi0FlowMC::PrimaryWeight(Int_t /* primary */){
1304 //________________________________________________________________________
1305 Double_t AliAnalysisTaskPi0FlowMC::PrimaryParticleWeight(TParticle * /* particle */){
1309 //___________________________________________________________________________
1310 AliStack* AliAnalysisTaskPi0FlowMC::GetMCStack()
1313 AliVEventHandler* eventHandler = AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler();
1315 AliMCEventHandler* mcEventHandler = dynamic_cast<AliMCEventHandler*> (eventHandler);
1317 fStack = static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent()->Stack();
1321 AliError("Could not get MC Stack!");
1325 Int_t AliAnalysisTaskPi0FlowMC::FindPrimary(AliVCluster*clu, Bool_t&sure){
1326 //Finds primary and estimates if it unique one?
1327 //First check can it be photon/electron
1328 const Double_t emFraction=0.9; //part of energy of cluster to be assigned to EM particle
1329 Int_t n=clu->GetNLabels() ;
1330 for(Int_t i=0; i<n; i++){
1331 TParticle* p= fStack->Particle(clu->GetLabelAt(i)) ;
1332 Int_t pdg = p->GetPdgCode() ;
1333 if(pdg==22 || pdg==11 || pdg == -11){
1334 if(p->Energy()>emFraction*clu->E()){
1336 return clu->GetLabelAt(i);
1341 Double_t* Ekin= new Double_t[n] ;
1342 for(Int_t i=0; i<n; i++){
1343 TParticle* p= fStack->Particle(clu->GetLabelAt(i)) ;
1344 Ekin[i]=p->P() ; // estimate of kinetic energy
1345 if(p->GetPdgCode()==-2212 || p->GetPdgCode()==-2112){
1346 Ekin[i]+=1.8 ; //due to annihilation
1350 Double_t eMax=0.,eSubMax=0. ;
1351 for(Int_t i=0; i<n; i++){
1358 if(eSubMax>0.8*eMax)//not obvious primary
1363 return clu->GetLabelAt(iMax) ;
1366 //________________________________________________________________________
1367 Int_t AliAnalysisTaskPi0FlowMC::FindCommonParent(Int_t iPart, Int_t jPart){
1368 //check if there is a common parent for particles i and j
1369 // -1: no common parent or wrong iPart/jPart
1371 if(iPart==-1 || iPart>=fStack->GetNtrack() ||
1372 jPart==-1 || jPart>=fStack->GetNtrack()) return -1;
1380 iprim2=((TParticle *)fStack->Particle(iprim2))->GetFirstMother();
1382 iprim1=((TParticle *)fStack->Particle(iprim1))->GetFirstMother();
1386 //________________________________________________________________________
1387 Bool_t AliAnalysisTaskPi0FlowMC::HaveParent(Int_t iPart, Int_t pdgParent){
1388 //check if there is a common parent for particles i and j
1389 // -1: no common parent or wrong iPart/jPart
1391 if(iPart==-1 || iPart>=fStack->GetNtrack()) return -1;
1395 TParticle * tmp = fStack->Particle(iprim1) ;
1396 if(tmp->GetPdgCode()==pdgParent)
1398 iprim1=tmp->GetFirstMother();
1402 //________________________________________________________________________
1403 Bool_t AliAnalysisTaskPi0FlowMC::InPi0mass(Double_t m, Double_t /*pt*/){
1405 return TMath::Abs(m-0.135)<0.007*2.5 ;