1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //_________________________________________________________________________
17 // Class to collect two-photon invariant mass distributions for
18 // extracting raw pi0 yield.
19 // Input is produced by AliAnaPhoton (or any other analysis producing output AliAODPWG4Particles),
20 // it will do nothing if executed alone
22 //-- Author: Dmitri Peressounko (RRC "KI")
23 //-- Adapted to CaloTrackCorr frame by Lamia Benhabib (SUBATECH)
24 //-- and Gustavo Conesa (INFN-Frascati)
25 //_________________________________________________________________________
28 // --- ROOT system ---
31 //#include "Riostream.h"
35 #include "TClonesArray.h"
36 #include "TObjString.h"
37 #include "TDatabasePDG.h"
39 //---- AliRoot system ----
40 #include "AliAnaPi0.h"
41 #include "AliCaloTrackReader.h"
42 #include "AliCaloPID.h"
44 #include "AliFiducialCut.h"
45 #include "TParticle.h"
46 #include "AliVEvent.h"
47 #include "AliESDCaloCluster.h"
48 #include "AliESDEvent.h"
49 #include "AliAODEvent.h"
50 #include "AliNeutralMesonSelection.h"
51 #include "AliMixedEvent.h"
52 #include "AliAODMCParticle.h"
55 #include "AliPHOSGeoUtils.h"
56 #include "AliEMCALGeometry.h"
60 //______________________________________________________
61 AliAnaPi0::AliAnaPi0() : AliAnaCaloTrackCorrBaseClass(),
64 fUseAngleCut(kFALSE), fUseAngleEDepCut(kFALSE), fAngleCut(0), fAngleMaxCut(7.),
65 fMultiCutAna(kFALSE), fMultiCutAnaSim(kFALSE),
66 fNPtCuts(0), fNAsymCuts(0), fNCellNCuts(0), fNPIDBits(0),
67 fMakeInvPtPlots(kFALSE), fSameSM(kFALSE),
68 fFillSMCombinations(kFALSE), fCheckConversion(kFALSE),
69 fFillBadDistHisto(kFALSE), fFillSSCombinations(kFALSE),
70 fFillAngleHisto(kFALSE), fFillAsymmetryHisto(kFALSE), fFillOriginHisto(0), fFillArmenterosThetaStar(0),
71 fCheckAccInSector(kFALSE),
72 fPhotonMom1(), fPhotonMom1Boost(), fPhotonMom2(), fPi0Mom(),
76 fhAverTotECluster(0), fhAverTotECell(0), fhAverTotECellvsCluster(0),
77 fhEDensityCluster(0), fhEDensityCell(0), fhEDensityCellvsCluster(0),
78 fhReMod(0x0), fhReSameSideEMCALMod(0x0), fhReSameSectorEMCALMod(0x0), fhReDiffPHOSMod(0x0),
79 fhMiMod(0x0), fhMiSameSideEMCALMod(0x0), fhMiSameSectorEMCALMod(0x0), fhMiDiffPHOSMod(0x0),
80 fhReConv(0x0), fhMiConv(0x0), fhReConv2(0x0), fhMiConv2(0x0),
81 fhRe1(0x0), fhMi1(0x0), fhRe2(0x0), fhMi2(0x0),
82 fhRe3(0x0), fhMi3(0x0), fhReInvPt1(0x0), fhMiInvPt1(0x0),
83 fhReInvPt2(0x0), fhMiInvPt2(0x0), fhReInvPt3(0x0), fhMiInvPt3(0x0),
84 fhRePtNCellAsymCuts(0x0), fhMiPtNCellAsymCuts(0x0), fhRePtNCellAsymCutsSM(),
85 fhRePIDBits(0x0), fhRePtMult(0x0), fhReSS(),
86 fhRePtAsym(0x0), fhRePtAsymPi0(0x0), fhRePtAsymEta(0x0),
87 fhEventBin(0), fhEventMixBin(0),
88 fhCentrality(0x0), fhCentralityNoPair(0x0),
89 fhEventPlaneResolution(0x0),
90 fhRealOpeningAngle(0x0), fhRealCosOpeningAngle(0x0), fhMixedOpeningAngle(0x0), fhMixedCosOpeningAngle(0x0),
92 fhPrimPi0E(0x0), fhPrimPi0Pt(0x0),
93 fhPrimPi0AccE(0x0), fhPrimPi0AccPt(0x0),
94 fhPrimPi0Y(0x0), fhPrimPi0AccY(0x0),
95 fhPrimPi0Yeta(0x0), fhPrimPi0YetaYcut(0x0), fhPrimPi0AccYeta(0x0),
96 fhPrimPi0Phi(0x0), fhPrimPi0AccPhi(0x0),
97 fhPrimPi0OpeningAngle(0x0), fhPrimPi0OpeningAngleAsym(0x0),fhPrimPi0CosOpeningAngle(0x0),
98 fhPrimPi0PtCentrality(0), fhPrimPi0PtEventPlane(0),
99 fhPrimPi0AccPtCentrality(0), fhPrimPi0AccPtEventPlane(0),
100 fhPrimEtaE(0x0), fhPrimEtaPt(0x0),
101 fhPrimEtaAccE(0x0), fhPrimEtaAccPt(0x0),
102 fhPrimEtaY(0x0), fhPrimEtaAccY(0x0),
103 fhPrimEtaYeta(0x0), fhPrimEtaYetaYcut(0x0), fhPrimEtaAccYeta(0x0),
104 fhPrimEtaPhi(0x0), fhPrimEtaAccPhi(0x0),
105 fhPrimEtaOpeningAngle(0x0), fhPrimEtaOpeningAngleAsym(0x0),fhPrimEtaCosOpeningAngle(0x0),
106 fhPrimEtaPtCentrality(0), fhPrimEtaPtEventPlane(0),
107 fhPrimEtaAccPtCentrality(0), fhPrimEtaAccPtEventPlane(0),
108 fhPrimPi0PtOrigin(0x0), fhPrimEtaPtOrigin(0x0),
109 fhMCOrgMass(), fhMCOrgAsym(), fhMCOrgDeltaEta(), fhMCOrgDeltaPhi(),
110 fhMCPi0MassPtRec(), fhMCPi0MassPtTrue(), fhMCPi0PtTruePtRec(),
111 fhMCEtaMassPtRec(), fhMCEtaMassPtTrue(), fhMCEtaPtTruePtRec(),
112 fhMCPi0PtOrigin(0x0), fhMCEtaPtOrigin(0x0),
113 fhMCPi0ProdVertex(0), fhMCEtaProdVertex(0),
114 fhPrimPi0ProdVertex(0), fhPrimEtaProdVertex(0),
115 fhReMCFromConversion(0), fhReMCFromNotConversion(0), fhReMCFromMixConversion(0),
116 fhCosThStarPrimPi0(0), fhCosThStarPrimEta(0),
123 for(Int_t i = 0; i < 4; i++)
130 //_____________________
131 AliAnaPi0::~AliAnaPi0()
133 // Remove event containers
135 if(DoOwnMix() && fEventsList)
137 for(Int_t ic=0; ic<GetNCentrBin(); ic++)
139 for(Int_t iz=0; iz<GetNZvertBin(); iz++)
141 for(Int_t irp=0; irp<GetNRPBin(); irp++)
143 Int_t bin = GetEventMixBin(ic,iz,irp);
144 fEventsList[bin]->Delete() ;
145 delete fEventsList[bin] ;
149 delete[] fEventsList;
154 //______________________________
155 void AliAnaPi0::InitParameters()
157 //Init parameters when first called the analysis
158 //Set default parameters
159 SetInputAODName("PWG4Particle");
161 AddToHistogramsName("AnaPi0_");
163 fUseAngleCut = kFALSE;
164 fUseAngleEDepCut = kFALSE;
166 fAngleMaxCut = TMath::Pi();
168 fMultiCutAna = kFALSE;
171 fPtCuts[0] = 0.; fPtCuts[1] = 0.3; fPtCuts[2] = 0.5;
172 for(Int_t i = fNPtCuts; i < 10; i++)fPtCuts[i] = 0.;
175 fAsymCuts[0] = 1.; fAsymCuts[1] = 0.7; //fAsymCuts[2] = 0.6; // fAsymCuts[3] = 0.1;
176 for(Int_t i = fNAsymCuts; i < 10; i++)fAsymCuts[i] = 0.;
179 fCellNCuts[0] = 0; fCellNCuts[1] = 1; fCellNCuts[2] = 2;
180 for(Int_t i = fNCellNCuts; i < 10; i++)fCellNCuts[i] = 0;
183 fPIDBits[0] = 0; fPIDBits[1] = 2; // fPIDBits[2] = 4; fPIDBits[3] = 6;// check, no cut, dispersion, neutral, dispersion&&neutral
184 for(Int_t i = fNPIDBits; i < 10; i++)fPIDBits[i] = 0;
189 //_______________________________________
190 TObjString * AliAnaPi0::GetAnalysisCuts()
192 //Save parameters used for analysis
193 TString parList ; //this will be list of parameters used for this analysis.
194 const Int_t buffersize = 255;
195 char onePar[buffersize] ;
196 snprintf(onePar,buffersize,"--- AliAnaPi0 ---:") ;
198 snprintf(onePar,buffersize,"Number of bins in Centrality: %d;",GetNCentrBin()) ;
200 snprintf(onePar,buffersize,"Number of bins in Z vert. pos: %d;",GetNZvertBin()) ;
202 snprintf(onePar,buffersize,"Number of bins in Reac. Plain: %d;",GetNRPBin()) ;
204 snprintf(onePar,buffersize,"Depth of event buffer: %d;",GetNMaxEvMix()) ;
206 snprintf(onePar,buffersize,"Select pairs with their angle: %d, edep %d, min angle %2.3f, max angle %2.3f;",fUseAngleCut, fUseAngleEDepCut,fAngleCut,fAngleMaxCut) ;
208 snprintf(onePar,buffersize," Asymmetry cuts: n = %d, asymmetry < ",fNAsymCuts) ;
209 for(Int_t i = 0; i < fNAsymCuts; i++) snprintf(onePar,buffersize,"%s %2.2f;",onePar,fAsymCuts[i]);
211 snprintf(onePar,buffersize," PID selection bits: n = %d, PID bit =",fNPIDBits) ;
212 for(Int_t i = 0; i < fNPIDBits; i++) snprintf(onePar,buffersize,"%s %d;",onePar,fPIDBits[i]);
214 snprintf(onePar,buffersize,"Cuts:") ;
216 snprintf(onePar,buffersize,"Z vertex position: -%f < z < %f;",GetZvertexCut(),GetZvertexCut()) ;
218 snprintf(onePar,buffersize,"Calorimeter: %s;",GetCalorimeterString().Data()) ;
220 snprintf(onePar,buffersize,"Number of modules: %d:",fNModules) ;
224 snprintf(onePar, buffersize," pT cuts: n = %d, pt > ",fNPtCuts) ;
225 for(Int_t i = 0; i < fNPtCuts; i++) snprintf(onePar,buffersize,"%s %2.2f;",onePar,fPtCuts[i]);
227 snprintf(onePar,buffersize, " N cell in cluster cuts: n = %d, nCell > ",fNCellNCuts) ;
228 for(Int_t i = 0; i < fNCellNCuts; i++) snprintf(onePar,buffersize,"%s %d;",onePar,fCellNCuts[i]);
232 return new TObjString(parList) ;
235 //_________________________________________
236 TList * AliAnaPi0::GetCreateOutputObjects()
238 // Create histograms to be saved in output file and
239 // store them in fOutputContainer
241 // Init the number of modules, set in the class AliCalorimeterUtils
242 fNModules = GetCaloUtils()->GetNumberOfSuperModulesUsed();
243 if(GetCalorimeter()==kPHOS && fNModules > 4) fNModules = 4;
245 //create event containers
246 fEventsList = new TList*[GetNCentrBin()*GetNZvertBin()*GetNRPBin()] ;
248 for(Int_t ic=0; ic<GetNCentrBin(); ic++)
250 for(Int_t iz=0; iz<GetNZvertBin(); iz++)
252 for(Int_t irp=0; irp<GetNRPBin(); irp++)
254 Int_t bin = GetEventMixBin(ic,iz,irp);
255 fEventsList[bin] = new TList() ;
256 fEventsList[bin]->SetOwner(kFALSE);
261 TList * outputContainer = new TList() ;
262 outputContainer->SetName(GetName());
264 fhReMod = new TH2F*[fNModules] ;
265 fhMiMod = new TH2F*[fNModules] ;
267 if(GetCalorimeter() == kPHOS)
269 fhReDiffPHOSMod = new TH2F*[fNModules] ;
270 fhMiDiffPHOSMod = new TH2F*[fNModules] ;
274 fhReSameSectorEMCALMod = new TH2F*[fNModules/2] ;
275 fhReSameSideEMCALMod = new TH2F*[fNModules-2] ;
276 fhMiSameSectorEMCALMod = new TH2F*[fNModules/2] ;
277 fhMiSameSideEMCALMod = new TH2F*[fNModules-2] ;
281 fhRe1 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
282 fhMi1 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
283 if(fFillBadDistHisto)
285 fhRe2 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
286 fhRe3 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
287 fhMi2 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
288 fhMi3 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
292 fhReInvPt1 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
293 fhMiInvPt1 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
294 if(fFillBadDistHisto){
295 fhReInvPt2 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
296 fhReInvPt3 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
297 fhMiInvPt2 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
298 fhMiInvPt3 = new TH2F*[GetNCentrBin()*fNPIDBits*fNAsymCuts] ;
302 const Int_t buffersize = 255;
303 char key[buffersize] ;
304 char title[buffersize] ;
306 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins();
307 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins();
308 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins();
309 Float_t ptmax = GetHistogramRanges()->GetHistoPtMax();
310 Float_t phimax = GetHistogramRanges()->GetHistoPhiMax();
311 Float_t etamax = GetHistogramRanges()->GetHistoEtaMax();
312 Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
313 Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
314 Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
316 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins();
317 Int_t nasymbins = GetHistogramRanges()->GetHistoAsymmetryBins();
318 Float_t massmax = GetHistogramRanges()->GetHistoMassMax();
319 Float_t asymmax = GetHistogramRanges()->GetHistoAsymmetryMax();
320 Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
321 Float_t asymmin = GetHistogramRanges()->GetHistoAsymmetryMin();
322 Int_t ntrmbins = GetHistogramRanges()->GetHistoTrackMultiplicityBins();
323 Int_t ntrmmax = GetHistogramRanges()->GetHistoTrackMultiplicityMax();
324 Int_t ntrmmin = GetHistogramRanges()->GetHistoTrackMultiplicityMin();
325 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ;
326 Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax();
327 Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
331 fhReConv = new TH2F("hReConv","Real Pair with one recombined conversion ",nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
332 fhReConv->SetXTitle("#it{p}_{T} (GeV/#it{c})");
333 fhReConv->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
334 outputContainer->Add(fhReConv) ;
336 fhReConv2 = new TH2F("hReConv2","Real Pair with 2 recombined conversion ",nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
337 fhReConv2->SetXTitle("#it{p}_{T} (GeV/#it{c})");
338 fhReConv2->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
339 outputContainer->Add(fhReConv2) ;
343 fhMiConv = new TH2F("hMiConv","Mixed Pair with one recombined conversion ",nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
344 fhMiConv->SetXTitle("#it{p}_{T} (GeV/#it{c})");
345 fhMiConv->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
346 outputContainer->Add(fhMiConv) ;
348 fhMiConv2 = new TH2F("hMiConv2","Mixed Pair with 2 recombined conversion ",nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
349 fhMiConv2->SetXTitle("#it{p}_{T} (GeV/#it{c})");
350 fhMiConv2->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
351 outputContainer->Add(fhMiConv2) ;
355 for(Int_t ic=0; ic<GetNCentrBin(); ic++)
357 for(Int_t ipid=0; ipid<fNPIDBits; ipid++)
359 for(Int_t iasym=0; iasym<fNAsymCuts; iasym++)
361 Int_t index = ((ic*fNPIDBits)+ipid)*fNAsymCuts + iasym;
362 //printf("cen %d, pid %d, asy %d, Index %d\n",ic,ipid,iasym,index);
363 //Distance to bad module 1
364 snprintf(key, buffersize,"hRe_cen%d_pidbit%d_asy%d_dist1",ic,ipid,iasym) ;
365 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 1",
366 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
367 fhRe1[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
368 fhRe1[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
369 fhRe1[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
370 //printf("name: %s\n ",fhRe1[index]->GetName());
371 outputContainer->Add(fhRe1[index]) ;
373 if(fFillBadDistHisto)
375 //Distance to bad module 2
376 snprintf(key, buffersize,"hRe_cen%d_pidbit%d_asy%d_dist2",ic,ipid,iasym) ;
377 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 2",
378 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
379 fhRe2[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
380 fhRe2[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
381 fhRe2[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
382 outputContainer->Add(fhRe2[index]) ;
384 //Distance to bad module 3
385 snprintf(key, buffersize,"hRe_cen%d_pidbit%d_asy%d_dist3",ic,ipid,iasym) ;
386 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 3",
387 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
388 fhRe3[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
389 fhRe3[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
390 fhRe3[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
391 outputContainer->Add(fhRe3[index]) ;
397 //Distance to bad module 1
398 snprintf(key, buffersize,"hReInvPt_cen%d_pidbit%d_asy%d_dist1",ic,ipid,iasym) ;
399 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 1",
400 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
401 fhReInvPt1[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
402 fhReInvPt1[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
403 fhReInvPt1[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
404 outputContainer->Add(fhReInvPt1[index]) ;
406 if(fFillBadDistHisto){
407 //Distance to bad module 2
408 snprintf(key, buffersize,"hReInvPt_cen%d_pidbit%d_asy%d_dist2",ic,ipid,iasym) ;
409 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 2",
410 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
411 fhReInvPt2[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
412 fhReInvPt2[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
413 fhReInvPt2[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
414 outputContainer->Add(fhReInvPt2[index]) ;
416 //Distance to bad module 3
417 snprintf(key, buffersize,"hReInvPt_cen%d_pidbit%d_asy%d_dist3",ic,ipid,iasym) ;
418 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 3",
419 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
420 fhReInvPt3[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
421 fhReInvPt3[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
422 fhReInvPt3[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
423 outputContainer->Add(fhReInvPt3[index]) ;
429 //Distance to bad module 1
430 snprintf(key, buffersize,"hMi_cen%d_pidbit%d_asy%d_dist1",ic,ipid,iasym) ;
431 snprintf(title, buffersize,"Mixed #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 1",
432 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
433 fhMi1[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
434 fhMi1[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
435 fhMi1[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
436 outputContainer->Add(fhMi1[index]) ;
437 if(fFillBadDistHisto){
438 //Distance to bad module 2
439 snprintf(key, buffersize,"hMi_cen%d_pidbit%d_asy%d_dist2",ic,ipid,iasym) ;
440 snprintf(title, buffersize,"Mixed #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 2",
441 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
442 fhMi2[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
443 fhMi2[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
444 fhMi2[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
445 outputContainer->Add(fhMi2[index]) ;
447 //Distance to bad module 3
448 snprintf(key, buffersize,"hMi_cen%d_pidbit%d_asy%d_dist3",ic,ipid,iasym) ;
449 snprintf(title, buffersize,"Mixed #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 3",
450 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
451 fhMi3[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
452 fhMi3[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
453 fhMi3[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
454 outputContainer->Add(fhMi3[index]) ;
460 //Distance to bad module 1
461 snprintf(key, buffersize,"hMiInvPt_cen%d_pidbit%d_asy%d_dist1",ic,ipid,iasym) ;
462 snprintf(title, buffersize,"Mixed #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 1",
463 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
464 fhMiInvPt1[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
465 fhMiInvPt1[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
466 fhMiInvPt1[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
467 outputContainer->Add(fhMiInvPt1[index]) ;
468 if(fFillBadDistHisto){
469 //Distance to bad module 2
470 snprintf(key, buffersize,"hMiInvPt_cen%d_pidbit%d_asy%d_dist2",ic,ipid,iasym) ;
471 snprintf(title, buffersize,"Mixed #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f, dist bad 2",
472 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
473 fhMiInvPt2[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
474 fhMiInvPt2[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
475 fhMiInvPt2[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
476 outputContainer->Add(fhMiInvPt2[index]) ;
478 //Distance to bad module 3
479 snprintf(key, buffersize,"hMiInvPt_cen%d_pidbit%d_asy%d_dist3",ic,ipid,iasym) ;
480 snprintf(title, buffersize,"Mixed #it{M}_{#gamma#gamma} distr. for centrality=%d, PID bit=%d and asymmetry %1.2f,dist bad 3",
481 ic,fPIDBits[ipid], fAsymCuts[iasym]) ;
482 fhMiInvPt3[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
483 fhMiInvPt3[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
484 fhMiInvPt3[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
485 outputContainer->Add(fhMiInvPt3[index]) ;
493 fhEPairDiffTime = new TH2F("hEPairDiffTime","cluster pair time difference vs #it{p}_{T}",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
494 fhEPairDiffTime->SetXTitle("#it{p}_{T,pair} (GeV/#it{c})");
495 fhEPairDiffTime->SetYTitle("#Delta t (ns)");
496 outputContainer->Add(fhEPairDiffTime);
498 if(fFillAsymmetryHisto)
500 fhRePtAsym = new TH2F("hRePtAsym","#it{Asymmetry} vs #it{p}_{T} , for pairs",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax) ;
501 fhRePtAsym->SetXTitle("#it{p}_{T} (GeV/#it{c})");
502 fhRePtAsym->SetYTitle("#it{Asymmetry}");
503 outputContainer->Add(fhRePtAsym);
505 fhRePtAsymPi0 = new TH2F("hRePtAsymPi0","#it{Asymmetry} vs #it{p}_{T} , for pairs close to #pi^{0} mass",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax) ;
506 fhRePtAsymPi0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
507 fhRePtAsymPi0->SetYTitle("Asymmetry");
508 outputContainer->Add(fhRePtAsymPi0);
510 fhRePtAsymEta = new TH2F("hRePtAsymEta","#it{Asymmetry} vs #it{p}_{T} , for pairs close to #eta mass",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax) ;
511 fhRePtAsymEta->SetXTitle("#it{p}_{T} (GeV/#it{c})");
512 fhRePtAsymEta->SetYTitle("#it{Asymmetry}");
513 outputContainer->Add(fhRePtAsymEta);
518 fhRePIDBits = new TH2F*[fNPIDBits];
519 for(Int_t ipid=0; ipid<fNPIDBits; ipid++){
520 snprintf(key, buffersize,"hRe_pidbit%d",ipid) ;
521 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for PIDBit=%d",fPIDBits[ipid]) ;
522 fhRePIDBits[ipid] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
523 fhRePIDBits[ipid]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
524 fhRePIDBits[ipid]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
525 outputContainer->Add(fhRePIDBits[ipid]) ;
528 fhRePtNCellAsymCuts = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
529 fhMiPtNCellAsymCuts = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
531 if(fFillSMCombinations)
532 for(Int_t iSM = 0; iSM < fNModules; iSM++) fhRePtNCellAsymCutsSM[iSM] = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
535 for(Int_t ipt=0; ipt<fNPtCuts; ipt++)
537 for(Int_t icell=0; icell<fNCellNCuts; icell++)
539 for(Int_t iasym=0; iasym<fNAsymCuts; iasym++)
541 snprintf(key, buffersize,"hRe_pt%d_cell%d_asym%d",ipt,icell,iasym) ;
542 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for pt >%2.2f, ncell>%d and asym >%1.2f ",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]) ;
543 Int_t index = ((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym;
544 //printf("ipt %d, icell %d, iassym %d, index %d\n",ipt, icell, iasym, index);
545 fhRePtNCellAsymCuts[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
546 fhRePtNCellAsymCuts[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
547 fhRePtNCellAsymCuts[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
548 outputContainer->Add(fhRePtNCellAsymCuts[index]) ;
550 snprintf(key, buffersize,"hMi_pt%d_cell%d_asym%d",ipt,icell,iasym) ;
551 snprintf(title, buffersize,"Mixed #it{M}_{#gamma#gamma} distr. for pt >%2.2f, ncell>%d and asym >%1.2f",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]) ;
552 fhMiPtNCellAsymCuts[index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
553 fhMiPtNCellAsymCuts[index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
554 fhMiPtNCellAsymCuts[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
555 outputContainer->Add(fhMiPtNCellAsymCuts[index]) ;
557 if(fFillSMCombinations)
559 for(Int_t iSM = 0; iSM < fNModules; iSM++)
561 snprintf(key, buffersize,"hRe_pt%d_cell%d_asym%d_SM%d",ipt,icell,iasym,iSM) ;
562 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for pt >%2.2f, ncell>%d and asym >%1.2f, SM %d ",
563 fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym],iSM) ;
564 fhRePtNCellAsymCutsSM[iSM][index] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
565 fhRePtNCellAsymCutsSM[iSM][index]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
566 fhRePtNCellAsymCutsSM[iSM][index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
567 outputContainer->Add(fhRePtNCellAsymCutsSM[iSM][index]) ;
577 fhRePtMult = new TH3F*[fNAsymCuts] ;
578 for(Int_t iasym = 0; iasym<fNAsymCuts; iasym++)
580 fhRePtMult[iasym] = new TH3F(Form("hRePtMult_asym%d",iasym),Form("(#it{p}_{T},C,M)_{#gamma#gamma}, A<%1.2f",fAsymCuts[iasym]),
581 nptbins,ptmin,ptmax,ntrmbins,ntrmmin,ntrmmax,nmassbins,massmin,massmax);
582 fhRePtMult[iasym]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
583 fhRePtMult[iasym]->SetYTitle("Track multiplicity");
584 fhRePtMult[iasym]->SetZTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
585 outputContainer->Add(fhRePtMult[iasym]) ;
588 }// multi cuts analysis
590 if(fFillSSCombinations)
593 fhReSS[0] = new TH2F("hRe_SS_Tight"," 0.01 < #lambda_{0}^{2} < 0.4",
594 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
595 fhReSS[0]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
596 fhReSS[0]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
597 outputContainer->Add(fhReSS[0]) ;
600 fhReSS[1] = new TH2F("hRe_SS_Loose"," #lambda_{0}^{2} > 0.4",
601 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
602 fhReSS[1]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
603 fhReSS[1]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
604 outputContainer->Add(fhReSS[1]) ;
607 fhReSS[2] = new TH2F("hRe_SS_Both"," cluster_{1} #lambda_{0}^{2} > 0.4; cluster_{2} 0.01 < #lambda_{0}^{2} < 0.4",
608 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
609 fhReSS[2]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
610 fhReSS[2]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
611 outputContainer->Add(fhReSS[2]) ;
616 fhEventBin=new TH1I("hEventBin","Number of real pairs per bin(cen,vz,rp)",
617 GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1,0,
618 GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1) ;
619 fhEventBin->SetXTitle("bin");
620 outputContainer->Add(fhEventBin) ;
623 fhEventMixBin=new TH1I("hEventMixBin","Number of mixed pairs per bin(cen,vz,rp)",
624 GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1,0,
625 GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1) ;
626 fhEventMixBin->SetXTitle("bin");
627 outputContainer->Add(fhEventMixBin) ;
632 fhCentrality=new TH1F("hCentralityBin","Number of events in centrality bin",GetNCentrBin(),0.,1.*GetNCentrBin()) ;
633 fhCentrality->SetXTitle("Centrality bin");
634 outputContainer->Add(fhCentrality) ;
636 fhCentralityNoPair=new TH1F("hCentralityBinNoPair","Number of events in centrality bin, with no cluster pairs",GetNCentrBin(),0.,1.*GetNCentrBin()) ;
637 fhCentralityNoPair->SetXTitle("Centrality bin");
638 outputContainer->Add(fhCentralityNoPair) ;
641 if(GetNRPBin() > 1 && GetNCentrBin()>1 )
643 fhEventPlaneResolution=new TH2F("hEventPlaneResolution","Event plane resolution",GetNCentrBin(),0,GetNCentrBin(),100,0.,TMath::TwoPi()) ;
644 fhEventPlaneResolution->SetYTitle("Resolution");
645 fhEventPlaneResolution->SetXTitle("Centrality Bin");
646 outputContainer->Add(fhEventPlaneResolution) ;
651 fhRealOpeningAngle = new TH2F
652 ("hRealOpeningAngle","Angle between all #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,300,0,TMath::Pi());
653 fhRealOpeningAngle->SetYTitle("#theta(rad)");
654 fhRealOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
655 outputContainer->Add(fhRealOpeningAngle) ;
657 fhRealCosOpeningAngle = new TH2F
658 ("hRealCosOpeningAngle","Cosinus of angle between all #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,100,0,1);
659 fhRealCosOpeningAngle->SetYTitle("cos (#theta) ");
660 fhRealCosOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
661 outputContainer->Add(fhRealCosOpeningAngle) ;
665 fhMixedOpeningAngle = new TH2F
666 ("hMixedOpeningAngle","Angle between all #gamma pair vs E_{#pi^{0}}, Mixed pairs",nptbins,ptmin,ptmax,300,0,TMath::Pi());
667 fhMixedOpeningAngle->SetYTitle("#theta(rad)");
668 fhMixedOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
669 outputContainer->Add(fhMixedOpeningAngle) ;
671 fhMixedCosOpeningAngle = new TH2F
672 ("hMixedCosOpeningAngle","Cosinus of angle between all #gamma pair vs E_{#pi^{0}}, Mixed pairs",nptbins,ptmin,ptmax,100,0,1);
673 fhMixedCosOpeningAngle->SetYTitle("cos (#theta) ");
674 fhMixedCosOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
675 outputContainer->Add(fhMixedCosOpeningAngle) ;
680 //Histograms filled only if MC data is requested
683 fhReMCFromConversion = new TH2F("hReMCFromConversion","Invariant mass of 2 clusters originated in conversions",
684 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
685 fhReMCFromConversion->SetXTitle("#it{p}_{T} (GeV/#it{c})");
686 fhReMCFromConversion->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
687 outputContainer->Add(fhReMCFromConversion) ;
689 fhReMCFromNotConversion = new TH2F("hReMCNotFromConversion","Invariant mass of 2 clusters not originated in conversions",
690 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
691 fhReMCFromNotConversion->SetXTitle("#it{p}_{T} (GeV/#it{c})");
692 fhReMCFromNotConversion->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
693 outputContainer->Add(fhReMCFromNotConversion) ;
695 fhReMCFromMixConversion = new TH2F("hReMCFromMixConversion","Invariant mass of 2 clusters one from conversion and the other not",
696 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
697 fhReMCFromMixConversion->SetXTitle("#it{p}_{T} (GeV/#it{c})");
698 fhReMCFromMixConversion->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
699 outputContainer->Add(fhReMCFromMixConversion) ;
703 fhPrimPi0E = new TH1F("hPrimPi0E","Primary #pi^{0} E, |#it{Y}|<1",nptbins,ptmin,ptmax) ;
704 fhPrimPi0AccE = new TH1F("hPrimPi0AccE","Primary #pi^{0} #it{E} with both photons in acceptance",nptbins,ptmin,ptmax) ;
705 fhPrimPi0E ->SetXTitle("#it{E} (GeV)");
706 fhPrimPi0AccE->SetXTitle("#it{E} (GeV)");
707 outputContainer->Add(fhPrimPi0E) ;
708 outputContainer->Add(fhPrimPi0AccE) ;
710 fhPrimPi0Pt = new TH1F("hPrimPi0Pt","Primary #pi^{0} #it{p}_{T} , |#it{Y}|<1",nptbins,ptmin,ptmax) ;
711 fhPrimPi0AccPt = new TH1F("hPrimPi0AccPt","Primary #pi^{0} #it{p}_{T} with both photons in acceptance",nptbins,ptmin,ptmax) ;
712 fhPrimPi0Pt ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
713 fhPrimPi0AccPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
714 outputContainer->Add(fhPrimPi0Pt) ;
715 outputContainer->Add(fhPrimPi0AccPt) ;
717 Int_t netabinsopen = TMath::Nint(netabins*4/(etamax-etamin));
718 fhPrimPi0Y = new TH2F("hPrimPi0Rapidity","Rapidity of primary #pi^{0}",nptbins,ptmin,ptmax,netabinsopen,-2, 2) ;
719 fhPrimPi0Y ->SetYTitle("#it{Rapidity}");
720 fhPrimPi0Y ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
721 outputContainer->Add(fhPrimPi0Y) ;
723 fhPrimPi0Yeta = new TH2F("hPrimPi0PseudoRapidity","PseudoRapidity of primary #pi^{0}",nptbins,ptmin,ptmax,netabinsopen,-2, 2) ;
724 fhPrimPi0Yeta ->SetYTitle("#eta");
725 fhPrimPi0Yeta ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
726 outputContainer->Add(fhPrimPi0Yeta) ;
728 fhPrimPi0YetaYcut = new TH2F("hPrimPi0PseudoRapidityYcut","PseudoRapidity of primary #pi^{0}, |#it{Y}|<1",nptbins,ptmin,ptmax,netabinsopen,-2, 2) ;
729 fhPrimPi0YetaYcut ->SetYTitle("#eta");
730 fhPrimPi0YetaYcut ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
731 outputContainer->Add(fhPrimPi0YetaYcut) ;
733 fhPrimPi0AccY = new TH2F("hPrimPi0AccRapidity","Rapidity of primary #pi^{0} with accepted daughters",nptbins,ptmin,ptmax,netabins,etamin,etamax) ;
734 fhPrimPi0AccY->SetYTitle("Rapidity");
735 fhPrimPi0AccY->SetXTitle("#it{p}_{T} (GeV/#it{c})");
736 outputContainer->Add(fhPrimPi0AccY) ;
738 fhPrimPi0AccYeta = new TH2F("hPrimPi0AccPseudoRapidity","PseudoRapidity of primary #pi^{0} with accepted daughters",nptbins,ptmin,ptmax,netabins,etamin,etamax) ;
739 fhPrimPi0AccYeta ->SetYTitle("#eta");
740 fhPrimPi0AccYeta ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
741 outputContainer->Add(fhPrimPi0AccYeta) ;
743 Int_t nphibinsopen = TMath::Nint(nphibins*TMath::TwoPi()/(phimax-phimin));
744 fhPrimPi0Phi = new TH2F("hPrimPi0Phi","#phi of primary #pi^{0}, |#it{Y}|<1",nptbins,ptmin,ptmax,nphibinsopen,0,360) ;
745 fhPrimPi0Phi->SetYTitle("#phi (deg)");
746 fhPrimPi0Phi->SetXTitle("#it{p}_{T} (GeV/#it{c})");
747 outputContainer->Add(fhPrimPi0Phi) ;
749 fhPrimPi0AccPhi = new TH2F("hPrimPi0AccPhi","#phi of primary #pi^{0} with accepted daughters",nptbins,ptmin,ptmax,
750 nphibins,phimin*TMath::RadToDeg(),phimax*TMath::RadToDeg()) ;
751 fhPrimPi0AccPhi->SetYTitle("#phi (deg)");
752 fhPrimPi0AccPhi->SetXTitle("#it{p}_{T} (GeV/#it{c})");
753 outputContainer->Add(fhPrimPi0AccPhi) ;
755 fhPrimPi0PtCentrality = new TH2F("hPrimPi0PtCentrality","Primary #pi^{0} #it{p}_{T} vs reco centrality, |#it{Y}|<1",
756 nptbins,ptmin,ptmax, 100, 0, 100) ;
757 fhPrimPi0AccPtCentrality = new TH2F("hPrimPi0AccPtCentrality","Primary #pi^{0} with both photons in acceptance #it{p}_{T} vs reco centrality",
758 nptbins,ptmin,ptmax, 100, 0, 100) ;
759 fhPrimPi0PtCentrality ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
760 fhPrimPi0AccPtCentrality->SetXTitle("#it{p}_{T} (GeV/#it{c})");
761 fhPrimPi0PtCentrality ->SetYTitle("Centrality");
762 fhPrimPi0AccPtCentrality->SetYTitle("Centrality");
763 outputContainer->Add(fhPrimPi0PtCentrality) ;
764 outputContainer->Add(fhPrimPi0AccPtCentrality) ;
766 fhPrimPi0PtEventPlane = new TH2F("hPrimPi0PtEventPlane","Primary #pi^{0} #it{p}_{T} vs reco event plane angle, |#it{Y}|<1",
767 nptbins,ptmin,ptmax, 100, 0, TMath::Pi()) ;
768 fhPrimPi0AccPtEventPlane = new TH2F("hPrimPi0AccPtEventPlane","Primary #pi^{0} with both photons in acceptance #it{p}_{T} vs reco event plane angle",
769 nptbins,ptmin,ptmax, 100, 0, TMath::Pi()) ;
770 fhPrimPi0PtEventPlane ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
771 fhPrimPi0AccPtEventPlane->SetXTitle("#it{p}_{T} (GeV/#it{c})");
772 fhPrimPi0PtEventPlane ->SetYTitle("Event Plane Angle (rad)");
773 fhPrimPi0AccPtEventPlane->SetYTitle("Event Plane Angle (rad)");
774 outputContainer->Add(fhPrimPi0PtEventPlane) ;
775 outputContainer->Add(fhPrimPi0AccPtEventPlane) ;
779 fhPrimEtaE = new TH1F("hPrimEtaE","Primary eta E",nptbins,ptmin,ptmax) ;
780 fhPrimEtaAccE = new TH1F("hPrimEtaAccE","Primary #eta #it{E} with both photons in acceptance",nptbins,ptmin,ptmax) ;
781 fhPrimEtaE ->SetXTitle("#it{E} (GeV)");
782 fhPrimEtaAccE->SetXTitle("#it{E} (GeV)");
783 outputContainer->Add(fhPrimEtaE) ;
784 outputContainer->Add(fhPrimEtaAccE) ;
786 fhPrimEtaPt = new TH1F("hPrimEtaPt","Primary #eta #it{p}_{T}",nptbins,ptmin,ptmax) ;
787 fhPrimEtaAccPt = new TH1F("hPrimEtaAccPt","Primary eta #it{p}_{T} with both photons in acceptance",nptbins,ptmin,ptmax) ;
788 fhPrimEtaPt ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
789 fhPrimEtaAccPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
790 outputContainer->Add(fhPrimEtaPt) ;
791 outputContainer->Add(fhPrimEtaAccPt) ;
793 fhPrimEtaY = new TH2F("hPrimEtaRapidity","Rapidity of primary #eta",nptbins,ptmin,ptmax,netabinsopen,-2, 2) ;
794 fhPrimEtaY->SetYTitle("#it{Rapidity}");
795 fhPrimEtaY->SetXTitle("#it{p}_{T} (GeV/#it{c})");
796 outputContainer->Add(fhPrimEtaY) ;
798 fhPrimEtaYeta = new TH2F("hPrimEtaPseudoRapidityEta","PseudoRapidity of primary #eta",nptbins,ptmin,ptmax,netabinsopen,-2, 2) ;
799 fhPrimEtaYeta->SetYTitle("#it{Rapidity}");
800 fhPrimEtaYeta->SetXTitle("#it{p}_{T} (GeV/#it{c})");
801 outputContainer->Add(fhPrimEtaYeta) ;
803 fhPrimEtaYetaYcut = new TH2F("hPrimEtaPseudoRapidityEtaYcut","PseudoRapidity of primary #eta, |#it{Y}|<1",nptbins,ptmin,ptmax,netabinsopen,-2, 2) ;
804 fhPrimEtaYetaYcut->SetYTitle("#it{Pseudorapidity}");
805 fhPrimEtaYetaYcut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
806 outputContainer->Add(fhPrimEtaYetaYcut) ;
808 fhPrimEtaAccY = new TH2F("hPrimEtaAccRapidity","Rapidity of primary #eta",nptbins,ptmin,ptmax, netabins,etamin,etamax) ;
809 fhPrimEtaAccY->SetYTitle("#it{Rapidity}");
810 fhPrimEtaAccY->SetXTitle("#it{p}_{T} (GeV/#it{c})");
811 outputContainer->Add(fhPrimEtaAccY) ;
813 fhPrimEtaAccYeta = new TH2F("hPrimEtaAccPseudoRapidity","PseudoRapidity of primary #eta",nptbins,ptmin,ptmax, netabins,etamin,etamax) ;
814 fhPrimEtaAccYeta->SetYTitle("#it{Pseudorapidity}");
815 fhPrimEtaAccYeta->SetXTitle("#it{p}_{T} (GeV/#it{c})");
816 outputContainer->Add(fhPrimEtaAccYeta) ;
818 fhPrimEtaPhi = new TH2F("hPrimEtaPhi","Azimuthal of primary #eta",nptbins,ptmin,ptmax, nphibins,phimin*TMath::RadToDeg(),phimax*TMath::RadToDeg()) ;
819 fhPrimEtaPhi->SetYTitle("#phi (deg)");
820 fhPrimEtaPhi->SetXTitle("#it{p}_{T} (GeV/#it{c})");
821 outputContainer->Add(fhPrimEtaPhi) ;
823 fhPrimEtaAccPhi = new TH2F("hPrimEtaAccPhi","Azimuthal of primary #eta with accepted daughters",nptbins,ptmin,ptmax, nphibins,phimin*TMath::RadToDeg(),phimax*TMath::RadToDeg()) ;
824 fhPrimEtaAccPhi->SetYTitle("#phi (deg)");
825 fhPrimEtaAccPhi->SetXTitle("#it{p}_{T} (GeV/#it{c})");
826 outputContainer->Add(fhPrimEtaAccPhi) ;
828 fhPrimEtaPtCentrality = new TH2F("hPrimEtaPtCentrality","Primary #eta #it{p}_{T} vs reco centrality, |#it{Y}|<1",nptbins,ptmin,ptmax, 100, 0, 100) ;
829 fhPrimEtaAccPtCentrality = new TH2F("hPrimEtaAccPtCentrality","Primary #eta with both photons in acceptance #it{p}_{T} vs reco centrality",nptbins,ptmin,ptmax, 100, 0, 100) ;
830 fhPrimEtaPtCentrality ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
831 fhPrimEtaAccPtCentrality->SetXTitle("#it{p}_{T} (GeV/#it{c})");
832 fhPrimEtaPtCentrality ->SetYTitle("Centrality");
833 fhPrimEtaAccPtCentrality->SetYTitle("Centrality");
834 outputContainer->Add(fhPrimEtaPtCentrality) ;
835 outputContainer->Add(fhPrimEtaAccPtCentrality) ;
837 fhPrimEtaPtEventPlane = new TH2F("hPrimEtaPtEventPlane","Primary #eta #it{p}_{T} vs reco event plane angle, |#it{Y}|<1",nptbins,ptmin,ptmax, 100, 0, TMath::Pi()) ;
838 fhPrimEtaAccPtEventPlane = new TH2F("hPrimEtaAccPtEventPlane","Primary #eta with both #gamma_{decay} in acceptance #it{p}_{T} vs reco event plane angle",nptbins,ptmin,ptmax, 100, 0, TMath::Pi()) ;
839 fhPrimEtaPtEventPlane ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
840 fhPrimEtaAccPtEventPlane->SetXTitle("#it{p}_{T} (GeV/#it{c})");
841 fhPrimEtaPtEventPlane ->SetYTitle("Event Plane Angle (rad)");
842 fhPrimEtaAccPtEventPlane->SetYTitle("Event Plane Angle (rad)");
843 outputContainer->Add(fhPrimEtaPtEventPlane) ;
844 outputContainer->Add(fhPrimEtaAccPtEventPlane) ;
848 fhPrimPi0OpeningAngle = new TH2F
849 ("hPrimPi0OpeningAngle","Angle between all primary #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,100,0,0.5);
850 fhPrimPi0OpeningAngle->SetYTitle("#theta(rad)");
851 fhPrimPi0OpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
852 outputContainer->Add(fhPrimPi0OpeningAngle) ;
854 fhPrimPi0OpeningAngleAsym = new TH2F
855 ("hPrimPi0OpeningAngleAsym","Angle between all primary #gamma pair vs #it{Asymmetry}, #it{p}_{T}>5 GeV/#it{c}",100,0,1,100,0,0.5);
856 fhPrimPi0OpeningAngleAsym->SetXTitle("|A|=| (E_{1}-E_{2}) / (E_{1}+E_{2}) |");
857 fhPrimPi0OpeningAngleAsym->SetYTitle("#theta(rad)");
858 outputContainer->Add(fhPrimPi0OpeningAngleAsym) ;
860 fhPrimPi0CosOpeningAngle = new TH2F
861 ("hPrimPi0CosOpeningAngle","Cosinus of angle between all primary #gamma pair vs E_{#pi^{0}}",nptbins,ptmin,ptmax,100,-1,1);
862 fhPrimPi0CosOpeningAngle->SetYTitle("cos (#theta) ");
863 fhPrimPi0CosOpeningAngle->SetXTitle("E_{ #pi^{0}} (GeV)");
864 outputContainer->Add(fhPrimPi0CosOpeningAngle) ;
866 fhPrimEtaOpeningAngle = new TH2F
867 ("hPrimEtaOpeningAngle","Angle between all primary #gamma pair vs E_{#eta}",nptbins,ptmin,ptmax,100,0,0.5);
868 fhPrimEtaOpeningAngle->SetYTitle("#theta(rad)");
869 fhPrimEtaOpeningAngle->SetXTitle("E_{#eta} (GeV)");
870 outputContainer->Add(fhPrimEtaOpeningAngle) ;
872 fhPrimEtaOpeningAngleAsym = new TH2F
873 ("hPrimEtaOpeningAngleAsym","Angle between all primary #gamma pair vs #it{Asymmetry}, #it{p}_{T}>5 GeV/#it{c}",100,0,1,100,0,0.5);
874 fhPrimEtaOpeningAngleAsym->SetXTitle("|#it{A}|=| (#it{E}_{1}-#it{E}_{2}) / (#it{E}_{1}+#it{E}_{2}) |");
875 fhPrimEtaOpeningAngleAsym->SetYTitle("#theta(rad)");
876 outputContainer->Add(fhPrimEtaOpeningAngleAsym) ;
879 fhPrimEtaCosOpeningAngle = new TH2F
880 ("hPrimEtaCosOpeningAngle","Cosinus of angle between all primary #gamma pair vs E_{#eta}",nptbins,ptmin,ptmax,100,-1,1);
881 fhPrimEtaCosOpeningAngle->SetYTitle("cos (#theta) ");
882 fhPrimEtaCosOpeningAngle->SetXTitle("#it{E}_{ #eta} (GeV)");
883 outputContainer->Add(fhPrimEtaCosOpeningAngle) ;
890 fhPrimPi0PtOrigin = new TH2F("hPrimPi0PtOrigin","Primary #pi^{0} #it{p}_{T} vs origin",nptbins,ptmin,ptmax,11,0,11) ;
891 fhPrimPi0PtOrigin->SetXTitle("#it{p}_{T} (GeV/#it{c})");
892 fhPrimPi0PtOrigin->SetYTitle("Origin");
893 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(1 ,"Status 21");
894 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(2 ,"Quark");
895 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(3 ,"qq Resonances ");
896 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(4 ,"Resonances");
897 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(5 ,"#rho");
898 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(6 ,"#omega");
899 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(7 ,"K");
900 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(8 ,"Other");
901 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(9 ,"#eta");
902 fhPrimPi0PtOrigin->GetYaxis()->SetBinLabel(10 ,"#eta prime");
903 outputContainer->Add(fhPrimPi0PtOrigin) ;
905 fhMCPi0PtOrigin = new TH2F("hMCPi0PtOrigin","Reconstructed pair from generated #pi^{0} #it{p}_{T} vs origin",nptbins,ptmin,ptmax,11,0,11) ;
906 fhMCPi0PtOrigin->SetXTitle("#it{p}_{T} (GeV/#it{c})");
907 fhMCPi0PtOrigin->SetYTitle("Origin");
908 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(1 ,"Status 21");
909 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(2 ,"Quark");
910 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(3 ,"qq Resonances");
911 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(4 ,"Resonances");
912 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(5 ,"#rho");
913 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(6 ,"#omega");
914 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(7 ,"K");
915 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(8 ,"Other");
916 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(9 ,"#eta");
917 fhMCPi0PtOrigin->GetYaxis()->SetBinLabel(10 ,"#eta prime");
918 outputContainer->Add(fhMCPi0PtOrigin) ;
921 fhPrimEtaPtOrigin = new TH2F("hPrimEtaPtOrigin","Primary #pi^{0} #it{p}_{T} vs origin",nptbins,ptmin,ptmax,7,0,7) ;
922 fhPrimEtaPtOrigin->SetXTitle("#it{p}_{T} (GeV/#it{c})");
923 fhPrimEtaPtOrigin->SetYTitle("Origin");
924 fhPrimEtaPtOrigin->GetYaxis()->SetBinLabel(1 ,"Status 21");
925 fhPrimEtaPtOrigin->GetYaxis()->SetBinLabel(2 ,"Quark");
926 fhPrimEtaPtOrigin->GetYaxis()->SetBinLabel(3 ,"qq Resonances");
927 fhPrimEtaPtOrigin->GetYaxis()->SetBinLabel(4 ,"Resonances");
928 fhPrimEtaPtOrigin->GetYaxis()->SetBinLabel(5 ,"Other");
929 fhPrimEtaPtOrigin->GetYaxis()->SetBinLabel(6 ,"#eta prime ");
931 outputContainer->Add(fhPrimEtaPtOrigin) ;
933 fhMCEtaPtOrigin = new TH2F("hMCEtaPtOrigin","Reconstructed pair from generated #pi^{0} #it{p}_{T} vs origin",nptbins,ptmin,ptmax,7,0,7) ;
934 fhMCEtaPtOrigin->SetXTitle("#it{p}_{T} (GeV/#it{c})");
935 fhMCEtaPtOrigin->SetYTitle("Origin");
936 fhMCEtaPtOrigin->GetYaxis()->SetBinLabel(1 ,"Status 21");
937 fhMCEtaPtOrigin->GetYaxis()->SetBinLabel(2 ,"Quark");
938 fhMCEtaPtOrigin->GetYaxis()->SetBinLabel(3 ,"qq Resonances");
939 fhMCEtaPtOrigin->GetYaxis()->SetBinLabel(4 ,"Resonances");
940 fhMCEtaPtOrigin->GetYaxis()->SetBinLabel(5 ,"Other");
941 fhMCEtaPtOrigin->GetYaxis()->SetBinLabel(6 ,"#eta prime");
943 outputContainer->Add(fhMCEtaPtOrigin) ;
945 fhMCPi0ProdVertex = new TH2F("hMCPi0ProdVertex","Selected reco pair from generated #pi^{0} #it{p}_{T} vs production vertex",
946 200,0.,20.,5000,0,500) ;
947 fhMCPi0ProdVertex->SetXTitle("#it{p}_{T} (GeV/#it{c})");
948 fhMCPi0ProdVertex->SetYTitle("#it{R} (cm)");
949 outputContainer->Add(fhMCPi0ProdVertex) ;
951 fhMCEtaProdVertex = new TH2F("hMCEtaProdVertex","Selected reco pair from generated #eta #it{p}_{T} vs production vertex",
952 200,0.,20.,5000,0,500) ;
953 fhMCEtaProdVertex->SetXTitle("#it{p}_{T} (GeV/#it{c})");
954 fhMCEtaProdVertex->SetYTitle("#it{R} (cm)");
955 outputContainer->Add(fhMCEtaProdVertex) ;
957 fhPrimPi0ProdVertex = new TH2F("hPrimPi0ProdVertex","generated #pi^{0} #it{p}_{T} vs production vertex",
958 200,0.,20.,5000,0,500) ;
959 fhPrimPi0ProdVertex->SetXTitle("#it{p}_{T} (GeV/#it{c})");
960 fhPrimPi0ProdVertex->SetYTitle("#it{R} (cm)");
961 outputContainer->Add(fhPrimPi0ProdVertex) ;
963 fhPrimEtaProdVertex = new TH2F("hPrimEtaProdVertex","generated #eta #it{p}_{T} vs production vertex",
964 200,0.,20.,5000,0,500) ;
965 fhPrimEtaProdVertex->SetXTitle("#it{p}_{T} (GeV/#it{c})");
966 fhPrimEtaProdVertex->SetYTitle("#it{R} (cm)");
967 outputContainer->Add(fhPrimEtaProdVertex) ;
969 for(Int_t i = 0; i<13; i++)
971 fhMCOrgMass[i] = new TH2F(Form("hMCOrgMass_%d",i),Form("#it{M} vs #it{p}_{T}, origin %d",i),nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
972 fhMCOrgMass[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
973 fhMCOrgMass[i]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
974 outputContainer->Add(fhMCOrgMass[i]) ;
976 fhMCOrgAsym[i]= new TH2F(Form("hMCOrgAsym_%d",i),Form("#it{Asymmetry} vs #it{p}_{T}, origin %d",i),nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax) ;
977 fhMCOrgAsym[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
978 fhMCOrgAsym[i]->SetYTitle("A");
979 outputContainer->Add(fhMCOrgAsym[i]) ;
981 fhMCOrgDeltaEta[i] = new TH2F(Form("hMCOrgDeltaEta_%d",i),Form("#Delta #eta of pair vs #it{p}_{T}, origin %d",i),nptbins,ptmin,ptmax,netabins,-1.4,1.4) ;
982 fhMCOrgDeltaEta[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
983 fhMCOrgDeltaEta[i]->SetYTitle("#Delta #eta");
984 outputContainer->Add(fhMCOrgDeltaEta[i]) ;
986 fhMCOrgDeltaPhi[i]= new TH2F(Form("hMCOrgDeltaPhi_%d",i),Form("#Delta #phi of pair vs #it{p}_{T}, origin %d",i),nptbins,ptmin,ptmax,nphibins,-0.7,0.7) ;
987 fhMCOrgDeltaPhi[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
988 fhMCOrgDeltaPhi[i]->SetYTitle("#Delta #phi (rad)");
989 outputContainer->Add(fhMCOrgDeltaPhi[i]) ;
995 fhMCPi0MassPtTrue = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
996 fhMCPi0MassPtRec = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
997 fhMCPi0PtTruePtRec = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
998 fhMCEtaMassPtRec = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
999 fhMCEtaMassPtTrue = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
1000 fhMCEtaPtTruePtRec = new TH2F*[fNPtCuts*fNAsymCuts*fNCellNCuts];
1001 for(Int_t ipt=0; ipt<fNPtCuts; ipt++){
1002 for(Int_t icell=0; icell<fNCellNCuts; icell++){
1003 for(Int_t iasym=0; iasym<fNAsymCuts; iasym++){
1004 Int_t index = ((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym;
1006 fhMCPi0MassPtRec[index] = new TH2F(Form("hMCPi0MassPtRec_pt%d_cell%d_asym%d",ipt,icell,iasym),
1007 Form("Reconstructed #it{M} vs reconstructed #it{p}_{T} of true #pi^{0} cluster pairs for #it{p}_{T} >%2.2f, #it{N}^{cluster}_{cell}>%d and |#it{A}|>%1.2f",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]),
1008 nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1009 fhMCPi0MassPtRec[index]->SetXTitle("#it{p}_{T, reconstructed} (GeV/#it{c})");
1010 fhMCPi0MassPtRec[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1011 outputContainer->Add(fhMCPi0MassPtRec[index]) ;
1013 fhMCPi0MassPtTrue[index] = new TH2F(Form("hMCPi0MassPtTrue_pt%d_cell%d_asym%d",ipt,icell,iasym),
1014 Form("Reconstructed #it{M} vs generated #it{p}_{T} of true #pi^{0} cluster pairs for #it{p}_{T} >%2.2f, #it{N}^{cluster}_{cell}>%d and |#it{A}|>%1.2f",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]),
1015 nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1016 fhMCPi0MassPtTrue[index]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1017 fhMCPi0MassPtTrue[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1018 outputContainer->Add(fhMCPi0MassPtTrue[index]) ;
1020 fhMCPi0PtTruePtRec[index] = new TH2F(Form("hMCPi0PtTruePtRec_pt%d_cell%d_asym%d",ipt,icell,iasym),
1021 Form("Generated vs reconstructed #it{p}_{T} of true #pi^{0} cluster pairs, 0.01 < rec. mass < 0.17 MeV/#it{c}^{2} for #it{p}_{T} >%2.2f, #it{N}^{cluster}_{cell}>%d and |#it{A}|>%1.2f",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]),
1022 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax) ;
1023 fhMCPi0PtTruePtRec[index]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1024 fhMCPi0PtTruePtRec[index]->SetYTitle("#it{p}_{T, reconstructed} (GeV/#it{c})");
1025 outputContainer->Add(fhMCPi0PtTruePtRec[index]) ;
1027 fhMCEtaMassPtRec[index] = new TH2F(Form("hMCEtaMassPtRec_pt%d_cell%d_asym%d",ipt,icell,iasym),
1028 Form("Reconstructed #it{M} vs reconstructed #it{p}_{T} of true #eta cluster pairs for #it{p}_{T} >%2.2f, #it{N}^{cluster}_{cell}>%d and |#it{A}|>%1.2f",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]),
1029 nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1030 fhMCEtaMassPtRec[index]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1031 fhMCEtaMassPtRec[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1032 outputContainer->Add(fhMCEtaMassPtRec[index]) ;
1034 fhMCEtaMassPtTrue[index] = new TH2F(Form("hMCEtaMassPtTrue_pt%d_cell%d_asym%d",ipt,icell,iasym),
1035 Form("Reconstructed #it{M} vs generated #it{p}_{T} of true #eta cluster pairs for #it{p}_{T} >%2.2f, #it{N}^{cluster}_{cell}>%d and |#it{A}|>%1.2f",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]),
1036 nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1037 fhMCEtaMassPtTrue[index]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1038 fhMCEtaMassPtTrue[index]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1039 outputContainer->Add(fhMCEtaMassPtTrue[index]) ;
1041 fhMCEtaPtTruePtRec[index] = new TH2F(Form("hMCEtaPtTruePtRec_pt%d_cell%d_asym%d",ipt,icell,iasym),
1042 Form("Generated vs reconstructed #it{p}_{T} of true #eta cluster pairs, 0.01 < rec. mass < 0.17 MeV/#it{c}^{2} for #it{p}_{T} >%2.2f, ncell>%d and asym >%1.2f",fPtCuts[ipt],fCellNCuts[icell], fAsymCuts[iasym]),
1043 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax) ;
1044 fhMCEtaPtTruePtRec[index]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1045 fhMCEtaPtTruePtRec[index]->SetYTitle("#it{p}_{T, reconstructed} (GeV/#it{c})");
1046 outputContainer->Add(fhMCEtaPtTruePtRec[index]) ;
1053 fhMCPi0MassPtTrue = new TH2F*[1];
1054 fhMCPi0PtTruePtRec = new TH2F*[1];
1055 fhMCEtaMassPtTrue = new TH2F*[1];
1056 fhMCEtaPtTruePtRec = new TH2F*[1];
1058 fhMCPi0MassPtTrue[0] = new TH2F("hMCPi0MassPtTrue","Reconstructed Mass vs generated p_T of true #pi^{0} cluster pairs",nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1059 fhMCPi0MassPtTrue[0]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1060 fhMCPi0MassPtTrue[0]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1061 outputContainer->Add(fhMCPi0MassPtTrue[0]) ;
1063 fhMCPi0PtTruePtRec[0]= new TH2F("hMCPi0PtTruePtRec","Generated vs reconstructed p_T of true #pi^{0} cluster pairs, 0.01 < rec. mass < 0.17 MeV/#it{c}^{2}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax) ;
1064 fhMCPi0PtTruePtRec[0]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1065 fhMCPi0PtTruePtRec[0]->SetYTitle("#it{p}_{T, reconstructed} (GeV/#it{c})");
1066 outputContainer->Add(fhMCPi0PtTruePtRec[0]) ;
1068 fhMCEtaMassPtTrue[0] = new TH2F("hMCEtaMassPtTrue","Reconstructed Mass vs generated p_T of true #eta cluster pairs",nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1069 fhMCEtaMassPtTrue[0]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1070 fhMCEtaMassPtTrue[0]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1071 outputContainer->Add(fhMCEtaMassPtTrue[0]) ;
1073 fhMCEtaPtTruePtRec[0]= new TH2F("hMCEtaPtTruePtRec","Generated vs reconstructed p_T of true #eta cluster pairs, 0.01 < rec. mass < 0.17 MeV/#it{c}^{2}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax) ;
1074 fhMCEtaPtTruePtRec[0]->SetXTitle("#it{p}_{T, generated} (GeV/#it{c})");
1075 fhMCEtaPtTruePtRec[0]->SetYTitle("#it{p}_{T, reconstructed} (GeV/#it{c})");
1076 outputContainer->Add(fhMCEtaPtTruePtRec[0]) ;
1081 if(fFillSMCombinations)
1083 TString pairnamePHOS[] = {"(0-1)","(0-2)","(1-2)","(0-3)","(0-4)","(1-3)","(1-4)","(2-3)","(2-4)","(3-4)"};
1084 for(Int_t imod=0; imod<fNModules; imod++)
1086 //Module dependent invariant mass
1087 snprintf(key, buffersize,"hReMod_%d",imod) ;
1088 snprintf(title, buffersize,"Real #it{M}_{#gamma#gamma} distr. for Module %d",imod) ;
1089 fhReMod[imod] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1090 fhReMod[imod]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1091 fhReMod[imod]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1092 outputContainer->Add(fhReMod[imod]) ;
1093 if(GetCalorimeter()==kPHOS)
1095 snprintf(key, buffersize,"hReDiffPHOSMod_%d",imod) ;
1096 snprintf(title, buffersize,"Real pairs PHOS, clusters in different Modules: %s",(pairnamePHOS[imod]).Data()) ;
1097 fhReDiffPHOSMod[imod] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1098 fhReDiffPHOSMod[imod]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1099 fhReDiffPHOSMod[imod]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1100 outputContainer->Add(fhReDiffPHOSMod[imod]) ;
1104 if(imod<fNModules/2)
1106 snprintf(key, buffersize,"hReSameSectorEMCAL_%d",imod) ;
1107 snprintf(title, buffersize,"Real pairs EMCAL, clusters in same sector, SM(%d,%d)",imod*2,imod*2+1) ;
1108 fhReSameSectorEMCALMod[imod] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1109 fhReSameSectorEMCALMod[imod]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1110 fhReSameSectorEMCALMod[imod]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1111 outputContainer->Add(fhReSameSectorEMCALMod[imod]) ;
1113 if(imod<fNModules-2)
1115 snprintf(key, buffersize,"hReSameSideEMCAL_%d",imod) ;
1116 snprintf(title, buffersize,"Real pairs EMCAL, clusters in same side SM(%d,%d)",imod, imod+2) ;
1117 fhReSameSideEMCALMod[imod] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1118 fhReSameSideEMCALMod[imod]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1119 fhReSameSideEMCALMod[imod]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1120 outputContainer->Add(fhReSameSideEMCALMod[imod]) ;
1126 snprintf(key, buffersize,"hMiMod_%d",imod) ;
1127 snprintf(title, buffersize,"Mixed #it{M}_{#gamma#gamma} distr. for Module %d",imod) ;
1128 fhMiMod[imod] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1129 fhMiMod[imod]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1130 fhMiMod[imod]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1131 outputContainer->Add(fhMiMod[imod]) ;
1133 if(GetCalorimeter()==kPHOS)
1135 snprintf(key, buffersize,"hMiDiffPHOSMod_%d",imod) ;
1136 snprintf(title, buffersize,"Mixed pairs PHOS, clusters in different Modules: %s",(pairnamePHOS[imod]).Data()) ;
1137 fhMiDiffPHOSMod[imod] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1138 fhMiDiffPHOSMod[imod]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1139 fhMiDiffPHOSMod[imod]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1140 outputContainer->Add(fhMiDiffPHOSMod[imod]) ;
1144 if(imod<fNModules/2)
1146 snprintf(key, buffersize,"hMiSameSectorEMCALMod_%d",imod) ;
1147 snprintf(title, buffersize,"Mixed pairs EMCAL, clusters in same sector, SM(%d,%d)",imod*2,imod*2+1) ;
1148 fhMiSameSectorEMCALMod[imod] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1149 fhMiSameSectorEMCALMod[imod]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1150 fhMiSameSectorEMCALMod[imod]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1151 outputContainer->Add(fhMiSameSectorEMCALMod[imod]) ;
1153 if(imod<fNModules-2){
1155 snprintf(key, buffersize,"hMiSameSideEMCALMod_%d",imod) ;
1156 snprintf(title, buffersize,"Mixed pairs EMCAL, clusters in same side SM(%d,%d)",imod, imod+2) ;
1157 fhMiSameSideEMCALMod[imod] = new TH2F(key,title,nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;
1158 fhMiSameSideEMCALMod[imod]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1159 fhMiSameSideEMCALMod[imod]->SetYTitle("#it{M}_{#gamma,#gamma} (GeV/#it{c}^{2})");
1160 outputContainer->Add(fhMiSameSideEMCALMod[imod]) ;
1164 }//loop combinations
1165 } // SM combinations
1167 if(fFillArmenterosThetaStar && IsDataMC())
1169 TString ebin[] = {"8 < E < 12 GeV","12 < E < 16 GeV", "16 < E < 20 GeV", "E > 20 GeV" };
1170 Int_t narmbins = 400;
1172 Float_t armmax = 0.4;
1174 for(Int_t i = 0; i < 4; i++)
1176 fhArmPrimPi0[i] = new TH2F(Form("hArmenterosPrimPi0EBin%d",i),
1177 Form("Armenteros of primary #pi^{0}, %s",ebin[i].Data()),
1178 200, -1, 1, narmbins,armmin,armmax);
1179 fhArmPrimPi0[i]->SetYTitle("#it{p}_{T}^{Arm}");
1180 fhArmPrimPi0[i]->SetXTitle("#alpha^{Arm}");
1181 outputContainer->Add(fhArmPrimPi0[i]) ;
1183 fhArmPrimEta[i] = new TH2F(Form("hArmenterosPrimEtaEBin%d",i),
1184 Form("Armenteros of primary #eta, %s",ebin[i].Data()),
1185 200, -1, 1, narmbins,armmin,armmax);
1186 fhArmPrimEta[i]->SetYTitle("#it{p}_{T}^{Arm}");
1187 fhArmPrimEta[i]->SetXTitle("#alpha^{Arm}");
1188 outputContainer->Add(fhArmPrimEta[i]) ;
1192 // Same as asymmetry ...
1193 fhCosThStarPrimPi0 = new TH2F
1194 ("hCosThStarPrimPi0","cos(#theta *) for primary #pi^{0}",nptbins,ptmin,ptmax,200,-1,1);
1195 fhCosThStarPrimPi0->SetYTitle("cos(#theta *)");
1196 fhCosThStarPrimPi0->SetXTitle("E_{ #pi^{0}} (GeV)");
1197 outputContainer->Add(fhCosThStarPrimPi0) ;
1199 fhCosThStarPrimEta = new TH2F
1200 ("hCosThStarPrimEta","cos(#theta *) for primary #eta",nptbins,ptmin,ptmax,200,-1,1);
1201 fhCosThStarPrimEta->SetYTitle("cos(#theta *)");
1202 fhCosThStarPrimEta->SetXTitle("E_{ #eta} (GeV)");
1203 outputContainer->Add(fhCosThStarPrimEta) ;
1207 // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++){
1209 // printf("Histogram %d, name: %s\n ",i, outputContainer->At(i)->GetName());
1213 return outputContainer;
1216 //___________________________________________________
1217 void AliAnaPi0::Print(const Option_t * /*opt*/) const
1219 //Print some relevant parameters set for the analysis
1220 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1221 AliAnaCaloTrackCorrBaseClass::Print(" ");
1223 printf("Number of bins in Centrality: %d \n",GetNCentrBin()) ;
1224 printf("Number of bins in Z vert. pos: %d \n",GetNZvertBin()) ;
1225 printf("Number of bins in Reac. Plain: %d \n",GetNRPBin()) ;
1226 printf("Depth of event buffer: %d \n",GetNMaxEvMix()) ;
1227 printf("Pair in same Module: %d \n",fSameSM) ;
1228 printf("Cuts: \n") ;
1229 // printf("Z vertex position: -%2.3f < z < %2.3f \n",GetZvertexCut(),GetZvertexCut()) ; //It crashes here, why?
1230 printf("Number of modules: %d \n",fNModules) ;
1231 printf("Select pairs with their angle: %d, edep %d, min angle %2.3f, max angle %2.3f \n",fUseAngleCut, fUseAngleEDepCut, fAngleCut, fAngleMaxCut) ;
1232 printf("Asymmetry cuts: n = %d, \n",fNAsymCuts) ;
1233 printf("\tasymmetry < ");
1234 for(Int_t i = 0; i < fNAsymCuts; i++) printf("%2.2f ",fAsymCuts[i]);
1237 printf("PID selection bits: n = %d, \n",fNPIDBits) ;
1238 printf("\tPID bit = ");
1239 for(Int_t i = 0; i < fNPIDBits; i++) printf("%d ",fPIDBits[i]);
1244 printf("pT cuts: n = %d, \n",fNPtCuts) ;
1246 for(Int_t i = 0; i < fNPtCuts; i++) printf("%2.2f ",fPtCuts[i]);
1249 printf("N cell in cluster cuts: n = %d, \n",fNCellNCuts) ;
1250 printf("\tnCell > ");
1251 for(Int_t i = 0; i < fNCellNCuts; i++) printf("%d ",fCellNCuts[i]);
1255 printf("------------------------------------------------------\n") ;
1258 //________________________________________
1259 void AliAnaPi0::FillAcceptanceHistograms()
1261 //Fill acceptance histograms if MC data is available
1263 Double_t mesonY = -100 ;
1264 Double_t mesonE = -1 ;
1265 Double_t mesonPt = -1 ;
1266 Double_t mesonPhi = 100 ;
1267 Double_t mesonYeta= -1 ;
1275 Float_t cen = GetEventCentrality();
1276 Float_t ep = GetEventPlaneAngle();
1278 TParticle * primStack = 0;
1279 AliAODMCParticle * primAOD = 0;
1281 // Get the ESD MC particles container
1282 AliStack * stack = 0;
1283 if( GetReader()->ReadStack() )
1285 stack = GetMCStack();
1287 nprim = stack->GetNtrack();
1290 // Get the AOD MC particles container
1291 TClonesArray * mcparticles = 0;
1292 if( GetReader()->ReadAODMCParticles() )
1294 mcparticles = GetReader()->GetAODMCParticles();
1295 if( !mcparticles ) return;
1296 nprim = mcparticles->GetEntriesFast();
1299 for(Int_t i=0 ; i < nprim; i++)
1301 if(GetReader()->AcceptOnlyHIJINGLabels() && !GetReader()->IsHIJINGLabel(i)) continue ;
1303 if(GetReader()->ReadStack())
1305 primStack = stack->Particle(i) ;
1308 AliWarning("ESD primaries pointer not available!!");
1312 // If too small skip
1313 if( primStack->Energy() < 0.4 ) continue;
1315 pdg = primStack->GetPdgCode();
1316 nDaught = primStack->GetNDaughters();
1317 iphot1 = primStack->GetDaughter(0) ;
1318 iphot2 = primStack->GetDaughter(1) ;
1319 if(primStack->Energy() == TMath::Abs(primStack->Pz())) continue ; //Protection against floating point exception
1321 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
1322 // prim->GetName(), prim->GetPdgCode());
1325 primStack->Momentum(fPi0Mom);
1327 mesonY = 0.5*TMath::Log((primStack->Energy()+primStack->Pz())/(primStack->Energy()-primStack->Pz())) ;
1331 primAOD = (AliAODMCParticle *) mcparticles->At(i);
1334 AliWarning("AOD primaries pointer not available!!");
1338 // If too small skip
1339 if( primAOD->E() < 0.4 ) continue;
1341 pdg = primAOD->GetPdgCode();
1342 nDaught = primAOD->GetNDaughters();
1343 iphot1 = primAOD->GetFirstDaughter() ;
1344 iphot2 = primAOD->GetLastDaughter() ;
1346 if(primAOD->E() == TMath::Abs(primAOD->Pz())) continue ; //Protection against floating point exception
1349 fPi0Mom.SetPxPyPzE(primAOD->Px(),primAOD->Py(),primAOD->Pz(),primAOD->E());
1351 mesonY = 0.5*TMath::Log((primAOD->E()+primAOD->Pz())/(primAOD->E()-primAOD->Pz())) ;
1354 // Select only pi0 or eta
1355 if( pdg != 111 && pdg != 221) continue ;
1357 mesonPt = fPi0Mom.Pt () ;
1358 mesonE = fPi0Mom.E () ;
1359 mesonYeta= fPi0Mom.Eta() ;
1360 mesonPhi = fPi0Mom.Phi() ;
1361 if( mesonPhi < 0 ) mesonPhi+=TMath::TwoPi();
1362 mesonPhi *= TMath::RadToDeg();
1366 if(TMath::Abs(mesonY) < 1.0)
1368 fhPrimPi0E ->Fill(mesonE ) ;
1369 fhPrimPi0Pt ->Fill(mesonPt) ;
1370 fhPrimPi0Phi->Fill(mesonPt, mesonPhi) ;
1372 fhPrimPi0YetaYcut ->Fill(mesonPt,mesonYeta) ;
1373 fhPrimPi0PtCentrality->Fill(mesonPt,cen) ;
1374 fhPrimPi0PtEventPlane->Fill(mesonPt,ep ) ;
1377 fhPrimPi0Y ->Fill(mesonPt, mesonY) ;
1378 fhPrimPi0Yeta->Fill(mesonPt, mesonYeta) ;
1382 if(TMath::Abs(mesonY) < 1.0)
1384 fhPrimEtaE ->Fill(mesonE ) ;
1385 fhPrimEtaPt ->Fill(mesonPt) ;
1386 fhPrimEtaPhi->Fill(mesonPt, mesonPhi) ;
1388 fhPrimEtaYetaYcut ->Fill(mesonPt,mesonYeta) ;
1389 fhPrimEtaPtCentrality->Fill(mesonPt,cen) ;
1390 fhPrimEtaPtEventPlane->Fill(mesonPt,ep ) ;
1393 fhPrimEtaY ->Fill(mesonPt, mesonY) ;
1394 fhPrimEtaYeta->Fill(mesonPt, mesonYeta) ;
1398 if(fFillOriginHisto && TMath::Abs(mesonY) < 0.7)
1400 Int_t momindex = -1;
1402 Int_t momstatus = -1;
1404 if(GetReader()->ReadStack()) momindex = primStack->GetFirstMother();
1405 if(GetReader()->ReadAODMCParticles()) momindex = primAOD ->GetMother();
1407 if(momindex >= 0 && momindex < nprim)
1409 if(GetReader()->ReadStack())
1411 TParticle* mother = stack->Particle(momindex);
1412 mompdg = TMath::Abs(mother->GetPdgCode());
1413 momstatus = mother->GetStatusCode();
1417 if(GetReader()->ReadAODMCParticles())
1419 AliAODMCParticle* mother = (AliAODMCParticle*) mcparticles->At(momindex);
1420 mompdg = TMath::Abs(mother->GetPdgCode());
1421 momstatus = mother->GetStatus();
1422 momR = TMath::Sqrt(mother->Xv()*mother->Xv()+mother->Yv()*mother->Yv());
1427 if (momstatus == 21)fhPrimPi0PtOrigin->Fill(mesonPt,0.5);//parton
1428 else if(mompdg < 22 ) fhPrimPi0PtOrigin->Fill(mesonPt,1.5);//quark
1429 else if(mompdg > 2100 && mompdg < 2210) fhPrimPi0PtOrigin->Fill(mesonPt,2.5);// resonances
1430 else if(mompdg == 221) fhPrimPi0PtOrigin->Fill(mesonPt,8.5);//eta
1431 else if(mompdg == 331) fhPrimPi0PtOrigin->Fill(mesonPt,9.5);//eta prime
1432 else if(mompdg == 213) fhPrimPi0PtOrigin->Fill(mesonPt,4.5);//rho
1433 else if(mompdg == 223) fhPrimPi0PtOrigin->Fill(mesonPt,5.5);//omega
1434 else if(mompdg >= 310 && mompdg <= 323) fhPrimPi0PtOrigin->Fill(mesonPt,6.5);//k0S, k+-,k*
1435 else if(mompdg == 130) fhPrimPi0PtOrigin->Fill(mesonPt,6.5);//k0L
1436 else if(momstatus == 11 || momstatus == 12 ) fhPrimPi0PtOrigin->Fill(mesonPt,3.5);//resonances
1437 else fhPrimPi0PtOrigin->Fill(mesonPt,7.5);//other?
1439 //printf("Prim Pi0: index %d, pt %2.2f Prod vertex %3.3f, origin pdg %d, origin status %d, origin UI %d\n",
1440 // momindex, mesonPt,mother->R(),mompdg,momstatus,mother->GetUniqueID());
1442 fhPrimPi0ProdVertex->Fill(mesonPt,momR);
1447 if (momstatus == 21 ) fhPrimEtaPtOrigin->Fill(mesonPt,0.5);//parton
1448 else if(mompdg < 22 ) fhPrimEtaPtOrigin->Fill(mesonPt,1.5);//quark
1449 else if(mompdg > 2100 && mompdg < 2210) fhPrimEtaPtOrigin->Fill(mesonPt,2.5);//qq resonances
1450 else if(mompdg == 331) fhPrimEtaPtOrigin->Fill(mesonPt,5.5);//eta prime
1451 else if(momstatus == 11 || momstatus == 12 ) fhPrimEtaPtOrigin->Fill(mesonPt,3.5);//resonances
1452 else fhPrimEtaPtOrigin->Fill(mesonPt,4.5);//stable, conversions?
1453 //printf("Other Meson pdg %d, Mother %s, pdg %d, status %d\n",pdg, TDatabasePDG::Instance()->GetParticle(mompdg)->GetName(),mompdg, momstatus );
1455 fhPrimEtaProdVertex->Fill(mesonPt,momR);
1461 //Check if both photons hit Calorimeter
1462 if(nDaught != 2 ) continue; //Only interested in 2 gamma decay
1464 if(iphot1 < 0 || iphot1 >= nprim || iphot2 < 0 || iphot2 >= nprim) continue ;
1468 Bool_t inacceptance1 = kTRUE;
1469 Bool_t inacceptance2 = kTRUE;
1471 if(GetReader()->ReadStack())
1473 TParticle * phot1 = stack->Particle(iphot1) ;
1474 TParticle * phot2 = stack->Particle(iphot2) ;
1476 if(!phot1 || !phot2) continue ;
1478 pdg1 = phot1->GetPdgCode();
1479 pdg2 = phot2->GetPdgCode();
1481 phot1->Momentum(fPhotonMom1);
1482 phot2->Momentum(fPhotonMom2);
1484 // Check if photons hit the Calorimeter acceptance
1485 if(IsRealCaloAcceptanceOn())
1487 if( !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance( GetCalorimeter(), phot1 )) inacceptance1 = kFALSE ;
1488 if( !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance( GetCalorimeter(), phot2 )) inacceptance2 = kFALSE ;
1492 if(GetReader()->ReadAODMCParticles())
1494 AliAODMCParticle * phot1 = (AliAODMCParticle *) mcparticles->At(iphot1) ;
1495 AliAODMCParticle * phot2 = (AliAODMCParticle *) mcparticles->At(iphot2) ;
1497 if(!phot1 || !phot2) continue ;
1499 pdg1 = phot1->GetPdgCode();
1500 pdg2 = phot2->GetPdgCode();
1502 fPhotonMom1.SetPxPyPzE(phot1->Px(),phot1->Py(),phot1->Pz(),phot1->E());
1503 fPhotonMom2.SetPxPyPzE(phot2->Px(),phot2->Py(),phot2->Pz(),phot2->E());
1505 // Check if photons hit the Calorimeter acceptance
1506 if(IsRealCaloAcceptanceOn())
1508 if( !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance( GetCalorimeter(), phot1 )) inacceptance1 = kFALSE ;
1509 if( !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance( GetCalorimeter(), phot2 )) inacceptance2 = kFALSE ;
1513 if( pdg1 != 22 || pdg2 !=22) continue ;
1515 // Check if photons hit desired acceptance in the fidutial borders fixed in the analysis
1516 if(IsFiducialCutOn())
1518 if( inacceptance1 && !GetFiducialCut()->IsInFiducialCut(fPhotonMom1.Eta(), fPhotonMom1.Phi(), GetCalorimeter()) ) inacceptance1 = kFALSE ;
1519 if( inacceptance2 && !GetFiducialCut()->IsInFiducialCut(fPhotonMom2.Eta(), fPhotonMom2.Phi(), GetCalorimeter()) ) inacceptance2 = kFALSE ;
1522 if(fFillArmenterosThetaStar) FillArmenterosThetaStar(pdg);
1524 if(GetCalorimeter()==kEMCAL && inacceptance1 && inacceptance2 && fCheckAccInSector)
1529 Float_t photonPhi1 = fPhotonMom1.Phi();
1530 Float_t photonPhi2 = fPhotonMom2.Phi();
1532 if(photonPhi1 < 0) photonPhi1+=TMath::TwoPi();
1533 if(photonPhi2 < 0) photonPhi2+=TMath::TwoPi();
1535 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(fPhotonMom1.Eta(),photonPhi1,absID1);
1536 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(fPhotonMom2.Eta(),photonPhi2,absID2);
1538 Int_t sm1 = GetEMCALGeometry()->GetSuperModuleNumber(absID1);
1539 Int_t sm2 = GetEMCALGeometry()->GetSuperModuleNumber(absID2);
1542 Bool_t sameSector = kFALSE;
1543 for(Int_t isector = 0; isector < fNModules/2; isector++)
1546 if((sm1==j && sm2==j+1) || (sm1==j+1 && sm2==j)) sameSector = kTRUE;
1549 if(sm1!=sm2 && !sameSector)
1551 inacceptance1 = kFALSE;
1552 inacceptance2 = kFALSE;
1554 //if(sm1!=sm2)printf("sm1 %d, sm2 %d, same sector %d, in acceptance %d\n",sm1,sm2,sameSector,inacceptance);
1555 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
1556 // inacceptance = kTRUE;
1559 AliDebug(2,Form("Accepted in %s?: m (%2.2f,%2.2f,%2.2f), p1 (%2.2f,%2.2f,%2.2f), p2 (%2.2f,%2.2f,%2.2f) : in1 %d, in2 %d",
1560 GetCalorimeterString().Data(),
1561 mesonPt,mesonYeta,mesonPhi,
1562 fPhotonMom1.Pt(),fPhotonMom1.Eta(),fPhotonMom1.Phi()*TMath::RadToDeg(),
1563 fPhotonMom2.Pt(),fPhotonMom2.Eta(),fPhotonMom2.Phi()*TMath::RadToDeg(),
1564 inacceptance1, inacceptance2));
1566 if(inacceptance1 && inacceptance2)
1568 Float_t asym = TMath::Abs((fPhotonMom1.E()-fPhotonMom2.E()) / (fPhotonMom1.E()+fPhotonMom2.E()));
1569 Double_t angle = fPhotonMom1.Angle(fPhotonMom2.Vect());
1571 AliDebug(2,Form("\t ACCEPTED pdg %d: pt %2.2f, phi %2.2f, eta %2.2f",pdg,mesonPt,mesonPhi,mesonYeta));
1575 fhPrimPi0AccE ->Fill(mesonE) ;
1576 fhPrimPi0AccPt ->Fill(mesonPt) ;
1577 fhPrimPi0AccPhi ->Fill(mesonPt, mesonPhi) ;
1578 fhPrimPi0AccY ->Fill(mesonPt, mesonY) ;
1579 fhPrimPi0AccYeta->Fill(mesonPt, mesonYeta) ;
1580 fhPrimPi0AccPtCentrality->Fill(mesonPt,cen) ;
1581 fhPrimPi0AccPtEventPlane->Fill(mesonPt,ep ) ;
1585 fhPrimPi0OpeningAngle ->Fill(mesonPt,angle);
1586 if(mesonPt > 5)fhPrimPi0OpeningAngleAsym->Fill(asym,angle);
1587 fhPrimPi0CosOpeningAngle ->Fill(mesonPt,TMath::Cos(angle));
1592 fhPrimEtaAccE ->Fill(mesonE ) ;
1593 fhPrimEtaAccPt ->Fill(mesonPt) ;
1594 fhPrimEtaAccPhi ->Fill(mesonPt, mesonPhi) ;
1595 fhPrimEtaAccY ->Fill(mesonPt, mesonY) ;
1596 fhPrimEtaAccYeta->Fill(mesonPt, mesonYeta) ;
1597 fhPrimEtaAccPtCentrality->Fill(mesonPt,cen) ;
1598 fhPrimEtaAccPtEventPlane->Fill(mesonPt,ep ) ;
1602 fhPrimEtaOpeningAngle ->Fill(mesonPt,angle);
1603 if(mesonPt > 5)fhPrimEtaOpeningAngleAsym->Fill(asym,angle);
1604 fhPrimEtaCosOpeningAngle ->Fill(mesonPt,TMath::Cos(angle));
1609 }//loop on primaries
1613 //________________________________________________
1614 void AliAnaPi0::FillArmenterosThetaStar(Int_t pdg)
1616 // Fill armenteros plots
1618 // Get pTArm and AlphaArm
1619 Float_t momentumSquaredMother = fPi0Mom.P()*fPi0Mom.P();
1620 Float_t momentumDaughter1AlongMother = 0.;
1621 Float_t momentumDaughter2AlongMother = 0.;
1623 if (momentumSquaredMother > 0.)
1625 momentumDaughter1AlongMother = (fPhotonMom1.Px()*fPi0Mom.Px() + fPhotonMom1.Py()*fPi0Mom.Py()+ fPhotonMom1.Pz()*fPi0Mom.Pz()) / sqrt(momentumSquaredMother);
1626 momentumDaughter2AlongMother = (fPhotonMom2.Px()*fPi0Mom.Px() + fPhotonMom2.Py()*fPi0Mom.Py()+ fPhotonMom2.Pz()*fPi0Mom.Pz()) / sqrt(momentumSquaredMother);
1629 Float_t momentumSquaredDaughter1 = fPhotonMom1.P()*fPhotonMom1.P();
1630 Float_t ptArmSquared = momentumSquaredDaughter1 - momentumDaughter1AlongMother*momentumDaughter1AlongMother;
1633 if (ptArmSquared > 0.)
1634 pTArm = sqrt(ptArmSquared);
1636 Float_t alphaArm = 0.;
1637 if(momentumDaughter1AlongMother + momentumDaughter2AlongMother > 0)
1638 alphaArm = (momentumDaughter1AlongMother -momentumDaughter2AlongMother) / (momentumDaughter1AlongMother + momentumDaughter2AlongMother);
1640 fPhotonMom1Boost = fPhotonMom1;
1641 fPhotonMom1Boost.Boost(-fPi0Mom.BoostVector());
1642 Float_t cosThStar=TMath::Cos(fPhotonMom1Boost.Vect().Angle(fPi0Mom.Vect()));
1644 Float_t en = fPi0Mom.Energy();
1646 if(en > 8 && en <= 12) ebin = 0;
1647 if(en > 12 && en <= 16) ebin = 1;
1648 if(en > 16 && en <= 20) ebin = 2;
1649 if(en > 20) ebin = 3;
1650 if(ebin < 0 || ebin > 3) return ;
1655 fhCosThStarPrimPi0->Fill(en,cosThStar);
1656 fhArmPrimPi0[ebin]->Fill(alphaArm,pTArm);
1660 fhCosThStarPrimEta->Fill(en,cosThStar);
1661 fhArmPrimEta[ebin]->Fill(alphaArm,pTArm);
1664 // if(GetDebug() > 2 )
1666 // Float_t asym = 0;
1667 // if(fPhotonMom1.E()+fPhotonMom2.E() > 0) asym = TMath::Abs(fPhotonMom1.E()-fPhotonMom2.E())/(fPhotonMom1.E()+fPhotonMom2.E());
1669 // printf("AliAnaPi0::FillArmenterosThetaStar() - E %f, alphaArm %f, pTArm %f, cos(theta*) %f, asymmetry %1.3f\n",
1670 // en,alphaArm,pTArm,cosThStar,asym);
1674 //_______________________________________________________________________________________
1675 void AliAnaPi0::FillMCVersusRecDataHistograms(Int_t index1, Int_t index2,
1676 Float_t pt1, Float_t pt2,
1677 Int_t ncell1, Int_t ncell2,
1678 Double_t mass, Double_t pt, Double_t asym,
1679 Double_t deta, Double_t dphi)
1681 //Do some MC checks on the origin of the pair, is there any common ancestor and if there is one, who?
1682 //Adjusted for Pythia, need to see what to do for other generators.
1683 //Array of histograms ordered as follows: 0-Photon, 1-electron, 2-pi0, 3-eta, 4-a-proton, 5-a-neutron, 6-stable particles,
1684 // 7-other decays, 8-string, 9-final parton, 10-initial parton, intermediate, 11-colliding proton, 12-unrelated
1687 Int_t ancStatus = 0;
1688 Int_t ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(index1, index2,
1689 GetReader(), ancPDG, ancStatus,fPi0Mom, fProdVertex);
1691 Int_t momindex = -1;
1693 Int_t momstatus = -1;
1700 AliDebug(1,Form("Common ancestor label %d, pdg %d, name %s, status %d",
1701 ancLabel,ancPDG,TDatabasePDG::Instance()->GetParticle(ancPDG)->GetName(),ancStatus));
1707 else if(TMath::Abs(ancPDG)==11)
1711 else if(ancPDG==111)
1716 for(Int_t ipt=0; ipt<fNPtCuts; ipt++)
1718 for(Int_t icell=0; icell<fNCellNCuts; icell++)
1720 for(Int_t iasym=0; iasym<fNAsymCuts; iasym++)
1722 Int_t index = ((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym;
1723 if(pt1 > fPtCuts[ipt] && pt2 > fPtCuts[ipt] &&
1724 asym < fAsymCuts[iasym] &&
1725 ncell1 >= fCellNCuts[icell] && ncell2 >= fCellNCuts[icell])
1727 fhMCPi0MassPtRec [index]->Fill(pt,mass);
1728 fhMCPi0MassPtTrue[index]->Fill(fPi0Mom.Pt(),mass);
1729 if(mass < 0.17 && mass > 0.1) fhMCPi0PtTruePtRec[index]->Fill(fPi0Mom.Pt(),pt);
1730 }//pass the different cuts
1731 }// pid bit cut loop
1734 }//Multi cut ana sim
1737 fhMCPi0MassPtTrue[0]->Fill(fPi0Mom.Pt(),mass);
1739 if(mass < 0.17 && mass > 0.1)
1741 fhMCPi0PtTruePtRec[0]->Fill(fPi0Mom.Pt(),pt);
1743 //Int_t uniqueId = -1;
1744 if(GetReader()->ReadStack())
1746 TParticle* ancestor = GetMCStack()->Particle(ancLabel);
1747 momindex = ancestor->GetFirstMother();
1748 if(momindex < 0) return;
1749 TParticle* mother = GetMCStack()->Particle(momindex);
1750 mompdg = TMath::Abs(mother->GetPdgCode());
1751 momstatus = mother->GetStatusCode();
1752 prodR = mother->R();
1753 //uniqueId = mother->GetUniqueID();
1757 TClonesArray * mcparticles = GetReader()->GetAODMCParticles();
1758 AliAODMCParticle* ancestor = (AliAODMCParticle *) mcparticles->At(ancLabel);
1759 momindex = ancestor->GetMother();
1760 if(momindex < 0) return;
1761 AliAODMCParticle* mother = (AliAODMCParticle *) mcparticles->At(momindex);
1762 mompdg = TMath::Abs(mother->GetPdgCode());
1763 momstatus = mother->GetStatus();
1764 prodR = TMath::Sqrt(mother->Xv()*mother->Xv()+mother->Yv()*mother->Yv());
1765 //uniqueId = mother->GetUniqueID();
1768 // printf("Reco Pi0: pt %2.2f Prod vertex %3.3f, origin pdg %d, origin status %d, origin UI %d\n",
1769 // pt,prodR,mompdg,momstatus,uniqueId);
1771 fhMCPi0ProdVertex->Fill(pt,prodR);
1773 if (momstatus == 21) fhMCPi0PtOrigin->Fill(pt,0.5);//parton
1774 else if(mompdg < 22 ) fhMCPi0PtOrigin->Fill(pt,1.5);//quark
1775 else if(mompdg > 2100 && mompdg < 2210) fhMCPi0PtOrigin->Fill(pt,2.5);// resonances
1776 else if(mompdg == 221) fhMCPi0PtOrigin->Fill(pt,8.5);//eta
1777 else if(mompdg == 331) fhMCPi0PtOrigin->Fill(pt,9.5);//eta prime
1778 else if(mompdg == 213) fhMCPi0PtOrigin->Fill(pt,4.5);//rho
1779 else if(mompdg == 223) fhMCPi0PtOrigin->Fill(pt,5.5);//omega
1780 else if(mompdg >= 310 && mompdg <= 323) fhMCPi0PtOrigin->Fill(pt,6.5);//k0S, k+-,k*
1781 else if(mompdg == 130) fhMCPi0PtOrigin->Fill(pt,6.5);//k0L
1782 else if(momstatus == 11 || momstatus == 12 ) fhMCPi0PtOrigin->Fill(pt,3.5);//resonances
1783 else fhMCPi0PtOrigin->Fill(pt,7.5);//other?
1789 else if(ancPDG==221)
1794 for(Int_t ipt=0; ipt<fNPtCuts; ipt++)
1796 for(Int_t icell=0; icell<fNCellNCuts; icell++)
1798 for(Int_t iasym=0; iasym<fNAsymCuts; iasym++)
1800 Int_t index = ((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym;
1801 if(pt1 > fPtCuts[ipt] && pt2 > fPtCuts[ipt] &&
1802 asym < fAsymCuts[iasym] &&
1803 ncell1 >= fCellNCuts[icell] && ncell2 >= fCellNCuts[icell])
1805 fhMCEtaMassPtRec [index]->Fill(pt,mass);
1806 fhMCEtaMassPtTrue[index]->Fill(fPi0Mom.Pt(),mass);
1807 if(mass < 0.65 && mass > 0.45) fhMCEtaPtTruePtRec[index]->Fill(fPi0Mom.Pt(),pt);
1808 }//pass the different cuts
1809 }// pid bit cut loop
1812 } //Multi cut ana sim
1815 fhMCEtaMassPtTrue[0]->Fill(fPi0Mom.Pt(),mass);
1816 if(mass < 0.65 && mass > 0.45) fhMCEtaPtTruePtRec[0]->Fill(fPi0Mom.Pt(),pt);
1818 if(GetReader()->ReadStack())
1820 TParticle* ancestor = GetMCStack()->Particle(ancLabel);
1821 momindex = ancestor->GetFirstMother();
1822 if(momindex < 0) return;
1823 TParticle* mother = GetMCStack()->Particle(momindex);
1824 mompdg = TMath::Abs(mother->GetPdgCode());
1825 momstatus = mother->GetStatusCode();
1826 prodR = mother->R();
1830 TClonesArray * mcparticles = GetReader()->GetAODMCParticles();
1831 AliAODMCParticle* ancestor = (AliAODMCParticle *) mcparticles->At(ancLabel);
1832 momindex = ancestor->GetMother();
1833 if(momindex < 0) return;
1834 AliAODMCParticle* mother = (AliAODMCParticle *) mcparticles->At(momindex);
1835 mompdg = TMath::Abs(mother->GetPdgCode());
1836 momstatus = mother->GetStatus();
1837 prodR = TMath::Sqrt(mother->Xv()*mother->Xv()+mother->Yv()*mother->Yv());
1840 fhMCEtaProdVertex->Fill(pt,prodR);
1842 if (momstatus == 21 ) fhMCEtaPtOrigin->Fill(pt,0.5);//parton
1843 else if(mompdg < 22 ) fhMCEtaPtOrigin->Fill(pt,1.5);//quark
1844 else if(mompdg > 2100 && mompdg < 2210) fhMCEtaPtOrigin->Fill(pt,2.5);//qq resonances
1845 else if(mompdg == 331) fhMCEtaPtOrigin->Fill(pt,5.5);//eta prime
1846 else if(momstatus == 11 || momstatus == 12 ) fhMCEtaPtOrigin->Fill(pt,3.5);//resonances
1847 else fhMCEtaPtOrigin->Fill(pt,4.5);//stable, conversions?
1848 //printf("Other Meson pdg %d, Mother %s, pdg %d, status %d\n",pdg, TDatabasePDG::Instance()->GetParticle(mompdg)->GetName(),mompdg, momstatus );
1852 else if(ancPDG==-2212){//AProton
1855 else if(ancPDG==-2112){//ANeutron
1858 else if(TMath::Abs(ancPDG)==13){//muons
1861 else if (TMath::Abs(ancPDG) > 100 && ancLabel > 7)
1864 {//Stable particles, converted? not decayed resonances
1868 {//resonances and other decays, more hadron conversions?
1873 {//Partons, colliding protons, strings, intermediate corrections
1874 if(ancStatus==11 || ancStatus==12)
1875 {//String fragmentation
1878 else if (ancStatus==21){
1880 {//Colliding protons
1882 }//colliding protons
1883 else if(ancLabel < 6)
1884 {//partonic initial states interactions
1887 else if(ancLabel < 8)
1888 {//Final state partons radiations?
1892 // printf("AliAnaPi0::FillMCVersusRecDataHistograms() - Check ** Common ancestor label %d, pdg %d, name %s, status %d; \n",
1893 // ancLabel,ancPDG,TDatabasePDG::Instance()->GetParticle(ancPDG)->GetName(),ancStatus);
1897 // printf("AliAnaPi0::FillMCVersusRecDataHistograms() - Check *** Common ancestor label %d, pdg %d, name %s, status %d; \n",
1898 // ancLabel,ancPDG,TDatabasePDG::Instance()->GetParticle(ancPDG)->GetName(),ancStatus);
1900 }////Partons, colliding protons, strings, intermediate corrections
1904 //printf("Not related at all label = %d\n",ancLabel);
1905 AliDebug(1,"Common ancestor not found");
1910 if(mcIndex >= 0 && mcIndex < 13)
1912 fhMCOrgMass[mcIndex]->Fill(pt,mass);
1913 fhMCOrgAsym[mcIndex]->Fill(pt,asym);
1914 fhMCOrgDeltaEta[mcIndex]->Fill(pt,deta);
1915 fhMCOrgDeltaPhi[mcIndex]->Fill(pt,dphi);
1920 //__________________________________________
1921 void AliAnaPi0::MakeAnalysisFillHistograms()
1923 //Process one event and extract photons from AOD branch
1924 // filled with AliAnaPhoton and fill histos with invariant mass
1926 //In case of simulated data, fill acceptance histograms
1927 if(IsDataMC())FillAcceptanceHistograms();
1929 //if (GetReader()->GetEventNumber()%10000 == 0)
1930 // printf("--- Event %d ---\n",GetReader()->GetEventNumber());
1932 if(!GetInputAODBranch())
1934 AliFatal(Form("No input aod photons in AOD with name branch < %s >, STOP",GetInputAODName().Data()));
1938 //Init some variables
1939 Int_t nPhot = GetInputAODBranch()->GetEntriesFast() ;
1941 AliDebug(1,Form("Photon entries %d", nPhot));
1943 //If less than photon 2 entries in the list, skip this event
1946 AliDebug(1,Form("nPhotons %d, cent bin %d continue to next event",nPhot, GetEventCentrality()));
1948 if(GetNCentrBin() > 1) fhCentralityNoPair->Fill(GetEventCentrality() * GetNCentrBin() / GetReader()->GetCentralityOpt());
1953 Int_t ncentr = GetNCentrBin();
1954 if(GetNCentrBin()==0) ncentr = 1;
1959 Double_t vert[] = {0.0, 0.0, 0.0} ; //vertex
1960 Int_t evtIndex1 = 0 ;
1961 Int_t currentEvtIndex = -1;
1962 Int_t curCentrBin = GetEventCentralityBin();
1963 //Int_t curVzBin = GetEventVzBin();
1964 //Int_t curRPBin = GetEventRPBin();
1965 Int_t eventbin = GetEventMixBin();
1967 if(eventbin > GetNCentrBin()*GetNZvertBin()*GetNRPBin())
1969 AliWarning(Form("Mix Bin not expected: cen bin %d, z bin %d, rp bin %d, total bin %d, Event Centrality %d, z vertex %2.3f, Reaction Plane %2.3f",
1970 GetEventCentralityBin(),GetEventVzBin(), GetEventRPBin(),eventbin,GetEventCentrality(),vert[2],GetEventPlaneAngle()));
1974 //Get shower shape information of clusters
1975 // TObjArray *clusters = 0;
1976 // if (GetCalorimeter()==kEMCAL) clusters = GetEMCALClusters();
1977 // else if(GetCalorimeter()==kPHOS ) clusters = GetPHOSClusters() ;
1979 //---------------------------------
1980 //First loop on photons/clusters
1981 //---------------------------------
1982 for(Int_t i1=0; i1<nPhot-1; i1++)
1984 AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ;
1985 //printf("AliAnaPi0::MakeAnalysisFillHistograms() : cluster1 id %d/%d\n",i1,nPhot-1);
1987 // get the event index in the mixed buffer where the photon comes from
1988 // in case of mixing with analysis frame, not own mixing
1989 evtIndex1 = GetEventIndex(p1, vert) ;
1990 if ( evtIndex1 == -1 )
1992 if ( evtIndex1 == -2 )
1995 // Only effective in case of mixed event frame
1996 if(TMath::Abs(vert[2]) > GetZvertexCut()) continue ; //vertex cut
1998 if (evtIndex1 != currentEvtIndex)
2000 //Fill event bin info
2001 if(DoOwnMix()) fhEventBin->Fill(eventbin) ;
2002 if(GetNCentrBin() > 1)
2004 fhCentrality->Fill(curCentrBin);
2005 if(GetNRPBin() > 1 && GetEventPlane()) fhEventPlaneResolution->Fill(curCentrBin,TMath::Cos(2.*GetEventPlane()->GetQsubRes()));
2007 currentEvtIndex = evtIndex1 ;
2010 //printf("AliAnaPi0::MakeAnalysisFillHistograms(): Photon 1 Evt %d Vertex : %f,%f,%f\n",evtIndex1, GetVertex(evtIndex1)[0] ,GetVertex(evtIndex1)[1],GetVertex(evtIndex1)[2]);
2012 //Get the momentum of this cluster
2013 fPhotonMom1.SetPxPyPzE(p1->Px(),p1->Py(),p1->Pz(),p1->E());
2015 //Get (Super)Module number of this cluster
2016 module1 = p1->GetSModNumber();// GetModuleNumber(p1);
2018 //------------------------------------------
2019 // Recover original cluster
2020 // Int_t iclus1 = -1 ;
2021 // AliVCluster * cluster1 = FindCluster(clusters,p1->GetCaloLabel(0),iclus1);
2022 // if(!cluster1) AliWarning("Cluster1 not found!");
2024 //---------------------------------
2025 //Second loop on photons/clusters
2026 //---------------------------------
2027 for(Int_t i2=i1+1; i2<nPhot; i2++)
2029 AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i2)) ;
2030 //printf("AliAnaPi0::MakeAnalysisFillHistograms() : cluster2 i %d/%d\n",i2,nPhot);
2032 //In case of mixing frame, check we are not in the same event as the first cluster
2033 Int_t evtIndex2 = GetEventIndex(p2, vert) ;
2034 if ( evtIndex2 == -1 )
2036 if ( evtIndex2 == -2 )
2038 if (GetMixedEvent() && (evtIndex1 == evtIndex2))
2041 // //------------------------------------------
2042 // // Recover original cluster
2043 // Int_t iclus2 = -1;
2044 // AliVCluster * cluster2 = FindCluster(clusters,p2->GetCaloLabel(0),iclus2,iclus1+1);
2045 // // start new loop from iclus1+1 to gain some time
2046 // if(!cluster2) AliWarning("Cluster2 not found!");
2048 // // Get the TOF,l0 and ncells from the clusters
2049 // Float_t tof1 = -1;
2050 // Float_t l01 = -1;
2051 // Int_t ncell1 = 0;
2054 // tof1 = cluster1->GetTOF()*1e9;
2055 // l01 = cluster1->GetM02();
2056 // ncell1 = cluster1->GetNCells();
2057 // //printf("cluster1: E %2.2f (%2.2f), l0 %2.2f, tof %2.2f\n",cluster1->E(),p1->E(),l01,tof1);
2059 // //else printf("cluster1 not available: calo label %d / %d, cluster ID %d\n",
2060 // // p1->GetCaloLabel(0),(GetReader()->GetInputEvent())->GetNumberOfCaloClusters()-1,cluster1->GetID());
2062 // Float_t tof2 = -1;
2063 // Float_t l02 = -1;
2064 // Int_t ncell2 = 0;
2067 // tof2 = cluster2->GetTOF()*1e9;
2068 // l02 = cluster2->GetM02();
2069 // ncell2 = cluster2->GetNCells();
2070 // //printf("cluster2: E %2.2f (%2.2f), l0 %2.2f, tof %2.2f\n",cluster2->E(),p2->E(),l02,tof2);
2072 // //else printf("cluster2 not available: calo label %d / %d, cluster ID %d\n",
2073 // // p2->GetCaloLabel(0),(GetReader()->GetInputEvent())->GetNumberOfCaloClusters()-1,cluster2->GetID());
2075 // if(cluster1 && cluster2)
2077 // Double_t t12diff = tof1-tof2;
2078 // if(TMath::Abs(t12diff) > GetPairTimeCut()) continue;
2081 Float_t tof1 = p1->GetTime();
2082 Float_t l01 = p1->GetM02();
2083 Int_t ncell1 = p1->GetNCells();
2084 //printf("cluster1: E %2.2f, l0 %2.2f, tof %2.2f\n",p1->E(),l01,tof1);
2086 Float_t tof2 = p2->GetTime();
2087 Float_t l02 = p2->GetM02();
2088 Int_t ncell2 = p2->GetNCells();
2089 //printf("cluster2: E %2.2f, l0 %2.2f, tof %2.2f\n",p2->E(),l02,tof2);
2091 Double_t t12diff = tof1-tof2;
2092 fhEPairDiffTime->Fill((fPhotonMom1 + fPhotonMom2).Pt(),t12diff);
2093 if(TMath::Abs(t12diff) > GetPairTimeCut()) continue;
2095 //------------------------------------------
2097 //printf("AliAnaPi0::MakeAnalysisFillHistograms(): Photon 2 Evt %d Vertex : %f,%f,%f\n",evtIndex2, GetVertex(evtIndex2)[0] ,GetVertex(evtIndex2)[1],GetVertex(evtIndex2)[2]);
2099 //Get the momentum of this cluster
2100 fPhotonMom2.SetPxPyPzE(p2->Px(),p2->Py(),p2->Pz(),p2->E());
2103 module2 = p2->GetSModNumber(); //GetModuleNumber(p2);
2105 //---------------------------------
2106 // Get pair kinematics
2107 //---------------------------------
2108 Double_t m = (fPhotonMom1 + fPhotonMom2).M() ;
2109 Double_t pt = (fPhotonMom1 + fPhotonMom2).Pt();
2110 Double_t deta = fPhotonMom1.Eta() - fPhotonMom2.Eta();
2111 Double_t dphi = fPhotonMom1.Phi() - fPhotonMom2.Phi();
2112 Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ;
2114 AliDebug(2,Form("E: fPhotonMom1 %f, fPhotonMom2 %f; Pair: pT %f, mass %f, a %f", p1->E(), p2->E(), (fPhotonMom1 + fPhotonMom2).E(),m,a));
2116 //--------------------------------
2117 // Opening angle selection
2118 //--------------------------------
2119 //Check if opening angle is too large or too small compared to what is expected
2120 Double_t angle = fPhotonMom1.Angle(fPhotonMom2.Vect());
2121 if(fUseAngleEDepCut && !GetNeutralMesonSelection()->IsAngleInWindow((fPhotonMom1+fPhotonMom2).E(),angle+0.05))
2123 AliDebug(2,Form("Real pair angle %f not in E %f window",angle, (fPhotonMom1+fPhotonMom2).E()));
2127 if(fUseAngleCut && (angle < fAngleCut || angle > fAngleMaxCut))
2129 AliDebug(2,Form("Real pair cut %f < angle %f < cut %f",fAngleCut, angle, fAngleMaxCut));
2133 //-------------------------------------------------------------------------------------------------
2134 //Fill module dependent histograms, put a cut on assymmetry on the first available cut in the array
2135 //-------------------------------------------------------------------------------------------------
2136 if(a < fAsymCuts[0] && fFillSMCombinations)
2138 if(module1==module2 && module1 >=0 && module1<fNModules)
2139 fhReMod[module1]->Fill(pt,m) ;
2141 if(GetCalorimeter()==kEMCAL)
2145 for(Int_t i = 0; i < fNModules/2; i++)
2148 if((module1==j && module2==j+1) || (module1==j+1 && module2==j)) fhReSameSectorEMCALMod[i]->Fill(pt,m) ;
2152 for(Int_t i = 0; i < fNModules-2; i++){
2153 if((module1==i && module2==i+2) || (module1==i+2 && module2==i)) fhReSameSideEMCALMod[i]->Fill(pt,m);
2157 if((module1==0 && module2==1) || (module1==1 && module2==0)) fhReDiffPHOSMod[0]->Fill(pt,m) ;
2158 if((module1==0 && module2==2) || (module1==2 && module2==0)) fhReDiffPHOSMod[1]->Fill(pt,m) ;
2159 if((module1==1 && module2==2) || (module1==2 && module2==1)) fhReDiffPHOSMod[2]->Fill(pt,m) ;
2163 //In case we want only pairs in same (super) module, check their origin.
2165 if(fSameSM && module1!=module2) ok=kFALSE;
2168 //Check if one of the clusters comes from a conversion
2169 if(fCheckConversion)
2171 if (p1->IsTagged() && p2->IsTagged()) fhReConv2->Fill(pt,m);
2172 else if(p1->IsTagged() || p2->IsTagged()) fhReConv ->Fill(pt,m);
2175 // Fill shower shape cut histograms
2176 if(fFillSSCombinations)
2178 if ( l01 > 0.01 && l01 < 0.4 &&
2179 l02 > 0.01 && l02 < 0.4 ) fhReSS[0]->Fill(pt,m); // Tight
2180 else if( l01 > 0.4 && l02 > 0.4 ) fhReSS[1]->Fill(pt,m); // Loose
2181 else if( l01 > 0.01 && l01 < 0.4 && l02 > 0.4 ) fhReSS[2]->Fill(pt,m); // Both
2182 else if( l02 > 0.01 && l02 < 0.4 && l01 > 0.4 ) fhReSS[2]->Fill(pt,m); // Both
2185 //Fill histograms for different bad channel distance, centrality, assymmetry cut and pid bit
2186 for(Int_t ipid=0; ipid<fNPIDBits; ipid++)
2188 if((p1->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton)) && (p2->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton)))
2190 for(Int_t iasym=0; iasym < fNAsymCuts; iasym++)
2192 if(a < fAsymCuts[iasym])
2194 Int_t index = ((curCentrBin*fNPIDBits)+ipid)*fNAsymCuts + iasym;
2195 //printf("index %d :(cen %d * nPID %d + ipid %d)*nasym %d + iasym %d - max index %d\n",index,curCentrBin,fNPIDBits,ipid,fNAsymCuts,iasym, curCentrBin*fNPIDBits*fNAsymCuts);
2197 if(index < 0 || index >= ncentr*fNPIDBits*fNAsymCuts) continue ;
2199 fhRe1 [index]->Fill(pt,m);
2200 if(fMakeInvPtPlots)fhReInvPt1[index]->Fill(pt,m,1./pt) ;
2201 if(fFillBadDistHisto)
2203 if(p1->DistToBad()>0 && p2->DistToBad()>0)
2205 fhRe2 [index]->Fill(pt,m) ;
2206 if(fMakeInvPtPlots)fhReInvPt2[index]->Fill(pt,m,1./pt) ;
2207 if(p1->DistToBad()>1 && p2->DistToBad()>1)
2209 fhRe3 [index]->Fill(pt,m) ;
2210 if(fMakeInvPtPlots)fhReInvPt3[index]->Fill(pt,m,1./pt) ;
2213 }// Fill bad dist histos
2215 }// asymmetry cut loop
2219 //Fill histograms with opening angle
2222 fhRealOpeningAngle ->Fill(pt,angle);
2223 fhRealCosOpeningAngle->Fill(pt,TMath::Cos(angle));
2226 //Fill histograms with pair assymmetry
2227 if(fFillAsymmetryHisto)
2229 fhRePtAsym->Fill(pt,a);
2230 if(m > 0.10 && m < 0.17) fhRePtAsymPi0->Fill(pt,a);
2231 if(m > 0.45 && m < 0.65) fhRePtAsymEta->Fill(pt,a);
2237 //Do some MC checks on the origin of the pair, is there any common ancestor and if there is one, who?
2240 if(GetMCAnalysisUtils()->CheckTagBit(p1->GetTag(),AliMCAnalysisUtils::kMCConversion) &&
2241 GetMCAnalysisUtils()->CheckTagBit(p2->GetTag(),AliMCAnalysisUtils::kMCConversion))
2243 fhReMCFromConversion->Fill(pt,m);
2245 else if(!GetMCAnalysisUtils()->CheckTagBit(p1->GetTag(),AliMCAnalysisUtils::kMCConversion) &&
2246 !GetMCAnalysisUtils()->CheckTagBit(p2->GetTag(),AliMCAnalysisUtils::kMCConversion))
2248 fhReMCFromNotConversion->Fill(pt,m);
2252 fhReMCFromMixConversion->Fill(pt,m);
2255 if(fFillOriginHisto)
2256 FillMCVersusRecDataHistograms(p1->GetLabel(), p2->GetLabel(),p1->Pt(), p2->Pt(),ncell1, ncell2, m, pt, a,deta, dphi);
2259 //-----------------------
2260 //Multi cuts analysis
2261 //-----------------------
2264 //Histograms for different PID bits selection
2265 for(Int_t ipid=0; ipid<fNPIDBits; ipid++)
2267 if(p1->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton) &&
2268 p2->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton)) fhRePIDBits[ipid]->Fill(pt,m) ;
2270 //printf("ipt %d, ipid%d, name %s\n",ipt, ipid, fhRePtPIDCuts[ipt*fNPIDBitsBits+ipid]->GetName());
2271 } // pid bit cut loop
2273 //Several pt,ncell and asymmetry cuts
2274 for(Int_t ipt=0; ipt<fNPtCuts; ipt++)
2276 for(Int_t icell=0; icell<fNCellNCuts; icell++)
2278 for(Int_t iasym=0; iasym<fNAsymCuts; iasym++)
2280 Int_t index = ((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym;
2281 if(p1->E() > fPtCuts[ipt] && p2->E() > fPtCuts[ipt] &&
2282 a < fAsymCuts[iasym] &&
2283 ncell1 >= fCellNCuts[icell] && ncell2 >= fCellNCuts[icell])
2285 fhRePtNCellAsymCuts[index]->Fill(pt,m) ;
2286 //printf("ipt %d, icell%d, iasym %d, name %s\n",ipt, icell, iasym, fhRePtNCellAsymCuts[((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym]->GetName());
2287 if(fFillSMCombinations && module1==module2)
2289 fhRePtNCellAsymCutsSM[module1][index]->Fill(pt,m) ;
2292 }// pid bit cut loop
2296 if(GetHistogramRanges()->GetHistoTrackMultiplicityBins())
2298 for(Int_t iasym = 0; iasym < fNAsymCuts; iasym++)
2300 if(a < fAsymCuts[iasym]) fhRePtMult[iasym]->Fill(pt,GetTrackMultiplicity(),m) ;
2303 }// multiple cuts analysis
2307 }// second same event particle
2310 //-------------------------------------------------------------
2312 //-------------------------------------------------------------
2315 //Recover events in with same characteristics as the current event
2317 //Check that the bin exists, if not (bad determination of RP, centrality or vz bin) do nothing
2318 if(eventbin < 0) return ;
2320 TList * evMixList=fEventsList[eventbin] ;
2324 AliWarning(Form("Mix event list not available, bin %d",eventbin));
2328 Int_t nMixed = evMixList->GetSize() ;
2329 for(Int_t ii=0; ii<nMixed; ii++)
2331 TClonesArray* ev2= (TClonesArray*) (evMixList->At(ii));
2332 Int_t nPhot2=ev2->GetEntriesFast() ;
2334 AliDebug(1,Form("Mixed event %d photon entries %d, centrality bin %d",ii, nPhot2, GetEventCentralityBin()));
2336 fhEventMixBin->Fill(eventbin) ;
2338 //---------------------------------
2339 //First loop on photons/clusters
2340 //---------------------------------
2341 for(Int_t i1=0; i1<nPhot; i1++)
2343 AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ;
2345 if(fSameSM && GetModuleNumber(p1)!=module1) continue;
2347 //Get kinematics of cluster and (super) module of this cluster
2348 fPhotonMom1.SetPxPyPzE(p1->Px(),p1->Py(),p1->Pz(),p1->E());
2349 module1 = GetModuleNumber(p1);
2351 //---------------------------------
2352 //First loop on photons/clusters
2353 //---------------------------------
2354 for(Int_t i2=0; i2<nPhot2; i2++)
2356 AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (ev2->At(i2)) ;
2358 //Get kinematics of second cluster and calculate those of the pair
2359 fPhotonMom2.SetPxPyPzE(p2->Px(),p2->Py(),p2->Pz(),p2->E());
2360 m = (fPhotonMom1+fPhotonMom2).M() ;
2361 Double_t pt = (fPhotonMom1 + fPhotonMom2).Pt();
2362 Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ;
2364 //Check if opening angle is too large or too small compared to what is expected
2365 Double_t angle = fPhotonMom1.Angle(fPhotonMom2.Vect());
2366 if(fUseAngleEDepCut && !GetNeutralMesonSelection()->IsAngleInWindow((fPhotonMom1+fPhotonMom2).E(),angle+0.05))
2368 AliDebug(2,Form("Mix pair angle %f not in E %f window",angle, (fPhotonMom1+fPhotonMom2).E()));
2372 if(fUseAngleCut && (angle < fAngleCut || angle > fAngleMaxCut))
2374 AliDebug(2,Form("Mix pair angle %f < cut %f",angle,fAngleCut));
2378 AliDebug(2,Form("Mixed Event: pT: fPhotonMom1 %2.2f, fPhotonMom2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %2.3f",p1->Pt(), p2->Pt(), pt,m,a));
2380 //In case we want only pairs in same (super) module, check their origin.
2381 module2 = GetModuleNumber(p2);
2383 //-------------------------------------------------------------------------------------------------
2384 //Fill module dependent histograms, put a cut on assymmetry on the first available cut in the array
2385 //-------------------------------------------------------------------------------------------------
2386 if(a < fAsymCuts[0] && fFillSMCombinations){
2387 if(module1==module2 && module1 >=0 && module1<fNModules)
2388 fhMiMod[module1]->Fill(pt,m) ;
2390 if(GetCalorimeter()==kEMCAL)
2394 for(Int_t i = 0; i < fNModules/2; i++)
2397 if((module1==j && module2==j+1) || (module1==j+1 && module2==j)) fhMiSameSectorEMCALMod[i]->Fill(pt,m) ;
2401 for(Int_t i = 0; i < fNModules-2; i++)
2403 if((module1==i && module2==i+2) || (module1==i+2 && module2==i)) fhMiSameSideEMCALMod[i]->Fill(pt,m);
2408 if((module1==0 && module2==1) || (module1==1 && module2==0)) fhMiDiffPHOSMod[0]->Fill(pt,m) ;
2409 if((module1==0 && module2==2) || (module1==2 && module2==0)) fhMiDiffPHOSMod[1]->Fill(pt,m) ;
2410 if((module1==1 && module2==2) || (module1==2 && module2==1)) fhMiDiffPHOSMod[2]->Fill(pt,m) ;
2417 if(fSameSM && module1!=module2) ok=kFALSE;
2420 //Check if one of the clusters comes from a conversion
2421 if(fCheckConversion)
2423 if (p1->IsTagged() && p2->IsTagged()) fhMiConv2->Fill(pt,m);
2424 else if(p1->IsTagged() || p2->IsTagged()) fhMiConv ->Fill(pt,m);
2426 //Fill histograms for different bad channel distance, centrality, assymmetry cut and pid bit
2427 for(Int_t ipid=0; ipid<fNPIDBits; ipid++)
2429 if((p1->IsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton)))
2431 for(Int_t iasym=0; iasym < fNAsymCuts; iasym++)
2433 if(a < fAsymCuts[iasym])
2435 Int_t index = ((curCentrBin*fNPIDBits)+ipid)*fNAsymCuts + iasym;
2437 if(index < 0 || index >= ncentr*fNPIDBits*fNAsymCuts) continue ;
2439 fhMi1 [index]->Fill(pt,m) ;
2441 if(fMakeInvPtPlots)fhMiInvPt1[index]->Fill(pt,m,1./pt) ;
2443 if(fFillBadDistHisto)
2445 if(p1->DistToBad()>0 && p2->DistToBad()>0)
2447 fhMi2 [index]->Fill(pt,m) ;
2448 if(fMakeInvPtPlots)fhMiInvPt2[index]->Fill(pt,m,1./pt) ;
2449 if(p1->DistToBad()>1 && p2->DistToBad()>1)
2451 fhMi3 [index]->Fill(pt,m) ;
2452 if(fMakeInvPtPlots)fhMiInvPt3[index]->Fill(pt,m,1./pt) ;
2455 }// Fill bad dist histo
2459 }//loop for histograms
2461 //-----------------------
2462 //Multi cuts analysis
2463 //-----------------------
2465 //Several pt,ncell and asymmetry cuts
2467 for(Int_t ipt=0; ipt<fNPtCuts; ipt++)
2469 for(Int_t icell=0; icell<fNCellNCuts; icell++)
2471 for(Int_t iasym=0; iasym<fNAsymCuts; iasym++)
2473 Int_t index = ((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym;
2474 if(p1->Pt() > fPtCuts[ipt] && p2->Pt() > fPtCuts[ipt] &&
2475 a < fAsymCuts[iasym] //&&
2476 //p1->GetBtag() >= fCellNCuts[icell] && p2->GetBtag() >= fCellNCuts[icell] // trick, correct it.
2479 fhMiPtNCellAsymCuts[index]->Fill(pt,m) ;
2480 //printf("ipt %d, icell%d, iasym %d, name %s\n",ipt, icell, iasym, fhRePtNCellAsymCuts[((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym]->GetName());
2482 }// pid bit cut loop
2487 //Fill histograms with opening angle
2490 fhMixedOpeningAngle ->Fill(pt,angle);
2491 fhMixedCosOpeningAngle->Fill(pt,TMath::Cos(angle));
2495 }// second cluster loop
2496 }//first cluster loop
2497 }//loop on mixed events
2499 //--------------------------------------------------------
2500 // Add the current event to the list of events for mixing
2501 //--------------------------------------------------------
2503 TClonesArray *currentEvent = new TClonesArray(*GetInputAODBranch());
2504 //Add current event to buffer and Remove redundant events
2505 if( currentEvent->GetEntriesFast() > 0 )
2507 evMixList->AddFirst(currentEvent) ;
2508 currentEvent=0 ; //Now list of particles belongs to buffer and it will be deleted with buffer
2509 if( evMixList->GetSize() >= GetNMaxEvMix() )
2511 TClonesArray * tmp = (TClonesArray*) (evMixList->Last()) ;
2512 evMixList->RemoveLast() ;
2518 delete currentEvent ;
2523 AliDebug(1,"End fill histograms");
2526 //________________________________________________________________________
2527 Int_t AliAnaPi0::GetEventIndex(AliAODPWG4Particle * part, Double_t * vert)
2529 // retieves the event index and checks the vertex
2530 // in the mixed buffer returns -2 if vertex NOK
2531 // for normal events returns 0 if vertex OK and -1 if vertex NOK
2533 Int_t evtIndex = -1 ;
2534 if(GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
2536 if (GetMixedEvent())
2538 evtIndex = GetMixedEvent()->EventIndexForCaloCluster(part->GetCaloLabel(0)) ;
2539 GetVertex(vert,evtIndex);
2541 if(TMath::Abs(vert[2])> GetZvertexCut())
2542 evtIndex = -2 ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
2549 if(TMath::Abs(vert[2])> GetZvertexCut())
2550 evtIndex = -1 ; //Event can not be used (vertex, centrality,... cuts not fulfilled)