1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 //_________________________________________________________________________
18 // Class to check results from simulations or reconstructed real data.
19 // Fill few histograms and do some checking plots
21 //-- Author: Gustavo Conesa (INFN-LNF)
22 //_________________________________________________________________________
25 // --- ROOT system ---
26 //#include "Riostream.h"
27 #include "TObjArray.h"
28 #include "TParticle.h"
29 #include "TDatabasePDG.h"
37 #include <TObjString.h>
39 //---- AliRoot system ----
40 #include "AliAnaCalorimeterQA.h"
41 #include "AliCaloTrackReader.h"
43 #include "AliAODCaloCells.h"
44 #include "AliESDCaloCells.h"
45 #include "AliAODCaloCluster.h"
46 #include "AliFiducialCut.h"
47 #include "AliESDtrack.h"
48 #include "AliAODTrack.h"
49 #include "AliESDCaloCluster.h"
50 #include "AliESDEvent.h"
51 #include "AliAODEvent.h"
52 #include "AliVEventHandler.h"
53 #include "AliAnalysisManager.h"
54 #include "AliAODMCParticle.h"
55 #include "AliMCAnalysisUtils.h"
56 #include "AliAODPid.h"
58 ClassImp(AliAnaCalorimeterQA)
60 //____________________________________________________________________________
61 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
62 AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""),
63 fMakePlots(kFALSE), fCorrelateCalos(kFALSE), fNModules(12), fNRCU(2),
64 fTimeCutMin(-1), fTimeCutMax(9999999),
65 fHistoPOverEBins(100), fHistoPOverEMax(100.), fHistoPOverEMin(0.),
66 fHistodEdxBins(100), fHistodEdxMax(100.), fHistodEdxMin(0.),
67 fHistodRBins(100), fHistodRMax(100.), fHistodRMin(0.),
68 fHistoTimeBins(100), fHistoTimeMax(100.), fHistoTimeMin(0.),
69 fHistoNBins(100), fHistoNMax(100), fHistoNMin(0),
70 fHistoRatioBins(100), fHistoRatioMax(100.), fHistoRatioMin(0.),
71 fHistoVertexDistBins(100), fHistoVertexDistMax(100.), fHistoVertexDistMin(0.),
72 fHistoRBins(100), fHistoRMax(1000), fHistoRMin(-1000),
73 fHistoXBins(100), fHistoXMax(1000), fHistoXMin(-1000),
74 fHistoYBins(100), fHistoYMax(1000), fHistoYMin(-1000),
75 fHistoZBins(100), fHistoZMax(1000), fHistoZMin(-1000),
76 fHistoSSBins(40), fHistoSSMax(10), fHistoSSMin(0),
77 fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhiE(0),
78 fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiECharged(0),
79 //fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0),
80 fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
81 fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0),
82 fhLambda(0), fhDispersion(0),
83 fhIM(0), fhIMCellCut(0),fhAsym(0),
84 fhNCellsPerCluster(0),fhNCellsPerClusterMIP(0), fhNCellsPerClusterMIPCharged(0), fhNClusters(0),
85 fhClusterTimeEnergy(0),fhCellTimeSpreadRespectToCellMax(0),fhCellIdCellLargeTimeSpread(0),
86 fhRNCells(0),fhXNCells(0),fhYNCells(0),fhZNCells(0),
87 fhRE(0), fhXE(0), fhYE(0), fhZE(0), fhXYZ(0),
88 fhRCellE(0), fhXCellE(0), fhYCellE(0), fhZCellE(0),fhXYZCell(0),
89 fhDeltaCellClusterRNCells(0),fhDeltaCellClusterXNCells(0),fhDeltaCellClusterYNCells(0),fhDeltaCellClusterZNCells(0),
90 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0), fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
91 fhNCells(0), fhAmplitude(0), fhAmpId(0), fhEtaPhiAmp(0),
92 fhTime(0), fhTimeId(0), fhTimeAmp(0), //fhT0Time(0), fhT0TimeId(0), fhT0TimeAmp(0),
93 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
94 fhEMod(0), fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),
95 fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0),
96 fhAmplitudeMod(0), fhAmplitudeModFraction(0),fhTimeAmpPerRCU(0), //fhT0TimeAmpPerRCU(0),
98 fhIMMod(0), fhIMCellCutMod(0),
99 fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
100 fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
101 fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
102 fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
103 fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0),
104 fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
105 fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
106 fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0),
107 fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
108 fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
109 fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
110 fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
111 fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
112 fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
113 fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
114 fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
115 fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
116 fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
117 fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
118 fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
119 fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
123 //Initialize parameters
127 //____________________________________________________________________________
128 AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
129 AliAnaPartCorrBaseClass(qa), fCalorimeter(qa.fCalorimeter), fStyleMacro(qa.fStyleMacro),
130 fMakePlots(qa.fMakePlots), fCorrelateCalos(qa.fCorrelateCalos), fNModules(qa.fNModules), fNRCU(qa.fNRCU),
131 fTimeCutMin(qa.fTimeCutMin), fTimeCutMax(qa.fTimeCutMax),
132 fHistoPOverEBins(qa.fHistoPOverEBins), fHistoPOverEMax(qa.fHistoPOverEMax), fHistoPOverEMin(qa.fHistoPOverEMin),
133 fHistodEdxBins(qa.fHistodEdxBins), fHistodEdxMax(qa.fHistodEdxMax), fHistodEdxMin(qa.fHistodEdxMin),
134 fHistodRBins(qa.fHistodRBins), fHistodRMax(qa.fHistodRMax), fHistodRMin(qa.fHistodRMin),
135 fHistoTimeBins(qa.fHistoTimeBins), fHistoTimeMax(qa.fHistoTimeMax), fHistoTimeMin(qa.fHistoTimeMin),
136 fHistoNBins(qa.fHistoNBins), fHistoNMax(qa.fHistoNMax), fHistoNMin(qa.fHistoNMin),
137 fHistoRatioBins(qa.fHistoRatioBins), fHistoRatioMax(qa.fHistoRatioMax), fHistoRatioMin(qa.fHistoRatioMin),
138 fHistoVertexDistBins(qa.fHistoVertexDistBins), fHistoVertexDistMax(qa.fHistoVertexDistMax), fHistoVertexDistMin(qa.fHistoVertexDistMin),
139 fHistoRBins(qa.fHistoRBins), fHistoRMax(qa.fHistoRMax), fHistoRMin(qa.fHistoRMin),
140 fHistoXBins(qa.fHistoXBins), fHistoXMax(qa.fHistoXMax), fHistoXMin(qa.fHistoXMin),
141 fHistoYBins(qa.fHistoYBins), fHistoYMax(qa.fHistoYMax), fHistoYMin(qa.fHistoYMin),
142 fHistoZBins(qa.fHistoZBins), fHistoZMax(qa.fHistoZMax), fHistoZMin(qa.fHistoZMin),
143 fHistoSSBins(qa.fHistoSSBins),fHistoSSMax(qa.fHistoSSMax), fHistoSSMin(qa.fHistoSSMin),
144 fhE(qa.fhE),fhPt(qa.fhPt), fhPhi(qa.fhPhi), fhEta(qa.fhEta), fhEtaPhiE(qa.fhEtaPhiE),
145 fhECharged(qa.fhECharged),fhPtCharged(qa.fhPtCharged),fhPhiCharged(qa.fhPhiCharged),
146 fhEtaCharged(qa.fhEtaCharged), fhEtaPhiECharged(qa.fhEtaPhiECharged),
147 //fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
148 //fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut),
149 fhDeltaE(qa.fhDeltaE), fhDeltaPt(qa.fhDeltaPt), fhDeltaPhi(qa.fhDeltaPhi), fhDeltaEta(qa.fhDeltaEta),
150 fhRatioE(qa.fhRatioE), fhRatioPt(qa.fhRatioPt), fhRatioPhi(qa.fhRatioPhi), fhRatioEta(qa.fhRatioEta),
151 fh2E(qa.fh2E), fh2Pt(qa.fh2Pt), fh2Phi(qa.fh2Phi),fh2Eta(qa.fh2Eta),
152 fhLambda(qa.fhLambda), fhDispersion(qa.fhDispersion),
153 fhIM(qa.fhIM), fhIMCellCut(qa.fhIMCellCut), fhAsym(qa.fhAsym),
154 fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNCellsPerClusterMIP(qa.fhNCellsPerClusterMIP),
155 fhNCellsPerClusterMIPCharged(qa.fhNCellsPerClusterMIPCharged),fhNClusters(qa.fhNClusters),
156 fhClusterTimeEnergy(qa.fhClusterTimeEnergy),
157 fhCellTimeSpreadRespectToCellMax(qa.fhCellTimeSpreadRespectToCellMax),
158 fhCellIdCellLargeTimeSpread(qa.fhCellIdCellLargeTimeSpread),
159 fhRNCells(qa.fhRNCells),fhXNCells(qa.fhXNCells),fhYNCells(qa.fhYNCells),fhZNCells(qa.fhZNCells),
160 fhRE(qa.fhRE), fhXE(qa.fhXE), fhYE(qa.fhYE), fhZE(qa.fhZE), fhXYZ(qa.fhXYZ),
161 fhRCellE(qa.fhXCellE), fhXCellE(qa.fhXCellE), fhYCellE(qa.fhYCellE), fhZCellE(qa.fhZCellE),fhXYZCell(qa.fhXYZCell),
162 fhDeltaCellClusterRNCells(qa.fhDeltaCellClusterRNCells),fhDeltaCellClusterXNCells(qa.fhDeltaCellClusterXNCells),
163 fhDeltaCellClusterYNCells(qa.fhDeltaCellClusterYNCells),fhDeltaCellClusterZNCells(qa.fhDeltaCellClusterZNCells),
164 fhDeltaCellClusterRE(qa.fhDeltaCellClusterRE), fhDeltaCellClusterXE(qa.fhDeltaCellClusterXE),
165 fhDeltaCellClusterYE(qa.fhDeltaCellClusterYE), fhDeltaCellClusterZE(qa.fhDeltaCellClusterZE),
166 fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude), fhAmpId(fhAmpId), fhEtaPhiAmp(qa.fhEtaPhiAmp),
167 fhTime(qa.fhTime), fhTimeId(qa.fhTimeId),fhTimeAmp(qa.fhTimeAmp),
168 //fhT0Time(qa.fhT0Time),fhT0TimeId(qa.fhT0TimeId), fhT0TimeAmp(qa.fhT0TimeAmp),
169 fhCaloCorrNClusters(qa.fhCaloCorrNClusters), fhCaloCorrEClusters(qa.fhCaloCorrEClusters),
170 fhCaloCorrNCells(qa.fhCaloCorrNCells), fhCaloCorrECells(qa.fhCaloCorrECells),
171 fhEMod(qa.fhEMod), fhNClustersMod(qa.fhNClustersMod),
172 fhNCellsPerClusterMod(qa.fhNCellsPerClusterMod), fhNCellsMod(qa.fhNCellsMod),
173 fhGridCellsMod(qa.fhGridCellsMod), fhGridCellsEMod(qa.fhGridCellsEMod), fhGridCellsTimeMod(qa.fhGridCellsTimeMod),
174 fhAmplitudeMod(qa.fhAmplitudeMod), fhAmplitudeModFraction(qa.fhAmplitudeModFraction),
175 fhTimeAmpPerRCU(qa.fhTimeAmpPerRCU), //fhT0TimeAmpPerRCU(qa.fhT0TimeAmpPerRCU), fhTimeCorrRCU(qa.fhTimeCorrRCU),
176 fhIMMod(qa.fhIMMod),fhIMCellCutMod(qa.fhIMCellCutMod),
177 fhGenGamPt(qa.fhGenGamPt), fhGenGamEta(qa.fhGenGamEta), fhGenGamPhi(qa.fhGenGamPhi),
178 fhGenPi0Pt(qa.fhGenPi0Pt), fhGenPi0Eta(qa.fhGenPi0Eta), fhGenPi0Phi(qa.fhGenPi0Phi),
179 fhGenEtaPt(qa.fhGenEtaPt), fhGenEtaEta(qa.fhGenEtaEta), fhGenEtaPhi(qa.fhGenEtaPhi),
180 fhGenOmegaPt(qa.fhGenOmegaPt), fhGenOmegaEta(qa.fhGenOmegaEta), fhGenOmegaPhi(qa.fhGenOmegaPhi),
181 fhGenElePt(qa.fhGenElePt), fhGenEleEta(qa.fhGenEleEta), fhGenElePhi(qa.fhGenElePhi),
182 fhEMVxyz(qa.fhEMVxyz), fhEMR(qa.fhEMR), fhHaVxyz(qa.fhHaVxyz), fhHaR(qa.fhHaR),
183 fhGamE(qa.fhGamE),fhGamPt(qa.fhGamPt),fhGamPhi(qa.fhGamPhi),fhGamEta(qa.fhGamEta),
184 fhGamDeltaE(qa.fhGamDeltaE), fhGamDeltaPt(qa.fhGamDeltaPt), fhGamDeltaPhi(qa.fhGamDeltaPhi), fhGamDeltaEta(qa.fhGamDeltaEta),
185 fhGamRatioE(qa.fhGamRatioE), fhGamRatioPt(qa.fhGamRatioPt), fhGamRatioPhi(qa.fhGamRatioPhi), fhGamRatioEta(qa.fhGamRatioEta),
186 fhEleE(qa.fhEleE),fhElePt(qa.fhElePt),fhElePhi(qa.fhElePhi),fhEleEta(qa.fhEleEta),
187 fhPi0E(qa.fhPi0E),fhPi0Pt(qa.fhPi0Pt),fhPi0Phi(qa.fhPi0Phi),fhPi0Eta(qa.fhPi0Eta),
188 fhNeHadE(qa.fhNeHadE),fhNeHadPt(qa.fhNeHadPt),fhNeHadPhi(qa.fhNeHadPhi),fhNeHadEta(qa.fhNeHadEta),
189 fhChHadE(qa.fhChHadE),fhChHadPt(qa.fhChHadPt),fhChHadPhi(qa.fhChHadPhi),fhChHadEta(qa.fhChHadEta),
190 fhGamECharged(qa.fhGamECharged),fhGamPtCharged(qa.fhGamPtCharged),fhGamPhiCharged(qa.fhGamPhiCharged),fhGamEtaCharged(qa.fhGamEtaCharged),
191 fhEleECharged(qa.fhEleECharged),fhElePtCharged(qa.fhElePtCharged),fhElePhiCharged(qa.fhElePhiCharged),fhEleEtaCharged(qa.fhEleEtaCharged),
192 fhPi0ECharged(qa.fhPi0ECharged),fhPi0PtCharged(qa.fhPi0PtCharged),fhPi0PhiCharged(qa.fhPi0PhiCharged),fhPi0EtaCharged(qa.fhPi0EtaCharged),
193 fhNeHadECharged(qa.fhNeHadECharged),fhNeHadPtCharged(qa.fhNeHadPtCharged),fhNeHadPhiCharged(qa.fhNeHadPhiCharged),fhNeHadEtaCharged(qa.fhNeHadEtaCharged),
194 fhChHadECharged(qa.fhChHadECharged),fhChHadPtCharged(qa.fhChHadPtCharged),fhChHadPhiCharged(qa.fhChHadPhiCharged),fhChHadEtaCharged(qa.fhChHadEtaCharged),
195 fhGenGamAccE(qa.fhGenGamAccE),fhGenGamAccPt(qa.fhGenGamAccPt),fhGenGamAccEta(qa.fhGenGamAccEta),fhGenGamAccPhi(qa.fhGenGamAccPhi),
196 fhGenPi0AccE(qa.fhGenPi0AccE),fhGenPi0AccPt(qa.fhGenPi0AccPt),fhGenPi0AccEta(qa.fhGenPi0AccEta),fhGenPi0AccPhi(qa.fhGenPi0AccPhi),
197 fh1pOverE(qa.fh1pOverE),fh1dR(qa.fh1dR),fh2EledEdx(qa.fh2EledEdx), fh2MatchdEdx(qa.fh2MatchdEdx),
198 fhMCEle1pOverE(qa.fhMCEle1pOverE),fhMCEle1dR(qa.fhMCEle1dR), fhMCEle2MatchdEdx(qa.fhMCEle2MatchdEdx),
199 fhMCChHad1pOverE(qa.fhMCChHad1pOverE),fhMCChHad1dR(qa.fhMCChHad1dR), fhMCChHad2MatchdEdx(qa.fhMCChHad2MatchdEdx),
200 fhMCNeutral1pOverE(qa.fhMCNeutral1pOverE),fhMCNeutral1dR(qa.fhMCNeutral1dR), fhMCNeutral2MatchdEdx(qa.fhMCNeutral2MatchdEdx),
201 fh1pOverER02(qa.fh1pOverER02), fhMCEle1pOverER02(qa.fhMCEle1pOverER02),fhMCChHad1pOverER02(qa.fhMCChHad1pOverER02), fhMCNeutral1pOverER02(qa.fhMCNeutral1pOverER02)
207 //________________________________________________________________________________________________________________________________________________
208 //AliAnaCalorimeterQA::~AliAnaCalorimeterQA() {
213 //________________________________________________________________________
214 TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
216 //Save parameters used for analysis
217 TString parList ; //this will be list of parameters used for this analysis.
220 sprintf(onePar,"--- AliAnaCalorimeterQA ---\n") ;
222 sprintf(onePar,"Calorimeter: %s\n",fCalorimeter.Data()) ;
224 sprintf(onePar,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
227 //Get parameters set in base class.
228 //parList += GetBaseParametersList() ;
230 //Get parameters set in FiducialCut class (not available yet)
231 //parlist += GetFidCut()->GetFidCutParametersList()
233 return new TObjString(parList) ;
237 //________________________________________________________________________
238 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
240 // Create histograms to be saved in output file and
241 // store them in outputContainer
243 TList * outputContainer = new TList() ;
244 outputContainer->SetName("QAHistos") ;
247 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
248 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
249 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
250 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
251 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
252 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
253 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
254 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
255 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
256 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
257 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
258 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
259 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
260 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
261 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
262 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
263 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
270 if(fCalorimeter=="PHOS"){
277 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins,ptmin,ptmax);
278 fhE->SetXTitle("E (GeV)");
279 outputContainer->Add(fhE);
281 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
282 fhPt->SetXTitle("p_{T} (GeV/c)");
283 outputContainer->Add(fhPt);
285 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
286 fhPhi->SetXTitle("#phi (rad)");
287 outputContainer->Add(fhPhi);
289 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
290 fhEta->SetXTitle("#eta ");
291 outputContainer->Add(fhEta);
293 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
294 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
295 fhEtaPhiE->SetXTitle("#eta ");
296 fhEtaPhiE->SetYTitle("#phi (rad)");
297 fhEtaPhiE->SetZTitle("E (GeV) ");
298 outputContainer->Add(fhEtaPhiE);
300 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
301 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
302 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
303 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
304 outputContainer->Add(fhClusterTimeEnergy);
308 fhLambda = new TH3F ("hLambda","#lambda_{0}^{2} vs #lambda_{1}^{2} vs energy, reconstructed clusters",
309 ssbins,ssmin,ssmax,ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
310 fhLambda->SetXTitle("#lambda_{0}^{2} ");
311 fhLambda->SetYTitle("#lambda_{1}^{2} ");
312 fhLambda->SetZTitle("E (GeV) ");
313 outputContainer->Add(fhLambda);
315 fhDispersion = new TH2F ("hDispersion"," dispersion vs energy, reconstructed clusters",
316 ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
317 fhDispersion->SetXTitle("Dispersion ");
318 fhDispersion->SetYTitle("E (GeV) ");
319 outputContainer->Add(fhDispersion);
323 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
324 fhECharged->SetXTitle("E (GeV)");
325 outputContainer->Add(fhECharged);
327 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
328 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
329 outputContainer->Add(fhPtCharged);
331 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
332 fhPhiCharged->SetXTitle("#phi (rad)");
333 outputContainer->Add(fhPhiCharged);
335 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
336 fhEtaCharged->SetXTitle("#eta ");
337 outputContainer->Add(fhEtaCharged);
339 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
340 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
341 fhEtaPhiECharged->SetXTitle("#eta ");
342 fhEtaPhiECharged->SetYTitle("#phi ");
343 fhEtaPhiECharged->SetZTitle("E (GeV) ");
344 outputContainer->Add(fhEtaPhiECharged);
347 // fhEChargedNoOut = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
348 // fhEChargedNoOut->SetXTitle("E (GeV)");
349 // outputContainer->Add(fhEChargedNoOut);
351 // fhPtChargedNoOut = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
352 // fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
353 // outputContainer->Add(fhPtChargedNoOut);
355 // fhPhiChargedNoOut = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax);
356 // fhPhiChargedNoOut->SetXTitle("#phi (rad)");
357 // outputContainer->Add(fhPhiChargedNoOut);
359 // fhEtaChargedNoOut = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax);
360 // fhEtaChargedNoOut->SetXTitle("#eta ");
361 // outputContainer->Add(fhEtaChargedNoOut);
363 // fhEtaPhiChargedNoOut = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);
364 // fhEtaPhiChargedNoOut->SetXTitle("#eta ");
365 // fhEtaPhiChargedNoOut->SetYTitle("#phi ");
366 // outputContainer->Add(fhEtaPhiChargedNoOut);
368 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
369 fh1pOverE->SetYTitle("p/E");
370 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
371 outputContainer->Add(fh1pOverE);
373 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
374 fh1dR->SetXTitle("#Delta R (rad)");
375 outputContainer->Add(fh1dR) ;
377 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
378 fh2MatchdEdx->SetXTitle("p (GeV/c)");
379 fh2MatchdEdx->SetYTitle("<dE/dx>");
380 outputContainer->Add(fh2MatchdEdx);
382 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
383 fh2EledEdx->SetXTitle("p (GeV/c)");
384 fh2EledEdx->SetYTitle("<dE/dx>");
385 outputContainer->Add(fh2EledEdx) ;
387 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
388 fh1pOverER02->SetYTitle("p/E");
389 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
390 outputContainer->Add(fh1pOverER02);
392 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
393 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
394 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
395 outputContainer->Add(fhIM);
397 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
398 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
399 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
400 outputContainer->Add(fhIMCellCut);
402 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
403 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
404 fhAsym->SetYTitle("Asymmetry");
405 outputContainer->Add(fhAsym);
407 fhNCellsPerCluster = new TH3F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax, netabins,etamin,etamax);
408 fhNCellsPerCluster->SetXTitle("E (GeV)");
409 fhNCellsPerCluster->SetYTitle("n cells");
410 fhNCellsPerCluster->SetZTitle("#eta");
411 outputContainer->Add(fhNCellsPerCluster);
414 fhNCellsPerClusterMIP = new TH3F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
415 100,0.,1., 6,0,5,netabins,etamin,etamax);
416 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
417 fhNCellsPerClusterMIP->SetYTitle("n cells");
418 fhNCellsPerClusterMIP->SetZTitle("#eta");
419 outputContainer->Add(fhNCellsPerClusterMIP);
422 fhNCellsPerClusterMIPCharged = new TH3F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
423 100,0.,1., 6,0,5,netabins,etamin,etamax);
424 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
425 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
426 fhNCellsPerClusterMIPCharged->SetZTitle("#eta");
427 outputContainer->Add(fhNCellsPerClusterMIPCharged);
430 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
431 fhNClusters->SetXTitle("number of clusters");
432 outputContainer->Add(fhNClusters);
434 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax);
435 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
436 fhRNCells->SetYTitle("N cells per cluster");
437 outputContainer->Add(fhRNCells);
439 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax);
440 fhXNCells->SetXTitle("x (cm)");
441 fhXNCells->SetYTitle("N cells per cluster");
442 outputContainer->Add(fhXNCells);
444 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax);
445 fhYNCells->SetXTitle("y (cm)");
446 fhYNCells->SetYTitle("N cells per cluster");
447 outputContainer->Add(fhYNCells);
449 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax);
450 fhZNCells->SetXTitle("z (cm)");
451 fhZNCells->SetYTitle("N cells per cluster");
452 outputContainer->Add(fhZNCells);
454 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
455 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
456 fhRE->SetYTitle("E (GeV)");
457 outputContainer->Add(fhRE);
459 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
460 fhXE->SetXTitle("x (cm)");
461 fhXE->SetYTitle("E (GeV)");
462 outputContainer->Add(fhXE);
464 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
465 fhYE->SetXTitle("y (cm)");
466 fhYE->SetYTitle("E (GeV)");
467 outputContainer->Add(fhYE);
469 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
470 fhZE->SetXTitle("z (cm)");
471 fhZE->SetYTitle("E (GeV)");
472 outputContainer->Add(fhZE);
474 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
475 fhXYZ->SetXTitle("x (cm)");
476 fhXYZ->SetYTitle("y (cm)");
477 fhXYZ->SetZTitle("z (cm) ");
478 outputContainer->Add(fhXYZ);
480 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
481 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
482 fhRCellE->SetYTitle("E (GeV)");
483 outputContainer->Add(fhRCellE);
485 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
486 fhXCellE->SetXTitle("x (cm)");
487 fhXCellE->SetYTitle("E (GeV)");
488 outputContainer->Add(fhXCellE);
490 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
491 fhYCellE->SetXTitle("y (cm)");
492 fhYCellE->SetYTitle("E (GeV)");
493 outputContainer->Add(fhYCellE);
495 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
496 fhZCellE->SetXTitle("z (cm)");
497 fhZCellE->SetYTitle("E (GeV)");
498 outputContainer->Add(fhZCellE);
500 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
501 fhXYZCell->SetXTitle("x (cm)");
502 fhXYZCell->SetYTitle("y (cm)");
503 fhXYZCell->SetZTitle("z (cm)");
504 outputContainer->Add(fhXYZCell);
507 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
508 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
509 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
510 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
512 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax);
513 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
514 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
515 outputContainer->Add(fhDeltaCellClusterRNCells);
517 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax);
518 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
519 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
520 outputContainer->Add(fhDeltaCellClusterXNCells);
522 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax);
523 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
524 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
525 outputContainer->Add(fhDeltaCellClusterYNCells);
527 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax);
528 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
529 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
530 outputContainer->Add(fhDeltaCellClusterZNCells);
532 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
533 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
534 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
535 outputContainer->Add(fhDeltaCellClusterRE);
537 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
538 fhDeltaCellClusterXE->SetXTitle("x (cm)");
539 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
540 outputContainer->Add(fhDeltaCellClusterXE);
542 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
543 fhDeltaCellClusterYE->SetXTitle("y (cm)");
544 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
545 outputContainer->Add(fhDeltaCellClusterYE);
547 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
548 fhDeltaCellClusterZE->SetXTitle("z (cm)");
549 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
550 outputContainer->Add(fhDeltaCellClusterZE);
552 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
553 fhEtaPhiAmp->SetXTitle("#eta ");
554 fhEtaPhiAmp->SetYTitle("#phi (rad)");
555 fhEtaPhiAmp->SetZTitle("E (GeV) ");
556 outputContainer->Add(fhEtaPhiAmp);
560 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
561 fhNCells->SetXTitle("n cells");
562 outputContainer->Add(fhNCells);
564 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
565 fhAmplitude->SetXTitle("Cell Energy (GeV)");
566 outputContainer->Add(fhAmplitude);
568 fhAmpId = new TH2F ("hAmpId","Cell Energy", nptbins*2,ptmin,ptmax*2,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
569 fhAmpId->SetXTitle("Cell Energy (GeV)");
570 outputContainer->Add(fhAmpId);
573 //Cell Time histograms, time only available in ESDs
574 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
576 fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200);
577 fhCellTimeSpreadRespectToCellMax->SetXTitle("#Delta t (ns)");
578 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
580 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
581 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
582 outputContainer->Add(fhCellIdCellLargeTimeSpread);
584 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
585 fhTime->SetXTitle("Cell Time (ns)");
586 outputContainer->Add(fhTime);
588 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
589 fhTimeId->SetXTitle("Cell Time (ns)");
590 fhTimeId->SetYTitle("Cell Absolute Id");
591 outputContainer->Add(fhTimeId);
593 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
594 fhTimeAmp->SetYTitle("Cell Time (ns)");
595 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
596 outputContainer->Add(fhTimeAmp);
598 // fhT0Time = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax);
599 // fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
600 // outputContainer->Add(fhT0Time);
602 // fhT0TimeId = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
603 // fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
604 // fhT0TimeId->SetYTitle("Cell Absolute Id");
605 // outputContainer->Add(fhT0TimeId);
607 // fhT0TimeAmp = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
608 // fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
609 // fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
610 // outputContainer->Add(fhT0TimeAmp);
616 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
617 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
618 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
619 outputContainer->Add(fhCaloCorrNClusters);
621 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
622 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
623 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
624 outputContainer->Add(fhCaloCorrEClusters);
626 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
627 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
628 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
629 outputContainer->Add(fhCaloCorrNCells);
631 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
632 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
633 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
634 outputContainer->Add(fhCaloCorrECells);
635 }//correlate calorimeters
638 fhEMod = new TH1F*[fNModules];
639 fhNClustersMod = new TH1F*[fNModules];
640 fhNCellsPerClusterMod = new TH2F*[fNModules];
641 fhNCellsMod = new TH1F*[fNModules];
642 fhGridCellsMod = new TH2F*[fNModules];
643 fhGridCellsEMod = new TH2F*[fNModules];
644 fhGridCellsTimeMod = new TH2F*[fNModules];
645 fhAmplitudeMod = new TH1F*[fNModules];
646 if(fCalorimeter=="EMCAL")
647 fhAmplitudeModFraction = new TH1F*[fNModules*3];
649 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
650 //fhT0TimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
651 //fhTimeCorrRCU = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
653 fhIMMod = new TH2F*[fNModules];
654 fhIMCellCutMod = new TH2F*[fNModules];
656 for(Int_t imod = 0; imod < fNModules; imod++){
658 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
659 fhEMod[imod]->SetXTitle("E (GeV)");
660 outputContainer->Add(fhEMod[imod]);
662 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
663 fhNClustersMod[imod]->SetXTitle("number of clusters");
664 outputContainer->Add(fhNClustersMod[imod]);
666 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
667 Form("# cells per cluster vs cluster energy in Module %d",imod),
668 nptbins,ptmin,ptmax, nbins,nmin,nmax);
669 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
670 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
671 outputContainer->Add(fhNCellsPerClusterMod[imod]);
673 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
674 fhNCellsMod[imod]->SetXTitle("n cells");
675 outputContainer->Add(fhNCellsMod[imod]);
676 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
677 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
678 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
679 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
680 outputContainer->Add(fhGridCellsMod[imod]);
682 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
683 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
684 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
685 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
686 outputContainer->Add(fhGridCellsEMod[imod]);
688 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),
689 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
690 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)");
691 fhGridCellsTimeMod[imod]->SetXTitle("column (eta direction)");
692 outputContainer->Add(fhGridCellsTimeMod[imod]);
694 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
695 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
696 outputContainer->Add(fhAmplitudeMod[imod]);
698 if(fCalorimeter == "EMCAL"){
699 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
700 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);
701 fhAmplitudeModFraction[imod*3+ifrac]->SetXTitle("E (GeV)");
702 outputContainer->Add(fhAmplitudeModFraction[imod*3+ifrac]);
707 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
708 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
709 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
710 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
711 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
712 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
713 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
715 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
716 // Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu),
717 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
718 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
719 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
720 // outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
723 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
724 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
725 // Int_t index = (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod;
726 // fhTimeCorrRCU[index] = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
727 // Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
728 // ntimebins,timemin,timemax,ntimebins,timemin,timemax);
729 // fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
730 // fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
731 // outputContainer->Add(fhTimeCorrRCU[index]);
737 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
738 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
739 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
740 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
741 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
742 outputContainer->Add(fhIMMod[imod]);
744 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
745 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
746 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
747 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
748 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
749 outputContainer->Add(fhIMCellCutMod[imod]);
754 //Monte Carlo Histograms
757 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
758 fhDeltaE->SetXTitle("#Delta E (GeV)");
759 outputContainer->Add(fhDeltaE);
761 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
762 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
763 outputContainer->Add(fhDeltaPt);
765 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
766 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
767 outputContainer->Add(fhDeltaPhi);
769 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
770 fhDeltaEta->SetXTitle("#Delta #eta ");
771 outputContainer->Add(fhDeltaEta);
773 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
774 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
775 outputContainer->Add(fhRatioE);
777 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
778 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
779 outputContainer->Add(fhRatioPt);
781 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
782 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
783 outputContainer->Add(fhRatioPhi);
785 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
786 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
787 outputContainer->Add(fhRatioEta);
789 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
790 fh2E->SetXTitle("E_{rec} (GeV)");
791 fh2E->SetYTitle("E_{gen} (GeV)");
792 outputContainer->Add(fh2E);
794 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
795 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
796 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
797 outputContainer->Add(fh2Pt);
799 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
800 fh2Phi->SetXTitle("#phi_{rec} (rad)");
801 fh2Phi->SetYTitle("#phi_{gen} (rad)");
802 outputContainer->Add(fh2Phi);
804 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
805 fh2Eta->SetXTitle("#eta_{rec} ");
806 fh2Eta->SetYTitle("#eta_{gen} ");
807 outputContainer->Add(fh2Eta);
809 //Fill histos depending on origin of cluster
810 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
811 fhGamE->SetXTitle("E_{rec} (GeV)");
812 fhGamE->SetXTitle("E_{gen} (GeV)");
813 outputContainer->Add(fhGamE);
815 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
816 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
817 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
818 outputContainer->Add(fhGamPt);
820 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
821 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
822 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
823 outputContainer->Add(fhGamPhi);
825 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
826 fhGamEta->SetXTitle("#eta_{rec} ");
827 fhGamEta->SetYTitle("#eta_{gen} ");
828 outputContainer->Add(fhGamEta);
830 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
831 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
832 outputContainer->Add(fhGamDeltaE);
834 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
835 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
836 outputContainer->Add(fhGamDeltaPt);
838 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
839 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
840 outputContainer->Add(fhGamDeltaPhi);
842 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
843 fhGamDeltaEta->SetXTitle("#Delta #eta ");
844 outputContainer->Add(fhGamDeltaEta);
846 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
847 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
848 outputContainer->Add(fhGamRatioE);
850 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
851 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
852 outputContainer->Add(fhGamRatioPt);
854 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
855 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
856 outputContainer->Add(fhGamRatioPhi);
858 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
859 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
860 outputContainer->Add(fhGamRatioEta);
862 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
863 fhPi0E->SetXTitle("E_{rec} (GeV)");
864 fhPi0E->SetYTitle("E_{gen} (GeV)");
865 outputContainer->Add(fhPi0E);
867 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
868 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
869 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
870 outputContainer->Add(fhPi0Pt);
872 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
873 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
874 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
875 outputContainer->Add(fhPi0Phi);
877 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
878 fhPi0Eta->SetXTitle("#eta_{rec} ");
879 fhPi0Eta->SetYTitle("#eta_{gen} ");
880 outputContainer->Add(fhPi0Eta);
882 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
883 fhEleE->SetXTitle("E_{rec} (GeV)");
884 fhEleE->SetXTitle("E_{gen} (GeV)");
885 outputContainer->Add(fhEleE);
887 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
888 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
889 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
890 outputContainer->Add(fhElePt);
892 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
893 fhElePhi->SetXTitle("#phi_{rec} (rad)");
894 fhElePhi->SetYTitle("#phi_{gen} (rad)");
895 outputContainer->Add(fhElePhi);
897 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
898 fhEleEta->SetXTitle("#eta_{rec} ");
899 fhEleEta->SetYTitle("#eta_{gen} ");
900 outputContainer->Add(fhEleEta);
902 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
903 fhNeHadE->SetXTitle("E_{rec} (GeV)");
904 fhNeHadE->SetYTitle("E_{gen} (GeV)");
905 outputContainer->Add(fhNeHadE);
907 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
908 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
909 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
910 outputContainer->Add(fhNeHadPt);
912 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
913 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
914 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
915 outputContainer->Add(fhNeHadPhi);
917 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
918 fhNeHadEta->SetXTitle("#eta_{rec} ");
919 fhNeHadEta->SetYTitle("#eta_{gen} ");
920 outputContainer->Add(fhNeHadEta);
922 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
923 fhChHadE->SetXTitle("E_{rec} (GeV)");
924 fhChHadE->SetYTitle("E_{gen} (GeV)");
925 outputContainer->Add(fhChHadE);
927 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
928 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
929 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
930 outputContainer->Add(fhChHadPt);
932 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
933 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
934 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
935 outputContainer->Add(fhChHadPhi);
937 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
938 fhChHadEta->SetXTitle("#eta_{rec} ");
939 fhChHadEta->SetYTitle("#eta_{gen} ");
940 outputContainer->Add(fhChHadEta);
944 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
945 fhGamECharged->SetXTitle("E_{rec} (GeV)");
946 fhGamECharged->SetXTitle("E_{gen} (GeV)");
947 outputContainer->Add(fhGamECharged);
949 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
950 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
951 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
952 outputContainer->Add(fhGamPtCharged);
954 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
955 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
956 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
957 outputContainer->Add(fhGamPhiCharged);
959 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
960 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
961 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
962 outputContainer->Add(fhGamEtaCharged);
964 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
965 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
966 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
967 outputContainer->Add(fhPi0ECharged);
969 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
970 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
971 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
972 outputContainer->Add(fhPi0PtCharged);
974 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
975 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
976 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
977 outputContainer->Add(fhPi0PhiCharged);
979 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
980 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
981 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
982 outputContainer->Add(fhPi0EtaCharged);
984 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
985 fhEleECharged->SetXTitle("E_{rec} (GeV)");
986 fhEleECharged->SetXTitle("E_{gen} (GeV)");
987 outputContainer->Add(fhEleECharged);
989 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
990 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
991 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
992 outputContainer->Add(fhElePtCharged);
994 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
995 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
996 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
997 outputContainer->Add(fhElePhiCharged);
999 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1000 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
1001 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
1002 outputContainer->Add(fhEleEtaCharged);
1004 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1005 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
1006 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
1007 outputContainer->Add(fhNeHadECharged);
1009 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1010 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1011 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1012 outputContainer->Add(fhNeHadPtCharged);
1014 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1015 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1016 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1017 outputContainer->Add(fhNeHadPhiCharged);
1019 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1020 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
1021 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
1022 outputContainer->Add(fhNeHadEtaCharged);
1024 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1025 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
1026 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
1027 outputContainer->Add(fhChHadECharged);
1029 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1030 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1031 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1032 outputContainer->Add(fhChHadPtCharged);
1034 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1035 fhChHadPhiCharged->SetXTitle("#phi (rad)");
1036 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1037 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1038 outputContainer->Add(fhChHadPhiCharged);
1040 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1041 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
1042 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
1043 outputContainer->Add(fhChHadEtaCharged);
1045 //Vertex of generated particles
1047 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1048 fhEMVxyz->SetXTitle("v_{x}");
1049 fhEMVxyz->SetYTitle("v_{y}");
1050 //fhEMVxyz->SetZTitle("v_{z}");
1051 outputContainer->Add(fhEMVxyz);
1053 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1054 fhHaVxyz->SetXTitle("v_{x}");
1055 fhHaVxyz->SetYTitle("v_{y}");
1056 //fhHaVxyz->SetZTitle("v_{z}");
1057 outputContainer->Add(fhHaVxyz);
1059 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1060 fhEMR->SetXTitle("E (GeV)");
1061 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1062 outputContainer->Add(fhEMR);
1064 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1065 fhHaR->SetXTitle("E (GeV)");
1066 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1067 outputContainer->Add(fhHaR);
1072 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
1073 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
1074 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
1076 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
1077 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
1078 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
1080 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
1081 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
1082 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
1084 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
1085 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
1086 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
1088 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
1089 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
1090 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
1092 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
1093 fhGenGamEta->SetXTitle("#eta");
1094 fhGenGamPhi->SetXTitle("#phi (rad)");
1095 outputContainer->Add(fhGenGamPt);
1096 outputContainer->Add(fhGenGamEta);
1097 outputContainer->Add(fhGenGamPhi);
1099 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
1100 fhGenPi0Eta->SetXTitle("#eta");
1101 fhGenPi0Phi->SetXTitle("#phi (rad)");
1102 outputContainer->Add(fhGenPi0Pt);
1103 outputContainer->Add(fhGenPi0Eta);
1104 outputContainer->Add(fhGenPi0Phi);
1106 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
1107 fhGenEtaEta->SetXTitle("#eta");
1108 fhGenEtaPhi->SetXTitle("#phi (rad)");
1109 outputContainer->Add(fhGenEtaPt);
1110 outputContainer->Add(fhGenEtaEta);
1111 outputContainer->Add(fhGenEtaPhi);
1113 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
1114 fhGenOmegaEta->SetXTitle("#eta");
1115 fhGenOmegaPhi->SetXTitle("#phi (rad)");
1116 outputContainer->Add(fhGenOmegaPt);
1117 outputContainer->Add(fhGenOmegaEta);
1118 outputContainer->Add(fhGenOmegaPhi);
1120 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
1121 fhGenEleEta->SetXTitle("#eta");
1122 fhGenElePhi->SetXTitle("#phi (rad)");
1123 outputContainer->Add(fhGenElePt);
1124 outputContainer->Add(fhGenEleEta);
1125 outputContainer->Add(fhGenElePhi);
1127 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1128 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1129 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
1130 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
1132 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1133 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1134 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
1135 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
1137 fhGenGamAccE ->SetXTitle("E (GeV)");
1138 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
1139 fhGenGamAccEta->SetXTitle("#eta");
1140 fhGenGamAccPhi->SetXTitle("#phi (rad)");
1141 outputContainer->Add(fhGenGamAccE);
1142 outputContainer->Add(fhGenGamAccPt);
1143 outputContainer->Add(fhGenGamAccEta);
1144 outputContainer->Add(fhGenGamAccPhi);
1146 fhGenPi0AccE ->SetXTitle("E (GeV)");
1147 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
1148 fhGenPi0AccEta->SetXTitle("#eta");
1149 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
1150 outputContainer->Add(fhGenPi0AccE);
1151 outputContainer->Add(fhGenPi0AccPt);
1152 outputContainer->Add(fhGenPi0AccEta);
1153 outputContainer->Add(fhGenPi0AccPhi);
1157 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1158 fhMCEle1pOverE->SetYTitle("p/E");
1159 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1160 outputContainer->Add(fhMCEle1pOverE);
1162 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
1163 fhMCEle1dR->SetXTitle("#Delta R (rad)");
1164 outputContainer->Add(fhMCEle1dR) ;
1166 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1167 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1168 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1169 outputContainer->Add(fhMCEle2MatchdEdx);
1171 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1172 fhMCChHad1pOverE->SetYTitle("p/E");
1173 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1174 outputContainer->Add(fhMCChHad1pOverE);
1176 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1177 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1178 outputContainer->Add(fhMCChHad1dR) ;
1180 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1181 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1182 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1183 outputContainer->Add(fhMCChHad2MatchdEdx);
1185 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1186 fhMCNeutral1pOverE->SetYTitle("p/E");
1187 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1188 outputContainer->Add(fhMCNeutral1pOverE);
1190 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1191 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1192 outputContainer->Add(fhMCNeutral1dR) ;
1194 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1195 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1196 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1197 outputContainer->Add(fhMCNeutral2MatchdEdx);
1199 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1200 fhMCEle1pOverER02->SetYTitle("p/E");
1201 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1202 outputContainer->Add(fhMCEle1pOverER02);
1204 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1205 fhMCChHad1pOverER02->SetYTitle("p/E");
1206 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1207 outputContainer->Add(fhMCChHad1pOverER02);
1209 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1210 fhMCNeutral1pOverER02->SetYTitle("p/E");
1211 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1212 outputContainer->Add(fhMCNeutral1pOverER02);
1215 return outputContainer;
1218 //_______________________________________________________________________________________________________________________________________
1219 Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
1221 //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
1222 Float_t oldbinsize = histo->GetBinWidth(0);
1223 Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
1224 //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
1225 if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
1229 //__________________________________________________
1230 void AliAnaCalorimeterQA::Init()
1232 //Check if the data or settings are ok
1233 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1234 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1238 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1239 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1246 //__________________________________________________
1247 void AliAnaCalorimeterQA::InitParameters()
1249 //Initialize the parameters of the analysis.
1250 AddToHistogramsName("AnaCaloQA_");
1252 fCalorimeter = "EMCAL"; //or PHOS
1254 fNModules = 12; // set maximum to maximum number of EMCAL modules
1255 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
1257 fTimeCutMax = 9999999;
1259 fHistoPOverEBins = 100 ; fHistoPOverEMax = 10. ; fHistoPOverEMin = 0. ;
1260 fHistodEdxBins = 200 ; fHistodEdxMax = 400. ; fHistodEdxMin = 0. ;
1261 fHistodRBins = 300 ; fHistodRMax = 3.15 ; fHistodRMin = 0. ;
1262 fHistoTimeBins = 1000; fHistoTimeMax = 1.e3 ; fHistoTimeMin = 0. ;//ns
1263 fHistoNBins = 300 ; fHistoNMax = 300 ; fHistoNMin = 0 ;
1264 fHistoRatioBins = 200 ; fHistoRatioMax = 2 ; fHistoRatioMin = 0. ;
1265 fHistoVertexDistBins = 100 ; fHistoVertexDistMax = 500. ; fHistoVertexDistMin = 0. ;
1266 fHistoRBins = 100 ; fHistoRMax = 500 ; fHistoRMin = -500 ;//cm
1267 fHistoXBins = 100 ; fHistoXMax = 500 ; fHistoXMin = -500 ;//cm
1268 fHistoYBins = 100 ; fHistoYMax = 500 ; fHistoYMin = -500 ;//cm
1269 fHistoZBins = 100 ; fHistoZMax = 600 ; fHistoZMin = -500 ;//cm
1270 fHistoSSBins = 40 ; fHistoSSMax = 10 ; fHistoSSMin = 0 ;
1274 //__________________________________________________________________
1275 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1277 //Print some relevant parameters set for the analysis
1281 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1282 AliAnaPartCorrBaseClass::Print(" ");
1284 printf("Select Calorimeter %s \n",fCalorimeter.Data());
1285 printf("Make plots? %d \n",fMakePlots);
1286 printf("Plots style macro %s \n",fStyleMacro.Data());
1287 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
1288 printf("Histograms: %3.1f < p/E < %3.1f, Nbin = %d\n", fHistoPOverEMin, fHistoPOverEMax, fHistoPOverEBins);
1289 printf("Histograms: %3.1f < dEdx < %3.1f, Nbin = %d\n", fHistodEdxMin, fHistodEdxMax, fHistodEdxBins);
1290 printf("Histograms: %3.1f < dR (track cluster) < %3.1f, Nbin = %d\n", fHistodRMin, fHistodRMax, fHistodRBins);
1291 printf("Histograms: %3.1f < R=sqrt{x^2+y^2} < %3.1f, Nbin = %d\n", fHistoRMin, fHistoRMax, fHistoRBins);
1292 printf("Histograms: %3.1f < X < %3.1f, Nbin = %d\n", fHistoXMin, fHistoXMax, fHistoXBins);
1293 printf("Histograms: %3.1f < Y < %3.1f, Nbin = %d\n", fHistoYMin, fHistoYMax, fHistoYBins);
1294 printf("Histograms: %3.1f < Z < %3.1f, Nbin = %d\n", fHistoZMin, fHistoZMax, fHistoZBins);
1295 printf("Histograms: %g < Time < %g, Nbin = %d\n" , fHistoTimeMin, fHistoTimeMax, fHistoTimeBins);
1296 printf("Histograms: %d < N < %d, Nbin = %d\n" , fHistoNMin, fHistoNMax, fHistoNBins);
1297 printf("Histograms: %3.1f < Ratio< %3.1f, Nbin = %d\n", fHistoRatioMin, fHistoRatioMax, fHistoRatioBins);
1298 printf("Histograms: %3.1f < Vertex Distance < %3.1f, Nbin = %d\n", fHistoVertexDistMin, fHistoVertexDistMax, fHistoVertexDistBins);
1302 //__________________________________________________________________
1303 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1305 //Fill Calorimeter QA histograms
1306 TLorentzVector mom ;
1307 TLorentzVector mom2 ;
1308 TRefArray * caloClusters = new TRefArray();
1311 Int_t nCaloClusters = 0;
1312 Int_t nCaloCellsPerCluster = 0;
1313 Int_t nTracksMatched = 0;
1314 Int_t trackIndex = 0;
1317 //Play with the MC stack if available
1318 //Get the MC arrays and do some checks
1320 if(GetReader()->ReadStack()){
1323 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1326 //Fill some pure MC histograms, only primaries.
1327 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1328 TParticle *primary = GetMCStack()->Particle(i) ;
1329 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1330 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1331 primary->Momentum(mom);
1332 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1335 else if(GetReader()->ReadAODMCParticles()){
1337 if(!GetReader()->GetAODMCParticles(0)) {
1338 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1341 //Fill some pure MC histograms, only primaries.
1342 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1343 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1344 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1345 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1346 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1347 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1348 //aodprimary->Momentum(mom);
1349 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1350 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1357 //Get List with CaloClusters
1359 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1360 if (fCalorimeter == "EMCAL") ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1361 else if(fCalorimeter == "PHOS") ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1363 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1367 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1368 if (fCalorimeter == "EMCAL") ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1369 else if(fCalorimeter == "PHOS") ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1371 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1377 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n");
1381 //----------------------------------------------------------
1382 //Correlate Calorimeters
1383 //----------------------------------------------------------
1384 if(fCorrelateCalos) CorrelateCalorimeters(caloClusters);
1387 //----------------------------------------------------------
1389 //----------------------------------------------------------
1391 nCaloClusters = caloClusters->GetEntriesFast() ;
1392 fhNClusters->Fill(nCaloClusters);
1393 Int_t *nClustersInModule = new Int_t[fNModules];
1394 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1397 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1399 //Get vertex for photon momentum calculation
1400 Double_t v[3] = {0,0,0}; //vertex ;
1401 GetReader()->GetVertex(v);
1402 TObject * track = 0x0;
1405 Float_t showerShape[3] ;
1407 //Loop over CaloClusters
1408 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1409 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1411 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1412 iclus+1,nCaloClusters,GetReader()->GetDataType());
1414 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1415 AliESDCaloCluster* clus = (AliESDCaloCluster*) (caloClusters->At(iclus));
1416 AliESDCaloCells * cell = 0x0;
1417 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1418 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1420 //Check if the cluster contains any bad channel or it is close to the calorimeter borders
1421 if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue;
1422 if(!GetCaloUtils()->CheckCellFiducialRegion(clus, cell)) continue;
1423 //Recalibrate the cluster energy
1424 if( GetCaloUtils()->IsRecalibrationOn()) {
1425 Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cell);
1429 //Get cluster kinematics
1430 clus->GetPosition(pos);
1431 clus->GetMomentum(mom,v);
1432 tof = clus->GetTOF()*1e9;
1433 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1435 //Check only certain regions
1437 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1439 //Get module of cluster
1440 nModule = GetModuleNumber(clus);
1441 if(nModule < fNModules) nClustersInModule[nModule]++;
1443 nLabel = clus->GetNLabels();
1444 if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray();
1446 nCaloCellsPerCluster = clus->GetNCells();
1447 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1448 //matched cluster with tracks
1449 nTracksMatched = clus->GetNTracksMatched();
1450 trackIndex = clus->GetTrackMatched();
1451 if(trackIndex >= 0){
1452 track = (AliESDtrack*) ((AliESDEvent*)GetReader()->GetInputEvent())->GetTrack(trackIndex);
1455 if(nTracksMatched == 1) nTracksMatched = 0;
1459 //Shower shape parameters
1460 showerShape[0] = clus->GetM20();
1461 showerShape[1] = clus->GetM02();
1462 showerShape[2] = clus->GetClusterDisp();
1464 //======================
1466 //======================
1468 //Get list of contributors
1469 UShort_t * indexList = clus->GetCellsAbsId() ;
1470 // check time of cells respect to max energy cell
1471 //Get maximum energy cell
1476 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1477 //Loop on cluster cells
1478 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1479 // printf("Index %d\n",ipos);
1480 absId = indexList[ipos];
1482 //Get position of cell compare to cluster
1483 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1485 Double_t cellpos[] = {0, 0, 0};
1486 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1488 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1489 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1490 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1492 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1493 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1494 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1496 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1497 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1498 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1499 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1501 // Float_t celleta = 0, cellphi = 0;
1502 // GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi);
1503 // Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
1504 // GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1505 // GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1506 // iIphi, iIeta,iphi,ieta);
1507 // printf("AbsId %d, SM %d, Index eta %d, phi %d\n", absId, imod, ieta, iphi);
1508 // 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());
1509 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1510 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1511 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1512 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1515 }//EMCAL and its matrices are available
1516 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1518 Int_t relId[4], module;
1519 Float_t xCell, zCell;
1521 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1523 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1524 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1526 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1527 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1528 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1530 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1531 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1532 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1534 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1535 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1536 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1537 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1539 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1540 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1541 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1542 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1543 }//PHOS and its matrices are available
1545 //Find maximum energy cluster
1546 if(cell->GetCellAmplitude(absId) > emax) {
1548 emax = cell->GetCellAmplitude(absId);
1549 tmax = cell->GetCellTime(absId);
1552 }// cluster cell loop
1554 // check time of cells respect to max energy cell
1555 if(nCaloCellsPerCluster > 1){
1556 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1557 if(imax == ipos) continue;
1558 absId = indexList[ipos];
1559 Float_t diff = (tmax-cell->GetCellTime(absId))*1e9;
1560 fhCellTimeSpreadRespectToCellMax->Fill(diff);
1561 if(TMath::Abs(TMath::Abs(diff) > 100)) fhCellIdCellLargeTimeSpread->Fill(absId);
1562 }// fill cell-cluster histogram loop
1564 }//check time of cells respect to max energy cell
1569 AliAODCaloCluster* clus = (AliAODCaloCluster*) (caloClusters->At(iclus));
1570 AliAODCaloCells * cell = 0x0;
1571 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1572 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1574 //Check if the cluster contains any bad channel or it is close to calorimeter borders
1575 if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue;
1576 if(!GetCaloUtils()->CheckCellFiducialRegion(clus, cell)) continue;
1577 //Recalibrate the cluster energy
1578 if( GetCaloUtils()->IsRecalibrationOn()) {
1579 Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cell);
1583 //Get cluster kinematics
1584 clus->GetPosition(pos);
1585 clus->GetMomentum(mom,v);
1586 tof = clus->GetTOF()*1e9;
1587 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1589 //Check only certain regions
1591 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1593 //Get module of cluster
1594 nModule = GetModuleNumber(clus);
1595 if(nModule < fNModules) nClustersInModule[nModule]++;
1597 nLabel = clus->GetNLabel();
1598 if(clus->GetLabels()) labels = clus->GetLabels();
1600 nCaloCellsPerCluster = clus->GetNCells();
1601 //matched cluster with tracks
1602 nTracksMatched = clus->GetNTracksMatched();
1603 if(nTracksMatched > 0)
1604 track = (AliAODTrack*)clus->GetTrackMatched(0);
1606 //Shower shape parameters
1607 showerShape[0] = clus->GetM20();
1608 showerShape[1] = clus->GetM02();
1609 showerShape[2] = clus->GetDispersion();
1611 //======================
1613 //======================
1615 //Get list of contributors
1616 UShort_t * indexList = clus->GetCellsAbsId() ;
1618 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1619 //Loop on cluster cells
1620 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1621 // printf("Index %d\n",ipos);
1622 absId = indexList[ipos];
1624 //Get position of cell compare to cluster
1625 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1627 Double_t cellpos[] = {0, 0, 0};
1628 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1630 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1631 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1632 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1634 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1635 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1636 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1638 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1639 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1640 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1641 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1643 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1644 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1645 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1646 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1648 }// EMCAL and its matrices are available
1649 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1651 Int_t relId[4], module;
1652 Float_t xCell, zCell;
1654 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1656 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1657 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1659 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1660 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1661 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1663 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1664 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1665 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1667 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1668 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1669 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1670 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1672 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1673 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1674 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1675 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1677 } //PHOS and its matrices are available
1678 }// cluster cell loop
1682 //-----------------------------------------------------------
1683 //Fill histograms related to single cluster or track matching
1684 //-----------------------------------------------------------
1686 ClusterHistograms(mom, tof, pos, showerShape, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1689 //-----------------------------------------------------------
1691 //-----------------------------------------------------------
1692 if(GetDebug()>1) printf("Invariant mass \n");
1694 //do not do for bad vertex
1695 Float_t fZvtxCut = 40. ;
1696 if(v[2]<-fZvtxCut || v[2]> fZvtxCut) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
1698 Int_t nModule2 = -1;
1699 Int_t nCaloCellsPerCluster2=0;
1700 if (nCaloClusters > 1 ) {
1701 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1702 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1703 AliESDCaloCluster* clus2 = (AliESDCaloCluster*) (caloClusters->At(jclus));
1704 AliESDCaloCells * cell2 = 0x0;
1705 if(fCalorimeter == "PHOS") cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1706 else cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1707 //Check if the cluster contains any bad channel or it is close to calorimeter borders
1708 if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus2->GetCellsAbsId(), clus2->GetNCells())) continue;
1709 if(!GetCaloUtils()->CheckCellFiducialRegion(clus2, cell2)) continue;
1711 //Get cluster kinematics
1712 clus2->GetMomentum(mom2,v);
1713 //Check only certain regions
1715 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1717 //Get module of cluster
1718 nModule2 = GetModuleNumber(clus2);
1720 nCaloCellsPerCluster2 = clus2->GetNCells();
1723 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD){
1724 AliAODCaloCluster* clus2 = (AliAODCaloCluster*) (caloClusters->At(jclus));
1725 AliAODCaloCells * cell2 = 0x0;
1726 if(fCalorimeter == "PHOS") cell2 = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1727 else cell2 = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1728 //Check if the cluster contains any bad channel or it is close to calorimeter borders
1729 if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus2->GetCellsAbsId(), clus2->GetNCells())) continue;
1730 if(!GetCaloUtils()->CheckCellFiducialRegion(clus2, cell2)) continue;
1732 //Get cluster kinematics
1733 clus2->GetMomentum(mom2,v);
1734 //Check only certain regions
1736 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1738 //Get module of cluster
1739 nModule2 = GetModuleNumber(clus2);
1741 nCaloCellsPerCluster2 = clus2->GetNCells();
1744 //Fill invariant mass histograms
1747 //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());
1748 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1750 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1751 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1753 //Select only clusters with at least 2 cells
1754 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1756 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1758 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1759 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1762 //Asymetry histograms
1763 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1765 }// 2nd cluster loop
1766 }////more than 1 cluster in calorimeter
1769 //Number of clusters per module
1770 for(Int_t imod = 0; imod < fNModules; imod++ ){
1772 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1773 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1775 delete [] nClustersInModule;
1776 delete caloClusters;
1778 //----------------------------------------------------------
1780 //----------------------------------------------------------
1782 Int_t *nCellsInModule = new Int_t[fNModules];
1783 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1790 Float_t recalF = 1.;
1792 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1793 AliESDCaloCells * cell = 0x0;
1795 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1796 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1799 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s ESD CELLS available for analysis\n",fCalorimeter.Data());
1803 ncells = cell->GetNumberOfCells() ;
1804 fhNCells->Fill(ncells) ;
1806 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1808 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1809 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1810 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
1811 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1813 if(nModule < fNModules) {
1814 //Check if the cell is a bad channel
1815 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1816 if(fCalorimeter=="EMCAL"){
1817 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1820 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
1821 printf("PHOS bad channel\n");
1827 //Get Recalibration factor if set
1828 if (GetCaloUtils()->IsRecalibrationOn()) {
1829 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1830 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1831 if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
1834 amp = cell->GetAmplitude(iCell)*recalF;
1835 time = cell->GetTime(iCell)*1e9;//transform time to ns
1837 //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
1838 // amp,time,nModule,icol,irow);
1840 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1842 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1843 id = cell->GetCellNumber(iCell);
1844 fhAmplitude->Fill(amp);
1845 fhAmpId ->Fill(amp,id);
1846 fhTime ->Fill(time);
1847 fhTimeId ->Fill(time,id);
1848 fhTimeAmp ->Fill(amp,time);
1849 //Double_t t0 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0();
1850 //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0,
1851 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0zVertex(),
1852 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0clock(),
1853 // ((AliESDEvent*)GetReader()->GetInputEvent())->GetT0Trig());
1854 //fhT0Time ->Fill(time-t0);
1855 //fhT0TimeId ->Fill(time-t0,id);
1856 //fhT0TimeAmp ->Fill(amp,time-t0);
1858 fhAmplitudeMod[nModule]->Fill(amp);
1859 if(fCalorimeter=="EMCAL"){
1861 if(icol > 15 && icol < 32) ifrac = 1;
1862 else if(icol > 31) ifrac = 2;
1863 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
1868 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
1869 //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
1870 //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
1871 nCellsInModule[nModule]++;
1872 fhGridCellsMod[nModule] ->Fill(icol,irow);
1873 fhGridCellsEMod[nModule] ->Fill(icol,irow,amp);
1875 fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
1877 // AliESDCaloCells * cell2 = 0x0;
1878 // if(fCalorimeter == "PHOS") cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1879 // else cell2 = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1880 // Int_t icol2 = -1;
1881 // Int_t irow2 = -1;
1882 // Int_t iRCU2 = -1;
1883 // Float_t amp2 = 0.;
1884 // Float_t time2 = 0.;
1886 // Int_t nModule2 = -1;
1887 // for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {
1888 // amp2 = cell2->GetAmplitude(iCell2);
1889 // if(amp2 < 0.3) continue;
1890 // if(iCell2 == iCell) continue;
1891 // time2 = cell2->GetTime(iCell2)*1e9;//transform time to ns
1892 // //printf("%s: time %g\n",fCalorimeter.Data(), time);
1893 // id2 = cell2->GetCellNumber(iCell2);
1894 // nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
1895 // Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule);
1896 // //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());
1897 // fhTimeCorrRCU[index]->Fill(time,time2);
1899 // }// second cell loop
1903 //Get Eta-Phi position of Cell
1904 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1905 Float_t celleta = 0.;
1906 Float_t cellphi = 0.;
1907 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1908 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1910 Double_t cellpos[] = {0, 0, 0};
1911 GetEMCALGeometry()->GetGlobal(id, cellpos);
1912 fhXCellE->Fill(cellpos[0],amp) ;
1913 fhYCellE->Fill(cellpos[1],amp) ;
1914 fhZCellE->Fill(cellpos[2],amp) ;
1915 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1916 fhRCellE->Fill(rcell,amp) ;
1918 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1920 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1922 Int_t relId[4], module;
1923 Float_t xCell, zCell;
1925 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
1927 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1928 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1929 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
1930 fhXCellE ->Fill(xyz.X(),amp) ;
1931 fhYCellE ->Fill(xyz.Y(),amp) ;
1932 fhZCellE ->Fill(xyz.Z(),amp) ;
1933 fhRCellE ->Fill(rcell ,amp) ;
1934 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
1940 AliAODCaloCells * cell = 0x0;
1943 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1944 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1947 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s AOD CELLS available for analysis\n",fCalorimeter.Data());
1952 ncells = cell->GetNumberOfCells() ;
1953 fhNCells->Fill(ncells) ;
1955 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In AOD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1957 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1958 id = cell->GetCellNumber(iCell);
1959 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), id);
1960 nModule = GetModuleNumberCellIndexes(id, fCalorimeter, icol, irow, iRCU);
1961 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1963 if(nModule < fNModules) {
1964 //Check if the cell is a bad channel
1965 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1966 if(fCalorimeter=="EMCAL"){
1967 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1970 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) continue;
1974 //Get Recalibration factor if set
1975 if (GetCaloUtils()->IsRecalibrationOn()) {
1976 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1977 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1978 //printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
1981 amp = cell->GetAmplitude(iCell)*recalF;
1982 fhAmplitude->Fill(amp);
1983 fhAmpId ->Fill(amp,id);
1984 fhAmplitudeMod[nModule]->Fill(amp);
1985 if(fCalorimeter=="EMCAL"){
1987 if(icol > 15 && icol < 32) ifrac = 1;
1988 else if(icol > 31) ifrac = 2;
1989 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
1992 fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, -1);
1994 nCellsInModule[nModule]++;
1995 fhGridCellsMod[nModule] ->Fill(icol,irow);
1996 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
2000 //Get Eta-Phi position of Cell
2001 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
2002 Float_t celleta = 0.;
2003 Float_t cellphi = 0.;
2004 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
2005 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
2007 Double_t cellpos[] = {0, 0, 0};
2008 GetEMCALGeometry()->GetGlobal(id, cellpos);
2009 fhXCellE->Fill(cellpos[0],amp) ;
2010 fhYCellE->Fill(cellpos[1],amp) ;
2011 fhZCellE->Fill(cellpos[2],amp) ;
2012 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
2013 fhRCellE->Fill(rcell,amp) ;
2015 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
2017 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
2019 Int_t relId[4], module;
2020 Float_t xCell, zCell;
2022 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
2024 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
2025 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
2026 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
2027 fhXCellE ->Fill(xyz.X(),amp) ;
2028 fhYCellE ->Fill(xyz.Y(),amp) ;
2029 fhZCellE ->Fill(xyz.Z(),amp) ;
2030 fhRCellE ->Fill(rcell ,amp) ;
2031 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
2036 //Number of cells per module
2037 for(Int_t imod = 0; imod < fNModules; imod++ ) {
2039 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
2040 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
2042 delete [] nCellsInModule;
2045 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
2049 //__________________________________
2050 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof, Float_t *pos, Float_t *showerShape,
2051 const Int_t nCaloCellsPerCluster,const Int_t nModule,
2052 const Int_t nTracksMatched, const TObject * track,
2053 const Int_t * labels, const Int_t nLabels){
2054 //Fill CaloCluster related histograms
2056 AliAODMCParticle * aodprimary = 0x0;
2057 TParticle * primary = 0x0;
2060 Float_t e = mom.E();
2061 Float_t pt = mom.Pt();
2062 Float_t eta = mom.Eta();
2063 Float_t phi = mom.Phi();
2064 if(phi < 0) phi +=TMath::TwoPi();
2065 if(GetDebug() > 0) {
2066 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
2068 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
2069 printf("\t Primaries: nlabels %d\n",nLabels);
2070 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
2075 if(nModule < fNModules) fhEMod[nModule]->Fill(e);
2079 fhEtaPhiE->Fill(eta,phi,e);
2080 fhXE ->Fill(pos[0],e);
2081 fhYE ->Fill(pos[1],e);
2082 fhZE ->Fill(pos[2],e);
2083 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
2084 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
2085 fhRE ->Fill(rxyz,e);
2086 fhClusterTimeEnergy->Fill(e,tof);
2088 //Shower shape parameters
2089 fhLambda->Fill(showerShape[0], showerShape[1], e);
2090 fhDispersion->Fill(showerShape[2],e);
2093 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster,eta);
2094 fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster,eta);
2095 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
2096 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
2097 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
2098 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
2100 if(nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
2102 //Fill histograms only possible when simulation
2103 if(IsDataMC() && nLabels > 0 && labels){
2105 //Play with the MC stack if available
2106 Int_t label = labels[0];
2109 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
2113 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
2114 Float_t vxMC= 0; Float_t vyMC = 0;
2115 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
2119 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
2121 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
2123 if( label >= GetMCStack()->GetNtrack()) {
2124 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
2128 primary = GetMCStack()->Particle(label);
2130 pdg0 = TMath::Abs(primary->GetPdgCode());
2132 status = primary->GetStatusCode();
2133 vxMC = primary->Vx();
2134 vyMC = primary->Vy();
2135 iParent = primary->GetFirstMother();
2137 if(GetDebug() > 1 ) {
2138 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2139 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
2142 //Get final particle, no conversion products
2143 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2145 primary = GetMCStack()->Particle(iParent);
2146 pdg = TMath::Abs(primary->GetPdgCode());
2147 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2148 while((pdg == 22 || pdg == 11) && status != 1){
2150 primary = GetMCStack()->Particle(iMother);
2151 status = primary->GetStatusCode();
2152 iParent = primary->GetFirstMother();
2153 pdg = TMath::Abs(primary->GetPdgCode());
2154 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
2157 if(GetDebug() > 1 ) {
2158 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2159 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
2164 //Overlapped pi0 (or eta, there will be very few), get the meson
2165 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2166 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2167 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
2168 while(pdg != 111 && pdg != 221){
2170 primary = GetMCStack()->Particle(iMother);
2171 status = primary->GetStatusCode();
2172 iParent = primary->GetFirstMother();
2173 pdg = TMath::Abs(primary->GetPdgCode());
2174 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
2176 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2181 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2182 primary->GetName(),iMother);
2185 eMC = primary->Energy();
2186 ptMC = primary->Pt();
2187 phiMC = primary->Phi();
2188 etaMC = primary->Eta();
2189 pdg = TMath::Abs(primary->GetPdgCode());
2190 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2193 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
2194 //Get the list of MC particles
2195 if(!GetReader()->GetAODMCParticles(0)) {
2196 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
2200 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
2202 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
2204 status = aodprimary->IsPrimary();
2205 vxMC = aodprimary->Xv();
2206 vyMC = aodprimary->Yv();
2207 iParent = aodprimary->GetMother();
2209 if(GetDebug() > 1 ) {
2210 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2211 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
2212 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
2215 //Get final particle, no conversion products
2216 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2218 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2220 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
2221 pdg = TMath::Abs(aodprimary->GetPdgCode());
2222 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
2224 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2225 status = aodprimary->IsPrimary();
2226 iParent = aodprimary->GetMother();
2227 pdg = TMath::Abs(aodprimary->GetPdgCode());
2229 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
2230 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2233 if(GetDebug() > 1 ) {
2234 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2235 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
2236 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2241 //Overlapped pi0 (or eta, there will be very few), get the meson
2242 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2243 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2244 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
2245 while(pdg != 111 && pdg != 221){
2248 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2249 status = aodprimary->IsPrimary();
2250 iParent = aodprimary->GetMother();
2251 pdg = TMath::Abs(aodprimary->GetPdgCode());
2253 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
2256 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2261 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2262 aodprimary->GetName(),iMother);
2265 status = aodprimary->IsPrimary();
2266 eMC = aodprimary->E();
2267 ptMC = aodprimary->Pt();
2268 phiMC = aodprimary->Phi();
2269 etaMC = aodprimary->Eta();
2270 pdg = TMath::Abs(aodprimary->GetPdgCode());
2271 charge = aodprimary->Charge();
2275 //Float_t vz = primary->Vz();
2276 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
2277 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
2278 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2279 fhEMR ->Fill(e,rVMC);
2282 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
2283 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
2284 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
2287 fh2E ->Fill(e, eMC);
2288 fh2Pt ->Fill(pt, ptMC);
2289 fh2Phi ->Fill(phi, phiMC);
2290 fh2Eta ->Fill(eta, etaMC);
2291 fhDeltaE ->Fill(eMC-e);
2292 fhDeltaPt ->Fill(ptMC-pt);
2293 fhDeltaPhi->Fill(phiMC-phi);
2294 fhDeltaEta->Fill(etaMC-eta);
2295 if(eMC > 0) fhRatioE ->Fill(e/eMC);
2296 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
2297 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
2298 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
2301 //Overlapped pi0 (or eta, there will be very few)
2302 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2303 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2304 fhPi0E ->Fill(e,eMC);
2305 fhPi0Pt ->Fill(pt,ptMC);
2306 fhPi0Eta ->Fill(eta,etaMC);
2307 fhPi0Phi ->Fill(phi,phiMC);
2308 if( nTracksMatched > 0){
2309 fhPi0ECharged ->Fill(e,eMC);
2310 fhPi0PtCharged ->Fill(pt,ptMC);
2311 fhPi0PhiCharged ->Fill(phi,phiMC);
2312 fhPi0EtaCharged ->Fill(eta,etaMC);
2314 }//Overlapped pizero decay
2315 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
2316 fhGamE ->Fill(e,eMC);
2317 fhGamPt ->Fill(pt,ptMC);
2318 fhGamEta ->Fill(eta,etaMC);
2319 fhGamPhi ->Fill(phi,phiMC);
2320 fhGamDeltaE ->Fill(eMC-e);
2321 fhGamDeltaPt ->Fill(ptMC-pt);
2322 fhGamDeltaPhi->Fill(phiMC-phi);
2323 fhGamDeltaEta->Fill(etaMC-eta);
2324 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
2325 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
2326 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
2327 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
2328 if( nTracksMatched > 0){
2329 fhGamECharged ->Fill(e,eMC);
2330 fhGamPtCharged ->Fill(pt,ptMC);
2331 fhGamPhiCharged ->Fill(phi,phiMC);
2332 fhGamEtaCharged ->Fill(eta,etaMC);
2335 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
2336 fhEleE ->Fill(e,eMC);
2337 fhElePt ->Fill(pt,ptMC);
2338 fhEleEta ->Fill(eta,etaMC);
2339 fhElePhi ->Fill(phi,phiMC);
2340 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2341 fhEMR ->Fill(e,rVMC);
2342 if( nTracksMatched > 0){
2343 fhEleECharged ->Fill(e,eMC);
2344 fhElePtCharged ->Fill(pt,ptMC);
2345 fhElePhiCharged ->Fill(phi,phiMC);
2346 fhEleEtaCharged ->Fill(eta,etaMC);
2349 else if(charge == 0){
2350 fhNeHadE ->Fill(e,eMC);
2351 fhNeHadPt ->Fill(pt,ptMC);
2352 fhNeHadEta ->Fill(eta,etaMC);
2353 fhNeHadPhi ->Fill(phi,phiMC);
2354 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2355 fhHaR ->Fill(e,rVMC);
2356 if( nTracksMatched > 0){
2357 fhNeHadECharged ->Fill(e,eMC);
2358 fhNeHadPtCharged ->Fill(pt,ptMC);
2359 fhNeHadPhiCharged ->Fill(phi,phiMC);
2360 fhNeHadEtaCharged ->Fill(eta,etaMC);
2364 fhChHadE ->Fill(e,eMC);
2365 fhChHadPt ->Fill(pt,ptMC);
2366 fhChHadEta ->Fill(eta,etaMC);
2367 fhChHadPhi ->Fill(phi,phiMC);
2368 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2369 fhHaR ->Fill(e,rVMC);
2370 if( nTracksMatched > 0){
2371 fhChHadECharged ->Fill(e,eMC);
2372 fhChHadPtCharged ->Fill(pt,ptMC);
2373 fhChHadPhiCharged ->Fill(phi,phiMC);
2374 fhChHadEtaCharged ->Fill(eta,etaMC);
2380 //Match tracks and clusters
2381 //To be Modified in case of AODs
2383 //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
2385 if( nTracksMatched > 0){
2386 fhECharged ->Fill(e);
2387 fhPtCharged ->Fill(pt);
2388 fhPhiCharged ->Fill(phi);
2389 fhEtaCharged ->Fill(eta);
2390 fhEtaPhiECharged->Fill(eta,phi,e);
2391 fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster,eta);
2393 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2394 //Study the track and matched cluster if track exists.
2396 Double_t emcpos[3] = {0.,0.,0.};
2397 Double_t emcmom[3] = {0.,0.,0.};
2398 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2399 Double_t bfield = 0.;
2405 Double_t tpcSignal = 0;
2406 Bool_t okpos = kFALSE;
2407 Bool_t okmom = kFALSE;
2408 Bool_t okout = kFALSE;
2412 //In case of ESDs get the parameters in this way
2413 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2414 if (((AliESDtrack*)track)->GetOuterParam() ) {
2417 bfield = ((AliESDEvent*)GetReader()->GetInputEvent())->GetMagneticField();
2418 okpos = ((AliESDtrack*)track)->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2419 okmom = ((AliESDtrack*)track)->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2420 if(!(okpos && okmom)) return;
2422 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2423 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2424 tphi = position.Phi();
2425 teta = position.Eta();
2426 tmom = momentum.Mag();
2428 //Double_t tphi = ((AliESDtrack*)track)->GetOuterParam()->Phi();
2429 //Double_t teta = ((AliESDtrack*)track)->GetOuterParam()->Eta();
2430 //Double_t tmom = ((AliESDtrack*)track)->GetOuterParam()->P();
2431 tpt = ((AliESDtrack*)track)->Pt();
2432 tmom2 = ((AliESDtrack*)track)->P();
2433 tpcSignal = ((AliESDtrack*)track)->GetTPCsignal();
2435 nITS = ((AliESDtrack*)track)->GetNcls(0);
2436 nTPC = ((AliESDtrack*)track)->GetNcls(1);
2437 }//Outer param available
2439 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2440 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2443 pid->GetEMCALPosition(emcpos);
2444 pid->GetEMCALMomentum(emcmom);
2446 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2447 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2448 tphi = position.Phi();
2449 teta = position.Eta();
2450 tmom = momentum.Mag();
2452 tpt = ((AliAODTrack*)track)->Pt();
2453 tmom2 = ((AliAODTrack*)track)->P();
2454 tpcSignal = pid->GetTPCsignal();
2456 //nITS = ((AliAODTrack*)track)->GetNcls(0);
2457 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
2458 }//Outer param available
2460 else return; //Do nothing case not implemented.
2463 Double_t deta = teta - eta;
2464 Double_t dphi = tphi - phi;
2465 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2466 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2467 Double_t dR = sqrt(dphi*dphi + deta*deta);
2469 Double_t pOverE = tmom/e;
2471 fh1pOverE->Fill(tpt, pOverE);
2472 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
2475 fh2MatchdEdx->Fill(tmom2,tpcSignal);
2477 if(IsDataMC() && primary){
2478 Int_t pdg = primary->GetPdgCode();
2479 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2481 if(TMath::Abs(pdg) == 11){
2482 fhMCEle1pOverE->Fill(tpt,pOverE);
2483 fhMCEle1dR->Fill(dR);
2484 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2485 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2488 fhMCChHad1pOverE->Fill(tpt,pOverE);
2489 fhMCChHad1dR->Fill(dR);
2490 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2491 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2493 else if(charge == 0){
2494 fhMCNeutral1pOverE->Fill(tpt,pOverE);
2495 fhMCNeutral1dR->Fill(dR);
2496 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2497 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2501 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2502 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2503 fh2EledEdx->Fill(tmom2,tpcSignal);
2506 else{//no ESD external param or AODPid
2507 // ULong_t status=AliESDtrack::kTPCrefit;
2508 // status|=AliESDtrack::kITSrefit;
2509 //printf("track status %d\n", track->GetStatus() );
2510 // fhEChargedNoOut ->Fill(e);
2511 // fhPtChargedNoOut ->Fill(pt);
2512 // fhPhiChargedNoOut ->Fill(phi);
2513 // fhEtaChargedNoOut ->Fill(eta);
2514 // fhEtaPhiChargedNoOut ->Fill(eta,phi);
2515 // if(GetDebug() >= 0 && ((((AliESDtrack*)track)->GetStatus() & status) == status)) printf("ITS+TPC\n");
2516 if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
2519 }//matched clusters with tracks
2523 //__________________________________
2524 void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
2525 // Correlate information from PHOS and EMCAL
2526 TRefArray * caloClustersEMCAL = 0;
2527 TRefArray * caloClustersPHOS = 0;
2529 // Get once the array of clusters per calorimeter, avoid an extra loop.
2530 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2531 if(fCalorimeter == "EMCAL"){
2532 caloClustersPHOS = new TRefArray();
2533 ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
2534 caloClustersEMCAL = new TRefArray(*refArray);
2536 else if(fCalorimeter == "PHOS") {
2537 caloClustersEMCAL = new TRefArray();
2538 ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
2539 caloClustersPHOS = new TRefArray(*refArray);
2542 //Fill histograms with clusters
2544 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2545 Float_t sumClusterEnergyEMCAL = 0;
2546 Float_t sumClusterEnergyPHOS = 0;
2548 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2549 sumClusterEnergyEMCAL += ((AliESDCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
2550 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2551 sumClusterEnergyPHOS += ((AliESDCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
2552 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2554 //Fill histograms with cells
2556 AliESDCaloCells * cellsEMCAL = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2557 AliESDCaloCells * cellsPHOS = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2558 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2561 Float_t sumCellEnergyEMCAL = 0;
2562 Float_t sumCellEnergyPHOS = 0;
2563 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2564 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2565 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2566 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2567 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2568 if(GetDebug() > 0 ){
2569 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2570 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2571 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2572 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2573 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2576 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2577 if(fCalorimeter == "EMCAL"){
2578 ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
2579 caloClustersEMCAL = refArray;
2581 else if(fCalorimeter == "PHOS") {
2582 ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
2583 caloClustersEMCAL = refArray;
2586 //Fill histograms with clusters
2588 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2589 Float_t sumClusterEnergyEMCAL = 0;
2590 Float_t sumClusterEnergyPHOS = 0;
2592 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2593 sumClusterEnergyEMCAL += ((AliAODCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
2594 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2595 sumClusterEnergyPHOS += ((AliAODCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
2596 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2598 //Fill histograms with cells
2600 AliAODCaloCells * cellsEMCAL = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
2601 AliAODCaloCells * cellsPHOS = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
2602 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2605 Float_t sumCellEnergyEMCAL = 0;
2606 Float_t sumCellEnergyPHOS = 0;
2607 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2608 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2609 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2610 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2611 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2612 if(GetDebug() > 0 ){
2613 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2614 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2615 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2616 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2617 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2621 delete caloClustersEMCAL;
2622 delete caloClustersPHOS;
2626 //______________________________________________________________________________
2627 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
2628 //Fill pure monte carlo related histograms
2630 Float_t eMC = mom.E();
2631 Float_t ptMC = mom.Pt();
2632 Float_t phiMC = mom.Phi();
2634 phiMC += TMath::TwoPi();
2635 Float_t etaMC = mom.Eta();
2637 if (TMath::Abs(etaMC) > 1) return;
2640 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2643 fhGenGamPt ->Fill(ptMC);
2644 fhGenGamEta->Fill(etaMC);
2645 fhGenGamPhi->Fill(phiMC);
2647 fhGenGamAccE ->Fill(eMC);
2648 fhGenGamAccPt ->Fill(ptMC);
2649 fhGenGamAccEta->Fill(etaMC);
2650 fhGenGamAccPhi->Fill(phiMC);
2653 else if (pdg==111) {
2654 fhGenPi0Pt ->Fill(ptMC);
2655 fhGenPi0Eta->Fill(etaMC);
2656 fhGenPi0Phi->Fill(phiMC);
2658 fhGenPi0AccE ->Fill(eMC);
2659 fhGenPi0AccPt ->Fill(ptMC);
2660 fhGenPi0AccEta->Fill(etaMC);
2661 fhGenPi0AccPhi->Fill(phiMC);
2664 else if (pdg==221) {
2665 fhGenEtaPt ->Fill(ptMC);
2666 fhGenEtaEta->Fill(etaMC);
2667 fhGenEtaPhi->Fill(phiMC);
2669 else if (pdg==223) {
2670 fhGenOmegaPt ->Fill(ptMC);
2671 fhGenOmegaEta->Fill(etaMC);
2672 fhGenOmegaPhi->Fill(phiMC);
2674 else if (TMath::Abs(pdg)==11) {
2675 fhGenElePt ->Fill(ptMC);
2676 fhGenEleEta->Fill(etaMC);
2677 fhGenElePhi->Fill(phiMC);
2682 //________________________________________________________________________
2683 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2685 // Needed when Terminate is executed in distributed environment
2686 // Refill analysis histograms of this class with corresponding histograms in output list.
2688 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2689 // the first one and then add the next
2690 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
2691 //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2693 //Read histograms, must be in the same order as in GetCreateOutputObject.
2694 fhE = (TH1F *) outputList->At(index++);
2695 fhPt = (TH1F *) outputList->At(index++);
2696 fhPhi = (TH1F *) outputList->At(index++);
2697 fhEta = (TH1F *) outputList->At(index++);
2698 fhEtaPhiE = (TH3F *) outputList->At(index++);
2700 fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
2702 fhLambda = (TH3F *) outputList->At(index++);
2703 fhDispersion = (TH2F *) outputList->At(index++);
2705 fhECharged = (TH1F *) outputList->At(index++);
2706 fhPtCharged = (TH1F *) outputList->At(index++);
2707 fhPhiCharged = (TH1F *) outputList->At(index++);
2708 fhEtaCharged = (TH1F *) outputList->At(index++);
2709 fhEtaPhiECharged = (TH3F *) outputList->At(index++);
2711 // fhEChargedNoOut = (TH1F *) outputList->At(index++);
2712 // fhPtChargedNoOut = (TH1F *) outputList->At(index++);
2713 // fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
2714 // fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
2715 // fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
2717 fh1pOverE = (TH2F *) outputList->At(index++);
2718 fh1dR = (TH1F *) outputList->At(index++);
2719 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2720 fh2EledEdx = (TH2F *) outputList->At(index++);
2721 fh1pOverER02 = (TH2F *) outputList->At(index++);
2723 fhIM = (TH2F *) outputList->At(index++);
2724 fhIMCellCut = (TH2F *) outputList->At(index++);
2725 fhAsym = (TH2F *) outputList->At(index++);
2727 fhNCellsPerCluster = (TH3F *) outputList->At(index++);
2728 fhNCellsPerClusterMIP = (TH3F *) outputList->At(index++);
2729 fhNCellsPerClusterMIPCharged = (TH3F *) outputList->At(index++);
2730 fhNClusters = (TH1F *) outputList->At(index++);
2732 fhRNCells = (TH2F *) outputList->At(index++);
2733 fhXNCells = (TH2F *) outputList->At(index++);
2734 fhYNCells = (TH2F *) outputList->At(index++);
2735 fhZNCells = (TH2F *) outputList->At(index++);
2736 fhRE = (TH2F *) outputList->At(index++);
2737 fhXE = (TH2F *) outputList->At(index++);
2738 fhYE = (TH2F *) outputList->At(index++);
2739 fhZE = (TH2F *) outputList->At(index++);
2740 fhXYZ = (TH3F *) outputList->At(index++);
2742 fhRCellE = (TH2F *) outputList->At(index++);
2743 fhXCellE = (TH2F *) outputList->At(index++);
2744 fhYCellE = (TH2F *) outputList->At(index++);
2745 fhZCellE = (TH2F *) outputList->At(index++);
2746 fhXYZCell = (TH3F *) outputList->At(index++);
2747 fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
2748 fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
2749 fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
2750 fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
2751 fhDeltaCellClusterRE = (TH2F *) outputList->At(index++);
2752 fhDeltaCellClusterXE = (TH2F *) outputList->At(index++);
2753 fhDeltaCellClusterYE = (TH2F *) outputList->At(index++);
2754 fhDeltaCellClusterZE = (TH2F *) outputList->At(index++);
2755 fhEtaPhiAmp = (TH3F *) outputList->At(index++);
2757 fhNCells = (TH1F *) outputList->At(index++);
2758 fhAmplitude = (TH1F *) outputList->At(index++);
2759 fhAmpId = (TH2F *) outputList->At(index++);
2761 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2763 fhCellTimeSpreadRespectToCellMax = (TH1F *) outputList->At(index++);
2764 fhCellIdCellLargeTimeSpread = (TH1F *) outputList->At(index++);
2766 fhTime = (TH1F *) outputList->At(index++);
2767 fhTimeId = (TH2F *) outputList->At(index++);
2768 fhTimeAmp = (TH2F *) outputList->At(index++);
2770 // fhT0Time = (TH1F *) outputList->At(index++);
2771 // fhT0TimeId = (TH2F *) outputList->At(index++);
2772 // fhT0TimeAmp = (TH2F *) outputList->At(index++);
2777 if(fCorrelateCalos){
2778 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2779 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2780 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2781 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2785 fhEMod = new TH1F*[fNModules];
2786 fhNClustersMod = new TH1F*[fNModules];
2787 fhNCellsPerClusterMod = new TH2F*[fNModules];
2788 fhNCellsMod = new TH1F*[fNModules];
2789 fhGridCellsMod = new TH2F*[fNModules];
2790 fhGridCellsEMod = new TH2F*[fNModules];
2791 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2792 fhGridCellsTimeMod = new TH2F*[fNModules];
2793 fhAmplitudeMod = new TH1F*[fNModules];
2794 if(fCalorimeter=="EMCAL")
2795 fhAmplitudeModFraction = new TH1F*[fNModules*3];
2798 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2800 fhIMMod = new TH2F*[fNModules];
2801 fhIMCellCutMod = new TH2F*[fNModules];
2803 for(Int_t imod = 0 ; imod < fNModules; imod++){
2804 fhEMod[imod] = (TH1F *) outputList->At(index++);
2805 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2806 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2807 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2808 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2809 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2810 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2811 fhGridCellsTimeMod[imod] = (TH2F *) outputList->At(index++);
2812 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2814 if(fCalorimeter=="EMCAL"){
2815 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
2816 fhAmplitudeModFraction[imod*3+ifrac] = (TH1F *) outputList->At(index++);
2820 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
2821 fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2822 //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2823 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
2824 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
2825 // fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2] = (TH2F *) outputList->At(index++);
2829 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2830 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
2835 fhDeltaE = (TH1F *) outputList->At(index++);
2836 fhDeltaPt = (TH1F *) outputList->At(index++);
2837 fhDeltaPhi = (TH1F *) outputList->At(index++);
2838 fhDeltaEta = (TH1F *) outputList->At(index++);
2840 fhRatioE = (TH1F *) outputList->At(index++);
2841 fhRatioPt = (TH1F *) outputList->At(index++);
2842 fhRatioPhi = (TH1F *) outputList->At(index++);
2843 fhRatioEta = (TH1F *) outputList->At(index++);
2845 fh2E = (TH2F *) outputList->At(index++);
2846 fh2Pt = (TH2F *) outputList->At(index++);
2847 fh2Phi = (TH2F *) outputList->At(index++);
2848 fh2Eta = (TH2F *) outputList->At(index++);
2850 fhGamE = (TH2F *) outputList->At(index++);
2851 fhGamPt = (TH2F *) outputList->At(index++);
2852 fhGamPhi = (TH2F *) outputList->At(index++);
2853 fhGamEta = (TH2F *) outputList->At(index++);
2855 fhGamDeltaE = (TH1F *) outputList->At(index++);
2856 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2857 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2858 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2860 fhGamRatioE = (TH1F *) outputList->At(index++);
2861 fhGamRatioPt = (TH1F *) outputList->At(index++);
2862 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2863 fhGamRatioEta = (TH1F *) outputList->At(index++);
2865 fhPi0E = (TH2F *) outputList->At(index++);
2866 fhPi0Pt = (TH2F *) outputList->At(index++);
2867 fhPi0Phi = (TH2F *) outputList->At(index++);
2868 fhPi0Eta = (TH2F *) outputList->At(index++);
2870 fhEleE = (TH2F *) outputList->At(index++);
2871 fhElePt = (TH2F *) outputList->At(index++);
2872 fhElePhi = (TH2F *) outputList->At(index++);
2873 fhEleEta = (TH2F *) outputList->At(index++);
2875 fhNeHadE = (TH2F *) outputList->At(index++);
2876 fhNeHadPt = (TH2F *) outputList->At(index++);
2877 fhNeHadPhi = (TH2F *) outputList->At(index++);
2878 fhNeHadEta = (TH2F *) outputList->At(index++);
2880 fhChHadE = (TH2F *) outputList->At(index++);
2881 fhChHadPt = (TH2F *) outputList->At(index++);
2882 fhChHadPhi = (TH2F *) outputList->At(index++);
2883 fhChHadEta = (TH2F *) outputList->At(index++);
2885 fhGamECharged = (TH2F *) outputList->At(index++);
2886 fhGamPtCharged = (TH2F *) outputList->At(index++);
2887 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2888 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2890 fhPi0ECharged = (TH2F *) outputList->At(index++);
2891 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2892 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2893 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2895 fhEleECharged = (TH2F *) outputList->At(index++);
2896 fhElePtCharged = (TH2F *) outputList->At(index++);
2897 fhElePhiCharged = (TH2F *) outputList->At(index++);
2898 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2900 fhNeHadECharged = (TH2F *) outputList->At(index++);
2901 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2902 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2903 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2905 fhChHadECharged = (TH2F *) outputList->At(index++);
2906 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2907 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2908 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2910 // fhEMVxyz = (TH3F *) outputList->At(index++);
2911 // fhHaVxyz = (TH3F *) outputList->At(index++);
2913 fhEMVxyz = (TH2F *) outputList->At(index++);
2914 fhHaVxyz = (TH2F *) outputList->At(index++);
2915 fhEMR = (TH2F *) outputList->At(index++);
2916 fhHaR = (TH2F *) outputList->At(index++);
2918 fhGenGamPt = (TH1F *) outputList->At(index++);
2919 fhGenGamEta = (TH1F *) outputList->At(index++);
2920 fhGenGamPhi = (TH1F *) outputList->At(index++);
2922 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2923 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2924 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2926 fhGenEtaPt = (TH1F *) outputList->At(index++);
2927 fhGenEtaEta = (TH1F *) outputList->At(index++);
2928 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2930 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2931 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2932 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2934 fhGenElePt = (TH1F *) outputList->At(index++);
2935 fhGenEleEta = (TH1F *) outputList->At(index++);
2936 fhGenElePhi = (TH1F *) outputList->At(index++);
2938 fhGenGamAccE = (TH1F *) outputList->At(index++);
2939 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2940 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2941 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2943 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2944 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2945 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2946 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2948 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
2949 fhMCEle1dR = (TH1F *) outputList->At(index++);
2950 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2952 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
2953 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2954 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2956 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
2957 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2958 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2960 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2961 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2962 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
2966 //__________________________________________________________________
2967 void AliAnaCalorimeterQA::Terminate(TList* outputList)
2969 //Do plots if requested
2971 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
2972 if(!fMakePlots) return;
2974 //Do some plots to end
2975 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
2976 //Recover histograms from output histograms list, needed for distributed analysis.
2977 ReadHistograms(outputList);
2979 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2980 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
2985 //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
2986 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
2987 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
2988 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
2989 // Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
2990 // Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
2991 // Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
2992 // Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
2993 // Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
2994 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
2995 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
2996 // Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
2997 // Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
2998 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
2999 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
3000 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
3001 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
3003 //Color code for the different modules
3004 Int_t modColorIndex[]={2,4,6,8};
3006 //--------------------------------------------------
3007 // Cluster energy distributions, module dependence
3008 //--------------------------------------------------
3009 sprintf(cname,"QA_%s_ClusterEnergy",fCalorimeter.Data());
3010 TCanvas * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
3012 Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
3013 //printf("new E rb %d\n",rbE);
3015 fhE->SetAxisRange(ptmin,ptmax,"X");
3017 if(fhE->GetEntries() > 0) gPad->SetLogy();
3018 TLegend pLegendE(0.7,0.6,0.9,0.8);
3019 pLegendE.SetTextSize(0.03);
3020 pLegendE.AddEntry(fhE,"all modules","L");
3021 pLegendE.SetFillColor(10);
3022 pLegendE.SetBorderSize(1);
3025 fhE->SetLineColor(1);
3027 for(Int_t imod = 0; imod < fNModules; imod++){
3028 fhEMod[imod]->Rebin(rbE);
3029 fhEMod[imod]->SetLineColor(modColorIndex[imod]);
3030 fhEMod[imod]->Draw("HE same");
3031 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
3037 TLegend pLegendER(0.55,0.8,0.9,0.9);
3038 pLegendER.SetTextSize(0.03);
3039 pLegendER.SetFillColor(10);
3040 pLegendER.SetBorderSize(1);
3042 for(Int_t imod = 1; imod < fNModules; imod++){
3043 TH1D * htmp = (TH1D*)fhEMod[imod]->Clone(Form("hERat%d",imod));
3044 htmp->Divide(fhEMod[0]);
3045 htmp->SetLineColor(modColorIndex[imod]);
3047 htmp->SetTitle("Ratio module X / module 0");
3048 htmp->SetAxisRange(ptmin,ptmax,"X");
3049 htmp->SetMaximum(5);
3050 htmp->SetMinimum(0);
3051 htmp->SetAxisRange(ptmin,ptmax,"X");
3055 htmp->Draw("same HE");
3057 pLegendER.AddEntry(fhEMod[imod],Form("module %d / module 0",imod),"L");
3061 sprintf(name,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
3062 c->Print(name); printf("Plot: %s\n",name);
3064 //--------------------------------------------------
3065 // Cell energy distributions, module dependence
3066 //--------------------------------------------------
3067 sprintf(cname,"%s_QA_CellEnergy",fCalorimeter.Data());
3068 TCanvas * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
3071 Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
3072 //printf("new Amp rb %d\n",rbAmp);
3073 fhAmplitude->Rebin(rbAmp);
3074 fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
3077 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
3078 TLegend pLegendA(0.7,0.6,0.9,0.8);
3079 pLegendA.SetTextSize(0.03);
3080 pLegendA.AddEntry(fhE,"all modules","L");
3081 pLegendA.SetFillColor(10);
3082 pLegendA.SetBorderSize(1);
3083 fhAmplitude->SetMinimum(0.1);
3084 fhAmplitude->SetLineColor(1);
3085 fhAmplitude->Draw("HE");
3087 for(Int_t imod = 0; imod < fNModules; imod++){
3088 fhAmplitudeMod[imod]->Rebin(rbAmp);
3089 fhAmplitudeMod[imod]->SetLineColor(modColorIndex[imod]);
3090 fhAmplitudeMod[imod]->Draw("HE same");
3091 pLegendA.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3097 TLegend pLegendAR(0.55,0.8,0.9,0.9);
3098 pLegendAR.SetTextSize(0.03);
3099 pLegendAR.SetFillColor(10);
3100 pLegendAR.SetBorderSize(1);
3102 for(Int_t imod = 1; imod < fNModules; imod++){
3103 TH1D * htmp = (TH1D*)fhAmplitudeMod[imod]->Clone(Form("hAmpRat%d",imod));
3104 htmp->Divide(fhAmplitudeMod[0]);
3105 htmp->SetLineColor(modColorIndex[imod]);
3107 htmp->SetTitle("Ratio cells energy in module X / module 0");
3108 htmp->SetAxisRange(ptmin,ptmax,"X");
3109 htmp->SetMaximum(5);
3110 htmp->SetMinimum(0);
3114 htmp->Draw("same HE");
3115 pLegendAR.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3119 sprintf(name,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
3120 ca->Print(name); printf("Plot: %s\n",name);
3122 //----------------------------------------------------------
3123 // Cell energy distributions, FRACTION of module dependence
3124 // See Super Module calibration difference
3125 //---------------------------------------------------------
3126 if(fCalorimeter=="EMCAL"){
3128 sprintf(cname,"%s_QA_SMThirds",fCalorimeter.Data());
3129 TCanvas * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
3130 cfrac->Divide(2, 3);
3132 if(fhAmplitude->GetEntries() > 0)
3134 TLegend pLegend1(0.6,0.6,0.9,0.8);
3135 pLegend1.SetTextSize(0.03);
3136 pLegend1.SetFillColor(10);
3137 pLegend1.SetBorderSize(1);
3138 pLegend1.SetHeader("Third close to Eta=0");
3139 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0");
3140 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3141 fhAmplitudeModFraction[0]->Draw("axis");
3142 TH1D * hAverageThird1 = (TH1D *)fhAmplitudeModFraction[3*0+2]->Clone("AverageThird1");
3143 for(Int_t imod = 0; imod < fNModules; imod++){
3145 if(imod%2==0) ifrac = 2;
3146 if(imod > 0) hAverageThird1->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3147 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3148 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3149 pLegend1.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3151 hAverageThird1 ->Scale(1./fNModules);
3155 for(Int_t imod = 0; imod < fNModules; imod++){
3157 if(imod%2==0) ifrac = 2;
3158 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3159 htmp->Divide(hAverageThird1);
3161 htmp ->SetTitle("Close to eta = 0");
3162 htmp ->SetMaximum(5);
3163 htmp ->SetMinimum(0);
3164 htmp ->SetAxisRange(ptmin,ptmax,"X");
3165 htmp ->SetYTitle("ratio third to average");
3168 else htmp -> Draw("same HE");
3174 if(fhAmplitude->GetEntries() > 0)
3176 TLegend pLegend2(0.6,0.6,0.9,0.8);
3177 pLegend2.SetTextSize(0.03);
3178 pLegend2.SetFillColor(10);
3179 pLegend2.SetBorderSize(1);
3180 pLegend2.SetHeader("Middle Third");
3182 fhAmplitudeModFraction[0]->SetTitle("Middle Third");
3183 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3184 fhAmplitudeModFraction[0]->Draw("axis");
3186 TH1D * hAverageThird2 = (TH1D *)fhAmplitudeModFraction[3*0+1]->Clone("AverageThird2");
3187 for(Int_t imod = 0; imod < fNModules; imod++){
3189 if(imod > 0) hAverageThird2->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3190 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3191 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3192 pLegend2.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3194 hAverageThird2->Scale(1./fNModules);
3200 for(Int_t imod = 0; imod < fNModules; imod++){
3202 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3203 htmp->Divide(hAverageThird2);
3205 htmp ->SetTitle("Middle");
3206 htmp ->SetMaximum(5);
3207 htmp ->SetMinimum(0);
3208 htmp ->SetAxisRange(ptmin,ptmax,"X");
3209 htmp ->SetYTitle("ratio third to average");
3212 else htmp -> Draw("same HE");
3218 if(fhAmplitude->GetEntries() > 0)
3220 TLegend pLegend3(0.6,0.6,0.9,0.8);
3221 pLegend3.SetTextSize(0.03);
3222 pLegend3.SetFillColor(10);
3223 pLegend3.SetBorderSize(1);
3224 pLegend3.SetHeader("Third close to Eta=0.7");
3226 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0.7");
3227 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3228 fhAmplitudeModFraction[0]->Draw("axis");
3230 TH1D * hAverageThird3 = (TH1D *)fhAmplitudeModFraction[3*0+0]->Clone("AverageThird3");
3231 for(Int_t imod = 0; imod < 4; imod++){
3233 if(imod%2==0) ifrac = 0;
3234 if(imod > 0) hAverageThird3->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3235 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3236 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3237 pLegend3.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3239 hAverageThird3 ->Scale(1./fNModules);
3244 for(Int_t imod = 0; imod < fNModules; imod++){
3246 if(imod%2==0) ifrac = 0;
3247 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3248 htmp->Divide(hAverageThird3);
3250 htmp ->SetTitle("Close to eta = 0.7");
3251 htmp ->SetMaximum(5);
3252 htmp ->SetMinimum(0);
3253 htmp ->SetAxisRange(ptmin,ptmax,"X");
3254 htmp ->SetYTitle("ratio third to average");
3257 else htmp ->Draw("same HE");
3261 sprintf(name,"QA_%s_CellEnergyModuleFraction.eps",fCalorimeter.Data());
3262 cfrac->Print(name); printf("Create plot %s\n",name);
3266 //----------------------------------------------------------
3267 // Cluster eta and phi distributions, energy cut dependence
3268 //---------------------------------------------------------
3270 sprintf(cname,"%s_QA_EtaPhiCluster",fCalorimeter.Data());
3271 TCanvas * cetaphic = new TCanvas(cname, "Eta-Phi Reconstructed distributions", 1200, 400) ;
3272 cetaphic->Divide(3, 1);
3277 Float_t ecut[] = {0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3};
3278 Int_t ecutcolor[]= {2, 4, 6, 7, 8, 9, 12};
3279 TH1D * hE = fhEtaPhiE->ProjectionZ();
3286 TLegend pLegendPhiCl(0.83,0.6,0.95,0.93);
3287 pLegendPhiCl.SetTextSize(0.03);
3288 pLegendPhiCl.SetFillColor(10);
3289 pLegendPhiCl.SetBorderSize(1);
3291 TH1D * htmp = fhEtaPhiE->ProjectionY("hphi_cluster_nocut",0,-1,0,-1);
3293 htmp->SetMinimum(1);
3294 rbPhi = GetNewRebinForRePlotting(htmp, phimin, phimax,nphibins) ;
3295 //printf("new Phi rb %d\n",rbPhi);
3297 htmp->SetTitle("#phi of clusters for energy in cluster > threshold");
3298 htmp->SetAxisRange(phimin,phimax,"X");
3300 pLegendPhiCl.AddEntry(htmp,"No cut","L");
3302 for (Int_t i = 0; i < ncuts; i++) {
3303 binmin = hE->FindBin(ecut[i]);
3304 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3305 htmp = fhEtaPhiE->ProjectionY(Form("hphi_cluster_cut%d",i),0,-1,binmin,-1);
3306 htmp->SetLineColor(ecutcolor[i]);
3308 htmp->Draw("same HE");
3309 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3313 pLegendPhiCl.Draw();
3320 htmp = fhEtaPhiE->ProjectionX("heta_cluster_nocut",0,-1,0,-1);
3321 htmp ->SetLineColor(1);
3322 rbEta = GetNewRebinForRePlotting(htmp,etamin, etamax,netabins) ;
3323 //printf("new Eta rb %d\n",rbEta);
3326 htmp->SetMinimum(1);
3327 htmp->SetTitle("#eta of clusters for energy in cluster > threshold");
3328 htmp->SetAxisRange(etamin,etamax,"X");
3331 for (Int_t i = 0; i < ncuts; i++) {
3332 binmin = hE->FindBin(ecut[i]);
3333 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3334 htmp = fhEtaPhiE->ProjectionX(Form("heta_cluster_cut%d",i),0,-1,binmin,-1);
3335 htmp->SetLineColor(ecutcolor[i]);
3337 htmp->Draw("same HE");
3342 TH2D* hEtaPhiCl = (TH2D*) fhEtaPhiE->Project3D("xy");
3343 hEtaPhiCl->SetAxisRange(etamin,etamax,"X");
3344 hEtaPhiCl->SetAxisRange(phimin,phimax,"Y");
3345 hEtaPhiCl->Draw("colz");
3347 sprintf(name,"QA_%s_ClusterEtaPhi.eps",fCalorimeter.Data());
3348 cetaphic->Print(name); printf("Create plot %s\n",name);
3350 //----------------------------------------------------------
3351 // Cell eta and phi distributions, energy cut dependence
3352 //---------------------------------------------------------
3354 sprintf(cname,"%s_QA_EtaPhiCell",fCalorimeter.Data());
3355 TCanvas * cetaphicell = new TCanvas(cname, "Eta-Phi Cells distributions", 1200, 400) ;
3356 cetaphicell->Divide(3, 1);
3359 cetaphicell->cd(1) ;
3363 TLegend pLegendPhiCell(0.83,0.6,0.95,0.93);
3364 pLegendPhiCell.SetTextSize(0.03);
3365 pLegendPhiCell.SetFillColor(10);
3366 pLegendPhiCell.SetBorderSize(1);
3368 htmp = fhEtaPhiAmp->ProjectionY("hphi_cell_nocut",0,-1,0,-1);
3370 htmp->SetMinimum(1);
3372 htmp->SetTitle("#phi of cells for cell energy > threshold");
3373 htmp->SetAxisRange(phimin,phimax,"X");
3375 pLegendPhiCell.AddEntry(htmp,"No cut","L");
3377 for (Int_t i = 0; i < ncuts; i++) {
3378 binmin = hE->FindBin(ecut[i]);
3379 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3380 htmp = fhEtaPhiAmp->ProjectionY(Form("hphi_cell_cut%d",i),0,-1,binmin,-1);
3381 htmp->SetLineColor(ecutcolor[i]);
3383 htmp->Draw("same HE");
3384 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3388 pLegendPhiCell.Draw();
3391 cetaphicell->cd(2) ;
3395 htmp = fhEtaPhiAmp->ProjectionX("heta_cell_nocut",0,-1,0,-1);
3397 htmp ->SetLineColor(1);
3399 htmp->SetMinimum(1);
3400 htmp->SetTitle("#eta of cells for cell energy > threshold");
3401 htmp->SetAxisRange(etamin,etamax,"X");
3404 for (Int_t i = 0; i < ncuts; i++) {
3405 binmin = hE->FindBin(ecut[i]);
3406 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3407 htmp = fhEtaPhiAmp->ProjectionX(Form("heta_cell_cut%d",i),0,-1,binmin,-1);
3408 htmp->SetLineColor(ecutcolor[i]);
3410 htmp->Draw("same HE");
3415 cetaphicell->cd(3) ;
3416 TH2D* hEtaPhiCell = (TH2D*) fhEtaPhiAmp->Project3D("xy");
3417 hEtaPhiCell->SetAxisRange(etamin,etamax,"X");
3418 hEtaPhiCell->SetAxisRange(phimin,phimax,"Y");
3419 hEtaPhiCell->Draw("colz");
3421 sprintf(name,"QA_%s_CellEtaPhi.eps",fCalorimeter.Data());
3422 cetaphicell->Print(name); printf("Create plot %s\n",name);
3424 ////////////////////////////////////////
3425 ///////// Global Positions /////////////
3426 ////////////////////////////////////////
3429 sprintf(cname,"%s_QA_ClusterXY",fCalorimeter.Data());
3430 TCanvas * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
3434 TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
3435 hXY->SetTitle("Cluster X vs Y");
3436 hXY->GetYaxis()->SetTitleOffset(1.6);
3439 TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
3440 hYZ->SetTitle("Cluster Z vs Y");
3441 hYZ->GetYaxis()->SetTitleOffset(1.6);
3444 TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
3445 hXZ->SetTitle("Cluster X vs Z");
3446 hXZ->GetYaxis()->SetTitleOffset(1.6);
3449 sprintf(name,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
3450 cxyz->Print(name); printf("Create plot %s\n",name);
3456 sprintf(cname,"QA_%s_ClusterX",fCalorimeter.Data());
3457 TCanvas * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
3461 TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
3464 hX->SetTitle("Cluster X ");
3466 rbX = GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
3467 //printf("new X rb %d\n",rbX);
3469 hX->SetMinimum(hX->GetMaximum()/2);
3470 hX->SetAxisRange(xmin,xmax);
3473 TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
3475 hY->SetTitle("Cluster Y ");
3476 rbY = GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
3477 //printf("new Y rb %d\n",rbY);
3480 hY->SetAxisRange(ymin,ymax);
3484 TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
3487 rbZ = GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
3488 //printf("new Z rb %d\n",rbZ);
3490 hZ->SetMinimum(hZ->GetMaximum()/2);
3491 hZ->SetAxisRange(zmin,zmax);
3494 sprintf(name,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
3495 cx->Print(name); printf("Create plot %s\n",name);
3499 sprintf(cname,"%s_QA_CellXY",fCalorimeter.Data());
3500 TCanvas * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
3501 cellxyz->Divide(3, 1);
3504 TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
3505 hXYCell->SetTitle("Cell X vs Y");
3506 hXYCell->GetYaxis()->SetTitleOffset(1.6);
3507 hXYCell->Draw("colz");
3509 TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
3510 hYZCell->SetTitle("Cell Z vs Y");
3511 hYZCell->GetYaxis()->SetTitleOffset(1.6);
3512 hYZCell->Draw("colz");
3514 TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
3515 hXZCell->SetTitle("Cell X vs Z");
3516 hXZCell->GetYaxis()->SetTitleOffset(1.6);
3517 hXZCell->Draw("colz");
3519 sprintf(name,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
3520 cellxyz->Print(name); printf("Create plot %s\n",name);
3523 sprintf(cname,"%s_QA_CellX",fCalorimeter.Data());
3524 TCanvas * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
3525 cellx->Divide(3, 1);
3528 TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
3531 hXCell->SetTitle("Cell X ");
3533 hXCell->SetMinimum(hXCell->GetMaximum()/2);
3534 hXCell->SetAxisRange(xmin,xmax);
3538 TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
3540 hYCell->SetTitle("Cell Y ");
3542 hYCell->SetAxisRange(ymin,ymax);
3543 hYCell->SetMinimum(1);
3547 TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
3550 hZCell->SetAxisRange(zmin,zmax);
3551 hZCell->SetTitle("Cell Z ");
3553 hZCell->SetMinimum(hZCell->GetMaximum()/2);
3556 sprintf(name,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
3557 cellx->Print(name); printf("Create plot %s\n",name);
3560 //----------------------------------------------------------
3561 // Cluster X, Y, Z, R, energy cut dependence
3562 //---------------------------------------------------------
3564 sprintf(cname,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
3565 TCanvas * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
3572 TLegend pLegendXCl(0.83,0.6,0.95,0.93);
3573 pLegendXCl.SetTextSize(0.03);
3574 pLegendXCl.SetFillColor(10);
3575 pLegendXCl.SetBorderSize(1);
3577 htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
3580 htmp->SetMinimum(1);
3581 rbR = GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
3582 //printf("new R rb %d\n",rbR);
3584 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3585 htmp->SetAxisRange(rmin,rmax,"X");
3587 pLegendXCl.AddEntry(htmp,"No cut","L");
3589 for (Int_t i = 0; i < ncuts; i++) {
3590 binmin = hE->FindBin(ecut[i]);
3591 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3592 htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
3593 htmp->SetLineColor(ecutcolor[i]);
3595 htmp->Draw("same HE");
3596 pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3605 htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
3607 htmp->SetMinimum(1);
3609 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3610 htmp->SetAxisRange(xmin,xmax,"X");
3613 for (Int_t i = 0; i < ncuts; i++) {
3614 binmin = hE->FindBin(ecut[i]);
3615 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3616 htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
3617 htmp->SetLineColor(ecutcolor[i]);
3619 htmp->Draw("same HE");
3626 htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
3628 htmp->SetMinimum(1);
3630 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3631 htmp->SetAxisRange(ymin,ymax,"X");
3634 for (Int_t i = 0; i < ncuts; i++) {
3635 binmin = hE->FindBin(ecut[i]);
3636 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3637 htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
3638 htmp->SetLineColor(ecutcolor[i]);
3640 htmp->Draw("same HE");
3648 htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
3650 htmp->SetMinimum(1);
3652 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3653 htmp->SetAxisRange(zmin,zmax,"X");
3656 for (Int_t i = 0; i < ncuts; i++) {
3657 binmin = hE->FindBin(ecut[i]);
3658 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3659 htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
3660 htmp->SetLineColor(ecutcolor[i]);
3662 htmp->Draw("same HE");
3666 sprintf(name,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3667 cxe->Print(name); printf("Create plot %s\n",name);
3670 //----------------------------------------------------------
3671 // Cluster X, Y, Z, R, NCells in cluster dependence
3672 //---------------------------------------------------------
3673 Int_t ncellcut[]={2, 3, 4};
3674 Int_t ncellcuts = 3;
3675 sprintf(cname,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
3676 TCanvas * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
3683 TLegend pLegendXClN(0.83,0.6,0.95,0.93);
3684 pLegendXClN.SetTextSize(0.03);
3685 pLegendXClN.SetFillColor(10);
3686 pLegendXClN.SetBorderSize(1);
3688 htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
3690 htmp->SetMinimum(1);
3692 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3693 htmp->SetAxisRange(rmin,rmax,"X");
3695 pLegendXClN.AddEntry(htmp,"No cut","L");
3697 for (Int_t i = 0; i < ncellcuts; i++) {
3698 if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3699 else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
3700 htmp->SetLineColor(ecutcolor[i]);
3702 htmp->Draw("same HE");
3703 if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3704 else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3714 htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
3716 htmp->SetMinimum(1);
3718 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3719 htmp->SetAxisRange(xmin,xmax,"X");
3722 for (Int_t i = 0; i < ncellcuts; i++) {
3723 if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3724 else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
3725 htmp->SetLineColor(ecutcolor[i]);
3727 htmp->Draw("same HE");
3734 htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
3736 htmp->SetMinimum(1);
3738 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3739 htmp->SetAxisRange(ymin,ymax,"X");
3742 for (Int_t i = 0; i < ncellcuts; i++) {
3743 if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3744 else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
3745 htmp->SetLineColor(ecutcolor[i]);
3747 htmp->Draw("same HE");
3755 htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
3757 htmp->SetMinimum(1);
3759 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3760 htmp->SetAxisRange(zmin,zmax,"X");
3763 for (Int_t i = 0; i < ncellcuts; i++) {
3764 if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3765 else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
3766 htmp->SetLineColor(ecutcolor[i]);
3768 htmp->Draw("same HE");
3772 sprintf(name,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
3773 cxn->Print(name); printf("Create plot %s\n",name);
3776 //----------------------------------------------------------
3777 // Cell X, Y, Z, R, energy cut dependence
3778 //---------------------------------------------------------
3780 sprintf(cname,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
3781 TCanvas * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
3782 cxecell->Divide(2, 2);
3788 TLegend pLegendXCell(0.83,0.6,0.95,0.93);
3789 pLegendXCell.SetTextSize(0.03);
3790 pLegendXCell.SetFillColor(10);
3791 pLegendXCell.SetBorderSize(1);
3793 htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
3795 htmp->SetMinimum(1);
3797 htmp->SetTitle("r of cells for energy in cluster > threshold");
3798 htmp->SetAxisRange(rmin,rmax,"X");
3800 pLegendXCell.AddEntry(htmp,"No cut","L");
3802 for (Int_t i = 0; i < ncuts; i++) {
3803 binmin = hE->FindBin(ecut[i]);
3804 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3805 htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
3806 htmp->SetLineColor(ecutcolor[i]);
3808 htmp->Draw("same HE");
3809 pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3812 pLegendXCell.Draw();
3819 htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
3821 htmp->SetMinimum(1);
3823 htmp->SetTitle("x of cells for energy in cluster > threshold");
3824 htmp->SetAxisRange(xmin,xmax,"X");
3827 for (Int_t i = 0; i < ncuts; i++) {
3828 binmin = hE->FindBin(ecut[i]);
3829 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3830 htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
3831 htmp->SetLineColor(ecutcolor[i]);
3833 htmp->Draw("same HE");
3840 htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
3842 htmp->SetMinimum(1);
3844 htmp->SetTitle("y of cells for energy in cluster > threshold");
3845 htmp->SetAxisRange(ymin,ymax,"X");
3848 for (Int_t i = 0; i < ncuts; i++) {
3849 binmin = hE->FindBin(ecut[i]);
3850 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3851 htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
3852 htmp->SetLineColor(ecutcolor[i]);
3854 htmp->Draw("same HE");
3861 htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
3863 htmp->SetMinimum(1);
3865 htmp->SetTitle("z of cells for energy in cluster > threshold");
3866 htmp->SetAxisRange(zmin,zmax,"X");
3869 for (Int_t i = 0; i < ncuts; i++) {
3870 binmin = hE->FindBin(ecut[i]);
3871 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3872 htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
3873 htmp->SetLineColor(ecutcolor[i]);
3875 htmp->Draw("same HE");
3878 sprintf(name,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3879 cxecell->Print(name); printf("Create plot %s\n",name);
3882 //----------------------------------------------------------
3883 // Cluster-Cell X, Y, Z, R, cluster energy cut dependence
3884 //---------------------------------------------------------
3885 Int_t rbDR= 1;//rbR;
3886 Int_t rbDX= 1;//rbX;
3887 Int_t rbDY= 1;//rbY;
3888 Int_t rbDZ= 1;//rbZ;
3890 sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
3891 TCanvas * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
3898 TLegend pLegendXClD(0.83,0.6,0.95,0.93);
3899 pLegendXClD.SetTextSize(0.03);
3900 pLegendXClD.SetFillColor(10);
3901 pLegendXClD.SetBorderSize(1);
3903 htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
3905 htmp->SetMinimum(1);
3907 htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
3908 htmp->SetAxisRange(-50,50,"X");
3910 pLegendXCl.AddEntry(htmp,"No cut","L");
3912 for (Int_t i = 0; i < ncuts; i++) {
3913 binmin = hE->FindBin(ecut[i]);
3914 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3915 htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
3916 htmp->SetLineColor(ecutcolor[i]);
3918 htmp->Draw("same HE");
3919 pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3928 htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
3930 htmp->SetMinimum(1);
3932 htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
3933 htmp->SetAxisRange(-50,50,"X");
3936 for (Int_t i = 0; i < ncuts; i++) {
3937 binmin = hE->FindBin(ecut[i]);
3938 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3939 htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
3940 htmp->SetLineColor(ecutcolor[i]);
3942 htmp->Draw("same HE");
3950 htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
3952 htmp->SetMinimum(1);
3954 htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
3955 htmp->SetAxisRange(-50,50,"X");
3958 for (Int_t i = 0; i < ncuts; i++) {
3959 binmin = hE->FindBin(ecut[i]);
3960 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3961 htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
3962 htmp->SetLineColor(ecutcolor[i]);
3964 htmp->Draw("same HE");
3973 htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
3975 htmp->SetMinimum(1);
3977 htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
3978 htmp->SetAxisRange(-50,50,"X");
3981 for (Int_t i = 0; i < ncuts; i++) {
3982 binmin = hE->FindBin(ecut[i]);
3983 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
3984 htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
3985 htmp->SetLineColor(ecutcolor[i]);
3987 htmp->Draw("same HE");
3992 sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
3993 cxde->Print(name); printf("Create plot %s\n",name);
3996 //----------------------------------------------------------
3997 // Cluster-Cell X, Y, Z, R, NCells in cluster dependence
3998 //---------------------------------------------------------
3999 sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
4000 TCanvas * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
4007 TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
4008 pLegendXClDN.SetTextSize(0.03);
4009 pLegendXClDN.SetFillColor(10);
4010 pLegendXClDN.SetBorderSize(1);
4012 htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
4014 htmp->SetMinimum(1);
4016 htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
4017 htmp->SetAxisRange(-50,50,"X");
4019 pLegendXClDN.AddEntry(htmp,"No cut","L");
4021 for (Int_t i = 0; i < ncellcuts; i++) {
4022 if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
4023 else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
4024 htmp->SetLineColor(ecutcolor[i]);
4026 htmp->Draw("same HE");
4027 if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
4028 else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
4032 pLegendXClDN.Draw();
4038 htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
4040 htmp->SetMinimum(1);
4042 htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
4043 htmp->SetAxisRange(-50,50,"X");
4046 for (Int_t i = 0; i < ncellcuts; i++) {
4047 if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
4048 else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
4049 htmp->SetLineColor(ecutcolor[i]);
4051 htmp->Draw("same HE");
4059 htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
4061 htmp->SetMinimum(1);
4063 htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
4064 htmp->SetAxisRange(-50,50,"X");
4067 for (Int_t i = 0; i < ncellcuts; i++) {
4068 if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
4069 else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
4070 htmp->SetLineColor(ecutcolor[i]);
4072 htmp->Draw("same HE");
4081 htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
4083 htmp->SetMinimum(1);
4085 htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
4086 htmp->SetAxisRange(-50,50,"X");
4089 for (Int_t i = 0; i < ncellcuts; i++) {
4090 if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
4091 else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
4092 htmp->SetLineColor(ecutcolor[i]);
4094 htmp->Draw("same HE");
4099 sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
4100 cxdn->Print(name); printf("Create plot %s\n",name);
4103 //----------------------------------------------------------
4104 //Reconstructed clusters energy-eta-phi distributions, matched with tracks
4105 //----------------------------------------------------------
4107 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
4108 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
4109 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
4110 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
4113 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
4114 TCanvas * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
4115 ccltm->Divide(3, 1);
4118 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
4119 fhECharged->Rebin(rbE);
4120 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4121 fhECharged->SetMinimum(1);
4125 if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
4126 fhPhiCharged->Rebin(rbPhi);
4127 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4128 fhPhiCharged->Draw();
4129 fhPhiCharged->Draw();
4132 if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
4133 fhEtaCharged->Rebin(rbEta);
4134 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4135 fhEtaCharged->Draw();
4136 fhEtaCharged->Draw();
4138 sprintf(name,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
4139 ccltm->Print(name); printf("Plot: %s\n",name);
4141 //----------------------------------------------------------
4142 // Ratio of reconstructed clusters energy-eta-phi distributions, matched with tracks over all
4143 //----------------------------------------------------------
4145 sprintf(cname,"%s_QA_ChargedRatio",fCalorimeter.Data());
4146 TCanvas * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
4147 ccharge->Divide(3, 1);
4150 fhECharged->Sumw2();
4152 fhECharged->Divide(fhE);
4153 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4154 fhECharged->SetMaximum(0.5);
4155 fhECharged->SetYTitle("track-matched clusters / all clusters");
4156 fhECharged->Draw("HE");
4159 fhPhiCharged->Sumw2();
4160 fhPhi->Rebin(rbPhi);
4162 fhPhiCharged->Divide(fhPhi);
4163 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4164 fhPhiCharged->SetMaximum(0.5);
4165 fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
4166 fhPhiCharged->Draw("HE");
4169 fhEtaCharged->Sumw2();
4170 fhEta->Rebin(rbEta);
4172 fhEtaCharged->Divide(fhEta);
4173 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4174 fhEtaCharged->SetMaximum(0.5);
4175 fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
4176 fhEtaCharged->Draw("HE");
4178 sprintf(name,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
4179 ccharge->Print(name); printf("Create plot %s\n",name);
4181 //-------------------------------------------
4182 // N Cells - N Clusters - N Cells per cluster
4183 //-------------------------------------------
4184 sprintf(cname,"QA_%s_nclustercells",fCalorimeter.Data());
4185 TCanvas * cN = new TCanvas(cname, " Number of CaloClusters and CaloCells", 800, 1200) ;
4190 TLegend pLegendN(0.7,0.6,0.9,0.8);
4191 pLegendN.SetTextSize(0.03);
4192 pLegendN.AddEntry(fhNClusters,"all modules","L");
4193 pLegendN.SetFillColor(10);
4194 pLegendN.SetBorderSize(1);
4196 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
4198 fhNClusters->SetLineColor(1);
4201 if(fhNClusters->GetNbinsX()> nbins) rbN = fhNClusters->GetNbinsX()/nbins;
4203 fhNClusters->SetAxisRange(nmin,nmax,"X");
4204 fhNClusters->Draw("HE");
4205 for(Int_t imod = 0; imod < fNModules; imod++){
4206 fhNClustersMod[imod]->SetAxisRange(nmin,nmax,"X");
4207 fhNClustersMod[imod]->SetLineColor(modColorIndex[imod]);
4208 fhNClustersMod[imod]->Draw("same");
4209 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
4215 for(Int_t imod = 1; imod < fNModules; imod++){
4216 htmp = (TH1D*)fhNClustersMod[imod]->Clone(Form("hNClustersRat%d",imod));
4217 htmp->Divide(fhNClustersMod[0]);
4218 htmp->SetLineColor(modColorIndex[imod]);
4220 htmp->SetTitle("Ratio # clusters in module X / module 0");
4221 htmp->SetMaximum(5);
4222 htmp->SetMinimum(0);
4226 htmp->Draw("same HE");
4231 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
4233 fhNCells->SetLineColor(1);
4234 fhNCells->SetAxisRange(nmin,nmax,"X");
4235 fhNCells->Draw("HE");
4236 for(Int_t imod = 0; imod < fNModules; imod++){
4237 fhNCellsMod[imod]->SetAxisRange(nmin,nmax,"X");
4238 fhNCellsMod[imod]->SetLineColor(modColorIndex[imod]);
4239 fhNCellsMod[imod]->Draw("same HE");
4245 for(Int_t imod = 1; imod < fNModules; imod++){
4246 htmp = (TH1D*)fhNCellsMod[imod]->Clone(Form("hNCellsRat%d",imod));
4247 htmp->Divide(fhNCellsMod[0]);
4248 htmp->SetLineColor(modColorIndex[imod]);
4250 htmp->SetTitle("Ratio # cells in module X / module 0");
4251 htmp->SetMaximum(5);
4252 htmp->SetMinimum(0);
4256 htmp->Draw("same HE");
4261 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
4263 TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1,-1,-1);
4264 cpc->SetLineColor(1);
4265 cpc->SetTitle("# cells per cluster");
4267 TH1D ** hNCellsCluster1D = new TH1D*[fNModules];
4269 for(Int_t imod = 0; imod < fNModules; imod++){
4270 hNCellsCluster1D[imod] = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
4271 hNCellsCluster1D[imod]->SetLineColor(modColorIndex[imod]);
4272 hNCellsCluster1D[imod]->Draw("same HE");
4278 for(Int_t imod = 1; imod < fNModules; imod++){
4279 htmp = (TH1D*)hNCellsCluster1D[imod]->Clone(Form("hNClustersCells1DRat%d",imod));
4280 htmp->Divide(hNCellsCluster1D[0]);
4281 htmp->SetLineColor(modColorIndex[imod]);
4283 htmp->SetTitle("Ratio # cells per cluster in module X / module 0");
4284 //htmp->SetAxisRange(ptmin,ptmax,"X");
4285 htmp->SetMaximum(3.5);
4286 htmp->SetMinimum(0);
4290 htmp->Draw("same HE");
4293 sprintf(name,"QA_%s_NumberCaloClustersAndCaloCells.eps",fCalorimeter.Data());
4294 cN->Print(name); printf("Print plot %s\n",name);
4296 //----------------------------------------------------
4297 // Cell Time histograms, time only available in ESDs
4298 //----------------------------------------------------
4299 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
4301 sprintf(cname,"QA_%s_cellstime",fCalorimeter.Data());
4302 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
4303 ctime->Divide(3, 1);
4306 if(fhTime->GetNbinsX()> ntimebins) rbTime = fhTime->GetNbinsX()/ntimebins;
4309 if(fhTime->GetEntries() > 0) gPad->SetLogy();
4310 fhTime->Rebin(rbTime);
4311 fhTime->SetAxisRange(timemin,timemax,"X");
4315 fhTimeId->SetTitleOffset(1.8,"Y");
4316 fhTimeId->SetAxisRange(timemin,timemax,"X");
4317 fhTimeId->Draw("colz");
4320 fhTimeAmp->SetTitle("Cell Energy vs Cell Time");
4321 fhTimeAmp->SetTitleOffset(1.8,"Y");
4322 fhTimeAmp->SetAxisRange(timemin,timemax,"Y");
4323 fhTimeAmp->SetAxisRange(ptmin,ptmax,"X");
4324 fhTimeAmp->Draw("colz");
4326 sprintf(name,"QA_%s_CellsTime.eps",fCalorimeter.Data());
4327 ctime->Print(name); printf("Plot: %s\n",name);
4331 //---------------------------------
4332 //Grid of cell per module plots
4333 //---------------------------------
4335 //Number of entries per cell
4336 gStyle->SetPadRightMargin(0.15);
4337 sprintf(cname,"%s_QA_GridCellEntries",fCalorimeter.Data());
4338 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
4339 if(fNModules%2 == 0)
4340 cgrid->Divide(fNModules/2,2);
4342 cgrid->Divide(fNModules/2+1,2);
4344 for(Int_t imod = 0; imod < fNModules ; imod++){
4349 //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
4350 fhGridCellsMod[imod]->SetZTitle("Counts ");
4351 fhGridCellsMod[imod]->SetYTitle("row (phi direction) ");
4352 //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
4353 fhGridCellsMod[imod]->Draw("colz");
4355 sprintf(name,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
4356 cgrid->Print(name); printf("Create plot %s\n",name);
4358 sprintf(cname,"%s_QA_GridCellAccumEnergy",fCalorimeter.Data());
4359 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
4360 if(fNModules%2 == 0)
4361 cgridE->Divide(fNModules/2,2);
4363 cgridE->Divide(fNModules/2+1,2);
4364 for(Int_t imod = 0; imod < fNModules ; imod++){
4369 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4370 fhGridCellsEMod[imod]->SetZTitle("Accumulated Energy (GeV) ");
4371 fhGridCellsEMod[imod]->SetYTitle("row (phi direction) ");
4372 fhGridCellsEMod[imod]->Draw("colz");
4374 sprintf(name,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
4375 cgridE->Print(name); printf("Create plot %s\n",name);
4377 //Accumulated energy per cell
4378 sprintf(cname,"%s_QA_GridCellAverageEnergy",fCalorimeter.Data());
4379 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
4380 if(fNModules%2 == 0)
4381 cgridEA->Divide(fNModules/2,2);
4383 cgridEA->Divide(fNModules/2+1,2);
4384 for(Int_t imod = 0; imod < fNModules ; imod++){
4385 cgridEA->cd(imod+1);
4389 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
4390 fhGridCellsEMod[imod]->SetZTitle("Average Energy (GeV) ");
4391 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
4392 fhGridCellsEMod[imod]->Draw("colz");
4394 sprintf(name,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
4395 cgridEA->Print(name); printf("Create plot %s\n",name);
4397 //Accumulated Time per cell, E > 0.5 GeV
4399 sprintf(cname,"%s_QA_GridCellAccumTime",fCalorimeter.Data());
4400 TCanvas *cgridT = new TCanvas("cgridT","Summed time per cell", 12,12,800,400);
4401 if(fNModules%2 == 0)
4402 cgridT->Divide(fNModules/2,2);
4404 cgridE->Divide(fNModules/2+1,2);
4405 for(Int_t imod = 0; imod < fNModules ; imod++){
4410 //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
4411 fhGridCellsTimeMod[imod]->SetZTitle("Accumulated Time (ns) ");
4412 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction) ");
4413 fhGridCellsTimeMod[imod]->Draw("colz");
4415 sprintf(name,"QA_%s_GridCellsAccumTime.eps",fCalorimeter.Data());
4416 cgridT->Print(name); printf("Create plot %s\n",name);
4420 //---------------------------------------------
4421 //Calorimeter Correlation, PHOS vs EMCAL
4422 //---------------------------------------------
4423 if(fCorrelateCalos){
4425 sprintf(cname,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
4426 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
4427 ccorr->Divide(2, 2);
4432 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"X");
4433 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"Y");
4434 fhCaloCorrNClusters ->Draw();
4439 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"X");
4440 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"Y");
4441 fhCaloCorrNCells->Draw();
4445 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"X");
4446 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"Y");
4447 fhCaloCorrEClusters->Draw();
4452 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"X");
4453 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"Y");
4454 fhCaloCorrECells->Draw();
4456 sprintf(name,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
4457 ccorr->Print(name); printf("Plot: %s\n",name);
4460 //----------------------------
4462 //-----------------------------
4464 Int_t imbinmin = -1;
4465 Int_t imbinmax = -1;
4467 if(fhIM->GetEntries() > 1){
4468 Int_t nebins = fhIM->GetNbinsX();
4469 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
4470 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
4471 if (emin != 0 ) printf("emin != 0 \n");
4472 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4474 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
4476 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
4480 //fhIM->SetLineColor(4);
4483 imbinmax = (Int_t) (1-emin)*nebins/emax;
4484 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),imbinmin,imbinmax);
4485 pyim1->SetTitle("E_{pair} < 1 GeV");
4486 pyim1->SetLineColor(1);
4488 TLegend pLegendIM(0.7,0.6,0.9,0.8);
4489 pLegendIM.SetTextSize(0.03);
4490 pLegendIM.AddEntry(pyim1,"all modules","L");
4491 pLegendIM.SetFillColor(10);
4492 pLegendIM.SetBorderSize(1);
4494 for(Int_t imod = 0; imod < fNModules; imod++){
4495 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4496 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
4497 pyim1->SetLineColor(imod+1);
4498 pyim1->Draw("same");
4503 imbinmin = (Int_t) (1-emin)*nebins/emax;
4504 imbinmax = (Int_t) (2-emin)*nebins/emax;
4505 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),imbinmin,imbinmax);
4506 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
4507 pyim2->SetLineColor(1);
4509 for(Int_t imod = 0; imod < fNModules; imod++){
4510 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4511 pyim2->SetLineColor(imod+1);
4512 pyim2->Draw("same");
4516 imbinmin = (Int_t) (2-emin)*nebins/emax;
4517 imbinmax = (Int_t) (3-emin)*nebins/emax;
4518 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),imbinmin,imbinmax);
4519 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
4520 pyim3->SetLineColor(1);
4522 for(Int_t imod = 0; imod < fNModules; imod++){
4523 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4524 pyim3->SetLineColor(imod+1);
4525 pyim3->Draw("same");
4529 imbinmin = (Int_t) (3-emin)*nebins/emax;
4530 imbinmax = (Int_t) (4-emin)*nebins/emax;
4531 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),imbinmin,imbinmax);
4532 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
4533 pyim4->SetLineColor(1);
4535 for(Int_t imod = 0; imod < fNModules; imod++){
4536 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4537 pyim4->SetLineColor(imod+1);
4538 pyim4->Draw("same");
4542 imbinmin = (Int_t) (4-emin)*nebins/emax;
4543 imbinmax = (Int_t) (5-emin)*nebins/emax;
4544 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),imbinmin,imbinmax);
4545 pyim5->SetTitle("4< E_{pair} < 5 GeV");
4546 pyim5->SetLineColor(1);
4548 for(Int_t imod = 0; imod < fNModules; imod++){
4549 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4550 pyim5->SetLineColor(imod+1);
4551 pyim5->Draw("same");
4555 imbinmin = (Int_t) (5-emin)*nebins/emax;
4557 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),imbinmin,imbinmax);
4558 pyim10->SetTitle("E_{pair} > 5 GeV");
4559 pyim10->SetLineColor(1);
4561 for(Int_t imod = 0; imod < fNModules; imod++){
4562 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4563 pyim10->SetLineColor(imod+1);
4564 pyim10->Draw("same");
4567 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
4568 c5->Print(name); printf("Plot: %s\n",name);
4571 //--------------------------------------------------
4572 //Invariant mass, clusters with more than one cell
4573 //-------------------------------------------------
4574 if(fhIMCellCut->GetEntries() > 1){
4575 Int_t nebins = fhIMCellCut->GetNbinsX();
4576 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
4577 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
4578 if (emin != 0 ) printf("emin != 0 \n");
4579 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4581 sprintf(cname,"QA_%s_IMCellCut",fCalorimeter.Data());
4582 // printf("c5cc\n");
4583 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
4587 //fhIMCellCut->SetLineColor(4);
4588 //fhIMCellCut->Draw();
4590 imbinmax = (Int_t) (1-emin)*nebins/emax;
4591 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),imbinmin,imbinmax);
4592 pyimcc1->SetTitle("E_{pair} < 1 GeV");
4593 pyimcc1->SetLineColor(1);
4595 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
4596 pLegendIMCellCut.SetTextSize(0.03);
4597 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
4598 pLegendIMCellCut.SetFillColor(10);
4599 pLegendIMCellCut.SetBorderSize(1);
4601 for(Int_t imod = 0; imod < fNModules; imod++){
4602 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4603 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
4604 pyimcc1->SetLineColor(imod+1);
4605 pyimcc1->Draw("same");
4607 pLegendIMCellCut.Draw();
4610 imbinmin = (Int_t) (1-emin)*nebins/emax;
4611 imbinmax = (Int_t) (2-emin)*nebins/emax;
4612 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),imbinmin,imbinmax);
4613 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
4614 pyimcc2->SetLineColor(1);
4616 for(Int_t imod = 0; imod < fNModules; imod++){
4617 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4618 pyimcc2->SetLineColor(imod+1);
4619 pyimcc2->Draw("same");
4623 imbinmin = (Int_t) (2-emin)*nebins/emax;
4624 imbinmax = (Int_t) (3-emin)*nebins/emax;
4625 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),imbinmin,imbinmax);
4626 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
4627 pyimcc3->SetLineColor(1);
4629 for(Int_t imod = 0; imod < fNModules; imod++){
4630 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4631 pyimcc3->SetLineColor(imod+1);
4632 pyimcc3->Draw("same");
4636 imbinmin = (Int_t) (3-emin)*nebins/emax;
4637 imbinmax = (Int_t) (4-emin)*nebins/emax;
4638 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),imbinmin,imbinmax);
4639 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
4640 pyimcc4->SetLineColor(1);
4642 for(Int_t imod = 0; imod < fNModules; imod++){
4643 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4644 pyimcc4->SetLineColor(imod+1);
4645 pyimcc4->Draw("same");
4649 imbinmin = (Int_t) (4-emin)*nebins/emax;
4650 imbinmax = (Int_t) (5-emin)*nebins/emax;
4651 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),imbinmin,imbinmax);
4652 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
4653 pyimcc5cc->SetLineColor(1);
4655 for(Int_t imod = 0; imod < fNModules; imod++){
4656 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4657 pyimcc5cc->SetLineColor(imod+1);
4658 pyimcc5cc->Draw("same");
4662 imbinmin = (Int_t) (5-emin)*nebins/emax;
4664 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),imbinmin,imbinmax);
4665 pyimcc10->SetTitle("E_{pair} > 5 GeV");
4666 pyimcc10->SetLineColor(1);
4668 for(Int_t imod = 0; imod < fNModules; imod++){
4669 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4670 pyimcc10->SetLineColor(imod+1);
4671 pyimcc10->Draw("same");
4674 sprintf(name,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
4675 c5cc->Print(name); printf("Plot: %s\n",name);
4680 if(fhAsym->GetEntries() > 1){
4681 Int_t nebins = fhAsym->GetNbinsX();
4682 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
4683 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
4684 if (emin != 0 ) printf("emin != 0 \n");
4685 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
4687 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
4689 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
4693 fhAsym->SetTitleOffset(1.6,"Y");
4694 fhAsym->SetLineColor(4);
4699 imbinmax = (Int_t) (5-emin)*nebins/emax;
4700 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),imbinmin,imbinmax);
4701 pyAsym5->SetTitle("E_{pair} < 5 GeV");
4702 pyAsym5->SetLineColor(4);
4706 imbinmin = (Int_t) (5-emin)*nebins/emax;
4707 imbinmax = (Int_t) (10-emin)*nebins/emax;
4708 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),imbinmin,imbinmax);
4709 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
4710 pyAsym510->SetLineColor(4);
4714 imbinmin = (Int_t) (10-emin)*nebins/emax;
4716 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),imbinmin,imbinmax);
4717 pyAsym10->SetTitle("E_{pair} > 10 GeV");
4718 pyAsym10->SetLineColor(4);
4721 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
4722 c5b->Print(name); printf("Plot: %s\n",name);
4727 //Reconstructed vs MC distributions
4729 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
4730 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4734 fh2E->SetTitleOffset(1.6,"Y");
4735 fh2E->SetLineColor(4);
4739 fh2Pt->SetTitleOffset(1.6,"Y");
4740 fh2Pt->SetLineColor(4);
4744 fh2Phi->SetTitleOffset(1.6,"Y");
4745 fh2Phi->SetLineColor(4);
4749 fh2Eta->SetTitleOffset(1.6,"Y");
4750 fh2Eta->SetLineColor(4);
4753 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4754 c6->Print(name); printf("Plot: %s\n",name);
4756 //Reconstructed vs MC distributions
4758 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
4759 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4760 c6Gam->Divide(2, 2);
4774 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
4775 c6->Print(name); printf("Plot: %s\n",name);
4777 //Generated - reconstructed
4779 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
4780 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
4784 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
4785 fhGamDeltaE->SetLineColor(4);
4787 fhGamDeltaE->Draw("same");
4789 TLegend pLegendd(0.65,0.55,0.9,0.8);
4790 pLegendd.SetTextSize(0.06);
4791 pLegendd.AddEntry(fhDeltaE,"all","L");
4792 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
4793 pLegendd.SetFillColor(10);
4794 pLegendd.SetBorderSize(1);
4798 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
4799 fhGamDeltaPt->SetLineColor(4);
4801 fhGamDeltaPt->Draw("same");
4804 fhGamDeltaPhi->SetLineColor(4);
4806 fhGamDeltaPhi->Draw("same");
4809 fhGamDeltaEta->SetLineColor(4);
4811 fhGamDeltaEta->Draw("same");
4813 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
4814 c7->Print(name); printf("Plot: %s\n",name);
4816 // Reconstructed / Generated
4818 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
4819 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
4823 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
4824 fhGamRatioE->SetLineColor(4);
4826 fhGamRatioE->Draw("same");
4828 TLegend pLegendr(0.65,0.55,0.9,0.8);
4829 pLegendr.SetTextSize(0.06);
4830 pLegendr.AddEntry(fhRatioE,"all","L");
4831 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
4832 pLegendr.SetFillColor(10);
4833 pLegendr.SetBorderSize(1);
4837 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
4838 fhGamRatioPt->SetLineColor(4);
4840 fhGamRatioPt->Draw("same");
4843 fhGamRatioPhi->SetLineColor(4);
4845 fhGamRatioPhi->Draw("same");
4848 fhGamRatioEta->SetLineColor(4);
4850 fhGamRatioEta->Draw("same");
4852 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
4853 c8->Print(name); printf("Plot: %s\n",name);
4857 //Generated distributions
4859 sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
4860 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
4865 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
4866 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
4867 fhGenPi0Pt->SetLineColor(1);
4868 fhGenGamPt->SetLineColor(4);
4869 fhGenEtaPt->SetLineColor(2);
4870 fhGenOmegaPt->SetLineColor(7);
4871 fhGenElePt->SetLineColor(6);
4873 //Select the maximum of the histogram to show all lines.
4874 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4875 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
4876 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
4877 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4878 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
4879 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
4880 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
4881 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4882 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
4883 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4884 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4885 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
4886 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4887 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
4888 haxispt->SetMaximum(fhGenElePt->GetMaximum());
4889 haxispt->SetMinimum(1);
4890 haxispt->Draw("axis");
4891 fhGenPi0Pt->Draw("same");
4892 fhGenGamPt->Draw("same");
4893 fhGenEtaPt->Draw("same");
4894 fhGenOmegaPt->Draw("same");
4895 fhGenElePt->Draw("same");
4897 TLegend pLegend(0.85,0.65,0.95,0.93);
4898 pLegend.SetTextSize(0.06);
4899 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
4900 pLegend.AddEntry(fhGenGamPt," #gamma","L");
4901 pLegend.AddEntry(fhGenEtaPt," #eta","L");
4902 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
4903 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
4904 pLegend.SetFillColor(10);
4905 pLegend.SetBorderSize(1);
4910 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
4911 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
4912 fhGenPi0Eta->SetLineColor(1);
4913 fhGenGamEta->SetLineColor(4);
4914 fhGenEtaEta->SetLineColor(2);
4915 fhGenOmegaEta->SetLineColor(7);
4916 fhGenEleEta->SetLineColor(6);
4917 //Select the maximum of the histogram to show all lines.
4918 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4919 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
4920 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
4921 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4922 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4923 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
4924 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
4925 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4926 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
4927 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4928 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4929 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
4930 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4931 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
4932 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
4933 haxiseta->SetMinimum(100);
4934 haxiseta->Draw("axis");
4935 fhGenPi0Eta->Draw("same");
4936 fhGenGamEta->Draw("same");
4937 fhGenEtaEta->Draw("same");
4938 fhGenOmegaEta->Draw("same");
4939 fhGenEleEta->Draw("same");
4944 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
4945 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
4946 fhGenPi0Phi->SetLineColor(1);
4947 fhGenGamPhi->SetLineColor(4);
4948 fhGenEtaPhi->SetLineColor(2);
4949 fhGenOmegaPhi->SetLineColor(7);
4950 fhGenElePhi->SetLineColor(6);
4951 //Select the maximum of the histogram to show all lines.
4952 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4953 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
4954 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
4955 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4956 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4957 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
4958 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
4959 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4960 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
4961 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4962 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4963 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
4964 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4965 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
4966 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
4967 haxisphi->SetMinimum(100);
4968 haxisphi->Draw("axis");
4969 fhGenPi0Phi->Draw("same");
4970 fhGenGamPhi->Draw("same");
4971 fhGenEtaPhi->Draw("same");
4972 fhGenOmegaPhi->Draw("same");
4973 fhGenElePhi->Draw("same");
4975 sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
4976 c10->Print(name); printf("Plot: %s\n",name);
4979 //Reconstructed clusters depending on its original particle.
4981 sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
4982 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
4988 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
4989 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
4990 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
4991 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
4992 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
4993 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
4994 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
4995 hPi0E->SetLineColor(1);
4996 hGamE->SetLineColor(4);
4997 hNeHadE->SetLineColor(2);
4998 hChHadE->SetLineColor(7);
4999 hEleE->SetLineColor(6);
5001 //Select the maximum of the histogram to show all lines.
5002 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
5003 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
5004 haxisE->SetMaximum(hPi0E->GetMaximum());
5005 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
5006 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
5007 haxisE->SetMaximum(hGamE->GetMaximum());
5008 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
5009 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
5010 haxisE->SetMaximum(hNeHadE->GetMaximum());
5011 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
5012 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
5013 haxisE->SetMaximum(hChHadE->GetMaximum());
5014 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
5015 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
5016 haxisE->SetMaximum(hEleE->GetMaximum());
5017 haxisE->SetXTitle("E (GeV)");
5018 haxisE->SetMinimum(1);
5019 haxisE->Draw("axis");
5020 hPi0E->Draw("same");
5021 hGamE->Draw("same");
5022 hNeHadE->Draw("same");
5023 hChHadE->Draw("same");
5024 hEleE->Draw("same");
5026 TLegend pLegend2(0.8,0.65,0.95,0.93);
5027 pLegend2.SetTextSize(0.06);
5028 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
5029 pLegend2.AddEntry(hGamE," #gamma","L");
5030 pLegend2.AddEntry(hEleE," e^{#pm}","L");
5031 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
5032 pLegend2.AddEntry(hNeHadE," h^{0}","L");
5033 pLegend2.SetFillColor(10);
5034 pLegend2.SetBorderSize(1);
5040 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
5041 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
5042 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
5043 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
5044 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
5045 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
5046 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
5047 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
5048 hPi0Pt->SetLineColor(1);
5049 hGamPt->SetLineColor(4);
5050 hNeHadPt->SetLineColor(2);
5051 hChHadPt->SetLineColor(7);
5052 hElePt->SetLineColor(6);
5054 //Select the maximum of the histogram to show all lines.
5055 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5056 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
5057 haxispt->SetMaximum(hPi0Pt->GetMaximum());
5058 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5059 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
5060 haxispt->SetMaximum(hGamPt->GetMaximum());
5061 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
5062 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
5063 haxispt->SetMaximum(hNeHadPt->GetMaximum());
5064 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5065 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
5066 haxispt->SetMaximum(hChHadPt->GetMaximum());
5067 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5068 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
5069 haxispt->SetMaximum(hElePt->GetMaximum());
5070 haxispt->SetXTitle("p_{T} (GeV/c)");
5071 haxispt->SetMinimum(1);
5072 haxispt->Draw("axis");
5073 hPi0Pt->Draw("same");
5074 hGamPt->Draw("same");
5075 hNeHadPt->Draw("same");
5076 hChHadPt->Draw("same");
5077 hElePt->Draw("same");
5082 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
5083 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
5084 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
5085 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
5086 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
5087 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
5088 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
5089 hPi0Eta->SetLineColor(1);
5090 hGamEta->SetLineColor(4);
5091 hNeHadEta->SetLineColor(2);
5092 hChHadEta->SetLineColor(7);
5093 hEleEta->SetLineColor(6);
5094 //Select the maximum of the histogram to show all lines.
5095 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5096 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
5097 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
5098 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5099 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
5100 haxiseta->SetMaximum(hGamEta->GetMaximum());
5101 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
5102 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
5103 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
5104 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5105 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
5106 haxiseta->SetMaximum(hChHadEta->GetMaximum());
5107 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5108 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
5109 haxiseta->SetMaximum(hEleEta->GetMaximum());
5111 haxiseta->SetXTitle("#eta");
5112 haxiseta->Draw("axis");
5113 hPi0Eta->Draw("same");
5114 hGamEta->Draw("same");
5115 hNeHadEta->Draw("same");
5116 hChHadEta->Draw("same");
5117 hEleEta->Draw("same");
5122 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
5123 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
5124 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
5125 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
5126 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
5127 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
5128 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
5130 hPi0Phi->SetLineColor(1);
5131 hGamPhi->SetLineColor(4);
5132 hNeHadPhi->SetLineColor(2);
5133 hChHadPhi->SetLineColor(7);
5134 hElePhi->SetLineColor(6);
5135 //Select the maximum of the histogram to show all lines.
5136 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5137 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
5138 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
5139 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5140 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
5141 haxisphi->SetMaximum(hGamPhi->GetMaximum());
5142 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
5143 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5144 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
5145 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5146 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5147 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
5148 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5149 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
5150 haxisphi->SetMaximum(hElePhi->GetMaximum());
5151 haxisphi->SetXTitle("#phi (rad)");
5152 haxisphi->Draw("axis");
5153 hPi0Phi->Draw("same");
5154 hGamPhi->Draw("same");
5155 hNeHadPhi->Draw("same");
5156 hChHadPhi->Draw("same");
5157 hElePhi->Draw("same");
5159 sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
5160 c11->Print(name); printf("Plot: %s\n",name);
5163 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
5166 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
5167 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
5168 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
5169 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
5170 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
5171 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
5172 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
5173 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
5175 sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
5176 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
5181 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5182 hPi0EClone->Divide(fhGenPi0AccE);
5183 hGamEClone->Divide(fhGenGamAccE);
5184 haxisE->SetMaximum(5);
5185 haxisE->SetMinimum(1e-2);
5186 haxisE->SetXTitle("E (GeV)");
5187 haxisE->SetYTitle("ratio = rec/gen");
5188 haxisE->Draw("axis");
5189 hPi0E->Draw("same");
5190 hGamE->Draw("same");
5192 TLegend pLegend3(0.75,0.2,0.9,0.4);
5193 pLegend3.SetTextSize(0.06);
5194 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
5195 pLegend3.AddEntry(hGamEClone," #gamma","L");
5196 pLegend3.SetFillColor(10);
5197 pLegend3.SetBorderSize(1);
5202 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5203 hPi0PtClone->Divide(fhGenPi0AccPt);
5204 hGamPtClone->Divide(fhGenGamAccPt);
5205 haxispt->SetMaximum(5);
5206 haxispt->SetMinimum(1e-2);
5207 haxispt->SetXTitle("p_{T} (GeV/c)");
5208 haxispt->SetYTitle("ratio = rec/gen");
5209 haxispt->Draw("axis");
5210 hPi0PtClone->Draw("same");
5211 hGamPtClone->Draw("same");
5216 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5217 hPi0EtaClone->Divide(fhGenPi0AccEta);
5218 hGamEtaClone->Divide(fhGenGamAccEta);
5219 haxiseta->SetMaximum(1.2);
5220 haxiseta->SetMinimum(1e-2);
5221 haxiseta->SetYTitle("ratio = rec/gen");
5222 haxiseta->SetXTitle("#eta");
5223 haxiseta->Draw("axis");
5224 hPi0EtaClone->Draw("same");
5225 hGamEtaClone->Draw("same");
5230 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5231 hPi0PhiClone->Divide(fhGenPi0AccPhi);
5232 hGamPhiClone->Divide(fhGenGamAccPhi);
5233 haxisphi->SetYTitle("ratio = rec/gen");
5234 haxisphi->SetXTitle("#phi (rad)");
5235 haxisphi->SetMaximum(1.2);
5236 haxisphi->SetMinimum(1e-2);
5237 haxisphi->Draw("axis");
5238 hPi0PhiClone->Draw("same");
5239 hGamPhiClone->Draw("same");
5241 sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
5242 c12->Print(name); printf("Plot: %s\n",name);
5246 //Reconstructed distributions
5248 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
5249 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
5254 fhEMVxyz->SetTitleOffset(1.6,"Y");
5259 fhHaVxyz->SetTitleOffset(1.6,"Y");
5264 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
5265 hEMR->SetLineColor(4);
5270 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
5271 hHaR->SetLineColor(4);
5275 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
5276 c13->Print(name); printf("Plot: %s\n",name);
5279 //Track-matching distributions
5281 //Reconstructed distributions, matched with tracks, generated particle dependence
5283 sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
5284 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
5285 c22ch->Divide(2, 2);
5289 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
5290 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
5291 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
5292 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
5293 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
5294 hPi0ECharged->SetLineColor(1);
5295 hGamECharged->SetLineColor(4);
5296 hNeHadECharged->SetLineColor(2);
5297 hChHadECharged->SetLineColor(7);
5298 hEleECharged->SetLineColor(6);
5300 fhECharged->SetLineColor(3);
5301 fhECharged->SetMinimum(0.5);
5303 hPi0ECharged->Draw("same");
5304 hGamECharged->Draw("same");
5305 hNeHadECharged->Draw("same");
5306 hChHadECharged->Draw("same");
5307 hEleECharged->Draw("same");
5308 TLegend pLegend22(0.75,0.45,0.9,0.8);
5309 pLegend22.SetTextSize(0.06);
5310 pLegend22.AddEntry(fhECharged,"all","L");
5311 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
5312 pLegend22.AddEntry(hGamECharged,"#gamma","L");
5313 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
5314 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
5315 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
5316 pLegend22.SetFillColor(10);
5317 pLegend22.SetBorderSize(1);
5322 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
5323 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
5324 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
5325 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
5326 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
5327 hPi0PtCharged->SetLineColor(1);
5328 hGamPtCharged->SetLineColor(4);
5329 hNeHadPtCharged->SetLineColor(2);
5330 hChHadPtCharged->SetLineColor(7);
5331 hElePtCharged->SetLineColor(6);
5333 fhPtCharged->SetLineColor(3);
5334 fhPtCharged->SetMinimum(0.5);
5335 fhPtCharged->Draw();
5336 hPi0PtCharged->Draw("same");
5337 hGamPtCharged->Draw("same");
5338 hNeHadPtCharged->Draw("same");
5339 hChHadPtCharged->Draw("same");
5340 hElePtCharged->Draw("same");
5344 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
5345 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
5346 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
5347 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
5348 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
5349 hPi0EtaCharged->SetLineColor(1);
5350 hGamEtaCharged->SetLineColor(4);
5351 hNeHadEtaCharged->SetLineColor(2);
5352 hChHadEtaCharged->SetLineColor(7);
5353 hEleEtaCharged->SetLineColor(6);
5355 fhEtaCharged->SetLineColor(3);
5356 fhEtaCharged->SetMinimum(0.5);
5357 fhEtaCharged->Draw();
5358 hPi0EtaCharged->Draw("same");
5359 hGamEtaCharged->Draw("same");
5360 hNeHadEtaCharged->Draw("same");
5361 hChHadEtaCharged->Draw("same");
5362 hEleEtaCharged->Draw("same");
5366 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
5367 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
5368 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
5369 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
5370 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
5371 hPi0PhiCharged->SetLineColor(1);
5372 hGamPhiCharged->SetLineColor(4);
5373 hNeHadPhiCharged->SetLineColor(2);
5374 hChHadPhiCharged->SetLineColor(7);
5375 hElePhiCharged->SetLineColor(6);
5377 fhPhiCharged->SetLineColor(3);
5378 fhPhiCharged->SetMinimum(0.5);
5379 fhPhiCharged->Draw();
5380 hPi0PhiCharged->Draw("same");
5381 hGamPhiCharged->Draw("same");
5382 hNeHadPhiCharged->Draw("same");
5383 hChHadPhiCharged->Draw("same");
5384 hElePhiCharged->Draw("same");
5387 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
5388 c22ch->Print(name); printf("Plot: %s\n",name);
5390 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
5391 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
5392 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
5393 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
5395 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
5396 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
5397 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
5398 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
5400 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
5401 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
5402 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
5403 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
5405 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
5406 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
5407 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
5408 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
5410 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
5411 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
5412 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
5413 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
5415 //Ratio: reconstructed track matched/ all reconstructed
5417 sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
5418 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
5422 hEChargedClone->SetMaximum(1.2);
5423 hEChargedClone->SetMinimum(0.001);
5424 hEChargedClone->SetLineColor(3);
5425 hEChargedClone->SetYTitle("track matched / all");
5426 hPi0EChargedClone->Divide(hPi0E);
5427 hGamEChargedClone->Divide(hGamE);
5428 hEleEChargedClone->Divide(hEleE);
5429 hNeHadEChargedClone->Divide(hNeHadE);
5430 hChHadEChargedClone->Divide(hChHadE);
5431 hEChargedClone->Draw();
5432 hPi0EChargedClone->Draw("same");
5433 hGamEChargedClone->Draw("same");
5434 hEleEChargedClone->Draw("same");
5435 hNeHadEChargedClone->Draw("same");
5436 hChHadEChargedClone->Draw("same");
5438 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
5439 pLegend3ch.SetTextSize(0.06);
5440 pLegend3ch.AddEntry(hEChargedClone,"all","L");
5441 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
5442 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
5443 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
5444 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
5445 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
5446 pLegend3ch.SetFillColor(10);
5447 pLegend3ch.SetBorderSize(1);
5451 hPtChargedClone->SetMaximum(1.2);
5452 hPtChargedClone->SetMinimum(0.001);
5453 hPtChargedClone->SetLineColor(3);
5454 hPtChargedClone->SetYTitle("track matched / all");
5455 hPi0PtChargedClone->Divide(hPi0Pt);
5456 hGamPtChargedClone->Divide(hGamPt);
5457 hElePtChargedClone->Divide(hElePt);
5458 hNeHadPtChargedClone->Divide(hNeHadPt);
5459 hChHadPtChargedClone->Divide(hChHadPt);
5460 hPtChargedClone->Draw();
5461 hPi0PtChargedClone->Draw("same");
5462 hGamPtChargedClone->Draw("same");
5463 hElePtChargedClone->Draw("same");
5464 hNeHadPtChargedClone->Draw("same");
5465 hChHadPtChargedClone->Draw("same");
5468 hEtaChargedClone->SetMaximum(1.2);
5469 hEtaChargedClone->SetMinimum(0.001);
5470 hEtaChargedClone->SetLineColor(3);
5471 hEtaChargedClone->SetYTitle("track matched / all");
5472 hPi0EtaChargedClone->Divide(hPi0Eta);
5473 hGamEtaChargedClone->Divide(hGamEta);
5474 hEleEtaChargedClone->Divide(hEleEta);
5475 hNeHadEtaChargedClone->Divide(hNeHadEta);
5476 hChHadEtaChargedClone->Divide(hChHadEta);
5477 hEtaChargedClone->Draw();
5478 hPi0EtaChargedClone->Draw("same");
5479 hGamEtaChargedClone->Draw("same");
5480 hEleEtaChargedClone->Draw("same");
5481 hNeHadEtaChargedClone->Draw("same");
5482 hChHadEtaChargedClone->Draw("same");
5485 hPhiChargedClone->SetMaximum(1.2);
5486 hPhiChargedClone->SetMinimum(0.001);
5487 hPhiChargedClone->SetLineColor(3);
5488 hPhiChargedClone->SetYTitle("track matched / all");
5489 hPi0PhiChargedClone->Divide(hPi0Phi);
5490 hGamPhiChargedClone->Divide(hGamPhi);
5491 hElePhiChargedClone->Divide(hElePhi);
5492 hNeHadPhiChargedClone->Divide(hNeHadPhi);
5493 hChHadPhiChargedClone->Divide(hChHadPhi);
5494 hPhiChargedClone->Draw();
5495 hPi0PhiChargedClone->Draw("same");
5496 hGamPhiChargedClone->Draw("same");
5497 hElePhiChargedClone->Draw("same");
5498 hNeHadPhiChargedClone->Draw("same");
5499 hChHadPhiChargedClone->Draw("same");
5501 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
5502 c3ch->Print(name); printf("Plot: %s\n",name);
5505 //Track-matching distributions
5507 sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
5508 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
5511 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
5512 pLegendpE0.SetTextSize(0.04);
5513 pLegendpE0.AddEntry(fh1pOverE,"all","L");
5514 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
5515 pLegendpE0.SetFillColor(10);
5516 pLegendpE0.SetBorderSize(1);
5517 //pLegendpE0.Draw();
5520 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
5521 fh1pOverE->SetTitle("Track matches p/E");
5523 fh1pOverER02->SetLineColor(4);
5524 fh1pOverER02->Draw("same");
5528 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
5532 fh2MatchdEdx->Draw();
5537 sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
5538 cme->Print(name); printf("Plot: %s\n",name);
5541 sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
5542 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
5547 fhMCEle1pOverE->Draw();
5548 fhMCEle1pOverER02->SetLineColor(4);
5549 fhMCEle1pOverE->SetLineColor(1);
5550 fhMCEle1pOverER02->Draw("same");
5558 fhMCEle2MatchdEdx->Draw();
5560 sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
5561 cmemc->Print(name); printf("Plot: %s\n",name);
5564 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
5565 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
5566 cmemchad->Divide(3,1);
5570 fhMCChHad1pOverE->Draw();
5571 fhMCChHad1pOverER02->SetLineColor(4);
5572 fhMCChHad1pOverE->SetLineColor(1);
5573 fhMCChHad1pOverER02->Draw("same");
5578 fhMCChHad1dR->Draw();
5581 fhMCChHad2MatchdEdx->Draw();
5583 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
5584 cmemchad->Print(name); printf("Plot: %s\n",name);
5586 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
5587 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
5588 cmemcn->Divide(3,1);
5592 fhMCNeutral1pOverE->Draw();
5593 fhMCNeutral1pOverE->SetLineColor(1);
5594 fhMCNeutral1pOverER02->SetLineColor(4);
5595 fhMCNeutral1pOverER02->Draw("same");
5600 fhMCNeutral1dR->Draw();
5603 fhMCNeutral2MatchdEdx->Draw();
5605 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
5606 cmemcn->Print(name); printf("Plot: %s\n",name);
5608 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
5609 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
5614 fh1pOverE->SetLineColor(1);
5615 fhMCEle1pOverE->SetLineColor(4);
5616 fhMCChHad1pOverE->SetLineColor(2);
5617 fhMCNeutral1pOverE->SetLineColor(7);
5618 fh1pOverER02->SetMinimum(0.5);
5620 fhMCEle1pOverE->Draw("same");
5621 fhMCChHad1pOverE->Draw("same");
5622 fhMCNeutral1pOverE->Draw("same");
5623 TLegend pLegendpE(0.65,0.55,0.9,0.8);
5624 pLegendpE.SetTextSize(0.06);
5625 pLegendpE.AddEntry(fh1pOverE,"all","L");
5626 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
5627 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
5628 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
5629 pLegendpE.SetFillColor(10);
5630 pLegendpE.SetBorderSize(1);
5635 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
5636 fh1pOverER02->SetLineColor(1);
5637 fhMCEle1pOverER02->SetLineColor(4);
5638 fhMCChHad1pOverER02->SetLineColor(2);
5639 fhMCNeutral1pOverER02->SetLineColor(7);
5640 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
5641 fh1pOverER02->SetMinimum(0.5);
5642 fh1pOverER02->Draw();
5643 fhMCEle1pOverER02->Draw("same");
5644 fhMCChHad1pOverER02->Draw("same");
5645 fhMCNeutral1pOverER02->Draw("same");
5647 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
5648 // pLegendpE2.SetTextSize(0.06);
5649 // pLegendpE2.SetHeader("dR < 0.02");
5650 // pLegendpE2.SetFillColor(10);
5651 // pLegendpE2.SetBorderSize(1);
5652 // pLegendpE2.Draw();
5654 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
5655 cmpoe->Print(name); printf("Plot: %s\n",name);
5659 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
5660 gROOT->ProcessLine(line);
5661 sprintf(line, ".!rm -fR *.eps");
5662 gROOT->ProcessLine(line);
5664 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());