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 //_________________________________________________________________________
18 // Class to collect two-photon invariant mass distributions for
19 // extractin raw pi0 yield.
21 //-- Author: Dmitri Peressounko (RRC "KI")
22 //-- Adapted to PartCorr frame by Lamia Benhabib (SUBATECH)
23 //-- and Gustavo Conesa (INFN-Frascati)
24 //_________________________________________________________________________
27 // --- ROOT system ---
29 //#include "Riostream.h"
33 #include "TClonesArray.h"
34 #include "TObjString.h"
36 //---- AliRoot system ----
37 #include "AliAnaPi0.h"
38 #include "AliCaloTrackReader.h"
39 #include "AliCaloPID.h"
41 #include "AliFidutialCut.h"
42 #include "TParticle.h"
43 #include "AliAODCaloCluster.h"
44 #include "AliVEvent.h"
47 #include "AliPHOSGeoUtils.h"
52 //________________________________________________________________________________________________________________________________________________
53 AliAnaPi0::AliAnaPi0() : AliAnaPartCorrBaseClass(),
54 fNCentrBin(0),fNZvertBin(0),fNrpBin(0),
55 fNPID(0),fNmaxMixEv(0), fZvtxCut(0.),fCalorimeter(""),
56 fEventsList(0x0), fhEtalon(0x0),
57 fhRe1(0x0),fhMi1(0x0),fhRe2(0x0),fhMi2(0x0),fhRe3(0x0),fhMi3(0x0),fhEvents(0x0),
58 fhPrimPt(0x0), fhPrimAccPt(0x0), fhPrimY(0x0), fhPrimAccY(0x0), fhPrimPhi(0x0), fhPrimAccPhi(0x0)
65 //________________________________________________________________________________________________________________________________________________
66 AliAnaPi0::AliAnaPi0(const AliAnaPi0 & ex) : AliAnaPartCorrBaseClass(ex),
67 fNCentrBin(ex.fNCentrBin),fNZvertBin(ex.fNZvertBin),fNrpBin(ex.fNrpBin),
68 fNPID(ex.fNPID),fNmaxMixEv(ex.fNmaxMixEv),fZvtxCut(ex.fZvtxCut), fCalorimeter(ex.fCalorimeter),
69 fEventsList(ex.fEventsList), fhEtalon(ex.fhEtalon),
70 fhRe1(ex.fhRe1),fhMi1(ex.fhMi1),fhRe2(ex.fhRe2),fhMi2(ex.fhMi2),fhRe3(ex.fhRe3),fhMi3(ex.fhMi3),fhEvents(ex.fhEvents),
71 fhPrimPt(ex.fhPrimPt), fhPrimAccPt(ex.fhPrimAccPt), fhPrimY(ex.fhPrimY),
72 fhPrimAccY(ex.fhPrimAccY), fhPrimPhi(ex.fhPrimPhi), fhPrimAccPhi(ex.fhPrimAccPhi)
78 //________________________________________________________________________________________________________________________________________________
79 AliAnaPi0 & AliAnaPi0::operator = (const AliAnaPi0 & ex)
81 // assignment operator
83 if(this == &ex)return *this;
84 ((AliAnaPartCorrBaseClass *)this)->operator=(ex);
86 fNCentrBin = ex.fNCentrBin ; fNZvertBin = ex.fNZvertBin ; fNrpBin = ex.fNrpBin ;
87 fNPID = ex.fNPID ; fNmaxMixEv = ex.fNmaxMixEv ; fZvtxCut = ex.fZvtxCut ; fCalorimeter = ex.fCalorimeter ;
88 fEventsList = ex.fEventsList ; fhEtalon = ex.fhEtalon ;
89 fhRe1 = ex.fhRe1 ; fhMi1 = ex.fhMi1 ; fhRe2 = ex.fhRe2 ; fhMi2 = ex.fhMi2 ;
90 fhRe3 = ex.fhRe3 ; fhMi3 = ex.fhMi3 ; fhEvents = ex.fhEvents ;
91 fhPrimPt = ex.fhPrimPt ; fhPrimAccPt = ex.fhPrimAccPt ; fhPrimY = ex.fhPrimY ;
92 fhPrimAccY = ex.fhPrimAccY ; fhPrimPhi = ex.fhPrimPhi ; fhPrimAccPhi = ex.fhPrimAccPhi ;
98 //________________________________________________________________________________________________________________________________________________
99 AliAnaPi0::~AliAnaPi0() {
100 // Remove event containers
102 for(Int_t ic=0; ic<fNCentrBin; ic++){
103 for(Int_t iz=0; iz<fNZvertBin; iz++){
104 for(Int_t irp=0; irp<fNrpBin; irp++){
105 fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp]->Delete() ;
106 delete fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp] ;
110 delete[] fEventsList;
115 if(fPHOSGeo) delete fPHOSGeo ;
119 //________________________________________________________________________________________________________________________________________________
120 void AliAnaPi0::InitParameters()
122 //Init parameters when first called the analysis
123 //Set default parameters
124 SetInputAODName("PWG4Particle");
126 AddToHistogramsName("AnaPi0_");
134 fCalorimeter = "PHOS";
136 //________________________________________________________________________________________________________________________________________________
137 void AliAnaPi0::Init()
139 //Init some data members needed in analysis
141 //Histograms binning and range
142 if(!fhEtalon){ // p_T alpha d m_gg
143 fhEtalon = new TH3D("hEtalon","Histo with binning parameters",50,0.,25.,10,0.,1.,200,0.,1.) ;
144 fhEtalon->SetXTitle("P_{T} (GeV)") ;
145 fhEtalon->SetYTitle("#alpha") ;
146 fhEtalon->SetZTitle("m_{#gamma#gamma} (GeV)") ;
151 //________________________________________________________________________________________________________________________________________________
152 TList * AliAnaPi0::GetCreateOutputObjects()
154 // Create histograms to be saved in output file and
155 // store them in fOutputContainer
157 //create event containers
158 fEventsList = new TList*[fNCentrBin*fNZvertBin*fNrpBin] ;
160 for(Int_t ic=0; ic<fNCentrBin; ic++){
161 for(Int_t iz=0; iz<fNZvertBin; iz++){
162 for(Int_t irp=0; irp<fNrpBin; irp++){
163 fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp] = new TList() ;
168 //If Geometry library loaded, do geometry selection during analysis.
170 printf("AliAnaPi0::GetCreateOutputObjects() - PHOS geometry initialized!\n");
171 fPHOSGeo = new AliPHOSGeoUtils("PHOSgeo") ;
174 TList * outputContainer = new TList() ;
175 outputContainer->SetName(GetName());
177 fhRe1=new TH3D*[fNCentrBin*fNPID] ;
178 fhRe2=new TH3D*[fNCentrBin*fNPID] ;
179 fhRe3=new TH3D*[fNCentrBin*fNPID] ;
180 fhMi1=new TH3D*[fNCentrBin*fNPID] ;
181 fhMi2=new TH3D*[fNCentrBin*fNPID] ;
182 fhMi3=new TH3D*[fNCentrBin*fNPID] ;
187 for(Int_t ic=0; ic<fNCentrBin; ic++){
188 for(Int_t ipid=0; ipid<fNPID; ipid++){
190 //Distance to bad module 1
191 sprintf(key,"hRe_cen%d_pid%d_dist1",ic,ipid) ;
192 sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
194 fhEtalon->Clone(key);
195 fhRe1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
196 fhRe1[ic*fNPID+ipid]->SetName(key) ;
197 fhRe1[ic*fNPID+ipid]->SetTitle(title) ;
198 outputContainer->Add(fhRe1[ic*fNPID+ipid]) ;
200 sprintf(key,"hMi_cen%d_pid%d_dist1",ic,ipid) ;
201 sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
202 fhMi1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
203 fhMi1[ic*fNPID+ipid]->SetName(key) ;
204 fhMi1[ic*fNPID+ipid]->SetTitle(title) ;
205 outputContainer->Add(fhMi1[ic*fNPID+ipid]) ;
207 //Distance to bad module 2
208 sprintf(key,"hRe_cen%d_pid%d_dist2",ic,ipid) ;
209 sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
210 fhRe2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
211 fhRe2[ic*fNPID+ipid]->SetName(key) ;
212 fhRe2[ic*fNPID+ipid]->SetTitle(title) ;
213 outputContainer->Add(fhRe2[ic*fNPID+ipid]) ;
215 sprintf(key,"hMi_cen%d_pid%d_dist2",ic,ipid) ;
216 sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
217 fhMi2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
218 fhMi2[ic*fNPID+ipid]->SetName(key) ;
219 fhMi2[ic*fNPID+ipid]->SetTitle(title) ;
220 outputContainer->Add(fhMi2[ic*fNPID+ipid]) ;
222 //Distance to bad module 3
223 sprintf(key,"hRe_cen%d_pid%d_dist3",ic,ipid) ;
224 sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
225 fhRe3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
226 fhRe3[ic*fNPID+ipid]->SetName(key) ;
227 fhRe3[ic*fNPID+ipid]->SetTitle(title) ;
228 outputContainer->Add(fhRe3[ic*fNPID+ipid]) ;
230 sprintf(key,"hMi_cen%d_pid%d_dist3",ic,ipid) ;
231 sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
232 fhMi3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
233 fhMi3[ic*fNPID+ipid]->SetName(key) ;
234 fhMi3[ic*fNPID+ipid]->SetTitle(title) ;
235 outputContainer->Add(fhMi3[ic*fNPID+ipid]) ;
240 fhEvents=new TH3D("hEvents","Number of events",fNCentrBin,0.,1.*fNCentrBin,
241 fNZvertBin,0.,1.*fNZvertBin,fNrpBin,0.,1.*fNrpBin) ;
242 outputContainer->Add(fhEvents) ;
244 //Histograms filled only if MC data is requested
245 if(IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC) ){
246 if(fhEtalon->GetXaxis()->GetXbins() && fhEtalon->GetXaxis()->GetXbins()->GetSize()){ //Variable bin size
247 fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXbins()->GetArray()) ;
248 fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",fhEtalon->GetXaxis()->GetNbins(),
249 fhEtalon->GetXaxis()->GetXbins()->GetArray()) ;
252 fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXmin(),fhEtalon->GetXaxis()->GetXmax()) ;
253 fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",
254 fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXmin(),fhEtalon->GetXaxis()->GetXmax()) ;
256 outputContainer->Add(fhPrimPt) ;
257 outputContainer->Add(fhPrimAccPt) ;
259 fhPrimY = new TH1D("hPrimaryRapidity","Rapidity of primary pi0",100,-5.,5.) ;
260 outputContainer->Add(fhPrimY) ;
262 fhPrimAccY = new TH1D("hPrimAccRapidity","Rapidity of primary pi0",100,-5.,5.) ;
263 outputContainer->Add(fhPrimAccY) ;
265 fhPrimPhi = new TH1D("hPrimaryPhi","Azimithal of primary pi0",180,0.,360.) ;
266 outputContainer->Add(fhPrimPhi) ;
268 fhPrimAccPhi = new TH1D("hPrimAccPhi","Azimithal of primary pi0 with accepted daughters",180,-0.,360.) ;
269 outputContainer->Add(fhPrimAccPhi) ;
272 //Save parameters used for analysis
273 TString parList ; //this will be list of parameters used for this analysis.
275 sprintf(onePar,"--- AliAnaPi0 ---\n") ;
277 sprintf(onePar,"Number of bins in Centrality: %d \n",fNCentrBin) ;
279 sprintf(onePar,"Number of bins in Z vert. pos: %d \n",fNZvertBin) ;
281 sprintf(onePar,"Number of bins in Reac. Plain: %d \n",fNrpBin) ;
283 sprintf(onePar,"Depth of event buffer: %d \n",fNmaxMixEv) ;
285 sprintf(onePar,"Number of different PID used: %d \n",fNPID) ;
287 sprintf(onePar,"Cuts: \n") ;
289 sprintf(onePar,"Z vertex position: -%f < z < %f \n",fZvtxCut,fZvtxCut) ;
291 sprintf(onePar,"Calorimeter: %s \n",fCalorimeter.Data()) ;
294 TObjString *oString= new TObjString(parList) ;
295 outputContainer->Add(oString);
297 return outputContainer;
300 //_________________________________________________________________________________________________________________________________________________
301 void AliAnaPi0::Print(const Option_t * /*opt*/) const
303 //Print some relevant parameters set for the analysis
304 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
305 AliAnaPartCorrBaseClass::Print(" ");
307 printf("Number of bins in Centrality: %d \n",fNCentrBin) ;
308 printf("Number of bins in Z vert. pos: %d \n",fNZvertBin) ;
309 printf("Number of bins in Reac. Plain: %d \n",fNrpBin) ;
310 printf("Depth of event buffer: %d \n",fNmaxMixEv) ;
311 printf("Number of different PID used: %d \n",fNPID) ;
313 printf("Z vertex position: -%2.3f < z < %2.3f \n",fZvtxCut,fZvtxCut) ;
314 printf("------------------------------------------------------\n") ;
318 //____________________________________________________________________________________________________________________________________________________
319 void AliAnaPi0::MakeAnalysisFillHistograms()
321 //Process one event and extract photons from AOD branch
322 // filled with AliAnaPhoton and fill histos with invariant mass
324 //Apply some cuts on event: vertex position and centrality range
325 Int_t iRun=(GetReader()->GetInputEvent())->GetRunNumber() ;
326 if(IsBadRun(iRun)) return ;
328 Double_t vert[]={0,0,0} ; //vertex ;
329 GetReader()->GetVertex(vert);
330 if(vert[2]<-fZvtxCut || vert[2]> fZvtxCut) return ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
332 //Get Centrality and calculate centrality bin
333 //Does not exist in ESD yet???????
334 Int_t curCentrBin=0 ;
336 //Get Reaction Plain position and calculate RP bin
337 //does not exist in ESD yet????
340 Int_t curZvertBin=(Int_t)(0.5*fNZvertBin*(vert[2]+fZvtxCut)/fZvtxCut) ;
342 fhEvents->Fill(curCentrBin+0.5,curZvertBin+0.5,curRPBin+0.5) ;
344 Int_t nPhot = GetInputAODBranch()->GetEntriesFast() ;
345 if(GetDebug() > 1) printf("AliAnaPi0::MakeAnalysisFillHistograms() - Photon entries %d\n", nPhot);
347 for(Int_t i1=0; i1<nPhot-1; i1++){
348 AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ;
349 TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E());
350 for(Int_t i2=i1+1; i2<nPhot; i2++){
351 AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i2)) ;
352 TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E());
353 Double_t m = (photon1 + photon2).M() ;
354 Double_t pt = (photon1 + photon2).Pt();
355 Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ;
357 printf("AliAnaPi0::MakeAnalysisFillHistograms() - Current Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n",
358 p1->Pt(), p2->Pt(), pt,m,a);
359 for(Int_t ipid=0; ipid<fNPID; ipid++)
361 if((p1->IsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){
362 fhRe1[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
363 if(p1->DistToBad()>0 && p2->DistToBad()>0){
364 fhRe2[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
365 if(p1->DistToBad()>1 && p2->DistToBad()>1){
366 fhRe3[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
376 TList * evMixList=fEventsList[curCentrBin*fNZvertBin*fNrpBin+curZvertBin*fNrpBin+curRPBin] ;
377 Int_t nMixed = evMixList->GetSize() ;
378 for(Int_t ii=0; ii<nMixed; ii++){
379 TClonesArray* ev2= (TClonesArray*) (evMixList->At(ii));
380 Int_t nPhot2=ev2->GetEntriesFast() ;
382 if(GetDebug() > 1) printf("AliAnaPi0::MakeAnalysisFillHistograms() - Mixed event %d photon entries %d\n", ii, nPhot);
384 for(Int_t i1=0; i1<nPhot; i1++){
385 AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ;
386 TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E());
387 for(Int_t i2=0; i2<nPhot2; i2++){
388 AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (ev2->At(i2)) ;
390 TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E());
391 m = (photon1+photon2).M() ;
392 Double_t pt = (photon1 + photon2).Pt();
393 Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ;
395 printf("AliAnaPi0::MakeAnalysisFillHistograms() - Mixed Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n",
396 p1->Pt(), p2->Pt(), pt,m,a);
397 for(Int_t ipid=0; ipid<fNPID; ipid++){
398 if((p1->IsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){
399 fhMi1[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
400 if(p1->DistToBad()>0 && p2->DistToBad()>0){
401 fhMi2[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
402 if(p1->DistToBad()>1 && p2->DistToBad()>1){
403 fhMi3[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
413 TClonesArray *currentEvent = new TClonesArray(*GetInputAODBranch());
414 //Add current event to buffer and Remove redandant events
415 if(currentEvent->GetEntriesFast()>0){
416 evMixList->AddFirst(currentEvent) ;
417 currentEvent=0 ; //Now list of particles belongs to buffer and it will be deleted with buffer
418 if(evMixList->GetSize()>=fNmaxMixEv)
420 TClonesArray * tmp = (TClonesArray*) (evMixList->Last()) ;
421 evMixList->RemoveLast() ;
426 delete currentEvent ;
431 AliStack * stack = GetMCStack();
432 if(stack && (IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC)) ){
433 for(Int_t i=0 ; i<stack->GetNprimary(); i++){
434 TParticle * prim = stack->Particle(i) ;
435 if(prim->GetPdgCode() == 111){
436 Double_t pi0Pt = prim->Pt() ;
437 //printf("pi0, pt %2.2f\n",pi0Pt);
438 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
439 Double_t pi0Y = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
440 Double_t phi = TMath::RadToDeg()*prim->Phi() ;
441 if(TMath::Abs(pi0Y) < 0.5){
442 fhPrimPt->Fill(pi0Pt) ;
444 fhPrimY ->Fill(pi0Y) ;
445 fhPrimPhi->Fill(phi) ;
447 //Check if both photons hit Calorimeter
448 Int_t iphot1=prim->GetFirstDaughter() ;
449 Int_t iphot2=prim->GetLastDaughter() ;
450 if(iphot1>-1 && iphot1<stack->GetNtrack() && iphot2>-1 && iphot2<stack->GetNtrack()){
451 TParticle * phot1 = stack->Particle(iphot1) ;
452 TParticle * phot2 = stack->Particle(iphot2) ;
453 if(phot1 && phot2 && phot1->GetPdgCode()==22 && phot2->GetPdgCode()==22){
454 //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",
455 // phot1->Pt(), phot1->Phi()*180./3.1415, phot1->Eta(), phot2->Pt(), phot2->Phi()*180./3.1415, phot2->Eta());
456 Bool_t inacceptance = kFALSE;
460 if(fCalorimeter == "PHOS" && fPHOSGeo->ImpactOnEmc(phot1,mod,z,x) && fPHOSGeo->ImpactOnEmc(phot1,mod,z,x))
461 inacceptance = kTRUE;
462 //printf("In REAL PHOS acceptance? %d\n",inacceptance);
464 TLorentzVector lv1, lv2;
465 phot1->Momentum(lv1);
466 phot2->Momentum(lv2);
467 if(GetFidutialCut()->IsInFidutialCut(lv1,fCalorimeter) && GetFidutialCut()->IsInFidutialCut(lv2,fCalorimeter))
468 inacceptance = kTRUE ;
469 //printf("In %s fidutial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
472 fhPrimAccPt->Fill(pi0Pt) ;
473 fhPrimAccPhi->Fill(phi) ;
474 fhPrimAccY->Fill(pi0Y) ;
477 }//Check daughters exist
480 }//stack exists and data is MC
484 //________________________________________________________________________
485 void AliAnaPi0::ReadHistograms(TList* outputList)
487 // Needed when Terminate is executed in distributed environment
488 // Refill analysis histograms of this class with corresponding histograms in output list.
490 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
491 // the first one and then add the next
492 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hRe_cen0_pid0_dist1"));
495 for(Int_t ic=0; ic<fNCentrBin; ic++){
496 for(Int_t ipid=0; ipid<fNPID; ipid++){
497 fhRe1[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
498 fhMi1[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
499 fhRe2[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
500 fhMi2[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
501 fhRe3[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
502 fhMi3[ic*fNPID+ipid] = (TH3D*) outputList->At(index++);
506 fhEvents = (TH3D *) outputList->At(index++);
508 //Histograms filled only if MC data is requested
509 if(IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC) ){
510 fhPrimPt = (TH1D*) outputList->At(index++);
511 fhPrimAccPt = (TH1D*) outputList->At(index++);
512 fhPrimY = (TH1D*) outputList->At(index++);
513 fhPrimAccY = (TH1D*) outputList->At(index++);
514 fhPrimPhi = (TH1D*) outputList->At(index++);
515 fhPrimAccPhi = (TH1D*) outputList->At(index);
521 //____________________________________________________________________________________________________________________________________________________
522 void AliAnaPi0::Terminate(TList* outputList)
524 //Do some calculations and plots from the final histograms.
526 printf(" *** %s Terminate:\n", GetName()) ;
528 //Recover histograms from output histograms list, needed for distributed analysis.
529 ReadHistograms(outputList);
532 printf("AliAnaPi0::Terminate() - Error: Remote output histograms not imported in AliAnaPi0 object");
536 printf("AliAnaPi0::Terminate() Mgg Real : %5.3f , RMS : %5.3f \n", fhRe1[0]->GetMean(), fhRe1[0]->GetRMS() ) ;
539 sprintf(nameIM,"AliAnaPi0_%s_cPt",fCalorimeter.Data());
540 TCanvas * cIM = new TCanvas(nameIM, "", 400, 10, 600, 700) ;
545 TH1D * hIMAllPt = (TH1D*) fhRe1[0]->ProjectionZ();
546 hIMAllPt->SetLineColor(2);
547 hIMAllPt->SetTitle("No cut on p_{T, #gamma#gamma} ");
551 TH3F * hRe1Pt5 = (TH3F*)fhRe1[0]->Clone("IMPt5");
552 hRe1Pt5->GetXaxis()->SetRangeUser(0,5);
553 TH1D * hIMPt5 = (TH1D*) hRe1Pt5->Project3D("z");
554 hIMPt5->SetLineColor(2);
555 hIMPt5->SetTitle("0 < p_{T, #gamma#gamma} < 5 GeV/c");
559 TH3F * hRe1Pt10 = (TH3F*)fhRe1[0]->Clone("IMPt10");
560 hRe1Pt10->GetXaxis()->SetRangeUser(5,10);
561 TH1D * hIMPt10 = (TH1D*) hRe1Pt10->Project3D("z");
562 hIMPt10->SetLineColor(2);
563 hIMPt10->SetTitle("5 < p_{T, #gamma#gamma} < 10 GeV/c");
567 TH3F * hRe1Pt20 = (TH3F*)fhRe1[0]->Clone("IMPt20");
568 hRe1Pt20->GetXaxis()->SetRangeUser(10,20);
569 TH1D * hIMPt20 = (TH1D*) hRe1Pt20->Project3D("z");
570 hIMPt20->SetLineColor(2);
571 hIMPt20->SetTitle("10 < p_{T, #gamma#gamma} < 20 GeV/c");
575 sprintf(nameIMF,"AliAnaPi0_%s_Mgg.eps",fCalorimeter.Data());
579 sprintf(namePt,"AliAnaPi0_%s_cPt",fCalorimeter.Data());
580 TCanvas * cPt = new TCanvas(namePt, "", 400, 10, 600, 700) ;
585 TH1D * hPt = (TH1D*) fhRe1[0]->Project3D("x");
586 hPt->SetLineColor(2);
587 hPt->SetTitle("No cut on M_{#gamma#gamma} ");
591 TH3F * hRe1IM1 = (TH3F*)fhRe1[0]->Clone("PtIM1");
592 hRe1IM1->GetZaxis()->SetRangeUser(0.05,0.21);
593 TH1D * hPtIM1 = (TH1D*) hRe1IM1->Project3D("x");
594 hPtIM1->SetLineColor(2);
595 hPtIM1->SetTitle("0.05 < M_{#gamma#gamma} < 0.21 GeV/c^{2}");
599 TH3F * hRe1IM2 = (TH3F*)fhRe1[0]->Clone("PtIM2");
600 hRe1IM2->GetZaxis()->SetRangeUser(0.09,0.17);
601 TH1D * hPtIM2 = (TH1D*) hRe1IM2->Project3D("x");
602 hPtIM2->SetLineColor(2);
603 hPtIM2->SetTitle("0.09 < M_{#gamma#gamma} < 0.17 GeV/c^{2}");
607 TH3F * hRe1IM3 = (TH3F*)fhRe1[0]->Clone("PtIM3");
608 hRe1IM3->GetZaxis()->SetRangeUser(0.11,0.15);
609 TH1D * hPtIM3 = (TH1D*) hRe1IM1->Project3D("x");
610 hPtIM3->SetLineColor(2);
611 hPtIM3->SetTitle("0.11 < M_{#gamma#gamma} < 0.15 GeV/c^{2}");
615 sprintf(namePtF,"AliAnaPi0_%s_Pt.eps",fCalorimeter.Data());
620 sprintf(line, ".!tar -zcf %s_%s.tar.gz *.eps", GetName(),fCalorimeter.Data()) ;
621 gROOT->ProcessLine(line);
622 sprintf(line, ".!rm -fR AliAnaPi0_%s*.eps",fCalorimeter.Data());
623 gROOT->ProcessLine(line);
625 printf(" AliAnaPi0::Terminate() - !! All the eps files are in %s_%s.tar.gz !!!\n", GetName(), fCalorimeter.Data());