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 "AliAODTrack.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 fFillAllPosHisto(kFALSE), fFillAllPosHisto2(kTRUE),
61 fFillAllTH12(kFALSE), fFillAllTH3(kTRUE),
62 fFillAllTMHisto(kTRUE), fFillAllPi0Histo(kTRUE),
63 fCorrelate(kTRUE), fNModules(12), fNRCU(2),
64 fTimeCutMin(-1), fTimeCutMax(9999999),
65 fEMCALCellAmpMin(0), fPHOSCellAmpMin(0),
66 fhE(0), fhPt(0), fhPhi(0), fhEta(0), fhEtaPhiE(0),
67 fhECharged(0), fhPtCharged(0), fhPhiCharged(0), fhEtaCharged(0), fhEtaPhiECharged(0),
68 fhDeltaE(0), fhDeltaPt(0), fhDeltaPhi(0), fhDeltaEta(0),
69 fhRatioE(0), fhRatioPt(0), fhRatioPhi(0), fhRatioEta(0),
70 fh2E(0), fh2Pt(0), fh2Phi(0), fh2Eta(0),
73 fhIM(0 ), fhIMCellCut(0), fhAsym(0),
74 fhNCellsPerCluster(0), fhNCellsPerClusterMIP(0), fhNCellsPerClusterMIPCharged(0),
78 fhClusterTimeEnergy(0), fhCellTimeSpreadRespectToCellMax(0),
79 fhCellIdCellLargeTimeSpread(0), fhClusterPairDiffTimeE(0),
81 fhClusterMaxCellCloseCellRatio(0), fhClusterMaxCellDiff(0),
84 fhBadClusterEnergy(0), fhBadClusterTimeEnergy(0), fhBadClusterPairDiffTimeE(0),
85 fhBadClusterMaxCellCloseCellRatio(0), fhBadClusterMaxCellDiff(0),
86 fhBadClusterLambda0(0), fhBadClusterLambda1(0),
87 fhBadClusterL0L1(0), fhBadClusterDispersion(0),
90 fhRNCells(0), fhXNCells(0), fhYNCells(0), fhZNCells(0),
91 fhRE(0), fhXE(0), fhYE(0), fhZE(0),
93 fhRCellE(0), fhXCellE(0), fhYCellE(0), fhZCellE(0),
95 fhDeltaCellClusterRNCells(0),fhDeltaCellClusterXNCells(0),fhDeltaCellClusterYNCells(0),fhDeltaCellClusterZNCells(0),
96 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0), fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
98 fhNCells(0), fhAmplitude(0), fhAmpId(0), fhEtaPhiAmp(0),
99 fhTime(0), fhTimeId(0), fhTimeAmp(0),
100 //fhT0Time(0), fhT0TimeId(0), fhT0TimeAmp(0),
101 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
102 fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0), fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
103 fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0), fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
104 fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0), fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
105 //Super-Module dependent histgrams
106 fhEMod(0), fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),
107 fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0),
108 fhAmplitudeMod(0), fhAmplitudeModFraction(0), fhTimeAmpPerRCU(0),
109 //fhT0TimeAmpPerRCU(0), fhTimeCorrRCU(0),
110 fhIMMod(0), fhIMCellCutMod(0),
112 fhGenGamPt(0), fhGenGamEta(0), fhGenGamPhi(0),
113 fhGenPi0Pt(0), fhGenPi0Eta(0), fhGenPi0Phi(0),
114 fhGenEtaPt(0), fhGenEtaEta(0), fhGenEtaPhi(0),
115 fhGenOmegaPt(0), fhGenOmegaEta(0), fhGenOmegaPhi(0),
116 fhGenElePt(0), fhGenEleEta(0), fhGenElePhi(0),
117 fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
118 fhGamE(0), fhGamPt(0), fhGamPhi(0), fhGamEta(0),
119 fhGamDeltaE(0), fhGamDeltaPt(0), fhGamDeltaPhi(0), fhGamDeltaEta(0),
120 fhGamRatioE(0), fhGamRatioPt(0), fhGamRatioPhi(0), fhGamRatioEta(0),
121 fhEleE(0), fhElePt(0), fhElePhi(0), fhEleEta(0),
122 fhPi0E(0), fhPi0Pt(0), fhPi0Phi(0), fhPi0Eta(0),
123 fhNeHadE(0), fhNeHadPt(0), fhNeHadPhi(0), fhNeHadEta(0),
124 fhChHadE(0), fhChHadPt(0), fhChHadPhi(0), fhChHadEta(0),
125 fhGamECharged(0), fhGamPtCharged(0), fhGamPhiCharged(0), fhGamEtaCharged(0),
126 fhEleECharged(0), fhElePtCharged(0), fhElePhiCharged(0), fhEleEtaCharged(0),
127 fhPi0ECharged(0), fhPi0PtCharged(0), fhPi0PhiCharged(0), fhPi0EtaCharged(0),
128 fhNeHadECharged(0), fhNeHadPtCharged(0), fhNeHadPhiCharged(0), fhNeHadEtaCharged(0),
129 fhChHadECharged(0), fhChHadPtCharged(0), fhChHadPhiCharged(0), fhChHadEtaCharged(0),
130 fhGenGamAccE(0), fhGenGamAccPt(0), fhGenGamAccEta(0), fhGenGamAccPhi(0),
131 fhGenPi0AccE(0), fhGenPi0AccPt(0), fhGenPi0AccEta(0), fhGenPi0AccPhi(0),
132 fh1pOverE(0), fh1dR(0), fh2EledEdx(0), fh2MatchdEdx(0),
133 fhMCEle1pOverE(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
134 fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
135 fhMCNeutral1pOverE(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0),fh1pOverER02(0),
136 fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
140 //Initialize parameters
144 //________________________________________________________________________
145 TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
147 //Save parameters used for analysis
148 TString parList ; //this will be list of parameters used for this analysis.
149 const Int_t buffersize = 255;
150 char onePar[buffersize] ;
152 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
154 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
156 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
158 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
160 //Get parameters set in base class.
161 //parList += GetBaseParametersList() ;
163 //Get parameters set in FiducialCut class (not available yet)
164 //parlist += GetFidCut()->GetFidCutParametersList()
166 return new TObjString(parList) ;
170 //________________________________________________________________________
171 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
173 // Create histograms to be saved in output file and
174 // store them in outputContainer
176 TList * outputContainer = new TList() ;
177 outputContainer->SetName("QAHistos") ;
180 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
181 Int_t nfineptbins = GetHistoFinePtBins(); Float_t ptfinemax = GetHistoFinePtMax(); Float_t ptfinemin = GetHistoFinePtMin();
182 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
183 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
184 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
185 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
186 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
187 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
188 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
189 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
190 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
191 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
192 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
193 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
194 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
195 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
196 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
197 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
198 Int_t tdbins = GetHistoDiffTimeBins() ; Float_t tdmax = GetHistoDiffTimeMax(); Float_t tdmin = GetHistoDiffTimeMin();
200 Int_t nv0sbins = GetHistoV0SignalBins(); Int_t nv0smax = GetHistoV0SignalMax(); Int_t nv0smin = GetHistoV0SignalMin();
201 Int_t nv0mbins = GetHistoV0MultiplicityBins(); Int_t nv0mmax = GetHistoV0MultiplicityMax(); Int_t nv0mmin = GetHistoV0MultiplicityMin();
202 Int_t ntrmbins = GetHistoTrackMultiplicityBins(); Int_t ntrmmax = GetHistoTrackMultiplicityMax(); Int_t ntrmmin = GetHistoTrackMultiplicityMin();
210 if(fCalorimeter=="PHOS"){
217 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
218 fhE->SetXTitle("E (GeV)");
219 outputContainer->Add(fhE);
222 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
223 fhPt->SetXTitle("p_{T} (GeV/c)");
224 outputContainer->Add(fhPt);
226 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
227 fhPhi->SetXTitle("#phi (rad)");
228 outputContainer->Add(fhPhi);
230 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
231 fhEta->SetXTitle("#eta ");
232 outputContainer->Add(fhEta);
235 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
236 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
237 fhEtaPhiE->SetXTitle("#eta ");
238 fhEtaPhiE->SetYTitle("#phi (rad)");
239 fhEtaPhiE->SetZTitle("E (GeV) ");
240 outputContainer->Add(fhEtaPhiE);
242 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
243 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
244 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
245 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
246 outputContainer->Add(fhClusterTimeEnergy);
248 fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCell","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
249 nptbins,ptmin,ptmax, 100,0,1.);
250 fhClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
251 fhClusterMaxCellCloseCellRatio->SetYTitle("ratio");
252 outputContainer->Add(fhClusterMaxCellCloseCellRatio);
254 fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy",
255 nptbins,ptmin,ptmax, 500,0,1.);
256 fhClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
257 fhClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster} (GeV)");
258 outputContainer->Add(fhClusterMaxCellDiff);
260 fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
261 fhClusterPairDiffTimeE->SetXTitle("E_{cluster} (GeV)");
262 fhClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
263 outputContainer->Add(fhClusterPairDiffTimeE);
265 if(fCalorimeter=="EMCAL" && !GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster()){
267 fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
268 fhBadClusterEnergy->SetXTitle("E_{cluster} (GeV) ");
269 outputContainer->Add(fhBadClusterEnergy);
271 fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCell","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
272 nptbins,ptmin,ptmax, 100,0,1.);
273 fhBadClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
274 fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
275 outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
277 fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
278 nptbins,ptmin,ptmax, 500,0,1.);
279 fhBadClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
280 fhBadClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max}) / E_{cluster} (GeV)");
281 outputContainer->Add(fhBadClusterMaxCellDiff);
283 fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
284 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
285 fhBadClusterTimeEnergy->SetXTitle("E_{cluster} (GeV) ");
286 fhBadClusterTimeEnergy->SetYTitle("TOF (ns)");
287 outputContainer->Add(fhBadClusterTimeEnergy);
289 fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
290 fhBadClusterPairDiffTimeE->SetXTitle("E_{bad cluster} (GeV)");
291 fhBadClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
292 outputContainer->Add(fhBadClusterPairDiffTimeE);
294 fhBadClusterLambda0 = new TH2F ("hBadClusterLambda0","bad clusters, shower shape, #lambda^{2}_{0} vs E ",
295 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
296 fhBadClusterLambda0->SetXTitle("E_{cluster} (GeV) ");
297 fhBadClusterLambda0->SetYTitle("#lambda^{2}_{0}");
298 outputContainer->Add(fhBadClusterLambda0);
300 fhBadClusterLambda1 = new TH2F ("hBadClusterLambda1","bad clusters, shower shape, #lambda^{2}_{1} vs E ",
301 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
302 fhBadClusterLambda1->SetXTitle("E_{cluster} (GeV) ");
303 fhBadClusterLambda1->SetYTitle("#lambda^{2}_{1}");
304 outputContainer->Add(fhBadClusterLambda1);
307 fhBadClusterDispersion = new TH2F ("hBadClusterDispersion","bad clusters, shower shape, dispersion^{2} vs E ",
308 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
309 fhBadClusterDispersion->SetXTitle("E_{cluster} (GeV) ");
310 fhBadClusterDispersion->SetYTitle("D^{2}_{}");
311 outputContainer->Add(fhBadClusterDispersion);
314 fhBadClusterL0L1 = new TH2F ("hBadClusterL0L1","bad clusters, shower shape, #lambda^{2}_{0} vs #lambda^{2}_{1}",
315 ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
316 fhBadClusterL0L1->SetXTitle("#lambda^{2}_{0}");
317 fhBadClusterL0L1->SetYTitle("#lambda^{2}_{1}");
318 outputContainer->Add(fhBadClusterL0L1);
325 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
326 fhECharged->SetXTitle("E (GeV)");
327 outputContainer->Add(fhECharged);
329 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
330 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
331 outputContainer->Add(fhPtCharged);
333 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
334 fhPhiCharged->SetXTitle("#phi (rad)");
335 outputContainer->Add(fhPhiCharged);
337 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
338 fhEtaCharged->SetXTitle("#eta ");
339 outputContainer->Add(fhEtaCharged);
342 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
343 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
344 fhEtaPhiECharged->SetXTitle("#eta ");
345 fhEtaPhiECharged->SetYTitle("#phi ");
346 fhEtaPhiECharged->SetZTitle("E (GeV) ");
347 outputContainer->Add(fhEtaPhiECharged);
350 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
351 fh1pOverE->SetYTitle("p/E");
352 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
353 outputContainer->Add(fh1pOverE);
355 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
356 fh1dR->SetXTitle("#Delta R (rad)");
357 outputContainer->Add(fh1dR) ;
359 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
360 fh2MatchdEdx->SetXTitle("p (GeV/c)");
361 fh2MatchdEdx->SetYTitle("<dE/dx>");
362 outputContainer->Add(fh2MatchdEdx);
364 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
365 fh2EledEdx->SetXTitle("p (GeV/c)");
366 fh2EledEdx->SetYTitle("<dE/dx>");
367 outputContainer->Add(fh2EledEdx) ;
369 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
370 fh1pOverER02->SetYTitle("p/E");
371 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
372 outputContainer->Add(fh1pOverER02);
375 if(fFillAllPi0Histo){
376 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
377 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
378 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
379 outputContainer->Add(fhIM);
381 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
382 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
383 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
384 outputContainer->Add(fhIMCellCut);
386 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
387 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
388 fhAsym->SetYTitle("Asymmetry");
389 outputContainer->Add(fhAsym);
394 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax);
395 fhNCellsPerCluster->SetXTitle("E (GeV)");
396 fhNCellsPerCluster->SetYTitle("n cells");
397 outputContainer->Add(fhNCellsPerCluster);
399 fhNCellsPerClusterMIP = new TH2F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
401 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
402 fhNCellsPerClusterMIP->SetYTitle("n cells");
403 outputContainer->Add(fhNCellsPerClusterMIP);
406 fhNCellsPerClusterMIPCharged = new TH2F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
408 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
409 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
410 outputContainer->Add(fhNCellsPerClusterMIPCharged);
413 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
414 fhNClusters->SetXTitle("number of clusters");
415 outputContainer->Add(fhNClusters);
417 if(fFillAllPosHisto2){
420 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
421 fhXYZ->SetXTitle("x (cm)");
422 fhXYZ->SetYTitle("y (cm)");
423 fhXYZ->SetZTitle("z (cm) ");
424 outputContainer->Add(fhXYZ);
427 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax);
428 fhXNCells->SetXTitle("x (cm)");
429 fhXNCells->SetYTitle("N cells per cluster");
430 outputContainer->Add(fhXNCells);
432 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax);
433 fhZNCells->SetXTitle("z (cm)");
434 fhZNCells->SetYTitle("N cells per cluster");
435 outputContainer->Add(fhZNCells);
437 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
438 fhXE->SetXTitle("x (cm)");
439 fhXE->SetYTitle("E (GeV)");
440 outputContainer->Add(fhXE);
442 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
443 fhZE->SetXTitle("z (cm)");
444 fhZE->SetYTitle("E (GeV)");
445 outputContainer->Add(fhZE);
448 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax);
449 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
450 fhRNCells->SetYTitle("N cells per cluster");
451 outputContainer->Add(fhRNCells);
454 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax);
455 fhYNCells->SetXTitle("y (cm)");
456 fhYNCells->SetYTitle("N cells per cluster");
457 outputContainer->Add(fhYNCells);
459 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
460 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
461 fhRE->SetYTitle("E (GeV)");
462 outputContainer->Add(fhRE);
464 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
465 fhYE->SetXTitle("y (cm)");
466 fhYE->SetYTitle("E (GeV)");
467 outputContainer->Add(fhYE);
469 if(fFillAllPosHisto){
471 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
472 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
473 fhRCellE->SetYTitle("E (GeV)");
474 outputContainer->Add(fhRCellE);
476 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
477 fhXCellE->SetXTitle("x (cm)");
478 fhXCellE->SetYTitle("E (GeV)");
479 outputContainer->Add(fhXCellE);
481 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
482 fhYCellE->SetXTitle("y (cm)");
483 fhYCellE->SetYTitle("E (GeV)");
484 outputContainer->Add(fhYCellE);
486 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
487 fhZCellE->SetXTitle("z (cm)");
488 fhZCellE->SetYTitle("E (GeV)");
489 outputContainer->Add(fhZCellE);
491 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
492 fhXYZCell->SetXTitle("x (cm)");
493 fhXYZCell->SetYTitle("y (cm)");
494 fhXYZCell->SetZTitle("z (cm)");
495 outputContainer->Add(fhXYZCell);
498 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
499 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
500 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
501 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
503 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax);
504 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
505 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
506 outputContainer->Add(fhDeltaCellClusterRNCells);
508 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax);
509 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
510 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
511 outputContainer->Add(fhDeltaCellClusterXNCells);
513 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax);
514 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
515 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
516 outputContainer->Add(fhDeltaCellClusterYNCells);
518 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax);
519 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
520 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
521 outputContainer->Add(fhDeltaCellClusterZNCells);
523 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
524 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
525 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
526 outputContainer->Add(fhDeltaCellClusterRE);
528 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
529 fhDeltaCellClusterXE->SetXTitle("x (cm)");
530 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
531 outputContainer->Add(fhDeltaCellClusterXE);
533 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
534 fhDeltaCellClusterYE->SetXTitle("y (cm)");
535 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
536 outputContainer->Add(fhDeltaCellClusterYE);
538 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
539 fhDeltaCellClusterZE->SetXTitle("z (cm)");
540 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
541 outputContainer->Add(fhDeltaCellClusterZE);
543 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
544 fhEtaPhiAmp->SetXTitle("#eta ");
545 fhEtaPhiAmp->SetYTitle("#phi (rad)");
546 fhEtaPhiAmp->SetZTitle("E (GeV) ");
547 outputContainer->Add(fhEtaPhiAmp);
552 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
553 fhNCells->SetXTitle("n cells");
554 outputContainer->Add(fhNCells);
556 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
557 fhAmplitude->SetXTitle("Cell Energy (GeV)");
558 outputContainer->Add(fhAmplitude);
560 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
561 fhAmpId->SetXTitle("Cell Energy (GeV)");
562 outputContainer->Add(fhAmpId);
565 //Cell Time histograms, time only available in ESDs
566 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
568 fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200);
569 fhCellTimeSpreadRespectToCellMax->SetXTitle("#Delta t (ns)");
570 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
572 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
573 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
574 outputContainer->Add(fhCellIdCellLargeTimeSpread);
576 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
577 fhTime->SetXTitle("Cell Time (ns)");
578 outputContainer->Add(fhTime);
580 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
581 fhTimeId->SetXTitle("Cell Time (ns)");
582 fhTimeId->SetYTitle("Cell Absolute Id");
583 outputContainer->Add(fhTimeId);
585 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
586 fhTimeAmp->SetYTitle("Cell Time (ns)");
587 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
588 outputContainer->Add(fhTimeAmp);
590 // fhT0Time = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax);
591 // fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
592 // outputContainer->Add(fhT0Time);
594 // fhT0TimeId = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
595 // fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
596 // fhT0TimeId->SetYTitle("Cell Absolute Id");
597 // outputContainer->Add(fhT0TimeId);
599 // fhT0TimeAmp = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
600 // fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
601 // fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
602 // outputContainer->Add(fhT0TimeAmp);
607 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
608 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
609 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
610 outputContainer->Add(fhCaloCorrNClusters);
612 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
613 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
614 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
615 outputContainer->Add(fhCaloCorrEClusters);
617 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
618 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
619 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
620 outputContainer->Add(fhCaloCorrNCells);
622 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins*2,ptmin,ptmax*2);
623 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
624 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
625 outputContainer->Add(fhCaloCorrECells);
627 //Calorimeter VS V0 signal
628 fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nbins,nmin,nmax);
629 fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
630 fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
631 outputContainer->Add(fhCaloV0SCorrNClusters);
633 fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
634 fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
635 fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
636 outputContainer->Add(fhCaloV0SCorrEClusters);
638 fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax, nbins,nmin,nmax);
639 fhCaloV0SCorrNCells->SetXTitle("V0 signal");
640 fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
641 outputContainer->Add(fhCaloV0SCorrNCells);
643 fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
644 fhCaloV0SCorrECells->SetXTitle("V0 signal");
645 fhCaloV0SCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
646 outputContainer->Add(fhCaloV0SCorrECells);
648 //Calorimeter VS V0 multiplicity
649 fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nbins,nmin,nmax);
650 fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
651 fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
652 outputContainer->Add(fhCaloV0MCorrNClusters);
654 fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
655 fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
656 fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
657 outputContainer->Add(fhCaloV0MCorrEClusters);
659 fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax, nbins,nmin,nmax);
660 fhCaloV0MCorrNCells->SetXTitle("V0 signal");
661 fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
662 outputContainer->Add(fhCaloV0MCorrNCells);
664 fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
665 fhCaloV0MCorrECells->SetXTitle("V0 signal");
666 fhCaloV0MCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
667 outputContainer->Add(fhCaloV0MCorrECells);
669 //Calorimeter VS Track multiplicity
670 fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nbins,nmin,nmax);
671 fhCaloTrackMCorrNClusters->SetXTitle("# tracks");
672 fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
673 outputContainer->Add(fhCaloTrackMCorrNClusters);
675 fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
676 fhCaloTrackMCorrEClusters->SetXTitle("# tracks");
677 fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
678 outputContainer->Add(fhCaloTrackMCorrEClusters);
680 fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax, nbins,nmin,nmax);
681 fhCaloTrackMCorrNCells->SetXTitle("# tracks");
682 fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
683 outputContainer->Add(fhCaloTrackMCorrNCells);
685 fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
686 fhCaloTrackMCorrECells->SetXTitle("# tracks");
687 fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
688 outputContainer->Add(fhCaloTrackMCorrECells);
691 }//correlate calorimeters
694 fhEMod = new TH1F*[fNModules];
695 fhNClustersMod = new TH1F*[fNModules];
696 fhNCellsPerClusterMod = new TH2F*[fNModules];
697 fhNCellsMod = new TH1F*[fNModules];
698 fhGridCellsMod = new TH2F*[fNModules];
699 fhGridCellsEMod = new TH2F*[fNModules];
700 fhGridCellsTimeMod = new TH2F*[fNModules];
701 fhAmplitudeMod = new TH1F*[fNModules];
702 if(fCalorimeter=="EMCAL")
703 fhAmplitudeModFraction = new TH1F*[fNModules*3];
705 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
706 //fhT0TimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
707 //fhTimeCorrRCU = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
709 fhIMMod = new TH2F*[fNModules];
710 fhIMCellCutMod = new TH2F*[fNModules];
712 for(Int_t imod = 0; imod < fNModules; imod++){
714 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
715 fhEMod[imod]->SetXTitle("E (GeV)");
716 outputContainer->Add(fhEMod[imod]);
718 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
719 fhNClustersMod[imod]->SetXTitle("number of clusters");
720 outputContainer->Add(fhNClustersMod[imod]);
722 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
723 Form("# cells per cluster vs cluster energy in Module %d",imod),
724 nptbins,ptmin,ptmax, nbins,nmin,nmax);
725 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
726 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
727 outputContainer->Add(fhNCellsPerClusterMod[imod]);
729 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
730 fhNCellsMod[imod]->SetXTitle("n cells");
731 outputContainer->Add(fhNCellsMod[imod]);
732 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
733 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
734 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
735 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
736 outputContainer->Add(fhGridCellsMod[imod]);
738 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
739 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
740 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
741 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
742 outputContainer->Add(fhGridCellsEMod[imod]);
744 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),
745 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
746 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)");
747 fhGridCellsTimeMod[imod]->SetXTitle("column (eta direction)");
748 outputContainer->Add(fhGridCellsTimeMod[imod]);
750 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
751 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
752 outputContainer->Add(fhAmplitudeMod[imod]);
754 if(fCalorimeter == "EMCAL"){
755 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
756 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);
757 fhAmplitudeModFraction[imod*3+ifrac]->SetXTitle("E (GeV)");
758 outputContainer->Add(fhAmplitudeModFraction[imod*3+ifrac]);
762 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
764 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
765 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
766 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
767 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
768 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
769 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
770 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
772 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
773 // Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu),
774 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
775 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
776 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
777 // outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
780 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
781 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
782 // Int_t index = (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod;
783 // fhTimeCorrRCU[index] = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
784 // Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
785 // ntimebins,timemin,timemax,ntimebins,timemin,timemax);
786 // fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
787 // fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
788 // outputContainer->Add(fhTimeCorrRCU[index]);
793 if(fFillAllPi0Histo){
794 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
795 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
796 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
797 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
798 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
799 outputContainer->Add(fhIMMod[imod]);
801 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
802 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
803 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
804 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
805 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
806 outputContainer->Add(fhIMCellCutMod[imod]);
811 //Monte Carlo Histograms
814 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
815 fhDeltaE->SetXTitle("#Delta E (GeV)");
816 outputContainer->Add(fhDeltaE);
818 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
819 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
820 outputContainer->Add(fhDeltaPt);
822 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
823 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
824 outputContainer->Add(fhDeltaPhi);
826 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
827 fhDeltaEta->SetXTitle("#Delta #eta ");
828 outputContainer->Add(fhDeltaEta);
830 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
831 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
832 outputContainer->Add(fhRatioE);
834 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
835 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
836 outputContainer->Add(fhRatioPt);
838 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
839 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
840 outputContainer->Add(fhRatioPhi);
842 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
843 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
844 outputContainer->Add(fhRatioEta);
846 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
847 fh2E->SetXTitle("E_{rec} (GeV)");
848 fh2E->SetYTitle("E_{gen} (GeV)");
849 outputContainer->Add(fh2E);
851 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
852 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
853 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
854 outputContainer->Add(fh2Pt);
856 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
857 fh2Phi->SetXTitle("#phi_{rec} (rad)");
858 fh2Phi->SetYTitle("#phi_{gen} (rad)");
859 outputContainer->Add(fh2Phi);
861 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
862 fh2Eta->SetXTitle("#eta_{rec} ");
863 fh2Eta->SetYTitle("#eta_{gen} ");
864 outputContainer->Add(fh2Eta);
866 //Fill histos depending on origin of cluster
867 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
868 fhGamE->SetXTitle("E_{rec} (GeV)");
869 fhGamE->SetXTitle("E_{gen} (GeV)");
870 outputContainer->Add(fhGamE);
872 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
873 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
874 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
875 outputContainer->Add(fhGamPt);
877 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
878 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
879 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
880 outputContainer->Add(fhGamPhi);
882 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
883 fhGamEta->SetXTitle("#eta_{rec} ");
884 fhGamEta->SetYTitle("#eta_{gen} ");
885 outputContainer->Add(fhGamEta);
887 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
888 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
889 outputContainer->Add(fhGamDeltaE);
891 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
892 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
893 outputContainer->Add(fhGamDeltaPt);
895 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
896 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
897 outputContainer->Add(fhGamDeltaPhi);
899 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
900 fhGamDeltaEta->SetXTitle("#Delta #eta ");
901 outputContainer->Add(fhGamDeltaEta);
903 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
904 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
905 outputContainer->Add(fhGamRatioE);
907 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
908 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
909 outputContainer->Add(fhGamRatioPt);
911 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
912 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
913 outputContainer->Add(fhGamRatioPhi);
915 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
916 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
917 outputContainer->Add(fhGamRatioEta);
919 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
920 fhPi0E->SetXTitle("E_{rec} (GeV)");
921 fhPi0E->SetYTitle("E_{gen} (GeV)");
922 outputContainer->Add(fhPi0E);
924 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
925 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
926 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
927 outputContainer->Add(fhPi0Pt);
929 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
930 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
931 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
932 outputContainer->Add(fhPi0Phi);
934 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
935 fhPi0Eta->SetXTitle("#eta_{rec} ");
936 fhPi0Eta->SetYTitle("#eta_{gen} ");
937 outputContainer->Add(fhPi0Eta);
939 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
940 fhEleE->SetXTitle("E_{rec} (GeV)");
941 fhEleE->SetXTitle("E_{gen} (GeV)");
942 outputContainer->Add(fhEleE);
944 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
945 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
946 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
947 outputContainer->Add(fhElePt);
949 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
950 fhElePhi->SetXTitle("#phi_{rec} (rad)");
951 fhElePhi->SetYTitle("#phi_{gen} (rad)");
952 outputContainer->Add(fhElePhi);
954 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
955 fhEleEta->SetXTitle("#eta_{rec} ");
956 fhEleEta->SetYTitle("#eta_{gen} ");
957 outputContainer->Add(fhEleEta);
959 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
960 fhNeHadE->SetXTitle("E_{rec} (GeV)");
961 fhNeHadE->SetYTitle("E_{gen} (GeV)");
962 outputContainer->Add(fhNeHadE);
964 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
965 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
966 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
967 outputContainer->Add(fhNeHadPt);
969 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
970 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
971 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
972 outputContainer->Add(fhNeHadPhi);
974 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
975 fhNeHadEta->SetXTitle("#eta_{rec} ");
976 fhNeHadEta->SetYTitle("#eta_{gen} ");
977 outputContainer->Add(fhNeHadEta);
979 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
980 fhChHadE->SetXTitle("E_{rec} (GeV)");
981 fhChHadE->SetYTitle("E_{gen} (GeV)");
982 outputContainer->Add(fhChHadE);
984 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
985 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
986 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
987 outputContainer->Add(fhChHadPt);
989 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
990 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
991 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
992 outputContainer->Add(fhChHadPhi);
994 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
995 fhChHadEta->SetXTitle("#eta_{rec} ");
996 fhChHadEta->SetYTitle("#eta_{gen} ");
997 outputContainer->Add(fhChHadEta);
1001 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1002 fhGamECharged->SetXTitle("E_{rec} (GeV)");
1003 fhGamECharged->SetXTitle("E_{gen} (GeV)");
1004 outputContainer->Add(fhGamECharged);
1006 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1007 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1008 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1009 outputContainer->Add(fhGamPtCharged);
1011 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1012 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
1013 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
1014 outputContainer->Add(fhGamPhiCharged);
1016 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1017 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
1018 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
1019 outputContainer->Add(fhGamEtaCharged);
1021 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1022 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
1023 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
1024 outputContainer->Add(fhPi0ECharged);
1026 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1027 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
1028 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
1029 outputContainer->Add(fhPi0PtCharged);
1031 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1032 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
1033 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
1034 outputContainer->Add(fhPi0PhiCharged);
1036 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1037 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
1038 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
1039 outputContainer->Add(fhPi0EtaCharged);
1041 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1042 fhEleECharged->SetXTitle("E_{rec} (GeV)");
1043 fhEleECharged->SetXTitle("E_{gen} (GeV)");
1044 outputContainer->Add(fhEleECharged);
1046 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1047 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
1048 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
1049 outputContainer->Add(fhElePtCharged);
1051 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1052 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
1053 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
1054 outputContainer->Add(fhElePhiCharged);
1056 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1057 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
1058 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
1059 outputContainer->Add(fhEleEtaCharged);
1061 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1062 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
1063 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
1064 outputContainer->Add(fhNeHadECharged);
1066 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1067 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1068 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1069 outputContainer->Add(fhNeHadPtCharged);
1071 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1072 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1073 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1074 outputContainer->Add(fhNeHadPhiCharged);
1076 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1077 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
1078 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
1079 outputContainer->Add(fhNeHadEtaCharged);
1081 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1082 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
1083 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
1084 outputContainer->Add(fhChHadECharged);
1086 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1087 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1088 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1089 outputContainer->Add(fhChHadPtCharged);
1091 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1092 fhChHadPhiCharged->SetXTitle("#phi (rad)");
1093 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1094 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1095 outputContainer->Add(fhChHadPhiCharged);
1097 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1098 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
1099 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
1100 outputContainer->Add(fhChHadEtaCharged);
1102 //Vertex of generated particles
1104 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1105 fhEMVxyz->SetXTitle("v_{x}");
1106 fhEMVxyz->SetYTitle("v_{y}");
1107 //fhEMVxyz->SetZTitle("v_{z}");
1108 outputContainer->Add(fhEMVxyz);
1110 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1111 fhHaVxyz->SetXTitle("v_{x}");
1112 fhHaVxyz->SetYTitle("v_{y}");
1113 //fhHaVxyz->SetZTitle("v_{z}");
1114 outputContainer->Add(fhHaVxyz);
1116 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1117 fhEMR->SetXTitle("E (GeV)");
1118 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1119 outputContainer->Add(fhEMR);
1121 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1122 fhHaR->SetXTitle("E (GeV)");
1123 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1124 outputContainer->Add(fhHaR);
1129 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
1130 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
1131 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
1133 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
1134 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
1135 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
1137 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
1138 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
1139 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
1141 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
1142 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
1143 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
1145 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
1146 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
1147 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
1149 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
1150 fhGenGamEta->SetXTitle("#eta");
1151 fhGenGamPhi->SetXTitle("#phi (rad)");
1152 outputContainer->Add(fhGenGamPt);
1153 outputContainer->Add(fhGenGamEta);
1154 outputContainer->Add(fhGenGamPhi);
1156 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
1157 fhGenPi0Eta->SetXTitle("#eta");
1158 fhGenPi0Phi->SetXTitle("#phi (rad)");
1159 outputContainer->Add(fhGenPi0Pt);
1160 outputContainer->Add(fhGenPi0Eta);
1161 outputContainer->Add(fhGenPi0Phi);
1163 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
1164 fhGenEtaEta->SetXTitle("#eta");
1165 fhGenEtaPhi->SetXTitle("#phi (rad)");
1166 outputContainer->Add(fhGenEtaPt);
1167 outputContainer->Add(fhGenEtaEta);
1168 outputContainer->Add(fhGenEtaPhi);
1170 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
1171 fhGenOmegaEta->SetXTitle("#eta");
1172 fhGenOmegaPhi->SetXTitle("#phi (rad)");
1173 outputContainer->Add(fhGenOmegaPt);
1174 outputContainer->Add(fhGenOmegaEta);
1175 outputContainer->Add(fhGenOmegaPhi);
1177 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
1178 fhGenEleEta->SetXTitle("#eta");
1179 fhGenElePhi->SetXTitle("#phi (rad)");
1180 outputContainer->Add(fhGenElePt);
1181 outputContainer->Add(fhGenEleEta);
1182 outputContainer->Add(fhGenElePhi);
1184 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1185 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1186 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
1187 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
1189 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1190 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1191 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
1192 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
1194 fhGenGamAccE ->SetXTitle("E (GeV)");
1195 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
1196 fhGenGamAccEta->SetXTitle("#eta");
1197 fhGenGamAccPhi->SetXTitle("#phi (rad)");
1198 outputContainer->Add(fhGenGamAccE);
1199 outputContainer->Add(fhGenGamAccPt);
1200 outputContainer->Add(fhGenGamAccEta);
1201 outputContainer->Add(fhGenGamAccPhi);
1203 fhGenPi0AccE ->SetXTitle("E (GeV)");
1204 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
1205 fhGenPi0AccEta->SetXTitle("#eta");
1206 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
1207 outputContainer->Add(fhGenPi0AccE);
1208 outputContainer->Add(fhGenPi0AccPt);
1209 outputContainer->Add(fhGenPi0AccEta);
1210 outputContainer->Add(fhGenPi0AccPhi);
1214 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1215 fhMCEle1pOverE->SetYTitle("p/E");
1216 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1217 outputContainer->Add(fhMCEle1pOverE);
1219 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
1220 fhMCEle1dR->SetXTitle("#Delta R (rad)");
1221 outputContainer->Add(fhMCEle1dR) ;
1223 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1224 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1225 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1226 outputContainer->Add(fhMCEle2MatchdEdx);
1228 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1229 fhMCChHad1pOverE->SetYTitle("p/E");
1230 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1231 outputContainer->Add(fhMCChHad1pOverE);
1233 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1234 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1235 outputContainer->Add(fhMCChHad1dR) ;
1237 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1238 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1239 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1240 outputContainer->Add(fhMCChHad2MatchdEdx);
1242 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1243 fhMCNeutral1pOverE->SetYTitle("p/E");
1244 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1245 outputContainer->Add(fhMCNeutral1pOverE);
1247 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1248 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1249 outputContainer->Add(fhMCNeutral1dR) ;
1251 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1252 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1253 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1254 outputContainer->Add(fhMCNeutral2MatchdEdx);
1256 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1257 fhMCEle1pOverER02->SetYTitle("p/E");
1258 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1259 outputContainer->Add(fhMCEle1pOverER02);
1261 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1262 fhMCChHad1pOverER02->SetYTitle("p/E");
1263 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1264 outputContainer->Add(fhMCChHad1pOverER02);
1266 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1267 fhMCNeutral1pOverER02->SetYTitle("p/E");
1268 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1269 outputContainer->Add(fhMCNeutral1pOverER02);
1272 // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
1273 // printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
1275 return outputContainer;
1278 //_______________________________________________________________________________________________________________________________________
1279 Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
1281 //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
1283 Float_t oldbinsize = histo->GetBinWidth(0);
1284 Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
1286 //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
1287 if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
1292 //__________________________________________________
1293 void AliAnaCalorimeterQA::Init()
1295 //Check if the data or settings are ok
1297 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL")
1298 AliFatal(Form("Wrong calorimeter name <%s>", fCalorimeter.Data()));
1300 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC)
1301 AliFatal("Analysis of reconstructed data, MC reader not aplicable");
1306 //__________________________________________________
1307 void AliAnaCalorimeterQA::InitParameters()
1309 //Initialize the parameters of the analysis.
1310 AddToHistogramsName("AnaCaloQA_");
1312 fCalorimeter = "EMCAL"; //or PHOS
1314 fNModules = 12; // set maximum to maximum number of EMCAL modules
1315 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
1317 fTimeCutMax = 9999999;
1318 fEMCALCellAmpMin = 0.0;
1319 fPHOSCellAmpMin = 0.0;
1323 //__________________________________________________________________
1324 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1326 //Print some relevant parameters set for the analysis
1330 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1331 AliAnaPartCorrBaseClass::Print(" ");
1333 printf("Select Calorimeter %s \n",fCalorimeter.Data());
1334 printf("Plots style macro %s \n",fStyleMacro.Data());
1335 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
1336 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
1337 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
1341 //__________________________________________________________________
1342 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1344 //Fill Calorimeter QA histograms
1345 TLorentzVector mom ;
1346 TLorentzVector mom2 ;
1347 TObjArray * caloClusters = NULL;
1350 Int_t nCaloClusters = 0;
1351 Int_t nCaloClustersAccepted = 0;
1352 Int_t nCaloCellsPerCluster = 0;
1353 Int_t nTracksMatched = 0;
1354 Int_t trackIndex = 0;
1357 //Get vertex for photon momentum calculation and event selection
1358 Double_t v[3] = {0,0,0}; //vertex ;
1359 GetReader()->GetVertex(v);
1360 if (TMath::Abs(v[2]) > GetZvertexCut()) return ;
1362 //Play with the MC stack if available
1363 //Get the MC arrays and do some checks
1365 if(GetReader()->ReadStack()){
1368 AliFatal("Stack not available, is the MC handler called?\n");
1370 //Fill some pure MC histograms, only primaries.
1371 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1372 TParticle *primary = GetMCStack()->Particle(i) ;
1373 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1374 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1375 primary->Momentum(mom);
1376 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1379 else if(GetReader()->ReadAODMCParticles()){
1381 if(!GetReader()->GetAODMCParticles(0))
1382 AliFatal("AODMCParticles not available!");
1384 //Fill some pure MC histograms, only primaries.
1385 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1386 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1387 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1388 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1389 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1390 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1391 //aodprimary->Momentum(mom);
1392 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1393 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1400 //Get List with CaloClusters
1401 if (fCalorimeter == "PHOS") caloClusters = GetPHOSClusters();
1402 else if (fCalorimeter == "EMCAL") caloClusters = GetEMCALClusters();
1404 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
1406 // if (fCalorimeter == "EMCAL") GetReader()->GetInputEvent()->GetEMCALClusters(caloClusters);//GetEMCALClusters();
1407 // else if(fCalorimeter == "PHOS") GetReader()->GetInputEvent()->GetPHOSClusters (caloClusters);//GetPHOSClusters();
1409 // AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
1412 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n"));
1415 //----------------------------------------------------------
1416 //Correlate Calorimeters and V0 and track Multiplicity
1417 //----------------------------------------------------------
1418 if(fCorrelate) Correlate();
1420 //----------------------------------------------------------
1422 //----------------------------------------------------------
1424 nCaloClusters = caloClusters->GetEntriesFast() ;
1425 Int_t *nClustersInModule = new Int_t[fNModules];
1426 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1429 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1431 AliVTrack * track = 0x0;
1434 //Loop over CaloClusters
1435 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1436 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1438 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1439 iclus+1,nCaloClusters,GetReader()->GetDataType());
1441 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
1442 AliVCaloCells * cell = 0x0;
1443 if(fCalorimeter == "PHOS") cell = GetPHOSCells();
1444 else cell = GetEMCALCells();
1446 //Get cluster kinematics
1447 clus->GetPosition(pos);
1448 clus->GetMomentum(mom,v);
1449 tof = clus->GetTOF()*1e9;
1450 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1452 //Check only certain regions
1454 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1458 nLabel = clus->GetNLabels();
1459 labels = clus->GetLabels();
1462 nCaloCellsPerCluster = clus->GetNCells();
1463 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1465 //matched cluster with tracks
1466 nTracksMatched = clus->GetNTracksMatched();
1467 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1468 trackIndex = clus->GetTrackMatchedIndex();
1469 if(trackIndex >= 0){
1470 track = (AliVTrack*)GetReader()->GetInputEvent()->GetTrack(trackIndex);
1473 if(nTracksMatched == 1) nTracksMatched = 0;
1478 if(nTracksMatched > 0) track = (AliVTrack*)clus->GetTrackMatched(0);
1481 //======================
1483 //======================
1485 //Get list of contributors
1486 UShort_t * indexList = clus->GetCellsAbsId() ;
1487 // check time of cells respect to max energy cell
1488 //Get maximum energy cell
1493 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1494 //Loop on cluster cells
1495 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1496 // printf("Index %d\n",ipos);
1497 absId = indexList[ipos];
1499 //Get position of cell compare to cluster
1500 if(fFillAllPosHisto){
1501 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1503 Double_t cellpos[] = {0, 0, 0};
1504 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1506 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1507 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1508 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1510 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1511 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1512 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1514 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1515 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1516 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1517 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1519 // Float_t celleta = 0, cellphi = 0;
1520 // GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi);
1521 // Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
1522 // GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1523 // GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1524 // iIphi, iIeta,iphi,ieta);
1525 // printf("AbsId %d, SM %d, Index eta %d, phi %d\n", absId, imod, ieta, iphi);
1526 // 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());
1527 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1528 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1529 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1530 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1533 }//EMCAL and its matrices are available
1534 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1536 Int_t relId[4], module;
1537 Float_t xCell, zCell;
1539 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1541 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1542 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1544 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1545 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1546 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1548 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1549 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1550 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1552 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1553 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1554 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1555 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1557 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1558 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1559 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1560 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1561 }//PHOS and its matrices are available
1562 }//Fill all position histograms
1564 //Find maximum energy cluster
1565 if(cell->GetCellAmplitude(absId) > emax) {
1567 emax = cell->GetCellAmplitude(absId);
1568 tmax = cell->GetCellTime(absId)*1e9;
1571 }// cluster cell loop
1573 //Check bad clusters if rejection was not on
1574 Bool_t badCluster = kFALSE;
1575 if(fCalorimeter=="EMCAL" && !GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster()){
1576 //Bad clusters histograms
1577 Float_t minNCells = 1+mom.E()/6;
1578 //if(nCaloCellsPerCluster > 8) minNCells = 0;
1579 if(clus->GetM02() < 0.01 || nCaloCellsPerCluster < minNCells) {
1580 //if(clus->GetM02() > 0 || TMath::Abs(clus->GetM20()) > 0 || clus->GetDispersion() > 0)
1582 Int_t sm =0; Int_t ietaa=-1; Int_t iphii = 0; Int_t rcu = 0;
1583 sm = GetModuleNumberCellIndexes(absId,fCalorimeter, ietaa, iphii, rcu);
1584 // if(clus->GetNCells() > 3){
1585 // printf("Bad : E %f, ncells %d, nclusters %d, dist to bad %f, l0 %f, l1 %f, d %f, cell max t %f, cluster TOF %f, sm %d, icol %d, irow %d, rcu %d\n",
1586 // clus->E(), clus->GetNCells(),nCaloClusters, clus->GetDistanceToBadChannel(),
1587 // clus->GetM02(), clus->GetM20(), clus->GetDispersion(),tmax, tof,sm,ietaa,iphii,rcu);
1592 fhBadClusterEnergy ->Fill(clus->E());
1593 fhBadClusterMaxCellDiff->Fill(clus->E(),(clus->E()-emax)/clus->E());
1594 fhBadClusterTimeEnergy ->Fill(clus->E(),tof);
1595 //printf("bad tof : %2.3f\n",tof);
1596 //if(clus->E() - emax < 0)printf("What?\n");
1598 //Clusters in event time difference
1600 for(Int_t iclus2 = 0; iclus2 < nCaloClusters; iclus2++ ){
1602 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(iclus2);
1604 if(clus->GetID()==clus2->GetID()) continue;
1606 if(clus->GetM02() > 0.01) {
1607 fhBadClusterPairDiffTimeE ->Fill(clus->E(), tof-clus2->GetTOF()*1.e9);
1608 // if(clus->GetNCells()>3) printf("\t i %d, E %f, nCells %d, dist to bad %f, good tof %f, bad tof %f, diff %f \n",
1609 // iclus2, clus2->E(), clus2->GetNCells(), clus->GetDistanceToBadChannel(), tof,clus2->GetTOF()*1.e9,tof-clus2->GetTOF()*1.e9);
1612 // Int_t absId2 = clus2->GetCellsAbsId()[0];
1613 // Int_t sm2 =0; Int_t ietaa2=-1; Int_t iphii2 = 0; Int_t rcu2 = 0;
1614 // sm2 = GetModuleNumberCellIndexes(absId2,fCalorimeter, ietaa2, iphii2, rcu2);
1615 // if(clus->GetNCells()>3) printf("i %d, E %f, nCells %d, bad tof %f, bad tof %f, diff %f, sm %d, icol %d, irow %d, rcu %d\n",
1616 // iclus2, clus2->E(), clus2->GetNCells(), tof,clus2->GetTOF()*1.e9,tof-clus2->GetTOF()*1.e9,sm2,ietaa2,iphii2,rcu2);
1623 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1624 // printf("Index %d\n",ipos);
1626 absId = indexList[ipos];
1627 Float_t frac = cell->GetCellAmplitude(absId)/emax;
1628 //printf("bad frac : %2.3f, e %2.2f, ncells %d, min %2.1f\n",frac,mom.E(),nCaloCellsPerCluster,minNCells);
1629 fhBadClusterMaxCellCloseCellRatio->Fill(mom.E(),frac);
1634 if(nCaloCellsPerCluster > 1){
1635 fhBadClusterLambda0 ->Fill(mom.E(),clus->GetM02());
1636 fhBadClusterLambda1 ->Fill(mom.E(),clus->GetM20());
1637 fhBadClusterDispersion->Fill(mom.E(),clus->GetDispersion()*clus->GetDispersion());
1639 fhBadClusterL0L1 ->Fill(clus->GetM02(),clus->GetM20());
1647 // if(TMath::Abs(clus->GetM20()) < 0.0001 && clus->GetNCells() > 3){
1648 // Int_t sm =0; Int_t ietaa=-1; Int_t iphii = 0; Int_t rcu = 0;
1649 // sm = GetModuleNumberCellIndexes(absId,fCalorimeter, ietaa, iphii, rcu);
1650 // printf("Good : E %f, mcells %d, l0 %f, l1 %f, d %f, cell max t %f, cluster TOF %f, sm %d, icol %d, irow %d \n",
1651 // clus->E(), clus->GetNCells(),clus->GetM02(), clus->GetM20(), clus->GetDispersion(),tmax, tof,sm,ietaa,iphii);
1655 fhClusterMaxCellDiff->Fill(clus->E(),(clus->E()-emax)/clus->E());
1656 fhClusterTimeEnergy ->Fill(mom.E(),tof);
1658 //Clusters in event time difference
1659 for(Int_t iclus2 = 0; iclus2 < nCaloClusters; iclus2++ ){
1661 AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
1663 if(clus->GetID()==clus2->GetID()) continue;
1665 if(clus->GetM02() > 0.01) {
1666 fhClusterPairDiffTimeE ->Fill(clus->E(), tof-clus2->GetTOF()*1.e9);
1670 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1671 // printf("Index %d\n",ipos);
1673 absId = indexList[ipos];
1674 Float_t frac = cell->GetCellAmplitude(absId)/emax;
1675 //printf("good frac : %2.3f\n",frac);
1676 fhClusterMaxCellCloseCellRatio->Fill(mom.E(),frac);
1680 // check time of cells respect to max energy cell
1681 if(nCaloCellsPerCluster > 1 && GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1682 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1683 if(imax == ipos) continue;
1684 absId = indexList[ipos];
1685 Float_t diff = (tmax-cell->GetCellTime(absId))*1e9;
1686 fhCellTimeSpreadRespectToCellMax->Fill(diff);
1687 if(TMath::Abs(TMath::Abs(diff) > 100)) fhCellIdCellLargeTimeSpread->Fill(absId);
1688 }// fill cell-cluster histogram loop
1689 }//check time of cells respect to max energy cell
1692 //Get module of cluster
1693 nCaloClustersAccepted++;
1694 nModule = GetModuleNumber(clus);
1695 if(nModule >=0 && nModule < fNModules) nClustersInModule[nModule]++;
1697 //-----------------------------------------------------------
1698 //Fill histograms related to single cluster or track matching
1699 //-----------------------------------------------------------
1700 ClusterHistograms(mom, pos, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1703 //-----------------------------------------------------------
1705 //-----------------------------------------------------------
1706 if(fFillAllPi0Histo){
1707 if(GetDebug()>1) printf("Invariant mass \n");
1709 //do not do for bad vertex
1710 // Float_t fZvtxCut = 40. ;
1711 if(v[2]<-GetZvertexCut() || v[2]> GetZvertexCut()) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
1713 Int_t nModule2 = -1;
1714 Int_t nCaloCellsPerCluster2=0;
1715 if (nCaloClusters > 1 ) {
1716 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1717 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
1719 //Get cluster kinematics
1720 clus2->GetMomentum(mom2,v);
1721 //Check only certain regions
1723 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1725 //Get module of cluster
1726 nModule2 = GetModuleNumber(clus2);
1728 nCaloCellsPerCluster2 = clus2->GetNCells();
1730 //Fill invariant mass histograms
1733 //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());
1734 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1736 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1737 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1739 //Select only clusters with at least 2 cells
1740 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1742 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1744 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1745 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1748 //Asymetry histograms
1749 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1751 }// 2nd cluster loop
1758 //Number of clusters histograms
1759 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
1760 // Number of clusters per module
1761 for(Int_t imod = 0; imod < fNModules; imod++ ){
1763 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1764 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1766 delete [] nClustersInModule;
1767 //delete caloClusters;
1768 }// calo clusters array exists
1770 //----------------------------------------------------------
1772 //----------------------------------------------------------
1774 AliVCaloCells * cell = 0x0;
1776 if(fCalorimeter == "PHOS")
1777 cell = GetPHOSCells();
1779 cell = GetEMCALCells();
1782 AliFatal(Form("No %s CELLS available for analysis",fCalorimeter.Data()));
1783 return; // just to trick coverity
1787 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - %s cell entries %d\n", fCalorimeter.Data(), cell->GetNumberOfCells());
1789 //Init arrays and used variables
1790 Int_t *nCellsInModule = new Int_t[fNModules];
1791 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1798 Float_t recalF = 1.;
1800 for (Int_t iCell = 0; iCell < cell->GetNumberOfCells(); iCell++) {
1802 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1803 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
1805 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1807 if(nModule < fNModules) {
1809 //Check if the cell is a bad channel
1810 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1811 if(fCalorimeter=="EMCAL"){
1812 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1815 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
1816 printf("PHOS bad channel\n");
1820 } // use bad channel map
1822 //Get Recalibration factor if set
1823 if (GetCaloUtils()->IsRecalibrationOn()) {
1824 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1825 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1826 //if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
1829 amp = cell->GetAmplitude(iCell)*recalF;
1830 time = cell->GetTime(iCell)*1e9;//transform time to ns
1832 //Remove noisy channels, only possible in ESDs
1833 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1834 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1836 //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
1837 // amp,time,nModule,icol,irow);
1839 id = cell->GetCellNumber(iCell);
1840 fhAmplitude->Fill(amp);
1841 fhAmpId ->Fill(amp,id);
1843 fhAmplitudeMod[nModule]->Fill(amp);
1844 if(fCalorimeter=="EMCAL"){
1846 if(icol > 15 && icol < 32) ifrac = 1;
1847 else if(icol > 31) ifrac = 2;
1848 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
1851 nCellsInModule[nModule]++;
1852 fhGridCellsMod[nModule] ->Fill(icol,irow);
1853 fhGridCellsEMod[nModule] ->Fill(icol,irow,amp);
1855 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1856 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1857 fhTime ->Fill(time);
1858 fhTimeId ->Fill(time,id);
1859 fhTimeAmp ->Fill(amp,time);
1861 //Double_t t0 = GetReader()->GetInputEvent()->GetT0();
1862 //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0,
1863 // GetReader()->GetInputEvent()->GetT0zVertex(),
1864 // GetReader()->GetInputEvent()->GetT0clock(),
1865 // GetReader()->GetInputEvent()->GetT0Trig());
1866 //fhT0Time ->Fill(time-t0);
1867 //fhT0TimeId ->Fill(time-t0,id);
1868 //fhT0TimeAmp ->Fill(amp,time-t0);
1870 //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
1871 //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
1873 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
1876 fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
1878 // AliESDCaloCells * cell2 = 0x0;
1879 // if(fCalorimeter == "PHOS") cell2 = GetReader()->GetInputEvent()->GetPHOSCells();
1880 // else cell2 = GetReader()->GetInputEvent()->GetEMCALCells();
1881 // Int_t icol2 = -1;
1882 // Int_t irow2 = -1;
1883 // Int_t iRCU2 = -1;
1884 // Float_t amp2 = 0.;
1885 // Float_t time2 = 0.;
1887 // Int_t nModule2 = -1;
1888 // for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {
1889 // amp2 = cell2->GetAmplitude(iCell2);
1890 // if(amp2 < 0.3) continue;
1891 // if(iCell2 == iCell) continue;
1892 // time2 = cell2->GetTime(iCell2)*1e9;//transform time to ns
1893 // //printf("%s: time %g\n",fCalorimeter.Data(), time);
1894 // id2 = cell2->GetCellNumber(iCell2);
1895 // nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
1896 // Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule);
1897 // //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());
1898 // fhTimeCorrRCU[index]->Fill(time,time2);
1900 // }// second cell loop
1906 //Get Eta-Phi position of Cell
1907 if(fFillAllPosHisto)
1909 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1910 Float_t celleta = 0.;
1911 Float_t cellphi = 0.;
1912 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1914 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1915 Double_t cellpos[] = {0, 0, 0};
1916 GetEMCALGeometry()->GetGlobal(id, cellpos);
1917 fhXCellE->Fill(cellpos[0],amp) ;
1918 fhYCellE->Fill(cellpos[1],amp) ;
1919 fhZCellE->Fill(cellpos[2],amp) ;
1920 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1921 fhRCellE->Fill(rcell,amp) ;
1922 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1924 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1926 Int_t relId[4], module;
1927 Float_t xCell, zCell;
1929 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
1931 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1932 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1933 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
1934 fhXCellE ->Fill(xyz.X(),amp) ;
1935 fhYCellE ->Fill(xyz.Y(),amp) ;
1936 fhZCellE ->Fill(xyz.Z(),amp) ;
1937 fhRCellE ->Fill(rcell ,amp) ;
1938 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
1940 }//fill cell position histograms
1942 if (fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ncells ++ ;
1943 else if(fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin) ncells ++ ;
1945 // printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - no %s CELLS passed the analysis cut\n",fCalorimeter.Data());
1948 if(ncells > 0 )fhNCells->Fill(ncells) ; //fill the cells after the cut
1950 //Number of cells per module
1951 for(Int_t imod = 0; imod < fNModules; imod++ ) {
1953 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
1954 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
1956 delete [] nCellsInModule;
1959 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1963 //_____________________________________________________________________________________________
1964 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom,
1965 Float_t *pos, const Int_t nCaloCellsPerCluster,const Int_t nModule,
1966 const Int_t nTracksMatched, const AliVTrack * track,
1967 const Int_t * labels, const Int_t nLabels){
1968 //Fill CaloCluster related histograms
1970 AliAODMCParticle * aodprimary = 0x0;
1971 TParticle * primary = 0x0;
1974 Float_t e = mom.E();
1975 Float_t pt = mom.Pt();
1976 Float_t eta = mom.Eta();
1977 Float_t phi = mom.Phi();
1978 if(phi < 0) phi +=TMath::TwoPi();
1979 if(GetDebug() > 0) {
1980 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
1982 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
1983 printf("\t Primaries: nlabels %d\n",nLabels);
1984 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
1989 if(nModule >=0 && nModule < fNModules) fhEMod[nModule]->Fill(e);
1996 fhEtaPhiE->Fill(eta,phi,e);
1999 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster);
2000 fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster);
2003 if(fFillAllPosHisto2){
2004 fhXE ->Fill(pos[0],e);
2005 fhYE ->Fill(pos[1],e);
2006 fhZE ->Fill(pos[2],e);
2008 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
2010 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
2011 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
2012 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
2013 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
2014 fhRE ->Fill(rxyz,e);
2015 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
2018 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
2020 //Fill histograms only possible when simulation
2021 if(IsDataMC() && nLabels > 0 && labels){
2023 //Play with the MC stack if available
2024 Int_t label = labels[0];
2027 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
2031 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
2032 Float_t vxMC= 0; Float_t vyMC = 0;
2033 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
2037 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
2039 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
2041 if( label >= GetMCStack()->GetNtrack()) {
2042 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
2046 primary = GetMCStack()->Particle(label);
2048 pdg0 = TMath::Abs(primary->GetPdgCode());
2050 status = primary->GetStatusCode();
2051 vxMC = primary->Vx();
2052 vyMC = primary->Vy();
2053 iParent = primary->GetFirstMother();
2055 if(GetDebug() > 1 ) {
2056 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2057 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
2060 //Get final particle, no conversion products
2061 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2063 primary = GetMCStack()->Particle(iParent);
2064 pdg = TMath::Abs(primary->GetPdgCode());
2065 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2066 while((pdg == 22 || pdg == 11) && status != 1){
2068 primary = GetMCStack()->Particle(iMother);
2069 status = primary->GetStatusCode();
2070 iParent = primary->GetFirstMother();
2071 pdg = TMath::Abs(primary->GetPdgCode());
2072 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
2075 if(GetDebug() > 1 ) {
2076 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2077 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
2082 //Overlapped pi0 (or eta, there will be very few), get the meson
2083 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2084 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2085 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
2086 while(pdg != 111 && pdg != 221){
2088 primary = GetMCStack()->Particle(iMother);
2089 status = primary->GetStatusCode();
2090 iParent = primary->GetFirstMother();
2091 pdg = TMath::Abs(primary->GetPdgCode());
2092 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
2094 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2099 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2100 primary->GetName(),iMother);
2103 eMC = primary->Energy();
2104 ptMC = primary->Pt();
2105 phiMC = primary->Phi();
2106 etaMC = primary->Eta();
2107 pdg = TMath::Abs(primary->GetPdgCode());
2108 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2111 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
2112 //Get the list of MC particles
2113 if(!GetReader()->GetAODMCParticles(0))
2114 AliFatal("MCParticles not available!");
2116 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
2118 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
2120 status = aodprimary->IsPrimary();
2121 vxMC = aodprimary->Xv();
2122 vyMC = aodprimary->Yv();
2123 iParent = aodprimary->GetMother();
2125 if(GetDebug() > 1 ) {
2126 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2127 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
2128 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
2131 //Get final particle, no conversion products
2132 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2134 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2136 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
2137 pdg = TMath::Abs(aodprimary->GetPdgCode());
2138 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
2140 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2141 status = aodprimary->IsPrimary();
2142 iParent = aodprimary->GetMother();
2143 pdg = TMath::Abs(aodprimary->GetPdgCode());
2145 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
2146 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2149 if(GetDebug() > 1 ) {
2150 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2151 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
2152 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2157 //Overlapped pi0 (or eta, there will be very few), get the meson
2158 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2159 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2160 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
2161 while(pdg != 111 && pdg != 221){
2164 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2165 status = aodprimary->IsPrimary();
2166 iParent = aodprimary->GetMother();
2167 pdg = TMath::Abs(aodprimary->GetPdgCode());
2169 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
2172 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2177 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2178 aodprimary->GetName(),iMother);
2181 status = aodprimary->IsPrimary();
2182 eMC = aodprimary->E();
2183 ptMC = aodprimary->Pt();
2184 phiMC = aodprimary->Phi();
2185 etaMC = aodprimary->Eta();
2186 pdg = TMath::Abs(aodprimary->GetPdgCode());
2187 charge = aodprimary->Charge();
2191 //Float_t vz = primary->Vz();
2192 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
2193 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
2194 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2195 fhEMR ->Fill(e,rVMC);
2198 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
2199 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
2200 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
2203 fh2E ->Fill(e, eMC);
2204 fh2Pt ->Fill(pt, ptMC);
2205 fh2Phi ->Fill(phi, phiMC);
2206 fh2Eta ->Fill(eta, etaMC);
2207 fhDeltaE ->Fill(eMC-e);
2208 fhDeltaPt ->Fill(ptMC-pt);
2209 fhDeltaPhi->Fill(phiMC-phi);
2210 fhDeltaEta->Fill(etaMC-eta);
2211 if(eMC > 0) fhRatioE ->Fill(e/eMC);
2212 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
2213 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
2214 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
2217 //Overlapped pi0 (or eta, there will be very few)
2218 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2219 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2220 fhPi0E ->Fill(e,eMC);
2221 fhPi0Pt ->Fill(pt,ptMC);
2222 fhPi0Eta ->Fill(eta,etaMC);
2223 fhPi0Phi ->Fill(phi,phiMC);
2224 if( nTracksMatched > 0){
2225 fhPi0ECharged ->Fill(e,eMC);
2226 fhPi0PtCharged ->Fill(pt,ptMC);
2227 fhPi0PhiCharged ->Fill(phi,phiMC);
2228 fhPi0EtaCharged ->Fill(eta,etaMC);
2230 }//Overlapped pizero decay
2231 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
2232 fhGamE ->Fill(e,eMC);
2233 fhGamPt ->Fill(pt,ptMC);
2234 fhGamEta ->Fill(eta,etaMC);
2235 fhGamPhi ->Fill(phi,phiMC);
2236 fhGamDeltaE ->Fill(eMC-e);
2237 fhGamDeltaPt ->Fill(ptMC-pt);
2238 fhGamDeltaPhi->Fill(phiMC-phi);
2239 fhGamDeltaEta->Fill(etaMC-eta);
2240 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
2241 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
2242 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
2243 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
2244 if( nTracksMatched > 0){
2245 fhGamECharged ->Fill(e,eMC);
2246 fhGamPtCharged ->Fill(pt,ptMC);
2247 fhGamPhiCharged ->Fill(phi,phiMC);
2248 fhGamEtaCharged ->Fill(eta,etaMC);
2251 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
2252 fhEleE ->Fill(e,eMC);
2253 fhElePt ->Fill(pt,ptMC);
2254 fhEleEta ->Fill(eta,etaMC);
2255 fhElePhi ->Fill(phi,phiMC);
2256 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2257 fhEMR ->Fill(e,rVMC);
2258 if( nTracksMatched > 0){
2259 fhEleECharged ->Fill(e,eMC);
2260 fhElePtCharged ->Fill(pt,ptMC);
2261 fhElePhiCharged ->Fill(phi,phiMC);
2262 fhEleEtaCharged ->Fill(eta,etaMC);
2265 else if(charge == 0){
2266 fhNeHadE ->Fill(e,eMC);
2267 fhNeHadPt ->Fill(pt,ptMC);
2268 fhNeHadEta ->Fill(eta,etaMC);
2269 fhNeHadPhi ->Fill(phi,phiMC);
2270 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2271 fhHaR ->Fill(e,rVMC);
2272 if( nTracksMatched > 0){
2273 fhNeHadECharged ->Fill(e,eMC);
2274 fhNeHadPtCharged ->Fill(pt,ptMC);
2275 fhNeHadPhiCharged ->Fill(phi,phiMC);
2276 fhNeHadEtaCharged ->Fill(eta,etaMC);
2280 fhChHadE ->Fill(e,eMC);
2281 fhChHadPt ->Fill(pt,ptMC);
2282 fhChHadEta ->Fill(eta,etaMC);
2283 fhChHadPhi ->Fill(phi,phiMC);
2284 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2285 fhHaR ->Fill(e,rVMC);
2286 if( nTracksMatched > 0){
2287 fhChHadECharged ->Fill(e,eMC);
2288 fhChHadPtCharged ->Fill(pt,ptMC);
2289 fhChHadPhiCharged ->Fill(phi,phiMC);
2290 fhChHadEtaCharged ->Fill(eta,etaMC);
2296 //Match tracks and clusters
2297 //To be Modified in case of AODs
2299 if( nTracksMatched > 0 && fFillAllTMHisto){
2300 if(fFillAllTH12 && fFillAllTMHisto){
2301 fhECharged ->Fill(e);
2302 fhPtCharged ->Fill(pt);
2303 fhPhiCharged ->Fill(phi);
2304 fhEtaCharged ->Fill(eta);
2307 if(fFillAllTMHisto){
2308 if(fFillAllTH3)fhEtaPhiECharged->Fill(eta,phi,e);
2309 fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster);
2311 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2312 //Study the track and matched cluster if track exists.
2314 Double_t emcpos[3] = {0.,0.,0.};
2315 Double_t emcmom[3] = {0.,0.,0.};
2316 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2317 Double_t bfield = 0.;
2323 Double_t tpcSignal = 0;
2324 Bool_t okpos = kFALSE;
2325 Bool_t okmom = kFALSE;
2326 Bool_t okout = kFALSE;
2330 //In case of ESDs get the parameters in this way
2331 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2332 if (track->GetOuterParam() ) {
2335 bfield = GetReader()->GetInputEvent()->GetMagneticField();
2336 okpos = track->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2337 okmom = track->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2338 if(!(okpos && okmom)) return;
2340 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2341 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2342 tphi = position.Phi();
2343 teta = position.Eta();
2344 tmom = momentum.Mag();
2346 //Double_t tphi = track->GetOuterParam()->Phi();
2347 //Double_t teta = track->GetOuterParam()->Eta();
2348 //Double_t tmom = track->GetOuterParam()->P();
2351 tpcSignal = track->GetTPCsignal();
2353 nITS = track->GetNcls(0);
2354 nTPC = track->GetNcls(1);
2355 }//Outer param available
2357 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2358 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2361 pid->GetEMCALPosition(emcpos);
2362 pid->GetEMCALMomentum(emcmom);
2364 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2365 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2366 tphi = position.Phi();
2367 teta = position.Eta();
2368 tmom = momentum.Mag();
2372 tpcSignal = pid->GetTPCsignal();
2374 //nITS = ((AliAODTrack*)track)->GetNcls(0);
2375 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
2380 Double_t deta = teta - eta;
2381 Double_t dphi = tphi - phi;
2382 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2383 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2384 Double_t dR = sqrt(dphi*dphi + deta*deta);
2386 Double_t pOverE = tmom/e;
2388 fh1pOverE->Fill(tpt, pOverE);
2389 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
2392 fh2MatchdEdx->Fill(tmom2,tpcSignal);
2394 if(IsDataMC() && primary){
2395 Int_t pdg = primary->GetPdgCode();
2396 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2398 if(TMath::Abs(pdg) == 11){
2399 fhMCEle1pOverE->Fill(tpt,pOverE);
2400 fhMCEle1dR->Fill(dR);
2401 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2402 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2405 fhMCChHad1pOverE->Fill(tpt,pOverE);
2406 fhMCChHad1dR->Fill(dR);
2407 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2408 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2410 else if(charge == 0){
2411 fhMCNeutral1pOverE->Fill(tpt,pOverE);
2412 fhMCNeutral1dR->Fill(dR);
2413 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2414 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2418 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2419 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2420 fh2EledEdx->Fill(tmom2,tpcSignal);
2423 else{//no ESD external param or AODPid
2424 // ULong_t status=AliESDtrack::kTPCrefit;
2425 // status|=AliESDtrack::kITSrefit;
2426 //printf("track status %d\n", track->GetStatus() );
2427 // fhEChargedNoOut ->Fill(e);
2428 // fhPtChargedNoOut ->Fill(pt);
2429 // fhPhiChargedNoOut ->Fill(phi);
2430 // fhEtaChargedNoOut ->Fill(eta);
2431 // fhEtaPhiChargedNoOut ->Fill(eta,phi);
2432 // if(GetDebug() >= 0 && ((track->GetStatus() & status) == status)) printf("ITS+TPC\n");
2433 if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
2436 }//matched clusters with tracks
2441 //__________________________________
2442 void AliAnaCalorimeterQA::Correlate(){
2443 // Correlate information from PHOS and EMCAL and with V0 and track multiplicity
2446 TObjArray * caloClustersEMCAL = GetEMCALClusters();
2447 TObjArray * caloClustersPHOS = GetPHOSClusters();
2449 Int_t nclEMCAL = caloClustersEMCAL->GetEntriesFast();
2450 Int_t nclPHOS = caloClustersPHOS ->GetEntriesFast();
2452 Float_t sumClusterEnergyEMCAL = 0;
2453 Float_t sumClusterEnergyPHOS = 0;
2455 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2456 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
2457 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2458 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
2463 AliVCaloCells * cellsEMCAL = GetEMCALCells();
2464 AliVCaloCells * cellsPHOS = GetPHOSCells();
2466 Int_t ncellsEMCAL = cellsEMCAL->GetNumberOfCells();
2467 Int_t ncellsPHOS = cellsPHOS ->GetNumberOfCells();
2469 Float_t sumCellEnergyEMCAL = 0;
2470 Float_t sumCellEnergyPHOS = 0;
2472 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2473 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2474 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2475 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2479 fhCaloCorrNClusters->Fill(nclEMCAL,nclPHOS);
2480 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2481 fhCaloCorrNCells ->Fill(ncellsEMCAL,ncellsPHOS);
2482 fhCaloCorrECells ->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2484 Int_t v0S = GetV0Signal(0)+GetV0Signal(1);
2485 Int_t v0M = GetV0Multiplicity(0)+GetV0Multiplicity(1);
2486 Int_t trM = GetTrackMultiplicity();
2487 if(fCalorimeter=="PHOS"){
2488 fhCaloV0MCorrNClusters ->Fill(v0M,nclPHOS);
2489 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyPHOS);
2490 fhCaloV0MCorrNCells ->Fill(v0M,ncellsPHOS);
2491 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyPHOS);
2493 fhCaloV0SCorrNClusters ->Fill(v0S,nclPHOS);
2494 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyPHOS);
2495 fhCaloV0SCorrNCells ->Fill(v0S,ncellsPHOS);
2496 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyPHOS);
2498 fhCaloTrackMCorrNClusters->Fill(trM,nclPHOS);
2499 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyPHOS);
2500 fhCaloTrackMCorrNCells ->Fill(trM,ncellsPHOS);
2501 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyPHOS);
2504 fhCaloV0MCorrNClusters ->Fill(v0M,nclEMCAL);
2505 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyEMCAL);
2506 fhCaloV0MCorrNCells ->Fill(v0M,ncellsEMCAL);
2507 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyEMCAL);
2509 fhCaloV0SCorrNClusters ->Fill(v0S,nclEMCAL);
2510 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyEMCAL);
2511 fhCaloV0SCorrNCells ->Fill(v0S,ncellsEMCAL);
2512 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyEMCAL);
2514 fhCaloTrackMCorrNClusters->Fill(trM,nclEMCAL);
2515 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyEMCAL);
2516 fhCaloTrackMCorrNCells ->Fill(trM,ncellsEMCAL);
2517 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyEMCAL);
2522 printf("AliAnaCalorimeterQA::Correlate(): \n");
2523 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2524 ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2525 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2526 ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS);
2527 printf("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d \n", v0S,v0M,trM);
2532 //______________________________________________________________________________
2533 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
2534 //Fill pure monte carlo related histograms
2536 Float_t eMC = mom.E();
2537 Float_t ptMC = mom.Pt();
2538 Float_t phiMC = mom.Phi();
2540 phiMC += TMath::TwoPi();
2541 Float_t etaMC = mom.Eta();
2543 if (TMath::Abs(etaMC) > 1) return;
2546 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2549 fhGenGamPt ->Fill(ptMC);
2550 fhGenGamEta->Fill(etaMC);
2551 fhGenGamPhi->Fill(phiMC);
2553 fhGenGamAccE ->Fill(eMC);
2554 fhGenGamAccPt ->Fill(ptMC);
2555 fhGenGamAccEta->Fill(etaMC);
2556 fhGenGamAccPhi->Fill(phiMC);
2559 else if (pdg==111) {
2560 fhGenPi0Pt ->Fill(ptMC);
2561 fhGenPi0Eta->Fill(etaMC);
2562 fhGenPi0Phi->Fill(phiMC);
2564 fhGenPi0AccE ->Fill(eMC);
2565 fhGenPi0AccPt ->Fill(ptMC);
2566 fhGenPi0AccEta->Fill(etaMC);
2567 fhGenPi0AccPhi->Fill(phiMC);
2570 else if (pdg==221) {
2571 fhGenEtaPt ->Fill(ptMC);
2572 fhGenEtaEta->Fill(etaMC);
2573 fhGenEtaPhi->Fill(phiMC);
2575 else if (pdg==223) {
2576 fhGenOmegaPt ->Fill(ptMC);
2577 fhGenOmegaEta->Fill(etaMC);
2578 fhGenOmegaPhi->Fill(phiMC);
2580 else if (TMath::Abs(pdg)==11) {
2581 fhGenElePt ->Fill(ptMC);
2582 fhGenEleEta->Fill(etaMC);
2583 fhGenElePhi->Fill(phiMC);
2588 //________________________________________________________________________
2589 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2591 // Needed when Terminate is executed in distributed environment
2592 // Refill analysis histograms of this class with corresponding histograms in output list.
2594 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2595 // the first one and then add the next
2596 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
2597 //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2599 //Read histograms, must be in the same order as in GetCreateOutputObject.
2600 fhE = (TH1F *) outputList->At(index++);
2602 fhPt = (TH1F *) outputList->At(index++);
2603 fhPhi = (TH1F *) outputList->At(index++);
2604 fhEta = (TH1F *) outputList->At(index++);
2607 fhEtaPhiE = (TH3F *) outputList->At(index++);
2609 fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
2612 fhECharged = (TH1F *) outputList->At(index++);
2613 fhPtCharged = (TH1F *) outputList->At(index++);
2614 fhPhiCharged = (TH1F *) outputList->At(index++);
2615 fhEtaCharged = (TH1F *) outputList->At(index++);
2618 fhEtaPhiECharged = (TH3F *) outputList->At(index++);
2620 fh1pOverE = (TH2F *) outputList->At(index++);
2621 fh1dR = (TH1F *) outputList->At(index++);
2622 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2623 fh2EledEdx = (TH2F *) outputList->At(index++);
2624 fh1pOverER02 = (TH2F *) outputList->At(index++);
2626 fhIM = (TH2F *) outputList->At(index++);
2627 fhIMCellCut = (TH2F *) outputList->At(index++);
2628 fhAsym = (TH2F *) outputList->At(index++);
2630 fhNCellsPerCluster = (TH2F *) outputList->At(index++);
2631 fhNCellsPerClusterMIP = (TH2F *) outputList->At(index++);
2632 fhNCellsPerClusterMIPCharged = (TH2F *) outputList->At(index++);
2633 fhNClusters = (TH1F *) outputList->At(index++);
2635 fhRNCells = (TH2F *) outputList->At(index++);
2636 fhXNCells = (TH2F *) outputList->At(index++);
2637 fhYNCells = (TH2F *) outputList->At(index++);
2638 fhZNCells = (TH2F *) outputList->At(index++);
2639 fhRE = (TH2F *) outputList->At(index++);
2640 fhXE = (TH2F *) outputList->At(index++);
2641 fhYE = (TH2F *) outputList->At(index++);
2642 fhZE = (TH2F *) outputList->At(index++);
2643 fhXYZ = (TH3F *) outputList->At(index++);
2644 if(fFillAllPosHisto){
2645 fhRCellE = (TH2F *) outputList->At(index++);
2646 fhXCellE = (TH2F *) outputList->At(index++);
2647 fhYCellE = (TH2F *) outputList->At(index++);
2648 fhZCellE = (TH2F *) outputList->At(index++);
2649 fhXYZCell = (TH3F *) outputList->At(index++);
2650 fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
2651 fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
2652 fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
2653 fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
2654 fhDeltaCellClusterRE = (TH2F *) outputList->At(index++);
2655 fhDeltaCellClusterXE = (TH2F *) outputList->At(index++);
2656 fhDeltaCellClusterYE = (TH2F *) outputList->At(index++);
2657 fhDeltaCellClusterZE = (TH2F *) outputList->At(index++);
2658 fhEtaPhiAmp = (TH3F *) outputList->At(index++);
2661 fhNCells = (TH1F *) outputList->At(index++);
2662 fhAmplitude = (TH1F *) outputList->At(index++);
2663 fhAmpId = (TH2F *) outputList->At(index++);
2665 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2667 fhCellTimeSpreadRespectToCellMax = (TH1F *) outputList->At(index++);
2668 fhCellIdCellLargeTimeSpread = (TH1F *) outputList->At(index++);
2670 fhTime = (TH1F *) outputList->At(index++);
2671 fhTimeId = (TH2F *) outputList->At(index++);
2672 fhTimeAmp = (TH2F *) outputList->At(index++);
2674 // fhT0Time = (TH1F *) outputList->At(index++);
2675 // fhT0TimeId = (TH2F *) outputList->At(index++);
2676 // fhT0TimeAmp = (TH2F *) outputList->At(index++);
2682 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2683 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2684 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2685 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2687 fhCaloV0SCorrNClusters = (TH2F *) outputList->At(index++);
2688 fhCaloV0SCorrEClusters = (TH2F *) outputList->At(index++);
2689 fhCaloV0SCorrNCells = (TH2F *) outputList->At(index++);
2690 fhCaloV0SCorrECells = (TH2F *) outputList->At(index++);
2692 fhCaloV0MCorrNClusters = (TH2F *) outputList->At(index++);
2693 fhCaloV0MCorrEClusters = (TH2F *) outputList->At(index++);
2694 fhCaloV0MCorrNCells = (TH2F *) outputList->At(index++);
2695 fhCaloV0MCorrECells = (TH2F *) outputList->At(index++);
2697 fhCaloTrackMCorrNClusters = (TH2F *) outputList->At(index++);
2698 fhCaloTrackMCorrEClusters = (TH2F *) outputList->At(index++);
2699 fhCaloTrackMCorrNCells = (TH2F *) outputList->At(index++);
2700 fhCaloTrackMCorrECells = (TH2F *) outputList->At(index++);
2704 fhEMod = new TH1F*[fNModules];
2705 fhNClustersMod = new TH1F*[fNModules];
2706 fhNCellsPerClusterMod = new TH2F*[fNModules];
2707 fhNCellsMod = new TH1F*[fNModules];
2708 fhGridCellsMod = new TH2F*[fNModules];
2709 fhGridCellsEMod = new TH2F*[fNModules];
2710 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2711 fhGridCellsTimeMod = new TH2F*[fNModules];
2712 fhAmplitudeMod = new TH1F*[fNModules];
2713 if(fCalorimeter=="EMCAL")
2714 fhAmplitudeModFraction = new TH1F*[fNModules*3];
2717 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2719 fhIMMod = new TH2F*[fNModules];
2720 fhIMCellCutMod = new TH2F*[fNModules];
2722 for(Int_t imod = 0 ; imod < fNModules; imod++){
2723 fhEMod[imod] = (TH1F *) outputList->At(index++);
2724 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2725 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2726 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2727 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2728 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2729 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2730 fhGridCellsTimeMod[imod] = (TH2F *) outputList->At(index++);
2731 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2733 if(fCalorimeter=="EMCAL"){
2734 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
2735 fhAmplitudeModFraction[imod*3+ifrac] = (TH1F *) outputList->At(index++);
2739 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
2740 fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2741 //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2742 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
2743 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
2744 // fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2] = (TH2F *) outputList->At(index++);
2748 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2749 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
2754 fhDeltaE = (TH1F *) outputList->At(index++);
2755 fhDeltaPt = (TH1F *) outputList->At(index++);
2756 fhDeltaPhi = (TH1F *) outputList->At(index++);
2757 fhDeltaEta = (TH1F *) outputList->At(index++);
2759 fhRatioE = (TH1F *) outputList->At(index++);
2760 fhRatioPt = (TH1F *) outputList->At(index++);
2761 fhRatioPhi = (TH1F *) outputList->At(index++);
2762 fhRatioEta = (TH1F *) outputList->At(index++);
2764 fh2E = (TH2F *) outputList->At(index++);
2765 fh2Pt = (TH2F *) outputList->At(index++);
2766 fh2Phi = (TH2F *) outputList->At(index++);
2767 fh2Eta = (TH2F *) outputList->At(index++);
2769 fhGamE = (TH2F *) outputList->At(index++);
2770 fhGamPt = (TH2F *) outputList->At(index++);
2771 fhGamPhi = (TH2F *) outputList->At(index++);
2772 fhGamEta = (TH2F *) outputList->At(index++);
2774 fhGamDeltaE = (TH1F *) outputList->At(index++);
2775 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2776 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2777 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2779 fhGamRatioE = (TH1F *) outputList->At(index++);
2780 fhGamRatioPt = (TH1F *) outputList->At(index++);
2781 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2782 fhGamRatioEta = (TH1F *) outputList->At(index++);
2784 fhPi0E = (TH2F *) outputList->At(index++);
2785 fhPi0Pt = (TH2F *) outputList->At(index++);
2786 fhPi0Phi = (TH2F *) outputList->At(index++);
2787 fhPi0Eta = (TH2F *) outputList->At(index++);
2789 fhEleE = (TH2F *) outputList->At(index++);
2790 fhElePt = (TH2F *) outputList->At(index++);
2791 fhElePhi = (TH2F *) outputList->At(index++);
2792 fhEleEta = (TH2F *) outputList->At(index++);
2794 fhNeHadE = (TH2F *) outputList->At(index++);
2795 fhNeHadPt = (TH2F *) outputList->At(index++);
2796 fhNeHadPhi = (TH2F *) outputList->At(index++);
2797 fhNeHadEta = (TH2F *) outputList->At(index++);
2799 fhChHadE = (TH2F *) outputList->At(index++);
2800 fhChHadPt = (TH2F *) outputList->At(index++);
2801 fhChHadPhi = (TH2F *) outputList->At(index++);
2802 fhChHadEta = (TH2F *) outputList->At(index++);
2804 fhGamECharged = (TH2F *) outputList->At(index++);
2805 fhGamPtCharged = (TH2F *) outputList->At(index++);
2806 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2807 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2809 fhPi0ECharged = (TH2F *) outputList->At(index++);
2810 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2811 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2812 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2814 fhEleECharged = (TH2F *) outputList->At(index++);
2815 fhElePtCharged = (TH2F *) outputList->At(index++);
2816 fhElePhiCharged = (TH2F *) outputList->At(index++);
2817 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2819 fhNeHadECharged = (TH2F *) outputList->At(index++);
2820 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2821 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2822 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2824 fhChHadECharged = (TH2F *) outputList->At(index++);
2825 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2826 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2827 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2829 // fhEMVxyz = (TH3F *) outputList->At(index++);
2830 // fhHaVxyz = (TH3F *) outputList->At(index++);
2832 fhEMVxyz = (TH2F *) outputList->At(index++);
2833 fhHaVxyz = (TH2F *) outputList->At(index++);
2834 fhEMR = (TH2F *) outputList->At(index++);
2835 fhHaR = (TH2F *) outputList->At(index++);
2837 fhGenGamPt = (TH1F *) outputList->At(index++);
2838 fhGenGamEta = (TH1F *) outputList->At(index++);
2839 fhGenGamPhi = (TH1F *) outputList->At(index++);
2841 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2842 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2843 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2845 fhGenEtaPt = (TH1F *) outputList->At(index++);
2846 fhGenEtaEta = (TH1F *) outputList->At(index++);
2847 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2849 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2850 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2851 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2853 fhGenElePt = (TH1F *) outputList->At(index++);
2854 fhGenEleEta = (TH1F *) outputList->At(index++);
2855 fhGenElePhi = (TH1F *) outputList->At(index++);
2857 fhGenGamAccE = (TH1F *) outputList->At(index++);
2858 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2859 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2860 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2862 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2863 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2864 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2865 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2867 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
2868 fhMCEle1dR = (TH1F *) outputList->At(index++);
2869 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2871 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
2872 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2873 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2875 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
2876 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2877 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2879 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2880 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2881 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
2885 //__________________________________________________________________
2886 void AliAnaCalorimeterQA::Terminate(TList* outputList)
2888 //Do plots if requested
2890 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), MakePlotsOn());
2892 //Do some plots to end
2893 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
2894 //Recover histograms from output histograms list, needed for distributed analysis.
2895 ReadHistograms(outputList);
2897 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2898 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
2900 const Int_t buffersize = 255;
2901 char name[buffersize];
2902 char cname[buffersize];
2904 //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
2905 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
2906 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
2907 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
2908 // Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
2909 // Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
2910 // Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
2911 // Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
2912 // Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
2913 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
2914 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
2915 // Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
2916 // Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
2917 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
2918 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
2919 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
2920 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
2922 //Color code for the different modules
2923 Int_t modColorIndex[]={2,4,6,8};
2925 //--------------------------------------------------
2926 // Cluster energy distributions, module dependence
2927 //--------------------------------------------------
2928 snprintf(cname,buffersize,"QA_%s_ClusterEnergy",fCalorimeter.Data());
2929 TCanvas * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
2931 Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
2932 //printf("new E rb %d\n",rbE);
2934 fhE->SetAxisRange(ptmin,ptmax,"X");
2936 if(fhE->GetEntries() > 0) gPad->SetLogy();
2937 TLegend pLegendE(0.7,0.6,0.9,0.8);
2938 pLegendE.SetTextSize(0.03);
2939 pLegendE.AddEntry(fhE,"all modules","L");
2940 pLegendE.SetFillColor(10);
2941 pLegendE.SetBorderSize(1);
2944 fhE->SetLineColor(1);
2946 for(Int_t imod = 0; imod < fNModules; imod++){
2947 fhEMod[imod]->Rebin(rbE);
2948 fhEMod[imod]->SetLineColor(modColorIndex[imod]);
2949 fhEMod[imod]->Draw("HE same");
2950 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
2956 TLegend pLegendER(0.55,0.8,0.9,0.9);
2957 pLegendER.SetTextSize(0.03);
2958 pLegendER.SetFillColor(10);
2959 pLegendER.SetBorderSize(1);
2961 for(Int_t imod = 1; imod < fNModules; imod++){
2962 TH1D * htmp = (TH1D*)fhEMod[imod]->Clone(Form("hERat%d",imod));
2963 htmp->Divide(fhEMod[0]);
2964 htmp->SetLineColor(modColorIndex[imod]);
2966 htmp->SetTitle("Ratio module X / module 0");
2967 htmp->SetAxisRange(ptmin,ptmax,"X");
2968 htmp->SetMaximum(5);
2969 htmp->SetMinimum(0);
2970 htmp->SetAxisRange(ptmin,ptmax,"X");
2974 htmp->Draw("same HE");
2976 pLegendER.AddEntry(fhEMod[imod],Form("module %d / module 0",imod),"L");
2980 snprintf(name,buffersize,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
2981 c->Print(name); printf("Plot: %s\n",name);
2983 //--------------------------------------------------
2984 // Cell energy distributions, module dependence
2985 //--------------------------------------------------
2986 snprintf(cname,buffersize,"%s_QA_CellEnergy",fCalorimeter.Data());
2987 TCanvas * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
2990 Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
2991 //printf("new Amp rb %d\n",rbAmp);
2992 fhAmplitude->Rebin(rbAmp);
2993 fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
2996 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
2997 TLegend pLegendA(0.7,0.6,0.9,0.8);
2998 pLegendA.SetTextSize(0.03);
2999 pLegendA.AddEntry(fhE,"all modules","L");
3000 pLegendA.SetFillColor(10);
3001 pLegendA.SetBorderSize(1);
3002 fhAmplitude->SetMinimum(0.1);
3003 fhAmplitude->SetLineColor(1);
3004 fhAmplitude->Draw("HE");
3006 for(Int_t imod = 0; imod < fNModules; imod++){
3007 fhAmplitudeMod[imod]->Rebin(rbAmp);
3008 fhAmplitudeMod[imod]->SetLineColor(modColorIndex[imod]);
3009 fhAmplitudeMod[imod]->Draw("HE same");
3010 pLegendA.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3016 TLegend pLegendAR(0.55,0.8,0.9,0.9);
3017 pLegendAR.SetTextSize(0.03);
3018 pLegendAR.SetFillColor(10);
3019 pLegendAR.SetBorderSize(1);
3021 for(Int_t imod = 1; imod < fNModules; imod++){
3022 TH1D * htmp = (TH1D*)fhAmplitudeMod[imod]->Clone(Form("hAmpRat%d",imod));
3023 htmp->Divide(fhAmplitudeMod[0]);
3024 htmp->SetLineColor(modColorIndex[imod]);
3026 htmp->SetTitle("Ratio cells energy in module X / module 0");
3027 htmp->SetAxisRange(ptmin,ptmax,"X");
3028 htmp->SetMaximum(5);
3029 htmp->SetMinimum(0);
3033 htmp->Draw("same HE");
3034 pLegendAR.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3038 snprintf(name,buffersize,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
3039 ca->Print(name); printf("Plot: %s\n",name);
3041 //----------------------------------------------------------
3042 // Cell energy distributions, FRACTION of module dependence
3043 // See Super Module calibration difference
3044 //---------------------------------------------------------
3045 if(fCalorimeter=="EMCAL"){
3047 snprintf(cname,buffersize,"%s_QA_SMThirds",fCalorimeter.Data());
3048 TCanvas * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
3049 cfrac->Divide(2, 3);
3051 if(fhAmplitude->GetEntries() > 0)
3053 TLegend pLegend1(0.6,0.6,0.9,0.8);
3054 pLegend1.SetTextSize(0.03);
3055 pLegend1.SetFillColor(10);
3056 pLegend1.SetBorderSize(1);
3057 pLegend1.SetHeader("Third close to Eta=0");
3058 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0");
3059 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3060 fhAmplitudeModFraction[0]->Draw("axis");
3061 TH1D * hAverageThird1 = (TH1D *)fhAmplitudeModFraction[3*0+2]->Clone("AverageThird1");
3062 for(Int_t imod = 0; imod < fNModules; imod++){
3064 if(imod%2==0) ifrac = 2;
3065 if(imod > 0) hAverageThird1->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3066 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3067 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3068 pLegend1.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3070 hAverageThird1 ->Scale(1./fNModules);
3074 for(Int_t imod = 0; imod < fNModules; imod++){
3076 if(imod%2==0) ifrac = 2;
3077 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3078 htmp->Divide(hAverageThird1);
3080 htmp ->SetTitle("Close to eta = 0");
3081 htmp ->SetMaximum(5);
3082 htmp ->SetMinimum(0);
3083 htmp ->SetAxisRange(ptmin,ptmax,"X");
3084 htmp ->SetYTitle("ratio third to average");
3087 else htmp -> Draw("same HE");
3093 if(fhAmplitude->GetEntries() > 0)
3095 TLegend pLegend2(0.6,0.6,0.9,0.8);
3096 pLegend2.SetTextSize(0.03);
3097 pLegend2.SetFillColor(10);
3098 pLegend2.SetBorderSize(1);
3099 pLegend2.SetHeader("Middle Third");
3101 fhAmplitudeModFraction[0]->SetTitle("Middle Third");
3102 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3103 fhAmplitudeModFraction[0]->Draw("axis");
3105 TH1D * hAverageThird2 = (TH1D *)fhAmplitudeModFraction[3*0+1]->Clone("AverageThird2");
3106 for(Int_t imod = 0; imod < fNModules; imod++){
3108 if(imod > 0) hAverageThird2->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3109 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3110 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3111 pLegend2.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3113 hAverageThird2->Scale(1./fNModules);
3119 for(Int_t imod = 0; imod < fNModules; imod++){
3121 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3122 htmp->Divide(hAverageThird2);
3124 htmp ->SetTitle("Middle");
3125 htmp ->SetMaximum(5);
3126 htmp ->SetMinimum(0);
3127 htmp ->SetAxisRange(ptmin,ptmax,"X");
3128 htmp ->SetYTitle("ratio third to average");
3131 else htmp -> Draw("same HE");
3137 if(fhAmplitude->GetEntries() > 0)
3139 TLegend pLegend3(0.6,0.6,0.9,0.8);
3140 pLegend3.SetTextSize(0.03);
3141 pLegend3.SetFillColor(10);
3142 pLegend3.SetBorderSize(1);
3143 pLegend3.SetHeader("Third close to Eta=0.7");
3145 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0.7");
3146 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3147 fhAmplitudeModFraction[0]->Draw("axis");
3149 TH1D * hAverageThird3 = (TH1D *)fhAmplitudeModFraction[3*0+0]->Clone("AverageThird3");
3150 for(Int_t imod = 0; imod < 4; imod++){
3152 if(imod%2==0) ifrac = 0;
3153 if(imod > 0) hAverageThird3->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3154 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3155 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3156 pLegend3.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3158 hAverageThird3 ->Scale(1./fNModules);
3163 for(Int_t imod = 0; imod < fNModules; imod++){
3165 if(imod%2==0) ifrac = 0;
3166 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3167 htmp->Divide(hAverageThird3);
3169 htmp ->SetTitle("Close to eta = 0.7");
3170 htmp ->SetMaximum(5);
3171 htmp ->SetMinimum(0);
3172 htmp ->SetAxisRange(ptmin,ptmax,"X");
3173 htmp ->SetYTitle("ratio third to average");
3176 else htmp ->Draw("same HE");
3180 snprintf(name,buffersize,"QA_%s_CellEnergyModuleFraction.eps",fCalorimeter.Data());
3181 cfrac->Print(name); printf("Create plot %s\n",name);
3185 //----------------------------------------------------------
3186 // Cluster eta and phi distributions, energy cut dependence
3187 //---------------------------------------------------------
3189 snprintf(cname,buffersize,"%s_QA_EtaPhiCluster",fCalorimeter.Data());
3190 TCanvas * cetaphic = new TCanvas(cname, "Eta-Phi Reconstructed distributions", 1200, 400) ;
3191 cetaphic->Divide(3, 1);
3196 Float_t ecut[] = {0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3};
3197 Int_t ecutcolor[]= {2, 4, 6, 7, 8, 9, 12};
3198 TH1D * hE = fhEtaPhiE->ProjectionZ();
3205 TLegend pLegendPhiCl(0.83,0.6,0.95,0.93);
3206 pLegendPhiCl.SetTextSize(0.03);
3207 pLegendPhiCl.SetFillColor(10);
3208 pLegendPhiCl.SetBorderSize(1);
3210 TH1D * htmp = fhEtaPhiE->ProjectionY("hphi_cluster_nocut",0,-1,0,-1);
3212 htmp->SetMinimum(1);
3213 rbPhi = GetNewRebinForRePlotting(htmp, phimin, phimax,nphibins) ;
3214 //printf("new Phi rb %d\n",rbPhi);
3216 htmp->SetTitle("#phi of clusters for energy in cluster > threshold");
3217 htmp->SetAxisRange(phimin,phimax,"X");
3219 pLegendPhiCl.AddEntry(htmp,"No cut","L");
3221 for (Int_t i = 0; i < ncuts; i++) {
3222 binmin = hE->FindBin(ecut[i]);
3223 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3224 htmp = fhEtaPhiE->ProjectionY(Form("hphi_cluster_cut%d",i),0,-1,binmin,-1);
3225 htmp->SetLineColor(ecutcolor[i]);
3227 htmp->Draw("same HE");
3228 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3232 pLegendPhiCl.Draw();
3240 htmp = fhEtaPhiE->ProjectionX("heta_cluster_nocut",0,-1,0,-1);
3242 rbEta = GetNewRebinForRePlotting(htmp,etamin, etamax,netabins) ;
3243 //printf("new Eta rb %d\n",rbEta);
3245 htmp->SetMinimum(1);
3246 htmp ->SetLineColor(1);
3247 htmp->SetTitle("#eta of clusters for energy in cluster > threshold");
3248 htmp->SetAxisRange(etamin,etamax,"X");
3251 for (Int_t i = 0; i < ncuts; i++) {
3252 binmin = hE->FindBin(ecut[i]);
3253 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3254 htmp = fhEtaPhiE->ProjectionX(Form("heta_cluster_cut%d",i),0,-1,binmin,-1);
3255 htmp->SetLineColor(ecutcolor[i]);
3257 htmp->Draw("same HE");
3262 TH2D* hEtaPhiCl = (TH2D*) fhEtaPhiE->Project3D("xy");
3263 hEtaPhiCl->SetAxisRange(etamin,etamax,"X");
3264 hEtaPhiCl->SetAxisRange(phimin,phimax,"Y");
3265 hEtaPhiCl->Draw("colz");
3267 snprintf(name,buffersize,"QA_%s_ClusterEtaPhi.eps",fCalorimeter.Data());
3268 cetaphic->Print(name); printf("Create plot %s\n",name);
3270 //----------------------------------------------------------
3271 // Cell eta and phi distributions, energy cut dependence
3272 //---------------------------------------------------------
3274 snprintf(cname,buffersize,"%s_QA_EtaPhiCell",fCalorimeter.Data());
3275 TCanvas * cetaphicell = new TCanvas(cname, "Eta-Phi Cells distributions", 1200, 400) ;
3276 cetaphicell->Divide(3, 1);
3279 cetaphicell->cd(1) ;
3283 TLegend pLegendPhiCell(0.83,0.6,0.95,0.93);
3284 pLegendPhiCell.SetTextSize(0.03);
3285 pLegendPhiCell.SetFillColor(10);
3286 pLegendPhiCell.SetBorderSize(1);
3289 htmp = fhEtaPhiAmp->ProjectionY("hphi_cell_nocut",0,-1,0,-1);
3291 htmp->SetMinimum(1);
3293 htmp->SetTitle("#phi of cells for cell energy > threshold");
3294 htmp->SetAxisRange(phimin,phimax,"X");
3296 pLegendPhiCell.AddEntry(htmp,"No cut","L");
3298 for (Int_t i = 0; i < ncuts; i++) {
3299 binmin = hE->FindBin(ecut[i]);
3300 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3301 htmp = fhEtaPhiAmp->ProjectionY(Form("hphi_cell_cut%d",i),0,-1,binmin,-1);
3302 htmp->SetLineColor(ecutcolor[i]);
3304 htmp->Draw("same HE");
3305 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3309 pLegendPhiCell.Draw();
3312 cetaphicell->cd(2) ;
3317 htmp = fhEtaPhiAmp->ProjectionX("heta_cell_nocut",0,-1,0,-1);
3319 htmp ->SetLineColor(1);
3321 htmp->SetMinimum(1);
3322 htmp->SetTitle("#eta of cells for cell energy > threshold");
3323 htmp->SetAxisRange(etamin,etamax,"X");
3326 for (Int_t i = 0; i < ncuts; i++) {
3327 binmin = hE->FindBin(ecut[i]);
3328 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3329 htmp = fhEtaPhiAmp->ProjectionX(Form("heta_cell_cut%d",i),0,-1,binmin,-1);
3330 htmp->SetLineColor(ecutcolor[i]);
3332 htmp->Draw("same HE");
3337 cetaphicell->cd(3) ;
3338 TH2D* hEtaPhiCell = (TH2D*) fhEtaPhiAmp->Project3D("xy");
3339 hEtaPhiCell->SetAxisRange(etamin,etamax,"X");
3340 hEtaPhiCell->SetAxisRange(phimin,phimax,"Y");
3341 hEtaPhiCell->Draw("colz");
3343 snprintf(name,buffersize,"QA_%s_CellEtaPhi.eps",fCalorimeter.Data());
3344 cetaphicell->Print(name); printf("Create plot %s\n",name);
3347 ////////////////////////////////////////
3348 ///////// Global Positions /////////////
3349 ////////////////////////////////////////
3355 if(fFillAllPosHisto)
3357 snprintf(cname,buffersize,"%s_QA_ClusterXY",fCalorimeter.Data());
3358 TCanvas * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
3362 TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
3363 hXY->SetTitle("Cluster X vs Y");
3364 hXY->GetYaxis()->SetTitleOffset(1.6);
3367 TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
3368 hYZ->SetTitle("Cluster Z vs Y");
3369 hYZ->GetYaxis()->SetTitleOffset(1.6);
3372 TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
3373 hXZ->SetTitle("Cluster X vs Z");
3374 hXZ->GetYaxis()->SetTitleOffset(1.6);
3377 snprintf(name,buffersize,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
3378 cxyz->Print(name); printf("Create plot %s\n",name);
3380 snprintf(cname,buffersize,"QA_%s_ClusterX",fCalorimeter.Data());
3381 TCanvas * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
3385 TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
3388 hX->SetTitle("Cluster X ");
3390 rbX = GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
3391 //printf("new X rb %d\n",rbX);
3393 hX->SetMinimum(hX->GetMaximum()/2);
3394 hX->SetAxisRange(xmin,xmax);
3397 TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
3399 hY->SetTitle("Cluster Y ");
3400 rbY = GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
3401 //printf("new Y rb %d\n",rbY);
3404 hY->SetAxisRange(ymin,ymax);
3408 TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
3411 rbZ = GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
3412 //printf("new Z rb %d\n",rbZ);
3414 hZ->SetMinimum(hZ->GetMaximum()/2);
3415 hZ->SetAxisRange(zmin,zmax);
3418 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
3419 cx->Print(name); printf("Create plot %s\n",name);
3422 if(fFillAllPosHisto)
3424 snprintf(cname,buffersize,"%s_QA_CellXY",fCalorimeter.Data());
3425 TCanvas * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
3426 cellxyz->Divide(3, 1);
3429 TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
3430 hXYCell->SetTitle("Cell X vs Y");
3431 hXYCell->GetYaxis()->SetTitleOffset(1.6);
3432 hXYCell->Draw("colz");
3434 TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
3435 hYZCell->SetTitle("Cell Z vs Y");
3436 hYZCell->GetYaxis()->SetTitleOffset(1.6);
3437 hYZCell->Draw("colz");
3439 TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
3440 hXZCell->SetTitle("Cell X vs Z");
3441 hXZCell->GetYaxis()->SetTitleOffset(1.6);
3442 hXZCell->Draw("colz");
3444 snprintf(name,buffersize,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
3445 cellxyz->Print(name); printf("Create plot %s\n",name);
3448 snprintf(cname,buffersize,"%s_QA_CellX",fCalorimeter.Data());
3449 TCanvas * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
3450 cellx->Divide(3, 1);
3453 TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
3456 hXCell->SetTitle("Cell X ");
3458 hXCell->SetMinimum(hXCell->GetMaximum()/2);
3459 hXCell->SetAxisRange(xmin,xmax);
3463 TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
3465 hYCell->SetTitle("Cell Y ");
3467 hYCell->SetAxisRange(ymin,ymax);
3468 hYCell->SetMinimum(1);
3472 TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
3475 hZCell->SetAxisRange(zmin,zmax);
3476 hZCell->SetTitle("Cell Z ");
3478 hZCell->SetMinimum(hZCell->GetMaximum()/2);
3481 snprintf(name,buffersize,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
3482 cellx->Print(name); printf("Create plot %s\n",name);
3485 //----------------------------------------------------------
3486 // Cluster X, Y, Z, R, energy cut dependence
3487 //---------------------------------------------------------
3489 snprintf(cname,buffersize,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
3490 TCanvas * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
3497 TLegend pLegendXCl(0.83,0.6,0.95,0.93);
3498 pLegendXCl.SetTextSize(0.03);
3499 pLegendXCl.SetFillColor(10);
3500 pLegendXCl.SetBorderSize(1);
3503 htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
3506 htmp->SetMinimum(1);
3507 rbR = GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
3508 //printf("new R rb %d\n",rbR);
3510 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3511 htmp->SetAxisRange(rmin,rmax,"X");
3513 pLegendXCl.AddEntry(htmp,"No cut","L");
3515 for (Int_t i = 0; i < ncuts; i++) {
3516 binmin = hE->FindBin(ecut[i]);
3517 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3518 htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
3519 htmp->SetLineColor(ecutcolor[i]);
3521 htmp->Draw("same HE");
3522 pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3532 htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
3534 htmp->SetMinimum(1);
3536 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3537 htmp->SetAxisRange(xmin,xmax,"X");
3540 for (Int_t i = 0; i < ncuts; i++) {
3541 binmin = hE->FindBin(ecut[i]);
3542 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3543 htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
3544 htmp->SetLineColor(ecutcolor[i]);
3546 htmp->Draw("same HE");
3555 htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
3557 htmp->SetMinimum(1);
3559 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3560 htmp->SetAxisRange(ymin,ymax,"X");
3563 for (Int_t i = 0; i < ncuts; i++) {
3564 binmin = hE->FindBin(ecut[i]);
3565 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3566 htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
3567 htmp->SetLineColor(ecutcolor[i]);
3569 htmp->Draw("same HE");
3578 htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
3580 htmp->SetMinimum(1);
3582 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3583 htmp->SetAxisRange(zmin,zmax,"X");
3586 for (Int_t i = 0; i < ncuts; i++) {
3587 binmin = hE->FindBin(ecut[i]);
3588 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3589 htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
3590 htmp->SetLineColor(ecutcolor[i]);
3592 htmp->Draw("same HE");
3596 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3597 cxe->Print(name); printf("Create plot %s\n",name);
3600 //----------------------------------------------------------
3601 // Cluster X, Y, Z, R, NCells in cluster dependence
3602 //---------------------------------------------------------
3603 Int_t ncellcut[]={2, 3, 4};
3604 Int_t ncellcuts = 3;
3605 snprintf(cname,buffersize,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
3606 TCanvas * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
3613 TLegend pLegendXClN(0.83,0.6,0.95,0.93);
3614 pLegendXClN.SetTextSize(0.03);
3615 pLegendXClN.SetFillColor(10);
3616 pLegendXClN.SetBorderSize(1);
3619 htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
3621 htmp->SetMinimum(1);
3623 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3624 htmp->SetAxisRange(rmin,rmax,"X");
3626 pLegendXClN.AddEntry(htmp,"No cut","L");
3628 for (Int_t i = 0; i < ncellcuts; i++) {
3629 if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3630 else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
3631 htmp->SetLineColor(ecutcolor[i]);
3633 htmp->Draw("same HE");
3634 if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3635 else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3647 htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
3649 htmp->SetMinimum(1);
3651 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3652 htmp->SetAxisRange(xmin,xmax,"X");
3655 for (Int_t i = 0; i < ncellcuts; i++) {
3656 if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3657 else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
3658 htmp->SetLineColor(ecutcolor[i]);
3660 htmp->Draw("same HE");
3668 htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
3670 htmp->SetMinimum(1);
3672 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3673 htmp->SetAxisRange(ymin,ymax,"X");
3676 for (Int_t i = 0; i < ncellcuts; i++) {
3677 if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3678 else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
3679 htmp->SetLineColor(ecutcolor[i]);
3681 htmp->Draw("same HE");
3690 htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
3692 htmp->SetMinimum(1);
3694 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3695 htmp->SetAxisRange(zmin,zmax,"X");
3698 for (Int_t i = 0; i < ncellcuts; i++) {
3699 if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3700 else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
3701 htmp->SetLineColor(ecutcolor[i]);
3703 htmp->Draw("same HE");
3707 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
3708 cxn->Print(name); printf("Create plot %s\n",name);
3711 //----------------------------------------------------------
3712 // Cell X, Y, Z, R, energy cut dependence
3713 //---------------------------------------------------------
3715 snprintf(cname,buffersize,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
3716 TCanvas * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
3717 cxecell->Divide(2, 2);
3723 TLegend pLegendXCell(0.83,0.6,0.95,0.93);
3724 pLegendXCell.SetTextSize(0.03);
3725 pLegendXCell.SetFillColor(10);
3726 pLegendXCell.SetBorderSize(1);
3729 htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
3731 htmp->SetMinimum(1);
3733 htmp->SetTitle("r of cells for energy in cluster > threshold");
3734 htmp->SetAxisRange(rmin,rmax,"X");
3736 pLegendXCell.AddEntry(htmp,"No cut","L");
3738 for (Int_t i = 0; i < ncuts; i++) {
3739 binmin = hE->FindBin(ecut[i]);
3740 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3741 htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
3742 htmp->SetLineColor(ecutcolor[i]);
3744 htmp->Draw("same HE");
3745 pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3748 pLegendXCell.Draw();
3756 htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
3758 htmp->SetMinimum(1);
3760 htmp->SetTitle("x of cells for energy in cluster > threshold");
3761 htmp->SetAxisRange(xmin,xmax,"X");
3764 for (Int_t i = 0; i < ncuts; i++) {
3765 binmin = hE->FindBin(ecut[i]);
3766 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3767 htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
3768 htmp->SetLineColor(ecutcolor[i]);
3770 htmp->Draw("same HE");
3778 htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
3780 htmp->SetMinimum(1);
3782 htmp->SetTitle("y of cells for energy in cluster > threshold");
3783 htmp->SetAxisRange(ymin,ymax,"X");
3786 for (Int_t i = 0; i < ncuts; i++) {
3787 binmin = hE->FindBin(ecut[i]);
3788 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3790 htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
3791 htmp->SetLineColor(ecutcolor[i]);
3793 htmp->Draw("same HE");
3801 htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
3803 htmp->SetMinimum(1);
3805 htmp->SetTitle("z of cells for energy in cluster > threshold");
3806 htmp->SetAxisRange(zmin,zmax,"X");
3809 for (Int_t i = 0; i < ncuts; i++) {
3810 binmin = hE->FindBin(ecut[i]);
3811 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3813 htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
3814 htmp->SetLineColor(ecutcolor[i]);
3816 htmp->Draw("same HE");
3819 snprintf(name,buffersize,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3820 cxecell->Print(name); printf("Create plot %s\n",name);
3823 //----------------------------------------------------------
3824 // Cluster-Cell X, Y, Z, R, cluster energy cut dependence
3825 //---------------------------------------------------------
3826 Int_t rbDR= 1;//rbR;
3827 Int_t rbDX= 1;//rbX;
3828 Int_t rbDY= 1;//rbY;
3829 Int_t rbDZ= 1;//rbZ;
3831 snprintf(cname,buffersize,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
3832 TCanvas * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
3839 TLegend pLegendXClD(0.83,0.6,0.95,0.93);
3840 pLegendXClD.SetTextSize(0.03);
3841 pLegendXClD.SetFillColor(10);
3842 pLegendXClD.SetBorderSize(1);
3845 htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
3847 htmp->SetMinimum(1);
3849 htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
3850 htmp->SetAxisRange(-50,50,"X");
3852 pLegendXCl.AddEntry(htmp,"No cut","L");
3854 for (Int_t i = 0; i < ncuts; i++) {
3855 binmin = hE->FindBin(ecut[i]);
3856 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3858 htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
3859 htmp->SetLineColor(ecutcolor[i]);
3861 htmp->Draw("same HE");
3862 pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3872 htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
3874 htmp->SetMinimum(1);
3876 htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
3877 htmp->SetAxisRange(-50,50,"X");
3880 for (Int_t i = 0; i < ncuts; i++) {
3881 binmin = hE->FindBin(ecut[i]);
3882 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3884 htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
3885 htmp->SetLineColor(ecutcolor[i]);
3887 htmp->Draw("same HE");
3896 htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
3898 htmp->SetMinimum(1);
3900 htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
3901 htmp->SetAxisRange(-50,50,"X");
3904 for (Int_t i = 0; i < ncuts; i++) {
3905 binmin = hE->FindBin(ecut[i]);
3906 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3908 htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
3909 htmp->SetLineColor(ecutcolor[i]);
3911 htmp->Draw("same HE");
3921 htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
3923 htmp->SetMinimum(1);
3925 htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
3926 htmp->SetAxisRange(-50,50,"X");
3929 for (Int_t i = 0; i < ncuts; i++) {
3930 binmin = hE->FindBin(ecut[i]);
3931 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3933 htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
3934 htmp->SetLineColor(ecutcolor[i]);
3936 htmp->Draw("same HE");
3941 snprintf(name,buffersize,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3942 cxde->Print(name); printf("Create plot %s\n",name);
3945 //----------------------------------------------------------
3946 // Cluster-Cell X, Y, Z, R, NCells in cluster dependence
3947 //---------------------------------------------------------
3948 snprintf(cname,buffersize,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
3949 TCanvas * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
3956 TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
3957 pLegendXClDN.SetTextSize(0.03);
3958 pLegendXClDN.SetFillColor(10);
3959 pLegendXClDN.SetBorderSize(1);
3961 htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
3963 htmp->SetMinimum(1);
3965 htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
3966 htmp->SetAxisRange(-50,50,"X");
3968 pLegendXClDN.AddEntry(htmp,"No cut","L");
3970 for (Int_t i = 0; i < ncellcuts; i++) {
3972 if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
3973 else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
3974 htmp->SetLineColor(ecutcolor[i]);
3976 htmp->Draw("same HE");
3977 if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3978 else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3982 pLegendXClDN.Draw();
3989 htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
3991 htmp->SetMinimum(1);
3993 htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
3994 htmp->SetAxisRange(-50,50,"X");
3997 for (Int_t i = 0; i < ncellcuts; i++) {
3999 if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
4000 else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
4001 htmp->SetLineColor(ecutcolor[i]);
4003 htmp->Draw("same HE");
4012 htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
4014 htmp->SetMinimum(1);
4016 htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
4017 htmp->SetAxisRange(-50,50,"X");
4020 for (Int_t i = 0; i < ncellcuts; i++) {
4022 if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
4023 else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
4024 htmp->SetLineColor(ecutcolor[i]);
4026 htmp->Draw("same HE");
4035 htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
4037 htmp->SetMinimum(1);
4039 htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
4040 htmp->SetAxisRange(-50,50,"X");
4043 for (Int_t i = 0; i < ncellcuts; i++) {
4045 if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
4046 else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
4047 htmp->SetLineColor(ecutcolor[i]);
4049 htmp->Draw("same HE");
4054 snprintf(name,buffersize,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
4055 cxdn->Print(name); printf("Create plot %s\n",name);
4059 //----------------------------------------------------------
4060 //Reconstructed clusters energy-eta-phi distributions, matched with tracks
4061 //----------------------------------------------------------
4062 TH1F * hEChargedClone = 0 ;
4063 TH1F * hPtChargedClone = 0 ;
4064 TH1F * hEtaChargedClone = 0 ;
4065 TH1F * hPhiChargedClone = 0 ;
4067 hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
4068 hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
4069 hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
4070 hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
4072 snprintf(cname,buffersize,"QA_%s_rectrackmatch",fCalorimeter.Data());
4073 TCanvas * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
4074 ccltm->Divide(3, 1);
4077 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
4078 fhECharged->Rebin(rbE);
4079 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4080 fhECharged->SetMinimum(1);
4084 if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
4085 fhPhiCharged->Rebin(rbPhi);
4086 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4087 fhPhiCharged->Draw();
4088 fhPhiCharged->Draw();
4091 if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
4092 fhEtaCharged->Rebin(rbEta);
4093 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4094 fhEtaCharged->Draw();
4095 fhEtaCharged->Draw();
4097 snprintf(name,buffersize,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
4098 ccltm->Print(name); printf("Plot: %s\n",name);
4100 //----------------------------------------------------------
4101 // Ratio of reconstructed clusters energy-eta-phi distributions, matched with tracks over all
4102 //----------------------------------------------------------
4104 snprintf(cname,buffersize,"%s_QA_ChargedRatio",fCalorimeter.Data());
4105 TCanvas * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
4106 ccharge->Divide(3, 1);
4109 fhECharged->Sumw2();
4111 fhECharged->Divide(fhE);
4112 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4113 fhECharged->SetMaximum(0.5);
4114 fhECharged->SetYTitle("track-matched clusters / all clusters");
4115 fhECharged->Draw("HE");
4118 fhPhiCharged->Sumw2();
4119 fhPhi->Rebin(rbPhi);
4121 fhPhiCharged->Divide(fhPhi);
4122 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4123 fhPhiCharged->SetMaximum(0.5);
4124 fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
4125 fhPhiCharged->Draw("HE");
4128 fhEtaCharged->Sumw2();
4129 fhEta->Rebin(rbEta);
4131 fhEtaCharged->Divide(fhEta);
4132 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4133 fhEtaCharged->SetMaximum(0.5);
4134 fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
4135 fhEtaCharged->Draw("HE");
4137 snprintf(name,buffersize,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
4138 ccharge->Print(name); printf("Create plot %s\n",name);
4140 //-------------------------------------------
4141 // N Cells - N Clusters - N Cells per cluster
4142 //-------------------------------------------
4143 snprintf(cname,buffersize,"QA_%s_nclustercells",fCalorimeter.Data());
4144 TCanvas * cN = new TCanvas(cname, " Number of CaloClusters and CaloCells", 800, 1200) ;
4149 TLegend pLegendN(0.7,0.6,0.9,0.8);
4150 pLegendN.SetTextSize(0.03);
4151 pLegendN.AddEntry(fhNClusters,"all modules","L");
4152 pLegendN.SetFillColor(10);
4153 pLegendN.SetBorderSize(1);
4155 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
4157 fhNClusters->SetLineColor(1);
4160 if(fhNClusters->GetNbinsX()> nbins) rbN = fhNClusters->GetNbinsX()/nbins;
4162 fhNClusters->SetAxisRange(nmin,nmax,"X");
4163 fhNClusters->Draw("HE");
4164 for(Int_t imod = 0; imod < fNModules; imod++){
4165 fhNClustersMod[imod]->SetAxisRange(nmin,nmax,"X");
4166 fhNClustersMod[imod]->SetLineColor(modColorIndex[imod]);
4167 fhNClustersMod[imod]->Draw("same");
4168 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
4174 for(Int_t imod = 1; imod < fNModules; imod++){
4176 htmp = (TH1D*)fhNClustersMod[imod]->Clone(Form("hNClustersRat%d",imod));
4177 htmp->Divide(fhNClustersMod[0]);
4178 htmp->SetLineColor(modColorIndex[imod]);
4180 htmp->SetTitle("Ratio # clusters in module X / module 0");
4181 htmp->SetMaximum(5);
4182 htmp->SetMinimum(0);
4186 htmp->Draw("same HE");
4191 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
4193 fhNCells->SetLineColor(1);
4194 fhNCells->SetAxisRange(nmin,nmax,"X");
4195 fhNCells->Draw("HE");
4196 for(Int_t imod = 0; imod < fNModules; imod++){
4197 fhNCellsMod[imod]->SetAxisRange(nmin,nmax,"X");
4198 fhNCellsMod[imod]->SetLineColor(modColorIndex[imod]);
4199 fhNCellsMod[imod]->Draw("same HE");
4205 for(Int_t imod = 1; imod < fNModules; imod++){
4207 htmp = (TH1D*)fhNCellsMod[imod]->Clone(Form("hNCellsRat%d",imod));
4208 htmp->Divide(fhNCellsMod[0]);
4209 htmp->SetLineColor(modColorIndex[imod]);
4211 htmp->SetTitle("Ratio # cells in module X / module 0");
4212 htmp->SetMaximum(5);
4213 htmp->SetMinimum(0);
4217 htmp->Draw("same HE");
4222 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
4224 TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1);
4225 cpc->SetLineColor(1);
4226 cpc->SetTitle("# cells per cluster");
4228 TH1D ** hNCellsCluster1D = new TH1D*[fNModules];
4230 for(Int_t imod = 0; imod < fNModules; imod++){
4231 hNCellsCluster1D[imod] = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
4232 hNCellsCluster1D[imod]->SetLineColor(modColorIndex[imod]);
4233 hNCellsCluster1D[imod]->Draw("same HE");
4239 for(Int_t imod = 1; imod < fNModules; imod++){
4241 htmp = (TH1D*)hNCellsCluster1D[imod]->Clone(Form("hNClustersCells1DRat%d",imod));
4242 htmp->Divide(hNCellsCluster1D[0]);
4243 htmp->SetLineColor(modColorIndex[imod]);
4245 htmp->SetTitle("Ratio # cells per cluster in module X / module 0");
4246 //htmp->SetAxisRange(ptmin,ptmax,"X");
4247 htmp->SetMaximum(3.5);
4248 htmp->SetMinimum(0);
4252 htmp->Draw("same HE");
4254 delete [] hNCellsCluster1D;
4256 snprintf(name,buffersize,"QA_%s_NumberCaloClustersAndCaloCells.eps",fCalorimeter.Data());
4257 cN->Print(name); printf("Print plot %s\n",name);
4259 //----------------------------------------------------
4260 // Cell Time histograms, time only available in ESDs
4261 //----------------------------------------------------
4262 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
4264 snprintf(cname,buffersize,"QA_%s_cellstime",fCalorimeter.Data());
4265 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
4266 ctime->Divide(3, 1);
4269 if(fhTime->GetNbinsX()> ntimebins) rbTime = fhTime->GetNbinsX()/ntimebins;
4272 if(fhTime->GetEntries() > 0) gPad->SetLogy();
4273 fhTime->Rebin(rbTime);
4274 fhTime->SetAxisRange(timemin,timemax,"X");
4278 fhTimeId->SetTitleOffset(1.8,"Y");
4279 fhTimeId->SetAxisRange(timemin,timemax,"X");
4280 fhTimeId->Draw("colz");
4283 fhTimeAmp->SetTitle("Cell Energy vs Cell Time");
4284 fhTimeAmp->SetTitleOffset(1.8,"Y");
4285 fhTimeAmp->SetAxisRange(timemin,timemax,"Y");
4286 fhTimeAmp->SetAxisRange(ptmin,ptmax,"X");
4287 fhTimeAmp->Draw("colz");
4289 snprintf(name,buffersize,"QA_%s_CellsTime.eps",fCalorimeter.Data());
4290 ctime->Print(name); printf("Plot: %s\n",name);
4294 //---------------------------------
4295 //Grid of cell per module plots
4296 //---------------------------------
4298 //Number of entries per cell
4299 gStyle->SetPadRightMargin(0.15);
4300 snprintf(cname,buffersize,"%s_QA_GridCellEntries",fCalorimeter.Data());
4301 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
4302 if(fNModules%2 == 0)
4303 cgrid->Divide(fNModules/2,2);
4305 cgrid->Divide(fNModules/2+1,2);
4307 for(Int_t imod = 0; imod < fNModules ; imod++){
4312 //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
4313 fhGridCellsMod[imod]->SetZTitle("Counts ");
4314 fhGridCellsMod[imod]->SetYTitle("row (phi direction) ");
4315 //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
4316 fhGridCellsMod[imod]->Draw("colz");
4318 snprintf(name,buffersize,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
4319 cgrid->Print(name); printf("Create plot %s\n",name);
4321 snprintf(cname,buffersize,"%s_QA_GridCellAccumEnergy",fCalorimeter.Data());
4322 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
4323 if(fNModules%2 == 0)
4324 cgridE->Divide(fNModules/2,2);
4326 cgridE->Divide(fNModules/2+1,2);
4327 for(Int_t imod = 0; imod < fNModules ; imod++){
4332 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4333 fhGridCellsEMod[imod]->SetZTitle("Accumulated Energy (GeV) ");
4334 fhGridCellsEMod[imod]->SetYTitle("row (phi direction) ");
4335 fhGridCellsEMod[imod]->Draw("colz");
4337 snprintf(name,buffersize,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
4338 cgridE->Print(name); printf("Create plot %s\n",name);
4340 //Accumulated energy per cell
4341 snprintf(cname,buffersize,"%s_QA_GridCellAverageEnergy",fCalorimeter.Data());
4342 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
4343 if(fNModules%2 == 0)
4344 cgridEA->Divide(fNModules/2,2);
4346 cgridEA->Divide(fNModules/2+1,2);
4347 for(Int_t imod = 0; imod < fNModules ; imod++){
4348 cgridEA->cd(imod+1);
4352 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4353 fhGridCellsEMod[imod]->SetZTitle("Average Energy (GeV) ");
4354 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
4355 fhGridCellsEMod[imod]->Draw("colz");
4357 snprintf(name,buffersize,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
4358 cgridEA->Print(name); printf("Create plot %s\n",name);
4360 //Accumulated Time per cell, E > 0.5 GeV
4362 snprintf(cname,buffersize,"%s_QA_GridCellAccumTime",fCalorimeter.Data());
4363 TCanvas *cgridT = new TCanvas("cgridT","Summed time per cell", 12,12,800,400);
4364 if(fNModules%2 == 0)
4365 cgridT->Divide(fNModules/2,2);
4367 cgridE->Divide(fNModules/2+1,2);
4368 for(Int_t imod = 0; imod < fNModules ; imod++){
4373 //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
4374 fhGridCellsTimeMod[imod]->SetZTitle("Accumulated Time (ns) ");
4375 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction) ");
4376 fhGridCellsTimeMod[imod]->Draw("colz");
4378 snprintf(name,buffersize,"QA_%s_GridCellsAccumTime.eps",fCalorimeter.Data());
4379 cgridT->Print(name); printf("Create plot %s\n",name);
4383 //---------------------------------------------
4384 //Calorimeter Correlation, PHOS vs EMCAL
4385 //---------------------------------------------
4388 snprintf(cname,buffersize,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
4389 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
4390 ccorr->Divide(2, 2);
4395 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"X");
4396 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"Y");
4397 fhCaloCorrNClusters ->Draw();
4402 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"X");
4403 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"Y");
4404 fhCaloCorrNCells->Draw();
4408 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"X");
4409 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"Y");
4410 fhCaloCorrEClusters->Draw();
4415 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"X");
4416 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"Y");
4417 fhCaloCorrECells->Draw();
4419 snprintf(name,buffersize,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
4420 ccorr->Print(name); printf("Plot: %s\n",name);
4423 //----------------------------
4425 //-----------------------------
4427 Int_t imbinmin = -1;
4428 Int_t imbinmax = -1;
4430 if(fhIM->GetEntries() > 1){
4431 Int_t nebins = fhIM->GetNbinsX();
4432 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
4433 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
4434 if (emin != 0 ) printf("emin != 0 \n");
4435 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4437 snprintf(cname,buffersize,"QA_%s_IM",fCalorimeter.Data());
4439 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
4443 //fhIM->SetLineColor(4);
4446 imbinmax = (Int_t) (1-emin)*nebins/emax;
4447 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),imbinmin,imbinmax);
4448 pyim1->SetTitle("E_{pair} < 1 GeV");
4449 pyim1->SetLineColor(1);
4451 TLegend pLegendIM(0.7,0.6,0.9,0.8);
4452 pLegendIM.SetTextSize(0.03);
4453 pLegendIM.AddEntry(pyim1,"all modules","L");
4454 pLegendIM.SetFillColor(10);
4455 pLegendIM.SetBorderSize(1);
4457 for(Int_t imod = 0; imod < fNModules; imod++){
4458 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4459 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
4460 pyim1->SetLineColor(imod+1);
4461 pyim1->Draw("same");
4466 imbinmin = (Int_t) (1-emin)*nebins/emax;
4467 imbinmax = (Int_t) (2-emin)*nebins/emax;
4468 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),imbinmin,imbinmax);
4469 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
4470 pyim2->SetLineColor(1);
4472 for(Int_t imod = 0; imod < fNModules; imod++){
4473 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4474 pyim2->SetLineColor(imod+1);
4475 pyim2->Draw("same");
4479 imbinmin = (Int_t) (2-emin)*nebins/emax;
4480 imbinmax = (Int_t) (3-emin)*nebins/emax;
4481 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),imbinmin,imbinmax);
4482 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
4483 pyim3->SetLineColor(1);
4485 for(Int_t imod = 0; imod < fNModules; imod++){
4486 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4487 pyim3->SetLineColor(imod+1);
4488 pyim3->Draw("same");
4492 imbinmin = (Int_t) (3-emin)*nebins/emax;
4493 imbinmax = (Int_t) (4-emin)*nebins/emax;
4494 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),imbinmin,imbinmax);
4495 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
4496 pyim4->SetLineColor(1);
4498 for(Int_t imod = 0; imod < fNModules; imod++){
4499 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4500 pyim4->SetLineColor(imod+1);
4501 pyim4->Draw("same");
4505 imbinmin = (Int_t) (4-emin)*nebins/emax;
4506 imbinmax = (Int_t) (5-emin)*nebins/emax;
4507 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),imbinmin,imbinmax);
4508 pyim5->SetTitle("4< E_{pair} < 5 GeV");
4509 pyim5->SetLineColor(1);
4511 for(Int_t imod = 0; imod < fNModules; imod++){
4512 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4513 pyim5->SetLineColor(imod+1);
4514 pyim5->Draw("same");
4518 imbinmin = (Int_t) (5-emin)*nebins/emax;
4520 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),imbinmin,imbinmax);
4521 pyim10->SetTitle("E_{pair} > 5 GeV");
4522 pyim10->SetLineColor(1);
4524 for(Int_t imod = 0; imod < fNModules; imod++){
4525 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4526 pyim10->SetLineColor(imod+1);
4527 pyim10->Draw("same");
4530 snprintf(name,buffersize,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
4531 c5->Print(name); printf("Plot: %s\n",name);
4534 //--------------------------------------------------
4535 //Invariant mass, clusters with more than one cell
4536 //-------------------------------------------------
4537 if(fhIMCellCut->GetEntries() > 1){
4538 Int_t nebins = fhIMCellCut->GetNbinsX();
4539 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
4540 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
4541 if (emin != 0 ) printf("emin != 0 \n");
4542 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4544 snprintf(cname,buffersize,"QA_%s_IMCellCut",fCalorimeter.Data());
4545 // printf("c5cc\n");
4546 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
4550 //fhIMCellCut->SetLineColor(4);
4551 //fhIMCellCut->Draw();
4553 imbinmax = (Int_t) (1-emin)*nebins/emax;
4554 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),imbinmin,imbinmax);
4555 pyimcc1->SetTitle("E_{pair} < 1 GeV");
4556 pyimcc1->SetLineColor(1);
4558 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
4559 pLegendIMCellCut.SetTextSize(0.03);
4560 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
4561 pLegendIMCellCut.SetFillColor(10);
4562 pLegendIMCellCut.SetBorderSize(1);
4564 for(Int_t imod = 0; imod < fNModules; imod++){
4565 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4566 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
4567 pyimcc1->SetLineColor(imod+1);
4568 pyimcc1->Draw("same");
4570 pLegendIMCellCut.Draw();
4573 imbinmin = (Int_t) (1-emin)*nebins/emax;
4574 imbinmax = (Int_t) (2-emin)*nebins/emax;
4575 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),imbinmin,imbinmax);
4576 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
4577 pyimcc2->SetLineColor(1);
4579 for(Int_t imod = 0; imod < fNModules; imod++){
4580 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4581 pyimcc2->SetLineColor(imod+1);
4582 pyimcc2->Draw("same");
4586 imbinmin = (Int_t) (2-emin)*nebins/emax;
4587 imbinmax = (Int_t) (3-emin)*nebins/emax;
4588 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),imbinmin,imbinmax);
4589 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
4590 pyimcc3->SetLineColor(1);
4592 for(Int_t imod = 0; imod < fNModules; imod++){
4593 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4594 pyimcc3->SetLineColor(imod+1);
4595 pyimcc3->Draw("same");
4599 imbinmin = (Int_t) (3-emin)*nebins/emax;
4600 imbinmax = (Int_t) (4-emin)*nebins/emax;
4601 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),imbinmin,imbinmax);
4602 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
4603 pyimcc4->SetLineColor(1);
4605 for(Int_t imod = 0; imod < fNModules; imod++){
4606 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4607 pyimcc4->SetLineColor(imod+1);
4608 pyimcc4->Draw("same");
4612 imbinmin = (Int_t) (4-emin)*nebins/emax;
4613 imbinmax = (Int_t) (5-emin)*nebins/emax;
4614 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),imbinmin,imbinmax);
4615 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
4616 pyimcc5cc->SetLineColor(1);
4618 for(Int_t imod = 0; imod < fNModules; imod++){
4619 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4620 pyimcc5cc->SetLineColor(imod+1);
4621 pyimcc5cc->Draw("same");
4625 imbinmin = (Int_t) (5-emin)*nebins/emax;
4627 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),imbinmin,imbinmax);
4628 pyimcc10->SetTitle("E_{pair} > 5 GeV");
4629 pyimcc10->SetLineColor(1);
4631 for(Int_t imod = 0; imod < fNModules; imod++){
4632 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4633 pyimcc10->SetLineColor(imod+1);
4634 pyimcc10->Draw("same");
4637 snprintf(name,buffersize,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
4638 c5cc->Print(name); printf("Plot: %s\n",name);
4643 if(fhAsym->GetEntries() > 1){
4644 Int_t nebins = fhAsym->GetNbinsX();
4645 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
4646 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
4647 if (emin != 0 ) printf("emin != 0 \n");
4648 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4650 snprintf(cname,buffersize,"QA_%s_Asym",fCalorimeter.Data());
4652 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
4656 fhAsym->SetTitleOffset(1.6,"Y");
4657 fhAsym->SetLineColor(4);
4662 imbinmax = (Int_t) (5-emin)*nebins/emax;
4663 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),imbinmin,imbinmax);
4664 pyAsym5->SetTitle("E_{pair} < 5 GeV");
4665 pyAsym5->SetLineColor(4);
4669 imbinmin = (Int_t) (5-emin)*nebins/emax;
4670 imbinmax = (Int_t) (10-emin)*nebins/emax;
4671 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),imbinmin,imbinmax);
4672 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
4673 pyAsym510->SetLineColor(4);
4677 imbinmin = (Int_t) (10-emin)*nebins/emax;
4679 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),imbinmin,imbinmax);
4680 pyAsym10->SetTitle("E_{pair} > 10 GeV");
4681 pyAsym10->SetLineColor(4);
4684 snprintf(name,buffersize,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
4685 c5b->Print(name); printf("Plot: %s\n",name);
4690 //Reconstructed vs MC distributions
4692 snprintf(cname,buffersize,"QA_%s_recvsmc",fCalorimeter.Data());
4693 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4697 fh2E->SetTitleOffset(1.6,"Y");
4698 fh2E->SetLineColor(4);
4702 fh2Pt->SetTitleOffset(1.6,"Y");
4703 fh2Pt->SetLineColor(4);
4707 fh2Phi->SetTitleOffset(1.6,"Y");
4708 fh2Phi->SetLineColor(4);
4712 fh2Eta->SetTitleOffset(1.6,"Y");
4713 fh2Eta->SetLineColor(4);
4716 snprintf(name,buffersize,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4717 c6->Print(name); printf("Plot: %s\n",name);
4719 //Reconstructed vs MC distributions
4721 snprintf(cname,buffersize,"QA_%s_gamrecvsmc",fCalorimeter.Data());
4722 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4723 c6Gam->Divide(2, 2);
4737 snprintf(name,buffersize,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4738 c6->Print(name); printf("Plot: %s\n",name);
4740 //Generated - reconstructed
4742 snprintf(cname,buffersize,"QA_%s_diffgenrec",fCalorimeter.Data());
4743 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
4747 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
4748 fhGamDeltaE->SetLineColor(4);
4750 fhGamDeltaE->Draw("same");
4752 TLegend pLegendd(0.65,0.55,0.9,0.8);
4753 pLegendd.SetTextSize(0.06);
4754 pLegendd.AddEntry(fhDeltaE,"all","L");
4755 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
4756 pLegendd.SetFillColor(10);
4757 pLegendd.SetBorderSize(1);
4761 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
4762 fhGamDeltaPt->SetLineColor(4);
4764 fhGamDeltaPt->Draw("same");
4767 fhGamDeltaPhi->SetLineColor(4);
4769 fhGamDeltaPhi->Draw("same");
4772 fhGamDeltaEta->SetLineColor(4);
4774 fhGamDeltaEta->Draw("same");
4776 snprintf(name,buffersize,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
4777 c7->Print(name); printf("Plot: %s\n",name);
4779 // Reconstructed / Generated
4781 snprintf(cname,buffersize,"QA_%s_ratiorecgen",fCalorimeter.Data());
4782 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
4786 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
4787 fhGamRatioE->SetLineColor(4);
4789 fhGamRatioE->Draw("same");
4791 TLegend pLegendr(0.65,0.55,0.9,0.8);
4792 pLegendr.SetTextSize(0.06);
4793 pLegendr.AddEntry(fhRatioE,"all","L");
4794 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
4795 pLegendr.SetFillColor(10);
4796 pLegendr.SetBorderSize(1);
4800 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
4801 fhGamRatioPt->SetLineColor(4);
4803 fhGamRatioPt->Draw("same");
4806 fhGamRatioPhi->SetLineColor(4);
4808 fhGamRatioPhi->Draw("same");
4811 fhGamRatioEta->SetLineColor(4);
4813 fhGamRatioEta->Draw("same");
4815 snprintf(name,buffersize,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
4816 c8->Print(name); printf("Plot: %s\n",name);
4820 //Generated distributions
4822 snprintf(cname,buffersize,"QA_%s_gen",fCalorimeter.Data());
4823 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
4828 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
4829 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
4830 fhGenPi0Pt->SetLineColor(1);
4831 fhGenGamPt->SetLineColor(4);
4832 fhGenEtaPt->SetLineColor(2);
4833 fhGenOmegaPt->SetLineColor(7);
4834 fhGenElePt->SetLineColor(6);
4836 //Select the maximum of the histogram to show all lines.
4837 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4838 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
4839 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
4840 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4841 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
4842 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
4843 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
4844 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4845 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
4846 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4847 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4848 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
4849 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4850 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
4851 haxispt->SetMaximum(fhGenElePt->GetMaximum());
4852 haxispt->SetMinimum(1);
4853 haxispt->Draw("axis");
4854 fhGenPi0Pt->Draw("same");
4855 fhGenGamPt->Draw("same");
4856 fhGenEtaPt->Draw("same");
4857 fhGenOmegaPt->Draw("same");
4858 fhGenElePt->Draw("same");
4860 TLegend pLegend(0.85,0.65,0.95,0.93);
4861 pLegend.SetTextSize(0.06);
4862 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
4863 pLegend.AddEntry(fhGenGamPt," #gamma","L");
4864 pLegend.AddEntry(fhGenEtaPt," #eta","L");
4865 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
4866 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
4867 pLegend.SetFillColor(10);
4868 pLegend.SetBorderSize(1);
4873 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
4874 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
4875 fhGenPi0Eta->SetLineColor(1);
4876 fhGenGamEta->SetLineColor(4);
4877 fhGenEtaEta->SetLineColor(2);
4878 fhGenOmegaEta->SetLineColor(7);
4879 fhGenEleEta->SetLineColor(6);
4880 //Select the maximum of the histogram to show all lines.
4881 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4882 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
4883 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
4884 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4885 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4886 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
4887 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
4888 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4889 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
4890 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4891 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4892 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
4893 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4894 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
4895 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
4896 haxiseta->SetMinimum(100);
4897 haxiseta->Draw("axis");
4898 fhGenPi0Eta->Draw("same");
4899 fhGenGamEta->Draw("same");
4900 fhGenEtaEta->Draw("same");
4901 fhGenOmegaEta->Draw("same");
4902 fhGenEleEta->Draw("same");
4907 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
4908 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
4909 fhGenPi0Phi->SetLineColor(1);
4910 fhGenGamPhi->SetLineColor(4);
4911 fhGenEtaPhi->SetLineColor(2);
4912 fhGenOmegaPhi->SetLineColor(7);
4913 fhGenElePhi->SetLineColor(6);
4914 //Select the maximum of the histogram to show all lines.
4915 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4916 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
4917 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
4918 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4919 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4920 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
4921 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
4922 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4923 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
4924 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4925 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4926 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
4927 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4928 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
4929 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
4930 haxisphi->SetMinimum(100);
4931 haxisphi->Draw("axis");
4932 fhGenPi0Phi->Draw("same");
4933 fhGenGamPhi->Draw("same");
4934 fhGenEtaPhi->Draw("same");
4935 fhGenOmegaPhi->Draw("same");
4936 fhGenElePhi->Draw("same");
4938 snprintf(name,buffersize,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
4939 c10->Print(name); printf("Plot: %s\n",name);
4942 //Reconstructed clusters depending on its original particle.
4944 snprintf(cname,buffersize,"QA_%s_recgenid",fCalorimeter.Data());
4945 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
4951 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
4952 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
4953 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
4954 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
4955 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
4956 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
4957 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
4958 hPi0E->SetLineColor(1);
4959 hGamE->SetLineColor(4);
4960 hNeHadE->SetLineColor(2);
4961 hChHadE->SetLineColor(7);
4962 hEleE->SetLineColor(6);
4964 //Select the maximum of the histogram to show all lines.
4965 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
4966 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
4967 haxisE->SetMaximum(hPi0E->GetMaximum());
4968 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
4969 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
4970 haxisE->SetMaximum(hGamE->GetMaximum());
4971 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
4972 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
4973 haxisE->SetMaximum(hNeHadE->GetMaximum());
4974 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
4975 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
4976 haxisE->SetMaximum(hChHadE->GetMaximum());
4977 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
4978 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
4979 haxisE->SetMaximum(hEleE->GetMaximum());
4980 haxisE->SetXTitle("E (GeV)");
4981 haxisE->SetMinimum(1);
4982 haxisE->Draw("axis");
4983 hPi0E->Draw("same");
4984 hGamE->Draw("same");
4985 hNeHadE->Draw("same");
4986 hChHadE->Draw("same");
4987 hEleE->Draw("same");
4989 TLegend pLegend2(0.8,0.65,0.95,0.93);
4990 pLegend2.SetTextSize(0.06);
4991 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
4992 pLegend2.AddEntry(hGamE," #gamma","L");
4993 pLegend2.AddEntry(hEleE," e^{#pm}","L");
4994 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
4995 pLegend2.AddEntry(hNeHadE," h^{0}","L");
4996 pLegend2.SetFillColor(10);
4997 pLegend2.SetBorderSize(1);
5003 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
5004 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
5005 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
5006 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
5007 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
5008 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
5009 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
5010 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
5011 hPi0Pt->SetLineColor(1);
5012 hGamPt->SetLineColor(4);
5013 hNeHadPt->SetLineColor(2);
5014 hChHadPt->SetLineColor(7);
5015 hElePt->SetLineColor(6);
5017 //Select the maximum of the histogram to show all lines.
5018 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5019 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
5020 haxispt->SetMaximum(hPi0Pt->GetMaximum());
5021 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5022 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
5023 haxispt->SetMaximum(hGamPt->GetMaximum());
5024 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
5025 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
5026 haxispt->SetMaximum(hNeHadPt->GetMaximum());
5027 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5028 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
5029 haxispt->SetMaximum(hChHadPt->GetMaximum());
5030 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5031 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
5032 haxispt->SetMaximum(hElePt->GetMaximum());
5033 haxispt->SetXTitle("p_{T} (GeV/c)");
5034 haxispt->SetMinimum(1);
5035 haxispt->Draw("axis");
5036 hPi0Pt->Draw("same");
5037 hGamPt->Draw("same");
5038 hNeHadPt->Draw("same");
5039 hChHadPt->Draw("same");
5040 hElePt->Draw("same");
5045 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
5046 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
5047 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
5048 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
5049 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
5050 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
5051 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
5052 hPi0Eta->SetLineColor(1);
5053 hGamEta->SetLineColor(4);
5054 hNeHadEta->SetLineColor(2);
5055 hChHadEta->SetLineColor(7);
5056 hEleEta->SetLineColor(6);
5057 //Select the maximum of the histogram to show all lines.
5058 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5059 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
5060 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
5061 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5062 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
5063 haxiseta->SetMaximum(hGamEta->GetMaximum());
5064 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
5065 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
5066 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
5067 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5068 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
5069 haxiseta->SetMaximum(hChHadEta->GetMaximum());
5070 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5071 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
5072 haxiseta->SetMaximum(hEleEta->GetMaximum());
5074 haxiseta->SetXTitle("#eta");
5075 haxiseta->Draw("axis");
5076 hPi0Eta->Draw("same");
5077 hGamEta->Draw("same");
5078 hNeHadEta->Draw("same");
5079 hChHadEta->Draw("same");
5080 hEleEta->Draw("same");
5085 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
5086 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
5087 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
5088 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
5089 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
5090 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
5091 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
5093 hPi0Phi->SetLineColor(1);
5094 hGamPhi->SetLineColor(4);
5095 hNeHadPhi->SetLineColor(2);
5096 hChHadPhi->SetLineColor(7);
5097 hElePhi->SetLineColor(6);
5098 //Select the maximum of the histogram to show all lines.
5099 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5100 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
5101 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
5102 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5103 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
5104 haxisphi->SetMaximum(hGamPhi->GetMaximum());
5105 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
5106 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5107 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
5108 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5109 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5110 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
5111 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5112 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
5113 haxisphi->SetMaximum(hElePhi->GetMaximum());
5114 haxisphi->SetXTitle("#phi (rad)");
5115 haxisphi->Draw("axis");
5116 hPi0Phi->Draw("same");
5117 hGamPhi->Draw("same");
5118 hNeHadPhi->Draw("same");
5119 hChHadPhi->Draw("same");
5120 hElePhi->Draw("same");
5122 snprintf(name,buffersize,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
5123 c11->Print(name); printf("Plot: %s\n",name);
5126 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
5129 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
5130 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
5131 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
5132 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
5133 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
5134 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
5135 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
5136 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
5138 snprintf(cname,buffersize,"QA_%s_recgenidratio",fCalorimeter.Data());
5139 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
5144 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5145 hPi0EClone->Divide(fhGenPi0AccE);
5146 hGamEClone->Divide(fhGenGamAccE);
5147 haxisE->SetMaximum(5);
5148 haxisE->SetMinimum(1e-2);
5149 haxisE->SetXTitle("E (GeV)");
5150 haxisE->SetYTitle("ratio = rec/gen");
5151 haxisE->Draw("axis");
5152 hPi0E->Draw("same");
5153 hGamE->Draw("same");
5155 TLegend pLegend3(0.75,0.2,0.9,0.4);
5156 pLegend3.SetTextSize(0.06);
5157 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
5158 pLegend3.AddEntry(hGamEClone," #gamma","L");
5159 pLegend3.SetFillColor(10);
5160 pLegend3.SetBorderSize(1);
5165 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5166 hPi0PtClone->Divide(fhGenPi0AccPt);
5167 hGamPtClone->Divide(fhGenGamAccPt);
5168 haxispt->SetMaximum(5);
5169 haxispt->SetMinimum(1e-2);
5170 haxispt->SetXTitle("p_{T} (GeV/c)");
5171 haxispt->SetYTitle("ratio = rec/gen");
5172 haxispt->Draw("axis");
5173 hPi0PtClone->Draw("same");
5174 hGamPtClone->Draw("same");
5179 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5180 hPi0EtaClone->Divide(fhGenPi0AccEta);
5181 hGamEtaClone->Divide(fhGenGamAccEta);
5182 haxiseta->SetMaximum(1.2);
5183 haxiseta->SetMinimum(1e-2);
5184 haxiseta->SetYTitle("ratio = rec/gen");
5185 haxiseta->SetXTitle("#eta");
5186 haxiseta->Draw("axis");
5187 hPi0EtaClone->Draw("same");
5188 hGamEtaClone->Draw("same");
5193 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5194 hPi0PhiClone->Divide(fhGenPi0AccPhi);
5195 hGamPhiClone->Divide(fhGenGamAccPhi);
5196 haxisphi->SetYTitle("ratio = rec/gen");
5197 haxisphi->SetXTitle("#phi (rad)");
5198 haxisphi->SetMaximum(1.2);
5199 haxisphi->SetMinimum(1e-2);
5200 haxisphi->Draw("axis");
5201 hPi0PhiClone->Draw("same");
5202 hGamPhiClone->Draw("same");
5204 snprintf(name,buffersize,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
5205 c12->Print(name); printf("Plot: %s\n",name);
5209 //Reconstructed distributions
5211 snprintf(cname,buffersize,"QA_%s_vertex",fCalorimeter.Data());
5212 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
5217 fhEMVxyz->SetTitleOffset(1.6,"Y");
5222 fhHaVxyz->SetTitleOffset(1.6,"Y");
5227 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
5228 hEMR->SetLineColor(4);
5233 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
5234 hHaR->SetLineColor(4);
5238 snprintf(name,buffersize,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
5239 c13->Print(name); printf("Plot: %s\n",name);
5242 //Track-matching distributions
5244 //Reconstructed distributions, matched with tracks, generated particle dependence
5246 snprintf(cname,buffersize,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
5247 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
5248 c22ch->Divide(2, 2);
5252 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
5253 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
5254 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
5255 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
5256 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
5257 hPi0ECharged->SetLineColor(1);
5258 hGamECharged->SetLineColor(4);
5259 hNeHadECharged->SetLineColor(2);
5260 hChHadECharged->SetLineColor(7);
5261 hEleECharged->SetLineColor(6);
5263 fhECharged->SetLineColor(3);
5264 fhECharged->SetMinimum(0.5);
5266 hPi0ECharged->Draw("same");
5267 hGamECharged->Draw("same");
5268 hNeHadECharged->Draw("same");
5269 hChHadECharged->Draw("same");
5270 hEleECharged->Draw("same");
5271 TLegend pLegend22(0.75,0.45,0.9,0.8);
5272 pLegend22.SetTextSize(0.06);
5273 pLegend22.AddEntry(fhECharged,"all","L");
5274 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
5275 pLegend22.AddEntry(hGamECharged,"#gamma","L");
5276 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
5277 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
5278 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
5279 pLegend22.SetFillColor(10);
5280 pLegend22.SetBorderSize(1);
5285 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
5286 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
5287 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
5288 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
5289 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
5290 hPi0PtCharged->SetLineColor(1);
5291 hGamPtCharged->SetLineColor(4);
5292 hNeHadPtCharged->SetLineColor(2);
5293 hChHadPtCharged->SetLineColor(7);
5294 hElePtCharged->SetLineColor(6);
5296 fhPtCharged->SetLineColor(3);
5297 fhPtCharged->SetMinimum(0.5);
5298 fhPtCharged->Draw();
5299 hPi0PtCharged->Draw("same");
5300 hGamPtCharged->Draw("same");
5301 hNeHadPtCharged->Draw("same");
5302 hChHadPtCharged->Draw("same");
5303 hElePtCharged->Draw("same");
5307 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
5308 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
5309 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
5310 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
5311 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
5312 hPi0EtaCharged->SetLineColor(1);
5313 hGamEtaCharged->SetLineColor(4);
5314 hNeHadEtaCharged->SetLineColor(2);
5315 hChHadEtaCharged->SetLineColor(7);
5316 hEleEtaCharged->SetLineColor(6);
5318 fhEtaCharged->SetLineColor(3);
5319 fhEtaCharged->SetMinimum(0.5);
5320 fhEtaCharged->Draw();
5321 hPi0EtaCharged->Draw("same");
5322 hGamEtaCharged->Draw("same");
5323 hNeHadEtaCharged->Draw("same");
5324 hChHadEtaCharged->Draw("same");
5325 hEleEtaCharged->Draw("same");
5329 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
5330 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
5331 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
5332 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
5333 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
5334 hPi0PhiCharged->SetLineColor(1);
5335 hGamPhiCharged->SetLineColor(4);
5336 hNeHadPhiCharged->SetLineColor(2);
5337 hChHadPhiCharged->SetLineColor(7);
5338 hElePhiCharged->SetLineColor(6);
5340 fhPhiCharged->SetLineColor(3);
5341 fhPhiCharged->SetMinimum(0.5);
5342 fhPhiCharged->Draw();
5343 hPi0PhiCharged->Draw("same");
5344 hGamPhiCharged->Draw("same");
5345 hNeHadPhiCharged->Draw("same");
5346 hChHadPhiCharged->Draw("same");
5347 hElePhiCharged->Draw("same");
5350 snprintf(name,buffersize,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
5351 c22ch->Print(name); printf("Plot: %s\n",name);
5353 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
5354 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
5355 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
5356 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
5358 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
5359 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
5360 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
5361 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
5363 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
5364 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
5365 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
5366 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
5368 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
5369 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
5370 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
5371 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
5373 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
5374 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
5375 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
5376 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
5378 //Ratio: reconstructed track matched/ all reconstructed
5380 snprintf(cname,buffersize,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
5381 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
5385 hEChargedClone->SetMaximum(1.2);
5386 hEChargedClone->SetMinimum(0.001);
5387 hEChargedClone->SetLineColor(3);
5388 hEChargedClone->SetYTitle("track matched / all");
5389 hPi0EChargedClone->Divide(hPi0E);
5390 hGamEChargedClone->Divide(hGamE);
5391 hEleEChargedClone->Divide(hEleE);
5392 hNeHadEChargedClone->Divide(hNeHadE);
5393 hChHadEChargedClone->Divide(hChHadE);
5394 hEChargedClone->Draw();
5395 hPi0EChargedClone->Draw("same");
5396 hGamEChargedClone->Draw("same");
5397 hEleEChargedClone->Draw("same");
5398 hNeHadEChargedClone->Draw("same");
5399 hChHadEChargedClone->Draw("same");
5401 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
5402 pLegend3ch.SetTextSize(0.06);
5403 pLegend3ch.AddEntry(hEChargedClone,"all","L");
5404 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
5405 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
5406 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
5407 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
5408 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
5409 pLegend3ch.SetFillColor(10);
5410 pLegend3ch.SetBorderSize(1);
5414 hPtChargedClone->SetMaximum(1.2);
5415 hPtChargedClone->SetMinimum(0.001);
5416 hPtChargedClone->SetLineColor(3);
5417 hPtChargedClone->SetYTitle("track matched / all");
5418 hPi0PtChargedClone->Divide(hPi0Pt);
5419 hGamPtChargedClone->Divide(hGamPt);
5420 hElePtChargedClone->Divide(hElePt);
5421 hNeHadPtChargedClone->Divide(hNeHadPt);
5422 hChHadPtChargedClone->Divide(hChHadPt);
5423 hPtChargedClone->Draw();
5424 hPi0PtChargedClone->Draw("same");
5425 hGamPtChargedClone->Draw("same");
5426 hElePtChargedClone->Draw("same");
5427 hNeHadPtChargedClone->Draw("same");
5428 hChHadPtChargedClone->Draw("same");
5431 hEtaChargedClone->SetMaximum(1.2);
5432 hEtaChargedClone->SetMinimum(0.001);
5433 hEtaChargedClone->SetLineColor(3);
5434 hEtaChargedClone->SetYTitle("track matched / all");
5435 hPi0EtaChargedClone->Divide(hPi0Eta);
5436 hGamEtaChargedClone->Divide(hGamEta);
5437 hEleEtaChargedClone->Divide(hEleEta);
5438 hNeHadEtaChargedClone->Divide(hNeHadEta);
5439 hChHadEtaChargedClone->Divide(hChHadEta);
5440 hEtaChargedClone->Draw();
5441 hPi0EtaChargedClone->Draw("same");
5442 hGamEtaChargedClone->Draw("same");
5443 hEleEtaChargedClone->Draw("same");
5444 hNeHadEtaChargedClone->Draw("same");
5445 hChHadEtaChargedClone->Draw("same");
5448 hPhiChargedClone->SetMaximum(1.2);
5449 hPhiChargedClone->SetMinimum(0.001);
5450 hPhiChargedClone->SetLineColor(3);
5451 hPhiChargedClone->SetYTitle("track matched / all");
5452 hPi0PhiChargedClone->Divide(hPi0Phi);
5453 hGamPhiChargedClone->Divide(hGamPhi);
5454 hElePhiChargedClone->Divide(hElePhi);
5455 hNeHadPhiChargedClone->Divide(hNeHadPhi);
5456 hChHadPhiChargedClone->Divide(hChHadPhi);
5457 hPhiChargedClone->Draw();
5458 hPi0PhiChargedClone->Draw("same");
5459 hGamPhiChargedClone->Draw("same");
5460 hElePhiChargedClone->Draw("same");
5461 hNeHadPhiChargedClone->Draw("same");
5462 hChHadPhiChargedClone->Draw("same");
5464 snprintf(name,buffersize,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
5465 c3ch->Print(name); printf("Plot: %s\n",name);
5469 //Track-matching distributions
5471 snprintf(cname,buffersize,"QA_%s_trkmatch",fCalorimeter.Data());
5472 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
5475 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
5476 pLegendpE0.SetTextSize(0.04);
5477 pLegendpE0.AddEntry(fh1pOverE,"all","L");
5478 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
5479 pLegendpE0.SetFillColor(10);
5480 pLegendpE0.SetBorderSize(1);
5481 //pLegendpE0.Draw();
5484 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
5485 fh1pOverE->SetTitle("Track matches p/E");
5487 fh1pOverER02->SetLineColor(4);
5488 fh1pOverER02->Draw("same");
5492 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
5496 fh2MatchdEdx->Draw();
5501 snprintf(name,buffersize,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
5502 cme->Print(name); printf("Plot: %s\n",name);
5505 snprintf(cname,buffersize,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
5506 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
5511 fhMCEle1pOverE->Draw();
5512 fhMCEle1pOverER02->SetLineColor(4);
5513 fhMCEle1pOverE->SetLineColor(1);
5514 fhMCEle1pOverER02->Draw("same");
5522 fhMCEle2MatchdEdx->Draw();
5524 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
5525 cmemc->Print(name); printf("Plot: %s\n",name);
5528 snprintf(cname,buffersize,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
5529 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
5530 cmemchad->Divide(3,1);
5534 fhMCChHad1pOverE->Draw();
5535 fhMCChHad1pOverER02->SetLineColor(4);
5536 fhMCChHad1pOverE->SetLineColor(1);
5537 fhMCChHad1pOverER02->Draw("same");
5542 fhMCChHad1dR->Draw();
5545 fhMCChHad2MatchdEdx->Draw();
5547 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
5548 cmemchad->Print(name); printf("Plot: %s\n",name);
5550 snprintf(cname,buffersize,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
5551 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
5552 cmemcn->Divide(3,1);
5556 fhMCNeutral1pOverE->Draw();
5557 fhMCNeutral1pOverE->SetLineColor(1);
5558 fhMCNeutral1pOverER02->SetLineColor(4);
5559 fhMCNeutral1pOverER02->Draw("same");
5564 fhMCNeutral1dR->Draw();
5567 fhMCNeutral2MatchdEdx->Draw();
5569 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
5570 cmemcn->Print(name); printf("Plot: %s\n",name);
5572 snprintf(cname,buffersize,"QA_%s_trkmatchpE",fCalorimeter.Data());
5573 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
5578 fh1pOverE->SetLineColor(1);
5579 fhMCEle1pOverE->SetLineColor(4);
5580 fhMCChHad1pOverE->SetLineColor(2);
5581 fhMCNeutral1pOverE->SetLineColor(7);
5582 fh1pOverER02->SetMinimum(0.5);
5584 fhMCEle1pOverE->Draw("same");
5585 fhMCChHad1pOverE->Draw("same");
5586 fhMCNeutral1pOverE->Draw("same");
5587 TLegend pLegendpE(0.65,0.55,0.9,0.8);
5588 pLegendpE.SetTextSize(0.06);
5589 pLegendpE.AddEntry(fh1pOverE,"all","L");
5590 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
5591 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
5592 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
5593 pLegendpE.SetFillColor(10);
5594 pLegendpE.SetBorderSize(1);
5599 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
5600 fh1pOverER02->SetLineColor(1);
5601 fhMCEle1pOverER02->SetLineColor(4);
5602 fhMCChHad1pOverER02->SetLineColor(2);
5603 fhMCNeutral1pOverER02->SetLineColor(7);
5604 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
5605 fh1pOverER02->SetMinimum(0.5);
5606 fh1pOverER02->Draw();
5607 fhMCEle1pOverER02->Draw("same");
5608 fhMCChHad1pOverER02->Draw("same");
5609 fhMCNeutral1pOverER02->Draw("same");
5611 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
5612 // pLegendpE2.SetTextSize(0.06);
5613 // pLegendpE2.SetHeader("dR < 0.02");
5614 // pLegendpE2.SetFillColor(10);
5615 // pLegendpE2.SetBorderSize(1);
5616 // pLegendpE2.Draw();
5618 snprintf(name,buffersize,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
5619 cmpoe->Print(name); printf("Plot: %s\n",name);
5622 char line[buffersize] ;
5623 snprintf(line, buffersize,".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
5624 gROOT->ProcessLine(line);
5625 snprintf(line, buffersize,".!rm -fR *.eps");
5626 gROOT->ProcessLine(line);
5628 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());