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 //If Geometry library loaded, do geometry selection during analysis.
220 if(fCalorimeter=="PHOS"){
221 if(!GetReader()->GetPHOSGeometry()) printf("AliAnaCalorimeterQA::GetCreateOutputObjects() - Initialize PHOS geometry!\n");
222 GetReader()->InitPHOSGeometry();
226 if(fCalorimeter=="EMCAL"){
227 if(!GetReader()->GetEMCALGeometry()) printf("AliAnaCalorimeterQA::GetCreateOutputObjects() - Initialize EMCAL geometry!\n");
228 GetReader()->InitEMCALGeometry();
232 TList * outputContainer = new TList() ;
233 outputContainer->SetName("QAHistos") ;
236 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
237 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
238 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
239 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
240 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
241 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
242 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
243 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
244 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
245 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
246 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
247 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
248 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
249 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
250 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
251 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
252 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
259 if(fCalorimeter=="PHOS"){
266 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins,ptmin,ptmax);
267 fhE->SetXTitle("E (GeV)");
268 outputContainer->Add(fhE);
270 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
271 fhPt->SetXTitle("p_{T} (GeV/c)");
272 outputContainer->Add(fhPt);
274 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
275 fhPhi->SetXTitle("#phi (rad)");
276 outputContainer->Add(fhPhi);
278 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
279 fhEta->SetXTitle("#eta ");
280 outputContainer->Add(fhEta);
282 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
283 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
284 fhEtaPhiE->SetXTitle("#eta ");
285 fhEtaPhiE->SetYTitle("#phi (rad)");
286 fhEtaPhiE->SetZTitle("E (GeV) ");
287 outputContainer->Add(fhEtaPhiE);
289 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
290 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
291 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
292 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
293 outputContainer->Add(fhClusterTimeEnergy);
297 fhLambda = new TH3F ("hLambda","#lambda_{0}^{2} vs #lambda_{1}^{2} vs energy, reconstructed clusters",
298 ssbins,ssmin,ssmax,ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
299 fhLambda->SetXTitle("#lambda_{0}^{2} ");
300 fhLambda->SetYTitle("#lambda_{1}^{2} ");
301 fhLambda->SetZTitle("E (GeV) ");
302 outputContainer->Add(fhLambda);
304 fhDispersion = new TH2F ("hDispersion"," dispersion vs energy, reconstructed clusters",
305 ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
306 fhDispersion->SetXTitle("Dispersion ");
307 fhDispersion->SetYTitle("E (GeV) ");
308 outputContainer->Add(fhDispersion);
312 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
313 fhECharged->SetXTitle("E (GeV)");
314 outputContainer->Add(fhECharged);
316 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
317 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
318 outputContainer->Add(fhPtCharged);
320 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
321 fhPhiCharged->SetXTitle("#phi (rad)");
322 outputContainer->Add(fhPhiCharged);
324 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
325 fhEtaCharged->SetXTitle("#eta ");
326 outputContainer->Add(fhEtaCharged);
328 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
329 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
330 fhEtaPhiECharged->SetXTitle("#eta ");
331 fhEtaPhiECharged->SetYTitle("#phi ");
332 fhEtaPhiECharged->SetZTitle("E (GeV) ");
333 outputContainer->Add(fhEtaPhiECharged);
336 fhEChargedNoOut = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
337 fhEChargedNoOut->SetXTitle("E (GeV)");
338 outputContainer->Add(fhEChargedNoOut);
340 fhPtChargedNoOut = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
341 fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
342 outputContainer->Add(fhPtChargedNoOut);
344 fhPhiChargedNoOut = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax);
345 fhPhiChargedNoOut->SetXTitle("#phi (rad)");
346 outputContainer->Add(fhPhiChargedNoOut);
348 fhEtaChargedNoOut = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax);
349 fhEtaChargedNoOut->SetXTitle("#eta ");
350 outputContainer->Add(fhEtaChargedNoOut);
352 fhEtaPhiChargedNoOut = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);
353 fhEtaPhiChargedNoOut->SetXTitle("#eta ");
354 fhEtaPhiChargedNoOut->SetYTitle("#phi ");
355 outputContainer->Add(fhEtaPhiChargedNoOut);
357 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
358 fh1pOverE->SetYTitle("p/E");
359 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
360 outputContainer->Add(fh1pOverE);
362 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
363 fh1dR->SetXTitle("#Delta R (rad)");
364 outputContainer->Add(fh1dR) ;
366 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
367 fh2MatchdEdx->SetXTitle("p (GeV/c)");
368 fh2MatchdEdx->SetYTitle("<dE/dx>");
369 outputContainer->Add(fh2MatchdEdx);
371 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
372 fh2EledEdx->SetXTitle("p (GeV/c)");
373 fh2EledEdx->SetYTitle("<dE/dx>");
374 outputContainer->Add(fh2EledEdx) ;
376 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
377 fh1pOverER02->SetYTitle("p/E");
378 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
379 outputContainer->Add(fh1pOverER02);
381 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
382 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
383 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
384 outputContainer->Add(fhIM);
386 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
387 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
388 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
389 outputContainer->Add(fhIMCellCut);
391 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
392 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
393 fhAsym->SetYTitle("Asymmetry");
394 outputContainer->Add(fhAsym);
396 fhNCellsPerCluster = new TH3F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax, netabins,etamin,etamax);
397 fhNCellsPerCluster->SetXTitle("E (GeV)");
398 fhNCellsPerCluster->SetYTitle("n cells");
399 fhNCellsPerCluster->SetZTitle("#eta");
400 outputContainer->Add(fhNCellsPerCluster);
403 fhNCellsPerClusterMIP = new TH3F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
404 100,0.,1., 6,0,5,netabins,etamin,etamax);
405 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
406 fhNCellsPerClusterMIP->SetYTitle("n cells");
407 fhNCellsPerClusterMIP->SetZTitle("#eta");
408 outputContainer->Add(fhNCellsPerClusterMIP);
411 fhNCellsPerClusterMIPCharged = new TH3F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
412 100,0.,1., 6,0,5,netabins,etamin,etamax);
413 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
414 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
415 fhNCellsPerClusterMIPCharged->SetZTitle("#eta");
416 outputContainer->Add(fhNCellsPerClusterMIPCharged);
419 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
420 fhNClusters->SetXTitle("number of clusters");
421 outputContainer->Add(fhNClusters);
423 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax);
424 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
425 fhRNCells->SetYTitle("N cells per cluster");
426 outputContainer->Add(fhRNCells);
428 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax);
429 fhXNCells->SetXTitle("x (cm)");
430 fhXNCells->SetYTitle("N cells per cluster");
431 outputContainer->Add(fhXNCells);
433 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax);
434 fhYNCells->SetXTitle("y (cm)");
435 fhYNCells->SetYTitle("N cells per cluster");
436 outputContainer->Add(fhYNCells);
438 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax);
439 fhZNCells->SetXTitle("z (cm)");
440 fhZNCells->SetYTitle("N cells per cluster");
441 outputContainer->Add(fhZNCells);
443 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
444 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
445 fhRE->SetYTitle("E (GeV)");
446 outputContainer->Add(fhRE);
448 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
449 fhXE->SetXTitle("x (cm)");
450 fhXE->SetYTitle("E (GeV)");
451 outputContainer->Add(fhXE);
453 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
454 fhYE->SetXTitle("y (cm)");
455 fhYE->SetYTitle("E (GeV)");
456 outputContainer->Add(fhYE);
458 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
459 fhZE->SetXTitle("z (cm)");
460 fhZE->SetYTitle("E (GeV)");
461 outputContainer->Add(fhZE);
463 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
464 fhXYZ->SetXTitle("x (cm)");
465 fhXYZ->SetYTitle("y (cm)");
466 fhXYZ->SetZTitle("z (cm) ");
467 outputContainer->Add(fhXYZ);
469 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
470 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
471 fhRCellE->SetYTitle("E (GeV)");
472 outputContainer->Add(fhRCellE);
474 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
475 fhXCellE->SetXTitle("x (cm)");
476 fhXCellE->SetYTitle("E (GeV)");
477 outputContainer->Add(fhXCellE);
479 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
480 fhYCellE->SetXTitle("y (cm)");
481 fhYCellE->SetYTitle("E (GeV)");
482 outputContainer->Add(fhYCellE);
484 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
485 fhZCellE->SetXTitle("z (cm)");
486 fhZCellE->SetYTitle("E (GeV)");
487 outputContainer->Add(fhZCellE);
489 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
490 fhXYZCell->SetXTitle("x (cm)");
491 fhXYZCell->SetYTitle("y (cm)");
492 fhXYZCell->SetZTitle("z (cm)");
493 outputContainer->Add(fhXYZCell);
496 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
497 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
498 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
499 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
501 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax);
502 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
503 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
504 outputContainer->Add(fhDeltaCellClusterRNCells);
506 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax);
507 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
508 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
509 outputContainer->Add(fhDeltaCellClusterXNCells);
511 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax);
512 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
513 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
514 outputContainer->Add(fhDeltaCellClusterYNCells);
516 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax);
517 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
518 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
519 outputContainer->Add(fhDeltaCellClusterZNCells);
521 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
522 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
523 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
524 outputContainer->Add(fhDeltaCellClusterRE);
526 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
527 fhDeltaCellClusterXE->SetXTitle("x (cm)");
528 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
529 outputContainer->Add(fhDeltaCellClusterXE);
531 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
532 fhDeltaCellClusterYE->SetXTitle("y (cm)");
533 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
534 outputContainer->Add(fhDeltaCellClusterYE);
536 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
537 fhDeltaCellClusterZE->SetXTitle("z (cm)");
538 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
539 outputContainer->Add(fhDeltaCellClusterZE);
541 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
542 fhEtaPhiAmp->SetXTitle("#eta ");
543 fhEtaPhiAmp->SetYTitle("#phi (rad)");
544 fhEtaPhiAmp->SetZTitle("E (GeV) ");
545 outputContainer->Add(fhEtaPhiAmp);
549 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
550 fhNCells->SetXTitle("n cells");
551 outputContainer->Add(fhNCells);
553 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
554 fhAmplitude->SetXTitle("Cell Energy (GeV)");
555 outputContainer->Add(fhAmplitude);
557 fhAmpId = new TH2F ("hAmpId","Cell Energy", nptbins*2,ptmin,ptmax*2,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
558 fhAmpId->SetXTitle("Cell Energy (GeV)");
559 outputContainer->Add(fhAmpId);
562 //Cell Time histograms, time only available in ESDs
563 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
565 fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200);
566 fhCellTimeSpreadRespectToCellMax->SetXTitle("#Delta t (ns)");
567 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
569 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
570 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
571 outputContainer->Add(fhCellIdCellLargeTimeSpread);
573 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
574 fhTime->SetXTitle("Cell Time (ns)");
575 outputContainer->Add(fhTime);
577 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
578 fhTimeId->SetXTitle("Cell Time (ns)");
579 fhTimeId->SetYTitle("Cell Absolute Id");
580 outputContainer->Add(fhTimeId);
582 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
583 fhTimeAmp->SetYTitle("Cell Time (ns)");
584 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
585 outputContainer->Add(fhTimeAmp);
587 // fhT0Time = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax);
588 // fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
589 // outputContainer->Add(fhT0Time);
591 // fhT0TimeId = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
592 // fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
593 // fhT0TimeId->SetYTitle("Cell Absolute Id");
594 // outputContainer->Add(fhT0TimeId);
596 // fhT0TimeAmp = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
597 // fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
598 // fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
599 // outputContainer->Add(fhT0TimeAmp);
605 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
606 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
607 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
608 outputContainer->Add(fhCaloCorrNClusters);
610 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
611 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
612 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
613 outputContainer->Add(fhCaloCorrEClusters);
615 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
616 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
617 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
618 outputContainer->Add(fhCaloCorrNCells);
620 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
621 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
622 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
623 outputContainer->Add(fhCaloCorrECells);
624 }//correlate calorimeters
627 fhEMod = new TH1F*[fNModules];
628 fhNClustersMod = new TH1F*[fNModules];
629 fhNCellsPerClusterMod = new TH2F*[fNModules];
630 fhNCellsMod = new TH1F*[fNModules];
631 fhGridCellsMod = new TH2F*[fNModules];
632 fhGridCellsEMod = new TH2F*[fNModules];
633 fhGridCellsTimeMod = new TH2F*[fNModules];
634 fhAmplitudeMod = new TH1F*[fNModules];
635 if(fCalorimeter=="EMCAL")
636 fhAmplitudeModFraction = new TH1F*[fNModules*3];
638 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
639 //fhT0TimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
640 //fhTimeCorrRCU = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
642 fhIMMod = new TH2F*[fNModules];
643 fhIMCellCutMod = new TH2F*[fNModules];
645 for(Int_t imod = 0; imod < fNModules; imod++){
647 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
648 fhEMod[imod]->SetXTitle("E (GeV)");
649 outputContainer->Add(fhEMod[imod]);
651 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
652 fhNClustersMod[imod]->SetXTitle("number of clusters");
653 outputContainer->Add(fhNClustersMod[imod]);
655 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
656 Form("# cells per cluster vs cluster energy in Module %d",imod),
657 nptbins,ptmin,ptmax, nbins,nmin,nmax);
658 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
659 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
660 outputContainer->Add(fhNCellsPerClusterMod[imod]);
662 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
663 fhNCellsMod[imod]->SetXTitle("n cells");
664 outputContainer->Add(fhNCellsMod[imod]);
665 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
666 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
667 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
668 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
669 outputContainer->Add(fhGridCellsMod[imod]);
671 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
672 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
673 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
674 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
675 outputContainer->Add(fhGridCellsEMod[imod]);
677 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),
678 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
679 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)");
680 fhGridCellsTimeMod[imod]->SetXTitle("column (eta direction)");
681 outputContainer->Add(fhGridCellsTimeMod[imod]);
683 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
684 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
685 outputContainer->Add(fhAmplitudeMod[imod]);
687 if(fCalorimeter == "EMCAL"){
688 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
689 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);
690 fhAmplitudeModFraction[imod*3+ifrac]->SetXTitle("E (GeV)");
691 outputContainer->Add(fhAmplitudeModFraction[imod*3+ifrac]);
696 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
697 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
698 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
699 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
700 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
701 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
702 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
704 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
705 // Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu),
706 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
707 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
708 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
709 // outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
712 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
713 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
714 // Int_t index = (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod;
715 // fhTimeCorrRCU[index] = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
716 // Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
717 // ntimebins,timemin,timemax,ntimebins,timemin,timemax);
718 // fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
719 // fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
720 // outputContainer->Add(fhTimeCorrRCU[index]);
726 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
727 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
728 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
729 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
730 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
731 outputContainer->Add(fhIMMod[imod]);
733 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
734 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
735 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
736 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
737 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
738 outputContainer->Add(fhIMCellCutMod[imod]);
743 //Monte Carlo Histograms
746 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
747 fhDeltaE->SetXTitle("#Delta E (GeV)");
748 outputContainer->Add(fhDeltaE);
750 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
751 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
752 outputContainer->Add(fhDeltaPt);
754 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
755 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
756 outputContainer->Add(fhDeltaPhi);
758 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
759 fhDeltaEta->SetXTitle("#Delta #eta ");
760 outputContainer->Add(fhDeltaEta);
762 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
763 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
764 outputContainer->Add(fhRatioE);
766 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
767 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
768 outputContainer->Add(fhRatioPt);
770 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
771 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
772 outputContainer->Add(fhRatioPhi);
774 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
775 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
776 outputContainer->Add(fhRatioEta);
778 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
779 fh2E->SetXTitle("E_{rec} (GeV)");
780 fh2E->SetYTitle("E_{gen} (GeV)");
781 outputContainer->Add(fh2E);
783 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
784 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
785 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
786 outputContainer->Add(fh2Pt);
788 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
789 fh2Phi->SetXTitle("#phi_{rec} (rad)");
790 fh2Phi->SetYTitle("#phi_{gen} (rad)");
791 outputContainer->Add(fh2Phi);
793 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
794 fh2Eta->SetXTitle("#eta_{rec} ");
795 fh2Eta->SetYTitle("#eta_{gen} ");
796 outputContainer->Add(fh2Eta);
798 //Fill histos depending on origin of cluster
799 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
800 fhGamE->SetXTitle("E_{rec} (GeV)");
801 fhGamE->SetXTitle("E_{gen} (GeV)");
802 outputContainer->Add(fhGamE);
804 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
805 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
806 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
807 outputContainer->Add(fhGamPt);
809 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
810 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
811 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
812 outputContainer->Add(fhGamPhi);
814 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
815 fhGamEta->SetXTitle("#eta_{rec} ");
816 fhGamEta->SetYTitle("#eta_{gen} ");
817 outputContainer->Add(fhGamEta);
819 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
820 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
821 outputContainer->Add(fhGamDeltaE);
823 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
824 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
825 outputContainer->Add(fhGamDeltaPt);
827 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
828 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
829 outputContainer->Add(fhGamDeltaPhi);
831 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
832 fhGamDeltaEta->SetXTitle("#Delta #eta ");
833 outputContainer->Add(fhGamDeltaEta);
835 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
836 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
837 outputContainer->Add(fhGamRatioE);
839 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
840 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
841 outputContainer->Add(fhGamRatioPt);
843 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
844 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
845 outputContainer->Add(fhGamRatioPhi);
847 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
848 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
849 outputContainer->Add(fhGamRatioEta);
851 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
852 fhPi0E->SetXTitle("E_{rec} (GeV)");
853 fhPi0E->SetYTitle("E_{gen} (GeV)");
854 outputContainer->Add(fhPi0E);
856 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
857 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
858 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
859 outputContainer->Add(fhPi0Pt);
861 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
862 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
863 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
864 outputContainer->Add(fhPi0Phi);
866 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
867 fhPi0Eta->SetXTitle("#eta_{rec} ");
868 fhPi0Eta->SetYTitle("#eta_{gen} ");
869 outputContainer->Add(fhPi0Eta);
871 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
872 fhEleE->SetXTitle("E_{rec} (GeV)");
873 fhEleE->SetXTitle("E_{gen} (GeV)");
874 outputContainer->Add(fhEleE);
876 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
877 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
878 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
879 outputContainer->Add(fhElePt);
881 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
882 fhElePhi->SetXTitle("#phi_{rec} (rad)");
883 fhElePhi->SetYTitle("#phi_{gen} (rad)");
884 outputContainer->Add(fhElePhi);
886 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
887 fhEleEta->SetXTitle("#eta_{rec} ");
888 fhEleEta->SetYTitle("#eta_{gen} ");
889 outputContainer->Add(fhEleEta);
891 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
892 fhNeHadE->SetXTitle("E_{rec} (GeV)");
893 fhNeHadE->SetYTitle("E_{gen} (GeV)");
894 outputContainer->Add(fhNeHadE);
896 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
897 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
898 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
899 outputContainer->Add(fhNeHadPt);
901 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
902 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
903 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
904 outputContainer->Add(fhNeHadPhi);
906 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
907 fhNeHadEta->SetXTitle("#eta_{rec} ");
908 fhNeHadEta->SetYTitle("#eta_{gen} ");
909 outputContainer->Add(fhNeHadEta);
911 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
912 fhChHadE->SetXTitle("E_{rec} (GeV)");
913 fhChHadE->SetYTitle("E_{gen} (GeV)");
914 outputContainer->Add(fhChHadE);
916 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
917 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
918 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
919 outputContainer->Add(fhChHadPt);
921 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
922 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
923 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
924 outputContainer->Add(fhChHadPhi);
926 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
927 fhChHadEta->SetXTitle("#eta_{rec} ");
928 fhChHadEta->SetYTitle("#eta_{gen} ");
929 outputContainer->Add(fhChHadEta);
933 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
934 fhGamECharged->SetXTitle("E_{rec} (GeV)");
935 fhGamECharged->SetXTitle("E_{gen} (GeV)");
936 outputContainer->Add(fhGamECharged);
938 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
939 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
940 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
941 outputContainer->Add(fhGamPtCharged);
943 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
944 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
945 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
946 outputContainer->Add(fhGamPhiCharged);
948 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
949 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
950 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
951 outputContainer->Add(fhGamEtaCharged);
953 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
954 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
955 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
956 outputContainer->Add(fhPi0ECharged);
958 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
959 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
960 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
961 outputContainer->Add(fhPi0PtCharged);
963 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
964 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
965 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
966 outputContainer->Add(fhPi0PhiCharged);
968 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
969 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
970 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
971 outputContainer->Add(fhPi0EtaCharged);
973 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
974 fhEleECharged->SetXTitle("E_{rec} (GeV)");
975 fhEleECharged->SetXTitle("E_{gen} (GeV)");
976 outputContainer->Add(fhEleECharged);
978 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
979 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
980 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
981 outputContainer->Add(fhElePtCharged);
983 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
984 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
985 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
986 outputContainer->Add(fhElePhiCharged);
988 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
989 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
990 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
991 outputContainer->Add(fhEleEtaCharged);
993 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
994 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
995 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
996 outputContainer->Add(fhNeHadECharged);
998 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
999 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1000 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1001 outputContainer->Add(fhNeHadPtCharged);
1003 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1004 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1005 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1006 outputContainer->Add(fhNeHadPhiCharged);
1008 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1009 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
1010 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
1011 outputContainer->Add(fhNeHadEtaCharged);
1013 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1014 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
1015 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
1016 outputContainer->Add(fhChHadECharged);
1018 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1019 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1020 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1021 outputContainer->Add(fhChHadPtCharged);
1023 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1024 fhChHadPhiCharged->SetXTitle("#phi (rad)");
1025 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1026 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1027 outputContainer->Add(fhChHadPhiCharged);
1029 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1030 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
1031 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
1032 outputContainer->Add(fhChHadEtaCharged);
1034 //Vertex of generated particles
1036 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1037 fhEMVxyz->SetXTitle("v_{x}");
1038 fhEMVxyz->SetYTitle("v_{y}");
1039 //fhEMVxyz->SetZTitle("v_{z}");
1040 outputContainer->Add(fhEMVxyz);
1042 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1043 fhHaVxyz->SetXTitle("v_{x}");
1044 fhHaVxyz->SetYTitle("v_{y}");
1045 //fhHaVxyz->SetZTitle("v_{z}");
1046 outputContainer->Add(fhHaVxyz);
1048 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1049 fhEMR->SetXTitle("E (GeV)");
1050 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1051 outputContainer->Add(fhEMR);
1053 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1054 fhHaR->SetXTitle("E (GeV)");
1055 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1056 outputContainer->Add(fhHaR);
1061 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
1062 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
1063 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
1065 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
1066 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
1067 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
1069 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
1070 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
1071 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
1073 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
1074 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
1075 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
1077 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
1078 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
1079 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
1081 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
1082 fhGenGamEta->SetXTitle("#eta");
1083 fhGenGamPhi->SetXTitle("#phi (rad)");
1084 outputContainer->Add(fhGenGamPt);
1085 outputContainer->Add(fhGenGamEta);
1086 outputContainer->Add(fhGenGamPhi);
1088 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
1089 fhGenPi0Eta->SetXTitle("#eta");
1090 fhGenPi0Phi->SetXTitle("#phi (rad)");
1091 outputContainer->Add(fhGenPi0Pt);
1092 outputContainer->Add(fhGenPi0Eta);
1093 outputContainer->Add(fhGenPi0Phi);
1095 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
1096 fhGenEtaEta->SetXTitle("#eta");
1097 fhGenEtaPhi->SetXTitle("#phi (rad)");
1098 outputContainer->Add(fhGenEtaPt);
1099 outputContainer->Add(fhGenEtaEta);
1100 outputContainer->Add(fhGenEtaPhi);
1102 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
1103 fhGenOmegaEta->SetXTitle("#eta");
1104 fhGenOmegaPhi->SetXTitle("#phi (rad)");
1105 outputContainer->Add(fhGenOmegaPt);
1106 outputContainer->Add(fhGenOmegaEta);
1107 outputContainer->Add(fhGenOmegaPhi);
1109 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
1110 fhGenEleEta->SetXTitle("#eta");
1111 fhGenElePhi->SetXTitle("#phi (rad)");
1112 outputContainer->Add(fhGenElePt);
1113 outputContainer->Add(fhGenEleEta);
1114 outputContainer->Add(fhGenElePhi);
1116 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1117 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1118 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
1119 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
1121 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1122 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1123 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
1124 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
1126 fhGenGamAccE ->SetXTitle("E (GeV)");
1127 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
1128 fhGenGamAccEta->SetXTitle("#eta");
1129 fhGenGamAccPhi->SetXTitle("#phi (rad)");
1130 outputContainer->Add(fhGenGamAccE);
1131 outputContainer->Add(fhGenGamAccPt);
1132 outputContainer->Add(fhGenGamAccEta);
1133 outputContainer->Add(fhGenGamAccPhi);
1135 fhGenPi0AccE ->SetXTitle("E (GeV)");
1136 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
1137 fhGenPi0AccEta->SetXTitle("#eta");
1138 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
1139 outputContainer->Add(fhGenPi0AccE);
1140 outputContainer->Add(fhGenPi0AccPt);
1141 outputContainer->Add(fhGenPi0AccEta);
1142 outputContainer->Add(fhGenPi0AccPhi);
1146 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1147 fhMCEle1pOverE->SetYTitle("p/E");
1148 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1149 outputContainer->Add(fhMCEle1pOverE);
1151 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
1152 fhMCEle1dR->SetXTitle("#Delta R (rad)");
1153 outputContainer->Add(fhMCEle1dR) ;
1155 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1156 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1157 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1158 outputContainer->Add(fhMCEle2MatchdEdx);
1160 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1161 fhMCChHad1pOverE->SetYTitle("p/E");
1162 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1163 outputContainer->Add(fhMCChHad1pOverE);
1165 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1166 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1167 outputContainer->Add(fhMCChHad1dR) ;
1169 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1170 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1171 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1172 outputContainer->Add(fhMCChHad2MatchdEdx);
1174 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1175 fhMCNeutral1pOverE->SetYTitle("p/E");
1176 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1177 outputContainer->Add(fhMCNeutral1pOverE);
1179 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1180 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1181 outputContainer->Add(fhMCNeutral1dR) ;
1183 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1184 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1185 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1186 outputContainer->Add(fhMCNeutral2MatchdEdx);
1188 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1189 fhMCEle1pOverER02->SetYTitle("p/E");
1190 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1191 outputContainer->Add(fhMCEle1pOverER02);
1193 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1194 fhMCChHad1pOverER02->SetYTitle("p/E");
1195 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1196 outputContainer->Add(fhMCChHad1pOverER02);
1198 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1199 fhMCNeutral1pOverER02->SetYTitle("p/E");
1200 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1201 outputContainer->Add(fhMCNeutral1pOverER02);
1204 return outputContainer;
1207 //____________________________________________________________________________________________________________________________________________________
1208 Int_t AliAnaCalorimeterQA::GetModuleNumber(AliESDCaloCluster * cluster)
1210 //Get the EMCAL/PHOS module number that corresponds to this cluster
1212 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
1213 cluster->GetMomentum(lv,v);
1214 Float_t phi = lv.Phi();
1215 if(phi < 0) phi+=TMath::TwoPi();
1217 if(fCalorimeter=="EMCAL"){
1218 GetReader()->GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
1220 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
1221 lv.Eta(), phi*TMath::RadToDeg(),absId, GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId));
1222 return GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId) ;
1226 if ( cluster->GetNCells() > 0) {
1227 absId = cluster->GetCellAbsId(0);
1229 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
1230 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
1235 (GetReader()->GetPHOSGeometry())->AbsToRelNumbering(absId,relId);
1237 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - PHOS: Module %d\n",relId[0]-1);
1246 //____________________________________________________________________________________________________________________________________________________
1247 Int_t AliAnaCalorimeterQA::GetModuleNumber(AliAODCaloCluster * cluster)
1249 //Get the EMCAL/PHOS module number that corresponds to this cluster
1251 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
1252 cluster->GetMomentum(lv,v);
1253 Float_t phi = lv.Phi();
1254 if(phi < 0) phi+=TMath::TwoPi();
1256 if(fCalorimeter=="EMCAL"){
1257 GetReader()->GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
1259 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
1260 lv.Eta(), phi*TMath::RadToDeg(),absId, GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId));
1261 return GetReader()->GetEMCALGeometry()->GetSuperModuleNumber(absId) ;
1265 if ( cluster->GetNCells() > 0) {
1266 absId = cluster->GetCellAbsId(0);
1268 printf("AliAnaCalorimeterQA::GetModuleNumber(AOD) - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
1269 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
1274 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1276 printf("AliAnaCalorimeterQA::GetModuleNumber(AOD) - PHOS: Module %d\n",relId[0]-1);
1285 //_____________________________________________________________________________________________________________
1286 Int_t AliAnaCalorimeterQA::GetModuleNumberCellIndexes(const Int_t absId, Int_t & icol, Int_t & irow, Int_t & iRCU)
1288 //Get the EMCAL/PHOS module, columns, row and RCU number that corresponds to this absId
1291 if(fCalorimeter=="EMCAL"){
1292 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1293 GetReader()->GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1294 GetReader()->GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1295 iIphi, iIeta,irow,icol);
1298 if (0<=irow&&irow<8) iRCU=0; // first cable row
1299 else if (8<=irow&&irow<16 && 0<=icol&&icol<24) iRCU=0; // first half;
1302 else if(8<=irow&&irow<16 && 24<=icol&&icol<48) iRCU=1; // second half;
1304 else if(16<=irow&&irow<24) iRCU=1; // third cable row
1306 if (imod%2==1) iRCU = 1 - iRCU; // swap for odd=C side, to allow us to cable both sides the same
1308 printf("AliAnaCalorimeterQA - Wrong EMCAL RCU number = %d\n", iRCU);
1316 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1320 iRCU= (Int_t)(relId[2]-1)/16 ;
1321 //Int_t iBranch= (Int_t)(relid[3]-1)/28 ; //0 to 1
1322 if (iRCU >= fNRCU) {
1323 printf("AliAnaCalorimeterQA - Wrong PHOS RCU number = %d\n", iRCU);
1333 //_______________________________________________________________________________________________________________________________________
1334 Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
1336 //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
1337 Float_t oldbinsize = histo->GetBinWidth(0);
1338 Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
1339 //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
1340 if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
1344 //__________________________________________________
1345 void AliAnaCalorimeterQA::Init()
1347 //Check if the data or settings are ok
1348 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1349 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1353 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1354 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1361 //__________________________________________________
1362 void AliAnaCalorimeterQA::InitParameters()
1364 //Initialize the parameters of the analysis.
1365 AddToHistogramsName("AnaCaloQA_");
1367 fCalorimeter = "EMCAL"; //or PHOS
1369 fNModules = 12; // set maximum to maximum number of EMCAL modules
1370 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
1372 fTimeCutMax = 9999999;
1374 fHistoPOverEBins = 100 ; fHistoPOverEMax = 10. ; fHistoPOverEMin = 0. ;
1375 fHistodEdxBins = 200 ; fHistodEdxMax = 400. ; fHistodEdxMin = 0. ;
1376 fHistodRBins = 300 ; fHistodRMax = 3.15 ; fHistodRMin = 0. ;
1377 fHistoTimeBins = 1000; fHistoTimeMax = 1.e3 ; fHistoTimeMin = 0. ;//ns
1378 fHistoNBins = 300 ; fHistoNMax = 300 ; fHistoNMin = 0 ;
1379 fHistoRatioBins = 200 ; fHistoRatioMax = 2 ; fHistoRatioMin = 0. ;
1380 fHistoVertexDistBins = 100 ; fHistoVertexDistMax = 500. ; fHistoVertexDistMin = 0. ;
1381 fHistoRBins = 100 ; fHistoRMax = 500 ; fHistoRMin = -500 ;//cm
1382 fHistoXBins = 100 ; fHistoXMax = 500 ; fHistoXMin = -500 ;//cm
1383 fHistoYBins = 100 ; fHistoYMax = 500 ; fHistoYMin = -500 ;//cm
1384 fHistoZBins = 100 ; fHistoZMax = 600 ; fHistoZMin = -500 ;//cm
1385 fHistoSSBins = 40 ; fHistoSSMax = 10 ; fHistoSSMin = 0 ;
1389 //__________________________________________________________________
1390 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1392 //Print some relevant parameters set for the analysis
1396 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1397 AliAnaPartCorrBaseClass::Print(" ");
1399 printf("Select Calorimeter %s \n",fCalorimeter.Data());
1400 printf("Make plots? %d \n",fMakePlots);
1401 printf("Plots style macro %s \n",fStyleMacro.Data());
1402 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
1403 printf("Histograms: %3.1f < p/E < %3.1f, Nbin = %d\n", fHistoPOverEMin, fHistoPOverEMax, fHistoPOverEBins);
1404 printf("Histograms: %3.1f < dEdx < %3.1f, Nbin = %d\n", fHistodEdxMin, fHistodEdxMax, fHistodEdxBins);
1405 printf("Histograms: %3.1f < dR (track cluster) < %3.1f, Nbin = %d\n", fHistodRMin, fHistodRMax, fHistodRBins);
1406 printf("Histograms: %3.1f < R=sqrt{x^2+y^2} < %3.1f, Nbin = %d\n", fHistoRMin, fHistoRMax, fHistoRBins);
1407 printf("Histograms: %3.1f < X < %3.1f, Nbin = %d\n", fHistoXMin, fHistoXMax, fHistoXBins);
1408 printf("Histograms: %3.1f < Y < %3.1f, Nbin = %d\n", fHistoYMin, fHistoYMax, fHistoYBins);
1409 printf("Histograms: %3.1f < Z < %3.1f, Nbin = %d\n", fHistoZMin, fHistoZMax, fHistoZBins);
1410 printf("Histograms: %g < Time < %g, Nbin = %d\n" , fHistoTimeMin, fHistoTimeMax, fHistoTimeBins);
1411 printf("Histograms: %d < N < %d, Nbin = %d\n" , fHistoNMin, fHistoNMax, fHistoNBins);
1412 printf("Histograms: %3.1f < Ratio< %3.1f, Nbin = %d\n", fHistoRatioMin, fHistoRatioMax, fHistoRatioBins);
1413 printf("Histograms: %3.1f < Vertex Distance < %3.1f, Nbin = %d\n", fHistoVertexDistMin, fHistoVertexDistMax, fHistoVertexDistBins);
1417 //__________________________________________________________________
1418 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1420 //Fill Calorimeter QA histograms
1421 TLorentzVector mom ;
1422 TLorentzVector mom2 ;
1423 TRefArray * caloClusters = new TRefArray();
1426 Int_t nCaloClusters = 0;
1427 Int_t nCaloCellsPerCluster = 0;
1428 Int_t nTracksMatched = 0;
1429 Int_t trackIndex = 0;
1432 //Play with the MC stack if available
1433 //Get the MC arrays and do some checks
1435 if(GetReader()->ReadStack()){
1438 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1441 //Fill some pure MC histograms, only primaries.
1442 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1443 TParticle *primary = GetMCStack()->Particle(i) ;
1444 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1445 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1446 primary->Momentum(mom);
1447 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1450 else if(GetReader()->ReadAODMCParticles()){
1452 if(!GetReader()->GetAODMCParticles(0)) {
1453 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1456 //Fill some pure MC histograms, only primaries.
1457 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1458 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1459 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1460 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1461 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1462 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1463 //aodprimary->Momentum(mom);
1464 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1465 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1472 //Get List with CaloClusters
1474 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1475 if (fCalorimeter == "EMCAL") ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1476 else if(fCalorimeter == "PHOS") ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1478 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1482 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1483 if (fCalorimeter == "EMCAL") ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1484 else if(fCalorimeter == "PHOS") ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1486 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1492 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n");
1496 //----------------------------------------------------------
1497 //Correlate Calorimeters
1498 //----------------------------------------------------------
1499 if(fCorrelateCalos) CorrelateCalorimeters(caloClusters);
1502 //----------------------------------------------------------
1504 //----------------------------------------------------------
1506 nCaloClusters = caloClusters->GetEntriesFast() ;
1507 fhNClusters->Fill(nCaloClusters);
1508 Int_t *nClustersInModule = new Int_t[fNModules];
1509 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1512 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1514 //Get vertex for photon momentum calculation
1515 Double_t v[3] = {0,0,0}; //vertex ;
1516 GetReader()->GetVertex(v);
1517 TObject * track = 0x0;
1520 Float_t showerShape[3] ;
1522 //Loop over CaloClusters
1523 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1524 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1526 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1527 iclus+1,nCaloClusters,GetReader()->GetDataType());
1529 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1530 AliESDCaloCluster* clus = (AliESDCaloCluster*) (caloClusters->At(iclus));
1532 //Check if the cluster contains any bad channel
1533 if(GetReader()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue;
1535 //Get cluster kinematics
1536 clus->GetPosition(pos);
1537 clus->GetMomentum(mom,v);
1538 tof = clus->GetTOF()*1e9;
1539 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1541 //Check only certain regions
1543 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1545 //Get module of cluster
1546 nModule = GetModuleNumber(clus);
1547 if(nModule < fNModules) nClustersInModule[nModule]++;
1549 nLabel = clus->GetNLabels();
1550 if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray();
1552 nCaloCellsPerCluster = clus->GetNCells();
1553 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1554 //matched cluster with tracks
1555 nTracksMatched = clus->GetNTracksMatched();
1556 trackIndex = clus->GetTrackMatched();
1557 if(trackIndex >= 0){
1558 track = (AliESDtrack*) ((AliESDEvent*)GetReader()->GetInputEvent())->GetTrack(trackIndex);
1561 if(nTracksMatched == 1) nTracksMatched = 0;
1565 //Shower shape parameters
1566 showerShape[0] = clus->GetM20();
1567 showerShape[1] = clus->GetM02();
1568 showerShape[2] = clus->GetClusterDisp();
1570 //======================
1572 //======================
1575 AliESDCaloCells * cell = 0x0;
1576 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1577 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1578 //Get list of contributors
1579 UShort_t * indexList = clus->GetCellsAbsId() ;
1580 // check time of cells respect to max energy cell
1581 //Get maximum energy cell
1586 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1587 //Loop on cluster cells
1588 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1589 // printf("Index %d\n",ipos);
1590 absId = indexList[ipos];
1592 //Get position of cell compare to cluster
1593 if(fCalorimeter=="EMCAL" && GetReader()->IsEMCALGeoMatrixSet()){
1595 Double_t cellpos[] = {0, 0, 0};
1596 GetReader()->GetEMCALGeometry()->GetGlobal(absId, cellpos);
1598 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1599 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1600 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1602 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1603 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1604 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1606 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1607 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1608 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1609 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1611 // Float_t celleta = 0, cellphi = 0;
1612 // GetReader()->GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi);
1613 // Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
1614 // GetReader()->GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1615 // GetReader()->GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1616 // iIphi, iIeta,iphi,ieta);
1617 // printf("AbsId %d, SM %d, Index eta %d, phi %d\n", absId, imod, ieta, iphi);
1618 // 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());
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);
1625 }//EMCAL and its matrices are available
1626 else if(fCalorimeter=="PHOS" && GetReader()->IsPHOSGeoMatrixSet()){
1628 Int_t relId[4], module;
1629 Float_t xCell, zCell;
1631 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1633 GetReader()->GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1634 GetReader()->GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1636 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1637 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1638 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1640 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1641 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1642 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1644 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1645 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1646 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1647 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1649 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1650 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1651 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1652 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1653 }//PHOS and its matrices are available
1655 //Find maximum energy cluster
1656 if(cell->GetCellAmplitude(absId) > emax) {
1658 emax = cell->GetCellAmplitude(absId);
1659 tmax = cell->GetCellTime(absId);
1662 }// cluster cell loop
1664 // check time of cells respect to max energy cell
1665 if(nCaloCellsPerCluster > 1){
1666 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1667 if(imax == ipos) continue;
1668 absId = indexList[ipos];
1669 Float_t diff = (tmax-cell->GetCellTime(absId))*1e9;
1670 fhCellTimeSpreadRespectToCellMax->Fill(diff);
1671 if(TMath::Abs(TMath::Abs(diff) > 100)) fhCellIdCellLargeTimeSpread->Fill(absId);
1672 }// fill cell-cluster histogram loop
1674 }//check time of cells respect to max energy cell
1679 AliAODCaloCluster* clus = (AliAODCaloCluster*) (caloClusters->At(iclus));
1681 //Check if the cluster contains any bad channel
1682 if(GetReader()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue;
1684 //Get cluster kinematics
1685 clus->GetPosition(pos);
1686 clus->GetMomentum(mom,v);
1687 tof = clus->GetTOF()*1e9;
1688 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1690 //Check only certain regions
1692 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1694 //Get module of cluster
1695 nModule = GetModuleNumber(clus);
1696 if(nModule < fNModules) nClustersInModule[nModule]++;
1698 nLabel = clus->GetNLabel();
1699 if(clus->GetLabels()) labels = clus->GetLabels();
1701 nCaloCellsPerCluster = clus->GetNCells();
1702 //matched cluster with tracks
1703 nTracksMatched = clus->GetNTracksMatched();
1704 if(nTracksMatched > 0)
1705 track = (AliAODTrack*)clus->GetTrackMatched(0);
1707 //Shower shape parameters
1708 showerShape[0] = clus->GetM20();
1709 showerShape[1] = clus->GetM02();
1710 showerShape[2] = clus->GetDispersion();
1712 //======================
1714 //======================
1716 AliAODCaloCells * cell = 0x0;
1717 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1718 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1720 //Get list of contributors
1721 UShort_t * indexList = clus->GetCellsAbsId() ;
1723 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1724 //Loop on cluster cells
1725 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1726 // printf("Index %d\n",ipos);
1727 absId = indexList[ipos];
1729 //Get position of cell compare to cluster
1730 if(fCalorimeter=="EMCAL" && GetReader()->IsEMCALGeoMatrixSet()){
1732 Double_t cellpos[] = {0, 0, 0};
1733 GetReader()->GetEMCALGeometry()->GetGlobal(absId, cellpos);
1735 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1736 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1737 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1739 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1740 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1741 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1743 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1744 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1745 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1746 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1748 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1749 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1750 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1751 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1753 }// EMCAL and its matrices are available
1754 else if(fCalorimeter=="PHOS" && GetReader()->IsPHOSGeoMatrixSet()){
1756 Int_t relId[4], module;
1757 Float_t xCell, zCell;
1759 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1761 GetReader()->GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1762 GetReader()->GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1764 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1765 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1766 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1768 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1769 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1770 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1772 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1773 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1774 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1775 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1777 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1778 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1779 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1780 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1782 } //PHOS and its matrices are available
1783 }// cluster cell loop
1787 //-----------------------------------------------------------
1788 //Fill histograms related to single cluster or track matching
1789 //-----------------------------------------------------------
1791 ClusterHistograms(mom, tof, pos, showerShape, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1794 //-----------------------------------------------------------
1796 //-----------------------------------------------------------
1797 if(GetDebug()>1) printf("Invariant mass \n");
1799 //do not do for bad vertex
1800 Float_t fZvtxCut = 40. ;
1801 if(v[2]<-fZvtxCut || v[2]> fZvtxCut) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
1803 Int_t nModule2 = -1;
1804 Int_t nCaloCellsPerCluster2=0;
1805 if (nCaloClusters > 1 ) {
1806 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1807 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1808 AliESDCaloCluster* clus2 = (AliESDCaloCluster*) (caloClusters->At(jclus));
1809 //Check if the cluster contains any bad channel
1810 if(GetReader()->ClusterContainsBadChannel(fCalorimeter,clus2->GetCellsAbsId(), clus2->GetNCells())) continue;
1811 //Get cluster kinematics
1812 clus2->GetMomentum(mom2,v);
1813 //Check only certain regions
1815 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1817 //Get module of cluster
1818 nModule2 = GetModuleNumber(clus2);
1820 nCaloCellsPerCluster2 = clus2->GetNCells();
1823 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD){
1824 AliAODCaloCluster* clus2 = (AliAODCaloCluster*) (caloClusters->At(jclus));
1825 //Check if the cluster contains any bad channel
1826 if(GetReader()->ClusterContainsBadChannel(fCalorimeter,clus2->GetCellsAbsId(), clus2->GetNCells())) continue;
1827 //Get cluster kinematics
1828 clus2->GetMomentum(mom2,v);
1829 //Check only certain regions
1831 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1833 //Get module of cluster
1834 nModule2 = GetModuleNumber(clus2);
1836 nCaloCellsPerCluster2 = clus2->GetNCells();
1839 //Fill invariant mass histograms
1842 //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());
1843 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1845 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1846 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1848 //Select only clusters with at least 2 cells
1849 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1851 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1853 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1854 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1857 //Asymetry histograms
1858 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1860 }// 2nd cluster loop
1861 }////more than 1 cluster in calorimeter
1864 //Number of clusters per module
1865 for(Int_t imod = 0; imod < fNModules; imod++ ){
1867 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1868 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1870 delete [] nClustersInModule;
1871 delete caloClusters;
1873 //----------------------------------------------------------
1875 //----------------------------------------------------------
1877 Int_t *nCellsInModule = new Int_t[fNModules];
1878 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1885 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1886 AliESDCaloCells * cell = 0x0;
1888 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1889 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1892 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s ESD CELLS available for analysis\n",fCalorimeter.Data());
1896 ncells = cell->GetNumberOfCells() ;
1897 fhNCells->Fill(ncells) ;
1899 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1901 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1902 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1903 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell), icol, irow, iRCU);
1904 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1906 if(nModule < fNModules) {
1907 //Check if the cell is a bad channel
1908 if(GetReader()->IsBadChannelsRemovalSwitchedOn()){
1909 if(fCalorimeter=="EMCAL"){
1910 if(GetReader()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1913 if(GetReader()->GetPHOSChannelStatus(nModule,icol,irow)) continue;
1916 amp = cell->GetAmplitude(iCell);
1917 time = cell->GetTime(iCell)*1e9;//transform time to ns
1918 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1920 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1921 id = cell->GetCellNumber(iCell);
1922 fhAmplitude->Fill(amp);
1923 fhAmpId ->Fill(amp,id);
1924 fhTime ->Fill(time);
1925 fhTimeId ->Fill(time,id);
1926 fhTimeAmp ->Fill(amp,time);
1927 //Double_t t0 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0();
1928 //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0,
1929 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0zVertex(),
1930 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0clock(),
1931 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0Trig());
1932 //fhT0Time ->Fill(time-t0);
1933 //fhT0TimeId ->Fill(time-t0,id);
1934 //fhT0TimeAmp ->Fill(amp,time-t0);
1936 fhAmplitudeMod[nModule]->Fill(amp);
1937 if(fCalorimeter=="EMCAL"){
1939 if(icol > 15 && icol < 32) ifrac = 1;
1940 else if(icol > 31) ifrac = 2;
1941 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
1946 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
1947 //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
1948 //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
1949 nCellsInModule[nModule]++;
1950 fhGridCellsMod[nModule] ->Fill(icol,irow);
1951 fhGridCellsEMod[nModule] ->Fill(icol,irow,amp);
1953 fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
1955 // AliESDCaloCells * cell2 = 0x0;
1956 // if(fCalorimeter == "PHOS") cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1957 // else cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1958 // Int_t icol2 = -1;
1959 // Int_t irow2 = -1;
1960 // Int_t iRCU2 = -1;
1961 // Float_t amp2 = 0.;
1962 // Float_t time2 = 0.;
1964 // Int_t nModule2 = -1;
1965 // for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {
1966 // amp2 = cell2->GetAmplitude(iCell2);
1967 // if(amp2 < 0.3) continue;
1968 // if(iCell2 == iCell) continue;
1969 // time2 = cell2->GetTime(iCell2)*1e9;//transform time to ns
1970 // //printf("%s: time %g\n",fCalorimeter.Data(), time);
1971 // id2 = cell2->GetCellNumber(iCell2);
1972 // nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), icol2, irow2, iRCU2);
1973 // Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule);
1974 // //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());
1975 // fhTimeCorrRCU[index]->Fill(time,time2);
1977 // }// second cell loop
1981 //Get Eta-Phi position of Cell
1982 if(fCalorimeter=="EMCAL" && GetReader()->IsEMCALGeoMatrixSet()){
1983 Float_t celleta = 0.;
1984 Float_t cellphi = 0.;
1985 GetReader()->GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1986 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1988 Double_t cellpos[] = {0, 0, 0};
1989 GetReader()->GetEMCALGeometry()->GetGlobal(id, cellpos);
1990 fhXCellE->Fill(cellpos[0],amp) ;
1991 fhYCellE->Fill(cellpos[1],amp) ;
1992 fhZCellE->Fill(cellpos[2],amp) ;
1993 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1994 fhRCellE->Fill(rcell,amp) ;
1996 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1998 else if(fCalorimeter=="PHOS" && GetReader()->IsPHOSGeoMatrixSet()){
2000 Int_t relId[4], module;
2001 Float_t xCell, zCell;
2003 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(id,relId);
2005 GetReader()->GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
2006 GetReader()->GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
2007 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
2008 fhXCellE ->Fill(xyz.X(),amp) ;
2009 fhYCellE ->Fill(xyz.Y(),amp) ;
2010 fhZCellE ->Fill(xyz.Z(),amp) ;
2011 fhRCellE ->Fill(rcell ,amp) ;
2012 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
2018 AliAODCaloCells * cell = 0x0;
2021 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2022 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2025 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s AOD CELLS available for analysis\n",fCalorimeter.Data());
2030 ncells = cell->GetNumberOfCells() ;
2031 fhNCells->Fill(ncells) ;
2033 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In AOD %s cell entries %d\n", fCalorimeter.Data(), ncells);
2035 for (Int_t iCell = 0; iCell < ncells; iCell++) {
2036 id = cell->GetCellNumber(iCell);
2037 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), id);
2038 nModule = GetModuleNumberCellIndexes(id, icol, irow, iRCU);
2039 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
2041 if(nModule < fNModules) {
2042 //Check if the cell is a bad channel
2043 if(GetReader()->IsBadChannelsRemovalSwitchedOn()){
2044 if(fCalorimeter=="EMCAL"){
2045 if(GetReader()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
2048 if(GetReader()->GetPHOSChannelStatus(nModule,icol,irow)) continue;
2051 amp = cell->GetAmplitude(iCell);
2052 fhAmplitude->Fill(amp);
2053 fhAmpId ->Fill(amp,id);
2054 fhAmplitudeMod[nModule]->Fill(amp);
2055 if(fCalorimeter=="EMCAL"){
2057 if(icol > 15 && icol < 32) ifrac = 1;
2058 else if(icol > 31) ifrac = 2;
2059 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
2062 fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, -1);
2064 nCellsInModule[nModule]++;
2065 fhGridCellsMod[nModule] ->Fill(icol,irow);
2066 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
2070 //Get Eta-Phi position of Cell
2071 if(fCalorimeter=="EMCAL" && GetReader()->IsEMCALGeoMatrixSet()){
2072 Float_t celleta = 0.;
2073 Float_t cellphi = 0.;
2074 GetReader()->GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
2075 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
2077 Double_t cellpos[] = {0, 0, 0};
2078 GetReader()->GetEMCALGeometry()->GetGlobal(id, cellpos);
2079 fhXCellE->Fill(cellpos[0],amp) ;
2080 fhYCellE->Fill(cellpos[1],amp) ;
2081 fhZCellE->Fill(cellpos[2],amp) ;
2082 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
2083 fhRCellE->Fill(rcell,amp) ;
2085 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
2087 else if(fCalorimeter=="PHOS" && GetReader()->IsPHOSGeoMatrixSet()){
2089 Int_t relId[4], module;
2090 Float_t xCell, zCell;
2092 GetReader()->GetPHOSGeometry()->AbsToRelNumbering(id,relId);
2094 GetReader()->GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
2095 GetReader()->GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
2096 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
2097 fhXCellE ->Fill(xyz.X(),amp) ;
2098 fhYCellE ->Fill(xyz.Y(),amp) ;
2099 fhZCellE ->Fill(xyz.Z(),amp) ;
2100 fhRCellE ->Fill(rcell ,amp) ;
2101 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
2106 //Number of cells per module
2107 for(Int_t imod = 0; imod < fNModules; imod++ ) {
2109 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
2110 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
2112 delete [] nCellsInModule;
2115 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
2119 //__________________________________
2120 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof, Float_t *pos, Float_t *showerShape,
2121 const Int_t nCaloCellsPerCluster,const Int_t nModule,
2122 const Int_t nTracksMatched, const TObject * track,
2123 const Int_t * labels, const Int_t nLabels){
2124 //Fill CaloCluster related histograms
2126 AliAODMCParticle * aodprimary = 0x0;
2127 TParticle * primary = 0x0;
2130 Float_t e = mom.E();
2131 Float_t pt = mom.Pt();
2132 Float_t eta = mom.Eta();
2133 Float_t phi = mom.Phi();
2134 if(phi < 0) phi +=TMath::TwoPi();
2135 if(GetDebug() > 0) {
2136 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
2138 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
2139 printf("\t Primaries: nlabels %d\n",nLabels);
2140 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
2145 if(nModule < fNModules) fhEMod[nModule]->Fill(e);
2149 fhEtaPhiE->Fill(eta,phi,e);
2150 fhXE ->Fill(pos[0],e);
2151 fhYE ->Fill(pos[1],e);
2152 fhZE ->Fill(pos[2],e);
2153 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
2154 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
2155 fhRE ->Fill(rxyz,e);
2156 fhClusterTimeEnergy->Fill(e,tof);
2158 //Shower shape parameters
2159 fhLambda->Fill(showerShape[0], showerShape[1], e);
2160 fhDispersion->Fill(showerShape[2],e);
2163 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster,eta);
2164 fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster,eta);
2165 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
2166 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
2167 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
2168 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
2170 if(nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
2172 //Fill histograms only possible when simulation
2173 if(IsDataMC() && nLabels > 0 && labels){
2175 //Play with the MC stack if available
2176 Int_t label = labels[0];
2179 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
2183 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
2184 Float_t vxMC= 0; Float_t vyMC = 0;
2185 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
2189 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
2191 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
2193 if( label >= GetMCStack()->GetNtrack()) {
2194 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
2198 primary = GetMCStack()->Particle(label);
2200 pdg0 = TMath::Abs(primary->GetPdgCode());
2202 status = primary->GetStatusCode();
2203 vxMC = primary->Vx();
2204 vyMC = primary->Vy();
2205 iParent = primary->GetFirstMother();
2207 if(GetDebug() > 1 ) {
2208 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2209 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
2212 //Get final particle, no conversion products
2213 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2215 primary = GetMCStack()->Particle(iParent);
2216 pdg = TMath::Abs(primary->GetPdgCode());
2217 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2218 while((pdg == 22 || pdg == 11) && status != 1){
2220 primary = GetMCStack()->Particle(iMother);
2221 status = primary->GetStatusCode();
2222 iParent = primary->GetFirstMother();
2223 pdg = TMath::Abs(primary->GetPdgCode());
2224 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
2227 if(GetDebug() > 1 ) {
2228 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2229 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
2234 //Overlapped pi0 (or eta, there will be very few), get the meson
2235 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2236 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2237 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
2238 while(pdg != 111 && pdg != 221){
2240 primary = GetMCStack()->Particle(iMother);
2241 status = primary->GetStatusCode();
2242 iParent = primary->GetFirstMother();
2243 pdg = TMath::Abs(primary->GetPdgCode());
2244 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
2246 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2251 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2252 primary->GetName(),iMother);
2255 eMC = primary->Energy();
2256 ptMC = primary->Pt();
2257 phiMC = primary->Phi();
2258 etaMC = primary->Eta();
2259 pdg = TMath::Abs(primary->GetPdgCode());
2260 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2263 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
2264 //Get the list of MC particles
2265 if(!GetReader()->GetAODMCParticles(0)) {
2266 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
2270 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
2272 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
2274 status = aodprimary->IsPrimary();
2275 vxMC = aodprimary->Xv();
2276 vyMC = aodprimary->Yv();
2277 iParent = aodprimary->GetMother();
2279 if(GetDebug() > 1 ) {
2280 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2281 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
2282 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
2285 //Get final particle, no conversion products
2286 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2288 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2290 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
2291 pdg = TMath::Abs(aodprimary->GetPdgCode());
2292 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
2294 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2295 status = aodprimary->IsPrimary();
2296 iParent = aodprimary->GetMother();
2297 pdg = TMath::Abs(aodprimary->GetPdgCode());
2299 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
2300 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2303 if(GetDebug() > 1 ) {
2304 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2305 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
2306 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2311 //Overlapped pi0 (or eta, there will be very few), get the meson
2312 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2313 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2314 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
2315 while(pdg != 111 && pdg != 221){
2318 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2319 status = aodprimary->IsPrimary();
2320 iParent = aodprimary->GetMother();
2321 pdg = TMath::Abs(aodprimary->GetPdgCode());
2323 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
2326 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2331 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2332 aodprimary->GetName(),iMother);
2335 status = aodprimary->IsPrimary();
2336 eMC = aodprimary->E();
2337 ptMC = aodprimary->Pt();
2338 phiMC = aodprimary->Phi();
2339 etaMC = aodprimary->Eta();
2340 pdg = TMath::Abs(aodprimary->GetPdgCode());
2341 charge = aodprimary->Charge();
2345 //Float_t vz = primary->Vz();
2346 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
2347 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
2348 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2349 fhEMR ->Fill(e,rVMC);
2352 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
2353 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
2354 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
2357 fh2E ->Fill(e, eMC);
2358 fh2Pt ->Fill(pt, ptMC);
2359 fh2Phi ->Fill(phi, phiMC);
2360 fh2Eta ->Fill(eta, etaMC);
2361 fhDeltaE ->Fill(eMC-e);
2362 fhDeltaPt ->Fill(ptMC-pt);
2363 fhDeltaPhi->Fill(phiMC-phi);
2364 fhDeltaEta->Fill(etaMC-eta);
2365 if(eMC > 0) fhRatioE ->Fill(e/eMC);
2366 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
2367 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
2368 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
2371 //Overlapped pi0 (or eta, there will be very few)
2372 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2373 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2374 fhPi0E ->Fill(e,eMC);
2375 fhPi0Pt ->Fill(pt,ptMC);
2376 fhPi0Eta ->Fill(eta,etaMC);
2377 fhPi0Phi ->Fill(phi,phiMC);
2378 if( nTracksMatched > 0){
2379 fhPi0ECharged ->Fill(e,eMC);
2380 fhPi0PtCharged ->Fill(pt,ptMC);
2381 fhPi0PhiCharged ->Fill(phi,phiMC);
2382 fhPi0EtaCharged ->Fill(eta,etaMC);
2384 }//Overlapped pizero decay
2385 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
2386 fhGamE ->Fill(e,eMC);
2387 fhGamPt ->Fill(pt,ptMC);
2388 fhGamEta ->Fill(eta,etaMC);
2389 fhGamPhi ->Fill(phi,phiMC);
2390 fhGamDeltaE ->Fill(eMC-e);
2391 fhGamDeltaPt ->Fill(ptMC-pt);
2392 fhGamDeltaPhi->Fill(phiMC-phi);
2393 fhGamDeltaEta->Fill(etaMC-eta);
2394 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
2395 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
2396 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
2397 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
2398 if( nTracksMatched > 0){
2399 fhGamECharged ->Fill(e,eMC);
2400 fhGamPtCharged ->Fill(pt,ptMC);
2401 fhGamPhiCharged ->Fill(phi,phiMC);
2402 fhGamEtaCharged ->Fill(eta,etaMC);
2405 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
2406 fhEleE ->Fill(e,eMC);
2407 fhElePt ->Fill(pt,ptMC);
2408 fhEleEta ->Fill(eta,etaMC);
2409 fhElePhi ->Fill(phi,phiMC);
2410 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2411 fhEMR ->Fill(e,rVMC);
2412 if( nTracksMatched > 0){
2413 fhEleECharged ->Fill(e,eMC);
2414 fhElePtCharged ->Fill(pt,ptMC);
2415 fhElePhiCharged ->Fill(phi,phiMC);
2416 fhEleEtaCharged ->Fill(eta,etaMC);
2419 else if(charge == 0){
2420 fhNeHadE ->Fill(e,eMC);
2421 fhNeHadPt ->Fill(pt,ptMC);
2422 fhNeHadEta ->Fill(eta,etaMC);
2423 fhNeHadPhi ->Fill(phi,phiMC);
2424 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2425 fhHaR ->Fill(e,rVMC);
2426 if( nTracksMatched > 0){
2427 fhNeHadECharged ->Fill(e,eMC);
2428 fhNeHadPtCharged ->Fill(pt,ptMC);
2429 fhNeHadPhiCharged ->Fill(phi,phiMC);
2430 fhNeHadEtaCharged ->Fill(eta,etaMC);
2434 fhChHadE ->Fill(e,eMC);
2435 fhChHadPt ->Fill(pt,ptMC);
2436 fhChHadEta ->Fill(eta,etaMC);
2437 fhChHadPhi ->Fill(phi,phiMC);
2438 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2439 fhHaR ->Fill(e,rVMC);
2440 if( nTracksMatched > 0){
2441 fhChHadECharged ->Fill(e,eMC);
2442 fhChHadPtCharged ->Fill(pt,ptMC);
2443 fhChHadPhiCharged ->Fill(phi,phiMC);
2444 fhChHadEtaCharged ->Fill(eta,etaMC);
2450 //Match tracks and clusters
2451 //To be Modified in case of AODs
2453 //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
2455 if( nTracksMatched > 0){
2456 fhECharged ->Fill(e);
2457 fhPtCharged ->Fill(pt);
2458 fhPhiCharged ->Fill(phi);
2459 fhEtaCharged ->Fill(eta);
2460 fhEtaPhiECharged->Fill(eta,phi,e);
2461 fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster,eta);
2463 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2464 //Study the track and matched cluster if track exists.
2466 Double_t emcpos[3] = {0.,0.,0.};
2467 Double_t emcmom[3] = {0.,0.,0.};
2468 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2469 Double_t bfield = 0.;
2475 Double_t tpcSignal = 0;
2476 Bool_t okpos = kFALSE;
2477 Bool_t okmom = kFALSE;
2478 Bool_t okout = kFALSE;
2482 //In case of ESDs get the parameters in this way
2483 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2484 if (((AliESDtrack*)track)->GetOuterParam() ) {
2487 bfield = ((AliESDEvent*)GetReader()->GetInputEvent())->GetMagneticField();
2488 okpos = ((AliESDtrack*)track)->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2489 okmom = ((AliESDtrack*)track)->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2490 if(!(okpos && okmom)) return;
2492 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2493 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2494 tphi = position.Phi();
2495 teta = position.Eta();
2496 tmom = momentum.Mag();
2498 //Double_t tphi = ((AliESDtrack*)track)->GetOuterParam()->Phi();
2499 //Double_t teta = ((AliESDtrack*)track)->GetOuterParam()->Eta();
2500 //Double_t tmom = ((AliESDtrack*)track)->GetOuterParam()->P();
2501 tpt = ((AliESDtrack*)track)->Pt();
2502 tmom2 = ((AliESDtrack*)track)->P();
2503 tpcSignal = ((AliESDtrack*)track)->GetTPCsignal();
2505 nITS = ((AliESDtrack*)track)->GetNcls(0);
2506 nTPC = ((AliESDtrack*)track)->GetNcls(1);
2507 }//Outer param available
2509 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2510 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2513 pid->GetEMCALPosition(emcpos);
2514 pid->GetEMCALMomentum(emcmom);
2516 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2517 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2518 tphi = position.Phi();
2519 teta = position.Eta();
2520 tmom = momentum.Mag();
2522 tpt = ((AliAODTrack*)track)->Pt();
2523 tmom2 = ((AliAODTrack*)track)->P();
2524 tpcSignal = pid->GetTPCsignal();
2526 //nITS = ((AliAODTrack*)track)->GetNcls(0);
2527 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
2528 }//Outer param available
2530 else return; //Do nothing case not implemented.
2533 Double_t deta = teta - eta;
2534 Double_t dphi = tphi - phi;
2535 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2536 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2537 Double_t dR = sqrt(dphi*dphi + deta*deta);
2539 Double_t pOverE = tmom/e;
2541 fh1pOverE->Fill(tpt, pOverE);
2542 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
2545 fh2MatchdEdx->Fill(tmom2,tpcSignal);
2547 if(IsDataMC() && primary){
2548 Int_t pdg = primary->GetPdgCode();
2549 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2551 if(TMath::Abs(pdg) == 11){
2552 fhMCEle1pOverE->Fill(tpt,pOverE);
2553 fhMCEle1dR->Fill(dR);
2554 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2555 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2558 fhMCChHad1pOverE->Fill(tpt,pOverE);
2559 fhMCChHad1dR->Fill(dR);
2560 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2561 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2563 else if(charge == 0){
2564 fhMCNeutral1pOverE->Fill(tpt,pOverE);
2565 fhMCNeutral1dR->Fill(dR);
2566 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2567 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2571 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2572 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2573 fh2EledEdx->Fill(tmom2,tpcSignal);
2576 else{//no ESD external param or AODPid
2577 ULong_t status=AliESDtrack::kTPCrefit;
2578 status|=AliESDtrack::kITSrefit;
2579 //printf("track status %d\n", track->GetStatus() );
2580 fhEChargedNoOut ->Fill(e);
2581 fhPtChargedNoOut ->Fill(pt);
2582 fhPhiChargedNoOut ->Fill(phi);
2583 fhEtaChargedNoOut ->Fill(eta);
2584 fhEtaPhiChargedNoOut ->Fill(eta,phi);
2585 if(GetDebug() >= 0 && ((((AliESDtrack*)track)->GetStatus() & status) == status)) printf("ITS+TPC\n");
2587 }//matched clusters with tracks
2591 //__________________________________
2592 void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
2593 // Correlate information from PHOS and EMCAL
2594 TRefArray * caloClustersEMCAL = 0;
2595 TRefArray * caloClustersPHOS = 0;
2597 // Get once the array of clusters per calorimeter, avoid an extra loop.
2598 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2599 if(fCalorimeter == "EMCAL"){
2600 caloClustersPHOS = new TRefArray();
2601 ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
2602 caloClustersEMCAL = new TRefArray(*refArray);
2604 else if(fCalorimeter == "PHOS") {
2605 caloClustersEMCAL = new TRefArray();
2606 ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
2607 caloClustersPHOS = new TRefArray(*refArray);
2610 //Fill histograms with clusters
2612 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2613 Float_t sumClusterEnergyEMCAL = 0;
2614 Float_t sumClusterEnergyPHOS = 0;
2616 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2617 sumClusterEnergyEMCAL += ((AliESDCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
2618 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2619 sumClusterEnergyPHOS += ((AliESDCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
2620 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2622 //Fill histograms with cells
2624 AliESDCaloCells * cellsEMCAL = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2625 AliESDCaloCells * cellsPHOS = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2626 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2629 Float_t sumCellEnergyEMCAL = 0;
2630 Float_t sumCellEnergyPHOS = 0;
2631 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2632 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2633 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2634 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2635 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2636 if(GetDebug() > 0 ){
2637 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2638 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2639 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2640 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2641 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2644 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2645 if(fCalorimeter == "EMCAL"){
2646 ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
2647 caloClustersEMCAL = refArray;
2649 else if(fCalorimeter == "PHOS") {
2650 ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
2651 caloClustersEMCAL = refArray;
2654 //Fill histograms with clusters
2656 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2657 Float_t sumClusterEnergyEMCAL = 0;
2658 Float_t sumClusterEnergyPHOS = 0;
2660 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2661 sumClusterEnergyEMCAL += ((AliAODCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
2662 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2663 sumClusterEnergyPHOS += ((AliAODCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
2664 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2666 //Fill histograms with cells
2668 AliAODCaloCells * cellsEMCAL = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2669 AliAODCaloCells * cellsPHOS = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2670 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2673 Float_t sumCellEnergyEMCAL = 0;
2674 Float_t sumCellEnergyPHOS = 0;
2675 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2676 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2677 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2678 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2679 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2680 if(GetDebug() > 0 ){
2681 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2682 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2683 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2684 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2685 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2689 delete caloClustersEMCAL;
2690 delete caloClustersPHOS;
2694 //______________________________________________________________________________
2695 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
2696 //Fill pure monte carlo related histograms
2698 Float_t eMC = mom.E();
2699 Float_t ptMC = mom.Pt();
2700 Float_t phiMC = mom.Phi();
2702 phiMC += TMath::TwoPi();
2703 Float_t etaMC = mom.Eta();
2705 if (TMath::Abs(etaMC) > 1) return;
2708 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2711 fhGenGamPt ->Fill(ptMC);
2712 fhGenGamEta->Fill(etaMC);
2713 fhGenGamPhi->Fill(phiMC);
2715 fhGenGamAccE ->Fill(eMC);
2716 fhGenGamAccPt ->Fill(ptMC);
2717 fhGenGamAccEta->Fill(etaMC);
2718 fhGenGamAccPhi->Fill(phiMC);
2721 else if (pdg==111) {
2722 fhGenPi0Pt ->Fill(ptMC);
2723 fhGenPi0Eta->Fill(etaMC);
2724 fhGenPi0Phi->Fill(phiMC);
2726 fhGenPi0AccE ->Fill(eMC);
2727 fhGenPi0AccPt ->Fill(ptMC);
2728 fhGenPi0AccEta->Fill(etaMC);
2729 fhGenPi0AccPhi->Fill(phiMC);
2732 else if (pdg==221) {
2733 fhGenEtaPt ->Fill(ptMC);
2734 fhGenEtaEta->Fill(etaMC);
2735 fhGenEtaPhi->Fill(phiMC);
2737 else if (pdg==223) {
2738 fhGenOmegaPt ->Fill(ptMC);
2739 fhGenOmegaEta->Fill(etaMC);
2740 fhGenOmegaPhi->Fill(phiMC);
2742 else if (TMath::Abs(pdg)==11) {
2743 fhGenElePt ->Fill(ptMC);
2744 fhGenEleEta->Fill(etaMC);
2745 fhGenElePhi->Fill(phiMC);
2750 //________________________________________________________________________
2751 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2753 // Needed when Terminate is executed in distributed environment
2754 // Refill analysis histograms of this class with corresponding histograms in output list.
2756 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2757 // the first one and then add the next
2758 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
2759 //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2761 //Read histograms, must be in the same order as in GetCreateOutputObject.
2762 fhE = (TH1F *) outputList->At(index++);
2763 fhPt = (TH1F *) outputList->At(index++);
2764 fhPhi = (TH1F *) outputList->At(index++);
2765 fhEta = (TH1F *) outputList->At(index++);
2766 fhEtaPhiE = (TH3F *) outputList->At(index++);
2768 fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
2770 fhLambda = (TH3F *) outputList->At(index++);
2771 fhDispersion = (TH2F *) outputList->At(index++);
2773 fhECharged = (TH1F *) outputList->At(index++);
2774 fhPtCharged = (TH1F *) outputList->At(index++);
2775 fhPhiCharged = (TH1F *) outputList->At(index++);
2776 fhEtaCharged = (TH1F *) outputList->At(index++);
2777 fhEtaPhiECharged = (TH3F *) outputList->At(index++);
2779 fhEChargedNoOut = (TH1F *) outputList->At(index++);
2780 fhPtChargedNoOut = (TH1F *) outputList->At(index++);
2781 fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
2782 fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
2783 fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
2785 fh1pOverE = (TH2F *) outputList->At(index++);
2786 fh1dR = (TH1F *) outputList->At(index++);
2787 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2788 fh2EledEdx = (TH2F *) outputList->At(index++);
2789 fh1pOverER02 = (TH2F *) outputList->At(index++);
2791 fhIM = (TH2F *) outputList->At(index++);
2792 fhIMCellCut = (TH2F *) outputList->At(index++);
2793 fhAsym = (TH2F *) outputList->At(index++);
2795 fhNCellsPerCluster = (TH3F *) outputList->At(index++);
2796 fhNCellsPerClusterMIP = (TH3F *) outputList->At(index++);
2797 fhNCellsPerClusterMIPCharged = (TH3F *) outputList->At(index++);
2798 fhNClusters = (TH1F *) outputList->At(index++);
2800 fhRNCells = (TH2F *) outputList->At(index++);
2801 fhXNCells = (TH2F *) outputList->At(index++);
2802 fhYNCells = (TH2F *) outputList->At(index++);
2803 fhZNCells = (TH2F *) outputList->At(index++);
2804 fhRE = (TH2F *) outputList->At(index++);
2805 fhXE = (TH2F *) outputList->At(index++);
2806 fhYE = (TH2F *) outputList->At(index++);
2807 fhZE = (TH2F *) outputList->At(index++);
2808 fhXYZ = (TH3F *) outputList->At(index++);
2810 fhRCellE = (TH2F *) outputList->At(index++);
2811 fhXCellE = (TH2F *) outputList->At(index++);
2812 fhYCellE = (TH2F *) outputList->At(index++);
2813 fhZCellE = (TH2F *) outputList->At(index++);
2814 fhXYZCell = (TH3F *) outputList->At(index++);
2815 fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
2816 fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
2817 fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
2818 fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
2819 fhDeltaCellClusterRE = (TH2F *) outputList->At(index++);
2820 fhDeltaCellClusterXE = (TH2F *) outputList->At(index++);
2821 fhDeltaCellClusterYE = (TH2F *) outputList->At(index++);
2822 fhDeltaCellClusterZE = (TH2F *) outputList->At(index++);
2823 fhEtaPhiAmp = (TH3F *) outputList->At(index++);
2825 fhNCells = (TH1F *) outputList->At(index++);
2826 fhAmplitude = (TH1F *) outputList->At(index++);
2827 fhAmpId = (TH2F *) outputList->At(index++);
2829 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2831 fhCellTimeSpreadRespectToCellMax = (TH1F *) outputList->At(index++);
2832 fhCellIdCellLargeTimeSpread = (TH1F *) outputList->At(index++);
2834 fhTime = (TH1F *) outputList->At(index++);
2835 fhTimeId = (TH2F *) outputList->At(index++);
2836 fhTimeAmp = (TH2F *) outputList->At(index++);
2838 // fhT0Time = (TH1F *) outputList->At(index++);
2839 // fhT0TimeId = (TH2F *) outputList->At(index++);
2840 // fhT0TimeAmp = (TH2F *) outputList->At(index++);
2845 if(fCorrelateCalos){
2846 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2847 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2848 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2849 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2853 fhEMod = new TH1F*[fNModules];
2854 fhNClustersMod = new TH1F*[fNModules];
2855 fhNCellsPerClusterMod = new TH2F*[fNModules];
2856 fhNCellsMod = new TH1F*[fNModules];
2857 fhGridCellsMod = new TH2F*[fNModules];
2858 fhGridCellsEMod = new TH2F*[fNModules];
2859 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2860 fhGridCellsTimeMod = new TH2F*[fNModules];
2861 fhAmplitudeMod = new TH1F*[fNModules];
2862 if(fCalorimeter=="EMCAL")
2863 fhAmplitudeModFraction = new TH1F*[fNModules*3];
2866 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2868 fhIMMod = new TH2F*[fNModules];
2869 fhIMCellCutMod = new TH2F*[fNModules];
2871 for(Int_t imod = 0 ; imod < fNModules; imod++){
2872 fhEMod[imod] = (TH1F *) outputList->At(index++);
2873 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2874 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2875 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2876 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2877 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2878 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2879 fhGridCellsTimeMod[imod] = (TH2F *) outputList->At(index++);
2880 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2882 if(fCalorimeter=="EMCAL"){
2883 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
2884 fhAmplitudeModFraction[imod*3+ifrac] = (TH1F *) outputList->At(index++);
2888 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
2889 fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2890 //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2891 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
2892 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
2893 // fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2] = (TH2F *) outputList->At(index++);
2897 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2898 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
2903 fhDeltaE = (TH1F *) outputList->At(index++);
2904 fhDeltaPt = (TH1F *) outputList->At(index++);
2905 fhDeltaPhi = (TH1F *) outputList->At(index++);
2906 fhDeltaEta = (TH1F *) outputList->At(index++);
2908 fhRatioE = (TH1F *) outputList->At(index++);
2909 fhRatioPt = (TH1F *) outputList->At(index++);
2910 fhRatioPhi = (TH1F *) outputList->At(index++);
2911 fhRatioEta = (TH1F *) outputList->At(index++);
2913 fh2E = (TH2F *) outputList->At(index++);
2914 fh2Pt = (TH2F *) outputList->At(index++);
2915 fh2Phi = (TH2F *) outputList->At(index++);
2916 fh2Eta = (TH2F *) outputList->At(index++);
2918 fhGamE = (TH2F *) outputList->At(index++);
2919 fhGamPt = (TH2F *) outputList->At(index++);
2920 fhGamPhi = (TH2F *) outputList->At(index++);
2921 fhGamEta = (TH2F *) outputList->At(index++);
2923 fhGamDeltaE = (TH1F *) outputList->At(index++);
2924 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2925 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2926 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2928 fhGamRatioE = (TH1F *) outputList->At(index++);
2929 fhGamRatioPt = (TH1F *) outputList->At(index++);
2930 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2931 fhGamRatioEta = (TH1F *) outputList->At(index++);
2933 fhPi0E = (TH2F *) outputList->At(index++);
2934 fhPi0Pt = (TH2F *) outputList->At(index++);
2935 fhPi0Phi = (TH2F *) outputList->At(index++);
2936 fhPi0Eta = (TH2F *) outputList->At(index++);
2938 fhEleE = (TH2F *) outputList->At(index++);
2939 fhElePt = (TH2F *) outputList->At(index++);
2940 fhElePhi = (TH2F *) outputList->At(index++);
2941 fhEleEta = (TH2F *) outputList->At(index++);
2943 fhNeHadE = (TH2F *) outputList->At(index++);
2944 fhNeHadPt = (TH2F *) outputList->At(index++);
2945 fhNeHadPhi = (TH2F *) outputList->At(index++);
2946 fhNeHadEta = (TH2F *) outputList->At(index++);
2948 fhChHadE = (TH2F *) outputList->At(index++);
2949 fhChHadPt = (TH2F *) outputList->At(index++);
2950 fhChHadPhi = (TH2F *) outputList->At(index++);
2951 fhChHadEta = (TH2F *) outputList->At(index++);
2953 fhGamECharged = (TH2F *) outputList->At(index++);
2954 fhGamPtCharged = (TH2F *) outputList->At(index++);
2955 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2956 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2958 fhPi0ECharged = (TH2F *) outputList->At(index++);
2959 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2960 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2961 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2963 fhEleECharged = (TH2F *) outputList->At(index++);
2964 fhElePtCharged = (TH2F *) outputList->At(index++);
2965 fhElePhiCharged = (TH2F *) outputList->At(index++);
2966 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2968 fhNeHadECharged = (TH2F *) outputList->At(index++);
2969 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2970 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2971 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2973 fhChHadECharged = (TH2F *) outputList->At(index++);
2974 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2975 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2976 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2978 // fhEMVxyz = (TH3F *) outputList->At(index++);
2979 // fhHaVxyz = (TH3F *) outputList->At(index++);
2981 fhEMVxyz = (TH2F *) outputList->At(index++);
2982 fhHaVxyz = (TH2F *) outputList->At(index++);
2983 fhEMR = (TH2F *) outputList->At(index++);
2984 fhHaR = (TH2F *) outputList->At(index++);
2986 fhGenGamPt = (TH1F *) outputList->At(index++);
2987 fhGenGamEta = (TH1F *) outputList->At(index++);
2988 fhGenGamPhi = (TH1F *) outputList->At(index++);
2990 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2991 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2992 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2994 fhGenEtaPt = (TH1F *) outputList->At(index++);
2995 fhGenEtaEta = (TH1F *) outputList->At(index++);
2996 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2998 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2999 fhGenOmegaEta = (TH1F *) outputList->At(index++);
3000 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
3002 fhGenElePt = (TH1F *) outputList->At(index++);
3003 fhGenEleEta = (TH1F *) outputList->At(index++);
3004 fhGenElePhi = (TH1F *) outputList->At(index++);
3006 fhGenGamAccE = (TH1F *) outputList->At(index++);
3007 fhGenGamAccPt = (TH1F *) outputList->At(index++);
3008 fhGenGamAccEta = (TH1F *) outputList->At(index++);
3009 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
3011 fhGenPi0AccE = (TH1F *) outputList->At(index++);
3012 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
3013 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
3014 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
3016 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
3017 fhMCEle1dR = (TH1F *) outputList->At(index++);
3018 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
3020 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
3021 fhMCChHad1dR = (TH1F *) outputList->At(index++);
3022 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
3024 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
3025 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
3026 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
3028 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
3029 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
3030 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
3034 //__________________________________________________________________
3035 void AliAnaCalorimeterQA::Terminate(TList* outputList)
3037 //Do plots if requested
3039 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
3040 if(!fMakePlots) return;
3042 //Do some plots to end
3043 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
3044 //Recover histograms from output histograms list, needed for distributed analysis.
3045 ReadHistograms(outputList);
3047 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
3048 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
3053 //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
3054 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
3055 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
3056 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
3057 // Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
3058 // Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
3059 // Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
3060 // Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
3061 // Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
3062 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
3063 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
3064 // Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
3065 // Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
3066 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
3067 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
3068 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
3069 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
3071 //Color code for the different modules
3072 Int_t modColorIndex[]={2,4,6,8};
3074 //--------------------------------------------------
3075 // Cluster energy distributions, module dependence
3076 //--------------------------------------------------
3077 sprintf(cname,"QA_%s_ClusterEnergy",fCalorimeter.Data());
3078 TCanvas * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
3080 Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
3081 //printf("new E rb %d\n",rbE);
3083 fhE->SetAxisRange(ptmin,ptmax,"X");
3085 if(fhE->GetEntries() > 0) gPad->SetLogy();
3086 TLegend pLegendE(0.7,0.6,0.9,0.8);
3087 pLegendE.SetTextSize(0.03);
3088 pLegendE.AddEntry(fhE,"all modules","L");
3089 pLegendE.SetFillColor(10);
3090 pLegendE.SetBorderSize(1);
3093 fhE->SetLineColor(1);
3095 for(Int_t imod = 0; imod < fNModules; imod++){
3096 fhEMod[imod]->Rebin(rbE);
3097 fhEMod[imod]->SetLineColor(modColorIndex[imod]);
3098 fhEMod[imod]->Draw("HE same");
3099 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
3105 TLegend pLegendER(0.55,0.8,0.9,0.9);
3106 pLegendER.SetTextSize(0.03);
3107 pLegendER.SetFillColor(10);
3108 pLegendER.SetBorderSize(1);
3110 for(Int_t imod = 1; imod < fNModules; imod++){
3111 TH1D * htmp = (TH1D*)fhEMod[imod]->Clone(Form("hERat%d",imod));
3112 htmp->Divide(fhEMod[0]);
3113 htmp->SetLineColor(modColorIndex[imod]);
3115 htmp->SetTitle("Ratio module X / module 0");
3116 htmp->SetAxisRange(ptmin,ptmax,"X");
3117 htmp->SetMaximum(5);
3118 htmp->SetMinimum(0);
3119 htmp->SetAxisRange(ptmin,ptmax,"X");
3123 htmp->Draw("same HE");
3125 pLegendER.AddEntry(fhEMod[imod],Form("module %d / module 0",imod),"L");
3129 sprintf(name,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
3130 c->Print(name); printf("Plot: %s\n",name);
3132 //--------------------------------------------------
3133 // Cell energy distributions, module dependence
3134 //--------------------------------------------------
3135 sprintf(cname,"%s_QA_CellEnergy",fCalorimeter.Data());
3136 TCanvas * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
3139 Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
3140 //printf("new Amp rb %d\n",rbAmp);
3141 fhAmplitude->Rebin(rbAmp);
3142 fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
3145 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
3146 TLegend pLegendA(0.7,0.6,0.9,0.8);
3147 pLegendA.SetTextSize(0.03);
3148 pLegendA.AddEntry(fhE,"all modules","L");
3149 pLegendA.SetFillColor(10);
3150 pLegendA.SetBorderSize(1);
3151 fhAmplitude->SetMinimum(0.1);
3152 fhAmplitude->SetLineColor(1);
3153 fhAmplitude->Draw("HE");
3155 for(Int_t imod = 0; imod < fNModules; imod++){
3156 fhAmplitudeMod[imod]->Rebin(rbAmp);
3157 fhAmplitudeMod[imod]->SetLineColor(modColorIndex[imod]);
3158 fhAmplitudeMod[imod]->Draw("HE same");
3159 pLegendA.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3165 TLegend pLegendAR(0.55,0.8,0.9,0.9);
3166 pLegendAR.SetTextSize(0.03);
3167 pLegendAR.SetFillColor(10);
3168 pLegendAR.SetBorderSize(1);
3170 for(Int_t imod = 1; imod < fNModules; imod++){
3171 TH1D * htmp = (TH1D*)fhAmplitudeMod[imod]->Clone(Form("hAmpRat%d",imod));
3172 htmp->Divide(fhAmplitudeMod[0]);
3173 htmp->SetLineColor(modColorIndex[imod]);
3175 htmp->SetTitle("Ratio cells energy in module X / module 0");
3176 htmp->SetAxisRange(ptmin,ptmax,"X");
3177 htmp->SetMaximum(5);
3178 htmp->SetMinimum(0);
3182 htmp->Draw("same HE");
3183 pLegendAR.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3187 sprintf(name,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
3188 ca->Print(name); printf("Plot: %s\n",name);
3190 //----------------------------------------------------------
3191 // Cell energy distributions, FRACTION of module dependence
3192 // See Super Module calibration difference
3193 //---------------------------------------------------------
3194 if(fCalorimeter=="EMCAL"){
3196 sprintf(cname,"%s_QA_SMThirds",fCalorimeter.Data());
3197 TCanvas * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
3198 cfrac->Divide(2, 3);
3200 if(fhAmplitude->GetEntries() > 0)
3202 TLegend pLegend1(0.6,0.6,0.9,0.8);
3203 pLegend1.SetTextSize(0.03);
3204 pLegend1.SetFillColor(10);
3205 pLegend1.SetBorderSize(1);
3206 pLegend1.SetHeader("Third close to Eta=0");
3207 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0");
3208 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3209 fhAmplitudeModFraction[0]->Draw("axis");
3210 TH1D * hAverageThird1 = (TH1D *)fhAmplitudeModFraction[3*0+2]->Clone("AverageThird1");
3211 for(Int_t imod = 0; imod < fNModules; imod++){
3213 if(imod%2==0) ifrac = 2;
3214 if(imod > 0) hAverageThird1->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3215 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3216 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3217 pLegend1.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3219 hAverageThird1 ->Scale(1./fNModules);
3223 for(Int_t imod = 0; imod < fNModules; imod++){
3225 if(imod%2==0) ifrac = 2;
3226 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3227 htmp->Divide(hAverageThird1);
3229 htmp ->SetTitle("Close to eta = 0");
3230 htmp ->SetMaximum(5);
3231 htmp ->SetMinimum(0);
3232 htmp ->SetAxisRange(ptmin,ptmax,"X");
3233 htmp ->SetYTitle("ratio third to average");
3236 else htmp -> Draw("same HE");
3242 if(fhAmplitude->GetEntries() > 0)
3244 TLegend pLegend2(0.6,0.6,0.9,0.8);
3245 pLegend2.SetTextSize(0.03);
3246 pLegend2.SetFillColor(10);
3247 pLegend2.SetBorderSize(1);
3248 pLegend2.SetHeader("Middle Third");
3250 fhAmplitudeModFraction[0]->SetTitle("Middle Third");
3251 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3252 fhAmplitudeModFraction[0]->Draw("axis");
3254 TH1D * hAverageThird2 = (TH1D *)fhAmplitudeModFraction[3*0+1]->Clone("AverageThird2");
3255 for(Int_t imod = 0; imod < fNModules; imod++){
3257 if(imod > 0) hAverageThird2->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3258 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3259 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3260 pLegend2.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3262 hAverageThird2->Scale(1./fNModules);
3268 for(Int_t imod = 0; imod < fNModules; imod++){
3270 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3271 htmp->Divide(hAverageThird2);
3273 htmp ->SetTitle("Middle");
3274 htmp ->SetMaximum(5);
3275 htmp ->SetMinimum(0);
3276 htmp ->SetAxisRange(ptmin,ptmax,"X");
3277 htmp ->SetYTitle("ratio third to average");
3280 else htmp -> Draw("same HE");
3286 if(fhAmplitude->GetEntries() > 0)
3288 TLegend pLegend3(0.6,0.6,0.9,0.8);
3289 pLegend3.SetTextSize(0.03);
3290 pLegend3.SetFillColor(10);
3291 pLegend3.SetBorderSize(1);
3292 pLegend3.SetHeader("Third close to Eta=0.7");
3294 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0.7");
3295 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3296 fhAmplitudeModFraction[0]->Draw("axis");
3298 TH1D * hAverageThird3 = (TH1D *)fhAmplitudeModFraction[3*0+0]->Clone("AverageThird3");
3299 for(Int_t imod = 0; imod < 4; imod++){
3301 if(imod%2==0) ifrac = 0;
3302 if(imod > 0) hAverageThird3->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3303 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3304 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3305 pLegend3.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3307 hAverageThird3 ->Scale(1./fNModules);
3312 for(Int_t imod = 0; imod < fNModules; imod++){
3314 if(imod%2==0) ifrac = 0;
3315 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3316 htmp->Divide(hAverageThird3);
3318 htmp ->SetTitle("Close to eta = 0.7");
3319 htmp ->SetMaximum(5);
3320 htmp ->SetMinimum(0);
3321 htmp ->SetAxisRange(ptmin,ptmax,"X");
3322 htmp ->SetYTitle("ratio third to average");
3325 else htmp ->Draw("same HE");
3329 sprintf(name,"QA_%s_CellEnergyModuleFraction.eps",fCalorimeter.Data());
3330 cfrac->Print(name); printf("Create plot %s\n",name);
3334 //----------------------------------------------------------
3335 // Cluster eta and phi distributions, energy cut dependence
3336 //---------------------------------------------------------
3338 sprintf(cname,"%s_QA_EtaPhiCluster",fCalorimeter.Data());
3339 TCanvas * cetaphic = new TCanvas(cname, "Eta-Phi Reconstructed distributions", 1200, 400) ;
3340 cetaphic->Divide(3, 1);
3345 Float_t ecut[] = {0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3};
3346 Int_t ecutcolor[]= {2, 4, 6, 7, 8, 9, 12};
3347 TH1D * hE = fhEtaPhiE->ProjectionZ();
3354 TLegend pLegendPhiCl(0.83,0.6,0.95,0.93);
3355 pLegendPhiCl.SetTextSize(0.03);
3356 pLegendPhiCl.SetFillColor(10);
3357 pLegendPhiCl.SetBorderSize(1);
3359 TH1D * htmp = fhEtaPhiE->ProjectionY("hphi_cluster_nocut",0,-1,0,-1);
3361 htmp->SetMinimum(1);
3362 rbPhi = GetNewRebinForRePlotting(htmp, phimin, phimax,nphibins) ;
3363 //printf("new Phi rb %d\n",rbPhi);
3365 htmp->SetTitle("#phi of clusters for energy in cluster > threshold");
3366 htmp->SetAxisRange(phimin,phimax,"X");
3368 pLegendPhiCl.AddEntry(htmp,"No cut","L");
3370 for (Int_t i = 0; i < ncuts; i++) {
3371 binmin = hE->FindBin(ecut[i]);
3372 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3373 htmp = fhEtaPhiE->ProjectionY(Form("hphi_cluster_cut%d",i),0,-1,binmin,-1);
3374 htmp->SetLineColor(ecutcolor[i]);
3376 htmp->Draw("same HE");
3377 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3381 pLegendPhiCl.Draw();
3388 htmp = fhEtaPhiE->ProjectionX("heta_cluster_nocut",0,-1,0,-1);
3389 htmp ->SetLineColor(1);
3390 rbEta = GetNewRebinForRePlotting(htmp,etamin, etamax,netabins) ;
3391 //printf("new Eta rb %d\n",rbEta);
3394 htmp->SetMinimum(1);
3395 htmp->SetTitle("#eta of clusters for energy in cluster > threshold");
3396 htmp->SetAxisRange(etamin,etamax,"X");
3399 for (Int_t i = 0; i < ncuts; i++) {
3400 binmin = hE->FindBin(ecut[i]);
3401 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3402 htmp = fhEtaPhiE->ProjectionX(Form("heta_cluster_cut%d",i),0,-1,binmin,-1);
3403 htmp->SetLineColor(ecutcolor[i]);
3405 htmp->Draw("same HE");
3410 TH2D* hEtaPhiCl = (TH2D*) fhEtaPhiE->Project3D("xy");
3411 hEtaPhiCl->SetAxisRange(etamin,etamax,"X");
3412 hEtaPhiCl->SetAxisRange(phimin,phimax,"Y");
3413 hEtaPhiCl->Draw("colz");
3415 sprintf(name,"QA_%s_ClusterEtaPhi.eps",fCalorimeter.Data());
3416 cetaphic->Print(name); printf("Create plot %s\n",name);
3418 //----------------------------------------------------------
3419 // Cell eta and phi distributions, energy cut dependence
3420 //---------------------------------------------------------
3422 sprintf(cname,"%s_QA_EtaPhiCell",fCalorimeter.Data());
3423 TCanvas * cetaphicell = new TCanvas(cname, "Eta-Phi Cells distributions", 1200, 400) ;
3424 cetaphicell->Divide(3, 1);
3427 cetaphicell->cd(1) ;
3431 TLegend pLegendPhiCell(0.83,0.6,0.95,0.93);
3432 pLegendPhiCell.SetTextSize(0.03);
3433 pLegendPhiCell.SetFillColor(10);
3434 pLegendPhiCell.SetBorderSize(1);
3436 htmp = fhEtaPhiAmp->ProjectionY("hphi_cell_nocut",0,-1,0,-1);
3438 htmp->SetMinimum(1);
3440 htmp->SetTitle("#phi of cells for cell energy > threshold");
3441 htmp->SetAxisRange(phimin,phimax,"X");
3443 pLegendPhiCell.AddEntry(htmp,"No cut","L");
3445 for (Int_t i = 0; i < ncuts; i++) {
3446 binmin = hE->FindBin(ecut[i]);
3447 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3448 htmp = fhEtaPhiAmp->ProjectionY(Form("hphi_cell_cut%d",i),0,-1,binmin,-1);
3449 htmp->SetLineColor(ecutcolor[i]);
3451 htmp->Draw("same HE");
3452 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3456 pLegendPhiCell.Draw();
3459 cetaphicell->cd(2) ;
3463 htmp = fhEtaPhiAmp->ProjectionX("heta_cell_nocut",0,-1,0,-1);
3465 htmp ->SetLineColor(1);
3467 htmp->SetMinimum(1);
3468 htmp->SetTitle("#eta of cells for cell energy > threshold");
3469 htmp->SetAxisRange(etamin,etamax,"X");
3472 for (Int_t i = 0; i < ncuts; i++) {
3473 binmin = hE->FindBin(ecut[i]);
3474 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3475 htmp = fhEtaPhiAmp->ProjectionX(Form("heta_cell_cut%d",i),0,-1,binmin,-1);
3476 htmp->SetLineColor(ecutcolor[i]);
3478 htmp->Draw("same HE");
3483 cetaphicell->cd(3) ;
3484 TH2D* hEtaPhiCell = (TH2D*) fhEtaPhiAmp->Project3D("xy");
3485 hEtaPhiCell->SetAxisRange(etamin,etamax,"X");
3486 hEtaPhiCell->SetAxisRange(phimin,phimax,"Y");
3487 hEtaPhiCell->Draw("colz");
3489 sprintf(name,"QA_%s_CellEtaPhi.eps",fCalorimeter.Data());
3490 cetaphicell->Print(name); printf("Create plot %s\n",name);
3492 ////////////////////////////////////////
3493 ///////// Global Positions /////////////
3494 ////////////////////////////////////////
3497 sprintf(cname,"%s_QA_ClusterXY",fCalorimeter.Data());
3498 TCanvas * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
3502 TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
3503 hXY->SetTitle("Cluster X vs Y");
3504 hXY->GetYaxis()->SetTitleOffset(1.6);
3507 TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
3508 hYZ->SetTitle("Cluster Z vs Y");
3509 hYZ->GetYaxis()->SetTitleOffset(1.6);
3512 TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
3513 hXZ->SetTitle("Cluster X vs Z");
3514 hXZ->GetYaxis()->SetTitleOffset(1.6);
3517 sprintf(name,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
3518 cxyz->Print(name); printf("Create plot %s\n",name);
3524 sprintf(cname,"QA_%s_ClusterX",fCalorimeter.Data());
3525 TCanvas * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
3529 TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
3532 hX->SetTitle("Cluster X ");
3534 rbX = GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
3535 //printf("new X rb %d\n",rbX);
3537 hX->SetMinimum(hX->GetMaximum()/2);
3538 hX->SetAxisRange(xmin,xmax);
3541 TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
3543 hY->SetTitle("Cluster Y ");
3544 rbY = GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
3545 //printf("new Y rb %d\n",rbY);
3548 hY->SetAxisRange(ymin,ymax);
3552 TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
3555 rbZ = GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
3556 //printf("new Z rb %d\n",rbZ);
3558 hZ->SetMinimum(hZ->GetMaximum()/2);
3559 hZ->SetAxisRange(zmin,zmax);
3562 sprintf(name,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
3563 cx->Print(name); printf("Create plot %s\n",name);
3567 sprintf(cname,"%s_QA_CellXY",fCalorimeter.Data());
3568 TCanvas * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
3569 cellxyz->Divide(3, 1);
3572 TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
3573 hXYCell->SetTitle("Cell X vs Y");
3574 hXYCell->GetYaxis()->SetTitleOffset(1.6);
3575 hXYCell->Draw("colz");
3577 TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
3578 hYZCell->SetTitle("Cell Z vs Y");
3579 hYZCell->GetYaxis()->SetTitleOffset(1.6);
3580 hYZCell->Draw("colz");
3582 TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
3583 hXZCell->SetTitle("Cell X vs Z");
3584 hXZCell->GetYaxis()->SetTitleOffset(1.6);
3585 hXZCell->Draw("colz");
3587 sprintf(name,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
3588 cellxyz->Print(name); printf("Create plot %s\n",name);
3591 sprintf(cname,"%s_QA_CellX",fCalorimeter.Data());
3592 TCanvas * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
3593 cellx->Divide(3, 1);
3596 TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
3599 hXCell->SetTitle("Cell X ");
3601 hXCell->SetMinimum(hXCell->GetMaximum()/2);
3602 hXCell->SetAxisRange(xmin,xmax);
3606 TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
3608 hYCell->SetTitle("Cell Y ");
3610 hYCell->SetAxisRange(ymin,ymax);
3611 hYCell->SetMinimum(1);
3615 TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
3618 hZCell->SetAxisRange(zmin,zmax);
3619 hZCell->SetTitle("Cell Z ");
3621 hZCell->SetMinimum(hZCell->GetMaximum()/2);
3624 sprintf(name,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
3625 cellx->Print(name); printf("Create plot %s\n",name);
3628 //----------------------------------------------------------
3629 // Cluster X, Y, Z, R, energy cut dependence
3630 //---------------------------------------------------------
3632 sprintf(cname,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
3633 TCanvas * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
3640 TLegend pLegendXCl(0.83,0.6,0.95,0.93);
3641 pLegendXCl.SetTextSize(0.03);
3642 pLegendXCl.SetFillColor(10);
3643 pLegendXCl.SetBorderSize(1);
3645 htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
3648 htmp->SetMinimum(1);
3649 rbR = GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
3650 //printf("new R rb %d\n",rbR);
3652 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3653 htmp->SetAxisRange(rmin,rmax,"X");
3655 pLegendXCl.AddEntry(htmp,"No cut","L");
3657 for (Int_t i = 0; i < ncuts; i++) {
3658 binmin = hE->FindBin(ecut[i]);
3659 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3660 htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
3661 htmp->SetLineColor(ecutcolor[i]);
3663 htmp->Draw("same HE");
3664 pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3673 htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
3675 htmp->SetMinimum(1);
3677 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3678 htmp->SetAxisRange(xmin,xmax,"X");
3681 for (Int_t i = 0; i < ncuts; i++) {
3682 binmin = hE->FindBin(ecut[i]);
3683 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3684 htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
3685 htmp->SetLineColor(ecutcolor[i]);
3687 htmp->Draw("same HE");
3694 htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
3696 htmp->SetMinimum(1);
3698 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3699 htmp->SetAxisRange(ymin,ymax,"X");
3702 for (Int_t i = 0; i < ncuts; i++) {
3703 binmin = hE->FindBin(ecut[i]);
3704 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3705 htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
3706 htmp->SetLineColor(ecutcolor[i]);
3708 htmp->Draw("same HE");
3716 htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
3718 htmp->SetMinimum(1);
3720 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3721 htmp->SetAxisRange(zmin,zmax,"X");
3724 for (Int_t i = 0; i < ncuts; i++) {
3725 binmin = hE->FindBin(ecut[i]);
3726 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3727 htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
3728 htmp->SetLineColor(ecutcolor[i]);
3730 htmp->Draw("same HE");
3734 sprintf(name,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3735 cxe->Print(name); printf("Create plot %s\n",name);
3738 //----------------------------------------------------------
3739 // Cluster X, Y, Z, R, NCells in cluster dependence
3740 //---------------------------------------------------------
3741 Int_t ncellcut[]={2, 3, 4};
3742 Int_t ncellcuts = 3;
3743 sprintf(cname,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
3744 TCanvas * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
3751 TLegend pLegendXClN(0.83,0.6,0.95,0.93);
3752 pLegendXClN.SetTextSize(0.03);
3753 pLegendXClN.SetFillColor(10);
3754 pLegendXClN.SetBorderSize(1);
3756 htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
3758 htmp->SetMinimum(1);
3760 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3761 htmp->SetAxisRange(rmin,rmax,"X");
3763 pLegendXClN.AddEntry(htmp,"No cut","L");
3765 for (Int_t i = 0; i < ncellcuts; i++) {
3766 if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3767 else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
3768 htmp->SetLineColor(ecutcolor[i]);
3770 htmp->Draw("same HE");
3771 if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3772 else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3782 htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
3784 htmp->SetMinimum(1);
3786 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3787 htmp->SetAxisRange(xmin,xmax,"X");
3790 for (Int_t i = 0; i < ncellcuts; i++) {
3791 if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3792 else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
3793 htmp->SetLineColor(ecutcolor[i]);
3795 htmp->Draw("same HE");
3802 htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
3804 htmp->SetMinimum(1);
3806 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3807 htmp->SetAxisRange(ymin,ymax,"X");
3810 for (Int_t i = 0; i < ncellcuts; i++) {
3811 if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3812 else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
3813 htmp->SetLineColor(ecutcolor[i]);
3815 htmp->Draw("same HE");
3823 htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
3825 htmp->SetMinimum(1);
3827 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3828 htmp->SetAxisRange(zmin,zmax,"X");
3831 for (Int_t i = 0; i < ncellcuts; i++) {
3832 if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3833 else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
3834 htmp->SetLineColor(ecutcolor[i]);
3836 htmp->Draw("same HE");
3840 sprintf(name,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
3841 cxn->Print(name); printf("Create plot %s\n",name);
3844 //----------------------------------------------------------
3845 // Cell X, Y, Z, R, energy cut dependence
3846 //---------------------------------------------------------
3848 sprintf(cname,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
3849 TCanvas * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
3850 cxecell->Divide(2, 2);
3856 TLegend pLegendXCell(0.83,0.6,0.95,0.93);
3857 pLegendXCell.SetTextSize(0.03);
3858 pLegendXCell.SetFillColor(10);
3859 pLegendXCell.SetBorderSize(1);
3861 htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
3863 htmp->SetMinimum(1);
3865 htmp->SetTitle("r of cells for energy in cluster > threshold");
3866 htmp->SetAxisRange(rmin,rmax,"X");
3868 pLegendXCell.AddEntry(htmp,"No cut","L");
3870 for (Int_t i = 0; i < ncuts; i++) {
3871 binmin = hE->FindBin(ecut[i]);
3872 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3873 htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
3874 htmp->SetLineColor(ecutcolor[i]);
3876 htmp->Draw("same HE");
3877 pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3880 pLegendXCell.Draw();
3887 htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
3889 htmp->SetMinimum(1);
3891 htmp->SetTitle("x of cells for energy in cluster > threshold");
3892 htmp->SetAxisRange(xmin,xmax,"X");
3895 for (Int_t i = 0; i < ncuts; i++) {
3896 binmin = hE->FindBin(ecut[i]);
3897 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3898 htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
3899 htmp->SetLineColor(ecutcolor[i]);
3901 htmp->Draw("same HE");
3908 htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
3910 htmp->SetMinimum(1);
3912 htmp->SetTitle("y of cells for energy in cluster > threshold");
3913 htmp->SetAxisRange(ymin,ymax,"X");
3916 for (Int_t i = 0; i < ncuts; i++) {
3917 binmin = hE->FindBin(ecut[i]);
3918 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3919 htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
3920 htmp->SetLineColor(ecutcolor[i]);
3922 htmp->Draw("same HE");
3929 htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
3931 htmp->SetMinimum(1);
3933 htmp->SetTitle("z of cells for energy in cluster > threshold");
3934 htmp->SetAxisRange(zmin,zmax,"X");
3937 for (Int_t i = 0; i < ncuts; i++) {
3938 binmin = hE->FindBin(ecut[i]);
3939 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3940 htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
3941 htmp->SetLineColor(ecutcolor[i]);
3943 htmp->Draw("same HE");
3946 sprintf(name,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3947 cxecell->Print(name); printf("Create plot %s\n",name);
3950 //----------------------------------------------------------
3951 // Cluster-Cell X, Y, Z, R, cluster energy cut dependence
3952 //---------------------------------------------------------
3953 Int_t rbDR= 1;//rbR;
3954 Int_t rbDX= 1;//rbX;
3955 Int_t rbDY= 1;//rbY;
3956 Int_t rbDZ= 1;//rbZ;
3958 sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
3959 TCanvas * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
3966 TLegend pLegendXClD(0.83,0.6,0.95,0.93);
3967 pLegendXClD.SetTextSize(0.03);
3968 pLegendXClD.SetFillColor(10);
3969 pLegendXClD.SetBorderSize(1);
3971 htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
3973 htmp->SetMinimum(1);
3975 htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
3976 htmp->SetAxisRange(-50,50,"X");
3978 pLegendXCl.AddEntry(htmp,"No cut","L");
3980 for (Int_t i = 0; i < ncuts; i++) {
3981 binmin = hE->FindBin(ecut[i]);
3982 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3983 htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
3984 htmp->SetLineColor(ecutcolor[i]);
3986 htmp->Draw("same HE");
3987 pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3996 htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
3998 htmp->SetMinimum(1);
4000 htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
4001 htmp->SetAxisRange(-50,50,"X");
4004 for (Int_t i = 0; i < ncuts; i++) {
4005 binmin = hE->FindBin(ecut[i]);
4006 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
4007 htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
4008 htmp->SetLineColor(ecutcolor[i]);
4010 htmp->Draw("same HE");
4018 htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
4020 htmp->SetMinimum(1);
4022 htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
4023 htmp->SetAxisRange(-50,50,"X");
4026 for (Int_t i = 0; i < ncuts; i++) {
4027 binmin = hE->FindBin(ecut[i]);
4028 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
4029 htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
4030 htmp->SetLineColor(ecutcolor[i]);
4032 htmp->Draw("same HE");
4041 htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
4043 htmp->SetMinimum(1);
4045 htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
4046 htmp->SetAxisRange(-50,50,"X");
4049 for (Int_t i = 0; i < ncuts; i++) {
4050 binmin = hE->FindBin(ecut[i]);
4051 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
4052 htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
4053 htmp->SetLineColor(ecutcolor[i]);
4055 htmp->Draw("same HE");
4060 sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
4061 cxde->Print(name); printf("Create plot %s\n",name);
4064 //----------------------------------------------------------
4065 // Cluster-Cell X, Y, Z, R, NCells in cluster dependence
4066 //---------------------------------------------------------
4067 sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
4068 TCanvas * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
4075 TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
4076 pLegendXClDN.SetTextSize(0.03);
4077 pLegendXClDN.SetFillColor(10);
4078 pLegendXClDN.SetBorderSize(1);
4080 htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
4082 htmp->SetMinimum(1);
4084 htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
4085 htmp->SetAxisRange(-50,50,"X");
4087 pLegendXClDN.AddEntry(htmp,"No cut","L");
4089 for (Int_t i = 0; i < ncellcuts; i++) {
4090 if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
4091 else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
4092 htmp->SetLineColor(ecutcolor[i]);
4094 htmp->Draw("same HE");
4095 if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
4096 else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
4100 pLegendXClDN.Draw();
4106 htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
4108 htmp->SetMinimum(1);
4110 htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
4111 htmp->SetAxisRange(-50,50,"X");
4114 for (Int_t i = 0; i < ncellcuts; i++) {
4115 if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
4116 else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
4117 htmp->SetLineColor(ecutcolor[i]);
4119 htmp->Draw("same HE");
4127 htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
4129 htmp->SetMinimum(1);
4131 htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
4132 htmp->SetAxisRange(-50,50,"X");
4135 for (Int_t i = 0; i < ncellcuts; i++) {
4136 if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
4137 else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
4138 htmp->SetLineColor(ecutcolor[i]);
4140 htmp->Draw("same HE");
4149 htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
4151 htmp->SetMinimum(1);
4153 htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
4154 htmp->SetAxisRange(-50,50,"X");
4157 for (Int_t i = 0; i < ncellcuts; i++) {
4158 if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
4159 else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
4160 htmp->SetLineColor(ecutcolor[i]);
4162 htmp->Draw("same HE");
4167 sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
4168 cxdn->Print(name); printf("Create plot %s\n",name);
4171 //----------------------------------------------------------
4172 //Reconstructed clusters energy-eta-phi distributions, matched with tracks
4173 //----------------------------------------------------------
4175 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
4176 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
4177 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
4178 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
4181 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
4182 TCanvas * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
4183 ccltm->Divide(3, 1);
4186 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
4187 fhECharged->Rebin(rbE);
4188 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4189 fhECharged->SetMinimum(1);
4193 if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
4194 fhPhiCharged->Rebin(rbPhi);
4195 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4196 fhPhiCharged->Draw();
4197 fhPhiCharged->Draw();
4200 if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
4201 fhEtaCharged->Rebin(rbEta);
4202 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4203 fhEtaCharged->Draw();
4204 fhEtaCharged->Draw();
4206 sprintf(name,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
4207 ccltm->Print(name); printf("Plot: %s\n",name);
4209 //----------------------------------------------------------
4210 // Ratio of reconstructed clusters energy-eta-phi distributions, matched with tracks over all
4211 //----------------------------------------------------------
4213 sprintf(cname,"%s_QA_ChargedRatio",fCalorimeter.Data());
4214 TCanvas * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
4215 ccharge->Divide(3, 1);
4218 fhECharged->Sumw2();
4220 fhECharged->Divide(fhE);
4221 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4222 fhECharged->SetMaximum(0.5);
4223 fhECharged->SetYTitle("track-matched clusters / all clusters");
4224 fhECharged->Draw("HE");
4227 fhPhiCharged->Sumw2();
4228 fhPhi->Rebin(rbPhi);
4230 fhPhiCharged->Divide(fhPhi);
4231 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4232 fhPhiCharged->SetMaximum(0.5);
4233 fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
4234 fhPhiCharged->Draw("HE");
4237 fhEtaCharged->Sumw2();
4238 fhEta->Rebin(rbEta);
4240 fhEtaCharged->Divide(fhEta);
4241 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4242 fhEtaCharged->SetMaximum(0.5);
4243 fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
4244 fhEtaCharged->Draw("HE");
4246 sprintf(name,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
4247 ccharge->Print(name); printf("Create plot %s\n",name);
4249 //-------------------------------------------
4250 // N Cells - N Clusters - N Cells per cluster
4251 //-------------------------------------------
4252 sprintf(cname,"QA_%s_nclustercells",fCalorimeter.Data());
4253 TCanvas * cN = new TCanvas(cname, " Number of CaloClusters and CaloCells", 800, 1200) ;
4258 TLegend pLegendN(0.7,0.6,0.9,0.8);
4259 pLegendN.SetTextSize(0.03);
4260 pLegendN.AddEntry(fhNClusters,"all modules","L");
4261 pLegendN.SetFillColor(10);
4262 pLegendN.SetBorderSize(1);
4264 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
4266 fhNClusters->SetLineColor(1);
4269 if(fhNClusters->GetNbinsX()> nbins) rbN = fhNClusters->GetNbinsX()/nbins;
4271 fhNClusters->SetAxisRange(nmin,nmax,"X");
4272 fhNClusters->Draw("HE");
4273 for(Int_t imod = 0; imod < fNModules; imod++){
4274 fhNClustersMod[imod]->SetAxisRange(nmin,nmax,"X");
4275 fhNClustersMod[imod]->SetLineColor(modColorIndex[imod]);
4276 fhNClustersMod[imod]->Draw("same");
4277 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
4283 for(Int_t imod = 1; imod < fNModules; imod++){
4284 htmp = (TH1D*)fhNClustersMod[imod]->Clone(Form("hNClustersRat%d",imod));
4285 htmp->Divide(fhNClustersMod[0]);
4286 htmp->SetLineColor(modColorIndex[imod]);
4288 htmp->SetTitle("Ratio # clusters in module X / module 0");
4289 htmp->SetMaximum(5);
4290 htmp->SetMinimum(0);
4294 htmp->Draw("same HE");
4299 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
4301 fhNCells->SetLineColor(1);
4302 fhNCells->SetAxisRange(nmin,nmax,"X");
4303 fhNCells->Draw("HE");
4304 for(Int_t imod = 0; imod < fNModules; imod++){
4305 fhNCellsMod[imod]->SetAxisRange(nmin,nmax,"X");
4306 fhNCellsMod[imod]->SetLineColor(modColorIndex[imod]);
4307 fhNCellsMod[imod]->Draw("same HE");
4313 for(Int_t imod = 1; imod < fNModules; imod++){
4314 htmp = (TH1D*)fhNCellsMod[imod]->Clone(Form("hNCellsRat%d",imod));
4315 htmp->Divide(fhNCellsMod[0]);
4316 htmp->SetLineColor(modColorIndex[imod]);
4318 htmp->SetTitle("Ratio # cells in module X / module 0");
4319 htmp->SetMaximum(5);
4320 htmp->SetMinimum(0);
4324 htmp->Draw("same HE");
4329 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
4331 TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1,-1,-1);
4332 cpc->SetLineColor(1);
4333 cpc->SetTitle("# cells per cluster");
4335 TH1D ** hNCellsCluster1D = new TH1D*[fNModules];
4337 for(Int_t imod = 0; imod < fNModules; imod++){
4338 hNCellsCluster1D[imod] = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
4339 hNCellsCluster1D[imod]->SetLineColor(modColorIndex[imod]);
4340 hNCellsCluster1D[imod]->Draw("same HE");
4346 for(Int_t imod = 1; imod < fNModules; imod++){
4347 htmp = (TH1D*)hNCellsCluster1D[imod]->Clone(Form("hNClustersCells1DRat%d",imod));
4348 htmp->Divide(hNCellsCluster1D[0]);
4349 htmp->SetLineColor(modColorIndex[imod]);
4351 htmp->SetTitle("Ratio # cells per cluster in module X / module 0");
4352 //htmp->SetAxisRange(ptmin,ptmax,"X");
4353 htmp->SetMaximum(3.5);
4354 htmp->SetMinimum(0);
4358 htmp->Draw("same HE");
4361 sprintf(name,"QA_%s_NumberCaloClustersAndCaloCells.eps",fCalorimeter.Data());
4362 cN->Print(name); printf("Print plot %s\n",name);
4364 //----------------------------------------------------
4365 // Cell Time histograms, time only available in ESDs
4366 //----------------------------------------------------
4367 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
4369 sprintf(cname,"QA_%s_cellstime",fCalorimeter.Data());
4370 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
4371 ctime->Divide(3, 1);
4374 if(fhTime->GetNbinsX()> ntimebins) rbTime = fhTime->GetNbinsX()/ntimebins;
4377 if(fhTime->GetEntries() > 0) gPad->SetLogy();
4378 fhTime->Rebin(rbTime);
4379 fhTime->SetAxisRange(timemin,timemax,"X");
4383 fhTimeId->SetTitleOffset(1.8,"Y");
4384 fhTimeId->SetAxisRange(timemin,timemax,"X");
4385 fhTimeId->Draw("colz");
4388 fhTimeAmp->SetTitle("Cell Energy vs Cell Time");
4389 fhTimeAmp->SetTitleOffset(1.8,"Y");
4390 fhTimeAmp->SetAxisRange(timemin,timemax,"Y");
4391 fhTimeAmp->SetAxisRange(ptmin,ptmax,"X");
4392 fhTimeAmp->Draw("colz");
4394 sprintf(name,"QA_%s_CellsTime.eps",fCalorimeter.Data());
4395 ctime->Print(name); printf("Plot: %s\n",name);
4399 //---------------------------------
4400 //Grid of cell per module plots
4401 //---------------------------------
4403 //Number of entries per cell
4404 gStyle->SetPadRightMargin(0.15);
4405 sprintf(cname,"%s_QA_GridCellEntries",fCalorimeter.Data());
4406 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
4407 if(fNModules%2 == 0)
4408 cgrid->Divide(fNModules/2,2);
4410 cgrid->Divide(fNModules/2+1,2);
4412 for(Int_t imod = 0; imod < fNModules ; imod++){
4417 //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
4418 fhGridCellsMod[imod]->SetZTitle("Counts ");
4419 fhGridCellsMod[imod]->SetYTitle("row (phi direction) ");
4420 //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
4421 fhGridCellsMod[imod]->Draw("colz");
4423 sprintf(name,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
4424 cgrid->Print(name); printf("Create plot %s\n",name);
4426 sprintf(cname,"%s_QA_GridCellAccumEnergy",fCalorimeter.Data());
4427 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
4428 if(fNModules%2 == 0)
4429 cgridE->Divide(fNModules/2,2);
4431 cgridE->Divide(fNModules/2+1,2);
4432 for(Int_t imod = 0; imod < fNModules ; imod++){
4437 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4438 fhGridCellsEMod[imod]->SetZTitle("Accumulated Energy (GeV) ");
4439 fhGridCellsEMod[imod]->SetYTitle("row (phi direction) ");
4440 fhGridCellsEMod[imod]->Draw("colz");
4442 sprintf(name,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
4443 cgridE->Print(name); printf("Create plot %s\n",name);
4445 //Accumulated energy per cell
4446 sprintf(cname,"%s_QA_GridCellAverageEnergy",fCalorimeter.Data());
4447 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
4448 if(fNModules%2 == 0)
4449 cgridEA->Divide(fNModules/2,2);
4451 cgridEA->Divide(fNModules/2+1,2);
4452 for(Int_t imod = 0; imod < fNModules ; imod++){
4453 cgridEA->cd(imod+1);
4457 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4458 fhGridCellsEMod[imod]->SetZTitle("Average Energy (GeV) ");
4459 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
4460 fhGridCellsEMod[imod]->Draw("colz");
4462 sprintf(name,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
4463 cgridEA->Print(name); printf("Create plot %s\n",name);
4465 //Accumulated Time per cell, E > 0.5 GeV
4467 sprintf(cname,"%s_QA_GridCellAccumTime",fCalorimeter.Data());
4468 TCanvas *cgridT = new TCanvas("cgridT","Summed time per cell", 12,12,800,400);
4469 if(fNModules%2 == 0)
4470 cgridT->Divide(fNModules/2,2);
4472 cgridE->Divide(fNModules/2+1,2);
4473 for(Int_t imod = 0; imod < fNModules ; imod++){
4478 //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
4479 fhGridCellsTimeMod[imod]->SetZTitle("Accumulated Time (ns) ");
4480 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction) ");
4481 fhGridCellsTimeMod[imod]->Draw("colz");
4483 sprintf(name,"QA_%s_GridCellsAccumTime.eps",fCalorimeter.Data());
4484 cgridT->Print(name); printf("Create plot %s\n",name);
4488 //---------------------------------------------
4489 //Calorimeter Correlation, PHOS vs EMCAL
4490 //---------------------------------------------
4491 if(fCorrelateCalos){
4493 sprintf(cname,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
4494 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
4495 ccorr->Divide(2, 2);
4500 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"X");
4501 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"Y");
4502 fhCaloCorrNClusters ->Draw();
4507 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"X");
4508 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"Y");
4509 fhCaloCorrNCells->Draw();
4513 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"X");
4514 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"Y");
4515 fhCaloCorrEClusters->Draw();
4520 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"X");
4521 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"Y");
4522 fhCaloCorrECells->Draw();
4524 sprintf(name,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
4525 ccorr->Print(name); printf("Plot: %s\n",name);
4528 //----------------------------
4530 //-----------------------------
4532 Int_t imbinmin = -1;
4533 Int_t imbinmax = -1;
4535 if(fhIM->GetEntries() > 1){
4536 Int_t nebins = fhIM->GetNbinsX();
4537 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
4538 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
4539 if (emin != 0 ) printf("emin != 0 \n");
4540 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4542 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
4544 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
4548 //fhIM->SetLineColor(4);
4551 imbinmax = (Int_t) (1-emin)*nebins/emax;
4552 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),imbinmin,imbinmax);
4553 pyim1->SetTitle("E_{pair} < 1 GeV");
4554 pyim1->SetLineColor(1);
4556 TLegend pLegendIM(0.7,0.6,0.9,0.8);
4557 pLegendIM.SetTextSize(0.03);
4558 pLegendIM.AddEntry(pyim1,"all modules","L");
4559 pLegendIM.SetFillColor(10);
4560 pLegendIM.SetBorderSize(1);
4562 for(Int_t imod = 0; imod < fNModules; imod++){
4563 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4564 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
4565 pyim1->SetLineColor(imod+1);
4566 pyim1->Draw("same");
4571 imbinmin = (Int_t) (1-emin)*nebins/emax;
4572 imbinmax = (Int_t) (2-emin)*nebins/emax;
4573 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),imbinmin,imbinmax);
4574 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
4575 pyim2->SetLineColor(1);
4577 for(Int_t imod = 0; imod < fNModules; imod++){
4578 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4579 pyim2->SetLineColor(imod+1);
4580 pyim2->Draw("same");
4584 imbinmin = (Int_t) (2-emin)*nebins/emax;
4585 imbinmax = (Int_t) (3-emin)*nebins/emax;
4586 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),imbinmin,imbinmax);
4587 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
4588 pyim3->SetLineColor(1);
4590 for(Int_t imod = 0; imod < fNModules; imod++){
4591 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4592 pyim3->SetLineColor(imod+1);
4593 pyim3->Draw("same");
4597 imbinmin = (Int_t) (3-emin)*nebins/emax;
4598 imbinmax = (Int_t) (4-emin)*nebins/emax;
4599 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),imbinmin,imbinmax);
4600 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
4601 pyim4->SetLineColor(1);
4603 for(Int_t imod = 0; imod < fNModules; imod++){
4604 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4605 pyim4->SetLineColor(imod+1);
4606 pyim4->Draw("same");
4610 imbinmin = (Int_t) (4-emin)*nebins/emax;
4611 imbinmax = (Int_t) (5-emin)*nebins/emax;
4612 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),imbinmin,imbinmax);
4613 pyim5->SetTitle("4< E_{pair} < 5 GeV");
4614 pyim5->SetLineColor(1);
4616 for(Int_t imod = 0; imod < fNModules; imod++){
4617 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4618 pyim5->SetLineColor(imod+1);
4619 pyim5->Draw("same");
4623 imbinmin = (Int_t) (5-emin)*nebins/emax;
4625 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),imbinmin,imbinmax);
4626 pyim10->SetTitle("E_{pair} > 5 GeV");
4627 pyim10->SetLineColor(1);
4629 for(Int_t imod = 0; imod < fNModules; imod++){
4630 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4631 pyim10->SetLineColor(imod+1);
4632 pyim10->Draw("same");
4635 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
4636 c5->Print(name); printf("Plot: %s\n",name);
4639 //--------------------------------------------------
4640 //Invariant mass, clusters with more than one cell
4641 //-------------------------------------------------
4642 if(fhIMCellCut->GetEntries() > 1){
4643 Int_t nebins = fhIMCellCut->GetNbinsX();
4644 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
4645 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
4646 if (emin != 0 ) printf("emin != 0 \n");
4647 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4649 sprintf(cname,"QA_%s_IMCellCut",fCalorimeter.Data());
4650 // printf("c5cc\n");
4651 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
4655 //fhIMCellCut->SetLineColor(4);
4656 //fhIMCellCut->Draw();
4658 imbinmax = (Int_t) (1-emin)*nebins/emax;
4659 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),imbinmin,imbinmax);
4660 pyimcc1->SetTitle("E_{pair} < 1 GeV");
4661 pyimcc1->SetLineColor(1);
4663 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
4664 pLegendIMCellCut.SetTextSize(0.03);
4665 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
4666 pLegendIMCellCut.SetFillColor(10);
4667 pLegendIMCellCut.SetBorderSize(1);
4669 for(Int_t imod = 0; imod < fNModules; imod++){
4670 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4671 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
4672 pyimcc1->SetLineColor(imod+1);
4673 pyimcc1->Draw("same");
4675 pLegendIMCellCut.Draw();
4678 imbinmin = (Int_t) (1-emin)*nebins/emax;
4679 imbinmax = (Int_t) (2-emin)*nebins/emax;
4680 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),imbinmin,imbinmax);
4681 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
4682 pyimcc2->SetLineColor(1);
4684 for(Int_t imod = 0; imod < fNModules; imod++){
4685 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4686 pyimcc2->SetLineColor(imod+1);
4687 pyimcc2->Draw("same");
4691 imbinmin = (Int_t) (2-emin)*nebins/emax;
4692 imbinmax = (Int_t) (3-emin)*nebins/emax;
4693 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),imbinmin,imbinmax);
4694 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
4695 pyimcc3->SetLineColor(1);
4697 for(Int_t imod = 0; imod < fNModules; imod++){
4698 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4699 pyimcc3->SetLineColor(imod+1);
4700 pyimcc3->Draw("same");
4704 imbinmin = (Int_t) (3-emin)*nebins/emax;
4705 imbinmax = (Int_t) (4-emin)*nebins/emax;
4706 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),imbinmin,imbinmax);
4707 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
4708 pyimcc4->SetLineColor(1);
4710 for(Int_t imod = 0; imod < fNModules; imod++){
4711 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4712 pyimcc4->SetLineColor(imod+1);
4713 pyimcc4->Draw("same");
4717 imbinmin = (Int_t) (4-emin)*nebins/emax;
4718 imbinmax = (Int_t) (5-emin)*nebins/emax;
4719 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),imbinmin,imbinmax);
4720 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
4721 pyimcc5cc->SetLineColor(1);
4723 for(Int_t imod = 0; imod < fNModules; imod++){
4724 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4725 pyimcc5cc->SetLineColor(imod+1);
4726 pyimcc5cc->Draw("same");
4730 imbinmin = (Int_t) (5-emin)*nebins/emax;
4732 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),imbinmin,imbinmax);
4733 pyimcc10->SetTitle("E_{pair} > 5 GeV");
4734 pyimcc10->SetLineColor(1);
4736 for(Int_t imod = 0; imod < fNModules; imod++){
4737 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4738 pyimcc10->SetLineColor(imod+1);
4739 pyimcc10->Draw("same");
4742 sprintf(name,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
4743 c5cc->Print(name); printf("Plot: %s\n",name);
4748 if(fhAsym->GetEntries() > 1){
4749 Int_t nebins = fhAsym->GetNbinsX();
4750 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
4751 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
4752 if (emin != 0 ) printf("emin != 0 \n");
4753 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4755 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
4757 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
4761 fhAsym->SetTitleOffset(1.6,"Y");
4762 fhAsym->SetLineColor(4);
4767 imbinmax = (Int_t) (5-emin)*nebins/emax;
4768 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),imbinmin,imbinmax);
4769 pyAsym5->SetTitle("E_{pair} < 5 GeV");
4770 pyAsym5->SetLineColor(4);
4774 imbinmin = (Int_t) (5-emin)*nebins/emax;
4775 imbinmax = (Int_t) (10-emin)*nebins/emax;
4776 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),imbinmin,imbinmax);
4777 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
4778 pyAsym510->SetLineColor(4);
4782 imbinmin = (Int_t) (10-emin)*nebins/emax;
4784 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),imbinmin,imbinmax);
4785 pyAsym10->SetTitle("E_{pair} > 10 GeV");
4786 pyAsym10->SetLineColor(4);
4789 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
4790 c5b->Print(name); printf("Plot: %s\n",name);
4795 //Reconstructed vs MC distributions
4797 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
4798 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4802 fh2E->SetTitleOffset(1.6,"Y");
4803 fh2E->SetLineColor(4);
4807 fh2Pt->SetTitleOffset(1.6,"Y");
4808 fh2Pt->SetLineColor(4);
4812 fh2Phi->SetTitleOffset(1.6,"Y");
4813 fh2Phi->SetLineColor(4);
4817 fh2Eta->SetTitleOffset(1.6,"Y");
4818 fh2Eta->SetLineColor(4);
4821 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4822 c6->Print(name); printf("Plot: %s\n",name);
4824 //Reconstructed vs MC distributions
4826 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
4827 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4828 c6Gam->Divide(2, 2);
4842 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4843 c6->Print(name); printf("Plot: %s\n",name);
4845 //Generated - reconstructed
4847 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
4848 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
4852 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
4853 fhGamDeltaE->SetLineColor(4);
4855 fhGamDeltaE->Draw("same");
4857 TLegend pLegendd(0.65,0.55,0.9,0.8);
4858 pLegendd.SetTextSize(0.06);
4859 pLegendd.AddEntry(fhDeltaE,"all","L");
4860 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
4861 pLegendd.SetFillColor(10);
4862 pLegendd.SetBorderSize(1);
4866 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
4867 fhGamDeltaPt->SetLineColor(4);
4869 fhGamDeltaPt->Draw("same");
4872 fhGamDeltaPhi->SetLineColor(4);
4874 fhGamDeltaPhi->Draw("same");
4877 fhGamDeltaEta->SetLineColor(4);
4879 fhGamDeltaEta->Draw("same");
4881 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
4882 c7->Print(name); printf("Plot: %s\n",name);
4884 // Reconstructed / Generated
4886 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
4887 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
4891 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
4892 fhGamRatioE->SetLineColor(4);
4894 fhGamRatioE->Draw("same");
4896 TLegend pLegendr(0.65,0.55,0.9,0.8);
4897 pLegendr.SetTextSize(0.06);
4898 pLegendr.AddEntry(fhRatioE,"all","L");
4899 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
4900 pLegendr.SetFillColor(10);
4901 pLegendr.SetBorderSize(1);
4905 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
4906 fhGamRatioPt->SetLineColor(4);
4908 fhGamRatioPt->Draw("same");
4911 fhGamRatioPhi->SetLineColor(4);
4913 fhGamRatioPhi->Draw("same");
4916 fhGamRatioEta->SetLineColor(4);
4918 fhGamRatioEta->Draw("same");
4920 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
4921 c8->Print(name); printf("Plot: %s\n",name);
4925 //Generated distributions
4927 sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
4928 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
4933 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
4934 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
4935 fhGenPi0Pt->SetLineColor(1);
4936 fhGenGamPt->SetLineColor(4);
4937 fhGenEtaPt->SetLineColor(2);
4938 fhGenOmegaPt->SetLineColor(7);
4939 fhGenElePt->SetLineColor(6);
4941 //Select the maximum of the histogram to show all lines.
4942 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4943 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
4944 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
4945 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4946 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
4947 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
4948 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
4949 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4950 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
4951 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4952 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4953 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
4954 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4955 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
4956 haxispt->SetMaximum(fhGenElePt->GetMaximum());
4957 haxispt->SetMinimum(1);
4958 haxispt->Draw("axis");
4959 fhGenPi0Pt->Draw("same");
4960 fhGenGamPt->Draw("same");
4961 fhGenEtaPt->Draw("same");
4962 fhGenOmegaPt->Draw("same");
4963 fhGenElePt->Draw("same");
4965 TLegend pLegend(0.85,0.65,0.95,0.93);
4966 pLegend.SetTextSize(0.06);
4967 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
4968 pLegend.AddEntry(fhGenGamPt," #gamma","L");
4969 pLegend.AddEntry(fhGenEtaPt," #eta","L");
4970 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
4971 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
4972 pLegend.SetFillColor(10);
4973 pLegend.SetBorderSize(1);
4978 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
4979 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
4980 fhGenPi0Eta->SetLineColor(1);
4981 fhGenGamEta->SetLineColor(4);
4982 fhGenEtaEta->SetLineColor(2);
4983 fhGenOmegaEta->SetLineColor(7);
4984 fhGenEleEta->SetLineColor(6);
4985 //Select the maximum of the histogram to show all lines.
4986 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4987 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
4988 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
4989 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4990 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4991 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
4992 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
4993 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4994 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
4995 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4996 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4997 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
4998 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4999 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
5000 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
5001 haxiseta->SetMinimum(100);
5002 haxiseta->Draw("axis");
5003 fhGenPi0Eta->Draw("same");
5004 fhGenGamEta->Draw("same");
5005 fhGenEtaEta->Draw("same");
5006 fhGenOmegaEta->Draw("same");
5007 fhGenEleEta->Draw("same");
5012 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
5013 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
5014 fhGenPi0Phi->SetLineColor(1);
5015 fhGenGamPhi->SetLineColor(4);
5016 fhGenEtaPhi->SetLineColor(2);
5017 fhGenOmegaPhi->SetLineColor(7);
5018 fhGenElePhi->SetLineColor(6);
5019 //Select the maximum of the histogram to show all lines.
5020 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
5021 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
5022 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
5023 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
5024 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
5025 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
5026 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
5027 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
5028 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
5029 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
5030 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
5031 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
5032 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
5033 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
5034 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
5035 haxisphi->SetMinimum(100);
5036 haxisphi->Draw("axis");
5037 fhGenPi0Phi->Draw("same");
5038 fhGenGamPhi->Draw("same");
5039 fhGenEtaPhi->Draw("same");
5040 fhGenOmegaPhi->Draw("same");
5041 fhGenElePhi->Draw("same");
5043 sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
5044 c10->Print(name); printf("Plot: %s\n",name);
5047 //Reconstructed clusters depending on its original particle.
5049 sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
5050 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
5056 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
5057 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
5058 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
5059 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
5060 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
5061 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
5062 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
5063 hPi0E->SetLineColor(1);
5064 hGamE->SetLineColor(4);
5065 hNeHadE->SetLineColor(2);
5066 hChHadE->SetLineColor(7);
5067 hEleE->SetLineColor(6);
5069 //Select the maximum of the histogram to show all lines.
5070 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
5071 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
5072 haxisE->SetMaximum(hPi0E->GetMaximum());
5073 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
5074 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
5075 haxisE->SetMaximum(hGamE->GetMaximum());
5076 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
5077 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
5078 haxisE->SetMaximum(hNeHadE->GetMaximum());
5079 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
5080 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
5081 haxisE->SetMaximum(hChHadE->GetMaximum());
5082 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
5083 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
5084 haxisE->SetMaximum(hEleE->GetMaximum());
5085 haxisE->SetXTitle("E (GeV)");
5086 haxisE->SetMinimum(1);
5087 haxisE->Draw("axis");
5088 hPi0E->Draw("same");
5089 hGamE->Draw("same");
5090 hNeHadE->Draw("same");
5091 hChHadE->Draw("same");
5092 hEleE->Draw("same");
5094 TLegend pLegend2(0.8,0.65,0.95,0.93);
5095 pLegend2.SetTextSize(0.06);
5096 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
5097 pLegend2.AddEntry(hGamE," #gamma","L");
5098 pLegend2.AddEntry(hEleE," e^{#pm}","L");
5099 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
5100 pLegend2.AddEntry(hNeHadE," h^{0}","L");
5101 pLegend2.SetFillColor(10);
5102 pLegend2.SetBorderSize(1);
5108 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
5109 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
5110 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
5111 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
5112 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
5113 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
5114 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
5115 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
5116 hPi0Pt->SetLineColor(1);
5117 hGamPt->SetLineColor(4);
5118 hNeHadPt->SetLineColor(2);
5119 hChHadPt->SetLineColor(7);
5120 hElePt->SetLineColor(6);
5122 //Select the maximum of the histogram to show all lines.
5123 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5124 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
5125 haxispt->SetMaximum(hPi0Pt->GetMaximum());
5126 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5127 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
5128 haxispt->SetMaximum(hGamPt->GetMaximum());
5129 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
5130 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
5131 haxispt->SetMaximum(hNeHadPt->GetMaximum());
5132 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5133 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
5134 haxispt->SetMaximum(hChHadPt->GetMaximum());
5135 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5136 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
5137 haxispt->SetMaximum(hElePt->GetMaximum());
5138 haxispt->SetXTitle("p_{T} (GeV/c)");
5139 haxispt->SetMinimum(1);
5140 haxispt->Draw("axis");
5141 hPi0Pt->Draw("same");
5142 hGamPt->Draw("same");
5143 hNeHadPt->Draw("same");
5144 hChHadPt->Draw("same");
5145 hElePt->Draw("same");
5150 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
5151 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
5152 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
5153 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
5154 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
5155 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
5156 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
5157 hPi0Eta->SetLineColor(1);
5158 hGamEta->SetLineColor(4);
5159 hNeHadEta->SetLineColor(2);
5160 hChHadEta->SetLineColor(7);
5161 hEleEta->SetLineColor(6);
5162 //Select the maximum of the histogram to show all lines.
5163 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5164 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
5165 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
5166 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5167 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
5168 haxiseta->SetMaximum(hGamEta->GetMaximum());
5169 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
5170 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
5171 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
5172 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5173 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
5174 haxiseta->SetMaximum(hChHadEta->GetMaximum());
5175 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5176 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
5177 haxiseta->SetMaximum(hEleEta->GetMaximum());
5179 haxiseta->SetXTitle("#eta");
5180 haxiseta->Draw("axis");
5181 hPi0Eta->Draw("same");
5182 hGamEta->Draw("same");
5183 hNeHadEta->Draw("same");
5184 hChHadEta->Draw("same");
5185 hEleEta->Draw("same");
5190 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
5191 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
5192 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
5193 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
5194 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
5195 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
5196 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
5198 hPi0Phi->SetLineColor(1);
5199 hGamPhi->SetLineColor(4);
5200 hNeHadPhi->SetLineColor(2);
5201 hChHadPhi->SetLineColor(7);
5202 hElePhi->SetLineColor(6);
5203 //Select the maximum of the histogram to show all lines.
5204 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5205 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
5206 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
5207 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5208 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
5209 haxisphi->SetMaximum(hGamPhi->GetMaximum());
5210 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
5211 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5212 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
5213 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5214 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5215 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
5216 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5217 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
5218 haxisphi->SetMaximum(hElePhi->GetMaximum());
5219 haxisphi->SetXTitle("#phi (rad)");
5220 haxisphi->Draw("axis");
5221 hPi0Phi->Draw("same");
5222 hGamPhi->Draw("same");
5223 hNeHadPhi->Draw("same");
5224 hChHadPhi->Draw("same");
5225 hElePhi->Draw("same");
5227 sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
5228 c11->Print(name); printf("Plot: %s\n",name);
5231 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
5234 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
5235 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
5236 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
5237 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
5238 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
5239 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
5240 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
5241 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
5243 sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
5244 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
5249 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5250 hPi0EClone->Divide(fhGenPi0AccE);
5251 hGamEClone->Divide(fhGenGamAccE);
5252 haxisE->SetMaximum(5);
5253 haxisE->SetMinimum(1e-2);
5254 haxisE->SetXTitle("E (GeV)");
5255 haxisE->SetYTitle("ratio = rec/gen");
5256 haxisE->Draw("axis");
5257 hPi0E->Draw("same");
5258 hGamE->Draw("same");
5260 TLegend pLegend3(0.75,0.2,0.9,0.4);
5261 pLegend3.SetTextSize(0.06);
5262 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
5263 pLegend3.AddEntry(hGamEClone," #gamma","L");
5264 pLegend3.SetFillColor(10);
5265 pLegend3.SetBorderSize(1);
5270 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5271 hPi0PtClone->Divide(fhGenPi0AccPt);
5272 hGamPtClone->Divide(fhGenGamAccPt);
5273 haxispt->SetMaximum(5);
5274 haxispt->SetMinimum(1e-2);
5275 haxispt->SetXTitle("p_{T} (GeV/c)");
5276 haxispt->SetYTitle("ratio = rec/gen");
5277 haxispt->Draw("axis");
5278 hPi0PtClone->Draw("same");
5279 hGamPtClone->Draw("same");
5284 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5285 hPi0EtaClone->Divide(fhGenPi0AccEta);
5286 hGamEtaClone->Divide(fhGenGamAccEta);
5287 haxiseta->SetMaximum(1.2);
5288 haxiseta->SetMinimum(1e-2);
5289 haxiseta->SetYTitle("ratio = rec/gen");
5290 haxiseta->SetXTitle("#eta");
5291 haxiseta->Draw("axis");
5292 hPi0EtaClone->Draw("same");
5293 hGamEtaClone->Draw("same");
5298 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5299 hPi0PhiClone->Divide(fhGenPi0AccPhi);
5300 hGamPhiClone->Divide(fhGenGamAccPhi);
5301 haxisphi->SetYTitle("ratio = rec/gen");
5302 haxisphi->SetXTitle("#phi (rad)");
5303 haxisphi->SetMaximum(1.2);
5304 haxisphi->SetMinimum(1e-2);
5305 haxisphi->Draw("axis");
5306 hPi0PhiClone->Draw("same");
5307 hGamPhiClone->Draw("same");
5309 sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
5310 c12->Print(name); printf("Plot: %s\n",name);
5314 //Reconstructed distributions
5316 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
5317 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
5322 fhEMVxyz->SetTitleOffset(1.6,"Y");
5327 fhHaVxyz->SetTitleOffset(1.6,"Y");
5332 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
5333 hEMR->SetLineColor(4);
5338 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
5339 hHaR->SetLineColor(4);
5343 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
5344 c13->Print(name); printf("Plot: %s\n",name);
5347 //Track-matching distributions
5349 //Reconstructed distributions, matched with tracks, generated particle dependence
5351 sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
5352 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
5353 c22ch->Divide(2, 2);
5357 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
5358 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
5359 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
5360 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
5361 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
5362 hPi0ECharged->SetLineColor(1);
5363 hGamECharged->SetLineColor(4);
5364 hNeHadECharged->SetLineColor(2);
5365 hChHadECharged->SetLineColor(7);
5366 hEleECharged->SetLineColor(6);
5368 fhECharged->SetLineColor(3);
5369 fhECharged->SetMinimum(0.5);
5371 hPi0ECharged->Draw("same");
5372 hGamECharged->Draw("same");
5373 hNeHadECharged->Draw("same");
5374 hChHadECharged->Draw("same");
5375 hEleECharged->Draw("same");
5376 TLegend pLegend22(0.75,0.45,0.9,0.8);
5377 pLegend22.SetTextSize(0.06);
5378 pLegend22.AddEntry(fhECharged,"all","L");
5379 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
5380 pLegend22.AddEntry(hGamECharged,"#gamma","L");
5381 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
5382 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
5383 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
5384 pLegend22.SetFillColor(10);
5385 pLegend22.SetBorderSize(1);
5390 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
5391 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
5392 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
5393 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
5394 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
5395 hPi0PtCharged->SetLineColor(1);
5396 hGamPtCharged->SetLineColor(4);
5397 hNeHadPtCharged->SetLineColor(2);
5398 hChHadPtCharged->SetLineColor(7);
5399 hElePtCharged->SetLineColor(6);
5401 fhPtCharged->SetLineColor(3);
5402 fhPtCharged->SetMinimum(0.5);
5403 fhPtCharged->Draw();
5404 hPi0PtCharged->Draw("same");
5405 hGamPtCharged->Draw("same");
5406 hNeHadPtCharged->Draw("same");
5407 hChHadPtCharged->Draw("same");
5408 hElePtCharged->Draw("same");
5412 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
5413 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
5414 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
5415 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
5416 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
5417 hPi0EtaCharged->SetLineColor(1);
5418 hGamEtaCharged->SetLineColor(4);
5419 hNeHadEtaCharged->SetLineColor(2);
5420 hChHadEtaCharged->SetLineColor(7);
5421 hEleEtaCharged->SetLineColor(6);
5423 fhEtaCharged->SetLineColor(3);
5424 fhEtaCharged->SetMinimum(0.5);
5425 fhEtaCharged->Draw();
5426 hPi0EtaCharged->Draw("same");
5427 hGamEtaCharged->Draw("same");
5428 hNeHadEtaCharged->Draw("same");
5429 hChHadEtaCharged->Draw("same");
5430 hEleEtaCharged->Draw("same");
5434 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
5435 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
5436 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
5437 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
5438 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
5439 hPi0PhiCharged->SetLineColor(1);
5440 hGamPhiCharged->SetLineColor(4);
5441 hNeHadPhiCharged->SetLineColor(2);
5442 hChHadPhiCharged->SetLineColor(7);
5443 hElePhiCharged->SetLineColor(6);
5445 fhPhiCharged->SetLineColor(3);
5446 fhPhiCharged->SetMinimum(0.5);
5447 fhPhiCharged->Draw();
5448 hPi0PhiCharged->Draw("same");
5449 hGamPhiCharged->Draw("same");
5450 hNeHadPhiCharged->Draw("same");
5451 hChHadPhiCharged->Draw("same");
5452 hElePhiCharged->Draw("same");
5455 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
5456 c22ch->Print(name); printf("Plot: %s\n",name);
5458 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
5459 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
5460 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
5461 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
5463 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
5464 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
5465 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
5466 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
5468 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
5469 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
5470 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
5471 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
5473 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
5474 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
5475 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
5476 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
5478 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
5479 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
5480 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
5481 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
5483 //Ratio: reconstructed track matched/ all reconstructed
5485 sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
5486 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
5490 hEChargedClone->SetMaximum(1.2);
5491 hEChargedClone->SetMinimum(0.001);
5492 hEChargedClone->SetLineColor(3);
5493 hEChargedClone->SetYTitle("track matched / all");
5494 hPi0EChargedClone->Divide(hPi0E);
5495 hGamEChargedClone->Divide(hGamE);
5496 hEleEChargedClone->Divide(hEleE);
5497 hNeHadEChargedClone->Divide(hNeHadE);
5498 hChHadEChargedClone->Divide(hChHadE);
5499 hEChargedClone->Draw();
5500 hPi0EChargedClone->Draw("same");
5501 hGamEChargedClone->Draw("same");
5502 hEleEChargedClone->Draw("same");
5503 hNeHadEChargedClone->Draw("same");
5504 hChHadEChargedClone->Draw("same");
5506 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
5507 pLegend3ch.SetTextSize(0.06);
5508 pLegend3ch.AddEntry(hEChargedClone,"all","L");
5509 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
5510 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
5511 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
5512 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
5513 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
5514 pLegend3ch.SetFillColor(10);
5515 pLegend3ch.SetBorderSize(1);
5519 hPtChargedClone->SetMaximum(1.2);
5520 hPtChargedClone->SetMinimum(0.001);
5521 hPtChargedClone->SetLineColor(3);
5522 hPtChargedClone->SetYTitle("track matched / all");
5523 hPi0PtChargedClone->Divide(hPi0Pt);
5524 hGamPtChargedClone->Divide(hGamPt);
5525 hElePtChargedClone->Divide(hElePt);
5526 hNeHadPtChargedClone->Divide(hNeHadPt);
5527 hChHadPtChargedClone->Divide(hChHadPt);
5528 hPtChargedClone->Draw();
5529 hPi0PtChargedClone->Draw("same");
5530 hGamPtChargedClone->Draw("same");
5531 hElePtChargedClone->Draw("same");
5532 hNeHadPtChargedClone->Draw("same");
5533 hChHadPtChargedClone->Draw("same");
5536 hEtaChargedClone->SetMaximum(1.2);
5537 hEtaChargedClone->SetMinimum(0.001);
5538 hEtaChargedClone->SetLineColor(3);
5539 hEtaChargedClone->SetYTitle("track matched / all");
5540 hPi0EtaChargedClone->Divide(hPi0Eta);
5541 hGamEtaChargedClone->Divide(hGamEta);
5542 hEleEtaChargedClone->Divide(hEleEta);
5543 hNeHadEtaChargedClone->Divide(hNeHadEta);
5544 hChHadEtaChargedClone->Divide(hChHadEta);
5545 hEtaChargedClone->Draw();
5546 hPi0EtaChargedClone->Draw("same");
5547 hGamEtaChargedClone->Draw("same");
5548 hEleEtaChargedClone->Draw("same");
5549 hNeHadEtaChargedClone->Draw("same");
5550 hChHadEtaChargedClone->Draw("same");
5553 hPhiChargedClone->SetMaximum(1.2);
5554 hPhiChargedClone->SetMinimum(0.001);
5555 hPhiChargedClone->SetLineColor(3);
5556 hPhiChargedClone->SetYTitle("track matched / all");
5557 hPi0PhiChargedClone->Divide(hPi0Phi);
5558 hGamPhiChargedClone->Divide(hGamPhi);
5559 hElePhiChargedClone->Divide(hElePhi);
5560 hNeHadPhiChargedClone->Divide(hNeHadPhi);
5561 hChHadPhiChargedClone->Divide(hChHadPhi);
5562 hPhiChargedClone->Draw();
5563 hPi0PhiChargedClone->Draw("same");
5564 hGamPhiChargedClone->Draw("same");
5565 hElePhiChargedClone->Draw("same");
5566 hNeHadPhiChargedClone->Draw("same");
5567 hChHadPhiChargedClone->Draw("same");
5569 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
5570 c3ch->Print(name); printf("Plot: %s\n",name);
5573 //Track-matching distributions
5575 sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
5576 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
5579 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
5580 pLegendpE0.SetTextSize(0.04);
5581 pLegendpE0.AddEntry(fh1pOverE,"all","L");
5582 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
5583 pLegendpE0.SetFillColor(10);
5584 pLegendpE0.SetBorderSize(1);
5585 //pLegendpE0.Draw();
5588 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
5589 fh1pOverE->SetTitle("Track matches p/E");
5591 fh1pOverER02->SetLineColor(4);
5592 fh1pOverER02->Draw("same");
5596 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
5600 fh2MatchdEdx->Draw();
5605 sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
5606 cme->Print(name); printf("Plot: %s\n",name);
5609 sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
5610 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
5615 fhMCEle1pOverE->Draw();
5616 fhMCEle1pOverER02->SetLineColor(4);
5617 fhMCEle1pOverE->SetLineColor(1);
5618 fhMCEle1pOverER02->Draw("same");
5626 fhMCEle2MatchdEdx->Draw();
5628 sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
5629 cmemc->Print(name); printf("Plot: %s\n",name);
5632 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
5633 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
5634 cmemchad->Divide(3,1);
5638 fhMCChHad1pOverE->Draw();
5639 fhMCChHad1pOverER02->SetLineColor(4);
5640 fhMCChHad1pOverE->SetLineColor(1);
5641 fhMCChHad1pOverER02->Draw("same");
5646 fhMCChHad1dR->Draw();
5649 fhMCChHad2MatchdEdx->Draw();
5651 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
5652 cmemchad->Print(name); printf("Plot: %s\n",name);
5654 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
5655 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
5656 cmemcn->Divide(3,1);
5660 fhMCNeutral1pOverE->Draw();
5661 fhMCNeutral1pOverE->SetLineColor(1);
5662 fhMCNeutral1pOverER02->SetLineColor(4);
5663 fhMCNeutral1pOverER02->Draw("same");
5668 fhMCNeutral1dR->Draw();
5671 fhMCNeutral2MatchdEdx->Draw();
5673 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
5674 cmemcn->Print(name); printf("Plot: %s\n",name);
5676 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
5677 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
5682 fh1pOverE->SetLineColor(1);
5683 fhMCEle1pOverE->SetLineColor(4);
5684 fhMCChHad1pOverE->SetLineColor(2);
5685 fhMCNeutral1pOverE->SetLineColor(7);
5686 fh1pOverER02->SetMinimum(0.5);
5688 fhMCEle1pOverE->Draw("same");
5689 fhMCChHad1pOverE->Draw("same");
5690 fhMCNeutral1pOverE->Draw("same");
5691 TLegend pLegendpE(0.65,0.55,0.9,0.8);
5692 pLegendpE.SetTextSize(0.06);
5693 pLegendpE.AddEntry(fh1pOverE,"all","L");
5694 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
5695 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
5696 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
5697 pLegendpE.SetFillColor(10);
5698 pLegendpE.SetBorderSize(1);
5703 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
5704 fh1pOverER02->SetLineColor(1);
5705 fhMCEle1pOverER02->SetLineColor(4);
5706 fhMCChHad1pOverER02->SetLineColor(2);
5707 fhMCNeutral1pOverER02->SetLineColor(7);
5708 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
5709 fh1pOverER02->SetMinimum(0.5);
5710 fh1pOverER02->Draw();
5711 fhMCEle1pOverER02->Draw("same");
5712 fhMCChHad1pOverER02->Draw("same");
5713 fhMCNeutral1pOverER02->Draw("same");
5715 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
5716 // pLegendpE2.SetTextSize(0.06);
5717 // pLegendpE2.SetHeader("dR < 0.02");
5718 // pLegendpE2.SetFillColor(10);
5719 // pLegendpE2.SetBorderSize(1);
5720 // pLegendpE2.Draw();
5722 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
5723 cmpoe->Print(name); printf("Plot: %s\n",name);
5727 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
5728 gROOT->ProcessLine(line);
5729 sprintf(line, ".!rm -fR *.eps");
5730 gROOT->ProcessLine(line);
5732 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());