]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
Add a setter to the number of PID options
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnaCalorimeterQA.cxx
CommitLineData
9725fd2a 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15/* $Id: $ */
16
17//_________________________________________________________________________
18// Class to check results from simulations or reconstructed real data.
19// Fill few histograms and do some checking plots
20//
21//-- Author: Gustavo Conesa (INFN-LNF)
22//_________________________________________________________________________
23
24
25// --- ROOT system ---
21d9bc2a 26//#include "Riostream.h"
591cc579 27#include "TObjArray.h"
9725fd2a 28#include "TParticle.h"
c180f65d 29#include "TDatabasePDG.h"
9725fd2a 30#include "TCanvas.h"
31#include "TPad.h"
32#include "TROOT.h"
a5fafd85 33#include "TH3F.h"
9725fd2a 34#include "TH2F.h"
35#include "TLegend.h"
a5fafd85 36#include "TStyle.h"
9725fd2a 37
38//---- AliRoot system ----
39#include "AliAnaCalorimeterQA.h"
40#include "AliCaloTrackReader.h"
41#include "AliStack.h"
42#include "AliAODCaloCells.h"
902aa95c 43#include "AliESDCaloCells.h"
9725fd2a 44#include "AliAODCaloCluster.h"
ff45398a 45#include "AliFiducialCut.h"
9725fd2a 46#include "AliESDtrack.h"
902aa95c 47#include "AliAODTrack.h"
9725fd2a 48#include "AliESDCaloCluster.h"
49#include "AliESDEvent.h"
902aa95c 50#include "AliAODEvent.h"
51#include "AliVEventHandler.h"
52#include "AliAnalysisManager.h"
53#include "AliAODMCParticle.h"
54#include "AliMCAnalysisUtils.h"
6fa7d352 55#include "AliAODPid.h"
a5fafd85 56#include "AliPHOSGeoUtils.h"
57#include "AliEMCALGeoUtils.h"
9725fd2a 58
59ClassImp(AliAnaCalorimeterQA)
60
61//____________________________________________________________________________
62 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
a0bb4dc0 63 AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""), fMakePlots(kFALSE), fCorrelateCalos(kFALSE),
a5fafd85 64 fPHOSGeo(0x0),fEMCALGeo(0x0), fEMCALGeoName("EMCAL_COMPLETE"), fNModules(12),
65 fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhi(0), fhEtaPhiE(0),
9725fd2a 66 fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiCharged(0),
67 fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0),
68 fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
a5fafd85 69 fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0), fhIM(0), fhIMCellCut(0),fhAsym(0), fhNCellsPerCluster(0), fhNClusters(0), fhNCells(0), fhAmplitude(0),
a0bb4dc0 70 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
a5fafd85 71 fhEMod(0),fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),
72 fhGridCellsMod(0), fhGridCellsEMod(0), fhAmplitudeMod(0), fhIMMod(0), fhIMCellCutMod(0),
9725fd2a 73 fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
74 fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
75 fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
76 fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
77 fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0), fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
9725fd2a 78 fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
79 fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0), fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
80 fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
a0bb4dc0 81 fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
82 fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
83 fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
84 fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
85 fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
9725fd2a 86 fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
87 fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
06e5656a 88 fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
a0bb4dc0 89 fhMCChHad1pOverE(0),fhMCChHad1dR(0),fhMCChHad2MatchdEdx(0),fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
06e5656a 90 fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
9725fd2a 91{
92 //Default Ctor
93
94 //Initialize parameters
95 InitParameters();
96}
97
98//____________________________________________________________________________
99AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
a0bb4dc0 100 AliAnaPartCorrBaseClass(qa), fCalorimeter(qa.fCalorimeter), fStyleMacro(qa.fStyleMacro),
101 fMakePlots(qa.fMakePlots), fCorrelateCalos(qa.fCorrelateCalos),
a5fafd85 102 fPHOSGeo(qa.fPHOSGeo),fEMCALGeo(qa.fEMCALGeo), fEMCALGeoName(qa.fEMCALGeoName), fNModules(qa.fNModules),
9725fd2a 103 fhE(qa.fhE),fhPt(qa.fhPt), fhPhi(qa.fhPhi), fhEta(qa.fhEta),
a5fafd85 104 fhEtaPhi(qa.fhEtaPhi), fhEtaPhiE(qa.fhEtaPhiE), fhECharged(qa.fhECharged),fhPtCharged(qa.fhPtCharged),fhPhiCharged(qa.fhPhiCharged),
9725fd2a 105 fhEtaCharged(qa.fhEtaCharged), fhEtaPhiCharged(qa.fhEtaPhiCharged),
106 fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
107 fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut),
108 fhDeltaE(qa.fhDeltaE), fhDeltaPt(qa.fhDeltaPt), fhDeltaPhi(qa.fhDeltaPhi), fhDeltaEta(qa.fhDeltaEta),
109 fhRatioE(qa.fhRatioE), fhRatioPt(qa.fhRatioPt), fhRatioPhi(qa.fhRatioPhi), fhRatioEta(qa.fhRatioEta),
110 fh2E(qa.fh2E), fh2Pt(qa.fh2Pt), fh2Phi(qa.fh2Phi),fh2Eta(qa.fh2Eta),
a5fafd85 111 fhIM(qa.fhIM), fhIMCellCut(qa.fhIMCellCut), fhAsym(qa.fhAsym), fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNClusters(qa.fhNClusters),
9725fd2a 112 fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude),
a0bb4dc0 113 fhCaloCorrNClusters(qa.fhCaloCorrNClusters), fhCaloCorrEClusters(qa.fhCaloCorrEClusters),
114 fhCaloCorrNCells(qa.fhCaloCorrNCells), fhCaloCorrECells(qa.fhCaloCorrECells),
a5fafd85 115 fhEMod(qa.fhEMod),fhNClustersMod(qa.fhNClustersMod), fhNCellsPerClusterMod(qa.fhNCellsPerClusterMod), fhNCellsMod(qa.fhNCellsMod),
116 fhGridCellsMod(qa.fhGridCellsMod), fhGridCellsEMod(qa.fhGridCellsEMod), fhAmplitudeMod(qa.fhAmplitudeMod),
117 fhIMMod(qa.fhIMMod),fhIMCellCutMod(qa.fhIMCellCutMod),
9725fd2a 118 fhGenGamPt(qa.fhGenGamPt), fhGenGamEta(qa.fhGenGamEta), fhGenGamPhi(qa.fhGenGamPhi),
119 fhGenPi0Pt(qa.fhGenPi0Pt), fhGenPi0Eta(qa.fhGenPi0Eta), fhGenPi0Phi(qa.fhGenPi0Phi),
120 fhGenEtaPt(qa.fhGenEtaPt), fhGenEtaEta(qa.fhGenEtaEta), fhGenEtaPhi(qa.fhGenEtaPhi),
121 fhGenOmegaPt(qa.fhGenOmegaPt), fhGenOmegaEta(qa.fhGenOmegaEta), fhGenOmegaPhi(qa.fhGenOmegaPhi),
122 fhGenElePt(qa.fhGenElePt), fhGenEleEta(qa.fhGenEleEta), fhGenElePhi(qa.fhGenElePhi),
123 fhEMVxyz(qa.fhEMVxyz), fhEMR(qa.fhEMR), fhHaVxyz(qa.fhHaVxyz), fhHaR(qa.fhHaR),
124 fhGamE(qa.fhGamE),fhGamPt(qa.fhGamPt),fhGamPhi(qa.fhGamPhi),fhGamEta(qa.fhGamEta),
125 fhGamDeltaE(qa.fhGamDeltaE), fhGamDeltaPt(qa.fhGamDeltaPt), fhGamDeltaPhi(qa.fhGamDeltaPhi), fhGamDeltaEta(qa.fhGamDeltaEta),
126 fhGamRatioE(qa.fhGamRatioE), fhGamRatioPt(qa.fhGamRatioPt), fhGamRatioPhi(qa.fhGamRatioPhi), fhGamRatioEta(qa.fhGamRatioEta),
9725fd2a 127 fhEleE(qa.fhEleE),fhElePt(qa.fhElePt),fhElePhi(qa.fhElePhi),fhEleEta(qa.fhEleEta),
128 fhPi0E(qa.fhPi0E),fhPi0Pt(qa.fhPi0Pt),fhPi0Phi(qa.fhPi0Phi),fhPi0Eta(qa.fhPi0Eta),
129 fhNeHadE(qa.fhNeHadE),fhNeHadPt(qa.fhNeHadPt),fhNeHadPhi(qa.fhNeHadPhi),fhNeHadEta(qa.fhNeHadEta),
130 fhChHadE(qa.fhChHadE),fhChHadPt(qa.fhChHadPt),fhChHadPhi(qa.fhChHadPhi),fhChHadEta(qa.fhChHadEta),
06e5656a 131 fhGamECharged(qa.fhGamECharged),fhGamPtCharged(qa.fhGamPtCharged),fhGamPhiCharged(qa.fhGamPhiCharged),fhGamEtaCharged(qa.fhGamEtaCharged),
132 fhEleECharged(qa.fhEleECharged),fhElePtCharged(qa.fhElePtCharged),fhElePhiCharged(qa.fhElePhiCharged),fhEleEtaCharged(qa.fhEleEtaCharged),
133 fhPi0ECharged(qa.fhPi0ECharged),fhPi0PtCharged(qa.fhPi0PtCharged),fhPi0PhiCharged(qa.fhPi0PhiCharged),fhPi0EtaCharged(qa.fhPi0EtaCharged),
134 fhNeHadECharged(qa.fhNeHadECharged),fhNeHadPtCharged(qa.fhNeHadPtCharged),fhNeHadPhiCharged(qa.fhNeHadPhiCharged),fhNeHadEtaCharged(qa.fhNeHadEtaCharged),
135 fhChHadECharged(qa.fhChHadECharged),fhChHadPtCharged(qa.fhChHadPtCharged),fhChHadPhiCharged(qa.fhChHadPhiCharged),fhChHadEtaCharged(qa.fhChHadEtaCharged),
9725fd2a 136 fhGenGamAccE(qa.fhGenGamAccE),fhGenGamAccPt(qa.fhGenGamAccPt),fhGenGamAccEta(qa.fhGenGamAccEta),fhGenGamAccPhi(qa.fhGenGamAccPhi),
137 fhGenPi0AccE(qa.fhGenPi0AccE),fhGenPi0AccPt(qa.fhGenPi0AccPt),fhGenPi0AccEta(qa.fhGenPi0AccEta),fhGenPi0AccPhi(qa.fhGenPi0AccPhi),
06e5656a 138 fh1pOverE(qa.fh1pOverE),fh1dR(qa.fh1dR),fh2EledEdx(qa.fh2EledEdx), fh2MatchdEdx(qa.fh2MatchdEdx),
139 fhMCEle1pOverE(qa.fhMCEle1pOverE),fhMCEle1dR(qa.fhMCEle1dR), fhMCEle2MatchdEdx(qa.fhMCEle2MatchdEdx),
140 fhMCChHad1pOverE(qa.fhMCChHad1pOverE),fhMCChHad1dR(qa.fhMCChHad1dR), fhMCChHad2MatchdEdx(qa.fhMCChHad2MatchdEdx),
141 fhMCNeutral1pOverE(qa.fhMCNeutral1pOverE),fhMCNeutral1dR(qa.fhMCNeutral1dR), fhMCNeutral2MatchdEdx(qa.fhMCNeutral2MatchdEdx),
142 fh1pOverER02(qa.fh1pOverER02), fhMCEle1pOverER02(qa.fhMCEle1pOverER02),fhMCChHad1pOverER02(qa.fhMCChHad1pOverER02), fhMCNeutral1pOverER02(qa.fhMCNeutral1pOverER02)
9725fd2a 143{
144 // cpy ctor
145
146}
147
148//_________________________________________________________________________
149AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA & qa)
150{
151 // assignment operator
152
153 if(this == &qa)return *this;
154 ((AliAnaPartCorrBaseClass *)this)->operator=(qa);
155
902aa95c 156 fCalorimeter = qa.fCalorimeter;
157 fStyleMacro = qa.fStyleMacro;
158 fMakePlots = qa.fMakePlots;
a0bb4dc0 159 fCorrelateCalos = qa.fCorrelateCalos;
a5fafd85 160
161 fPHOSGeo = qa.fPHOSGeo;
162 fEMCALGeo = qa.fEMCALGeo;
163 fEMCALGeoName = qa.fEMCALGeoName ;
164 fNModules = qa.fNModules;
902aa95c 165
9725fd2a 166 fhE = qa.fhE;
167 fhPt = qa.fhPt;
168 fhPhi = qa.fhPhi;
169 fhEta = qa.fhEta;
170 fhEtaPhi = qa.fhEtaPhi;
a5fafd85 171 fhEtaPhiE= qa.fhEtaPhiE;
172
9725fd2a 173 fhECharged = qa.fhECharged;
174 fhPtCharged = qa.fhPtCharged;
175 fhPhiCharged = qa.fhPhiCharged;
176 fhEtaCharged = qa.fhEtaCharged;
177 fhEtaPhiCharged = qa.fhEtaPhiCharged;
178
179 fhEChargedNoOut = qa.fhEChargedNoOut;
180 fhPtChargedNoOut = qa.fhPtChargedNoOut;
181 fhPhiChargedNoOut = qa.fhPhiChargedNoOut;
182 fhEtaChargedNoOut = qa.fhEtaChargedNoOut;
183 fhEtaPhiChargedNoOut = qa.fhEtaPhiChargedNoOut;
184
a5fafd85 185 fhIM = qa.fhIM; fhIMCellCut = qa.fhIMCellCut;
9725fd2a 186 fhAsym = qa.fhAsym;
187
188 fhNCellsPerCluster = qa.fhNCellsPerCluster;
189 fhNClusters = qa.fhNClusters;
190
191 fhDeltaE = qa.fhDeltaE;
192 fhDeltaPt = qa.fhDeltaPt;
193 fhDeltaPhi = qa.fhDeltaPhi;
194 fhDeltaEta = qa.fhDeltaEta;
195
196 fhRatioE = qa.fhRatioE;
197 fhRatioPt = qa.fhRatioPt;
198 fhRatioPhi = qa.fhRatioPhi;
199 fhRatioEta = qa.fhRatioEta;
200
201
202 fh2E = qa.fh2E;
203 fh2Pt = qa.fh2Pt;
204 fh2Phi = qa.fh2Phi;
205 fh2Eta = qa.fh2Eta;
206
207 fhNCells = qa.fhNCells;
208 fhAmplitude = qa.fhAmplitude;
209
a0bb4dc0 210 fhCaloCorrNClusters = qa.fhCaloCorrNClusters; fhCaloCorrEClusters = qa.fhCaloCorrEClusters;
211 fhCaloCorrNCells = qa.fhCaloCorrNCells; fhCaloCorrECells = qa.fhCaloCorrECells;
212
a5fafd85 213 fhEMod = qa.fhEMod; fhNClustersMod = qa.fhNClustersMod;
214 fhNCellsPerClusterMod = qa.fhNCellsPerClusterMod; fhNCellsMod = qa.fhNCellsMod;
215 fhGridCellsMod = qa.fhGridCellsMod; fhGridCellsEMod = qa.fhGridCellsEMod;
216 fhAmplitudeMod = qa.fhAmplitudeMod; fhIMMod=qa.fhIMMod; fhIMCellCutMod=qa.fhIMCellCutMod;
217
9725fd2a 218 fhGenGamPt = qa.fhGenGamPt ; fhGenGamEta = qa.fhGenGamEta ; fhGenGamPhi = qa.fhGenGamPhi ;
219 fhGenPi0Pt = qa.fhGenPi0Pt ; fhGenPi0Eta = qa.fhGenPi0Eta ; fhGenPi0Phi = qa.fhGenPi0Phi ;
220 fhGenEtaPt = qa.fhGenEtaPt ; fhGenEtaEta = qa.fhGenEtaEta ; fhGenEtaPhi = qa.fhGenEtaPhi ;
221 fhGenOmegaPt = qa.fhGenOmegaPt ; fhGenOmegaEta = qa.fhGenOmegaEta ; fhGenOmegaPhi = qa.fhGenOmegaPhi ;
222 fhGenElePt = qa.fhGenElePt ; fhGenEleEta = qa.fhGenEleEta ; fhGenElePhi = qa.fhGenElePhi ;
223
224 fhEMVxyz = qa.fhEMVxyz ; fhEMR = qa.fhEMR ; fhHaVxyz = qa.fhHaVxyz ; fhHaR = qa.fhHaR ;
225 fhGamE = qa.fhGamE ;fhGamPt = qa.fhGamPt ;fhGamPhi = qa.fhGamPhi ;fhGamEta = qa.fhGamEta ;
226 fhGamDeltaE = qa.fhDeltaE; fhGamDeltaPt = qa.fhDeltaPt; fhGamDeltaPhi = qa.fhDeltaPhi; fhGamDeltaEta = qa.fhDeltaEta;
227
228 fhGamRatioE = qa.fhGamRatioE; fhGamRatioPt = qa.fhGamRatioPt; fhGamRatioPhi = qa.fhGamRatioPhi; fhGamRatioEta = qa.fhGamRatioEta;
9725fd2a 229
230 fhEleE = qa.fhEleE ;fhElePt = qa.fhElePt ;fhElePhi = qa.fhElePhi ;fhEleEta = qa.fhEleEta ;
231 fhPi0E = qa.fhPi0E ;fhPi0Pt = qa.fhPi0Pt ;fhPi0Phi = qa.fhPi0Phi ;fhPi0Eta = qa.fhPi0Eta ;
232 fhNeHadE = qa.fhNeHadE ;fhNeHadPt = qa.fhNeHadPt ;fhNeHadPhi = qa.fhNeHadPhi ;fhNeHadEta = qa.fhNeHadEta ;
233 fhChHadE = qa.fhChHadE ;fhChHadPt = qa.fhChHadPt ;fhChHadPhi = qa.fhChHadPhi ;fhChHadEta = qa.fhChHadEta ;
234 fhGenGamAccE = qa.fhGenGamAccE ; fhGenPi0AccE = qa.fhGenPi0AccE ;
235 fhGenGamAccPt = qa.fhGenGamAccPt ;fhGenGamAccEta = qa.fhGenGamAccEta ;fhGenGamAccPhi = qa.fhGenGamAccPhi ;
236 fhGenPi0AccPt = qa.fhGenPi0AccPt ;fhGenPi0AccEta = qa.fhGenPi0AccEta; fhGenPi0AccPhi = qa.fhGenPi0AccPhi ;
237
06e5656a 238 fhGamECharged = qa.fhGamECharged; fhGamPtCharged = qa.fhGamPtCharged; fhGamPhiCharged = qa.fhGamPhiCharged; fhGamEtaCharged = qa.fhGamEtaCharged;
239 fhEleECharged = qa.fhEleECharged; fhElePtCharged = qa.fhElePtCharged; fhElePhiCharged = qa.fhElePhiCharged; fhEleEtaCharged = qa.fhEleEtaCharged;
240 fhPi0ECharged = qa.fhPi0ECharged; fhPi0PtCharged = qa.fhPi0PtCharged; fhPi0PhiCharged = qa.fhPi0PhiCharged; fhPi0EtaCharged = qa.fhPi0EtaCharged;
241 fhNeHadECharged = qa.fhNeHadECharged; fhNeHadPtCharged = qa.fhNeHadPtCharged; fhNeHadPhiCharged = qa.fhNeHadPhiCharged; fhNeHadEtaCharged = qa.fhNeHadEtaCharged;
242 fhChHadECharged = qa.fhChHadECharged; fhChHadPtCharged = qa.fhChHadPtCharged; fhChHadPhiCharged = qa.fhChHadPhiCharged; fhChHadEtaCharged = qa.fhChHadEtaCharged;
243
244 fh1pOverE = qa.fh1pOverE;
245 fh1dR = qa.fh1dR;
9725fd2a 246 fh2MatchdEdx = qa.fh2MatchdEdx;
06e5656a 247 fh2EledEdx = qa.fh2EledEdx;
248
249 fhMCEle1pOverE = qa.fhMCEle1pOverE;
250 fhMCEle1dR = qa.fhMCEle1dR;
251 fhMCEle2MatchdEdx = qa.fhMCEle2MatchdEdx ;
252
253 fhMCChHad1pOverE = qa.fhMCChHad1pOverE; fhMCChHad1dR = qa.fhMCChHad1dR; fhMCChHad2MatchdEdx = qa.fhMCChHad2MatchdEdx;
254 fhMCNeutral1pOverE = qa.fhMCNeutral1pOverE; fhMCNeutral1dR = qa.fhMCNeutral1dR; fhMCNeutral2MatchdEdx = qa.fhMCNeutral2MatchdEdx;
255 fh1pOverER02 = qa.fh1pOverER02; fhMCEle1pOverER02 = qa.fhMCEle1pOverER02; fhMCChHad1pOverER02 = qa.fhMCChHad1pOverER02;
256 fhMCNeutral1pOverER02 = qa.fhMCNeutral1pOverER02;
9725fd2a 257
258 return *this;
259
260}
261
a5fafd85 262//________________________________________________________________________________________________________________________________________________
263AliAnaCalorimeterQA::~AliAnaCalorimeterQA() {
264 // dtor
265
266 if(fPHOSGeo) delete fPHOSGeo ;
267 if(fEMCALGeo) delete fEMCALGeo ;
268
269}
270
271
9725fd2a 272//________________________________________________________________________
273TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
274{
275 // Create histograms to be saved in output file and
34187a5a 276 // store them in outputContainer
9725fd2a 277
a5fafd85 278 //If Geometry library loaded, do geometry selection during analysis.
34187a5a 279 if(fCalorimeter=="PHOS"){
280 fPHOSGeo = new AliPHOSGeoUtils("PHOSgeo") ;
281 printf("AliAnaPi0::GetCreateOutputObjects() - PHOS geometry initialized!\n");
282 }
283 else if(fCalorimeter=="EMCAL"){
284 fEMCALGeo = new AliEMCALGeoUtils(fEMCALGeoName) ;
285 printf("AliAnaPi0::GetCreateOutputObjects() - EMCAL geometry initialized!\n");
286 }
a5fafd85 287
9725fd2a 288 TList * outputContainer = new TList() ;
4865e325 289 outputContainer->SetName("QAHistos") ;
9725fd2a 290
a5fafd85 291 //Histograms
9725fd2a 292 Int_t nptbins = GetHistoNPtBins();
293 Int_t nphibins = GetHistoNPhiBins();
294 Int_t netabins = GetHistoNEtaBins();
295 Float_t ptmax = GetHistoPtMax();
296 Float_t phimax = GetHistoPhiMax();
297 Float_t etamax = GetHistoEtaMax();
298 Float_t ptmin = GetHistoPtMin();
299 Float_t phimin = GetHistoPhiMin();
300 Float_t etamin = GetHistoEtaMin();
301
a5fafd85 302 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins,ptmin,ptmax);
9725fd2a 303 fhE->SetXTitle("E (GeV)");
304 outputContainer->Add(fhE);
305
a5fafd85 306 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
9725fd2a 307 fhPt->SetXTitle("p_{T} (GeV/c)");
308 outputContainer->Add(fhPt);
309
a5fafd85 310 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
9725fd2a 311 fhPhi->SetXTitle("#phi (rad)");
312 outputContainer->Add(fhPhi);
313
a5fafd85 314 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
9725fd2a 315 fhEta->SetXTitle("#eta ");
316 outputContainer->Add(fhEta);
317
a5fafd85 318 fhEtaPhi = new TH2F ("hEtaPhi","#eta vs #phi, reconstructed clusters ",netabins,etamin,etamax,nphibins,phimin,phimax);
9725fd2a 319 fhEtaPhi->SetXTitle("#eta ");
320 fhEtaPhi->SetYTitle("#phi ");
321 outputContainer->Add(fhEtaPhi);
322
a5fafd85 323 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
324 fhEtaPhiE->SetXTitle("#eta ");
325 fhEtaPhiE->SetYTitle("#phi (rad)");
326 fhEtaPhiE->SetZTitle("E (GeV) ");
327 outputContainer->Add(fhEtaPhiE);
328
a0bb4dc0 329 //Track Matching
330
a5fafd85 331 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
9725fd2a 332 fhECharged->SetXTitle("E (GeV)");
333 outputContainer->Add(fhECharged);
334
a5fafd85 335 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
9725fd2a 336 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
337 outputContainer->Add(fhPtCharged);
338
a5fafd85 339 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
9725fd2a 340 fhPhiCharged->SetXTitle("#phi (rad)");
341 outputContainer->Add(fhPhiCharged);
342
a5fafd85 343 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
9725fd2a 344 fhEtaCharged->SetXTitle("#eta ");
345 outputContainer->Add(fhEtaCharged);
346
a5fafd85 347 fhEtaPhiCharged = new TH2F ("hEtaPhiCharged","#eta vs #phi, reconstructed clusters, matched with track",netabins,etamin,etamax,nphibins,phimin,phimax);
9725fd2a 348 fhEtaPhiCharged->SetXTitle("#eta ");
349 fhEtaPhiCharged->SetYTitle("#phi ");
350 outputContainer->Add(fhEtaPhiCharged);
9725fd2a 351
a5fafd85 352 fhEChargedNoOut = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
9725fd2a 353 fhEChargedNoOut->SetXTitle("E (GeV)");
354 outputContainer->Add(fhEChargedNoOut);
355
a5fafd85 356 fhPtChargedNoOut = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);
9725fd2a 357 fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
358 outputContainer->Add(fhPtChargedNoOut);
359
a5fafd85 360 fhPhiChargedNoOut = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax);
9725fd2a 361 fhPhiChargedNoOut->SetXTitle("#phi (rad)");
362 outputContainer->Add(fhPhiChargedNoOut);
363
a5fafd85 364 fhEtaChargedNoOut = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax);
9725fd2a 365 fhEtaChargedNoOut->SetXTitle("#eta ");
366 outputContainer->Add(fhEtaChargedNoOut);
367
a5fafd85 368 fhEtaPhiChargedNoOut = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);
9725fd2a 369 fhEtaPhiChargedNoOut->SetXTitle("#eta ");
370 fhEtaPhiChargedNoOut->SetYTitle("#phi ");
371 outputContainer->Add(fhEtaPhiChargedNoOut);
372
491e4f8b 373 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",200,0.,100., 100,0.,10.);
a0bb4dc0 374 fh1pOverE->SetYTitle("p/E");
375 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
376 outputContainer->Add(fh1pOverE);
377
378 fh1dR = new TH1F("h1dR","TRACK matches dR",300, 0.,TMath::Pi());
379 fh1dR->SetXTitle("#Delta R (rad)");
380 outputContainer->Add(fh1dR) ;
381
382 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",200,0.,50.,200,0.,400.);
383 fh2MatchdEdx->SetXTitle("p (GeV/c)");
384 fh2MatchdEdx->SetYTitle("<dE/dx>");
385 outputContainer->Add(fh2MatchdEdx);
386
387 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",200,0.,50.,200,0.,400.);
388 fh2EledEdx->SetXTitle("p (GeV/c)");
389 fh2EledEdx->SetYTitle("<dE/dx>");
390 outputContainer->Add(fh2EledEdx) ;
391
491e4f8b 392 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",200,0.,100.,100,0.,10.);
a0bb4dc0 393 fh1pOverER02->SetYTitle("p/E");
394 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
395 outputContainer->Add(fh1pOverER02);
396
9725fd2a 397 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,200,0,1);
398 fhIM->SetXTitle("E_{cluster pairs} (GeV) ");
399 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
400 outputContainer->Add(fhIM);
401
a5fafd85 402 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,200,0,1);
403 fhIMCellCut->SetXTitle("E_{cluster pairs} (GeV) ");
404 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
405 outputContainer->Add(fhIMCellCut);
406
9725fd2a 407 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,100,0,1);
408 fhAsym->SetXTitle("E_{cluster pairs} (GeV) ");
409 fhAsym->SetYTitle("Asymmetry");
410 outputContainer->Add(fhAsym);
411
a348c43e 412 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs cluster energy", nptbins,ptmin,ptmax, 200,0,200);
9725fd2a 413 fhNCellsPerCluster->SetXTitle("E (GeV)");
414 fhNCellsPerCluster->SetYTitle("n cells");
415 outputContainer->Add(fhNCellsPerCluster);
416
417 fhNClusters = new TH1F ("hNClusters","# clusters", 300,0,300);
418 fhNClusters->SetXTitle("number of clusters");
419 outputContainer->Add(fhNClusters);
420
421 //Calo cells
a5fafd85 422 fhNCells = new TH1F ("hNCells","# cells", 18000,0,18000);
9725fd2a 423 fhNCells->SetXTitle("n cells");
424 outputContainer->Add(fhNCells);
425
a5fafd85 426 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", 500,0,100);
427 fhAmplitude->SetXTitle("Cell Energy (GeV)");
9725fd2a 428 outputContainer->Add(fhAmplitude);
429
a0bb4dc0 430 if(fCorrelateCalos){
431 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", 300,0,300, 300,0,300);
432 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
433 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
434 outputContainer->Add(fhCaloCorrNClusters);
435
436 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", 300,0,300, 300,0,300);
437 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
438 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
439 outputContainer->Add(fhCaloCorrEClusters);
440
441 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", 300,0,300, 300,0,300);
442 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
443 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
444 outputContainer->Add(fhCaloCorrNCells);
445
446 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", 300,0,300, 300,0,300);
447 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
448 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
449 outputContainer->Add(fhCaloCorrECells);
450 }//correlate calorimeters
451
a5fafd85 452 //Module histograms
453 fhEMod = new TH1F*[fNModules];
454 fhNClustersMod = new TH1F*[fNModules];
455 fhNCellsPerClusterMod = new TH2F*[fNModules];
456 fhNCellsMod = new TH1F*[fNModules];
457 fhGridCellsMod = new TH2F*[fNModules];
458 fhGridCellsEMod = new TH2F*[fNModules];
459 fhAmplitudeMod = new TH1F*[fNModules];
460 fhIMMod = new TH2F*[fNModules];
461 fhIMCellCutMod = new TH2F*[fNModules];
462
463 for(Int_t imod = 0; imod < fNModules; imod++){
464
465 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
466 fhEMod[imod]->SetXTitle("E (GeV)");
467 outputContainer->Add(fhEMod[imod]);
468
469 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), 300,0,300);
470 fhNClustersMod[imod]->SetXTitle("number of clusters");
471 outputContainer->Add(fhNClustersMod[imod]);
472
473 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
474 Form("# cells per cluster vs cluster energy in Module %d",imod),
475 nptbins,ptmin,ptmax, 200,0,200);
476 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
477 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
478 outputContainer->Add(fhNCellsPerClusterMod[imod]);
479
480 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), 18000,0,18000);
481 fhNCellsMod[imod]->SetXTitle("n cells");
482 outputContainer->Add(fhNCellsMod[imod]);
483 Int_t colmax = 48;
484 Int_t rowmax = 24;
485 if(fCalorimeter=="PHOS"){
486 colmax=56;
487 rowmax=64;
488 }
489 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
490 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
491 fhGridCellsMod[imod]->SetXTitle("row (phi direction)");
492 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
493 outputContainer->Add(fhGridCellsMod[imod]);
494
495 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
496 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
497 fhGridCellsEMod[imod]->SetXTitle("row (phi direction)");
498 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
499 outputContainer->Add(fhGridCellsEMod[imod]);
500
13d4407a 501 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), 500,0,50);
a5fafd85 502 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
503 outputContainer->Add(fhAmplitudeMod[imod]);
504
505 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
506 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
507 nptbins,ptmin,ptmax,200,0,1);
508 fhIMMod[imod]->SetXTitle("E_{cluster pairs} (GeV) ");
509 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
510 outputContainer->Add(fhIMMod[imod]);
511
512 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
513 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
514 nptbins,ptmin,ptmax,200,0,1);
515 fhIMCellCutMod[imod]->SetXTitle("E_{cluster pairs} (GeV) ");
516 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
517 outputContainer->Add(fhIMCellCutMod[imod]);
518
519 }
520
521
a0bb4dc0 522 //Monte Carlo Histograms
9725fd2a 523 if(IsDataMC()){
524
525 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", 200,-50,50);
526 fhDeltaE->SetXTitle("#Delta E (GeV)");
527 outputContainer->Add(fhDeltaE);
528
529 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", 200,-50,50);
530 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
531 outputContainer->Add(fhDeltaPt);
532
533 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",100,-2,2);
534 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
535 outputContainer->Add(fhDeltaPhi);
536
537 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",100,-1,1);
538 fhDeltaEta->SetXTitle("#Delta #eta ");
539 outputContainer->Add(fhDeltaEta);
540
541 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", 200,0,2);
542 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
543 outputContainer->Add(fhRatioE);
544
545 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", 200,0,2);
546 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
547 outputContainer->Add(fhRatioPt);
548
549 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",200,0,2);
550 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
551 outputContainer->Add(fhRatioPhi);
552
553 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",200,0,2);
554 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
555 outputContainer->Add(fhRatioEta);
556
557 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
558 fh2E->SetXTitle("E_{rec} (GeV)");
559 fh2E->SetYTitle("E_{gen} (GeV)");
560 outputContainer->Add(fh2E);
561
562 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
563 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
564 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
565 outputContainer->Add(fh2Pt);
566
567 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
568 fh2Phi->SetXTitle("#phi_{rec} (rad)");
569 fh2Phi->SetYTitle("#phi_{gen} (rad)");
570 outputContainer->Add(fh2Phi);
571
572 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
573 fh2Eta->SetXTitle("#eta_{rec} ");
574 fh2Eta->SetYTitle("#eta_{gen} ");
575 outputContainer->Add(fh2Eta);
576
577 //Fill histos depending on origin of cluster
578 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 579 fhGamE->SetXTitle("E_{rec} (GeV)");
580 fhGamE->SetXTitle("E_{gen} (GeV)");
9725fd2a 581 outputContainer->Add(fhGamE);
582
583 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 584 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
585 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 586 outputContainer->Add(fhGamPt);
587
588 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 589 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
590 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 591 outputContainer->Add(fhGamPhi);
592
593 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 594 fhGamEta->SetXTitle("#eta_{rec} ");
595 fhGamEta->SetYTitle("#eta_{gen} ");
9725fd2a 596 outputContainer->Add(fhGamEta);
597
598 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", 200,-50,50);
599 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
600 outputContainer->Add(fhGamDeltaE);
601
602 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", 200,-50,50);
603 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
604 outputContainer->Add(fhGamDeltaPt);
605
606 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",100,-2,2);
607 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
608 outputContainer->Add(fhGamDeltaPhi);
609
610 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",100,-1,1);
611 fhGamDeltaEta->SetXTitle("#Delta #eta ");
612 outputContainer->Add(fhGamDeltaEta);
613
614 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", 200,0,2);
615 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
616 outputContainer->Add(fhGamRatioE);
617
618 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", 200,0,2);
619 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
620 outputContainer->Add(fhGamRatioPt);
621
622 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",200,0,2);
623 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
624 outputContainer->Add(fhGamRatioPhi);
625
626 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",200,0,2);
627 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
628 outputContainer->Add(fhGamRatioEta);
629
06e5656a 630 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
631 fhPi0E->SetXTitle("E_{rec} (GeV)");
632 fhPi0E->SetYTitle("E_{gen} (GeV)");
9725fd2a 633 outputContainer->Add(fhPi0E);
634
635 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 636 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
637 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 638 outputContainer->Add(fhPi0Pt);
639
640 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 641 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
642 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 643 outputContainer->Add(fhPi0Phi);
644
645 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 646 fhPi0Eta->SetXTitle("#eta_{rec} ");
647 fhPi0Eta->SetYTitle("#eta_{gen} ");
9725fd2a 648 outputContainer->Add(fhPi0Eta);
649
650 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 651 fhEleE->SetXTitle("E_{rec} (GeV)");
652 fhEleE->SetXTitle("E_{gen} (GeV)");
9725fd2a 653 outputContainer->Add(fhEleE);
654
655 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 656 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
657 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 658 outputContainer->Add(fhElePt);
659
06e5656a 660 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
661 fhElePhi->SetXTitle("#phi_{rec} (rad)");
662 fhElePhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 663 outputContainer->Add(fhElePhi);
664
665 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 666 fhEleEta->SetXTitle("#eta_{rec} ");
667 fhEleEta->SetYTitle("#eta_{gen} ");
9725fd2a 668 outputContainer->Add(fhEleEta);
669
06e5656a 670 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
671 fhNeHadE->SetXTitle("E_{rec} (GeV)");
672 fhNeHadE->SetYTitle("E_{gen} (GeV)");
9725fd2a 673 outputContainer->Add(fhNeHadE);
674
675 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 676 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
677 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 678 outputContainer->Add(fhNeHadPt);
679
680 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 681 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
682 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 683 outputContainer->Add(fhNeHadPhi);
684
685 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 686 fhNeHadEta->SetXTitle("#eta_{rec} ");
687 fhNeHadEta->SetYTitle("#eta_{gen} ");
9725fd2a 688 outputContainer->Add(fhNeHadEta);
689
06e5656a 690 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
691 fhChHadE->SetXTitle("E_{rec} (GeV)");
692 fhChHadE->SetYTitle("E_{gen} (GeV)");
9725fd2a 693 outputContainer->Add(fhChHadE);
694
695 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 696 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
697 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 698 outputContainer->Add(fhChHadPt);
699
700 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 701 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
702 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 703 outputContainer->Add(fhChHadPhi);
704
705 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 706 fhChHadEta->SetXTitle("#eta_{rec} ");
707 fhChHadEta->SetYTitle("#eta_{gen} ");
9725fd2a 708 outputContainer->Add(fhChHadEta);
709
06e5656a 710 //Charged clusters
711
712 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
713 fhGamECharged->SetXTitle("E_{rec} (GeV)");
714 fhGamECharged->SetXTitle("E_{gen} (GeV)");
715 outputContainer->Add(fhGamECharged);
716
717 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
718 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
719 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
720 outputContainer->Add(fhGamPtCharged);
721
722 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
723 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
724 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
725 outputContainer->Add(fhGamPhiCharged);
726
727 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
728 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
729 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
730 outputContainer->Add(fhGamEtaCharged);
731
732 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
733 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
734 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
735 outputContainer->Add(fhPi0ECharged);
736
737 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
738 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
739 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
740 outputContainer->Add(fhPi0PtCharged);
741
742 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
743 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
744 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
745 outputContainer->Add(fhPi0PhiCharged);
746
747 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
748 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
749 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
750 outputContainer->Add(fhPi0EtaCharged);
751
752 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
753 fhEleECharged->SetXTitle("E_{rec} (GeV)");
754 fhEleECharged->SetXTitle("E_{gen} (GeV)");
755 outputContainer->Add(fhEleECharged);
756
757 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
758 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
759 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
760 outputContainer->Add(fhElePtCharged);
761
762 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
763 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
764 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
765 outputContainer->Add(fhElePhiCharged);
766
767 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
768 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
769 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
770 outputContainer->Add(fhEleEtaCharged);
771
772 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
773 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
774 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
775 outputContainer->Add(fhNeHadECharged);
776
777 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
778 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
779 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
780 outputContainer->Add(fhNeHadPtCharged);
781
782 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
783 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
784 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
785 outputContainer->Add(fhNeHadPhiCharged);
786
787 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
788 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
789 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
790 outputContainer->Add(fhNeHadEtaCharged);
791
792 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
793 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
794 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
795 outputContainer->Add(fhChHadECharged);
796
797 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
798 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
799 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
800 outputContainer->Add(fhChHadPtCharged);
801
802 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
803 fhChHadPhiCharged->SetXTitle("#phi (rad)");
804 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
805 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
806 outputContainer->Add(fhChHadPhiCharged);
807
808 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
809 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
810 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
811 outputContainer->Add(fhChHadEtaCharged);
812
9725fd2a 813 //Vertex of generated particles
814
815 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",100,0,500,100,0,500);//,100,0,500);
816 fhEMVxyz->SetXTitle("v_{x}");
817 fhEMVxyz->SetYTitle("v_{y}");
818 //fhEMVxyz->SetZTitle("v_{z}");
819 outputContainer->Add(fhEMVxyz);
820
821 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",100,0,500,100,0,500);//,100,0,500);
822 fhHaVxyz->SetXTitle("v_{x}");
823 fhHaVxyz->SetYTitle("v_{y}");
824 //fhHaVxyz->SetZTitle("v_{z}");
825 outputContainer->Add(fhHaVxyz);
826
827 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,100,0,500);
828 fhEMR->SetXTitle("E (GeV)");
829 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
830 outputContainer->Add(fhEMR);
831
832 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,100,0,500);
833 fhHaR->SetXTitle("E (GeV)");
834 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
835 outputContainer->Add(fhHaR);
836
06e5656a 837
9725fd2a 838
839 //Pure MC
840 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
841 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
842 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
843
844 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
845 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
846 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
847
848 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
849 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
850 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
851
852 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
853 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
854 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
855
856 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
857 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
858 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
859
860 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
861 fhGenGamEta->SetXTitle("#eta");
862 fhGenGamPhi->SetXTitle("#phi (rad)");
863 outputContainer->Add(fhGenGamPt);
864 outputContainer->Add(fhGenGamEta);
865 outputContainer->Add(fhGenGamPhi);
866
867 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
868 fhGenPi0Eta->SetXTitle("#eta");
869 fhGenPi0Phi->SetXTitle("#phi (rad)");
870 outputContainer->Add(fhGenPi0Pt);
871 outputContainer->Add(fhGenPi0Eta);
872 outputContainer->Add(fhGenPi0Phi);
873
874 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
875 fhGenEtaEta->SetXTitle("#eta");
876 fhGenEtaPhi->SetXTitle("#phi (rad)");
877 outputContainer->Add(fhGenEtaPt);
878 outputContainer->Add(fhGenEtaEta);
879 outputContainer->Add(fhGenEtaPhi);
880
881 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
882 fhGenOmegaEta->SetXTitle("#eta");
883 fhGenOmegaPhi->SetXTitle("#phi (rad)");
884 outputContainer->Add(fhGenOmegaPt);
885 outputContainer->Add(fhGenOmegaEta);
886 outputContainer->Add(fhGenOmegaPhi);
887
888 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
889 fhGenEleEta->SetXTitle("#eta");
890 fhGenElePhi->SetXTitle("#phi (rad)");
891 outputContainer->Add(fhGenElePt);
892 outputContainer->Add(fhGenEleEta);
893 outputContainer->Add(fhGenElePhi);
894
895 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
896 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
897 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
898 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
899
900 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
901 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
902 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
903 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
904
905 fhGenGamAccE ->SetXTitle("E (GeV)");
906 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
907 fhGenGamAccEta->SetXTitle("#eta");
908 fhGenGamAccPhi->SetXTitle("#phi (rad)");
909 outputContainer->Add(fhGenGamAccE);
910 outputContainer->Add(fhGenGamAccPt);
911 outputContainer->Add(fhGenGamAccEta);
912 outputContainer->Add(fhGenGamAccPhi);
913
914 fhGenPi0AccE ->SetXTitle("E (GeV)");
915 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
916 fhGenPi0AccEta->SetXTitle("#eta");
917 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
918 outputContainer->Add(fhGenPi0AccE);
919 outputContainer->Add(fhGenPi0AccPt);
920 outputContainer->Add(fhGenPi0AccEta);
921 outputContainer->Add(fhGenPi0AccPhi);
922
a0bb4dc0 923 //Track Matching
924
491e4f8b 925 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",200,0.,100.,100,0.,10.);
a0bb4dc0 926 fhMCEle1pOverE->SetYTitle("p/E");
927 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
928 outputContainer->Add(fhMCEle1pOverE);
929
930 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",300, 0.,TMath::Pi());
931 fhMCEle1dR->SetXTitle("#Delta R (rad)");
932 outputContainer->Add(fhMCEle1dR) ;
933
934 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",200,0.,50.,200,0.,400.);
935 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
936 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
937 outputContainer->Add(fhMCEle2MatchdEdx);
938
491e4f8b 939 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",200,0.,100.,100,0.,10.);
a0bb4dc0 940 fhMCChHad1pOverE->SetYTitle("p/E");
941 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
942 outputContainer->Add(fhMCChHad1pOverE);
943
944 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",300, 0.,TMath::Pi());
945 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
946 outputContainer->Add(fhMCChHad1dR) ;
947
948 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",200,0.,50.,200,0.,400.);
949 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
950 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
951 outputContainer->Add(fhMCChHad2MatchdEdx);
952
491e4f8b 953 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",200,0.,100.,100,0.,10.);
a0bb4dc0 954 fhMCNeutral1pOverE->SetYTitle("p/E");
955 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
956 outputContainer->Add(fhMCNeutral1pOverE);
957
958 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",300, 0.,TMath::Pi());
959 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
960 outputContainer->Add(fhMCNeutral1dR) ;
961
962 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",200,0.,50.,200,0.,400.);
963 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
964 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
965 outputContainer->Add(fhMCNeutral2MatchdEdx);
966
491e4f8b 967 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",200,0.,100.,100,0.,10.);
a0bb4dc0 968 fhMCEle1pOverER02->SetYTitle("p/E");
969 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
970 outputContainer->Add(fhMCEle1pOverER02);
971
491e4f8b 972 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",200,0.,100.,100,0.,10.);
a0bb4dc0 973 fhMCChHad1pOverER02->SetYTitle("p/E");
974 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
975 outputContainer->Add(fhMCChHad1pOverER02);
976
491e4f8b 977 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",200,0.,100.,100,0.,10.);
a0bb4dc0 978 fhMCNeutral1pOverER02->SetYTitle("p/E");
979 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
980 outputContainer->Add(fhMCNeutral1pOverER02);
9725fd2a 981 }
a0bb4dc0 982
9725fd2a 983 return outputContainer;
984}
985
a5fafd85 986//____________________________________________________________________________________________________________________________________________________
987Int_t AliAnaCalorimeterQA::GetModuleNumber(AliESDCaloCluster * cluster)
988{
989 //Get the EMCAL/PHOS module number that corresponds to this cluster
990 TLorentzVector lv;
991 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
992 cluster->GetMomentum(lv,v);
993 Float_t phi = lv.Phi();
994 if(phi < 0) phi+=TMath::TwoPi();
995 Int_t absId = -1;
996 if(fCalorimeter=="EMCAL"){
997 fEMCALGeo->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
998 if(GetDebug() > 2)
999 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
1000 lv.Eta(), phi*TMath::RadToDeg(),absId, fEMCALGeo->GetSuperModuleNumber(absId));
1001 return fEMCALGeo->GetSuperModuleNumber(absId) ;
1002 }//EMCAL
1003 else{//PHOS
1004 Int_t relId[4];
1005 if ( cluster->GetNCells() > 0) {
1006 absId = cluster->GetCellAbsId(0);
1007 if(GetDebug() > 2)
1008 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
1009 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
1010 }
1011 else return -1;
1012
1013 if ( absId >= 0) {
1014 fPHOSGeo->AbsToRelNumbering(absId,relId);
1015 if(GetDebug() > 2)
1016 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - PHOS: Module %d\n",relId[0]-1);
1017 return relId[0]-1;
1018 }
1019 else return -1;
1020 }//PHOS
1021
1022 return -1;
1023}
1024
1025//____________________________________________________________________________________________________________________________________________________
1026Int_t AliAnaCalorimeterQA::GetModuleNumber(AliAODCaloCluster * cluster)
1027{
1028 //Get the EMCAL/PHOS module number that corresponds to this cluster
1029 TLorentzVector lv;
1030 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
1031 cluster->GetMomentum(lv,v);
1032 Float_t phi = lv.Phi();
1033 if(phi < 0) phi+=TMath::TwoPi();
1034 Int_t absId = -1;
1035 if(fCalorimeter=="EMCAL"){
1036 fEMCALGeo->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
1037 if(GetDebug() > 2)
1038 printf("AliAnaCalorimeterQA::GetModuleNumber(ESD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
1039 lv.Eta(), phi*TMath::RadToDeg(),absId, fEMCALGeo->GetSuperModuleNumber(absId));
1040 return fEMCALGeo->GetSuperModuleNumber(absId) ;
1041 }//EMCAL
1042 else{//PHOS
1043 Int_t relId[4];
1044 if ( cluster->GetNCells() > 0) {
1045 absId = cluster->GetCellAbsId(0);
1046 if(GetDebug() > 2)
1047 printf("AliAnaCalorimeterQA::GetModuleNumber(AOD) - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
1048 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
1049 }
1050 else return -1;
1051
1052 if ( absId >= 0) {
1053 fPHOSGeo->AbsToRelNumbering(absId,relId);
1054 if(GetDebug() > 2)
1055 printf("AliAnaCalorimeterQA::GetModuleNumber(AOD) - PHOS: Module %d\n",relId[0]-1);
1056 return relId[0]-1;
1057 }
1058 else return -1;
1059 }//PHOS
1060
1061 return -1;
1062}
1063//____________________________________________________________________________________________________________________________________________________
1064Int_t AliAnaCalorimeterQA::GetModuleNumberCellIndexes(const Int_t absId, Int_t & icol, Int_t & irow)
1065{
1066 //Get the EMCAL/PHOS module number that corresponds to this absId
1067 Int_t imod = -1;
1068 if ( absId >= 0) {
1069 if(fCalorimeter=="EMCAL"){
1070 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1071 fEMCALGeo->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1072 fEMCALGeo->GetCellPhiEtaIndexInSModule(imod,iTower,
1073 iIphi, iIeta,irow,icol);
1074 return imod ;
1075 }//EMCAL
1076 else{//PHOS
1077 Int_t relId[4];
1078 fPHOSGeo->AbsToRelNumbering(absId,relId);
1079 irow = relId[2];
1080 icol = relId[3];
1081 imod = relId[0]-1;
1082 return imod;
1083 }//PHOS
1084 }
1085
1086 return -1;
1087}
1088
1089
9725fd2a 1090//__________________________________________________
1091void AliAnaCalorimeterQA::Init()
1092{
1093 //Check if the data or settings are ok
1094 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1095 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1096 abort();
1097 }
1098
1099 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1100 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1101 abort();
1102 }
1103
1104}
1105
1106
1107//__________________________________________________
1108void AliAnaCalorimeterQA::InitParameters()
1109{
1110 //Initialize the parameters of the analysis.
1111 AddToHistogramsName("AnaCaloQA_");
1112
1113 fCalorimeter = "EMCAL"; //or PHOS
1114 fStyleMacro = "" ;
a5fafd85 1115 fEMCALGeoName = "EMCAL_COMPLETE";
1116 fNModules = 12; // set maximum to maximum number of EMCAL modules
1117
9725fd2a 1118}
1119
1120//__________________________________________________________________
1121void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1122{
1123 //Print some relevant parameters set for the analysis
1124 if(! opt)
1125 return;
1126
1127 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1128 AliAnaPartCorrBaseClass::Print(" ");
1129
1130 printf("Select Calorimeter %s \n",fCalorimeter.Data());
63f1dd86 1131 printf("Make plots? %d \n",fMakePlots);
1132 printf("Plots style macro %s \n",fStyleMacro.Data());
9725fd2a 1133}
1134
1135//__________________________________________________________________
1136void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1137{
902aa95c 1138 //Fill Calorimeter QA histograms
1139
9725fd2a 1140 TLorentzVector mom ;
1141 TLorentzVector mom2 ;
902aa95c 1142 TRefArray * caloClusters = new TRefArray();
1143 Int_t nLabel = 0;
1144 Int_t *labels=0x0;
1145 Int_t nCaloClusters = 0;
1146 Int_t nCaloCellsPerCluster = 0;
1147 Int_t nTracksMatched = 0;
1148 Int_t trackIndex = 0;
a5fafd85 1149 Int_t nModule = -1;
1150
902aa95c 1151 //Play with the MC stack if available
1152 //Get the MC arrays and do some checks
1153 if(IsDataMC()){
1154 if(GetReader()->ReadStack()){
1155
1156 if(!GetMCStack()) {
1157 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1158 abort();
1159 }
1160 //Fill some pure MC histograms, only primaries.
1161 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1162 TParticle *primary = GetMCStack()->Particle(i) ;
1163 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1164 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1165 primary->Momentum(mom);
1166 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1167 } //primary loop
1168 }
1169 else if(GetReader()->ReadAODMCParticles()){
1170
1171 if(!GetReader()->GetAODMCParticles(0)) {
1172 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1173 abort();
1174 }
1175 //Fill some pure MC histograms, only primaries.
1176 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1177 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1178 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1179 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1180 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1181 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1182 //aodprimary->Momentum(mom);
1183 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1184 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1185 } //primary loop
1186
1187 }
1188 }// is data and MC
1189
1190
1191 //Get List with CaloClusters
1192
1193 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1194 if (fCalorimeter == "EMCAL") ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1195 else if(fCalorimeter == "PHOS") ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1196 else {
1197 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1198 abort();
1199 }
1200 }
1201 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1202 if (fCalorimeter == "EMCAL") ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1203 else if(fCalorimeter == "PHOS") ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters (caloClusters);//GetAODPHOS();
1204 else {
1205 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1206 abort();
4865e325 1207 }
1208 }
9725fd2a 1209
902aa95c 1210 if(!caloClusters) {
1211 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n");
9725fd2a 1212 abort();
1213 }
1214
a0bb4dc0 1215 //Correlate Calorimeters
1216 if(fCorrelateCalos) CorrelateCalorimeters(caloClusters);
1217
902aa95c 1218 nCaloClusters = caloClusters->GetEntriesFast() ;
1219 fhNClusters->Fill(nCaloClusters);
491e4f8b 1220 Int_t *nClustersInModule = new Int_t[fNModules];
a5fafd85 1221 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1222
9725fd2a 1223 if(GetDebug() > 0)
902aa95c 1224 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
9725fd2a 1225
1226 //Get vertex for photon momentum calculation
1227 Double_t v[3] ; //vertex ;
1228 GetReader()->GetVertex(v);
902aa95c 1229 TObject * track = 0x0;
1230 //Loop over CaloClusters
1231 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1232
1233 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1234 iclus+1,nCaloClusters,GetReader()->GetDataType());
1235
1236 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1237 AliESDCaloCluster* clus = (AliESDCaloCluster*) (caloClusters->At(iclus));
1238 //Get cluster kinematics
1239 clus->GetMomentum(mom,v);
a5fafd85 1240 //Get module of cluster
1241 nModule = GetModuleNumber(clus);
63f1dd86 1242 if(nModule < fNModules) nClustersInModule[nModule]++;
902aa95c 1243 //MC labels
1244 nLabel = clus->GetNLabels();
1245 if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray();
1246 //Cells per cluster
1247 nCaloCellsPerCluster = clus->GetNCells();
1248 //matched cluster with tracks
1249 nTracksMatched = clus->GetNTracksMatched();
1250 trackIndex = clus->GetTrackMatched();
1251 if(trackIndex >= 0){
1252 track = (AliESDtrack*) ((AliESDEvent*)GetReader()->GetInputEvent())->GetTrack(trackIndex);
1253 }
1254 else{
1255 if(nTracksMatched == 1) nTracksMatched = 0;
1256 track = 0;
1257 }
1258 }
1259 else{
1260 AliAODCaloCluster* clus = (AliAODCaloCluster*) (caloClusters->At(iclus));
4865e325 1261
902aa95c 1262 //Get cluster kinematics
1263 clus->GetMomentum(mom,v);
a5fafd85 1264 //Get module of cluster
1265 nModule = GetModuleNumber(clus);
63f1dd86 1266 if(nModule < fNModules) nClustersInModule[nModule]++;
902aa95c 1267 //MC labels
1268 nLabel = clus->GetNLabel();
1269 if(clus->GetLabels()) labels = clus->GetLabels();
1270 //Cells per cluster
1271 nCaloCellsPerCluster = clus->GetNCells();
1272 //matched cluster with tracks
1273 nTracksMatched = clus->GetNTracksMatched();
1274 if(nTracksMatched > 0)
1275 track = (AliAODTrack*)clus->GetTrackMatched(0);
1276 }
4865e325 1277
902aa95c 1278 //Fill histograms related to single cluster or track matching
13d4407a 1279 ClusterHistograms(mom, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
a5fafd85 1280 if(GetDebug()>1) printf("Invariant mass \n");
902aa95c 1281 //Invariant mass
a5fafd85 1282 Int_t nModule2 = -1;
1283 Int_t nCaloCellsPerCluster2=0;
902aa95c 1284 if (nCaloClusters > 1 ) {
1285 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters-1 ; jclus++) {
1286 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1287 AliESDCaloCluster* clus2 = (AliESDCaloCluster*) (caloClusters->At(jclus));
1288 //Get cluster kinematics
1289 clus2->GetMomentum(mom2,v);
a5fafd85 1290 //Get module of cluster
1291 nModule2 = GetModuleNumber(clus2);
1292 //Cells per cluster
1293 nCaloCellsPerCluster2 = clus2->GetNCells();
1294
06e5656a 1295 }
59b6bd99 1296 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD){
902aa95c 1297 AliAODCaloCluster* clus2 = (AliAODCaloCluster*) (caloClusters->At(jclus));
1298 //Get cluster kinematics
1299 clus2->GetMomentum(mom2,v);
a5fafd85 1300 //Get module of cluster
1301 nModule2 = GetModuleNumber(clus2);
1302 //Cells per cluster
1303 nCaloCellsPerCluster2 = clus2->GetNCells();
06e5656a 1304 }
59b6bd99 1305
1306 //Fill invariant mass histograms
1307 //All modules
9725fd2a 1308 fhIM ->Fill((mom+mom2).E(),(mom+mom2).M());
59b6bd99 1309 //Single module
1310 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1311 fhIMMod[nModule]->Fill((mom+mom2).E(),(mom+mom2).M());
1312
1313 //Select only clusters with at least 2 cells
a5fafd85 1314 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
59b6bd99 1315 //All modules
1316 fhIMCellCut ->Fill((mom+mom2).E(),(mom+mom2).M());
1317 //Single modules
1318 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1319 fhIMCellCutMod[nModule]->Fill((mom+mom2).E(),(mom+mom2).M());
a5fafd85 1320 }
59b6bd99 1321
1322 //Asymetry histograms
902aa95c 1323 fhAsym->Fill((mom+mom2).E(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1324
9725fd2a 1325 }// 2nd cluster loop
902aa95c 1326 }////more than 1 cluster in calorimeter
1327 }//cluster loop
1328
a5fafd85 1329 //Number of clusters per module
63f1dd86 1330 for(Int_t imod = 0; imod < fNModules; imod++ ){
1331 if(GetDebug() > 1)
1332 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1333 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1334 }
a5fafd85 1335
902aa95c 1336 //CaloCells
491e4f8b 1337 Int_t *nCellsInModule = new Int_t[fNModules];
a5fafd85 1338 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1339 Int_t icol = -1;
1340 Int_t irow = -1;
1341 Float_t amp = 0;
902aa95c 1342 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1343 AliESDCaloCells * cell = 0x0;
1344 Int_t ncells = 0;
1345 if(fCalorimeter == "PHOS") cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1346 else cell = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1347
1348 if(!cell) {
1349 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No CELLS available for analysis");
1350 abort();
1351 }
1352
1353 ncells = cell->GetNumberOfCells() ;
1354 fhNCells->Fill(ncells) ;
1355 if(GetDebug() > 0)
1356 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1357
1358 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1359 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
a5fafd85 1360 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell), icol, irow);
1361 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1362 amp = cell->GetAmplitude(iCell);
1363 fhAmplitude->Fill(amp);
1364 fhAmplitudeMod[nModule]->Fill(cell->GetAmplitude(iCell));
1365 nCellsInModule[nModule]++;
1366 fhGridCellsMod[nModule]->Fill(icol,irow);
1367 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
902aa95c 1368 }
1369
1370 }//ESD
1371 else{//AOD
a0bb4dc0 1372 AliAODCaloCells * cell = 0x0;
902aa95c 1373 Int_t ncells = 0;
9725fd2a 1374
a0bb4dc0 1375 if(fCalorimeter == "PHOS") cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1376 else cell = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
9725fd2a 1377
902aa95c 1378 if(!cell) {
1379 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No CELLS available for analysis");
1380 abort();
1381 }
1382
1383 ncells = cell->GetNumberOfCells() ;
1384 fhNCells->Fill(ncells) ;
1385 if(GetDebug() > 0)
1386 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
9725fd2a 1387
902aa95c 1388 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1389 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
a5fafd85 1390 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell), icol, irow);
1391 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1392 amp = cell->GetAmplitude(iCell);
1393 fhAmplitude->Fill(amp);
63f1dd86 1394 if(nModule < fNModules) {
1395 fhAmplitudeMod[nModule]->Fill(cell->GetAmplitude(iCell));
1396 nCellsInModule[nModule]++;
1397 fhGridCellsMod[nModule]->Fill(icol,irow);
1398 fhGridCellsEMod[nModule]->Fill(icol,irow,amp);
1399 }
902aa95c 1400 }
9725fd2a 1401
902aa95c 1402 }//AOD
a5fafd85 1403
1404 //Number of cells per module
63f1dd86 1405 for(Int_t imod = 0; imod < fNModules; imod++ ) {
1406 if(GetDebug() > 1)
1407 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
1408 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
1409 }
a5fafd85 1410
902aa95c 1411 if(GetDebug() > 0)
1412 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1413}
1414
a0bb4dc0 1415
902aa95c 1416//__________________________________
a5fafd85 1417void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Int_t nCaloCellsPerCluster,const Int_t nModule,
1418 const Int_t nTracksMatched, const TObject * track,
902aa95c 1419 const Int_t * labels, const Int_t nLabels){
1420 //Fill CaloCluster related histograms
9725fd2a 1421
902aa95c 1422 AliAODMCParticle * aodprimary = 0x0;
1423 TParticle * primary = 0x0;
1424 Int_t tag = 0;
1425
1426 Float_t e = mom.E();
1427 Float_t pt = mom.Pt();
1428 Float_t eta = mom.Eta();
1429 Float_t phi = mom.Phi();
1430 if(phi < 0) phi +=TMath::TwoPi();
1431 if(GetDebug() > 0) {
1432 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
1433 if(IsDataMC()) {
491e4f8b 1434 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
1435 printf("\t Primaries: nlabels %d\n",nLabels);
902aa95c 1436 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
1437 }
9725fd2a 1438 }
902aa95c 1439
13d4407a 1440 fhE ->Fill(e);
63f1dd86 1441 if(nModule < fNModules) fhEMod[nModule]->Fill(e);
902aa95c 1442 fhPt ->Fill(pt);
1443 fhPhi ->Fill(phi);
1444 fhEta ->Fill(eta);
1445 fhEtaPhi->Fill(eta,phi);
a5fafd85 1446 fhEtaPhiE->Fill(eta,phi,e);
902aa95c 1447 //Cells per cluster
1448 fhNCellsPerCluster->Fill(e, nCaloCellsPerCluster);
63f1dd86 1449 if(nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
902aa95c 1450
1451 //Fill histograms only possible when simulation
1452 if(IsDataMC() && nLabels > 0 && labels){
1453
9725fd2a 1454 //Play with the MC stack if available
902aa95c 1455 Int_t label = labels[0];
1456
1457 if(label < 0) {
1458 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
1459 return;
1460 }
1461
1462 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1463 Float_t vxMC= 0; Float_t vyMC = 0;
1464 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1465 Int_t charge = 0;
1466
1467 //Check the origin.
1468 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
1469
1470 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
1471
1472 if( label >= GetMCStack()->GetNtrack()) {
1473 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1474 return ;
1475 }
9725fd2a 1476
902aa95c 1477 primary = GetMCStack()->Particle(label);
1478 iMother = label;
1479 pdg0 = TMath::Abs(primary->GetPdgCode());
1480 pdg = pdg0;
1481 status = primary->GetStatusCode();
1482 vxMC = primary->Vx();
1483 vyMC = primary->Vy();
1484 iParent = primary->GetFirstMother();
1485
1486 if(GetDebug() > 1 ) {
1487 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1488 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1489 }
1490
1491 //Get final particle, no conversion products
1492 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1493 //Get the parent
1494 primary = GetMCStack()->Particle(iParent);
1495 pdg = TMath::Abs(primary->GetPdgCode());
1496 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1497 while((pdg == 22 || pdg == 11) && status != 1){
1498 iMother = iParent;
1499 primary = GetMCStack()->Particle(iMother);
1500 status = primary->GetStatusCode();
1501 iParent = primary->GetFirstMother();
1502 pdg = TMath::Abs(primary->GetPdgCode());
1503 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1504 }
1505
1506 if(GetDebug() > 1 ) {
1507 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1508 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1509 }
1510
1511 }
1512
1513 //Overlapped pi0 (or eta, there will be very few), get the meson
1514 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1515 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1516 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1517 while(pdg != 111 && pdg != 221){
1518 iMother = iParent;
1519 primary = GetMCStack()->Particle(iMother);
1520 status = primary->GetStatusCode();
1521 iParent = primary->GetFirstMother();
1522 pdg = TMath::Abs(primary->GetPdgCode());
1523 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1524 if(iMother==-1) {
1525 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1526 //break;
1527 }
1528 }
1529
1530 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1531 primary->GetName(),iMother);
1532 }
1533
1534 eMC = primary->Energy();
1535 ptMC = primary->Pt();
1536 phiMC = primary->Phi();
1537 etaMC = primary->Eta();
1538 pdg = TMath::Abs(primary->GetPdgCode());
1539 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1540
1541 }
1542 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
1543 //Get the list of MC particles
1544 if(!GetReader()->GetAODMCParticles(0)) {
1545 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
1546 abort();
1547 }
9725fd2a 1548
902aa95c 1549 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
1550 iMother = label;
1551 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1552 pdg = pdg0;
1553 status = aodprimary->IsPrimary();
1554 vxMC = aodprimary->Xv();
1555 vyMC = aodprimary->Yv();
1556 iParent = aodprimary->GetMother();
1557
1558 if(GetDebug() > 1 ) {
1559 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1560 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
1561 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
1562 }
9725fd2a 1563
902aa95c 1564 //Get final particle, no conversion products
1565 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1566 if(GetDebug() > 1 )
1567 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1568 //Get the parent
1569 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
1570 pdg = TMath::Abs(aodprimary->GetPdgCode());
1571 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
1572 iMother = iParent;
1573 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1574 status = aodprimary->IsPrimary();
1575 iParent = aodprimary->GetMother();
1576 pdg = TMath::Abs(aodprimary->GetPdgCode());
1577 if(GetDebug() > 1 )
1578 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
1579 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1580 }
1581
1582 if(GetDebug() > 1 ) {
1583 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1584 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
1585 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
9725fd2a 1586 }
902aa95c 1587
9725fd2a 1588 }
902aa95c 1589
1590 //Overlapped pi0 (or eta, there will be very few), get the meson
1591 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1592 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1593 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1594 while(pdg != 111 && pdg != 221){
1595
1596 iMother = iParent;
1597 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1598 status = aodprimary->IsPrimary();
1599 iParent = aodprimary->GetMother();
1600 pdg = TMath::Abs(aodprimary->GetPdgCode());
1601
1602 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1603
1604 if(iMother==-1) {
1605 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1606 //break;
1607 }
1608 }
1609
1610 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1611 aodprimary->GetName(),iMother);
1612 }
1613
1614 status = aodprimary->IsPrimary();
1615 eMC = aodprimary->E();
1616 ptMC = aodprimary->Pt();
1617 phiMC = aodprimary->Phi();
1618 etaMC = aodprimary->Eta();
1619 pdg = TMath::Abs(aodprimary->GetPdgCode());
1620 charge = aodprimary->Charge();
1621
1622 }
1623
1624 //Float_t vz = primary->Vz();
1625 Float_t r = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1626 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
1627 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1628 fhEMR ->Fill(e,r);
1629 }
1630
1631 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1632 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1633 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1634
1635
1636 fh2E ->Fill(e, eMC);
1637 fh2Pt ->Fill(pt, ptMC);
1638 fh2Phi ->Fill(phi, phiMC);
1639 fh2Eta ->Fill(eta, etaMC);
1640 fhDeltaE ->Fill(eMC-e);
1641 fhDeltaPt ->Fill(ptMC-pt);
1642 fhDeltaPhi->Fill(phiMC-phi);
1643 fhDeltaEta->Fill(etaMC-eta);
1644 if(eMC > 0) fhRatioE ->Fill(e/eMC);
1645 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
1646 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
1647 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
1648
1649
1650 //Overlapped pi0 (or eta, there will be very few)
1651 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1652 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1653 //cout<<"Fill pi0"<< "E "<< e <<" prim E "<<eMC<<endl;
1654 fhPi0E ->Fill(e,eMC);
1655 fhPi0Pt ->Fill(pt,ptMC);
1656 fhPi0Eta ->Fill(eta,etaMC);
1657 fhPi0Phi ->Fill(phi,phiMC);
1658 if( nTracksMatched > 0){
1659 fhPi0ECharged ->Fill(e,eMC);
1660 fhPi0PtCharged ->Fill(pt,ptMC);
1661 fhPi0PhiCharged ->Fill(phi,phiMC);
1662 fhPi0EtaCharged ->Fill(eta,etaMC);
9725fd2a 1663 }
902aa95c 1664 }//Overlapped pizero decay
1665 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
1666 fhGamE ->Fill(e,eMC);
1667 fhGamPt ->Fill(pt,ptMC);
1668 fhGamEta ->Fill(eta,etaMC);
1669 fhGamPhi ->Fill(phi,phiMC);
1670 fhGamDeltaE ->Fill(eMC-e);
1671 fhGamDeltaPt ->Fill(ptMC-pt);
1672 fhGamDeltaPhi->Fill(phiMC-phi);
1673 fhGamDeltaEta->Fill(etaMC-eta);
1674 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
1675 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
1676 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
1677 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
1678 if( nTracksMatched > 0){
1679 fhGamECharged ->Fill(e,eMC);
1680 fhGamPtCharged ->Fill(pt,ptMC);
1681 fhGamPhiCharged ->Fill(phi,phiMC);
1682 fhGamEtaCharged ->Fill(eta,etaMC);
1683 }
1684 }//photon
1685 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
1686 fhEleE ->Fill(e,eMC);
1687 fhElePt ->Fill(pt,ptMC);
1688 fhEleEta ->Fill(eta,etaMC);
1689 fhElePhi ->Fill(phi,phiMC);
1690 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1691 fhEMR ->Fill(e,r);
1692 if( nTracksMatched > 0){
1693 fhEleECharged ->Fill(e,eMC);
1694 fhElePtCharged ->Fill(pt,ptMC);
1695 fhElePhiCharged ->Fill(phi,phiMC);
1696 fhEleEtaCharged ->Fill(eta,etaMC);
1697 }
1698 }
1699 else if(charge == 0){
1700 fhNeHadE ->Fill(e,eMC);
1701 fhNeHadPt ->Fill(pt,ptMC);
1702 fhNeHadEta ->Fill(eta,etaMC);
1703 fhNeHadPhi ->Fill(phi,phiMC);
1704 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1705 fhHaR ->Fill(e,r);
1706 if( nTracksMatched > 0){
1707 fhNeHadECharged ->Fill(e,eMC);
1708 fhNeHadPtCharged ->Fill(pt,ptMC);
1709 fhNeHadPhiCharged ->Fill(phi,phiMC);
1710 fhNeHadEtaCharged ->Fill(eta,etaMC);
9725fd2a 1711 }
902aa95c 1712 }
1713 else if(charge!=0){
1714 fhChHadE ->Fill(e,eMC);
1715 fhChHadPt ->Fill(pt,ptMC);
1716 fhChHadEta ->Fill(eta,etaMC);
1717 fhChHadPhi ->Fill(phi,phiMC);
1718 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1719 fhHaR ->Fill(e,r);
1720 if( nTracksMatched > 0){
1721 fhChHadECharged ->Fill(e,eMC);
1722 fhChHadPtCharged ->Fill(pt,ptMC);
1723 fhChHadPhiCharged ->Fill(phi,phiMC);
1724 fhChHadEtaCharged ->Fill(eta,etaMC);
9725fd2a 1725 }
902aa95c 1726 }
1727 }//Work with MC
1728
1729
1730 //Match tracks and clusters
1731 //To be Modified in case of AODs
1732
1733 //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
1734
1735 if( nTracksMatched > 0){
1736 fhECharged ->Fill(e);
1737 fhPtCharged ->Fill(pt);
1738 fhPhiCharged ->Fill(phi);
1739 fhEtaCharged ->Fill(eta);
1740 fhEtaPhiCharged->Fill(eta,phi);
1741
6fa7d352 1742 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
1743 //Study the track and matched cluster if track exists.
1744 if(!track) return;
1745 Double_t emcpos[3] = {0.,0.,0.};
1746 Double_t emcmom[3] = {0.,0.,0.};
1747 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
1748 Double_t bfield = 0.;
1749 Double_t tphi = 0;
1750 Double_t teta = 0;
1751 Double_t tmom = 0;
1752 Double_t tpt = 0;
1753 Double_t tmom2 = 0;
1754 Double_t tpcSignal = 0;
1755 Bool_t okpos = kFALSE;
1756 Bool_t okmom = kFALSE;
1757 Bool_t okout = kFALSE;
1758 Int_t nITS = 0;
1759 Int_t nTPC = 0;
1760
1761 //In case of ESDs get the parameters in this way
902aa95c 1762 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
6fa7d352 1763 if (((AliESDtrack*)track)->GetOuterParam() ) {
1764 okout = kTRUE;
902aa95c 1765
6fa7d352 1766 bfield = ((AliESDEvent*)GetReader()->GetInputEvent())->GetMagneticField();
1767 okpos = ((AliESDtrack*)track)->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
1768 okmom = ((AliESDtrack*)track)->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
1769 if(!(okpos && okmom)) return;
1770
1771 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
1772 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
1773 tphi = position.Phi();
1774 teta = position.Eta();
1775 tmom = momentum.Mag();
1776
1777 //Double_t tphi = ((AliESDtrack*)track)->GetOuterParam()->Phi();
1778 //Double_t teta = ((AliESDtrack*)track)->GetOuterParam()->Eta();
1779 //Double_t tmom = ((AliESDtrack*)track)->GetOuterParam()->P();
1780 tpt = ((AliESDtrack*)track)->Pt();
1781 tmom2 = ((AliESDtrack*)track)->P();
1782 tpcSignal = ((AliESDtrack*)track)->GetTPCsignal();
902aa95c 1783
6fa7d352 1784 nITS = ((AliESDtrack*)track)->GetNcls(0);
1785 nTPC = ((AliESDtrack*)track)->GetNcls(1);
1786 }//Outer param available
1787 }// ESDs
1788 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1789 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
1790 if (pid) {
1791 okout = kTRUE;
1792 pid->GetEMCALPosition(emcpos);
1793 pid->GetEMCALMomentum(emcmom);
1794
1795 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
1796 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
1797 tphi = position.Phi();
1798 teta = position.Eta();
1799 tmom = momentum.Mag();
1800
1801 tpt = ((AliAODTrack*)track)->Pt();
1802 tmom2 = ((AliAODTrack*)track)->P();
1803 tpcSignal = pid->GetTPCsignal();
902aa95c 1804
6fa7d352 1805 //nITS = ((AliAODTrack*)track)->GetNcls(0);
1806 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
1807 }//Outer param available
1808 }//AODs
1809 else return; //Do nothing case not implemented.
1810
1811 if(okout){
902aa95c 1812 Double_t deta = teta - eta;
1813 Double_t dphi = tphi - phi;
1814 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
1815 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
1816 Double_t dR = sqrt(dphi*dphi + deta*deta);
6fa7d352 1817
902aa95c 1818 Double_t pOverE = tmom/e;
6fa7d352 1819
1820 fh1pOverE->Fill(tpt, pOverE);
1821 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
1822
902aa95c 1823 fh1dR->Fill(dR);
1824 fh2MatchdEdx->Fill(tmom2,tpcSignal);
6fa7d352 1825
902aa95c 1826 if(IsDataMC() && primary){
1827 Int_t pdg = primary->GetPdgCode();
1828 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
6fa7d352 1829
902aa95c 1830 if(TMath::Abs(pdg) == 11){
6fa7d352 1831 fhMCEle1pOverE->Fill(tpt,pOverE);
902aa95c 1832 fhMCEle1dR->Fill(dR);
1833 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
6fa7d352 1834 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
902aa95c 1835 }
1836 else if(charge!=0){
6fa7d352 1837 fhMCChHad1pOverE->Fill(tpt,pOverE);
902aa95c 1838 fhMCChHad1dR->Fill(dR);
1839 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
6fa7d352 1840 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
902aa95c 1841 }
1842 else if(charge == 0){
6fa7d352 1843 fhMCNeutral1pOverE->Fill(tpt,pOverE);
902aa95c 1844 fhMCNeutral1dR->Fill(dR);
1845 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
6fa7d352 1846 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
902aa95c 1847 }
1848 }//DataMC
6fa7d352 1849
902aa95c 1850 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
1851 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
1852 fh2EledEdx->Fill(tmom2,tpcSignal);
1853 }
6fa7d352 1854 }
1855 else{//no ESD external param or AODPid
1856 ULong_t status=AliESDtrack::kTPCrefit;
902aa95c 1857 status|=AliESDtrack::kITSrefit;
1858 //printf("track status %d\n", track->GetStatus() );
a5fafd85 1859 fhEChargedNoOut ->Fill(e);
902aa95c 1860 fhPtChargedNoOut ->Fill(pt);
1861 fhPhiChargedNoOut ->Fill(phi);
1862 fhEtaChargedNoOut ->Fill(eta);
1863 fhEtaPhiChargedNoOut ->Fill(eta,phi);
1864 if(GetDebug() >= 0 && ((((AliESDtrack*)track)->GetStatus() & status) == status)) printf("ITS+TPC\n");
6fa7d352 1865 }//No out params
1866 }//matched clusters with tracks
9725fd2a 1867
902aa95c 1868}// Clusters
4865e325 1869
a0bb4dc0 1870//__________________________________
1871void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
1872 // Correlate information from PHOS and EMCAL
1873 TRefArray * caloClustersEMCAL = new TRefArray;
1874 TRefArray * caloClustersPHOS = new TRefArray;
1875
1876 // Get once the array of clusters per calorimeter, avoid an extra loop.
1877 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1878 if(fCalorimeter == "EMCAL"){
1879 ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
1880 caloClustersEMCAL = refArray;
1881 }
1882 else if(fCalorimeter == "PHOS") {
1883 ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
1884 caloClustersEMCAL = refArray;
1885 }
1886
1887 //Fill histograms with clusters
1888
1889 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
1890 Float_t sumClusterEnergyEMCAL = 0;
1891 Float_t sumClusterEnergyPHOS = 0;
1892 Int_t iclus = 0;
1893 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1894 sumClusterEnergyEMCAL += ((AliESDCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
1895 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
1896 sumClusterEnergyPHOS += ((AliESDCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
1897 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
1898
1899 //Fill histograms with cells
1900
1901 AliESDCaloCells * cellsEMCAL = ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1902 AliESDCaloCells * cellsPHOS = ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1903 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
1904
1905 Int_t icell = 0;
1906 Float_t sumCellEnergyEMCAL = 0;
1907 Float_t sumCellEnergyPHOS = 0;
1908 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
1909 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
1910 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
1911 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
1912 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
1913 if(GetDebug() > 0 ){
1914 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
1915 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1916 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
1917 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1918 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
1919 }
1920 }//ESD
1921 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
1922 if(fCalorimeter == "EMCAL"){
1923 ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSClusters(caloClustersPHOS);
1924 caloClustersEMCAL = refArray;
1925 }
1926 else if(fCalorimeter == "PHOS") {
1927 ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALClusters (caloClustersEMCAL);
1928 caloClustersEMCAL = refArray;
1929 }
1930
1931 //Fill histograms with clusters
1932
1933 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
1934 Float_t sumClusterEnergyEMCAL = 0;
1935 Float_t sumClusterEnergyPHOS = 0;
1936 Int_t iclus = 0;
1937 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1938 sumClusterEnergyEMCAL += ((AliAODCaloCluster*) (caloClustersEMCAL->At(iclus)))->E();
1939 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
1940 sumClusterEnergyPHOS += ((AliAODCaloCluster*) (caloClustersPHOS->At(iclus)))->E();
1941 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
1942
1943 //Fill histograms with cells
1944
1945 AliAODCaloCells * cellsEMCAL = ((AliAODEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
1946 AliAODCaloCells * cellsPHOS = ((AliAODEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
1947 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
1948
1949 Int_t icell = 0;
1950 Float_t sumCellEnergyEMCAL = 0;
1951 Float_t sumCellEnergyPHOS = 0;
1952 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
1953 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
1954 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
1955 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
1956 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
1957 if(GetDebug() > 0 ){
1958 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
1959 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1960 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
1961 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1962 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
1963 }
1964 }//AOD
1965
1966}
1967
902aa95c 1968//______________________________________________________________________________
1969void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
1970 //Fill pure monte carlo related histograms
4865e325 1971
902aa95c 1972 Float_t eMC = mom.E();
1973 Float_t ptMC = mom.Pt();
1974 Float_t phiMC = mom.Phi();
1975 if(phiMC < 0)
1976 phiMC += TMath::TwoPi();
1977 Float_t etaMC = mom.Eta();
1978
1979 if (TMath::Abs(etaMC) > 1) return;
9725fd2a 1980
902aa95c 1981 Bool_t in = kTRUE;
ff45398a 1982 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
902aa95c 1983
1984 if (pdg==22) {
1985 fhGenGamPt ->Fill(ptMC);
1986 fhGenGamEta->Fill(etaMC);
1987 fhGenGamPhi->Fill(phiMC);
1988 if(in){
1989 fhGenGamAccE ->Fill(eMC);
1990 fhGenGamAccPt ->Fill(ptMC);
1991 fhGenGamAccEta->Fill(etaMC);
1992 fhGenGamAccPhi->Fill(phiMC);
1993 }
1994 }
1995 else if (pdg==111) {
1996 fhGenPi0Pt ->Fill(ptMC);
1997 fhGenPi0Eta->Fill(etaMC);
1998 fhGenPi0Phi->Fill(phiMC);
1999 if(in){
2000 fhGenPi0AccE ->Fill(eMC);
2001 fhGenPi0AccPt ->Fill(ptMC);
2002 fhGenPi0AccEta->Fill(etaMC);
2003 fhGenPi0AccPhi->Fill(phiMC);
2004 }
2005 }
2006 else if (pdg==221) {
2007 fhGenEtaPt ->Fill(ptMC);
2008 fhGenEtaEta->Fill(etaMC);
2009 fhGenEtaPhi->Fill(phiMC);
2010 }
2011 else if (pdg==223) {
2012 fhGenOmegaPt ->Fill(ptMC);
2013 fhGenOmegaEta->Fill(etaMC);
2014 fhGenOmegaPhi->Fill(phiMC);
2015 }
2016 else if (TMath::Abs(pdg)==11) {
2017 fhGenElePt ->Fill(ptMC);
2018 fhGenEleEta->Fill(etaMC);
2019 fhGenElePhi->Fill(phiMC);
2020 }
2021
2022}
2023
9725fd2a 2024//________________________________________________________________________
2025void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2026{
2027 // Needed when Terminate is executed in distributed environment
2028 // Refill analysis histograms of this class with corresponding histograms in output list.
2029
2030 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2031 // the first one and then add the next
2032 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
63f1dd86 2033 printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2034
9725fd2a 2035 //Read histograms, must be in the same order as in GetCreateOutputObject.
a5fafd85 2036 fhE = (TH1F *) outputList->At(index++);
2037 fhPt = (TH1F *) outputList->At(index++);
2038 fhPhi = (TH1F *) outputList->At(index++);
2039 fhEta = (TH1F *) outputList->At(index++);
2040 fhEtaPhi = (TH2F *) outputList->At(index++);
2041 fhEtaPhiE = (TH3F *) outputList->At(index++);
9725fd2a 2042
2043 fhECharged = (TH1F *) outputList->At(index++);
2044 fhPtCharged = (TH1F *) outputList->At(index++);
2045 fhPhiCharged = (TH1F *) outputList->At(index++);
2046 fhEtaCharged = (TH1F *) outputList->At(index++);
2047 fhEtaPhiCharged = (TH2F *) outputList->At(index++);
2048
2049 fhEChargedNoOut = (TH1F *) outputList->At(index++);
2050 fhPtChargedNoOut = (TH1F *) outputList->At(index++);
2051 fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
2052 fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
2053 fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
2054
a0bb4dc0 2055 fh1pOverE = (TH2F *) outputList->At(index++);
2056 fh1dR = (TH1F *) outputList->At(index++);
2057 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2058 fh2EledEdx = (TH2F *) outputList->At(index++);
2059 fh1pOverER02 = (TH2F *) outputList->At(index++);
2060
a5fafd85 2061 fhIM = (TH2F *) outputList->At(index++);
2062 fhIMCellCut = (TH2F *) outputList->At(index++);
2063 fhAsym = (TH2F *) outputList->At(index++);
9725fd2a 2064
2065 fhNCellsPerCluster = (TH2F *) outputList->At(index++);
2066 fhNClusters = (TH1F *) outputList->At(index++);
2067 fhNCells = (TH1F *) outputList->At(index++);
2068 fhAmplitude = (TH1F *) outputList->At(index++);
2069
a0bb4dc0 2070 if(fCorrelateCalos){
2071 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2072 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2073 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2074 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2075 }
63f1dd86 2076
2077 //Module histograms
2078 fhEMod = new TH1F*[fNModules];
2079 fhNClustersMod = new TH1F*[fNModules];
2080 fhNCellsPerClusterMod = new TH2F*[fNModules];
2081 fhNCellsMod = new TH1F*[fNModules];
2082 fhGridCellsMod = new TH2F*[fNModules];
2083 fhGridCellsEMod = new TH2F*[fNModules];
2084 fhAmplitudeMod = new TH1F*[fNModules];
2085 fhIMMod = new TH2F*[fNModules];
2086 fhIMCellCutMod = new TH2F*[fNModules];
2087
a5fafd85 2088 for(Int_t imod = 0 ; imod < fNModules; imod++){
2089 fhEMod[imod] = (TH1F *) outputList->At(index++);
2090 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2091 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2092 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2093 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2094 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2095 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2096 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2097 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
2098
2099 }
a0bb4dc0 2100
9725fd2a 2101 if(IsDataMC()){
2102 fhDeltaE = (TH1F *) outputList->At(index++);
2103 fhDeltaPt = (TH1F *) outputList->At(index++);
2104 fhDeltaPhi = (TH1F *) outputList->At(index++);
2105 fhDeltaEta = (TH1F *) outputList->At(index++);
2106
2107 fhRatioE = (TH1F *) outputList->At(index++);
2108 fhRatioPt = (TH1F *) outputList->At(index++);
2109 fhRatioPhi = (TH1F *) outputList->At(index++);
2110 fhRatioEta = (TH1F *) outputList->At(index++);
2111
2112 fh2E = (TH2F *) outputList->At(index++);
2113 fh2Pt = (TH2F *) outputList->At(index++);
2114 fh2Phi = (TH2F *) outputList->At(index++);
2115 fh2Eta = (TH2F *) outputList->At(index++);
2116
2117 fhGamE = (TH2F *) outputList->At(index++);
2118 fhGamPt = (TH2F *) outputList->At(index++);
2119 fhGamPhi = (TH2F *) outputList->At(index++);
2120 fhGamEta = (TH2F *) outputList->At(index++);
2121
2122 fhGamDeltaE = (TH1F *) outputList->At(index++);
2123 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2124 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2125 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2126
2127 fhGamRatioE = (TH1F *) outputList->At(index++);
2128 fhGamRatioPt = (TH1F *) outputList->At(index++);
2129 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2130 fhGamRatioEta = (TH1F *) outputList->At(index++);
2131
9725fd2a 2132 fhPi0E = (TH2F *) outputList->At(index++);
2133 fhPi0Pt = (TH2F *) outputList->At(index++);
2134 fhPi0Phi = (TH2F *) outputList->At(index++);
2135 fhPi0Eta = (TH2F *) outputList->At(index++);
2136
2137 fhEleE = (TH2F *) outputList->At(index++);
2138 fhElePt = (TH2F *) outputList->At(index++);
2139 fhElePhi = (TH2F *) outputList->At(index++);
2140 fhEleEta = (TH2F *) outputList->At(index++);
2141
2142 fhNeHadE = (TH2F *) outputList->At(index++);
2143 fhNeHadPt = (TH2F *) outputList->At(index++);
2144 fhNeHadPhi = (TH2F *) outputList->At(index++);
2145 fhNeHadEta = (TH2F *) outputList->At(index++);
2146
2147 fhChHadE = (TH2F *) outputList->At(index++);
2148 fhChHadPt = (TH2F *) outputList->At(index++);
2149 fhChHadPhi = (TH2F *) outputList->At(index++);
2150 fhChHadEta = (TH2F *) outputList->At(index++);
2151
06e5656a 2152 fhGamECharged = (TH2F *) outputList->At(index++);
2153 fhGamPtCharged = (TH2F *) outputList->At(index++);
2154 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2155 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2156
2157 fhPi0ECharged = (TH2F *) outputList->At(index++);
2158 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2159 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2160 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2161
2162 fhEleECharged = (TH2F *) outputList->At(index++);
2163 fhElePtCharged = (TH2F *) outputList->At(index++);
2164 fhElePhiCharged = (TH2F *) outputList->At(index++);
2165 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2166
2167 fhNeHadECharged = (TH2F *) outputList->At(index++);
2168 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2169 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2170 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2171
2172 fhChHadECharged = (TH2F *) outputList->At(index++);
2173 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2174 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2175 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2176
9725fd2a 2177// fhEMVxyz = (TH3F *) outputList->At(index++);
2178// fhHaVxyz = (TH3F *) outputList->At(index++);
2179
2180 fhEMVxyz = (TH2F *) outputList->At(index++);
2181 fhHaVxyz = (TH2F *) outputList->At(index++);
2182 fhEMR = (TH2F *) outputList->At(index++);
2183 fhHaR = (TH2F *) outputList->At(index++);
2184
2185 fhGenGamPt = (TH1F *) outputList->At(index++);
2186 fhGenGamEta = (TH1F *) outputList->At(index++);
2187 fhGenGamPhi = (TH1F *) outputList->At(index++);
2188
2189 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2190 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2191 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2192
2193 fhGenEtaPt = (TH1F *) outputList->At(index++);
2194 fhGenEtaEta = (TH1F *) outputList->At(index++);
2195 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2196
2197 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2198 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2199 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2200
2201 fhGenElePt = (TH1F *) outputList->At(index++);
2202 fhGenEleEta = (TH1F *) outputList->At(index++);
2203 fhGenElePhi = (TH1F *) outputList->At(index++);
2204
2205 fhGenGamAccE = (TH1F *) outputList->At(index++);
2206 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2207 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2208 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2209
2210 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2211 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2212 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2213 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2214
6fa7d352 2215 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
06e5656a 2216 fhMCEle1dR = (TH1F *) outputList->At(index++);
2217 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2218
6fa7d352 2219 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
06e5656a 2220 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2221 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2222
6fa7d352 2223 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
06e5656a 2224 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2225 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2226
6fa7d352 2227 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2228 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2229 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
06e5656a 2230 }
2231 //for(Int_t i = 0; i<index ; i++) cout<<outputList->At(i)->GetName()<<endl;
9725fd2a 2232}
2233
2234//__________________________________________________________________
2235void AliAnaCalorimeterQA::Terminate(TList* outputList)
2236{
902aa95c 2237 //Do plots if requested
2238 char line[1024] ;
2239
2240 //if(fRemoveOutputAOD){
2241 // sprintf(line, ".!rm -fR %s",((AliVEventHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()))->GetOutputFileName());
2242 // gROOT->ProcessLine(line);
2243 //}
63f1dd86 2244 printf("AliAnaCalorimeterQA::Terminate() - Make plots? %d\n",fMakePlots);
21d9bc2a 2245 if(!fMakePlots) return;
9725fd2a 2246
2247 //Do some plots to end
2248 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
2249 //Recover histograms from output histograms list, needed for distributed analysis.
2250 ReadHistograms(outputList);
2251
63f1dd86 2252 printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2253 printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
9725fd2a 2254
2255 char name[128];
2256 char cname[128];
06e5656a 2257
8a587055 2258 //CaloCells
2259 //printf("c9\n");
2260 sprintf(cname,"QA_%s_nclustercellsamp",fCalorimeter.Data());
2261 TCanvas * c9 = new TCanvas(cname, " CaloClusters and CaloCells", 400, 400) ;
2262 c9->Divide(2, 2);
2263
2264 c9->cd(1) ;
a5fafd85 2265
2266 TLegend pLegendN(0.7,0.6,0.9,0.8);
2267 pLegendN.SetTextSize(0.03);
2268 pLegendN.AddEntry(fhNClusters,"all modules","L");
2269 pLegendN.SetFillColor(10);
2270 pLegendN.SetBorderSize(1);
2271
8a587055 2272 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
2273 gPad->SetLogx();
a5fafd85 2274 fhNClusters->SetLineColor(1);
8a587055 2275 fhNClusters->Draw();
a5fafd85 2276 for(Int_t imod = 0; imod < fNModules; imod++){
2277 fhNClustersMod[imod]->SetLineColor(imod+1);
2278 fhNClustersMod[imod]->Draw("same");
2279 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
2280 }
2281 pLegendN.Draw();
2282
8a587055 2283 c9->cd(2) ;
2284 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
2285 gPad->SetLogx();
a5fafd85 2286 fhNCells->SetLineColor(1);
8a587055 2287 fhNCells->Draw();
a5fafd85 2288 for(Int_t imod = 0; imod < fNModules; imod++){
2289 fhNCellsMod[imod]->SetLineColor(imod+1);
2290 fhNCellsMod[imod]->Draw("same");
2291 }
8a587055 2292 c9->cd(3) ;
2293 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
2294 gPad->SetLogx();
a5fafd85 2295 TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1);
2296 cpc->SetLineColor(1);
2297 cpc->Draw();
2298 for(Int_t imod = 0; imod < fNModules; imod++){
2299 cpc = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
2300 cpc->SetLineColor(imod+1);
2301 cpc->Draw("same");
2302 }
8a587055 2303
2304 c9->cd(4) ;
2305 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
a348c43e 2306 gPad->SetLogx();
a5fafd85 2307 fhAmplitude->SetLineColor(1);
8a587055 2308 fhAmplitude->Draw();
a5fafd85 2309 for(Int_t imod = 0; imod < fNModules; imod++){
2310 fhAmplitudeMod[imod]->SetLineColor(imod+1);
2311 fhAmplitudeMod[imod]->Draw("same");
2312 }
8a587055 2313
2314 sprintf(name,"QA_%s_CaloClustersAndCaloCells.eps",fCalorimeter.Data());
2315 c9->Print(name); printf("Plot: %s\n",name);
2316
a0bb4dc0 2317 if(fCorrelateCalos){
2318 //Calorimeter Correlation, PHOS vs EMCAL
2319 //printf("c9\n");
2320 sprintf(cname,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
2321 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
2322 ccorr->Divide(2, 2);
2323
2324 ccorr->cd(1) ;
2325 //gPad->SetLogy();
2326 //gPad->SetLogx();
2327 fhCaloCorrNClusters ->Draw();
2328
2329 ccorr->cd(2) ;
2330 //gPad->SetLogy();
2331 //gPad->SetLogx();
2332 fhCaloCorrNCells->Draw();
2333
2334 ccorr->cd(3) ;
2335 //gPad->SetLogy();
2336 //gPad->SetLogx();
2337 fhCaloCorrEClusters->Draw();
2338
2339 ccorr->cd(4) ;
2340 //gPad->SetLogy();
2341 //gPad->SetLogx();
2342 fhCaloCorrECells->Draw();
2343
2344 sprintf(name,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
2345 ccorr->Print(name); printf("Plot: %s\n",name);
2346 }
8a587055 2347
9725fd2a 2348 //Reconstructed distributions
06e5656a 2349 //printf("c1\n");
9725fd2a 2350 sprintf(cname,"QA_%s_rec",fCalorimeter.Data());
2351 TCanvas * c = new TCanvas(cname, "Reconstructed distributions", 400, 400) ;
2352 c->Divide(2, 2);
2353
2354 c->cd(1) ;
8a587055 2355 if(fhE->GetEntries() > 0) gPad->SetLogy();
a5fafd85 2356 TLegend pLegendE(0.7,0.6,0.9,0.8);
2357 pLegendE.SetTextSize(0.03);
2358 pLegendE.AddEntry(fhE,"all modules","L");
2359 pLegendE.SetFillColor(10);
2360 pLegendE.SetBorderSize(1);
2361
2362 fhE->SetLineColor(1);
9725fd2a 2363 fhE->Draw();
a5fafd85 2364 for(Int_t imod = 0; imod < fNModules; imod++){
2365 fhEMod[imod]->SetLineColor(imod+1);
2366 fhEMod[imod]->Draw("same");
2367 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
2368 }
2369 pLegendE.Draw();
9725fd2a 2370
2371 c->cd(2) ;
8a587055 2372 if(fhPt->GetEntries() > 0) gPad->SetLogy();
9725fd2a 2373 fhPt->SetLineColor(4);
2374 fhPt->Draw();
2375
2376 c->cd(3) ;
2377 fhPhi->SetLineColor(4);
2378 fhPhi->Draw();
2379
2380 c->cd(4) ;
2381 fhEta->SetLineColor(4);
2382 fhEta->Draw();
2383
2384 sprintf(name,"QA_%s_ReconstructedDistributions.eps",fCalorimeter.Data());
8a587055 2385 c->Print(name); printf("Plot: %s\n",name);
9725fd2a 2386
2387 //Reconstructed distributions, matched with tracks
2388 //printf("c2\n");
2389 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
2390 TCanvas * c2 = new TCanvas(cname, "Reconstructed distributions, matched with tracks", 400, 400) ;
2391 c2->Divide(2, 2);
2392
2393 c2->cd(1) ;
8a587055 2394 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
9725fd2a 2395 fhECharged->SetLineColor(4);
2396 fhECharged->Draw();
2397
2398 c2->cd(2) ;
8a587055 2399 if(fhPtCharged->GetEntries() > 0) gPad->SetLogy();
9725fd2a 2400 fhPtCharged->SetLineColor(4);
2401 fhPtCharged->Draw();
2402
2403 c2->cd(3) ;
2404 fhPhiCharged->SetLineColor(4);
2405 fhPhiCharged->Draw();
2406
2407 c2->cd(4) ;
2408 fhEtaCharged->SetLineColor(4);
2409 fhEtaCharged->Draw();
2410
2411 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched.eps",fCalorimeter.Data());
8a587055 2412 c2->Print(name); printf("Plot: %s\n",name);
9725fd2a 2413
2414 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone("EChargedClone");
2415 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone("PtChargedClone");
2416 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone("EtaChargedClone");
2417 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone("PhiChargedClone");
06e5656a 2418
9725fd2a 2419 TH1F * hEChargedClone2 = (TH1F*) fhECharged->Clone("EChargedClone2");
2420 TH1F * hPtChargedClone2 = (TH1F*) fhPtCharged->Clone("PtChargedClone2");
2421 TH1F * hEtaChargedClone2 = (TH1F*) fhEtaCharged->Clone("EtaChargedClone2");
2422 TH1F * hPhiChargedClone2 = (TH1F*) fhPhiCharged->Clone("PhiChargedClone2");
06e5656a 2423
9725fd2a 2424 //Ratio: reconstructed track matched/ all reconstructed
2425 //printf("c3\n");
2426 sprintf(cname,"QA_%s_rectrackmatchrat",fCalorimeter.Data());
2427 TCanvas * c3 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
2428 c3->Divide(2, 2);
2429
2430 c3->cd(1) ;
8a587055 2431 if(hEChargedClone->GetEntries() > 0) gPad->SetLogy();
06e5656a 2432 hEChargedClone->SetTitleOffset(1.6,"Y");
2433 hEChargedClone->SetYTitle("track matched / all ");
2434 hEChargedClone->SetXTitle("E (GeV)");
9725fd2a 2435 hEChargedClone->Divide(fhE);
2436 hEChargedClone->Draw();
2437
2438 c3->cd(2) ;
8a587055 2439 if(hPtChargedClone->GetEntries() > 0) gPad->SetLogy();
06e5656a 2440 hPtChargedClone->SetTitleOffset(1.6,"Y");
2441 hPtChargedClone->SetYTitle("track matched / all ");
2442 hPtChargedClone->SetXTitle("p_{T} (GeV/c)");
9725fd2a 2443 hPtChargedClone->Divide(fhPt);
2444 hPtChargedClone->Draw();
2445
2446 c3->cd(3) ;
8a587055 2447 if(hPhiChargedClone->GetEntries() > 0) gPad->SetLogy();
06e5656a 2448 hPhiChargedClone->SetTitleOffset(1.6,"Y");
2449 hPhiChargedClone->SetYTitle("track matched / all ");
2450 hPhiChargedClone->SetXTitle("#phi (rad)");
9725fd2a 2451 hPhiChargedClone->Divide(fhPhi);
2452 hPhiChargedClone->Draw();
2453
2454 c3->cd(4) ;
8a587055 2455 if(hEtaChargedClone->GetEntries() > 0) gPad->SetLogy();
06e5656a 2456 hEtaChargedClone->SetTitleOffset(1.6,"Y");
2457 hEtaChargedClone->SetYTitle("track matched / all ");
2458 hEtaChargedClone->SetXTitle("#eta");
2459 hEtaChargedClone->Divide(fhEta);
9725fd2a 2460 hEtaChargedClone->Draw();
2461
2462 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributions.eps",fCalorimeter.Data());
8a587055 2463 c3->Print(name); printf("Plot: %s\n",name);
9725fd2a 2464
2465 //Ratio: reconstructed track matched (minus no track param) / all
06e5656a 2466 //printf("c3\n");
9725fd2a 2467 sprintf(cname,"QA_%s_rectrackmatchratout",fCalorimeter.Data());
2468 TCanvas * c333 = new TCanvas(cname, "Ratio: reconstructed track matched (with outer track param)/ all", 400, 400) ;
2469 c333->Divide(2, 2);
06e5656a 2470
9725fd2a 2471 c333->cd(1) ;
2472 hEChargedClone2->Add(fhEChargedNoOut,-1);
2473 hEChargedClone2->SetYTitle("track matched / all");
06e5656a 2474 hEChargedClone2->SetXTitle("E (GeV)");
9725fd2a 2475 hEChargedClone2->Divide(fhE);
2476 hEChargedClone2->Draw();
2477
2478 c333->cd(2) ;
2479 hPtChargedClone2->Add(fhPtChargedNoOut,-1);
2480 hPtChargedClone2->SetYTitle("track matched / all");
06e5656a 2481 hPtChargedClone2->SetXTitle("p_{T} (GeV/c)");
9725fd2a 2482 hPtChargedClone2->Divide(fhPt);
2483 hPtChargedClone2->Draw();
2484
2485 c333->cd(3) ;
2486 hPhiChargedClone2->Add(fhPhiChargedNoOut,-1);
2487 hPhiChargedClone2->SetYTitle("track matched / all");
06e5656a 2488 hPhiChargedClone2->SetXTitle("#phi (rad)");
9725fd2a 2489 hPhiChargedClone2->Divide(fhPhi);
2490 hPhiChargedClone2->Draw();
2491
2492 c333->cd(4) ;
2493 hEtaChargedClone2->Add(fhEtaChargedNoOut,-1);
2494 hEtaChargedClone2->SetYTitle("track matched / all");
06e5656a 2495 hEtaChargedClone2->SetXTitle("#eta");
9725fd2a 2496 hEtaChargedClone2->Divide(fhEta);
2497 hEtaChargedClone2->Draw();
2498
2499 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsOuter.eps",fCalorimeter.Data());
8a587055 2500 c333->Print(name); printf("Plot: %s\n",name);
06e5656a 2501
2502 //Reconstructed distributions, matched with tracks but no outer param
9725fd2a 2503 //printf("c2\n");
2504 sprintf(cname,"QA_%s_rectrackmatch_noout",fCalorimeter.Data());
2505 TCanvas * c22 = new TCanvas(cname, "Reconstructed distributions, matched with tracks, no outer track param", 400, 400) ;
2506 c22->Divide(2, 2);
2507
2508 c22->cd(1) ;
8a587055 2509 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
9725fd2a 2510 fhEChargedNoOut->SetLineColor(4);
2511 fhEChargedNoOut->Draw();
2512
2513 c22->cd(2) ;
8a587055 2514 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
9725fd2a 2515 fhPtChargedNoOut->SetLineColor(4);
2516 fhPtChargedNoOut->Draw();
2517
2518 c22->cd(3) ;
2519 fhPhiChargedNoOut->SetLineColor(4);
2520 fhPhiChargedNoOut->Draw();
2521
2522 c22->cd(4) ;
2523 fhEtaChargedNoOut->SetLineColor(4);
2524 fhEtaChargedNoOut->Draw();
2525
2526 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched_NoOutParam.eps",fCalorimeter.Data());
8a587055 2527 c22->Print(name); printf("Plot: %s\n",name);
9725fd2a 2528
2529 //Ratio: reconstructed track matched/ all reconstructed
06e5656a 2530 //printf("c3\n");
2531
2532// TH1F * hEChargedNoOutClone = (TH1F*) fhEChargedNoOut->Clone("EChargedNoOutClone");
2533// TH1F * hPtChargedNoOutClone = (TH1F*) fhPtChargedNoOut->Clone("PtChargedNoOutClone");
2534// TH1F * hEtaChargedNoOutClone = (TH1F*) fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
2535// TH1F * hPhiChargedNoOutClone = (TH1F*) fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");
2536
2537// sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
2538// TCanvas * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
2539// c33->Divide(2, 2);
2540//
2541// c33->cd(1) ;
2542// hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2543// hEChargedNoOutClone->SetXTitle("E (GeV)");
2544// hEChargedNoOutClone->Divide(fhECharged);
2545// hEChargedNoOutClone->Draw();
2546//
2547// c33->cd(2) ;
2548// hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
2549// hPtChargedNoOutClone->SetXTitle("p_{T} (GeV/c)");
2550// hPtChargedNoOutClone->Divide(fhPtCharged);
2551// hPtChargedNoOutClone->Draw();
2552//
2553// c33->cd(3) ;
2554// hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2555// hPhiChargedNoOutClone->SetXTitle("#phi (rad)");
2556// hPhiChargedNoOutClone->Divide(fhPhiCharged);
2557// hPhiChargedNoOutClone->Draw();
2558//
2559// c33->cd(4) ;
2560// hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
2561// hEtaChargedNoOutClone->SetXTitle("#eta");
2562// hEtaChargedNoOutClone->Divide(fhEtaCharged);
2563// hEtaChargedNoOutClone->Draw();
2564//
2565// sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
8a587055 2566// c33->Print(name); printf("Plot: %s\n",name);
06e5656a 2567
2568
9725fd2a 2569 //eta vs phi
2570 //printf("c4\n");
a5fafd85 2571 sprintf(cname,"QA_%s_etavsphivse",fCalorimeter.Data());
06e5656a 2572 // TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 600, 200) ;
2573 // c4->Divide(3, 1);
2574
a5fafd85 2575 TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi vs E", 600, 600) ;
2576 /*
2577 c4->Divide(3, 1);
06e5656a 2578
9725fd2a 2579 c4->cd(1) ;
a5fafd85 2580 fhEtaPhi->Draw("contz");
2581 c4->cd(2) ;
2582 fhEtaPhiE->Draw();
2583 c4->cd(3) ;
2584 fhEtaPhiCharged->Draw("contz");
2585 //c4->Divide(3, 1);
2586 */
2587 {gStyle->SetOptStat(0);
2588 fhEtaPhi->Draw("contz");}
2589 //fhEtaPhiE->Draw();
9725fd2a 2590
9725fd2a 2591
06e5656a 2592 // c4->cd(3) ;
2593 // fhEtaPhiChargedNoOut->Draw("cont");
2594
a5fafd85 2595 sprintf(name,"QA_%s_ReconstructedEtaVsPhiVsE.eps",fCalorimeter.Data());
8a587055 2596 c4->Print(name); printf("Plot: %s\n",name);
9725fd2a 2597
2598 //Invariant mass
2599 Int_t binmin = -1;
2600 Int_t binmax = -1;
06e5656a 2601
9725fd2a 2602 if(fhIM->GetEntries() > 1){
2603 Int_t nebins = fhIM->GetNbinsX();
2604 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
2605 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
2606 if (emin != 0 ) printf("emin != 0 \n");
2607 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2608
2609 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
06e5656a 2610 // printf("c5\n");
a5fafd85 2611 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
2612 c5->Divide(2, 3);
9725fd2a 2613
2614 c5->cd(1) ;
a5fafd85 2615 //fhIM->SetLineColor(4);
2616 //fhIM->Draw();
2617 binmin = 0;
2618 binmax = (Int_t) (1-emin)*nebins/emax;
2619 TH1D *pyim1 = fhIM->ProjectionY("pyim1",binmin,binmax);
2620 pyim1->SetTitle("E_{pair} < 1 GeV");
2621 pyim1->SetLineColor(1);
2622 pyim1->Draw();
2623 TLegend pLegendIM(0.7,0.6,0.9,0.8);
2624 pLegendIM.SetTextSize(0.03);
2625 pLegendIM.AddEntry(pyim1,"all modules","L");
2626 pLegendIM.SetFillColor(10);
2627 pLegendIM.SetBorderSize(1);
2628 for(Int_t imod = 0; imod < fNModules; imod++){
2629 pyim1 = fhIMMod[imod]->ProjectionY(Form("pyim1_%d",imod),binmin,binmax);
2630 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
2631 pyim1->SetLineColor(imod+1);
2632 pyim1->Draw("same");
2633 }
2634 pLegendIM.Draw();
9725fd2a 2635
2636 c5->cd(2) ;
a5fafd85 2637 binmin = (Int_t) (1-emin)*nebins/emax;
2638 binmax = (Int_t) (2-emin)*nebins/emax;
2639 TH1D *pyim2 = fhIM->ProjectionY("pyim2",binmin,binmax);
2640 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
2641 pyim2->SetLineColor(1);
2642 pyim2->Draw();
2643 for(Int_t imod = 0; imod < fNModules; imod++){
2644 pyim2 = fhIMMod[imod]->ProjectionY(Form("pyim2_%d",imod),binmin,binmax);
2645 pyim2->SetLineColor(imod+1);
2646 pyim2->Draw("same");
2647 }
2648
2649 c5->cd(3) ;
2650 binmin = (Int_t) (2-emin)*nebins/emax;
2651 binmax = (Int_t) (3-emin)*nebins/emax;
2652 TH1D *pyim3 = fhIM->ProjectionY("pyim3",binmin,binmax);
2653 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
2654 pyim3->SetLineColor(1);
2655 pyim3->Draw();
2656 for(Int_t imod = 0; imod < fNModules; imod++){
2657 pyim3 = fhIMMod[imod]->ProjectionY(Form("pyim3_%d",imod),binmin,binmax);
2658 pyim3->SetLineColor(imod+1);
2659 pyim3->Draw("same");
2660 }
2661
2662 c5->cd(4) ;
2663 binmin = (Int_t) (3-emin)*nebins/emax;
2664 binmax = (Int_t) (4-emin)*nebins/emax;
2665 TH1D *pyim4 = fhIM->ProjectionY("pyim4",binmin,binmax);
2666 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
2667 pyim4->SetLineColor(1);
2668 pyim4->Draw();
2669 for(Int_t imod = 0; imod < fNModules; imod++){
2670 pyim4 = fhIMMod[imod]->ProjectionY(Form("pyim4_%d",imod),binmin,binmax);
2671 pyim4->SetLineColor(imod+1);
2672 pyim4->Draw("same");
2673 }
2674
2675 c5->cd(5) ;
2676 binmin = (Int_t) (4-emin)*nebins/emax;
578e3787 2677 binmax = (Int_t) (5-emin)*nebins/emax;
9725fd2a 2678 TH1D *pyim5 = fhIM->ProjectionY("pyim5",binmin,binmax);
a5fafd85 2679 pyim5->SetTitle("4< E_{pair} < 5 GeV");
2680 pyim5->SetLineColor(1);
9725fd2a 2681 pyim5->Draw();
a5fafd85 2682 for(Int_t imod = 0; imod < fNModules; imod++){
2683 pyim5 = fhIMMod[imod]->ProjectionY(Form("pyim5_%d",imod),binmin,binmax);
2684 pyim5->SetLineColor(imod+1);
2685 pyim5->Draw("same");
2686 }
9725fd2a 2687
a5fafd85 2688 c5->cd(6) ;
578e3787 2689 binmin = (Int_t) (5-emin)*nebins/emax;
a5fafd85 2690 binmax = -1;
9725fd2a 2691 TH1D *pyim10 = fhIM->ProjectionY("pyim10",binmin,binmax);
a5fafd85 2692 pyim10->SetTitle("E_{pair} > 5 GeV");
2693 pyim10->SetLineColor(1);
9725fd2a 2694 pyim10->Draw();
a5fafd85 2695 for(Int_t imod = 0; imod < fNModules; imod++){
2696 pyim10 = fhIMMod[imod]->ProjectionY(Form("pyim10_%d",imod),binmin,binmax);
2697 pyim10->SetLineColor(imod+1);
2698 pyim10->Draw("same");
2699 }
9725fd2a 2700
2701 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
8a587055 2702 c5->Print(name); printf("Plot: %s\n",name);
9725fd2a 2703 }
2704
a5fafd85 2705
2706 if(fhIMCellCut->GetEntries() > 1){
2707 Int_t nebins = fhIMCellCut->GetNbinsX();
2708 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
2709 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
2710 if (emin != 0 ) printf("emin != 0 \n");
2711 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2712
2713 sprintf(cname,"QA_%s_IMCellCut",fCalorimeter.Data());
2714 // printf("c5cc\n");
2715 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
2716 c5cc->Divide(2, 3);
2717
2718 c5cc->cd(1) ;
2719 //fhIMCellCut->SetLineColor(4);
2720 //fhIMCellCut->Draw();
2721 binmin = 0;
2722 binmax = (Int_t) (1-emin)*nebins/emax;
2723 TH1D *pyimcc1 = fhIMCellCut->ProjectionY("pyimcc1",binmin,binmax);
2724 pyimcc1->SetTitle("E_{pair} < 1 GeV");
2725 pyimcc1->SetLineColor(1);
2726 pyimcc1->Draw();
2727 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
2728 pLegendIMCellCut.SetTextSize(0.03);
2729 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
2730 pLegendIMCellCut.SetFillColor(10);
2731 pLegendIMCellCut.SetBorderSize(1);
2732 for(Int_t imod = 0; imod < fNModules; imod++){
2733 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc1_%d",imod),binmin,binmax);
2734 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
2735 pyimcc1->SetLineColor(imod+1);
2736 pyimcc1->Draw("same");
2737 }
2738 pLegendIMCellCut.Draw();
2739
2740 c5cc->cd(2) ;
2741 binmin = (Int_t) (1-emin)*nebins/emax;
2742 binmax = (Int_t) (2-emin)*nebins/emax;
2743 TH1D *pyimcc2 = fhIMCellCut->ProjectionY("pyimcc2",binmin,binmax);
2744 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
2745 pyimcc2->SetLineColor(1);
2746 pyimcc2->Draw();
2747 for(Int_t imod = 0; imod < fNModules; imod++){
2748 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc2_%d",imod),binmin,binmax);
2749 pyimcc2->SetLineColor(imod+1);
2750 pyimcc2->Draw("same");
2751 }
2752
2753 c5cc->cd(3) ;
2754 binmin = (Int_t) (2-emin)*nebins/emax;
2755 binmax = (Int_t) (3-emin)*nebins/emax;
2756 TH1D *pyimcc3 = fhIMCellCut->ProjectionY("pyimcc3",binmin,binmax);
2757 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
2758 pyimcc3->SetLineColor(1);
2759 pyimcc3->Draw();
2760 for(Int_t imod = 0; imod < fNModules; imod++){
2761 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc3_%d",imod),binmin,binmax);
2762 pyimcc3->SetLineColor(imod+1);
2763 pyimcc3->Draw("same");
2764 }
2765
2766 c5cc->cd(4) ;
2767 binmin = (Int_t) (3-emin)*nebins/emax;
2768 binmax = (Int_t) (4-emin)*nebins/emax;
2769 TH1D *pyimcc4 = fhIMCellCut->ProjectionY("pyimcc4",binmin,binmax);
2770 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
2771 pyimcc4->SetLineColor(1);
2772 pyimcc4->Draw();
2773 for(Int_t imod = 0; imod < fNModules; imod++){
2774 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc4_%d",imod),binmin,binmax);
2775 pyimcc4->SetLineColor(imod+1);
2776 pyimcc4->Draw("same");
2777 }
2778
2779 c5cc->cd(5) ;
2780 binmin = (Int_t) (4-emin)*nebins/emax;
2781 binmax = (Int_t) (5-emin)*nebins/emax;
2782 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY("pyimcc5cc",binmin,binmax);
2783 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
2784 pyimcc5cc->SetLineColor(1);
2785 pyimcc5cc->Draw();
2786 for(Int_t imod = 0; imod < fNModules; imod++){
2787 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc5cc_%d",imod),binmin,binmax);
2788 pyimcc5cc->SetLineColor(imod+1);
2789 pyimcc5cc->Draw("same");
2790 }
2791
2792 c5cc->cd(6) ;
2793 binmin = (Int_t) (5-emin)*nebins/emax;
2794 binmax = -1;
2795 TH1D *pyimcc10 = fhIMCellCut->ProjectionY("pyimcc10",binmin,binmax);
2796 pyimcc10->SetTitle("E_{pair} > 5 GeV");
2797 pyimcc10->SetLineColor(1);
2798 pyimcc10->Draw();
2799 for(Int_t imod = 0; imod < fNModules; imod++){
2800 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc10_%d",imod),binmin,binmax);
2801 pyimcc10->SetLineColor(imod+1);
2802 pyimcc10->Draw("same");
2803 }
2804
2805 sprintf(name,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
2806 c5cc->Print(name); printf("Plot: %s\n",name);
2807 }
2808
2809
9725fd2a 2810 //Asymmetry
2811 if(fhAsym->GetEntries() > 1){
2812 Int_t nebins = fhAsym->GetNbinsX();
2813 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
2814 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
2815 if (emin != 0 ) printf("emin != 0 \n");
2816 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
2817
2818 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
2819 // printf("c5\n");
2820 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
2821 c5b->Divide(2, 2);
2822
2823 c5b->cd(1) ;
06e5656a 2824 fhAsym->SetTitleOffset(1.6,"Y");
9725fd2a 2825 fhAsym->SetLineColor(4);
2826 fhAsym->Draw();
2827
2828 c5b->cd(2) ;
2829 binmin = 0;
2830 binmax = (Int_t) (5-emin)*nebins/emax;
2831 TH1D *pyAsym5 = fhAsym->ProjectionY("pyAsym5",binmin,binmax);
2832 pyAsym5->SetTitle("E_{pair} < 5 GeV");
2833 pyAsym5->SetLineColor(4);
2834 pyAsym5->Draw();
2835
2836 c5b->cd(3) ;
2837 binmin = (Int_t) (5-emin)*nebins/emax;
2838 binmax = (Int_t) (10-emin)*nebins/emax;
2839 TH1D *pyAsym510 = fhAsym->ProjectionY("pyAsym5_10",binmin,binmax);
2840 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
2841 pyAsym510->SetLineColor(4);
2842 pyAsym510->Draw();
2843
2844 c5b->cd(4) ;
2845 binmin = (Int_t) (10-emin)*nebins/emax;
2846 binmax = -1;
2847 TH1D *pyAsym10 = fhAsym->ProjectionY("pyAsym10",binmin,binmax);
2848 pyAsym10->SetTitle("E_{pair} > 10 GeV");
2849 pyAsym10->SetLineColor(4);
2850 pyAsym10->Draw();
2851
2852 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
8a587055 2853 c5b->Print(name); printf("Plot: %s\n",name);
9725fd2a 2854 }
2855
a5fafd85 2856 //Grid of cell per module plots
2857 {
2858 gStyle->SetOptStat(0);
2859 sprintf(cname,"QA_%s_GridCellEntries",fCalorimeter.Data());
2860 // printf("c5\n");
2861 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
2862 if(fNModules%2 == 0)
2863 cgrid->Divide(fNModules/2,2);
2864 else
2865 cgrid->Divide(fNModules/2+1,2);
2866
2867 for(Int_t imod = 0; imod < fNModules ; imod++){
2868 cgrid->cd(imod+1);
2869 gPad->SetLogz();
2870 gPad->SetGridy();
2871 gPad->SetGridx();
2872 fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
2873 fhGridCellsMod[imod]->Draw("colz");
2874 }
2875 sprintf(name,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
2876 cgrid->Print(name); printf("Plot: %s\n",name);
2877
2878 sprintf(cname,"QA_%s_GridCellAccumEnergy",fCalorimeter.Data());
2879 // printf("c5\n");
2880 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
2881 cgridE->Divide(fNModules/2,2);
2882 for(Int_t imod = 0; imod < fNModules ; imod++){
2883 cgridE->cd(imod+1);
2884 gPad->SetLogz();
2885 gPad->SetGridy();
2886 gPad->SetGridx();
2887 fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
2888 fhGridCellsEMod[imod]->Draw("colz");
2889 }
2890 sprintf(name,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
2891 cgridE->Print(name); printf("Plot: %s\n",name);
2892
2893 sprintf(cname,"QA_%s_GridCellAverageEnergy",fCalorimeter.Data());
2894 // printf("c5\n");
2895 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
2896 cgridEA->Divide(fNModules/2,2);
2897 for(Int_t imod = 0; imod < fNModules ; imod++){
2898 cgridEA->cd(imod+1);
2899 gPad->SetLogz();
2900 gPad->SetGridy();
2901 gPad->SetGridx();
2902 fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
2903 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
2904 fhGridCellsEMod[imod]->Draw("colz");
2905 }
2906 sprintf(name,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
2907 cgridEA->Print(name); printf("Plot: %s\n",name);
2908
2909 }
2910
8a587055 2911 if(IsDataMC()){
9725fd2a 2912 //Reconstructed vs MC distributions
2913 //printf("c6\n");
2914 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
2915 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
2916 c6->Divide(2, 2);
2917
2918 c6->cd(1) ;
06e5656a 2919 fh2E->SetTitleOffset(1.6,"Y");
9725fd2a 2920 fh2E->SetLineColor(4);
2921 fh2E->Draw();
2922
2923 c6->cd(2) ;
06e5656a 2924 fh2Pt->SetTitleOffset(1.6,"Y");
9725fd2a 2925 fh2Pt->SetLineColor(4);
2926 fh2Pt->Draw();
2927
2928 c6->cd(3) ;
06e5656a 2929 fh2Phi->SetTitleOffset(1.6,"Y");
9725fd2a 2930 fh2Phi->SetLineColor(4);
2931 fh2Phi->Draw();
2932
2933 c6->cd(4) ;
06e5656a 2934 fh2Eta->SetTitleOffset(1.6,"Y");
9725fd2a 2935 fh2Eta->SetLineColor(4);
2936 fh2Eta->Draw();
2937
2938 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
8a587055 2939 c6->Print(name); printf("Plot: %s\n",name);
9725fd2a 2940
9725fd2a 2941 //Reconstructed vs MC distributions
2942 //printf("c6\n");
2943 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
2944 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
2945 c6Gam->Divide(2, 2);
2946
2947 c6Gam->cd(1) ;
06e5656a 2948 fhGamE->Draw();
9725fd2a 2949
2950 c6Gam->cd(2) ;
06e5656a 2951 fhGamPt->Draw();
9725fd2a 2952
2953 c6Gam->cd(3) ;
06e5656a 2954 fhGamPhi->Draw();
9725fd2a 2955
2956 c6Gam->cd(4) ;
06e5656a 2957 fhGamEta->Draw();
9725fd2a 2958
2959 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
8a587055 2960 c6->Print(name); printf("Plot: %s\n",name);
06e5656a 2961
9725fd2a 2962 //Generated - reconstructed
2963 //printf("c7\n");
2964 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
2965 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
2966 c7->Divide(2, 2);
2967
2968 c7->cd(1) ;
8a587055 2969 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
9725fd2a 2970 fhGamDeltaE->SetLineColor(4);
2971 fhDeltaE->Draw();
2972 fhGamDeltaE->Draw("same");
06e5656a 2973
9725fd2a 2974 TLegend pLegendd(0.65,0.55,0.9,0.8);
2975 pLegendd.SetTextSize(0.06);
2976 pLegendd.AddEntry(fhDeltaE,"all","L");
2977 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
2978 pLegendd.SetFillColor(10);
2979 pLegendd.SetBorderSize(1);
2980 pLegendd.Draw();
06e5656a 2981
9725fd2a 2982 c7->cd(2) ;
8a587055 2983 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
9725fd2a 2984 fhGamDeltaPt->SetLineColor(4);
2985 fhDeltaPt->Draw();
06e5656a 2986 fhGamDeltaPt->Draw("same");
2987
9725fd2a 2988 c7->cd(3) ;
2989 fhGamDeltaPhi->SetLineColor(4);
2990 fhDeltaPhi->Draw();
06e5656a 2991 fhGamDeltaPhi->Draw("same");
9725fd2a 2992
2993 c7->cd(4) ;
2994 fhGamDeltaEta->SetLineColor(4);
2995 fhDeltaEta->Draw();
2996 fhGamDeltaEta->Draw("same");
06e5656a 2997
9725fd2a 2998 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
8a587055 2999 c7->Print(name); printf("Plot: %s\n",name);
9725fd2a 3000
9725fd2a 3001 // Reconstructed / Generated
3002 //printf("c8\n");
3003 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
3004 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
3005 c8->Divide(2, 2);
3006
3007 c8->cd(1) ;
8a587055 3008 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
9725fd2a 3009 fhGamRatioE->SetLineColor(4);
3010 fhRatioE->Draw();
3011 fhGamRatioE->Draw("same");
06e5656a 3012
9725fd2a 3013 TLegend pLegendr(0.65,0.55,0.9,0.8);
3014 pLegendr.SetTextSize(0.06);
3015 pLegendr.AddEntry(fhRatioE,"all","L");
3016 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
3017 pLegendr.SetFillColor(10);
3018 pLegendr.SetBorderSize(1);
3019 pLegendr.Draw();
06e5656a 3020
9725fd2a 3021 c8->cd(2) ;
8a587055 3022 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
9725fd2a 3023 fhGamRatioPt->SetLineColor(4);
3024 fhRatioPt->Draw();
06e5656a 3025 fhGamRatioPt->Draw("same");
3026
9725fd2a 3027 c8->cd(3) ;
3028 fhGamRatioPhi->SetLineColor(4);
3029 fhRatioPhi->Draw();
06e5656a 3030 fhGamRatioPhi->Draw("same");
3031
9725fd2a 3032 c8->cd(4) ;
3033 fhGamRatioEta->SetLineColor(4);
3034 fhRatioEta->Draw();
06e5656a 3035 fhGamRatioEta->Draw("same");
3036
9725fd2a 3037 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
8a587055 3038 c8->Print(name); printf("Plot: %s\n",name);
9725fd2a 3039
3040 //MC
3041
3042 //Generated distributions
3043 //printf("c1\n");
3044 sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
3045 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
3046 c10->Divide(3, 1);
3047
3048 c10->cd(1) ;
3049 gPad->SetLogy();
3050 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone("axispt");
3051 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
3052 fhGenPi0Pt->SetLineColor(1);
3053 fhGenGamPt->SetLineColor(4);
3054 fhGenEtaPt->SetLineColor(2);
3055 fhGenOmegaPt->SetLineColor(7);
3056 fhGenElePt->SetLineColor(6);
3057
3058 //Select the maximum of the histogram to show all lines.
3059 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3060 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
3061 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
3062 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
06e5656a 3063 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
9725fd2a 3064 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
3065 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
3066 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
3067 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
3068 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3069 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
3070 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
3071 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
3072 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
3073 haxispt->SetMaximum(fhGenElePt->GetMaximum());
06e5656a 3074 haxispt->SetMinimum(1);
9725fd2a 3075 haxispt->Draw("axis");
3076 fhGenPi0Pt->Draw("same");
3077 fhGenGamPt->Draw("same");
3078 fhGenEtaPt->Draw("same");
3079 fhGenOmegaPt->Draw("same");
3080 fhGenElePt->Draw("same");
3081
06e5656a 3082 TLegend pLegend(0.85,0.65,0.95,0.93);
9725fd2a 3083 pLegend.SetTextSize(0.06);
06e5656a 3084 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
3085 pLegend.AddEntry(fhGenGamPt," #gamma","L");
3086 pLegend.AddEntry(fhGenEtaPt," #eta","L");
3087 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
3088 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
9725fd2a 3089 pLegend.SetFillColor(10);
3090 pLegend.SetBorderSize(1);
3091 pLegend.Draw();
3092
3093 c10->cd(2) ;
3094 gPad->SetLogy();
3095 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone("axiseta");
3096 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
3097 fhGenPi0Eta->SetLineColor(1);
3098 fhGenGamEta->SetLineColor(4);
3099 fhGenEtaEta->SetLineColor(2);
3100 fhGenOmegaEta->SetLineColor(7);
3101 fhGenEleEta->SetLineColor(6);
3102 //Select the maximum of the histogram to show all lines.
3103 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3104 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
3105 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
3106 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3107 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3108 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
3109 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
3110 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3111 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
3112 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3113 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
3114 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
3115 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
3116 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
3117 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
06e5656a 3118 haxiseta->SetMinimum(100);
9725fd2a 3119 haxiseta->Draw("axis");
3120 fhGenPi0Eta->Draw("same");
3121 fhGenGamEta->Draw("same");
3122 fhGenEtaEta->Draw("same");
3123 fhGenOmegaEta->Draw("same");
3124 fhGenEleEta->Draw("same");
3125
3126
3127 c10->cd(3) ;
3128 gPad->SetLogy();
3129 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone("axisphi");
3130 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
3131 fhGenPi0Phi->SetLineColor(1);
3132 fhGenGamPhi->SetLineColor(4);
3133 fhGenEtaPhi->SetLineColor(2);
3134 fhGenOmegaPhi->SetLineColor(7);
3135 fhGenElePhi->SetLineColor(6);
3136 //Select the maximum of the histogram to show all lines.
3137 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3138 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
3139 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
3140 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3141 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3142 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
3143 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
3144 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3145 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
3146 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3147 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
3148 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
3149 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
3150 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
3151 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
06e5656a 3152 haxisphi->SetMinimum(100);
9725fd2a 3153 haxisphi->Draw("axis");
3154 fhGenPi0Phi->Draw("same");
3155 fhGenGamPhi->Draw("same");
3156 fhGenEtaPhi->Draw("same");
3157 fhGenOmegaPhi->Draw("same");
3158 fhGenElePhi->Draw("same");
3159
3160 sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
8a587055 3161 c10->Print(name); printf("Plot: %s\n",name);
9725fd2a 3162
3163
3164 //Reconstructed clusters depending on its original particle.
3165 //printf("c1\n");
3166 sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
3167 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
3168 c11->Divide(2, 2);
3169
3170
3171 c11->cd(1) ;
3172 gPad->SetLogy();
06e5656a 3173 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX("hGamE",-1,-1);
3174 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX("hPi0E",-1,-1);
3175 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX("hEleE",-1,-1);
3176 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX("hNeHadE",-1,-1);
3177 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX("hChHadE",-1,-1);
9725fd2a 3178 TH1F * haxisE = (TH1F*) hPi0E->Clone("axisE");
3179 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
3180 hPi0E->SetLineColor(1);
3181 hGamE->SetLineColor(4);
3182 hNeHadE->SetLineColor(2);
3183 hChHadE->SetLineColor(7);
3184 hEleE->SetLineColor(6);
3185
3186 //Select the maximum of the histogram to show all lines.
3187 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
3188 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
3189 haxisE->SetMaximum(hPi0E->GetMaximum());
3190 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
3191 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
3192 haxisE->SetMaximum(hGamE->GetMaximum());
3193 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
3194 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
3195 haxisE->SetMaximum(hNeHadE->GetMaximum());
3196 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
3197 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
3198 haxisE->SetMaximum(hChHadE->GetMaximum());
3199 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
3200 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
3201 haxisE->SetMaximum(hEleE->GetMaximum());
06e5656a 3202 haxisE->SetXTitle("E (GeV)");
3203 haxisE->SetMinimum(1);
9725fd2a 3204 haxisE->Draw("axis");
3205 hPi0E->Draw("same");
3206 hGamE->Draw("same");
3207 hNeHadE->Draw("same");
3208 hChHadE->Draw("same");
3209 hEleE->Draw("same");
3210
06e5656a 3211 TLegend pLegend2(0.8,0.65,0.95,0.93);
9725fd2a 3212 pLegend2.SetTextSize(0.06);
06e5656a 3213 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
3214 pLegend2.AddEntry(hGamE," #gamma","L");
3215 pLegend2.AddEntry(hEleE," e^{#pm}","L");
3216 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
3217 pLegend2.AddEntry(hNeHadE," h^{0}","L");
9725fd2a 3218 pLegend2.SetFillColor(10);
3219 pLegend2.SetBorderSize(1);
3220 pLegend2.Draw();
3221
3222
3223 c11->cd(2) ;
3224 gPad->SetLogy();
3225 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
06e5656a 3226 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX("hGamPt",-1,-1);
3227 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX("hPi0Pt",-1,-1);
3228 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX("hElePt",-1,-1);
3229 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX("hNeHadPt",-1,-1);
3230 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX("hChHadPt",-1,-1);
9725fd2a 3231 haxispt = (TH1F*) hPi0Pt->Clone("axispt");
3232 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
3233 hPi0Pt->SetLineColor(1);
3234 hGamPt->SetLineColor(4);
3235 hNeHadPt->SetLineColor(2);
3236 hChHadPt->SetLineColor(7);
3237 hElePt->SetLineColor(6);
3238
3239 //Select the maximum of the histogram to show all lines.
3240 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3241 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
3242 haxispt->SetMaximum(hPi0Pt->GetMaximum());
3243 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3244 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
3245 haxispt->SetMaximum(hGamPt->GetMaximum());
3246 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
3247 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
3248 haxispt->SetMaximum(hNeHadPt->GetMaximum());
3249 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3250 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
3251 haxispt->SetMaximum(hChHadPt->GetMaximum());
3252 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
3253 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
3254 haxispt->SetMaximum(hElePt->GetMaximum());
06e5656a 3255 haxispt->SetXTitle("p_{T} (GeV/c)");
3256 haxispt->SetMinimum(1);
9725fd2a 3257 haxispt->Draw("axis");
3258 hPi0Pt->Draw("same");
3259 hGamPt->Draw("same");
3260 hNeHadPt->Draw("same");
3261 hChHadPt->Draw("same");
06e5656a 3262 hElePt->Draw("same");
9725fd2a 3263
3264
3265 c11->cd(3) ;
3266 gPad->SetLogy();
06e5656a 3267
3268 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX("hGamEta",-1,-1);
3269 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX("hPi0Eta",-1,-1);
3270 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX("hEleEta",-1,-1);
3271 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX("hNeHadEta",-1,-1);
3272 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX("hChHadEta",-1,-1);
9725fd2a 3273 haxiseta = (TH1F*) hPi0Eta->Clone("axiseta");
3274 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
3275 hPi0Eta->SetLineColor(1);
3276 hGamEta->SetLineColor(4);
3277 hNeHadEta->SetLineColor(2);
3278 hChHadEta->SetLineColor(7);
3279 hEleEta->SetLineColor(6);
3280 //Select the maximum of the histogram to show all lines.
3281 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3282 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
3283 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
3284 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3285 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
3286 haxiseta->SetMaximum(hGamEta->GetMaximum());
3287 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
3288 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
3289 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
3290 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3291 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
3292 haxiseta->SetMaximum(hChHadEta->GetMaximum());
3293 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
3294 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
3295 haxiseta->SetMaximum(hEleEta->GetMaximum());
3296
06e5656a 3297 haxiseta->SetXTitle("#eta");
9725fd2a 3298 haxiseta->Draw("axis");
3299 hPi0Eta->Draw("same");
3300 hGamEta->Draw("same");
3301 hNeHadEta->Draw("same");
3302 hChHadEta->Draw("same");
3303 hEleEta->Draw("same");
3304
3305
3306 c11->cd(4) ;
3307 gPad->SetLogy();
06e5656a 3308 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX("hGamPhi",-1,-1);
3309 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX("hPi0Phi",-1,-1);
3310 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX("hElePhi",-1,-1);
3311 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX("hNeHadPhi",-1,-1);
3312 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX("hChHadPhi",-1,-1);
9725fd2a 3313 haxisphi = (TH1F*) hPi0Phi->Clone("axisphi");
3314 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
06e5656a 3315
9725fd2a 3316 hPi0Phi->SetLineColor(1);
3317 hGamPhi->SetLineColor(4);
3318 hNeHadPhi->SetLineColor(2);
3319 hChHadPhi->SetLineColor(7);
3320 hElePhi->SetLineColor(6);
3321 //Select the maximum of the histogram to show all lines.
3322 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3323 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
3324 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
3325 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3326 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
3327 haxisphi->SetMaximum(hGamPhi->GetMaximum());
3328 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
3329 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
3330 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
3331 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3332 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
3333 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
3334 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
3335 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
3336 haxisphi->SetMaximum(hElePhi->GetMaximum());
06e5656a 3337 haxisphi->SetXTitle("#phi (rad)");
9725fd2a 3338 haxisphi->Draw("axis");
3339 hPi0Phi->Draw("same");
3340 hGamPhi->Draw("same");
3341 hNeHadPhi->Draw("same");
3342 hChHadPhi->Draw("same");
3343 hElePhi->Draw("same");
3344
3345 sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
8a587055 3346 c11->Print(name); printf("Plot: %s\n",name);
9725fd2a 3347
3348
3349 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
06e5656a 3350 //printf("c1\n");
9725fd2a 3351
3352 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone("hPi0EClone");
3353 TH1F * hGamEClone = (TH1F*) hGamE ->Clone("hGamEClone");
3354 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone("hPi0PtClone");
3355 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone("hGamPtClone");
3356 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone("hPi0EtaClone");
3357 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone("hGamEtaClone");
3358 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone("hPi0PhiClone");
06e5656a 3359 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone("hGamPhiClone");
3360
9725fd2a 3361 sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
3362 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
3363 c12->Divide(2, 2);
3364
3365 c12->cd(1) ;
3366 gPad->SetLogy();
3367 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3368 hPi0EClone->Divide(fhGenPi0AccE);
3369 hGamEClone->Divide(fhGenGamAccE);
06e5656a 3370 haxisE->SetMaximum(5);
3371 haxisE->SetMinimum(1e-2);
3372 haxisE->SetXTitle("E (GeV)");
9725fd2a 3373 haxisE->SetYTitle("ratio = rec/gen");
3374 haxisE->Draw("axis");
06e5656a 3375 hPi0E->Draw("same");
3376 hGamE->Draw("same");
9725fd2a 3377
06e5656a 3378 TLegend pLegend3(0.75,0.2,0.9,0.4);
9725fd2a 3379 pLegend3.SetTextSize(0.06);
06e5656a 3380 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
3381 pLegend3.AddEntry(hGamEClone," #gamma","L");
9725fd2a 3382 pLegend3.SetFillColor(10);
3383 pLegend3.SetBorderSize(1);
3384 pLegend3.Draw();
3385
3386 c12->cd(2) ;
3387 gPad->SetLogy();
3388 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3389 hPi0PtClone->Divide(fhGenPi0AccPt);
3390 hGamPtClone->Divide(fhGenGamAccPt);
06e5656a 3391 haxispt->SetMaximum(5);
3392 haxispt->SetMinimum(1e-2);
3393 haxispt->SetXTitle("p_{T} (GeV/c)");
9725fd2a 3394 haxispt->SetYTitle("ratio = rec/gen");
3395 haxispt->Draw("axis");
9725fd2a 3396 hPi0PtClone->Draw("same");
3397 hGamPtClone->Draw("same");
3398
3399 c12->cd(3) ;
3400 gPad->SetLogy();
3401
3402 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3403 hPi0EtaClone->Divide(fhGenPi0AccEta);
3404 hGamEtaClone->Divide(fhGenGamAccEta);
3405 haxiseta->SetMaximum(1.2);
06e5656a 3406 haxiseta->SetMinimum(1e-2);
9725fd2a 3407 haxiseta->SetYTitle("ratio = rec/gen");
06e5656a 3408 haxiseta->SetXTitle("#eta");
9725fd2a 3409 haxiseta->Draw("axis");
9725fd2a 3410 hPi0EtaClone->Draw("same");
3411 hGamEtaClone->Draw("same");
3412
3413
3414 c12->cd(4) ;
3415 gPad->SetLogy();
3416 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
3417 hPi0PhiClone->Divide(fhGenPi0AccPhi);
3418 hGamPhiClone->Divide(fhGenGamAccPhi);
06e5656a 3419 haxisphi->SetYTitle("ratio = rec/gen");
3420 haxisphi->SetXTitle("#phi (rad)");
9725fd2a 3421 haxisphi->SetMaximum(1.2);
06e5656a 3422 haxisphi->SetMinimum(1e-2);
9725fd2a 3423 haxisphi->Draw("axis");
9725fd2a 3424 hPi0PhiClone->Draw("same");
3425 hGamPhiClone->Draw("same");
3426
9725fd2a 3427 sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
8a587055 3428 c12->Print(name); printf("Plot: %s\n",name);
3429
9725fd2a 3430
3431
3432 //Reconstructed distributions
3433 //printf("c1\n");
3434 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
3435 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
3436 c13->Divide(2, 2);
3437
3438 c13->cd(1) ;
3439 //gPad->SetLogy();
06e5656a 3440 fhEMVxyz->SetTitleOffset(1.6,"Y");
3441 fhEMVxyz->Draw();
9725fd2a 3442
3443 c13->cd(2) ;
3444 //gPad->SetLogy();
06e5656a 3445 fhHaVxyz->SetTitleOffset(1.6,"Y");
9725fd2a 3446 fhHaVxyz->Draw();
3447
3448 c13->cd(3) ;
3449 gPad->SetLogy();
3450 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY("hEM",-1,-1);
3451 hEMR->SetLineColor(4);
3452 hEMR->Draw();
3453
3454 c13->cd(4) ;
3455 gPad->SetLogy();
3456 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY("hHa",-1,-1);
3457 hHaR->SetLineColor(4);
3458 hHaR->Draw();
3459
3460
3461 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
8a587055 3462 c13->Print(name); printf("Plot: %s\n",name);
9725fd2a 3463
3464
06e5656a 3465 //Track-matching distributions
8a587055 3466
06e5656a 3467 //Reconstructed distributions, matched with tracks, generated particle dependence
3468 //printf("c2\n");
3469 sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
3470 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
3471 c22ch->Divide(2, 2);
3472
3473 c22ch->cd(1) ;
3474
3475 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX("hGamECharged",-1,-1);
3476 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX("hPi0ECharged",-1,-1);
3477 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX("hEleECharged",-1,-1);
3478 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX("hNeHadECharged",-1,-1);
3479 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX("hChHadECharged",-1,-1);
3480 hPi0ECharged->SetLineColor(1);
3481 hGamECharged->SetLineColor(4);
3482 hNeHadECharged->SetLineColor(2);
3483 hChHadECharged->SetLineColor(7);
3484 hEleECharged->SetLineColor(6);
3485 gPad->SetLogy();
3486 fhECharged->SetLineColor(3);
3487 fhECharged->SetMinimum(0.5);
3488 fhECharged->Draw();
3489 hPi0ECharged->Draw("same");
3490 hGamECharged->Draw("same");
3491 hNeHadECharged->Draw("same");
3492 hChHadECharged->Draw("same");
3493 hEleECharged->Draw("same");
3494 TLegend pLegend22(0.75,0.45,0.9,0.8);
3495 pLegend22.SetTextSize(0.06);
3496 pLegend22.AddEntry(fhECharged,"all","L");
3497 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
3498 pLegend22.AddEntry(hGamECharged,"#gamma","L");
3499 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
3500 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
3501 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
3502 pLegend22.SetFillColor(10);
3503 pLegend22.SetBorderSize(1);
3504 pLegend22.Draw();
3505
3506 c22ch->cd(2) ;
3507
3508 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX("hGamPtCharged",-1,-1);
3509 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX("hPi0PtCharged",-1,-1);
3510 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX("hElePtCharged",-1,-1);
3511 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX("hNeHadPtCharged",-1,-1);
3512 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX("hChHadPtCharged",-1,-1);
3513 hPi0PtCharged->SetLineColor(1);
3514 hGamPtCharged->SetLineColor(4);
3515 hNeHadPtCharged->SetLineColor(2);
3516 hChHadPtCharged->SetLineColor(7);
3517 hElePtCharged->SetLineColor(6);
3518 gPad->SetLogy();
3519 fhPtCharged->SetLineColor(3);
3520 fhPtCharged->SetMinimum(0.5);
3521 fhPtCharged->Draw();
3522 hPi0PtCharged->Draw("same");
3523 hGamPtCharged->Draw("same");
3524 hNeHadPtCharged->Draw("same");
3525 hChHadPtCharged->Draw("same");
3526 hElePtCharged->Draw("same");
3527
3528 c22ch->cd(4) ;
3529
3530 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX("hGamEtaCharged",-1,-1);
3531 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX("hPi0EtaCharged",-1,-1);
3532 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX("hEleEtaCharged",-1,-1);
3533 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX("hNeHadEtaCharged",-1,-1);
3534 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX("hChHadEtaCharged",-1,-1);
3535 hPi0EtaCharged->SetLineColor(1);
3536 hGamEtaCharged->SetLineColor(4);
3537 hNeHadEtaCharged->SetLineColor(2);
3538 hChHadEtaCharged->SetLineColor(7);
3539 hEleEtaCharged->SetLineColor(6);
3540 gPad->SetLogy();
3541 fhEtaCharged->SetLineColor(3);
3542 fhEtaCharged->SetMinimum(0.5);
3543 fhEtaCharged->Draw();
3544 hPi0EtaCharged->Draw("same");
3545 hGamEtaCharged->Draw("same");
3546 hNeHadEtaCharged->Draw("same");
3547 hChHadEtaCharged->Draw("same");
3548 hEleEtaCharged->Draw("same");
3549
3550 c22ch->cd(3) ;
3551
3552 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX("hGamPhiCharged",-1,-1);
3553 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX("hPi0PhiCharged",-1,-1);
3554 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX("hElePhiCharged",-1,-1);
3555 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX("hNeHadPhiCharged",-1,-1);
3556 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX("hChHadPhiCharged",-1,-1);
3557 hPi0PhiCharged->SetLineColor(1);
3558 hGamPhiCharged->SetLineColor(4);
3559 hNeHadPhiCharged->SetLineColor(2);
3560 hChHadPhiCharged->SetLineColor(7);
3561 hElePhiCharged->SetLineColor(6);
3562 gPad->SetLogy();
3563 fhPhiCharged->SetLineColor(3);
3564 fhPhiCharged->SetMinimum(0.5);
3565 fhPhiCharged->Draw();
3566 hPi0PhiCharged->Draw("same");
3567 hGamPhiCharged->Draw("same");
3568 hNeHadPhiCharged->Draw("same");
3569 hChHadPhiCharged->Draw("same");
3570 hElePhiCharged->Draw("same");
3571
3572
3573 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
8a587055 3574 c22ch->Print(name); printf("Plot: %s\n",name);
06e5656a 3575
3576 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone("GamEChargedClone");
3577 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone("GamPtChargedClone");
3578 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone("GamEtaChargedClone");
3579 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone("GamPhiChargedClone");
3580
3581 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone("Pi0EChargedClone");
3582 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone("Pi0PtChargedClone");
3583 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone("Pi0EtaChargedClone");
3584 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone("Pi0PhiChargedClone");
3585
3586 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone("EleEChargedClone");
3587 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone("ElePtChargedClone");
3588 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone("EleEtaChargedClone");
3589 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone("ElePhiChargedClone");
3590
3591 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone("NeHadEChargedClone");
3592 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone("NeHadPtChargedClone");
3593 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone("NeHadEtaChargedClone");
3594 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone("NeHadPhiChargedClone");
3595
3596 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone("ChHadEChargedClone");
3597 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone("ChHadPtChargedClone");
3598 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone("ChHadEtaChargedClone");
3599 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone("ChHadPhiChargedClone");
3600
3601 //Ratio: reconstructed track matched/ all reconstructed
3602 //printf("c3\n");
3603 sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
3604 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
3605 c3ch->Divide(2, 2);
3606
3607 c3ch->cd(1) ;
3608 hEChargedClone->SetMaximum(1.2);
3609 hEChargedClone->SetMinimum(0.001);
3610 hEChargedClone->SetLineColor(3);
3611 hEChargedClone->SetYTitle("track matched / all");
3612 hPi0EChargedClone->Divide(hPi0E);
3613 hGamEChargedClone->Divide(hGamE);
3614 hEleEChargedClone->Divide(hEleE);
3615 hNeHadEChargedClone->Divide(hNeHadE);
3616 hChHadEChargedClone->Divide(hChHadE);
3617 hEChargedClone->Draw();
3618 hPi0EChargedClone->Draw("same");
3619 hGamEChargedClone->Draw("same");
3620 hEleEChargedClone->Draw("same");
3621 hNeHadEChargedClone->Draw("same");
3622 hChHadEChargedClone->Draw("same");
3623
3624 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
3625 pLegend3ch.SetTextSize(0.06);
3626 pLegend3ch.AddEntry(hEChargedClone,"all","L");
3627 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
3628 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
3629 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
3630 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
3631 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
3632 pLegend3ch.SetFillColor(10);
3633 pLegend3ch.SetBorderSize(1);
3634 pLegend3ch.Draw();
3635
3636 c3ch->cd(2) ;
3637 hPtChargedClone->SetMaximum(1.2);
3638 hPtChargedClone->SetMinimum(0.001);
3639 hPtChargedClone->SetLineColor(3);
3640 hPtChargedClone->SetYTitle("track matched / all");
3641 hPi0PtChargedClone->Divide(hPi0Pt);
3642 hGamPtChargedClone->Divide(hGamPt);
3643 hElePtChargedClone->Divide(hElePt);
3644 hNeHadPtChargedClone->Divide(hNeHadPt);
3645 hChHadPtChargedClone->Divide(hChHadPt);
3646 hPtChargedClone->Draw();
3647 hPi0PtChargedClone->Draw("same");
3648 hGamPtChargedClone->Draw("same");
3649 hElePtChargedClone->Draw("same");
3650 hNeHadPtChargedClone->Draw("same");
3651 hChHadPtChargedClone->Draw("same");
3652
3653 c3ch->cd(4) ;
3654 hEtaChargedClone->SetMaximum(1.2);
3655 hEtaChargedClone->SetMinimum(0.001);
3656 hEtaChargedClone->SetLineColor(3);
3657 hEtaChargedClone->SetYTitle("track matched / all");
3658 hPi0EtaChargedClone->Divide(hPi0Eta);
3659 hGamEtaChargedClone->Divide(hGamEta);
3660 hEleEtaChargedClone->Divide(hEleEta);
3661 hNeHadEtaChargedClone->Divide(hNeHadEta);
3662 hChHadEtaChargedClone->Divide(hChHadEta);
3663 hEtaChargedClone->Draw();
3664 hPi0EtaChargedClone->Draw("same");
3665 hGamEtaChargedClone->Draw("same");
3666 hEleEtaChargedClone->Draw("same");
3667 hNeHadEtaChargedClone->Draw("same");
3668 hChHadEtaChargedClone->Draw("same");
3669
3670 c3ch->cd(3) ;
3671 hPhiChargedClone->SetMaximum(1.2);
3672 hPhiChargedClone->SetMinimum(0.001);
3673 hPhiChargedClone->SetLineColor(3);
3674 hPhiChargedClone->SetYTitle("track matched / all");
3675 hPi0PhiChargedClone->Divide(hPi0Phi);
3676 hGamPhiChargedClone->Divide(hGamPhi);
3677 hElePhiChargedClone->Divide(hElePhi);
3678 hNeHadPhiChargedClone->Divide(hNeHadPhi);
3679 hChHadPhiChargedClone->Divide(hChHadPhi);
3680 hPhiChargedClone->Draw();
3681 hPi0PhiChargedClone->Draw("same");
3682 hGamPhiChargedClone->Draw("same");
3683 hElePhiChargedClone->Draw("same");
3684 hNeHadPhiChargedClone->Draw("same");
3685 hChHadPhiChargedClone->Draw("same");
3686
3687 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
8a587055 3688 c3ch->Print(name); printf("Plot: %s\n",name);
06e5656a 3689
8a587055 3690 }
9725fd2a 3691 //Track-matching distributions
06e5656a 3692
6fa7d352 3693 sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
3694 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
3695 cme->Divide(2,2);
3696
3697 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
3698 pLegendpE0.SetTextSize(0.04);
3699 pLegendpE0.AddEntry(fh1pOverE,"all","L");
3700 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
3701 pLegendpE0.SetFillColor(10);
3702 pLegendpE0.SetBorderSize(1);
3703 //pLegendpE0.Draw();
3704
3705 cme->cd(1);
3706 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
3707 fh1pOverE->SetTitle("Track matches p/E");
3708 fh1pOverE->Draw();
3709 fh1pOverER02->SetLineColor(4);
3710 fh1pOverER02->Draw("same");
3711 pLegendpE0.Draw();
3712
3713 cme->cd(2);
3714 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
3715 fh1dR->Draw();
3716
3717 cme->cd(3);
3718 fh2MatchdEdx->Draw();
3719
3720 cme->cd(4);
3721 fh2EledEdx->Draw();
3722
3723 sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
3724 cme->Print(name); printf("Plot: %s\n",name);
3725
3726 if(IsDataMC()){
3727 sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
3728 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
3729 cmemc->Divide(3,1);
3730
3731 cmemc->cd(1);
3732 gPad->SetLogy();
3733 fhMCEle1pOverE->Draw();
3734 fhMCEle1pOverER02->SetLineColor(4);
3735 fhMCEle1pOverE->SetLineColor(1);
3736 fhMCEle1pOverER02->Draw("same");
3737 pLegendpE0.Draw();
3738
3739 cmemc->cd(2);
3740 gPad->SetLogy();
3741 fhMCEle1dR->Draw();
3742
3743 cmemc->cd(3);
3744 fhMCEle2MatchdEdx->Draw();
3745
3746 sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
3747 cmemc->Print(name); printf("Plot: %s\n",name);
3748
3749
3750 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
3751 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
3752 cmemchad->Divide(3,1);
3753
3754 cmemchad->cd(1);
3755 gPad->SetLogy();
3756 fhMCChHad1pOverE->Draw();
3757 fhMCChHad1pOverER02->SetLineColor(4);
3758 fhMCChHad1pOverE->SetLineColor(1);
3759 fhMCChHad1pOverER02->Draw("same");
3760 pLegendpE0.Draw();
3761
3762 cmemchad->cd(2);
3763 gPad->SetLogy();
3764 fhMCChHad1dR->Draw();
3765
3766 cmemchad->cd(3);
3767 fhMCChHad2MatchdEdx->Draw();
3768
3769 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
3770 cmemchad->Print(name); printf("Plot: %s\n",name);
3771
3772 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
3773 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
3774 cmemcn->Divide(3,1);
3775
3776 cmemcn->cd(1);
3777 gPad->SetLogy();
3778 fhMCNeutral1pOverE->Draw();
3779 fhMCNeutral1pOverE->SetLineColor(1);
3780 fhMCNeutral1pOverER02->SetLineColor(4);
3781 fhMCNeutral1pOverER02->Draw("same");
3782 pLegendpE0.Draw();
3783
3784 cmemcn->cd(2);
3785 gPad->SetLogy();
3786 fhMCNeutral1dR->Draw();
3787
3788 cmemcn->cd(3);
3789 fhMCNeutral2MatchdEdx->Draw();
3790
3791 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
3792 cmemcn->Print(name); printf("Plot: %s\n",name);
3793
3794 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
3795 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
3796 cmpoe->Divide(2,1);
3797
3798 cmpoe->cd(1);
3799 gPad->SetLogy();
3800 fh1pOverE->SetLineColor(1);
3801 fhMCEle1pOverE->SetLineColor(4);
3802 fhMCChHad1pOverE->SetLineColor(2);
3803 fhMCNeutral1pOverE->SetLineColor(7);
3804 fh1pOverER02->SetMinimum(0.5);
3805 fh1pOverE->Draw();
3806 fhMCEle1pOverE->Draw("same");
3807 fhMCChHad1pOverE->Draw("same");
3808 fhMCNeutral1pOverE->Draw("same");
3809 TLegend pLegendpE(0.65,0.55,0.9,0.8);
3810 pLegendpE.SetTextSize(0.06);
3811 pLegendpE.AddEntry(fh1pOverE,"all","L");
3812 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
3813 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
3814 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
3815 pLegendpE.SetFillColor(10);
3816 pLegendpE.SetBorderSize(1);
3817 pLegendpE.Draw();
3818
3819 cmpoe->cd(2);
3820 gPad->SetLogy();
3821 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
3822 fh1pOverER02->SetLineColor(1);
3823 fhMCEle1pOverER02->SetLineColor(4);
3824 fhMCChHad1pOverER02->SetLineColor(2);
3825 fhMCNeutral1pOverER02->SetLineColor(7);
3826 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
3827 fh1pOverER02->SetMinimum(0.5);
3828 fh1pOverER02->Draw();
3829 fhMCEle1pOverER02->Draw("same");
3830 fhMCChHad1pOverER02->Draw("same");
3831 fhMCNeutral1pOverER02->Draw("same");
3832
3833 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
3834 // pLegendpE2.SetTextSize(0.06);
3835 // pLegendpE2.SetHeader("dR < 0.02");
3836 // pLegendpE2.SetFillColor(10);
3837 // pLegendpE2.SetBorderSize(1);
3838 // pLegendpE2.Draw();
3839
3840 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
3841 cmpoe->Print(name); printf("Plot: %s\n",name);
9725fd2a 3842 }
06e5656a 3843
902aa95c 3844
9725fd2a 3845 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
3846 gROOT->ProcessLine(line);
3847 sprintf(line, ".!rm -fR *.eps");
3848 gROOT->ProcessLine(line);
3849
3850 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());
3851
3852}