1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 //_________________________________________________________________________
18 // Class to check results from simulations or reconstructed real data.
19 // Fill few histograms and do some checking plots
21 //-- Author: Gustavo Conesa (INFN-LNF)
22 //_________________________________________________________________________
25 // --- ROOT system ---
26 //#include "Riostream.h"
27 #include "TObjArray.h"
28 #include "TParticle.h"
29 #include "TDatabasePDG.h"
37 #include <TObjString.h>
39 //---- AliRoot system ----
40 #include "AliAnaCalorimeterQA.h"
41 #include "AliCaloTrackReader.h"
43 #include "AliVCaloCells.h"
44 #include "AliFiducialCut.h"
45 #include "AliVTrack.h"
46 #include "AliVCluster.h"
47 #include "AliVEvent.h"
48 #include "AliVEventHandler.h"
49 #include "AliAnalysisManager.h"
50 #include "AliAODMCParticle.h"
51 #include "AliMCAnalysisUtils.h"
52 #include "AliAODPid.h"
53 #include "AliExternalTrackParam.h"
55 ClassImp(AliAnaCalorimeterQA)
57 //____________________________________________________________________________
58 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
59 AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""),
60 fMakePlots(kFALSE), fFillAllPosHisto(kFALSE), fFillAllTH12(kFALSE),
61 fCorrelateCalos(kFALSE), fNModules(12), fNRCU(2),
62 fTimeCutMin(-1), fTimeCutMax(9999999),
63 fEMCALCellAmpMin(0),fPHOSCellAmpMin(0),
64 fHistoFinePtBins(1000), fHistoFinePtMax(5.), fHistoFinePtMin(0.),
65 fHistoPOverEBins(100), fHistoPOverEMax(100.), fHistoPOverEMin(0.),
66 fHistodEdxBins(100), fHistodEdxMax(100.), fHistodEdxMin(0.),
67 fHistodRBins(100), fHistodRMax(100.), fHistodRMin(0.),
68 fHistoTimeBins(100), fHistoTimeMax(100.), fHistoTimeMin(0.),
69 fHistoNBins(100), fHistoNMax(100), fHistoNMin(0),
70 fHistoRatioBins(100), fHistoRatioMax(100.), fHistoRatioMin(0.),
71 fHistoVertexDistBins(100), fHistoVertexDistMax(100.), fHistoVertexDistMin(0.),
72 fHistoRBins(100), fHistoRMax(1000), fHistoRMin(-1000),
73 fHistoXBins(100), fHistoXMax(1000), fHistoXMin(-1000),
74 fHistoYBins(100), fHistoYMax(1000), fHistoYMin(-1000),
75 fHistoZBins(100), fHistoZMax(1000), fHistoZMin(-1000),
76 fHistoSSBins(25), fHistoSSMax(5), fHistoSSMin(0),
77 fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhiE(0),
78 fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiECharged(0),
79 fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
80 fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0),
81 fhLambda(0), fhDispersion(0),
82 fhIM(0), fhIMCellCut(0),fhAsym(0),
83 fhNCellsPerCluster(0),fhNCellsPerClusterMIP(0), fhNCellsPerClusterMIPCharged(0), fhNClusters(0),
84 fhClusterTimeEnergy(0),fhCellTimeSpreadRespectToCellMax(0),fhCellIdCellLargeTimeSpread(0),
85 fhRNCells(0),fhXNCells(0),fhYNCells(0),fhZNCells(0),
86 fhRE(0), fhXE(0), fhYE(0), fhZE(0), fhXYZ(0),
87 fhRCellE(0), fhXCellE(0), fhYCellE(0), fhZCellE(0),fhXYZCell(0),
88 fhDeltaCellClusterRNCells(0),fhDeltaCellClusterXNCells(0),fhDeltaCellClusterYNCells(0),fhDeltaCellClusterZNCells(0),
89 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0), fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
90 fhNCells(0), fhAmplitude(0), fhAmpId(0), fhEtaPhiAmp(0),
91 fhTime(0), fhTimeId(0), fhTimeAmp(0), //fhT0Time(0), fhT0TimeId(0), fhT0TimeAmp(0),
92 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
93 fhEMod(0), fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),
94 fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0),
95 fhAmplitudeMod(0), fhAmplitudeModFraction(0),fhTimeAmpPerRCU(0), //fhT0TimeAmpPerRCU(0), fhTimeCorrRCU(0),
96 fhIMMod(0), fhIMCellCutMod(0),
97 fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
98 fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
99 fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
100 fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
101 fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0),
102 fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
103 fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
104 fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0),
105 fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
106 fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
107 fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
108 fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
109 fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
110 fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
111 fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
112 fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
113 fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
114 fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
115 fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
116 fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
117 fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
121 //Initialize parameters
125 //________________________________________________________________________
126 TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
128 //Save parameters used for analysis
129 TString parList ; //this will be list of parameters used for this analysis.
130 const Int_t buffersize = 255;
131 char onePar[buffersize] ;
133 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
135 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
137 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
139 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
141 //Get parameters set in base class.
142 //parList += GetBaseParametersList() ;
144 //Get parameters set in FiducialCut class (not available yet)
145 //parlist += GetFidCut()->GetFidCutParametersList()
147 return new TObjString(parList) ;
151 //________________________________________________________________________
152 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
154 // Create histograms to be saved in output file and
155 // store them in outputContainer
157 TList * outputContainer = new TList() ;
158 outputContainer->SetName("QAHistos") ;
161 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
162 Int_t nfineptbins = GetHistoFinePtBins(); Float_t ptfinemax = GetHistoFinePtMax(); Float_t ptfinemin = GetHistoFinePtMin();
163 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
164 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
165 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
166 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
167 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
168 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
169 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
170 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
171 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
172 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
173 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
174 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
175 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
176 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
177 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
178 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
185 if(fCalorimeter=="PHOS"){
192 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
193 fhE->SetXTitle("E (GeV)");
194 outputContainer->Add(fhE);
197 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
198 fhPt->SetXTitle("p_{T} (GeV/c)");
199 outputContainer->Add(fhPt);
201 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
202 fhPhi->SetXTitle("#phi (rad)");
203 outputContainer->Add(fhPhi);
205 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
206 fhEta->SetXTitle("#eta ");
207 outputContainer->Add(fhEta);
210 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
211 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
212 fhEtaPhiE->SetXTitle("#eta ");
213 fhEtaPhiE->SetYTitle("#phi (rad)");
214 fhEtaPhiE->SetZTitle("E (GeV) ");
215 outputContainer->Add(fhEtaPhiE);
217 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
218 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
219 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
220 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
221 outputContainer->Add(fhClusterTimeEnergy);
225 fhLambda = new TH3F ("hLambda","#lambda_{0}^{2} vs #lambda_{1}^{2} vs energy, reconstructed clusters",
226 ssbins,ssmin,ssmax,ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
227 fhLambda->SetXTitle("#lambda_{0}^{2} ");
228 fhLambda->SetYTitle("#lambda_{1}^{2} ");
229 fhLambda->SetZTitle("E (GeV) ");
230 outputContainer->Add(fhLambda);
232 fhDispersion = new TH2F ("hDispersion"," dispersion vs energy, reconstructed clusters",
233 ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
234 fhDispersion->SetXTitle("Dispersion ");
235 fhDispersion->SetYTitle("E (GeV) ");
236 outputContainer->Add(fhDispersion);
240 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
241 fhECharged->SetXTitle("E (GeV)");
242 outputContainer->Add(fhECharged);
244 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
245 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
246 outputContainer->Add(fhPtCharged);
248 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
249 fhPhiCharged->SetXTitle("#phi (rad)");
250 outputContainer->Add(fhPhiCharged);
252 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
253 fhEtaCharged->SetXTitle("#eta ");
254 outputContainer->Add(fhEtaCharged);
257 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
258 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
259 fhEtaPhiECharged->SetXTitle("#eta ");
260 fhEtaPhiECharged->SetYTitle("#phi ");
261 fhEtaPhiECharged->SetZTitle("E (GeV) ");
262 outputContainer->Add(fhEtaPhiECharged);
264 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
265 fh1pOverE->SetYTitle("p/E");
266 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
267 outputContainer->Add(fh1pOverE);
269 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
270 fh1dR->SetXTitle("#Delta R (rad)");
271 outputContainer->Add(fh1dR) ;
273 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
274 fh2MatchdEdx->SetXTitle("p (GeV/c)");
275 fh2MatchdEdx->SetYTitle("<dE/dx>");
276 outputContainer->Add(fh2MatchdEdx);
278 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
279 fh2EledEdx->SetXTitle("p (GeV/c)");
280 fh2EledEdx->SetYTitle("<dE/dx>");
281 outputContainer->Add(fh2EledEdx) ;
283 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
284 fh1pOverER02->SetYTitle("p/E");
285 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
286 outputContainer->Add(fh1pOverER02);
288 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
289 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
290 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
291 outputContainer->Add(fhIM);
293 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
294 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
295 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
296 outputContainer->Add(fhIMCellCut);
298 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
299 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
300 fhAsym->SetYTitle("Asymmetry");
301 outputContainer->Add(fhAsym);
304 Int_t nlargeetabins = 3;
305 if(fCalorimeter=="EMCAL") nlargeetabins = 8;
307 fhNCellsPerCluster = new TH3F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax, nlargeetabins,etamin,etamax);
308 fhNCellsPerCluster->SetXTitle("E (GeV)");
309 fhNCellsPerCluster->SetYTitle("n cells");
310 fhNCellsPerCluster->SetZTitle("#eta");
311 outputContainer->Add(fhNCellsPerCluster);
314 fhNCellsPerClusterMIP = new TH3F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
315 40,0.,2., 11,0,10,nlargeetabins,etamin,etamax);
316 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
317 fhNCellsPerClusterMIP->SetYTitle("n cells");
318 fhNCellsPerClusterMIP->SetZTitle("#eta");
319 outputContainer->Add(fhNCellsPerClusterMIP);
322 fhNCellsPerClusterMIPCharged = new TH3F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
323 40,0.,2., 11,0,10,nlargeetabins,etamin,etamax);
324 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
325 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
326 fhNCellsPerClusterMIPCharged->SetZTitle("#eta");
327 outputContainer->Add(fhNCellsPerClusterMIPCharged);
330 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
331 fhNClusters->SetXTitle("number of clusters");
332 outputContainer->Add(fhNClusters);
334 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
335 fhXYZ->SetXTitle("x (cm)");
336 fhXYZ->SetYTitle("y (cm)");
337 fhXYZ->SetZTitle("z (cm) ");
338 outputContainer->Add(fhXYZ);
340 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax);
341 fhXNCells->SetXTitle("x (cm)");
342 fhXNCells->SetYTitle("N cells per cluster");
343 outputContainer->Add(fhXNCells);
345 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax);
346 fhZNCells->SetXTitle("z (cm)");
347 fhZNCells->SetYTitle("N cells per cluster");
348 outputContainer->Add(fhZNCells);
350 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
351 fhXE->SetXTitle("x (cm)");
352 fhXE->SetYTitle("E (GeV)");
353 outputContainer->Add(fhXE);
355 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
356 fhZE->SetXTitle("z (cm)");
357 fhZE->SetYTitle("E (GeV)");
358 outputContainer->Add(fhZE);
361 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax);
362 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
363 fhRNCells->SetYTitle("N cells per cluster");
364 outputContainer->Add(fhRNCells);
367 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax);
368 fhYNCells->SetXTitle("y (cm)");
369 fhYNCells->SetYTitle("N cells per cluster");
370 outputContainer->Add(fhYNCells);
372 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
373 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
374 fhRE->SetYTitle("E (GeV)");
375 outputContainer->Add(fhRE);
377 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
378 fhYE->SetXTitle("y (cm)");
379 fhYE->SetYTitle("E (GeV)");
380 outputContainer->Add(fhYE);
382 if(fFillAllPosHisto){
384 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
385 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
386 fhRCellE->SetYTitle("E (GeV)");
387 outputContainer->Add(fhRCellE);
389 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
390 fhXCellE->SetXTitle("x (cm)");
391 fhXCellE->SetYTitle("E (GeV)");
392 outputContainer->Add(fhXCellE);
394 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
395 fhYCellE->SetXTitle("y (cm)");
396 fhYCellE->SetYTitle("E (GeV)");
397 outputContainer->Add(fhYCellE);
399 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
400 fhZCellE->SetXTitle("z (cm)");
401 fhZCellE->SetYTitle("E (GeV)");
402 outputContainer->Add(fhZCellE);
404 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
405 fhXYZCell->SetXTitle("x (cm)");
406 fhXYZCell->SetYTitle("y (cm)");
407 fhXYZCell->SetZTitle("z (cm)");
408 outputContainer->Add(fhXYZCell);
411 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
412 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
413 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
414 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
416 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax);
417 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
418 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
419 outputContainer->Add(fhDeltaCellClusterRNCells);
421 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax);
422 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
423 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
424 outputContainer->Add(fhDeltaCellClusterXNCells);
426 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax);
427 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
428 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
429 outputContainer->Add(fhDeltaCellClusterYNCells);
431 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax);
432 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
433 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
434 outputContainer->Add(fhDeltaCellClusterZNCells);
436 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
437 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
438 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
439 outputContainer->Add(fhDeltaCellClusterRE);
441 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
442 fhDeltaCellClusterXE->SetXTitle("x (cm)");
443 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
444 outputContainer->Add(fhDeltaCellClusterXE);
446 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
447 fhDeltaCellClusterYE->SetXTitle("y (cm)");
448 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
449 outputContainer->Add(fhDeltaCellClusterYE);
451 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
452 fhDeltaCellClusterZE->SetXTitle("z (cm)");
453 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
454 outputContainer->Add(fhDeltaCellClusterZE);
456 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
457 fhEtaPhiAmp->SetXTitle("#eta ");
458 fhEtaPhiAmp->SetYTitle("#phi (rad)");
459 fhEtaPhiAmp->SetZTitle("E (GeV) ");
460 outputContainer->Add(fhEtaPhiAmp);
465 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
466 fhNCells->SetXTitle("n cells");
467 outputContainer->Add(fhNCells);
469 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
470 fhAmplitude->SetXTitle("Cell Energy (GeV)");
471 outputContainer->Add(fhAmplitude);
473 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
474 fhAmpId->SetXTitle("Cell Energy (GeV)");
475 outputContainer->Add(fhAmpId);
478 //Cell Time histograms, time only available in ESDs
479 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
481 fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200);
482 fhCellTimeSpreadRespectToCellMax->SetXTitle("#Delta t (ns)");
483 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
485 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
486 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
487 outputContainer->Add(fhCellIdCellLargeTimeSpread);
489 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
490 fhTime->SetXTitle("Cell Time (ns)");
491 outputContainer->Add(fhTime);
493 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
494 fhTimeId->SetXTitle("Cell Time (ns)");
495 fhTimeId->SetYTitle("Cell Absolute Id");
496 outputContainer->Add(fhTimeId);
498 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
499 fhTimeAmp->SetYTitle("Cell Time (ns)");
500 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
501 outputContainer->Add(fhTimeAmp);
503 // fhT0Time = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax);
504 // fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
505 // outputContainer->Add(fhT0Time);
507 // fhT0TimeId = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
508 // fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
509 // fhT0TimeId->SetYTitle("Cell Absolute Id");
510 // outputContainer->Add(fhT0TimeId);
512 // fhT0TimeAmp = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
513 // fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
514 // fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
515 // outputContainer->Add(fhT0TimeAmp);
519 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
520 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
521 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
522 outputContainer->Add(fhCaloCorrNClusters);
524 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
525 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
526 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
527 outputContainer->Add(fhCaloCorrEClusters);
529 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
530 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
531 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
532 outputContainer->Add(fhCaloCorrNCells);
534 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
535 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
536 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
537 outputContainer->Add(fhCaloCorrECells);
538 }//correlate calorimeters
541 fhEMod = new TH1F*[fNModules];
542 fhNClustersMod = new TH1F*[fNModules];
543 fhNCellsPerClusterMod = new TH2F*[fNModules];
544 fhNCellsMod = new TH1F*[fNModules];
545 fhGridCellsMod = new TH2F*[fNModules];
546 fhGridCellsEMod = new TH2F*[fNModules];
547 fhGridCellsTimeMod = new TH2F*[fNModules];
548 fhAmplitudeMod = new TH1F*[fNModules];
549 if(fCalorimeter=="EMCAL")
550 fhAmplitudeModFraction = new TH1F*[fNModules*3];
552 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
553 //fhT0TimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
554 //fhTimeCorrRCU = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
556 fhIMMod = new TH2F*[fNModules];
557 fhIMCellCutMod = new TH2F*[fNModules];
559 for(Int_t imod = 0; imod < fNModules; imod++){
561 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
562 fhEMod[imod]->SetXTitle("E (GeV)");
563 outputContainer->Add(fhEMod[imod]);
565 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
566 fhNClustersMod[imod]->SetXTitle("number of clusters");
567 outputContainer->Add(fhNClustersMod[imod]);
569 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
570 Form("# cells per cluster vs cluster energy in Module %d",imod),
571 nptbins,ptmin,ptmax, nbins,nmin,nmax);
572 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
573 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
574 outputContainer->Add(fhNCellsPerClusterMod[imod]);
576 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
577 fhNCellsMod[imod]->SetXTitle("n cells");
578 outputContainer->Add(fhNCellsMod[imod]);
579 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
580 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
581 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
582 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
583 outputContainer->Add(fhGridCellsMod[imod]);
585 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
586 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
587 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
588 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
589 outputContainer->Add(fhGridCellsEMod[imod]);
591 fhGridCellsTimeMod[imod] = new TH2F (Form("hGridCellsTime_Mod%d",imod),Form("Accumulated time in grid of cells in Module %d, with E > 0.5 GeV",imod),
592 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
593 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)");
594 fhGridCellsTimeMod[imod]->SetXTitle("column (eta direction)");
595 outputContainer->Add(fhGridCellsTimeMod[imod]);
597 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
598 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
599 outputContainer->Add(fhAmplitudeMod[imod]);
601 if(fCalorimeter == "EMCAL"){
602 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
603 fhAmplitudeModFraction[imod*3+ifrac] = new TH1F (Form("hAmplitude_Mod%d_Frac%d",imod,ifrac),Form("Cell reconstructed Energy in Module %d, Fraction %d ",imod,ifrac), nptbins,ptmin,ptmax);
604 fhAmplitudeModFraction[imod*3+ifrac]->SetXTitle("E (GeV)");
605 outputContainer->Add(fhAmplitudeModFraction[imod*3+ifrac]);
610 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
611 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
612 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
613 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
614 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
615 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
616 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
618 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
619 // Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu),
620 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
621 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
622 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
623 // outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
626 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
627 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
628 // Int_t index = (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod;
629 // fhTimeCorrRCU[index] = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
630 // Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
631 // ntimebins,timemin,timemax,ntimebins,timemin,timemax);
632 // fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
633 // fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
634 // outputContainer->Add(fhTimeCorrRCU[index]);
640 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
641 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
642 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
643 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
644 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
645 outputContainer->Add(fhIMMod[imod]);
647 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
648 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
649 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
650 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
651 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
652 outputContainer->Add(fhIMCellCutMod[imod]);
657 //Monte Carlo Histograms
660 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
661 fhDeltaE->SetXTitle("#Delta E (GeV)");
662 outputContainer->Add(fhDeltaE);
664 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
665 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
666 outputContainer->Add(fhDeltaPt);
668 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
669 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
670 outputContainer->Add(fhDeltaPhi);
672 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
673 fhDeltaEta->SetXTitle("#Delta #eta ");
674 outputContainer->Add(fhDeltaEta);
676 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
677 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
678 outputContainer->Add(fhRatioE);
680 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
681 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
682 outputContainer->Add(fhRatioPt);
684 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
685 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
686 outputContainer->Add(fhRatioPhi);
688 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
689 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
690 outputContainer->Add(fhRatioEta);
692 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
693 fh2E->SetXTitle("E_{rec} (GeV)");
694 fh2E->SetYTitle("E_{gen} (GeV)");
695 outputContainer->Add(fh2E);
697 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
698 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
699 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
700 outputContainer->Add(fh2Pt);
702 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
703 fh2Phi->SetXTitle("#phi_{rec} (rad)");
704 fh2Phi->SetYTitle("#phi_{gen} (rad)");
705 outputContainer->Add(fh2Phi);
707 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
708 fh2Eta->SetXTitle("#eta_{rec} ");
709 fh2Eta->SetYTitle("#eta_{gen} ");
710 outputContainer->Add(fh2Eta);
712 //Fill histos depending on origin of cluster
713 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
714 fhGamE->SetXTitle("E_{rec} (GeV)");
715 fhGamE->SetXTitle("E_{gen} (GeV)");
716 outputContainer->Add(fhGamE);
718 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
719 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
720 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
721 outputContainer->Add(fhGamPt);
723 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
724 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
725 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
726 outputContainer->Add(fhGamPhi);
728 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
729 fhGamEta->SetXTitle("#eta_{rec} ");
730 fhGamEta->SetYTitle("#eta_{gen} ");
731 outputContainer->Add(fhGamEta);
733 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
734 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
735 outputContainer->Add(fhGamDeltaE);
737 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
738 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
739 outputContainer->Add(fhGamDeltaPt);
741 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
742 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
743 outputContainer->Add(fhGamDeltaPhi);
745 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
746 fhGamDeltaEta->SetXTitle("#Delta #eta ");
747 outputContainer->Add(fhGamDeltaEta);
749 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
750 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
751 outputContainer->Add(fhGamRatioE);
753 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
754 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
755 outputContainer->Add(fhGamRatioPt);
757 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
758 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
759 outputContainer->Add(fhGamRatioPhi);
761 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
762 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
763 outputContainer->Add(fhGamRatioEta);
765 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
766 fhPi0E->SetXTitle("E_{rec} (GeV)");
767 fhPi0E->SetYTitle("E_{gen} (GeV)");
768 outputContainer->Add(fhPi0E);
770 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
771 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
772 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
773 outputContainer->Add(fhPi0Pt);
775 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
776 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
777 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
778 outputContainer->Add(fhPi0Phi);
780 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
781 fhPi0Eta->SetXTitle("#eta_{rec} ");
782 fhPi0Eta->SetYTitle("#eta_{gen} ");
783 outputContainer->Add(fhPi0Eta);
785 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
786 fhEleE->SetXTitle("E_{rec} (GeV)");
787 fhEleE->SetXTitle("E_{gen} (GeV)");
788 outputContainer->Add(fhEleE);
790 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
791 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
792 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
793 outputContainer->Add(fhElePt);
795 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
796 fhElePhi->SetXTitle("#phi_{rec} (rad)");
797 fhElePhi->SetYTitle("#phi_{gen} (rad)");
798 outputContainer->Add(fhElePhi);
800 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
801 fhEleEta->SetXTitle("#eta_{rec} ");
802 fhEleEta->SetYTitle("#eta_{gen} ");
803 outputContainer->Add(fhEleEta);
805 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
806 fhNeHadE->SetXTitle("E_{rec} (GeV)");
807 fhNeHadE->SetYTitle("E_{gen} (GeV)");
808 outputContainer->Add(fhNeHadE);
810 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
811 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
812 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
813 outputContainer->Add(fhNeHadPt);
815 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
816 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
817 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
818 outputContainer->Add(fhNeHadPhi);
820 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
821 fhNeHadEta->SetXTitle("#eta_{rec} ");
822 fhNeHadEta->SetYTitle("#eta_{gen} ");
823 outputContainer->Add(fhNeHadEta);
825 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
826 fhChHadE->SetXTitle("E_{rec} (GeV)");
827 fhChHadE->SetYTitle("E_{gen} (GeV)");
828 outputContainer->Add(fhChHadE);
830 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
831 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
832 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
833 outputContainer->Add(fhChHadPt);
835 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
836 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
837 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
838 outputContainer->Add(fhChHadPhi);
840 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
841 fhChHadEta->SetXTitle("#eta_{rec} ");
842 fhChHadEta->SetYTitle("#eta_{gen} ");
843 outputContainer->Add(fhChHadEta);
847 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
848 fhGamECharged->SetXTitle("E_{rec} (GeV)");
849 fhGamECharged->SetXTitle("E_{gen} (GeV)");
850 outputContainer->Add(fhGamECharged);
852 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
853 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
854 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
855 outputContainer->Add(fhGamPtCharged);
857 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
858 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
859 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
860 outputContainer->Add(fhGamPhiCharged);
862 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
863 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
864 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
865 outputContainer->Add(fhGamEtaCharged);
867 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
868 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
869 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
870 outputContainer->Add(fhPi0ECharged);
872 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
873 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
874 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
875 outputContainer->Add(fhPi0PtCharged);
877 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
878 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
879 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
880 outputContainer->Add(fhPi0PhiCharged);
882 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
883 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
884 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
885 outputContainer->Add(fhPi0EtaCharged);
887 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
888 fhEleECharged->SetXTitle("E_{rec} (GeV)");
889 fhEleECharged->SetXTitle("E_{gen} (GeV)");
890 outputContainer->Add(fhEleECharged);
892 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
893 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
894 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
895 outputContainer->Add(fhElePtCharged);
897 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
898 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
899 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
900 outputContainer->Add(fhElePhiCharged);
902 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
903 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
904 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
905 outputContainer->Add(fhEleEtaCharged);
907 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
908 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
909 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
910 outputContainer->Add(fhNeHadECharged);
912 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
913 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
914 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
915 outputContainer->Add(fhNeHadPtCharged);
917 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
918 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
919 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
920 outputContainer->Add(fhNeHadPhiCharged);
922 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
923 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
924 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
925 outputContainer->Add(fhNeHadEtaCharged);
927 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
928 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
929 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
930 outputContainer->Add(fhChHadECharged);
932 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
933 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
934 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
935 outputContainer->Add(fhChHadPtCharged);
937 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
938 fhChHadPhiCharged->SetXTitle("#phi (rad)");
939 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
940 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
941 outputContainer->Add(fhChHadPhiCharged);
943 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
944 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
945 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
946 outputContainer->Add(fhChHadEtaCharged);
948 //Vertex of generated particles
950 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
951 fhEMVxyz->SetXTitle("v_{x}");
952 fhEMVxyz->SetYTitle("v_{y}");
953 //fhEMVxyz->SetZTitle("v_{z}");
954 outputContainer->Add(fhEMVxyz);
956 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
957 fhHaVxyz->SetXTitle("v_{x}");
958 fhHaVxyz->SetYTitle("v_{y}");
959 //fhHaVxyz->SetZTitle("v_{z}");
960 outputContainer->Add(fhHaVxyz);
962 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
963 fhEMR->SetXTitle("E (GeV)");
964 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
965 outputContainer->Add(fhEMR);
967 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
968 fhHaR->SetXTitle("E (GeV)");
969 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
970 outputContainer->Add(fhHaR);
975 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
976 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
977 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
979 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
980 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
981 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
983 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
984 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
985 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
987 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
988 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
989 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
991 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
992 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
993 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
995 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
996 fhGenGamEta->SetXTitle("#eta");
997 fhGenGamPhi->SetXTitle("#phi (rad)");
998 outputContainer->Add(fhGenGamPt);
999 outputContainer->Add(fhGenGamEta);
1000 outputContainer->Add(fhGenGamPhi);
1002 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
1003 fhGenPi0Eta->SetXTitle("#eta");
1004 fhGenPi0Phi->SetXTitle("#phi (rad)");
1005 outputContainer->Add(fhGenPi0Pt);
1006 outputContainer->Add(fhGenPi0Eta);
1007 outputContainer->Add(fhGenPi0Phi);
1009 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
1010 fhGenEtaEta->SetXTitle("#eta");
1011 fhGenEtaPhi->SetXTitle("#phi (rad)");
1012 outputContainer->Add(fhGenEtaPt);
1013 outputContainer->Add(fhGenEtaEta);
1014 outputContainer->Add(fhGenEtaPhi);
1016 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
1017 fhGenOmegaEta->SetXTitle("#eta");
1018 fhGenOmegaPhi->SetXTitle("#phi (rad)");
1019 outputContainer->Add(fhGenOmegaPt);
1020 outputContainer->Add(fhGenOmegaEta);
1021 outputContainer->Add(fhGenOmegaPhi);
1023 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
1024 fhGenEleEta->SetXTitle("#eta");
1025 fhGenElePhi->SetXTitle("#phi (rad)");
1026 outputContainer->Add(fhGenElePt);
1027 outputContainer->Add(fhGenEleEta);
1028 outputContainer->Add(fhGenElePhi);
1030 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1031 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1032 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
1033 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
1035 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1036 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1037 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
1038 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
1040 fhGenGamAccE ->SetXTitle("E (GeV)");
1041 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
1042 fhGenGamAccEta->SetXTitle("#eta");
1043 fhGenGamAccPhi->SetXTitle("#phi (rad)");
1044 outputContainer->Add(fhGenGamAccE);
1045 outputContainer->Add(fhGenGamAccPt);
1046 outputContainer->Add(fhGenGamAccEta);
1047 outputContainer->Add(fhGenGamAccPhi);
1049 fhGenPi0AccE ->SetXTitle("E (GeV)");
1050 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
1051 fhGenPi0AccEta->SetXTitle("#eta");
1052 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
1053 outputContainer->Add(fhGenPi0AccE);
1054 outputContainer->Add(fhGenPi0AccPt);
1055 outputContainer->Add(fhGenPi0AccEta);
1056 outputContainer->Add(fhGenPi0AccPhi);
1060 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1061 fhMCEle1pOverE->SetYTitle("p/E");
1062 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1063 outputContainer->Add(fhMCEle1pOverE);
1065 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
1066 fhMCEle1dR->SetXTitle("#Delta R (rad)");
1067 outputContainer->Add(fhMCEle1dR) ;
1069 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1070 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1071 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1072 outputContainer->Add(fhMCEle2MatchdEdx);
1074 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1075 fhMCChHad1pOverE->SetYTitle("p/E");
1076 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1077 outputContainer->Add(fhMCChHad1pOverE);
1079 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1080 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1081 outputContainer->Add(fhMCChHad1dR) ;
1083 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1084 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1085 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1086 outputContainer->Add(fhMCChHad2MatchdEdx);
1088 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1089 fhMCNeutral1pOverE->SetYTitle("p/E");
1090 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1091 outputContainer->Add(fhMCNeutral1pOverE);
1093 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1094 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1095 outputContainer->Add(fhMCNeutral1dR) ;
1097 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1098 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1099 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1100 outputContainer->Add(fhMCNeutral2MatchdEdx);
1102 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1103 fhMCEle1pOverER02->SetYTitle("p/E");
1104 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1105 outputContainer->Add(fhMCEle1pOverER02);
1107 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1108 fhMCChHad1pOverER02->SetYTitle("p/E");
1109 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1110 outputContainer->Add(fhMCChHad1pOverER02);
1112 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1113 fhMCNeutral1pOverER02->SetYTitle("p/E");
1114 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1115 outputContainer->Add(fhMCNeutral1pOverER02);
1118 return outputContainer;
1121 //_______________________________________________________________________________________________________________________________________
1122 Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
1124 //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
1125 Float_t oldbinsize = histo->GetBinWidth(0);
1126 Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
1127 //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
1128 if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
1132 //__________________________________________________
1133 void AliAnaCalorimeterQA::Init()
1135 //Check if the data or settings are ok
1136 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1137 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1141 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1142 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1149 //__________________________________________________
1150 void AliAnaCalorimeterQA::InitParameters()
1152 //Initialize the parameters of the analysis.
1153 AddToHistogramsName("AnaCaloQA_");
1155 fCalorimeter = "EMCAL"; //or PHOS
1157 fNModules = 12; // set maximum to maximum number of EMCAL modules
1158 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
1160 fTimeCutMax = 9999999;
1161 fEMCALCellAmpMin = 0.0;
1162 fPHOSCellAmpMin = 0.0;
1164 fHistoPOverEBins = 100 ; fHistoPOverEMax = 10. ; fHistoPOverEMin = 0. ;
1165 fHistodEdxBins = 200 ; fHistodEdxMax = 400. ; fHistodEdxMin = 0. ;
1166 fHistodRBins = 300 ; fHistodRMax = 3.15 ; fHistodRMin = 0. ;
1167 fHistoTimeBins = 1000; fHistoTimeMax = 1.e3 ; fHistoTimeMin = 0. ;//ns
1168 fHistoNBins = 300 ; fHistoNMax = 300 ; fHistoNMin = 0 ;
1169 fHistoRatioBins = 200 ; fHistoRatioMax = 2 ; fHistoRatioMin = 0. ;
1170 fHistoVertexDistBins = 100 ; fHistoVertexDistMax = 500. ; fHistoVertexDistMin = 0. ;
1171 fHistoRBins = 100 ; fHistoRMax = 500 ; fHistoRMin = -500 ;//cm
1172 fHistoXBins = 100 ; fHistoXMax = 500 ; fHistoXMin = -500 ;//cm
1173 fHistoYBins = 100 ; fHistoYMax = 500 ; fHistoYMin = -500 ;//cm
1174 fHistoZBins = 100 ; fHistoZMax = 600 ; fHistoZMin = -500 ;//cm
1175 fHistoSSBins = 40 ; fHistoSSMax = 10 ; fHistoSSMin = 0 ;
1179 //__________________________________________________________________
1180 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1182 //Print some relevant parameters set for the analysis
1186 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1187 AliAnaPartCorrBaseClass::Print(" ");
1189 printf("Select Calorimeter %s \n",fCalorimeter.Data());
1190 printf("Make plots? %d \n",fMakePlots);
1191 printf("Plots style macro %s \n",fStyleMacro.Data());
1192 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
1193 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
1194 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
1195 printf("Histograms: %3.1f < p/E < %3.1f, Nbin = %d\n", fHistoPOverEMin, fHistoPOverEMax, fHistoPOverEBins);
1196 printf("Histograms: %3.1f < dEdx < %3.1f, Nbin = %d\n", fHistodEdxMin, fHistodEdxMax, fHistodEdxBins);
1197 printf("Histograms: %3.1f < dR (track cluster) < %3.1f, Nbin = %d\n", fHistodRMin, fHistodRMax, fHistodRBins);
1198 printf("Histograms: %3.1f < R=sqrt{x^2+y^2} < %3.1f, Nbin = %d\n", fHistoRMin, fHistoRMax, fHistoRBins);
1199 printf("Histograms: %3.1f < X < %3.1f, Nbin = %d\n", fHistoXMin, fHistoXMax, fHistoXBins);
1200 printf("Histograms: %3.1f < Y < %3.1f, Nbin = %d\n", fHistoYMin, fHistoYMax, fHistoYBins);
1201 printf("Histograms: %3.1f < Z < %3.1f, Nbin = %d\n", fHistoZMin, fHistoZMax, fHistoZBins);
1202 printf("Histograms: %g < Time < %g, Nbin = %d\n" , fHistoTimeMin, fHistoTimeMax, fHistoTimeBins);
1203 printf("Histograms: %d < N < %d, Nbin = %d\n" , fHistoNMin, fHistoNMax, fHistoNBins);
1204 printf("Histograms: %3.1f < Ratio< %3.1f, Nbin = %d\n", fHistoRatioMin, fHistoRatioMax, fHistoRatioBins);
1205 printf("Histograms: %3.1f < Vertex Distance < %3.1f, Nbin = %d\n", fHistoVertexDistMin, fHistoVertexDistMax, fHistoVertexDistBins);
1209 //__________________________________________________________________
1210 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1212 //Fill Calorimeter QA histograms
1213 TLorentzVector mom ;
1214 TLorentzVector mom2 ;
1215 TObjArray * caloClusters = NULL;
1218 Int_t nCaloClusters = 0;
1219 Int_t nCaloClustersAccepted = 0;
1220 Int_t nCaloCellsPerCluster = 0;
1221 Int_t nTracksMatched = 0;
1222 Int_t trackIndex = 0;
1225 //Play with the MC stack if available
1226 //Get the MC arrays and do some checks
1228 if(GetReader()->ReadStack()){
1231 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1234 //Fill some pure MC histograms, only primaries.
1235 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1236 TParticle *primary = GetMCStack()->Particle(i) ;
1237 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1238 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1239 primary->Momentum(mom);
1240 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1243 else if(GetReader()->ReadAODMCParticles()){
1245 if(!GetReader()->GetAODMCParticles(0)) {
1246 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1249 //Fill some pure MC histograms, only primaries.
1250 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1251 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1252 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1253 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1254 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1255 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1256 //aodprimary->Momentum(mom);
1257 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1258 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1265 //Get List with CaloClusters
1266 if (fCalorimeter == "PHOS") caloClusters = GetAODPHOS();
1267 else if (fCalorimeter == "EMCAL") caloClusters = GetAODEMCAL();
1269 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
1271 // if (fCalorimeter == "EMCAL") GetReader()->GetInputEvent()->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1272 // else if(fCalorimeter == "PHOS") GetReader()->GetInputEvent()->GetPHOSClusters (caloClusters);//GetAODPHOS();
1274 // AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
1277 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n"));
1280 //----------------------------------------------------------
1281 //Correlate Calorimeters
1282 //----------------------------------------------------------
1283 //if(fCorrelateCalos) CorrelateCalorimeters(caloClusters);
1284 if(fCorrelateCalos) CorrelateCalorimeters();
1287 //----------------------------------------------------------
1289 //----------------------------------------------------------
1291 nCaloClusters = caloClusters->GetEntriesFast() ;
1292 Int_t *nClustersInModule = new Int_t[fNModules];
1293 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1296 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1298 //Get vertex for photon momentum calculation
1299 Double_t v[3] = {0,0,0}; //vertex ;
1300 GetReader()->GetVertex(v);
1301 AliVTrack * track = 0x0;
1304 Float_t showerShape[3] ;
1306 //Loop over CaloClusters
1307 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1308 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1310 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1311 iclus+1,nCaloClusters,GetReader()->GetDataType());
1313 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1314 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
1315 AliVCaloCells * cell = 0x0;
1316 if(fCalorimeter == "PHOS") cell = GetPHOSCells();
1317 else cell = GetEMCALCells();
1319 //Get cluster kinematics
1320 clus->GetPosition(pos);
1321 clus->GetMomentum(mom,v);
1322 tof = clus->GetTOF()*1e9;
1323 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1325 //Check only certain regions
1327 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1330 //Get module of cluster
1331 nCaloClustersAccepted++;
1332 nModule = GetModuleNumber(clus);
1333 if(nModule >=0 && nModule < fNModules) nClustersInModule[nModule]++;
1336 nLabel = clus->GetNLabels();
1337 labels = clus->GetLabels();
1340 nCaloCellsPerCluster = clus->GetNCells();
1341 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1343 //matched cluster with tracks
1344 nTracksMatched = clus->GetNTracksMatched();
1345 trackIndex = clus->GetTrackMatchedIndex();
1346 if(trackIndex >= 0){
1347 track = (AliVTrack*)GetReader()->GetInputEvent()->GetTrack(trackIndex);
1350 if(nTracksMatched == 1) nTracksMatched = 0;
1354 //Shower shape parameters
1355 showerShape[0] = clus->GetM20();
1356 showerShape[1] = clus->GetM02();
1357 showerShape[2] = clus->GetDispersion();
1359 //======================
1361 //======================
1363 //Get list of contributors
1364 UShort_t * indexList = clus->GetCellsAbsId() ;
1365 // check time of cells respect to max energy cell
1366 //Get maximum energy cell
1371 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1372 //Loop on cluster cells
1373 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1374 // printf("Index %d\n",ipos);
1375 absId = indexList[ipos];
1377 //Get position of cell compare to cluster
1378 if(fFillAllPosHisto){
1379 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1381 Double_t cellpos[] = {0, 0, 0};
1382 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1384 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1385 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1386 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1388 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1389 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1390 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1392 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1393 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1394 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1395 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1397 // Float_t celleta = 0, cellphi = 0;
1398 // GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi);
1399 // Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
1400 // GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1401 // GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1402 // iIphi, iIeta,iphi,ieta);
1403 // printf("AbsId %d, SM %d, Index eta %d, phi %d\n", absId, imod, ieta, iphi);
1404 // printf("Cluster E %f, eta %f, phi %f; Cell: Amp %f, eta %f, phi%f\n", mom.E(),mom.Eta(), mom.Phi()*TMath::RadToDeg(), cell->GetCellAmplitude(absId),celleta, cellphi*TMath::RadToDeg());
1405 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1406 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1407 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1408 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1411 }//EMCAL and its matrices are available
1412 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1414 Int_t relId[4], module;
1415 Float_t xCell, zCell;
1417 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1419 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1420 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1422 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1423 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1424 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1426 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1427 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1428 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1430 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1431 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1432 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1433 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1435 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1436 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1437 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1438 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1439 }//PHOS and its matrices are available
1440 }//Fill all position histograms
1442 //Find maximum energy cluster
1443 if(cell->GetCellAmplitude(absId) > emax) {
1445 emax = cell->GetCellAmplitude(absId);
1446 tmax = cell->GetCellTime(absId);
1449 }// cluster cell loop
1451 // check time of cells respect to max energy cell
1452 if(nCaloCellsPerCluster > 1){
1453 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1454 if(imax == ipos) continue;
1455 absId = indexList[ipos];
1456 Float_t diff = (tmax-cell->GetCellTime(absId))*1e9;
1457 fhCellTimeSpreadRespectToCellMax->Fill(diff);
1458 if(TMath::Abs(TMath::Abs(diff) > 100)) fhCellIdCellLargeTimeSpread->Fill(absId);
1459 }// fill cell-cluster histogram loop
1461 }//check time of cells respect to max energy cell
1463 //-----------------------------------------------------------
1464 //Fill histograms related to single cluster or track matching
1465 //-----------------------------------------------------------
1467 ClusterHistograms(mom, tof, pos, showerShape, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1470 //-----------------------------------------------------------
1472 //-----------------------------------------------------------
1473 if(GetDebug()>1) printf("Invariant mass \n");
1475 //do not do for bad vertex
1476 Float_t fZvtxCut = 40. ;
1477 if(v[2]<-fZvtxCut || v[2]> fZvtxCut) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
1479 Int_t nModule2 = -1;
1480 Int_t nCaloCellsPerCluster2=0;
1481 if (nCaloClusters > 1 ) {
1482 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1483 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
1485 //Get cluster kinematics
1486 clus2->GetMomentum(mom2,v);
1487 //Check only certain regions
1489 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1491 //Get module of cluster
1492 nModule2 = GetModuleNumber(clus2);
1494 nCaloCellsPerCluster2 = clus2->GetNCells();
1496 //Fill invariant mass histograms
1499 //printf("QA : Fill inv mass histo: pt1 %f, pt2 %f, pt12 %f, mass %f, calo %s \n",mom.Pt(),mom2.Pt(),(mom+mom2).Pt(),(mom+mom2).M(), fCalorimeter.Data());
1500 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1502 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1503 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1505 //Select only clusters with at least 2 cells
1506 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1508 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1510 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1511 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1514 //Asymetry histograms
1515 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1517 }// 2nd cluster loop
1518 }////more than 1 cluster in calorimeter
1521 //Number of clusters histograms
1522 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
1523 // Number of clusters per module
1524 for(Int_t imod = 0; imod < fNModules; imod++ ){
1526 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1527 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1529 delete [] nClustersInModule;
1530 //delete caloClusters;
1531 }// calo clusters array exists
1533 //----------------------------------------------------------
1535 //----------------------------------------------------------
1537 Int_t *nCellsInModule = new Int_t[fNModules];
1538 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1545 Float_t recalF = 1.;
1547 AliVCaloCells * cell = 0x0;
1549 if(fCalorimeter == "PHOS")
1550 cell = GetPHOSCells();
1552 cell = GetEMCALCells();
1555 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s ESD CELLS available for analysis\n",fCalorimeter.Data());
1560 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), cell->GetNumberOfCells());
1562 for (Int_t iCell = 0; iCell < cell->GetNumberOfCells(); iCell++) {
1563 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1564 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
1565 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1567 if(nModule < fNModules) {
1568 //Check if the cell is a bad channel
1569 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1570 if(fCalorimeter=="EMCAL"){
1571 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1574 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
1575 printf("PHOS bad channel\n");
1581 //Get Recalibration factor if set
1582 if (GetCaloUtils()->IsRecalibrationOn()) {
1583 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1584 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1585 //if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
1588 amp = cell->GetAmplitude(iCell)*recalF;
1589 time = cell->GetTime(iCell)*1e9;//transform time to ns
1590 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1592 //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
1593 // amp,time,nModule,icol,irow);
1595 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1596 id = cell->GetCellNumber(iCell);
1597 fhAmplitude->Fill(amp);
1598 fhAmpId ->Fill(amp,id);
1599 fhTime ->Fill(time);
1600 fhTimeId ->Fill(time,id);
1601 fhTimeAmp ->Fill(amp,time);
1602 //Double_t t0 = GetReader()->GetInputEvent()->GetT0();
1603 //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0,
1604 // GetReader()->GetInputEvent()->GetT0zVertex(),
1605 // GetReader()->GetInputEvent()->GetT0clock(),
1606 // GetReader()->GetInputEvent()->GetT0Trig());
1607 //fhT0Time ->Fill(time-t0);
1608 //fhT0TimeId ->Fill(time-t0,id);
1609 //fhT0TimeAmp ->Fill(amp,time-t0);
1611 fhAmplitudeMod[nModule]->Fill(amp);
1612 if(fCalorimeter=="EMCAL"){
1614 if(icol > 15 && icol < 32) ifrac = 1;
1615 else if(icol > 31) ifrac = 2;
1616 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
1619 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
1620 //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
1621 //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
1622 nCellsInModule[nModule]++;
1623 fhGridCellsMod[nModule] ->Fill(icol,irow);
1624 fhGridCellsEMod[nModule] ->Fill(icol,irow,amp);
1626 fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
1628 // AliESDCaloCells * cell2 = 0x0;
1629 // if(fCalorimeter == "PHOS") cell2 = GetReader()->GetInputEvent()->GetPHOSCells();
1630 // else cell2 = GetReader()->GetInputEvent()->GetEMCALCells();
1631 // Int_t icol2 = -1;
1632 // Int_t irow2 = -1;
1633 // Int_t iRCU2 = -1;
1634 // Float_t amp2 = 0.;
1635 // Float_t time2 = 0.;
1637 // Int_t nModule2 = -1;
1638 // for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {
1639 // amp2 = cell2->GetAmplitude(iCell2);
1640 // if(amp2 < 0.3) continue;
1641 // if(iCell2 == iCell) continue;
1642 // time2 = cell2->GetTime(iCell2)*1e9;//transform time to ns
1643 // //printf("%s: time %g\n",fCalorimeter.Data(), time);
1644 // id2 = cell2->GetCellNumber(iCell2);
1645 // nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
1646 // Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule);
1647 // //printf("id %d, nModule %d, iRCU %d, id2 %d, nModule2 %d, iRCU2 %d, index %d: Histo Name %s\n",id, nModule,iRCU,cell2->GetCellNumber(iCell2),nModule2,iRCU2,index, fhTimeCorrRCU[index]->GetName());
1648 // fhTimeCorrRCU[index]->Fill(time,time2);
1650 // }// second cell loop
1654 //Get Eta-Phi position of Cell
1655 //if(fFillAllPosHisto)
1657 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1658 Float_t celleta = 0.;
1659 Float_t cellphi = 0.;
1660 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1661 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1662 Double_t cellpos[] = {0, 0, 0};
1663 GetEMCALGeometry()->GetGlobal(id, cellpos);
1664 fhXCellE->Fill(cellpos[0],amp) ;
1665 fhYCellE->Fill(cellpos[1],amp) ;
1666 fhZCellE->Fill(cellpos[2],amp) ;
1667 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1668 fhRCellE->Fill(rcell,amp) ;
1669 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1671 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1673 Int_t relId[4], module;
1674 Float_t xCell, zCell;
1676 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
1678 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1679 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1680 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
1681 fhXCellE ->Fill(xyz.X(),amp) ;
1682 fhYCellE ->Fill(xyz.Y(),amp) ;
1683 fhZCellE ->Fill(xyz.Z(),amp) ;
1684 fhRCellE ->Fill(rcell ,amp) ;
1685 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
1687 }//fill cell position histograms
1688 if (fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ncells ++ ;
1689 else if(fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin) ncells ++ ;
1691 // printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - no %s CELLS passed the analysis cut\n",fCalorimeter.Data());
1693 if(ncells > 0 )fhNCells->Fill(ncells) ; //fill the cells after the cut
1695 //Number of cells per module
1696 for(Int_t imod = 0; imod < fNModules; imod++ ) {
1698 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
1699 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
1701 delete [] nCellsInModule;
1704 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1708 //_____________________________________________________________________________________________
1709 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof,
1710 Float_t *pos, Float_t *showerShape,
1711 const Int_t nCaloCellsPerCluster,const Int_t nModule,
1712 const Int_t nTracksMatched, const AliVTrack * track,
1713 const Int_t * labels, const Int_t nLabels){
1714 //Fill CaloCluster related histograms
1716 AliAODMCParticle * aodprimary = 0x0;
1717 TParticle * primary = 0x0;
1720 Float_t e = mom.E();
1721 Float_t pt = mom.Pt();
1722 Float_t eta = mom.Eta();
1723 Float_t phi = mom.Phi();
1724 if(phi < 0) phi +=TMath::TwoPi();
1725 if(GetDebug() > 0) {
1726 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
1728 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
1729 printf("\t Primaries: nlabels %d\n",nLabels);
1730 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
1735 if(nModule >=0 && nModule < fNModules) fhEMod[nModule]->Fill(e);
1741 fhEtaPhiE->Fill(eta,phi,e);
1744 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster,eta);
1745 fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster,eta);
1748 //if(fFillAllPosHisto)
1750 fhXE ->Fill(pos[0],e);
1751 fhYE ->Fill(pos[1],e);
1752 fhZE ->Fill(pos[2],e);
1753 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
1755 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
1756 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
1757 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
1758 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
1759 fhRE ->Fill(rxyz,e);
1760 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
1763 fhClusterTimeEnergy->Fill(e,tof);
1765 //Shower shape parameters
1766 fhLambda->Fill(showerShape[0], showerShape[1], e);
1767 fhDispersion->Fill(showerShape[2],e);
1769 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
1771 //Fill histograms only possible when simulation
1772 if(IsDataMC() && nLabels > 0 && labels){
1774 //Play with the MC stack if available
1775 Int_t label = labels[0];
1778 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
1782 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1783 Float_t vxMC= 0; Float_t vyMC = 0;
1784 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1788 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
1790 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
1792 if( label >= GetMCStack()->GetNtrack()) {
1793 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1797 primary = GetMCStack()->Particle(label);
1799 pdg0 = TMath::Abs(primary->GetPdgCode());
1801 status = primary->GetStatusCode();
1802 vxMC = primary->Vx();
1803 vyMC = primary->Vy();
1804 iParent = primary->GetFirstMother();
1806 if(GetDebug() > 1 ) {
1807 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1808 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1811 //Get final particle, no conversion products
1812 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1814 primary = GetMCStack()->Particle(iParent);
1815 pdg = TMath::Abs(primary->GetPdgCode());
1816 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1817 while((pdg == 22 || pdg == 11) && status != 1){
1819 primary = GetMCStack()->Particle(iMother);
1820 status = primary->GetStatusCode();
1821 iParent = primary->GetFirstMother();
1822 pdg = TMath::Abs(primary->GetPdgCode());
1823 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1826 if(GetDebug() > 1 ) {
1827 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1828 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1833 //Overlapped pi0 (or eta, there will be very few), get the meson
1834 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1835 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1836 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1837 while(pdg != 111 && pdg != 221){
1839 primary = GetMCStack()->Particle(iMother);
1840 status = primary->GetStatusCode();
1841 iParent = primary->GetFirstMother();
1842 pdg = TMath::Abs(primary->GetPdgCode());
1843 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1845 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1850 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1851 primary->GetName(),iMother);
1854 eMC = primary->Energy();
1855 ptMC = primary->Pt();
1856 phiMC = primary->Phi();
1857 etaMC = primary->Eta();
1858 pdg = TMath::Abs(primary->GetPdgCode());
1859 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1862 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
1863 //Get the list of MC particles
1864 if(!GetReader()->GetAODMCParticles(0)) {
1865 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
1869 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
1871 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1873 status = aodprimary->IsPrimary();
1874 vxMC = aodprimary->Xv();
1875 vyMC = aodprimary->Yv();
1876 iParent = aodprimary->GetMother();
1878 if(GetDebug() > 1 ) {
1879 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1880 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
1881 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
1884 //Get final particle, no conversion products
1885 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1887 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1889 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
1890 pdg = TMath::Abs(aodprimary->GetPdgCode());
1891 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
1893 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1894 status = aodprimary->IsPrimary();
1895 iParent = aodprimary->GetMother();
1896 pdg = TMath::Abs(aodprimary->GetPdgCode());
1898 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
1899 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1902 if(GetDebug() > 1 ) {
1903 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1904 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
1905 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1910 //Overlapped pi0 (or eta, there will be very few), get the meson
1911 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1912 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1913 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1914 while(pdg != 111 && pdg != 221){
1917 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1918 status = aodprimary->IsPrimary();
1919 iParent = aodprimary->GetMother();
1920 pdg = TMath::Abs(aodprimary->GetPdgCode());
1922 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1925 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1930 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1931 aodprimary->GetName(),iMother);
1934 status = aodprimary->IsPrimary();
1935 eMC = aodprimary->E();
1936 ptMC = aodprimary->Pt();
1937 phiMC = aodprimary->Phi();
1938 etaMC = aodprimary->Eta();
1939 pdg = TMath::Abs(aodprimary->GetPdgCode());
1940 charge = aodprimary->Charge();
1944 //Float_t vz = primary->Vz();
1945 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1946 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
1947 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1948 fhEMR ->Fill(e,rVMC);
1951 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1952 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1953 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1956 fh2E ->Fill(e, eMC);
1957 fh2Pt ->Fill(pt, ptMC);
1958 fh2Phi ->Fill(phi, phiMC);
1959 fh2Eta ->Fill(eta, etaMC);
1960 fhDeltaE ->Fill(eMC-e);
1961 fhDeltaPt ->Fill(ptMC-pt);
1962 fhDeltaPhi->Fill(phiMC-phi);
1963 fhDeltaEta->Fill(etaMC-eta);
1964 if(eMC > 0) fhRatioE ->Fill(e/eMC);
1965 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
1966 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
1967 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
1970 //Overlapped pi0 (or eta, there will be very few)
1971 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1972 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1973 fhPi0E ->Fill(e,eMC);
1974 fhPi0Pt ->Fill(pt,ptMC);
1975 fhPi0Eta ->Fill(eta,etaMC);
1976 fhPi0Phi ->Fill(phi,phiMC);
1977 if( nTracksMatched > 0){
1978 fhPi0ECharged ->Fill(e,eMC);
1979 fhPi0PtCharged ->Fill(pt,ptMC);
1980 fhPi0PhiCharged ->Fill(phi,phiMC);
1981 fhPi0EtaCharged ->Fill(eta,etaMC);
1983 }//Overlapped pizero decay
1984 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
1985 fhGamE ->Fill(e,eMC);
1986 fhGamPt ->Fill(pt,ptMC);
1987 fhGamEta ->Fill(eta,etaMC);
1988 fhGamPhi ->Fill(phi,phiMC);
1989 fhGamDeltaE ->Fill(eMC-e);
1990 fhGamDeltaPt ->Fill(ptMC-pt);
1991 fhGamDeltaPhi->Fill(phiMC-phi);
1992 fhGamDeltaEta->Fill(etaMC-eta);
1993 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
1994 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
1995 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
1996 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
1997 if( nTracksMatched > 0){
1998 fhGamECharged ->Fill(e,eMC);
1999 fhGamPtCharged ->Fill(pt,ptMC);
2000 fhGamPhiCharged ->Fill(phi,phiMC);
2001 fhGamEtaCharged ->Fill(eta,etaMC);
2004 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
2005 fhEleE ->Fill(e,eMC);
2006 fhElePt ->Fill(pt,ptMC);
2007 fhEleEta ->Fill(eta,etaMC);
2008 fhElePhi ->Fill(phi,phiMC);
2009 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2010 fhEMR ->Fill(e,rVMC);
2011 if( nTracksMatched > 0){
2012 fhEleECharged ->Fill(e,eMC);
2013 fhElePtCharged ->Fill(pt,ptMC);
2014 fhElePhiCharged ->Fill(phi,phiMC);
2015 fhEleEtaCharged ->Fill(eta,etaMC);
2018 else if(charge == 0){
2019 fhNeHadE ->Fill(e,eMC);
2020 fhNeHadPt ->Fill(pt,ptMC);
2021 fhNeHadEta ->Fill(eta,etaMC);
2022 fhNeHadPhi ->Fill(phi,phiMC);
2023 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2024 fhHaR ->Fill(e,rVMC);
2025 if( nTracksMatched > 0){
2026 fhNeHadECharged ->Fill(e,eMC);
2027 fhNeHadPtCharged ->Fill(pt,ptMC);
2028 fhNeHadPhiCharged ->Fill(phi,phiMC);
2029 fhNeHadEtaCharged ->Fill(eta,etaMC);
2033 fhChHadE ->Fill(e,eMC);
2034 fhChHadPt ->Fill(pt,ptMC);
2035 fhChHadEta ->Fill(eta,etaMC);
2036 fhChHadPhi ->Fill(phi,phiMC);
2037 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2038 fhHaR ->Fill(e,rVMC);
2039 if( nTracksMatched > 0){
2040 fhChHadECharged ->Fill(e,eMC);
2041 fhChHadPtCharged ->Fill(pt,ptMC);
2042 fhChHadPhiCharged ->Fill(phi,phiMC);
2043 fhChHadEtaCharged ->Fill(eta,etaMC);
2049 //Match tracks and clusters
2050 //To be Modified in case of AODs
2052 //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
2054 if( nTracksMatched > 0){
2056 fhECharged ->Fill(e);
2057 fhPtCharged ->Fill(pt);
2058 fhPhiCharged ->Fill(phi);
2059 fhEtaCharged ->Fill(eta);
2061 fhEtaPhiECharged->Fill(eta,phi,e);
2062 fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster,eta);
2064 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2065 //Study the track and matched cluster if track exists.
2067 Double_t emcpos[3] = {0.,0.,0.};
2068 Double_t emcmom[3] = {0.,0.,0.};
2069 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2070 Double_t bfield = 0.;
2076 Double_t tpcSignal = 0;
2077 Bool_t okpos = kFALSE;
2078 Bool_t okmom = kFALSE;
2079 Bool_t okout = kFALSE;
2083 //In case of ESDs get the parameters in this way
2084 // if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2085 if (track->GetOuterParam() ) {
2088 bfield = GetReader()->GetInputEvent()->GetMagneticField();
2089 okpos = track->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2090 okmom = track->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2091 if(!(okpos && okmom)) return;
2093 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2094 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2095 tphi = position.Phi();
2096 teta = position.Eta();
2097 tmom = momentum.Mag();
2099 //Double_t tphi = track->GetOuterParam()->Phi();
2100 //Double_t teta = track->GetOuterParam()->Eta();
2101 //Double_t tmom = track->GetOuterParam()->P();
2104 tpcSignal = track->GetTPCsignal();
2106 nITS = track->GetNcls(0);
2107 nTPC = track->GetNcls(1);
2108 }//Outer param available
2110 // else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2111 // AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2114 // pid->GetEMCALPosition(emcpos);
2115 // pid->GetEMCALMomentum(emcmom);
2117 // TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2118 // TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2119 // tphi = position.Phi();
2120 // teta = position.Eta();
2121 // tmom = momentum.Mag();
2123 // tpt = ((AliAODTrack*)track)->Pt();
2124 // tmom2 = ((AliAODTrack*)track)->P();
2125 // tpcSignal = pid->GetTPCsignal();
2127 // //nITS = ((AliAODTrack*)track)->GetNcls(0);
2128 // //nTPC = ((AliAODTrack*)track)->GetNcls(1);
2129 // }//Outer param available
2131 // else return; //Do nothing case not implemented.
2134 Double_t deta = teta - eta;
2135 Double_t dphi = tphi - phi;
2136 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2137 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2138 Double_t dR = sqrt(dphi*dphi + deta*deta);
2140 Double_t pOverE = tmom/e;
2142 fh1pOverE->Fill(tpt, pOverE);
2143 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
2146 fh2MatchdEdx->Fill(tmom2,tpcSignal);
2148 if(IsDataMC() && primary){
2149 Int_t pdg = primary->GetPdgCode();
2150 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2152 if(TMath::Abs(pdg) == 11){
2153 fhMCEle1pOverE->Fill(tpt,pOverE);
2154 fhMCEle1dR->Fill(dR);
2155 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2156 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2159 fhMCChHad1pOverE->Fill(tpt,pOverE);
2160 fhMCChHad1dR->Fill(dR);
2161 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2162 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2164 else if(charge == 0){
2165 fhMCNeutral1pOverE->Fill(tpt,pOverE);
2166 fhMCNeutral1dR->Fill(dR);
2167 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2168 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2172 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2173 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2174 fh2EledEdx->Fill(tmom2,tpcSignal);
2177 else{//no ESD external param or AODPid
2178 // ULong_t status=AliESDtrack::kTPCrefit;
2179 // status|=AliESDtrack::kITSrefit;
2180 //printf("track status %d\n", track->GetStatus() );
2181 // fhEChargedNoOut ->Fill(e);
2182 // fhPtChargedNoOut ->Fill(pt);
2183 // fhPhiChargedNoOut ->Fill(phi);
2184 // fhEtaChargedNoOut ->Fill(eta);
2185 // fhEtaPhiChargedNoOut ->Fill(eta,phi);
2186 // if(GetDebug() >= 0 && ((track->GetStatus() & status) == status)) printf("ITS+TPC\n");
2187 if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
2190 }//matched clusters with tracks
2194 //__________________________________
2195 //void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
2196 // // Correlate information from PHOS and EMCAL
2197 // TRefArray * caloClustersEMCAL = 0;
2198 // TRefArray * caloClustersPHOS = 0;
2200 // // Get once the array of clusters per calorimeter, avoid an extra loop.
2201 // if(fCalorimeter == "EMCAL"){
2202 // caloClustersPHOS = new TRefArray();
2203 // GetReader()->GetInputEvent()->GetPHOSClusters(caloClustersPHOS);
2204 // caloClustersEMCAL = new TRefArray(*refArray);
2206 // else if(fCalorimeter == "PHOS") {
2207 // caloClustersEMCAL = new TRefArray();
2208 // GetReader()->GetInputEvent()->GetEMCALClusters (caloClustersEMCAL);
2209 // caloClustersPHOS = new TRefArray(*refArray);
2212 // //Fill histograms with clusters
2214 // fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2215 // Float_t sumClusterEnergyEMCAL = 0;
2216 // Float_t sumClusterEnergyPHOS = 0;
2218 // for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2219 // sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
2220 // for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2221 // sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
2222 // fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2224 // //Fill histograms with cells
2226 // AliVCaloCells * cellsEMCAL = GetReader()->GetInputEvent()->GetEMCALCells();
2227 // AliVCaloCells * cellsPHOS = GetReader()->GetInputEvent()->GetPHOSCells();
2228 // fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2231 // Float_t sumCellEnergyEMCAL = 0;
2232 // Float_t sumCellEnergyPHOS = 0;
2233 // for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2234 // sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2235 // for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2236 // sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2237 // fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2238 // if(GetDebug() > 0 ){
2239 // printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2240 // printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2241 // cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2242 // printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2243 // cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2246 // delete caloClustersEMCAL;
2247 // delete caloClustersPHOS;
2251 //__________________________________
2252 void AliAnaCalorimeterQA::CorrelateCalorimeters(){
2253 // Correlate information from PHOS and EMCAL
2254 TObjArray * caloClustersEMCAL = GetAODEMCAL();
2255 TObjArray * caloClustersPHOS = GetAODPHOS();
2257 //Fill histograms with clusters
2259 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2260 Float_t sumClusterEnergyEMCAL = 0;
2261 Float_t sumClusterEnergyPHOS = 0;
2263 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2264 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
2265 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2266 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
2267 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2269 //Fill histograms with cells
2271 AliVCaloCells * cellsEMCAL = GetEMCALCells();
2272 AliVCaloCells * cellsPHOS = GetPHOSCells();
2273 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2276 Float_t sumCellEnergyEMCAL = 0;
2277 Float_t sumCellEnergyPHOS = 0;
2278 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2279 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2280 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2281 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2282 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2283 if(GetDebug() > 0 ){
2284 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2285 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2286 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2287 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2288 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2293 //______________________________________________________________________________
2294 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
2295 //Fill pure monte carlo related histograms
2297 Float_t eMC = mom.E();
2298 Float_t ptMC = mom.Pt();
2299 Float_t phiMC = mom.Phi();
2301 phiMC += TMath::TwoPi();
2302 Float_t etaMC = mom.Eta();
2304 if (TMath::Abs(etaMC) > 1) return;
2307 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2310 fhGenGamPt ->Fill(ptMC);
2311 fhGenGamEta->Fill(etaMC);
2312 fhGenGamPhi->Fill(phiMC);
2314 fhGenGamAccE ->Fill(eMC);
2315 fhGenGamAccPt ->Fill(ptMC);
2316 fhGenGamAccEta->Fill(etaMC);
2317 fhGenGamAccPhi->Fill(phiMC);
2320 else if (pdg==111) {
2321 fhGenPi0Pt ->Fill(ptMC);
2322 fhGenPi0Eta->Fill(etaMC);
2323 fhGenPi0Phi->Fill(phiMC);
2325 fhGenPi0AccE ->Fill(eMC);
2326 fhGenPi0AccPt ->Fill(ptMC);
2327 fhGenPi0AccEta->Fill(etaMC);
2328 fhGenPi0AccPhi->Fill(phiMC);
2331 else if (pdg==221) {
2332 fhGenEtaPt ->Fill(ptMC);
2333 fhGenEtaEta->Fill(etaMC);
2334 fhGenEtaPhi->Fill(phiMC);
2336 else if (pdg==223) {
2337 fhGenOmegaPt ->Fill(ptMC);
2338 fhGenOmegaEta->Fill(etaMC);
2339 fhGenOmegaPhi->Fill(phiMC);
2341 else if (TMath::Abs(pdg)==11) {
2342 fhGenElePt ->Fill(ptMC);
2343 fhGenEleEta->Fill(etaMC);
2344 fhGenElePhi->Fill(phiMC);
2349 //________________________________________________________________________
2350 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2352 // Needed when Terminate is executed in distributed environment
2353 // Refill analysis histograms of this class with corresponding histograms in output list.
2355 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2356 // the first one and then add the next
2357 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
2358 //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2360 //Read histograms, must be in the same order as in GetCreateOutputObject.
2361 fhE = (TH1F *) outputList->At(index++);
2363 fhPt = (TH1F *) outputList->At(index++);
2364 fhPhi = (TH1F *) outputList->At(index++);
2365 fhEta = (TH1F *) outputList->At(index++);
2367 fhEtaPhiE = (TH3F *) outputList->At(index++);
2369 fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
2371 fhLambda = (TH3F *) outputList->At(index++);
2372 fhDispersion = (TH2F *) outputList->At(index++);
2374 fhECharged = (TH1F *) outputList->At(index++);
2375 fhPtCharged = (TH1F *) outputList->At(index++);
2376 fhPhiCharged = (TH1F *) outputList->At(index++);
2377 fhEtaCharged = (TH1F *) outputList->At(index++);
2379 fhEtaPhiECharged = (TH3F *) outputList->At(index++);
2381 fh1pOverE = (TH2F *) outputList->At(index++);
2382 fh1dR = (TH1F *) outputList->At(index++);
2383 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2384 fh2EledEdx = (TH2F *) outputList->At(index++);
2385 fh1pOverER02 = (TH2F *) outputList->At(index++);
2387 fhIM = (TH2F *) outputList->At(index++);
2388 fhIMCellCut = (TH2F *) outputList->At(index++);
2389 fhAsym = (TH2F *) outputList->At(index++);
2391 fhNCellsPerCluster = (TH3F *) outputList->At(index++);
2392 fhNCellsPerClusterMIP = (TH3F *) outputList->At(index++);
2393 fhNCellsPerClusterMIPCharged = (TH3F *) outputList->At(index++);
2394 fhNClusters = (TH1F *) outputList->At(index++);
2396 fhRNCells = (TH2F *) outputList->At(index++);
2397 fhXNCells = (TH2F *) outputList->At(index++);
2398 fhYNCells = (TH2F *) outputList->At(index++);
2399 fhZNCells = (TH2F *) outputList->At(index++);
2400 fhRE = (TH2F *) outputList->At(index++);
2401 fhXE = (TH2F *) outputList->At(index++);
2402 fhYE = (TH2F *) outputList->At(index++);
2403 fhZE = (TH2F *) outputList->At(index++);
2404 fhXYZ = (TH3F *) outputList->At(index++);
2405 if(fFillAllPosHisto){
2406 fhRCellE = (TH2F *) outputList->At(index++);
2407 fhXCellE = (TH2F *) outputList->At(index++);
2408 fhYCellE = (TH2F *) outputList->At(index++);
2409 fhZCellE = (TH2F *) outputList->At(index++);
2410 fhXYZCell = (TH3F *) outputList->At(index++);
2411 fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
2412 fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
2413 fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
2414 fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
2415 fhDeltaCellClusterRE = (TH2F *) outputList->At(index++);
2416 fhDeltaCellClusterXE = (TH2F *) outputList->At(index++);
2417 fhDeltaCellClusterYE = (TH2F *) outputList->At(index++);
2418 fhDeltaCellClusterZE = (TH2F *) outputList->At(index++);
2419 fhEtaPhiAmp = (TH3F *) outputList->At(index++);
2422 fhNCells = (TH1F *) outputList->At(index++);
2423 fhAmplitude = (TH1F *) outputList->At(index++);
2424 fhAmpId = (TH2F *) outputList->At(index++);
2426 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2428 fhCellTimeSpreadRespectToCellMax = (TH1F *) outputList->At(index++);
2429 fhCellIdCellLargeTimeSpread = (TH1F *) outputList->At(index++);
2431 fhTime = (TH1F *) outputList->At(index++);
2432 fhTimeId = (TH2F *) outputList->At(index++);
2433 fhTimeAmp = (TH2F *) outputList->At(index++);
2435 // fhT0Time = (TH1F *) outputList->At(index++);
2436 // fhT0TimeId = (TH2F *) outputList->At(index++);
2437 // fhT0TimeAmp = (TH2F *) outputList->At(index++);
2442 if(fCorrelateCalos){
2443 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2444 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2445 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2446 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2450 fhEMod = new TH1F*[fNModules];
2451 fhNClustersMod = new TH1F*[fNModules];
2452 fhNCellsPerClusterMod = new TH2F*[fNModules];
2453 fhNCellsMod = new TH1F*[fNModules];
2454 fhGridCellsMod = new TH2F*[fNModules];
2455 fhGridCellsEMod = new TH2F*[fNModules];
2456 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2457 fhGridCellsTimeMod = new TH2F*[fNModules];
2458 fhAmplitudeMod = new TH1F*[fNModules];
2459 if(fCalorimeter=="EMCAL")
2460 fhAmplitudeModFraction = new TH1F*[fNModules*3];
2463 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2465 fhIMMod = new TH2F*[fNModules];
2466 fhIMCellCutMod = new TH2F*[fNModules];
2468 for(Int_t imod = 0 ; imod < fNModules; imod++){
2469 fhEMod[imod] = (TH1F *) outputList->At(index++);
2470 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2471 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2472 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2473 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2474 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2475 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2476 fhGridCellsTimeMod[imod] = (TH2F *) outputList->At(index++);
2477 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2479 if(fCalorimeter=="EMCAL"){
2480 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
2481 fhAmplitudeModFraction[imod*3+ifrac] = (TH1F *) outputList->At(index++);
2485 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
2486 fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2487 //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2488 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
2489 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
2490 // fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2] = (TH2F *) outputList->At(index++);
2494 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2495 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
2500 fhDeltaE = (TH1F *) outputList->At(index++);
2501 fhDeltaPt = (TH1F *) outputList->At(index++);
2502 fhDeltaPhi = (TH1F *) outputList->At(index++);
2503 fhDeltaEta = (TH1F *) outputList->At(index++);
2505 fhRatioE = (TH1F *) outputList->At(index++);
2506 fhRatioPt = (TH1F *) outputList->At(index++);
2507 fhRatioPhi = (TH1F *) outputList->At(index++);
2508 fhRatioEta = (TH1F *) outputList->At(index++);
2510 fh2E = (TH2F *) outputList->At(index++);
2511 fh2Pt = (TH2F *) outputList->At(index++);
2512 fh2Phi = (TH2F *) outputList->At(index++);
2513 fh2Eta = (TH2F *) outputList->At(index++);
2515 fhGamE = (TH2F *) outputList->At(index++);
2516 fhGamPt = (TH2F *) outputList->At(index++);
2517 fhGamPhi = (TH2F *) outputList->At(index++);
2518 fhGamEta = (TH2F *) outputList->At(index++);
2520 fhGamDeltaE = (TH1F *) outputList->At(index++);
2521 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2522 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2523 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2525 fhGamRatioE = (TH1F *) outputList->At(index++);
2526 fhGamRatioPt = (TH1F *) outputList->At(index++);
2527 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2528 fhGamRatioEta = (TH1F *) outputList->At(index++);
2530 fhPi0E = (TH2F *) outputList->At(index++);
2531 fhPi0Pt = (TH2F *) outputList->At(index++);
2532 fhPi0Phi = (TH2F *) outputList->At(index++);
2533 fhPi0Eta = (TH2F *) outputList->At(index++);
2535 fhEleE = (TH2F *) outputList->At(index++);
2536 fhElePt = (TH2F *) outputList->At(index++);
2537 fhElePhi = (TH2F *) outputList->At(index++);
2538 fhEleEta = (TH2F *) outputList->At(index++);
2540 fhNeHadE = (TH2F *) outputList->At(index++);
2541 fhNeHadPt = (TH2F *) outputList->At(index++);
2542 fhNeHadPhi = (TH2F *) outputList->At(index++);
2543 fhNeHadEta = (TH2F *) outputList->At(index++);
2545 fhChHadE = (TH2F *) outputList->At(index++);
2546 fhChHadPt = (TH2F *) outputList->At(index++);
2547 fhChHadPhi = (TH2F *) outputList->At(index++);
2548 fhChHadEta = (TH2F *) outputList->At(index++);
2550 fhGamECharged = (TH2F *) outputList->At(index++);
2551 fhGamPtCharged = (TH2F *) outputList->At(index++);
2552 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2553 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2555 fhPi0ECharged = (TH2F *) outputList->At(index++);
2556 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2557 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2558 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2560 fhEleECharged = (TH2F *) outputList->At(index++);
2561 fhElePtCharged = (TH2F *) outputList->At(index++);
2562 fhElePhiCharged = (TH2F *) outputList->At(index++);
2563 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2565 fhNeHadECharged = (TH2F *) outputList->At(index++);
2566 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2567 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2568 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2570 fhChHadECharged = (TH2F *) outputList->At(index++);
2571 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2572 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2573 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2575 // fhEMVxyz = (TH3F *) outputList->At(index++);
2576 // fhHaVxyz = (TH3F *) outputList->At(index++);
2578 fhEMVxyz = (TH2F *) outputList->At(index++);
2579 fhHaVxyz = (TH2F *) outputList->At(index++);
2580 fhEMR = (TH2F *) outputList->At(index++);
2581 fhHaR = (TH2F *) outputList->At(index++);
2583 fhGenGamPt = (TH1F *) outputList->At(index++);
2584 fhGenGamEta = (TH1F *) outputList->At(index++);
2585 fhGenGamPhi = (TH1F *) outputList->At(index++);
2587 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2588 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2589 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2591 fhGenEtaPt = (TH1F *) outputList->At(index++);
2592 fhGenEtaEta = (TH1F *) outputList->At(index++);
2593 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2595 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2596 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2597 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2599 fhGenElePt = (TH1F *) outputList->At(index++);
2600 fhGenEleEta = (TH1F *) outputList->At(index++);
2601 fhGenElePhi = (TH1F *) outputList->At(index++);
2603 fhGenGamAccE = (TH1F *) outputList->At(index++);
2604 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2605 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2606 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2608 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2609 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2610 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2611 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2613 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
2614 fhMCEle1dR = (TH1F *) outputList->At(index++);
2615 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2617 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
2618 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2619 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2621 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
2622 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2623 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2625 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2626 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2627 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
2631 //__________________________________________________________________
2632 void AliAnaCalorimeterQA::Terminate(TList* outputList)
2634 //Do plots if requested
2636 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
2637 if(!fMakePlots) return;
2639 //Do some plots to end
2640 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
2641 //Recover histograms from output histograms list, needed for distributed analysis.
2642 ReadHistograms(outputList);
2644 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2645 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
2647 const Int_t buffersize = 255;
2648 char name[buffersize];
2649 char cname[buffersize];
2651 //In case terminate is executed after the analysis, in a second step, and we want to rebin or to change the range of the histograms for plotting
2652 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
2653 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
2654 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
2655 // Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
2656 // Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
2657 // Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
2658 // Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
2659 // Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
2660 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
2661 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
2662 // Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
2663 // Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
2664 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
2665 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
2666 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
2667 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
2669 //Color code for the different modules
2670 Int_t modColorIndex[]={2,4,6,8};
2672 //--------------------------------------------------
2673 // Cluster energy distributions, module dependence
2674 //--------------------------------------------------
2675 snprintf(cname,buffersize,"QA_%s_ClusterEnergy",fCalorimeter.Data());
2676 TCanvas * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
2678 Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
2679 //printf("new E rb %d\n",rbE);
2681 fhE->SetAxisRange(ptmin,ptmax,"X");
2683 if(fhE->GetEntries() > 0) gPad->SetLogy();
2684 TLegend pLegendE(0.7,0.6,0.9,0.8);
2685 pLegendE.SetTextSize(0.03);
2686 pLegendE.AddEntry(fhE,"all modules","L");
2687 pLegendE.SetFillColor(10);
2688 pLegendE.SetBorderSize(1);
2691 fhE->SetLineColor(1);
2693 for(Int_t imod = 0; imod < fNModules; imod++){
2694 fhEMod[imod]->Rebin(rbE);
2695 fhEMod[imod]->SetLineColor(modColorIndex[imod]);
2696 fhEMod[imod]->Draw("HE same");
2697 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
2703 TLegend pLegendER(0.55,0.8,0.9,0.9);
2704 pLegendER.SetTextSize(0.03);
2705 pLegendER.SetFillColor(10);
2706 pLegendER.SetBorderSize(1);
2708 for(Int_t imod = 1; imod < fNModules; imod++){
2709 TH1D * htmp = (TH1D*)fhEMod[imod]->Clone(Form("hERat%d",imod));
2710 htmp->Divide(fhEMod[0]);
2711 htmp->SetLineColor(modColorIndex[imod]);
2713 htmp->SetTitle("Ratio module X / module 0");
2714 htmp->SetAxisRange(ptmin,ptmax,"X");
2715 htmp->SetMaximum(5);
2716 htmp->SetMinimum(0);
2717 htmp->SetAxisRange(ptmin,ptmax,"X");
2721 htmp->Draw("same HE");
2723 pLegendER.AddEntry(fhEMod[imod],Form("module %d / module 0",imod),"L");
2727 snprintf(name,buffersize,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
2728 c->Print(name); printf("Plot: %s\n",name);
2730 //--------------------------------------------------
2731 // Cell energy distributions, module dependence
2732 //--------------------------------------------------
2733 snprintf(cname,buffersize,"%s_QA_CellEnergy",fCalorimeter.Data());
2734 TCanvas * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
2737 Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
2738 //printf("new Amp rb %d\n",rbAmp);
2739 fhAmplitude->Rebin(rbAmp);
2740 fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
2743 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
2744 TLegend pLegendA(0.7,0.6,0.9,0.8);
2745 pLegendA.SetTextSize(0.03);
2746 pLegendA.AddEntry(fhE,"all modules","L");
2747 pLegendA.SetFillColor(10);
2748 pLegendA.SetBorderSize(1);
2749 fhAmplitude->SetMinimum(0.1);
2750 fhAmplitude->SetLineColor(1);
2751 fhAmplitude->Draw("HE");
2753 for(Int_t imod = 0; imod < fNModules; imod++){
2754 fhAmplitudeMod[imod]->Rebin(rbAmp);
2755 fhAmplitudeMod[imod]->SetLineColor(modColorIndex[imod]);
2756 fhAmplitudeMod[imod]->Draw("HE same");
2757 pLegendA.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
2763 TLegend pLegendAR(0.55,0.8,0.9,0.9);
2764 pLegendAR.SetTextSize(0.03);
2765 pLegendAR.SetFillColor(10);
2766 pLegendAR.SetBorderSize(1);
2768 for(Int_t imod = 1; imod < fNModules; imod++){
2769 TH1D * htmp = (TH1D*)fhAmplitudeMod[imod]->Clone(Form("hAmpRat%d",imod));
2770 htmp->Divide(fhAmplitudeMod[0]);
2771 htmp->SetLineColor(modColorIndex[imod]);
2773 htmp->SetTitle("Ratio cells energy in module X / module 0");
2774 htmp->SetAxisRange(ptmin,ptmax,"X");
2775 htmp->SetMaximum(5);
2776 htmp->SetMinimum(0);
2780 htmp->Draw("same HE");
2781 pLegendAR.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
2785 snprintf(name,buffersize,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
2786 ca->Print(name); printf("Plot: %s\n",name);
2788 //----------------------------------------------------------
2789 // Cell energy distributions, FRACTION of module dependence
2790 // See Super Module calibration difference
2791 //---------------------------------------------------------
2792 if(fCalorimeter=="EMCAL"){
2794 snprintf(cname,buffersize,"%s_QA_SMThirds",fCalorimeter.Data());
2795 TCanvas * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
2796 cfrac->Divide(2, 3);
2798 if(fhAmplitude->GetEntries() > 0)
2800 TLegend pLegend1(0.6,0.6,0.9,0.8);
2801 pLegend1.SetTextSize(0.03);
2802 pLegend1.SetFillColor(10);
2803 pLegend1.SetBorderSize(1);
2804 pLegend1.SetHeader("Third close to Eta=0");
2805 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0");
2806 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
2807 fhAmplitudeModFraction[0]->Draw("axis");
2808 TH1D * hAverageThird1 = (TH1D *)fhAmplitudeModFraction[3*0+2]->Clone("AverageThird1");
2809 for(Int_t imod = 0; imod < fNModules; imod++){
2811 if(imod%2==0) ifrac = 2;
2812 if(imod > 0) hAverageThird1->Add( fhAmplitudeModFraction[3*imod+ifrac]);
2813 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
2814 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
2815 pLegend1.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
2817 hAverageThird1 ->Scale(1./fNModules);
2821 for(Int_t imod = 0; imod < fNModules; imod++){
2823 if(imod%2==0) ifrac = 2;
2824 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
2825 htmp->Divide(hAverageThird1);
2827 htmp ->SetTitle("Close to eta = 0");
2828 htmp ->SetMaximum(5);
2829 htmp ->SetMinimum(0);
2830 htmp ->SetAxisRange(ptmin,ptmax,"X");
2831 htmp ->SetYTitle("ratio third to average");
2834 else htmp -> Draw("same HE");
2840 if(fhAmplitude->GetEntries() > 0)
2842 TLegend pLegend2(0.6,0.6,0.9,0.8);
2843 pLegend2.SetTextSize(0.03);
2844 pLegend2.SetFillColor(10);
2845 pLegend2.SetBorderSize(1);
2846 pLegend2.SetHeader("Middle Third");
2848 fhAmplitudeModFraction[0]->SetTitle("Middle Third");
2849 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
2850 fhAmplitudeModFraction[0]->Draw("axis");
2852 TH1D * hAverageThird2 = (TH1D *)fhAmplitudeModFraction[3*0+1]->Clone("AverageThird2");
2853 for(Int_t imod = 0; imod < fNModules; imod++){
2855 if(imod > 0) hAverageThird2->Add( fhAmplitudeModFraction[3*imod+ifrac]);
2856 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
2857 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
2858 pLegend2.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
2860 hAverageThird2->Scale(1./fNModules);
2866 for(Int_t imod = 0; imod < fNModules; imod++){
2868 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
2869 htmp->Divide(hAverageThird2);
2871 htmp ->SetTitle("Middle");
2872 htmp ->SetMaximum(5);
2873 htmp ->SetMinimum(0);
2874 htmp ->SetAxisRange(ptmin,ptmax,"X");
2875 htmp ->SetYTitle("ratio third to average");
2878 else htmp -> Draw("same HE");
2884 if(fhAmplitude->GetEntries() > 0)
2886 TLegend pLegend3(0.6,0.6,0.9,0.8);
2887 pLegend3.SetTextSize(0.03);
2888 pLegend3.SetFillColor(10);
2889 pLegend3.SetBorderSize(1);
2890 pLegend3.SetHeader("Third close to Eta=0.7");
2892 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0.7");
2893 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
2894 fhAmplitudeModFraction[0]->Draw("axis");
2896 TH1D * hAverageThird3 = (TH1D *)fhAmplitudeModFraction[3*0+0]->Clone("AverageThird3");
2897 for(Int_t imod = 0; imod < 4; imod++){
2899 if(imod%2==0) ifrac = 0;
2900 if(imod > 0) hAverageThird3->Add( fhAmplitudeModFraction[3*imod+ifrac]);
2901 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
2902 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
2903 pLegend3.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
2905 hAverageThird3 ->Scale(1./fNModules);
2910 for(Int_t imod = 0; imod < fNModules; imod++){
2912 if(imod%2==0) ifrac = 0;
2913 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
2914 htmp->Divide(hAverageThird3);
2916 htmp ->SetTitle("Close to eta = 0.7");
2917 htmp ->SetMaximum(5);
2918 htmp ->SetMinimum(0);
2919 htmp ->SetAxisRange(ptmin,ptmax,"X");
2920 htmp ->SetYTitle("ratio third to average");
2923 else htmp ->Draw("same HE");
2927 snprintf(name,buffersize,"QA_%s_CellEnergyModuleFraction.eps",fCalorimeter.Data());
2928 cfrac->Print(name); printf("Create plot %s\n",name);
2932 //----------------------------------------------------------
2933 // Cluster eta and phi distributions, energy cut dependence
2934 //---------------------------------------------------------
2936 snprintf(cname,buffersize,"%s_QA_EtaPhiCluster",fCalorimeter.Data());
2937 TCanvas * cetaphic = new TCanvas(cname, "Eta-Phi Reconstructed distributions", 1200, 400) ;
2938 cetaphic->Divide(3, 1);
2943 Float_t ecut[] = {0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3};
2944 Int_t ecutcolor[]= {2, 4, 6, 7, 8, 9, 12};
2945 TH1D * hE = fhEtaPhiE->ProjectionZ();
2952 TLegend pLegendPhiCl(0.83,0.6,0.95,0.93);
2953 pLegendPhiCl.SetTextSize(0.03);
2954 pLegendPhiCl.SetFillColor(10);
2955 pLegendPhiCl.SetBorderSize(1);
2957 TH1D * htmp = fhEtaPhiE->ProjectionY("hphi_cluster_nocut",0,-1,0,-1);
2959 htmp->SetMinimum(1);
2960 rbPhi = GetNewRebinForRePlotting(htmp, phimin, phimax,nphibins) ;
2961 //printf("new Phi rb %d\n",rbPhi);
2963 htmp->SetTitle("#phi of clusters for energy in cluster > threshold");
2964 htmp->SetAxisRange(phimin,phimax,"X");
2966 pLegendPhiCl.AddEntry(htmp,"No cut","L");
2968 for (Int_t i = 0; i < ncuts; i++) {
2969 binmin = hE->FindBin(ecut[i]);
2970 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
2971 htmp = fhEtaPhiE->ProjectionY(Form("hphi_cluster_cut%d",i),0,-1,binmin,-1);
2972 htmp->SetLineColor(ecutcolor[i]);
2974 htmp->Draw("same HE");
2975 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
2979 pLegendPhiCl.Draw();
2986 htmp = fhEtaPhiE->ProjectionX("heta_cluster_nocut",0,-1,0,-1);
2987 htmp ->SetLineColor(1);
2988 rbEta = GetNewRebinForRePlotting(htmp,etamin, etamax,netabins) ;
2989 //printf("new Eta rb %d\n",rbEta);
2992 htmp->SetMinimum(1);
2993 htmp->SetTitle("#eta of clusters for energy in cluster > threshold");
2994 htmp->SetAxisRange(etamin,etamax,"X");
2997 for (Int_t i = 0; i < ncuts; i++) {
2998 binmin = hE->FindBin(ecut[i]);
2999 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3000 htmp = fhEtaPhiE->ProjectionX(Form("heta_cluster_cut%d",i),0,-1,binmin,-1);
3001 htmp->SetLineColor(ecutcolor[i]);
3003 htmp->Draw("same HE");
3008 TH2D* hEtaPhiCl = (TH2D*) fhEtaPhiE->Project3D("xy");
3009 hEtaPhiCl->SetAxisRange(etamin,etamax,"X");
3010 hEtaPhiCl->SetAxisRange(phimin,phimax,"Y");
3011 hEtaPhiCl->Draw("colz");
3013 snprintf(name,buffersize,"QA_%s_ClusterEtaPhi.eps",fCalorimeter.Data());
3014 cetaphic->Print(name); printf("Create plot %s\n",name);
3016 //----------------------------------------------------------
3017 // Cell eta and phi distributions, energy cut dependence
3018 //---------------------------------------------------------
3020 snprintf(cname,buffersize,"%s_QA_EtaPhiCell",fCalorimeter.Data());
3021 TCanvas * cetaphicell = new TCanvas(cname, "Eta-Phi Cells distributions", 1200, 400) ;
3022 cetaphicell->Divide(3, 1);
3025 cetaphicell->cd(1) ;
3029 TLegend pLegendPhiCell(0.83,0.6,0.95,0.93);
3030 pLegendPhiCell.SetTextSize(0.03);
3031 pLegendPhiCell.SetFillColor(10);
3032 pLegendPhiCell.SetBorderSize(1);
3034 htmp = fhEtaPhiAmp->ProjectionY("hphi_cell_nocut",0,-1,0,-1);
3036 htmp->SetMinimum(1);
3038 htmp->SetTitle("#phi of cells for cell energy > threshold");
3039 htmp->SetAxisRange(phimin,phimax,"X");
3041 pLegendPhiCell.AddEntry(htmp,"No cut","L");
3043 for (Int_t i = 0; i < ncuts; i++) {
3044 binmin = hE->FindBin(ecut[i]);
3045 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3046 htmp = fhEtaPhiAmp->ProjectionY(Form("hphi_cell_cut%d",i),0,-1,binmin,-1);
3047 htmp->SetLineColor(ecutcolor[i]);
3049 htmp->Draw("same HE");
3050 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3054 pLegendPhiCell.Draw();
3057 cetaphicell->cd(2) ;
3061 htmp = fhEtaPhiAmp->ProjectionX("heta_cell_nocut",0,-1,0,-1);
3063 htmp ->SetLineColor(1);
3065 htmp->SetMinimum(1);
3066 htmp->SetTitle("#eta of cells for cell energy > threshold");
3067 htmp->SetAxisRange(etamin,etamax,"X");
3070 for (Int_t i = 0; i < ncuts; i++) {
3071 binmin = hE->FindBin(ecut[i]);
3072 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3073 htmp = fhEtaPhiAmp->ProjectionX(Form("heta_cell_cut%d",i),0,-1,binmin,-1);
3074 htmp->SetLineColor(ecutcolor[i]);
3076 htmp->Draw("same HE");
3081 cetaphicell->cd(3) ;
3082 TH2D* hEtaPhiCell = (TH2D*) fhEtaPhiAmp->Project3D("xy");
3083 hEtaPhiCell->SetAxisRange(etamin,etamax,"X");
3084 hEtaPhiCell->SetAxisRange(phimin,phimax,"Y");
3085 hEtaPhiCell->Draw("colz");
3087 snprintf(name,buffersize,"QA_%s_CellEtaPhi.eps",fCalorimeter.Data());
3088 cetaphicell->Print(name); printf("Create plot %s\n",name);
3091 ////////////////////////////////////////
3092 ///////// Global Positions /////////////
3093 ////////////////////////////////////////
3099 //if(fFillAllPosHisto)
3101 snprintf(cname,buffersize,"%s_QA_ClusterXY",fCalorimeter.Data());
3102 TCanvas * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
3106 TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
3107 hXY->SetTitle("Cluster X vs Y");
3108 hXY->GetYaxis()->SetTitleOffset(1.6);
3111 TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
3112 hYZ->SetTitle("Cluster Z vs Y");
3113 hYZ->GetYaxis()->SetTitleOffset(1.6);
3116 TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
3117 hXZ->SetTitle("Cluster X vs Z");
3118 hXZ->GetYaxis()->SetTitleOffset(1.6);
3121 snprintf(name,buffersize,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
3122 cxyz->Print(name); printf("Create plot %s\n",name);
3124 snprintf(cname,buffersize,"QA_%s_ClusterX",fCalorimeter.Data());
3125 TCanvas * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
3129 TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
3132 hX->SetTitle("Cluster X ");
3134 rbX = GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
3135 //printf("new X rb %d\n",rbX);
3137 hX->SetMinimum(hX->GetMaximum()/2);
3138 hX->SetAxisRange(xmin,xmax);
3141 TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
3143 hY->SetTitle("Cluster Y ");
3144 rbY = GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
3145 //printf("new Y rb %d\n",rbY);
3148 hY->SetAxisRange(ymin,ymax);
3152 TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
3155 rbZ = GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
3156 //printf("new Z rb %d\n",rbZ);
3158 hZ->SetMinimum(hZ->GetMaximum()/2);
3159 hZ->SetAxisRange(zmin,zmax);
3162 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
3163 cx->Print(name); printf("Create plot %s\n",name);
3166 if(fFillAllPosHisto)
3168 snprintf(cname,buffersize,"%s_QA_CellXY",fCalorimeter.Data());
3169 TCanvas * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
3170 cellxyz->Divide(3, 1);
3173 TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
3174 hXYCell->SetTitle("Cell X vs Y");
3175 hXYCell->GetYaxis()->SetTitleOffset(1.6);
3176 hXYCell->Draw("colz");
3178 TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
3179 hYZCell->SetTitle("Cell Z vs Y");
3180 hYZCell->GetYaxis()->SetTitleOffset(1.6);
3181 hYZCell->Draw("colz");
3183 TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
3184 hXZCell->SetTitle("Cell X vs Z");
3185 hXZCell->GetYaxis()->SetTitleOffset(1.6);
3186 hXZCell->Draw("colz");
3188 snprintf(name,buffersize,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
3189 cellxyz->Print(name); printf("Create plot %s\n",name);
3192 snprintf(cname,buffersize,"%s_QA_CellX",fCalorimeter.Data());
3193 TCanvas * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
3194 cellx->Divide(3, 1);
3197 TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
3200 hXCell->SetTitle("Cell X ");
3202 hXCell->SetMinimum(hXCell->GetMaximum()/2);
3203 hXCell->SetAxisRange(xmin,xmax);
3207 TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
3209 hYCell->SetTitle("Cell Y ");
3211 hYCell->SetAxisRange(ymin,ymax);
3212 hYCell->SetMinimum(1);
3216 TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
3219 hZCell->SetAxisRange(zmin,zmax);
3220 hZCell->SetTitle("Cell Z ");
3222 hZCell->SetMinimum(hZCell->GetMaximum()/2);
3225 snprintf(name,buffersize,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
3226 cellx->Print(name); printf("Create plot %s\n",name);
3229 //----------------------------------------------------------
3230 // Cluster X, Y, Z, R, energy cut dependence
3231 //---------------------------------------------------------
3233 snprintf(cname,buffersize,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
3234 TCanvas * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
3241 TLegend pLegendXCl(0.83,0.6,0.95,0.93);
3242 pLegendXCl.SetTextSize(0.03);
3243 pLegendXCl.SetFillColor(10);
3244 pLegendXCl.SetBorderSize(1);
3246 htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
3249 htmp->SetMinimum(1);
3250 rbR = GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
3251 //printf("new R rb %d\n",rbR);
3253 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3254 htmp->SetAxisRange(rmin,rmax,"X");
3256 pLegendXCl.AddEntry(htmp,"No cut","L");
3258 for (Int_t i = 0; i < ncuts; i++) {
3259 binmin = hE->FindBin(ecut[i]);
3260 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3261 htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
3262 htmp->SetLineColor(ecutcolor[i]);
3264 htmp->Draw("same HE");
3265 pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3274 htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
3276 htmp->SetMinimum(1);
3278 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3279 htmp->SetAxisRange(xmin,xmax,"X");
3282 for (Int_t i = 0; i < ncuts; i++) {
3283 binmin = hE->FindBin(ecut[i]);
3284 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3285 htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
3286 htmp->SetLineColor(ecutcolor[i]);
3288 htmp->Draw("same HE");
3295 htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
3297 htmp->SetMinimum(1);
3299 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3300 htmp->SetAxisRange(ymin,ymax,"X");
3303 for (Int_t i = 0; i < ncuts; i++) {
3304 binmin = hE->FindBin(ecut[i]);
3305 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3306 htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
3307 htmp->SetLineColor(ecutcolor[i]);
3309 htmp->Draw("same HE");
3317 htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
3319 htmp->SetMinimum(1);
3321 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3322 htmp->SetAxisRange(zmin,zmax,"X");
3325 for (Int_t i = 0; i < ncuts; i++) {
3326 binmin = hE->FindBin(ecut[i]);
3327 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3328 htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
3329 htmp->SetLineColor(ecutcolor[i]);
3331 htmp->Draw("same HE");
3335 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3336 cxe->Print(name); printf("Create plot %s\n",name);
3339 //----------------------------------------------------------
3340 // Cluster X, Y, Z, R, NCells in cluster dependence
3341 //---------------------------------------------------------
3342 Int_t ncellcut[]={2, 3, 4};
3343 Int_t ncellcuts = 3;
3344 snprintf(cname,buffersize,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
3345 TCanvas * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
3352 TLegend pLegendXClN(0.83,0.6,0.95,0.93);
3353 pLegendXClN.SetTextSize(0.03);
3354 pLegendXClN.SetFillColor(10);
3355 pLegendXClN.SetBorderSize(1);
3357 htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
3359 htmp->SetMinimum(1);
3361 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3362 htmp->SetAxisRange(rmin,rmax,"X");
3364 pLegendXClN.AddEntry(htmp,"No cut","L");
3366 for (Int_t i = 0; i < ncellcuts; i++) {
3367 if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3368 else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
3369 htmp->SetLineColor(ecutcolor[i]);
3371 htmp->Draw("same HE");
3372 if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3373 else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3383 htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
3385 htmp->SetMinimum(1);
3387 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3388 htmp->SetAxisRange(xmin,xmax,"X");
3391 for (Int_t i = 0; i < ncellcuts; i++) {
3392 if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3393 else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
3394 htmp->SetLineColor(ecutcolor[i]);
3396 htmp->Draw("same HE");
3403 htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
3405 htmp->SetMinimum(1);
3407 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3408 htmp->SetAxisRange(ymin,ymax,"X");
3411 for (Int_t i = 0; i < ncellcuts; i++) {
3412 if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3413 else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
3414 htmp->SetLineColor(ecutcolor[i]);
3416 htmp->Draw("same HE");
3424 htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
3426 htmp->SetMinimum(1);
3428 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3429 htmp->SetAxisRange(zmin,zmax,"X");
3432 for (Int_t i = 0; i < ncellcuts; i++) {
3433 if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3434 else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
3435 htmp->SetLineColor(ecutcolor[i]);
3437 htmp->Draw("same HE");
3441 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
3442 cxn->Print(name); printf("Create plot %s\n",name);
3445 //----------------------------------------------------------
3446 // Cell X, Y, Z, R, energy cut dependence
3447 //---------------------------------------------------------
3449 snprintf(cname,buffersize,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
3450 TCanvas * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
3451 cxecell->Divide(2, 2);
3457 TLegend pLegendXCell(0.83,0.6,0.95,0.93);
3458 pLegendXCell.SetTextSize(0.03);
3459 pLegendXCell.SetFillColor(10);
3460 pLegendXCell.SetBorderSize(1);
3462 htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
3464 htmp->SetMinimum(1);
3466 htmp->SetTitle("r of cells for energy in cluster > threshold");
3467 htmp->SetAxisRange(rmin,rmax,"X");
3469 pLegendXCell.AddEntry(htmp,"No cut","L");
3471 for (Int_t i = 0; i < ncuts; i++) {
3472 binmin = hE->FindBin(ecut[i]);
3473 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3474 htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
3475 htmp->SetLineColor(ecutcolor[i]);
3477 htmp->Draw("same HE");
3478 pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3481 pLegendXCell.Draw();
3488 htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
3490 htmp->SetMinimum(1);
3492 htmp->SetTitle("x of cells for energy in cluster > threshold");
3493 htmp->SetAxisRange(xmin,xmax,"X");
3496 for (Int_t i = 0; i < ncuts; i++) {
3497 binmin = hE->FindBin(ecut[i]);
3498 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3499 htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
3500 htmp->SetLineColor(ecutcolor[i]);
3502 htmp->Draw("same HE");
3509 htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
3511 htmp->SetMinimum(1);
3513 htmp->SetTitle("y of cells for energy in cluster > threshold");
3514 htmp->SetAxisRange(ymin,ymax,"X");
3517 for (Int_t i = 0; i < ncuts; i++) {
3518 binmin = hE->FindBin(ecut[i]);
3519 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3520 htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
3521 htmp->SetLineColor(ecutcolor[i]);
3523 htmp->Draw("same HE");
3530 htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
3532 htmp->SetMinimum(1);
3534 htmp->SetTitle("z of cells for energy in cluster > threshold");
3535 htmp->SetAxisRange(zmin,zmax,"X");
3538 for (Int_t i = 0; i < ncuts; i++) {
3539 binmin = hE->FindBin(ecut[i]);
3540 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3541 htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
3542 htmp->SetLineColor(ecutcolor[i]);
3544 htmp->Draw("same HE");
3547 snprintf(name,buffersize,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3548 cxecell->Print(name); printf("Create plot %s\n",name);
3551 //----------------------------------------------------------
3552 // Cluster-Cell X, Y, Z, R, cluster energy cut dependence
3553 //---------------------------------------------------------
3554 Int_t rbDR= 1;//rbR;
3555 Int_t rbDX= 1;//rbX;
3556 Int_t rbDY= 1;//rbY;
3557 Int_t rbDZ= 1;//rbZ;
3559 snprintf(cname,buffersize,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
3560 TCanvas * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
3567 TLegend pLegendXClD(0.83,0.6,0.95,0.93);
3568 pLegendXClD.SetTextSize(0.03);
3569 pLegendXClD.SetFillColor(10);
3570 pLegendXClD.SetBorderSize(1);
3572 htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
3574 htmp->SetMinimum(1);
3576 htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
3577 htmp->SetAxisRange(-50,50,"X");
3579 pLegendXCl.AddEntry(htmp,"No cut","L");
3581 for (Int_t i = 0; i < ncuts; i++) {
3582 binmin = hE->FindBin(ecut[i]);
3583 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3584 htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
3585 htmp->SetLineColor(ecutcolor[i]);
3587 htmp->Draw("same HE");
3588 pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3597 htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
3599 htmp->SetMinimum(1);
3601 htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
3602 htmp->SetAxisRange(-50,50,"X");
3605 for (Int_t i = 0; i < ncuts; i++) {
3606 binmin = hE->FindBin(ecut[i]);
3607 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3608 htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
3609 htmp->SetLineColor(ecutcolor[i]);
3611 htmp->Draw("same HE");
3619 htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
3621 htmp->SetMinimum(1);
3623 htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
3624 htmp->SetAxisRange(-50,50,"X");
3627 for (Int_t i = 0; i < ncuts; i++) {
3628 binmin = hE->FindBin(ecut[i]);
3629 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3630 htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
3631 htmp->SetLineColor(ecutcolor[i]);
3633 htmp->Draw("same HE");
3642 htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
3644 htmp->SetMinimum(1);
3646 htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
3647 htmp->SetAxisRange(-50,50,"X");
3650 for (Int_t i = 0; i < ncuts; i++) {
3651 binmin = hE->FindBin(ecut[i]);
3652 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3653 htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
3654 htmp->SetLineColor(ecutcolor[i]);
3656 htmp->Draw("same HE");
3661 snprintf(name,buffersize,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3662 cxde->Print(name); printf("Create plot %s\n",name);
3665 //----------------------------------------------------------
3666 // Cluster-Cell X, Y, Z, R, NCells in cluster dependence
3667 //---------------------------------------------------------
3668 snprintf(cname,buffersize,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
3669 TCanvas * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
3676 TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
3677 pLegendXClDN.SetTextSize(0.03);
3678 pLegendXClDN.SetFillColor(10);
3679 pLegendXClDN.SetBorderSize(1);
3681 htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
3683 htmp->SetMinimum(1);
3685 htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
3686 htmp->SetAxisRange(-50,50,"X");
3688 pLegendXClDN.AddEntry(htmp,"No cut","L");
3690 for (Int_t i = 0; i < ncellcuts; i++) {
3691 if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
3692 else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
3693 htmp->SetLineColor(ecutcolor[i]);
3695 htmp->Draw("same HE");
3696 if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3697 else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3701 pLegendXClDN.Draw();
3707 htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
3709 htmp->SetMinimum(1);
3711 htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
3712 htmp->SetAxisRange(-50,50,"X");
3715 for (Int_t i = 0; i < ncellcuts; i++) {
3716 if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
3717 else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
3718 htmp->SetLineColor(ecutcolor[i]);
3720 htmp->Draw("same HE");
3728 htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
3730 htmp->SetMinimum(1);
3732 htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
3733 htmp->SetAxisRange(-50,50,"X");
3736 for (Int_t i = 0; i < ncellcuts; i++) {
3737 if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
3738 else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
3739 htmp->SetLineColor(ecutcolor[i]);
3741 htmp->Draw("same HE");
3750 htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
3752 htmp->SetMinimum(1);
3754 htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
3755 htmp->SetAxisRange(-50,50,"X");
3758 for (Int_t i = 0; i < ncellcuts; i++) {
3759 if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
3760 else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
3761 htmp->SetLineColor(ecutcolor[i]);
3763 htmp->Draw("same HE");
3768 snprintf(name,buffersize,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
3769 cxdn->Print(name); printf("Create plot %s\n",name);
3773 //----------------------------------------------------------
3774 //Reconstructed clusters energy-eta-phi distributions, matched with tracks
3775 //----------------------------------------------------------
3776 TH1F * hEChargedClone = 0 ;
3777 TH1F * hPtChargedClone = 0 ;
3778 TH1F * hEtaChargedClone = 0 ;
3779 TH1F * hPhiChargedClone = 0 ;
3781 hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
3782 hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
3783 hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
3784 hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
3786 snprintf(cname,buffersize,"QA_%s_rectrackmatch",fCalorimeter.Data());
3787 TCanvas * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
3788 ccltm->Divide(3, 1);
3791 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
3792 fhECharged->Rebin(rbE);
3793 fhECharged->SetAxisRange(ptmin,ptmax,"X");
3794 fhECharged->SetMinimum(1);
3798 if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
3799 fhPhiCharged->Rebin(rbPhi);
3800 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
3801 fhPhiCharged->Draw();
3802 fhPhiCharged->Draw();
3805 if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
3806 fhEtaCharged->Rebin(rbEta);
3807 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
3808 fhEtaCharged->Draw();
3809 fhEtaCharged->Draw();
3811 snprintf(name,buffersize,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
3812 ccltm->Print(name); printf("Plot: %s\n",name);
3814 //----------------------------------------------------------
3815 // Ratio of reconstructed clusters energy-eta-phi distributions, matched with tracks over all
3816 //----------------------------------------------------------
3818 snprintf(cname,buffersize,"%s_QA_ChargedRatio",fCalorimeter.Data());
3819 TCanvas * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
3820 ccharge->Divide(3, 1);
3823 fhECharged->Sumw2();
3825 fhECharged->Divide(fhE);
3826 fhECharged->SetAxisRange(ptmin,ptmax,"X");
3827 fhECharged->SetMaximum(0.5);
3828 fhECharged->SetYTitle("track-matched clusters / all clusters");
3829 fhECharged->Draw("HE");
3832 fhPhiCharged->Sumw2();
3833 fhPhi->Rebin(rbPhi);
3835 fhPhiCharged->Divide(fhPhi);
3836 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
3837 fhPhiCharged->SetMaximum(0.5);
3838 fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
3839 fhPhiCharged->Draw("HE");
3842 fhEtaCharged->Sumw2();
3843 fhEta->Rebin(rbEta);
3845 fhEtaCharged->Divide(fhEta);
3846 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
3847 fhEtaCharged->SetMaximum(0.5);
3848 fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
3849 fhEtaCharged->Draw("HE");
3851 snprintf(name,buffersize,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
3852 ccharge->Print(name); printf("Create plot %s\n",name);
3854 //-------------------------------------------
3855 // N Cells - N Clusters - N Cells per cluster
3856 //-------------------------------------------
3857 snprintf(cname,buffersize,"QA_%s_nclustercells",fCalorimeter.Data());
3858 TCanvas * cN = new TCanvas(cname, " Number of CaloClusters and CaloCells", 800, 1200) ;
3863 TLegend pLegendN(0.7,0.6,0.9,0.8);
3864 pLegendN.SetTextSize(0.03);
3865 pLegendN.AddEntry(fhNClusters,"all modules","L");
3866 pLegendN.SetFillColor(10);
3867 pLegendN.SetBorderSize(1);
3869 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
3871 fhNClusters->SetLineColor(1);
3874 if(fhNClusters->GetNbinsX()> nbins) rbN = fhNClusters->GetNbinsX()/nbins;
3876 fhNClusters->SetAxisRange(nmin,nmax,"X");
3877 fhNClusters->Draw("HE");
3878 for(Int_t imod = 0; imod < fNModules; imod++){
3879 fhNClustersMod[imod]->SetAxisRange(nmin,nmax,"X");
3880 fhNClustersMod[imod]->SetLineColor(modColorIndex[imod]);
3881 fhNClustersMod[imod]->Draw("same");
3882 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
3888 for(Int_t imod = 1; imod < fNModules; imod++){
3889 htmp = (TH1D*)fhNClustersMod[imod]->Clone(Form("hNClustersRat%d",imod));
3890 htmp->Divide(fhNClustersMod[0]);
3891 htmp->SetLineColor(modColorIndex[imod]);
3893 htmp->SetTitle("Ratio # clusters in module X / module 0");
3894 htmp->SetMaximum(5);
3895 htmp->SetMinimum(0);
3899 htmp->Draw("same HE");
3904 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
3906 fhNCells->SetLineColor(1);
3907 fhNCells->SetAxisRange(nmin,nmax,"X");
3908 fhNCells->Draw("HE");
3909 for(Int_t imod = 0; imod < fNModules; imod++){
3910 fhNCellsMod[imod]->SetAxisRange(nmin,nmax,"X");
3911 fhNCellsMod[imod]->SetLineColor(modColorIndex[imod]);
3912 fhNCellsMod[imod]->Draw("same HE");
3918 for(Int_t imod = 1; imod < fNModules; imod++){
3919 htmp = (TH1D*)fhNCellsMod[imod]->Clone(Form("hNCellsRat%d",imod));
3920 htmp->Divide(fhNCellsMod[0]);
3921 htmp->SetLineColor(modColorIndex[imod]);
3923 htmp->SetTitle("Ratio # cells in module X / module 0");
3924 htmp->SetMaximum(5);
3925 htmp->SetMinimum(0);
3929 htmp->Draw("same HE");
3934 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
3936 TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1,-1,-1);
3937 cpc->SetLineColor(1);
3938 cpc->SetTitle("# cells per cluster");
3940 TH1D ** hNCellsCluster1D = new TH1D*[fNModules];
3942 for(Int_t imod = 0; imod < fNModules; imod++){
3943 hNCellsCluster1D[imod] = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
3944 hNCellsCluster1D[imod]->SetLineColor(modColorIndex[imod]);
3945 hNCellsCluster1D[imod]->Draw("same HE");
3951 for(Int_t imod = 1; imod < fNModules; imod++){
3952 htmp = (TH1D*)hNCellsCluster1D[imod]->Clone(Form("hNClustersCells1DRat%d",imod));
3953 htmp->Divide(hNCellsCluster1D[0]);
3954 htmp->SetLineColor(modColorIndex[imod]);
3956 htmp->SetTitle("Ratio # cells per cluster in module X / module 0");
3957 //htmp->SetAxisRange(ptmin,ptmax,"X");
3958 htmp->SetMaximum(3.5);
3959 htmp->SetMinimum(0);
3963 htmp->Draw("same HE");
3965 delete [] hNCellsCluster1D;
3968 snprintf(name,buffersize,"QA_%s_NumberCaloClustersAndCaloCells.eps",fCalorimeter.Data());
3969 cN->Print(name); printf("Print plot %s\n",name);
3971 //----------------------------------------------------
3972 // Cell Time histograms, time only available in ESDs
3973 //----------------------------------------------------
3974 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
3976 snprintf(cname,buffersize,"QA_%s_cellstime",fCalorimeter.Data());
3977 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
3978 ctime->Divide(3, 1);
3981 if(fhTime->GetNbinsX()> ntimebins) rbTime = fhTime->GetNbinsX()/ntimebins;
3984 if(fhTime->GetEntries() > 0) gPad->SetLogy();
3985 fhTime->Rebin(rbTime);
3986 fhTime->SetAxisRange(timemin,timemax,"X");
3990 fhTimeId->SetTitleOffset(1.8,"Y");
3991 fhTimeId->SetAxisRange(timemin,timemax,"X");
3992 fhTimeId->Draw("colz");
3995 fhTimeAmp->SetTitle("Cell Energy vs Cell Time");
3996 fhTimeAmp->SetTitleOffset(1.8,"Y");
3997 fhTimeAmp->SetAxisRange(timemin,timemax,"Y");
3998 fhTimeAmp->SetAxisRange(ptmin,ptmax,"X");
3999 fhTimeAmp->Draw("colz");
4001 snprintf(name,buffersize,"QA_%s_CellsTime.eps",fCalorimeter.Data());
4002 ctime->Print(name); printf("Plot: %s\n",name);
4006 //---------------------------------
4007 //Grid of cell per module plots
4008 //---------------------------------
4010 //Number of entries per cell
4011 gStyle->SetPadRightMargin(0.15);
4012 snprintf(cname,buffersize,"%s_QA_GridCellEntries",fCalorimeter.Data());
4013 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
4014 if(fNModules%2 == 0)
4015 cgrid->Divide(fNModules/2,2);
4017 cgrid->Divide(fNModules/2+1,2);
4019 for(Int_t imod = 0; imod < fNModules ; imod++){
4024 //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
4025 fhGridCellsMod[imod]->SetZTitle("Counts ");
4026 fhGridCellsMod[imod]->SetYTitle("row (phi direction) ");
4027 //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
4028 fhGridCellsMod[imod]->Draw("colz");
4030 snprintf(name,buffersize,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
4031 cgrid->Print(name); printf("Create plot %s\n",name);
4033 snprintf(cname,buffersize,"%s_QA_GridCellAccumEnergy",fCalorimeter.Data());
4034 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
4035 if(fNModules%2 == 0)
4036 cgridE->Divide(fNModules/2,2);
4038 cgridE->Divide(fNModules/2+1,2);
4039 for(Int_t imod = 0; imod < fNModules ; imod++){
4044 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4045 fhGridCellsEMod[imod]->SetZTitle("Accumulated Energy (GeV) ");
4046 fhGridCellsEMod[imod]->SetYTitle("row (phi direction) ");
4047 fhGridCellsEMod[imod]->Draw("colz");
4049 snprintf(name,buffersize,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
4050 cgridE->Print(name); printf("Create plot %s\n",name);
4052 //Accumulated energy per cell
4053 snprintf(cname,buffersize,"%s_QA_GridCellAverageEnergy",fCalorimeter.Data());
4054 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
4055 if(fNModules%2 == 0)
4056 cgridEA->Divide(fNModules/2,2);
4058 cgridEA->Divide(fNModules/2+1,2);
4059 for(Int_t imod = 0; imod < fNModules ; imod++){
4060 cgridEA->cd(imod+1);
4064 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4065 fhGridCellsEMod[imod]->SetZTitle("Average Energy (GeV) ");
4066 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
4067 fhGridCellsEMod[imod]->Draw("colz");
4069 snprintf(name,buffersize,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
4070 cgridEA->Print(name); printf("Create plot %s\n",name);
4072 //Accumulated Time per cell, E > 0.5 GeV
4074 snprintf(cname,buffersize,"%s_QA_GridCellAccumTime",fCalorimeter.Data());
4075 TCanvas *cgridT = new TCanvas("cgridT","Summed time per cell", 12,12,800,400);
4076 if(fNModules%2 == 0)
4077 cgridT->Divide(fNModules/2,2);
4079 cgridE->Divide(fNModules/2+1,2);
4080 for(Int_t imod = 0; imod < fNModules ; imod++){
4085 //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
4086 fhGridCellsTimeMod[imod]->SetZTitle("Accumulated Time (ns) ");
4087 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction) ");
4088 fhGridCellsTimeMod[imod]->Draw("colz");
4090 snprintf(name,buffersize,"QA_%s_GridCellsAccumTime.eps",fCalorimeter.Data());
4091 cgridT->Print(name); printf("Create plot %s\n",name);
4095 //---------------------------------------------
4096 //Calorimeter Correlation, PHOS vs EMCAL
4097 //---------------------------------------------
4098 if(fCorrelateCalos){
4100 snprintf(cname,buffersize,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
4101 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
4102 ccorr->Divide(2, 2);
4107 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"X");
4108 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"Y");
4109 fhCaloCorrNClusters ->Draw();
4114 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"X");
4115 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"Y");
4116 fhCaloCorrNCells->Draw();
4120 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"X");
4121 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"Y");
4122 fhCaloCorrEClusters->Draw();
4127 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"X");
4128 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"Y");
4129 fhCaloCorrECells->Draw();
4131 snprintf(name,buffersize,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
4132 ccorr->Print(name); printf("Plot: %s\n",name);
4135 //----------------------------
4137 //-----------------------------
4139 Int_t imbinmin = -1;
4140 Int_t imbinmax = -1;
4142 if(fhIM->GetEntries() > 1){
4143 Int_t nebins = fhIM->GetNbinsX();
4144 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
4145 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
4146 if (emin != 0 ) printf("emin != 0 \n");
4147 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4149 snprintf(cname,buffersize,"QA_%s_IM",fCalorimeter.Data());
4151 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
4155 //fhIM->SetLineColor(4);
4158 imbinmax = (Int_t) (1-emin)*nebins/emax;
4159 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),imbinmin,imbinmax);
4160 pyim1->SetTitle("E_{pair} < 1 GeV");
4161 pyim1->SetLineColor(1);
4163 TLegend pLegendIM(0.7,0.6,0.9,0.8);
4164 pLegendIM.SetTextSize(0.03);
4165 pLegendIM.AddEntry(pyim1,"all modules","L");
4166 pLegendIM.SetFillColor(10);
4167 pLegendIM.SetBorderSize(1);
4169 for(Int_t imod = 0; imod < fNModules; imod++){
4170 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4171 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
4172 pyim1->SetLineColor(imod+1);
4173 pyim1->Draw("same");
4178 imbinmin = (Int_t) (1-emin)*nebins/emax;
4179 imbinmax = (Int_t) (2-emin)*nebins/emax;
4180 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),imbinmin,imbinmax);
4181 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
4182 pyim2->SetLineColor(1);
4184 for(Int_t imod = 0; imod < fNModules; imod++){
4185 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4186 pyim2->SetLineColor(imod+1);
4187 pyim2->Draw("same");
4191 imbinmin = (Int_t) (2-emin)*nebins/emax;
4192 imbinmax = (Int_t) (3-emin)*nebins/emax;
4193 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),imbinmin,imbinmax);
4194 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
4195 pyim3->SetLineColor(1);
4197 for(Int_t imod = 0; imod < fNModules; imod++){
4198 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4199 pyim3->SetLineColor(imod+1);
4200 pyim3->Draw("same");
4204 imbinmin = (Int_t) (3-emin)*nebins/emax;
4205 imbinmax = (Int_t) (4-emin)*nebins/emax;
4206 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),imbinmin,imbinmax);
4207 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
4208 pyim4->SetLineColor(1);
4210 for(Int_t imod = 0; imod < fNModules; imod++){
4211 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4212 pyim4->SetLineColor(imod+1);
4213 pyim4->Draw("same");
4217 imbinmin = (Int_t) (4-emin)*nebins/emax;
4218 imbinmax = (Int_t) (5-emin)*nebins/emax;
4219 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),imbinmin,imbinmax);
4220 pyim5->SetTitle("4< E_{pair} < 5 GeV");
4221 pyim5->SetLineColor(1);
4223 for(Int_t imod = 0; imod < fNModules; imod++){
4224 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4225 pyim5->SetLineColor(imod+1);
4226 pyim5->Draw("same");
4230 imbinmin = (Int_t) (5-emin)*nebins/emax;
4232 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),imbinmin,imbinmax);
4233 pyim10->SetTitle("E_{pair} > 5 GeV");
4234 pyim10->SetLineColor(1);
4236 for(Int_t imod = 0; imod < fNModules; imod++){
4237 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4238 pyim10->SetLineColor(imod+1);
4239 pyim10->Draw("same");
4242 snprintf(name,buffersize,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
4243 c5->Print(name); printf("Plot: %s\n",name);
4246 //--------------------------------------------------
4247 //Invariant mass, clusters with more than one cell
4248 //-------------------------------------------------
4249 if(fhIMCellCut->GetEntries() > 1){
4250 Int_t nebins = fhIMCellCut->GetNbinsX();
4251 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
4252 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
4253 if (emin != 0 ) printf("emin != 0 \n");
4254 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4256 snprintf(cname,buffersize,"QA_%s_IMCellCut",fCalorimeter.Data());
4257 // printf("c5cc\n");
4258 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
4262 //fhIMCellCut->SetLineColor(4);
4263 //fhIMCellCut->Draw();
4265 imbinmax = (Int_t) (1-emin)*nebins/emax;
4266 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),imbinmin,imbinmax);
4267 pyimcc1->SetTitle("E_{pair} < 1 GeV");
4268 pyimcc1->SetLineColor(1);
4270 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
4271 pLegendIMCellCut.SetTextSize(0.03);
4272 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
4273 pLegendIMCellCut.SetFillColor(10);
4274 pLegendIMCellCut.SetBorderSize(1);
4276 for(Int_t imod = 0; imod < fNModules; imod++){
4277 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4278 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
4279 pyimcc1->SetLineColor(imod+1);
4280 pyimcc1->Draw("same");
4282 pLegendIMCellCut.Draw();
4285 imbinmin = (Int_t) (1-emin)*nebins/emax;
4286 imbinmax = (Int_t) (2-emin)*nebins/emax;
4287 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),imbinmin,imbinmax);
4288 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
4289 pyimcc2->SetLineColor(1);
4291 for(Int_t imod = 0; imod < fNModules; imod++){
4292 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4293 pyimcc2->SetLineColor(imod+1);
4294 pyimcc2->Draw("same");
4298 imbinmin = (Int_t) (2-emin)*nebins/emax;
4299 imbinmax = (Int_t) (3-emin)*nebins/emax;
4300 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),imbinmin,imbinmax);
4301 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
4302 pyimcc3->SetLineColor(1);
4304 for(Int_t imod = 0; imod < fNModules; imod++){
4305 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4306 pyimcc3->SetLineColor(imod+1);
4307 pyimcc3->Draw("same");
4311 imbinmin = (Int_t) (3-emin)*nebins/emax;
4312 imbinmax = (Int_t) (4-emin)*nebins/emax;
4313 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),imbinmin,imbinmax);
4314 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
4315 pyimcc4->SetLineColor(1);
4317 for(Int_t imod = 0; imod < fNModules; imod++){
4318 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4319 pyimcc4->SetLineColor(imod+1);
4320 pyimcc4->Draw("same");
4324 imbinmin = (Int_t) (4-emin)*nebins/emax;
4325 imbinmax = (Int_t) (5-emin)*nebins/emax;
4326 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),imbinmin,imbinmax);
4327 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
4328 pyimcc5cc->SetLineColor(1);
4330 for(Int_t imod = 0; imod < fNModules; imod++){
4331 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4332 pyimcc5cc->SetLineColor(imod+1);
4333 pyimcc5cc->Draw("same");
4337 imbinmin = (Int_t) (5-emin)*nebins/emax;
4339 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),imbinmin,imbinmax);
4340 pyimcc10->SetTitle("E_{pair} > 5 GeV");
4341 pyimcc10->SetLineColor(1);
4343 for(Int_t imod = 0; imod < fNModules; imod++){
4344 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4345 pyimcc10->SetLineColor(imod+1);
4346 pyimcc10->Draw("same");
4349 snprintf(name,buffersize,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
4350 c5cc->Print(name); printf("Plot: %s\n",name);
4355 if(fhAsym->GetEntries() > 1){
4356 Int_t nebins = fhAsym->GetNbinsX();
4357 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
4358 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
4359 if (emin != 0 ) printf("emin != 0 \n");
4360 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4362 snprintf(cname,buffersize,"QA_%s_Asym",fCalorimeter.Data());
4364 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
4368 fhAsym->SetTitleOffset(1.6,"Y");
4369 fhAsym->SetLineColor(4);
4374 imbinmax = (Int_t) (5-emin)*nebins/emax;
4375 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),imbinmin,imbinmax);
4376 pyAsym5->SetTitle("E_{pair} < 5 GeV");
4377 pyAsym5->SetLineColor(4);
4381 imbinmin = (Int_t) (5-emin)*nebins/emax;
4382 imbinmax = (Int_t) (10-emin)*nebins/emax;
4383 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),imbinmin,imbinmax);
4384 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
4385 pyAsym510->SetLineColor(4);
4389 imbinmin = (Int_t) (10-emin)*nebins/emax;
4391 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),imbinmin,imbinmax);
4392 pyAsym10->SetTitle("E_{pair} > 10 GeV");
4393 pyAsym10->SetLineColor(4);
4396 snprintf(name,buffersize,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
4397 c5b->Print(name); printf("Plot: %s\n",name);
4402 //Reconstructed vs MC distributions
4404 snprintf(cname,buffersize,"QA_%s_recvsmc",fCalorimeter.Data());
4405 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4409 fh2E->SetTitleOffset(1.6,"Y");
4410 fh2E->SetLineColor(4);
4414 fh2Pt->SetTitleOffset(1.6,"Y");
4415 fh2Pt->SetLineColor(4);
4419 fh2Phi->SetTitleOffset(1.6,"Y");
4420 fh2Phi->SetLineColor(4);
4424 fh2Eta->SetTitleOffset(1.6,"Y");
4425 fh2Eta->SetLineColor(4);
4428 snprintf(name,buffersize,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4429 c6->Print(name); printf("Plot: %s\n",name);
4431 //Reconstructed vs MC distributions
4433 snprintf(cname,buffersize,"QA_%s_gamrecvsmc",fCalorimeter.Data());
4434 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4435 c6Gam->Divide(2, 2);
4449 snprintf(name,buffersize,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4450 c6->Print(name); printf("Plot: %s\n",name);
4452 //Generated - reconstructed
4454 snprintf(cname,buffersize,"QA_%s_diffgenrec",fCalorimeter.Data());
4455 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
4459 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
4460 fhGamDeltaE->SetLineColor(4);
4462 fhGamDeltaE->Draw("same");
4464 TLegend pLegendd(0.65,0.55,0.9,0.8);
4465 pLegendd.SetTextSize(0.06);
4466 pLegendd.AddEntry(fhDeltaE,"all","L");
4467 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
4468 pLegendd.SetFillColor(10);
4469 pLegendd.SetBorderSize(1);
4473 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
4474 fhGamDeltaPt->SetLineColor(4);
4476 fhGamDeltaPt->Draw("same");
4479 fhGamDeltaPhi->SetLineColor(4);
4481 fhGamDeltaPhi->Draw("same");
4484 fhGamDeltaEta->SetLineColor(4);
4486 fhGamDeltaEta->Draw("same");
4488 snprintf(name,buffersize,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
4489 c7->Print(name); printf("Plot: %s\n",name);
4491 // Reconstructed / Generated
4493 snprintf(cname,buffersize,"QA_%s_ratiorecgen",fCalorimeter.Data());
4494 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
4498 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
4499 fhGamRatioE->SetLineColor(4);
4501 fhGamRatioE->Draw("same");
4503 TLegend pLegendr(0.65,0.55,0.9,0.8);
4504 pLegendr.SetTextSize(0.06);
4505 pLegendr.AddEntry(fhRatioE,"all","L");
4506 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
4507 pLegendr.SetFillColor(10);
4508 pLegendr.SetBorderSize(1);
4512 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
4513 fhGamRatioPt->SetLineColor(4);
4515 fhGamRatioPt->Draw("same");
4518 fhGamRatioPhi->SetLineColor(4);
4520 fhGamRatioPhi->Draw("same");
4523 fhGamRatioEta->SetLineColor(4);
4525 fhGamRatioEta->Draw("same");
4527 snprintf(name,buffersize,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
4528 c8->Print(name); printf("Plot: %s\n",name);
4532 //Generated distributions
4534 snprintf(cname,buffersize,"QA_%s_gen",fCalorimeter.Data());
4535 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
4540 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
4541 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
4542 fhGenPi0Pt->SetLineColor(1);
4543 fhGenGamPt->SetLineColor(4);
4544 fhGenEtaPt->SetLineColor(2);
4545 fhGenOmegaPt->SetLineColor(7);
4546 fhGenElePt->SetLineColor(6);
4548 //Select the maximum of the histogram to show all lines.
4549 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4550 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
4551 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
4552 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4553 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
4554 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
4555 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
4556 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4557 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
4558 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4559 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4560 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
4561 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4562 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
4563 haxispt->SetMaximum(fhGenElePt->GetMaximum());
4564 haxispt->SetMinimum(1);
4565 haxispt->Draw("axis");
4566 fhGenPi0Pt->Draw("same");
4567 fhGenGamPt->Draw("same");
4568 fhGenEtaPt->Draw("same");
4569 fhGenOmegaPt->Draw("same");
4570 fhGenElePt->Draw("same");
4572 TLegend pLegend(0.85,0.65,0.95,0.93);
4573 pLegend.SetTextSize(0.06);
4574 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
4575 pLegend.AddEntry(fhGenGamPt," #gamma","L");
4576 pLegend.AddEntry(fhGenEtaPt," #eta","L");
4577 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
4578 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
4579 pLegend.SetFillColor(10);
4580 pLegend.SetBorderSize(1);
4585 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
4586 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
4587 fhGenPi0Eta->SetLineColor(1);
4588 fhGenGamEta->SetLineColor(4);
4589 fhGenEtaEta->SetLineColor(2);
4590 fhGenOmegaEta->SetLineColor(7);
4591 fhGenEleEta->SetLineColor(6);
4592 //Select the maximum of the histogram to show all lines.
4593 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4594 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
4595 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
4596 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4597 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4598 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
4599 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
4600 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4601 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
4602 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4603 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4604 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
4605 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4606 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
4607 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
4608 haxiseta->SetMinimum(100);
4609 haxiseta->Draw("axis");
4610 fhGenPi0Eta->Draw("same");
4611 fhGenGamEta->Draw("same");
4612 fhGenEtaEta->Draw("same");
4613 fhGenOmegaEta->Draw("same");
4614 fhGenEleEta->Draw("same");
4619 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
4620 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
4621 fhGenPi0Phi->SetLineColor(1);
4622 fhGenGamPhi->SetLineColor(4);
4623 fhGenEtaPhi->SetLineColor(2);
4624 fhGenOmegaPhi->SetLineColor(7);
4625 fhGenElePhi->SetLineColor(6);
4626 //Select the maximum of the histogram to show all lines.
4627 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4628 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
4629 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
4630 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4631 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4632 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
4633 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
4634 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4635 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
4636 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4637 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4638 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
4639 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4640 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
4641 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
4642 haxisphi->SetMinimum(100);
4643 haxisphi->Draw("axis");
4644 fhGenPi0Phi->Draw("same");
4645 fhGenGamPhi->Draw("same");
4646 fhGenEtaPhi->Draw("same");
4647 fhGenOmegaPhi->Draw("same");
4648 fhGenElePhi->Draw("same");
4650 snprintf(name,buffersize,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
4651 c10->Print(name); printf("Plot: %s\n",name);
4654 //Reconstructed clusters depending on its original particle.
4656 snprintf(cname,buffersize,"QA_%s_recgenid",fCalorimeter.Data());
4657 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
4663 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
4664 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
4665 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
4666 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
4667 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
4668 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
4669 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
4670 hPi0E->SetLineColor(1);
4671 hGamE->SetLineColor(4);
4672 hNeHadE->SetLineColor(2);
4673 hChHadE->SetLineColor(7);
4674 hEleE->SetLineColor(6);
4676 //Select the maximum of the histogram to show all lines.
4677 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
4678 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
4679 haxisE->SetMaximum(hPi0E->GetMaximum());
4680 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
4681 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
4682 haxisE->SetMaximum(hGamE->GetMaximum());
4683 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
4684 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
4685 haxisE->SetMaximum(hNeHadE->GetMaximum());
4686 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
4687 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
4688 haxisE->SetMaximum(hChHadE->GetMaximum());
4689 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
4690 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
4691 haxisE->SetMaximum(hEleE->GetMaximum());
4692 haxisE->SetXTitle("E (GeV)");
4693 haxisE->SetMinimum(1);
4694 haxisE->Draw("axis");
4695 hPi0E->Draw("same");
4696 hGamE->Draw("same");
4697 hNeHadE->Draw("same");
4698 hChHadE->Draw("same");
4699 hEleE->Draw("same");
4701 TLegend pLegend2(0.8,0.65,0.95,0.93);
4702 pLegend2.SetTextSize(0.06);
4703 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
4704 pLegend2.AddEntry(hGamE," #gamma","L");
4705 pLegend2.AddEntry(hEleE," e^{#pm}","L");
4706 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
4707 pLegend2.AddEntry(hNeHadE," h^{0}","L");
4708 pLegend2.SetFillColor(10);
4709 pLegend2.SetBorderSize(1);
4715 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
4716 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
4717 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
4718 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
4719 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
4720 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
4721 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
4722 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
4723 hPi0Pt->SetLineColor(1);
4724 hGamPt->SetLineColor(4);
4725 hNeHadPt->SetLineColor(2);
4726 hChHadPt->SetLineColor(7);
4727 hElePt->SetLineColor(6);
4729 //Select the maximum of the histogram to show all lines.
4730 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
4731 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
4732 haxispt->SetMaximum(hPi0Pt->GetMaximum());
4733 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
4734 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
4735 haxispt->SetMaximum(hGamPt->GetMaximum());
4736 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
4737 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
4738 haxispt->SetMaximum(hNeHadPt->GetMaximum());
4739 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
4740 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
4741 haxispt->SetMaximum(hChHadPt->GetMaximum());
4742 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
4743 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
4744 haxispt->SetMaximum(hElePt->GetMaximum());
4745 haxispt->SetXTitle("p_{T} (GeV/c)");
4746 haxispt->SetMinimum(1);
4747 haxispt->Draw("axis");
4748 hPi0Pt->Draw("same");
4749 hGamPt->Draw("same");
4750 hNeHadPt->Draw("same");
4751 hChHadPt->Draw("same");
4752 hElePt->Draw("same");
4757 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
4758 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
4759 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
4760 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
4761 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
4762 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
4763 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
4764 hPi0Eta->SetLineColor(1);
4765 hGamEta->SetLineColor(4);
4766 hNeHadEta->SetLineColor(2);
4767 hChHadEta->SetLineColor(7);
4768 hEleEta->SetLineColor(6);
4769 //Select the maximum of the histogram to show all lines.
4770 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
4771 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
4772 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
4773 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
4774 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
4775 haxiseta->SetMaximum(hGamEta->GetMaximum());
4776 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
4777 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
4778 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
4779 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
4780 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
4781 haxiseta->SetMaximum(hChHadEta->GetMaximum());
4782 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
4783 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
4784 haxiseta->SetMaximum(hEleEta->GetMaximum());
4786 haxiseta->SetXTitle("#eta");
4787 haxiseta->Draw("axis");
4788 hPi0Eta->Draw("same");
4789 hGamEta->Draw("same");
4790 hNeHadEta->Draw("same");
4791 hChHadEta->Draw("same");
4792 hEleEta->Draw("same");
4797 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
4798 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
4799 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
4800 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
4801 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
4802 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
4803 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
4805 hPi0Phi->SetLineColor(1);
4806 hGamPhi->SetLineColor(4);
4807 hNeHadPhi->SetLineColor(2);
4808 hChHadPhi->SetLineColor(7);
4809 hElePhi->SetLineColor(6);
4810 //Select the maximum of the histogram to show all lines.
4811 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
4812 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
4813 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
4814 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
4815 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
4816 haxisphi->SetMaximum(hGamPhi->GetMaximum());
4817 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
4818 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
4819 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
4820 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
4821 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
4822 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
4823 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
4824 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
4825 haxisphi->SetMaximum(hElePhi->GetMaximum());
4826 haxisphi->SetXTitle("#phi (rad)");
4827 haxisphi->Draw("axis");
4828 hPi0Phi->Draw("same");
4829 hGamPhi->Draw("same");
4830 hNeHadPhi->Draw("same");
4831 hChHadPhi->Draw("same");
4832 hElePhi->Draw("same");
4834 snprintf(name,buffersize,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
4835 c11->Print(name); printf("Plot: %s\n",name);
4838 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
4841 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
4842 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
4843 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
4844 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
4845 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
4846 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
4847 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
4848 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
4850 snprintf(cname,buffersize,"QA_%s_recgenidratio",fCalorimeter.Data());
4851 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
4856 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
4857 hPi0EClone->Divide(fhGenPi0AccE);
4858 hGamEClone->Divide(fhGenGamAccE);
4859 haxisE->SetMaximum(5);
4860 haxisE->SetMinimum(1e-2);
4861 haxisE->SetXTitle("E (GeV)");
4862 haxisE->SetYTitle("ratio = rec/gen");
4863 haxisE->Draw("axis");
4864 hPi0E->Draw("same");
4865 hGamE->Draw("same");
4867 TLegend pLegend3(0.75,0.2,0.9,0.4);
4868 pLegend3.SetTextSize(0.06);
4869 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
4870 pLegend3.AddEntry(hGamEClone," #gamma","L");
4871 pLegend3.SetFillColor(10);
4872 pLegend3.SetBorderSize(1);
4877 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
4878 hPi0PtClone->Divide(fhGenPi0AccPt);
4879 hGamPtClone->Divide(fhGenGamAccPt);
4880 haxispt->SetMaximum(5);
4881 haxispt->SetMinimum(1e-2);
4882 haxispt->SetXTitle("p_{T} (GeV/c)");
4883 haxispt->SetYTitle("ratio = rec/gen");
4884 haxispt->Draw("axis");
4885 hPi0PtClone->Draw("same");
4886 hGamPtClone->Draw("same");
4891 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
4892 hPi0EtaClone->Divide(fhGenPi0AccEta);
4893 hGamEtaClone->Divide(fhGenGamAccEta);
4894 haxiseta->SetMaximum(1.2);
4895 haxiseta->SetMinimum(1e-2);
4896 haxiseta->SetYTitle("ratio = rec/gen");
4897 haxiseta->SetXTitle("#eta");
4898 haxiseta->Draw("axis");
4899 hPi0EtaClone->Draw("same");
4900 hGamEtaClone->Draw("same");
4905 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
4906 hPi0PhiClone->Divide(fhGenPi0AccPhi);
4907 hGamPhiClone->Divide(fhGenGamAccPhi);
4908 haxisphi->SetYTitle("ratio = rec/gen");
4909 haxisphi->SetXTitle("#phi (rad)");
4910 haxisphi->SetMaximum(1.2);
4911 haxisphi->SetMinimum(1e-2);
4912 haxisphi->Draw("axis");
4913 hPi0PhiClone->Draw("same");
4914 hGamPhiClone->Draw("same");
4916 snprintf(name,buffersize,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
4917 c12->Print(name); printf("Plot: %s\n",name);
4921 //Reconstructed distributions
4923 snprintf(cname,buffersize,"QA_%s_vertex",fCalorimeter.Data());
4924 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
4929 fhEMVxyz->SetTitleOffset(1.6,"Y");
4934 fhHaVxyz->SetTitleOffset(1.6,"Y");
4939 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
4940 hEMR->SetLineColor(4);
4945 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
4946 hHaR->SetLineColor(4);
4950 snprintf(name,buffersize,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
4951 c13->Print(name); printf("Plot: %s\n",name);
4954 //Track-matching distributions
4956 //Reconstructed distributions, matched with tracks, generated particle dependence
4958 snprintf(cname,buffersize,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
4959 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
4960 c22ch->Divide(2, 2);
4964 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
4965 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
4966 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
4967 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
4968 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
4969 hPi0ECharged->SetLineColor(1);
4970 hGamECharged->SetLineColor(4);
4971 hNeHadECharged->SetLineColor(2);
4972 hChHadECharged->SetLineColor(7);
4973 hEleECharged->SetLineColor(6);
4975 fhECharged->SetLineColor(3);
4976 fhECharged->SetMinimum(0.5);
4978 hPi0ECharged->Draw("same");
4979 hGamECharged->Draw("same");
4980 hNeHadECharged->Draw("same");
4981 hChHadECharged->Draw("same");
4982 hEleECharged->Draw("same");
4983 TLegend pLegend22(0.75,0.45,0.9,0.8);
4984 pLegend22.SetTextSize(0.06);
4985 pLegend22.AddEntry(fhECharged,"all","L");
4986 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
4987 pLegend22.AddEntry(hGamECharged,"#gamma","L");
4988 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
4989 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
4990 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
4991 pLegend22.SetFillColor(10);
4992 pLegend22.SetBorderSize(1);
4997 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
4998 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
4999 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
5000 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
5001 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
5002 hPi0PtCharged->SetLineColor(1);
5003 hGamPtCharged->SetLineColor(4);
5004 hNeHadPtCharged->SetLineColor(2);
5005 hChHadPtCharged->SetLineColor(7);
5006 hElePtCharged->SetLineColor(6);
5008 fhPtCharged->SetLineColor(3);
5009 fhPtCharged->SetMinimum(0.5);
5010 fhPtCharged->Draw();
5011 hPi0PtCharged->Draw("same");
5012 hGamPtCharged->Draw("same");
5013 hNeHadPtCharged->Draw("same");
5014 hChHadPtCharged->Draw("same");
5015 hElePtCharged->Draw("same");
5019 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
5020 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
5021 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
5022 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
5023 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
5024 hPi0EtaCharged->SetLineColor(1);
5025 hGamEtaCharged->SetLineColor(4);
5026 hNeHadEtaCharged->SetLineColor(2);
5027 hChHadEtaCharged->SetLineColor(7);
5028 hEleEtaCharged->SetLineColor(6);
5030 fhEtaCharged->SetLineColor(3);
5031 fhEtaCharged->SetMinimum(0.5);
5032 fhEtaCharged->Draw();
5033 hPi0EtaCharged->Draw("same");
5034 hGamEtaCharged->Draw("same");
5035 hNeHadEtaCharged->Draw("same");
5036 hChHadEtaCharged->Draw("same");
5037 hEleEtaCharged->Draw("same");
5041 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
5042 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
5043 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
5044 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
5045 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
5046 hPi0PhiCharged->SetLineColor(1);
5047 hGamPhiCharged->SetLineColor(4);
5048 hNeHadPhiCharged->SetLineColor(2);
5049 hChHadPhiCharged->SetLineColor(7);
5050 hElePhiCharged->SetLineColor(6);
5052 fhPhiCharged->SetLineColor(3);
5053 fhPhiCharged->SetMinimum(0.5);
5054 fhPhiCharged->Draw();
5055 hPi0PhiCharged->Draw("same");
5056 hGamPhiCharged->Draw("same");
5057 hNeHadPhiCharged->Draw("same");
5058 hChHadPhiCharged->Draw("same");
5059 hElePhiCharged->Draw("same");
5062 snprintf(name,buffersize,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
5063 c22ch->Print(name); printf("Plot: %s\n",name);
5065 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
5066 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
5067 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
5068 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
5070 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
5071 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
5072 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
5073 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
5075 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
5076 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
5077 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
5078 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
5080 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
5081 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
5082 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
5083 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
5085 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
5086 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
5087 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
5088 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
5090 //Ratio: reconstructed track matched/ all reconstructed
5092 snprintf(cname,buffersize,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
5093 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
5097 hEChargedClone->SetMaximum(1.2);
5098 hEChargedClone->SetMinimum(0.001);
5099 hEChargedClone->SetLineColor(3);
5100 hEChargedClone->SetYTitle("track matched / all");
5101 hPi0EChargedClone->Divide(hPi0E);
5102 hGamEChargedClone->Divide(hGamE);
5103 hEleEChargedClone->Divide(hEleE);
5104 hNeHadEChargedClone->Divide(hNeHadE);
5105 hChHadEChargedClone->Divide(hChHadE);
5106 hEChargedClone->Draw();
5107 hPi0EChargedClone->Draw("same");
5108 hGamEChargedClone->Draw("same");
5109 hEleEChargedClone->Draw("same");
5110 hNeHadEChargedClone->Draw("same");
5111 hChHadEChargedClone->Draw("same");
5113 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
5114 pLegend3ch.SetTextSize(0.06);
5115 pLegend3ch.AddEntry(hEChargedClone,"all","L");
5116 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
5117 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
5118 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
5119 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
5120 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
5121 pLegend3ch.SetFillColor(10);
5122 pLegend3ch.SetBorderSize(1);
5126 hPtChargedClone->SetMaximum(1.2);
5127 hPtChargedClone->SetMinimum(0.001);
5128 hPtChargedClone->SetLineColor(3);
5129 hPtChargedClone->SetYTitle("track matched / all");
5130 hPi0PtChargedClone->Divide(hPi0Pt);
5131 hGamPtChargedClone->Divide(hGamPt);
5132 hElePtChargedClone->Divide(hElePt);
5133 hNeHadPtChargedClone->Divide(hNeHadPt);
5134 hChHadPtChargedClone->Divide(hChHadPt);
5135 hPtChargedClone->Draw();
5136 hPi0PtChargedClone->Draw("same");
5137 hGamPtChargedClone->Draw("same");
5138 hElePtChargedClone->Draw("same");
5139 hNeHadPtChargedClone->Draw("same");
5140 hChHadPtChargedClone->Draw("same");
5143 hEtaChargedClone->SetMaximum(1.2);
5144 hEtaChargedClone->SetMinimum(0.001);
5145 hEtaChargedClone->SetLineColor(3);
5146 hEtaChargedClone->SetYTitle("track matched / all");
5147 hPi0EtaChargedClone->Divide(hPi0Eta);
5148 hGamEtaChargedClone->Divide(hGamEta);
5149 hEleEtaChargedClone->Divide(hEleEta);
5150 hNeHadEtaChargedClone->Divide(hNeHadEta);
5151 hChHadEtaChargedClone->Divide(hChHadEta);
5152 hEtaChargedClone->Draw();
5153 hPi0EtaChargedClone->Draw("same");
5154 hGamEtaChargedClone->Draw("same");
5155 hEleEtaChargedClone->Draw("same");
5156 hNeHadEtaChargedClone->Draw("same");
5157 hChHadEtaChargedClone->Draw("same");
5160 hPhiChargedClone->SetMaximum(1.2);
5161 hPhiChargedClone->SetMinimum(0.001);
5162 hPhiChargedClone->SetLineColor(3);
5163 hPhiChargedClone->SetYTitle("track matched / all");
5164 hPi0PhiChargedClone->Divide(hPi0Phi);
5165 hGamPhiChargedClone->Divide(hGamPhi);
5166 hElePhiChargedClone->Divide(hElePhi);
5167 hNeHadPhiChargedClone->Divide(hNeHadPhi);
5168 hChHadPhiChargedClone->Divide(hChHadPhi);
5169 hPhiChargedClone->Draw();
5170 hPi0PhiChargedClone->Draw("same");
5171 hGamPhiChargedClone->Draw("same");
5172 hElePhiChargedClone->Draw("same");
5173 hNeHadPhiChargedClone->Draw("same");
5174 hChHadPhiChargedClone->Draw("same");
5176 snprintf(name,buffersize,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
5177 c3ch->Print(name); printf("Plot: %s\n",name);
5181 //Track-matching distributions
5183 snprintf(cname,buffersize,"QA_%s_trkmatch",fCalorimeter.Data());
5184 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
5187 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
5188 pLegendpE0.SetTextSize(0.04);
5189 pLegendpE0.AddEntry(fh1pOverE,"all","L");
5190 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
5191 pLegendpE0.SetFillColor(10);
5192 pLegendpE0.SetBorderSize(1);
5193 //pLegendpE0.Draw();
5196 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
5197 fh1pOverE->SetTitle("Track matches p/E");
5199 fh1pOverER02->SetLineColor(4);
5200 fh1pOverER02->Draw("same");
5204 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
5208 fh2MatchdEdx->Draw();
5213 snprintf(name,buffersize,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
5214 cme->Print(name); printf("Plot: %s\n",name);
5217 snprintf(cname,buffersize,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
5218 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
5223 fhMCEle1pOverE->Draw();
5224 fhMCEle1pOverER02->SetLineColor(4);
5225 fhMCEle1pOverE->SetLineColor(1);
5226 fhMCEle1pOverER02->Draw("same");
5234 fhMCEle2MatchdEdx->Draw();
5236 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
5237 cmemc->Print(name); printf("Plot: %s\n",name);
5240 snprintf(cname,buffersize,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
5241 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
5242 cmemchad->Divide(3,1);
5246 fhMCChHad1pOverE->Draw();
5247 fhMCChHad1pOverER02->SetLineColor(4);
5248 fhMCChHad1pOverE->SetLineColor(1);
5249 fhMCChHad1pOverER02->Draw("same");
5254 fhMCChHad1dR->Draw();
5257 fhMCChHad2MatchdEdx->Draw();
5259 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
5260 cmemchad->Print(name); printf("Plot: %s\n",name);
5262 snprintf(cname,buffersize,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
5263 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
5264 cmemcn->Divide(3,1);
5268 fhMCNeutral1pOverE->Draw();
5269 fhMCNeutral1pOverE->SetLineColor(1);
5270 fhMCNeutral1pOverER02->SetLineColor(4);
5271 fhMCNeutral1pOverER02->Draw("same");
5276 fhMCNeutral1dR->Draw();
5279 fhMCNeutral2MatchdEdx->Draw();
5281 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
5282 cmemcn->Print(name); printf("Plot: %s\n",name);
5284 snprintf(cname,buffersize,"QA_%s_trkmatchpE",fCalorimeter.Data());
5285 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
5290 fh1pOverE->SetLineColor(1);
5291 fhMCEle1pOverE->SetLineColor(4);
5292 fhMCChHad1pOverE->SetLineColor(2);
5293 fhMCNeutral1pOverE->SetLineColor(7);
5294 fh1pOverER02->SetMinimum(0.5);
5296 fhMCEle1pOverE->Draw("same");
5297 fhMCChHad1pOverE->Draw("same");
5298 fhMCNeutral1pOverE->Draw("same");
5299 TLegend pLegendpE(0.65,0.55,0.9,0.8);
5300 pLegendpE.SetTextSize(0.06);
5301 pLegendpE.AddEntry(fh1pOverE,"all","L");
5302 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
5303 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
5304 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
5305 pLegendpE.SetFillColor(10);
5306 pLegendpE.SetBorderSize(1);
5311 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
5312 fh1pOverER02->SetLineColor(1);
5313 fhMCEle1pOverER02->SetLineColor(4);
5314 fhMCChHad1pOverER02->SetLineColor(2);
5315 fhMCNeutral1pOverER02->SetLineColor(7);
5316 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
5317 fh1pOverER02->SetMinimum(0.5);
5318 fh1pOverER02->Draw();
5319 fhMCEle1pOverER02->Draw("same");
5320 fhMCChHad1pOverER02->Draw("same");
5321 fhMCNeutral1pOverER02->Draw("same");
5323 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
5324 // pLegendpE2.SetTextSize(0.06);
5325 // pLegendpE2.SetHeader("dR < 0.02");
5326 // pLegendpE2.SetFillColor(10);
5327 // pLegendpE2.SetBorderSize(1);
5328 // pLegendpE2.Draw();
5330 snprintf(name,buffersize,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
5331 cmpoe->Print(name); printf("Plot: %s\n",name);
5334 char line[buffersize] ;
5335 snprintf(line, buffersize,".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
5336 gROOT->ProcessLine(line);
5337 snprintf(line, buffersize,".!rm -fR *.eps");
5338 gROOT->ProcessLine(line);
5340 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());