]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrDep/AliAnaPi0.cxx
Changes for report #69974: Virtual class for calorimeter analysis objects
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnaPi0.cxx
CommitLineData
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"
44#include "AliAODCaloCluster.h"
45#include "AliVEvent.h"
6921fa00 46#include "AliESDCaloCluster.h"
47#include "AliESDEvent.h"
48#include "AliAODEvent.h"
50f39b97 49#include "AliNeutralMesonSelection.h"
c8fe2783 50#include "AliMixedEvent.h"
51
591cc579 52
1c5acb87 53ClassImp(AliAnaPi0)
54
55//________________________________________________________________________________________________________________________________________________
56AliAnaPi0::AliAnaPi0() : AliAnaPartCorrBaseClass(),
57fNCentrBin(0),fNZvertBin(0),fNrpBin(0),
58fNPID(0),fNmaxMixEv(0), fZvtxCut(0.),fCalorimeter(""),
50f39b97 59fNModules(12), fUseAngleCut(kFALSE), fEventsList(0x0), //fhEtalon(0x0),
5a2dbc3c 60fhReMod(0x0), fhRe1(0x0),fhMi1(0x0),fhRe2(0x0),fhMi2(0x0),fhRe3(0x0),fhMi3(0x0),fhEvents(0x0),
50f39b97 61fhRealOpeningAngle(0x0),fhRealCosOpeningAngle(0x0),
62fhPrimPt(0x0), fhPrimAccPt(0x0), fhPrimY(0x0), fhPrimAccY(0x0), fhPrimPhi(0x0), fhPrimAccPhi(0x0),
63fhPrimOpeningAngle(0x0),fhPrimCosOpeningAngle(0x0)
1c5acb87 64{
65//Default Ctor
66 InitParameters();
67
68}
78219bac 69/*
1c5acb87 70//________________________________________________________________________________________________________________________________________________
71AliAnaPi0::AliAnaPi0(const AliAnaPi0 & ex) : AliAnaPartCorrBaseClass(ex),
72fNCentrBin(ex.fNCentrBin),fNZvertBin(ex.fNZvertBin),fNrpBin(ex.fNrpBin),
c0649ccf 73fNPID(ex.fNPID),fNmaxMixEv(ex.fNmaxMixEv),fZvtxCut(ex.fZvtxCut), fCalorimeter(ex.fCalorimeter),
614701c6 74fNModules(ex.fNModules), fUseAngleCut(ex.fUseAngleCut), fEventsList(0x0), //fhEtalon(ex.fhEtalon),
5a2dbc3c 75fhReMod(ex.fhReMod), fhRe1(ex.fhRe1),fhMi1(ex.fhMi1),fhRe2(ex.fhRe2),fhMi2(ex.fhMi2),
76fhRe3(ex.fhRe3),fhMi3(ex.fhMi3),fhEvents(ex.fhEvents),
50f39b97 77fhRealOpeningAngle(ex.fhRealOpeningAngle),fhRealCosOpeningAngle(ex.fhRealCosOpeningAngle),
1c5acb87 78fhPrimPt(ex.fhPrimPt), fhPrimAccPt(ex.fhPrimAccPt), fhPrimY(ex.fhPrimY),
50f39b97 79fhPrimAccY(ex.fhPrimAccY), fhPrimPhi(ex.fhPrimPhi), fhPrimAccPhi(ex.fhPrimAccPhi),
80fhPrimOpeningAngle(ex.fhPrimOpeningAngle),fhPrimCosOpeningAngle(ex.fhPrimCosOpeningAngle)
1c5acb87 81{
477d6cee 82 // cpy ctor
83 //Do not need it
1c5acb87 84}
78219bac 85*/
614701c6 86//
87////________________________________________________________________________________________________________________________________________________
88//AliAnaPi0 & AliAnaPi0::operator = (const AliAnaPi0 & ex)
89//{
90// // assignment operator
91//
92// if(this == &ex)return *this;
93// ((AliAnaPartCorrBaseClass *)this)->operator=(ex);
94//
95// fNCentrBin = ex.fNCentrBin ; fNZvertBin = ex.fNZvertBin ; fNrpBin = ex.fNrpBin ;
96// fNPID = ex.fNPID ; fNmaxMixEv = ex.fNmaxMixEv ; fZvtxCut = ex.fZvtxCut ; fCalorimeter = ex.fCalorimeter ;
97// fNModules = ex.fNModules; fEventsList = ex.fEventsList ; //fhEtalon = ex.fhEtalon ;
98// fhRe1 = ex.fhRe1 ; fhMi1 = ex.fhMi1 ; fhRe2 = ex.fhRe2 ; fhMi2 = ex.fhMi2 ; fhReMod = ex.fhReMod;
99// fhRe3 = ex.fhRe3 ; fhMi3 = ex.fhMi3 ; fhEvents = ex.fhEvents ; fUseAngleCut = ex.fUseAngleCut;
100// fhPrimPt = ex.fhPrimPt ; fhPrimAccPt = ex.fhPrimAccPt ; fhPrimY = ex.fhPrimY ;
101// fhPrimAccY = ex.fhPrimAccY ; fhPrimPhi = ex.fhPrimPhi ; fhPrimAccPhi = ex.fhPrimAccPhi ;
102// fhRealOpeningAngle = ex.fhRealOpeningAngle; fhRealCosOpeningAngle = ex.fhRealCosOpeningAngle;
103// fhPrimOpeningAngle = ex.fhPrimOpeningAngle; fhPrimCosOpeningAngle = ex.fhPrimCosOpeningAngle;
104//
105// return *this;
106//
107//}
1c5acb87 108
109//________________________________________________________________________________________________________________________________________________
110AliAnaPi0::~AliAnaPi0() {
477d6cee 111 // Remove event containers
112 if(fEventsList){
113 for(Int_t ic=0; ic<fNCentrBin; ic++){
114 for(Int_t iz=0; iz<fNZvertBin; iz++){
115 for(Int_t irp=0; irp<fNrpBin; irp++){
116 fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp]->Delete() ;
117 delete fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp] ;
1c5acb87 118 }
477d6cee 119 }
120 }
121 delete[] fEventsList;
122 fEventsList=0 ;
123 }
591cc579 124
1c5acb87 125}
126
127//________________________________________________________________________________________________________________________________________________
128void AliAnaPi0::InitParameters()
129{
130//Init parameters when first called the analysis
131//Set default parameters
a3aebfff 132 SetInputAODName("PWG4Particle");
133
134 AddToHistogramsName("AnaPi0_");
6921fa00 135 fNModules = 12; // set maximum to maximum number of EMCAL modules
477d6cee 136 fNCentrBin = 1;
137 fNZvertBin = 1;
138 fNrpBin = 1;
139 fNPID = 9;
140 fNmaxMixEv = 10;
141 fZvtxCut = 40;
142 fCalorimeter = "PHOS";
50f39b97 143 fUseAngleCut = kFALSE;
144
1c5acb87 145}
146//________________________________________________________________________________________________________________________________________________
5a2dbc3c 147//void AliAnaPi0::Init()
148//{
477d6cee 149 //Init some data members needed in analysis
150
151 //Histograms binning and range
5a2dbc3c 152 // if(!fhEtalon){ // p_T alpha d m_gg
153 // fhEtalon = new TH3D("hEtalon","Histo with binning parameters",50,0.,25.,10,0.,1.,200,0.,1.) ;
154 // fhEtalon->SetXTitle("P_{T} (GeV)") ;
155 // fhEtalon->SetYTitle("#alpha") ;
156 // fhEtalon->SetZTitle("m_{#gamma#gamma} (GeV)") ;
157 // }
477d6cee 158
5a2dbc3c 159//}
1c5acb87 160
0c1383b5 161
162//________________________________________________________________________________________________________________________________________________
163TObjString * AliAnaPi0::GetAnalysisCuts()
164{
165 //Save parameters used for analysis
166 TString parList ; //this will be list of parameters used for this analysis.
167 char onePar[255] ;
168 sprintf(onePar,"--- AliAnaPi0 ---\n") ;
169 parList+=onePar ;
170 sprintf(onePar,"Number of bins in Centrality: %d \n",fNCentrBin) ;
171 parList+=onePar ;
172 sprintf(onePar,"Number of bins in Z vert. pos: %d \n",fNZvertBin) ;
173 parList+=onePar ;
174 sprintf(onePar,"Number of bins in Reac. Plain: %d \n",fNrpBin) ;
175 parList+=onePar ;
176 sprintf(onePar,"Depth of event buffer: %d \n",fNmaxMixEv) ;
177 parList+=onePar ;
178 sprintf(onePar,"Number of different PID used: %d \n",fNPID) ;
179 parList+=onePar ;
180 sprintf(onePar,"Cuts: \n") ;
181 parList+=onePar ;
182 sprintf(onePar,"Z vertex position: -%f < z < %f \n",fZvtxCut,fZvtxCut) ;
183 parList+=onePar ;
184 sprintf(onePar,"Calorimeter: %s \n",fCalorimeter.Data()) ;
185 parList+=onePar ;
186 sprintf(onePar,"Number of modules: %d \n",fNModules) ;
187 parList+=onePar ;
188
189 return new TObjString(parList) ;
190}
191
2e557d1c 192//________________________________________________________________________________________________________________________________________________
193TList * AliAnaPi0::GetCreateOutputObjects()
194{
477d6cee 195 // Create histograms to be saved in output file and
196 // store them in fOutputContainer
197
198 //create event containers
199 fEventsList = new TList*[fNCentrBin*fNZvertBin*fNrpBin] ;
1c5acb87 200
477d6cee 201 for(Int_t ic=0; ic<fNCentrBin; ic++){
202 for(Int_t iz=0; iz<fNZvertBin; iz++){
203 for(Int_t irp=0; irp<fNrpBin; irp++){
204 fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp] = new TList() ;
205 }
206 }
207 }
765d44e7 208
477d6cee 209 TList * outputContainer = new TList() ;
210 outputContainer->SetName(GetName());
6921fa00 211
212 fhReMod = new TH3D*[fNModules] ;
50305ae9 213 fhRe1 = new TH3D*[fNCentrBin*fNPID] ;
214 fhRe2 = new TH3D*[fNCentrBin*fNPID] ;
215 fhRe3 = new TH3D*[fNCentrBin*fNPID] ;
216 fhMi1 = new TH3D*[fNCentrBin*fNPID] ;
217 fhMi2 = new TH3D*[fNCentrBin*fNPID] ;
218 fhMi3 = new TH3D*[fNCentrBin*fNPID] ;
477d6cee 219
220 char key[255] ;
221 char title[255] ;
5a2dbc3c 222 Int_t nptbins = GetHistoPtBins();
223 Int_t nphibins = GetHistoPhiBins();
224 Int_t netabins = GetHistoEtaBins();
225 Float_t ptmax = GetHistoPtMax();
226 Float_t phimax = GetHistoPhiMax();
227 Float_t etamax = GetHistoEtaMax();
228 Float_t ptmin = GetHistoPtMin();
229 Float_t phimin = GetHistoPhiMin();
230 Float_t etamin = GetHistoEtaMin();
231
232 Int_t nmassbins = GetHistoMassBins();
233 Int_t nasymbins = GetHistoAsymmetryBins();
234 Float_t massmax = GetHistoMassMax();
235 Float_t asymmax = GetHistoAsymmetryMax();
236 Float_t massmin = GetHistoMassMin();
237 Float_t asymmin = GetHistoAsymmetryMin();
238
477d6cee 239 for(Int_t ic=0; ic<fNCentrBin; ic++){
240 for(Int_t ipid=0; ipid<fNPID; ipid++){
6921fa00 241
477d6cee 242 //Distance to bad module 1
243 sprintf(key,"hRe_cen%d_pid%d_dist1",ic,ipid) ;
244 sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
245
5a2dbc3c 246 //fhEtalon->Clone(key);
247 //fhRe1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
248 //fhRe1[ic*fNPID+ipid]->SetName(key) ;
249 //fhRe1[ic*fNPID+ipid]->SetTitle(title) ;
250 fhRe1[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ;
477d6cee 251 outputContainer->Add(fhRe1[ic*fNPID+ipid]) ;
252
253 sprintf(key,"hMi_cen%d_pid%d_dist1",ic,ipid) ;
254 sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
5a2dbc3c 255 //fhMi1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
256 //fhMi1[ic*fNPID+ipid]->SetName(key) ;
257 //fhMi1[ic*fNPID+ipid]->SetTitle(title) ;
258 fhMi1[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ;
477d6cee 259 outputContainer->Add(fhMi1[ic*fNPID+ipid]) ;
260
261 //Distance to bad module 2
262 sprintf(key,"hRe_cen%d_pid%d_dist2",ic,ipid) ;
263 sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
5a2dbc3c 264 //fhRe2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
265 //fhRe2[ic*fNPID+ipid]->SetName(key) ;
266 //fhRe2[ic*fNPID+ipid]->SetTitle(title) ;
267 fhRe2[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ;
477d6cee 268 outputContainer->Add(fhRe2[ic*fNPID+ipid]) ;
269
270 sprintf(key,"hMi_cen%d_pid%d_dist2",ic,ipid) ;
271 sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
5a2dbc3c 272 //fhMi2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
273 //fhMi2[ic*fNPID+ipid]->SetName(key) ;
274 //fhMi2[ic*fNPID+ipid]->SetTitle(title) ;
275 fhMi2[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ;
477d6cee 276 outputContainer->Add(fhMi2[ic*fNPID+ipid]) ;
277
278 //Distance to bad module 3
279 sprintf(key,"hRe_cen%d_pid%d_dist3",ic,ipid) ;
280 sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
5a2dbc3c 281 //fhRe3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
282 //fhRe3[ic*fNPID+ipid]->SetName(key) ;
283 //fhRe3[ic*fNPID+ipid]->SetTitle(title) ;
284 fhRe3[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ;
477d6cee 285 outputContainer->Add(fhRe3[ic*fNPID+ipid]) ;
286
287 sprintf(key,"hMi_cen%d_pid%d_dist3",ic,ipid) ;
288 sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
5a2dbc3c 289 //fhMi3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
290 //fhMi3[ic*fNPID+ipid]->SetName(key) ;
291 //fhMi3[ic*fNPID+ipid]->SetTitle(title) ;
292 fhMi3[ic*fNPID+ipid] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ;
477d6cee 293 outputContainer->Add(fhMi3[ic*fNPID+ipid]) ;
1c5acb87 294 }
477d6cee 295 }
296
297
298 fhEvents=new TH3D("hEvents","Number of events",fNCentrBin,0.,1.*fNCentrBin,
299 fNZvertBin,0.,1.*fNZvertBin,fNrpBin,0.,1.*fNrpBin) ;
300 outputContainer->Add(fhEvents) ;
301
50f39b97 302
303 fhRealOpeningAngle = new TH2D
304 ("hRealOpeningAngle","Angle between all #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,200,0,0.5);
305 fhRealOpeningAngle->SetYTitle("#theta(rad)");
306 fhRealOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
307 outputContainer->Add(fhRealOpeningAngle) ;
308
309 fhRealCosOpeningAngle = new TH2D
310 ("hRealCosOpeningAngle","Cosinus of angle between all #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,200,-1,1);
311 fhRealCosOpeningAngle->SetYTitle("cos (#theta) ");
312 fhRealCosOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
313 outputContainer->Add(fhRealCosOpeningAngle) ;
314
315
477d6cee 316 //Histograms filled only if MC data is requested
317 if(IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC) ){
5a2dbc3c 318 // if(fhEtalon->GetXaxis()->GetXbins() && fhEtalon->GetXaxis()->GetXbins()->GetSize()){ //Variable bin size
319 // fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXbins()->GetArray()) ;
320 // fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",fhEtalon->GetXaxis()->GetNbins(),
321 // fhEtalon->GetXaxis()->GetXbins()->GetArray()) ;
322 // }
323 // else{
324 // fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXmin(),fhEtalon->GetXaxis()->GetXmax()) ;
325 // fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",
326 // fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXmin(),fhEtalon->GetXaxis()->GetXmax()) ;
327 // }
328
329 fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",nptbins,ptmin,ptmax) ;
330 fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",nptbins,ptmin,ptmax) ;
477d6cee 331 outputContainer->Add(fhPrimPt) ;
332 outputContainer->Add(fhPrimAccPt) ;
333
5a2dbc3c 334 fhPrimY = new TH1D("hPrimaryRapidity","Rapidity of primary pi0",netabins,etamin,etamax) ;
477d6cee 335 outputContainer->Add(fhPrimY) ;
336
5a2dbc3c 337 fhPrimAccY = new TH1D("hPrimAccRapidity","Rapidity of primary pi0",netabins,etamin,etamax) ;
477d6cee 338 outputContainer->Add(fhPrimAccY) ;
339
5a2dbc3c 340 fhPrimPhi = new TH1D("hPrimaryPhi","Azimithal of primary pi0",nphibins,phimin*TMath::RadToDeg(),phimax*TMath::RadToDeg()) ;
477d6cee 341 outputContainer->Add(fhPrimPhi) ;
342
5a2dbc3c 343 fhPrimAccPhi = new TH1D("hPrimAccPhi","Azimithal of primary pi0 with accepted daughters",nphibins,phimin*TMath::RadToDeg(),phimax*TMath::RadToDeg()) ;
477d6cee 344 outputContainer->Add(fhPrimAccPhi) ;
50f39b97 345
346
347 fhPrimOpeningAngle = new TH2D
4df35693 348 ("hPrimOpeningAngle","Angle between all primary #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,100,0,0.5);
50f39b97 349 fhPrimOpeningAngle->SetYTitle("#theta(rad)");
350 fhPrimOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
351 outputContainer->Add(fhPrimOpeningAngle) ;
352
353 fhPrimCosOpeningAngle = new TH2D
4df35693 354 ("hPrimCosOpeningAngle","Cosinus of angle between all primary #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,100,-1,1);
50f39b97 355 fhPrimCosOpeningAngle->SetYTitle("cos (#theta) ");
356 fhPrimCosOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
357 outputContainer->Add(fhPrimCosOpeningAngle) ;
358
477d6cee 359 }
50f39b97 360
6921fa00 361 for(Int_t imod=0; imod<fNModules; imod++){
50f39b97 362 //Module dependent invariant mass
363 sprintf(key,"hReMod_%d",imod) ;
364 sprintf(title,"Real m_{#gamma#gamma} distr. for Module %d",imod) ;
365 //fhEtalon->Clone(key);
366 //fhReMod[imod]=(TH3D*)fhEtalon->Clone(key) ;
367 //fhReMod[imod]->SetName(key) ;
368 //fhReMod[imod]->SetTitle(title) ;
369 fhReMod[imod] = new TH3D(key,title,nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax,nmassbins,massmin,massmax) ;
370 outputContainer->Add(fhReMod[imod]) ;
6921fa00 371 }
50f39b97 372
477d6cee 373 return outputContainer;
1c5acb87 374}
375
376//_________________________________________________________________________________________________________________________________________________
377void AliAnaPi0::Print(const Option_t * /*opt*/) const
378{
477d6cee 379 //Print some relevant parameters set for the analysis
a3aebfff 380 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
477d6cee 381 AliAnaPartCorrBaseClass::Print(" ");
a3aebfff 382
477d6cee 383 printf("Number of bins in Centrality: %d \n",fNCentrBin) ;
384 printf("Number of bins in Z vert. pos: %d \n",fNZvertBin) ;
385 printf("Number of bins in Reac. Plain: %d \n",fNrpBin) ;
386 printf("Depth of event buffer: %d \n",fNmaxMixEv) ;
387 printf("Number of different PID used: %d \n",fNPID) ;
388 printf("Cuts: \n") ;
389 printf("Z vertex position: -%2.3f < z < %2.3f \n",fZvtxCut,fZvtxCut) ;
50f39b97 390 printf("Number of modules: %d \n",fNModules) ;
391 printf("Select pairs with their angle: %d \n",fUseAngleCut) ;
477d6cee 392 printf("------------------------------------------------------\n") ;
1c5acb87 393}
394
c8fe2783 395
1c5acb87 396//____________________________________________________________________________________________________________________________________________________
6639984f 397void AliAnaPi0::MakeAnalysisFillHistograms()
1c5acb87 398{
477d6cee 399 //Process one event and extract photons from AOD branch
400 // filled with AliAnaPhoton and fill histos with invariant mass
401
402 //Apply some cuts on event: vertex position and centrality range
403 Int_t iRun=(GetReader()->GetInputEvent())->GetRunNumber() ;
404 if(IsBadRun(iRun)) return ;
405
477d6cee 406 Int_t nPhot = GetInputAODBranch()->GetEntriesFast() ;
c8fe2783 407 if(GetDebug() > 1)
408 printf("AliAnaPi0::MakeAnalysisFillHistograms() - Photon entries %d\n", nPhot);
409 if(nPhot < 2 )
410 return ;
6921fa00 411 Int_t module1 = -1;
412 Int_t module2 = -1;
477d6cee 413 for(Int_t i1=0; i1<nPhot-1; i1++){
414 AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ;
c8fe2783 415 // get the event index in the mixed buffer where the photon comes from
416 Double_t vert[] = {0.0, 0.0, 0.0} ; //vertex
417 Int_t evtIndex1 = 0 ;
418 Int_t currentEvtIndex = -1 ;
419 Int_t curCentrBin = 0 ;
420 Int_t curRPBin = 0 ;
421 Int_t curZvertBin = 0 ;
422 evtIndex1 = GetEventIndex(p1, vert) ;
423 if ( evtIndex1 == -1 )
424 return ;
425 if ( evtIndex1 == -2 )
426 continue ;
427 if (evtIndex1 != currentEvtIndex) {
428 //Get Reaction Plan position and calculate RP bin
429 //does not exist in ESD yet????
430 curCentrBin = 0 ;
431 curRPBin = 0 ;
432 curZvertBin = (Int_t)(0.5*fNZvertBin*(vert[2]+fZvtxCut)/fZvtxCut) ;
433 fhEvents->Fill(curCentrBin+0.5,curZvertBin+0.5,curRPBin+0.5) ;
434 currentEvtIndex = evtIndex1 ;
435 }
436
477d6cee 437 TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E());
59b6bd99 438 //Get Module number
439 module1 = GetModuleNumber(p1);
477d6cee 440 for(Int_t i2=i1+1; i2<nPhot; i2++){
441 AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i2)) ;
c8fe2783 442 Int_t evtIndex2 = GetEventIndex(p2, vert) ;
443 if ( evtIndex2 == -1 )
444 return ;
445 if ( evtIndex2 == -2 )
446 continue ;
447 if (GetMixedEvent() && (evtIndex1 == evtIndex2))
448 continue ;
477d6cee 449 TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E());
59b6bd99 450 //Get module number
451 module2 = GetModuleNumber(p2);
477d6cee 452 Double_t m = (photon1 + photon2).M() ;
453 Double_t pt = (photon1 + photon2).Pt();
454 Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ;
455 if(GetDebug() > 2)
c8fe2783 456 printf("AliAnaPi0::MakeAnalysisFillHistograms() - Current Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n",
457 p1->Pt(), p2->Pt(), pt,m,a);
50f39b97 458 //Check if opening angle is too large or too small compared to what is expected
459 Double_t angle = photon1.Angle(photon2.Vect());
460 //if(fUseAngleCut && !GetNeutralMesonSelection()->IsAngleInWindow((photon1+photon2).E(),angle)) continue;
461 //printf("angle %f\n",angle);
c8fe2783 462 if(fUseAngleCut && angle < 0.1)
463 continue;
50f39b97 464 fhRealOpeningAngle ->Fill(pt,angle);
465 fhRealCosOpeningAngle->Fill(pt,TMath::Cos(angle));
59b6bd99 466 //Fill module dependent histograms
467 //if(module1==module2) printf("mod1 %d\n",module1);
468 if(module1==module2 && module1 >=0 && module1<fNModules)
c8fe2783 469 fhReMod[module1]->Fill(pt,a,m) ;
470
471 for(Int_t ipid=0; ipid<fNPID; ipid++){
472 if((p1->IsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){
473 fhRe1[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
474 if(p1->DistToBad()>0 && p2->DistToBad()>0){
475 fhRe2[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
476 if(p1->DistToBad()>1 && p2->DistToBad()>1){
477 fhRe3[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
478 }
479 }
480 }
481 }
477d6cee 482 }
483 }
c8fe2783 484//
485// //Fill mixed
486//
487// TList * evMixList=fEventsList[curCentrBin*fNZvertBin*fNrpBin+curZvertBin*fNrpBin+curRPBin] ;
488// Int_t nMixed = evMixList->GetSize() ;
489// for(Int_t ii=0; ii<nMixed; ii++){
490// TClonesArray* ev2= (TClonesArray*) (evMixList->At(ii));
491// Int_t nPhot2=ev2->GetEntriesFast() ;
492// Double_t m = -999;
493// if(GetDebug() > 1) printf("AliAnaPi0::MakeAnalysisFillHistograms() - Mixed event %d photon entries %d\n", ii, nPhot);
494//
495// for(Int_t i1=0; i1<nPhot; i1++){
496// AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ;
497// TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E());
498// for(Int_t i2=0; i2<nPhot2; i2++){
499// AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (ev2->At(i2)) ;
500//
501// TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E());
502// m = (photon1+photon2).M() ;
503// Double_t pt = (photon1 + photon2).Pt();
504// Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ;
505//
506// //Check if opening angle is too large or too small compared to what is expected
507// Double_t angle = photon1.Angle(photon2.Vect());
508// //if(fUseAngleCut && !GetNeutralMesonSelection()->IsAngleInWindow((photon1+photon2).E(),angle)) continue;
509// if(fUseAngleCut && angle < 0.1) continue;
510//
511// if(GetDebug() > 2)
512// printf("AliAnaPi0::MakeAnalysisFillHistograms() - Mixed Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n",
513// p1->Pt(), p2->Pt(), pt,m,a);
514// for(Int_t ipid=0; ipid<fNPID; ipid++){
515// if((p1->IsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){
516// fhMi1[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
517// if(p1->DistToBad()>0 && p2->DistToBad()>0){
518// fhMi2[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
519// if(p1->DistToBad()>1 && p2->DistToBad()>1){
520// fhMi3[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
521// }
522//
523// }
524// }
525// }
526// }
527// }
528// }
529//
530// TClonesArray *currentEvent = new TClonesArray(*GetInputAODBranch());
531// //Add current event to buffer and Remove redundant events
532// if(currentEvent->GetEntriesFast()>0){
533// evMixList->AddFirst(currentEvent) ;
534// currentEvent=0 ; //Now list of particles belongs to buffer and it will be deleted with buffer
535// if(evMixList->GetSize()>=fNmaxMixEv)
536// {
537// TClonesArray * tmp = (TClonesArray*) (evMixList->Last()) ;
538// evMixList->RemoveLast() ;
539// delete tmp ;
540// }
541// }
542// else{ //empty event
543// delete currentEvent ;
544// currentEvent=0 ;
545// }
546
547 //Acceptance
de8a210f 548 if(IsDataMC() && GetReader()->ReadStack()){
50f39b97 549 AliStack * stack = GetMCStack();
550 if(stack && (IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC)) ){
551 for(Int_t i=0 ; i<stack->GetNprimary(); i++){
c8fe2783 552 TParticle * prim = stack->Particle(i) ;
553 if(prim->GetPdgCode() == 111){
554 Double_t pi0Pt = prim->Pt() ;
555 //printf("pi0, pt %2.2f\n",pi0Pt);
556 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
557 Double_t pi0Y = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
558 Double_t phi = TMath::RadToDeg()*prim->Phi() ;
559 if(TMath::Abs(pi0Y) < 0.5){
560 fhPrimPt->Fill(pi0Pt) ;
561 }
562 fhPrimY ->Fill(pi0Y) ;
563 fhPrimPhi->Fill(phi) ;
564
565 //Check if both photons hit Calorimeter
566 Int_t iphot1=prim->GetFirstDaughter() ;
567 Int_t iphot2=prim->GetLastDaughter() ;
568 if(iphot1>-1 && iphot1<stack->GetNtrack() && iphot2>-1 && iphot2<stack->GetNtrack()){
569 TParticle * phot1 = stack->Particle(iphot1) ;
570 TParticle * phot2 = stack->Particle(iphot2) ;
571 if(phot1 && phot2 && phot1->GetPdgCode()==22 && phot2->GetPdgCode()==22){
572 //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",
573 // phot1->Pt(), phot1->Phi()*180./3.1415, phot1->Eta(), phot2->Pt(), phot2->Phi()*180./3.1415, phot2->Eta());
574
575 TLorentzVector lv1, lv2;
576 phot1->Momentum(lv1);
577 phot2->Momentum(lv2);
578
579 Bool_t inacceptance = kFALSE;
580 if(fCalorimeter == "PHOS"){
581 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet()){
582 Int_t mod ;
583 Double_t x,z ;
584 if(GetPHOSGeometry()->ImpactOnEmc(phot1,mod,z,x) && GetPHOSGeometry()->ImpactOnEmc(phot2,mod,z,x))
585 inacceptance = kTRUE;
586 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
587 }
588 else{
589
590 if(GetFiducialCut()->IsInFiducialCut(lv1,fCalorimeter) && GetFiducialCut()->IsInFiducialCut(lv2,fCalorimeter))
591 inacceptance = kTRUE ;
592 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
593 }
594
595 }
596 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
597 if(GetEMCALGeometry()){
598 if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
599 inacceptance = kTRUE;
600 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
601 }
602 else{
603 if(GetFiducialCut()->IsInFiducialCut(lv1,fCalorimeter) && GetFiducialCut()->IsInFiducialCut(lv2,fCalorimeter))
604 inacceptance = kTRUE ;
605 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
606 }
607 }
608
609 if(inacceptance){
610
611 fhPrimAccPt->Fill(pi0Pt) ;
612 fhPrimAccPhi->Fill(phi) ;
613 fhPrimAccY->Fill(pi0Y) ;
614 Double_t angle = lv1.Angle(lv2.Vect());
615 fhPrimOpeningAngle ->Fill(pi0Pt,angle);
616 fhPrimCosOpeningAngle->Fill(pi0Pt,TMath::Cos(angle));
617
618 }//Accepted
619 }// 2 photons
620 }//Check daughters exist
621 }// Primary pi0
50f39b97 622 }//loop on primaries
623 }//stack exists and data is MC
591cc579 624 }//read stack
625 else if(GetReader()->ReadAODMCParticles()){
50f39b97 626 if(GetDebug() >= 0) printf("AliAnaPi0::MakeAnalysisFillHistograms() - Acceptance calculation with MCParticles not implemented yet\n");
591cc579 627 }
1c5acb87 628}
629
a5cc4f03 630//________________________________________________________________________
631void AliAnaPi0::ReadHistograms(TList* outputList)
632{
50f39b97 633 // Needed when Terminate is executed in distributed environment
634 // Refill analysis histograms of this class with corresponding histograms in output list.
635
636 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
637 // the first one and then add the next.
638 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hRe_cen0_pid0_dist1"));
639
640 if(!fhRe1) fhRe1 = new TH3D*[fNCentrBin*fNPID] ;
641 if(!fhRe2) fhRe2 = new TH3D*[fNCentrBin*fNPID] ;
642 if(!fhRe3) fhRe3 = new TH3D*[fNCentrBin*fNPID] ;
643 if(!fhMi1) fhMi1 = new TH3D*[fNCentrBin*fNPID] ;
644 if(!fhMi2) fhMi2 = new TH3D*[fNCentrBin*fNPID] ;
645 if(!fhMi3) fhMi3 = new TH3D*[fNCentrBin*fNPID] ;
646 if(!fhReMod) fhReMod = new TH3D*[fNModules] ;
647
648 for(Int_t ic=0; ic<fNCentrBin; ic++){
649 for(Int_t ipid=0; ipid<fNPID; ipid++){
650 fhRe1[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
651 fhMi1[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
652 fhRe2[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
653 fhMi2[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
654 fhRe3[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
655 fhMi3[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
656 }
657 }
658
659 fhEvents = (TH3D *) outputList->At(index++);
660
661 //Histograms filled only if MC data is requested
662 if(IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC) ){
663 fhPrimPt = (TH1D*) outputList->At(index++);
664 fhPrimAccPt = (TH1D*) outputList->At(index++);
665 fhPrimY = (TH1D*) outputList->At(index++);
666 fhPrimAccY = (TH1D*) outputList->At(index++);
667 fhPrimPhi = (TH1D*) outputList->At(index++);
668 fhPrimAccPhi = (TH1D*) outputList->At(index++);
669 }
670
671 for(Int_t imod=0; imod < fNModules; imod++)
672 fhReMod[imod] = (TH3D*) outputList->At(index++);
673
a5cc4f03 674}
675
676
6639984f 677//____________________________________________________________________________________________________________________________________________________
a5cc4f03 678void AliAnaPi0::Terminate(TList* outputList)
6639984f 679{
680 //Do some calculations and plots from the final histograms.
477d6cee 681
fbeaf916 682 printf(" *** %s Terminate:\n", GetName()) ;
50f39b97 683
a5cc4f03 684 //Recover histograms from output histograms list, needed for distributed analysis.
685 ReadHistograms(outputList);
50f39b97 686
2e557d1c 687 if (!fhRe1) {
50f39b97 688 printf("AliAnaPi0::Terminate() - Error: Remote output histograms not imported in AliAnaPi0 object");
689 return;
2e557d1c 690 }
50f39b97 691
a3aebfff 692 printf("AliAnaPi0::Terminate() Mgg Real : %5.3f , RMS : %5.3f \n", fhRe1[0]->GetMean(), fhRe1[0]->GetRMS() ) ;
50f39b97 693
71dd883b 694 char nameIM[128];
695 sprintf(nameIM,"AliAnaPi0_%s_cPt",fCalorimeter.Data());
696 TCanvas * cIM = new TCanvas(nameIM, "", 400, 10, 600, 700) ;
6639984f 697 cIM->Divide(2, 2);
50f39b97 698
6639984f 699 cIM->cd(1) ;
700 //gPad->SetLogy();
583c48f1 701 TH1D * hIMAllPt = (TH1D*) fhRe1[0]->ProjectionZ(Form("IMPtAll_%s",fCalorimeter.Data()));
6639984f 702 hIMAllPt->SetLineColor(2);
703 hIMAllPt->SetTitle("No cut on p_{T, #gamma#gamma} ");
704 hIMAllPt->Draw();
705
706 cIM->cd(2) ;
583c48f1 707 TH3F * hRe1Pt5 = (TH3F*)fhRe1[0]->Clone(Form("IMPt5_%s",fCalorimeter.Data()));
6639984f 708 hRe1Pt5->GetXaxis()->SetRangeUser(0,5);
583c48f1 709 TH1D * hIMPt5 = (TH1D*) hRe1Pt5->Project3D(Form("IMPt5_%s_pz",fCalorimeter.Data()));
6639984f 710 hIMPt5->SetLineColor(2);
711 hIMPt5->SetTitle("0 < p_{T, #gamma#gamma} < 5 GeV/c");
712 hIMPt5->Draw();
713
714 cIM->cd(3) ;
583c48f1 715 TH3F * hRe1Pt10 = (TH3F*)fhRe1[0]->Clone(Form("IMPt10_%s",fCalorimeter.Data()));
6639984f 716 hRe1Pt10->GetXaxis()->SetRangeUser(5,10);
583c48f1 717 TH1D * hIMPt10 = (TH1D*) hRe1Pt10->Project3D(Form("IMPt10_%s_pz",fCalorimeter.Data()));
6639984f 718 hIMPt10->SetLineColor(2);
719 hIMPt10->SetTitle("5 < p_{T, #gamma#gamma} < 10 GeV/c");
720 hIMPt10->Draw();
721
722 cIM->cd(4) ;
583c48f1 723 TH3F * hRe1Pt20 = (TH3F*)fhRe1[0]->Clone(Form("IMPt20_%s",fCalorimeter.Data()));
6639984f 724 hRe1Pt20->GetXaxis()->SetRangeUser(10,20);
583c48f1 725 TH1D * hIMPt20 = (TH1D*) hRe1Pt20->Project3D(Form("IMPt20_%s_pz",fCalorimeter.Data()));
6639984f 726 hIMPt20->SetLineColor(2);
727 hIMPt20->SetTitle("10 < p_{T, #gamma#gamma} < 20 GeV/c");
728 hIMPt20->Draw();
729
71dd883b 730 char nameIMF[128];
731 sprintf(nameIMF,"AliAnaPi0_%s_Mgg.eps",fCalorimeter.Data());
732 cIM->Print(nameIMF);
6639984f 733
71dd883b 734 char namePt[128];
735 sprintf(namePt,"AliAnaPi0_%s_cPt",fCalorimeter.Data());
736 TCanvas * cPt = new TCanvas(namePt, "", 400, 10, 600, 700) ;
6639984f 737 cPt->Divide(2, 2);
738
739 cPt->cd(1) ;
740 //gPad->SetLogy();
741 TH1D * hPt = (TH1D*) fhRe1[0]->Project3D("x");
742 hPt->SetLineColor(2);
743 hPt->SetTitle("No cut on M_{#gamma#gamma} ");
744 hPt->Draw();
745
746 cPt->cd(2) ;
583c48f1 747 TH3F * hRe1IM1 = (TH3F*)fhRe1[0]->Clone(Form("Pt1_%s",fCalorimeter.Data()));
6639984f 748 hRe1IM1->GetZaxis()->SetRangeUser(0.05,0.21);
749 TH1D * hPtIM1 = (TH1D*) hRe1IM1->Project3D("x");
750 hPtIM1->SetLineColor(2);
751 hPtIM1->SetTitle("0.05 < M_{#gamma#gamma} < 0.21 GeV/c^{2}");
752 hPtIM1->Draw();
753
754 cPt->cd(3) ;
583c48f1 755 TH3F * hRe1IM2 = (TH3F*)fhRe1[0]->Clone(Form("Pt2_%s",fCalorimeter.Data()));
6639984f 756 hRe1IM2->GetZaxis()->SetRangeUser(0.09,0.17);
757 TH1D * hPtIM2 = (TH1D*) hRe1IM2->Project3D("x");
758 hPtIM2->SetLineColor(2);
759 hPtIM2->SetTitle("0.09 < M_{#gamma#gamma} < 0.17 GeV/c^{2}");
760 hPtIM2->Draw();
761
762 cPt->cd(4) ;
583c48f1 763 TH3F * hRe1IM3 = (TH3F*)fhRe1[0]->Clone(Form("Pt3_%s",fCalorimeter.Data()));
6639984f 764 hRe1IM3->GetZaxis()->SetRangeUser(0.11,0.15);
765 TH1D * hPtIM3 = (TH1D*) hRe1IM1->Project3D("x");
766 hPtIM3->SetLineColor(2);
767 hPtIM3->SetTitle("0.11 < M_{#gamma#gamma} < 0.15 GeV/c^{2}");
768 hPtIM3->Draw();
769
71dd883b 770 char namePtF[128];
771 sprintf(namePtF,"AliAnaPi0_%s_Pt.eps",fCalorimeter.Data());
772 cPt->Print(namePtF);
1c5acb87 773
6639984f 774
775 char line[1024] ;
71dd883b 776 sprintf(line, ".!tar -zcf %s_%s.tar.gz *.eps", GetName(),fCalorimeter.Data()) ;
6639984f 777 gROOT->ProcessLine(line);
71dd883b 778 sprintf(line, ".!rm -fR AliAnaPi0_%s*.eps",fCalorimeter.Data());
6639984f 779 gROOT->ProcessLine(line);
780
71dd883b 781 printf(" AliAnaPi0::Terminate() - !! All the eps files are in %s_%s.tar.gz !!!\n", GetName(), fCalorimeter.Data());
1c5acb87 782
6639984f 783}
c8fe2783 784 //____________________________________________________________________________________________________________________________________________________
785Int_t AliAnaPi0::GetEventIndex(AliAODPWG4Particle * part, Double_t * vert)
786{
787 // retieves the event index and checks the vertex
788 // in the mixed buffer returns -2 if vertex NOK
789 // for normal events returns 0 if vertex OK and -1 if vertex NOK
790
791 Int_t rv = -1 ;
792 if (GetMixedEvent()){
793 TObjArray * pl = 0x0;
794 if (part->GetDetector().Contains("PHOS")) {
795 pl = GetAODPHOS();
796 } else if (part->GetDetector().Contains("EMCAL")) {
797 pl = GetAODEMCAL();
798 } else {
799 AliFatal(Form("%s is an unknown calorimeter", part->GetDetector().Data())) ;
800 }
801 rv = GetMixedEvent()->EventIndexForCaloCluster(part->GetCaloLabel(0)) ;
802 GetMixedEvent()->GetVertexOfEvent(rv)->GetXYZ(vert);
803 if(vert[2] < -fZvtxCut || vert[2] > fZvtxCut)
804 rv = -2 ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
805 } else {
806 Double_t * tempo = GetReader()->GetVertex() ;
807 vert[0] = tempo[0] ;
808 vert[1] = tempo[1] ;
809 vert[2] = tempo[2] ;
810 if(vert[2] < -fZvtxCut || vert[2] > fZvtxCut)
811 rv = -1 ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
812 else
813 rv = 0 ;
814 }
815 return rv ;
816}