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), fNRCU(2),
63 fTimeCutMin(-1), fTimeCutMax(9999999),
64 fHistoPOverEBins(100), fHistoPOverEMax(100.), fHistoPOverEMin(0.),
65 fHistodEdxBins(100), fHistodEdxMax(100.), fHistodEdxMin(0.),
66 fHistodRBins(100), fHistodRMax(100.), fHistodRMin(0.),
67 fHistoTimeBins(100), fHistoTimeMax(100.), fHistoTimeMin(0.),
68 fHistoNBins(100), fHistoNMax(100), fHistoNMin(0),
69 fHistoRatioBins(100), fHistoRatioMax(100.), fHistoRatioMin(0.),
70 fHistoVertexDistBins(100), fHistoVertexDistMax(100.), fHistoVertexDistMin(0.),
71 fHistoRBins(100), fHistoRMax(1000), fHistoRMin(-1000),
72 fHistoXBins(100), fHistoXMax(1000), fHistoXMin(-1000),
73 fHistoYBins(100), fHistoYMax(1000), fHistoYMin(-1000),
74 fHistoZBins(100), fHistoZMax(1000), fHistoZMin(-1000),
75 fHistoSSBins(40), fHistoSSMax(10), fHistoSSMin(0),
76 fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhiE(0),
77 fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiECharged(0),
78 //fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0),
79 fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
80 fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0),
81 fhLambda(0), fhDispersion(0),
82 fhIM(0), fhIMCellCut(0),fhAsym(0),
83 fhNCellsPerCluster(0),fhNCellsPerClusterMIP(0), fhNCellsPerClusterMIPCharged(0), fhNClusters(0),
84 fhClusterTimeEnergy(0),fhCellTimeSpreadRespectToCellMax(0),fhCellIdCellLargeTimeSpread(0),
85 fhRNCells(0),fhXNCells(0),fhYNCells(0),fhZNCells(0),
86 fhRE(0), fhXE(0), fhYE(0), fhZE(0), fhXYZ(0),
87 fhRCellE(0), fhXCellE(0), fhYCellE(0), fhZCellE(0),fhXYZCell(0),
88 fhDeltaCellClusterRNCells(0),fhDeltaCellClusterXNCells(0),fhDeltaCellClusterYNCells(0),fhDeltaCellClusterZNCells(0),
89 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0), fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
90 fhNCells(0), fhAmplitude(0), fhAmpId(0), fhEtaPhiAmp(0),
91 fhTime(0), fhTimeId(0), fhTimeAmp(0), //fhT0Time(0), fhT0TimeId(0), fhT0TimeAmp(0),
92 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
93 fhEMod(0), fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),
94 fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0),
95 fhAmplitudeMod(0), fhAmplitudeModFraction(0),fhTimeAmpPerRCU(0), //fhT0TimeAmpPerRCU(0),
97 fhIMMod(0), fhIMCellCutMod(0),
98 fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
99 fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
100 fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
101 fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
102 fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0),
103 fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
104 fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
105 fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0),
106 fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
107 fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
108 fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
109 fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
110 fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
111 fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
112 fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
113 fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
114 fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
115 fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
116 fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
117 fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
118 fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
122 //Initialize parameters
126 //____________________________________________________________________________
127 AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
128 AliAnaPartCorrBaseClass(qa), fCalorimeter(qa.fCalorimeter), fStyleMacro(qa.fStyleMacro),
129 fMakePlots(qa.fMakePlots), fCorrelateCalos(qa.fCorrelateCalos), fNModules(qa.fNModules), fNRCU(qa.fNRCU),
130 fTimeCutMin(qa.fTimeCutMin), fTimeCutMax(qa.fTimeCutMax),
131 fHistoPOverEBins(qa.fHistoPOverEBins), fHistoPOverEMax(qa.fHistoPOverEMax), fHistoPOverEMin(qa.fHistoPOverEMin),
132 fHistodEdxBins(qa.fHistodEdxBins), fHistodEdxMax(qa.fHistodEdxMax), fHistodEdxMin(qa.fHistodEdxMin),
133 fHistodRBins(qa.fHistodRBins), fHistodRMax(qa.fHistodRMax), fHistodRMin(qa.fHistodRMin),
134 fHistoTimeBins(qa.fHistoTimeBins), fHistoTimeMax(qa.fHistoTimeMax), fHistoTimeMin(qa.fHistoTimeMin),
135 fHistoNBins(qa.fHistoNBins), fHistoNMax(qa.fHistoNMax), fHistoNMin(qa.fHistoNMin),
136 fHistoRatioBins(qa.fHistoRatioBins), fHistoRatioMax(qa.fHistoRatioMax), fHistoRatioMin(qa.fHistoRatioMin),
137 fHistoVertexDistBins(qa.fHistoVertexDistBins), fHistoVertexDistMax(qa.fHistoVertexDistMax), fHistoVertexDistMin(qa.fHistoVertexDistMin),
138 fHistoRBins(qa.fHistoRBins), fHistoRMax(qa.fHistoRMax), fHistoRMin(qa.fHistoRMin),
139 fHistoXBins(qa.fHistoXBins), fHistoXMax(qa.fHistoXMax), fHistoXMin(qa.fHistoXMin),
140 fHistoYBins(qa.fHistoYBins), fHistoYMax(qa.fHistoYMax), fHistoYMin(qa.fHistoYMin),
141 fHistoZBins(qa.fHistoZBins), fHistoZMax(qa.fHistoZMax), fHistoZMin(qa.fHistoZMin),
142 fHistoSSBins(qa.fHistoSSBins),fHistoSSMax(qa.fHistoSSMax), fHistoSSMin(qa.fHistoSSMin),
143 fhE(qa.fhE),fhPt(qa.fhPt), fhPhi(qa.fhPhi), fhEta(qa.fhEta), fhEtaPhiE(qa.fhEtaPhiE),
144 fhECharged(qa.fhECharged),fhPtCharged(qa.fhPtCharged),fhPhiCharged(qa.fhPhiCharged),
145 fhEtaCharged(qa.fhEtaCharged), fhEtaPhiECharged(qa.fhEtaPhiECharged),
146 //fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
147 //fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut),
148 fhDeltaE(qa.fhDeltaE), fhDeltaPt(qa.fhDeltaPt), fhDeltaPhi(qa.fhDeltaPhi), fhDeltaEta(qa.fhDeltaEta),
149 fhRatioE(qa.fhRatioE), fhRatioPt(qa.fhRatioPt), fhRatioPhi(qa.fhRatioPhi), fhRatioEta(qa.fhRatioEta),
150 fh2E(qa.fh2E), fh2Pt(qa.fh2Pt), fh2Phi(qa.fh2Phi),fh2Eta(qa.fh2Eta),
151 fhLambda(qa.fhLambda), fhDispersion(qa.fhDispersion),
152 fhIM(qa.fhIM), fhIMCellCut(qa.fhIMCellCut), fhAsym(qa.fhAsym),
153 fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNCellsPerClusterMIP(qa.fhNCellsPerClusterMIP),
154 fhNCellsPerClusterMIPCharged(qa.fhNCellsPerClusterMIPCharged),fhNClusters(qa.fhNClusters),
155 fhClusterTimeEnergy(qa.fhClusterTimeEnergy),
156 fhCellTimeSpreadRespectToCellMax(qa.fhCellTimeSpreadRespectToCellMax),
157 fhCellIdCellLargeTimeSpread(qa.fhCellIdCellLargeTimeSpread),
158 fhRNCells(qa.fhRNCells),fhXNCells(qa.fhXNCells),fhYNCells(qa.fhYNCells),fhZNCells(qa.fhZNCells),
159 fhRE(qa.fhRE), fhXE(qa.fhXE), fhYE(qa.fhYE), fhZE(qa.fhZE), fhXYZ(qa.fhXYZ),
160 fhRCellE(qa.fhXCellE), fhXCellE(qa.fhXCellE), fhYCellE(qa.fhYCellE), fhZCellE(qa.fhZCellE),fhXYZCell(qa.fhXYZCell),
161 fhDeltaCellClusterRNCells(qa.fhDeltaCellClusterRNCells),fhDeltaCellClusterXNCells(qa.fhDeltaCellClusterXNCells),
162 fhDeltaCellClusterYNCells(qa.fhDeltaCellClusterYNCells),fhDeltaCellClusterZNCells(qa.fhDeltaCellClusterZNCells),
163 fhDeltaCellClusterRE(qa.fhDeltaCellClusterRE), fhDeltaCellClusterXE(qa.fhDeltaCellClusterXE),
164 fhDeltaCellClusterYE(qa.fhDeltaCellClusterYE), fhDeltaCellClusterZE(qa.fhDeltaCellClusterZE),
165 fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude), fhAmpId(fhAmpId), fhEtaPhiAmp(qa.fhEtaPhiAmp),
166 fhTime(qa.fhTime), fhTimeId(qa.fhTimeId),fhTimeAmp(qa.fhTimeAmp),
167 //fhT0Time(qa.fhT0Time),fhT0TimeId(qa.fhT0TimeId), fhT0TimeAmp(qa.fhT0TimeAmp),
168 fhCaloCorrNClusters(qa.fhCaloCorrNClusters), fhCaloCorrEClusters(qa.fhCaloCorrEClusters),
169 fhCaloCorrNCells(qa.fhCaloCorrNCells), fhCaloCorrECells(qa.fhCaloCorrECells),
170 fhEMod(qa.fhEMod), fhNClustersMod(qa.fhNClustersMod),
171 fhNCellsPerClusterMod(qa.fhNCellsPerClusterMod), fhNCellsMod(qa.fhNCellsMod),
172 fhGridCellsMod(qa.fhGridCellsMod), fhGridCellsEMod(qa.fhGridCellsEMod), fhGridCellsTimeMod(qa.fhGridCellsTimeMod),
173 fhAmplitudeMod(qa.fhAmplitudeMod), fhAmplitudeModFraction(qa.fhAmplitudeModFraction),
174 fhTimeAmpPerRCU(qa.fhTimeAmpPerRCU), //fhT0TimeAmpPerRCU(qa.fhT0TimeAmpPerRCU), fhTimeCorrRCU(qa.fhTimeCorrRCU),
175 fhIMMod(qa.fhIMMod),fhIMCellCutMod(qa.fhIMCellCutMod),
176 fhGenGamPt(qa.fhGenGamPt), fhGenGamEta(qa.fhGenGamEta), fhGenGamPhi(qa.fhGenGamPhi),
177 fhGenPi0Pt(qa.fhGenPi0Pt), fhGenPi0Eta(qa.fhGenPi0Eta), fhGenPi0Phi(qa.fhGenPi0Phi),
178 fhGenEtaPt(qa.fhGenEtaPt), fhGenEtaEta(qa.fhGenEtaEta), fhGenEtaPhi(qa.fhGenEtaPhi),
179 fhGenOmegaPt(qa.fhGenOmegaPt), fhGenOmegaEta(qa.fhGenOmegaEta), fhGenOmegaPhi(qa.fhGenOmegaPhi),
180 fhGenElePt(qa.fhGenElePt), fhGenEleEta(qa.fhGenEleEta), fhGenElePhi(qa.fhGenElePhi),
181 fhEMVxyz(qa.fhEMVxyz), fhEMR(qa.fhEMR), fhHaVxyz(qa.fhHaVxyz), fhHaR(qa.fhHaR),
182 fhGamE(qa.fhGamE),fhGamPt(qa.fhGamPt),fhGamPhi(qa.fhGamPhi),fhGamEta(qa.fhGamEta),
183 fhGamDeltaE(qa.fhGamDeltaE), fhGamDeltaPt(qa.fhGamDeltaPt), fhGamDeltaPhi(qa.fhGamDeltaPhi), fhGamDeltaEta(qa.fhGamDeltaEta),
184 fhGamRatioE(qa.fhGamRatioE), fhGamRatioPt(qa.fhGamRatioPt), fhGamRatioPhi(qa.fhGamRatioPhi), fhGamRatioEta(qa.fhGamRatioEta),
185 fhEleE(qa.fhEleE),fhElePt(qa.fhElePt),fhElePhi(qa.fhElePhi),fhEleEta(qa.fhEleEta),
186 fhPi0E(qa.fhPi0E),fhPi0Pt(qa.fhPi0Pt),fhPi0Phi(qa.fhPi0Phi),fhPi0Eta(qa.fhPi0Eta),
187 fhNeHadE(qa.fhNeHadE),fhNeHadPt(qa.fhNeHadPt),fhNeHadPhi(qa.fhNeHadPhi),fhNeHadEta(qa.fhNeHadEta),
188 fhChHadE(qa.fhChHadE),fhChHadPt(qa.fhChHadPt),fhChHadPhi(qa.fhChHadPhi),fhChHadEta(qa.fhChHadEta),
189 fhGamECharged(qa.fhGamECharged),fhGamPtCharged(qa.fhGamPtCharged),fhGamPhiCharged(qa.fhGamPhiCharged),fhGamEtaCharged(qa.fhGamEtaCharged),
190 fhEleECharged(qa.fhEleECharged),fhElePtCharged(qa.fhElePtCharged),fhElePhiCharged(qa.fhElePhiCharged),fhEleEtaCharged(qa.fhEleEtaCharged),
191 fhPi0ECharged(qa.fhPi0ECharged),fhPi0PtCharged(qa.fhPi0PtCharged),fhPi0PhiCharged(qa.fhPi0PhiCharged),fhPi0EtaCharged(qa.fhPi0EtaCharged),
192 fhNeHadECharged(qa.fhNeHadECharged),fhNeHadPtCharged(qa.fhNeHadPtCharged),fhNeHadPhiCharged(qa.fhNeHadPhiCharged),fhNeHadEtaCharged(qa.fhNeHadEtaCharged),
193 fhChHadECharged(qa.fhChHadECharged),fhChHadPtCharged(qa.fhChHadPtCharged),fhChHadPhiCharged(qa.fhChHadPhiCharged),fhChHadEtaCharged(qa.fhChHadEtaCharged),
194 fhGenGamAccE(qa.fhGenGamAccE),fhGenGamAccPt(qa.fhGenGamAccPt),fhGenGamAccEta(qa.fhGenGamAccEta),fhGenGamAccPhi(qa.fhGenGamAccPhi),
195 fhGenPi0AccE(qa.fhGenPi0AccE),fhGenPi0AccPt(qa.fhGenPi0AccPt),fhGenPi0AccEta(qa.fhGenPi0AccEta),fhGenPi0AccPhi(qa.fhGenPi0AccPhi),
196 fh1pOverE(qa.fh1pOverE),fh1dR(qa.fh1dR),fh2EledEdx(qa.fh2EledEdx), fh2MatchdEdx(qa.fh2MatchdEdx),
197 fhMCEle1pOverE(qa.fhMCEle1pOverE),fhMCEle1dR(qa.fhMCEle1dR), fhMCEle2MatchdEdx(qa.fhMCEle2MatchdEdx),
198 fhMCChHad1pOverE(qa.fhMCChHad1pOverE),fhMCChHad1dR(qa.fhMCChHad1dR), fhMCChHad2MatchdEdx(qa.fhMCChHad2MatchdEdx),
199 fhMCNeutral1pOverE(qa.fhMCNeutral1pOverE),fhMCNeutral1dR(qa.fhMCNeutral1dR), fhMCNeutral2MatchdEdx(qa.fhMCNeutral2MatchdEdx),
200 fh1pOverER02(qa.fh1pOverER02), fhMCEle1pOverER02(qa.fhMCEle1pOverER02),fhMCChHad1pOverER02(qa.fhMCChHad1pOverER02), fhMCNeutral1pOverER02(qa.fhMCNeutral1pOverER02)
206 //________________________________________________________________________________________________________________________________________________
207 //AliAnaCalorimeterQA::~AliAnaCalorimeterQA() {
213 //________________________________________________________________________
214 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
216 // Create histograms to be saved in output file and
217 // store them in outputContainer
219 TList * outputContainer = new TList() ;
220 outputContainer->SetName("QAHistos") ;
223 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
224 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
225 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
226 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
227 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
228 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
229 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
230 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
231 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
232 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
233 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
234 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
235 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
236 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
237 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
238 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
239 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
246 if(fCalorimeter=="PHOS"){
253 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins,ptmin,ptmax);
254 fhE->SetXTitle("E (GeV)");
255 outputContainer->Add(fhE);
257 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
258 fhPt->SetXTitle("p_{T} (GeV/c)");
259 outputContainer->Add(fhPt);
261 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
262 fhPhi->SetXTitle("#phi (rad)");
263 outputContainer->Add(fhPhi);
265 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
266 fhEta->SetXTitle("#eta ");
267 outputContainer->Add(fhEta);
269 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
270 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
271 fhEtaPhiE->SetXTitle("#eta ");
272 fhEtaPhiE->SetYTitle("#phi (rad)");
273 fhEtaPhiE->SetZTitle("E (GeV) ");
274 outputContainer->Add(fhEtaPhiE);
276 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
277 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
278 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
279 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
280 outputContainer->Add(fhClusterTimeEnergy);
284 fhLambda = new TH3F ("hLambda","#lambda_{0}^{2} vs #lambda_{1}^{2} vs energy, reconstructed clusters",
285 ssbins,ssmin,ssmax,ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
286 fhLambda->SetXTitle("#lambda_{0}^{2} ");
287 fhLambda->SetYTitle("#lambda_{1}^{2} ");
288 fhLambda->SetZTitle("E (GeV) ");
289 outputContainer->Add(fhLambda);
291 fhDispersion = new TH2F ("hDispersion"," dispersion vs energy, reconstructed clusters",
292 ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
293 fhDispersion->SetXTitle("Dispersion ");
294 fhDispersion->SetYTitle("E (GeV) ");
295 outputContainer->Add(fhDispersion);
299 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
300 fhECharged->SetXTitle("E (GeV)");
301 outputContainer->Add(fhECharged);
303 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
304 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
305 outputContainer->Add(fhPtCharged);
307 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
308 fhPhiCharged->SetXTitle("#phi (rad)");
309 outputContainer->Add(fhPhiCharged);
311 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
312 fhEtaCharged->SetXTitle("#eta ");
313 outputContainer->Add(fhEtaCharged);
315 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
316 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
317 fhEtaPhiECharged->SetXTitle("#eta ");
318 fhEtaPhiECharged->SetYTitle("#phi ");
319 fhEtaPhiECharged->SetZTitle("E (GeV) ");
320 outputContainer->Add(fhEtaPhiECharged);
323 // fhEChargedNoOut = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
324 // fhEChargedNoOut->SetXTitle("E (GeV)");
325 // outputContainer->Add(fhEChargedNoOut);
327 // fhPtChargedNoOut = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
328 // fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
329 // outputContainer->Add(fhPtChargedNoOut);
331 // fhPhiChargedNoOut = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax);
332 // fhPhiChargedNoOut->SetXTitle("#phi (rad)");
333 // outputContainer->Add(fhPhiChargedNoOut);
335 // fhEtaChargedNoOut = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax);
336 // fhEtaChargedNoOut->SetXTitle("#eta ");
337 // outputContainer->Add(fhEtaChargedNoOut);
339 // fhEtaPhiChargedNoOut = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);
340 // fhEtaPhiChargedNoOut->SetXTitle("#eta ");
341 // fhEtaPhiChargedNoOut->SetYTitle("#phi ");
342 // outputContainer->Add(fhEtaPhiChargedNoOut);
344 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
345 fh1pOverE->SetYTitle("p/E");
346 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
347 outputContainer->Add(fh1pOverE);
349 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
350 fh1dR->SetXTitle("#Delta R (rad)");
351 outputContainer->Add(fh1dR) ;
353 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
354 fh2MatchdEdx->SetXTitle("p (GeV/c)");
355 fh2MatchdEdx->SetYTitle("<dE/dx>");
356 outputContainer->Add(fh2MatchdEdx);
358 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
359 fh2EledEdx->SetXTitle("p (GeV/c)");
360 fh2EledEdx->SetYTitle("<dE/dx>");
361 outputContainer->Add(fh2EledEdx) ;
363 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
364 fh1pOverER02->SetYTitle("p/E");
365 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
366 outputContainer->Add(fh1pOverER02);
368 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
369 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
370 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
371 outputContainer->Add(fhIM);
373 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
374 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
375 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
376 outputContainer->Add(fhIMCellCut);
378 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
379 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
380 fhAsym->SetYTitle("Asymmetry");
381 outputContainer->Add(fhAsym);
383 fhNCellsPerCluster = new TH3F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax, netabins,etamin,etamax);
384 fhNCellsPerCluster->SetXTitle("E (GeV)");
385 fhNCellsPerCluster->SetYTitle("n cells");
386 fhNCellsPerCluster->SetZTitle("#eta");
387 outputContainer->Add(fhNCellsPerCluster);
390 fhNCellsPerClusterMIP = new TH3F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
391 100,0.,1., 6,0,5,netabins,etamin,etamax);
392 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
393 fhNCellsPerClusterMIP->SetYTitle("n cells");
394 fhNCellsPerClusterMIP->SetZTitle("#eta");
395 outputContainer->Add(fhNCellsPerClusterMIP);
398 fhNCellsPerClusterMIPCharged = new TH3F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
399 100,0.,1., 6,0,5,netabins,etamin,etamax);
400 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
401 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
402 fhNCellsPerClusterMIPCharged->SetZTitle("#eta");
403 outputContainer->Add(fhNCellsPerClusterMIPCharged);
406 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
407 fhNClusters->SetXTitle("number of clusters");
408 outputContainer->Add(fhNClusters);
410 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax);
411 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
412 fhRNCells->SetYTitle("N cells per cluster");
413 outputContainer->Add(fhRNCells);
415 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax);
416 fhXNCells->SetXTitle("x (cm)");
417 fhXNCells->SetYTitle("N cells per cluster");
418 outputContainer->Add(fhXNCells);
420 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax);
421 fhYNCells->SetXTitle("y (cm)");
422 fhYNCells->SetYTitle("N cells per cluster");
423 outputContainer->Add(fhYNCells);
425 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax);
426 fhZNCells->SetXTitle("z (cm)");
427 fhZNCells->SetYTitle("N cells per cluster");
428 outputContainer->Add(fhZNCells);
430 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
431 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
432 fhRE->SetYTitle("E (GeV)");
433 outputContainer->Add(fhRE);
435 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
436 fhXE->SetXTitle("x (cm)");
437 fhXE->SetYTitle("E (GeV)");
438 outputContainer->Add(fhXE);
440 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
441 fhYE->SetXTitle("y (cm)");
442 fhYE->SetYTitle("E (GeV)");
443 outputContainer->Add(fhYE);
445 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
446 fhZE->SetXTitle("z (cm)");
447 fhZE->SetYTitle("E (GeV)");
448 outputContainer->Add(fhZE);
450 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
451 fhXYZ->SetXTitle("x (cm)");
452 fhXYZ->SetYTitle("y (cm)");
453 fhXYZ->SetZTitle("z (cm) ");
454 outputContainer->Add(fhXYZ);
456 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
457 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
458 fhRCellE->SetYTitle("E (GeV)");
459 outputContainer->Add(fhRCellE);
461 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
462 fhXCellE->SetXTitle("x (cm)");
463 fhXCellE->SetYTitle("E (GeV)");
464 outputContainer->Add(fhXCellE);
466 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
467 fhYCellE->SetXTitle("y (cm)");
468 fhYCellE->SetYTitle("E (GeV)");
469 outputContainer->Add(fhYCellE);
471 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
472 fhZCellE->SetXTitle("z (cm)");
473 fhZCellE->SetYTitle("E (GeV)");
474 outputContainer->Add(fhZCellE);
476 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
477 fhXYZCell->SetXTitle("x (cm)");
478 fhXYZCell->SetYTitle("y (cm)");
479 fhXYZCell->SetZTitle("z (cm)");
480 outputContainer->Add(fhXYZCell);
483 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
484 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
485 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
486 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
488 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax);
489 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
490 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
491 outputContainer->Add(fhDeltaCellClusterRNCells);
493 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax);
494 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
495 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
496 outputContainer->Add(fhDeltaCellClusterXNCells);
498 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax);
499 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
500 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
501 outputContainer->Add(fhDeltaCellClusterYNCells);
503 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax);
504 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
505 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
506 outputContainer->Add(fhDeltaCellClusterZNCells);
508 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
509 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
510 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
511 outputContainer->Add(fhDeltaCellClusterRE);
513 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
514 fhDeltaCellClusterXE->SetXTitle("x (cm)");
515 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
516 outputContainer->Add(fhDeltaCellClusterXE);
518 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
519 fhDeltaCellClusterYE->SetXTitle("y (cm)");
520 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
521 outputContainer->Add(fhDeltaCellClusterYE);
523 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
524 fhDeltaCellClusterZE->SetXTitle("z (cm)");
525 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
526 outputContainer->Add(fhDeltaCellClusterZE);
528 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
529 fhEtaPhiAmp->SetXTitle("#eta ");
530 fhEtaPhiAmp->SetYTitle("#phi (rad)");
531 fhEtaPhiAmp->SetZTitle("E (GeV) ");
532 outputContainer->Add(fhEtaPhiAmp);
536 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
537 fhNCells->SetXTitle("n cells");
538 outputContainer->Add(fhNCells);
540 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
541 fhAmplitude->SetXTitle("Cell Energy (GeV)");
542 outputContainer->Add(fhAmplitude);
544 fhAmpId = new TH2F ("hAmpId","Cell Energy", nptbins*2,ptmin,ptmax*2,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
545 fhAmpId->SetXTitle("Cell Energy (GeV)");
546 outputContainer->Add(fhAmpId);
549 //Cell Time histograms, time only available in ESDs
550 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
552 fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200);
553 fhCellTimeSpreadRespectToCellMax->SetXTitle("#Delta t (ns)");
554 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
556 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
557 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
558 outputContainer->Add(fhCellIdCellLargeTimeSpread);
560 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
561 fhTime->SetXTitle("Cell Time (ns)");
562 outputContainer->Add(fhTime);
564 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
565 fhTimeId->SetXTitle("Cell Time (ns)");
566 fhTimeId->SetYTitle("Cell Absolute Id");
567 outputContainer->Add(fhTimeId);
569 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
570 fhTimeAmp->SetYTitle("Cell Time (ns)");
571 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
572 outputContainer->Add(fhTimeAmp);
574 // fhT0Time = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax);
575 // fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
576 // outputContainer->Add(fhT0Time);
578 // fhT0TimeId = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
579 // fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
580 // fhT0TimeId->SetYTitle("Cell Absolute Id");
581 // outputContainer->Add(fhT0TimeId);
583 // fhT0TimeAmp = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
584 // fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
585 // fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
586 // outputContainer->Add(fhT0TimeAmp);
592 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
593 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
594 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
595 outputContainer->Add(fhCaloCorrNClusters);
597 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
598 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
599 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
600 outputContainer->Add(fhCaloCorrEClusters);
602 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
603 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
604 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
605 outputContainer->Add(fhCaloCorrNCells);
607 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
608 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
609 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
610 outputContainer->Add(fhCaloCorrECells);
611 }//correlate calorimeters
614 fhEMod = new TH1F*[fNModules];
615 fhNClustersMod = new TH1F*[fNModules];
616 fhNCellsPerClusterMod = new TH2F*[fNModules];
617 fhNCellsMod = new TH1F*[fNModules];
618 fhGridCellsMod = new TH2F*[fNModules];
619 fhGridCellsEMod = new TH2F*[fNModules];
620 fhGridCellsTimeMod = new TH2F*[fNModules];
621 fhAmplitudeMod = new TH1F*[fNModules];
622 if(fCalorimeter=="EMCAL")
623 fhAmplitudeModFraction = new TH1F*[fNModules*3];
625 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
626 //fhT0TimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
627 //fhTimeCorrRCU = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
629 fhIMMod = new TH2F*[fNModules];
630 fhIMCellCutMod = new TH2F*[fNModules];
632 for(Int_t imod = 0; imod < fNModules; imod++){
634 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
635 fhEMod[imod]->SetXTitle("E (GeV)");
636 outputContainer->Add(fhEMod[imod]);
638 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
639 fhNClustersMod[imod]->SetXTitle("number of clusters");
640 outputContainer->Add(fhNClustersMod[imod]);
642 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
643 Form("# cells per cluster vs cluster energy in Module %d",imod),
644 nptbins,ptmin,ptmax, nbins,nmin,nmax);
645 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
646 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
647 outputContainer->Add(fhNCellsPerClusterMod[imod]);
649 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
650 fhNCellsMod[imod]->SetXTitle("n cells");
651 outputContainer->Add(fhNCellsMod[imod]);
652 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
653 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
654 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
655 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
656 outputContainer->Add(fhGridCellsMod[imod]);
658 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
659 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
660 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
661 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
662 outputContainer->Add(fhGridCellsEMod[imod]);
664 fhGridCellsTimeMod[imod] = new TH2F (Form("hGridCellsTime_Mod%d",imod),Form("Accumulated time in grid of cells in Module %d, with E > 0.5 GeV",imod),
665 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
666 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)");
667 fhGridCellsTimeMod[imod]->SetXTitle("column (eta direction)");
668 outputContainer->Add(fhGridCellsTimeMod[imod]);
670 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
671 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
672 outputContainer->Add(fhAmplitudeMod[imod]);
674 if(fCalorimeter == "EMCAL"){
675 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
676 fhAmplitudeModFraction[imod*3+ifrac] = new TH1F (Form("hAmplitude_Mod%d_Frac%d",imod,ifrac),Form("Cell reconstructed Energy in Module %d, Fraction %d ",imod,ifrac), nptbins,ptmin,ptmax);
677 fhAmplitudeModFraction[imod*3+ifrac]->SetXTitle("E (GeV)");
678 outputContainer->Add(fhAmplitudeModFraction[imod*3+ifrac]);
683 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
684 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
685 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
686 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
687 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
688 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
689 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
691 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
692 // Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu),
693 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
694 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
695 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
696 // outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
699 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
700 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
701 // Int_t index = (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod;
702 // fhTimeCorrRCU[index] = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
703 // Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
704 // ntimebins,timemin,timemax,ntimebins,timemin,timemax);
705 // fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
706 // fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
707 // outputContainer->Add(fhTimeCorrRCU[index]);
713 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
714 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
715 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
716 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
717 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
718 outputContainer->Add(fhIMMod[imod]);
720 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
721 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
722 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
723 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
724 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
725 outputContainer->Add(fhIMCellCutMod[imod]);
730 //Monte Carlo Histograms
733 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
734 fhDeltaE->SetXTitle("#Delta E (GeV)");
735 outputContainer->Add(fhDeltaE);
737 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
738 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
739 outputContainer->Add(fhDeltaPt);
741 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
742 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
743 outputContainer->Add(fhDeltaPhi);
745 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
746 fhDeltaEta->SetXTitle("#Delta #eta ");
747 outputContainer->Add(fhDeltaEta);
749 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
750 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
751 outputContainer->Add(fhRatioE);
753 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
754 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
755 outputContainer->Add(fhRatioPt);
757 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
758 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
759 outputContainer->Add(fhRatioPhi);
761 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
762 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
763 outputContainer->Add(fhRatioEta);
765 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
766 fh2E->SetXTitle("E_{rec} (GeV)");
767 fh2E->SetYTitle("E_{gen} (GeV)");
768 outputContainer->Add(fh2E);
770 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
771 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
772 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
773 outputContainer->Add(fh2Pt);
775 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
776 fh2Phi->SetXTitle("#phi_{rec} (rad)");
777 fh2Phi->SetYTitle("#phi_{gen} (rad)");
778 outputContainer->Add(fh2Phi);
780 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
781 fh2Eta->SetXTitle("#eta_{rec} ");
782 fh2Eta->SetYTitle("#eta_{gen} ");
783 outputContainer->Add(fh2Eta);
785 //Fill histos depending on origin of cluster
786 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
787 fhGamE->SetXTitle("E_{rec} (GeV)");
788 fhGamE->SetXTitle("E_{gen} (GeV)");
789 outputContainer->Add(fhGamE);
791 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
792 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
793 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
794 outputContainer->Add(fhGamPt);
796 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
797 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
798 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
799 outputContainer->Add(fhGamPhi);
801 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
802 fhGamEta->SetXTitle("#eta_{rec} ");
803 fhGamEta->SetYTitle("#eta_{gen} ");
804 outputContainer->Add(fhGamEta);
806 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
807 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
808 outputContainer->Add(fhGamDeltaE);
810 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
811 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
812 outputContainer->Add(fhGamDeltaPt);
814 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
815 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
816 outputContainer->Add(fhGamDeltaPhi);
818 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
819 fhGamDeltaEta->SetXTitle("#Delta #eta ");
820 outputContainer->Add(fhGamDeltaEta);
822 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
823 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
824 outputContainer->Add(fhGamRatioE);
826 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
827 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
828 outputContainer->Add(fhGamRatioPt);
830 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
831 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
832 outputContainer->Add(fhGamRatioPhi);
834 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
835 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
836 outputContainer->Add(fhGamRatioEta);
838 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
839 fhPi0E->SetXTitle("E_{rec} (GeV)");
840 fhPi0E->SetYTitle("E_{gen} (GeV)");
841 outputContainer->Add(fhPi0E);
843 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
844 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
845 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
846 outputContainer->Add(fhPi0Pt);
848 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
849 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
850 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
851 outputContainer->Add(fhPi0Phi);
853 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
854 fhPi0Eta->SetXTitle("#eta_{rec} ");
855 fhPi0Eta->SetYTitle("#eta_{gen} ");
856 outputContainer->Add(fhPi0Eta);
858 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
859 fhEleE->SetXTitle("E_{rec} (GeV)");
860 fhEleE->SetXTitle("E_{gen} (GeV)");
861 outputContainer->Add(fhEleE);
863 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
864 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
865 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
866 outputContainer->Add(fhElePt);
868 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
869 fhElePhi->SetXTitle("#phi_{rec} (rad)");
870 fhElePhi->SetYTitle("#phi_{gen} (rad)");
871 outputContainer->Add(fhElePhi);
873 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
874 fhEleEta->SetXTitle("#eta_{rec} ");
875 fhEleEta->SetYTitle("#eta_{gen} ");
876 outputContainer->Add(fhEleEta);
878 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
879 fhNeHadE->SetXTitle("E_{rec} (GeV)");
880 fhNeHadE->SetYTitle("E_{gen} (GeV)");
881 outputContainer->Add(fhNeHadE);
883 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
884 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
885 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
886 outputContainer->Add(fhNeHadPt);
888 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
889 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
890 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
891 outputContainer->Add(fhNeHadPhi);
893 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
894 fhNeHadEta->SetXTitle("#eta_{rec} ");
895 fhNeHadEta->SetYTitle("#eta_{gen} ");
896 outputContainer->Add(fhNeHadEta);
898 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
899 fhChHadE->SetXTitle("E_{rec} (GeV)");
900 fhChHadE->SetYTitle("E_{gen} (GeV)");
901 outputContainer->Add(fhChHadE);
903 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
904 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
905 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
906 outputContainer->Add(fhChHadPt);
908 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
909 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
910 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
911 outputContainer->Add(fhChHadPhi);
913 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
914 fhChHadEta->SetXTitle("#eta_{rec} ");
915 fhChHadEta->SetYTitle("#eta_{gen} ");
916 outputContainer->Add(fhChHadEta);
920 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
921 fhGamECharged->SetXTitle("E_{rec} (GeV)");
922 fhGamECharged->SetXTitle("E_{gen} (GeV)");
923 outputContainer->Add(fhGamECharged);
925 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
926 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
927 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
928 outputContainer->Add(fhGamPtCharged);
930 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
931 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
932 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
933 outputContainer->Add(fhGamPhiCharged);
935 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
936 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
937 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
938 outputContainer->Add(fhGamEtaCharged);
940 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
941 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
942 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
943 outputContainer->Add(fhPi0ECharged);
945 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
946 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
947 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
948 outputContainer->Add(fhPi0PtCharged);
950 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
951 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
952 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
953 outputContainer->Add(fhPi0PhiCharged);
955 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
956 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
957 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
958 outputContainer->Add(fhPi0EtaCharged);
960 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
961 fhEleECharged->SetXTitle("E_{rec} (GeV)");
962 fhEleECharged->SetXTitle("E_{gen} (GeV)");
963 outputContainer->Add(fhEleECharged);
965 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
966 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
967 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
968 outputContainer->Add(fhElePtCharged);
970 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
971 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
972 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
973 outputContainer->Add(fhElePhiCharged);
975 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
976 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
977 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
978 outputContainer->Add(fhEleEtaCharged);
980 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
981 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
982 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
983 outputContainer->Add(fhNeHadECharged);
985 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
986 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
987 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
988 outputContainer->Add(fhNeHadPtCharged);
990 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
991 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
992 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
993 outputContainer->Add(fhNeHadPhiCharged);
995 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
996 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
997 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
998 outputContainer->Add(fhNeHadEtaCharged);
1000 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1001 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
1002 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
1003 outputContainer->Add(fhChHadECharged);
1005 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1006 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1007 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1008 outputContainer->Add(fhChHadPtCharged);
1010 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1011 fhChHadPhiCharged->SetXTitle("#phi (rad)");
1012 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1013 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1014 outputContainer->Add(fhChHadPhiCharged);
1016 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1017 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
1018 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
1019 outputContainer->Add(fhChHadEtaCharged);
1021 //Vertex of generated particles
1023 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1024 fhEMVxyz->SetXTitle("v_{x}");
1025 fhEMVxyz->SetYTitle("v_{y}");
1026 //fhEMVxyz->SetZTitle("v_{z}");
1027 outputContainer->Add(fhEMVxyz);
1029 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1030 fhHaVxyz->SetXTitle("v_{x}");
1031 fhHaVxyz->SetYTitle("v_{y}");
1032 //fhHaVxyz->SetZTitle("v_{z}");
1033 outputContainer->Add(fhHaVxyz);
1035 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1036 fhEMR->SetXTitle("E (GeV)");
1037 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1038 outputContainer->Add(fhEMR);
1040 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1041 fhHaR->SetXTitle("E (GeV)");
1042 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1043 outputContainer->Add(fhHaR);
1048 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
1049 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
1050 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
1052 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
1053 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
1054 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
1056 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
1057 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
1058 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
1060 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
1061 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
1062 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
1064 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
1065 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
1066 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
1068 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
1069 fhGenGamEta->SetXTitle("#eta");
1070 fhGenGamPhi->SetXTitle("#phi (rad)");
1071 outputContainer->Add(fhGenGamPt);
1072 outputContainer->Add(fhGenGamEta);
1073 outputContainer->Add(fhGenGamPhi);
1075 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
1076 fhGenPi0Eta->SetXTitle("#eta");
1077 fhGenPi0Phi->SetXTitle("#phi (rad)");
1078 outputContainer->Add(fhGenPi0Pt);
1079 outputContainer->Add(fhGenPi0Eta);
1080 outputContainer->Add(fhGenPi0Phi);
1082 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
1083 fhGenEtaEta->SetXTitle("#eta");
1084 fhGenEtaPhi->SetXTitle("#phi (rad)");
1085 outputContainer->Add(fhGenEtaPt);
1086 outputContainer->Add(fhGenEtaEta);
1087 outputContainer->Add(fhGenEtaPhi);
1089 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
1090 fhGenOmegaEta->SetXTitle("#eta");
1091 fhGenOmegaPhi->SetXTitle("#phi (rad)");
1092 outputContainer->Add(fhGenOmegaPt);
1093 outputContainer->Add(fhGenOmegaEta);
1094 outputContainer->Add(fhGenOmegaPhi);
1096 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
1097 fhGenEleEta->SetXTitle("#eta");
1098 fhGenElePhi->SetXTitle("#phi (rad)");
1099 outputContainer->Add(fhGenElePt);
1100 outputContainer->Add(fhGenEleEta);
1101 outputContainer->Add(fhGenElePhi);
1103 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1104 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1105 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
1106 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
1108 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1109 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1110 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
1111 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
1113 fhGenGamAccE ->SetXTitle("E (GeV)");
1114 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
1115 fhGenGamAccEta->SetXTitle("#eta");
1116 fhGenGamAccPhi->SetXTitle("#phi (rad)");
1117 outputContainer->Add(fhGenGamAccE);
1118 outputContainer->Add(fhGenGamAccPt);
1119 outputContainer->Add(fhGenGamAccEta);
1120 outputContainer->Add(fhGenGamAccPhi);
1122 fhGenPi0AccE ->SetXTitle("E (GeV)");
1123 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
1124 fhGenPi0AccEta->SetXTitle("#eta");
1125 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
1126 outputContainer->Add(fhGenPi0AccE);
1127 outputContainer->Add(fhGenPi0AccPt);
1128 outputContainer->Add(fhGenPi0AccEta);
1129 outputContainer->Add(fhGenPi0AccPhi);
1133 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1134 fhMCEle1pOverE->SetYTitle("p/E");
1135 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1136 outputContainer->Add(fhMCEle1pOverE);
1138 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
1139 fhMCEle1dR->SetXTitle("#Delta R (rad)");
1140 outputContainer->Add(fhMCEle1dR) ;
1142 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1143 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1144 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1145 outputContainer->Add(fhMCEle2MatchdEdx);
1147 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1148 fhMCChHad1pOverE->SetYTitle("p/E");
1149 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1150 outputContainer->Add(fhMCChHad1pOverE);
1152 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1153 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1154 outputContainer->Add(fhMCChHad1dR) ;
1156 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1157 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1158 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1159 outputContainer->Add(fhMCChHad2MatchdEdx);
1161 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1162 fhMCNeutral1pOverE->SetYTitle("p/E");
1163 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1164 outputContainer->Add(fhMCNeutral1pOverE);
1166 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1167 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1168 outputContainer->Add(fhMCNeutral1dR) ;
1170 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1171 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1172 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1173 outputContainer->Add(fhMCNeutral2MatchdEdx);
1175 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1176 fhMCEle1pOverER02->SetYTitle("p/E");
1177 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1178 outputContainer->Add(fhMCEle1pOverER02);
1180 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1181 fhMCChHad1pOverER02->SetYTitle("p/E");
1182 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1183 outputContainer->Add(fhMCChHad1pOverER02);
1185 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1186 fhMCNeutral1pOverER02->SetYTitle("p/E");
1187 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1188 outputContainer->Add(fhMCNeutral1pOverER02);
1191 return outputContainer;
1194 //_______________________________________________________________________________________________________________________________________
1195 Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
1197 //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
1198 Float_t oldbinsize = histo->GetBinWidth(0);
1199 Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
1200 //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
1201 if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
1205 //__________________________________________________
1206 void AliAnaCalorimeterQA::Init()
1208 //Check if the data or settings are ok
1209 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1210 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1214 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1215 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1222 //__________________________________________________
1223 void AliAnaCalorimeterQA::InitParameters()
1225 //Initialize the parameters of the analysis.
1226 AddToHistogramsName("AnaCaloQA_");
1228 fCalorimeter = "EMCAL"; //or PHOS
1230 fNModules = 12; // set maximum to maximum number of EMCAL modules
1231 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
1233 fTimeCutMax = 9999999;
1235 fHistoPOverEBins = 100 ; fHistoPOverEMax = 10. ; fHistoPOverEMin = 0. ;
1236 fHistodEdxBins = 200 ; fHistodEdxMax = 400. ; fHistodEdxMin = 0. ;
1237 fHistodRBins = 300 ; fHistodRMax = 3.15 ; fHistodRMin = 0. ;
1238 fHistoTimeBins = 1000; fHistoTimeMax = 1.e3 ; fHistoTimeMin = 0. ;//ns
1239 fHistoNBins = 300 ; fHistoNMax = 300 ; fHistoNMin = 0 ;
1240 fHistoRatioBins = 200 ; fHistoRatioMax = 2 ; fHistoRatioMin = 0. ;
1241 fHistoVertexDistBins = 100 ; fHistoVertexDistMax = 500. ; fHistoVertexDistMin = 0. ;
1242 fHistoRBins = 100 ; fHistoRMax = 500 ; fHistoRMin = -500 ;//cm
1243 fHistoXBins = 100 ; fHistoXMax = 500 ; fHistoXMin = -500 ;//cm
1244 fHistoYBins = 100 ; fHistoYMax = 500 ; fHistoYMin = -500 ;//cm
1245 fHistoZBins = 100 ; fHistoZMax = 600 ; fHistoZMin = -500 ;//cm
1246 fHistoSSBins = 40 ; fHistoSSMax = 10 ; fHistoSSMin = 0 ;
1250 //__________________________________________________________________
1251 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1253 //Print some relevant parameters set for the analysis
1257 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1258 AliAnaPartCorrBaseClass::Print(" ");
1260 printf("Select Calorimeter %s \n",fCalorimeter.Data());
1261 printf("Make plots? %d \n",fMakePlots);
1262 printf("Plots style macro %s \n",fStyleMacro.Data());
1263 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
1264 printf("Histograms: %3.1f < p/E < %3.1f, Nbin = %d\n", fHistoPOverEMin, fHistoPOverEMax, fHistoPOverEBins);
1265 printf("Histograms: %3.1f < dEdx < %3.1f, Nbin = %d\n", fHistodEdxMin, fHistodEdxMax, fHistodEdxBins);
1266 printf("Histograms: %3.1f < dR (track cluster) < %3.1f, Nbin = %d\n", fHistodRMin, fHistodRMax, fHistodRBins);
1267 printf("Histograms: %3.1f < R=sqrt{x^2+y^2} < %3.1f, Nbin = %d\n", fHistoRMin, fHistoRMax, fHistoRBins);
1268 printf("Histograms: %3.1f < X < %3.1f, Nbin = %d\n", fHistoXMin, fHistoXMax, fHistoXBins);
1269 printf("Histograms: %3.1f < Y < %3.1f, Nbin = %d\n", fHistoYMin, fHistoYMax, fHistoYBins);
1270 printf("Histograms: %3.1f < Z < %3.1f, Nbin = %d\n", fHistoZMin, fHistoZMax, fHistoZBins);
1271 printf("Histograms: %g < Time < %g, Nbin = %d\n" , fHistoTimeMin, fHistoTimeMax, fHistoTimeBins);
1272 printf("Histograms: %d < N < %d, Nbin = %d\n" , fHistoNMin, fHistoNMax, fHistoNBins);
1273 printf("Histograms: %3.1f < Ratio< %3.1f, Nbin = %d\n", fHistoRatioMin, fHistoRatioMax, fHistoRatioBins);
1274 printf("Histograms: %3.1f < Vertex Distance < %3.1f, Nbin = %d\n", fHistoVertexDistMin, fHistoVertexDistMax, fHistoVertexDistBins);
1278 //__________________________________________________________________
1279 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1281 //Fill Calorimeter QA histograms
1282 TLorentzVector mom ;
1283 TLorentzVector mom2 ;
1284 TRefArray * caloClusters = new TRefArray();
1287 Int_t nCaloClusters = 0;
1288 Int_t nCaloCellsPerCluster = 0;
1289 Int_t nTracksMatched = 0;
1290 Int_t trackIndex = 0;
1293 //Play with the MC stack if available
1294 //Get the MC arrays and do some checks
1296 if(GetReader()->ReadStack()){
1299 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1302 //Fill some pure MC histograms, only primaries.
1303 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1304 TParticle *primary = GetMCStack()->Particle(i) ;
1305 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1306 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1307 primary->Momentum(mom);
1308 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1311 else if(GetReader()->ReadAODMCParticles()){
1313 if(!GetReader()->GetAODMCParticles(0)) {
1314 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1317 //Fill some pure MC histograms, only primaries.
1318 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1319 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1320 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1321 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1322 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1323 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1324 //aodprimary->Momentum(mom);
1325 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1326 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1333 //Get List with CaloClusters
1335 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1336 if (fCalorimeter == "EMCAL") ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1337 else if(fCalorimeter == "PHOS") ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1339 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1343 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1344 if (fCalorimeter == "EMCAL") ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1345 else if(fCalorimeter == "PHOS") ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1347 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1353 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n");
1357 //----------------------------------------------------------
1358 //Correlate Calorimeters
1359 //----------------------------------------------------------
1360 if(fCorrelateCalos) CorrelateCalorimeters(caloClusters);
1363 //----------------------------------------------------------
1365 //----------------------------------------------------------
1367 nCaloClusters = caloClusters->GetEntriesFast() ;
1368 fhNClusters->Fill(nCaloClusters);
1369 Int_t *nClustersInModule = new Int_t[fNModules];
1370 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1373 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1375 //Get vertex for photon momentum calculation
1376 Double_t v[3] = {0,0,0}; //vertex ;
1377 GetReader()->GetVertex(v);
1378 TObject * track = 0x0;
1381 Float_t showerShape[3] ;
1383 //Loop over CaloClusters
1384 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1385 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1387 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1388 iclus+1,nCaloClusters,GetReader()->GetDataType());
1390 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1391 AliESDCaloCluster* clus = (AliESDCaloCluster*) (caloClusters->At(iclus));
1392 AliESDCaloCells * cell = 0x0;
1393 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1394 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1396 //Check if the cluster contains any bad channel or it is close to the calorimeter borders
1397 if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue;
1398 if(!GetCaloUtils()->CheckCellFiducialRegion(clus, cell)) continue;
1399 //Recalibrate the cluster energy
1400 if( GetCaloUtils()->IsRecalibrationOn()) {
1401 Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cell);
1405 //Get cluster kinematics
1406 clus->GetPosition(pos);
1407 clus->GetMomentum(mom,v);
1408 tof = clus->GetTOF()*1e9;
1409 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1411 //Check only certain regions
1413 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1415 //Get module of cluster
1416 nModule = GetModuleNumber(clus);
1417 if(nModule < fNModules) nClustersInModule[nModule]++;
1419 nLabel = clus->GetNLabels();
1420 if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray();
1422 nCaloCellsPerCluster = clus->GetNCells();
1423 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1424 //matched cluster with tracks
1425 nTracksMatched = clus->GetNTracksMatched();
1426 trackIndex = clus->GetTrackMatched();
1427 if(trackIndex >= 0){
1428 track = (AliESDtrack*) ((AliESDEvent*)GetReader()->GetInputEvent())->GetTrack(trackIndex);
1431 if(nTracksMatched == 1) nTracksMatched = 0;
1435 //Shower shape parameters
1436 showerShape[0] = clus->GetM20();
1437 showerShape[1] = clus->GetM02();
1438 showerShape[2] = clus->GetClusterDisp();
1440 //======================
1442 //======================
1444 //Get list of contributors
1445 UShort_t * indexList = clus->GetCellsAbsId() ;
1446 // check time of cells respect to max energy cell
1447 //Get maximum energy cell
1452 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1453 //Loop on cluster cells
1454 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1455 // printf("Index %d\n",ipos);
1456 absId = indexList[ipos];
1458 //Get position of cell compare to cluster
1459 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1461 Double_t cellpos[] = {0, 0, 0};
1462 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1464 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1465 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1466 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1468 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1469 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1470 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1472 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1473 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1474 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1475 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1477 // Float_t celleta = 0, cellphi = 0;
1478 // GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi);
1479 // Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
1480 // GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1481 // GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1482 // iIphi, iIeta,iphi,ieta);
1483 // printf("AbsId %d, SM %d, Index eta %d, phi %d\n", absId, imod, ieta, iphi);
1484 // printf("Cluster E %f, eta %f, phi %f; Cell: Amp %f, eta %f, phi%f\n", mom.E(),mom.Eta(), mom.Phi()*TMath::RadToDeg(), cell->GetCellAmplitude(absId),celleta, cellphi*TMath::RadToDeg());
1485 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1486 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1487 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1488 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1491 }//EMCAL and its matrices are available
1492 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1494 Int_t relId[4], module;
1495 Float_t xCell, zCell;
1497 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1499 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1500 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1502 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1503 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1504 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1506 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1507 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1508 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1510 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1511 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1512 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1513 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1515 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1516 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1517 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1518 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1519 }//PHOS and its matrices are available
1521 //Find maximum energy cluster
1522 if(cell->GetCellAmplitude(absId) > emax) {
1524 emax = cell->GetCellAmplitude(absId);
1525 tmax = cell->GetCellTime(absId);
1528 }// cluster cell loop
1530 // check time of cells respect to max energy cell
1531 if(nCaloCellsPerCluster > 1){
1532 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1533 if(imax == ipos) continue;
1534 absId = indexList[ipos];
1535 Float_t diff = (tmax-cell->GetCellTime(absId))*1e9;
1536 fhCellTimeSpreadRespectToCellMax->Fill(diff);
1537 if(TMath::Abs(TMath::Abs(diff) > 100)) fhCellIdCellLargeTimeSpread->Fill(absId);
1538 }// fill cell-cluster histogram loop
1540 }//check time of cells respect to max energy cell
1545 AliAODCaloCluster* clus = (AliAODCaloCluster*) (caloClusters->At(iclus));
1546 AliAODCaloCells * cell = 0x0;
1547 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1548 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1550 //Check if the cluster contains any bad channel or it is close to calorimeter borders
1551 if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue;
1552 if(!GetCaloUtils()->CheckCellFiducialRegion(clus, cell)) continue;
1553 //Recalibrate the cluster energy
1554 if( GetCaloUtils()->IsRecalibrationOn()) {
1555 Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cell);
1559 //Get cluster kinematics
1560 clus->GetPosition(pos);
1561 clus->GetMomentum(mom,v);
1562 tof = clus->GetTOF()*1e9;
1563 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1565 //Check only certain regions
1567 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1569 //Get module of cluster
1570 nModule = GetModuleNumber(clus);
1571 if(nModule < fNModules) nClustersInModule[nModule]++;
1573 nLabel = clus->GetNLabel();
1574 if(clus->GetLabels()) labels = clus->GetLabels();
1576 nCaloCellsPerCluster = clus->GetNCells();
1577 //matched cluster with tracks
1578 nTracksMatched = clus->GetNTracksMatched();
1579 if(nTracksMatched > 0)
1580 track = (AliAODTrack*)clus->GetTrackMatched(0);
1582 //Shower shape parameters
1583 showerShape[0] = clus->GetM20();
1584 showerShape[1] = clus->GetM02();
1585 showerShape[2] = clus->GetDispersion();
1587 //======================
1589 //======================
1591 //Get list of contributors
1592 UShort_t * indexList = clus->GetCellsAbsId() ;
1594 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1595 //Loop on cluster cells
1596 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1597 // printf("Index %d\n",ipos);
1598 absId = indexList[ipos];
1600 //Get position of cell compare to cluster
1601 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1603 Double_t cellpos[] = {0, 0, 0};
1604 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1606 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1607 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1608 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1610 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1611 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1612 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1614 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1615 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1616 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1617 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1619 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1620 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1621 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1622 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1624 }// EMCAL and its matrices are available
1625 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1627 Int_t relId[4], module;
1628 Float_t xCell, zCell;
1630 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1632 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1633 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1635 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1636 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1637 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1639 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1640 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1641 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1643 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1644 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1645 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1646 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1648 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1649 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1650 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1651 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1653 } //PHOS and its matrices are available
1654 }// cluster cell loop
1658 //-----------------------------------------------------------
1659 //Fill histograms related to single cluster or track matching
1660 //-----------------------------------------------------------
1662 ClusterHistograms(mom, tof, pos, showerShape, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1665 //-----------------------------------------------------------
1667 //-----------------------------------------------------------
1668 if(GetDebug()>1) printf("Invariant mass \n");
1670 //do not do for bad vertex
1671 Float_t fZvtxCut = 40. ;
1672 if(v[2]<-fZvtxCut || v[2]> fZvtxCut) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
1674 Int_t nModule2 = -1;
1675 Int_t nCaloCellsPerCluster2=0;
1676 if (nCaloClusters > 1 ) {
1677 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1678 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1679 AliESDCaloCluster* clus2 = (AliESDCaloCluster*) (caloClusters->At(jclus));
1680 AliESDCaloCells * cell2 = 0x0;
1681 if(fCalorimeter == "PHOS") cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1682 else cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1683 //Check if the cluster contains any bad channel or it is close to calorimeter borders
1684 if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus2->GetCellsAbsId(), clus2->GetNCells())) continue;
1685 if(!GetCaloUtils()->CheckCellFiducialRegion(clus2, cell2)) continue;
1687 //Get cluster kinematics
1688 clus2->GetMomentum(mom2,v);
1689 //Check only certain regions
1691 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1693 //Get module of cluster
1694 nModule2 = GetModuleNumber(clus2);
1696 nCaloCellsPerCluster2 = clus2->GetNCells();
1699 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD){
1700 AliAODCaloCluster* clus2 = (AliAODCaloCluster*) (caloClusters->At(jclus));
1701 AliAODCaloCells * cell2 = 0x0;
1702 if(fCalorimeter == "PHOS") cell2 = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1703 else cell2 = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1704 //Check if the cluster contains any bad channel or it is close to calorimeter borders
1705 if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus2->GetCellsAbsId(), clus2->GetNCells())) continue;
1706 if(!GetCaloUtils()->CheckCellFiducialRegion(clus2, cell2)) continue;
1708 //Get cluster kinematics
1709 clus2->GetMomentum(mom2,v);
1710 //Check only certain regions
1712 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1714 //Get module of cluster
1715 nModule2 = GetModuleNumber(clus2);
1717 nCaloCellsPerCluster2 = clus2->GetNCells();
1720 //Fill invariant mass histograms
1723 //printf("QA : Fill inv mass histo: pt1 %f, pt2 %f, pt12 %f, mass %f, calo %s \n",mom.Pt(),mom2.Pt(),(mom+mom2).Pt(),(mom+mom2).M(), fCalorimeter.Data());
1724 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1726 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1727 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1729 //Select only clusters with at least 2 cells
1730 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1732 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1734 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1735 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1738 //Asymetry histograms
1739 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1741 }// 2nd cluster loop
1742 }////more than 1 cluster in calorimeter
1745 //Number of clusters per module
1746 for(Int_t imod = 0; imod < fNModules; imod++ ){
1748 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1749 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1751 delete [] nClustersInModule;
1752 delete caloClusters;
1754 //----------------------------------------------------------
1756 //----------------------------------------------------------
1758 Int_t *nCellsInModule = new Int_t[fNModules];
1759 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1766 Float_t recalF = 1.;
1768 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1769 AliESDCaloCells * cell = 0x0;
1771 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1772 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1775 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s ESD CELLS available for analysis\n",fCalorimeter.Data());
1779 ncells = cell->GetNumberOfCells() ;
1780 fhNCells->Fill(ncells) ;
1782 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1784 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1785 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1786 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
1787 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1789 if(nModule < fNModules) {
1790 //Check if the cell is a bad channel
1791 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1792 if(fCalorimeter=="EMCAL"){
1793 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1796 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
1797 printf("PHOS bad channel\n");
1803 //Get Recalibration factor if set
1804 if (GetCaloUtils()->IsRecalibrationOn()) {
1805 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1806 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1807 if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
1810 amp = cell->GetAmplitude(iCell)*recalF;
1811 time = cell->GetTime(iCell)*1e9;//transform time to ns
1813 //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
1814 // amp,time,nModule,icol,irow);
1816 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1818 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1819 id = cell->GetCellNumber(iCell);
1820 fhAmplitude->Fill(amp);
1821 fhAmpId ->Fill(amp,id);
1822 fhTime ->Fill(time);
1823 fhTimeId ->Fill(time,id);
1824 fhTimeAmp ->Fill(amp,time);
1825 //Double_t t0 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0();
1826 //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0,
1827 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0zVertex(),
1828 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0clock(),
1829 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0Trig());
1830 //fhT0Time ->Fill(time-t0);
1831 //fhT0TimeId ->Fill(time-t0,id);
1832 //fhT0TimeAmp ->Fill(amp,time-t0);
1834 fhAmplitudeMod[nModule]->Fill(amp);
1835 if(fCalorimeter=="EMCAL"){
1837 if(icol > 15 && icol < 32) ifrac = 1;
1838 else if(icol > 31) ifrac = 2;
1839 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
1844 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
1845 //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
1846 //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
1847 nCellsInModule[nModule]++;
1848 fhGridCellsMod[nModule] ->Fill(icol,irow);
1849 fhGridCellsEMod[nModule] ->Fill(icol,irow,amp);
1851 fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
1853 // AliESDCaloCells * cell2 = 0x0;
1854 // if(fCalorimeter == "PHOS") cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1855 // else cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1856 // Int_t icol2 = -1;
1857 // Int_t irow2 = -1;
1858 // Int_t iRCU2 = -1;
1859 // Float_t amp2 = 0.;
1860 // Float_t time2 = 0.;
1862 // Int_t nModule2 = -1;
1863 // for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {
1864 // amp2 = cell2->GetAmplitude(iCell2);
1865 // if(amp2 < 0.3) continue;
1866 // if(iCell2 == iCell) continue;
1867 // time2 = cell2->GetTime(iCell2)*1e9;//transform time to ns
1868 // //printf("%s: time %g\n",fCalorimeter.Data(), time);
1869 // id2 = cell2->GetCellNumber(iCell2);
1870 // nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
1871 // Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule);
1872 // //printf("id %d, nModule %d, iRCU %d, id2 %d, nModule2 %d, iRCU2 %d, index %d: Histo Name %s\n",id, nModule,iRCU,cell2->GetCellNumber(iCell2),nModule2,iRCU2,index, fhTimeCorrRCU[index]->GetName());
1873 // fhTimeCorrRCU[index]->Fill(time,time2);
1875 // }// second cell loop
1879 //Get Eta-Phi position of Cell
1880 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1881 Float_t celleta = 0.;
1882 Float_t cellphi = 0.;
1883 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1884 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1886 Double_t cellpos[] = {0, 0, 0};
1887 GetEMCALGeometry()->GetGlobal(id, cellpos);
1888 fhXCellE->Fill(cellpos[0],amp) ;
1889 fhYCellE->Fill(cellpos[1],amp) ;
1890 fhZCellE->Fill(cellpos[2],amp) ;
1891 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1892 fhRCellE->Fill(rcell,amp) ;
1894 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1896 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1898 Int_t relId[4], module;
1899 Float_t xCell, zCell;
1901 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
1903 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1904 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1905 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
1906 fhXCellE ->Fill(xyz.X(),amp) ;
1907 fhYCellE ->Fill(xyz.Y(),amp) ;
1908 fhZCellE ->Fill(xyz.Z(),amp) ;
1909 fhRCellE ->Fill(rcell ,amp) ;
1910 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
1916 AliAODCaloCells * cell = 0x0;
1919 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1920 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1923 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s AOD CELLS available for analysis\n",fCalorimeter.Data());
1928 ncells = cell->GetNumberOfCells() ;
1929 fhNCells->Fill(ncells) ;
1931 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In AOD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1933 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1934 id = cell->GetCellNumber(iCell);
1935 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), id);
1936 nModule = GetModuleNumberCellIndexes(id, fCalorimeter, icol, irow, iRCU);
1937 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1939 if(nModule < fNModules) {
1940 //Check if the cell is a bad channel
1941 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1942 if(fCalorimeter=="EMCAL"){
1943 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1946 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) continue;
1950 //Get Recalibration factor if set
1951 if (GetCaloUtils()->IsRecalibrationOn()) {
1952 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1953 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1954 //printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
1957 amp = cell->GetAmplitude(iCell)*recalF;
1958 fhAmplitude->Fill(amp);
1959 fhAmpId ->Fill(amp,id);
1960 fhAmplitudeMod[nModule]->Fill(amp);
1961 if(fCalorimeter=="EMCAL"){
1963 if(icol > 15 && icol < 32) ifrac = 1;
1964 else if(icol > 31) ifrac = 2;
1965 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
1968 fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, -1);
1970 nCellsInModule[nModule]++;
1971 fhGridCellsMod[nModule] ->Fill(icol,irow);
1972 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
1976 //Get Eta-Phi position of Cell
1977 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1978 Float_t celleta = 0.;
1979 Float_t cellphi = 0.;
1980 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1981 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1983 Double_t cellpos[] = {0, 0, 0};
1984 GetEMCALGeometry()->GetGlobal(id, cellpos);
1985 fhXCellE->Fill(cellpos[0],amp) ;
1986 fhYCellE->Fill(cellpos[1],amp) ;
1987 fhZCellE->Fill(cellpos[2],amp) ;
1988 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1989 fhRCellE->Fill(rcell,amp) ;
1991 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1993 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1995 Int_t relId[4], module;
1996 Float_t xCell, zCell;
1998 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
2000 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
2001 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
2002 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
2003 fhXCellE ->Fill(xyz.X(),amp) ;
2004 fhYCellE ->Fill(xyz.Y(),amp) ;
2005 fhZCellE ->Fill(xyz.Z(),amp) ;
2006 fhRCellE ->Fill(rcell ,amp) ;
2007 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
2012 //Number of cells per module
2013 for(Int_t imod = 0; imod < fNModules; imod++ ) {
2015 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
2016 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
2018 delete [] nCellsInModule;
2021 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
2025 //__________________________________
2026 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof, Float_t *pos, Float_t *showerShape,
2027 const Int_t nCaloCellsPerCluster,const Int_t nModule,
2028 const Int_t nTracksMatched, const TObject * track,
2029 const Int_t * labels, const Int_t nLabels){
2030 //Fill CaloCluster related histograms
2032 AliAODMCParticle * aodprimary = 0x0;
2033 TParticle * primary = 0x0;
2036 Float_t e = mom.E();
2037 Float_t pt = mom.Pt();
2038 Float_t eta = mom.Eta();
2039 Float_t phi = mom.Phi();
2040 if(phi < 0) phi +=TMath::TwoPi();
2041 if(GetDebug() > 0) {
2042 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
2044 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
2045 printf("\t Primaries: nlabels %d\n",nLabels);
2046 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
2051 if(nModule < fNModules) fhEMod[nModule]->Fill(e);
2055 fhEtaPhiE->Fill(eta,phi,e);
2056 fhXE ->Fill(pos[0],e);
2057 fhYE ->Fill(pos[1],e);
2058 fhZE ->Fill(pos[2],e);
2059 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
2060 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
2061 fhRE ->Fill(rxyz,e);
2062 fhClusterTimeEnergy->Fill(e,tof);
2064 //Shower shape parameters
2065 fhLambda->Fill(showerShape[0], showerShape[1], e);
2066 fhDispersion->Fill(showerShape[2],e);
2069 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster,eta);
2070 fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster,eta);
2071 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
2072 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
2073 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
2074 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
2076 if(nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
2078 //Fill histograms only possible when simulation
2079 if(IsDataMC() && nLabels > 0 && labels){
2081 //Play with the MC stack if available
2082 Int_t label = labels[0];
2085 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
2089 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
2090 Float_t vxMC= 0; Float_t vyMC = 0;
2091 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
2095 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
2097 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
2099 if( label >= GetMCStack()->GetNtrack()) {
2100 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
2104 primary = GetMCStack()->Particle(label);
2106 pdg0 = TMath::Abs(primary->GetPdgCode());
2108 status = primary->GetStatusCode();
2109 vxMC = primary->Vx();
2110 vyMC = primary->Vy();
2111 iParent = primary->GetFirstMother();
2113 if(GetDebug() > 1 ) {
2114 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2115 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
2118 //Get final particle, no conversion products
2119 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2121 primary = GetMCStack()->Particle(iParent);
2122 pdg = TMath::Abs(primary->GetPdgCode());
2123 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2124 while((pdg == 22 || pdg == 11) && status != 1){
2126 primary = GetMCStack()->Particle(iMother);
2127 status = primary->GetStatusCode();
2128 iParent = primary->GetFirstMother();
2129 pdg = TMath::Abs(primary->GetPdgCode());
2130 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
2133 if(GetDebug() > 1 ) {
2134 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2135 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
2140 //Overlapped pi0 (or eta, there will be very few), get the meson
2141 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2142 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2143 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
2144 while(pdg != 111 && pdg != 221){
2146 primary = GetMCStack()->Particle(iMother);
2147 status = primary->GetStatusCode();
2148 iParent = primary->GetFirstMother();
2149 pdg = TMath::Abs(primary->GetPdgCode());
2150 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
2152 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2157 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2158 primary->GetName(),iMother);
2161 eMC = primary->Energy();
2162 ptMC = primary->Pt();
2163 phiMC = primary->Phi();
2164 etaMC = primary->Eta();
2165 pdg = TMath::Abs(primary->GetPdgCode());
2166 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2169 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
2170 //Get the list of MC particles
2171 if(!GetReader()->GetAODMCParticles(0)) {
2172 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
2176 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
2178 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
2180 status = aodprimary->IsPrimary();
2181 vxMC = aodprimary->Xv();
2182 vyMC = aodprimary->Yv();
2183 iParent = aodprimary->GetMother();
2185 if(GetDebug() > 1 ) {
2186 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2187 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
2188 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
2191 //Get final particle, no conversion products
2192 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2194 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2196 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
2197 pdg = TMath::Abs(aodprimary->GetPdgCode());
2198 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
2200 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2201 status = aodprimary->IsPrimary();
2202 iParent = aodprimary->GetMother();
2203 pdg = TMath::Abs(aodprimary->GetPdgCode());
2205 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
2206 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2209 if(GetDebug() > 1 ) {
2210 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2211 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
2212 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2217 //Overlapped pi0 (or eta, there will be very few), get the meson
2218 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2219 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2220 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
2221 while(pdg != 111 && pdg != 221){
2224 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2225 status = aodprimary->IsPrimary();
2226 iParent = aodprimary->GetMother();
2227 pdg = TMath::Abs(aodprimary->GetPdgCode());
2229 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
2232 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2237 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2238 aodprimary->GetName(),iMother);
2241 status = aodprimary->IsPrimary();
2242 eMC = aodprimary->E();
2243 ptMC = aodprimary->Pt();
2244 phiMC = aodprimary->Phi();
2245 etaMC = aodprimary->Eta();
2246 pdg = TMath::Abs(aodprimary->GetPdgCode());
2247 charge = aodprimary->Charge();
2251 //Float_t vz = primary->Vz();
2252 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
2253 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
2254 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2255 fhEMR ->Fill(e,rVMC);
2258 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
2259 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
2260 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
2263 fh2E ->Fill(e, eMC);
2264 fh2Pt ->Fill(pt, ptMC);
2265 fh2Phi ->Fill(phi, phiMC);
2266 fh2Eta ->Fill(eta, etaMC);
2267 fhDeltaE ->Fill(eMC-e);
2268 fhDeltaPt ->Fill(ptMC-pt);
2269 fhDeltaPhi->Fill(phiMC-phi);
2270 fhDeltaEta->Fill(etaMC-eta);
2271 if(eMC > 0) fhRatioE ->Fill(e/eMC);
2272 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
2273 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
2274 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
2277 //Overlapped pi0 (or eta, there will be very few)
2278 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2279 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2280 fhPi0E ->Fill(e,eMC);
2281 fhPi0Pt ->Fill(pt,ptMC);
2282 fhPi0Eta ->Fill(eta,etaMC);
2283 fhPi0Phi ->Fill(phi,phiMC);
2284 if( nTracksMatched > 0){
2285 fhPi0ECharged ->Fill(e,eMC);
2286 fhPi0PtCharged ->Fill(pt,ptMC);
2287 fhPi0PhiCharged ->Fill(phi,phiMC);
2288 fhPi0EtaCharged ->Fill(eta,etaMC);
2290 }//Overlapped pizero decay
2291 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
2292 fhGamE ->Fill(e,eMC);
2293 fhGamPt ->Fill(pt,ptMC);
2294 fhGamEta ->Fill(eta,etaMC);
2295 fhGamPhi ->Fill(phi,phiMC);
2296 fhGamDeltaE ->Fill(eMC-e);
2297 fhGamDeltaPt ->Fill(ptMC-pt);
2298 fhGamDeltaPhi->Fill(phiMC-phi);
2299 fhGamDeltaEta->Fill(etaMC-eta);
2300 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
2301 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
2302 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
2303 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
2304 if( nTracksMatched > 0){
2305 fhGamECharged ->Fill(e,eMC);
2306 fhGamPtCharged ->Fill(pt,ptMC);
2307 fhGamPhiCharged ->Fill(phi,phiMC);
2308 fhGamEtaCharged ->Fill(eta,etaMC);
2311 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
2312 fhEleE ->Fill(e,eMC);
2313 fhElePt ->Fill(pt,ptMC);
2314 fhEleEta ->Fill(eta,etaMC);
2315 fhElePhi ->Fill(phi,phiMC);
2316 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2317 fhEMR ->Fill(e,rVMC);
2318 if( nTracksMatched > 0){
2319 fhEleECharged ->Fill(e,eMC);
2320 fhElePtCharged ->Fill(pt,ptMC);
2321 fhElePhiCharged ->Fill(phi,phiMC);
2322 fhEleEtaCharged ->Fill(eta,etaMC);
2325 else if(charge == 0){
2326 fhNeHadE ->Fill(e,eMC);
2327 fhNeHadPt ->Fill(pt,ptMC);
2328 fhNeHadEta ->Fill(eta,etaMC);
2329 fhNeHadPhi ->Fill(phi,phiMC);
2330 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2331 fhHaR ->Fill(e,rVMC);
2332 if( nTracksMatched > 0){
2333 fhNeHadECharged ->Fill(e,eMC);
2334 fhNeHadPtCharged ->Fill(pt,ptMC);
2335 fhNeHadPhiCharged ->Fill(phi,phiMC);
2336 fhNeHadEtaCharged ->Fill(eta,etaMC);
2340 fhChHadE ->Fill(e,eMC);
2341 fhChHadPt ->Fill(pt,ptMC);
2342 fhChHadEta ->Fill(eta,etaMC);
2343 fhChHadPhi ->Fill(phi,phiMC);
2344 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2345 fhHaR ->Fill(e,rVMC);
2346 if( nTracksMatched > 0){
2347 fhChHadECharged ->Fill(e,eMC);
2348 fhChHadPtCharged ->Fill(pt,ptMC);
2349 fhChHadPhiCharged ->Fill(phi,phiMC);
2350 fhChHadEtaCharged ->Fill(eta,etaMC);
2356 //Match tracks and clusters
2357 //To be Modified in case of AODs
2359 //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
2361 if( nTracksMatched > 0){
2362 fhECharged ->Fill(e);
2363 fhPtCharged ->Fill(pt);
2364 fhPhiCharged ->Fill(phi);
2365 fhEtaCharged ->Fill(eta);
2366 fhEtaPhiECharged->Fill(eta,phi,e);
2367 fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster,eta);
2369 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2370 //Study the track and matched cluster if track exists.
2372 Double_t emcpos[3] = {0.,0.,0.};
2373 Double_t emcmom[3] = {0.,0.,0.};
2374 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2375 Double_t bfield = 0.;
2381 Double_t tpcSignal = 0;
2382 Bool_t okpos = kFALSE;
2383 Bool_t okmom = kFALSE;
2384 Bool_t okout = kFALSE;
2388 //In case of ESDs get the parameters in this way
2389 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2390 if (((AliESDtrack*)track)->GetOuterParam() ) {
2393 bfield = ((AliESDEvent*)GetReader()->GetInputEvent())->GetMagneticField();
2394 okpos = ((AliESDtrack*)track)->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2395 okmom = ((AliESDtrack*)track)->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2396 if(!(okpos && okmom)) return;
2398 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2399 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2400 tphi = position.Phi();
2401 teta = position.Eta();
2402 tmom = momentum.Mag();
2404 //Double_t tphi = ((AliESDtrack*)track)->GetOuterParam()->Phi();
2405 //Double_t teta = ((AliESDtrack*)track)->GetOuterParam()->Eta();
2406 //Double_t tmom = ((AliESDtrack*)track)->GetOuterParam()->P();
2407 tpt = ((AliESDtrack*)track)->Pt();
2408 tmom2 = ((AliESDtrack*)track)->P();
2409 tpcSignal = ((AliESDtrack*)track)->GetTPCsignal();
2411 nITS = ((AliESDtrack*)track)->GetNcls(0);
2412 nTPC = ((AliESDtrack*)track)->GetNcls(1);
2413 }//Outer param available
2415 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2416 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2419 pid->GetEMCALPosition(emcpos);
2420 pid->GetEMCALMomentum(emcmom);
2422 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2423 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2424 tphi = position.Phi();
2425 teta = position.Eta();
2426 tmom = momentum.Mag();
2428 tpt = ((AliAODTrack*)track)->Pt();
2429 tmom2 = ((AliAODTrack*)track)->P();
2430 tpcSignal = pid->GetTPCsignal();
2432 //nITS = ((AliAODTrack*)track)->GetNcls(0);
2433 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
2434 }//Outer param available
2436 else return; //Do nothing case not implemented.
2439 Double_t deta = teta - eta;
2440 Double_t dphi = tphi - phi;
2441 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2442 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2443 Double_t dR = sqrt(dphi*dphi + deta*deta);
2445 Double_t pOverE = tmom/e;
2447 fh1pOverE->Fill(tpt, pOverE);
2448 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
2451 fh2MatchdEdx->Fill(tmom2,tpcSignal);
2453 if(IsDataMC() && primary){
2454 Int_t pdg = primary->GetPdgCode();
2455 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2457 if(TMath::Abs(pdg) == 11){
2458 fhMCEle1pOverE->Fill(tpt,pOverE);
2459 fhMCEle1dR->Fill(dR);
2460 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2461 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2464 fhMCChHad1pOverE->Fill(tpt,pOverE);
2465 fhMCChHad1dR->Fill(dR);
2466 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2467 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2469 else if(charge == 0){
2470 fhMCNeutral1pOverE->Fill(tpt,pOverE);
2471 fhMCNeutral1dR->Fill(dR);
2472 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2473 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2477 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2478 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2479 fh2EledEdx->Fill(tmom2,tpcSignal);
2482 else{//no ESD external param or AODPid
2483 // ULong_t status=AliESDtrack::kTPCrefit;
2484 // status|=AliESDtrack::kITSrefit;
2485 //printf("track status %d\n", track->GetStatus() );
2486 // fhEChargedNoOut ->Fill(e);
2487 // fhPtChargedNoOut ->Fill(pt);
2488 // fhPhiChargedNoOut ->Fill(phi);
2489 // fhEtaChargedNoOut ->Fill(eta);
2490 // fhEtaPhiChargedNoOut ->Fill(eta,phi);
2491 // if(GetDebug() >= 0 && ((((AliESDtrack*)track)->GetStatus() & status) == status)) printf("ITS+TPC\n");
2492 if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
2495 }//matched clusters with tracks
2499 //__________________________________
2500 void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
2501 // Correlate information from PHOS and EMCAL
2502 TRefArray * caloClustersEMCAL = 0;
2503 TRefArray * caloClustersPHOS = 0;
2505 // Get once the array of clusters per calorimeter, avoid an extra loop.
2506 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2507 if(fCalorimeter == "EMCAL"){
2508 caloClustersPHOS = new TRefArray();
2509 ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
2510 caloClustersEMCAL = new TRefArray(*refArray);
2512 else if(fCalorimeter == "PHOS") {
2513 caloClustersEMCAL = new TRefArray();
2514 ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
2515 caloClustersPHOS = new TRefArray(*refArray);
2518 //Fill histograms with clusters
2520 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2521 Float_t sumClusterEnergyEMCAL = 0;
2522 Float_t sumClusterEnergyPHOS = 0;
2524 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2525 sumClusterEnergyEMCAL += ((AliESDCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
2526 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2527 sumClusterEnergyPHOS += ((AliESDCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
2528 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2530 //Fill histograms with cells
2532 AliESDCaloCells * cellsEMCAL = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2533 AliESDCaloCells * cellsPHOS = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2534 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2537 Float_t sumCellEnergyEMCAL = 0;
2538 Float_t sumCellEnergyPHOS = 0;
2539 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2540 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2541 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2542 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2543 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2544 if(GetDebug() > 0 ){
2545 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2546 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2547 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2548 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2549 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2552 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2553 if(fCalorimeter == "EMCAL"){
2554 ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
2555 caloClustersEMCAL = refArray;
2557 else if(fCalorimeter == "PHOS") {
2558 ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
2559 caloClustersEMCAL = refArray;
2562 //Fill histograms with clusters
2564 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2565 Float_t sumClusterEnergyEMCAL = 0;
2566 Float_t sumClusterEnergyPHOS = 0;
2568 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2569 sumClusterEnergyEMCAL += ((AliAODCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
2570 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2571 sumClusterEnergyPHOS += ((AliAODCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
2572 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2574 //Fill histograms with cells
2576 AliAODCaloCells * cellsEMCAL = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2577 AliAODCaloCells * cellsPHOS = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2578 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2581 Float_t sumCellEnergyEMCAL = 0;
2582 Float_t sumCellEnergyPHOS = 0;
2583 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2584 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2585 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2586 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2587 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2588 if(GetDebug() > 0 ){
2589 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2590 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2591 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2592 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2593 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2597 delete caloClustersEMCAL;
2598 delete caloClustersPHOS;
2602 //______________________________________________________________________________
2603 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
2604 //Fill pure monte carlo related histograms
2606 Float_t eMC = mom.E();
2607 Float_t ptMC = mom.Pt();
2608 Float_t phiMC = mom.Phi();
2610 phiMC += TMath::TwoPi();
2611 Float_t etaMC = mom.Eta();
2613 if (TMath::Abs(etaMC) > 1) return;
2616 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2619 fhGenGamPt ->Fill(ptMC);
2620 fhGenGamEta->Fill(etaMC);
2621 fhGenGamPhi->Fill(phiMC);
2623 fhGenGamAccE ->Fill(eMC);
2624 fhGenGamAccPt ->Fill(ptMC);
2625 fhGenGamAccEta->Fill(etaMC);
2626 fhGenGamAccPhi->Fill(phiMC);
2629 else if (pdg==111) {
2630 fhGenPi0Pt ->Fill(ptMC);
2631 fhGenPi0Eta->Fill(etaMC);
2632 fhGenPi0Phi->Fill(phiMC);
2634 fhGenPi0AccE ->Fill(eMC);
2635 fhGenPi0AccPt ->Fill(ptMC);
2636 fhGenPi0AccEta->Fill(etaMC);
2637 fhGenPi0AccPhi->Fill(phiMC);
2640 else if (pdg==221) {
2641 fhGenEtaPt ->Fill(ptMC);
2642 fhGenEtaEta->Fill(etaMC);
2643 fhGenEtaPhi->Fill(phiMC);
2645 else if (pdg==223) {
2646 fhGenOmegaPt ->Fill(ptMC);
2647 fhGenOmegaEta->Fill(etaMC);
2648 fhGenOmegaPhi->Fill(phiMC);
2650 else if (TMath::Abs(pdg)==11) {
2651 fhGenElePt ->Fill(ptMC);
2652 fhGenEleEta->Fill(etaMC);
2653 fhGenElePhi->Fill(phiMC);
2658 //________________________________________________________________________
2659 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2661 // Needed when Terminate is executed in distributed environment
2662 // Refill analysis histograms of this class with corresponding histograms in output list.
2664 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2665 // the first one and then add the next
2666 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
2667 //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2669 //Read histograms, must be in the same order as in GetCreateOutputObject.
2670 fhE = (TH1F *) outputList->At(index++);
2671 fhPt = (TH1F *) outputList->At(index++);
2672 fhPhi = (TH1F *) outputList->At(index++);
2673 fhEta = (TH1F *) outputList->At(index++);
2674 fhEtaPhiE = (TH3F *) outputList->At(index++);
2676 fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
2678 fhLambda = (TH3F *) outputList->At(index++);
2679 fhDispersion = (TH2F *) outputList->At(index++);
2681 fhECharged = (TH1F *) outputList->At(index++);
2682 fhPtCharged = (TH1F *) outputList->At(index++);
2683 fhPhiCharged = (TH1F *) outputList->At(index++);
2684 fhEtaCharged = (TH1F *) outputList->At(index++);
2685 fhEtaPhiECharged = (TH3F *) outputList->At(index++);
2687 // fhEChargedNoOut = (TH1F *) outputList->At(index++);
2688 // fhPtChargedNoOut = (TH1F *) outputList->At(index++);
2689 // fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
2690 // fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
2691 // fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
2693 fh1pOverE = (TH2F *) outputList->At(index++);
2694 fh1dR = (TH1F *) outputList->At(index++);
2695 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2696 fh2EledEdx = (TH2F *) outputList->At(index++);
2697 fh1pOverER02 = (TH2F *) outputList->At(index++);
2699 fhIM = (TH2F *) outputList->At(index++);
2700 fhIMCellCut = (TH2F *) outputList->At(index++);
2701 fhAsym = (TH2F *) outputList->At(index++);
2703 fhNCellsPerCluster = (TH3F *) outputList->At(index++);
2704 fhNCellsPerClusterMIP = (TH3F *) outputList->At(index++);
2705 fhNCellsPerClusterMIPCharged = (TH3F *) outputList->At(index++);
2706 fhNClusters = (TH1F *) outputList->At(index++);
2708 fhRNCells = (TH2F *) outputList->At(index++);
2709 fhXNCells = (TH2F *) outputList->At(index++);
2710 fhYNCells = (TH2F *) outputList->At(index++);
2711 fhZNCells = (TH2F *) outputList->At(index++);
2712 fhRE = (TH2F *) outputList->At(index++);
2713 fhXE = (TH2F *) outputList->At(index++);
2714 fhYE = (TH2F *) outputList->At(index++);
2715 fhZE = (TH2F *) outputList->At(index++);
2716 fhXYZ = (TH3F *) outputList->At(index++);
2718 fhRCellE = (TH2F *) outputList->At(index++);
2719 fhXCellE = (TH2F *) outputList->At(index++);
2720 fhYCellE = (TH2F *) outputList->At(index++);
2721 fhZCellE = (TH2F *) outputList->At(index++);
2722 fhXYZCell = (TH3F *) outputList->At(index++);
2723 fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
2724 fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
2725 fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
2726 fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
2727 fhDeltaCellClusterRE = (TH2F *) outputList->At(index++);
2728 fhDeltaCellClusterXE = (TH2F *) outputList->At(index++);
2729 fhDeltaCellClusterYE = (TH2F *) outputList->At(index++);
2730 fhDeltaCellClusterZE = (TH2F *) outputList->At(index++);
2731 fhEtaPhiAmp = (TH3F *) outputList->At(index++);
2733 fhNCells = (TH1F *) outputList->At(index++);
2734 fhAmplitude = (TH1F *) outputList->At(index++);
2735 fhAmpId = (TH2F *) outputList->At(index++);
2737 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2739 fhCellTimeSpreadRespectToCellMax = (TH1F *) outputList->At(index++);
2740 fhCellIdCellLargeTimeSpread = (TH1F *) outputList->At(index++);
2742 fhTime = (TH1F *) outputList->At(index++);
2743 fhTimeId = (TH2F *) outputList->At(index++);
2744 fhTimeAmp = (TH2F *) outputList->At(index++);
2746 // fhT0Time = (TH1F *) outputList->At(index++);
2747 // fhT0TimeId = (TH2F *) outputList->At(index++);
2748 // fhT0TimeAmp = (TH2F *) outputList->At(index++);
2753 if(fCorrelateCalos){
2754 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2755 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2756 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2757 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2761 fhEMod = new TH1F*[fNModules];
2762 fhNClustersMod = new TH1F*[fNModules];
2763 fhNCellsPerClusterMod = new TH2F*[fNModules];
2764 fhNCellsMod = new TH1F*[fNModules];
2765 fhGridCellsMod = new TH2F*[fNModules];
2766 fhGridCellsEMod = new TH2F*[fNModules];
2767 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2768 fhGridCellsTimeMod = new TH2F*[fNModules];
2769 fhAmplitudeMod = new TH1F*[fNModules];
2770 if(fCalorimeter=="EMCAL")
2771 fhAmplitudeModFraction = new TH1F*[fNModules*3];
2774 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2776 fhIMMod = new TH2F*[fNModules];
2777 fhIMCellCutMod = new TH2F*[fNModules];
2779 for(Int_t imod = 0 ; imod < fNModules; imod++){
2780 fhEMod[imod] = (TH1F *) outputList->At(index++);
2781 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2782 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2783 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2784 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2785 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2786 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2787 fhGridCellsTimeMod[imod] = (TH2F *) outputList->At(index++);
2788 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2790 if(fCalorimeter=="EMCAL"){
2791 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
2792 fhAmplitudeModFraction[imod*3+ifrac] = (TH1F *) outputList->At(index++);
2796 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
2797 fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2798 //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2799 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
2800 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
2801 // fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2] = (TH2F *) outputList->At(index++);
2805 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2806 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
2811 fhDeltaE = (TH1F *) outputList->At(index++);
2812 fhDeltaPt = (TH1F *) outputList->At(index++);
2813 fhDeltaPhi = (TH1F *) outputList->At(index++);
2814 fhDeltaEta = (TH1F *) outputList->At(index++);
2816 fhRatioE = (TH1F *) outputList->At(index++);
2817 fhRatioPt = (TH1F *) outputList->At(index++);
2818 fhRatioPhi = (TH1F *) outputList->At(index++);
2819 fhRatioEta = (TH1F *) outputList->At(index++);
2821 fh2E = (TH2F *) outputList->At(index++);
2822 fh2Pt = (TH2F *) outputList->At(index++);
2823 fh2Phi = (TH2F *) outputList->At(index++);
2824 fh2Eta = (TH2F *) outputList->At(index++);
2826 fhGamE = (TH2F *) outputList->At(index++);
2827 fhGamPt = (TH2F *) outputList->At(index++);
2828 fhGamPhi = (TH2F *) outputList->At(index++);
2829 fhGamEta = (TH2F *) outputList->At(index++);
2831 fhGamDeltaE = (TH1F *) outputList->At(index++);
2832 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2833 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2834 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2836 fhGamRatioE = (TH1F *) outputList->At(index++);
2837 fhGamRatioPt = (TH1F *) outputList->At(index++);
2838 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2839 fhGamRatioEta = (TH1F *) outputList->At(index++);
2841 fhPi0E = (TH2F *) outputList->At(index++);
2842 fhPi0Pt = (TH2F *) outputList->At(index++);
2843 fhPi0Phi = (TH2F *) outputList->At(index++);
2844 fhPi0Eta = (TH2F *) outputList->At(index++);
2846 fhEleE = (TH2F *) outputList->At(index++);
2847 fhElePt = (TH2F *) outputList->At(index++);
2848 fhElePhi = (TH2F *) outputList->At(index++);
2849 fhEleEta = (TH2F *) outputList->At(index++);
2851 fhNeHadE = (TH2F *) outputList->At(index++);
2852 fhNeHadPt = (TH2F *) outputList->At(index++);
2853 fhNeHadPhi = (TH2F *) outputList->At(index++);
2854 fhNeHadEta = (TH2F *) outputList->At(index++);
2856 fhChHadE = (TH2F *) outputList->At(index++);
2857 fhChHadPt = (TH2F *) outputList->At(index++);
2858 fhChHadPhi = (TH2F *) outputList->At(index++);
2859 fhChHadEta = (TH2F *) outputList->At(index++);
2861 fhGamECharged = (TH2F *) outputList->At(index++);
2862 fhGamPtCharged = (TH2F *) outputList->At(index++);
2863 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2864 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2866 fhPi0ECharged = (TH2F *) outputList->At(index++);
2867 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2868 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2869 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2871 fhEleECharged = (TH2F *) outputList->At(index++);
2872 fhElePtCharged = (TH2F *) outputList->At(index++);
2873 fhElePhiCharged = (TH2F *) outputList->At(index++);
2874 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2876 fhNeHadECharged = (TH2F *) outputList->At(index++);
2877 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2878 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2879 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2881 fhChHadECharged = (TH2F *) outputList->At(index++);
2882 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2883 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2884 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2886 // fhEMVxyz = (TH3F *) outputList->At(index++);
2887 // fhHaVxyz = (TH3F *) outputList->At(index++);
2889 fhEMVxyz = (TH2F *) outputList->At(index++);
2890 fhHaVxyz = (TH2F *) outputList->At(index++);
2891 fhEMR = (TH2F *) outputList->At(index++);
2892 fhHaR = (TH2F *) outputList->At(index++);
2894 fhGenGamPt = (TH1F *) outputList->At(index++);
2895 fhGenGamEta = (TH1F *) outputList->At(index++);
2896 fhGenGamPhi = (TH1F *) outputList->At(index++);
2898 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2899 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2900 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2902 fhGenEtaPt = (TH1F *) outputList->At(index++);
2903 fhGenEtaEta = (TH1F *) outputList->At(index++);
2904 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2906 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2907 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2908 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2910 fhGenElePt = (TH1F *) outputList->At(index++);
2911 fhGenEleEta = (TH1F *) outputList->At(index++);
2912 fhGenElePhi = (TH1F *) outputList->At(index++);
2914 fhGenGamAccE = (TH1F *) outputList->At(index++);
2915 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2916 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2917 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2919 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2920 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2921 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2922 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2924 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
2925 fhMCEle1dR = (TH1F *) outputList->At(index++);
2926 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2928 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
2929 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2930 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2932 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
2933 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2934 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2936 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2937 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2938 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
2942 //__________________________________________________________________
2943 void AliAnaCalorimeterQA::Terminate(TList* outputList)
2945 //Do plots if requested
2947 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
2948 if(!fMakePlots) return;
2950 //Do some plots to end
2951 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
2952 //Recover histograms from output histograms list, needed for distributed analysis.
2953 ReadHistograms(outputList);
2955 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2956 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
2961 //In case terminate is executed after the analysis, in a second step, and we want to rebin or to change the range of the histograms for plotting
2962 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
2963 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
2964 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
2965 // Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
2966 // Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
2967 // Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
2968 // Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
2969 // Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
2970 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
2971 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
2972 // Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
2973 // Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
2974 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
2975 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
2976 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
2977 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
2979 //Color code for the different modules
2980 Int_t modColorIndex[]={2,4,6,8};
2982 //--------------------------------------------------
2983 // Cluster energy distributions, module dependence
2984 //--------------------------------------------------
2985 sprintf(cname,"QA_%s_ClusterEnergy",fCalorimeter.Data());
2986 TCanvas * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
2988 Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
2989 //printf("new E rb %d\n",rbE);
2991 fhE->SetAxisRange(ptmin,ptmax,"X");
2993 if(fhE->GetEntries() > 0) gPad->SetLogy();
2994 TLegend pLegendE(0.7,0.6,0.9,0.8);
2995 pLegendE.SetTextSize(0.03);
2996 pLegendE.AddEntry(fhE,"all modules","L");
2997 pLegendE.SetFillColor(10);
2998 pLegendE.SetBorderSize(1);
3001 fhE->SetLineColor(1);
3003 for(Int_t imod = 0; imod < fNModules; imod++){
3004 fhEMod[imod]->Rebin(rbE);
3005 fhEMod[imod]->SetLineColor(modColorIndex[imod]);
3006 fhEMod[imod]->Draw("HE same");
3007 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
3013 TLegend pLegendER(0.55,0.8,0.9,0.9);
3014 pLegendER.SetTextSize(0.03);
3015 pLegendER.SetFillColor(10);
3016 pLegendER.SetBorderSize(1);
3018 for(Int_t imod = 1; imod < fNModules; imod++){
3019 TH1D * htmp = (TH1D*)fhEMod[imod]->Clone(Form("hERat%d",imod));
3020 htmp->Divide(fhEMod[0]);
3021 htmp->SetLineColor(modColorIndex[imod]);
3023 htmp->SetTitle("Ratio module X / module 0");
3024 htmp->SetAxisRange(ptmin,ptmax,"X");
3025 htmp->SetMaximum(5);
3026 htmp->SetMinimum(0);
3027 htmp->SetAxisRange(ptmin,ptmax,"X");
3031 htmp->Draw("same HE");
3033 pLegendER.AddEntry(fhEMod[imod],Form("module %d / module 0",imod),"L");
3037 sprintf(name,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
3038 c->Print(name); printf("Plot: %s\n",name);
3040 //--------------------------------------------------
3041 // Cell energy distributions, module dependence
3042 //--------------------------------------------------
3043 sprintf(cname,"%s_QA_CellEnergy",fCalorimeter.Data());
3044 TCanvas * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
3047 Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
3048 //printf("new Amp rb %d\n",rbAmp);
3049 fhAmplitude->Rebin(rbAmp);
3050 fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
3053 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
3054 TLegend pLegendA(0.7,0.6,0.9,0.8);
3055 pLegendA.SetTextSize(0.03);
3056 pLegendA.AddEntry(fhE,"all modules","L");
3057 pLegendA.SetFillColor(10);
3058 pLegendA.SetBorderSize(1);
3059 fhAmplitude->SetMinimum(0.1);
3060 fhAmplitude->SetLineColor(1);
3061 fhAmplitude->Draw("HE");
3063 for(Int_t imod = 0; imod < fNModules; imod++){
3064 fhAmplitudeMod[imod]->Rebin(rbAmp);
3065 fhAmplitudeMod[imod]->SetLineColor(modColorIndex[imod]);
3066 fhAmplitudeMod[imod]->Draw("HE same");
3067 pLegendA.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3073 TLegend pLegendAR(0.55,0.8,0.9,0.9);
3074 pLegendAR.SetTextSize(0.03);
3075 pLegendAR.SetFillColor(10);
3076 pLegendAR.SetBorderSize(1);
3078 for(Int_t imod = 1; imod < fNModules; imod++){
3079 TH1D * htmp = (TH1D*)fhAmplitudeMod[imod]->Clone(Form("hAmpRat%d",imod));
3080 htmp->Divide(fhAmplitudeMod[0]);
3081 htmp->SetLineColor(modColorIndex[imod]);
3083 htmp->SetTitle("Ratio cells energy in module X / module 0");
3084 htmp->SetAxisRange(ptmin,ptmax,"X");
3085 htmp->SetMaximum(5);
3086 htmp->SetMinimum(0);
3090 htmp->Draw("same HE");
3091 pLegendAR.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3095 sprintf(name,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
3096 ca->Print(name); printf("Plot: %s\n",name);
3098 //----------------------------------------------------------
3099 // Cell energy distributions, FRACTION of module dependence
3100 // See Super Module calibration difference
3101 //---------------------------------------------------------
3102 if(fCalorimeter=="EMCAL"){
3104 sprintf(cname,"%s_QA_SMThirds",fCalorimeter.Data());
3105 TCanvas * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
3106 cfrac->Divide(2, 3);
3108 if(fhAmplitude->GetEntries() > 0)
3110 TLegend pLegend1(0.6,0.6,0.9,0.8);
3111 pLegend1.SetTextSize(0.03);
3112 pLegend1.SetFillColor(10);
3113 pLegend1.SetBorderSize(1);
3114 pLegend1.SetHeader("Third close to Eta=0");
3115 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0");
3116 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3117 fhAmplitudeModFraction[0]->Draw("axis");
3118 TH1D * hAverageThird1 = (TH1D *)fhAmplitudeModFraction[3*0+2]->Clone("AverageThird1");
3119 for(Int_t imod = 0; imod < fNModules; imod++){
3121 if(imod%2==0) ifrac = 2;
3122 if(imod > 0) hAverageThird1->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3123 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3124 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3125 pLegend1.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3127 hAverageThird1 ->Scale(1./fNModules);
3131 for(Int_t imod = 0; imod < fNModules; imod++){
3133 if(imod%2==0) ifrac = 2;
3134 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3135 htmp->Divide(hAverageThird1);
3137 htmp ->SetTitle("Close to eta = 0");
3138 htmp ->SetMaximum(5);
3139 htmp ->SetMinimum(0);
3140 htmp ->SetAxisRange(ptmin,ptmax,"X");
3141 htmp ->SetYTitle("ratio third to average");
3144 else htmp -> Draw("same HE");
3150 if(fhAmplitude->GetEntries() > 0)
3152 TLegend pLegend2(0.6,0.6,0.9,0.8);
3153 pLegend2.SetTextSize(0.03);
3154 pLegend2.SetFillColor(10);
3155 pLegend2.SetBorderSize(1);
3156 pLegend2.SetHeader("Middle Third");
3158 fhAmplitudeModFraction[0]->SetTitle("Middle Third");
3159 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3160 fhAmplitudeModFraction[0]->Draw("axis");
3162 TH1D * hAverageThird2 = (TH1D *)fhAmplitudeModFraction[3*0+1]->Clone("AverageThird2");
3163 for(Int_t imod = 0; imod < fNModules; imod++){
3165 if(imod > 0) hAverageThird2->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3166 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3167 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3168 pLegend2.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3170 hAverageThird2->Scale(1./fNModules);
3176 for(Int_t imod = 0; imod < fNModules; imod++){
3178 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3179 htmp->Divide(hAverageThird2);
3181 htmp ->SetTitle("Middle");
3182 htmp ->SetMaximum(5);
3183 htmp ->SetMinimum(0);
3184 htmp ->SetAxisRange(ptmin,ptmax,"X");
3185 htmp ->SetYTitle("ratio third to average");
3188 else htmp -> Draw("same HE");
3194 if(fhAmplitude->GetEntries() > 0)
3196 TLegend pLegend3(0.6,0.6,0.9,0.8);
3197 pLegend3.SetTextSize(0.03);
3198 pLegend3.SetFillColor(10);
3199 pLegend3.SetBorderSize(1);
3200 pLegend3.SetHeader("Third close to Eta=0.7");
3202 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0.7");
3203 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3204 fhAmplitudeModFraction[0]->Draw("axis");
3206 TH1D * hAverageThird3 = (TH1D *)fhAmplitudeModFraction[3*0+0]->Clone("AverageThird3");
3207 for(Int_t imod = 0; imod < 4; imod++){
3209 if(imod%2==0) ifrac = 0;
3210 if(imod > 0) hAverageThird3->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3211 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3212 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3213 pLegend3.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3215 hAverageThird3 ->Scale(1./fNModules);
3220 for(Int_t imod = 0; imod < fNModules; imod++){
3222 if(imod%2==0) ifrac = 0;
3223 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3224 htmp->Divide(hAverageThird3);
3226 htmp ->SetTitle("Close to eta = 0.7");
3227 htmp ->SetMaximum(5);
3228 htmp ->SetMinimum(0);
3229 htmp ->SetAxisRange(ptmin,ptmax,"X");
3230 htmp ->SetYTitle("ratio third to average");
3233 else htmp ->Draw("same HE");
3237 sprintf(name,"QA_%s_CellEnergyModuleFraction.eps",fCalorimeter.Data());
3238 cfrac->Print(name); printf("Create plot %s\n",name);
3242 //----------------------------------------------------------
3243 // Cluster eta and phi distributions, energy cut dependence
3244 //---------------------------------------------------------
3246 sprintf(cname,"%s_QA_EtaPhiCluster",fCalorimeter.Data());
3247 TCanvas * cetaphic = new TCanvas(cname, "Eta-Phi Reconstructed distributions", 1200, 400) ;
3248 cetaphic->Divide(3, 1);
3253 Float_t ecut[] = {0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3};
3254 Int_t ecutcolor[]= {2, 4, 6, 7, 8, 9, 12};
3255 TH1D * hE = fhEtaPhiE->ProjectionZ();
3262 TLegend pLegendPhiCl(0.83,0.6,0.95,0.93);
3263 pLegendPhiCl.SetTextSize(0.03);
3264 pLegendPhiCl.SetFillColor(10);
3265 pLegendPhiCl.SetBorderSize(1);
3267 TH1D * htmp = fhEtaPhiE->ProjectionY("hphi_cluster_nocut",0,-1,0,-1);
3269 htmp->SetMinimum(1);
3270 rbPhi = GetNewRebinForRePlotting(htmp, phimin, phimax,nphibins) ;
3271 //printf("new Phi rb %d\n",rbPhi);
3273 htmp->SetTitle("#phi of clusters for energy in cluster > threshold");
3274 htmp->SetAxisRange(phimin,phimax,"X");
3276 pLegendPhiCl.AddEntry(htmp,"No cut","L");
3278 for (Int_t i = 0; i < ncuts; i++) {
3279 binmin = hE->FindBin(ecut[i]);
3280 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3281 htmp = fhEtaPhiE->ProjectionY(Form("hphi_cluster_cut%d",i),0,-1,binmin,-1);
3282 htmp->SetLineColor(ecutcolor[i]);
3284 htmp->Draw("same HE");
3285 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3289 pLegendPhiCl.Draw();
3296 htmp = fhEtaPhiE->ProjectionX("heta_cluster_nocut",0,-1,0,-1);
3297 htmp ->SetLineColor(1);
3298 rbEta = GetNewRebinForRePlotting(htmp,etamin, etamax,netabins) ;
3299 //printf("new Eta rb %d\n",rbEta);
3302 htmp->SetMinimum(1);
3303 htmp->SetTitle("#eta of clusters for energy in cluster > threshold");
3304 htmp->SetAxisRange(etamin,etamax,"X");
3307 for (Int_t i = 0; i < ncuts; i++) {
3308 binmin = hE->FindBin(ecut[i]);
3309 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3310 htmp = fhEtaPhiE->ProjectionX(Form("heta_cluster_cut%d",i),0,-1,binmin,-1);
3311 htmp->SetLineColor(ecutcolor[i]);
3313 htmp->Draw("same HE");
3318 TH2D* hEtaPhiCl = (TH2D*) fhEtaPhiE->Project3D("xy");
3319 hEtaPhiCl->SetAxisRange(etamin,etamax,"X");
3320 hEtaPhiCl->SetAxisRange(phimin,phimax,"Y");
3321 hEtaPhiCl->Draw("colz");
3323 sprintf(name,"QA_%s_ClusterEtaPhi.eps",fCalorimeter.Data());
3324 cetaphic->Print(name); printf("Create plot %s\n",name);
3326 //----------------------------------------------------------
3327 // Cell eta and phi distributions, energy cut dependence
3328 //---------------------------------------------------------
3330 sprintf(cname,"%s_QA_EtaPhiCell",fCalorimeter.Data());
3331 TCanvas * cetaphicell = new TCanvas(cname, "Eta-Phi Cells distributions", 1200, 400) ;
3332 cetaphicell->Divide(3, 1);
3335 cetaphicell->cd(1) ;
3339 TLegend pLegendPhiCell(0.83,0.6,0.95,0.93);
3340 pLegendPhiCell.SetTextSize(0.03);
3341 pLegendPhiCell.SetFillColor(10);
3342 pLegendPhiCell.SetBorderSize(1);
3344 htmp = fhEtaPhiAmp->ProjectionY("hphi_cell_nocut",0,-1,0,-1);
3346 htmp->SetMinimum(1);
3348 htmp->SetTitle("#phi of cells for cell energy > threshold");
3349 htmp->SetAxisRange(phimin,phimax,"X");
3351 pLegendPhiCell.AddEntry(htmp,"No cut","L");
3353 for (Int_t i = 0; i < ncuts; i++) {
3354 binmin = hE->FindBin(ecut[i]);
3355 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3356 htmp = fhEtaPhiAmp->ProjectionY(Form("hphi_cell_cut%d",i),0,-1,binmin,-1);
3357 htmp->SetLineColor(ecutcolor[i]);
3359 htmp->Draw("same HE");
3360 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3364 pLegendPhiCell.Draw();
3367 cetaphicell->cd(2) ;
3371 htmp = fhEtaPhiAmp->ProjectionX("heta_cell_nocut",0,-1,0,-1);
3373 htmp ->SetLineColor(1);
3375 htmp->SetMinimum(1);
3376 htmp->SetTitle("#eta of cells for cell energy > threshold");
3377 htmp->SetAxisRange(etamin,etamax,"X");
3380 for (Int_t i = 0; i < ncuts; i++) {
3381 binmin = hE->FindBin(ecut[i]);
3382 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3383 htmp = fhEtaPhiAmp->ProjectionX(Form("heta_cell_cut%d",i),0,-1,binmin,-1);
3384 htmp->SetLineColor(ecutcolor[i]);
3386 htmp->Draw("same HE");
3391 cetaphicell->cd(3) ;
3392 TH2D* hEtaPhiCell = (TH2D*) fhEtaPhiAmp->Project3D("xy");
3393 hEtaPhiCell->SetAxisRange(etamin,etamax,"X");
3394 hEtaPhiCell->SetAxisRange(phimin,phimax,"Y");
3395 hEtaPhiCell->Draw("colz");
3397 sprintf(name,"QA_%s_CellEtaPhi.eps",fCalorimeter.Data());
3398 cetaphicell->Print(name); printf("Create plot %s\n",name);
3400 ////////////////////////////////////////
3401 ///////// Global Positions /////////////
3402 ////////////////////////////////////////
3405 sprintf(cname,"%s_QA_ClusterXY",fCalorimeter.Data());
3406 TCanvas * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
3410 TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
3411 hXY->SetTitle("Cluster X vs Y");
3412 hXY->GetYaxis()->SetTitleOffset(1.6);
3415 TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
3416 hYZ->SetTitle("Cluster Z vs Y");
3417 hYZ->GetYaxis()->SetTitleOffset(1.6);
3420 TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
3421 hXZ->SetTitle("Cluster X vs Z");
3422 hXZ->GetYaxis()->SetTitleOffset(1.6);
3425 sprintf(name,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
3426 cxyz->Print(name); printf("Create plot %s\n",name);
3432 sprintf(cname,"QA_%s_ClusterX",fCalorimeter.Data());
3433 TCanvas * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
3437 TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
3440 hX->SetTitle("Cluster X ");
3442 rbX = GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
3443 //printf("new X rb %d\n",rbX);
3445 hX->SetMinimum(hX->GetMaximum()/2);
3446 hX->SetAxisRange(xmin,xmax);
3449 TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
3451 hY->SetTitle("Cluster Y ");
3452 rbY = GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
3453 //printf("new Y rb %d\n",rbY);
3456 hY->SetAxisRange(ymin,ymax);
3460 TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
3463 rbZ = GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
3464 //printf("new Z rb %d\n",rbZ);
3466 hZ->SetMinimum(hZ->GetMaximum()/2);
3467 hZ->SetAxisRange(zmin,zmax);
3470 sprintf(name,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
3471 cx->Print(name); printf("Create plot %s\n",name);
3475 sprintf(cname,"%s_QA_CellXY",fCalorimeter.Data());
3476 TCanvas * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
3477 cellxyz->Divide(3, 1);
3480 TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
3481 hXYCell->SetTitle("Cell X vs Y");
3482 hXYCell->GetYaxis()->SetTitleOffset(1.6);
3483 hXYCell->Draw("colz");
3485 TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
3486 hYZCell->SetTitle("Cell Z vs Y");
3487 hYZCell->GetYaxis()->SetTitleOffset(1.6);
3488 hYZCell->Draw("colz");
3490 TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
3491 hXZCell->SetTitle("Cell X vs Z");
3492 hXZCell->GetYaxis()->SetTitleOffset(1.6);
3493 hXZCell->Draw("colz");
3495 sprintf(name,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
3496 cellxyz->Print(name); printf("Create plot %s\n",name);
3499 sprintf(cname,"%s_QA_CellX",fCalorimeter.Data());
3500 TCanvas * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
3501 cellx->Divide(3, 1);
3504 TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
3507 hXCell->SetTitle("Cell X ");
3509 hXCell->SetMinimum(hXCell->GetMaximum()/2);
3510 hXCell->SetAxisRange(xmin,xmax);
3514 TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
3516 hYCell->SetTitle("Cell Y ");
3518 hYCell->SetAxisRange(ymin,ymax);
3519 hYCell->SetMinimum(1);
3523 TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
3526 hZCell->SetAxisRange(zmin,zmax);
3527 hZCell->SetTitle("Cell Z ");
3529 hZCell->SetMinimum(hZCell->GetMaximum()/2);
3532 sprintf(name,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
3533 cellx->Print(name); printf("Create plot %s\n",name);
3536 //----------------------------------------------------------
3537 // Cluster X, Y, Z, R, energy cut dependence
3538 //---------------------------------------------------------
3540 sprintf(cname,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
3541 TCanvas * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
3548 TLegend pLegendXCl(0.83,0.6,0.95,0.93);
3549 pLegendXCl.SetTextSize(0.03);
3550 pLegendXCl.SetFillColor(10);
3551 pLegendXCl.SetBorderSize(1);
3553 htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
3556 htmp->SetMinimum(1);
3557 rbR = GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
3558 //printf("new R rb %d\n",rbR);
3560 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3561 htmp->SetAxisRange(rmin,rmax,"X");
3563 pLegendXCl.AddEntry(htmp,"No cut","L");
3565 for (Int_t i = 0; i < ncuts; i++) {
3566 binmin = hE->FindBin(ecut[i]);
3567 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3568 htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
3569 htmp->SetLineColor(ecutcolor[i]);
3571 htmp->Draw("same HE");
3572 pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3581 htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
3583 htmp->SetMinimum(1);
3585 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3586 htmp->SetAxisRange(xmin,xmax,"X");
3589 for (Int_t i = 0; i < ncuts; i++) {
3590 binmin = hE->FindBin(ecut[i]);
3591 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3592 htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
3593 htmp->SetLineColor(ecutcolor[i]);
3595 htmp->Draw("same HE");
3602 htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
3604 htmp->SetMinimum(1);
3606 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3607 htmp->SetAxisRange(ymin,ymax,"X");
3610 for (Int_t i = 0; i < ncuts; i++) {
3611 binmin = hE->FindBin(ecut[i]);
3612 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3613 htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
3614 htmp->SetLineColor(ecutcolor[i]);
3616 htmp->Draw("same HE");
3624 htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
3626 htmp->SetMinimum(1);
3628 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3629 htmp->SetAxisRange(zmin,zmax,"X");
3632 for (Int_t i = 0; i < ncuts; i++) {
3633 binmin = hE->FindBin(ecut[i]);
3634 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3635 htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
3636 htmp->SetLineColor(ecutcolor[i]);
3638 htmp->Draw("same HE");
3642 sprintf(name,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3643 cxe->Print(name); printf("Create plot %s\n",name);
3646 //----------------------------------------------------------
3647 // Cluster X, Y, Z, R, NCells in cluster dependence
3648 //---------------------------------------------------------
3649 Int_t ncellcut[]={2, 3, 4};
3650 Int_t ncellcuts = 3;
3651 sprintf(cname,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
3652 TCanvas * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
3659 TLegend pLegendXClN(0.83,0.6,0.95,0.93);
3660 pLegendXClN.SetTextSize(0.03);
3661 pLegendXClN.SetFillColor(10);
3662 pLegendXClN.SetBorderSize(1);
3664 htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
3666 htmp->SetMinimum(1);
3668 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3669 htmp->SetAxisRange(rmin,rmax,"X");
3671 pLegendXClN.AddEntry(htmp,"No cut","L");
3673 for (Int_t i = 0; i < ncellcuts; i++) {
3674 if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3675 else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
3676 htmp->SetLineColor(ecutcolor[i]);
3678 htmp->Draw("same HE");
3679 if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3680 else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3690 htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
3692 htmp->SetMinimum(1);
3694 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3695 htmp->SetAxisRange(xmin,xmax,"X");
3698 for (Int_t i = 0; i < ncellcuts; i++) {
3699 if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3700 else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
3701 htmp->SetLineColor(ecutcolor[i]);
3703 htmp->Draw("same HE");
3710 htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
3712 htmp->SetMinimum(1);
3714 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3715 htmp->SetAxisRange(ymin,ymax,"X");
3718 for (Int_t i = 0; i < ncellcuts; i++) {
3719 if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3720 else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
3721 htmp->SetLineColor(ecutcolor[i]);
3723 htmp->Draw("same HE");
3731 htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
3733 htmp->SetMinimum(1);
3735 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3736 htmp->SetAxisRange(zmin,zmax,"X");
3739 for (Int_t i = 0; i < ncellcuts; i++) {
3740 if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3741 else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
3742 htmp->SetLineColor(ecutcolor[i]);
3744 htmp->Draw("same HE");
3748 sprintf(name,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
3749 cxn->Print(name); printf("Create plot %s\n",name);
3752 //----------------------------------------------------------
3753 // Cell X, Y, Z, R, energy cut dependence
3754 //---------------------------------------------------------
3756 sprintf(cname,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
3757 TCanvas * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
3758 cxecell->Divide(2, 2);
3764 TLegend pLegendXCell(0.83,0.6,0.95,0.93);
3765 pLegendXCell.SetTextSize(0.03);
3766 pLegendXCell.SetFillColor(10);
3767 pLegendXCell.SetBorderSize(1);
3769 htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
3771 htmp->SetMinimum(1);
3773 htmp->SetTitle("r of cells for energy in cluster > threshold");
3774 htmp->SetAxisRange(rmin,rmax,"X");
3776 pLegendXCell.AddEntry(htmp,"No cut","L");
3778 for (Int_t i = 0; i < ncuts; i++) {
3779 binmin = hE->FindBin(ecut[i]);
3780 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3781 htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
3782 htmp->SetLineColor(ecutcolor[i]);
3784 htmp->Draw("same HE");
3785 pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3788 pLegendXCell.Draw();
3795 htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
3797 htmp->SetMinimum(1);
3799 htmp->SetTitle("x of cells for energy in cluster > threshold");
3800 htmp->SetAxisRange(xmin,xmax,"X");
3803 for (Int_t i = 0; i < ncuts; i++) {
3804 binmin = hE->FindBin(ecut[i]);
3805 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3806 htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
3807 htmp->SetLineColor(ecutcolor[i]);
3809 htmp->Draw("same HE");
3816 htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
3818 htmp->SetMinimum(1);
3820 htmp->SetTitle("y of cells for energy in cluster > threshold");
3821 htmp->SetAxisRange(ymin,ymax,"X");
3824 for (Int_t i = 0; i < ncuts; i++) {
3825 binmin = hE->FindBin(ecut[i]);
3826 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3827 htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
3828 htmp->SetLineColor(ecutcolor[i]);
3830 htmp->Draw("same HE");
3837 htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
3839 htmp->SetMinimum(1);
3841 htmp->SetTitle("z of cells for energy in cluster > threshold");
3842 htmp->SetAxisRange(zmin,zmax,"X");
3845 for (Int_t i = 0; i < ncuts; i++) {
3846 binmin = hE->FindBin(ecut[i]);
3847 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3848 htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
3849 htmp->SetLineColor(ecutcolor[i]);
3851 htmp->Draw("same HE");
3854 sprintf(name,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3855 cxecell->Print(name); printf("Create plot %s\n",name);
3858 //----------------------------------------------------------
3859 // Cluster-Cell X, Y, Z, R, cluster energy cut dependence
3860 //---------------------------------------------------------
3861 Int_t rbDR= 1;//rbR;
3862 Int_t rbDX= 1;//rbX;
3863 Int_t rbDY= 1;//rbY;
3864 Int_t rbDZ= 1;//rbZ;
3866 sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
3867 TCanvas * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
3874 TLegend pLegendXClD(0.83,0.6,0.95,0.93);
3875 pLegendXClD.SetTextSize(0.03);
3876 pLegendXClD.SetFillColor(10);
3877 pLegendXClD.SetBorderSize(1);
3879 htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
3881 htmp->SetMinimum(1);
3883 htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
3884 htmp->SetAxisRange(-50,50,"X");
3886 pLegendXCl.AddEntry(htmp,"No cut","L");
3888 for (Int_t i = 0; i < ncuts; i++) {
3889 binmin = hE->FindBin(ecut[i]);
3890 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3891 htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
3892 htmp->SetLineColor(ecutcolor[i]);
3894 htmp->Draw("same HE");
3895 pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3904 htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
3906 htmp->SetMinimum(1);
3908 htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
3909 htmp->SetAxisRange(-50,50,"X");
3912 for (Int_t i = 0; i < ncuts; i++) {
3913 binmin = hE->FindBin(ecut[i]);
3914 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3915 htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
3916 htmp->SetLineColor(ecutcolor[i]);
3918 htmp->Draw("same HE");
3926 htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
3928 htmp->SetMinimum(1);
3930 htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
3931 htmp->SetAxisRange(-50,50,"X");
3934 for (Int_t i = 0; i < ncuts; i++) {
3935 binmin = hE->FindBin(ecut[i]);
3936 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3937 htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
3938 htmp->SetLineColor(ecutcolor[i]);
3940 htmp->Draw("same HE");
3949 htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
3951 htmp->SetMinimum(1);
3953 htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
3954 htmp->SetAxisRange(-50,50,"X");
3957 for (Int_t i = 0; i < ncuts; i++) {
3958 binmin = hE->FindBin(ecut[i]);
3959 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3960 htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
3961 htmp->SetLineColor(ecutcolor[i]);
3963 htmp->Draw("same HE");
3968 sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3969 cxde->Print(name); printf("Create plot %s\n",name);
3972 //----------------------------------------------------------
3973 // Cluster-Cell X, Y, Z, R, NCells in cluster dependence
3974 //---------------------------------------------------------
3975 sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
3976 TCanvas * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
3983 TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
3984 pLegendXClDN.SetTextSize(0.03);
3985 pLegendXClDN.SetFillColor(10);
3986 pLegendXClDN.SetBorderSize(1);
3988 htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
3990 htmp->SetMinimum(1);
3992 htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
3993 htmp->SetAxisRange(-50,50,"X");
3995 pLegendXClDN.AddEntry(htmp,"No cut","L");
3997 for (Int_t i = 0; i < ncellcuts; i++) {
3998 if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
3999 else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
4000 htmp->SetLineColor(ecutcolor[i]);
4002 htmp->Draw("same HE");
4003 if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
4004 else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
4008 pLegendXClDN.Draw();
4014 htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
4016 htmp->SetMinimum(1);
4018 htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
4019 htmp->SetAxisRange(-50,50,"X");
4022 for (Int_t i = 0; i < ncellcuts; i++) {
4023 if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
4024 else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
4025 htmp->SetLineColor(ecutcolor[i]);
4027 htmp->Draw("same HE");
4035 htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
4037 htmp->SetMinimum(1);
4039 htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
4040 htmp->SetAxisRange(-50,50,"X");
4043 for (Int_t i = 0; i < ncellcuts; i++) {
4044 if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
4045 else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
4046 htmp->SetLineColor(ecutcolor[i]);
4048 htmp->Draw("same HE");
4057 htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
4059 htmp->SetMinimum(1);
4061 htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
4062 htmp->SetAxisRange(-50,50,"X");
4065 for (Int_t i = 0; i < ncellcuts; i++) {
4066 if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
4067 else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
4068 htmp->SetLineColor(ecutcolor[i]);
4070 htmp->Draw("same HE");
4075 sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
4076 cxdn->Print(name); printf("Create plot %s\n",name);
4079 //----------------------------------------------------------
4080 //Reconstructed clusters energy-eta-phi distributions, matched with tracks
4081 //----------------------------------------------------------
4083 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
4084 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
4085 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
4086 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
4089 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
4090 TCanvas * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
4091 ccltm->Divide(3, 1);
4094 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
4095 fhECharged->Rebin(rbE);
4096 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4097 fhECharged->SetMinimum(1);
4101 if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
4102 fhPhiCharged->Rebin(rbPhi);
4103 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4104 fhPhiCharged->Draw();
4105 fhPhiCharged->Draw();
4108 if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
4109 fhEtaCharged->Rebin(rbEta);
4110 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4111 fhEtaCharged->Draw();
4112 fhEtaCharged->Draw();
4114 sprintf(name,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
4115 ccltm->Print(name); printf("Plot: %s\n",name);
4117 //----------------------------------------------------------
4118 // Ratio of reconstructed clusters energy-eta-phi distributions, matched with tracks over all
4119 //----------------------------------------------------------
4121 sprintf(cname,"%s_QA_ChargedRatio",fCalorimeter.Data());
4122 TCanvas * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
4123 ccharge->Divide(3, 1);
4126 fhECharged->Sumw2();
4128 fhECharged->Divide(fhE);
4129 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4130 fhECharged->SetMaximum(0.5);
4131 fhECharged->SetYTitle("track-matched clusters / all clusters");
4132 fhECharged->Draw("HE");
4135 fhPhiCharged->Sumw2();
4136 fhPhi->Rebin(rbPhi);
4138 fhPhiCharged->Divide(fhPhi);
4139 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4140 fhPhiCharged->SetMaximum(0.5);
4141 fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
4142 fhPhiCharged->Draw("HE");
4145 fhEtaCharged->Sumw2();
4146 fhEta->Rebin(rbEta);
4148 fhEtaCharged->Divide(fhEta);
4149 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4150 fhEtaCharged->SetMaximum(0.5);
4151 fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
4152 fhEtaCharged->Draw("HE");
4154 sprintf(name,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
4155 ccharge->Print(name); printf("Create plot %s\n",name);
4157 //-------------------------------------------
4158 // N Cells - N Clusters - N Cells per cluster
4159 //-------------------------------------------
4160 sprintf(cname,"QA_%s_nclustercells",fCalorimeter.Data());
4161 TCanvas * cN = new TCanvas(cname, " Number of CaloClusters and CaloCells", 800, 1200) ;
4166 TLegend pLegendN(0.7,0.6,0.9,0.8);
4167 pLegendN.SetTextSize(0.03);
4168 pLegendN.AddEntry(fhNClusters,"all modules","L");
4169 pLegendN.SetFillColor(10);
4170 pLegendN.SetBorderSize(1);
4172 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
4174 fhNClusters->SetLineColor(1);
4177 if(fhNClusters->GetNbinsX()> nbins) rbN = fhNClusters->GetNbinsX()/nbins;
4179 fhNClusters->SetAxisRange(nmin,nmax,"X");
4180 fhNClusters->Draw("HE");
4181 for(Int_t imod = 0; imod < fNModules; imod++){
4182 fhNClustersMod[imod]->SetAxisRange(nmin,nmax,"X");
4183 fhNClustersMod[imod]->SetLineColor(modColorIndex[imod]);
4184 fhNClustersMod[imod]->Draw("same");
4185 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
4191 for(Int_t imod = 1; imod < fNModules; imod++){
4192 htmp = (TH1D*)fhNClustersMod[imod]->Clone(Form("hNClustersRat%d",imod));
4193 htmp->Divide(fhNClustersMod[0]);
4194 htmp->SetLineColor(modColorIndex[imod]);
4196 htmp->SetTitle("Ratio # clusters in module X / module 0");
4197 htmp->SetMaximum(5);
4198 htmp->SetMinimum(0);
4202 htmp->Draw("same HE");
4207 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
4209 fhNCells->SetLineColor(1);
4210 fhNCells->SetAxisRange(nmin,nmax,"X");
4211 fhNCells->Draw("HE");
4212 for(Int_t imod = 0; imod < fNModules; imod++){
4213 fhNCellsMod[imod]->SetAxisRange(nmin,nmax,"X");
4214 fhNCellsMod[imod]->SetLineColor(modColorIndex[imod]);
4215 fhNCellsMod[imod]->Draw("same HE");
4221 for(Int_t imod = 1; imod < fNModules; imod++){
4222 htmp = (TH1D*)fhNCellsMod[imod]->Clone(Form("hNCellsRat%d",imod));
4223 htmp->Divide(fhNCellsMod[0]);
4224 htmp->SetLineColor(modColorIndex[imod]);
4226 htmp->SetTitle("Ratio # cells in module X / module 0");
4227 htmp->SetMaximum(5);
4228 htmp->SetMinimum(0);
4232 htmp->Draw("same HE");
4237 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
4239 TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1,-1,-1);
4240 cpc->SetLineColor(1);
4241 cpc->SetTitle("# cells per cluster");
4243 TH1D ** hNCellsCluster1D = new TH1D*[fNModules];
4245 for(Int_t imod = 0; imod < fNModules; imod++){
4246 hNCellsCluster1D[imod] = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
4247 hNCellsCluster1D[imod]->SetLineColor(modColorIndex[imod]);
4248 hNCellsCluster1D[imod]->Draw("same HE");
4254 for(Int_t imod = 1; imod < fNModules; imod++){
4255 htmp = (TH1D*)hNCellsCluster1D[imod]->Clone(Form("hNClustersCells1DRat%d",imod));
4256 htmp->Divide(hNCellsCluster1D[0]);
4257 htmp->SetLineColor(modColorIndex[imod]);
4259 htmp->SetTitle("Ratio # cells per cluster in module X / module 0");
4260 //htmp->SetAxisRange(ptmin,ptmax,"X");
4261 htmp->SetMaximum(3.5);
4262 htmp->SetMinimum(0);
4266 htmp->Draw("same HE");
4269 sprintf(name,"QA_%s_NumberCaloClustersAndCaloCells.eps",fCalorimeter.Data());
4270 cN->Print(name); printf("Print plot %s\n",name);
4272 //----------------------------------------------------
4273 // Cell Time histograms, time only available in ESDs
4274 //----------------------------------------------------
4275 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
4277 sprintf(cname,"QA_%s_cellstime",fCalorimeter.Data());
4278 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
4279 ctime->Divide(3, 1);
4282 if(fhTime->GetNbinsX()> ntimebins) rbTime = fhTime->GetNbinsX()/ntimebins;
4285 if(fhTime->GetEntries() > 0) gPad->SetLogy();
4286 fhTime->Rebin(rbTime);
4287 fhTime->SetAxisRange(timemin,timemax,"X");
4291 fhTimeId->SetTitleOffset(1.8,"Y");
4292 fhTimeId->SetAxisRange(timemin,timemax,"X");
4293 fhTimeId->Draw("colz");
4296 fhTimeAmp->SetTitle("Cell Energy vs Cell Time");
4297 fhTimeAmp->SetTitleOffset(1.8,"Y");
4298 fhTimeAmp->SetAxisRange(timemin,timemax,"Y");
4299 fhTimeAmp->SetAxisRange(ptmin,ptmax,"X");
4300 fhTimeAmp->Draw("colz");
4302 sprintf(name,"QA_%s_CellsTime.eps",fCalorimeter.Data());
4303 ctime->Print(name); printf("Plot: %s\n",name);
4307 //---------------------------------
4308 //Grid of cell per module plots
4309 //---------------------------------
4311 //Number of entries per cell
4312 gStyle->SetPadRightMargin(0.15);
4313 sprintf(cname,"%s_QA_GridCellEntries",fCalorimeter.Data());
4314 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
4315 if(fNModules%2 == 0)
4316 cgrid->Divide(fNModules/2,2);
4318 cgrid->Divide(fNModules/2+1,2);
4320 for(Int_t imod = 0; imod < fNModules ; imod++){
4325 //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
4326 fhGridCellsMod[imod]->SetZTitle("Counts ");
4327 fhGridCellsMod[imod]->SetYTitle("row (phi direction) ");
4328 //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
4329 fhGridCellsMod[imod]->Draw("colz");
4331 sprintf(name,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
4332 cgrid->Print(name); printf("Create plot %s\n",name);
4334 sprintf(cname,"%s_QA_GridCellAccumEnergy",fCalorimeter.Data());
4335 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
4336 if(fNModules%2 == 0)
4337 cgridE->Divide(fNModules/2,2);
4339 cgridE->Divide(fNModules/2+1,2);
4340 for(Int_t imod = 0; imod < fNModules ; imod++){
4345 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4346 fhGridCellsEMod[imod]->SetZTitle("Accumulated Energy (GeV) ");
4347 fhGridCellsEMod[imod]->SetYTitle("row (phi direction) ");
4348 fhGridCellsEMod[imod]->Draw("colz");
4350 sprintf(name,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
4351 cgridE->Print(name); printf("Create plot %s\n",name);
4353 //Accumulated energy per cell
4354 sprintf(cname,"%s_QA_GridCellAverageEnergy",fCalorimeter.Data());
4355 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
4356 if(fNModules%2 == 0)
4357 cgridEA->Divide(fNModules/2,2);
4359 cgridEA->Divide(fNModules/2+1,2);
4360 for(Int_t imod = 0; imod < fNModules ; imod++){
4361 cgridEA->cd(imod+1);
4365 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4366 fhGridCellsEMod[imod]->SetZTitle("Average Energy (GeV) ");
4367 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
4368 fhGridCellsEMod[imod]->Draw("colz");
4370 sprintf(name,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
4371 cgridEA->Print(name); printf("Create plot %s\n",name);
4373 //Accumulated Time per cell, E > 0.5 GeV
4375 sprintf(cname,"%s_QA_GridCellAccumTime",fCalorimeter.Data());
4376 TCanvas *cgridT = new TCanvas("cgridT","Summed time per cell", 12,12,800,400);
4377 if(fNModules%2 == 0)
4378 cgridT->Divide(fNModules/2,2);
4380 cgridE->Divide(fNModules/2+1,2);
4381 for(Int_t imod = 0; imod < fNModules ; imod++){
4386 //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
4387 fhGridCellsTimeMod[imod]->SetZTitle("Accumulated Time (ns) ");
4388 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction) ");
4389 fhGridCellsTimeMod[imod]->Draw("colz");
4391 sprintf(name,"QA_%s_GridCellsAccumTime.eps",fCalorimeter.Data());
4392 cgridT->Print(name); printf("Create plot %s\n",name);
4396 //---------------------------------------------
4397 //Calorimeter Correlation, PHOS vs EMCAL
4398 //---------------------------------------------
4399 if(fCorrelateCalos){
4401 sprintf(cname,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
4402 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
4403 ccorr->Divide(2, 2);
4408 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"X");
4409 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"Y");
4410 fhCaloCorrNClusters ->Draw();
4415 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"X");
4416 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"Y");
4417 fhCaloCorrNCells->Draw();
4421 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"X");
4422 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"Y");
4423 fhCaloCorrEClusters->Draw();
4428 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"X");
4429 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"Y");
4430 fhCaloCorrECells->Draw();
4432 sprintf(name,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
4433 ccorr->Print(name); printf("Plot: %s\n",name);
4436 //----------------------------
4438 //-----------------------------
4440 Int_t imbinmin = -1;
4441 Int_t imbinmax = -1;
4443 if(fhIM->GetEntries() > 1){
4444 Int_t nebins = fhIM->GetNbinsX();
4445 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
4446 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
4447 if (emin != 0 ) printf("emin != 0 \n");
4448 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4450 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
4452 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
4456 //fhIM->SetLineColor(4);
4459 imbinmax = (Int_t) (1-emin)*nebins/emax;
4460 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),imbinmin,imbinmax);
4461 pyim1->SetTitle("E_{pair} < 1 GeV");
4462 pyim1->SetLineColor(1);
4464 TLegend pLegendIM(0.7,0.6,0.9,0.8);
4465 pLegendIM.SetTextSize(0.03);
4466 pLegendIM.AddEntry(pyim1,"all modules","L");
4467 pLegendIM.SetFillColor(10);
4468 pLegendIM.SetBorderSize(1);
4470 for(Int_t imod = 0; imod < fNModules; imod++){
4471 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4472 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
4473 pyim1->SetLineColor(imod+1);
4474 pyim1->Draw("same");
4479 imbinmin = (Int_t) (1-emin)*nebins/emax;
4480 imbinmax = (Int_t) (2-emin)*nebins/emax;
4481 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),imbinmin,imbinmax);
4482 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
4483 pyim2->SetLineColor(1);
4485 for(Int_t imod = 0; imod < fNModules; imod++){
4486 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4487 pyim2->SetLineColor(imod+1);
4488 pyim2->Draw("same");
4492 imbinmin = (Int_t) (2-emin)*nebins/emax;
4493 imbinmax = (Int_t) (3-emin)*nebins/emax;
4494 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),imbinmin,imbinmax);
4495 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
4496 pyim3->SetLineColor(1);
4498 for(Int_t imod = 0; imod < fNModules; imod++){
4499 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4500 pyim3->SetLineColor(imod+1);
4501 pyim3->Draw("same");
4505 imbinmin = (Int_t) (3-emin)*nebins/emax;
4506 imbinmax = (Int_t) (4-emin)*nebins/emax;
4507 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),imbinmin,imbinmax);
4508 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
4509 pyim4->SetLineColor(1);
4511 for(Int_t imod = 0; imod < fNModules; imod++){
4512 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4513 pyim4->SetLineColor(imod+1);
4514 pyim4->Draw("same");
4518 imbinmin = (Int_t) (4-emin)*nebins/emax;
4519 imbinmax = (Int_t) (5-emin)*nebins/emax;
4520 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),imbinmin,imbinmax);
4521 pyim5->SetTitle("4< E_{pair} < 5 GeV");
4522 pyim5->SetLineColor(1);
4524 for(Int_t imod = 0; imod < fNModules; imod++){
4525 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4526 pyim5->SetLineColor(imod+1);
4527 pyim5->Draw("same");
4531 imbinmin = (Int_t) (5-emin)*nebins/emax;
4533 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),imbinmin,imbinmax);
4534 pyim10->SetTitle("E_{pair} > 5 GeV");
4535 pyim10->SetLineColor(1);
4537 for(Int_t imod = 0; imod < fNModules; imod++){
4538 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4539 pyim10->SetLineColor(imod+1);
4540 pyim10->Draw("same");
4543 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
4544 c5->Print(name); printf("Plot: %s\n",name);
4547 //--------------------------------------------------
4548 //Invariant mass, clusters with more than one cell
4549 //-------------------------------------------------
4550 if(fhIMCellCut->GetEntries() > 1){
4551 Int_t nebins = fhIMCellCut->GetNbinsX();
4552 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
4553 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
4554 if (emin != 0 ) printf("emin != 0 \n");
4555 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4557 sprintf(cname,"QA_%s_IMCellCut",fCalorimeter.Data());
4558 // printf("c5cc\n");
4559 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
4563 //fhIMCellCut->SetLineColor(4);
4564 //fhIMCellCut->Draw();
4566 imbinmax = (Int_t) (1-emin)*nebins/emax;
4567 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),imbinmin,imbinmax);
4568 pyimcc1->SetTitle("E_{pair} < 1 GeV");
4569 pyimcc1->SetLineColor(1);
4571 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
4572 pLegendIMCellCut.SetTextSize(0.03);
4573 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
4574 pLegendIMCellCut.SetFillColor(10);
4575 pLegendIMCellCut.SetBorderSize(1);
4577 for(Int_t imod = 0; imod < fNModules; imod++){
4578 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4579 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
4580 pyimcc1->SetLineColor(imod+1);
4581 pyimcc1->Draw("same");
4583 pLegendIMCellCut.Draw();
4586 imbinmin = (Int_t) (1-emin)*nebins/emax;
4587 imbinmax = (Int_t) (2-emin)*nebins/emax;
4588 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),imbinmin,imbinmax);
4589 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
4590 pyimcc2->SetLineColor(1);
4592 for(Int_t imod = 0; imod < fNModules; imod++){
4593 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4594 pyimcc2->SetLineColor(imod+1);
4595 pyimcc2->Draw("same");
4599 imbinmin = (Int_t) (2-emin)*nebins/emax;
4600 imbinmax = (Int_t) (3-emin)*nebins/emax;
4601 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),imbinmin,imbinmax);
4602 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
4603 pyimcc3->SetLineColor(1);
4605 for(Int_t imod = 0; imod < fNModules; imod++){
4606 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4607 pyimcc3->SetLineColor(imod+1);
4608 pyimcc3->Draw("same");
4612 imbinmin = (Int_t) (3-emin)*nebins/emax;
4613 imbinmax = (Int_t) (4-emin)*nebins/emax;
4614 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),imbinmin,imbinmax);
4615 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
4616 pyimcc4->SetLineColor(1);
4618 for(Int_t imod = 0; imod < fNModules; imod++){
4619 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4620 pyimcc4->SetLineColor(imod+1);
4621 pyimcc4->Draw("same");
4625 imbinmin = (Int_t) (4-emin)*nebins/emax;
4626 imbinmax = (Int_t) (5-emin)*nebins/emax;
4627 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),imbinmin,imbinmax);
4628 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
4629 pyimcc5cc->SetLineColor(1);
4631 for(Int_t imod = 0; imod < fNModules; imod++){
4632 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4633 pyimcc5cc->SetLineColor(imod+1);
4634 pyimcc5cc->Draw("same");
4638 imbinmin = (Int_t) (5-emin)*nebins/emax;
4640 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),imbinmin,imbinmax);
4641 pyimcc10->SetTitle("E_{pair} > 5 GeV");
4642 pyimcc10->SetLineColor(1);
4644 for(Int_t imod = 0; imod < fNModules; imod++){
4645 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4646 pyimcc10->SetLineColor(imod+1);
4647 pyimcc10->Draw("same");
4650 sprintf(name,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
4651 c5cc->Print(name); printf("Plot: %s\n",name);
4656 if(fhAsym->GetEntries() > 1){
4657 Int_t nebins = fhAsym->GetNbinsX();
4658 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
4659 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
4660 if (emin != 0 ) printf("emin != 0 \n");
4661 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4663 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
4665 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
4669 fhAsym->SetTitleOffset(1.6,"Y");
4670 fhAsym->SetLineColor(4);
4675 imbinmax = (Int_t) (5-emin)*nebins/emax;
4676 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),imbinmin,imbinmax);
4677 pyAsym5->SetTitle("E_{pair} < 5 GeV");
4678 pyAsym5->SetLineColor(4);
4682 imbinmin = (Int_t) (5-emin)*nebins/emax;
4683 imbinmax = (Int_t) (10-emin)*nebins/emax;
4684 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),imbinmin,imbinmax);
4685 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
4686 pyAsym510->SetLineColor(4);
4690 imbinmin = (Int_t) (10-emin)*nebins/emax;
4692 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),imbinmin,imbinmax);
4693 pyAsym10->SetTitle("E_{pair} > 10 GeV");
4694 pyAsym10->SetLineColor(4);
4697 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
4698 c5b->Print(name); printf("Plot: %s\n",name);
4703 //Reconstructed vs MC distributions
4705 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
4706 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4710 fh2E->SetTitleOffset(1.6,"Y");
4711 fh2E->SetLineColor(4);
4715 fh2Pt->SetTitleOffset(1.6,"Y");
4716 fh2Pt->SetLineColor(4);
4720 fh2Phi->SetTitleOffset(1.6,"Y");
4721 fh2Phi->SetLineColor(4);
4725 fh2Eta->SetTitleOffset(1.6,"Y");
4726 fh2Eta->SetLineColor(4);
4729 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4730 c6->Print(name); printf("Plot: %s\n",name);
4732 //Reconstructed vs MC distributions
4734 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
4735 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4736 c6Gam->Divide(2, 2);
4750 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4751 c6->Print(name); printf("Plot: %s\n",name);
4753 //Generated - reconstructed
4755 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
4756 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
4760 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
4761 fhGamDeltaE->SetLineColor(4);
4763 fhGamDeltaE->Draw("same");
4765 TLegend pLegendd(0.65,0.55,0.9,0.8);
4766 pLegendd.SetTextSize(0.06);
4767 pLegendd.AddEntry(fhDeltaE,"all","L");
4768 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
4769 pLegendd.SetFillColor(10);
4770 pLegendd.SetBorderSize(1);
4774 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
4775 fhGamDeltaPt->SetLineColor(4);
4777 fhGamDeltaPt->Draw("same");
4780 fhGamDeltaPhi->SetLineColor(4);
4782 fhGamDeltaPhi->Draw("same");
4785 fhGamDeltaEta->SetLineColor(4);
4787 fhGamDeltaEta->Draw("same");
4789 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
4790 c7->Print(name); printf("Plot: %s\n",name);
4792 // Reconstructed / Generated
4794 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
4795 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
4799 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
4800 fhGamRatioE->SetLineColor(4);
4802 fhGamRatioE->Draw("same");
4804 TLegend pLegendr(0.65,0.55,0.9,0.8);
4805 pLegendr.SetTextSize(0.06);
4806 pLegendr.AddEntry(fhRatioE,"all","L");
4807 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
4808 pLegendr.SetFillColor(10);
4809 pLegendr.SetBorderSize(1);
4813 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
4814 fhGamRatioPt->SetLineColor(4);
4816 fhGamRatioPt->Draw("same");
4819 fhGamRatioPhi->SetLineColor(4);
4821 fhGamRatioPhi->Draw("same");
4824 fhGamRatioEta->SetLineColor(4);
4826 fhGamRatioEta->Draw("same");
4828 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
4829 c8->Print(name); printf("Plot: %s\n",name);
4833 //Generated distributions
4835 sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
4836 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
4841 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
4842 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
4843 fhGenPi0Pt->SetLineColor(1);
4844 fhGenGamPt->SetLineColor(4);
4845 fhGenEtaPt->SetLineColor(2);
4846 fhGenOmegaPt->SetLineColor(7);
4847 fhGenElePt->SetLineColor(6);
4849 //Select the maximum of the histogram to show all lines.
4850 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4851 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
4852 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
4853 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4854 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
4855 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
4856 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
4857 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4858 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
4859 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4860 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4861 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
4862 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4863 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
4864 haxispt->SetMaximum(fhGenElePt->GetMaximum());
4865 haxispt->SetMinimum(1);
4866 haxispt->Draw("axis");
4867 fhGenPi0Pt->Draw("same");
4868 fhGenGamPt->Draw("same");
4869 fhGenEtaPt->Draw("same");
4870 fhGenOmegaPt->Draw("same");
4871 fhGenElePt->Draw("same");
4873 TLegend pLegend(0.85,0.65,0.95,0.93);
4874 pLegend.SetTextSize(0.06);
4875 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
4876 pLegend.AddEntry(fhGenGamPt," #gamma","L");
4877 pLegend.AddEntry(fhGenEtaPt," #eta","L");
4878 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
4879 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
4880 pLegend.SetFillColor(10);
4881 pLegend.SetBorderSize(1);
4886 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
4887 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
4888 fhGenPi0Eta->SetLineColor(1);
4889 fhGenGamEta->SetLineColor(4);
4890 fhGenEtaEta->SetLineColor(2);
4891 fhGenOmegaEta->SetLineColor(7);
4892 fhGenEleEta->SetLineColor(6);
4893 //Select the maximum of the histogram to show all lines.
4894 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4895 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
4896 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
4897 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4898 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4899 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
4900 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
4901 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4902 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
4903 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4904 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4905 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
4906 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4907 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
4908 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
4909 haxiseta->SetMinimum(100);
4910 haxiseta->Draw("axis");
4911 fhGenPi0Eta->Draw("same");
4912 fhGenGamEta->Draw("same");
4913 fhGenEtaEta->Draw("same");
4914 fhGenOmegaEta->Draw("same");
4915 fhGenEleEta->Draw("same");
4920 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
4921 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
4922 fhGenPi0Phi->SetLineColor(1);
4923 fhGenGamPhi->SetLineColor(4);
4924 fhGenEtaPhi->SetLineColor(2);
4925 fhGenOmegaPhi->SetLineColor(7);
4926 fhGenElePhi->SetLineColor(6);
4927 //Select the maximum of the histogram to show all lines.
4928 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4929 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
4930 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
4931 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4932 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4933 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
4934 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
4935 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4936 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
4937 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4938 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4939 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
4940 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4941 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
4942 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
4943 haxisphi->SetMinimum(100);
4944 haxisphi->Draw("axis");
4945 fhGenPi0Phi->Draw("same");
4946 fhGenGamPhi->Draw("same");
4947 fhGenEtaPhi->Draw("same");
4948 fhGenOmegaPhi->Draw("same");
4949 fhGenElePhi->Draw("same");
4951 sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
4952 c10->Print(name); printf("Plot: %s\n",name);
4955 //Reconstructed clusters depending on its original particle.
4957 sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
4958 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
4964 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
4965 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
4966 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
4967 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
4968 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
4969 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
4970 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
4971 hPi0E->SetLineColor(1);
4972 hGamE->SetLineColor(4);
4973 hNeHadE->SetLineColor(2);
4974 hChHadE->SetLineColor(7);
4975 hEleE->SetLineColor(6);
4977 //Select the maximum of the histogram to show all lines.
4978 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
4979 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
4980 haxisE->SetMaximum(hPi0E->GetMaximum());
4981 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
4982 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
4983 haxisE->SetMaximum(hGamE->GetMaximum());
4984 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
4985 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
4986 haxisE->SetMaximum(hNeHadE->GetMaximum());
4987 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
4988 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
4989 haxisE->SetMaximum(hChHadE->GetMaximum());
4990 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
4991 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
4992 haxisE->SetMaximum(hEleE->GetMaximum());
4993 haxisE->SetXTitle("E (GeV)");
4994 haxisE->SetMinimum(1);
4995 haxisE->Draw("axis");
4996 hPi0E->Draw("same");
4997 hGamE->Draw("same");
4998 hNeHadE->Draw("same");
4999 hChHadE->Draw("same");
5000 hEleE->Draw("same");
5002 TLegend pLegend2(0.8,0.65,0.95,0.93);
5003 pLegend2.SetTextSize(0.06);
5004 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
5005 pLegend2.AddEntry(hGamE," #gamma","L");
5006 pLegend2.AddEntry(hEleE," e^{#pm}","L");
5007 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
5008 pLegend2.AddEntry(hNeHadE," h^{0}","L");
5009 pLegend2.SetFillColor(10);
5010 pLegend2.SetBorderSize(1);
5016 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
5017 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
5018 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
5019 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
5020 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
5021 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
5022 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
5023 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
5024 hPi0Pt->SetLineColor(1);
5025 hGamPt->SetLineColor(4);
5026 hNeHadPt->SetLineColor(2);
5027 hChHadPt->SetLineColor(7);
5028 hElePt->SetLineColor(6);
5030 //Select the maximum of the histogram to show all lines.
5031 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5032 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
5033 haxispt->SetMaximum(hPi0Pt->GetMaximum());
5034 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5035 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
5036 haxispt->SetMaximum(hGamPt->GetMaximum());
5037 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
5038 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
5039 haxispt->SetMaximum(hNeHadPt->GetMaximum());
5040 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5041 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
5042 haxispt->SetMaximum(hChHadPt->GetMaximum());
5043 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5044 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
5045 haxispt->SetMaximum(hElePt->GetMaximum());
5046 haxispt->SetXTitle("p_{T} (GeV/c)");
5047 haxispt->SetMinimum(1);
5048 haxispt->Draw("axis");
5049 hPi0Pt->Draw("same");
5050 hGamPt->Draw("same");
5051 hNeHadPt->Draw("same");
5052 hChHadPt->Draw("same");
5053 hElePt->Draw("same");
5058 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
5059 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
5060 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
5061 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
5062 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
5063 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
5064 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
5065 hPi0Eta->SetLineColor(1);
5066 hGamEta->SetLineColor(4);
5067 hNeHadEta->SetLineColor(2);
5068 hChHadEta->SetLineColor(7);
5069 hEleEta->SetLineColor(6);
5070 //Select the maximum of the histogram to show all lines.
5071 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5072 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
5073 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
5074 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5075 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
5076 haxiseta->SetMaximum(hGamEta->GetMaximum());
5077 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
5078 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
5079 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
5080 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5081 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
5082 haxiseta->SetMaximum(hChHadEta->GetMaximum());
5083 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5084 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
5085 haxiseta->SetMaximum(hEleEta->GetMaximum());
5087 haxiseta->SetXTitle("#eta");
5088 haxiseta->Draw("axis");
5089 hPi0Eta->Draw("same");
5090 hGamEta->Draw("same");
5091 hNeHadEta->Draw("same");
5092 hChHadEta->Draw("same");
5093 hEleEta->Draw("same");
5098 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
5099 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
5100 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
5101 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
5102 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
5103 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
5104 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
5106 hPi0Phi->SetLineColor(1);
5107 hGamPhi->SetLineColor(4);
5108 hNeHadPhi->SetLineColor(2);
5109 hChHadPhi->SetLineColor(7);
5110 hElePhi->SetLineColor(6);
5111 //Select the maximum of the histogram to show all lines.
5112 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5113 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
5114 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
5115 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5116 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
5117 haxisphi->SetMaximum(hGamPhi->GetMaximum());
5118 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
5119 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5120 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
5121 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5122 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5123 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
5124 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5125 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
5126 haxisphi->SetMaximum(hElePhi->GetMaximum());
5127 haxisphi->SetXTitle("#phi (rad)");
5128 haxisphi->Draw("axis");
5129 hPi0Phi->Draw("same");
5130 hGamPhi->Draw("same");
5131 hNeHadPhi->Draw("same");
5132 hChHadPhi->Draw("same");
5133 hElePhi->Draw("same");
5135 sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
5136 c11->Print(name); printf("Plot: %s\n",name);
5139 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
5142 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
5143 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
5144 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
5145 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
5146 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
5147 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
5148 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
5149 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
5151 sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
5152 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
5157 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5158 hPi0EClone->Divide(fhGenPi0AccE);
5159 hGamEClone->Divide(fhGenGamAccE);
5160 haxisE->SetMaximum(5);
5161 haxisE->SetMinimum(1e-2);
5162 haxisE->SetXTitle("E (GeV)");
5163 haxisE->SetYTitle("ratio = rec/gen");
5164 haxisE->Draw("axis");
5165 hPi0E->Draw("same");
5166 hGamE->Draw("same");
5168 TLegend pLegend3(0.75,0.2,0.9,0.4);
5169 pLegend3.SetTextSize(0.06);
5170 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
5171 pLegend3.AddEntry(hGamEClone," #gamma","L");
5172 pLegend3.SetFillColor(10);
5173 pLegend3.SetBorderSize(1);
5178 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5179 hPi0PtClone->Divide(fhGenPi0AccPt);
5180 hGamPtClone->Divide(fhGenGamAccPt);
5181 haxispt->SetMaximum(5);
5182 haxispt->SetMinimum(1e-2);
5183 haxispt->SetXTitle("p_{T} (GeV/c)");
5184 haxispt->SetYTitle("ratio = rec/gen");
5185 haxispt->Draw("axis");
5186 hPi0PtClone->Draw("same");
5187 hGamPtClone->Draw("same");
5192 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5193 hPi0EtaClone->Divide(fhGenPi0AccEta);
5194 hGamEtaClone->Divide(fhGenGamAccEta);
5195 haxiseta->SetMaximum(1.2);
5196 haxiseta->SetMinimum(1e-2);
5197 haxiseta->SetYTitle("ratio = rec/gen");
5198 haxiseta->SetXTitle("#eta");
5199 haxiseta->Draw("axis");
5200 hPi0EtaClone->Draw("same");
5201 hGamEtaClone->Draw("same");
5206 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5207 hPi0PhiClone->Divide(fhGenPi0AccPhi);
5208 hGamPhiClone->Divide(fhGenGamAccPhi);
5209 haxisphi->SetYTitle("ratio = rec/gen");
5210 haxisphi->SetXTitle("#phi (rad)");
5211 haxisphi->SetMaximum(1.2);
5212 haxisphi->SetMinimum(1e-2);
5213 haxisphi->Draw("axis");
5214 hPi0PhiClone->Draw("same");
5215 hGamPhiClone->Draw("same");
5217 sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
5218 c12->Print(name); printf("Plot: %s\n",name);
5222 //Reconstructed distributions
5224 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
5225 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
5230 fhEMVxyz->SetTitleOffset(1.6,"Y");
5235 fhHaVxyz->SetTitleOffset(1.6,"Y");
5240 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
5241 hEMR->SetLineColor(4);
5246 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
5247 hHaR->SetLineColor(4);
5251 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
5252 c13->Print(name); printf("Plot: %s\n",name);
5255 //Track-matching distributions
5257 //Reconstructed distributions, matched with tracks, generated particle dependence
5259 sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
5260 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
5261 c22ch->Divide(2, 2);
5265 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
5266 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
5267 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
5268 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
5269 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
5270 hPi0ECharged->SetLineColor(1);
5271 hGamECharged->SetLineColor(4);
5272 hNeHadECharged->SetLineColor(2);
5273 hChHadECharged->SetLineColor(7);
5274 hEleECharged->SetLineColor(6);
5276 fhECharged->SetLineColor(3);
5277 fhECharged->SetMinimum(0.5);
5279 hPi0ECharged->Draw("same");
5280 hGamECharged->Draw("same");
5281 hNeHadECharged->Draw("same");
5282 hChHadECharged->Draw("same");
5283 hEleECharged->Draw("same");
5284 TLegend pLegend22(0.75,0.45,0.9,0.8);
5285 pLegend22.SetTextSize(0.06);
5286 pLegend22.AddEntry(fhECharged,"all","L");
5287 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
5288 pLegend22.AddEntry(hGamECharged,"#gamma","L");
5289 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
5290 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
5291 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
5292 pLegend22.SetFillColor(10);
5293 pLegend22.SetBorderSize(1);
5298 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
5299 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
5300 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
5301 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
5302 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
5303 hPi0PtCharged->SetLineColor(1);
5304 hGamPtCharged->SetLineColor(4);
5305 hNeHadPtCharged->SetLineColor(2);
5306 hChHadPtCharged->SetLineColor(7);
5307 hElePtCharged->SetLineColor(6);
5309 fhPtCharged->SetLineColor(3);
5310 fhPtCharged->SetMinimum(0.5);
5311 fhPtCharged->Draw();
5312 hPi0PtCharged->Draw("same");
5313 hGamPtCharged->Draw("same");
5314 hNeHadPtCharged->Draw("same");
5315 hChHadPtCharged->Draw("same");
5316 hElePtCharged->Draw("same");
5320 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
5321 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
5322 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
5323 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
5324 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
5325 hPi0EtaCharged->SetLineColor(1);
5326 hGamEtaCharged->SetLineColor(4);
5327 hNeHadEtaCharged->SetLineColor(2);
5328 hChHadEtaCharged->SetLineColor(7);
5329 hEleEtaCharged->SetLineColor(6);
5331 fhEtaCharged->SetLineColor(3);
5332 fhEtaCharged->SetMinimum(0.5);
5333 fhEtaCharged->Draw();
5334 hPi0EtaCharged->Draw("same");
5335 hGamEtaCharged->Draw("same");
5336 hNeHadEtaCharged->Draw("same");
5337 hChHadEtaCharged->Draw("same");
5338 hEleEtaCharged->Draw("same");
5342 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
5343 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
5344 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
5345 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
5346 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
5347 hPi0PhiCharged->SetLineColor(1);
5348 hGamPhiCharged->SetLineColor(4);
5349 hNeHadPhiCharged->SetLineColor(2);
5350 hChHadPhiCharged->SetLineColor(7);
5351 hElePhiCharged->SetLineColor(6);
5353 fhPhiCharged->SetLineColor(3);
5354 fhPhiCharged->SetMinimum(0.5);
5355 fhPhiCharged->Draw();
5356 hPi0PhiCharged->Draw("same");
5357 hGamPhiCharged->Draw("same");
5358 hNeHadPhiCharged->Draw("same");
5359 hChHadPhiCharged->Draw("same");
5360 hElePhiCharged->Draw("same");
5363 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
5364 c22ch->Print(name); printf("Plot: %s\n",name);
5366 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
5367 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
5368 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
5369 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
5371 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
5372 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
5373 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
5374 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
5376 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
5377 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
5378 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
5379 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
5381 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
5382 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
5383 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
5384 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
5386 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
5387 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
5388 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
5389 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
5391 //Ratio: reconstructed track matched/ all reconstructed
5393 sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
5394 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
5398 hEChargedClone->SetMaximum(1.2);
5399 hEChargedClone->SetMinimum(0.001);
5400 hEChargedClone->SetLineColor(3);
5401 hEChargedClone->SetYTitle("track matched / all");
5402 hPi0EChargedClone->Divide(hPi0E);
5403 hGamEChargedClone->Divide(hGamE);
5404 hEleEChargedClone->Divide(hEleE);
5405 hNeHadEChargedClone->Divide(hNeHadE);
5406 hChHadEChargedClone->Divide(hChHadE);
5407 hEChargedClone->Draw();
5408 hPi0EChargedClone->Draw("same");
5409 hGamEChargedClone->Draw("same");
5410 hEleEChargedClone->Draw("same");
5411 hNeHadEChargedClone->Draw("same");
5412 hChHadEChargedClone->Draw("same");
5414 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
5415 pLegend3ch.SetTextSize(0.06);
5416 pLegend3ch.AddEntry(hEChargedClone,"all","L");
5417 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
5418 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
5419 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
5420 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
5421 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
5422 pLegend3ch.SetFillColor(10);
5423 pLegend3ch.SetBorderSize(1);
5427 hPtChargedClone->SetMaximum(1.2);
5428 hPtChargedClone->SetMinimum(0.001);
5429 hPtChargedClone->SetLineColor(3);
5430 hPtChargedClone->SetYTitle("track matched / all");
5431 hPi0PtChargedClone->Divide(hPi0Pt);
5432 hGamPtChargedClone->Divide(hGamPt);
5433 hElePtChargedClone->Divide(hElePt);
5434 hNeHadPtChargedClone->Divide(hNeHadPt);
5435 hChHadPtChargedClone->Divide(hChHadPt);
5436 hPtChargedClone->Draw();
5437 hPi0PtChargedClone->Draw("same");
5438 hGamPtChargedClone->Draw("same");
5439 hElePtChargedClone->Draw("same");
5440 hNeHadPtChargedClone->Draw("same");
5441 hChHadPtChargedClone->Draw("same");
5444 hEtaChargedClone->SetMaximum(1.2);
5445 hEtaChargedClone->SetMinimum(0.001);
5446 hEtaChargedClone->SetLineColor(3);
5447 hEtaChargedClone->SetYTitle("track matched / all");
5448 hPi0EtaChargedClone->Divide(hPi0Eta);
5449 hGamEtaChargedClone->Divide(hGamEta);
5450 hEleEtaChargedClone->Divide(hEleEta);
5451 hNeHadEtaChargedClone->Divide(hNeHadEta);
5452 hChHadEtaChargedClone->Divide(hChHadEta);
5453 hEtaChargedClone->Draw();
5454 hPi0EtaChargedClone->Draw("same");
5455 hGamEtaChargedClone->Draw("same");
5456 hEleEtaChargedClone->Draw("same");
5457 hNeHadEtaChargedClone->Draw("same");
5458 hChHadEtaChargedClone->Draw("same");
5461 hPhiChargedClone->SetMaximum(1.2);
5462 hPhiChargedClone->SetMinimum(0.001);
5463 hPhiChargedClone->SetLineColor(3);
5464 hPhiChargedClone->SetYTitle("track matched / all");
5465 hPi0PhiChargedClone->Divide(hPi0Phi);
5466 hGamPhiChargedClone->Divide(hGamPhi);
5467 hElePhiChargedClone->Divide(hElePhi);
5468 hNeHadPhiChargedClone->Divide(hNeHadPhi);
5469 hChHadPhiChargedClone->Divide(hChHadPhi);
5470 hPhiChargedClone->Draw();
5471 hPi0PhiChargedClone->Draw("same");
5472 hGamPhiChargedClone->Draw("same");
5473 hElePhiChargedClone->Draw("same");
5474 hNeHadPhiChargedClone->Draw("same");
5475 hChHadPhiChargedClone->Draw("same");
5477 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
5478 c3ch->Print(name); printf("Plot: %s\n",name);
5481 //Track-matching distributions
5483 sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
5484 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
5487 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
5488 pLegendpE0.SetTextSize(0.04);
5489 pLegendpE0.AddEntry(fh1pOverE,"all","L");
5490 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
5491 pLegendpE0.SetFillColor(10);
5492 pLegendpE0.SetBorderSize(1);
5493 //pLegendpE0.Draw();
5496 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
5497 fh1pOverE->SetTitle("Track matches p/E");
5499 fh1pOverER02->SetLineColor(4);
5500 fh1pOverER02->Draw("same");
5504 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
5508 fh2MatchdEdx->Draw();
5513 sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
5514 cme->Print(name); printf("Plot: %s\n",name);
5517 sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
5518 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
5523 fhMCEle1pOverE->Draw();
5524 fhMCEle1pOverER02->SetLineColor(4);
5525 fhMCEle1pOverE->SetLineColor(1);
5526 fhMCEle1pOverER02->Draw("same");
5534 fhMCEle2MatchdEdx->Draw();
5536 sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
5537 cmemc->Print(name); printf("Plot: %s\n",name);
5540 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
5541 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
5542 cmemchad->Divide(3,1);
5546 fhMCChHad1pOverE->Draw();
5547 fhMCChHad1pOverER02->SetLineColor(4);
5548 fhMCChHad1pOverE->SetLineColor(1);
5549 fhMCChHad1pOverER02->Draw("same");
5554 fhMCChHad1dR->Draw();
5557 fhMCChHad2MatchdEdx->Draw();
5559 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
5560 cmemchad->Print(name); printf("Plot: %s\n",name);
5562 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
5563 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
5564 cmemcn->Divide(3,1);
5568 fhMCNeutral1pOverE->Draw();
5569 fhMCNeutral1pOverE->SetLineColor(1);
5570 fhMCNeutral1pOverER02->SetLineColor(4);
5571 fhMCNeutral1pOverER02->Draw("same");
5576 fhMCNeutral1dR->Draw();
5579 fhMCNeutral2MatchdEdx->Draw();
5581 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
5582 cmemcn->Print(name); printf("Plot: %s\n",name);
5584 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
5585 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
5590 fh1pOverE->SetLineColor(1);
5591 fhMCEle1pOverE->SetLineColor(4);
5592 fhMCChHad1pOverE->SetLineColor(2);
5593 fhMCNeutral1pOverE->SetLineColor(7);
5594 fh1pOverER02->SetMinimum(0.5);
5596 fhMCEle1pOverE->Draw("same");
5597 fhMCChHad1pOverE->Draw("same");
5598 fhMCNeutral1pOverE->Draw("same");
5599 TLegend pLegendpE(0.65,0.55,0.9,0.8);
5600 pLegendpE.SetTextSize(0.06);
5601 pLegendpE.AddEntry(fh1pOverE,"all","L");
5602 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
5603 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
5604 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
5605 pLegendpE.SetFillColor(10);
5606 pLegendpE.SetBorderSize(1);
5611 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
5612 fh1pOverER02->SetLineColor(1);
5613 fhMCEle1pOverER02->SetLineColor(4);
5614 fhMCChHad1pOverER02->SetLineColor(2);
5615 fhMCNeutral1pOverER02->SetLineColor(7);
5616 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
5617 fh1pOverER02->SetMinimum(0.5);
5618 fh1pOverER02->Draw();
5619 fhMCEle1pOverER02->Draw("same");
5620 fhMCChHad1pOverER02->Draw("same");
5621 fhMCNeutral1pOverER02->Draw("same");
5623 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
5624 // pLegendpE2.SetTextSize(0.06);
5625 // pLegendpE2.SetHeader("dR < 0.02");
5626 // pLegendpE2.SetFillColor(10);
5627 // pLegendpE2.SetBorderSize(1);
5628 // pLegendpE2.Draw();
5630 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
5631 cmpoe->Print(name); printf("Plot: %s\n",name);
5635 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
5636 gROOT->ProcessLine(line);
5637 sprintf(line, ".!rm -fR *.eps");
5638 gROOT->ProcessLine(line);
5640 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());