]>
Commit | Line | Data |
---|---|---|
1c5acb87 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | /* $Id: $ */ | |
16 | ||
17 | //_________________________________________________________________________ | |
18 | // Class to collect two-photon invariant mass distributions for | |
19 | // extractin raw pi0 yield. | |
20 | // | |
21 | //-- Author: Dmitri Peressounko (RRC "KI") | |
22 | //-- Adapted to PartCorr frame by Lamia Benhabib (SUBATECH) | |
23 | //-- and Gustavo Conesa (INFN-Frascati) | |
24 | //_________________________________________________________________________ | |
25 | ||
26 | ||
27 | // --- ROOT system --- | |
28 | #include "TH3.h" | |
50f39b97 | 29 | #include "TH2D.h" |
1c5acb87 | 30 | //#include "Riostream.h" |
6639984f | 31 | #include "TCanvas.h" |
32 | #include "TPad.h" | |
33 | #include "TROOT.h" | |
477d6cee | 34 | #include "TClonesArray.h" |
0c1383b5 | 35 | #include "TObjString.h" |
1c5acb87 | 36 | |
37 | //---- AliRoot system ---- | |
38 | #include "AliAnaPi0.h" | |
39 | #include "AliCaloTrackReader.h" | |
40 | #include "AliCaloPID.h" | |
6639984f | 41 | #include "AliStack.h" |
ff45398a | 42 | #include "AliFiducialCut.h" |
477d6cee | 43 | #include "TParticle.h" |
477d6cee | 44 | #include "AliVEvent.h" |
6921fa00 | 45 | #include "AliESDCaloCluster.h" |
46 | #include "AliESDEvent.h" | |
47 | #include "AliAODEvent.h" | |
50f39b97 | 48 | #include "AliNeutralMesonSelection.h" |
c8fe2783 | 49 | #include "AliMixedEvent.h" |
50 | ||
591cc579 | 51 | |
1c5acb87 | 52 | ClassImp(AliAnaPi0) |
53 | ||
54 | //________________________________________________________________________________________________________________________________________________ | |
55 | AliAnaPi0::AliAnaPi0() : AliAnaPartCorrBaseClass(), | |
5025c139 | 56 | fDoOwnMix(kFALSE),fNCentrBin(0),//fNZvertBin(0),fNrpBin(0), |
57 | fNPID(0),fNmaxMixEv(0), fCalorimeter(""), | |
5ae09196 | 58 | fNModules(12), fUseAngleCut(kFALSE), fEventsList(0x0), fMultiCutAna(kFALSE), |
59 | fNPtCuts(0),fPtCuts(0x0),fNAsymCuts(0),fAsymCuts(0x0), | |
db2bf6fd | 60 | fNCellNCuts(0),fCellNCuts(0x0),fNPIDBits(0),fPIDBits(0x0),fhReMod(0x0), |
5ae09196 | 61 | fhRe1(0x0), fhMi1(0x0), fhRe2(0x0), fhMi2(0x0), fhRe3(0x0), fhMi3(0x0), |
62 | fhReInvPt1(0x0), fhMiInvPt1(0x0), fhReInvPt2(0x0), fhMiInvPt2(0x0), fhReInvPt3(0x0), fhMiInvPt3(0x0), | |
63 | fhRePtNCellAsymCuts(0x0), fhRePIDBits(0x0), | |
64 | fhEvents(0x0), fhRealOpeningAngle(0x0),fhRealCosOpeningAngle(0x0), | |
50f39b97 | 65 | fhPrimPt(0x0), fhPrimAccPt(0x0), fhPrimY(0x0), fhPrimAccY(0x0), fhPrimPhi(0x0), fhPrimAccPhi(0x0), |
66 | fhPrimOpeningAngle(0x0),fhPrimCosOpeningAngle(0x0) | |
1c5acb87 | 67 | { |
68 | //Default Ctor | |
69 | InitParameters(); | |
70 | ||
71 | } | |
1c5acb87 | 72 | |
73 | //________________________________________________________________________________________________________________________________________________ | |
74 | AliAnaPi0::~AliAnaPi0() { | |
477d6cee | 75 | // Remove event containers |
7e7694bb | 76 | |
77 | if(fDoOwnMix && fEventsList){ | |
477d6cee | 78 | for(Int_t ic=0; ic<fNCentrBin; ic++){ |
5025c139 | 79 | for(Int_t iz=0; iz<GetNZvertBin(); iz++){ |
80 | for(Int_t irp=0; irp<GetNRPBin(); irp++){ | |
81 | fEventsList[ic*GetNZvertBin()*GetNRPBin()+iz*GetNRPBin()+irp]->Delete() ; | |
82 | delete fEventsList[ic*GetNZvertBin()*GetNRPBin()+iz*GetNRPBin()+irp] ; | |
7e7694bb | 83 | } |
477d6cee | 84 | } |
85 | } | |
86 | delete[] fEventsList; | |
87 | fEventsList=0 ; | |
88 | } | |
591cc579 | 89 | |
1c5acb87 | 90 | } |
91 | ||
92 | //________________________________________________________________________________________________________________________________________________ | |
93 | void AliAnaPi0::InitParameters() | |
94 | { | |
95 | //Init parameters when first called the analysis | |
96 | //Set default parameters | |
a3aebfff | 97 | SetInputAODName("PWG4Particle"); |
98 | ||
99 | AddToHistogramsName("AnaPi0_"); | |
6921fa00 | 100 | fNModules = 12; // set maximum to maximum number of EMCAL modules |
477d6cee | 101 | fNCentrBin = 1; |
5025c139 | 102 | // fNZvertBin = 1; |
103 | // fNrpBin = 1; | |
477d6cee | 104 | fNPID = 9; |
105 | fNmaxMixEv = 10; | |
5025c139 | 106 | |
477d6cee | 107 | fCalorimeter = "PHOS"; |
50f39b97 | 108 | fUseAngleCut = kFALSE; |
5ae09196 | 109 | |
110 | fMultiCutAna = kFALSE; | |
111 | ||
112 | fNPtCuts = 3; | |
113 | fPtCuts = new Float_t[fNPtCuts]; | |
114 | fPtCuts[0] = 0.; fPtCuts[1] = 0.2; fPtCuts[2] = 0.3; | |
115 | ||
116 | fNAsymCuts = 3; | |
117 | fAsymCuts = new Float_t[fNAsymCuts]; | |
db2bf6fd | 118 | fAsymCuts[0] = 0.7; fAsymCuts[1] = 0.8; fAsymCuts[2] = 1.; |
5ae09196 | 119 | |
120 | fNCellNCuts = 3; | |
121 | fCellNCuts = new Int_t[fNCellNCuts]; | |
122 | fCellNCuts[0] = 1; fCellNCuts[1] = 2; fCellNCuts[2] = 3; | |
123 | ||
124 | fNPIDBits = 3; | |
125 | fPIDBits = new Int_t[fNPIDBits]; | |
126 | fPIDBits[0] = 2; fPIDBits[1] = 4; fPIDBits[2] = 6; // check dispersion, neutral, dispersion&&neutral | |
127 | ||
1c5acb87 | 128 | } |
1c5acb87 | 129 | |
0c1383b5 | 130 | |
131 | //________________________________________________________________________________________________________________________________________________ | |
132 | TObjString * AliAnaPi0::GetAnalysisCuts() | |
133 | { | |
134 | //Save parameters used for analysis | |
135 | TString parList ; //this will be list of parameters used for this analysis. | |
5ae09196 | 136 | const Int_t buffersize = 255; |
137 | char onePar[buffersize] ; | |
138 | snprintf(onePar,buffersize,"--- AliAnaPi0 ---\n") ; | |
0c1383b5 | 139 | parList+=onePar ; |
5ae09196 | 140 | snprintf(onePar,buffersize,"Number of bins in Centrality: %d \n",fNCentrBin) ; |
0c1383b5 | 141 | parList+=onePar ; |
5025c139 | 142 | snprintf(onePar,buffersize,"Number of bins in Z vert. pos: %d \n",GetNZvertBin()) ; |
0c1383b5 | 143 | parList+=onePar ; |
5025c139 | 144 | snprintf(onePar,buffersize,"Number of bins in Reac. Plain: %d \n",GetNRPBin()) ; |
0c1383b5 | 145 | parList+=onePar ; |
5ae09196 | 146 | snprintf(onePar,buffersize,"Depth of event buffer: %d \n",fNmaxMixEv) ; |
0c1383b5 | 147 | parList+=onePar ; |
5ae09196 | 148 | snprintf(onePar,buffersize,"Number of different PID used: %d \n",fNPID) ; |
0c1383b5 | 149 | parList+=onePar ; |
5ae09196 | 150 | snprintf(onePar,buffersize,"Cuts: \n") ; |
0c1383b5 | 151 | parList+=onePar ; |
5025c139 | 152 | snprintf(onePar,buffersize,"Z vertex position: -%f < z < %f \n",GetZvertexCut(),GetZvertexCut()) ; |
0c1383b5 | 153 | parList+=onePar ; |
5ae09196 | 154 | snprintf(onePar,buffersize,"Calorimeter: %s \n",fCalorimeter.Data()) ; |
0c1383b5 | 155 | parList+=onePar ; |
5ae09196 | 156 | snprintf(onePar,buffersize,"Number of modules: %d \n",fNModules) ; |
0c1383b5 | 157 | parList+=onePar ; |
db2bf6fd | 158 | if(fMultiCutAna){ |
159 | snprintf(onePar, buffersize," pT cuts: n = %d, pt > ",fNPtCuts) ; | |
160 | for(Int_t i = 0; i < fNPtCuts; i++) snprintf(onePar,buffersize,"%s %2.2f;",onePar,fPtCuts[i]); | |
161 | parList+=onePar ; | |
162 | ||
163 | snprintf(onePar,buffersize, " N cell in cluster cuts: n = %d, nCell > ",fNCellNCuts) ; | |
164 | for(Int_t i = 0; i < fNCellNCuts; i++) snprintf(onePar,buffersize,"%s %d;",onePar,fCellNCuts[i]); | |
165 | parList+=onePar ; | |
166 | ||
167 | snprintf(onePar,buffersize," Asymmetry cuts: n = %d, asymmetry < ",fNAsymCuts) ; | |
168 | for(Int_t i = 0; i < fNAsymCuts; i++) snprintf(onePar,buffersize,"%s %2.2f;",onePar,fAsymCuts[i]); | |
169 | parList+=onePar ; | |
170 | ||
171 | snprintf(onePar,buffersize," PID selection bits: n = %d, PID bit =\n",fNPIDBits) ; | |
172 | for(Int_t i = 0; i < fNPIDBits; i++) snprintf(onePar,buffersize,"%s %d;",onePar,fPIDBits[i]); | |
173 | parList+=onePar ; | |
174 | } | |
175 | ||
0c1383b5 | 176 | return new TObjString(parList) ; |
177 | } | |
178 | ||
2e557d1c | 179 | //________________________________________________________________________________________________________________________________________________ |
180 | TList * AliAnaPi0::GetCreateOutputObjects() | |
181 | { | |
477d6cee | 182 | // Create histograms to be saved in output file and |
183 | // store them in fOutputContainer | |
184 | ||
185 | //create event containers | |
5025c139 | 186 | fEventsList = new TList*[fNCentrBin*GetNZvertBin()*GetNRPBin()] ; |
1c5acb87 | 187 | |
477d6cee | 188 | for(Int_t ic=0; ic<fNCentrBin; ic++){ |
5025c139 | 189 | for(Int_t iz=0; iz<GetNZvertBin(); iz++){ |
190 | for(Int_t irp=0; irp<GetNRPBin(); irp++){ | |
191 | fEventsList[ic*GetNZvertBin()*GetNRPBin()+iz*GetNRPBin()+irp] = new TList() ; | |
477d6cee | 192 | } |
193 | } | |
194 | } | |
7e7694bb | 195 | |
477d6cee | 196 | TList * outputContainer = new TList() ; |
197 | outputContainer->SetName(GetName()); | |
6921fa00 | 198 | |
199 | fhReMod = new TH3D*[fNModules] ; | |
50305ae9 | 200 | fhRe1 = new TH3D*[fNCentrBin*fNPID] ; |
201 | fhRe2 = new TH3D*[fNCentrBin*fNPID] ; | |
202 | fhRe3 = new TH3D*[fNCentrBin*fNPID] ; | |
203 | fhMi1 = new TH3D*[fNCentrBin*fNPID] ; | |
204 | fhMi2 = new TH3D*[fNCentrBin*fNPID] ; | |
205 | fhMi3 = new TH3D*[fNCentrBin*fNPID] ; | |
5ae09196 | 206 | |
207 | fhReInvPt1 = new TH3D*[fNCentrBin*fNPID] ; | |
208 | fhReInvPt2 = new TH3D*[fNCentrBin*fNPID] ; | |
209 | fhReInvPt3 = new TH3D*[fNCentrBin*fNPID] ; | |
210 | fhMiInvPt1 = new TH3D*[fNCentrBin*fNPID] ; | |
211 | fhMiInvPt2 = new TH3D*[fNCentrBin*fNPID] ; | |
212 | fhMiInvPt3 = new TH3D*[fNCentrBin*fNPID] ; | |
213 | ||
214 | const Int_t buffersize = 255; | |
215 | char key[buffersize] ; | |
216 | char title[buffersize] ; | |
477d6cee | 217 | |
5a2dbc3c | 218 | Int_t nptbins = GetHistoPtBins(); |
219 | Int_t nphibins = GetHistoPhiBins(); | |
220 | Int_t netabins = GetHistoEtaBins(); | |
221 | Float_t ptmax = GetHistoPtMax(); | |
222 | Float_t phimax = GetHistoPhiMax(); | |
223 | Float_t etamax = GetHistoEtaMax(); | |
224 | Float_t ptmin = GetHistoPtMin(); | |
225 | Float_t phimin = GetHistoPhiMin(); | |
226 | Float_t etamin = GetHistoEtaMin(); | |
227 | ||
228 | Int_t nmassbins = GetHistoMassBins(); | |
229 | Int_t nasymbins = GetHistoAsymmetryBins(); | |
230 | Float_t massmax = GetHistoMassMax(); | |
231 | Float_t asymmax = GetHistoAsymmetryMax(); | |
232 | Float_t massmin = GetHistoMassMin(); | |
233 | Float_t asymmin = GetHistoAsymmetryMin(); | |
234 | ||
477d6cee | 235 | for(Int_t ic=0; ic<fNCentrBin; ic++){ |
236 | for(Int_t ipid=0; ipid<fNPID; ipid++){ | |
7e7694bb | 237 | |
477d6cee | 238 | //Distance to bad module 1 |
5ae09196 | 239 | snprintf(key, buffersize,"hRe_cen%d_pid%d_dist1",ic,ipid) ; |
240 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
7e7694bb | 241 | fhRe1[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
477d6cee | 242 | outputContainer->Add(fhRe1[ic*fNPID+ipid]) ; |
7e7694bb | 243 | |
477d6cee | 244 | //Distance to bad module 2 |
5ae09196 | 245 | snprintf(key, buffersize,"hRe_cen%d_pid%d_dist2",ic,ipid) ; |
246 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
7e7694bb | 247 | fhRe2[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
477d6cee | 248 | outputContainer->Add(fhRe2[ic*fNPID+ipid]) ; |
249 | ||
477d6cee | 250 | //Distance to bad module 3 |
5ae09196 | 251 | snprintf(key, buffersize,"hRe_cen%d_pid%d_dist3",ic,ipid) ; |
252 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
7e7694bb | 253 | fhRe3[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
477d6cee | 254 | outputContainer->Add(fhRe3[ic*fNPID+ipid]) ; |
255 | ||
5ae09196 | 256 | //Inverse pT |
257 | //Distance to bad module 1 | |
258 | snprintf(key, buffersize,"hReInvPt_cen%d_pid%d_dist1",ic,ipid) ; | |
259 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
db2bf6fd | 260 | fhReInvPt1[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
5ae09196 | 261 | outputContainer->Add(fhReInvPt1[ic*fNPID+ipid]) ; |
262 | ||
263 | //Distance to bad module 2 | |
264 | snprintf(key, buffersize,"hReInvPt_cen%d_pid%d_dist2",ic,ipid) ; | |
265 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
db2bf6fd | 266 | fhReInvPt2[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
5ae09196 | 267 | outputContainer->Add(fhReInvPt2[ic*fNPID+ipid]) ; |
268 | ||
269 | //Distance to bad module 3 | |
270 | snprintf(key, buffersize,"hReInvPt_cen%d_pid%d_dist3",ic,ipid) ; | |
271 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
db2bf6fd | 272 | fhReInvPt3[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
5ae09196 | 273 | outputContainer->Add(fhReInvPt3[ic*fNPID+ipid]) ; |
274 | ||
275 | ||
7e7694bb | 276 | if(fDoOwnMix){ |
277 | //Distance to bad module 1 | |
5ae09196 | 278 | snprintf(key, buffersize,"hMi_cen%d_pid%d_dist1",ic,ipid) ; |
279 | snprintf(title, buffersize,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
7e7694bb | 280 | fhMi1[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
281 | outputContainer->Add(fhMi1[ic*fNPID+ipid]) ; | |
282 | ||
283 | //Distance to bad module 2 | |
5ae09196 | 284 | snprintf(key, buffersize,"hMi_cen%d_pid%d_dist2",ic,ipid) ; |
285 | snprintf(title, buffersize,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
7e7694bb | 286 | fhMi2[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
287 | outputContainer->Add(fhMi2[ic*fNPID+ipid]) ; | |
288 | ||
289 | //Distance to bad module 3 | |
5ae09196 | 290 | snprintf(key, buffersize,"hMi_cen%d_pid%d_dist3",ic,ipid) ; |
291 | snprintf(title, buffersize,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
7e7694bb | 292 | fhMi3[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
293 | outputContainer->Add(fhMi3[ic*fNPID+ipid]) ; | |
5ae09196 | 294 | |
295 | //Inverse pT | |
296 | //Distance to bad module 1 | |
297 | snprintf(key, buffersize,"hMiInvPt_cen%d_pid%d_dist1",ic,ipid) ; | |
298 | snprintf(title, buffersize,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
db2bf6fd | 299 | fhMiInvPt1[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
5ae09196 | 300 | outputContainer->Add(fhMiInvPt1[ic*fNPID+ipid]) ; |
301 | ||
302 | //Distance to bad module 2 | |
303 | snprintf(key, buffersize,"hMiInvPt_cen%d_pid%d_dist2",ic,ipid) ; | |
304 | snprintf(title, buffersize,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
db2bf6fd | 305 | fhMiInvPt2[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
5ae09196 | 306 | outputContainer->Add(fhMiInvPt2[ic*fNPID+ipid]) ; |
307 | ||
308 | //Distance to bad module 3 | |
309 | snprintf(key, buffersize,"hMiInvPt_cen%d_pid%d_dist3",ic,ipid) ; | |
310 | snprintf(title, buffersize,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; | |
db2bf6fd | 311 | fhMiInvPt3[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
5ae09196 | 312 | outputContainer->Add(fhMiInvPt3[ic*fNPID+ipid]) ; |
313 | ||
314 | ||
7e7694bb | 315 | } |
1c5acb87 | 316 | } |
477d6cee | 317 | } |
318 | ||
5ae09196 | 319 | if(fMultiCutAna){ |
320 | ||
321 | fhRePIDBits = new TH2D*[fNPIDBits]; | |
322 | for(Int_t ipid=0; ipid<fNPIDBits; ipid++){ | |
323 | snprintf(key, buffersize,"hRe_pidbit%d",ipid) ; | |
324 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for PIDBit=%d",fPIDBits[ipid]) ; | |
325 | fhRePIDBits[ipid] = new TH2D(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ; | |
326 | outputContainer->Add(fhRePIDBits[ipid]) ; | |
327 | }// pid bit loop | |
328 | ||
329 | fhRePtNCellAsymCuts = new TH2D*[fNPtCuts*fNAsymCuts*fNCellNCuts]; | |
330 | for(Int_t ipt=0; ipt<fNPtCuts; ipt++){ | |
331 | for(Int_t icell=0; icell<fNCellNCuts; icell++){ | |
332 | for(Int_t iasym=0; iasym<fNAsymCuts; iasym++){ | |
333 | snprintf(key, buffersize,"hRe_pt%d_cell%d_asym%d",ipt,icell,iasym) ; | |
334 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for pt >%2.2f, ncell>%d and asym >%2.2f ",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]) ; | |
335 | Int_t index = ((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym; | |
336 | //printf("ipt %d, icell %d, iassym %d, index %d\n",ipt, icell, iasym, index); | |
337 | fhRePtNCellAsymCuts[index] = new TH2D(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ; | |
338 | outputContainer->Add(fhRePtNCellAsymCuts[index]) ; | |
339 | } | |
340 | } | |
341 | } | |
342 | }// multi cuts analysis | |
343 | ||
477d6cee | 344 | fhEvents=new TH3D("hEvents","Number of events",fNCentrBin,0.,1.*fNCentrBin, |
5025c139 | 345 | GetNZvertBin(),0.,1.*GetNZvertBin(),GetNRPBin(),0.,1.*GetNRPBin()) ; |
477d6cee | 346 | outputContainer->Add(fhEvents) ; |
50f39b97 | 347 | |
348 | fhRealOpeningAngle = new TH2D | |
349 | ("hRealOpeningAngle","Angle between all #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,200,0,0.5); | |
350 | fhRealOpeningAngle->SetYTitle("#theta(rad)"); | |
351 | fhRealOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)"); | |
352 | outputContainer->Add(fhRealOpeningAngle) ; | |
7e7694bb | 353 | |
50f39b97 | 354 | fhRealCosOpeningAngle = new TH2D |
355 | ("hRealCosOpeningAngle","Cosinus of angle between all #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,200,-1,1); | |
356 | fhRealCosOpeningAngle->SetYTitle("cos (#theta) "); | |
357 | fhRealCosOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)"); | |
358 | outputContainer->Add(fhRealCosOpeningAngle) ; | |
359 | ||
360 | ||
477d6cee | 361 | //Histograms filled only if MC data is requested |
0ae57829 | 362 | if(IsDataMC()){ |
5ae09196 | 363 | |
7e7694bb | 364 | fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",nptbins,ptmin,ptmax) ; |
5a2dbc3c | 365 | fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",nptbins,ptmin,ptmax) ; |
477d6cee | 366 | outputContainer->Add(fhPrimPt) ; |
367 | outputContainer->Add(fhPrimAccPt) ; | |
368 | ||
5a2dbc3c | 369 | fhPrimY = new TH1D("hPrimaryRapidity","Rapidity of primary pi0",netabins,etamin,etamax) ; |
477d6cee | 370 | outputContainer->Add(fhPrimY) ; |
371 | ||
5a2dbc3c | 372 | fhPrimAccY = new TH1D("hPrimAccRapidity","Rapidity of primary pi0",netabins,etamin,etamax) ; |
477d6cee | 373 | outputContainer->Add(fhPrimAccY) ; |
374 | ||
7e7694bb | 375 | fhPrimPhi = new TH1D("hPrimaryPhi","Azimithal of primary pi0",nphibins,phimin*TMath::RadToDeg(),phimax*TMath::RadToDeg()) ; |
477d6cee | 376 | outputContainer->Add(fhPrimPhi) ; |
377 | ||
5a2dbc3c | 378 | fhPrimAccPhi = new TH1D("hPrimAccPhi","Azimithal of primary pi0 with accepted daughters",nphibins,phimin*TMath::RadToDeg(),phimax*TMath::RadToDeg()) ; |
477d6cee | 379 | outputContainer->Add(fhPrimAccPhi) ; |
50f39b97 | 380 | |
381 | ||
382 | fhPrimOpeningAngle = new TH2D | |
7e7694bb | 383 | ("hPrimOpeningAngle","Angle between all primary #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,100,0,0.5); |
50f39b97 | 384 | fhPrimOpeningAngle->SetYTitle("#theta(rad)"); |
385 | fhPrimOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)"); | |
386 | outputContainer->Add(fhPrimOpeningAngle) ; | |
387 | ||
388 | fhPrimCosOpeningAngle = new TH2D | |
7e7694bb | 389 | ("hPrimCosOpeningAngle","Cosinus of angle between all primary #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,100,-1,1); |
50f39b97 | 390 | fhPrimCosOpeningAngle->SetYTitle("cos (#theta) "); |
391 | fhPrimCosOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)"); | |
392 | outputContainer->Add(fhPrimCosOpeningAngle) ; | |
393 | ||
477d6cee | 394 | } |
50f39b97 | 395 | |
6921fa00 | 396 | for(Int_t imod=0; imod<fNModules; imod++){ |
50f39b97 | 397 | //Module dependent invariant mass |
5ae09196 | 398 | snprintf(key, buffersize,"hReMod_%d",imod) ; |
399 | snprintf(title, buffersize,"Real m_{#gamma#gamma} distr. for Module %d",imod) ; | |
50f39b97 | 400 | fhReMod[imod] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ; |
401 | outputContainer->Add(fhReMod[imod]) ; | |
6921fa00 | 402 | } |
50f39b97 | 403 | |
eee5fcf1 | 404 | // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++){ |
405 | // | |
406 | // printf("Histogram %d, name: %s\n ",i, outputContainer->At(i)->GetName()); | |
407 | // | |
408 | // } | |
409 | ||
477d6cee | 410 | return outputContainer; |
1c5acb87 | 411 | } |
412 | ||
413 | //_________________________________________________________________________________________________________________________________________________ | |
414 | void AliAnaPi0::Print(const Option_t * /*opt*/) const | |
415 | { | |
477d6cee | 416 | //Print some relevant parameters set for the analysis |
a3aebfff | 417 | printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; |
477d6cee | 418 | AliAnaPartCorrBaseClass::Print(" "); |
a3aebfff | 419 | |
477d6cee | 420 | printf("Number of bins in Centrality: %d \n",fNCentrBin) ; |
5025c139 | 421 | printf("Number of bins in Z vert. pos: %d \n",GetNZvertBin()) ; |
422 | printf("Number of bins in Reac. Plain: %d \n",GetNRPBin()) ; | |
477d6cee | 423 | printf("Depth of event buffer: %d \n",fNmaxMixEv) ; |
424 | printf("Number of different PID used: %d \n",fNPID) ; | |
425 | printf("Cuts: \n") ; | |
5025c139 | 426 | printf("Z vertex position: -%2.3f < z < %2.3f \n",GetZvertexCut(),GetZvertexCut()) ; |
50f39b97 | 427 | printf("Number of modules: %d \n",fNModules) ; |
428 | printf("Select pairs with their angle: %d \n",fUseAngleCut) ; | |
db2bf6fd | 429 | if(fMultiCutAna){ |
430 | printf("pT cuts: n = %d, \n",fNPtCuts) ; | |
431 | printf("\tpT > "); | |
432 | for(Int_t i = 0; i < fNPtCuts; i++) printf("%2.2f ",fPtCuts[i]); | |
433 | printf("GeV/c\n"); | |
434 | ||
435 | printf("N cell in cluster cuts: n = %d, \n",fNCellNCuts) ; | |
436 | printf("\tnCell > "); | |
437 | for(Int_t i = 0; i < fNCellNCuts; i++) printf("%d ",fCellNCuts[i]); | |
438 | printf("\n"); | |
439 | ||
440 | printf("Asymmetry cuts: n = %d, \n",fNAsymCuts) ; | |
441 | printf("\tasymmetry < "); | |
442 | for(Int_t i = 0; i < fNAsymCuts; i++) printf("%2.2f ",fAsymCuts[i]); | |
443 | printf("\n"); | |
444 | ||
445 | printf("PID selection bits: n = %d, \n",fNPIDBits) ; | |
446 | printf("\tPID bit = "); | |
447 | for(Int_t i = 0; i < fNPIDBits; i++) printf("%d ",fPIDBits[i]); | |
448 | printf("\n"); | |
449 | ||
450 | } | |
477d6cee | 451 | printf("------------------------------------------------------\n") ; |
1c5acb87 | 452 | } |
453 | ||
5ae09196 | 454 | //_____________________________________________________________ |
455 | void AliAnaPi0::FillAcceptanceHistograms(){ | |
456 | //Fill acceptance histograms if MC data is available | |
c8fe2783 | 457 | |
5ae09196 | 458 | if(IsDataMC() && GetReader()->ReadStack()){ |
459 | AliStack * stack = GetMCStack(); | |
460 | if(stack && (IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC)) ){ | |
461 | for(Int_t i=0 ; i<stack->GetNprimary(); i++){ | |
462 | TParticle * prim = stack->Particle(i) ; | |
463 | if(prim->GetPdgCode() == 111){ | |
464 | Double_t pi0Pt = prim->Pt() ; | |
465 | //printf("pi0, pt %2.2f\n",pi0Pt); | |
466 | if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception | |
467 | Double_t pi0Y = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ; | |
468 | Double_t phi = TMath::RadToDeg()*prim->Phi() ; | |
469 | if(TMath::Abs(pi0Y) < 0.5){ | |
470 | fhPrimPt->Fill(pi0Pt) ; | |
471 | } | |
472 | fhPrimY ->Fill(pi0Y) ; | |
473 | fhPrimPhi->Fill(phi) ; | |
474 | ||
475 | //Check if both photons hit Calorimeter | |
476 | Int_t iphot1=prim->GetFirstDaughter() ; | |
477 | Int_t iphot2=prim->GetLastDaughter() ; | |
478 | if(iphot1>-1 && iphot1<stack->GetNtrack() && iphot2>-1 && iphot2<stack->GetNtrack()){ | |
479 | TParticle * phot1 = stack->Particle(iphot1) ; | |
480 | TParticle * phot2 = stack->Particle(iphot2) ; | |
481 | if(phot1 && phot2 && phot1->GetPdgCode()==22 && phot2->GetPdgCode()==22){ | |
482 | //printf("2 photons: photon 1: pt %2.2f, phi %3.2f, eta %1.2f; photon 2: pt %2.2f, phi %3.2f, eta %1.2f\n", | |
483 | // phot1->Pt(), phot1->Phi()*180./3.1415, phot1->Eta(), phot2->Pt(), phot2->Phi()*180./3.1415, phot2->Eta()); | |
484 | ||
485 | TLorentzVector lv1, lv2; | |
486 | phot1->Momentum(lv1); | |
487 | phot2->Momentum(lv2); | |
488 | ||
489 | Bool_t inacceptance = kFALSE; | |
490 | if(fCalorimeter == "PHOS"){ | |
491 | if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet()){ | |
492 | Int_t mod ; | |
493 | Double_t x,z ; | |
494 | if(GetPHOSGeometry()->ImpactOnEmc(phot1,mod,z,x) && GetPHOSGeometry()->ImpactOnEmc(phot2,mod,z,x)) | |
495 | inacceptance = kTRUE; | |
496 | if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance); | |
497 | } | |
498 | else{ | |
499 | ||
500 | if(GetFiducialCut()->IsInFiducialCut(lv1,fCalorimeter) && GetFiducialCut()->IsInFiducialCut(lv2,fCalorimeter)) | |
501 | inacceptance = kTRUE ; | |
502 | if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance); | |
503 | } | |
504 | ||
505 | } | |
506 | else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){ | |
507 | if(GetEMCALGeometry()){ | |
508 | if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2)) | |
509 | inacceptance = kTRUE; | |
510 | if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance); | |
511 | } | |
512 | else{ | |
513 | if(GetFiducialCut()->IsInFiducialCut(lv1,fCalorimeter) && GetFiducialCut()->IsInFiducialCut(lv2,fCalorimeter)) | |
514 | inacceptance = kTRUE ; | |
515 | if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance); | |
516 | } | |
517 | } | |
518 | ||
519 | if(inacceptance){ | |
520 | ||
521 | fhPrimAccPt->Fill(pi0Pt) ; | |
522 | fhPrimAccPhi->Fill(phi) ; | |
523 | fhPrimAccY->Fill(pi0Y) ; | |
524 | Double_t angle = lv1.Angle(lv2.Vect()); | |
525 | fhPrimOpeningAngle ->Fill(pi0Pt,angle); | |
526 | fhPrimCosOpeningAngle->Fill(pi0Pt,TMath::Cos(angle)); | |
527 | ||
528 | }//Accepted | |
529 | }// 2 photons | |
530 | }//Check daughters exist | |
531 | }// Primary pi0 | |
532 | }//loop on primaries | |
533 | }//stack exists and data is MC | |
534 | }//read stack | |
535 | else if(GetReader()->ReadAODMCParticles()){ | |
536 | if(GetDebug() >= 0) printf("AliAnaPi0::FillAcceptanceHistograms() - Acceptance calculation with MCParticles not implemented yet\n"); | |
537 | } | |
538 | } | |
539 | ||
1c5acb87 | 540 | //____________________________________________________________________________________________________________________________________________________ |
6639984f | 541 | void AliAnaPi0::MakeAnalysisFillHistograms() |
1c5acb87 | 542 | { |
477d6cee | 543 | //Process one event and extract photons from AOD branch |
544 | // filled with AliAnaPhoton and fill histos with invariant mass | |
545 | ||
5ae09196 | 546 | //In case of MC data, fill acceptance histograms |
547 | FillAcceptanceHistograms(); | |
548 | ||
477d6cee | 549 | //Apply some cuts on event: vertex position and centrality range |
550 | Int_t iRun=(GetReader()->GetInputEvent())->GetRunNumber() ; | |
551 | if(IsBadRun(iRun)) return ; | |
552 | ||
477d6cee | 553 | Int_t nPhot = GetInputAODBranch()->GetEntriesFast() ; |
c8fe2783 | 554 | if(GetDebug() > 1) |
555 | printf("AliAnaPi0::MakeAnalysisFillHistograms() - Photon entries %d\n", nPhot); | |
556 | if(nPhot < 2 ) | |
557 | return ; | |
6921fa00 | 558 | Int_t module1 = -1; |
559 | Int_t module2 = -1; | |
7e7694bb | 560 | Double_t vert[] = {0.0, 0.0, 0.0} ; //vertex |
561 | Int_t evtIndex1 = 0 ; | |
562 | Int_t currentEvtIndex = -1 ; | |
563 | Int_t curCentrBin = 0 ; | |
564 | Int_t curRPBin = 0 ; | |
565 | Int_t curZvertBin = 0 ; | |
566 | ||
477d6cee | 567 | for(Int_t i1=0; i1<nPhot-1; i1++){ |
568 | AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ; | |
7e7694bb | 569 | // get the event index in the mixed buffer where the photon comes from |
570 | // in case of mixing with analysis frame, not own mixing | |
c8fe2783 | 571 | evtIndex1 = GetEventIndex(p1, vert) ; |
5025c139 | 572 | //printf("charge = %d\n", track->Charge()); |
c8fe2783 | 573 | if ( evtIndex1 == -1 ) |
574 | return ; | |
575 | if ( evtIndex1 == -2 ) | |
576 | continue ; | |
577 | if (evtIndex1 != currentEvtIndex) { | |
7e7694bb | 578 | //Get Reaction Plan position and calculate RP bin |
579 | //does not exist in ESD yet???? | |
c8fe2783 | 580 | curCentrBin = 0 ; |
581 | curRPBin = 0 ; | |
5025c139 | 582 | curZvertBin = (Int_t)(0.5*GetNZvertBin()*(vert[2]+GetZvertexCut())/GetZvertexCut()) ; |
c8fe2783 | 583 | fhEvents->Fill(curCentrBin+0.5,curZvertBin+0.5,curRPBin+0.5) ; |
584 | currentEvtIndex = evtIndex1 ; | |
585 | } | |
7e7694bb | 586 | |
f8006433 | 587 | //printf("AliAnaPi0::MakeAnalysisFillHistograms(): Photon 1 Evt %d Vertex : %f,%f,%f\n",evtIndex1, GetVertex(evtIndex1)[0] ,GetVertex(evtIndex1)[1],GetVertex(evtIndex1)[2]); |
588 | ||
477d6cee | 589 | TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E()); |
59b6bd99 | 590 | //Get Module number |
591 | module1 = GetModuleNumber(p1); | |
477d6cee | 592 | for(Int_t i2=i1+1; i2<nPhot; i2++){ |
593 | AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i2)) ; | |
c8fe2783 | 594 | Int_t evtIndex2 = GetEventIndex(p2, vert) ; |
595 | if ( evtIndex2 == -1 ) | |
596 | return ; | |
597 | if ( evtIndex2 == -2 ) | |
598 | continue ; | |
599 | if (GetMixedEvent() && (evtIndex1 == evtIndex2)) | |
7e7694bb | 600 | continue ; |
f8006433 | 601 | //printf("AliAnaPi0::MakeAnalysisFillHistograms(): Photon 2 Evt %d Vertex : %f,%f,%f\n",evtIndex2, GetVertex(evtIndex2)[0] ,GetVertex(evtIndex2)[1],GetVertex(evtIndex2)[2]); |
477d6cee | 602 | TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E()); |
59b6bd99 | 603 | //Get module number |
604 | module2 = GetModuleNumber(p2); | |
477d6cee | 605 | Double_t m = (photon1 + photon2).M() ; |
606 | Double_t pt = (photon1 + photon2).Pt(); | |
607 | Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ; | |
608 | if(GetDebug() > 2) | |
c8fe2783 | 609 | printf("AliAnaPi0::MakeAnalysisFillHistograms() - Current Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n", |
610 | p1->Pt(), p2->Pt(), pt,m,a); | |
50f39b97 | 611 | //Check if opening angle is too large or too small compared to what is expected |
612 | Double_t angle = photon1.Angle(photon2.Vect()); | |
613 | //if(fUseAngleCut && !GetNeutralMesonSelection()->IsAngleInWindow((photon1+photon2).E(),angle)) continue; | |
614 | //printf("angle %f\n",angle); | |
c8fe2783 | 615 | if(fUseAngleCut && angle < 0.1) |
616 | continue; | |
50f39b97 | 617 | fhRealOpeningAngle ->Fill(pt,angle); |
618 | fhRealCosOpeningAngle->Fill(pt,TMath::Cos(angle)); | |
59b6bd99 | 619 | //Fill module dependent histograms |
620 | //if(module1==module2) printf("mod1 %d\n",module1); | |
621 | if(module1==module2 && module1 >=0 && module1<fNModules) | |
c8fe2783 | 622 | fhReMod[module1]->Fill(pt,a,m) ; |
7e7694bb | 623 | |
c8fe2783 | 624 | for(Int_t ipid=0; ipid<fNPID; ipid++){ |
625 | if((p1->IsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){ | |
db2bf6fd | 626 | fhRe1 [curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; |
627 | fhReInvPt1[curCentrBin*fNPID+ipid]->Fill(pt,a,m,1./pt) ; | |
c8fe2783 | 628 | if(p1->DistToBad()>0 && p2->DistToBad()>0){ |
db2bf6fd | 629 | fhRe2 [curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; |
630 | fhReInvPt2[curCentrBin*fNPID+ipid]->Fill(pt,a,m,1./pt) ; | |
c8fe2783 | 631 | if(p1->DistToBad()>1 && p2->DistToBad()>1){ |
db2bf6fd | 632 | fhRe3 [curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; |
633 | fhReInvPt3[curCentrBin*fNPID+ipid]->Fill(pt,a,m,1./pt) ; | |
5ae09196 | 634 | }// bad 3 |
635 | }// bad2 | |
636 | }// bad 1 | |
637 | }// pid loop | |
638 | ||
639 | //Multi cuts analysis | |
640 | if(fMultiCutAna){ | |
641 | //Histograms for different PID bits selection | |
642 | for(Int_t ipid=0; ipid<fNPIDBits; ipid++){ | |
643 | ||
644 | if(p1->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton) && | |
645 | p2->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton)) fhRePIDBits[ipid]->Fill(pt,m) ; | |
646 | ||
647 | //printf("ipt %d, ipid%d, name %s\n",ipt, ipid, fhRePtPIDCuts[ipt*fNPIDBits+ipid]->GetName()); | |
648 | } // pid bit cut loop | |
649 | ||
650 | //Several pt,ncell and asymetry cuts | |
651 | //Get the number of cells | |
652 | Int_t ncell1 = 0; | |
653 | Int_t ncell2 = 0; | |
52f4577d | 654 | AliVEvent * event = GetReader()->GetInputEvent(); |
655 | if(event){ | |
656 | for(Int_t iclus = 0; iclus < event->GetNumberOfCaloClusters(); iclus++){ | |
657 | AliVCluster *cluster = event->GetCaloCluster(iclus); | |
658 | ||
659 | Bool_t is = kFALSE; | |
660 | if (fCalorimeter == "EMCAL" && GetReader()->IsEMCALCluster(cluster)) is = kTRUE; | |
661 | else if(fCalorimeter == "PHOS" && GetReader()->IsPHOSCluster (cluster)) is = kTRUE; | |
662 | ||
663 | if(is){ | |
664 | if (p1->GetCaloLabel(0) == cluster->GetID()) ncell1 = cluster->GetNCells(); | |
665 | else if (p2->GetCaloLabel(0) == cluster->GetID()) ncell2 = cluster->GetNCells(); | |
666 | } // PHOS or EMCAL cluster as requested in analysis | |
667 | ||
668 | if(ncell2 > 0 && ncell1 > 0) break; // No need to continue the iteration | |
669 | ||
670 | } | |
671 | //printf("e 1: %2.2f, e 2: %2.2f, ncells: n1 %d, n2 %d\n", p1->E(), p2->E(),ncell1,ncell2); | |
c8fe2783 | 672 | } |
5ae09196 | 673 | for(Int_t ipt=0; ipt<fNPtCuts; ipt++){ |
674 | for(Int_t icell=0; icell<fNCellNCuts; icell++){ | |
675 | for(Int_t iasym=0; iasym<fNAsymCuts; iasym++){ | |
676 | ||
677 | if(p1->Pt() > fPtCuts[ipt] && p2->Pt() > fPtCuts[ipt] && | |
678 | a < fAsymCuts[iasym] && | |
679 | ncell1 >= fCellNCuts[icell] && ncell2 >= fCellNCuts[icell]) fhRePtNCellAsymCuts[((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym]->Fill(pt,m) ; | |
680 | ||
681 | //printf("ipt %d, icell%d, iasym %d, name %s\n",ipt, icell, iasym, fhRePtNCellAsymCuts[((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym]->GetName()); | |
682 | }// pid bit cut loop | |
683 | }// icell loop | |
684 | }// pt cut loop | |
685 | ||
686 | }// multiple cuts analysis | |
7e7694bb | 687 | }// second same event particle |
688 | }// first cluster | |
689 | ||
690 | if(fDoOwnMix){ | |
691 | //Fill mixed | |
5025c139 | 692 | TList * evMixList=fEventsList[curCentrBin*GetNZvertBin()*GetNRPBin()+curZvertBin*GetNRPBin()+curRPBin] ; |
7e7694bb | 693 | Int_t nMixed = evMixList->GetSize() ; |
694 | for(Int_t ii=0; ii<nMixed; ii++){ | |
695 | TClonesArray* ev2= (TClonesArray*) (evMixList->At(ii)); | |
696 | Int_t nPhot2=ev2->GetEntriesFast() ; | |
697 | Double_t m = -999; | |
698 | if(GetDebug() > 1) printf("AliAnaPi0::MakeAnalysisFillHistograms() - Mixed event %d photon entries %d\n", ii, nPhot); | |
699 | ||
700 | for(Int_t i1=0; i1<nPhot; i1++){ | |
701 | AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ; | |
702 | TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E()); | |
703 | for(Int_t i2=0; i2<nPhot2; i2++){ | |
704 | AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (ev2->At(i2)) ; | |
705 | ||
706 | TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E()); | |
707 | m = (photon1+photon2).M() ; | |
708 | Double_t pt = (photon1 + photon2).Pt(); | |
709 | Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ; | |
710 | ||
711 | //Check if opening angle is too large or too small compared to what is expected | |
712 | Double_t angle = photon1.Angle(photon2.Vect()); | |
713 | //if(fUseAngleCut && !GetNeutralMesonSelection()->IsAngleInWindow((photon1+photon2).E(),angle)) continue; | |
714 | if(fUseAngleCut && angle < 0.1) continue; | |
715 | ||
716 | if(GetDebug() > 2) | |
717 | printf("AliAnaPi0::MakeAnalysisFillHistograms() - Mixed Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n", | |
718 | p1->Pt(), p2->Pt(), pt,m,a); | |
719 | for(Int_t ipid=0; ipid<fNPID; ipid++){ | |
720 | if((p1->IsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){ | |
5ae09196 | 721 | fhMi1 [curCentrBin*fNPID+ipid]->Fill(pt, a,m) ; |
722 | fhMiInvPt1[curCentrBin*fNPID+ipid]->Fill(1./pt,a,m) ; | |
7e7694bb | 723 | if(p1->DistToBad()>0 && p2->DistToBad()>0){ |
5ae09196 | 724 | fhMi2 [curCentrBin*fNPID+ipid]->Fill(pt, a,m) ; |
725 | fhMiInvPt2[curCentrBin*fNPID+ipid]->Fill(1./pt,a,m) ; | |
7e7694bb | 726 | if(p1->DistToBad()>1 && p2->DistToBad()>1){ |
5ae09196 | 727 | fhMi3 [curCentrBin*fNPID+ipid]->Fill(pt, a,m) ; |
728 | fhMiInvPt3[curCentrBin*fNPID+ipid]->Fill(1./pt,a,m) ; | |
7e7694bb | 729 | } |
730 | ||
731 | } | |
732 | } | |
733 | }//loop for histograms | |
734 | }// second cluster loop | |
735 | }//first cluster loop | |
736 | }//loop on mixed events | |
737 | ||
738 | TClonesArray *currentEvent = new TClonesArray(*GetInputAODBranch()); | |
739 | //Ad d current event to buffer and Remove redundant events | |
740 | if(currentEvent->GetEntriesFast()>0){ | |
741 | evMixList->AddFirst(currentEvent) ; | |
742 | currentEvent=0 ; //Now list of particles belongs to buffer and it will be deleted with buffer | |
743 | if(evMixList->GetSize()>=fNmaxMixEv) | |
744 | { | |
745 | TClonesArray * tmp = (TClonesArray*) (evMixList->Last()) ; | |
746 | evMixList->RemoveLast() ; | |
747 | delete tmp ; | |
748 | } | |
749 | } | |
750 | else{ //empty event | |
751 | delete currentEvent ; | |
752 | currentEvent=0 ; | |
477d6cee | 753 | } |
7e7694bb | 754 | }// DoOwnMix |
c8fe2783 | 755 | |
1c5acb87 | 756 | } |
757 | ||
a5cc4f03 | 758 | //________________________________________________________________________ |
759 | void AliAnaPi0::ReadHistograms(TList* outputList) | |
760 | { | |
50f39b97 | 761 | // Needed when Terminate is executed in distributed environment |
762 | // Refill analysis histograms of this class with corresponding histograms in output list. | |
763 | ||
764 | // Histograms of this analsys are kept in the same list as other analysis, recover the position of | |
765 | // the first one and then add the next. | |
766 | Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hRe_cen0_pid0_dist1")); | |
767 | ||
768 | if(!fhRe1) fhRe1 = new TH3D*[fNCentrBin*fNPID] ; | |
769 | if(!fhRe2) fhRe2 = new TH3D*[fNCentrBin*fNPID] ; | |
770 | if(!fhRe3) fhRe3 = new TH3D*[fNCentrBin*fNPID] ; | |
771 | if(!fhMi1) fhMi1 = new TH3D*[fNCentrBin*fNPID] ; | |
772 | if(!fhMi2) fhMi2 = new TH3D*[fNCentrBin*fNPID] ; | |
773 | if(!fhMi3) fhMi3 = new TH3D*[fNCentrBin*fNPID] ; | |
f8006433 | 774 | if(!fhReInvPt1) fhReInvPt1 = new TH3D*[fNCentrBin*fNPID] ; |
775 | if(!fhReInvPt2) fhReInvPt2 = new TH3D*[fNCentrBin*fNPID] ; | |
776 | if(!fhReInvPt3) fhReInvPt3 = new TH3D*[fNCentrBin*fNPID] ; | |
777 | if(!fhMiInvPt1) fhMiInvPt1 = new TH3D*[fNCentrBin*fNPID] ; | |
778 | if(!fhMiInvPt2) fhMiInvPt2 = new TH3D*[fNCentrBin*fNPID] ; | |
779 | if(!fhMiInvPt3) fhMiInvPt3 = new TH3D*[fNCentrBin*fNPID] ; | |
eee5fcf1 | 780 | if(!fhReMod) fhReMod = new TH3D*[fNModules] ; |
781 | ||
50f39b97 | 782 | for(Int_t ic=0; ic<fNCentrBin; ic++){ |
783 | for(Int_t ipid=0; ipid<fNPID; ipid++){ | |
784 | fhRe1[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
50f39b97 | 785 | fhRe2[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); |
50f39b97 | 786 | fhRe3[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); |
5ae09196 | 787 | |
788 | fhReInvPt1[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
789 | fhReInvPt2[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
790 | fhReInvPt3[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
791 | ||
792 | fhMi1[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
793 | fhMi2[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
50f39b97 | 794 | fhMi3[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); |
5ae09196 | 795 | |
796 | fhMiInvPt1[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
797 | fhMiInvPt2[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
798 | fhMiInvPt3[ic*fNPID+ipid] = (TH3D*) outputList->At(index++); | |
50f39b97 | 799 | } |
800 | } | |
eee5fcf1 | 801 | |
5ae09196 | 802 | if(fMultiCutAna){ |
803 | ||
eee5fcf1 | 804 | if(!fhRePtNCellAsymCuts) fhRePtNCellAsymCuts = new TH2D*[fNPtCuts*fNAsymCuts*fNCellNCuts]; |
805 | if(!fhRePIDBits) fhRePIDBits = new TH2D*[fNPIDBits]; | |
806 | ||
5ae09196 | 807 | for(Int_t ipid=0; ipid<fNPIDBits; ipid++){ |
808 | fhRePIDBits[ipid] = (TH2D*) outputList->At(index++); | |
809 | }// ipid loop | |
810 | ||
811 | for(Int_t ipt=0; ipt<fNPtCuts; ipt++){ | |
812 | for(Int_t icell=0; icell<fNCellNCuts; icell++){ | |
813 | for(Int_t iasym=0; iasym<fNAsymCuts; iasym++){ | |
814 | fhRePtNCellAsymCuts[((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym] = (TH2D*) outputList->At(index++); | |
815 | }// iasym | |
816 | }// icell loop | |
817 | }// ipt loop | |
818 | }// multi cut analysis | |
50f39b97 | 819 | |
820 | fhEvents = (TH3D *) outputList->At(index++); | |
821 | ||
822 | //Histograms filled only if MC data is requested | |
823 | if(IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC) ){ | |
824 | fhPrimPt = (TH1D*) outputList->At(index++); | |
825 | fhPrimAccPt = (TH1D*) outputList->At(index++); | |
826 | fhPrimY = (TH1D*) outputList->At(index++); | |
827 | fhPrimAccY = (TH1D*) outputList->At(index++); | |
828 | fhPrimPhi = (TH1D*) outputList->At(index++); | |
829 | fhPrimAccPhi = (TH1D*) outputList->At(index++); | |
830 | } | |
831 | ||
832 | for(Int_t imod=0; imod < fNModules; imod++) | |
833 | fhReMod[imod] = (TH3D*) outputList->At(index++); | |
834 | ||
eee5fcf1 | 835 | |
a5cc4f03 | 836 | } |
837 | ||
838 | ||
6639984f | 839 | //____________________________________________________________________________________________________________________________________________________ |
a5cc4f03 | 840 | void AliAnaPi0::Terminate(TList* outputList) |
6639984f | 841 | { |
842 | //Do some calculations and plots from the final histograms. | |
477d6cee | 843 | |
fbeaf916 | 844 | printf(" *** %s Terminate:\n", GetName()) ; |
50f39b97 | 845 | |
a5cc4f03 | 846 | //Recover histograms from output histograms list, needed for distributed analysis. |
847 | ReadHistograms(outputList); | |
50f39b97 | 848 | |
2e557d1c | 849 | if (!fhRe1) { |
50f39b97 | 850 | printf("AliAnaPi0::Terminate() - Error: Remote output histograms not imported in AliAnaPi0 object"); |
851 | return; | |
2e557d1c | 852 | } |
50f39b97 | 853 | |
a3aebfff | 854 | printf("AliAnaPi0::Terminate() Mgg Real : %5.3f , RMS : %5.3f \n", fhRe1[0]->GetMean(), fhRe1[0]->GetRMS() ) ; |
5ae09196 | 855 | |
856 | const Int_t buffersize = 255; | |
857 | ||
858 | char nameIM[buffersize]; | |
859 | snprintf(nameIM, buffersize,"AliAnaPi0_%s_cPt",fCalorimeter.Data()); | |
71dd883b | 860 | TCanvas * cIM = new TCanvas(nameIM, "", 400, 10, 600, 700) ; |
6639984f | 861 | cIM->Divide(2, 2); |
50f39b97 | 862 | |
6639984f | 863 | cIM->cd(1) ; |
864 | //gPad->SetLogy(); | |
583c48f1 | 865 | TH1D * hIMAllPt = (TH1D*) fhRe1[0]->ProjectionZ(Form("IMPtAll_%s",fCalorimeter.Data())); |
6639984f | 866 | hIMAllPt->SetLineColor(2); |
867 | hIMAllPt->SetTitle("No cut on p_{T, #gamma#gamma} "); | |
868 | hIMAllPt->Draw(); | |
869 | ||
870 | cIM->cd(2) ; | |
583c48f1 | 871 | TH3F * hRe1Pt5 = (TH3F*)fhRe1[0]->Clone(Form("IMPt5_%s",fCalorimeter.Data())); |
6639984f | 872 | hRe1Pt5->GetXaxis()->SetRangeUser(0,5); |
583c48f1 | 873 | TH1D * hIMPt5 = (TH1D*) hRe1Pt5->Project3D(Form("IMPt5_%s_pz",fCalorimeter.Data())); |
6639984f | 874 | hIMPt5->SetLineColor(2); |
875 | hIMPt5->SetTitle("0 < p_{T, #gamma#gamma} < 5 GeV/c"); | |
876 | hIMPt5->Draw(); | |
877 | ||
878 | cIM->cd(3) ; | |
583c48f1 | 879 | TH3F * hRe1Pt10 = (TH3F*)fhRe1[0]->Clone(Form("IMPt10_%s",fCalorimeter.Data())); |
6639984f | 880 | hRe1Pt10->GetXaxis()->SetRangeUser(5,10); |
583c48f1 | 881 | TH1D * hIMPt10 = (TH1D*) hRe1Pt10->Project3D(Form("IMPt10_%s_pz",fCalorimeter.Data())); |
6639984f | 882 | hIMPt10->SetLineColor(2); |
883 | hIMPt10->SetTitle("5 < p_{T, #gamma#gamma} < 10 GeV/c"); | |
884 | hIMPt10->Draw(); | |
885 | ||
886 | cIM->cd(4) ; | |
583c48f1 | 887 | TH3F * hRe1Pt20 = (TH3F*)fhRe1[0]->Clone(Form("IMPt20_%s",fCalorimeter.Data())); |
6639984f | 888 | hRe1Pt20->GetXaxis()->SetRangeUser(10,20); |
583c48f1 | 889 | TH1D * hIMPt20 = (TH1D*) hRe1Pt20->Project3D(Form("IMPt20_%s_pz",fCalorimeter.Data())); |
6639984f | 890 | hIMPt20->SetLineColor(2); |
891 | hIMPt20->SetTitle("10 < p_{T, #gamma#gamma} < 20 GeV/c"); | |
892 | hIMPt20->Draw(); | |
893 | ||
5ae09196 | 894 | char nameIMF[buffersize]; |
895 | snprintf(nameIMF,buffersize,"AliAnaPi0_%s_Mgg.eps",fCalorimeter.Data()); | |
71dd883b | 896 | cIM->Print(nameIMF); |
6639984f | 897 | |
5ae09196 | 898 | char namePt[buffersize]; |
899 | snprintf(namePt,buffersize,"AliAnaPi0_%s_cPt",fCalorimeter.Data()); | |
71dd883b | 900 | TCanvas * cPt = new TCanvas(namePt, "", 400, 10, 600, 700) ; |
6639984f | 901 | cPt->Divide(2, 2); |
902 | ||
903 | cPt->cd(1) ; | |
904 | //gPad->SetLogy(); | |
905 | TH1D * hPt = (TH1D*) fhRe1[0]->Project3D("x"); | |
906 | hPt->SetLineColor(2); | |
907 | hPt->SetTitle("No cut on M_{#gamma#gamma} "); | |
908 | hPt->Draw(); | |
909 | ||
910 | cPt->cd(2) ; | |
583c48f1 | 911 | TH3F * hRe1IM1 = (TH3F*)fhRe1[0]->Clone(Form("Pt1_%s",fCalorimeter.Data())); |
6639984f | 912 | hRe1IM1->GetZaxis()->SetRangeUser(0.05,0.21); |
913 | TH1D * hPtIM1 = (TH1D*) hRe1IM1->Project3D("x"); | |
914 | hPtIM1->SetLineColor(2); | |
915 | hPtIM1->SetTitle("0.05 < M_{#gamma#gamma} < 0.21 GeV/c^{2}"); | |
916 | hPtIM1->Draw(); | |
917 | ||
918 | cPt->cd(3) ; | |
583c48f1 | 919 | TH3F * hRe1IM2 = (TH3F*)fhRe1[0]->Clone(Form("Pt2_%s",fCalorimeter.Data())); |
6639984f | 920 | hRe1IM2->GetZaxis()->SetRangeUser(0.09,0.17); |
921 | TH1D * hPtIM2 = (TH1D*) hRe1IM2->Project3D("x"); | |
922 | hPtIM2->SetLineColor(2); | |
923 | hPtIM2->SetTitle("0.09 < M_{#gamma#gamma} < 0.17 GeV/c^{2}"); | |
924 | hPtIM2->Draw(); | |
925 | ||
926 | cPt->cd(4) ; | |
583c48f1 | 927 | TH3F * hRe1IM3 = (TH3F*)fhRe1[0]->Clone(Form("Pt3_%s",fCalorimeter.Data())); |
6639984f | 928 | hRe1IM3->GetZaxis()->SetRangeUser(0.11,0.15); |
929 | TH1D * hPtIM3 = (TH1D*) hRe1IM1->Project3D("x"); | |
930 | hPtIM3->SetLineColor(2); | |
931 | hPtIM3->SetTitle("0.11 < M_{#gamma#gamma} < 0.15 GeV/c^{2}"); | |
932 | hPtIM3->Draw(); | |
933 | ||
164a1d84 | 934 | char namePtF[buffersize]; |
5ae09196 | 935 | snprintf(namePtF,buffersize,"AliAnaPi0_%s_Pt.eps",fCalorimeter.Data()); |
71dd883b | 936 | cPt->Print(namePtF); |
1c5acb87 | 937 | |
5ae09196 | 938 | char line[buffersize] ; |
939 | snprintf(line,buffersize,".!tar -zcf %s_%s.tar.gz *.eps", GetName(),fCalorimeter.Data()) ; | |
6639984f | 940 | gROOT->ProcessLine(line); |
5ae09196 | 941 | snprintf(line, buffersize,".!rm -fR AliAnaPi0_%s*.eps",fCalorimeter.Data()); |
6639984f | 942 | gROOT->ProcessLine(line); |
943 | ||
71dd883b | 944 | printf(" AliAnaPi0::Terminate() - !! All the eps files are in %s_%s.tar.gz !!!\n", GetName(), fCalorimeter.Data()); |
1c5acb87 | 945 | |
6639984f | 946 | } |
c8fe2783 | 947 | //____________________________________________________________________________________________________________________________________________________ |
948 | Int_t AliAnaPi0::GetEventIndex(AliAODPWG4Particle * part, Double_t * vert) | |
949 | { | |
f8006433 | 950 | // retieves the event index and checks the vertex |
951 | // in the mixed buffer returns -2 if vertex NOK | |
952 | // for normal events returns 0 if vertex OK and -1 if vertex NOK | |
953 | ||
954 | Int_t evtIndex = -1 ; | |
955 | if(GetReader()->GetDataType()!=AliCaloTrackReader::kMC){ | |
956 | ||
957 | if (GetMixedEvent()){ | |
958 | ||
959 | evtIndex = GetMixedEvent()->EventIndexForCaloCluster(part->GetCaloLabel(0)) ; | |
960 | GetVertex(vert,evtIndex); | |
961 | ||
5025c139 | 962 | if(TMath::Abs(vert[2])> GetZvertexCut()) |
f8006433 | 963 | evtIndex = -2 ; //Event can not be used (vertex, centrality,... cuts not fulfilled) |
964 | } else {// Single event | |
965 | ||
966 | GetVertex(vert); | |
967 | ||
5025c139 | 968 | if(TMath::Abs(vert[2])> GetZvertexCut()) |
f8006433 | 969 | evtIndex = -1 ; //Event can not be used (vertex, centrality,... cuts not fulfilled) |
970 | else | |
971 | evtIndex = 0 ; | |
c8fe2783 | 972 | } |
0ae57829 | 973 | }//No MC reader |
f8006433 | 974 | else { |
975 | evtIndex = 0; | |
976 | vert[0] = 0. ; | |
977 | vert[1] = 0. ; | |
978 | vert[2] = 0. ; | |
979 | } | |
0ae57829 | 980 | |
f8006433 | 981 | return evtIndex ; |
c8fe2783 | 982 | } |
f8006433 | 983 |