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"
38 //---- AliRoot system ----
39 #include "AliAnaCalorimeterQA.h"
40 #include "AliCaloTrackReader.h"
42 #include "AliAODCaloCells.h"
43 #include "AliESDCaloCells.h"
44 #include "AliAODCaloCluster.h"
45 #include "AliFiducialCut.h"
46 #include "AliESDtrack.h"
47 #include "AliAODTrack.h"
48 #include "AliESDCaloCluster.h"
49 #include "AliESDEvent.h"
50 #include "AliAODEvent.h"
51 #include "AliVEventHandler.h"
52 #include "AliAnalysisManager.h"
53 #include "AliAODMCParticle.h"
54 #include "AliMCAnalysisUtils.h"
55 #include "AliAODPid.h"
57 ClassImp(AliAnaCalorimeterQA)
59 //____________________________________________________________________________
60 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
61 AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""),
62 fMakePlots(kFALSE), fCorrelateCalos(kFALSE), fNModules(12),
63 fHistoPOverEBins(100), fHistoPOverEMax(100.), fHistoPOverEMin(0.),
64 fHistodEdxBins(100), fHistodEdxMax(100.), fHistodEdxMin(0.),
65 fHistodRBins(100), fHistodRMax(100.), fHistodRMin(0.),
66 fHistoTimeBins(100), fHistoTimeMax(100.), fHistoTimeMin(0.),
67 fHistoNBins(100), fHistoNMax(100), fHistoNMin(0),
68 fHistoRatioBins(100), fHistoRatioMax(100.), fHistoRatioMin(0.),
69 fHistoVertexDistBins(100), fHistoVertexDistMax(100.), fHistoVertexDistMin(0.),
70 fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhi(0), fhEtaPhiE(0),
71 fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiCharged(0),
72 fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0),
73 fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
74 fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0), fhIM(0), fhIMCellCut(0),fhAsym(0),
75 fhNCellsPerCluster(0),fhNCellsPerClusterMIP(0), fhNClusters(0), fhNCells(0),
76 fhAmplitude(0), fhAmpId(0), fhTime(0), fhTimeId(0), fhTimeAmp(0),
77 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
78 fhEMod(0),fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),
79 fhGridCellsMod(0), fhGridCellsEMod(0), fhAmplitudeMod(0), fhIMMod(0), fhIMCellCutMod(0),
80 fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
81 fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
82 fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
83 fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
84 fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0), fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
85 fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
86 fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0), fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
87 fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
88 fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
89 fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
90 fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
91 fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
92 fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
93 fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
94 fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
95 fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
96 fhMCChHad1pOverE(0),fhMCChHad1dR(0),fhMCChHad2MatchdEdx(0),fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
97 fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
101 //Initialize parameters
105 //____________________________________________________________________________
106 AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
107 AliAnaPartCorrBaseClass(qa), fCalorimeter(qa.fCalorimeter), fStyleMacro(qa.fStyleMacro),
108 fMakePlots(qa.fMakePlots), fCorrelateCalos(qa.fCorrelateCalos), fNModules(qa.fNModules),
109 fHistoPOverEBins(qa.fHistoPOverEBins), fHistoPOverEMax(qa.fHistoPOverEMax), fHistoPOverEMin(qa.fHistoPOverEMin),
110 fHistodEdxBins(qa.fHistodEdxBins), fHistodEdxMax(qa.fHistodEdxMax), fHistodEdxMin(qa.fHistodEdxMin),
111 fHistodRBins(qa.fHistodRBins), fHistodRMax(qa.fHistodRMax), fHistodRMin(qa.fHistodRMin),
112 fHistoTimeBins(qa.fHistoTimeBins), fHistoTimeMax(qa.fHistoTimeMax), fHistoTimeMin(qa.fHistoTimeMin),
113 fHistoNBins(qa.fHistoNBins), fHistoNMax(qa.fHistoNMax), fHistoNMin(qa.fHistoNMin),
114 fHistoRatioBins(qa.fHistoRatioBins), fHistoRatioMax(qa.fHistoRatioMax), fHistoRatioMin(qa.fHistoRatioMin),
115 fHistoVertexDistBins(qa.fHistoVertexDistBins), fHistoVertexDistMax(qa.fHistoVertexDistMax), fHistoVertexDistMin(qa.fHistoVertexDistMin),
116 fhE(qa.fhE),fhPt(qa.fhPt), fhPhi(qa.fhPhi), fhEta(qa.fhEta),
117 fhEtaPhi(qa.fhEtaPhi), fhEtaPhiE(qa.fhEtaPhiE), fhECharged(qa.fhECharged),fhPtCharged(qa.fhPtCharged),fhPhiCharged(qa.fhPhiCharged),
118 fhEtaCharged(qa.fhEtaCharged), fhEtaPhiCharged(qa.fhEtaPhiCharged),
119 fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
120 fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut),
121 fhDeltaE(qa.fhDeltaE), fhDeltaPt(qa.fhDeltaPt), fhDeltaPhi(qa.fhDeltaPhi), fhDeltaEta(qa.fhDeltaEta),
122 fhRatioE(qa.fhRatioE), fhRatioPt(qa.fhRatioPt), fhRatioPhi(qa.fhRatioPhi), fhRatioEta(qa.fhRatioEta),
123 fh2E(qa.fh2E), fh2Pt(qa.fh2Pt), fh2Phi(qa.fh2Phi),fh2Eta(qa.fh2Eta),
124 fhIM(qa.fhIM), fhIMCellCut(qa.fhIMCellCut), fhAsym(qa.fhAsym),
125 fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNCellsPerClusterMIP(qa.fhNCellsPerClusterMIP),
126 fhNClusters(qa.fhNClusters), fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude), fhAmpId(fhAmpId),
127 fhTime(qa.fhTime), fhTimeId(qa.fhTimeId),fhTimeAmp(qa.fhTimeAmp),
128 fhCaloCorrNClusters(qa.fhCaloCorrNClusters), fhCaloCorrEClusters(qa.fhCaloCorrEClusters),
129 fhCaloCorrNCells(qa.fhCaloCorrNCells), fhCaloCorrECells(qa.fhCaloCorrECells),
130 fhEMod(qa.fhEMod),fhNClustersMod(qa.fhNClustersMod), fhNCellsPerClusterMod(qa.fhNCellsPerClusterMod), fhNCellsMod(qa.fhNCellsMod),
131 fhGridCellsMod(qa.fhGridCellsMod), fhGridCellsEMod(qa.fhGridCellsEMod), fhAmplitudeMod(qa.fhAmplitudeMod),
132 fhIMMod(qa.fhIMMod),fhIMCellCutMod(qa.fhIMCellCutMod),
133 fhGenGamPt(qa.fhGenGamPt), fhGenGamEta(qa.fhGenGamEta), fhGenGamPhi(qa.fhGenGamPhi),
134 fhGenPi0Pt(qa.fhGenPi0Pt), fhGenPi0Eta(qa.fhGenPi0Eta), fhGenPi0Phi(qa.fhGenPi0Phi),
135 fhGenEtaPt(qa.fhGenEtaPt), fhGenEtaEta(qa.fhGenEtaEta), fhGenEtaPhi(qa.fhGenEtaPhi),
136 fhGenOmegaPt(qa.fhGenOmegaPt), fhGenOmegaEta(qa.fhGenOmegaEta), fhGenOmegaPhi(qa.fhGenOmegaPhi),
137 fhGenElePt(qa.fhGenElePt), fhGenEleEta(qa.fhGenEleEta), fhGenElePhi(qa.fhGenElePhi),
138 fhEMVxyz(qa.fhEMVxyz), fhEMR(qa.fhEMR), fhHaVxyz(qa.fhHaVxyz), fhHaR(qa.fhHaR),
139 fhGamE(qa.fhGamE),fhGamPt(qa.fhGamPt),fhGamPhi(qa.fhGamPhi),fhGamEta(qa.fhGamEta),
140 fhGamDeltaE(qa.fhGamDeltaE), fhGamDeltaPt(qa.fhGamDeltaPt), fhGamDeltaPhi(qa.fhGamDeltaPhi), fhGamDeltaEta(qa.fhGamDeltaEta),
141 fhGamRatioE(qa.fhGamRatioE), fhGamRatioPt(qa.fhGamRatioPt), fhGamRatioPhi(qa.fhGamRatioPhi), fhGamRatioEta(qa.fhGamRatioEta),
142 fhEleE(qa.fhEleE),fhElePt(qa.fhElePt),fhElePhi(qa.fhElePhi),fhEleEta(qa.fhEleEta),
143 fhPi0E(qa.fhPi0E),fhPi0Pt(qa.fhPi0Pt),fhPi0Phi(qa.fhPi0Phi),fhPi0Eta(qa.fhPi0Eta),
144 fhNeHadE(qa.fhNeHadE),fhNeHadPt(qa.fhNeHadPt),fhNeHadPhi(qa.fhNeHadPhi),fhNeHadEta(qa.fhNeHadEta),
145 fhChHadE(qa.fhChHadE),fhChHadPt(qa.fhChHadPt),fhChHadPhi(qa.fhChHadPhi),fhChHadEta(qa.fhChHadEta),
146 fhGamECharged(qa.fhGamECharged),fhGamPtCharged(qa.fhGamPtCharged),fhGamPhiCharged(qa.fhGamPhiCharged),fhGamEtaCharged(qa.fhGamEtaCharged),
147 fhEleECharged(qa.fhEleECharged),fhElePtCharged(qa.fhElePtCharged),fhElePhiCharged(qa.fhElePhiCharged),fhEleEtaCharged(qa.fhEleEtaCharged),
148 fhPi0ECharged(qa.fhPi0ECharged),fhPi0PtCharged(qa.fhPi0PtCharged),fhPi0PhiCharged(qa.fhPi0PhiCharged),fhPi0EtaCharged(qa.fhPi0EtaCharged),
149 fhNeHadECharged(qa.fhNeHadECharged),fhNeHadPtCharged(qa.fhNeHadPtCharged),fhNeHadPhiCharged(qa.fhNeHadPhiCharged),fhNeHadEtaCharged(qa.fhNeHadEtaCharged),
150 fhChHadECharged(qa.fhChHadECharged),fhChHadPtCharged(qa.fhChHadPtCharged),fhChHadPhiCharged(qa.fhChHadPhiCharged),fhChHadEtaCharged(qa.fhChHadEtaCharged),
151 fhGenGamAccE(qa.fhGenGamAccE),fhGenGamAccPt(qa.fhGenGamAccPt),fhGenGamAccEta(qa.fhGenGamAccEta),fhGenGamAccPhi(qa.fhGenGamAccPhi),
152 fhGenPi0AccE(qa.fhGenPi0AccE),fhGenPi0AccPt(qa.fhGenPi0AccPt),fhGenPi0AccEta(qa.fhGenPi0AccEta),fhGenPi0AccPhi(qa.fhGenPi0AccPhi),
153 fh1pOverE(qa.fh1pOverE),fh1dR(qa.fh1dR),fh2EledEdx(qa.fh2EledEdx), fh2MatchdEdx(qa.fh2MatchdEdx),
154 fhMCEle1pOverE(qa.fhMCEle1pOverE),fhMCEle1dR(qa.fhMCEle1dR), fhMCEle2MatchdEdx(qa.fhMCEle2MatchdEdx),
155 fhMCChHad1pOverE(qa.fhMCChHad1pOverE),fhMCChHad1dR(qa.fhMCChHad1dR), fhMCChHad2MatchdEdx(qa.fhMCChHad2MatchdEdx),
156 fhMCNeutral1pOverE(qa.fhMCNeutral1pOverE),fhMCNeutral1dR(qa.fhMCNeutral1dR), fhMCNeutral2MatchdEdx(qa.fhMCNeutral2MatchdEdx),
157 fh1pOverER02(qa.fh1pOverER02), fhMCEle1pOverER02(qa.fhMCEle1pOverER02),fhMCChHad1pOverER02(qa.fhMCChHad1pOverER02), fhMCNeutral1pOverER02(qa.fhMCNeutral1pOverER02)
163 //_________________________________________________________________________
164 AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA & qa)
166 // assignment operator
168 if(this == &qa)return *this;
169 ((AliAnaPartCorrBaseClass *)this)->operator=(qa);
171 fCalorimeter = qa.fCalorimeter;
172 fStyleMacro = qa.fStyleMacro;
173 fMakePlots = qa.fMakePlots;
174 fCorrelateCalos = qa.fCorrelateCalos;
175 fNModules = qa.fNModules;
177 fHistoPOverEBins = qa.fHistoPOverEBins; fHistoPOverEMax = qa.fHistoPOverEMax; fHistoPOverEMin = qa.fHistoPOverEMin;
178 fHistodEdxBins = qa.fHistodEdxBins; fHistodEdxMax = qa.fHistodEdxMax; fHistodEdxMin = qa.fHistodEdxMin;
179 fHistodRBins = qa.fHistodRBins; fHistodRMax = qa.fHistodRMax; fHistodRMin = qa.fHistodRMin;
180 fHistoTimeBins = qa.fHistoTimeBins; fHistoTimeMax = qa.fHistoTimeMax; fHistoTimeMin = qa.fHistoTimeMin;
181 fHistoNBins = qa.fHistoNBins; fHistoNMax = qa.fHistoNMax; fHistoNMin = qa.fHistoNMin;
182 fHistoRatioBins = qa.fHistoRatioBins; fHistoRatioMax = qa.fHistoRatioMax; fHistoRatioMin = qa.fHistoRatioMin;
183 fHistoVertexDistBins = qa.fHistoVertexDistBins; fHistoVertexDistMax = qa.fHistoVertexDistMax; fHistoVertexDistMin = qa.fHistoVertexDistMin;
189 fhEtaPhi = qa.fhEtaPhi;
190 fhEtaPhiE= qa.fhEtaPhiE;
192 fhECharged = qa.fhECharged;
193 fhPtCharged = qa.fhPtCharged;
194 fhPhiCharged = qa.fhPhiCharged;
195 fhEtaCharged = qa.fhEtaCharged;
196 fhEtaPhiCharged = qa.fhEtaPhiCharged;
198 fhEChargedNoOut = qa.fhEChargedNoOut;
199 fhPtChargedNoOut = qa.fhPtChargedNoOut;
200 fhPhiChargedNoOut = qa.fhPhiChargedNoOut;
201 fhEtaChargedNoOut = qa.fhEtaChargedNoOut;
202 fhEtaPhiChargedNoOut = qa.fhEtaPhiChargedNoOut;
204 fhIM = qa.fhIM; fhIMCellCut = qa.fhIMCellCut;
207 fhNCellsPerCluster = qa.fhNCellsPerCluster;
208 fhNCellsPerClusterMIP = qa.fhNCellsPerClusterMIP;
209 fhNClusters = qa.fhNClusters;
211 fhDeltaE = qa.fhDeltaE;
212 fhDeltaPt = qa.fhDeltaPt;
213 fhDeltaPhi = qa.fhDeltaPhi;
214 fhDeltaEta = qa.fhDeltaEta;
216 fhRatioE = qa.fhRatioE;
217 fhRatioPt = qa.fhRatioPt;
218 fhRatioPhi = qa.fhRatioPhi;
219 fhRatioEta = qa.fhRatioEta;
227 fhNCells = qa.fhNCells;
228 fhAmplitude = qa.fhAmplitude;
229 fhAmpId = qa.fhAmpId;
231 fhTimeId = qa.fhTimeId;
232 fhTimeAmp = qa.fhTimeAmp;
234 fhCaloCorrNClusters = qa.fhCaloCorrNClusters; fhCaloCorrEClusters = qa.fhCaloCorrEClusters;
235 fhCaloCorrNCells = qa.fhCaloCorrNCells; fhCaloCorrECells = qa.fhCaloCorrECells;
237 fhEMod = qa.fhEMod; fhNClustersMod = qa.fhNClustersMod;
238 fhNCellsPerClusterMod = qa.fhNCellsPerClusterMod; fhNCellsMod = qa.fhNCellsMod;
239 fhGridCellsMod = qa.fhGridCellsMod; fhGridCellsEMod = qa.fhGridCellsEMod;
240 fhAmplitudeMod = qa.fhAmplitudeMod; fhIMMod=qa.fhIMMod; fhIMCellCutMod=qa.fhIMCellCutMod;
242 fhGenGamPt = qa.fhGenGamPt ; fhGenGamEta = qa.fhGenGamEta ; fhGenGamPhi = qa.fhGenGamPhi ;
243 fhGenPi0Pt = qa.fhGenPi0Pt ; fhGenPi0Eta = qa.fhGenPi0Eta ; fhGenPi0Phi = qa.fhGenPi0Phi ;
244 fhGenEtaPt = qa.fhGenEtaPt ; fhGenEtaEta = qa.fhGenEtaEta ; fhGenEtaPhi = qa.fhGenEtaPhi ;
245 fhGenOmegaPt = qa.fhGenOmegaPt ; fhGenOmegaEta = qa.fhGenOmegaEta ; fhGenOmegaPhi = qa.fhGenOmegaPhi ;
246 fhGenElePt = qa.fhGenElePt ; fhGenEleEta = qa.fhGenEleEta ; fhGenElePhi = qa.fhGenElePhi ;
248 fhEMVxyz = qa.fhEMVxyz ; fhEMR = qa.fhEMR ; fhHaVxyz = qa.fhHaVxyz ; fhHaR = qa.fhHaR ;
249 fhGamE = qa.fhGamE ;fhGamPt = qa.fhGamPt ;fhGamPhi = qa.fhGamPhi ;fhGamEta = qa.fhGamEta ;
250 fhGamDeltaE = qa.fhDeltaE; fhGamDeltaPt = qa.fhDeltaPt; fhGamDeltaPhi = qa.fhDeltaPhi; fhGamDeltaEta = qa.fhDeltaEta;
252 fhGamRatioE = qa.fhGamRatioE; fhGamRatioPt = qa.fhGamRatioPt; fhGamRatioPhi = qa.fhGamRatioPhi; fhGamRatioEta = qa.fhGamRatioEta;
254 fhEleE = qa.fhEleE ;fhElePt = qa.fhElePt ;fhElePhi = qa.fhElePhi ;fhEleEta = qa.fhEleEta ;
255 fhPi0E = qa.fhPi0E ;fhPi0Pt = qa.fhPi0Pt ;fhPi0Phi = qa.fhPi0Phi ;fhPi0Eta = qa.fhPi0Eta ;
256 fhNeHadE = qa.fhNeHadE ;fhNeHadPt = qa.fhNeHadPt ;fhNeHadPhi = qa.fhNeHadPhi ;fhNeHadEta = qa.fhNeHadEta ;
257 fhChHadE = qa.fhChHadE ;fhChHadPt = qa.fhChHadPt ;fhChHadPhi = qa.fhChHadPhi ;fhChHadEta = qa.fhChHadEta ;
258 fhGenGamAccE = qa.fhGenGamAccE ; fhGenPi0AccE = qa.fhGenPi0AccE ;
259 fhGenGamAccPt = qa.fhGenGamAccPt ;fhGenGamAccEta = qa.fhGenGamAccEta ;fhGenGamAccPhi = qa.fhGenGamAccPhi ;
260 fhGenPi0AccPt = qa.fhGenPi0AccPt ;fhGenPi0AccEta = qa.fhGenPi0AccEta; fhGenPi0AccPhi = qa.fhGenPi0AccPhi ;
262 fhGamECharged = qa.fhGamECharged; fhGamPtCharged = qa.fhGamPtCharged; fhGamPhiCharged = qa.fhGamPhiCharged; fhGamEtaCharged = qa.fhGamEtaCharged;
263 fhEleECharged = qa.fhEleECharged; fhElePtCharged = qa.fhElePtCharged; fhElePhiCharged = qa.fhElePhiCharged; fhEleEtaCharged = qa.fhEleEtaCharged;
264 fhPi0ECharged = qa.fhPi0ECharged; fhPi0PtCharged = qa.fhPi0PtCharged; fhPi0PhiCharged = qa.fhPi0PhiCharged; fhPi0EtaCharged = qa.fhPi0EtaCharged;
265 fhNeHadECharged = qa.fhNeHadECharged; fhNeHadPtCharged = qa.fhNeHadPtCharged; fhNeHadPhiCharged = qa.fhNeHadPhiCharged; fhNeHadEtaCharged = qa.fhNeHadEtaCharged;
266 fhChHadECharged = qa.fhChHadECharged; fhChHadPtCharged = qa.fhChHadPtCharged; fhChHadPhiCharged = qa.fhChHadPhiCharged; fhChHadEtaCharged = qa.fhChHadEtaCharged;
268 fh1pOverE = qa.fh1pOverE;
270 fh2MatchdEdx = qa.fh2MatchdEdx;
271 fh2EledEdx = qa.fh2EledEdx;
273 fhMCEle1pOverE = qa.fhMCEle1pOverE;
274 fhMCEle1dR = qa.fhMCEle1dR;
275 fhMCEle2MatchdEdx = qa.fhMCEle2MatchdEdx ;
277 fhMCChHad1pOverE = qa.fhMCChHad1pOverE; fhMCChHad1dR = qa.fhMCChHad1dR; fhMCChHad2MatchdEdx = qa.fhMCChHad2MatchdEdx;
278 fhMCNeutral1pOverE = qa.fhMCNeutral1pOverE; fhMCNeutral1dR = qa.fhMCNeutral1dR; fhMCNeutral2MatchdEdx = qa.fhMCNeutral2MatchdEdx;
279 fh1pOverER02 = qa.fh1pOverER02; fhMCEle1pOverER02 = qa.fhMCEle1pOverER02; fhMCChHad1pOverER02 = qa.fhMCChHad1pOverER02;
280 fhMCNeutral1pOverER02 = qa.fhMCNeutral1pOverER02;
286 //________________________________________________________________________________________________________________________________________________
287 //AliAnaCalorimeterQA::~AliAnaCalorimeterQA() {
293 //________________________________________________________________________
294 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
296 // Create histograms to be saved in output file and
297 // store them in outputContainer
299 //If Geometry library loaded, do geometry selection during analysis.
300 if(fCalorimeter=="PHOS"){
301 if(!GetReader()->GetPHOSGeometry()) printf("AliAnaPi0::GetCreateOutputObjects() - Initialize PHOS geometry!\n");
302 GetReader()->InitPHOSGeometry();
305 else if(fCalorimeter=="EMCAL"){
306 if(!GetReader()->GetEMCALGeometry()) printf("AliAnaPi0::GetCreateOutputObjects() - Initialize EMCAL geometry!\n");
307 GetReader()->InitEMCALGeometry();
311 TList * outputContainer = new TList() ;
312 outputContainer->SetName("QAHistos") ;
315 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
316 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
317 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
318 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
319 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
320 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
321 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
322 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
323 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
324 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
325 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
326 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
332 if(fCalorimeter=="PHOS"){
338 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins,ptmin,ptmax);
339 fhE->SetXTitle("E (GeV)");
340 outputContainer->Add(fhE);
342 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
343 fhPt->SetXTitle("p_{T} (GeV/c)");
344 outputContainer->Add(fhPt);
346 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
347 fhPhi->SetXTitle("#phi (rad)");
348 outputContainer->Add(fhPhi);
350 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
351 fhEta->SetXTitle("#eta ");
352 outputContainer->Add(fhEta);
354 fhEtaPhi = new TH2F ("hEtaPhi","#eta vs #phi, reconstructed clusters ",netabins,etamin,etamax,nphibins,phimin,phimax);
355 fhEtaPhi->SetXTitle("#eta ");
356 fhEtaPhi->SetYTitle("#phi ");
357 outputContainer->Add(fhEtaPhi);
359 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
360 fhEtaPhiE->SetXTitle("#eta ");
361 fhEtaPhiE->SetYTitle("#phi (rad)");
362 fhEtaPhiE->SetZTitle("E (GeV) ");
363 outputContainer->Add(fhEtaPhiE);
367 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
368 fhECharged->SetXTitle("E (GeV)");
369 outputContainer->Add(fhECharged);
371 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
372 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
373 outputContainer->Add(fhPtCharged);
375 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
376 fhPhiCharged->SetXTitle("#phi (rad)");
377 outputContainer->Add(fhPhiCharged);
379 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
380 fhEtaCharged->SetXTitle("#eta ");
381 outputContainer->Add(fhEtaCharged);
383 fhEtaPhiCharged = new TH2F ("hEtaPhiCharged","#eta vs #phi, reconstructed clusters, matched with track",netabins,etamin,etamax,nphibins,phimin,phimax);
384 fhEtaPhiCharged->SetXTitle("#eta ");
385 fhEtaPhiCharged->SetYTitle("#phi ");
386 outputContainer->Add(fhEtaPhiCharged);
388 fhEChargedNoOut = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
389 fhEChargedNoOut->SetXTitle("E (GeV)");
390 outputContainer->Add(fhEChargedNoOut);
392 fhPtChargedNoOut = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
393 fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
394 outputContainer->Add(fhPtChargedNoOut);
396 fhPhiChargedNoOut = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax);
397 fhPhiChargedNoOut->SetXTitle("#phi (rad)");
398 outputContainer->Add(fhPhiChargedNoOut);
400 fhEtaChargedNoOut = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax);
401 fhEtaChargedNoOut->SetXTitle("#eta ");
402 outputContainer->Add(fhEtaChargedNoOut);
404 fhEtaPhiChargedNoOut = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);
405 fhEtaPhiChargedNoOut->SetXTitle("#eta ");
406 fhEtaPhiChargedNoOut->SetYTitle("#phi ");
407 outputContainer->Add(fhEtaPhiChargedNoOut);
409 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
410 fh1pOverE->SetYTitle("p/E");
411 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
412 outputContainer->Add(fh1pOverE);
414 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
415 fh1dR->SetXTitle("#Delta R (rad)");
416 outputContainer->Add(fh1dR) ;
418 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
419 fh2MatchdEdx->SetXTitle("p (GeV/c)");
420 fh2MatchdEdx->SetYTitle("<dE/dx>");
421 outputContainer->Add(fh2MatchdEdx);
423 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
424 fh2EledEdx->SetXTitle("p (GeV/c)");
425 fh2EledEdx->SetYTitle("<dE/dx>");
426 outputContainer->Add(fh2EledEdx) ;
428 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
429 fh1pOverER02->SetYTitle("p/E");
430 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
431 outputContainer->Add(fh1pOverER02);
433 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
434 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
435 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
436 outputContainer->Add(fhIM);
438 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
439 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
440 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
441 outputContainer->Add(fhIMCellCut);
443 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
444 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
445 fhAsym->SetYTitle("Asymmetry");
446 outputContainer->Add(fhAsym);
448 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs cluster energy", nptbins,ptmin,ptmax, nbins,nmin,nmax);
449 fhNCellsPerCluster->SetXTitle("E (GeV)");
450 fhNCellsPerCluster->SetYTitle("n cells");
451 outputContainer->Add(fhNCellsPerCluster);
453 fhNCellsPerClusterMIP = new TH2F ("hNCellsPerClusterMIP","# cells per cluster vs cluster energy, smaller bin for MIP search", 400,0.,2., nbins,nmin,nmax);
454 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
455 fhNCellsPerClusterMIP->SetYTitle("n cells");
456 outputContainer->Add(fhNCellsPerClusterMIP);
458 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
459 fhNClusters->SetXTitle("number of clusters");
460 outputContainer->Add(fhNClusters);
463 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
464 fhNCells->SetXTitle("n cells");
465 outputContainer->Add(fhNCells);
467 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*5,ptmin,ptmax);
468 fhAmplitude->SetXTitle("Cell Energy (GeV)");
469 outputContainer->Add(fhAmplitude);
471 fhAmpId = new TH2F ("hAmpId","Cell Energy", nptbins*2,ptmin,ptmax,rowmax*colmax,0,rowmax*colmax);
472 fhAmpId->SetXTitle("Cell Energy (GeV)");
473 outputContainer->Add(fhAmpId);
475 //Cell Time histograms, time only available in ESDs
476 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
477 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
478 fhTime->SetXTitle("Cell Time (ns)");
479 outputContainer->Add(fhTime);
481 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax,0,rowmax*colmax);
482 fhTimeId->SetXTitle("Cell Time (ns)");
483 fhTimeId->SetYTitle("Cell Absolute Id");
484 outputContainer->Add(fhTimeId);
486 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
487 fhTimeAmp->SetYTitle("Cell Time (ns)");
488 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
489 outputContainer->Add(fhTimeAmp);
493 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
494 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
495 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
496 outputContainer->Add(fhCaloCorrNClusters);
498 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
499 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
500 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
501 outputContainer->Add(fhCaloCorrEClusters);
503 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
504 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
505 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
506 outputContainer->Add(fhCaloCorrNCells);
508 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
509 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
510 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
511 outputContainer->Add(fhCaloCorrECells);
512 }//correlate calorimeters
515 fhEMod = new TH1F*[fNModules];
516 fhNClustersMod = new TH1F*[fNModules];
517 fhNCellsPerClusterMod = new TH2F*[fNModules];
518 fhNCellsMod = new TH1F*[fNModules];
519 fhGridCellsMod = new TH2F*[fNModules];
520 fhGridCellsEMod = new TH2F*[fNModules];
521 fhAmplitudeMod = new TH1F*[fNModules];
522 fhIMMod = new TH2F*[fNModules];
523 fhIMCellCutMod = new TH2F*[fNModules];
525 for(Int_t imod = 0; imod < fNModules; imod++){
527 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
528 fhEMod[imod]->SetXTitle("E (GeV)");
529 outputContainer->Add(fhEMod[imod]);
531 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
532 fhNClustersMod[imod]->SetXTitle("number of clusters");
533 outputContainer->Add(fhNClustersMod[imod]);
535 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
536 Form("# cells per cluster vs cluster energy in Module %d",imod),
537 nptbins,ptmin,ptmax, nbins,nmin,nmax);
538 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
539 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
540 outputContainer->Add(fhNCellsPerClusterMod[imod]);
542 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
543 fhNCellsMod[imod]->SetXTitle("n cells");
544 outputContainer->Add(fhNCellsMod[imod]);
545 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
546 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
547 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
548 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
549 outputContainer->Add(fhGridCellsMod[imod]);
551 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
552 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
553 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
554 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
555 outputContainer->Add(fhGridCellsEMod[imod]);
557 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
558 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
559 outputContainer->Add(fhAmplitudeMod[imod]);
561 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
562 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
563 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
564 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
565 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
566 outputContainer->Add(fhIMMod[imod]);
568 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
569 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
570 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
571 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
572 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
573 outputContainer->Add(fhIMCellCutMod[imod]);
578 //Monte Carlo Histograms
581 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
582 fhDeltaE->SetXTitle("#Delta E (GeV)");
583 outputContainer->Add(fhDeltaE);
585 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
586 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
587 outputContainer->Add(fhDeltaPt);
589 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
590 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
591 outputContainer->Add(fhDeltaPhi);
593 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
594 fhDeltaEta->SetXTitle("#Delta #eta ");
595 outputContainer->Add(fhDeltaEta);
597 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
598 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
599 outputContainer->Add(fhRatioE);
601 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
602 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
603 outputContainer->Add(fhRatioPt);
605 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
606 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
607 outputContainer->Add(fhRatioPhi);
609 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
610 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
611 outputContainer->Add(fhRatioEta);
613 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
614 fh2E->SetXTitle("E_{rec} (GeV)");
615 fh2E->SetYTitle("E_{gen} (GeV)");
616 outputContainer->Add(fh2E);
618 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
619 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
620 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
621 outputContainer->Add(fh2Pt);
623 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
624 fh2Phi->SetXTitle("#phi_{rec} (rad)");
625 fh2Phi->SetYTitle("#phi_{gen} (rad)");
626 outputContainer->Add(fh2Phi);
628 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
629 fh2Eta->SetXTitle("#eta_{rec} ");
630 fh2Eta->SetYTitle("#eta_{gen} ");
631 outputContainer->Add(fh2Eta);
633 //Fill histos depending on origin of cluster
634 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
635 fhGamE->SetXTitle("E_{rec} (GeV)");
636 fhGamE->SetXTitle("E_{gen} (GeV)");
637 outputContainer->Add(fhGamE);
639 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
640 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
641 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
642 outputContainer->Add(fhGamPt);
644 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
645 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
646 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
647 outputContainer->Add(fhGamPhi);
649 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
650 fhGamEta->SetXTitle("#eta_{rec} ");
651 fhGamEta->SetYTitle("#eta_{gen} ");
652 outputContainer->Add(fhGamEta);
654 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
655 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
656 outputContainer->Add(fhGamDeltaE);
658 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
659 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
660 outputContainer->Add(fhGamDeltaPt);
662 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
663 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
664 outputContainer->Add(fhGamDeltaPhi);
666 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
667 fhGamDeltaEta->SetXTitle("#Delta #eta ");
668 outputContainer->Add(fhGamDeltaEta);
670 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
671 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
672 outputContainer->Add(fhGamRatioE);
674 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
675 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
676 outputContainer->Add(fhGamRatioPt);
678 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
679 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
680 outputContainer->Add(fhGamRatioPhi);
682 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
683 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
684 outputContainer->Add(fhGamRatioEta);
686 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
687 fhPi0E->SetXTitle("E_{rec} (GeV)");
688 fhPi0E->SetYTitle("E_{gen} (GeV)");
689 outputContainer->Add(fhPi0E);
691 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
692 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
693 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
694 outputContainer->Add(fhPi0Pt);
696 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
697 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
698 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
699 outputContainer->Add(fhPi0Phi);
701 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
702 fhPi0Eta->SetXTitle("#eta_{rec} ");
703 fhPi0Eta->SetYTitle("#eta_{gen} ");
704 outputContainer->Add(fhPi0Eta);
706 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
707 fhEleE->SetXTitle("E_{rec} (GeV)");
708 fhEleE->SetXTitle("E_{gen} (GeV)");
709 outputContainer->Add(fhEleE);
711 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
712 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
713 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
714 outputContainer->Add(fhElePt);
716 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
717 fhElePhi->SetXTitle("#phi_{rec} (rad)");
718 fhElePhi->SetYTitle("#phi_{gen} (rad)");
719 outputContainer->Add(fhElePhi);
721 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
722 fhEleEta->SetXTitle("#eta_{rec} ");
723 fhEleEta->SetYTitle("#eta_{gen} ");
724 outputContainer->Add(fhEleEta);
726 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
727 fhNeHadE->SetXTitle("E_{rec} (GeV)");
728 fhNeHadE->SetYTitle("E_{gen} (GeV)");
729 outputContainer->Add(fhNeHadE);
731 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
732 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
733 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
734 outputContainer->Add(fhNeHadPt);
736 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
737 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
738 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
739 outputContainer->Add(fhNeHadPhi);
741 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
742 fhNeHadEta->SetXTitle("#eta_{rec} ");
743 fhNeHadEta->SetYTitle("#eta_{gen} ");
744 outputContainer->Add(fhNeHadEta);
746 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
747 fhChHadE->SetXTitle("E_{rec} (GeV)");
748 fhChHadE->SetYTitle("E_{gen} (GeV)");
749 outputContainer->Add(fhChHadE);
751 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
752 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
753 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
754 outputContainer->Add(fhChHadPt);
756 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
757 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
758 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
759 outputContainer->Add(fhChHadPhi);
761 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
762 fhChHadEta->SetXTitle("#eta_{rec} ");
763 fhChHadEta->SetYTitle("#eta_{gen} ");
764 outputContainer->Add(fhChHadEta);
768 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
769 fhGamECharged->SetXTitle("E_{rec} (GeV)");
770 fhGamECharged->SetXTitle("E_{gen} (GeV)");
771 outputContainer->Add(fhGamECharged);
773 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
774 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
775 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
776 outputContainer->Add(fhGamPtCharged);
778 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
779 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
780 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
781 outputContainer->Add(fhGamPhiCharged);
783 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
784 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
785 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
786 outputContainer->Add(fhGamEtaCharged);
788 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
789 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
790 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
791 outputContainer->Add(fhPi0ECharged);
793 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
794 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
795 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
796 outputContainer->Add(fhPi0PtCharged);
798 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
799 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
800 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
801 outputContainer->Add(fhPi0PhiCharged);
803 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
804 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
805 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
806 outputContainer->Add(fhPi0EtaCharged);
808 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
809 fhEleECharged->SetXTitle("E_{rec} (GeV)");
810 fhEleECharged->SetXTitle("E_{gen} (GeV)");
811 outputContainer->Add(fhEleECharged);
813 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
814 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
815 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
816 outputContainer->Add(fhElePtCharged);
818 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
819 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
820 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
821 outputContainer->Add(fhElePhiCharged);
823 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
824 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
825 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
826 outputContainer->Add(fhEleEtaCharged);
828 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
829 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
830 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
831 outputContainer->Add(fhNeHadECharged);
833 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
834 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
835 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
836 outputContainer->Add(fhNeHadPtCharged);
838 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
839 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
840 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
841 outputContainer->Add(fhNeHadPhiCharged);
843 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
844 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
845 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
846 outputContainer->Add(fhNeHadEtaCharged);
848 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
849 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
850 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
851 outputContainer->Add(fhChHadECharged);
853 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
854 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
855 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
856 outputContainer->Add(fhChHadPtCharged);
858 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
859 fhChHadPhiCharged->SetXTitle("#phi (rad)");
860 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
861 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
862 outputContainer->Add(fhChHadPhiCharged);
864 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
865 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
866 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
867 outputContainer->Add(fhChHadEtaCharged);
869 //Vertex of generated particles
871 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
872 fhEMVxyz->SetXTitle("v_{x}");
873 fhEMVxyz->SetYTitle("v_{y}");
874 //fhEMVxyz->SetZTitle("v_{z}");
875 outputContainer->Add(fhEMVxyz);
877 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
878 fhHaVxyz->SetXTitle("v_{x}");
879 fhHaVxyz->SetYTitle("v_{y}");
880 //fhHaVxyz->SetZTitle("v_{z}");
881 outputContainer->Add(fhHaVxyz);
883 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
884 fhEMR->SetXTitle("E (GeV)");
885 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
886 outputContainer->Add(fhEMR);
888 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
889 fhHaR->SetXTitle("E (GeV)");
890 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
891 outputContainer->Add(fhHaR);
896 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
897 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
898 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
900 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
901 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
902 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
904 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
905 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
906 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
908 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
909 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
910 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
912 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
913 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
914 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
916 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
917 fhGenGamEta->SetXTitle("#eta");
918 fhGenGamPhi->SetXTitle("#phi (rad)");
919 outputContainer->Add(fhGenGamPt);
920 outputContainer->Add(fhGenGamEta);
921 outputContainer->Add(fhGenGamPhi);
923 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
924 fhGenPi0Eta->SetXTitle("#eta");
925 fhGenPi0Phi->SetXTitle("#phi (rad)");
926 outputContainer->Add(fhGenPi0Pt);
927 outputContainer->Add(fhGenPi0Eta);
928 outputContainer->Add(fhGenPi0Phi);
930 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
931 fhGenEtaEta->SetXTitle("#eta");
932 fhGenEtaPhi->SetXTitle("#phi (rad)");
933 outputContainer->Add(fhGenEtaPt);
934 outputContainer->Add(fhGenEtaEta);
935 outputContainer->Add(fhGenEtaPhi);
937 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
938 fhGenOmegaEta->SetXTitle("#eta");
939 fhGenOmegaPhi->SetXTitle("#phi (rad)");
940 outputContainer->Add(fhGenOmegaPt);
941 outputContainer->Add(fhGenOmegaEta);
942 outputContainer->Add(fhGenOmegaPhi);
944 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
945 fhGenEleEta->SetXTitle("#eta");
946 fhGenElePhi->SetXTitle("#phi (rad)");
947 outputContainer->Add(fhGenElePt);
948 outputContainer->Add(fhGenEleEta);
949 outputContainer->Add(fhGenElePhi);
951 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
952 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
953 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
954 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
956 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
957 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
958 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
959 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
961 fhGenGamAccE ->SetXTitle("E (GeV)");
962 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
963 fhGenGamAccEta->SetXTitle("#eta");
964 fhGenGamAccPhi->SetXTitle("#phi (rad)");
965 outputContainer->Add(fhGenGamAccE);
966 outputContainer->Add(fhGenGamAccPt);
967 outputContainer->Add(fhGenGamAccEta);
968 outputContainer->Add(fhGenGamAccPhi);
970 fhGenPi0AccE ->SetXTitle("E (GeV)");
971 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
972 fhGenPi0AccEta->SetXTitle("#eta");
973 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
974 outputContainer->Add(fhGenPi0AccE);
975 outputContainer->Add(fhGenPi0AccPt);
976 outputContainer->Add(fhGenPi0AccEta);
977 outputContainer->Add(fhGenPi0AccPhi);
981 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
982 fhMCEle1pOverE->SetYTitle("p/E");
983 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
984 outputContainer->Add(fhMCEle1pOverE);
986 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
987 fhMCEle1dR->SetXTitle("#Delta R (rad)");
988 outputContainer->Add(fhMCEle1dR) ;
990 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
991 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
992 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
993 outputContainer->Add(fhMCEle2MatchdEdx);
995 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
996 fhMCChHad1pOverE->SetYTitle("p/E");
997 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
998 outputContainer->Add(fhMCChHad1pOverE);
1000 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1001 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1002 outputContainer->Add(fhMCChHad1dR) ;
1004 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1005 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1006 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1007 outputContainer->Add(fhMCChHad2MatchdEdx);
1009 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1010 fhMCNeutral1pOverE->SetYTitle("p/E");
1011 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1012 outputContainer->Add(fhMCNeutral1pOverE);
1014 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1015 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1016 outputContainer->Add(fhMCNeutral1dR) ;
1018 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1019 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1020 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1021 outputContainer->Add(fhMCNeutral2MatchdEdx);
1023 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1024 fhMCEle1pOverER02->SetYTitle("p/E");
1025 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1026 outputContainer->Add(fhMCEle1pOverER02);
1028 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1029 fhMCChHad1pOverER02->SetYTitle("p/E");
1030 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1031 outputContainer->Add(fhMCChHad1pOverER02);
1033 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1034 fhMCNeutral1pOverER02->SetYTitle("p/E");
1035 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1036 outputContainer->Add(fhMCNeutral1pOverER02);
1039 return outputContainer;
1042 //____________________________________________________________________________________________________________________________________________________
1043 Int_t AliAnaCalorimeterQA::GetModuleNumber(AliESDCaloCluster * cluster)
1045 //Get the EMCAL/PHOS module number that corresponds to this cluster
1047 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
1048 cluster->GetMomentum(lv,v);
1049 Float_t phi = lv.Phi();
1050 if(phi < 0) phi+=TMath::TwoPi();
1052 if(fCalorimeter=="EMCAL"){
1053 GetReader()->GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
1055 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
1056 lv.Eta(), phi*TMath::RadToDeg(),absId, GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId));
1057 return GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId) ;
1061 if ( cluster->GetNCells() > 0) {
1062 absId = cluster->GetCellAbsId(0);
1064 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
1065 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
1070 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1072 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - PHOS: Module %d\n",relId[0]-1);
1081 //____________________________________________________________________________________________________________________________________________________
1082 Int_t AliAnaCalorimeterQA::GetModuleNumber(AliAODCaloCluster * cluster)
1084 //Get the EMCAL/PHOS module number that corresponds to this cluster
1086 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
1087 cluster->GetMomentum(lv,v);
1088 Float_t phi = lv.Phi();
1089 if(phi < 0) phi+=TMath::TwoPi();
1091 if(fCalorimeter=="EMCAL"){
1092 GetReader()->GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
1094 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
1095 lv.Eta(), phi*TMath::RadToDeg(),absId, GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId));
1096 return GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId) ;
1100 if ( cluster->GetNCells() > 0) {
1101 absId = cluster->GetCellAbsId(0);
1103 printf("AliAnaCalorimeterQA::GetModuleNumber(AOD) - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
1104 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
1109 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1111 printf("AliAnaCalorimeterQA::GetModuleNumber(AOD) - PHOS: Module %d\n",relId[0]-1);
1119 //____________________________________________________________________________________________________________________________________________________
1120 Int_t AliAnaCalorimeterQA::GetModuleNumberCellIndexes(const Int_t absId, Int_t & icol, Int_t & irow)
1122 //Get the EMCAL/PHOS module number that corresponds to this absId
1125 if(fCalorimeter=="EMCAL"){
1126 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1127 GetReader()->GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1128 GetReader()->GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1129 iIphi, iIeta,irow,icol);
1134 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1146 //__________________________________________________
1147 void AliAnaCalorimeterQA::Init()
1149 //Check if the data or settings are ok
1150 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1151 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1155 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1156 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1163 //__________________________________________________
1164 void AliAnaCalorimeterQA::InitParameters()
1166 //Initialize the parameters of the analysis.
1167 AddToHistogramsName("AnaCaloQA_");
1169 fCalorimeter = "EMCAL"; //or PHOS
1171 fNModules = 12; // set maximum to maximum number of EMCAL modules
1173 fHistoPOverEBins = 100 ; fHistoPOverEMax = 10. ; fHistoPOverEMin = 0. ;
1174 fHistodEdxBins = 200 ; fHistodEdxMax = 400. ; fHistodEdxMin = 0. ;
1175 fHistodRBins = 300 ; fHistodRMax = 3.15 ; fHistodRMin = 0. ;
1176 fHistoTimeBins = 1000; fHistoTimeMax = 1.e3 ; fHistoTimeMin = 0. ;//ns
1177 fHistoNBins = 300 ; fHistoNMax = 300 ; fHistoNMin = 0 ;
1178 fHistoRatioBins = 200 ; fHistoRatioMax = 2 ; fHistoRatioMin = 0. ;
1179 fHistoVertexDistBins = 100 ; fHistoVertexDistMax = 500. ; fHistoVertexDistMin = 0. ;
1184 //__________________________________________________________________
1185 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1187 //Print some relevant parameters set for the analysis
1191 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1192 AliAnaPartCorrBaseClass::Print(" ");
1194 printf("Select Calorimeter %s \n",fCalorimeter.Data());
1195 printf("Make plots? %d \n",fMakePlots);
1196 printf("Plots style macro %s \n",fStyleMacro.Data());
1197 printf("Histograms: %3.1f < p/E < %3.1f, Nbin = %d\n", fHistoPOverEMin, fHistoPOverEMax, fHistoPOverEBins);
1198 printf("Histograms: %3.1f < dEdx < %3.1f, Nbin = %d\n", fHistodEdxMin, fHistodEdxMax, fHistodEdxBins);
1199 printf("Histograms: %3.1f < dR < %3.1f, Nbin = %d\n", fHistodRMin, fHistodRMax, fHistodRBins);
1200 printf("Histograms: %g < Time < %g, Nbin = %d\n" , fHistoTimeMin, fHistoTimeMax, fHistoTimeBins);
1201 printf("Histograms: %d < N < %d, Nbin = %d\n" , fHistoNMin, fHistoNMax, fHistoNBins);
1202 printf("Histograms: %3.1f < Ratio< %3.1f, Nbin = %d\n", fHistoRatioMin, fHistoRatioMax, fHistoRatioBins);
1203 printf("Histograms: %3.1f < Vertex Distance < %3.1f, Nbin = %d\n", fHistoVertexDistMin, fHistoVertexDistMax, fHistoVertexDistBins);
1207 //__________________________________________________________________
1208 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1210 //Fill Calorimeter QA histograms
1212 TLorentzVector mom ;
1213 TLorentzVector mom2 ;
1214 TRefArray * caloClusters = new TRefArray();
1217 Int_t nCaloClusters = 0;
1218 Int_t nCaloCellsPerCluster = 0;
1219 Int_t nTracksMatched = 0;
1220 Int_t trackIndex = 0;
1223 //Play with the MC stack if available
1224 //Get the MC arrays and do some checks
1226 if(GetReader()->ReadStack()){
1229 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1232 //Fill some pure MC histograms, only primaries.
1233 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1234 TParticle *primary = GetMCStack()->Particle(i) ;
1235 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1236 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1237 primary->Momentum(mom);
1238 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1241 else if(GetReader()->ReadAODMCParticles()){
1243 if(!GetReader()->GetAODMCParticles(0)) {
1244 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1247 //Fill some pure MC histograms, only primaries.
1248 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1249 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1250 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1251 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1252 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1253 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1254 //aodprimary->Momentum(mom);
1255 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1256 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1263 //Get List with CaloClusters
1265 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1266 if (fCalorimeter == "EMCAL") ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1267 else if(fCalorimeter == "PHOS") ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1269 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1273 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1274 if (fCalorimeter == "EMCAL") ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1275 else if(fCalorimeter == "PHOS") ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1277 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1283 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n");
1287 //Correlate Calorimeters
1288 if(fCorrelateCalos) CorrelateCalorimeters(caloClusters);
1290 nCaloClusters = caloClusters->GetEntriesFast() ;
1291 fhNClusters->Fill(nCaloClusters);
1292 Int_t *nClustersInModule = new Int_t[fNModules];
1293 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1296 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1298 //Get vertex for photon momentum calculation
1299 Double_t v[3] ; //vertex ;
1300 GetReader()->GetVertex(v);
1301 TObject * track = 0x0;
1302 //Loop over CaloClusters
1303 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1305 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1306 iclus+1,nCaloClusters,GetReader()->GetDataType());
1308 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1309 AliESDCaloCluster* clus = (AliESDCaloCluster*) (caloClusters->At(iclus));
1310 //Get cluster kinematics
1311 clus->GetMomentum(mom,v);
1312 //Check only certain regions
1314 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1316 //Get module of cluster
1317 nModule = GetModuleNumber(clus);
1318 if(nModule < fNModules) nClustersInModule[nModule]++;
1320 nLabel = clus->GetNLabels();
1321 if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray();
1323 nCaloCellsPerCluster = clus->GetNCells();
1324 //matched cluster with tracks
1325 nTracksMatched = clus->GetNTracksMatched();
1326 trackIndex = clus->GetTrackMatched();
1327 if(trackIndex >= 0){
1328 track = (AliESDtrack*) ((AliESDEvent*)GetReader()->GetInputEvent())->GetTrack(trackIndex);
1331 if(nTracksMatched == 1) nTracksMatched = 0;
1336 AliAODCaloCluster* clus = (AliAODCaloCluster*) (caloClusters->At(iclus));
1338 //Get cluster kinematics
1339 clus->GetMomentum(mom,v);
1340 //Check only certain regions
1342 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1344 //Get module of cluster
1345 nModule = GetModuleNumber(clus);
1346 if(nModule < fNModules) nClustersInModule[nModule]++;
1348 nLabel = clus->GetNLabel();
1349 if(clus->GetLabels()) labels = clus->GetLabels();
1351 nCaloCellsPerCluster = clus->GetNCells();
1352 //matched cluster with tracks
1353 nTracksMatched = clus->GetNTracksMatched();
1354 if(nTracksMatched > 0)
1355 track = (AliAODTrack*)clus->GetTrackMatched(0);
1358 //Fill histograms related to single cluster or track matching
1359 ClusterHistograms(mom, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1360 if(GetDebug()>1) printf("Invariant mass \n");
1362 Int_t nModule2 = -1;
1363 Int_t nCaloCellsPerCluster2=0;
1364 if (nCaloClusters > 1 ) {
1365 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters-1 ; jclus++) {
1366 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1367 AliESDCaloCluster* clus2 = (AliESDCaloCluster*) (caloClusters->At(jclus));
1368 //Get cluster kinematics
1369 clus2->GetMomentum(mom2,v);
1370 //Check only certain regions
1372 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1374 //Get module of cluster
1375 nModule2 = GetModuleNumber(clus2);
1377 nCaloCellsPerCluster2 = clus2->GetNCells();
1380 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD){
1381 AliAODCaloCluster* clus2 = (AliAODCaloCluster*) (caloClusters->At(jclus));
1382 //Get cluster kinematics
1383 clus2->GetMomentum(mom2,v);
1384 //Check only certain regions
1386 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1388 //Get module of cluster
1389 nModule2 = GetModuleNumber(clus2);
1391 nCaloCellsPerCluster2 = clus2->GetNCells();
1394 //Fill invariant mass histograms
1396 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1398 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1399 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1401 //Select only clusters with at least 2 cells
1402 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1404 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1406 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1407 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1410 //Asymetry histograms
1411 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1413 }// 2nd cluster loop
1414 }////more than 1 cluster in calorimeter
1417 //Number of clusters per module
1418 for(Int_t imod = 0; imod < fNModules; imod++ ){
1420 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1421 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1425 Int_t *nCellsInModule = new Int_t[fNModules];
1426 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1432 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1433 AliESDCaloCells * cell = 0x0;
1435 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1436 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1439 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No CELLS available for analysis");
1443 ncells = cell->GetNumberOfCells() ;
1444 fhNCells->Fill(ncells) ;
1446 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1448 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1449 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1450 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell), icol, irow);
1451 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1453 if(nModule < fNModules) {
1454 amp = cell->GetAmplitude(iCell);
1455 time = cell->GetTime(iCell)*1e9;//transform time to ns
1456 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1457 id = cell->GetCellNumber(iCell);
1458 fhAmplitude->Fill(amp);
1459 fhAmpId ->Fill(amp,id);
1460 fhTime ->Fill(time);
1461 fhTimeId ->Fill(time,id);
1462 fhTimeAmp ->Fill(amp,time);
1463 fhAmplitudeMod[nModule]->Fill(cell->GetAmplitude(iCell));
1464 nCellsInModule[nModule]++;
1465 fhGridCellsMod[nModule] ->Fill(icol,irow);
1466 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
1471 AliAODCaloCells * cell = 0x0;
1474 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1475 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1478 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No CELLS available for analysis");
1482 ncells = cell->GetNumberOfCells() ;
1483 fhNCells->Fill(ncells) ;
1485 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1487 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1488 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1489 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell), icol, irow);
1490 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1492 if(nModule < fNModules) {
1493 amp = cell->GetAmplitude(iCell);
1494 fhAmplitude->Fill(amp);
1495 fhAmpId ->Fill(amp,id);
1496 fhAmplitudeMod[nModule]->Fill(cell->GetAmplitude(iCell));
1497 nCellsInModule[nModule]++;
1498 fhGridCellsMod[nModule]->Fill(icol,irow);
1499 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
1504 //Number of cells per module
1505 for(Int_t imod = 0; imod < fNModules; imod++ ) {
1507 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
1508 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
1512 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1516 //__________________________________
1517 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Int_t nCaloCellsPerCluster,const Int_t nModule,
1518 const Int_t nTracksMatched, const TObject * track,
1519 const Int_t * labels, const Int_t nLabels){
1520 //Fill CaloCluster related histograms
1522 AliAODMCParticle * aodprimary = 0x0;
1523 TParticle * primary = 0x0;
1526 Float_t e = mom.E();
1527 Float_t pt = mom.Pt();
1528 Float_t eta = mom.Eta();
1529 Float_t phi = mom.Phi();
1530 if(phi < 0) phi +=TMath::TwoPi();
1531 if(GetDebug() > 0) {
1532 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
1534 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
1535 printf("\t Primaries: nlabels %d\n",nLabels);
1536 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
1541 if(nModule < fNModules) fhEMod[nModule]->Fill(e);
1545 fhEtaPhi->Fill(eta,phi);
1546 fhEtaPhiE->Fill(eta,phi,e);
1548 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster);
1549 fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster);
1550 if(nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
1552 //Fill histograms only possible when simulation
1553 if(IsDataMC() && nLabels > 0 && labels){
1555 //Play with the MC stack if available
1556 Int_t label = labels[0];
1559 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
1563 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1564 Float_t vxMC= 0; Float_t vyMC = 0;
1565 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1569 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
1571 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
1573 if( label >= GetMCStack()->GetNtrack()) {
1574 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1578 primary = GetMCStack()->Particle(label);
1580 pdg0 = TMath::Abs(primary->GetPdgCode());
1582 status = primary->GetStatusCode();
1583 vxMC = primary->Vx();
1584 vyMC = primary->Vy();
1585 iParent = primary->GetFirstMother();
1587 if(GetDebug() > 1 ) {
1588 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1589 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1592 //Get final particle, no conversion products
1593 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1595 primary = GetMCStack()->Particle(iParent);
1596 pdg = TMath::Abs(primary->GetPdgCode());
1597 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1598 while((pdg == 22 || pdg == 11) && status != 1){
1600 primary = GetMCStack()->Particle(iMother);
1601 status = primary->GetStatusCode();
1602 iParent = primary->GetFirstMother();
1603 pdg = TMath::Abs(primary->GetPdgCode());
1604 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1607 if(GetDebug() > 1 ) {
1608 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1609 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1614 //Overlapped pi0 (or eta, there will be very few), get the meson
1615 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1616 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1617 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1618 while(pdg != 111 && pdg != 221){
1620 primary = GetMCStack()->Particle(iMother);
1621 status = primary->GetStatusCode();
1622 iParent = primary->GetFirstMother();
1623 pdg = TMath::Abs(primary->GetPdgCode());
1624 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1626 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1631 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1632 primary->GetName(),iMother);
1635 eMC = primary->Energy();
1636 ptMC = primary->Pt();
1637 phiMC = primary->Phi();
1638 etaMC = primary->Eta();
1639 pdg = TMath::Abs(primary->GetPdgCode());
1640 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1643 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
1644 //Get the list of MC particles
1645 if(!GetReader()->GetAODMCParticles(0)) {
1646 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
1650 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
1652 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1654 status = aodprimary->IsPrimary();
1655 vxMC = aodprimary->Xv();
1656 vyMC = aodprimary->Yv();
1657 iParent = aodprimary->GetMother();
1659 if(GetDebug() > 1 ) {
1660 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1661 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
1662 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
1665 //Get final particle, no conversion products
1666 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1668 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1670 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
1671 pdg = TMath::Abs(aodprimary->GetPdgCode());
1672 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
1674 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1675 status = aodprimary->IsPrimary();
1676 iParent = aodprimary->GetMother();
1677 pdg = TMath::Abs(aodprimary->GetPdgCode());
1679 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
1680 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1683 if(GetDebug() > 1 ) {
1684 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1685 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
1686 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1691 //Overlapped pi0 (or eta, there will be very few), get the meson
1692 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1693 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1694 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1695 while(pdg != 111 && pdg != 221){
1698 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1699 status = aodprimary->IsPrimary();
1700 iParent = aodprimary->GetMother();
1701 pdg = TMath::Abs(aodprimary->GetPdgCode());
1703 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1706 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1711 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1712 aodprimary->GetName(),iMother);
1715 status = aodprimary->IsPrimary();
1716 eMC = aodprimary->E();
1717 ptMC = aodprimary->Pt();
1718 phiMC = aodprimary->Phi();
1719 etaMC = aodprimary->Eta();
1720 pdg = TMath::Abs(aodprimary->GetPdgCode());
1721 charge = aodprimary->Charge();
1725 //Float_t vz = primary->Vz();
1726 Float_t r = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1727 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
1728 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1732 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1733 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1734 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1737 fh2E ->Fill(e, eMC);
1738 fh2Pt ->Fill(pt, ptMC);
1739 fh2Phi ->Fill(phi, phiMC);
1740 fh2Eta ->Fill(eta, etaMC);
1741 fhDeltaE ->Fill(eMC-e);
1742 fhDeltaPt ->Fill(ptMC-pt);
1743 fhDeltaPhi->Fill(phiMC-phi);
1744 fhDeltaEta->Fill(etaMC-eta);
1745 if(eMC > 0) fhRatioE ->Fill(e/eMC);
1746 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
1747 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
1748 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
1751 //Overlapped pi0 (or eta, there will be very few)
1752 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1753 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1754 //cout<<"Fill pi0"<< "E "<< e <<" prim E "<<eMC<<endl;
1755 fhPi0E ->Fill(e,eMC);
1756 fhPi0Pt ->Fill(pt,ptMC);
1757 fhPi0Eta ->Fill(eta,etaMC);
1758 fhPi0Phi ->Fill(phi,phiMC);
1759 if( nTracksMatched > 0){
1760 fhPi0ECharged ->Fill(e,eMC);
1761 fhPi0PtCharged ->Fill(pt,ptMC);
1762 fhPi0PhiCharged ->Fill(phi,phiMC);
1763 fhPi0EtaCharged ->Fill(eta,etaMC);
1765 }//Overlapped pizero decay
1766 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
1767 fhGamE ->Fill(e,eMC);
1768 fhGamPt ->Fill(pt,ptMC);
1769 fhGamEta ->Fill(eta,etaMC);
1770 fhGamPhi ->Fill(phi,phiMC);
1771 fhGamDeltaE ->Fill(eMC-e);
1772 fhGamDeltaPt ->Fill(ptMC-pt);
1773 fhGamDeltaPhi->Fill(phiMC-phi);
1774 fhGamDeltaEta->Fill(etaMC-eta);
1775 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
1776 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
1777 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
1778 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
1779 if( nTracksMatched > 0){
1780 fhGamECharged ->Fill(e,eMC);
1781 fhGamPtCharged ->Fill(pt,ptMC);
1782 fhGamPhiCharged ->Fill(phi,phiMC);
1783 fhGamEtaCharged ->Fill(eta,etaMC);
1786 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
1787 fhEleE ->Fill(e,eMC);
1788 fhElePt ->Fill(pt,ptMC);
1789 fhEleEta ->Fill(eta,etaMC);
1790 fhElePhi ->Fill(phi,phiMC);
1791 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1793 if( nTracksMatched > 0){
1794 fhEleECharged ->Fill(e,eMC);
1795 fhElePtCharged ->Fill(pt,ptMC);
1796 fhElePhiCharged ->Fill(phi,phiMC);
1797 fhEleEtaCharged ->Fill(eta,etaMC);
1800 else if(charge == 0){
1801 fhNeHadE ->Fill(e,eMC);
1802 fhNeHadPt ->Fill(pt,ptMC);
1803 fhNeHadEta ->Fill(eta,etaMC);
1804 fhNeHadPhi ->Fill(phi,phiMC);
1805 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1807 if( nTracksMatched > 0){
1808 fhNeHadECharged ->Fill(e,eMC);
1809 fhNeHadPtCharged ->Fill(pt,ptMC);
1810 fhNeHadPhiCharged ->Fill(phi,phiMC);
1811 fhNeHadEtaCharged ->Fill(eta,etaMC);
1815 fhChHadE ->Fill(e,eMC);
1816 fhChHadPt ->Fill(pt,ptMC);
1817 fhChHadEta ->Fill(eta,etaMC);
1818 fhChHadPhi ->Fill(phi,phiMC);
1819 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1821 if( nTracksMatched > 0){
1822 fhChHadECharged ->Fill(e,eMC);
1823 fhChHadPtCharged ->Fill(pt,ptMC);
1824 fhChHadPhiCharged ->Fill(phi,phiMC);
1825 fhChHadEtaCharged ->Fill(eta,etaMC);
1831 //Match tracks and clusters
1832 //To be Modified in case of AODs
1834 //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
1836 if( nTracksMatched > 0){
1837 fhECharged ->Fill(e);
1838 fhPtCharged ->Fill(pt);
1839 fhPhiCharged ->Fill(phi);
1840 fhEtaCharged ->Fill(eta);
1841 fhEtaPhiCharged->Fill(eta,phi);
1843 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
1844 //Study the track and matched cluster if track exists.
1846 Double_t emcpos[3] = {0.,0.,0.};
1847 Double_t emcmom[3] = {0.,0.,0.};
1848 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
1849 Double_t bfield = 0.;
1855 Double_t tpcSignal = 0;
1856 Bool_t okpos = kFALSE;
1857 Bool_t okmom = kFALSE;
1858 Bool_t okout = kFALSE;
1862 //In case of ESDs get the parameters in this way
1863 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1864 if (((AliESDtrack*)track)->GetOuterParam() ) {
1867 bfield = ((AliESDEvent*)GetReader()->GetInputEvent())->GetMagneticField();
1868 okpos = ((AliESDtrack*)track)->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
1869 okmom = ((AliESDtrack*)track)->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
1870 if(!(okpos && okmom)) return;
1872 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
1873 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
1874 tphi = position.Phi();
1875 teta = position.Eta();
1876 tmom = momentum.Mag();
1878 //Double_t tphi = ((AliESDtrack*)track)->GetOuterParam()->Phi();
1879 //Double_t teta = ((AliESDtrack*)track)->GetOuterParam()->Eta();
1880 //Double_t tmom = ((AliESDtrack*)track)->GetOuterParam()->P();
1881 tpt = ((AliESDtrack*)track)->Pt();
1882 tmom2 = ((AliESDtrack*)track)->P();
1883 tpcSignal = ((AliESDtrack*)track)->GetTPCsignal();
1885 nITS = ((AliESDtrack*)track)->GetNcls(0);
1886 nTPC = ((AliESDtrack*)track)->GetNcls(1);
1887 }//Outer param available
1889 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1890 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
1893 pid->GetEMCALPosition(emcpos);
1894 pid->GetEMCALMomentum(emcmom);
1896 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
1897 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
1898 tphi = position.Phi();
1899 teta = position.Eta();
1900 tmom = momentum.Mag();
1902 tpt = ((AliAODTrack*)track)->Pt();
1903 tmom2 = ((AliAODTrack*)track)->P();
1904 tpcSignal = pid->GetTPCsignal();
1906 //nITS = ((AliAODTrack*)track)->GetNcls(0);
1907 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
1908 }//Outer param available
1910 else return; //Do nothing case not implemented.
1913 Double_t deta = teta - eta;
1914 Double_t dphi = tphi - phi;
1915 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
1916 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
1917 Double_t dR = sqrt(dphi*dphi + deta*deta);
1919 Double_t pOverE = tmom/e;
1921 fh1pOverE->Fill(tpt, pOverE);
1922 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
1925 fh2MatchdEdx->Fill(tmom2,tpcSignal);
1927 if(IsDataMC() && primary){
1928 Int_t pdg = primary->GetPdgCode();
1929 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1931 if(TMath::Abs(pdg) == 11){
1932 fhMCEle1pOverE->Fill(tpt,pOverE);
1933 fhMCEle1dR->Fill(dR);
1934 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
1935 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
1938 fhMCChHad1pOverE->Fill(tpt,pOverE);
1939 fhMCChHad1dR->Fill(dR);
1940 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
1941 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
1943 else if(charge == 0){
1944 fhMCNeutral1pOverE->Fill(tpt,pOverE);
1945 fhMCNeutral1dR->Fill(dR);
1946 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
1947 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
1951 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
1952 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
1953 fh2EledEdx->Fill(tmom2,tpcSignal);
1956 else{//no ESD external param or AODPid
1957 ULong_t status=AliESDtrack::kTPCrefit;
1958 status|=AliESDtrack::kITSrefit;
1959 //printf("track status %d\n", track->GetStatus() );
1960 fhEChargedNoOut ->Fill(e);
1961 fhPtChargedNoOut ->Fill(pt);
1962 fhPhiChargedNoOut ->Fill(phi);
1963 fhEtaChargedNoOut ->Fill(eta);
1964 fhEtaPhiChargedNoOut ->Fill(eta,phi);
1965 if(GetDebug() >= 0 && ((((AliESDtrack*)track)->GetStatus() & status) == status)) printf("ITS+TPC\n");
1967 }//matched clusters with tracks
1971 //__________________________________
1972 void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
1973 // Correlate information from PHOS and EMCAL
1974 TRefArray * caloClustersEMCAL = new TRefArray;
1975 TRefArray * caloClustersPHOS = new TRefArray;
1977 // Get once the array of clusters per calorimeter, avoid an extra loop.
1978 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1979 if(fCalorimeter == "EMCAL"){
1980 ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
1981 caloClustersEMCAL = refArray;
1983 else if(fCalorimeter == "PHOS") {
1984 ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
1985 caloClustersEMCAL = refArray;
1988 //Fill histograms with clusters
1990 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
1991 Float_t sumClusterEnergyEMCAL = 0;
1992 Float_t sumClusterEnergyPHOS = 0;
1994 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1995 sumClusterEnergyEMCAL += ((AliESDCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
1996 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
1997 sumClusterEnergyPHOS += ((AliESDCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
1998 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2000 //Fill histograms with cells
2002 AliESDCaloCells * cellsEMCAL = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2003 AliESDCaloCells * cellsPHOS = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2004 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2007 Float_t sumCellEnergyEMCAL = 0;
2008 Float_t sumCellEnergyPHOS = 0;
2009 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2010 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2011 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2012 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2013 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2014 if(GetDebug() > 0 ){
2015 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2016 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2017 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2018 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2019 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2022 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2023 if(fCalorimeter == "EMCAL"){
2024 ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
2025 caloClustersEMCAL = refArray;
2027 else if(fCalorimeter == "PHOS") {
2028 ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
2029 caloClustersEMCAL = refArray;
2032 //Fill histograms with clusters
2034 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2035 Float_t sumClusterEnergyEMCAL = 0;
2036 Float_t sumClusterEnergyPHOS = 0;
2038 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2039 sumClusterEnergyEMCAL += ((AliAODCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
2040 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2041 sumClusterEnergyPHOS += ((AliAODCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
2042 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2044 //Fill histograms with cells
2046 AliAODCaloCells * cellsEMCAL = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2047 AliAODCaloCells * cellsPHOS = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2048 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2051 Float_t sumCellEnergyEMCAL = 0;
2052 Float_t sumCellEnergyPHOS = 0;
2053 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2054 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2055 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2056 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2057 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2058 if(GetDebug() > 0 ){
2059 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2060 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2061 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2062 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2063 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2069 //______________________________________________________________________________
2070 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
2071 //Fill pure monte carlo related histograms
2073 Float_t eMC = mom.E();
2074 Float_t ptMC = mom.Pt();
2075 Float_t phiMC = mom.Phi();
2077 phiMC += TMath::TwoPi();
2078 Float_t etaMC = mom.Eta();
2080 if (TMath::Abs(etaMC) > 1) return;
2083 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2086 fhGenGamPt ->Fill(ptMC);
2087 fhGenGamEta->Fill(etaMC);
2088 fhGenGamPhi->Fill(phiMC);
2090 fhGenGamAccE ->Fill(eMC);
2091 fhGenGamAccPt ->Fill(ptMC);
2092 fhGenGamAccEta->Fill(etaMC);
2093 fhGenGamAccPhi->Fill(phiMC);
2096 else if (pdg==111) {
2097 fhGenPi0Pt ->Fill(ptMC);
2098 fhGenPi0Eta->Fill(etaMC);
2099 fhGenPi0Phi->Fill(phiMC);
2101 fhGenPi0AccE ->Fill(eMC);
2102 fhGenPi0AccPt ->Fill(ptMC);
2103 fhGenPi0AccEta->Fill(etaMC);
2104 fhGenPi0AccPhi->Fill(phiMC);
2107 else if (pdg==221) {
2108 fhGenEtaPt ->Fill(ptMC);
2109 fhGenEtaEta->Fill(etaMC);
2110 fhGenEtaPhi->Fill(phiMC);
2112 else if (pdg==223) {
2113 fhGenOmegaPt ->Fill(ptMC);
2114 fhGenOmegaEta->Fill(etaMC);
2115 fhGenOmegaPhi->Fill(phiMC);
2117 else if (TMath::Abs(pdg)==11) {
2118 fhGenElePt ->Fill(ptMC);
2119 fhGenEleEta->Fill(etaMC);
2120 fhGenElePhi->Fill(phiMC);
2125 //________________________________________________________________________
2126 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2128 // Needed when Terminate is executed in distributed environment
2129 // Refill analysis histograms of this class with corresponding histograms in output list.
2131 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2132 // the first one and then add the next
2133 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
2134 printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2136 //Read histograms, must be in the same order as in GetCreateOutputObject.
2137 fhE = (TH1F *) outputList->At(index++);
2138 fhPt = (TH1F *) outputList->At(index++);
2139 fhPhi = (TH1F *) outputList->At(index++);
2140 fhEta = (TH1F *) outputList->At(index++);
2141 fhEtaPhi = (TH2F *) outputList->At(index++);
2142 fhEtaPhiE = (TH3F *) outputList->At(index++);
2144 fhECharged = (TH1F *) outputList->At(index++);
2145 fhPtCharged = (TH1F *) outputList->At(index++);
2146 fhPhiCharged = (TH1F *) outputList->At(index++);
2147 fhEtaCharged = (TH1F *) outputList->At(index++);
2148 fhEtaPhiCharged = (TH2F *) outputList->At(index++);
2150 fhEChargedNoOut = (TH1F *) outputList->At(index++);
2151 fhPtChargedNoOut = (TH1F *) outputList->At(index++);
2152 fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
2153 fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
2154 fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
2156 fh1pOverE = (TH2F *) outputList->At(index++);
2157 fh1dR = (TH1F *) outputList->At(index++);
2158 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2159 fh2EledEdx = (TH2F *) outputList->At(index++);
2160 fh1pOverER02 = (TH2F *) outputList->At(index++);
2162 fhIM = (TH2F *) outputList->At(index++);
2163 fhIMCellCut = (TH2F *) outputList->At(index++);
2164 fhAsym = (TH2F *) outputList->At(index++);
2166 fhNCellsPerCluster = (TH2F *) outputList->At(index++);
2167 fhNCellsPerClusterMIP = (TH2F *) outputList->At(index++);
2168 fhNClusters = (TH1F *) outputList->At(index++);
2169 fhNCells = (TH1F *) outputList->At(index++);
2170 fhAmplitude = (TH1F *) outputList->At(index++);
2171 fhAmpId = (TH2F *) outputList->At(index++);
2173 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2174 fhTime = (TH1F *) outputList->At(index++);
2175 fhTimeId = (TH2F *) outputList->At(index++);
2176 fhTimeAmp = (TH2F *) outputList->At(index++);
2179 if(fCorrelateCalos){
2180 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2181 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2182 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2183 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2187 fhEMod = new TH1F*[fNModules];
2188 fhNClustersMod = new TH1F*[fNModules];
2189 fhNCellsPerClusterMod = new TH2F*[fNModules];
2190 fhNCellsMod = new TH1F*[fNModules];
2191 fhGridCellsMod = new TH2F*[fNModules];
2192 fhGridCellsEMod = new TH2F*[fNModules];
2193 fhAmplitudeMod = new TH1F*[fNModules];
2194 fhIMMod = new TH2F*[fNModules];
2195 fhIMCellCutMod = new TH2F*[fNModules];
2197 for(Int_t imod = 0 ; imod < fNModules; imod++){
2198 fhEMod[imod] = (TH1F *) outputList->At(index++);
2199 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2200 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2201 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2202 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2203 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2204 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2205 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2206 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
2211 fhDeltaE = (TH1F *) outputList->At(index++);
2212 fhDeltaPt = (TH1F *) outputList->At(index++);
2213 fhDeltaPhi = (TH1F *) outputList->At(index++);
2214 fhDeltaEta = (TH1F *) outputList->At(index++);
2216 fhRatioE = (TH1F *) outputList->At(index++);
2217 fhRatioPt = (TH1F *) outputList->At(index++);
2218 fhRatioPhi = (TH1F *) outputList->At(index++);
2219 fhRatioEta = (TH1F *) outputList->At(index++);
2221 fh2E = (TH2F *) outputList->At(index++);
2222 fh2Pt = (TH2F *) outputList->At(index++);
2223 fh2Phi = (TH2F *) outputList->At(index++);
2224 fh2Eta = (TH2F *) outputList->At(index++);
2226 fhGamE = (TH2F *) outputList->At(index++);
2227 fhGamPt = (TH2F *) outputList->At(index++);
2228 fhGamPhi = (TH2F *) outputList->At(index++);
2229 fhGamEta = (TH2F *) outputList->At(index++);
2231 fhGamDeltaE = (TH1F *) outputList->At(index++);
2232 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2233 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2234 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2236 fhGamRatioE = (TH1F *) outputList->At(index++);
2237 fhGamRatioPt = (TH1F *) outputList->At(index++);
2238 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2239 fhGamRatioEta = (TH1F *) outputList->At(index++);
2241 fhPi0E = (TH2F *) outputList->At(index++);
2242 fhPi0Pt = (TH2F *) outputList->At(index++);
2243 fhPi0Phi = (TH2F *) outputList->At(index++);
2244 fhPi0Eta = (TH2F *) outputList->At(index++);
2246 fhEleE = (TH2F *) outputList->At(index++);
2247 fhElePt = (TH2F *) outputList->At(index++);
2248 fhElePhi = (TH2F *) outputList->At(index++);
2249 fhEleEta = (TH2F *) outputList->At(index++);
2251 fhNeHadE = (TH2F *) outputList->At(index++);
2252 fhNeHadPt = (TH2F *) outputList->At(index++);
2253 fhNeHadPhi = (TH2F *) outputList->At(index++);
2254 fhNeHadEta = (TH2F *) outputList->At(index++);
2256 fhChHadE = (TH2F *) outputList->At(index++);
2257 fhChHadPt = (TH2F *) outputList->At(index++);
2258 fhChHadPhi = (TH2F *) outputList->At(index++);
2259 fhChHadEta = (TH2F *) outputList->At(index++);
2261 fhGamECharged = (TH2F *) outputList->At(index++);
2262 fhGamPtCharged = (TH2F *) outputList->At(index++);
2263 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2264 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2266 fhPi0ECharged = (TH2F *) outputList->At(index++);
2267 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2268 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2269 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2271 fhEleECharged = (TH2F *) outputList->At(index++);
2272 fhElePtCharged = (TH2F *) outputList->At(index++);
2273 fhElePhiCharged = (TH2F *) outputList->At(index++);
2274 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2276 fhNeHadECharged = (TH2F *) outputList->At(index++);
2277 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2278 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2279 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2281 fhChHadECharged = (TH2F *) outputList->At(index++);
2282 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2283 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2284 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2286 // fhEMVxyz = (TH3F *) outputList->At(index++);
2287 // fhHaVxyz = (TH3F *) outputList->At(index++);
2289 fhEMVxyz = (TH2F *) outputList->At(index++);
2290 fhHaVxyz = (TH2F *) outputList->At(index++);
2291 fhEMR = (TH2F *) outputList->At(index++);
2292 fhHaR = (TH2F *) outputList->At(index++);
2294 fhGenGamPt = (TH1F *) outputList->At(index++);
2295 fhGenGamEta = (TH1F *) outputList->At(index++);
2296 fhGenGamPhi = (TH1F *) outputList->At(index++);
2298 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2299 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2300 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2302 fhGenEtaPt = (TH1F *) outputList->At(index++);
2303 fhGenEtaEta = (TH1F *) outputList->At(index++);
2304 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2306 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2307 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2308 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2310 fhGenElePt = (TH1F *) outputList->At(index++);
2311 fhGenEleEta = (TH1F *) outputList->At(index++);
2312 fhGenElePhi = (TH1F *) outputList->At(index++);
2314 fhGenGamAccE = (TH1F *) outputList->At(index++);
2315 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2316 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2317 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2319 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2320 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2321 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2322 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2324 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
2325 fhMCEle1dR = (TH1F *) outputList->At(index++);
2326 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2328 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
2329 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2330 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2332 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
2333 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2334 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2336 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2337 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2338 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
2340 //for(Int_t i = 0; i<index ; i++) cout<<outputList->At(i)->GetName()<<endl;
2343 //__________________________________________________________________
2344 void AliAnaCalorimeterQA::Terminate(TList* outputList)
2346 //Do plots if requested
2348 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
2349 if(!fMakePlots) return;
2351 //Do some plots to end
2352 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
2353 //Recover histograms from output histograms list, needed for distributed analysis.
2354 ReadHistograms(outputList);
2356 printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2357 printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
2364 sprintf(cname,"QA_%s_nclustercellsamp",fCalorimeter.Data());
2365 TCanvas * c9 = new TCanvas(cname, " CaloClusters and CaloCells", 400, 400) ;
2370 TLegend pLegendN(0.7,0.6,0.9,0.8);
2371 pLegendN.SetTextSize(0.03);
2372 pLegendN.AddEntry(fhNClusters,"all modules","L");
2373 pLegendN.SetFillColor(10);
2374 pLegendN.SetBorderSize(1);
2376 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
2378 fhNClusters->SetLineColor(1);
2379 fhNClusters->Draw();
2380 for(Int_t imod = 0; imod < fNModules; imod++){
2381 fhNClustersMod[imod]->SetLineColor(imod+1);
2382 fhNClustersMod[imod]->Draw("same");
2383 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
2388 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
2390 fhNCells->SetLineColor(1);
2392 for(Int_t imod = 0; imod < fNModules; imod++){
2393 fhNCellsMod[imod]->SetLineColor(imod+1);
2394 fhNCellsMod[imod]->Draw("same");
2397 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
2399 TH1D *cpc = fhNCellsPerCluster->ProjectionY(Form("%s_py",fhNCellsPerCluster->GetName()),-1,-1);
2400 cpc->SetLineColor(1);
2402 for(Int_t imod = 0; imod < fNModules; imod++){
2403 cpc = fhNCellsPerClusterMod[imod]->ProjectionY(Form("%s_py",fhNCellsPerClusterMod[imod]->GetName()),-1,-1);
2404 cpc->SetLineColor(imod+1);
2409 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
2411 fhAmplitude->SetLineColor(1);
2412 fhAmplitude->Draw();
2413 for(Int_t imod = 0; imod < fNModules; imod++){
2414 fhAmplitudeMod[imod]->SetLineColor(imod+1);
2415 fhAmplitudeMod[imod]->Draw("same");
2418 sprintf(name,"QA_%s_CaloClustersAndCaloCells.eps",fCalorimeter.Data());
2419 c9->Print(name); printf("Plot: %s\n",name);
2421 //Cell Time histograms, time only available in ESDs
2422 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2424 sprintf(cname,"QA_%s_cellstime",fCalorimeter.Data());
2425 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
2426 ctime->Divide(3, 1);
2429 if(fhTime->GetEntries() > 0) gPad->SetLogy();
2433 //if(fhTimeId->GetEntries() > 0) gPad->SetLogy();
2434 fhTimeId->Draw("colz");
2437 //if(fhTimeAmp->GetEntries() > 0) gPad->SetLogy();
2438 fhTimeAmp->Draw("surf");
2440 sprintf(name,"QA_%s_CellsTime.eps",fCalorimeter.Data());
2441 ctime->Print(name); printf("Plot: %s\n",name);
2444 if(fCorrelateCalos){
2445 //Calorimeter Correlation, PHOS vs EMCAL
2447 sprintf(cname,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
2448 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
2449 ccorr->Divide(2, 2);
2454 fhCaloCorrNClusters ->Draw();
2459 fhCaloCorrNCells->Draw();
2464 fhCaloCorrEClusters->Draw();
2469 fhCaloCorrECells->Draw();
2471 sprintf(name,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
2472 ccorr->Print(name); printf("Plot: %s\n",name);
2475 //Reconstructed distributions
2477 sprintf(cname,"QA_%s_rec",fCalorimeter.Data());
2478 TCanvas * c = new TCanvas(cname, "Reconstructed distributions", 400, 400) ;
2482 if(fhE->GetEntries() > 0) gPad->SetLogy();
2483 TLegend pLegendE(0.7,0.6,0.9,0.8);
2484 pLegendE.SetTextSize(0.03);
2485 pLegendE.AddEntry(fhE,"all modules","L");
2486 pLegendE.SetFillColor(10);
2487 pLegendE.SetBorderSize(1);
2489 fhE->SetLineColor(1);
2491 for(Int_t imod = 0; imod < fNModules; imod++){
2492 fhEMod[imod]->SetLineColor(imod+1);
2493 fhEMod[imod]->Draw("same");
2494 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
2499 if(fhPt->GetEntries() > 0) gPad->SetLogy();
2500 fhPt->SetLineColor(4);
2504 fhPhi->SetLineColor(4);
2508 fhEta->SetLineColor(4);
2511 sprintf(name,"QA_%s_ReconstructedDistributions.eps",fCalorimeter.Data());
2512 c->Print(name); printf("Plot: %s\n",name);
2514 //Reconstructed distributions, matched with tracks
2516 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
2517 TCanvas * c2 = new TCanvas(cname, "Reconstructed distributions, matched with tracks", 400, 400) ;
2521 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
2522 fhECharged->SetLineColor(4);
2526 if(fhPtCharged->GetEntries() > 0) gPad->SetLogy();
2527 fhPtCharged->SetLineColor(4);
2528 fhPtCharged->Draw();
2531 fhPhiCharged->SetLineColor(4);
2532 fhPhiCharged->Draw();
2535 fhEtaCharged->SetLineColor(4);
2536 fhEtaCharged->Draw();
2538 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched.eps",fCalorimeter.Data());
2539 c2->Print(name); printf("Plot: %s\n",name);
2541 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
2542 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
2543 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
2544 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
2546 TH1F * hEChargedClone2 = (TH1F*) fhECharged->Clone(Form("%sClone2",fhECharged->GetName()));
2547 TH1F * hPtChargedClone2 = (TH1F*) fhPtCharged->Clone(Form("%sClone2",fhPtCharged->GetName()));
2548 TH1F * hEtaChargedClone2 = (TH1F*) fhEtaCharged->Clone(Form("%sClone2",fhEtaCharged->GetName()));
2549 TH1F * hPhiChargedClone2 = (TH1F*) fhPhiCharged->Clone(Form("%sClone2",fhPhiCharged->GetName()));
2551 //Ratio: reconstructed track matched/ all reconstructed
2553 sprintf(cname,"QA_%s_rectrackmatchrat",fCalorimeter.Data());
2554 TCanvas * c3 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
2558 if(hEChargedClone->GetEntries() > 0) gPad->SetLogy();
2559 hEChargedClone->SetTitleOffset(1.6,"Y");
2560 hEChargedClone->SetYTitle("track matched / all ");
2561 hEChargedClone->SetXTitle("E (GeV)");
2562 hEChargedClone->Divide(fhE);
2563 hEChargedClone->Draw();
2566 if(hPtChargedClone->GetEntries() > 0) gPad->SetLogy();
2567 hPtChargedClone->SetTitleOffset(1.6,"Y");
2568 hPtChargedClone->SetYTitle("track matched / all ");
2569 hPtChargedClone->SetXTitle("p_{T} (GeV/c)");
2570 hPtChargedClone->Divide(fhPt);
2571 hPtChargedClone->Draw();
2574 if(hPhiChargedClone->GetEntries() > 0) gPad->SetLogy();
2575 hPhiChargedClone->SetTitleOffset(1.6,"Y");
2576 hPhiChargedClone->SetYTitle("track matched / all ");
2577 hPhiChargedClone->SetXTitle("#phi (rad)");
2578 hPhiChargedClone->Divide(fhPhi);
2579 hPhiChargedClone->Draw();
2582 if(hEtaChargedClone->GetEntries() > 0) gPad->SetLogy();
2583 hEtaChargedClone->SetTitleOffset(1.6,"Y");
2584 hEtaChargedClone->SetYTitle("track matched / all ");
2585 hEtaChargedClone->SetXTitle("#eta");
2586 hEtaChargedClone->Divide(fhEta);
2587 hEtaChargedClone->Draw();
2589 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributions.eps",fCalorimeter.Data());
2590 c3->Print(name); printf("Plot: %s\n",name);
2592 //Ratio: reconstructed track matched (minus no track param) / all
2594 sprintf(cname,"QA_%s_rectrackmatchratout",fCalorimeter.Data());
2595 TCanvas * c333 = new TCanvas(cname, "Ratio: reconstructed track matched (with outer track param)/ all", 400, 400) ;
2599 hEChargedClone2->Add(fhEChargedNoOut,-1);
2600 hEChargedClone2->SetYTitle("track matched / all");
2601 hEChargedClone2->SetXTitle("E (GeV)");
2602 hEChargedClone2->Divide(fhE);
2603 hEChargedClone2->Draw();
2606 hPtChargedClone2->Add(fhPtChargedNoOut,-1);
2607 hPtChargedClone2->SetYTitle("track matched / all");
2608 hPtChargedClone2->SetXTitle("p_{T} (GeV/c)");
2609 hPtChargedClone2->Divide(fhPt);
2610 hPtChargedClone2->Draw();
2613 hPhiChargedClone2->Add(fhPhiChargedNoOut,-1);
2614 hPhiChargedClone2->SetYTitle("track matched / all");
2615 hPhiChargedClone2->SetXTitle("#phi (rad)");
2616 hPhiChargedClone2->Divide(fhPhi);
2617 hPhiChargedClone2->Draw();
2620 hEtaChargedClone2->Add(fhEtaChargedNoOut,-1);
2621 hEtaChargedClone2->SetYTitle("track matched / all");
2622 hEtaChargedClone2->SetXTitle("#eta");
2623 hEtaChargedClone2->Divide(fhEta);
2624 hEtaChargedClone2->Draw();
2626 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsOuter.eps",fCalorimeter.Data());
2627 c333->Print(name); printf("Plot: %s\n",name);
2629 //Reconstructed distributions, matched with tracks but no outer param
2631 sprintf(cname,"QA_%s_rectrackmatch_noout",fCalorimeter.Data());
2632 TCanvas * c22 = new TCanvas(cname, "Reconstructed distributions, matched with tracks, no outer track param", 400, 400) ;
2636 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
2637 fhEChargedNoOut->SetLineColor(4);
2638 fhEChargedNoOut->Draw();
2641 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
2642 fhPtChargedNoOut->SetLineColor(4);
2643 fhPtChargedNoOut->Draw();
2646 fhPhiChargedNoOut->SetLineColor(4);
2647 fhPhiChargedNoOut->Draw();
2650 fhEtaChargedNoOut->SetLineColor(4);
2651 fhEtaChargedNoOut->Draw();
2653 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched_NoOutParam.eps",fCalorimeter.Data());
2654 c22->Print(name); printf("Plot: %s\n",name);
2656 //Ratio: reconstructed track matched/ all reconstructed
2659 // TH1F * hEChargedNoOutClone = (TH1F*) fhEChargedNoOut->Clone("EChargedNoOutClone");
2660 // TH1F * hPtChargedNoOutClone = (TH1F*) fhPtChargedNoOut->Clone("PtChargedNoOutClone");
2661 // TH1F * hEtaChargedNoOutClone = (TH1F*) fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
2662 // TH1F * hPhiChargedNoOutClone = (TH1F*) fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");
2664 // sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
2665 // TCanvas * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
2666 // c33->Divide(2, 2);
2669 // hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2670 // hEChargedNoOutClone->SetXTitle("E (GeV)");
2671 // hEChargedNoOutClone->Divide(fhECharged);
2672 // hEChargedNoOutClone->Draw();
2675 // hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
2676 // hPtChargedNoOutClone->SetXTitle("p_{T} (GeV/c)");
2677 // hPtChargedNoOutClone->Divide(fhPtCharged);
2678 // hPtChargedNoOutClone->Draw();
2681 // hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2682 // hPhiChargedNoOutClone->SetXTitle("#phi (rad)");
2683 // hPhiChargedNoOutClone->Divide(fhPhiCharged);
2684 // hPhiChargedNoOutClone->Draw();
2687 // hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2688 // hEtaChargedNoOutClone->SetXTitle("#eta");
2689 // hEtaChargedNoOutClone->Divide(fhEtaCharged);
2690 // hEtaChargedNoOutClone->Draw();
2692 // sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
2693 // c33->Print(name); printf("Plot: %s\n",name);
2698 sprintf(cname,"QA_%s_etavsphivse",fCalorimeter.Data());
2699 // TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 600, 200) ;
2700 // c4->Divide(3, 1);
2702 TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi vs E", 600, 600) ;
2707 fhEtaPhi->Draw("contz");
2711 fhEtaPhiCharged->Draw("contz");
2714 {gStyle->SetOptStat(0);
2715 fhEtaPhi->Draw("contz");}
2716 //fhEtaPhiE->Draw();
2720 // fhEtaPhiChargedNoOut->Draw("cont");
2722 sprintf(name,"QA_%s_ReconstructedEtaVsPhiVsE.eps",fCalorimeter.Data());
2723 c4->Print(name); printf("Plot: %s\n",name);
2729 if(fhIM->GetEntries() > 1){
2730 Int_t nebins = fhIM->GetNbinsX();
2731 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
2732 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
2733 if (emin != 0 ) printf("emin != 0 \n");
2734 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2736 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
2738 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
2742 //fhIM->SetLineColor(4);
2745 binmax = (Int_t) (1-emin)*nebins/emax;
2746 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),binmin,binmax);
2747 pyim1->SetTitle("E_{pair} < 1 GeV");
2748 pyim1->SetLineColor(1);
2750 TLegend pLegendIM(0.7,0.6,0.9,0.8);
2751 pLegendIM.SetTextSize(0.03);
2752 pLegendIM.AddEntry(pyim1,"all modules","L");
2753 pLegendIM.SetFillColor(10);
2754 pLegendIM.SetBorderSize(1);
2755 for(Int_t imod = 0; imod < fNModules; imod++){
2756 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),binmin,binmax);
2757 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
2758 pyim1->SetLineColor(imod+1);
2759 pyim1->Draw("same");
2764 binmin = (Int_t) (1-emin)*nebins/emax;
2765 binmax = (Int_t) (2-emin)*nebins/emax;
2766 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),binmin,binmax);
2767 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
2768 pyim2->SetLineColor(1);
2770 for(Int_t imod = 0; imod < fNModules; imod++){
2771 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),binmin,binmax);
2772 pyim2->SetLineColor(imod+1);
2773 pyim2->Draw("same");
2777 binmin = (Int_t) (2-emin)*nebins/emax;
2778 binmax = (Int_t) (3-emin)*nebins/emax;
2779 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),binmin,binmax);
2780 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
2781 pyim3->SetLineColor(1);
2783 for(Int_t imod = 0; imod < fNModules; imod++){
2784 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),binmin,binmax);
2785 pyim3->SetLineColor(imod+1);
2786 pyim3->Draw("same");
2790 binmin = (Int_t) (3-emin)*nebins/emax;
2791 binmax = (Int_t) (4-emin)*nebins/emax;
2792 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),binmin,binmax);
2793 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
2794 pyim4->SetLineColor(1);
2796 for(Int_t imod = 0; imod < fNModules; imod++){
2797 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),binmin,binmax);
2798 pyim4->SetLineColor(imod+1);
2799 pyim4->Draw("same");
2803 binmin = (Int_t) (4-emin)*nebins/emax;
2804 binmax = (Int_t) (5-emin)*nebins/emax;
2805 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),binmin,binmax);
2806 pyim5->SetTitle("4< E_{pair} < 5 GeV");
2807 pyim5->SetLineColor(1);
2809 for(Int_t imod = 0; imod < fNModules; imod++){
2810 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),binmin,binmax);
2811 pyim5->SetLineColor(imod+1);
2812 pyim5->Draw("same");
2816 binmin = (Int_t) (5-emin)*nebins/emax;
2818 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),binmin,binmax);
2819 pyim10->SetTitle("E_{pair} > 5 GeV");
2820 pyim10->SetLineColor(1);
2822 for(Int_t imod = 0; imod < fNModules; imod++){
2823 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),binmin,binmax);
2824 pyim10->SetLineColor(imod+1);
2825 pyim10->Draw("same");
2828 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
2829 c5->Print(name); printf("Plot: %s\n",name);
2833 if(fhIMCellCut->GetEntries() > 1){
2834 Int_t nebins = fhIMCellCut->GetNbinsX();
2835 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
2836 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
2837 if (emin != 0 ) printf("emin != 0 \n");
2838 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2840 sprintf(cname,"QA_%s_IMCellCut",fCalorimeter.Data());
2841 // printf("c5cc\n");
2842 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
2846 //fhIMCellCut->SetLineColor(4);
2847 //fhIMCellCut->Draw();
2849 binmax = (Int_t) (1-emin)*nebins/emax;
2850 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),binmin,binmax);
2851 pyimcc1->SetTitle("E_{pair} < 1 GeV");
2852 pyimcc1->SetLineColor(1);
2854 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
2855 pLegendIMCellCut.SetTextSize(0.03);
2856 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
2857 pLegendIMCellCut.SetFillColor(10);
2858 pLegendIMCellCut.SetBorderSize(1);
2859 for(Int_t imod = 0; imod < fNModules; imod++){
2860 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2861 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
2862 pyimcc1->SetLineColor(imod+1);
2863 pyimcc1->Draw("same");
2865 pLegendIMCellCut.Draw();
2868 binmin = (Int_t) (1-emin)*nebins/emax;
2869 binmax = (Int_t) (2-emin)*nebins/emax;
2870 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),binmin,binmax);
2871 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
2872 pyimcc2->SetLineColor(1);
2874 for(Int_t imod = 0; imod < fNModules; imod++){
2875 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2876 pyimcc2->SetLineColor(imod+1);
2877 pyimcc2->Draw("same");
2881 binmin = (Int_t) (2-emin)*nebins/emax;
2882 binmax = (Int_t) (3-emin)*nebins/emax;
2883 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),binmin,binmax);
2884 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
2885 pyimcc3->SetLineColor(1);
2887 for(Int_t imod = 0; imod < fNModules; imod++){
2888 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2889 pyimcc3->SetLineColor(imod+1);
2890 pyimcc3->Draw("same");
2894 binmin = (Int_t) (3-emin)*nebins/emax;
2895 binmax = (Int_t) (4-emin)*nebins/emax;
2896 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),binmin,binmax);
2897 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
2898 pyimcc4->SetLineColor(1);
2900 for(Int_t imod = 0; imod < fNModules; imod++){
2901 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2902 pyimcc4->SetLineColor(imod+1);
2903 pyimcc4->Draw("same");
2907 binmin = (Int_t) (4-emin)*nebins/emax;
2908 binmax = (Int_t) (5-emin)*nebins/emax;
2909 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),binmin,binmax);
2910 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
2911 pyimcc5cc->SetLineColor(1);
2913 for(Int_t imod = 0; imod < fNModules; imod++){
2914 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2915 pyimcc5cc->SetLineColor(imod+1);
2916 pyimcc5cc->Draw("same");
2920 binmin = (Int_t) (5-emin)*nebins/emax;
2922 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),binmin,binmax);
2923 pyimcc10->SetTitle("E_{pair} > 5 GeV");
2924 pyimcc10->SetLineColor(1);
2926 for(Int_t imod = 0; imod < fNModules; imod++){
2927 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2928 pyimcc10->SetLineColor(imod+1);
2929 pyimcc10->Draw("same");
2932 sprintf(name,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
2933 c5cc->Print(name); printf("Plot: %s\n",name);
2938 if(fhAsym->GetEntries() > 1){
2939 Int_t nebins = fhAsym->GetNbinsX();
2940 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
2941 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
2942 if (emin != 0 ) printf("emin != 0 \n");
2943 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2945 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
2947 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
2951 fhAsym->SetTitleOffset(1.6,"Y");
2952 fhAsym->SetLineColor(4);
2957 binmax = (Int_t) (5-emin)*nebins/emax;
2958 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),binmin,binmax);
2959 pyAsym5->SetTitle("E_{pair} < 5 GeV");
2960 pyAsym5->SetLineColor(4);
2964 binmin = (Int_t) (5-emin)*nebins/emax;
2965 binmax = (Int_t) (10-emin)*nebins/emax;
2966 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),binmin,binmax);
2967 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
2968 pyAsym510->SetLineColor(4);
2972 binmin = (Int_t) (10-emin)*nebins/emax;
2974 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),binmin,binmax);
2975 pyAsym10->SetTitle("E_{pair} > 10 GeV");
2976 pyAsym10->SetLineColor(4);
2979 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
2980 c5b->Print(name); printf("Plot: %s\n",name);
2983 //Grid of cell per module plots
2985 gStyle->SetOptStat(0);
2986 sprintf(cname,"QA_%s_GridCellEntries",fCalorimeter.Data());
2988 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
2989 if(fNModules%2 == 0)
2990 cgrid->Divide(fNModules/2,2);
2992 cgrid->Divide(fNModules/2+1,2);
2994 for(Int_t imod = 0; imod < fNModules ; imod++){
2999 fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
3000 fhGridCellsMod[imod]->Draw("colz");
3002 sprintf(name,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
3003 cgrid->Print(name); printf("Plot: %s\n",name);
3005 sprintf(cname,"QA_%s_GridCellAccumEnergy",fCalorimeter.Data());
3007 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
3008 cgridE->Divide(fNModules/2,2);
3009 for(Int_t imod = 0; imod < fNModules ; imod++){
3014 fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
3015 fhGridCellsEMod[imod]->Draw("colz");
3017 sprintf(name,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
3018 cgridE->Print(name); printf("Plot: %s\n",name);
3020 sprintf(cname,"QA_%s_GridCellAverageEnergy",fCalorimeter.Data());
3022 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
3023 cgridEA->Divide(fNModules/2,2);
3024 for(Int_t imod = 0; imod < fNModules ; imod++){
3025 cgridEA->cd(imod+1);
3029 fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
3030 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
3031 fhGridCellsEMod[imod]->Draw("colz");
3033 sprintf(name,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
3034 cgridEA->Print(name); printf("Plot: %s\n",name);
3039 //Reconstructed vs MC distributions
3041 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
3042 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
3046 fh2E->SetTitleOffset(1.6,"Y");
3047 fh2E->SetLineColor(4);
3051 fh2Pt->SetTitleOffset(1.6,"Y");
3052 fh2Pt->SetLineColor(4);
3056 fh2Phi->SetTitleOffset(1.6,"Y");
3057 fh2Phi->SetLineColor(4);
3061 fh2Eta->SetTitleOffset(1.6,"Y");
3062 fh2Eta->SetLineColor(4);
3065 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
3066 c6->Print(name); printf("Plot: %s\n",name);
3068 //Reconstructed vs MC distributions
3070 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
3071 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
3072 c6Gam->Divide(2, 2);
3086 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
3087 c6->Print(name); printf("Plot: %s\n",name);
3089 //Generated - reconstructed
3091 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
3092 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
3096 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
3097 fhGamDeltaE->SetLineColor(4);
3099 fhGamDeltaE->Draw("same");
3101 TLegend pLegendd(0.65,0.55,0.9,0.8);
3102 pLegendd.SetTextSize(0.06);
3103 pLegendd.AddEntry(fhDeltaE,"all","L");
3104 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
3105 pLegendd.SetFillColor(10);
3106 pLegendd.SetBorderSize(1);
3110 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
3111 fhGamDeltaPt->SetLineColor(4);
3113 fhGamDeltaPt->Draw("same");
3116 fhGamDeltaPhi->SetLineColor(4);
3118 fhGamDeltaPhi->Draw("same");
3121 fhGamDeltaEta->SetLineColor(4);
3123 fhGamDeltaEta->Draw("same");
3125 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
3126 c7->Print(name); printf("Plot: %s\n",name);
3128 // Reconstructed / Generated
3130 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
3131 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
3135 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
3136 fhGamRatioE->SetLineColor(4);
3138 fhGamRatioE->Draw("same");
3140 TLegend pLegendr(0.65,0.55,0.9,0.8);
3141 pLegendr.SetTextSize(0.06);
3142 pLegendr.AddEntry(fhRatioE,"all","L");
3143 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
3144 pLegendr.SetFillColor(10);
3145 pLegendr.SetBorderSize(1);
3149 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
3150 fhGamRatioPt->SetLineColor(4);
3152 fhGamRatioPt->Draw("same");
3155 fhGamRatioPhi->SetLineColor(4);
3157 fhGamRatioPhi->Draw("same");
3160 fhGamRatioEta->SetLineColor(4);
3162 fhGamRatioEta->Draw("same");
3164 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
3165 c8->Print(name); printf("Plot: %s\n",name);
3169 //Generated distributions
3171 sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
3172 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
3177 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
3178 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
3179 fhGenPi0Pt->SetLineColor(1);
3180 fhGenGamPt->SetLineColor(4);
3181 fhGenEtaPt->SetLineColor(2);
3182 fhGenOmegaPt->SetLineColor(7);
3183 fhGenElePt->SetLineColor(6);
3185 //Select the maximum of the histogram to show all lines.
3186 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3187 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
3188 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
3189 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3190 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
3191 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
3192 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
3193 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
3194 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
3195 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3196 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
3197 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
3198 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3199 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
3200 haxispt->SetMaximum(fhGenElePt->GetMaximum());
3201 haxispt->SetMinimum(1);
3202 haxispt->Draw("axis");
3203 fhGenPi0Pt->Draw("same");
3204 fhGenGamPt->Draw("same");
3205 fhGenEtaPt->Draw("same");
3206 fhGenOmegaPt->Draw("same");
3207 fhGenElePt->Draw("same");
3209 TLegend pLegend(0.85,0.65,0.95,0.93);
3210 pLegend.SetTextSize(0.06);
3211 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
3212 pLegend.AddEntry(fhGenGamPt," #gamma","L");
3213 pLegend.AddEntry(fhGenEtaPt," #eta","L");
3214 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
3215 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
3216 pLegend.SetFillColor(10);
3217 pLegend.SetBorderSize(1);
3222 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
3223 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
3224 fhGenPi0Eta->SetLineColor(1);
3225 fhGenGamEta->SetLineColor(4);
3226 fhGenEtaEta->SetLineColor(2);
3227 fhGenOmegaEta->SetLineColor(7);
3228 fhGenEleEta->SetLineColor(6);
3229 //Select the maximum of the histogram to show all lines.
3230 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3231 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
3232 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
3233 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3234 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3235 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
3236 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
3237 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3238 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
3239 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3240 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3241 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
3242 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3243 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
3244 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
3245 haxiseta->SetMinimum(100);
3246 haxiseta->Draw("axis");
3247 fhGenPi0Eta->Draw("same");
3248 fhGenGamEta->Draw("same");
3249 fhGenEtaEta->Draw("same");
3250 fhGenOmegaEta->Draw("same");
3251 fhGenEleEta->Draw("same");
3256 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
3257 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
3258 fhGenPi0Phi->SetLineColor(1);
3259 fhGenGamPhi->SetLineColor(4);
3260 fhGenEtaPhi->SetLineColor(2);
3261 fhGenOmegaPhi->SetLineColor(7);
3262 fhGenElePhi->SetLineColor(6);
3263 //Select the maximum of the histogram to show all lines.
3264 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3265 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
3266 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
3267 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3268 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3269 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
3270 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
3271 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3272 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
3273 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3274 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3275 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
3276 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3277 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
3278 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
3279 haxisphi->SetMinimum(100);
3280 haxisphi->Draw("axis");
3281 fhGenPi0Phi->Draw("same");
3282 fhGenGamPhi->Draw("same");
3283 fhGenEtaPhi->Draw("same");
3284 fhGenOmegaPhi->Draw("same");
3285 fhGenElePhi->Draw("same");
3287 sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
3288 c10->Print(name); printf("Plot: %s\n",name);
3291 //Reconstructed clusters depending on its original particle.
3293 sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
3294 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
3300 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
3301 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
3302 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
3303 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
3304 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
3305 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
3306 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
3307 hPi0E->SetLineColor(1);
3308 hGamE->SetLineColor(4);
3309 hNeHadE->SetLineColor(2);
3310 hChHadE->SetLineColor(7);
3311 hEleE->SetLineColor(6);
3313 //Select the maximum of the histogram to show all lines.
3314 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
3315 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
3316 haxisE->SetMaximum(hPi0E->GetMaximum());
3317 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
3318 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
3319 haxisE->SetMaximum(hGamE->GetMaximum());
3320 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
3321 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
3322 haxisE->SetMaximum(hNeHadE->GetMaximum());
3323 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
3324 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
3325 haxisE->SetMaximum(hChHadE->GetMaximum());
3326 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
3327 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
3328 haxisE->SetMaximum(hEleE->GetMaximum());
3329 haxisE->SetXTitle("E (GeV)");
3330 haxisE->SetMinimum(1);
3331 haxisE->Draw("axis");
3332 hPi0E->Draw("same");
3333 hGamE->Draw("same");
3334 hNeHadE->Draw("same");
3335 hChHadE->Draw("same");
3336 hEleE->Draw("same");
3338 TLegend pLegend2(0.8,0.65,0.95,0.93);
3339 pLegend2.SetTextSize(0.06);
3340 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
3341 pLegend2.AddEntry(hGamE," #gamma","L");
3342 pLegend2.AddEntry(hEleE," e^{#pm}","L");
3343 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
3344 pLegend2.AddEntry(hNeHadE," h^{0}","L");
3345 pLegend2.SetFillColor(10);
3346 pLegend2.SetBorderSize(1);
3352 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
3353 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
3354 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
3355 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
3356 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
3357 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
3358 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
3359 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
3360 hPi0Pt->SetLineColor(1);
3361 hGamPt->SetLineColor(4);
3362 hNeHadPt->SetLineColor(2);
3363 hChHadPt->SetLineColor(7);
3364 hElePt->SetLineColor(6);
3366 //Select the maximum of the histogram to show all lines.
3367 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3368 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
3369 haxispt->SetMaximum(hPi0Pt->GetMaximum());
3370 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3371 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
3372 haxispt->SetMaximum(hGamPt->GetMaximum());
3373 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
3374 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
3375 haxispt->SetMaximum(hNeHadPt->GetMaximum());
3376 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3377 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
3378 haxispt->SetMaximum(hChHadPt->GetMaximum());
3379 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3380 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
3381 haxispt->SetMaximum(hElePt->GetMaximum());
3382 haxispt->SetXTitle("p_{T} (GeV/c)");
3383 haxispt->SetMinimum(1);
3384 haxispt->Draw("axis");
3385 hPi0Pt->Draw("same");
3386 hGamPt->Draw("same");
3387 hNeHadPt->Draw("same");
3388 hChHadPt->Draw("same");
3389 hElePt->Draw("same");
3395 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
3396 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
3397 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
3398 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
3399 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
3400 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
3401 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
3402 hPi0Eta->SetLineColor(1);
3403 hGamEta->SetLineColor(4);
3404 hNeHadEta->SetLineColor(2);
3405 hChHadEta->SetLineColor(7);
3406 hEleEta->SetLineColor(6);
3407 //Select the maximum of the histogram to show all lines.
3408 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3409 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
3410 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
3411 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3412 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
3413 haxiseta->SetMaximum(hGamEta->GetMaximum());
3414 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
3415 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
3416 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
3417 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3418 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
3419 haxiseta->SetMaximum(hChHadEta->GetMaximum());
3420 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3421 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
3422 haxiseta->SetMaximum(hEleEta->GetMaximum());
3424 haxiseta->SetXTitle("#eta");
3425 haxiseta->Draw("axis");
3426 hPi0Eta->Draw("same");
3427 hGamEta->Draw("same");
3428 hNeHadEta->Draw("same");
3429 hChHadEta->Draw("same");
3430 hEleEta->Draw("same");
3435 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
3436 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
3437 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
3438 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
3439 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
3440 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
3441 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
3443 hPi0Phi->SetLineColor(1);
3444 hGamPhi->SetLineColor(4);
3445 hNeHadPhi->SetLineColor(2);
3446 hChHadPhi->SetLineColor(7);
3447 hElePhi->SetLineColor(6);
3448 //Select the maximum of the histogram to show all lines.
3449 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3450 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
3451 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
3452 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3453 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
3454 haxisphi->SetMaximum(hGamPhi->GetMaximum());
3455 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
3456 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
3457 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
3458 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3459 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
3460 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
3461 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3462 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
3463 haxisphi->SetMaximum(hElePhi->GetMaximum());
3464 haxisphi->SetXTitle("#phi (rad)");
3465 haxisphi->Draw("axis");
3466 hPi0Phi->Draw("same");
3467 hGamPhi->Draw("same");
3468 hNeHadPhi->Draw("same");
3469 hChHadPhi->Draw("same");
3470 hElePhi->Draw("same");
3472 sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
3473 c11->Print(name); printf("Plot: %s\n",name);
3476 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
3479 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
3480 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
3481 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
3482 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
3483 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
3484 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
3485 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
3486 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
3488 sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
3489 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
3494 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3495 hPi0EClone->Divide(fhGenPi0AccE);
3496 hGamEClone->Divide(fhGenGamAccE);
3497 haxisE->SetMaximum(5);
3498 haxisE->SetMinimum(1e-2);
3499 haxisE->SetXTitle("E (GeV)");
3500 haxisE->SetYTitle("ratio = rec/gen");
3501 haxisE->Draw("axis");
3502 hPi0E->Draw("same");
3503 hGamE->Draw("same");
3505 TLegend pLegend3(0.75,0.2,0.9,0.4);
3506 pLegend3.SetTextSize(0.06);
3507 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
3508 pLegend3.AddEntry(hGamEClone," #gamma","L");
3509 pLegend3.SetFillColor(10);
3510 pLegend3.SetBorderSize(1);
3515 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3516 hPi0PtClone->Divide(fhGenPi0AccPt);
3517 hGamPtClone->Divide(fhGenGamAccPt);
3518 haxispt->SetMaximum(5);
3519 haxispt->SetMinimum(1e-2);
3520 haxispt->SetXTitle("p_{T} (GeV/c)");
3521 haxispt->SetYTitle("ratio = rec/gen");
3522 haxispt->Draw("axis");
3523 hPi0PtClone->Draw("same");
3524 hGamPtClone->Draw("same");
3529 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3530 hPi0EtaClone->Divide(fhGenPi0AccEta);
3531 hGamEtaClone->Divide(fhGenGamAccEta);
3532 haxiseta->SetMaximum(1.2);
3533 haxiseta->SetMinimum(1e-2);
3534 haxiseta->SetYTitle("ratio = rec/gen");
3535 haxiseta->SetXTitle("#eta");
3536 haxiseta->Draw("axis");
3537 hPi0EtaClone->Draw("same");
3538 hGamEtaClone->Draw("same");
3543 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3544 hPi0PhiClone->Divide(fhGenPi0AccPhi);
3545 hGamPhiClone->Divide(fhGenGamAccPhi);
3546 haxisphi->SetYTitle("ratio = rec/gen");
3547 haxisphi->SetXTitle("#phi (rad)");
3548 haxisphi->SetMaximum(1.2);
3549 haxisphi->SetMinimum(1e-2);
3550 haxisphi->Draw("axis");
3551 hPi0PhiClone->Draw("same");
3552 hGamPhiClone->Draw("same");
3554 sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
3555 c12->Print(name); printf("Plot: %s\n",name);
3559 //Reconstructed distributions
3561 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
3562 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
3567 fhEMVxyz->SetTitleOffset(1.6,"Y");
3572 fhHaVxyz->SetTitleOffset(1.6,"Y");
3577 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
3578 hEMR->SetLineColor(4);
3583 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
3584 hHaR->SetLineColor(4);
3588 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
3589 c13->Print(name); printf("Plot: %s\n",name);
3592 //Track-matching distributions
3594 //Reconstructed distributions, matched with tracks, generated particle dependence
3596 sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
3597 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
3598 c22ch->Divide(2, 2);
3602 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
3603 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
3604 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
3605 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
3606 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
3607 hPi0ECharged->SetLineColor(1);
3608 hGamECharged->SetLineColor(4);
3609 hNeHadECharged->SetLineColor(2);
3610 hChHadECharged->SetLineColor(7);
3611 hEleECharged->SetLineColor(6);
3613 fhECharged->SetLineColor(3);
3614 fhECharged->SetMinimum(0.5);
3616 hPi0ECharged->Draw("same");
3617 hGamECharged->Draw("same");
3618 hNeHadECharged->Draw("same");
3619 hChHadECharged->Draw("same");
3620 hEleECharged->Draw("same");
3621 TLegend pLegend22(0.75,0.45,0.9,0.8);
3622 pLegend22.SetTextSize(0.06);
3623 pLegend22.AddEntry(fhECharged,"all","L");
3624 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
3625 pLegend22.AddEntry(hGamECharged,"#gamma","L");
3626 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
3627 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
3628 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
3629 pLegend22.SetFillColor(10);
3630 pLegend22.SetBorderSize(1);
3635 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
3636 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
3637 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
3638 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
3639 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
3640 hPi0PtCharged->SetLineColor(1);
3641 hGamPtCharged->SetLineColor(4);
3642 hNeHadPtCharged->SetLineColor(2);
3643 hChHadPtCharged->SetLineColor(7);
3644 hElePtCharged->SetLineColor(6);
3646 fhPtCharged->SetLineColor(3);
3647 fhPtCharged->SetMinimum(0.5);
3648 fhPtCharged->Draw();
3649 hPi0PtCharged->Draw("same");
3650 hGamPtCharged->Draw("same");
3651 hNeHadPtCharged->Draw("same");
3652 hChHadPtCharged->Draw("same");
3653 hElePtCharged->Draw("same");
3657 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
3658 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
3659 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
3660 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
3661 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
3662 hPi0EtaCharged->SetLineColor(1);
3663 hGamEtaCharged->SetLineColor(4);
3664 hNeHadEtaCharged->SetLineColor(2);
3665 hChHadEtaCharged->SetLineColor(7);
3666 hEleEtaCharged->SetLineColor(6);
3668 fhEtaCharged->SetLineColor(3);
3669 fhEtaCharged->SetMinimum(0.5);
3670 fhEtaCharged->Draw();
3671 hPi0EtaCharged->Draw("same");
3672 hGamEtaCharged->Draw("same");
3673 hNeHadEtaCharged->Draw("same");
3674 hChHadEtaCharged->Draw("same");
3675 hEleEtaCharged->Draw("same");
3679 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
3680 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
3681 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
3682 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
3683 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
3684 hPi0PhiCharged->SetLineColor(1);
3685 hGamPhiCharged->SetLineColor(4);
3686 hNeHadPhiCharged->SetLineColor(2);
3687 hChHadPhiCharged->SetLineColor(7);
3688 hElePhiCharged->SetLineColor(6);
3690 fhPhiCharged->SetLineColor(3);
3691 fhPhiCharged->SetMinimum(0.5);
3692 fhPhiCharged->Draw();
3693 hPi0PhiCharged->Draw("same");
3694 hGamPhiCharged->Draw("same");
3695 hNeHadPhiCharged->Draw("same");
3696 hChHadPhiCharged->Draw("same");
3697 hElePhiCharged->Draw("same");
3700 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
3701 c22ch->Print(name); printf("Plot: %s\n",name);
3703 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
3704 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
3705 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
3706 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
3708 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
3709 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
3710 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
3711 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
3713 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
3714 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
3715 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
3716 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
3718 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
3719 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
3720 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
3721 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
3723 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
3724 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
3725 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
3726 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
3728 //Ratio: reconstructed track matched/ all reconstructed
3730 sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
3731 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
3735 hEChargedClone->SetMaximum(1.2);
3736 hEChargedClone->SetMinimum(0.001);
3737 hEChargedClone->SetLineColor(3);
3738 hEChargedClone->SetYTitle("track matched / all");
3739 hPi0EChargedClone->Divide(hPi0E);
3740 hGamEChargedClone->Divide(hGamE);
3741 hEleEChargedClone->Divide(hEleE);
3742 hNeHadEChargedClone->Divide(hNeHadE);
3743 hChHadEChargedClone->Divide(hChHadE);
3744 hEChargedClone->Draw();
3745 hPi0EChargedClone->Draw("same");
3746 hGamEChargedClone->Draw("same");
3747 hEleEChargedClone->Draw("same");
3748 hNeHadEChargedClone->Draw("same");
3749 hChHadEChargedClone->Draw("same");
3751 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
3752 pLegend3ch.SetTextSize(0.06);
3753 pLegend3ch.AddEntry(hEChargedClone,"all","L");
3754 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
3755 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
3756 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
3757 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
3758 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
3759 pLegend3ch.SetFillColor(10);
3760 pLegend3ch.SetBorderSize(1);
3764 hPtChargedClone->SetMaximum(1.2);
3765 hPtChargedClone->SetMinimum(0.001);
3766 hPtChargedClone->SetLineColor(3);
3767 hPtChargedClone->SetYTitle("track matched / all");
3768 hPi0PtChargedClone->Divide(hPi0Pt);
3769 hGamPtChargedClone->Divide(hGamPt);
3770 hElePtChargedClone->Divide(hElePt);
3771 hNeHadPtChargedClone->Divide(hNeHadPt);
3772 hChHadPtChargedClone->Divide(hChHadPt);
3773 hPtChargedClone->Draw();
3774 hPi0PtChargedClone->Draw("same");
3775 hGamPtChargedClone->Draw("same");
3776 hElePtChargedClone->Draw("same");
3777 hNeHadPtChargedClone->Draw("same");
3778 hChHadPtChargedClone->Draw("same");
3781 hEtaChargedClone->SetMaximum(1.2);
3782 hEtaChargedClone->SetMinimum(0.001);
3783 hEtaChargedClone->SetLineColor(3);
3784 hEtaChargedClone->SetYTitle("track matched / all");
3785 hPi0EtaChargedClone->Divide(hPi0Eta);
3786 hGamEtaChargedClone->Divide(hGamEta);
3787 hEleEtaChargedClone->Divide(hEleEta);
3788 hNeHadEtaChargedClone->Divide(hNeHadEta);
3789 hChHadEtaChargedClone->Divide(hChHadEta);
3790 hEtaChargedClone->Draw();
3791 hPi0EtaChargedClone->Draw("same");
3792 hGamEtaChargedClone->Draw("same");
3793 hEleEtaChargedClone->Draw("same");
3794 hNeHadEtaChargedClone->Draw("same");
3795 hChHadEtaChargedClone->Draw("same");
3798 hPhiChargedClone->SetMaximum(1.2);
3799 hPhiChargedClone->SetMinimum(0.001);
3800 hPhiChargedClone->SetLineColor(3);
3801 hPhiChargedClone->SetYTitle("track matched / all");
3802 hPi0PhiChargedClone->Divide(hPi0Phi);
3803 hGamPhiChargedClone->Divide(hGamPhi);
3804 hElePhiChargedClone->Divide(hElePhi);
3805 hNeHadPhiChargedClone->Divide(hNeHadPhi);
3806 hChHadPhiChargedClone->Divide(hChHadPhi);
3807 hPhiChargedClone->Draw();
3808 hPi0PhiChargedClone->Draw("same");
3809 hGamPhiChargedClone->Draw("same");
3810 hElePhiChargedClone->Draw("same");
3811 hNeHadPhiChargedClone->Draw("same");
3812 hChHadPhiChargedClone->Draw("same");
3814 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
3815 c3ch->Print(name); printf("Plot: %s\n",name);
3818 //Track-matching distributions
3820 sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
3821 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
3824 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
3825 pLegendpE0.SetTextSize(0.04);
3826 pLegendpE0.AddEntry(fh1pOverE,"all","L");
3827 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
3828 pLegendpE0.SetFillColor(10);
3829 pLegendpE0.SetBorderSize(1);
3830 //pLegendpE0.Draw();
3833 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
3834 fh1pOverE->SetTitle("Track matches p/E");
3836 fh1pOverER02->SetLineColor(4);
3837 fh1pOverER02->Draw("same");
3841 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
3845 fh2MatchdEdx->Draw();
3850 sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
3851 cme->Print(name); printf("Plot: %s\n",name);
3854 sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
3855 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
3860 fhMCEle1pOverE->Draw();
3861 fhMCEle1pOverER02->SetLineColor(4);
3862 fhMCEle1pOverE->SetLineColor(1);
3863 fhMCEle1pOverER02->Draw("same");
3871 fhMCEle2MatchdEdx->Draw();
3873 sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
3874 cmemc->Print(name); printf("Plot: %s\n",name);
3877 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
3878 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
3879 cmemchad->Divide(3,1);
3883 fhMCChHad1pOverE->Draw();
3884 fhMCChHad1pOverER02->SetLineColor(4);
3885 fhMCChHad1pOverE->SetLineColor(1);
3886 fhMCChHad1pOverER02->Draw("same");
3891 fhMCChHad1dR->Draw();
3894 fhMCChHad2MatchdEdx->Draw();
3896 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
3897 cmemchad->Print(name); printf("Plot: %s\n",name);
3899 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
3900 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
3901 cmemcn->Divide(3,1);
3905 fhMCNeutral1pOverE->Draw();
3906 fhMCNeutral1pOverE->SetLineColor(1);
3907 fhMCNeutral1pOverER02->SetLineColor(4);
3908 fhMCNeutral1pOverER02->Draw("same");
3913 fhMCNeutral1dR->Draw();
3916 fhMCNeutral2MatchdEdx->Draw();
3918 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
3919 cmemcn->Print(name); printf("Plot: %s\n",name);
3921 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
3922 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
3927 fh1pOverE->SetLineColor(1);
3928 fhMCEle1pOverE->SetLineColor(4);
3929 fhMCChHad1pOverE->SetLineColor(2);
3930 fhMCNeutral1pOverE->SetLineColor(7);
3931 fh1pOverER02->SetMinimum(0.5);
3933 fhMCEle1pOverE->Draw("same");
3934 fhMCChHad1pOverE->Draw("same");
3935 fhMCNeutral1pOverE->Draw("same");
3936 TLegend pLegendpE(0.65,0.55,0.9,0.8);
3937 pLegendpE.SetTextSize(0.06);
3938 pLegendpE.AddEntry(fh1pOverE,"all","L");
3939 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
3940 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
3941 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
3942 pLegendpE.SetFillColor(10);
3943 pLegendpE.SetBorderSize(1);
3948 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
3949 fh1pOverER02->SetLineColor(1);
3950 fhMCEle1pOverER02->SetLineColor(4);
3951 fhMCChHad1pOverER02->SetLineColor(2);
3952 fhMCNeutral1pOverER02->SetLineColor(7);
3953 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
3954 fh1pOverER02->SetMinimum(0.5);
3955 fh1pOverER02->Draw();
3956 fhMCEle1pOverER02->Draw("same");
3957 fhMCChHad1pOverER02->Draw("same");
3958 fhMCNeutral1pOverER02->Draw("same");
3960 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
3961 // pLegendpE2.SetTextSize(0.06);
3962 // pLegendpE2.SetHeader("dR < 0.02");
3963 // pLegendpE2.SetFillColor(10);
3964 // pLegendpE2.SetBorderSize(1);
3965 // pLegendpE2.Draw();
3967 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
3968 cmpoe->Print(name); printf("Plot: %s\n",name);
3972 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
3973 gROOT->ProcessLine(line);
3974 sprintf(line, ".!rm -fR *.eps");
3975 gROOT->ProcessLine(line);
3977 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());