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 **************************************************************************/
17 // Analysis task for pi0 and eta meson analysis in pp collisions
18 // Authors: Yuri Kharlov, Dmitri Peressounko
22 #include "TObjArray.h"
28 #include "TParticle.h"
32 #include "AliAnalysisTaskSE.h"
33 #include "AliAnalysisTaskPi0.h"
34 #include "AliCaloPhoton.h"
35 #include "AliPHOSGeometry.h"
36 #include "AliESDEvent.h"
37 #include "AliESDCaloCells.h"
38 #include "AliESDCaloCluster.h"
39 #include "AliESDVertex.h"
40 #include "AliESDtrackCuts.h"
43 #include "AliTriggerAnalysis.h"
45 // Analysis task to fill histograms with PHOS ESD clusters and cells
46 // Authors: Yuri Kharlov
49 ClassImp(AliAnalysisTaskPi0)
51 //________________________________________________________________________
52 AliAnalysisTaskPi0::AliAnalysisTaskPi0(const char *name)
53 : AliAnalysisTaskSE(name),
63 fTriggerAnalysis(new AliTriggerAnalysis)
67 for(Int_t i=0;i<nBin;i++){
68 for(Int_t j=0;j<2;j++)
72 // Output slots #0 write into a TH1 container
73 DefineOutput(1,TList::Class());
75 // Set bad channel map
77 for(Int_t i=0; i<6; i++){
78 snprintf(key,55,"PHOS_BadMap_mod%d",i) ;
79 fPHOSBadMap[i]=new TH2I(key,"Bad Modules map",64,0.,64.,56,0.,56.) ;
81 // Initialize the PHOS geometry
82 fPHOSGeo = AliPHOSGeometry::GetInstance("IHEP") ;
86 //________________________________________________________________________
87 void AliAnalysisTaskPi0::UserCreateOutputObjects()
93 if(fOutputContainer != NULL){
94 delete fOutputContainer;
96 fOutputContainer = new TList();
97 fOutputContainer->SetOwner(kTRUE);
99 fOutputContainer->Add(new TH1I("hCellMultEvent" ,"PHOS cell multiplicity per event" ,2000,0,2000));
100 fOutputContainer->Add(new TH1I("hCellMultEventM1","PHOS cell multiplicity per event, M1",2000,0,2000));
101 fOutputContainer->Add(new TH1I("hCellMultEventM2","PHOS cell multiplicity per event, M2",2000,0,2000));
102 fOutputContainer->Add(new TH1I("hCellMultEventM3","PHOS cell multiplicity per event, M3",2000,0,2000));
103 fOutputContainer->Add(new TH1I("hClusterMult" ,"CaloCluster multiplicity" ,100,0,100));
104 fOutputContainer->Add(new TH1I("hPHOSClusterMult" ,"PHOS cluster multiplicity" ,100,0,100));
105 fOutputContainer->Add(new TH1I("hPHOSClusterMultM1","PHOS cluster multiplicity, M1",100,0,100));
106 fOutputContainer->Add(new TH1I("hPHOSClusterMultM2","PHOS cluster multiplicity, M2",100,0,100));
107 fOutputContainer->Add(new TH1I("hPHOSClusterMultM3","PHOS cluster multiplicity, M3",100,0,100));
108 fOutputContainer->Add(new TH1F("hCellEnergy" ,"Cell energy" ,5000,0.,50.));
109 fOutputContainer->Add(new TH1F("hCellEnergyM1","Cell energy in module 1",5000,0.,50.));
110 fOutputContainer->Add(new TH1F("hCellEnergyM2","Cell energy in module 2",5000,0.,50.));
111 fOutputContainer->Add(new TH1F("hCellEnergyM3","Cell energy in module 3",5000,0.,50.));
112 fOutputContainer->Add(new TH1F("hClusterEnergy" ,"Cluster energy" ,5000,0.,50.));
113 fOutputContainer->Add(new TH1F("hClusterEnergyM1","Cluster energy, M1" ,5000,0.,50.));
114 fOutputContainer->Add(new TH1F("hClusterEnergyM2","Cluster energy, M2" ,5000,0.,50.));
115 fOutputContainer->Add(new TH1F("hClusterEnergyM3","Cluster energy, M3" ,5000,0.,50.));
116 fOutputContainer->Add(new TH2F("hClusterEvsN" ,"Cluster energy vs digit multiplicity" ,5000,0.,50.,40,0.,40.));
117 fOutputContainer->Add(new TH2F("hClusterEvsNM1","Cluster energy vs digit multiplicity, M1",5000,0.,50.,40,0.,40.));
118 fOutputContainer->Add(new TH2F("hClusterEvsNM2","Cluster energy vs digit multiplicity, M2",5000,0.,50.,40,0.,40.));
119 fOutputContainer->Add(new TH2F("hClusterEvsNM3","Cluster energy vs digit multiplicity, M3",5000,0.,50.,40,0.,40.));
120 fOutputContainer->Add(new TH1I("hCellMultClu" ,"Cell multiplicity per cluster" ,200,0,200));
121 fOutputContainer->Add(new TH1I("hCellMultCluM1","Cell multiplicity per cluster, M1",200,0,200));
122 fOutputContainer->Add(new TH1I("hCellMultCluM2","Cell multiplicity per cluster, M3",200,0,200));
123 fOutputContainer->Add(new TH1I("hCellMultCluM3","Cell multiplicity per cluster, M3",200,0,200));
124 fOutputContainer->Add(new TH1I("hModule","Module events",5,0.,5.));
125 fOutputContainer->Add(new TH1F("hSelEvents","Selected events",7,0.5,7.5));
127 fOutputContainer->Add(new TH2F("hCellNXZM1","Cell (X,Z), M1" ,64,0.5,64.5, 56,0.5,56.5));
128 fOutputContainer->Add(new TH2F("hCellNXZM2","Cell (X,Z), M2" ,64,0.5,64.5, 56,0.5,56.5));
129 fOutputContainer->Add(new TH2F("hCellNXZM3","Cell (X,Z), M3" ,64,0.5,64.5, 56,0.5,56.5));
130 fOutputContainer->Add(new TH2F("hCellEXZM1","Cell E(X,Z), M1",64,0.5,64.5, 56,0.5,56.5));
131 fOutputContainer->Add(new TH2F("hCellEXZM2","Cell E(X,Z), M2",64,0.5,64.5, 56,0.5,56.5));
132 fOutputContainer->Add(new TH2F("hCellEXZM3","Cell E(X,Z), M3",64,0.5,64.5, 56,0.5,56.5));
133 fOutputContainer->Add(new TH2F("hCluNXZM1","Clu (X,Z), M1" ,64,0.5,64.5, 56,0.5,56.5));
134 fOutputContainer->Add(new TH2F("hCluNXZM2","Clu (X,Z), M2" ,64,0.5,64.5, 56,0.5,56.5));
135 fOutputContainer->Add(new TH2F("hCluNXZM3","Clu (X,Z), M3" ,64,0.5,64.5, 56,0.5,56.5));
136 fOutputContainer->Add(new TH2F("hCluEXZM1","Clu E(X,Z), M1" ,64,0.5,64.5, 56,0.5,56.5));
137 fOutputContainer->Add(new TH2F("hCluEXZM2","Clu E(X,Z), M2" ,64,0.5,64.5, 56,0.5,56.5));
138 fOutputContainer->Add(new TH2F("hCluEXZM3","Clu E(X,Z), M3" ,64,0.5,64.5, 56,0.5,56.5));
146 fOutputContainer->Add(new TH2F("hAsymPtPi0","(A,p_{T})_{#gamma#gamma} #pi^{0}" ,50,0.,1., nPt,ptMin,ptMax));
147 fOutputContainer->Add(new TH2F("hAsymPtEta","(A,p_{T})_{#gamma#gamma} #eta" ,50,0.,1., nPt,ptMin,ptMax));
149 fOutputContainer->Add(new TH2F("hMassPtA10" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax));
150 fOutputContainer->Add(new TH2F("hMassPtA08" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.8" ,nM,mMin,mMax,nPt,ptMin,ptMax));
151 fOutputContainer->Add(new TH2F("hMassPtA07" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7" ,nM,mMin,mMax,nPt,ptMin,ptMax));
152 fOutputContainer->Add(new TH2F("hMassPtA01" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.1" ,nM,mMin,mMax,nPt,ptMin,ptMax));
154 fOutputContainer->Add(new TH2F("hMassPtA10nvtx" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0, no vtx" ,nM,mMin,mMax,nPt,ptMin,ptMax));
155 fOutputContainer->Add(new TH2F("hMassPtA07nvtx" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7, no vtx" ,nM,mMin,mMax,nPt,ptMin,ptMax));
157 fOutputContainer->Add(new TH2F("hMassPtA10vtx" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0, vtx" ,nM,mMin,mMax,nPt,ptMin,ptMax));
158 fOutputContainer->Add(new TH2F("hMassPtA07vtx" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7, vtx" ,nM,mMin,mMax,nPt,ptMin,ptMax));
160 fOutputContainer->Add(new TH2F("hMassPtA10V0AND" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0, V0AND",nM,mMin,mMax,nPt,ptMin,ptMax));
161 fOutputContainer->Add(new TH2F("hMassPtA07V0AND" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7, V0AND",nM,mMin,mMax,nPt,ptMin,ptMax));
163 fOutputContainer->Add(new TH2F("hMassPtA10V0PU" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0, pileup",nM,mMin,mMax,nPt,ptMin,ptMax));
164 fOutputContainer->Add(new TH2F("hMassPtA07V0PU" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7, pileup",nM,mMin,mMax,nPt,ptMin,ptMax));
166 fOutputContainer->Add(new TH2F("hMassPtvA10","(M,p_{T})_{#gamma#gamma}, 0<A<1.0, ESD vertex",nM,mMin,mMax,nPt,ptMin,ptMax));
167 fOutputContainer->Add(new TH2F("hMassPtvA07","(M,p_{T})_{#gamma#gamma}, 0<A<0.7, ESD vertex",nM,mMin,mMax,nPt,ptMin,ptMax));
169 fOutputContainer->Add(new TH3F("hMassPtCA10","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
170 fOutputContainer->Add(new TH3F("hMassPtCA10_cpv","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
171 fOutputContainer->Add(new TH3F("hMassPtCA10_disp","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
172 fOutputContainer->Add(new TH3F("hMassPtCA10_both","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
173 fOutputContainer->Add(new TH3F("hMassPtCA07","(M,p_{T},C)_{#gamma#gamma}, 0<A<0.7" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
174 fOutputContainer->Add(new TH3F("hMassPtCA07_cpv","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
175 fOutputContainer->Add(new TH3F("hMassPtCA07_disp","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
176 fOutputContainer->Add(new TH3F("hMassPtCA07_both","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
178 fOutputContainer->Add(new TH2F("hMassSingle_all","(M,p_{T})_{#gamma#gamma}, no PID" ,nM,mMin,mMax,nPt,ptMin,ptMax));
179 fOutputContainer->Add(new TH2F("hMassSingle_cpv","(M,p_{T})_{#gamma#gamma}, no PID" ,nM,mMin,mMax,nPt,ptMin,ptMax));
180 fOutputContainer->Add(new TH2F("hMassSingle_disp","(M,p_{T})_{#gamma#gamma}, no PID" ,nM,mMin,mMax,nPt,ptMin,ptMax));
181 fOutputContainer->Add(new TH2F("hMassSingle_both","(M,p_{T})_{#gamma#gamma}, no PID" ,nM,mMin,mMax,nPt,ptMin,ptMax));
183 fOutputContainer->Add(new TH2F("hMassPtM1","(M,p_{T})_{#gamma#gamma}, module 1" ,nM,mMin,mMax,nPt,ptMin,ptMax));
184 fOutputContainer->Add(new TH2F("hMassPtM2","(M,p_{T})_{#gamma#gamma}, module 2" ,nM,mMin,mMax,nPt,ptMin,ptMax));
185 fOutputContainer->Add(new TH2F("hMassPtM3","(M,p_{T})_{#gamma#gamma}, module 3" ,nM,mMin,mMax,nPt,ptMin,ptMax));
186 fOutputContainer->Add(new TH2F("hMassPtM12","(M,p_{T})_{#gamma#gamma}, modules 1,2",nM,mMin,mMax,nPt,ptMin,ptMax));
187 fOutputContainer->Add(new TH2F("hMassPtM13","(M,p_{T})_{#gamma#gamma}, modules 1,3",nM,mMin,mMax,nPt,ptMin,ptMax));
188 fOutputContainer->Add(new TH2F("hMassPtM23","(M,p_{T})_{#gamma#gamma}, modules 2,3",nM,mMin,mMax,nPt,ptMin,ptMax));
190 fOutputContainer->Add(new TH2F("hMassPt20cm","(M,p_{T})_{#gamma#gamma}, |z|<20 cm" ,nM,mMin,mMax,nPt,ptMin,ptMax));
191 fOutputContainer->Add(new TH2F("hMassPt40cm","(M,p_{T})_{#gamma#gamma}, 20<|z|<40 cm",nM,mMin,mMax,nPt,ptMin,ptMax));
192 fOutputContainer->Add(new TH2F("hMassPt60cm","(M,p_{T})_{#gamma#gamma}, |z|>40 cm" ,nM,mMin,mMax,nPt,ptMin,ptMax));
194 fOutputContainer->Add(new TH2F("hMassPtN3","(M,p_{T})_{#gamma#gamma}, N_{cell}>2" ,nM,mMin,mMax,nPt,ptMin,ptMax));
195 fOutputContainer->Add(new TH2F("hMassPtN4","(M,p_{T})_{#gamma#gamma}, N_{cell}>3" ,nM,mMin,mMax,nPt,ptMin,ptMax));
196 fOutputContainer->Add(new TH2F("hMassPtN5","(M,p_{T})_{#gamma#gamma}, N_{cell}>4" ,nM,mMin,mMax,nPt,ptMin,ptMax));
197 fOutputContainer->Add(new TH2F("hMassPtN6","(M,p_{T})_{#gamma#gamma}, N_{cell}>5" ,nM,mMin,mMax,nPt,ptMin,ptMax));
199 fOutputContainer->Add(new TH2F("hMiAsymPt","(A,p_{T})_{#gamma#gamma}" ,50,0.,1., nPt,ptMin,ptMax));
201 fOutputContainer->Add(new TH2F("hMiMassPtA10" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax));
202 fOutputContainer->Add(new TH2F("hMiMassPtA08" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.8" ,nM,mMin,mMax,nPt,ptMin,ptMax));
203 fOutputContainer->Add(new TH2F("hMiMassPtA07" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7" ,nM,mMin,mMax,nPt,ptMin,ptMax));
204 fOutputContainer->Add(new TH2F("hMiMassPtA01" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.1" ,nM,mMin,mMax,nPt,ptMin,ptMax));
206 fOutputContainer->Add(new TH2F("hMiMassPtA10nvtx" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0, no vtx" ,nM,mMin,mMax,nPt,ptMin,ptMax));
207 fOutputContainer->Add(new TH2F("hMiMassPtA07nvtx" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7, no vtx" ,nM,mMin,mMax,nPt,ptMin,ptMax));
209 fOutputContainer->Add(new TH2F("hMiMassPtA10vtx" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0, vtx" ,nM,mMin,mMax,nPt,ptMin,ptMax));
210 fOutputContainer->Add(new TH2F("hMiMassPtA07vtx" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7, vtx" ,nM,mMin,mMax,nPt,ptMin,ptMax));
212 fOutputContainer->Add(new TH2F("hMiMassPtA10V0AND" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0, V0AND",nM,mMin,mMax,nPt,ptMin,ptMax));
213 fOutputContainer->Add(new TH2F("hMiMassPtA07V0AND" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7, V0AND",nM,mMin,mMax,nPt,ptMin,ptMax));
215 fOutputContainer->Add(new TH2F("hMiMassPtA10V0PU" ,"(M,p_{T})_{#gamma#gamma}, 0<A<1.0, pileup",nM,mMin,mMax,nPt,ptMin,ptMax));
216 fOutputContainer->Add(new TH2F("hMiMassPtA07V0PU" ,"(M,p_{T})_{#gamma#gamma}, 0<A<0.7, pileup",nM,mMin,mMax,nPt,ptMin,ptMax));
218 fOutputContainer->Add(new TH2F("hMiMassPtvA10","(M,p_{T})_{#gamma#gamma}, 0<A<1.0, ESD vertex",nM,mMin,mMax,nPt,ptMin,ptMax));
219 fOutputContainer->Add(new TH2F("hMiMassPtvA07","(M,p_{T})_{#gamma#gamma}, 0<A<0.7, ESD vertex",nM,mMin,mMax,nPt,ptMin,ptMax));
221 fOutputContainer->Add(new TH3F("hMiMassPtCA10","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
222 fOutputContainer->Add(new TH3F("hMiMassPtCA10_cpv","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
223 fOutputContainer->Add(new TH3F("hMiMassPtCA10_disp","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
224 fOutputContainer->Add(new TH3F("hMiMassPtCA10_both","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
225 fOutputContainer->Add(new TH3F("hMiMassPtCA07","(M,p_{T},C)_{#gamma#gamma}, 0<A<0.7" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
226 fOutputContainer->Add(new TH3F("hMiMassPtCA07_cpv","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
227 fOutputContainer->Add(new TH3F("hMiMassPtCA07_disp","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
228 fOutputContainer->Add(new TH3F("hMiMassPtCA07_both","(M,p_{T},C)_{#gamma#gamma}, 0<A<1.0" ,nM,mMin,mMax,nPt,ptMin,ptMax,8,0.,8.));
230 fOutputContainer->Add(new TH2F("hMiMassSingle_all","(M,p_{T})_{#gamma#gamma}, no PID" ,nM,mMin,mMax,nPt,ptMin,ptMax));
231 fOutputContainer->Add(new TH2F("hMiMassSingle_cpv","(M,p_{T})_{#gamma#gamma}, no PID" ,nM,mMin,mMax,nPt,ptMin,ptMax));
232 fOutputContainer->Add(new TH2F("hMiMassSingle_disp","(M,p_{T})_{#gamma#gamma}, no PID" ,nM,mMin,mMax,nPt,ptMin,ptMax));
233 fOutputContainer->Add(new TH2F("hMiMassSingle_both","(M,p_{T})_{#gamma#gamma}, no PID" ,nM,mMin,mMax,nPt,ptMin,ptMax));
235 fOutputContainer->Add(new TH2F("hMiMassPtM1","(M,p_{T})_{#gamma#gamma}, module 1" ,nM,mMin,mMax,nPt,ptMin,ptMax));
236 fOutputContainer->Add(new TH2F("hMiMassPtM2","(M,p_{T})_{#gamma#gamma}, module 2" ,nM,mMin,mMax,nPt,ptMin,ptMax));
237 fOutputContainer->Add(new TH2F("hMiMassPtM3","(M,p_{T})_{#gamma#gamma}, module 3" ,nM,mMin,mMax,nPt,ptMin,ptMax));
238 fOutputContainer->Add(new TH2F("hMiMassPtM12","(M,p_{T})_{#gamma#gamma}, modules 1,2",nM,mMin,mMax,nPt,ptMin,ptMax));
239 fOutputContainer->Add(new TH2F("hMiMassPtM13","(M,p_{T})_{#gamma#gamma}, modules 1,3",nM,mMin,mMax,nPt,ptMin,ptMax));
240 fOutputContainer->Add(new TH2F("hMiMassPtM23","(M,p_{T})_{#gamma#gamma}, modules 2,3",nM,mMin,mMax,nPt,ptMin,ptMax));
242 fOutputContainer->Add(new TH2F("hMiMassPt20cm","(M,p_{T})_{#gamma#gamma}, |z|<20 cm" ,nM,mMin,mMax,nPt,ptMin,ptMax));
243 fOutputContainer->Add(new TH2F("hMiMassPt40cm","(M,p_{T})_{#gamma#gamma}, 20<|z|<40 cm",nM,mMin,mMax,nPt,ptMin,ptMax));
244 fOutputContainer->Add(new TH2F("hMiMassPt60cm","(M,p_{T})_{#gamma#gamma}, |z|>40 cm" ,nM,mMin,mMax,nPt,ptMin,ptMax));
246 fOutputContainer->Add(new TH2F("hMiMassPtN3","(M,p_{T})_{#gamma#gamma}, N_{cell}>2" ,nM,mMin,mMax,nPt,ptMin,ptMax));
247 fOutputContainer->Add(new TH2F("hMiMassPtN4","(M,p_{T})_{#gamma#gamma}, N_{cell}>3" ,nM,mMin,mMax,nPt,ptMin,ptMax));
248 fOutputContainer->Add(new TH2F("hMiMassPtN5","(M,p_{T})_{#gamma#gamma}, N_{cell}>4" ,nM,mMin,mMax,nPt,ptMin,ptMax));
249 fOutputContainer->Add(new TH2F("hMiMassPtN6","(M,p_{T})_{#gamma#gamma}, N_{cell}>5" ,nM,mMin,mMax,nPt,ptMin,ptMax));
251 fOutputContainer->Add(new TH1F("hPhotonKappa","#kappa(#gamma)",200,0.,20.));
252 fOutputContainer->Add(new TH1F("hPhotonPt","p_{T}(#gamma)",200,0.,20.));
253 fOutputContainer->Add(new TH1F("hPhotonPx","p_{x}(#gamma)",200,0.,20.));
254 fOutputContainer->Add(new TH1F("hPhotonPy","p_{y}(#gamma)",200,0.,20.));
256 fOutputContainer->Add(new TH1F("hTrigClass","Trigger class",5,0.5,5.5));
258 fOutputContainer->Add(new TH1F("hZvertex","Z vertex",200,-50.,+50.));
259 fOutputContainer->Add(new TH1F("hNvertexTracks","N of primary tracks from the primary vertex",150,0.,150.));
260 fOutputContainer->Add(new TH1F("hTrackMult","Charged track multiplicity",150,0.,150.));
262 // Create ESD track cut
264 fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
265 fESDtrackCuts ->SetMaxDCAToVertexZ(2);
266 fESDtrackCuts ->SetEtaRange(-0.8, 0.8);
267 fESDtrackCuts ->SetPtRange(0.15);
269 PostData(1, fOutputContainer);
273 //________________________________________________________________________
274 void AliAnalysisTaskPi0::UserExec(Option_t *)
276 // Main loop, called for each event
279 // Event selection flags
281 Bool_t eventVtxExist = kFALSE;
282 Bool_t eventVtxZ10cm = kFALSE;
283 Bool_t eventPileup = kFALSE;
284 Bool_t eventV0AND = kFALSE;
286 AliESDEvent *event = dynamic_cast<AliESDEvent*>(InputEvent());
287 Int_t eventNumberInFile = event->GetEventNumberInFile();
289 Printf("ERROR: Could not retrieve event");
294 fPHOSEvent->Clear() ;
296 fPHOSEvent = new TClonesArray("AliCaloPhoton",50) ;
298 // Checks if we have a primary vertex
299 // Get primary vertices form ESD
301 if (event->GetPrimaryVertexTracks()->GetNContributors()>0)
302 eventVtxExist = kTRUE;
303 else if (event->GetPrimaryVertexSPD() ->GetNContributors()>0)
304 eventVtxExist = kTRUE;
306 const AliESDVertex *esdVertex5 = event->GetPrimaryVertex();
308 Double_t vtx0[3] = {0,0,0}; // don't rely on ESD vertex, assume (0,0,0)
310 vtx5[0] = esdVertex5->GetX();
311 vtx5[1] = esdVertex5->GetY();
312 vtx5[2] = esdVertex5->GetZ();
314 FillHistogram("hNvertexTracks",esdVertex5->GetNContributors());
315 FillHistogram("hZvertex" ,esdVertex5->GetZ());
316 if (TMath::Abs(esdVertex5->GetZ()) < 10. )
317 eventVtxZ10cm = kTRUE;
319 if (event->IsPileupFromSPD())
322 eventV0AND = fTriggerAnalysis->IsOfflineTriggerFired(event, AliTriggerAnalysis::kV0AND);
324 // Fill event statistics for different selection criteria
326 FillHistogram("hSelEvents",1) ;
328 FillHistogram("hSelEvents",2) ;
329 if (eventVtxExist && eventVtxZ10cm)
330 FillHistogram("hSelEvents",3) ;
331 if (eventVtxExist && eventVtxZ10cm && eventV0AND)
332 FillHistogram("hSelEvents",4) ;
333 if (eventVtxExist && eventVtxZ10cm && eventV0AND && eventPileup)
334 FillHistogram("hSelEvents",5) ;
336 FillHistogram("hSelEvents",6) ;
338 FillHistogram("hSelEvents",7) ;
342 Int_t zvtx = (Int_t)((vtx5[2]+10.)/2.) ;
346 TString trigClasses = event->GetFiredTriggerClasses();
348 if (trigClasses.Contains("CINT1B")) fnCINT1B++;
349 if (trigClasses.Contains("CINT1A")) fnCINT1A++;
350 if (trigClasses.Contains("CINT1C")) fnCINT1C++;
351 if (trigClasses.Contains("CINT1-E")) fnCINT1E++;
353 //Calculate charged multiplicity
355 for (Int_t i=0;i<event->GetNumberOfTracks();++i) {
356 AliESDtrack *track = new AliESDtrack(*event->GetTrack(i)) ;
357 if(fESDtrackCuts->AcceptTrack(track) && TMath::Abs(track->Eta())< 0.8)
361 FillHistogram("hTrackMult",trackMult+0.5) ;
364 //always zero centrality
365 if(!fPHOSEvents[zvtx][centr]) fPHOSEvents[zvtx][centr]=new TList() ;
366 TList * prevPHOS = fPHOSEvents[zvtx][centr] ;
392 AliESDCaloCluster *clu1;
393 TLorentzVector p1,p2,p12, pv1,pv2,pv12;
394 AliESDCaloCells *cells = event->GetPHOSCells();
396 Int_t multClust = event->GetNumberOfCaloClusters();
397 Int_t multCells = cells->GetNumberOfCells();
398 FillHistogram("hClusterMult",multClust);
399 FillHistogram("hCellMultEvent",multCells);
401 Printf("Event %d, trig.class %s, period %d, bc %d, orbit %d",
402 eventNumberInFile,trigClasses.Data(),event->GetPeriodNumber(),
403 event->GetBunchCrossNumber(),event->GetOrbitNumber());
404 Printf("\tthere are %d caloclusters and %d calocells",
405 multClust,multCells);
407 // Get PHOS rotation matrices from ESD and set them to the PHOS geometry
408 if(fEventCounter == 0) {
409 for(Int_t mod=0; mod<5; mod++) {
410 if(!event->GetPHOSMatrix(mod)) continue;
411 fPHOSGeo->SetMisalMatrix(event->GetPHOSMatrix(mod),mod) ;
412 Printf("PHOS geo matrix %p for module # %d is set\n", event->GetPHOSMatrix(mod), mod);
417 Int_t mod1, relId[4], cellAbsId, cellX, cellZ;
419 // Single loop over cells
421 Int_t nCellModule[3] = {0,0,0};
422 for (Int_t iCell=0; iCell<multCells; iCell++) {
423 cellAbsId = cells->GetCellNumber(iCell);
424 fPHOSGeo->AbsToRelNumbering(cellAbsId,relId);
428 energy = cells->GetAmplitude(iCell);
429 FillHistogram("hCellEnergy",energy);
432 FillHistogram("hCellEnergyM1",cells->GetAmplitude(iCell));
433 FillHistogram("hCellNXZM1",cellX,cellZ,1.);
434 FillHistogram("hCellEXZM1",cellX,cellZ,energy);
438 FillHistogram("hCellEnergyM2",cells->GetAmplitude(iCell));
439 FillHistogram("hCellNXZM2",cellX,cellZ,1.);
440 FillHistogram("hCellEXZM2",cellX,cellZ,energy);
444 FillHistogram("hCellEnergyM3",cells->GetAmplitude(iCell));
445 FillHistogram("hCellNXZM3",cellX,cellZ,1.);
446 FillHistogram("hCellEXZM3",cellX,cellZ,energy);
449 FillHistogram("hCellMultEventM1",nCellModule[0]);
450 FillHistogram("hCellMultEventM2",nCellModule[1]);
451 FillHistogram("hCellMultEventM3",nCellModule[2]);
453 // Single loop over clusters fills cluster histograms
456 Int_t multPHOSClust[4] = {0,0,0,0};
459 for (Int_t i1=0; i1<multClust; i1++) {
460 clu1 = event->GetCaloCluster(i1);
461 if ( !clu1->IsPHOS() ) continue;
463 digMult = clu1->GetNCells();
464 clu1->GetPosition(position);
465 TVector3 global1(position) ;
466 fPHOSGeo->GlobalPos2RelId(global1,relId) ;
470 if ( !IsGoodChannel("PHOS",mod1,cellX,cellZ) ) continue ;
472 cellAbsId = clu1->GetCellAbsId(0);
473 fPHOSGeo->AbsToRelNumbering(cellAbsId,relId);
478 FillHistogram("hClusterEnergy",energy);
479 FillHistogram("hClusterEvsN",energy,digMult);
480 FillHistogram("hCellMultClu",digMult);
483 FillHistogram("hClusterEvsNM1",energy,digMult);
484 FillHistogram("hCellMultCluM1",digMult);
485 FillHistogram("hClusterEnergyM1",energy);
486 FillHistogram("hCluNXZM1",cellX,cellZ,1.);
487 FillHistogram("hCluEXZM1",cellX,cellZ,energy);
491 FillHistogram("hClusterEvsNM2",energy,digMult);
492 FillHistogram("hCellMultCluM2",digMult);
493 FillHistogram("hClusterEnergyM2",energy);
494 FillHistogram("hCluNXZM2",cellX,cellZ,1.);
495 FillHistogram("hCluEXZM2",cellX,cellZ,energy);
499 FillHistogram("hClusterEvsNM3",energy,digMult);
500 FillHistogram("hCellMultCluM3",digMult);
501 FillHistogram("hClusterEnergyM3",energy);
502 FillHistogram("hCluNXZM3",cellX,cellZ,1.);
503 FillHistogram("hCluEXZM3",cellX,cellZ,energy);
507 clu1 ->GetMomentum(p1 ,vtx0);
508 Double_t pAbs = p1.P();
509 Double_t pT = p1.Pt();
510 Double_t pX = p1.Px();
511 Double_t pY = p1.Py();
512 Double_t kappa = pAbs - TMath::Power(0.135,2)/4./pAbs;
514 FillHistogram("hPhotonKappa",kappa);
515 FillHistogram("hPhotonPt",pT);
516 FillHistogram("hPhotonPx",pX);
517 FillHistogram("hPhotonPy",pY);
520 FillHistogram("hPHOSClusterMult",multPHOSClust[0]);
521 FillHistogram("hPHOSClusterMultM1",multPHOSClust[1]);
522 FillHistogram("hPHOSClusterMultM2",multPHOSClust[2]);
523 FillHistogram("hPHOSClusterMultM3",multPHOSClust[3]);
525 //Select photons for inv mass calculation
527 for (Int_t i1=0; i1<multClust; i1++) {
528 clu1 = event->GetCaloCluster(i1);
529 if ( !clu1->IsPHOS() || clu1->E()<0.3) continue;
531 clu1->GetPosition(position);
532 TVector3 global1(position) ;
533 fPHOSGeo->GlobalPos2RelId(global1,relId) ;
537 if ( !IsGoodChannel("PHOS",mod1,cellX,cellZ) ) continue ;
539 clu1 ->GetMomentum(p1 ,vtx0);
540 clu1 ->GetMomentum(pv1,vtx5);
541 digMult = clu1->GetNCells();
542 new((*fPHOSEvent)[inPHOS]) AliCaloPhoton(p1.X(),p1.Py(),p1.Z(),p1.E()) ;
543 AliCaloPhoton * ph = (AliCaloPhoton*)fPHOSEvent->At(inPHOS) ;
544 ph->SetModule(mod1) ;
546 ph->SetNCells(clu1->GetNCells());
547 ph->SetEMCx(global1.X());
548 ph->SetEMCy(global1.Y());
549 ph->SetEMCz(global1.Z());
550 ph->SetDispBit(TestLambda(clu1->GetM20(),clu1->GetM02())) ;
551 ph->SetCPVBit(clu1->GetEmcCpvDistance()>10.) ;
556 // Fill Real disribution
558 for (Int_t i1=0; i1<inPHOS-1; i1++) {
559 AliCaloPhoton * ph1=(AliCaloPhoton*)fPHOSEvent->At(i1) ;
560 for (Int_t i2=i1+1; i2<inPHOS; i2++) {
561 AliCaloPhoton * ph2=(AliCaloPhoton*)fPHOSEvent->At(i2) ;
563 pv12 = *(ph1->GetMomV2()) + *(ph2->GetMomV2());
564 Double_t asym = TMath::Abs((ph1->Energy()-ph2->Energy())/(ph1->Energy()+ph2->Energy()));
565 Double_t ma12 = p12.M();
566 Double_t pt12 = p12.Pt();
568 if (ph1->GetNCells()>2 && ph2->GetNCells()>2) {
569 FillHistogram("hMassPtA10",ma12 ,pt12 );
570 FillHistogram("hMassPtvA10",pv12.M(),pv12.Pt());
571 FillHistogram("hMassPtCA10",ma12 ,pt12, centr+0.5);
572 FillHistogram("hMassSingle_all",ma12,ph1->Pt()) ;
573 FillHistogram("hMassSingle_all",ma12,ph2->Pt()) ;
576 FillHistogram("hMassPtA10nvtx",ma12 ,pt12 );
578 FillHistogram("hMassPtA10vtx" ,ma12 ,pt12 );
579 if(eventVtxExist && eventV0AND)
580 FillHistogram("hMassPtA10V0AND",ma12 ,pt12 );
582 FillHistogram("hMassPtA10PU" ,ma12 ,pt12 );
585 FillHistogram("hMassSingle_cpv",ma12,ph1->Pt()) ;
587 FillHistogram("hMassSingle_cpv",ma12,ph2->Pt()) ;
589 FillHistogram("hMassSingle_disp",ma12,ph1->Pt()) ;
591 FillHistogram("hMassSingle_disp",ma12,ph2->Pt()) ;
592 if(ph1->IsCPVOK() && ph1->IsDispOK())
593 FillHistogram("hMassSingle_both",ma12,ph1->Pt()) ;
594 if(ph2->IsCPVOK() && ph2->IsDispOK())
595 FillHistogram("hMassSingle_both",ma12,ph2->Pt()) ;
598 if(ph1->IsCPVOK() && ph2->IsCPVOK())
599 FillHistogram("hMassPtCA10_cpv",ma12 ,pt12, centr+0.5);
600 if(ph1->IsDispOK() && ph2->IsDispOK()){
601 FillHistogram("hMassPtCA10_disp",ma12 ,pt12, centr+0.5);
602 if(ph1->IsCPVOK() && ph2->IsCPVOK())
603 FillHistogram("hMassPtCA10_both",ma12 ,pt12, centr+0.5);
606 FillHistogram("hMassPtA08",ma12,pt12);
609 FillHistogram("hMassPtA07",ma12,pt12);
610 FillHistogram("hMassPtvA07",pv12.M(),pv12.Pt());
611 FillHistogram("hMassPtCA07",ma12 ,pt12, centr+0.5);
613 FillHistogram("hMassPtA07nvtx",ma12 ,pt12 );
615 FillHistogram("hMassPtA07vtx" ,ma12 ,pt12 );
616 if(eventVtxExist && eventV0AND)
617 FillHistogram("hMassPtA07V0AND",ma12 ,pt12 );
619 FillHistogram("hMassPtA07PU" ,ma12 ,pt12 );
620 if(ph1->IsCPVOK() && ph2->IsCPVOK())
621 FillHistogram("hMassPtCA07_cpv",ma12 ,pt12, centr+0.5);
622 if(ph1->IsDispOK() && ph2->IsDispOK()){
623 FillHistogram("hMassPtCA07_disp",ma12 ,pt12, centr+0.5);
624 if(ph1->IsCPVOK() && ph2->IsCPVOK())
625 FillHistogram("hMassPtCA07_both",ma12 ,pt12, centr+0.5);
630 FillHistogram("hMassPtA01",ma12,pt12);
632 if (TMath::Abs(ma12-0.135)<0.03)
633 FillHistogram("hAsymPtPi0",asym ,pt12);
634 if (TMath::Abs(ma12-0.547)<0.09)
635 FillHistogram("hAsymPtEta",asym ,pt12);
637 if (ph1->Module()==1 && ph2->Module()==1) FillHistogram("hMassPtM1",ma12 ,pt12 );
638 if (ph1->Module()==2 && ph2->Module()==2) FillHistogram("hMassPtM2",ma12 ,pt12 );
639 if (ph1->Module()==3 && ph2->Module()==3) FillHistogram("hMassPtM3",ma12 ,pt12 );
640 if ((ph1->Module()==1 && ph2->Module()==2) ||
641 (ph1->Module()==2 && ph2->Module()==1)) FillHistogram("hMassPtM12",ma12 ,pt12 );
642 if ((ph1->Module()==2 && ph2->Module()==3) ||
643 (ph1->Module()==3 && ph2->Module()==2)) FillHistogram("hMassPtM23",ma12 ,pt12 );
644 if ((ph1->Module()==1 && ph2->Module()==3) ||
645 (ph1->Module()==3 && ph2->Module()==1)) FillHistogram("hMassPtM13",ma12 ,pt12 );
647 if (TMath::Abs(ph1->EMCz()) < 20. || TMath::Abs(ph2->EMCz()) < 20.)
648 FillHistogram("hMassPt20cm",ma12 ,pt12 );
649 if ((TMath::Abs(ph1->EMCz()) > 20. && TMath::Abs(ph1->EMCz()) < 40.) ||
650 (TMath::Abs(ph2->EMCz()) > 20. && TMath::Abs(ph2->EMCz()) < 40.))
651 FillHistogram("hMassPt40cm",ma12 ,pt12 );
652 if (TMath::Abs(ph1->EMCz()) > 40. || TMath::Abs(ph2->EMCz()) > 40.)
653 FillHistogram("hMassPt60cm",ma12 ,pt12 );
657 if (ph1->GetNCells()>3 && ph2->GetNCells()>3) {
658 FillHistogram("hMassPtN3",ma12 ,pt12 );
660 if (ph1->GetNCells()>4 && ph2->GetNCells()>4) {
661 FillHistogram("hMassPtN4",ma12 ,pt12 );
663 if (ph1->GetNCells()>5 && ph2->GetNCells()>5) {
664 FillHistogram("hMassPtN5",ma12 ,pt12 );
666 if (ph1->GetNCells()>6 && ph2->GetNCells()>6) {
667 FillHistogram("hMassPtN6",ma12 ,pt12 );
674 for (Int_t i1=0; i1<inPHOS; i1++) {
675 AliCaloPhoton * ph1=(AliCaloPhoton*)fPHOSEvent->At(i1) ;
676 for(Int_t ev=0; ev<prevPHOS->GetSize();ev++){
677 TClonesArray * mixPHOS = static_cast<TClonesArray*>(prevPHOS->At(ev)) ;
678 for(Int_t i2=0; i2<mixPHOS->GetEntriesFast();i2++){
679 AliCaloPhoton * ph2=(AliCaloPhoton*)mixPHOS->At(i2) ;
681 pv12 = *(ph1->GetMomV2()) + *(ph2->GetMomV2());
682 Double_t asym = TMath::Abs((ph1->Energy()-ph2->Energy())/(ph1->Energy()+ph2->Energy()));
683 Double_t ma12 = p12.M();
684 Double_t pt12 = p12.Pt();
686 if (ph1->GetNCells()>2 && ph2->GetNCells()>2) {
687 FillHistogram("hMiMassPtA10",ma12 ,pt12 );
688 FillHistogram("hMiMassPtvA10",pv12.M(),pv12.Pt());
689 FillHistogram("hMiMassPtCA10",ma12 ,pt12, centr+0.5);
690 FillHistogram("hMiMassSingle_all",ma12,ph1->Pt()) ;
691 FillHistogram("hMiMassSingle_all",ma12,ph2->Pt()) ;
694 FillHistogram("hMiMassPtA10nvtx",ma12 ,pt12 );
696 FillHistogram("hMiMassPtA10vtx" ,ma12 ,pt12 );
697 if(eventVtxExist && eventV0AND)
698 FillHistogram("hMiMassPtA10V0AND",ma12 ,pt12 );
700 FillHistogram("hMiMassPtA10PU" ,ma12 ,pt12 );
703 FillHistogram("hMiMassSingle_cpv",ma12,ph1->Pt()) ;
705 FillHistogram("hMiMassSingle_cpv",ma12,ph2->Pt()) ;
707 FillHistogram("hMiMassSingle_disp",ma12,ph1->Pt()) ;
709 FillHistogram("hMiMassSingle_disp",ma12,ph2->Pt()) ;
710 if(ph1->IsCPVOK() && ph1->IsDispOK())
711 FillHistogram("hMiMassSingle_both",ma12,ph1->Pt()) ;
712 if(ph2->IsCPVOK() && ph2->IsDispOK())
713 FillHistogram("hMiMassSingle_both",ma12,ph2->Pt()) ;
716 if(ph1->IsCPVOK() && ph2->IsCPVOK())
717 FillHistogram("hMiMassPtCA10_cpv",ma12 ,pt12, centr+0.5);
718 if(ph1->IsDispOK() && ph2->IsDispOK()){
719 FillHistogram("hMiMassPtCA10_disp",ma12 ,pt12, centr+0.5);
720 if(ph1->IsCPVOK() && ph2->IsCPVOK())
721 FillHistogram("hMiMassPtCA10_both",ma12 ,pt12, centr+0.5);
724 FillHistogram("hMiMassPtA08",ma12,pt12);
727 FillHistogram("hMiMassPtA07",ma12,pt12);
728 FillHistogram("hMiMassPtvA07",pv12.M(),pv12.Pt());
729 FillHistogram("hMiMassPtCA07",ma12 ,pt12, centr+0.5);
731 FillHistogram("hMiMassPtA07nvtx",ma12 ,pt12 );
733 FillHistogram("hMiMassPtA07vtx" ,ma12 ,pt12 );
734 if(eventVtxExist && eventV0AND)
735 FillHistogram("hMiMassPtA07V0AND",ma12 ,pt12 );
737 FillHistogram("hMiMassPtA07PU" ,ma12 ,pt12 );
738 if(ph1->IsCPVOK() && ph2->IsCPVOK())
739 FillHistogram("hMiMassPtCA07_cpv",ma12 ,pt12, centr+0.5);
740 if(ph1->IsDispOK() && ph2->IsDispOK()){
741 FillHistogram("hMiMassPtCA07_disp",ma12 ,pt12, centr+0.5);
742 if(ph1->IsCPVOK() && ph2->IsCPVOK())
743 FillHistogram("hMiMassPtCA07_both",ma12 ,pt12, centr+0.5);
747 FillHistogram("hMiMassPtA01",ma12,pt12);
749 FillHistogram("hMiAsymPt",asym ,pt12);
751 if (ph1->Module()==1 && ph2->Module()==1) FillHistogram("hMiMassPtM1",ma12 ,pt12 );
752 if (ph1->Module()==2 && ph2->Module()==2) FillHistogram("hMiMassPtM2",ma12 ,pt12 );
753 if (ph1->Module()==3 && ph2->Module()==3) FillHistogram("hMiMassPtM3",ma12 ,pt12 );
754 if ((ph1->Module()==1 && ph2->Module()==2) ||
755 (ph1->Module()==2 && ph2->Module()==1)) FillHistogram("hMiMassPtM12",ma12 ,pt12 );
756 if ((ph1->Module()==2 && ph2->Module()==3) ||
757 (ph1->Module()==3 && ph2->Module()==2)) FillHistogram("hMiMassPtM23",ma12 ,pt12 );
758 if ((ph1->Module()==1 && ph2->Module()==3) ||
759 (ph1->Module()==3 && ph2->Module()==1)) FillHistogram("hMiMassPtM13",ma12 ,pt12 );
761 if (TMath::Abs(ph1->EMCz()) < 20. || TMath::Abs(ph2->EMCz()) < 20.)
762 FillHistogram("hMiMassPt20cm",ma12 ,pt12 );
763 if ((TMath::Abs(ph1->EMCz()) > 20. && TMath::Abs(ph1->EMCz()) < 40.) ||
764 (TMath::Abs(ph2->EMCz()) > 20. && TMath::Abs(ph2->EMCz()) < 40.))
765 FillHistogram("hMiMassPt40cm",ma12 ,pt12 );
766 if (TMath::Abs(ph1->EMCz()) > 40. || TMath::Abs(ph2->EMCz()) > 40.)
767 FillHistogram("hMiMassPt60cm",ma12 ,pt12 );
771 if (ph1->GetNCells()>3 && ph2->GetNCells()>3) {
772 FillHistogram("hMiMassPtN3",ma12 ,pt12 );
774 if (ph1->GetNCells()>4 && ph2->GetNCells()>4) {
775 FillHistogram("hMiMassPtN4",ma12 ,pt12 );
777 if (ph1->GetNCells()>5 && ph2->GetNCells()>5) {
778 FillHistogram("hMiMassPtN5",ma12 ,pt12 );
780 if (ph1->GetNCells()>6 && ph2->GetNCells()>6) {
781 FillHistogram("fMihMassPtN6",ma12 ,pt12 );
789 //Now we either add current events to stack or remove
790 //If no photons in current event - no need to add it to mixed
791 if(fPHOSEvent->GetEntriesFast()>0){
792 prevPHOS->AddFirst(fPHOSEvent) ;
794 if(prevPHOS->GetSize()>100){//Remove redundant events
795 TClonesArray * tmp = static_cast<TClonesArray*>(prevPHOS->Last()) ;
796 prevPHOS->RemoveLast() ;
801 PostData(1, fOutputContainer);
805 //________________________________________________________________________
806 void AliAnalysisTaskPi0::Terminate(Option_t *)
808 // Draw result to the screen
809 // Called once at the end of the query
811 Int_t nPP = fnCINT1B - fnCINT1A - fnCINT1C + 2*fnCINT1E;
812 FillHistogram("hTrigClass",1,fnCINT1B);
813 FillHistogram("hTrigClass",2,fnCINT1A);
814 FillHistogram("hTrigClass",3,fnCINT1C);
815 FillHistogram("hTrigClass",4,fnCINT1E);
816 FillHistogram("hTrigClass",5,nPP);
817 Printf("fnCINT1B=%d, fnCINT1A=%d ,fnCINT1C=%d ,fnCINT1E=%d, nPP=%d",
818 fnCINT1B,fnCINT1A,fnCINT1C,fnCINT1E,nPP);
822 //________________________________________________________________________
823 Bool_t AliAnalysisTaskPi0::IsGoodChannel(const char * det, Int_t mod, Int_t ix, Int_t iz)
825 //Check if this channel belogs to the good ones
827 if(strcmp(det,"PHOS")==0){
829 AliError(Form("No bad map for PHOS module %d ",mod)) ;
832 if(!fPHOSBadMap[mod]){
833 AliError(Form("No Bad map for PHOS module %d",mod)) ;
836 if(fPHOSBadMap[mod]->GetBinContent(ix,iz)>0)
842 AliError(Form("Can not find bad channels for detector %s ",det)) ;
846 //_____________________________________________________________________________
847 void AliAnalysisTaskPi0::FillHistogram(const char * key,Double_t x)const{
849 TH1I * tmpI = dynamic_cast<TH1I*>(fOutputContainer->FindObject(key)) ;
854 TH1F * tmpF = dynamic_cast<TH1F*>(fOutputContainer->FindObject(key)) ;
859 TH1D * tmpD = dynamic_cast<TH1D*>(fOutputContainer->FindObject(key)) ;
864 AliInfo(Form("can not find histogram <%s> ",key)) ;
866 //_____________________________________________________________________________
867 void AliAnalysisTaskPi0::FillHistogram(const char * key,Double_t x,Double_t y)const{
869 TObject * tmp = fOutputContainer->FindObject(key) ;
871 AliInfo(Form("can not find histogram <%s> ",key)) ;
874 if(tmp->IsA() == TClass::GetClass("TH1F")){
875 ((TH1F*)tmp)->Fill(x,y) ;
878 if(tmp->IsA() == TClass::GetClass("TH2F")){
879 ((TH2F*)tmp)->Fill(x,y) ;
882 AliError(Form("Calling FillHistogram with 2 parameters for histo <%s> of type %s",key,tmp->IsA()->GetName())) ;
885 //_____________________________________________________________________________
886 void AliAnalysisTaskPi0::FillHistogram(const char * key,Double_t x,Double_t y, Double_t z) const{
887 //Fills 1D histograms with key
888 TObject * tmp = fOutputContainer->FindObject(key) ;
890 AliInfo(Form("can not find histogram <%s> ",key)) ;
893 if(tmp->IsA() == TClass::GetClass("TH2F")){
894 ((TH2F*)tmp)->Fill(x,y,z) ;
897 if(tmp->IsA() == TClass::GetClass("TH3F")){
898 ((TH3F*)tmp)->Fill(x,y,z) ;
902 //_____________________________________________________________________________
903 Bool_t AliAnalysisTaskPi0::TestLambda(Double_t l1,Double_t l2){
904 Double_t l1Mean=1.22 ;
905 Double_t l2Mean=2.0 ;
906 Double_t l1Sigma=0.42 ;
907 Double_t l2Sigma=0.71 ;
909 Double_t R2=(l1-l1Mean)*(l1-l1Mean)/l1Sigma/l1Sigma+(l2-l2Mean)*(l2-l2Mean)/l2Sigma/l2Sigma-c*(l1-l1Mean)*(l2-l2Mean)/l1Sigma/l2Sigma ;