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), fhNClusters(0), fhNCells(0),
76 fhAmplitude(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), fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNClusters(qa.fhNClusters),
125 fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude), fhTime(qa.fhTime), fhTimeId(qa.fhTimeId),fhTimeAmp(qa.fhTimeAmp),
126 fhCaloCorrNClusters(qa.fhCaloCorrNClusters), fhCaloCorrEClusters(qa.fhCaloCorrEClusters),
127 fhCaloCorrNCells(qa.fhCaloCorrNCells), fhCaloCorrECells(qa.fhCaloCorrECells),
128 fhEMod(qa.fhEMod),fhNClustersMod(qa.fhNClustersMod), fhNCellsPerClusterMod(qa.fhNCellsPerClusterMod), fhNCellsMod(qa.fhNCellsMod),
129 fhGridCellsMod(qa.fhGridCellsMod), fhGridCellsEMod(qa.fhGridCellsEMod), fhAmplitudeMod(qa.fhAmplitudeMod),
130 fhIMMod(qa.fhIMMod),fhIMCellCutMod(qa.fhIMCellCutMod),
131 fhGenGamPt(qa.fhGenGamPt), fhGenGamEta(qa.fhGenGamEta), fhGenGamPhi(qa.fhGenGamPhi),
132 fhGenPi0Pt(qa.fhGenPi0Pt), fhGenPi0Eta(qa.fhGenPi0Eta), fhGenPi0Phi(qa.fhGenPi0Phi),
133 fhGenEtaPt(qa.fhGenEtaPt), fhGenEtaEta(qa.fhGenEtaEta), fhGenEtaPhi(qa.fhGenEtaPhi),
134 fhGenOmegaPt(qa.fhGenOmegaPt), fhGenOmegaEta(qa.fhGenOmegaEta), fhGenOmegaPhi(qa.fhGenOmegaPhi),
135 fhGenElePt(qa.fhGenElePt), fhGenEleEta(qa.fhGenEleEta), fhGenElePhi(qa.fhGenElePhi),
136 fhEMVxyz(qa.fhEMVxyz), fhEMR(qa.fhEMR), fhHaVxyz(qa.fhHaVxyz), fhHaR(qa.fhHaR),
137 fhGamE(qa.fhGamE),fhGamPt(qa.fhGamPt),fhGamPhi(qa.fhGamPhi),fhGamEta(qa.fhGamEta),
138 fhGamDeltaE(qa.fhGamDeltaE), fhGamDeltaPt(qa.fhGamDeltaPt), fhGamDeltaPhi(qa.fhGamDeltaPhi), fhGamDeltaEta(qa.fhGamDeltaEta),
139 fhGamRatioE(qa.fhGamRatioE), fhGamRatioPt(qa.fhGamRatioPt), fhGamRatioPhi(qa.fhGamRatioPhi), fhGamRatioEta(qa.fhGamRatioEta),
140 fhEleE(qa.fhEleE),fhElePt(qa.fhElePt),fhElePhi(qa.fhElePhi),fhEleEta(qa.fhEleEta),
141 fhPi0E(qa.fhPi0E),fhPi0Pt(qa.fhPi0Pt),fhPi0Phi(qa.fhPi0Phi),fhPi0Eta(qa.fhPi0Eta),
142 fhNeHadE(qa.fhNeHadE),fhNeHadPt(qa.fhNeHadPt),fhNeHadPhi(qa.fhNeHadPhi),fhNeHadEta(qa.fhNeHadEta),
143 fhChHadE(qa.fhChHadE),fhChHadPt(qa.fhChHadPt),fhChHadPhi(qa.fhChHadPhi),fhChHadEta(qa.fhChHadEta),
144 fhGamECharged(qa.fhGamECharged),fhGamPtCharged(qa.fhGamPtCharged),fhGamPhiCharged(qa.fhGamPhiCharged),fhGamEtaCharged(qa.fhGamEtaCharged),
145 fhEleECharged(qa.fhEleECharged),fhElePtCharged(qa.fhElePtCharged),fhElePhiCharged(qa.fhElePhiCharged),fhEleEtaCharged(qa.fhEleEtaCharged),
146 fhPi0ECharged(qa.fhPi0ECharged),fhPi0PtCharged(qa.fhPi0PtCharged),fhPi0PhiCharged(qa.fhPi0PhiCharged),fhPi0EtaCharged(qa.fhPi0EtaCharged),
147 fhNeHadECharged(qa.fhNeHadECharged),fhNeHadPtCharged(qa.fhNeHadPtCharged),fhNeHadPhiCharged(qa.fhNeHadPhiCharged),fhNeHadEtaCharged(qa.fhNeHadEtaCharged),
148 fhChHadECharged(qa.fhChHadECharged),fhChHadPtCharged(qa.fhChHadPtCharged),fhChHadPhiCharged(qa.fhChHadPhiCharged),fhChHadEtaCharged(qa.fhChHadEtaCharged),
149 fhGenGamAccE(qa.fhGenGamAccE),fhGenGamAccPt(qa.fhGenGamAccPt),fhGenGamAccEta(qa.fhGenGamAccEta),fhGenGamAccPhi(qa.fhGenGamAccPhi),
150 fhGenPi0AccE(qa.fhGenPi0AccE),fhGenPi0AccPt(qa.fhGenPi0AccPt),fhGenPi0AccEta(qa.fhGenPi0AccEta),fhGenPi0AccPhi(qa.fhGenPi0AccPhi),
151 fh1pOverE(qa.fh1pOverE),fh1dR(qa.fh1dR),fh2EledEdx(qa.fh2EledEdx), fh2MatchdEdx(qa.fh2MatchdEdx),
152 fhMCEle1pOverE(qa.fhMCEle1pOverE),fhMCEle1dR(qa.fhMCEle1dR), fhMCEle2MatchdEdx(qa.fhMCEle2MatchdEdx),
153 fhMCChHad1pOverE(qa.fhMCChHad1pOverE),fhMCChHad1dR(qa.fhMCChHad1dR), fhMCChHad2MatchdEdx(qa.fhMCChHad2MatchdEdx),
154 fhMCNeutral1pOverE(qa.fhMCNeutral1pOverE),fhMCNeutral1dR(qa.fhMCNeutral1dR), fhMCNeutral2MatchdEdx(qa.fhMCNeutral2MatchdEdx),
155 fh1pOverER02(qa.fh1pOverER02), fhMCEle1pOverER02(qa.fhMCEle1pOverER02),fhMCChHad1pOverER02(qa.fhMCChHad1pOverER02), fhMCNeutral1pOverER02(qa.fhMCNeutral1pOverER02)
161 //_________________________________________________________________________
162 AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA & qa)
164 // assignment operator
166 if(this == &qa)return *this;
167 ((AliAnaPartCorrBaseClass *)this)->operator=(qa);
169 fCalorimeter = qa.fCalorimeter;
170 fStyleMacro = qa.fStyleMacro;
171 fMakePlots = qa.fMakePlots;
172 fCorrelateCalos = qa.fCorrelateCalos;
173 fNModules = qa.fNModules;
175 fHistoPOverEBins = qa.fHistoPOverEBins; fHistoPOverEMax = qa.fHistoPOverEMax; fHistoPOverEMin = qa.fHistoPOverEMin;
176 fHistodEdxBins = qa.fHistodEdxBins; fHistodEdxMax = qa.fHistodEdxMax; fHistodEdxMin = qa.fHistodEdxMin;
177 fHistodRBins = qa.fHistodRBins; fHistodRMax = qa.fHistodRMax; fHistodRMin = qa.fHistodRMin;
178 fHistoTimeBins = qa.fHistoTimeBins; fHistoTimeMax = qa.fHistoTimeMax; fHistoTimeMin = qa.fHistoTimeMin;
179 fHistoNBins = qa.fHistoNBins; fHistoNMax = qa.fHistoNMax; fHistoNMin = qa.fHistoNMin;
180 fHistoRatioBins = qa.fHistoRatioBins; fHistoRatioMax = qa.fHistoRatioMax; fHistoRatioMin = qa.fHistoRatioMin;
181 fHistoVertexDistBins = qa.fHistoVertexDistBins; fHistoVertexDistMax = qa.fHistoVertexDistMax; fHistoVertexDistMin = qa.fHistoVertexDistMin;
187 fhEtaPhi = qa.fhEtaPhi;
188 fhEtaPhiE= qa.fhEtaPhiE;
190 fhECharged = qa.fhECharged;
191 fhPtCharged = qa.fhPtCharged;
192 fhPhiCharged = qa.fhPhiCharged;
193 fhEtaCharged = qa.fhEtaCharged;
194 fhEtaPhiCharged = qa.fhEtaPhiCharged;
196 fhEChargedNoOut = qa.fhEChargedNoOut;
197 fhPtChargedNoOut = qa.fhPtChargedNoOut;
198 fhPhiChargedNoOut = qa.fhPhiChargedNoOut;
199 fhEtaChargedNoOut = qa.fhEtaChargedNoOut;
200 fhEtaPhiChargedNoOut = qa.fhEtaPhiChargedNoOut;
202 fhIM = qa.fhIM; fhIMCellCut = qa.fhIMCellCut;
205 fhNCellsPerCluster = qa.fhNCellsPerCluster;
206 fhNClusters = qa.fhNClusters;
208 fhDeltaE = qa.fhDeltaE;
209 fhDeltaPt = qa.fhDeltaPt;
210 fhDeltaPhi = qa.fhDeltaPhi;
211 fhDeltaEta = qa.fhDeltaEta;
213 fhRatioE = qa.fhRatioE;
214 fhRatioPt = qa.fhRatioPt;
215 fhRatioPhi = qa.fhRatioPhi;
216 fhRatioEta = qa.fhRatioEta;
224 fhNCells = qa.fhNCells;
225 fhAmplitude = qa.fhAmplitude;
227 fhTimeId = qa.fhTimeId;
228 fhTimeAmp = qa.fhTimeAmp;
230 fhCaloCorrNClusters = qa.fhCaloCorrNClusters; fhCaloCorrEClusters = qa.fhCaloCorrEClusters;
231 fhCaloCorrNCells = qa.fhCaloCorrNCells; fhCaloCorrECells = qa.fhCaloCorrECells;
233 fhEMod = qa.fhEMod; fhNClustersMod = qa.fhNClustersMod;
234 fhNCellsPerClusterMod = qa.fhNCellsPerClusterMod; fhNCellsMod = qa.fhNCellsMod;
235 fhGridCellsMod = qa.fhGridCellsMod; fhGridCellsEMod = qa.fhGridCellsEMod;
236 fhAmplitudeMod = qa.fhAmplitudeMod; fhIMMod=qa.fhIMMod; fhIMCellCutMod=qa.fhIMCellCutMod;
238 fhGenGamPt = qa.fhGenGamPt ; fhGenGamEta = qa.fhGenGamEta ; fhGenGamPhi = qa.fhGenGamPhi ;
239 fhGenPi0Pt = qa.fhGenPi0Pt ; fhGenPi0Eta = qa.fhGenPi0Eta ; fhGenPi0Phi = qa.fhGenPi0Phi ;
240 fhGenEtaPt = qa.fhGenEtaPt ; fhGenEtaEta = qa.fhGenEtaEta ; fhGenEtaPhi = qa.fhGenEtaPhi ;
241 fhGenOmegaPt = qa.fhGenOmegaPt ; fhGenOmegaEta = qa.fhGenOmegaEta ; fhGenOmegaPhi = qa.fhGenOmegaPhi ;
242 fhGenElePt = qa.fhGenElePt ; fhGenEleEta = qa.fhGenEleEta ; fhGenElePhi = qa.fhGenElePhi ;
244 fhEMVxyz = qa.fhEMVxyz ; fhEMR = qa.fhEMR ; fhHaVxyz = qa.fhHaVxyz ; fhHaR = qa.fhHaR ;
245 fhGamE = qa.fhGamE ;fhGamPt = qa.fhGamPt ;fhGamPhi = qa.fhGamPhi ;fhGamEta = qa.fhGamEta ;
246 fhGamDeltaE = qa.fhDeltaE; fhGamDeltaPt = qa.fhDeltaPt; fhGamDeltaPhi = qa.fhDeltaPhi; fhGamDeltaEta = qa.fhDeltaEta;
248 fhGamRatioE = qa.fhGamRatioE; fhGamRatioPt = qa.fhGamRatioPt; fhGamRatioPhi = qa.fhGamRatioPhi; fhGamRatioEta = qa.fhGamRatioEta;
250 fhEleE = qa.fhEleE ;fhElePt = qa.fhElePt ;fhElePhi = qa.fhElePhi ;fhEleEta = qa.fhEleEta ;
251 fhPi0E = qa.fhPi0E ;fhPi0Pt = qa.fhPi0Pt ;fhPi0Phi = qa.fhPi0Phi ;fhPi0Eta = qa.fhPi0Eta ;
252 fhNeHadE = qa.fhNeHadE ;fhNeHadPt = qa.fhNeHadPt ;fhNeHadPhi = qa.fhNeHadPhi ;fhNeHadEta = qa.fhNeHadEta ;
253 fhChHadE = qa.fhChHadE ;fhChHadPt = qa.fhChHadPt ;fhChHadPhi = qa.fhChHadPhi ;fhChHadEta = qa.fhChHadEta ;
254 fhGenGamAccE = qa.fhGenGamAccE ; fhGenPi0AccE = qa.fhGenPi0AccE ;
255 fhGenGamAccPt = qa.fhGenGamAccPt ;fhGenGamAccEta = qa.fhGenGamAccEta ;fhGenGamAccPhi = qa.fhGenGamAccPhi ;
256 fhGenPi0AccPt = qa.fhGenPi0AccPt ;fhGenPi0AccEta = qa.fhGenPi0AccEta; fhGenPi0AccPhi = qa.fhGenPi0AccPhi ;
258 fhGamECharged = qa.fhGamECharged; fhGamPtCharged = qa.fhGamPtCharged; fhGamPhiCharged = qa.fhGamPhiCharged; fhGamEtaCharged = qa.fhGamEtaCharged;
259 fhEleECharged = qa.fhEleECharged; fhElePtCharged = qa.fhElePtCharged; fhElePhiCharged = qa.fhElePhiCharged; fhEleEtaCharged = qa.fhEleEtaCharged;
260 fhPi0ECharged = qa.fhPi0ECharged; fhPi0PtCharged = qa.fhPi0PtCharged; fhPi0PhiCharged = qa.fhPi0PhiCharged; fhPi0EtaCharged = qa.fhPi0EtaCharged;
261 fhNeHadECharged = qa.fhNeHadECharged; fhNeHadPtCharged = qa.fhNeHadPtCharged; fhNeHadPhiCharged = qa.fhNeHadPhiCharged; fhNeHadEtaCharged = qa.fhNeHadEtaCharged;
262 fhChHadECharged = qa.fhChHadECharged; fhChHadPtCharged = qa.fhChHadPtCharged; fhChHadPhiCharged = qa.fhChHadPhiCharged; fhChHadEtaCharged = qa.fhChHadEtaCharged;
264 fh1pOverE = qa.fh1pOverE;
266 fh2MatchdEdx = qa.fh2MatchdEdx;
267 fh2EledEdx = qa.fh2EledEdx;
269 fhMCEle1pOverE = qa.fhMCEle1pOverE;
270 fhMCEle1dR = qa.fhMCEle1dR;
271 fhMCEle2MatchdEdx = qa.fhMCEle2MatchdEdx ;
273 fhMCChHad1pOverE = qa.fhMCChHad1pOverE; fhMCChHad1dR = qa.fhMCChHad1dR; fhMCChHad2MatchdEdx = qa.fhMCChHad2MatchdEdx;
274 fhMCNeutral1pOverE = qa.fhMCNeutral1pOverE; fhMCNeutral1dR = qa.fhMCNeutral1dR; fhMCNeutral2MatchdEdx = qa.fhMCNeutral2MatchdEdx;
275 fh1pOverER02 = qa.fh1pOverER02; fhMCEle1pOverER02 = qa.fhMCEle1pOverER02; fhMCChHad1pOverER02 = qa.fhMCChHad1pOverER02;
276 fhMCNeutral1pOverER02 = qa.fhMCNeutral1pOverER02;
282 //________________________________________________________________________________________________________________________________________________
283 //AliAnaCalorimeterQA::~AliAnaCalorimeterQA() {
289 //________________________________________________________________________
290 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
292 // Create histograms to be saved in output file and
293 // store them in outputContainer
295 //If Geometry library loaded, do geometry selection during analysis.
296 if(fCalorimeter=="PHOS"){
297 if(!GetReader()->GetPHOSGeometry()) printf("AliAnaPi0::GetCreateOutputObjects() - Initialize PHOS geometry!\n");
298 GetReader()->InitPHOSGeometry();
301 else if(fCalorimeter=="EMCAL"){
302 if(!GetReader()->GetEMCALGeometry()) printf("AliAnaPi0::GetCreateOutputObjects() - Initialize EMCAL geometry!\n");
303 GetReader()->InitEMCALGeometry();
307 TList * outputContainer = new TList() ;
308 outputContainer->SetName("QAHistos") ;
311 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
312 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
313 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
314 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
315 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
316 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
317 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
318 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
319 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
320 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
321 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
322 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
328 if(fCalorimeter=="PHOS"){
334 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins,ptmin,ptmax);
335 fhE->SetXTitle("E (GeV)");
336 outputContainer->Add(fhE);
338 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
339 fhPt->SetXTitle("p_{T} (GeV/c)");
340 outputContainer->Add(fhPt);
342 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
343 fhPhi->SetXTitle("#phi (rad)");
344 outputContainer->Add(fhPhi);
346 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
347 fhEta->SetXTitle("#eta ");
348 outputContainer->Add(fhEta);
350 fhEtaPhi = new TH2F ("hEtaPhi","#eta vs #phi, reconstructed clusters ",netabins,etamin,etamax,nphibins,phimin,phimax);
351 fhEtaPhi->SetXTitle("#eta ");
352 fhEtaPhi->SetYTitle("#phi ");
353 outputContainer->Add(fhEtaPhi);
355 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
356 fhEtaPhiE->SetXTitle("#eta ");
357 fhEtaPhiE->SetYTitle("#phi (rad)");
358 fhEtaPhiE->SetZTitle("E (GeV) ");
359 outputContainer->Add(fhEtaPhiE);
363 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
364 fhECharged->SetXTitle("E (GeV)");
365 outputContainer->Add(fhECharged);
367 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
368 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
369 outputContainer->Add(fhPtCharged);
371 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
372 fhPhiCharged->SetXTitle("#phi (rad)");
373 outputContainer->Add(fhPhiCharged);
375 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
376 fhEtaCharged->SetXTitle("#eta ");
377 outputContainer->Add(fhEtaCharged);
379 fhEtaPhiCharged = new TH2F ("hEtaPhiCharged","#eta vs #phi, reconstructed clusters, matched with track",netabins,etamin,etamax,nphibins,phimin,phimax);
380 fhEtaPhiCharged->SetXTitle("#eta ");
381 fhEtaPhiCharged->SetYTitle("#phi ");
382 outputContainer->Add(fhEtaPhiCharged);
384 fhEChargedNoOut = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
385 fhEChargedNoOut->SetXTitle("E (GeV)");
386 outputContainer->Add(fhEChargedNoOut);
388 fhPtChargedNoOut = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
389 fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
390 outputContainer->Add(fhPtChargedNoOut);
392 fhPhiChargedNoOut = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax);
393 fhPhiChargedNoOut->SetXTitle("#phi (rad)");
394 outputContainer->Add(fhPhiChargedNoOut);
396 fhEtaChargedNoOut = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax);
397 fhEtaChargedNoOut->SetXTitle("#eta ");
398 outputContainer->Add(fhEtaChargedNoOut);
400 fhEtaPhiChargedNoOut = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);
401 fhEtaPhiChargedNoOut->SetXTitle("#eta ");
402 fhEtaPhiChargedNoOut->SetYTitle("#phi ");
403 outputContainer->Add(fhEtaPhiChargedNoOut);
405 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
406 fh1pOverE->SetYTitle("p/E");
407 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
408 outputContainer->Add(fh1pOverE);
410 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
411 fh1dR->SetXTitle("#Delta R (rad)");
412 outputContainer->Add(fh1dR) ;
414 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
415 fh2MatchdEdx->SetXTitle("p (GeV/c)");
416 fh2MatchdEdx->SetYTitle("<dE/dx>");
417 outputContainer->Add(fh2MatchdEdx);
419 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
420 fh2EledEdx->SetXTitle("p (GeV/c)");
421 fh2EledEdx->SetYTitle("<dE/dx>");
422 outputContainer->Add(fh2EledEdx) ;
424 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
425 fh1pOverER02->SetYTitle("p/E");
426 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
427 outputContainer->Add(fh1pOverER02);
429 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
430 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
431 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
432 outputContainer->Add(fhIM);
434 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
435 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
436 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
437 outputContainer->Add(fhIMCellCut);
439 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
440 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
441 fhAsym->SetYTitle("Asymmetry");
442 outputContainer->Add(fhAsym);
444 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs cluster energy", nptbins,ptmin,ptmax, nbins,nmin,nmax);
445 fhNCellsPerCluster->SetXTitle("E (GeV)");
446 fhNCellsPerCluster->SetYTitle("n cells");
447 outputContainer->Add(fhNCellsPerCluster);
449 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
450 fhNClusters->SetXTitle("number of clusters");
451 outputContainer->Add(fhNClusters);
454 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
455 fhNCells->SetXTitle("n cells");
456 outputContainer->Add(fhNCells);
458 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
459 fhAmplitude->SetXTitle("Cell Energy (GeV)");
460 outputContainer->Add(fhAmplitude);
462 //Cell Time histograms, time only available in ESDs
463 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
464 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
465 fhTime->SetXTitle("Cell Time (ns)");
466 outputContainer->Add(fhTime);
468 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax,0,rowmax*colmax);
469 fhTimeId->SetXTitle("Cell Time (ns)");
470 fhTimeId->SetYTitle("Cell Absolute Id");
471 outputContainer->Add(fhTimeId);
473 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
474 fhTimeAmp->SetYTitle("Cell Time (ns)");
475 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
476 outputContainer->Add(fhTimeAmp);
480 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
481 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
482 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
483 outputContainer->Add(fhCaloCorrNClusters);
485 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
486 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
487 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
488 outputContainer->Add(fhCaloCorrEClusters);
490 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
491 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
492 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
493 outputContainer->Add(fhCaloCorrNCells);
495 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
496 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
497 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
498 outputContainer->Add(fhCaloCorrECells);
499 }//correlate calorimeters
502 fhEMod = new TH1F*[fNModules];
503 fhNClustersMod = new TH1F*[fNModules];
504 fhNCellsPerClusterMod = new TH2F*[fNModules];
505 fhNCellsMod = new TH1F*[fNModules];
506 fhGridCellsMod = new TH2F*[fNModules];
507 fhGridCellsEMod = new TH2F*[fNModules];
508 fhAmplitudeMod = new TH1F*[fNModules];
509 fhIMMod = new TH2F*[fNModules];
510 fhIMCellCutMod = new TH2F*[fNModules];
512 for(Int_t imod = 0; imod < fNModules; imod++){
514 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
515 fhEMod[imod]->SetXTitle("E (GeV)");
516 outputContainer->Add(fhEMod[imod]);
518 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
519 fhNClustersMod[imod]->SetXTitle("number of clusters");
520 outputContainer->Add(fhNClustersMod[imod]);
522 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
523 Form("# cells per cluster vs cluster energy in Module %d",imod),
524 nptbins,ptmin,ptmax, nbins,nmin,nmax);
525 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
526 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
527 outputContainer->Add(fhNCellsPerClusterMod[imod]);
529 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
530 fhNCellsMod[imod]->SetXTitle("n cells");
531 outputContainer->Add(fhNCellsMod[imod]);
532 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
533 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
534 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
535 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
536 outputContainer->Add(fhGridCellsMod[imod]);
538 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
539 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
540 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
541 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
542 outputContainer->Add(fhGridCellsEMod[imod]);
544 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
545 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
546 outputContainer->Add(fhAmplitudeMod[imod]);
548 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
549 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
550 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
551 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
552 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
553 outputContainer->Add(fhIMMod[imod]);
555 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
556 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
557 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
558 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
559 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
560 outputContainer->Add(fhIMCellCutMod[imod]);
565 //Monte Carlo Histograms
568 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
569 fhDeltaE->SetXTitle("#Delta E (GeV)");
570 outputContainer->Add(fhDeltaE);
572 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
573 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
574 outputContainer->Add(fhDeltaPt);
576 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
577 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
578 outputContainer->Add(fhDeltaPhi);
580 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
581 fhDeltaEta->SetXTitle("#Delta #eta ");
582 outputContainer->Add(fhDeltaEta);
584 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
585 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
586 outputContainer->Add(fhRatioE);
588 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
589 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
590 outputContainer->Add(fhRatioPt);
592 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
593 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
594 outputContainer->Add(fhRatioPhi);
596 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
597 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
598 outputContainer->Add(fhRatioEta);
600 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
601 fh2E->SetXTitle("E_{rec} (GeV)");
602 fh2E->SetYTitle("E_{gen} (GeV)");
603 outputContainer->Add(fh2E);
605 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
606 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
607 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
608 outputContainer->Add(fh2Pt);
610 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
611 fh2Phi->SetXTitle("#phi_{rec} (rad)");
612 fh2Phi->SetYTitle("#phi_{gen} (rad)");
613 outputContainer->Add(fh2Phi);
615 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
616 fh2Eta->SetXTitle("#eta_{rec} ");
617 fh2Eta->SetYTitle("#eta_{gen} ");
618 outputContainer->Add(fh2Eta);
620 //Fill histos depending on origin of cluster
621 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
622 fhGamE->SetXTitle("E_{rec} (GeV)");
623 fhGamE->SetXTitle("E_{gen} (GeV)");
624 outputContainer->Add(fhGamE);
626 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
627 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
628 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
629 outputContainer->Add(fhGamPt);
631 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
632 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
633 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
634 outputContainer->Add(fhGamPhi);
636 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
637 fhGamEta->SetXTitle("#eta_{rec} ");
638 fhGamEta->SetYTitle("#eta_{gen} ");
639 outputContainer->Add(fhGamEta);
641 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
642 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
643 outputContainer->Add(fhGamDeltaE);
645 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
646 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
647 outputContainer->Add(fhGamDeltaPt);
649 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
650 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
651 outputContainer->Add(fhGamDeltaPhi);
653 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
654 fhGamDeltaEta->SetXTitle("#Delta #eta ");
655 outputContainer->Add(fhGamDeltaEta);
657 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
658 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
659 outputContainer->Add(fhGamRatioE);
661 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
662 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
663 outputContainer->Add(fhGamRatioPt);
665 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
666 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
667 outputContainer->Add(fhGamRatioPhi);
669 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
670 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
671 outputContainer->Add(fhGamRatioEta);
673 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
674 fhPi0E->SetXTitle("E_{rec} (GeV)");
675 fhPi0E->SetYTitle("E_{gen} (GeV)");
676 outputContainer->Add(fhPi0E);
678 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
679 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
680 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
681 outputContainer->Add(fhPi0Pt);
683 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
684 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
685 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
686 outputContainer->Add(fhPi0Phi);
688 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
689 fhPi0Eta->SetXTitle("#eta_{rec} ");
690 fhPi0Eta->SetYTitle("#eta_{gen} ");
691 outputContainer->Add(fhPi0Eta);
693 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
694 fhEleE->SetXTitle("E_{rec} (GeV)");
695 fhEleE->SetXTitle("E_{gen} (GeV)");
696 outputContainer->Add(fhEleE);
698 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
699 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
700 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
701 outputContainer->Add(fhElePt);
703 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
704 fhElePhi->SetXTitle("#phi_{rec} (rad)");
705 fhElePhi->SetYTitle("#phi_{gen} (rad)");
706 outputContainer->Add(fhElePhi);
708 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
709 fhEleEta->SetXTitle("#eta_{rec} ");
710 fhEleEta->SetYTitle("#eta_{gen} ");
711 outputContainer->Add(fhEleEta);
713 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
714 fhNeHadE->SetXTitle("E_{rec} (GeV)");
715 fhNeHadE->SetYTitle("E_{gen} (GeV)");
716 outputContainer->Add(fhNeHadE);
718 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
719 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
720 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
721 outputContainer->Add(fhNeHadPt);
723 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
724 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
725 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
726 outputContainer->Add(fhNeHadPhi);
728 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
729 fhNeHadEta->SetXTitle("#eta_{rec} ");
730 fhNeHadEta->SetYTitle("#eta_{gen} ");
731 outputContainer->Add(fhNeHadEta);
733 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
734 fhChHadE->SetXTitle("E_{rec} (GeV)");
735 fhChHadE->SetYTitle("E_{gen} (GeV)");
736 outputContainer->Add(fhChHadE);
738 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
739 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
740 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
741 outputContainer->Add(fhChHadPt);
743 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
744 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
745 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
746 outputContainer->Add(fhChHadPhi);
748 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
749 fhChHadEta->SetXTitle("#eta_{rec} ");
750 fhChHadEta->SetYTitle("#eta_{gen} ");
751 outputContainer->Add(fhChHadEta);
755 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
756 fhGamECharged->SetXTitle("E_{rec} (GeV)");
757 fhGamECharged->SetXTitle("E_{gen} (GeV)");
758 outputContainer->Add(fhGamECharged);
760 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
761 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
762 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
763 outputContainer->Add(fhGamPtCharged);
765 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
766 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
767 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
768 outputContainer->Add(fhGamPhiCharged);
770 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
771 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
772 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
773 outputContainer->Add(fhGamEtaCharged);
775 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
776 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
777 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
778 outputContainer->Add(fhPi0ECharged);
780 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
781 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
782 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
783 outputContainer->Add(fhPi0PtCharged);
785 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
786 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
787 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
788 outputContainer->Add(fhPi0PhiCharged);
790 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
791 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
792 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
793 outputContainer->Add(fhPi0EtaCharged);
795 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
796 fhEleECharged->SetXTitle("E_{rec} (GeV)");
797 fhEleECharged->SetXTitle("E_{gen} (GeV)");
798 outputContainer->Add(fhEleECharged);
800 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
801 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
802 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
803 outputContainer->Add(fhElePtCharged);
805 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
806 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
807 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
808 outputContainer->Add(fhElePhiCharged);
810 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
811 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
812 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
813 outputContainer->Add(fhEleEtaCharged);
815 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
816 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
817 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
818 outputContainer->Add(fhNeHadECharged);
820 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
821 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
822 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
823 outputContainer->Add(fhNeHadPtCharged);
825 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
826 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
827 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
828 outputContainer->Add(fhNeHadPhiCharged);
830 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
831 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
832 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
833 outputContainer->Add(fhNeHadEtaCharged);
835 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
836 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
837 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
838 outputContainer->Add(fhChHadECharged);
840 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
841 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
842 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
843 outputContainer->Add(fhChHadPtCharged);
845 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
846 fhChHadPhiCharged->SetXTitle("#phi (rad)");
847 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
848 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
849 outputContainer->Add(fhChHadPhiCharged);
851 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
852 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
853 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
854 outputContainer->Add(fhChHadEtaCharged);
856 //Vertex of generated particles
858 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
859 fhEMVxyz->SetXTitle("v_{x}");
860 fhEMVxyz->SetYTitle("v_{y}");
861 //fhEMVxyz->SetZTitle("v_{z}");
862 outputContainer->Add(fhEMVxyz);
864 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
865 fhHaVxyz->SetXTitle("v_{x}");
866 fhHaVxyz->SetYTitle("v_{y}");
867 //fhHaVxyz->SetZTitle("v_{z}");
868 outputContainer->Add(fhHaVxyz);
870 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
871 fhEMR->SetXTitle("E (GeV)");
872 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
873 outputContainer->Add(fhEMR);
875 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
876 fhHaR->SetXTitle("E (GeV)");
877 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
878 outputContainer->Add(fhHaR);
883 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
884 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
885 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
887 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
888 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
889 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
891 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
892 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
893 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
895 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
896 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
897 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
899 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
900 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
901 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
903 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
904 fhGenGamEta->SetXTitle("#eta");
905 fhGenGamPhi->SetXTitle("#phi (rad)");
906 outputContainer->Add(fhGenGamPt);
907 outputContainer->Add(fhGenGamEta);
908 outputContainer->Add(fhGenGamPhi);
910 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
911 fhGenPi0Eta->SetXTitle("#eta");
912 fhGenPi0Phi->SetXTitle("#phi (rad)");
913 outputContainer->Add(fhGenPi0Pt);
914 outputContainer->Add(fhGenPi0Eta);
915 outputContainer->Add(fhGenPi0Phi);
917 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
918 fhGenEtaEta->SetXTitle("#eta");
919 fhGenEtaPhi->SetXTitle("#phi (rad)");
920 outputContainer->Add(fhGenEtaPt);
921 outputContainer->Add(fhGenEtaEta);
922 outputContainer->Add(fhGenEtaPhi);
924 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
925 fhGenOmegaEta->SetXTitle("#eta");
926 fhGenOmegaPhi->SetXTitle("#phi (rad)");
927 outputContainer->Add(fhGenOmegaPt);
928 outputContainer->Add(fhGenOmegaEta);
929 outputContainer->Add(fhGenOmegaPhi);
931 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
932 fhGenEleEta->SetXTitle("#eta");
933 fhGenElePhi->SetXTitle("#phi (rad)");
934 outputContainer->Add(fhGenElePt);
935 outputContainer->Add(fhGenEleEta);
936 outputContainer->Add(fhGenElePhi);
938 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
939 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
940 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
941 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
943 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
944 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
945 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
946 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
948 fhGenGamAccE ->SetXTitle("E (GeV)");
949 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
950 fhGenGamAccEta->SetXTitle("#eta");
951 fhGenGamAccPhi->SetXTitle("#phi (rad)");
952 outputContainer->Add(fhGenGamAccE);
953 outputContainer->Add(fhGenGamAccPt);
954 outputContainer->Add(fhGenGamAccEta);
955 outputContainer->Add(fhGenGamAccPhi);
957 fhGenPi0AccE ->SetXTitle("E (GeV)");
958 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
959 fhGenPi0AccEta->SetXTitle("#eta");
960 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
961 outputContainer->Add(fhGenPi0AccE);
962 outputContainer->Add(fhGenPi0AccPt);
963 outputContainer->Add(fhGenPi0AccEta);
964 outputContainer->Add(fhGenPi0AccPhi);
968 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
969 fhMCEle1pOverE->SetYTitle("p/E");
970 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
971 outputContainer->Add(fhMCEle1pOverE);
973 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
974 fhMCEle1dR->SetXTitle("#Delta R (rad)");
975 outputContainer->Add(fhMCEle1dR) ;
977 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
978 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
979 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
980 outputContainer->Add(fhMCEle2MatchdEdx);
982 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
983 fhMCChHad1pOverE->SetYTitle("p/E");
984 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
985 outputContainer->Add(fhMCChHad1pOverE);
987 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
988 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
989 outputContainer->Add(fhMCChHad1dR) ;
991 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
992 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
993 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
994 outputContainer->Add(fhMCChHad2MatchdEdx);
996 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
997 fhMCNeutral1pOverE->SetYTitle("p/E");
998 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
999 outputContainer->Add(fhMCNeutral1pOverE);
1001 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1002 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1003 outputContainer->Add(fhMCNeutral1dR) ;
1005 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1006 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1007 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1008 outputContainer->Add(fhMCNeutral2MatchdEdx);
1010 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1011 fhMCEle1pOverER02->SetYTitle("p/E");
1012 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1013 outputContainer->Add(fhMCEle1pOverER02);
1015 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1016 fhMCChHad1pOverER02->SetYTitle("p/E");
1017 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1018 outputContainer->Add(fhMCChHad1pOverER02);
1020 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1021 fhMCNeutral1pOverER02->SetYTitle("p/E");
1022 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1023 outputContainer->Add(fhMCNeutral1pOverER02);
1026 return outputContainer;
1029 //____________________________________________________________________________________________________________________________________________________
1030 Int_t AliAnaCalorimeterQA::GetModuleNumber(AliESDCaloCluster * cluster)
1032 //Get the EMCAL/PHOS module number that corresponds to this cluster
1034 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
1035 cluster->GetMomentum(lv,v);
1036 Float_t phi = lv.Phi();
1037 if(phi < 0) phi+=TMath::TwoPi();
1039 if(fCalorimeter=="EMCAL"){
1040 GetReader()->GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
1042 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
1043 lv.Eta(), phi*TMath::RadToDeg(),absId, GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId));
1044 return GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId) ;
1048 if ( cluster->GetNCells() > 0) {
1049 absId = cluster->GetCellAbsId(0);
1051 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
1052 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
1057 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1059 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - PHOS: Module %d\n",relId[0]-1);
1068 //____________________________________________________________________________________________________________________________________________________
1069 Int_t AliAnaCalorimeterQA::GetModuleNumber(AliAODCaloCluster * cluster)
1071 //Get the EMCAL/PHOS module number that corresponds to this cluster
1073 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
1074 cluster->GetMomentum(lv,v);
1075 Float_t phi = lv.Phi();
1076 if(phi < 0) phi+=TMath::TwoPi();
1078 if(fCalorimeter=="EMCAL"){
1079 GetReader()->GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
1081 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
1082 lv.Eta(), phi*TMath::RadToDeg(),absId, GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId));
1083 return GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId) ;
1087 if ( cluster->GetNCells() > 0) {
1088 absId = cluster->GetCellAbsId(0);
1090 printf("AliAnaCalorimeterQA::GetModuleNumber(AOD) - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
1091 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
1096 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1098 printf("AliAnaCalorimeterQA::GetModuleNumber(AOD) - PHOS: Module %d\n",relId[0]-1);
1106 //____________________________________________________________________________________________________________________________________________________
1107 Int_t AliAnaCalorimeterQA::GetModuleNumberCellIndexes(const Int_t absId, Int_t & icol, Int_t & irow)
1109 //Get the EMCAL/PHOS module number that corresponds to this absId
1112 if(fCalorimeter=="EMCAL"){
1113 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1114 GetReader()->GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1115 GetReader()->GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1116 iIphi, iIeta,irow,icol);
1121 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1133 //__________________________________________________
1134 void AliAnaCalorimeterQA::Init()
1136 //Check if the data or settings are ok
1137 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1138 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1142 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1143 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1150 //__________________________________________________
1151 void AliAnaCalorimeterQA::InitParameters()
1153 //Initialize the parameters of the analysis.
1154 AddToHistogramsName("AnaCaloQA_");
1156 fCalorimeter = "EMCAL"; //or PHOS
1158 fNModules = 12; // set maximum to maximum number of EMCAL modules
1160 fHistoPOverEBins = 100 ; fHistoPOverEMax = 10. ; fHistoPOverEMin = 0. ;
1161 fHistodEdxBins = 200 ; fHistodEdxMax = 400. ; fHistodEdxMin = 0. ;
1162 fHistodRBins = 300 ; fHistodRMax = 3.15 ; fHistodRMin = 0. ;
1163 fHistoTimeBins = 1000; fHistoTimeMax = 1.e3 ; fHistoTimeMin = 0. ;//ns
1164 fHistoNBins = 300 ; fHistoNMax = 300 ; fHistoNMin = 0 ;
1165 fHistoRatioBins = 200 ; fHistoRatioMax = 2 ; fHistoRatioMin = 0. ;
1166 fHistoVertexDistBins = 100 ; fHistoVertexDistMax = 500. ; fHistoVertexDistMin = 0. ;
1171 //__________________________________________________________________
1172 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1174 //Print some relevant parameters set for the analysis
1178 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1179 AliAnaPartCorrBaseClass::Print(" ");
1181 printf("Select Calorimeter %s \n",fCalorimeter.Data());
1182 printf("Make plots? %d \n",fMakePlots);
1183 printf("Plots style macro %s \n",fStyleMacro.Data());
1184 printf("Histograms: %3.1f < p/E < %3.1f, Nbin = %d\n", fHistoPOverEMin, fHistoPOverEMax, fHistoPOverEBins);
1185 printf("Histograms: %3.1f < dEdx < %3.1f, Nbin = %d\n", fHistodEdxMin, fHistodEdxMax, fHistodEdxBins);
1186 printf("Histograms: %3.1f < dR < %3.1f, Nbin = %d\n", fHistodRMin, fHistodRMax, fHistodRBins);
1187 printf("Histograms: %g < Time < %g, Nbin = %d\n" , fHistoTimeMin, fHistoTimeMax, fHistoTimeBins);
1188 printf("Histograms: %d < N < %d, Nbin = %d\n" , fHistoNMin, fHistoNMax, fHistoNBins);
1189 printf("Histograms: %3.1f < Ratio< %3.1f, Nbin = %d\n", fHistoRatioMin, fHistoRatioMax, fHistoRatioBins);
1190 printf("Histograms: %3.1f < Vertex Distance < %3.1f, Nbin = %d\n", fHistoVertexDistMin, fHistoVertexDistMax, fHistoVertexDistBins);
1194 //__________________________________________________________________
1195 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1197 //Fill Calorimeter QA histograms
1199 TLorentzVector mom ;
1200 TLorentzVector mom2 ;
1201 TRefArray * caloClusters = new TRefArray();
1204 Int_t nCaloClusters = 0;
1205 Int_t nCaloCellsPerCluster = 0;
1206 Int_t nTracksMatched = 0;
1207 Int_t trackIndex = 0;
1210 //Play with the MC stack if available
1211 //Get the MC arrays and do some checks
1213 if(GetReader()->ReadStack()){
1216 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1219 //Fill some pure MC histograms, only primaries.
1220 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1221 TParticle *primary = GetMCStack()->Particle(i) ;
1222 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1223 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1224 primary->Momentum(mom);
1225 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1228 else if(GetReader()->ReadAODMCParticles()){
1230 if(!GetReader()->GetAODMCParticles(0)) {
1231 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1234 //Fill some pure MC histograms, only primaries.
1235 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1236 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1237 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1238 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1239 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1240 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1241 //aodprimary->Momentum(mom);
1242 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1243 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1250 //Get List with CaloClusters
1252 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1253 if (fCalorimeter == "EMCAL") ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1254 else if(fCalorimeter == "PHOS") ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1256 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1260 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1261 if (fCalorimeter == "EMCAL") ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1262 else if(fCalorimeter == "PHOS") ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1264 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1270 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n");
1274 //Correlate Calorimeters
1275 if(fCorrelateCalos) CorrelateCalorimeters(caloClusters);
1277 nCaloClusters = caloClusters->GetEntriesFast() ;
1278 fhNClusters->Fill(nCaloClusters);
1279 Int_t *nClustersInModule = new Int_t[fNModules];
1280 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1283 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1285 //Get vertex for photon momentum calculation
1286 Double_t v[3] ; //vertex ;
1287 GetReader()->GetVertex(v);
1288 TObject * track = 0x0;
1289 //Loop over CaloClusters
1290 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1292 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1293 iclus+1,nCaloClusters,GetReader()->GetDataType());
1295 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1296 AliESDCaloCluster* clus = (AliESDCaloCluster*) (caloClusters->At(iclus));
1297 //Get cluster kinematics
1298 clus->GetMomentum(mom,v);
1299 //Check only certain regions
1301 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1303 //Get module of cluster
1304 nModule = GetModuleNumber(clus);
1305 if(nModule < fNModules) nClustersInModule[nModule]++;
1307 nLabel = clus->GetNLabels();
1308 if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray();
1310 nCaloCellsPerCluster = clus->GetNCells();
1311 //matched cluster with tracks
1312 nTracksMatched = clus->GetNTracksMatched();
1313 trackIndex = clus->GetTrackMatched();
1314 if(trackIndex >= 0){
1315 track = (AliESDtrack*) ((AliESDEvent*)GetReader()->GetInputEvent())->GetTrack(trackIndex);
1318 if(nTracksMatched == 1) nTracksMatched = 0;
1323 AliAODCaloCluster* clus = (AliAODCaloCluster*) (caloClusters->At(iclus));
1325 //Get cluster kinematics
1326 clus->GetMomentum(mom,v);
1327 //Check only certain regions
1329 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1331 //Get module of cluster
1332 nModule = GetModuleNumber(clus);
1333 if(nModule < fNModules) nClustersInModule[nModule]++;
1335 nLabel = clus->GetNLabel();
1336 if(clus->GetLabels()) labels = clus->GetLabels();
1338 nCaloCellsPerCluster = clus->GetNCells();
1339 //matched cluster with tracks
1340 nTracksMatched = clus->GetNTracksMatched();
1341 if(nTracksMatched > 0)
1342 track = (AliAODTrack*)clus->GetTrackMatched(0);
1345 //Fill histograms related to single cluster or track matching
1346 ClusterHistograms(mom, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1347 if(GetDebug()>1) printf("Invariant mass \n");
1349 Int_t nModule2 = -1;
1350 Int_t nCaloCellsPerCluster2=0;
1351 if (nCaloClusters > 1 ) {
1352 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters-1 ; jclus++) {
1353 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1354 AliESDCaloCluster* clus2 = (AliESDCaloCluster*) (caloClusters->At(jclus));
1355 //Get cluster kinematics
1356 clus2->GetMomentum(mom2,v);
1357 //Check only certain regions
1359 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1361 //Get module of cluster
1362 nModule2 = GetModuleNumber(clus2);
1364 nCaloCellsPerCluster2 = clus2->GetNCells();
1367 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD){
1368 AliAODCaloCluster* clus2 = (AliAODCaloCluster*) (caloClusters->At(jclus));
1369 //Get cluster kinematics
1370 clus2->GetMomentum(mom2,v);
1371 //Check only certain regions
1373 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1375 //Get module of cluster
1376 nModule2 = GetModuleNumber(clus2);
1378 nCaloCellsPerCluster2 = clus2->GetNCells();
1381 //Fill invariant mass histograms
1383 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1385 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1386 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1388 //Select only clusters with at least 2 cells
1389 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1391 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1393 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1394 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1397 //Asymetry histograms
1398 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1400 }// 2nd cluster loop
1401 }////more than 1 cluster in calorimeter
1404 //Number of clusters per module
1405 for(Int_t imod = 0; imod < fNModules; imod++ ){
1407 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1408 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1412 Int_t *nCellsInModule = new Int_t[fNModules];
1413 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1419 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1420 AliESDCaloCells * cell = 0x0;
1422 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1423 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1426 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No CELLS available for analysis");
1430 ncells = cell->GetNumberOfCells() ;
1431 fhNCells->Fill(ncells) ;
1433 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1435 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1436 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1437 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell), icol, irow);
1438 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1440 if(nModule < fNModules) {
1441 amp = cell->GetAmplitude(iCell);
1442 time = cell->GetTime(iCell)*1e9;//transform time to ns
1443 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1444 id = cell->GetCellNumber(iCell);
1445 fhAmplitude->Fill(amp);
1446 fhTime ->Fill(time);
1447 fhTimeId ->Fill(time,id);
1448 fhTimeAmp ->Fill(amp,time);
1449 fhAmplitudeMod[nModule]->Fill(cell->GetAmplitude(iCell));
1450 nCellsInModule[nModule]++;
1451 fhGridCellsMod[nModule] ->Fill(icol,irow);
1452 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
1457 AliAODCaloCells * cell = 0x0;
1460 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1461 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1464 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No CELLS available for analysis");
1468 ncells = cell->GetNumberOfCells() ;
1469 fhNCells->Fill(ncells) ;
1471 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1473 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1474 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1475 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell), icol, irow);
1476 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1478 if(nModule < fNModules) {
1479 amp = cell->GetAmplitude(iCell);
1480 fhAmplitude->Fill(amp);
1481 fhAmplitudeMod[nModule]->Fill(cell->GetAmplitude(iCell));
1482 nCellsInModule[nModule]++;
1483 fhGridCellsMod[nModule]->Fill(icol,irow);
1484 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
1489 //Number of cells per module
1490 for(Int_t imod = 0; imod < fNModules; imod++ ) {
1492 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
1493 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
1497 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1501 //__________________________________
1502 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Int_t nCaloCellsPerCluster,const Int_t nModule,
1503 const Int_t nTracksMatched, const TObject * track,
1504 const Int_t * labels, const Int_t nLabels){
1505 //Fill CaloCluster related histograms
1507 AliAODMCParticle * aodprimary = 0x0;
1508 TParticle * primary = 0x0;
1511 Float_t e = mom.E();
1512 Float_t pt = mom.Pt();
1513 Float_t eta = mom.Eta();
1514 Float_t phi = mom.Phi();
1515 if(phi < 0) phi +=TMath::TwoPi();
1516 if(GetDebug() > 0) {
1517 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
1519 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
1520 printf("\t Primaries: nlabels %d\n",nLabels);
1521 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
1526 if(nModule < fNModules) fhEMod[nModule]->Fill(e);
1530 fhEtaPhi->Fill(eta,phi);
1531 fhEtaPhiE->Fill(eta,phi,e);
1533 fhNCellsPerCluster->Fill(e, nCaloCellsPerCluster);
1534 if(nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
1536 //Fill histograms only possible when simulation
1537 if(IsDataMC() && nLabels > 0 && labels){
1539 //Play with the MC stack if available
1540 Int_t label = labels[0];
1543 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
1547 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1548 Float_t vxMC= 0; Float_t vyMC = 0;
1549 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1553 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
1555 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
1557 if( label >= GetMCStack()->GetNtrack()) {
1558 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1562 primary = GetMCStack()->Particle(label);
1564 pdg0 = TMath::Abs(primary->GetPdgCode());
1566 status = primary->GetStatusCode();
1567 vxMC = primary->Vx();
1568 vyMC = primary->Vy();
1569 iParent = primary->GetFirstMother();
1571 if(GetDebug() > 1 ) {
1572 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1573 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1576 //Get final particle, no conversion products
1577 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1579 primary = GetMCStack()->Particle(iParent);
1580 pdg = TMath::Abs(primary->GetPdgCode());
1581 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1582 while((pdg == 22 || pdg == 11) && status != 1){
1584 primary = GetMCStack()->Particle(iMother);
1585 status = primary->GetStatusCode();
1586 iParent = primary->GetFirstMother();
1587 pdg = TMath::Abs(primary->GetPdgCode());
1588 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1591 if(GetDebug() > 1 ) {
1592 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1593 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1598 //Overlapped pi0 (or eta, there will be very few), get the meson
1599 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1600 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1601 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1602 while(pdg != 111 && pdg != 221){
1604 primary = GetMCStack()->Particle(iMother);
1605 status = primary->GetStatusCode();
1606 iParent = primary->GetFirstMother();
1607 pdg = TMath::Abs(primary->GetPdgCode());
1608 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1610 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1615 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1616 primary->GetName(),iMother);
1619 eMC = primary->Energy();
1620 ptMC = primary->Pt();
1621 phiMC = primary->Phi();
1622 etaMC = primary->Eta();
1623 pdg = TMath::Abs(primary->GetPdgCode());
1624 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1627 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
1628 //Get the list of MC particles
1629 if(!GetReader()->GetAODMCParticles(0)) {
1630 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
1634 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
1636 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1638 status = aodprimary->IsPrimary();
1639 vxMC = aodprimary->Xv();
1640 vyMC = aodprimary->Yv();
1641 iParent = aodprimary->GetMother();
1643 if(GetDebug() > 1 ) {
1644 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1645 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
1646 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
1649 //Get final particle, no conversion products
1650 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1652 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1654 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
1655 pdg = TMath::Abs(aodprimary->GetPdgCode());
1656 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
1658 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1659 status = aodprimary->IsPrimary();
1660 iParent = aodprimary->GetMother();
1661 pdg = TMath::Abs(aodprimary->GetPdgCode());
1663 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
1664 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1667 if(GetDebug() > 1 ) {
1668 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1669 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
1670 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1675 //Overlapped pi0 (or eta, there will be very few), get the meson
1676 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1677 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1678 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1679 while(pdg != 111 && pdg != 221){
1682 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1683 status = aodprimary->IsPrimary();
1684 iParent = aodprimary->GetMother();
1685 pdg = TMath::Abs(aodprimary->GetPdgCode());
1687 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1690 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1695 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1696 aodprimary->GetName(),iMother);
1699 status = aodprimary->IsPrimary();
1700 eMC = aodprimary->E();
1701 ptMC = aodprimary->Pt();
1702 phiMC = aodprimary->Phi();
1703 etaMC = aodprimary->Eta();
1704 pdg = TMath::Abs(aodprimary->GetPdgCode());
1705 charge = aodprimary->Charge();
1709 //Float_t vz = primary->Vz();
1710 Float_t r = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1711 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
1712 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1716 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1717 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1718 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1721 fh2E ->Fill(e, eMC);
1722 fh2Pt ->Fill(pt, ptMC);
1723 fh2Phi ->Fill(phi, phiMC);
1724 fh2Eta ->Fill(eta, etaMC);
1725 fhDeltaE ->Fill(eMC-e);
1726 fhDeltaPt ->Fill(ptMC-pt);
1727 fhDeltaPhi->Fill(phiMC-phi);
1728 fhDeltaEta->Fill(etaMC-eta);
1729 if(eMC > 0) fhRatioE ->Fill(e/eMC);
1730 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
1731 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
1732 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
1735 //Overlapped pi0 (or eta, there will be very few)
1736 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1737 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1738 //cout<<"Fill pi0"<< "E "<< e <<" prim E "<<eMC<<endl;
1739 fhPi0E ->Fill(e,eMC);
1740 fhPi0Pt ->Fill(pt,ptMC);
1741 fhPi0Eta ->Fill(eta,etaMC);
1742 fhPi0Phi ->Fill(phi,phiMC);
1743 if( nTracksMatched > 0){
1744 fhPi0ECharged ->Fill(e,eMC);
1745 fhPi0PtCharged ->Fill(pt,ptMC);
1746 fhPi0PhiCharged ->Fill(phi,phiMC);
1747 fhPi0EtaCharged ->Fill(eta,etaMC);
1749 }//Overlapped pizero decay
1750 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
1751 fhGamE ->Fill(e,eMC);
1752 fhGamPt ->Fill(pt,ptMC);
1753 fhGamEta ->Fill(eta,etaMC);
1754 fhGamPhi ->Fill(phi,phiMC);
1755 fhGamDeltaE ->Fill(eMC-e);
1756 fhGamDeltaPt ->Fill(ptMC-pt);
1757 fhGamDeltaPhi->Fill(phiMC-phi);
1758 fhGamDeltaEta->Fill(etaMC-eta);
1759 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
1760 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
1761 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
1762 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
1763 if( nTracksMatched > 0){
1764 fhGamECharged ->Fill(e,eMC);
1765 fhGamPtCharged ->Fill(pt,ptMC);
1766 fhGamPhiCharged ->Fill(phi,phiMC);
1767 fhGamEtaCharged ->Fill(eta,etaMC);
1770 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
1771 fhEleE ->Fill(e,eMC);
1772 fhElePt ->Fill(pt,ptMC);
1773 fhEleEta ->Fill(eta,etaMC);
1774 fhElePhi ->Fill(phi,phiMC);
1775 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1777 if( nTracksMatched > 0){
1778 fhEleECharged ->Fill(e,eMC);
1779 fhElePtCharged ->Fill(pt,ptMC);
1780 fhElePhiCharged ->Fill(phi,phiMC);
1781 fhEleEtaCharged ->Fill(eta,etaMC);
1784 else if(charge == 0){
1785 fhNeHadE ->Fill(e,eMC);
1786 fhNeHadPt ->Fill(pt,ptMC);
1787 fhNeHadEta ->Fill(eta,etaMC);
1788 fhNeHadPhi ->Fill(phi,phiMC);
1789 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1791 if( nTracksMatched > 0){
1792 fhNeHadECharged ->Fill(e,eMC);
1793 fhNeHadPtCharged ->Fill(pt,ptMC);
1794 fhNeHadPhiCharged ->Fill(phi,phiMC);
1795 fhNeHadEtaCharged ->Fill(eta,etaMC);
1799 fhChHadE ->Fill(e,eMC);
1800 fhChHadPt ->Fill(pt,ptMC);
1801 fhChHadEta ->Fill(eta,etaMC);
1802 fhChHadPhi ->Fill(phi,phiMC);
1803 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1805 if( nTracksMatched > 0){
1806 fhChHadECharged ->Fill(e,eMC);
1807 fhChHadPtCharged ->Fill(pt,ptMC);
1808 fhChHadPhiCharged ->Fill(phi,phiMC);
1809 fhChHadEtaCharged ->Fill(eta,etaMC);
1815 //Match tracks and clusters
1816 //To be Modified in case of AODs
1818 //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
1820 if( nTracksMatched > 0){
1821 fhECharged ->Fill(e);
1822 fhPtCharged ->Fill(pt);
1823 fhPhiCharged ->Fill(phi);
1824 fhEtaCharged ->Fill(eta);
1825 fhEtaPhiCharged->Fill(eta,phi);
1827 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
1828 //Study the track and matched cluster if track exists.
1830 Double_t emcpos[3] = {0.,0.,0.};
1831 Double_t emcmom[3] = {0.,0.,0.};
1832 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
1833 Double_t bfield = 0.;
1839 Double_t tpcSignal = 0;
1840 Bool_t okpos = kFALSE;
1841 Bool_t okmom = kFALSE;
1842 Bool_t okout = kFALSE;
1846 //In case of ESDs get the parameters in this way
1847 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1848 if (((AliESDtrack*)track)->GetOuterParam() ) {
1851 bfield = ((AliESDEvent*)GetReader()->GetInputEvent())->GetMagneticField();
1852 okpos = ((AliESDtrack*)track)->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
1853 okmom = ((AliESDtrack*)track)->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
1854 if(!(okpos && okmom)) return;
1856 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
1857 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
1858 tphi = position.Phi();
1859 teta = position.Eta();
1860 tmom = momentum.Mag();
1862 //Double_t tphi = ((AliESDtrack*)track)->GetOuterParam()->Phi();
1863 //Double_t teta = ((AliESDtrack*)track)->GetOuterParam()->Eta();
1864 //Double_t tmom = ((AliESDtrack*)track)->GetOuterParam()->P();
1865 tpt = ((AliESDtrack*)track)->Pt();
1866 tmom2 = ((AliESDtrack*)track)->P();
1867 tpcSignal = ((AliESDtrack*)track)->GetTPCsignal();
1869 nITS = ((AliESDtrack*)track)->GetNcls(0);
1870 nTPC = ((AliESDtrack*)track)->GetNcls(1);
1871 }//Outer param available
1873 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1874 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
1877 pid->GetEMCALPosition(emcpos);
1878 pid->GetEMCALMomentum(emcmom);
1880 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
1881 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
1882 tphi = position.Phi();
1883 teta = position.Eta();
1884 tmom = momentum.Mag();
1886 tpt = ((AliAODTrack*)track)->Pt();
1887 tmom2 = ((AliAODTrack*)track)->P();
1888 tpcSignal = pid->GetTPCsignal();
1890 //nITS = ((AliAODTrack*)track)->GetNcls(0);
1891 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
1892 }//Outer param available
1894 else return; //Do nothing case not implemented.
1897 Double_t deta = teta - eta;
1898 Double_t dphi = tphi - phi;
1899 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
1900 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
1901 Double_t dR = sqrt(dphi*dphi + deta*deta);
1903 Double_t pOverE = tmom/e;
1905 fh1pOverE->Fill(tpt, pOverE);
1906 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
1909 fh2MatchdEdx->Fill(tmom2,tpcSignal);
1911 if(IsDataMC() && primary){
1912 Int_t pdg = primary->GetPdgCode();
1913 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1915 if(TMath::Abs(pdg) == 11){
1916 fhMCEle1pOverE->Fill(tpt,pOverE);
1917 fhMCEle1dR->Fill(dR);
1918 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
1919 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
1922 fhMCChHad1pOverE->Fill(tpt,pOverE);
1923 fhMCChHad1dR->Fill(dR);
1924 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
1925 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
1927 else if(charge == 0){
1928 fhMCNeutral1pOverE->Fill(tpt,pOverE);
1929 fhMCNeutral1dR->Fill(dR);
1930 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
1931 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
1935 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
1936 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
1937 fh2EledEdx->Fill(tmom2,tpcSignal);
1940 else{//no ESD external param or AODPid
1941 ULong_t status=AliESDtrack::kTPCrefit;
1942 status|=AliESDtrack::kITSrefit;
1943 //printf("track status %d\n", track->GetStatus() );
1944 fhEChargedNoOut ->Fill(e);
1945 fhPtChargedNoOut ->Fill(pt);
1946 fhPhiChargedNoOut ->Fill(phi);
1947 fhEtaChargedNoOut ->Fill(eta);
1948 fhEtaPhiChargedNoOut ->Fill(eta,phi);
1949 if(GetDebug() >= 0 && ((((AliESDtrack*)track)->GetStatus() & status) == status)) printf("ITS+TPC\n");
1951 }//matched clusters with tracks
1955 //__________________________________
1956 void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
1957 // Correlate information from PHOS and EMCAL
1958 TRefArray * caloClustersEMCAL = new TRefArray;
1959 TRefArray * caloClustersPHOS = new TRefArray;
1961 // Get once the array of clusters per calorimeter, avoid an extra loop.
1962 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1963 if(fCalorimeter == "EMCAL"){
1964 ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
1965 caloClustersEMCAL = refArray;
1967 else if(fCalorimeter == "PHOS") {
1968 ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
1969 caloClustersEMCAL = refArray;
1972 //Fill histograms with clusters
1974 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
1975 Float_t sumClusterEnergyEMCAL = 0;
1976 Float_t sumClusterEnergyPHOS = 0;
1978 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1979 sumClusterEnergyEMCAL += ((AliESDCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
1980 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
1981 sumClusterEnergyPHOS += ((AliESDCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
1982 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
1984 //Fill histograms with cells
1986 AliESDCaloCells * cellsEMCAL = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1987 AliESDCaloCells * cellsPHOS = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1988 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
1991 Float_t sumCellEnergyEMCAL = 0;
1992 Float_t sumCellEnergyPHOS = 0;
1993 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
1994 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
1995 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
1996 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
1997 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
1998 if(GetDebug() > 0 ){
1999 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2000 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2001 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2002 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2003 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2006 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2007 if(fCalorimeter == "EMCAL"){
2008 ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
2009 caloClustersEMCAL = refArray;
2011 else if(fCalorimeter == "PHOS") {
2012 ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
2013 caloClustersEMCAL = refArray;
2016 //Fill histograms with clusters
2018 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2019 Float_t sumClusterEnergyEMCAL = 0;
2020 Float_t sumClusterEnergyPHOS = 0;
2022 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2023 sumClusterEnergyEMCAL += ((AliAODCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
2024 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2025 sumClusterEnergyPHOS += ((AliAODCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
2026 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2028 //Fill histograms with cells
2030 AliAODCaloCells * cellsEMCAL = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2031 AliAODCaloCells * cellsPHOS = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2032 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2035 Float_t sumCellEnergyEMCAL = 0;
2036 Float_t sumCellEnergyPHOS = 0;
2037 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2038 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2039 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2040 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2041 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2042 if(GetDebug() > 0 ){
2043 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2044 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2045 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2046 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2047 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2053 //______________________________________________________________________________
2054 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
2055 //Fill pure monte carlo related histograms
2057 Float_t eMC = mom.E();
2058 Float_t ptMC = mom.Pt();
2059 Float_t phiMC = mom.Phi();
2061 phiMC += TMath::TwoPi();
2062 Float_t etaMC = mom.Eta();
2064 if (TMath::Abs(etaMC) > 1) return;
2067 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2070 fhGenGamPt ->Fill(ptMC);
2071 fhGenGamEta->Fill(etaMC);
2072 fhGenGamPhi->Fill(phiMC);
2074 fhGenGamAccE ->Fill(eMC);
2075 fhGenGamAccPt ->Fill(ptMC);
2076 fhGenGamAccEta->Fill(etaMC);
2077 fhGenGamAccPhi->Fill(phiMC);
2080 else if (pdg==111) {
2081 fhGenPi0Pt ->Fill(ptMC);
2082 fhGenPi0Eta->Fill(etaMC);
2083 fhGenPi0Phi->Fill(phiMC);
2085 fhGenPi0AccE ->Fill(eMC);
2086 fhGenPi0AccPt ->Fill(ptMC);
2087 fhGenPi0AccEta->Fill(etaMC);
2088 fhGenPi0AccPhi->Fill(phiMC);
2091 else if (pdg==221) {
2092 fhGenEtaPt ->Fill(ptMC);
2093 fhGenEtaEta->Fill(etaMC);
2094 fhGenEtaPhi->Fill(phiMC);
2096 else if (pdg==223) {
2097 fhGenOmegaPt ->Fill(ptMC);
2098 fhGenOmegaEta->Fill(etaMC);
2099 fhGenOmegaPhi->Fill(phiMC);
2101 else if (TMath::Abs(pdg)==11) {
2102 fhGenElePt ->Fill(ptMC);
2103 fhGenEleEta->Fill(etaMC);
2104 fhGenElePhi->Fill(phiMC);
2109 //________________________________________________________________________
2110 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2112 // Needed when Terminate is executed in distributed environment
2113 // Refill analysis histograms of this class with corresponding histograms in output list.
2115 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2116 // the first one and then add the next
2117 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
2118 printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2120 //Read histograms, must be in the same order as in GetCreateOutputObject.
2121 fhE = (TH1F *) outputList->At(index++);
2122 fhPt = (TH1F *) outputList->At(index++);
2123 fhPhi = (TH1F *) outputList->At(index++);
2124 fhEta = (TH1F *) outputList->At(index++);
2125 fhEtaPhi = (TH2F *) outputList->At(index++);
2126 fhEtaPhiE = (TH3F *) outputList->At(index++);
2128 fhECharged = (TH1F *) outputList->At(index++);
2129 fhPtCharged = (TH1F *) outputList->At(index++);
2130 fhPhiCharged = (TH1F *) outputList->At(index++);
2131 fhEtaCharged = (TH1F *) outputList->At(index++);
2132 fhEtaPhiCharged = (TH2F *) outputList->At(index++);
2134 fhEChargedNoOut = (TH1F *) outputList->At(index++);
2135 fhPtChargedNoOut = (TH1F *) outputList->At(index++);
2136 fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
2137 fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
2138 fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
2140 fh1pOverE = (TH2F *) outputList->At(index++);
2141 fh1dR = (TH1F *) outputList->At(index++);
2142 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2143 fh2EledEdx = (TH2F *) outputList->At(index++);
2144 fh1pOverER02 = (TH2F *) outputList->At(index++);
2146 fhIM = (TH2F *) outputList->At(index++);
2147 fhIMCellCut = (TH2F *) outputList->At(index++);
2148 fhAsym = (TH2F *) outputList->At(index++);
2150 fhNCellsPerCluster = (TH2F *) outputList->At(index++);
2151 fhNClusters = (TH1F *) outputList->At(index++);
2152 fhNCells = (TH1F *) outputList->At(index++);
2153 fhAmplitude = (TH1F *) outputList->At(index++);
2154 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2155 fhTime = (TH1F *) outputList->At(index++);
2156 fhTimeId = (TH2F *) outputList->At(index++);
2157 fhTimeAmp = (TH2F *) outputList->At(index++);
2160 if(fCorrelateCalos){
2161 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2162 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2163 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2164 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2168 fhEMod = new TH1F*[fNModules];
2169 fhNClustersMod = new TH1F*[fNModules];
2170 fhNCellsPerClusterMod = new TH2F*[fNModules];
2171 fhNCellsMod = new TH1F*[fNModules];
2172 fhGridCellsMod = new TH2F*[fNModules];
2173 fhGridCellsEMod = new TH2F*[fNModules];
2174 fhAmplitudeMod = new TH1F*[fNModules];
2175 fhIMMod = new TH2F*[fNModules];
2176 fhIMCellCutMod = new TH2F*[fNModules];
2178 for(Int_t imod = 0 ; imod < fNModules; imod++){
2179 fhEMod[imod] = (TH1F *) outputList->At(index++);
2180 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2181 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2182 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2183 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2184 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2185 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2186 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2187 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
2192 fhDeltaE = (TH1F *) outputList->At(index++);
2193 fhDeltaPt = (TH1F *) outputList->At(index++);
2194 fhDeltaPhi = (TH1F *) outputList->At(index++);
2195 fhDeltaEta = (TH1F *) outputList->At(index++);
2197 fhRatioE = (TH1F *) outputList->At(index++);
2198 fhRatioPt = (TH1F *) outputList->At(index++);
2199 fhRatioPhi = (TH1F *) outputList->At(index++);
2200 fhRatioEta = (TH1F *) outputList->At(index++);
2202 fh2E = (TH2F *) outputList->At(index++);
2203 fh2Pt = (TH2F *) outputList->At(index++);
2204 fh2Phi = (TH2F *) outputList->At(index++);
2205 fh2Eta = (TH2F *) outputList->At(index++);
2207 fhGamE = (TH2F *) outputList->At(index++);
2208 fhGamPt = (TH2F *) outputList->At(index++);
2209 fhGamPhi = (TH2F *) outputList->At(index++);
2210 fhGamEta = (TH2F *) outputList->At(index++);
2212 fhGamDeltaE = (TH1F *) outputList->At(index++);
2213 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2214 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2215 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2217 fhGamRatioE = (TH1F *) outputList->At(index++);
2218 fhGamRatioPt = (TH1F *) outputList->At(index++);
2219 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2220 fhGamRatioEta = (TH1F *) outputList->At(index++);
2222 fhPi0E = (TH2F *) outputList->At(index++);
2223 fhPi0Pt = (TH2F *) outputList->At(index++);
2224 fhPi0Phi = (TH2F *) outputList->At(index++);
2225 fhPi0Eta = (TH2F *) outputList->At(index++);
2227 fhEleE = (TH2F *) outputList->At(index++);
2228 fhElePt = (TH2F *) outputList->At(index++);
2229 fhElePhi = (TH2F *) outputList->At(index++);
2230 fhEleEta = (TH2F *) outputList->At(index++);
2232 fhNeHadE = (TH2F *) outputList->At(index++);
2233 fhNeHadPt = (TH2F *) outputList->At(index++);
2234 fhNeHadPhi = (TH2F *) outputList->At(index++);
2235 fhNeHadEta = (TH2F *) outputList->At(index++);
2237 fhChHadE = (TH2F *) outputList->At(index++);
2238 fhChHadPt = (TH2F *) outputList->At(index++);
2239 fhChHadPhi = (TH2F *) outputList->At(index++);
2240 fhChHadEta = (TH2F *) outputList->At(index++);
2242 fhGamECharged = (TH2F *) outputList->At(index++);
2243 fhGamPtCharged = (TH2F *) outputList->At(index++);
2244 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2245 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2247 fhPi0ECharged = (TH2F *) outputList->At(index++);
2248 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2249 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2250 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2252 fhEleECharged = (TH2F *) outputList->At(index++);
2253 fhElePtCharged = (TH2F *) outputList->At(index++);
2254 fhElePhiCharged = (TH2F *) outputList->At(index++);
2255 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2257 fhNeHadECharged = (TH2F *) outputList->At(index++);
2258 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2259 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2260 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2262 fhChHadECharged = (TH2F *) outputList->At(index++);
2263 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2264 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2265 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2267 // fhEMVxyz = (TH3F *) outputList->At(index++);
2268 // fhHaVxyz = (TH3F *) outputList->At(index++);
2270 fhEMVxyz = (TH2F *) outputList->At(index++);
2271 fhHaVxyz = (TH2F *) outputList->At(index++);
2272 fhEMR = (TH2F *) outputList->At(index++);
2273 fhHaR = (TH2F *) outputList->At(index++);
2275 fhGenGamPt = (TH1F *) outputList->At(index++);
2276 fhGenGamEta = (TH1F *) outputList->At(index++);
2277 fhGenGamPhi = (TH1F *) outputList->At(index++);
2279 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2280 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2281 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2283 fhGenEtaPt = (TH1F *) outputList->At(index++);
2284 fhGenEtaEta = (TH1F *) outputList->At(index++);
2285 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2287 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2288 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2289 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2291 fhGenElePt = (TH1F *) outputList->At(index++);
2292 fhGenEleEta = (TH1F *) outputList->At(index++);
2293 fhGenElePhi = (TH1F *) outputList->At(index++);
2295 fhGenGamAccE = (TH1F *) outputList->At(index++);
2296 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2297 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2298 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2300 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2301 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2302 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2303 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2305 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
2306 fhMCEle1dR = (TH1F *) outputList->At(index++);
2307 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2309 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
2310 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2311 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2313 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
2314 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2315 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2317 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2318 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2319 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
2321 //for(Int_t i = 0; i<index ; i++) cout<<outputList->At(i)->GetName()<<endl;
2324 //__________________________________________________________________
2325 void AliAnaCalorimeterQA::Terminate(TList* outputList)
2327 //Do plots if requested
2329 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
2330 if(!fMakePlots) return;
2332 //Do some plots to end
2333 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
2334 //Recover histograms from output histograms list, needed for distributed analysis.
2335 ReadHistograms(outputList);
2337 printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2338 printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
2345 sprintf(cname,"QA_%s_nclustercellsamp",fCalorimeter.Data());
2346 TCanvas * c9 = new TCanvas(cname, " CaloClusters and CaloCells", 400, 400) ;
2351 TLegend pLegendN(0.7,0.6,0.9,0.8);
2352 pLegendN.SetTextSize(0.03);
2353 pLegendN.AddEntry(fhNClusters,"all modules","L");
2354 pLegendN.SetFillColor(10);
2355 pLegendN.SetBorderSize(1);
2357 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
2359 fhNClusters->SetLineColor(1);
2360 fhNClusters->Draw();
2361 for(Int_t imod = 0; imod < fNModules; imod++){
2362 fhNClustersMod[imod]->SetLineColor(imod+1);
2363 fhNClustersMod[imod]->Draw("same");
2364 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
2369 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
2371 fhNCells->SetLineColor(1);
2373 for(Int_t imod = 0; imod < fNModules; imod++){
2374 fhNCellsMod[imod]->SetLineColor(imod+1);
2375 fhNCellsMod[imod]->Draw("same");
2378 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
2380 TH1D *cpc = fhNCellsPerCluster->ProjectionY(Form("%s_py",fhNCellsPerCluster->GetName()),-1,-1);
2381 cpc->SetLineColor(1);
2383 for(Int_t imod = 0; imod < fNModules; imod++){
2384 cpc = fhNCellsPerClusterMod[imod]->ProjectionY(Form("%s_py",fhNCellsPerClusterMod[imod]->GetName()),-1,-1);
2385 cpc->SetLineColor(imod+1);
2390 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
2392 fhAmplitude->SetLineColor(1);
2393 fhAmplitude->Draw();
2394 for(Int_t imod = 0; imod < fNModules; imod++){
2395 fhAmplitudeMod[imod]->SetLineColor(imod+1);
2396 fhAmplitudeMod[imod]->Draw("same");
2399 sprintf(name,"QA_%s_CaloClustersAndCaloCells.eps",fCalorimeter.Data());
2400 c9->Print(name); printf("Plot: %s\n",name);
2402 //Cell Time histograms, time only available in ESDs
2403 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2405 sprintf(cname,"QA_%s_cellstime",fCalorimeter.Data());
2406 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
2407 ctime->Divide(3, 1);
2410 if(fhTime->GetEntries() > 0) gPad->SetLogy();
2414 //if(fhTimeId->GetEntries() > 0) gPad->SetLogy();
2415 fhTimeId->Draw("colz");
2418 //if(fhTimeAmp->GetEntries() > 0) gPad->SetLogy();
2419 fhTimeAmp->Draw("surf");
2421 sprintf(name,"QA_%s_CellsTime.eps",fCalorimeter.Data());
2422 ctime->Print(name); printf("Plot: %s\n",name);
2425 if(fCorrelateCalos){
2426 //Calorimeter Correlation, PHOS vs EMCAL
2428 sprintf(cname,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
2429 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
2430 ccorr->Divide(2, 2);
2435 fhCaloCorrNClusters ->Draw();
2440 fhCaloCorrNCells->Draw();
2445 fhCaloCorrEClusters->Draw();
2450 fhCaloCorrECells->Draw();
2452 sprintf(name,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
2453 ccorr->Print(name); printf("Plot: %s\n",name);
2456 //Reconstructed distributions
2458 sprintf(cname,"QA_%s_rec",fCalorimeter.Data());
2459 TCanvas * c = new TCanvas(cname, "Reconstructed distributions", 400, 400) ;
2463 if(fhE->GetEntries() > 0) gPad->SetLogy();
2464 TLegend pLegendE(0.7,0.6,0.9,0.8);
2465 pLegendE.SetTextSize(0.03);
2466 pLegendE.AddEntry(fhE,"all modules","L");
2467 pLegendE.SetFillColor(10);
2468 pLegendE.SetBorderSize(1);
2470 fhE->SetLineColor(1);
2472 for(Int_t imod = 0; imod < fNModules; imod++){
2473 fhEMod[imod]->SetLineColor(imod+1);
2474 fhEMod[imod]->Draw("same");
2475 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
2480 if(fhPt->GetEntries() > 0) gPad->SetLogy();
2481 fhPt->SetLineColor(4);
2485 fhPhi->SetLineColor(4);
2489 fhEta->SetLineColor(4);
2492 sprintf(name,"QA_%s_ReconstructedDistributions.eps",fCalorimeter.Data());
2493 c->Print(name); printf("Plot: %s\n",name);
2495 //Reconstructed distributions, matched with tracks
2497 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
2498 TCanvas * c2 = new TCanvas(cname, "Reconstructed distributions, matched with tracks", 400, 400) ;
2502 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
2503 fhECharged->SetLineColor(4);
2507 if(fhPtCharged->GetEntries() > 0) gPad->SetLogy();
2508 fhPtCharged->SetLineColor(4);
2509 fhPtCharged->Draw();
2512 fhPhiCharged->SetLineColor(4);
2513 fhPhiCharged->Draw();
2516 fhEtaCharged->SetLineColor(4);
2517 fhEtaCharged->Draw();
2519 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched.eps",fCalorimeter.Data());
2520 c2->Print(name); printf("Plot: %s\n",name);
2522 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
2523 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
2524 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
2525 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
2527 TH1F * hEChargedClone2 = (TH1F*) fhECharged->Clone(Form("%sClone2",fhECharged->GetName()));
2528 TH1F * hPtChargedClone2 = (TH1F*) fhPtCharged->Clone(Form("%sClone2",fhPtCharged->GetName()));
2529 TH1F * hEtaChargedClone2 = (TH1F*) fhEtaCharged->Clone(Form("%sClone2",fhEtaCharged->GetName()));
2530 TH1F * hPhiChargedClone2 = (TH1F*) fhPhiCharged->Clone(Form("%sClone2",fhPhiCharged->GetName()));
2532 //Ratio: reconstructed track matched/ all reconstructed
2534 sprintf(cname,"QA_%s_rectrackmatchrat",fCalorimeter.Data());
2535 TCanvas * c3 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
2539 if(hEChargedClone->GetEntries() > 0) gPad->SetLogy();
2540 hEChargedClone->SetTitleOffset(1.6,"Y");
2541 hEChargedClone->SetYTitle("track matched / all ");
2542 hEChargedClone->SetXTitle("E (GeV)");
2543 hEChargedClone->Divide(fhE);
2544 hEChargedClone->Draw();
2547 if(hPtChargedClone->GetEntries() > 0) gPad->SetLogy();
2548 hPtChargedClone->SetTitleOffset(1.6,"Y");
2549 hPtChargedClone->SetYTitle("track matched / all ");
2550 hPtChargedClone->SetXTitle("p_{T} (GeV/c)");
2551 hPtChargedClone->Divide(fhPt);
2552 hPtChargedClone->Draw();
2555 if(hPhiChargedClone->GetEntries() > 0) gPad->SetLogy();
2556 hPhiChargedClone->SetTitleOffset(1.6,"Y");
2557 hPhiChargedClone->SetYTitle("track matched / all ");
2558 hPhiChargedClone->SetXTitle("#phi (rad)");
2559 hPhiChargedClone->Divide(fhPhi);
2560 hPhiChargedClone->Draw();
2563 if(hEtaChargedClone->GetEntries() > 0) gPad->SetLogy();
2564 hEtaChargedClone->SetTitleOffset(1.6,"Y");
2565 hEtaChargedClone->SetYTitle("track matched / all ");
2566 hEtaChargedClone->SetXTitle("#eta");
2567 hEtaChargedClone->Divide(fhEta);
2568 hEtaChargedClone->Draw();
2570 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributions.eps",fCalorimeter.Data());
2571 c3->Print(name); printf("Plot: %s\n",name);
2573 //Ratio: reconstructed track matched (minus no track param) / all
2575 sprintf(cname,"QA_%s_rectrackmatchratout",fCalorimeter.Data());
2576 TCanvas * c333 = new TCanvas(cname, "Ratio: reconstructed track matched (with outer track param)/ all", 400, 400) ;
2580 hEChargedClone2->Add(fhEChargedNoOut,-1);
2581 hEChargedClone2->SetYTitle("track matched / all");
2582 hEChargedClone2->SetXTitle("E (GeV)");
2583 hEChargedClone2->Divide(fhE);
2584 hEChargedClone2->Draw();
2587 hPtChargedClone2->Add(fhPtChargedNoOut,-1);
2588 hPtChargedClone2->SetYTitle("track matched / all");
2589 hPtChargedClone2->SetXTitle("p_{T} (GeV/c)");
2590 hPtChargedClone2->Divide(fhPt);
2591 hPtChargedClone2->Draw();
2594 hPhiChargedClone2->Add(fhPhiChargedNoOut,-1);
2595 hPhiChargedClone2->SetYTitle("track matched / all");
2596 hPhiChargedClone2->SetXTitle("#phi (rad)");
2597 hPhiChargedClone2->Divide(fhPhi);
2598 hPhiChargedClone2->Draw();
2601 hEtaChargedClone2->Add(fhEtaChargedNoOut,-1);
2602 hEtaChargedClone2->SetYTitle("track matched / all");
2603 hEtaChargedClone2->SetXTitle("#eta");
2604 hEtaChargedClone2->Divide(fhEta);
2605 hEtaChargedClone2->Draw();
2607 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsOuter.eps",fCalorimeter.Data());
2608 c333->Print(name); printf("Plot: %s\n",name);
2610 //Reconstructed distributions, matched with tracks but no outer param
2612 sprintf(cname,"QA_%s_rectrackmatch_noout",fCalorimeter.Data());
2613 TCanvas * c22 = new TCanvas(cname, "Reconstructed distributions, matched with tracks, no outer track param", 400, 400) ;
2617 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
2618 fhEChargedNoOut->SetLineColor(4);
2619 fhEChargedNoOut->Draw();
2622 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
2623 fhPtChargedNoOut->SetLineColor(4);
2624 fhPtChargedNoOut->Draw();
2627 fhPhiChargedNoOut->SetLineColor(4);
2628 fhPhiChargedNoOut->Draw();
2631 fhEtaChargedNoOut->SetLineColor(4);
2632 fhEtaChargedNoOut->Draw();
2634 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched_NoOutParam.eps",fCalorimeter.Data());
2635 c22->Print(name); printf("Plot: %s\n",name);
2637 //Ratio: reconstructed track matched/ all reconstructed
2640 // TH1F * hEChargedNoOutClone = (TH1F*) fhEChargedNoOut->Clone("EChargedNoOutClone");
2641 // TH1F * hPtChargedNoOutClone = (TH1F*) fhPtChargedNoOut->Clone("PtChargedNoOutClone");
2642 // TH1F * hEtaChargedNoOutClone = (TH1F*) fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
2643 // TH1F * hPhiChargedNoOutClone = (TH1F*) fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");
2645 // sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
2646 // TCanvas * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
2647 // c33->Divide(2, 2);
2650 // hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2651 // hEChargedNoOutClone->SetXTitle("E (GeV)");
2652 // hEChargedNoOutClone->Divide(fhECharged);
2653 // hEChargedNoOutClone->Draw();
2656 // hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
2657 // hPtChargedNoOutClone->SetXTitle("p_{T} (GeV/c)");
2658 // hPtChargedNoOutClone->Divide(fhPtCharged);
2659 // hPtChargedNoOutClone->Draw();
2662 // hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2663 // hPhiChargedNoOutClone->SetXTitle("#phi (rad)");
2664 // hPhiChargedNoOutClone->Divide(fhPhiCharged);
2665 // hPhiChargedNoOutClone->Draw();
2668 // hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2669 // hEtaChargedNoOutClone->SetXTitle("#eta");
2670 // hEtaChargedNoOutClone->Divide(fhEtaCharged);
2671 // hEtaChargedNoOutClone->Draw();
2673 // sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
2674 // c33->Print(name); printf("Plot: %s\n",name);
2679 sprintf(cname,"QA_%s_etavsphivse",fCalorimeter.Data());
2680 // TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 600, 200) ;
2681 // c4->Divide(3, 1);
2683 TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi vs E", 600, 600) ;
2688 fhEtaPhi->Draw("contz");
2692 fhEtaPhiCharged->Draw("contz");
2695 {gStyle->SetOptStat(0);
2696 fhEtaPhi->Draw("contz");}
2697 //fhEtaPhiE->Draw();
2701 // fhEtaPhiChargedNoOut->Draw("cont");
2703 sprintf(name,"QA_%s_ReconstructedEtaVsPhiVsE.eps",fCalorimeter.Data());
2704 c4->Print(name); printf("Plot: %s\n",name);
2710 if(fhIM->GetEntries() > 1){
2711 Int_t nebins = fhIM->GetNbinsX();
2712 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
2713 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
2714 if (emin != 0 ) printf("emin != 0 \n");
2715 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2717 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
2719 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
2723 //fhIM->SetLineColor(4);
2726 binmax = (Int_t) (1-emin)*nebins/emax;
2727 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),binmin,binmax);
2728 pyim1->SetTitle("E_{pair} < 1 GeV");
2729 pyim1->SetLineColor(1);
2731 TLegend pLegendIM(0.7,0.6,0.9,0.8);
2732 pLegendIM.SetTextSize(0.03);
2733 pLegendIM.AddEntry(pyim1,"all modules","L");
2734 pLegendIM.SetFillColor(10);
2735 pLegendIM.SetBorderSize(1);
2736 for(Int_t imod = 0; imod < fNModules; imod++){
2737 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),binmin,binmax);
2738 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
2739 pyim1->SetLineColor(imod+1);
2740 pyim1->Draw("same");
2745 binmin = (Int_t) (1-emin)*nebins/emax;
2746 binmax = (Int_t) (2-emin)*nebins/emax;
2747 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),binmin,binmax);
2748 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
2749 pyim2->SetLineColor(1);
2751 for(Int_t imod = 0; imod < fNModules; imod++){
2752 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),binmin,binmax);
2753 pyim2->SetLineColor(imod+1);
2754 pyim2->Draw("same");
2758 binmin = (Int_t) (2-emin)*nebins/emax;
2759 binmax = (Int_t) (3-emin)*nebins/emax;
2760 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),binmin,binmax);
2761 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
2762 pyim3->SetLineColor(1);
2764 for(Int_t imod = 0; imod < fNModules; imod++){
2765 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),binmin,binmax);
2766 pyim3->SetLineColor(imod+1);
2767 pyim3->Draw("same");
2771 binmin = (Int_t) (3-emin)*nebins/emax;
2772 binmax = (Int_t) (4-emin)*nebins/emax;
2773 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),binmin,binmax);
2774 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
2775 pyim4->SetLineColor(1);
2777 for(Int_t imod = 0; imod < fNModules; imod++){
2778 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),binmin,binmax);
2779 pyim4->SetLineColor(imod+1);
2780 pyim4->Draw("same");
2784 binmin = (Int_t) (4-emin)*nebins/emax;
2785 binmax = (Int_t) (5-emin)*nebins/emax;
2786 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),binmin,binmax);
2787 pyim5->SetTitle("4< E_{pair} < 5 GeV");
2788 pyim5->SetLineColor(1);
2790 for(Int_t imod = 0; imod < fNModules; imod++){
2791 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),binmin,binmax);
2792 pyim5->SetLineColor(imod+1);
2793 pyim5->Draw("same");
2797 binmin = (Int_t) (5-emin)*nebins/emax;
2799 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),binmin,binmax);
2800 pyim10->SetTitle("E_{pair} > 5 GeV");
2801 pyim10->SetLineColor(1);
2803 for(Int_t imod = 0; imod < fNModules; imod++){
2804 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),binmin,binmax);
2805 pyim10->SetLineColor(imod+1);
2806 pyim10->Draw("same");
2809 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
2810 c5->Print(name); printf("Plot: %s\n",name);
2814 if(fhIMCellCut->GetEntries() > 1){
2815 Int_t nebins = fhIMCellCut->GetNbinsX();
2816 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
2817 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
2818 if (emin != 0 ) printf("emin != 0 \n");
2819 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2821 sprintf(cname,"QA_%s_IMCellCut",fCalorimeter.Data());
2822 // printf("c5cc\n");
2823 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
2827 //fhIMCellCut->SetLineColor(4);
2828 //fhIMCellCut->Draw();
2830 binmax = (Int_t) (1-emin)*nebins/emax;
2831 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),binmin,binmax);
2832 pyimcc1->SetTitle("E_{pair} < 1 GeV");
2833 pyimcc1->SetLineColor(1);
2835 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
2836 pLegendIMCellCut.SetTextSize(0.03);
2837 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
2838 pLegendIMCellCut.SetFillColor(10);
2839 pLegendIMCellCut.SetBorderSize(1);
2840 for(Int_t imod = 0; imod < fNModules; imod++){
2841 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2842 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
2843 pyimcc1->SetLineColor(imod+1);
2844 pyimcc1->Draw("same");
2846 pLegendIMCellCut.Draw();
2849 binmin = (Int_t) (1-emin)*nebins/emax;
2850 binmax = (Int_t) (2-emin)*nebins/emax;
2851 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),binmin,binmax);
2852 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
2853 pyimcc2->SetLineColor(1);
2855 for(Int_t imod = 0; imod < fNModules; imod++){
2856 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2857 pyimcc2->SetLineColor(imod+1);
2858 pyimcc2->Draw("same");
2862 binmin = (Int_t) (2-emin)*nebins/emax;
2863 binmax = (Int_t) (3-emin)*nebins/emax;
2864 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),binmin,binmax);
2865 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
2866 pyimcc3->SetLineColor(1);
2868 for(Int_t imod = 0; imod < fNModules; imod++){
2869 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2870 pyimcc3->SetLineColor(imod+1);
2871 pyimcc3->Draw("same");
2875 binmin = (Int_t) (3-emin)*nebins/emax;
2876 binmax = (Int_t) (4-emin)*nebins/emax;
2877 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),binmin,binmax);
2878 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
2879 pyimcc4->SetLineColor(1);
2881 for(Int_t imod = 0; imod < fNModules; imod++){
2882 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2883 pyimcc4->SetLineColor(imod+1);
2884 pyimcc4->Draw("same");
2888 binmin = (Int_t) (4-emin)*nebins/emax;
2889 binmax = (Int_t) (5-emin)*nebins/emax;
2890 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),binmin,binmax);
2891 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
2892 pyimcc5cc->SetLineColor(1);
2894 for(Int_t imod = 0; imod < fNModules; imod++){
2895 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2896 pyimcc5cc->SetLineColor(imod+1);
2897 pyimcc5cc->Draw("same");
2901 binmin = (Int_t) (5-emin)*nebins/emax;
2903 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),binmin,binmax);
2904 pyimcc10->SetTitle("E_{pair} > 5 GeV");
2905 pyimcc10->SetLineColor(1);
2907 for(Int_t imod = 0; imod < fNModules; imod++){
2908 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),binmin,binmax);
2909 pyimcc10->SetLineColor(imod+1);
2910 pyimcc10->Draw("same");
2913 sprintf(name,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
2914 c5cc->Print(name); printf("Plot: %s\n",name);
2919 if(fhAsym->GetEntries() > 1){
2920 Int_t nebins = fhAsym->GetNbinsX();
2921 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
2922 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
2923 if (emin != 0 ) printf("emin != 0 \n");
2924 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2926 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
2928 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
2932 fhAsym->SetTitleOffset(1.6,"Y");
2933 fhAsym->SetLineColor(4);
2938 binmax = (Int_t) (5-emin)*nebins/emax;
2939 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),binmin,binmax);
2940 pyAsym5->SetTitle("E_{pair} < 5 GeV");
2941 pyAsym5->SetLineColor(4);
2945 binmin = (Int_t) (5-emin)*nebins/emax;
2946 binmax = (Int_t) (10-emin)*nebins/emax;
2947 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),binmin,binmax);
2948 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
2949 pyAsym510->SetLineColor(4);
2953 binmin = (Int_t) (10-emin)*nebins/emax;
2955 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),binmin,binmax);
2956 pyAsym10->SetTitle("E_{pair} > 10 GeV");
2957 pyAsym10->SetLineColor(4);
2960 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
2961 c5b->Print(name); printf("Plot: %s\n",name);
2964 //Grid of cell per module plots
2966 gStyle->SetOptStat(0);
2967 sprintf(cname,"QA_%s_GridCellEntries",fCalorimeter.Data());
2969 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
2970 if(fNModules%2 == 0)
2971 cgrid->Divide(fNModules/2,2);
2973 cgrid->Divide(fNModules/2+1,2);
2975 for(Int_t imod = 0; imod < fNModules ; imod++){
2980 fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
2981 fhGridCellsMod[imod]->Draw("colz");
2983 sprintf(name,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
2984 cgrid->Print(name); printf("Plot: %s\n",name);
2986 sprintf(cname,"QA_%s_GridCellAccumEnergy",fCalorimeter.Data());
2988 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
2989 cgridE->Divide(fNModules/2,2);
2990 for(Int_t imod = 0; imod < fNModules ; imod++){
2995 fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
2996 fhGridCellsEMod[imod]->Draw("colz");
2998 sprintf(name,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
2999 cgridE->Print(name); printf("Plot: %s\n",name);
3001 sprintf(cname,"QA_%s_GridCellAverageEnergy",fCalorimeter.Data());
3003 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
3004 cgridEA->Divide(fNModules/2,2);
3005 for(Int_t imod = 0; imod < fNModules ; imod++){
3006 cgridEA->cd(imod+1);
3010 fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
3011 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
3012 fhGridCellsEMod[imod]->Draw("colz");
3014 sprintf(name,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
3015 cgridEA->Print(name); printf("Plot: %s\n",name);
3020 //Reconstructed vs MC distributions
3022 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
3023 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
3027 fh2E->SetTitleOffset(1.6,"Y");
3028 fh2E->SetLineColor(4);
3032 fh2Pt->SetTitleOffset(1.6,"Y");
3033 fh2Pt->SetLineColor(4);
3037 fh2Phi->SetTitleOffset(1.6,"Y");
3038 fh2Phi->SetLineColor(4);
3042 fh2Eta->SetTitleOffset(1.6,"Y");
3043 fh2Eta->SetLineColor(4);
3046 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
3047 c6->Print(name); printf("Plot: %s\n",name);
3049 //Reconstructed vs MC distributions
3051 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
3052 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
3053 c6Gam->Divide(2, 2);
3067 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
3068 c6->Print(name); printf("Plot: %s\n",name);
3070 //Generated - reconstructed
3072 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
3073 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
3077 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
3078 fhGamDeltaE->SetLineColor(4);
3080 fhGamDeltaE->Draw("same");
3082 TLegend pLegendd(0.65,0.55,0.9,0.8);
3083 pLegendd.SetTextSize(0.06);
3084 pLegendd.AddEntry(fhDeltaE,"all","L");
3085 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
3086 pLegendd.SetFillColor(10);
3087 pLegendd.SetBorderSize(1);
3091 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
3092 fhGamDeltaPt->SetLineColor(4);
3094 fhGamDeltaPt->Draw("same");
3097 fhGamDeltaPhi->SetLineColor(4);
3099 fhGamDeltaPhi->Draw("same");
3102 fhGamDeltaEta->SetLineColor(4);
3104 fhGamDeltaEta->Draw("same");
3106 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
3107 c7->Print(name); printf("Plot: %s\n",name);
3109 // Reconstructed / Generated
3111 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
3112 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
3116 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
3117 fhGamRatioE->SetLineColor(4);
3119 fhGamRatioE->Draw("same");
3121 TLegend pLegendr(0.65,0.55,0.9,0.8);
3122 pLegendr.SetTextSize(0.06);
3123 pLegendr.AddEntry(fhRatioE,"all","L");
3124 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
3125 pLegendr.SetFillColor(10);
3126 pLegendr.SetBorderSize(1);
3130 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
3131 fhGamRatioPt->SetLineColor(4);
3133 fhGamRatioPt->Draw("same");
3136 fhGamRatioPhi->SetLineColor(4);
3138 fhGamRatioPhi->Draw("same");
3141 fhGamRatioEta->SetLineColor(4);
3143 fhGamRatioEta->Draw("same");
3145 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
3146 c8->Print(name); printf("Plot: %s\n",name);
3150 //Generated distributions
3152 sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
3153 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
3158 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
3159 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
3160 fhGenPi0Pt->SetLineColor(1);
3161 fhGenGamPt->SetLineColor(4);
3162 fhGenEtaPt->SetLineColor(2);
3163 fhGenOmegaPt->SetLineColor(7);
3164 fhGenElePt->SetLineColor(6);
3166 //Select the maximum of the histogram to show all lines.
3167 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3168 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
3169 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
3170 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3171 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
3172 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
3173 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
3174 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
3175 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
3176 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3177 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
3178 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
3179 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3180 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
3181 haxispt->SetMaximum(fhGenElePt->GetMaximum());
3182 haxispt->SetMinimum(1);
3183 haxispt->Draw("axis");
3184 fhGenPi0Pt->Draw("same");
3185 fhGenGamPt->Draw("same");
3186 fhGenEtaPt->Draw("same");
3187 fhGenOmegaPt->Draw("same");
3188 fhGenElePt->Draw("same");
3190 TLegend pLegend(0.85,0.65,0.95,0.93);
3191 pLegend.SetTextSize(0.06);
3192 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
3193 pLegend.AddEntry(fhGenGamPt," #gamma","L");
3194 pLegend.AddEntry(fhGenEtaPt," #eta","L");
3195 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
3196 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
3197 pLegend.SetFillColor(10);
3198 pLegend.SetBorderSize(1);
3203 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
3204 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
3205 fhGenPi0Eta->SetLineColor(1);
3206 fhGenGamEta->SetLineColor(4);
3207 fhGenEtaEta->SetLineColor(2);
3208 fhGenOmegaEta->SetLineColor(7);
3209 fhGenEleEta->SetLineColor(6);
3210 //Select the maximum of the histogram to show all lines.
3211 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3212 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
3213 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
3214 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3215 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3216 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
3217 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
3218 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3219 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
3220 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3221 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3222 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
3223 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3224 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
3225 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
3226 haxiseta->SetMinimum(100);
3227 haxiseta->Draw("axis");
3228 fhGenPi0Eta->Draw("same");
3229 fhGenGamEta->Draw("same");
3230 fhGenEtaEta->Draw("same");
3231 fhGenOmegaEta->Draw("same");
3232 fhGenEleEta->Draw("same");
3237 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
3238 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
3239 fhGenPi0Phi->SetLineColor(1);
3240 fhGenGamPhi->SetLineColor(4);
3241 fhGenEtaPhi->SetLineColor(2);
3242 fhGenOmegaPhi->SetLineColor(7);
3243 fhGenElePhi->SetLineColor(6);
3244 //Select the maximum of the histogram to show all lines.
3245 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3246 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
3247 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
3248 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3249 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3250 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
3251 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
3252 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3253 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
3254 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3255 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3256 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
3257 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3258 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
3259 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
3260 haxisphi->SetMinimum(100);
3261 haxisphi->Draw("axis");
3262 fhGenPi0Phi->Draw("same");
3263 fhGenGamPhi->Draw("same");
3264 fhGenEtaPhi->Draw("same");
3265 fhGenOmegaPhi->Draw("same");
3266 fhGenElePhi->Draw("same");
3268 sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
3269 c10->Print(name); printf("Plot: %s\n",name);
3272 //Reconstructed clusters depending on its original particle.
3274 sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
3275 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
3281 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
3282 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
3283 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
3284 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
3285 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
3286 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
3287 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
3288 hPi0E->SetLineColor(1);
3289 hGamE->SetLineColor(4);
3290 hNeHadE->SetLineColor(2);
3291 hChHadE->SetLineColor(7);
3292 hEleE->SetLineColor(6);
3294 //Select the maximum of the histogram to show all lines.
3295 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
3296 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
3297 haxisE->SetMaximum(hPi0E->GetMaximum());
3298 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
3299 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
3300 haxisE->SetMaximum(hGamE->GetMaximum());
3301 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
3302 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
3303 haxisE->SetMaximum(hNeHadE->GetMaximum());
3304 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
3305 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
3306 haxisE->SetMaximum(hChHadE->GetMaximum());
3307 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
3308 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
3309 haxisE->SetMaximum(hEleE->GetMaximum());
3310 haxisE->SetXTitle("E (GeV)");
3311 haxisE->SetMinimum(1);
3312 haxisE->Draw("axis");
3313 hPi0E->Draw("same");
3314 hGamE->Draw("same");
3315 hNeHadE->Draw("same");
3316 hChHadE->Draw("same");
3317 hEleE->Draw("same");
3319 TLegend pLegend2(0.8,0.65,0.95,0.93);
3320 pLegend2.SetTextSize(0.06);
3321 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
3322 pLegend2.AddEntry(hGamE," #gamma","L");
3323 pLegend2.AddEntry(hEleE," e^{#pm}","L");
3324 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
3325 pLegend2.AddEntry(hNeHadE," h^{0}","L");
3326 pLegend2.SetFillColor(10);
3327 pLegend2.SetBorderSize(1);
3333 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
3334 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
3335 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
3336 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
3337 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
3338 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
3339 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
3340 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
3341 hPi0Pt->SetLineColor(1);
3342 hGamPt->SetLineColor(4);
3343 hNeHadPt->SetLineColor(2);
3344 hChHadPt->SetLineColor(7);
3345 hElePt->SetLineColor(6);
3347 //Select the maximum of the histogram to show all lines.
3348 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3349 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
3350 haxispt->SetMaximum(hPi0Pt->GetMaximum());
3351 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3352 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
3353 haxispt->SetMaximum(hGamPt->GetMaximum());
3354 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
3355 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
3356 haxispt->SetMaximum(hNeHadPt->GetMaximum());
3357 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3358 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
3359 haxispt->SetMaximum(hChHadPt->GetMaximum());
3360 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3361 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
3362 haxispt->SetMaximum(hElePt->GetMaximum());
3363 haxispt->SetXTitle("p_{T} (GeV/c)");
3364 haxispt->SetMinimum(1);
3365 haxispt->Draw("axis");
3366 hPi0Pt->Draw("same");
3367 hGamPt->Draw("same");
3368 hNeHadPt->Draw("same");
3369 hChHadPt->Draw("same");
3370 hElePt->Draw("same");
3376 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
3377 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
3378 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
3379 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
3380 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
3381 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
3382 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
3383 hPi0Eta->SetLineColor(1);
3384 hGamEta->SetLineColor(4);
3385 hNeHadEta->SetLineColor(2);
3386 hChHadEta->SetLineColor(7);
3387 hEleEta->SetLineColor(6);
3388 //Select the maximum of the histogram to show all lines.
3389 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3390 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
3391 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
3392 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3393 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
3394 haxiseta->SetMaximum(hGamEta->GetMaximum());
3395 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
3396 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
3397 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
3398 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3399 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
3400 haxiseta->SetMaximum(hChHadEta->GetMaximum());
3401 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3402 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
3403 haxiseta->SetMaximum(hEleEta->GetMaximum());
3405 haxiseta->SetXTitle("#eta");
3406 haxiseta->Draw("axis");
3407 hPi0Eta->Draw("same");
3408 hGamEta->Draw("same");
3409 hNeHadEta->Draw("same");
3410 hChHadEta->Draw("same");
3411 hEleEta->Draw("same");
3416 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
3417 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
3418 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
3419 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
3420 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
3421 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
3422 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
3424 hPi0Phi->SetLineColor(1);
3425 hGamPhi->SetLineColor(4);
3426 hNeHadPhi->SetLineColor(2);
3427 hChHadPhi->SetLineColor(7);
3428 hElePhi->SetLineColor(6);
3429 //Select the maximum of the histogram to show all lines.
3430 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3431 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
3432 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
3433 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3434 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
3435 haxisphi->SetMaximum(hGamPhi->GetMaximum());
3436 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
3437 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
3438 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
3439 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3440 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
3441 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
3442 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3443 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
3444 haxisphi->SetMaximum(hElePhi->GetMaximum());
3445 haxisphi->SetXTitle("#phi (rad)");
3446 haxisphi->Draw("axis");
3447 hPi0Phi->Draw("same");
3448 hGamPhi->Draw("same");
3449 hNeHadPhi->Draw("same");
3450 hChHadPhi->Draw("same");
3451 hElePhi->Draw("same");
3453 sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
3454 c11->Print(name); printf("Plot: %s\n",name);
3457 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
3460 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
3461 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
3462 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
3463 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
3464 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
3465 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
3466 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
3467 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
3469 sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
3470 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
3475 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3476 hPi0EClone->Divide(fhGenPi0AccE);
3477 hGamEClone->Divide(fhGenGamAccE);
3478 haxisE->SetMaximum(5);
3479 haxisE->SetMinimum(1e-2);
3480 haxisE->SetXTitle("E (GeV)");
3481 haxisE->SetYTitle("ratio = rec/gen");
3482 haxisE->Draw("axis");
3483 hPi0E->Draw("same");
3484 hGamE->Draw("same");
3486 TLegend pLegend3(0.75,0.2,0.9,0.4);
3487 pLegend3.SetTextSize(0.06);
3488 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
3489 pLegend3.AddEntry(hGamEClone," #gamma","L");
3490 pLegend3.SetFillColor(10);
3491 pLegend3.SetBorderSize(1);
3496 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3497 hPi0PtClone->Divide(fhGenPi0AccPt);
3498 hGamPtClone->Divide(fhGenGamAccPt);
3499 haxispt->SetMaximum(5);
3500 haxispt->SetMinimum(1e-2);
3501 haxispt->SetXTitle("p_{T} (GeV/c)");
3502 haxispt->SetYTitle("ratio = rec/gen");
3503 haxispt->Draw("axis");
3504 hPi0PtClone->Draw("same");
3505 hGamPtClone->Draw("same");
3510 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3511 hPi0EtaClone->Divide(fhGenPi0AccEta);
3512 hGamEtaClone->Divide(fhGenGamAccEta);
3513 haxiseta->SetMaximum(1.2);
3514 haxiseta->SetMinimum(1e-2);
3515 haxiseta->SetYTitle("ratio = rec/gen");
3516 haxiseta->SetXTitle("#eta");
3517 haxiseta->Draw("axis");
3518 hPi0EtaClone->Draw("same");
3519 hGamEtaClone->Draw("same");
3524 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3525 hPi0PhiClone->Divide(fhGenPi0AccPhi);
3526 hGamPhiClone->Divide(fhGenGamAccPhi);
3527 haxisphi->SetYTitle("ratio = rec/gen");
3528 haxisphi->SetXTitle("#phi (rad)");
3529 haxisphi->SetMaximum(1.2);
3530 haxisphi->SetMinimum(1e-2);
3531 haxisphi->Draw("axis");
3532 hPi0PhiClone->Draw("same");
3533 hGamPhiClone->Draw("same");
3535 sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
3536 c12->Print(name); printf("Plot: %s\n",name);
3540 //Reconstructed distributions
3542 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
3543 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
3548 fhEMVxyz->SetTitleOffset(1.6,"Y");
3553 fhHaVxyz->SetTitleOffset(1.6,"Y");
3558 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
3559 hEMR->SetLineColor(4);
3564 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
3565 hHaR->SetLineColor(4);
3569 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
3570 c13->Print(name); printf("Plot: %s\n",name);
3573 //Track-matching distributions
3575 //Reconstructed distributions, matched with tracks, generated particle dependence
3577 sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
3578 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
3579 c22ch->Divide(2, 2);
3583 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
3584 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
3585 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
3586 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
3587 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
3588 hPi0ECharged->SetLineColor(1);
3589 hGamECharged->SetLineColor(4);
3590 hNeHadECharged->SetLineColor(2);
3591 hChHadECharged->SetLineColor(7);
3592 hEleECharged->SetLineColor(6);
3594 fhECharged->SetLineColor(3);
3595 fhECharged->SetMinimum(0.5);
3597 hPi0ECharged->Draw("same");
3598 hGamECharged->Draw("same");
3599 hNeHadECharged->Draw("same");
3600 hChHadECharged->Draw("same");
3601 hEleECharged->Draw("same");
3602 TLegend pLegend22(0.75,0.45,0.9,0.8);
3603 pLegend22.SetTextSize(0.06);
3604 pLegend22.AddEntry(fhECharged,"all","L");
3605 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
3606 pLegend22.AddEntry(hGamECharged,"#gamma","L");
3607 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
3608 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
3609 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
3610 pLegend22.SetFillColor(10);
3611 pLegend22.SetBorderSize(1);
3616 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
3617 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
3618 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
3619 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
3620 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
3621 hPi0PtCharged->SetLineColor(1);
3622 hGamPtCharged->SetLineColor(4);
3623 hNeHadPtCharged->SetLineColor(2);
3624 hChHadPtCharged->SetLineColor(7);
3625 hElePtCharged->SetLineColor(6);
3627 fhPtCharged->SetLineColor(3);
3628 fhPtCharged->SetMinimum(0.5);
3629 fhPtCharged->Draw();
3630 hPi0PtCharged->Draw("same");
3631 hGamPtCharged->Draw("same");
3632 hNeHadPtCharged->Draw("same");
3633 hChHadPtCharged->Draw("same");
3634 hElePtCharged->Draw("same");
3638 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
3639 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
3640 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
3641 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
3642 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
3643 hPi0EtaCharged->SetLineColor(1);
3644 hGamEtaCharged->SetLineColor(4);
3645 hNeHadEtaCharged->SetLineColor(2);
3646 hChHadEtaCharged->SetLineColor(7);
3647 hEleEtaCharged->SetLineColor(6);
3649 fhEtaCharged->SetLineColor(3);
3650 fhEtaCharged->SetMinimum(0.5);
3651 fhEtaCharged->Draw();
3652 hPi0EtaCharged->Draw("same");
3653 hGamEtaCharged->Draw("same");
3654 hNeHadEtaCharged->Draw("same");
3655 hChHadEtaCharged->Draw("same");
3656 hEleEtaCharged->Draw("same");
3660 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
3661 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
3662 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
3663 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
3664 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
3665 hPi0PhiCharged->SetLineColor(1);
3666 hGamPhiCharged->SetLineColor(4);
3667 hNeHadPhiCharged->SetLineColor(2);
3668 hChHadPhiCharged->SetLineColor(7);
3669 hElePhiCharged->SetLineColor(6);
3671 fhPhiCharged->SetLineColor(3);
3672 fhPhiCharged->SetMinimum(0.5);
3673 fhPhiCharged->Draw();
3674 hPi0PhiCharged->Draw("same");
3675 hGamPhiCharged->Draw("same");
3676 hNeHadPhiCharged->Draw("same");
3677 hChHadPhiCharged->Draw("same");
3678 hElePhiCharged->Draw("same");
3681 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
3682 c22ch->Print(name); printf("Plot: %s\n",name);
3684 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
3685 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
3686 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
3687 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
3689 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
3690 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
3691 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
3692 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
3694 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
3695 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
3696 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
3697 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
3699 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
3700 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
3701 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
3702 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
3704 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
3705 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
3706 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
3707 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
3709 //Ratio: reconstructed track matched/ all reconstructed
3711 sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
3712 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
3716 hEChargedClone->SetMaximum(1.2);
3717 hEChargedClone->SetMinimum(0.001);
3718 hEChargedClone->SetLineColor(3);
3719 hEChargedClone->SetYTitle("track matched / all");
3720 hPi0EChargedClone->Divide(hPi0E);
3721 hGamEChargedClone->Divide(hGamE);
3722 hEleEChargedClone->Divide(hEleE);
3723 hNeHadEChargedClone->Divide(hNeHadE);
3724 hChHadEChargedClone->Divide(hChHadE);
3725 hEChargedClone->Draw();
3726 hPi0EChargedClone->Draw("same");
3727 hGamEChargedClone->Draw("same");
3728 hEleEChargedClone->Draw("same");
3729 hNeHadEChargedClone->Draw("same");
3730 hChHadEChargedClone->Draw("same");
3732 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
3733 pLegend3ch.SetTextSize(0.06);
3734 pLegend3ch.AddEntry(hEChargedClone,"all","L");
3735 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
3736 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
3737 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
3738 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
3739 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
3740 pLegend3ch.SetFillColor(10);
3741 pLegend3ch.SetBorderSize(1);
3745 hPtChargedClone->SetMaximum(1.2);
3746 hPtChargedClone->SetMinimum(0.001);
3747 hPtChargedClone->SetLineColor(3);
3748 hPtChargedClone->SetYTitle("track matched / all");
3749 hPi0PtChargedClone->Divide(hPi0Pt);
3750 hGamPtChargedClone->Divide(hGamPt);
3751 hElePtChargedClone->Divide(hElePt);
3752 hNeHadPtChargedClone->Divide(hNeHadPt);
3753 hChHadPtChargedClone->Divide(hChHadPt);
3754 hPtChargedClone->Draw();
3755 hPi0PtChargedClone->Draw("same");
3756 hGamPtChargedClone->Draw("same");
3757 hElePtChargedClone->Draw("same");
3758 hNeHadPtChargedClone->Draw("same");
3759 hChHadPtChargedClone->Draw("same");
3762 hEtaChargedClone->SetMaximum(1.2);
3763 hEtaChargedClone->SetMinimum(0.001);
3764 hEtaChargedClone->SetLineColor(3);
3765 hEtaChargedClone->SetYTitle("track matched / all");
3766 hPi0EtaChargedClone->Divide(hPi0Eta);
3767 hGamEtaChargedClone->Divide(hGamEta);
3768 hEleEtaChargedClone->Divide(hEleEta);
3769 hNeHadEtaChargedClone->Divide(hNeHadEta);
3770 hChHadEtaChargedClone->Divide(hChHadEta);
3771 hEtaChargedClone->Draw();
3772 hPi0EtaChargedClone->Draw("same");
3773 hGamEtaChargedClone->Draw("same");
3774 hEleEtaChargedClone->Draw("same");
3775 hNeHadEtaChargedClone->Draw("same");
3776 hChHadEtaChargedClone->Draw("same");
3779 hPhiChargedClone->SetMaximum(1.2);
3780 hPhiChargedClone->SetMinimum(0.001);
3781 hPhiChargedClone->SetLineColor(3);
3782 hPhiChargedClone->SetYTitle("track matched / all");
3783 hPi0PhiChargedClone->Divide(hPi0Phi);
3784 hGamPhiChargedClone->Divide(hGamPhi);
3785 hElePhiChargedClone->Divide(hElePhi);
3786 hNeHadPhiChargedClone->Divide(hNeHadPhi);
3787 hChHadPhiChargedClone->Divide(hChHadPhi);
3788 hPhiChargedClone->Draw();
3789 hPi0PhiChargedClone->Draw("same");
3790 hGamPhiChargedClone->Draw("same");
3791 hElePhiChargedClone->Draw("same");
3792 hNeHadPhiChargedClone->Draw("same");
3793 hChHadPhiChargedClone->Draw("same");
3795 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
3796 c3ch->Print(name); printf("Plot: %s\n",name);
3799 //Track-matching distributions
3801 sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
3802 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
3805 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
3806 pLegendpE0.SetTextSize(0.04);
3807 pLegendpE0.AddEntry(fh1pOverE,"all","L");
3808 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
3809 pLegendpE0.SetFillColor(10);
3810 pLegendpE0.SetBorderSize(1);
3811 //pLegendpE0.Draw();
3814 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
3815 fh1pOverE->SetTitle("Track matches p/E");
3817 fh1pOverER02->SetLineColor(4);
3818 fh1pOverER02->Draw("same");
3822 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
3826 fh2MatchdEdx->Draw();
3831 sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
3832 cme->Print(name); printf("Plot: %s\n",name);
3835 sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
3836 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
3841 fhMCEle1pOverE->Draw();
3842 fhMCEle1pOverER02->SetLineColor(4);
3843 fhMCEle1pOverE->SetLineColor(1);
3844 fhMCEle1pOverER02->Draw("same");
3852 fhMCEle2MatchdEdx->Draw();
3854 sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
3855 cmemc->Print(name); printf("Plot: %s\n",name);
3858 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
3859 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
3860 cmemchad->Divide(3,1);
3864 fhMCChHad1pOverE->Draw();
3865 fhMCChHad1pOverER02->SetLineColor(4);
3866 fhMCChHad1pOverE->SetLineColor(1);
3867 fhMCChHad1pOverER02->Draw("same");
3872 fhMCChHad1dR->Draw();
3875 fhMCChHad2MatchdEdx->Draw();
3877 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
3878 cmemchad->Print(name); printf("Plot: %s\n",name);
3880 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
3881 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
3882 cmemcn->Divide(3,1);
3886 fhMCNeutral1pOverE->Draw();
3887 fhMCNeutral1pOverE->SetLineColor(1);
3888 fhMCNeutral1pOverER02->SetLineColor(4);
3889 fhMCNeutral1pOverER02->Draw("same");
3894 fhMCNeutral1dR->Draw();
3897 fhMCNeutral2MatchdEdx->Draw();
3899 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
3900 cmemcn->Print(name); printf("Plot: %s\n",name);
3902 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
3903 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
3908 fh1pOverE->SetLineColor(1);
3909 fhMCEle1pOverE->SetLineColor(4);
3910 fhMCChHad1pOverE->SetLineColor(2);
3911 fhMCNeutral1pOverE->SetLineColor(7);
3912 fh1pOverER02->SetMinimum(0.5);
3914 fhMCEle1pOverE->Draw("same");
3915 fhMCChHad1pOverE->Draw("same");
3916 fhMCNeutral1pOverE->Draw("same");
3917 TLegend pLegendpE(0.65,0.55,0.9,0.8);
3918 pLegendpE.SetTextSize(0.06);
3919 pLegendpE.AddEntry(fh1pOverE,"all","L");
3920 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
3921 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
3922 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
3923 pLegendpE.SetFillColor(10);
3924 pLegendpE.SetBorderSize(1);
3929 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
3930 fh1pOverER02->SetLineColor(1);
3931 fhMCEle1pOverER02->SetLineColor(4);
3932 fhMCChHad1pOverER02->SetLineColor(2);
3933 fhMCNeutral1pOverER02->SetLineColor(7);
3934 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
3935 fh1pOverER02->SetMinimum(0.5);
3936 fh1pOverER02->Draw();
3937 fhMCEle1pOverER02->Draw("same");
3938 fhMCChHad1pOverER02->Draw("same");
3939 fhMCNeutral1pOverER02->Draw("same");
3941 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
3942 // pLegendpE2.SetTextSize(0.06);
3943 // pLegendpE2.SetHeader("dR < 0.02");
3944 // pLegendpE2.SetFillColor(10);
3945 // pLegendpE2.SetBorderSize(1);
3946 // pLegendpE2.Draw();
3948 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
3949 cmpoe->Print(name); printf("Plot: %s\n",name);
3953 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
3954 gROOT->ProcessLine(line);
3955 sprintf(line, ".!rm -fR *.eps");
3956 gROOT->ProcessLine(line);
3958 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());