]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
fixing compilation problem
[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 ---
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"
33//#include "TH3F.h"
34#include "TH2F.h"
35#include "TLegend.h"
36
37//---- AliRoot system ----
38#include "AliAnaCalorimeterQA.h"
39#include "AliCaloTrackReader.h"
40#include "AliStack.h"
41#include "AliAODCaloCells.h"
42#include "AliAODCaloCluster.h"
43#include "AliFidutialCut.h"
44#include "AliESDtrack.h"
45#include "AliESDCaloCluster.h"
46#include "AliESDEvent.h"
47
48ClassImp(AliAnaCalorimeterQA)
49
50//____________________________________________________________________________
51 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
52 AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""), fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhi(0),
53 fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiCharged(0),
54 fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0),
55 fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
56 fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0), fhIM(0), fhAsym(0), fhNCellsPerCluster(0), fhNClusters(0), fhNCells(0), fhAmplitude(0),
57 fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
58 fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
59 fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
60 fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
61 fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0), fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
9725fd2a 62 fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
63 fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0), fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
64 fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
06e5656a 65 fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
66 fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
67 fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
68 fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
69 fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
9725fd2a 70 fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
71 fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
06e5656a 72 fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
73 fhMCChHad1pOverE(0),fhMCChHad1dR(0),fhMCChHad2MatchdEdx(0),fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
74 fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
9725fd2a 75{
76 //Default Ctor
77
78 //Initialize parameters
79 InitParameters();
80}
81
82//____________________________________________________________________________
83AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
84 AliAnaPartCorrBaseClass(qa), fCalorimeter(qa.fCalorimeter), fStyleMacro(qa.fStyleMacro),
85 fhE(qa.fhE),fhPt(qa.fhPt), fhPhi(qa.fhPhi), fhEta(qa.fhEta),
86 fhEtaPhi(qa.fhEtaPhi), fhECharged(qa.fhECharged),fhPtCharged(qa.fhPtCharged),fhPhiCharged(qa.fhPhiCharged),
87 fhEtaCharged(qa.fhEtaCharged), fhEtaPhiCharged(qa.fhEtaPhiCharged),
88 fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
89 fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut),
90 fhDeltaE(qa.fhDeltaE), fhDeltaPt(qa.fhDeltaPt), fhDeltaPhi(qa.fhDeltaPhi), fhDeltaEta(qa.fhDeltaEta),
91 fhRatioE(qa.fhRatioE), fhRatioPt(qa.fhRatioPt), fhRatioPhi(qa.fhRatioPhi), fhRatioEta(qa.fhRatioEta),
92 fh2E(qa.fh2E), fh2Pt(qa.fh2Pt), fh2Phi(qa.fh2Phi),fh2Eta(qa.fh2Eta),
93 fhIM(qa.fhIM), fhAsym(qa.fhAsym), fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNClusters(qa.fhNClusters),
94 fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude),
95 fhGenGamPt(qa.fhGenGamPt), fhGenGamEta(qa.fhGenGamEta), fhGenGamPhi(qa.fhGenGamPhi),
96 fhGenPi0Pt(qa.fhGenPi0Pt), fhGenPi0Eta(qa.fhGenPi0Eta), fhGenPi0Phi(qa.fhGenPi0Phi),
97 fhGenEtaPt(qa.fhGenEtaPt), fhGenEtaEta(qa.fhGenEtaEta), fhGenEtaPhi(qa.fhGenEtaPhi),
98 fhGenOmegaPt(qa.fhGenOmegaPt), fhGenOmegaEta(qa.fhGenOmegaEta), fhGenOmegaPhi(qa.fhGenOmegaPhi),
99 fhGenElePt(qa.fhGenElePt), fhGenEleEta(qa.fhGenEleEta), fhGenElePhi(qa.fhGenElePhi),
100 fhEMVxyz(qa.fhEMVxyz), fhEMR(qa.fhEMR), fhHaVxyz(qa.fhHaVxyz), fhHaR(qa.fhHaR),
101 fhGamE(qa.fhGamE),fhGamPt(qa.fhGamPt),fhGamPhi(qa.fhGamPhi),fhGamEta(qa.fhGamEta),
102 fhGamDeltaE(qa.fhGamDeltaE), fhGamDeltaPt(qa.fhGamDeltaPt), fhGamDeltaPhi(qa.fhGamDeltaPhi), fhGamDeltaEta(qa.fhGamDeltaEta),
103 fhGamRatioE(qa.fhGamRatioE), fhGamRatioPt(qa.fhGamRatioPt), fhGamRatioPhi(qa.fhGamRatioPhi), fhGamRatioEta(qa.fhGamRatioEta),
9725fd2a 104 fhEleE(qa.fhEleE),fhElePt(qa.fhElePt),fhElePhi(qa.fhElePhi),fhEleEta(qa.fhEleEta),
105 fhPi0E(qa.fhPi0E),fhPi0Pt(qa.fhPi0Pt),fhPi0Phi(qa.fhPi0Phi),fhPi0Eta(qa.fhPi0Eta),
106 fhNeHadE(qa.fhNeHadE),fhNeHadPt(qa.fhNeHadPt),fhNeHadPhi(qa.fhNeHadPhi),fhNeHadEta(qa.fhNeHadEta),
107 fhChHadE(qa.fhChHadE),fhChHadPt(qa.fhChHadPt),fhChHadPhi(qa.fhChHadPhi),fhChHadEta(qa.fhChHadEta),
06e5656a 108 fhGamECharged(qa.fhGamECharged),fhGamPtCharged(qa.fhGamPtCharged),fhGamPhiCharged(qa.fhGamPhiCharged),fhGamEtaCharged(qa.fhGamEtaCharged),
109 fhEleECharged(qa.fhEleECharged),fhElePtCharged(qa.fhElePtCharged),fhElePhiCharged(qa.fhElePhiCharged),fhEleEtaCharged(qa.fhEleEtaCharged),
110 fhPi0ECharged(qa.fhPi0ECharged),fhPi0PtCharged(qa.fhPi0PtCharged),fhPi0PhiCharged(qa.fhPi0PhiCharged),fhPi0EtaCharged(qa.fhPi0EtaCharged),
111 fhNeHadECharged(qa.fhNeHadECharged),fhNeHadPtCharged(qa.fhNeHadPtCharged),fhNeHadPhiCharged(qa.fhNeHadPhiCharged),fhNeHadEtaCharged(qa.fhNeHadEtaCharged),
112 fhChHadECharged(qa.fhChHadECharged),fhChHadPtCharged(qa.fhChHadPtCharged),fhChHadPhiCharged(qa.fhChHadPhiCharged),fhChHadEtaCharged(qa.fhChHadEtaCharged),
9725fd2a 113 fhGenGamAccE(qa.fhGenGamAccE),fhGenGamAccPt(qa.fhGenGamAccPt),fhGenGamAccEta(qa.fhGenGamAccEta),fhGenGamAccPhi(qa.fhGenGamAccPhi),
114 fhGenPi0AccE(qa.fhGenPi0AccE),fhGenPi0AccPt(qa.fhGenPi0AccPt),fhGenPi0AccEta(qa.fhGenPi0AccEta),fhGenPi0AccPhi(qa.fhGenPi0AccPhi),
06e5656a 115 fh1pOverE(qa.fh1pOverE),fh1dR(qa.fh1dR),fh2EledEdx(qa.fh2EledEdx), fh2MatchdEdx(qa.fh2MatchdEdx),
116 fhMCEle1pOverE(qa.fhMCEle1pOverE),fhMCEle1dR(qa.fhMCEle1dR), fhMCEle2MatchdEdx(qa.fhMCEle2MatchdEdx),
117 fhMCChHad1pOverE(qa.fhMCChHad1pOverE),fhMCChHad1dR(qa.fhMCChHad1dR), fhMCChHad2MatchdEdx(qa.fhMCChHad2MatchdEdx),
118 fhMCNeutral1pOverE(qa.fhMCNeutral1pOverE),fhMCNeutral1dR(qa.fhMCNeutral1dR), fhMCNeutral2MatchdEdx(qa.fhMCNeutral2MatchdEdx),
119 fh1pOverER02(qa.fh1pOverER02), fhMCEle1pOverER02(qa.fhMCEle1pOverER02),fhMCChHad1pOverER02(qa.fhMCChHad1pOverER02), fhMCNeutral1pOverER02(qa.fhMCNeutral1pOverER02)
9725fd2a 120{
121 // cpy ctor
122
123}
124
125//_________________________________________________________________________
126AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA & qa)
127{
128 // assignment operator
129
130 if(this == &qa)return *this;
131 ((AliAnaPartCorrBaseClass *)this)->operator=(qa);
132
133 fCalorimeter = qa.fCalorimeter;
134 fStyleMacro = qa.fStyleMacro;
135
136 fhE = qa.fhE;
137 fhPt = qa.fhPt;
138 fhPhi = qa.fhPhi;
139 fhEta = qa.fhEta;
140 fhEtaPhi = qa.fhEtaPhi;
141
142 fhECharged = qa.fhECharged;
143 fhPtCharged = qa.fhPtCharged;
144 fhPhiCharged = qa.fhPhiCharged;
145 fhEtaCharged = qa.fhEtaCharged;
146 fhEtaPhiCharged = qa.fhEtaPhiCharged;
147
148 fhEChargedNoOut = qa.fhEChargedNoOut;
149 fhPtChargedNoOut = qa.fhPtChargedNoOut;
150 fhPhiChargedNoOut = qa.fhPhiChargedNoOut;
151 fhEtaChargedNoOut = qa.fhEtaChargedNoOut;
152 fhEtaPhiChargedNoOut = qa.fhEtaPhiChargedNoOut;
153
154 fhIM = qa.fhIM;
155 fhAsym = qa.fhAsym;
156
157 fhNCellsPerCluster = qa.fhNCellsPerCluster;
158 fhNClusters = qa.fhNClusters;
159
160 fhDeltaE = qa.fhDeltaE;
161 fhDeltaPt = qa.fhDeltaPt;
162 fhDeltaPhi = qa.fhDeltaPhi;
163 fhDeltaEta = qa.fhDeltaEta;
164
165 fhRatioE = qa.fhRatioE;
166 fhRatioPt = qa.fhRatioPt;
167 fhRatioPhi = qa.fhRatioPhi;
168 fhRatioEta = qa.fhRatioEta;
169
170
171 fh2E = qa.fh2E;
172 fh2Pt = qa.fh2Pt;
173 fh2Phi = qa.fh2Phi;
174 fh2Eta = qa.fh2Eta;
175
176 fhNCells = qa.fhNCells;
177 fhAmplitude = qa.fhAmplitude;
178
179 fhGenGamPt = qa.fhGenGamPt ; fhGenGamEta = qa.fhGenGamEta ; fhGenGamPhi = qa.fhGenGamPhi ;
180 fhGenPi0Pt = qa.fhGenPi0Pt ; fhGenPi0Eta = qa.fhGenPi0Eta ; fhGenPi0Phi = qa.fhGenPi0Phi ;
181 fhGenEtaPt = qa.fhGenEtaPt ; fhGenEtaEta = qa.fhGenEtaEta ; fhGenEtaPhi = qa.fhGenEtaPhi ;
182 fhGenOmegaPt = qa.fhGenOmegaPt ; fhGenOmegaEta = qa.fhGenOmegaEta ; fhGenOmegaPhi = qa.fhGenOmegaPhi ;
183 fhGenElePt = qa.fhGenElePt ; fhGenEleEta = qa.fhGenEleEta ; fhGenElePhi = qa.fhGenElePhi ;
184
185 fhEMVxyz = qa.fhEMVxyz ; fhEMR = qa.fhEMR ; fhHaVxyz = qa.fhHaVxyz ; fhHaR = qa.fhHaR ;
186 fhGamE = qa.fhGamE ;fhGamPt = qa.fhGamPt ;fhGamPhi = qa.fhGamPhi ;fhGamEta = qa.fhGamEta ;
187 fhGamDeltaE = qa.fhDeltaE; fhGamDeltaPt = qa.fhDeltaPt; fhGamDeltaPhi = qa.fhDeltaPhi; fhGamDeltaEta = qa.fhDeltaEta;
188
189 fhGamRatioE = qa.fhGamRatioE; fhGamRatioPt = qa.fhGamRatioPt; fhGamRatioPhi = qa.fhGamRatioPhi; fhGamRatioEta = qa.fhGamRatioEta;
9725fd2a 190
191 fhEleE = qa.fhEleE ;fhElePt = qa.fhElePt ;fhElePhi = qa.fhElePhi ;fhEleEta = qa.fhEleEta ;
192 fhPi0E = qa.fhPi0E ;fhPi0Pt = qa.fhPi0Pt ;fhPi0Phi = qa.fhPi0Phi ;fhPi0Eta = qa.fhPi0Eta ;
193 fhNeHadE = qa.fhNeHadE ;fhNeHadPt = qa.fhNeHadPt ;fhNeHadPhi = qa.fhNeHadPhi ;fhNeHadEta = qa.fhNeHadEta ;
194 fhChHadE = qa.fhChHadE ;fhChHadPt = qa.fhChHadPt ;fhChHadPhi = qa.fhChHadPhi ;fhChHadEta = qa.fhChHadEta ;
195 fhGenGamAccE = qa.fhGenGamAccE ; fhGenPi0AccE = qa.fhGenPi0AccE ;
196 fhGenGamAccPt = qa.fhGenGamAccPt ;fhGenGamAccEta = qa.fhGenGamAccEta ;fhGenGamAccPhi = qa.fhGenGamAccPhi ;
197 fhGenPi0AccPt = qa.fhGenPi0AccPt ;fhGenPi0AccEta = qa.fhGenPi0AccEta; fhGenPi0AccPhi = qa.fhGenPi0AccPhi ;
198
06e5656a 199 fhGamECharged = qa.fhGamECharged; fhGamPtCharged = qa.fhGamPtCharged; fhGamPhiCharged = qa.fhGamPhiCharged; fhGamEtaCharged = qa.fhGamEtaCharged;
200 fhEleECharged = qa.fhEleECharged; fhElePtCharged = qa.fhElePtCharged; fhElePhiCharged = qa.fhElePhiCharged; fhEleEtaCharged = qa.fhEleEtaCharged;
201 fhPi0ECharged = qa.fhPi0ECharged; fhPi0PtCharged = qa.fhPi0PtCharged; fhPi0PhiCharged = qa.fhPi0PhiCharged; fhPi0EtaCharged = qa.fhPi0EtaCharged;
202 fhNeHadECharged = qa.fhNeHadECharged; fhNeHadPtCharged = qa.fhNeHadPtCharged; fhNeHadPhiCharged = qa.fhNeHadPhiCharged; fhNeHadEtaCharged = qa.fhNeHadEtaCharged;
203 fhChHadECharged = qa.fhChHadECharged; fhChHadPtCharged = qa.fhChHadPtCharged; fhChHadPhiCharged = qa.fhChHadPhiCharged; fhChHadEtaCharged = qa.fhChHadEtaCharged;
204
205 fh1pOverE = qa.fh1pOverE;
206 fh1dR = qa.fh1dR;
9725fd2a 207 fh2MatchdEdx = qa.fh2MatchdEdx;
06e5656a 208 fh2EledEdx = qa.fh2EledEdx;
209
210 fhMCEle1pOverE = qa.fhMCEle1pOverE;
211 fhMCEle1dR = qa.fhMCEle1dR;
212 fhMCEle2MatchdEdx = qa.fhMCEle2MatchdEdx ;
213
214 fhMCChHad1pOverE = qa.fhMCChHad1pOverE; fhMCChHad1dR = qa.fhMCChHad1dR; fhMCChHad2MatchdEdx = qa.fhMCChHad2MatchdEdx;
215 fhMCNeutral1pOverE = qa.fhMCNeutral1pOverE; fhMCNeutral1dR = qa.fhMCNeutral1dR; fhMCNeutral2MatchdEdx = qa.fhMCNeutral2MatchdEdx;
216 fh1pOverER02 = qa.fh1pOverER02; fhMCEle1pOverER02 = qa.fhMCEle1pOverER02; fhMCChHad1pOverER02 = qa.fhMCChHad1pOverER02;
217 fhMCNeutral1pOverER02 = qa.fhMCNeutral1pOverER02;
9725fd2a 218
219 return *this;
220
221}
222
223//________________________________________________________________________
224TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
225{
226 // Create histograms to be saved in output file and
227 // store them in fOutputContainer
228
229 TList * outputContainer = new TList() ;
4865e325 230 outputContainer->SetName("QAHistos") ;
9725fd2a 231
232 Int_t nptbins = GetHistoNPtBins();
233 Int_t nphibins = GetHistoNPhiBins();
234 Int_t netabins = GetHistoNEtaBins();
235 Float_t ptmax = GetHistoPtMax();
236 Float_t phimax = GetHistoPhiMax();
237 Float_t etamax = GetHistoEtaMax();
238 Float_t ptmin = GetHistoPtMin();
239 Float_t phimin = GetHistoPhiMin();
240 Float_t etamin = GetHistoEtaMin();
241
242 fhE = new TH1F ("hE","E reconstructed", nptbins,ptmin,ptmax);
243 fhE->SetXTitle("E (GeV)");
244 outputContainer->Add(fhE);
245
246 fhPt = new TH1F ("hPt","p_{T} reconstructed", nptbins,ptmin,ptmax);
247 fhPt->SetXTitle("p_{T} (GeV/c)");
248 outputContainer->Add(fhPt);
249
250 fhPhi = new TH1F ("hPhi","#phi reconstructed",nphibins,phimin,phimax);
251 fhPhi->SetXTitle("#phi (rad)");
252 outputContainer->Add(fhPhi);
253
254 fhEta = new TH1F ("hEta","#eta reconstructed",netabins,etamin,etamax);
255 fhEta->SetXTitle("#eta ");
256 outputContainer->Add(fhEta);
257
258 fhEtaPhi = new TH2F ("hEtaPhi","#eta vs #phi, reconstructed",netabins,etamin,etamax,nphibins,phimin,phimax);
259 fhEtaPhi->SetXTitle("#eta ");
260 fhEtaPhi->SetYTitle("#phi ");
261 outputContainer->Add(fhEtaPhi);
262
263 fhECharged = new TH1F ("hECharged","E reconstructed, matched with track", nptbins,ptmin,ptmax);
264 fhECharged->SetXTitle("E (GeV)");
265 outputContainer->Add(fhECharged);
266
267 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed, matched with track", nptbins,ptmin,ptmax);
268 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
269 outputContainer->Add(fhPtCharged);
270
271 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed, matched with track",nphibins,phimin,phimax);
272 fhPhiCharged->SetXTitle("#phi (rad)");
273 outputContainer->Add(fhPhiCharged);
274
275 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed, matched with track",netabins,etamin,etamax);
276 fhEtaCharged->SetXTitle("#eta ");
277 outputContainer->Add(fhEtaCharged);
278
279 fhEtaPhiCharged = new TH2F ("hEtaPhiCharged","#eta vs #phi, reconstructed , matched with track",netabins,etamin,etamax,nphibins,phimin,phimax);
280 fhEtaPhiCharged->SetXTitle("#eta ");
281 fhEtaPhiCharged->SetYTitle("#phi ");
282 outputContainer->Add(fhEtaPhiCharged);
283
284
285 fhEChargedNoOut = new TH1F ("hEChargedNoOut","E reconstructed, matched with track, no output track params", nptbins,ptmin,ptmax);
286 fhEChargedNoOut->SetXTitle("E (GeV)");
287 outputContainer->Add(fhEChargedNoOut);
288
289 fhPtChargedNoOut = new TH1F ("hPtChargedNoOut","p_{T} reconstructed, matched with track, no output track params", nptbins,ptmin,ptmax);
290 fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
291 outputContainer->Add(fhPtChargedNoOut);
292
293 fhPhiChargedNoOut = new TH1F ("hPhiChargedNoOut","#phi reconstructed, matched with track, no output track params",nphibins,phimin,phimax);
294 fhPhiChargedNoOut->SetXTitle("#phi (rad)");
295 outputContainer->Add(fhPhiChargedNoOut);
296
297 fhEtaChargedNoOut = new TH1F ("hEtaChargedNoOut","#eta reconstructed, matched with track, no output track params",netabins,etamin,etamax);
298 fhEtaChargedNoOut->SetXTitle("#eta ");
299 outputContainer->Add(fhEtaChargedNoOut);
300
301 fhEtaPhiChargedNoOut = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed , matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);
302 fhEtaPhiChargedNoOut->SetXTitle("#eta ");
303 fhEtaPhiChargedNoOut->SetYTitle("#phi ");
304 outputContainer->Add(fhEtaPhiChargedNoOut);
305
306 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,200,0,1);
307 fhIM->SetXTitle("E_{cluster pairs} (GeV) ");
308 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
309 outputContainer->Add(fhIM);
310
311 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,100,0,1);
312 fhAsym->SetXTitle("E_{cluster pairs} (GeV) ");
313 fhAsym->SetYTitle("Asymmetry");
314 outputContainer->Add(fhAsym);
315
316 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs cluster energy", nptbins,ptmin,ptmax, 100,0,1000);
317 fhNCellsPerCluster->SetXTitle("E (GeV)");
318 fhNCellsPerCluster->SetYTitle("n cells");
319 outputContainer->Add(fhNCellsPerCluster);
320
321 fhNClusters = new TH1F ("hNClusters","# clusters", 300,0,300);
322 fhNClusters->SetXTitle("number of clusters");
323 outputContainer->Add(fhNClusters);
324
325 //Calo cells
326 fhNCells = new TH1F ("hNCells","# cells", 13000,0,13000);
327 fhNCells->SetXTitle("n cells");
328 outputContainer->Add(fhNCells);
329
330 fhAmplitude = new TH1F ("hAmplitude","Amplitude", 100,0,1000);
331 fhAmplitude->SetXTitle("Amplitude ");
332 outputContainer->Add(fhAmplitude);
333
334 if(IsDataMC()){
335
336 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", 200,-50,50);
337 fhDeltaE->SetXTitle("#Delta E (GeV)");
338 outputContainer->Add(fhDeltaE);
339
340 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", 200,-50,50);
341 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
342 outputContainer->Add(fhDeltaPt);
343
344 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",100,-2,2);
345 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
346 outputContainer->Add(fhDeltaPhi);
347
348 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",100,-1,1);
349 fhDeltaEta->SetXTitle("#Delta #eta ");
350 outputContainer->Add(fhDeltaEta);
351
352 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", 200,0,2);
353 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
354 outputContainer->Add(fhRatioE);
355
356 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", 200,0,2);
357 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
358 outputContainer->Add(fhRatioPt);
359
360 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",200,0,2);
361 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
362 outputContainer->Add(fhRatioPhi);
363
364 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",200,0,2);
365 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
366 outputContainer->Add(fhRatioEta);
367
368 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
369 fh2E->SetXTitle("E_{rec} (GeV)");
370 fh2E->SetYTitle("E_{gen} (GeV)");
371 outputContainer->Add(fh2E);
372
373 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
374 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
375 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
376 outputContainer->Add(fh2Pt);
377
378 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
379 fh2Phi->SetXTitle("#phi_{rec} (rad)");
380 fh2Phi->SetYTitle("#phi_{gen} (rad)");
381 outputContainer->Add(fh2Phi);
382
383 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
384 fh2Eta->SetXTitle("#eta_{rec} ");
385 fh2Eta->SetYTitle("#eta_{gen} ");
386 outputContainer->Add(fh2Eta);
387
388 //Fill histos depending on origin of cluster
389 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 390 fhGamE->SetXTitle("E_{rec} (GeV)");
391 fhGamE->SetXTitle("E_{gen} (GeV)");
9725fd2a 392 outputContainer->Add(fhGamE);
393
394 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 395 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
396 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 397 outputContainer->Add(fhGamPt);
398
399 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 400 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
401 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 402 outputContainer->Add(fhGamPhi);
403
404 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 405 fhGamEta->SetXTitle("#eta_{rec} ");
406 fhGamEta->SetYTitle("#eta_{gen} ");
9725fd2a 407 outputContainer->Add(fhGamEta);
408
409 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", 200,-50,50);
410 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
411 outputContainer->Add(fhGamDeltaE);
412
413 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", 200,-50,50);
414 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
415 outputContainer->Add(fhGamDeltaPt);
416
417 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",100,-2,2);
418 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
419 outputContainer->Add(fhGamDeltaPhi);
420
421 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",100,-1,1);
422 fhGamDeltaEta->SetXTitle("#Delta #eta ");
423 outputContainer->Add(fhGamDeltaEta);
424
425 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", 200,0,2);
426 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
427 outputContainer->Add(fhGamRatioE);
428
429 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", 200,0,2);
430 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
431 outputContainer->Add(fhGamRatioPt);
432
433 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",200,0,2);
434 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
435 outputContainer->Add(fhGamRatioPhi);
436
437 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",200,0,2);
438 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
439 outputContainer->Add(fhGamRatioEta);
440
06e5656a 441 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
442 fhPi0E->SetXTitle("E_{rec} (GeV)");
443 fhPi0E->SetYTitle("E_{gen} (GeV)");
9725fd2a 444 outputContainer->Add(fhPi0E);
445
446 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 447 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
448 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 449 outputContainer->Add(fhPi0Pt);
450
451 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 452 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
453 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 454 outputContainer->Add(fhPi0Phi);
455
456 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 457 fhPi0Eta->SetXTitle("#eta_{rec} ");
458 fhPi0Eta->SetYTitle("#eta_{gen} ");
9725fd2a 459 outputContainer->Add(fhPi0Eta);
460
461 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 462 fhEleE->SetXTitle("E_{rec} (GeV)");
463 fhEleE->SetXTitle("E_{gen} (GeV)");
9725fd2a 464 outputContainer->Add(fhEleE);
465
466 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 467 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
468 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 469 outputContainer->Add(fhElePt);
470
06e5656a 471 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
472 fhElePhi->SetXTitle("#phi_{rec} (rad)");
473 fhElePhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 474 outputContainer->Add(fhElePhi);
475
476 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 477 fhEleEta->SetXTitle("#eta_{rec} ");
478 fhEleEta->SetYTitle("#eta_{gen} ");
9725fd2a 479 outputContainer->Add(fhEleEta);
480
06e5656a 481 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
482 fhNeHadE->SetXTitle("E_{rec} (GeV)");
483 fhNeHadE->SetYTitle("E_{gen} (GeV)");
9725fd2a 484 outputContainer->Add(fhNeHadE);
485
486 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 487 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
488 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 489 outputContainer->Add(fhNeHadPt);
490
491 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 492 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
493 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 494 outputContainer->Add(fhNeHadPhi);
495
496 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 497 fhNeHadEta->SetXTitle("#eta_{rec} ");
498 fhNeHadEta->SetYTitle("#eta_{gen} ");
9725fd2a 499 outputContainer->Add(fhNeHadEta);
500
06e5656a 501 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
502 fhChHadE->SetXTitle("E_{rec} (GeV)");
503 fhChHadE->SetYTitle("E_{gen} (GeV)");
9725fd2a 504 outputContainer->Add(fhChHadE);
505
506 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 507 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
508 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 509 outputContainer->Add(fhChHadPt);
510
511 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 512 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
513 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 514 outputContainer->Add(fhChHadPhi);
515
516 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 517 fhChHadEta->SetXTitle("#eta_{rec} ");
518 fhChHadEta->SetYTitle("#eta_{gen} ");
9725fd2a 519 outputContainer->Add(fhChHadEta);
520
06e5656a 521 //Charged clusters
522
523 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
524 fhGamECharged->SetXTitle("E_{rec} (GeV)");
525 fhGamECharged->SetXTitle("E_{gen} (GeV)");
526 outputContainer->Add(fhGamECharged);
527
528 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
529 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
530 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
531 outputContainer->Add(fhGamPtCharged);
532
533 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
534 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
535 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
536 outputContainer->Add(fhGamPhiCharged);
537
538 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
539 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
540 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
541 outputContainer->Add(fhGamEtaCharged);
542
543 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
544 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
545 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
546 outputContainer->Add(fhPi0ECharged);
547
548 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
549 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
550 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
551 outputContainer->Add(fhPi0PtCharged);
552
553 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
554 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
555 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
556 outputContainer->Add(fhPi0PhiCharged);
557
558 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
559 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
560 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
561 outputContainer->Add(fhPi0EtaCharged);
562
563 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
564 fhEleECharged->SetXTitle("E_{rec} (GeV)");
565 fhEleECharged->SetXTitle("E_{gen} (GeV)");
566 outputContainer->Add(fhEleECharged);
567
568 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
569 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
570 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
571 outputContainer->Add(fhElePtCharged);
572
573 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
574 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
575 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
576 outputContainer->Add(fhElePhiCharged);
577
578 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
579 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
580 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
581 outputContainer->Add(fhEleEtaCharged);
582
583 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
584 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
585 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
586 outputContainer->Add(fhNeHadECharged);
587
588 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
589 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
590 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
591 outputContainer->Add(fhNeHadPtCharged);
592
593 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
594 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
595 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
596 outputContainer->Add(fhNeHadPhiCharged);
597
598 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
599 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
600 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
601 outputContainer->Add(fhNeHadEtaCharged);
602
603 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
604 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
605 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
606 outputContainer->Add(fhChHadECharged);
607
608 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
609 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
610 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
611 outputContainer->Add(fhChHadPtCharged);
612
613 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
614 fhChHadPhiCharged->SetXTitle("#phi (rad)");
615 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
616 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
617 outputContainer->Add(fhChHadPhiCharged);
618
619 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
620 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
621 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
622 outputContainer->Add(fhChHadEtaCharged);
623
9725fd2a 624 //Vertex of generated particles
625
626 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",100,0,500,100,0,500);//,100,0,500);
627 fhEMVxyz->SetXTitle("v_{x}");
628 fhEMVxyz->SetYTitle("v_{y}");
629 //fhEMVxyz->SetZTitle("v_{z}");
630 outputContainer->Add(fhEMVxyz);
631
632 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",100,0,500,100,0,500);//,100,0,500);
633 fhHaVxyz->SetXTitle("v_{x}");
634 fhHaVxyz->SetYTitle("v_{y}");
635 //fhHaVxyz->SetZTitle("v_{z}");
636 outputContainer->Add(fhHaVxyz);
637
638 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,100,0,500);
639 fhEMR->SetXTitle("E (GeV)");
640 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
641 outputContainer->Add(fhEMR);
642
643 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,100,0,500);
644 fhHaR->SetXTitle("E (GeV)");
645 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
646 outputContainer->Add(fhHaR);
647
06e5656a 648
9725fd2a 649
650 //Pure MC
651 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
652 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
653 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
654
655 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
656 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
657 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
658
659 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
660 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
661 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
662
663 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
664 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
665 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
666
667 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
668 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
669 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
670
671 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
672 fhGenGamEta->SetXTitle("#eta");
673 fhGenGamPhi->SetXTitle("#phi (rad)");
674 outputContainer->Add(fhGenGamPt);
675 outputContainer->Add(fhGenGamEta);
676 outputContainer->Add(fhGenGamPhi);
677
678 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
679 fhGenPi0Eta->SetXTitle("#eta");
680 fhGenPi0Phi->SetXTitle("#phi (rad)");
681 outputContainer->Add(fhGenPi0Pt);
682 outputContainer->Add(fhGenPi0Eta);
683 outputContainer->Add(fhGenPi0Phi);
684
685 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
686 fhGenEtaEta->SetXTitle("#eta");
687 fhGenEtaPhi->SetXTitle("#phi (rad)");
688 outputContainer->Add(fhGenEtaPt);
689 outputContainer->Add(fhGenEtaEta);
690 outputContainer->Add(fhGenEtaPhi);
691
692 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
693 fhGenOmegaEta->SetXTitle("#eta");
694 fhGenOmegaPhi->SetXTitle("#phi (rad)");
695 outputContainer->Add(fhGenOmegaPt);
696 outputContainer->Add(fhGenOmegaEta);
697 outputContainer->Add(fhGenOmegaPhi);
698
699 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
700 fhGenEleEta->SetXTitle("#eta");
701 fhGenElePhi->SetXTitle("#phi (rad)");
702 outputContainer->Add(fhGenElePt);
703 outputContainer->Add(fhGenEleEta);
704 outputContainer->Add(fhGenElePhi);
705
706 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
707 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
708 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
709 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
710
711 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
712 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
713 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
714 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
715
716 fhGenGamAccE ->SetXTitle("E (GeV)");
717 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
718 fhGenGamAccEta->SetXTitle("#eta");
719 fhGenGamAccPhi->SetXTitle("#phi (rad)");
720 outputContainer->Add(fhGenGamAccE);
721 outputContainer->Add(fhGenGamAccPt);
722 outputContainer->Add(fhGenGamAccEta);
723 outputContainer->Add(fhGenGamAccPhi);
724
725 fhGenPi0AccE ->SetXTitle("E (GeV)");
726 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
727 fhGenPi0AccEta->SetXTitle("#eta");
728 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
729 outputContainer->Add(fhGenPi0AccE);
730 outputContainer->Add(fhGenPi0AccPt);
731 outputContainer->Add(fhGenPi0AccEta);
732 outputContainer->Add(fhGenPi0AccPhi);
733
734 }
735
736
06e5656a 737 fh1pOverE = new TH1F("h1pOverE","TRACK matches p/E",100,0.,10.);
9725fd2a 738 fh1pOverE->SetXTitle("p/E");
739 outputContainer->Add(fh1pOverE);
740
06e5656a 741 fh1dR = new TH1F("h1dR","TRACK matches dR",300, 0.,TMath::Pi());
9725fd2a 742 fh1dR->SetXTitle("#Delta R (rad)");
743 outputContainer->Add(fh1dR) ;
744
745 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",200,0.,50.,200,0.,400.);
746 fh2MatchdEdx->SetXTitle("p (GeV/c)");
747 fh2MatchdEdx->SetYTitle("<dE/dx>");
748 outputContainer->Add(fh2MatchdEdx);
749
750 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",200,0.,50.,200,0.,400.);
751 fh2EledEdx->SetXTitle("p (GeV/c)");
752 fh2EledEdx->SetYTitle("<dE/dx>");
753 outputContainer->Add(fh2EledEdx) ;
754
06e5656a 755 fhMCEle1pOverE = new TH1F("hMCEle1pOverE","TRACK matches p/E, MC electrons",100,0.,10.);
756 fhMCEle1pOverE->SetXTitle("p/E");
757 outputContainer->Add(fhMCEle1pOverE);
758
759 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",300, 0.,TMath::Pi());
760 fhMCEle1dR->SetXTitle("#Delta R (rad)");
761 outputContainer->Add(fhMCEle1dR) ;
762
763 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",200,0.,50.,200,0.,400.);
764 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
765 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
766 outputContainer->Add(fhMCEle2MatchdEdx);
767
768 fhMCChHad1pOverE = new TH1F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",100,0.,10.);
769 fhMCChHad1pOverE->SetXTitle("p/E");
770 outputContainer->Add(fhMCChHad1pOverE);
771
772 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",300, 0.,TMath::Pi());
773 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
774 outputContainer->Add(fhMCChHad1dR) ;
775
776 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",200,0.,50.,200,0.,400.);
777 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
778 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
779 outputContainer->Add(fhMCChHad2MatchdEdx);
780
781 fhMCNeutral1pOverE = new TH1F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",100,0.,10.);
782 fhMCNeutral1pOverE->SetXTitle("p/E");
783 outputContainer->Add(fhMCNeutral1pOverE);
784
785 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",300, 0.,TMath::Pi());
786 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
787 outputContainer->Add(fhMCNeutral1dR) ;
788
789 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",200,0.,50.,200,0.,400.);
790 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
791 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
792 outputContainer->Add(fhMCNeutral2MatchdEdx);
793
794 fh1pOverER02 = new TH1F("h1pOverER02","TRACK matches p/E, all",100,0.,10.);
795 fh1pOverER02->SetXTitle("p/E");
796 outputContainer->Add(fh1pOverER02);
797
798 fhMCEle1pOverER02 = new TH1F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",100,0.,10.);
799 fhMCEle1pOverER02->SetXTitle("p/E");
800 outputContainer->Add(fhMCEle1pOverER02);
801
802 fhMCChHad1pOverER02 = new TH1F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",100,0.,10.);
803 fhMCChHad1pOverER02->SetXTitle("p/E");
804 outputContainer->Add(fhMCChHad1pOverER02);
805
806 fhMCNeutral1pOverER02 = new TH1F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",100,0.,10.);
807 fhMCNeutral1pOverER02->SetXTitle("p/E");
808 outputContainer->Add(fhMCNeutral1pOverER02);
809
9725fd2a 810 return outputContainer;
811}
812
813//__________________________________________________
814void AliAnaCalorimeterQA::Init()
815{
816 //Check if the data or settings are ok
817 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
818 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
819 abort();
820 }
821
822 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
823 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
824 abort();
825 }
826
827}
828
829
830//__________________________________________________
831void AliAnaCalorimeterQA::InitParameters()
832{
833 //Initialize the parameters of the analysis.
834 AddToHistogramsName("AnaCaloQA_");
835
836 fCalorimeter = "EMCAL"; //or PHOS
837 fStyleMacro = "" ;
838}
839
840//__________________________________________________________________
841void AliAnaCalorimeterQA::Print(const Option_t * opt) const
842{
843 //Print some relevant parameters set for the analysis
844 if(! opt)
845 return;
846
847 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
848 AliAnaPartCorrBaseClass::Print(" ");
849
850 printf("Select Calorimeter %s \n",fCalorimeter.Data());
851 printf("Plots style macro %s \n",fStyleMacro.Data());
852}
853
854//__________________________________________________________________
855void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
856{
857 //Do analysis and fill histograms
858 TLorentzVector mom ;
859 TLorentzVector mom2 ;
860 //Play with the MC stack if available
861 AliStack * stack = 0x0;
862 TParticle * primary = 0x0;
4865e325 863 if(IsDataMC()) {
864 stack = GetMCStack() ;
865 if(!stack) {
866 printf("Stack not available, have you switched on the MC data?\n");
867 return;
868 }
869 }
9725fd2a 870
871 //Get List with clusters
591cc579 872 TObjArray * partList = new TObjArray();
9725fd2a 873 if(fCalorimeter == "EMCAL") partList = GetAODEMCAL();
874 else if(fCalorimeter == "PHOS") partList = GetAODPHOS();
875 else {
876 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
877 abort();
878 }
879
880 if(!partList || partList->GetEntriesFast() == 0) return ;
881
882 Int_t nclusters = partList->GetEntriesFast() ;
883 fhNClusters->Fill(nclusters);
884
885 if(GetDebug() > 0)
886 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nclusters);
887
888 //Get vertex for photon momentum calculation
889 Double_t v[3] ; //vertex ;
890 GetReader()->GetVertex(v);
4865e325 891
9725fd2a 892 for(Int_t iclus = 0; iclus < partList->GetEntriesFast(); iclus++){
4865e325 893 //printf(" cluster %d\n",iclus);
9725fd2a 894 AliAODCaloCluster * calo = (AliAODCaloCluster*) (partList->At(iclus));
895 //if(calo->GetNCells() <= 2) continue;
896 //Get cluster kinematics
897 calo->GetMomentum(mom,v);
898 Float_t e = mom.E();
899 //if(e < 0.5) continue;
900 //printf("e %2.2f, n %f\n",e, calo->GetNCells());
901 Float_t pt = mom.Pt();
902 Float_t eta = mom.Eta();
903 Float_t phi = mom.Phi();
904 if(phi < 0) phi +=TMath::TwoPi();
8a587055 905 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster %d: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",iclus,e,pt,eta,phi*TMath::RadToDeg());
9725fd2a 906 fhE ->Fill(e);
907 fhPt ->Fill(pt);
908 fhPhi ->Fill(phi);
909 fhEta ->Fill(eta);
910 fhEtaPhi->Fill(eta,phi);
06e5656a 911
9725fd2a 912 //matched cluster with tracks
06e5656a 913 Int_t ntracksmatched = calo->GetNTracksMatched();
4865e325 914
06e5656a 915 //Fill histograms only possible when simulation
9725fd2a 916 if(IsDataMC()){
917 //Play with the MC stack if available
918 Int_t label = calo->GetLabel(0);
919
920 if(label < 0 || !stack) {
921 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() *** bad label or no stack ***: label %d \n", label);
922 continue;
923 }
924
925 if(label >= stack->GetNtrack()) {
926 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
927 continue ;
928 }
4865e325 929
e727d2f7 930 //cout<<"LABEL "<<label<<endl;
9725fd2a 931 primary = GetMCStack()->Particle(label);
4865e325 932
9725fd2a 933 Int_t pdg = primary->GetPdgCode();
934 Float_t vx = primary->Vx();
935 Float_t vy = primary->Vy();
936 //Float_t vz = primary->Vz();
937 Float_t r = TMath::Sqrt(vx*vx + vy*vy);
938 if((pdg == 22 || TMath::Abs(pdg)==11) && primary->GetStatusCode()!=1) {
06e5656a 939 fhEMVxyz ->Fill(vx,vy);//,vz);
940 fhEMR ->Fill(e,r);
9725fd2a 941 }
942
e727d2f7 943 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
944 //printf("prim e %f, pt %f, phi %f, eta %f \n", primary->Energy(),primary->Pt() ,primary->Phi() ,primary->Eta() );
945 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vx, vy, vz, r);
9725fd2a 946
947 //Get final particle, no conversion products
948 Int_t status = primary->GetStatusCode();
949 Int_t mother= primary->GetFirstMother();
9725fd2a 950 if(status == 0){
06e5656a 951 while(mother >= 0){
952 primary = GetMCStack()->Particle(mother);
06e5656a 953 status = primary->GetStatusCode();
954 mother= primary->GetFirstMother();
955 if(status == 1) break;
956 //printf("mother %d\n",mother);
957 }
9725fd2a 958 }
959
960 fh2E ->Fill(e, primary->Energy());
961 fh2Pt ->Fill(pt, primary->Pt());
962 fh2Phi ->Fill(phi, primary->Phi());
963 fh2Eta ->Fill(eta, primary->Eta());
964 fhDeltaE ->Fill(primary->Energy()-e);
965 fhDeltaPt ->Fill(primary->Pt()-pt);
966 fhDeltaPhi->Fill(primary->Phi()-phi);
967 fhDeltaEta->Fill(primary->Eta()-eta);
968 if(primary->Energy() > 0) fhRatioE ->Fill(e/primary->Energy());
969 if(primary->Pt() > 0) fhRatioPt ->Fill(pt/primary->Pt());
970 if(primary->Phi() > 0) fhRatioPhi->Fill(phi/primary->Phi());
971 if(primary->Eta() > 0) fhRatioEta->Fill(eta/primary->Eta());
972
973 //cout<<"Final Label "<<finallabel<<" mother "<<mother<<endl;
974 pdg = primary->GetPdgCode();
e727d2f7 975 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
06e5656a 976
9725fd2a 977 if(pdg == 22){
06e5656a 978 //cout<<"pdg "<<pdg<<" status "<<status<<" "<<primary->GetStatusCode()<<endl;
979 TParticle *pi0 = 0x0;
980 TParticle *p1 = 0x0;
981 TParticle *p2 = 0x0;
982 TParticle * tmp = 0x0;
983 Int_t pdgpi0 = 0;
984 Int_t mothertmp = 0;
985 //Check if it is a decay photon from pi0, in this case, check if both decay contribute cluster
986 Bool_t ok1 = kFALSE;
987 Bool_t ok2 = kFALSE;
988
989 if(calo->GetNLabel() > 1){
990 if(pdg !=111){
991 while(mother >= 0){
992 pi0 = GetMCStack()->Particle(mother);
993 pdgpi0 = pi0->GetPdgCode();
e727d2f7 994 if(pdgpi0 == 111) {
995 //cout<<"pi0!!!"<<endl;
996 break;
997 }
06e5656a 998 mother= pi0->GetFirstMother();
999 //printf("mother %d\n",mother);
1000 }
1001 }
1002 else pi0 = primary;
e727d2f7 1003
1004 if(!pi0 || mother < 0 ) continue ;
1005 cout<<"pi0 pointer "<<pi0<<" pdg "<<pdgpi0<<" "<<pi0->GetPdgCode()<<endl;
1006 cout<<"MOTHER PI0 LABEL "<<mother<<" pt" << pi0->Pt()<<" status "<<pi0->GetStatusCode()<<endl;
06e5656a 1007 if(pi0->GetNDaughters() == 2){
e727d2f7 1008 cout<<"pi0, 2 daughters "<<endl;
06e5656a 1009 Int_t id1 = pi0->GetFirstDaughter();
1010 Int_t id2 = pi0->GetFirstDaughter()+1;
1011 p1=GetMCStack()->Particle(id1);
1012 p2=GetMCStack()->Particle(id2);
1013
1014 if(p1->GetFirstMother()!=p2->GetFirstMother()) cout <<"Decay photon mothers are not the same!!"<<endl;
1015 if(p1->GetPdgCode()==22 && p2->GetPdgCode()==22){
1016 // cout<<"2 photons, labels "<< id1<<" "<<id2<<endl;
1017 for(UInt_t ilabel = 0; ilabel < calo->GetNLabel(); ilabel++){
1018 Int_t iprim = calo->GetLabel(ilabel);
1019 //cout<<"iprim "<<iprim<<endl;
1020 if (iprim == id1) ok1 = kTRUE;
1021 else if (iprim == id2) ok2 = kTRUE;
1022 mothertmp = iprim;
1023 while(mothertmp >= 0){
1024 tmp = GetMCStack()->Particle(mothertmp);
1025 mothertmp= tmp->GetFirstMother();
1026 // cout<<"mothertmp "<<mothertmp<<" "<<tmp->GetName()<< " pt "<<tmp->Pt()<<endl;
1027 if (mothertmp == id1) ok1 = kTRUE;
1028 else if (mothertmp == id2) ok2 = kTRUE;
1029 if(ok1 && ok2) break;
1030 //printf("mother %d\n",mother);
1031 }
1032 }
1033 }//2 photon daughters
1034 }////mother pi0, 2 daughers
1035 }//more than one contribution to clust
1036
1037 if(ok1 && ok2){
1038 //cout<<"Fill pi0"<< "E "<< e <<" prim E "<<primary->Energy()<<endl;
1039 fhPi0E ->Fill(e,primary->Energy());
1040 fhPi0Pt ->Fill(pt,primary->Pt());
1041 fhPi0Eta ->Fill(eta,primary->Eta());
1042 fhPi0Phi ->Fill(phi,primary->Phi());
1043 if( ntracksmatched > 0){
1044 fhPi0ECharged ->Fill(e,primary->Energy());
1045 fhPi0PtCharged ->Fill(pt,primary->Pt());
1046 fhPi0PhiCharged ->Fill(phi,primary->Phi());
1047 fhPi0EtaCharged ->Fill(eta,primary->Eta());
1048 }
1049 }
1050 else{
1051 fhGamE ->Fill(e,primary->Energy());
1052 fhGamPt ->Fill(pt,primary->Pt());
1053 fhGamEta ->Fill(eta,primary->Eta());
1054 fhGamPhi ->Fill(phi,primary->Phi());
1055 fhGamDeltaE ->Fill(primary->Energy()-e);
1056 fhGamDeltaPt ->Fill(primary->Pt()-pt);
1057 fhGamDeltaPhi->Fill(primary->Phi()-phi);
1058 fhGamDeltaEta->Fill(primary->Eta()-eta);
1059 if(primary->Energy() > 0) fhGamRatioE ->Fill(e/primary->Energy());
1060 if(primary->Pt() > 0) fhGamRatioPt ->Fill(pt/primary->Pt());
1061 if(primary->Phi() > 0) fhGamRatioPhi->Fill(phi/primary->Phi());
1062 if(primary->Eta() > 0) fhGamRatioEta->Fill(eta/primary->Eta());
1063 if( ntracksmatched > 0){
1064 fhGamECharged ->Fill(e,primary->Energy());
1065 fhGamPtCharged ->Fill(pt,primary->Pt());
1066 fhGamPhiCharged ->Fill(phi,primary->Phi());
1067 fhGamEtaCharged ->Fill(eta,primary->Eta());
1068 }
1069 }
9725fd2a 1070 }//pdg == 22
1071 else if(TMath::Abs(pdg) == 11) {
06e5656a 1072 fhEleE ->Fill(e,primary->Energy());
1073 fhElePt ->Fill(pt,primary->Pt());
1074 fhEleEta ->Fill(eta,primary->Eta());
1075 fhElePhi ->Fill(phi,primary->Phi());
1076 fhEMVxyz ->Fill(vx,vy);//,vz);
1077 fhEMR ->Fill(e,r);
1078 if( ntracksmatched > 0){
1079 fhEleECharged ->Fill(e,primary->Energy());
1080 fhElePtCharged ->Fill(pt,primary->Pt());
1081 fhElePhiCharged ->Fill(phi,primary->Phi());
1082 fhEleEtaCharged ->Fill(eta,primary->Eta());
1083 }
9725fd2a 1084 }
1085 else if(pdg == 111) {
06e5656a 1086 fhPi0E ->Fill(e,primary->Energy());
1087 fhPi0Pt ->Fill(pt,primary->Pt());
1088 fhPi0Eta ->Fill(eta,primary->Eta());
1089 fhPi0Phi ->Fill(phi,primary->Phi());
1090 if( ntracksmatched > 0){
1091 fhPi0ECharged ->Fill(e,primary->Energy());
1092 fhPi0PtCharged ->Fill(pt,primary->Pt());
1093 fhPi0PhiCharged ->Fill(phi,primary->Phi());
1094 fhPi0EtaCharged ->Fill(eta,primary->Eta());
1095 }
9725fd2a 1096 }
1097 else if(charge == 0){
06e5656a 1098 fhNeHadE ->Fill(e,primary->Energy());
1099 fhNeHadPt ->Fill(pt,primary->Pt());
1100 fhNeHadEta ->Fill(eta,primary->Eta());
1101 fhNeHadPhi ->Fill(phi,primary->Phi());
1102 fhHaVxyz ->Fill(vx,vy);//,vz);
1103 fhHaR ->Fill(e,r);
1104 if( ntracksmatched > 0){
1105 fhNeHadECharged ->Fill(e,primary->Energy());
1106 fhNeHadPtCharged ->Fill(pt,primary->Pt());
1107 fhNeHadPhiCharged ->Fill(phi,primary->Phi());
1108 fhNeHadEtaCharged ->Fill(eta,primary->Eta());
1109 }
9725fd2a 1110 }
1111 else if(charge!=0){
06e5656a 1112 fhChHadE ->Fill(e,primary->Energy());
1113 fhChHadPt ->Fill(pt,primary->Pt());
1114 fhChHadEta ->Fill(eta,primary->Eta());
1115 fhChHadPhi ->Fill(phi,primary->Phi());
1116 fhHaVxyz ->Fill(vx,vy);//,vz);
1117 fhHaR ->Fill(e,r);
1118 if( ntracksmatched > 0){
1119 fhChHadECharged ->Fill(e,primary->Energy());
1120 fhChHadPtCharged ->Fill(pt,primary->Pt());
1121 fhChHadPhiCharged ->Fill(phi,primary->Phi());
1122 fhChHadEtaCharged ->Fill(eta,primary->Eta());
1123 }
9725fd2a 1124 }
1125 }//Work with stack also
1126
06e5656a 1127 //matched cluster with tracks
1128 if( ntracksmatched > 0){
1129 fhECharged ->Fill(e);
1130 fhPtCharged ->Fill(pt);
1131 fhPhiCharged ->Fill(phi);
1132 fhEtaCharged ->Fill(eta);
1133 fhEtaPhiCharged->Fill(eta,phi);
1134 if((!strcmp(GetReader()->GetInputEvent()->GetName(),"AliESDEvent"))) {
1135 AliESDEvent *esd = (AliESDEvent*) GetReader()->GetInputEvent();
1136 AliESDCaloCluster * esdcalo = (AliESDCaloCluster*) esd->GetCaloCluster(calo->GetID());
1137 Int_t trackIndex = esdcalo->GetTrackMatched();
1138 //printf("track index %d ntracks %d\n", trackIndex, esd->GetNumberOfTracks());
1139 if(trackIndex >= 0){
1140 AliESDtrack* track = (AliESDtrack*) esd->GetTrack(trackIndex);
1141 if (track && track->GetOuterParam() ) {
4865e325 1142
06e5656a 1143 Double_t tphi = track->GetOuterParam()->Phi();
1144 Double_t teta = track->GetOuterParam()->Eta();
1145 Double_t tmom = track->GetOuterParam()->P();
4865e325 1146
06e5656a 1147 Double_t deta = teta - eta;
1148 Double_t dphi = tphi - phi;
1149 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
1150 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
1151 Double_t dR = sqrt(dphi*dphi + deta*deta);
1152
1153 Double_t pOverE = tmom/e;
1154
1155 fh1pOverE->Fill(pOverE);
1156 if(dR < 0.02) fh1pOverER02->Fill(pOverE);
1157
1158 fh1dR->Fill(dR);
1159 fh2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
4865e325 1160
06e5656a 1161 if(IsDataMC() && primary){
4865e325 1162 Int_t pdg = primary->GetPdgCode();
1163 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1164
06e5656a 1165 if(TMath::Abs(pdg) == 11){
1166 fhMCEle1pOverE->Fill(pOverE);
1167 fhMCEle1dR->Fill(dR);
1168 fhMCEle2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1169 if(dR < 0.02) fhMCEle1pOverER02->Fill(pOverE);
1170 }
1171 else if(charge!=0){
1172 fhMCChHad1pOverE->Fill(pOverE);
1173 fhMCChHad1dR->Fill(dR);
1174 fhMCChHad2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1175 if(dR < 0.02) fhMCChHad1pOverER02->Fill(pOverE);
1176 }
1177 else if(charge == 0){
1178 fhMCNeutral1pOverE->Fill(pOverE);
1179 fhMCNeutral1dR->Fill(dR);
1180 fhMCNeutral2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1181 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(pOverE);
1182 }
1183 }
1184 int nITS = track->GetNcls(0);
1185 int nTPC = track->GetNcls(1);
1186 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
1187 && calo->GetNCells() > 1 && nITS > 3 && nTPC > 20) {
1188 fh2EledEdx->Fill(track->P(),track->GetTPCsignal());
1189 }
1190 }
1191 else if(!track->GetOuterParam()){
1192 ULong_t status=AliESDtrack::kTPCrefit;
1193 status|=AliESDtrack::kITSrefit;
1194 //printf("track status %d\n", track->GetStatus() );
1195 fhEChargedNoOut ->Fill(e);
1196 fhPtChargedNoOut ->Fill(pt);
1197 fhPhiChargedNoOut ->Fill(phi);
1198 fhEtaChargedNoOut ->Fill(eta);
1199 fhEtaPhiChargedNoOut ->Fill(eta,phi);
1200 if ( (track->GetStatus() & status) == status) printf("ITS+TPC\n");
1201 }
1202 else {
4865e325 1203 printf("ERROR: Could not receive track %d\n", trackIndex);
06e5656a 1204 }
1205 }// non negative track index
1206 }//do only if input are ESDs
1207 }// at least one track matched
1208
9725fd2a 1209 //Invariant mass
1210 if (nclusters > 1 ) {
1211 for(Int_t jclus = iclus + 1 ; jclus < nclusters ; jclus++) {
1212 AliAODCaloCluster * calo2 = (AliAODCaloCluster*) (partList->At(jclus));
1213 //Get cluster kinematics
1214 calo2->GetMomentum(mom2,v);
1215 fhIM ->Fill((mom+mom2).E(),(mom+mom2).M());
1216 fhAsym->Fill((mom+mom2).E(),TMath::Abs((e-mom2.E())/(e+mom2.E())));
1217 }// 2nd cluster loop
1218 }////more than 1 cluster in calorimeter
1219
1220 //Cells per cluster
1221 fhNCellsPerCluster->Fill(e,calo->GetNCells());
1222
1223 }// 1st cluster loop
1224
1225 //CaloCells
1226 AliAODCaloCells * cell = new AliAODCaloCells ;
1227 if(fCalorimeter == "PHOS")
1228 cell = (AliAODCaloCells *) GetPHOSCells();
1229 else
1230 cell = (AliAODCaloCells *) GetEMCALCells();
1231
1232 if(!cell) {
1233 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - ABORT: No CELLS available for analysis");
1234 abort();
1235 }
1236
1237 //Some prints
1238 if(GetDebug() > 0 && cell )
1239 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), cell->GetNumberOfCells());
1240
1241 Int_t ncells = cell->GetNumberOfCells() ;
1242 fhNCells->Fill(ncells) ;
1243
1244 for (Int_t iCell = 0; iCell < ncells; iCell++) {
8a587055 1245 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
9725fd2a 1246 fhAmplitude->Fill(cell->GetAmplitude(iCell));
1247 }
1248
9725fd2a 1249 //Monte Carlo
1250 if(IsDataMC()){
1251 //Play with the MC stack if available
1252 for(Int_t i=8 ; i<stack->GetNprimary(); i++){
1253 primary = stack->Particle(i) ;
1254
1255 //if (!primary->IsPrimary()) continue;
1256 if (TMath::Abs(primary->Eta()) > 1) continue;
1257
1258 Int_t kf = primary->GetPdgCode();
1259 //printf("kf %d\n",kf);
1260
1261 Bool_t in = kTRUE;
1262 primary->Momentum(mom);
1263 if(IsFidutialCutOn()) in = GetFidutialCut()->IsInFidutialCut(mom,fCalorimeter) ;
1264
1265 if (kf==22) {
1266 fhGenGamPt ->Fill(primary->Pt());
1267 fhGenGamEta->Fill(primary->Eta());
1268 fhGenGamPhi->Fill(primary->Phi());
1269 if(in){
1270 fhGenGamAccE ->Fill(primary->Energy());
1271 fhGenGamAccPt ->Fill(primary->Pt());
1272 fhGenGamAccEta->Fill(primary->Eta());
1273 fhGenGamAccPhi->Fill(primary->Phi());
1274 }
1275 }
1276 else if (kf==111) {
1277 fhGenPi0Pt ->Fill(primary->Pt());
1278 fhGenPi0Eta->Fill(primary->Eta());
1279 fhGenPi0Phi->Fill(primary->Phi());
1280 if(in){
1281 fhGenPi0AccE ->Fill(primary->Energy());
1282 fhGenPi0AccPt ->Fill(primary->Pt());
1283 fhGenPi0AccEta->Fill(primary->Eta());
1284 fhGenPi0AccPhi->Fill(primary->Phi());
1285 }
1286 }
1287 else if (kf==221) {
1288 fhGenEtaPt ->Fill(primary->Pt());
1289 fhGenEtaEta->Fill(primary->Eta());
1290 fhGenEtaPhi->Fill(primary->Phi());
1291 }
1292 else if (kf==223) {
1293 fhGenOmegaPt ->Fill(primary->Pt());
1294 fhGenOmegaEta->Fill(primary->Eta());
1295 fhGenOmegaPhi->Fill(primary->Phi());
1296 }
1297 else if (TMath::Abs(kf)==11) {
1298 fhGenElePt ->Fill(primary->Pt());
1299 fhGenEleEta->Fill(primary->Eta());
1300 fhGenElePhi->Fill(primary->Phi());
1301 }
1302 } //primary loop
1303 } //Is data MC
1304
4865e325 1305 if(GetDebug() > 0)
1306 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1307
1308
9725fd2a 1309}
1310
1311//________________________________________________________________________
1312void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
1313{
1314 // Needed when Terminate is executed in distributed environment
1315 // Refill analysis histograms of this class with corresponding histograms in output list.
1316
1317 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
1318 // the first one and then add the next
1319 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
1320 //printf("Calo: %s, index: %d\n",fCalorimeter.Data(),index);
1321 //Read histograms, must be in the same order as in GetCreateOutputObject.
1322 fhE = (TH1F *) outputList->At(index++);
1323 fhPt = (TH1F *) outputList->At(index++);
1324 fhPhi = (TH1F *) outputList->At(index++);
1325 fhEta = (TH1F *) outputList->At(index++);
1326 fhEtaPhi = (TH2F *) outputList->At(index++);
1327
1328 fhECharged = (TH1F *) outputList->At(index++);
1329 fhPtCharged = (TH1F *) outputList->At(index++);
1330 fhPhiCharged = (TH1F *) outputList->At(index++);
1331 fhEtaCharged = (TH1F *) outputList->At(index++);
1332 fhEtaPhiCharged = (TH2F *) outputList->At(index++);
1333
1334 fhEChargedNoOut = (TH1F *) outputList->At(index++);
1335 fhPtChargedNoOut = (TH1F *) outputList->At(index++);
1336 fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
1337 fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
1338 fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
1339
1340 fhIM = (TH2F *) outputList->At(index++);
1341 fhAsym = (TH2F *) outputList->At(index++);
1342
1343 fhNCellsPerCluster = (TH2F *) outputList->At(index++);
1344 fhNClusters = (TH1F *) outputList->At(index++);
1345 fhNCells = (TH1F *) outputList->At(index++);
1346 fhAmplitude = (TH1F *) outputList->At(index++);
1347
1348 if(IsDataMC()){
1349 fhDeltaE = (TH1F *) outputList->At(index++);
1350 fhDeltaPt = (TH1F *) outputList->At(index++);
1351 fhDeltaPhi = (TH1F *) outputList->At(index++);
1352 fhDeltaEta = (TH1F *) outputList->At(index++);
1353
1354 fhRatioE = (TH1F *) outputList->At(index++);
1355 fhRatioPt = (TH1F *) outputList->At(index++);
1356 fhRatioPhi = (TH1F *) outputList->At(index++);
1357 fhRatioEta = (TH1F *) outputList->At(index++);
1358
1359 fh2E = (TH2F *) outputList->At(index++);
1360 fh2Pt = (TH2F *) outputList->At(index++);
1361 fh2Phi = (TH2F *) outputList->At(index++);
1362 fh2Eta = (TH2F *) outputList->At(index++);
1363
1364 fhGamE = (TH2F *) outputList->At(index++);
1365 fhGamPt = (TH2F *) outputList->At(index++);
1366 fhGamPhi = (TH2F *) outputList->At(index++);
1367 fhGamEta = (TH2F *) outputList->At(index++);
1368
1369 fhGamDeltaE = (TH1F *) outputList->At(index++);
1370 fhGamDeltaPt = (TH1F *) outputList->At(index++);
1371 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
1372 fhGamDeltaEta = (TH1F *) outputList->At(index++);
1373
1374 fhGamRatioE = (TH1F *) outputList->At(index++);
1375 fhGamRatioPt = (TH1F *) outputList->At(index++);
1376 fhGamRatioPhi = (TH1F *) outputList->At(index++);
1377 fhGamRatioEta = (TH1F *) outputList->At(index++);
1378
9725fd2a 1379 fhPi0E = (TH2F *) outputList->At(index++);
1380 fhPi0Pt = (TH2F *) outputList->At(index++);
1381 fhPi0Phi = (TH2F *) outputList->At(index++);
1382 fhPi0Eta = (TH2F *) outputList->At(index++);
1383
1384 fhEleE = (TH2F *) outputList->At(index++);
1385 fhElePt = (TH2F *) outputList->At(index++);
1386 fhElePhi = (TH2F *) outputList->At(index++);
1387 fhEleEta = (TH2F *) outputList->At(index++);
1388
1389 fhNeHadE = (TH2F *) outputList->At(index++);
1390 fhNeHadPt = (TH2F *) outputList->At(index++);
1391 fhNeHadPhi = (TH2F *) outputList->At(index++);
1392 fhNeHadEta = (TH2F *) outputList->At(index++);
1393
1394 fhChHadE = (TH2F *) outputList->At(index++);
1395 fhChHadPt = (TH2F *) outputList->At(index++);
1396 fhChHadPhi = (TH2F *) outputList->At(index++);
1397 fhChHadEta = (TH2F *) outputList->At(index++);
1398
06e5656a 1399 fhGamECharged = (TH2F *) outputList->At(index++);
1400 fhGamPtCharged = (TH2F *) outputList->At(index++);
1401 fhGamPhiCharged = (TH2F *) outputList->At(index++);
1402 fhGamEtaCharged = (TH2F *) outputList->At(index++);
1403
1404 fhPi0ECharged = (TH2F *) outputList->At(index++);
1405 fhPi0PtCharged = (TH2F *) outputList->At(index++);
1406 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
1407 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
1408
1409 fhEleECharged = (TH2F *) outputList->At(index++);
1410 fhElePtCharged = (TH2F *) outputList->At(index++);
1411 fhElePhiCharged = (TH2F *) outputList->At(index++);
1412 fhEleEtaCharged = (TH2F *) outputList->At(index++);
1413
1414 fhNeHadECharged = (TH2F *) outputList->At(index++);
1415 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
1416 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
1417 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
1418
1419 fhChHadECharged = (TH2F *) outputList->At(index++);
1420 fhChHadPtCharged = (TH2F *) outputList->At(index++);
1421 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
1422 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
1423
9725fd2a 1424// fhEMVxyz = (TH3F *) outputList->At(index++);
1425// fhHaVxyz = (TH3F *) outputList->At(index++);
1426
1427 fhEMVxyz = (TH2F *) outputList->At(index++);
1428 fhHaVxyz = (TH2F *) outputList->At(index++);
1429 fhEMR = (TH2F *) outputList->At(index++);
1430 fhHaR = (TH2F *) outputList->At(index++);
1431
1432 fhGenGamPt = (TH1F *) outputList->At(index++);
1433 fhGenGamEta = (TH1F *) outputList->At(index++);
1434 fhGenGamPhi = (TH1F *) outputList->At(index++);
1435
1436 fhGenPi0Pt = (TH1F *) outputList->At(index++);
1437 fhGenPi0Eta = (TH1F *) outputList->At(index++);
1438 fhGenPi0Phi = (TH1F *) outputList->At(index++);
1439
1440 fhGenEtaPt = (TH1F *) outputList->At(index++);
1441 fhGenEtaEta = (TH1F *) outputList->At(index++);
1442 fhGenEtaPhi = (TH1F *) outputList->At(index++);
1443
1444 fhGenOmegaPt = (TH1F *) outputList->At(index++);
1445 fhGenOmegaEta = (TH1F *) outputList->At(index++);
1446 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
1447
1448 fhGenElePt = (TH1F *) outputList->At(index++);
1449 fhGenEleEta = (TH1F *) outputList->At(index++);
1450 fhGenElePhi = (TH1F *) outputList->At(index++);
1451
1452 fhGenGamAccE = (TH1F *) outputList->At(index++);
1453 fhGenGamAccPt = (TH1F *) outputList->At(index++);
1454 fhGenGamAccEta = (TH1F *) outputList->At(index++);
1455 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
1456
1457 fhGenPi0AccE = (TH1F *) outputList->At(index++);
1458 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
1459 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
1460 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
1461
1462 }//Is data MC
1463
1464 fh1pOverE = (TH1F *) outputList->At(index++);
1465 fh1dR = (TH1F *) outputList->At(index++);
1466 fh2MatchdEdx = (TH2F *) outputList->At(index++);
1467 fh2EledEdx = (TH2F *) outputList->At(index++);
1468
06e5656a 1469 if(IsDataMC()){
1470 fhMCEle1pOverE = (TH1F *) outputList->At(index++);
1471 fhMCEle1dR = (TH1F *) outputList->At(index++);
1472 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
1473
1474 fhMCChHad1pOverE = (TH1F *) outputList->At(index++);
1475 fhMCChHad1dR = (TH1F *) outputList->At(index++);
1476 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
1477
1478 fhMCNeutral1pOverE = (TH1F *) outputList->At(index++);
1479 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
1480 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
1481
1482 fh1pOverER02 = (TH1F *) outputList->At(index++);
1483 fhMCEle1pOverER02 = (TH1F *) outputList->At(index++);
1484 fhMCChHad1pOverER02 = (TH1F *) outputList->At(index++);
1485 fhMCNeutral1pOverER02 = (TH1F *) outputList->At(index++);
1486 }
1487 //for(Int_t i = 0; i<index ; i++) cout<<outputList->At(i)->GetName()<<endl;
9725fd2a 1488}
1489
1490//__________________________________________________________________
1491void AliAnaCalorimeterQA::Terminate(TList* outputList)
1492{
1493
1494 //Do some plots to end
1495 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
1496 //Recover histograms from output histograms list, needed for distributed analysis.
1497 ReadHistograms(outputList);
1498
1499 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
1500 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
1501
1502 char name[128];
1503 char cname[128];
06e5656a 1504
8a587055 1505 //CaloCells
1506 //printf("c9\n");
1507 sprintf(cname,"QA_%s_nclustercellsamp",fCalorimeter.Data());
1508 TCanvas * c9 = new TCanvas(cname, " CaloClusters and CaloCells", 400, 400) ;
1509 c9->Divide(2, 2);
1510
1511 c9->cd(1) ;
1512 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
1513 gPad->SetLogx();
1514 fhNClusters->SetLineColor(4);
1515 fhNClusters->Draw();
1516
1517 c9->cd(2) ;
1518 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
1519 gPad->SetLogx();
1520 fhNCells->SetLineColor(4);
1521 fhNCells->Draw();
1522
1523 c9->cd(3) ;
1524 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
1525 gPad->SetLogx();
1526 fhNCellsPerCluster->SetLineColor(4);
1527 fhNCellsPerCluster->Draw();
1528
1529 c9->cd(4) ;
1530 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
1531 //gPad->SetLogx();
1532 fhAmplitude->SetLineColor(4);
1533 fhAmplitude->Draw();
1534
1535 sprintf(name,"QA_%s_CaloClustersAndCaloCells.eps",fCalorimeter.Data());
1536 c9->Print(name); printf("Plot: %s\n",name);
1537
1538
9725fd2a 1539 //Reconstructed distributions
06e5656a 1540 //printf("c1\n");
9725fd2a 1541 sprintf(cname,"QA_%s_rec",fCalorimeter.Data());
1542 TCanvas * c = new TCanvas(cname, "Reconstructed distributions", 400, 400) ;
1543 c->Divide(2, 2);
1544
1545 c->cd(1) ;
8a587055 1546 if(fhE->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1547 fhE->SetLineColor(4);
1548 fhE->Draw();
1549
1550 c->cd(2) ;
8a587055 1551 if(fhPt->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1552 fhPt->SetLineColor(4);
1553 fhPt->Draw();
1554
1555 c->cd(3) ;
1556 fhPhi->SetLineColor(4);
1557 fhPhi->Draw();
1558
1559 c->cd(4) ;
1560 fhEta->SetLineColor(4);
1561 fhEta->Draw();
1562
1563 sprintf(name,"QA_%s_ReconstructedDistributions.eps",fCalorimeter.Data());
8a587055 1564 c->Print(name); printf("Plot: %s\n",name);
9725fd2a 1565
1566 //Reconstructed distributions, matched with tracks
1567 //printf("c2\n");
1568 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
1569 TCanvas * c2 = new TCanvas(cname, "Reconstructed distributions, matched with tracks", 400, 400) ;
1570 c2->Divide(2, 2);
1571
1572 c2->cd(1) ;
8a587055 1573 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1574 fhECharged->SetLineColor(4);
1575 fhECharged->Draw();
1576
1577 c2->cd(2) ;
8a587055 1578 if(fhPtCharged->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1579 fhPtCharged->SetLineColor(4);
1580 fhPtCharged->Draw();
1581
1582 c2->cd(3) ;
1583 fhPhiCharged->SetLineColor(4);
1584 fhPhiCharged->Draw();
1585
1586 c2->cd(4) ;
1587 fhEtaCharged->SetLineColor(4);
1588 fhEtaCharged->Draw();
1589
1590 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched.eps",fCalorimeter.Data());
8a587055 1591 c2->Print(name); printf("Plot: %s\n",name);
9725fd2a 1592
1593 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone("EChargedClone");
1594 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone("PtChargedClone");
1595 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone("EtaChargedClone");
1596 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone("PhiChargedClone");
06e5656a 1597
9725fd2a 1598 TH1F * hEChargedClone2 = (TH1F*) fhECharged->Clone("EChargedClone2");
1599 TH1F * hPtChargedClone2 = (TH1F*) fhPtCharged->Clone("PtChargedClone2");
1600 TH1F * hEtaChargedClone2 = (TH1F*) fhEtaCharged->Clone("EtaChargedClone2");
1601 TH1F * hPhiChargedClone2 = (TH1F*) fhPhiCharged->Clone("PhiChargedClone2");
06e5656a 1602
9725fd2a 1603 //Ratio: reconstructed track matched/ all reconstructed
1604 //printf("c3\n");
1605 sprintf(cname,"QA_%s_rectrackmatchrat",fCalorimeter.Data());
1606 TCanvas * c3 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
1607 c3->Divide(2, 2);
1608
1609 c3->cd(1) ;
8a587055 1610 if(hEChargedClone->GetEntries() > 0) gPad->SetLogy();
06e5656a 1611 hEChargedClone->SetTitleOffset(1.6,"Y");
1612 hEChargedClone->SetYTitle("track matched / all ");
1613 hEChargedClone->SetXTitle("E (GeV)");
9725fd2a 1614 hEChargedClone->Divide(fhE);
1615 hEChargedClone->Draw();
1616
1617 c3->cd(2) ;
8a587055 1618 if(hPtChargedClone->GetEntries() > 0) gPad->SetLogy();
06e5656a 1619 hPtChargedClone->SetTitleOffset(1.6,"Y");
1620 hPtChargedClone->SetYTitle("track matched / all ");
1621 hPtChargedClone->SetXTitle("p_{T} (GeV/c)");
9725fd2a 1622 hPtChargedClone->Divide(fhPt);
1623 hPtChargedClone->Draw();
1624
1625 c3->cd(3) ;
8a587055 1626 if(hPhiChargedClone->GetEntries() > 0) gPad->SetLogy();
06e5656a 1627 hPhiChargedClone->SetTitleOffset(1.6,"Y");
1628 hPhiChargedClone->SetYTitle("track matched / all ");
1629 hPhiChargedClone->SetXTitle("#phi (rad)");
9725fd2a 1630 hPhiChargedClone->Divide(fhPhi);
1631 hPhiChargedClone->Draw();
1632
1633 c3->cd(4) ;
8a587055 1634 if(hEtaChargedClone->GetEntries() > 0) gPad->SetLogy();
06e5656a 1635 hEtaChargedClone->SetTitleOffset(1.6,"Y");
1636 hEtaChargedClone->SetYTitle("track matched / all ");
1637 hEtaChargedClone->SetXTitle("#eta");
1638 hEtaChargedClone->Divide(fhEta);
9725fd2a 1639 hEtaChargedClone->Draw();
1640
1641 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributions.eps",fCalorimeter.Data());
8a587055 1642 c3->Print(name); printf("Plot: %s\n",name);
9725fd2a 1643
1644 //Ratio: reconstructed track matched (minus no track param) / all
06e5656a 1645 //printf("c3\n");
9725fd2a 1646 sprintf(cname,"QA_%s_rectrackmatchratout",fCalorimeter.Data());
1647 TCanvas * c333 = new TCanvas(cname, "Ratio: reconstructed track matched (with outer track param)/ all", 400, 400) ;
1648 c333->Divide(2, 2);
06e5656a 1649
9725fd2a 1650 c333->cd(1) ;
1651 hEChargedClone2->Add(fhEChargedNoOut,-1);
1652 hEChargedClone2->SetYTitle("track matched / all");
06e5656a 1653 hEChargedClone2->SetXTitle("E (GeV)");
9725fd2a 1654 hEChargedClone2->Divide(fhE);
1655 hEChargedClone2->Draw();
1656
1657 c333->cd(2) ;
1658 hPtChargedClone2->Add(fhPtChargedNoOut,-1);
1659 hPtChargedClone2->SetYTitle("track matched / all");
06e5656a 1660 hPtChargedClone2->SetXTitle("p_{T} (GeV/c)");
9725fd2a 1661 hPtChargedClone2->Divide(fhPt);
1662 hPtChargedClone2->Draw();
1663
1664 c333->cd(3) ;
1665 hPhiChargedClone2->Add(fhPhiChargedNoOut,-1);
1666 hPhiChargedClone2->SetYTitle("track matched / all");
06e5656a 1667 hPhiChargedClone2->SetXTitle("#phi (rad)");
9725fd2a 1668 hPhiChargedClone2->Divide(fhPhi);
1669 hPhiChargedClone2->Draw();
1670
1671 c333->cd(4) ;
1672 hEtaChargedClone2->Add(fhEtaChargedNoOut,-1);
1673 hEtaChargedClone2->SetYTitle("track matched / all");
06e5656a 1674 hEtaChargedClone2->SetXTitle("#eta");
9725fd2a 1675 hEtaChargedClone2->Divide(fhEta);
1676 hEtaChargedClone2->Draw();
1677
1678 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsOuter.eps",fCalorimeter.Data());
8a587055 1679 c333->Print(name); printf("Plot: %s\n",name);
06e5656a 1680
1681 //Reconstructed distributions, matched with tracks but no outer param
9725fd2a 1682 //printf("c2\n");
1683 sprintf(cname,"QA_%s_rectrackmatch_noout",fCalorimeter.Data());
1684 TCanvas * c22 = new TCanvas(cname, "Reconstructed distributions, matched with tracks, no outer track param", 400, 400) ;
1685 c22->Divide(2, 2);
1686
1687 c22->cd(1) ;
8a587055 1688 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1689 fhEChargedNoOut->SetLineColor(4);
1690 fhEChargedNoOut->Draw();
1691
1692 c22->cd(2) ;
8a587055 1693 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1694 fhPtChargedNoOut->SetLineColor(4);
1695 fhPtChargedNoOut->Draw();
1696
1697 c22->cd(3) ;
1698 fhPhiChargedNoOut->SetLineColor(4);
1699 fhPhiChargedNoOut->Draw();
1700
1701 c22->cd(4) ;
1702 fhEtaChargedNoOut->SetLineColor(4);
1703 fhEtaChargedNoOut->Draw();
1704
1705 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched_NoOutParam.eps",fCalorimeter.Data());
8a587055 1706 c22->Print(name); printf("Plot: %s\n",name);
9725fd2a 1707
1708 //Ratio: reconstructed track matched/ all reconstructed
06e5656a 1709 //printf("c3\n");
1710
1711// TH1F * hEChargedNoOutClone = (TH1F*) fhEChargedNoOut->Clone("EChargedNoOutClone");
1712// TH1F * hPtChargedNoOutClone = (TH1F*) fhPtChargedNoOut->Clone("PtChargedNoOutClone");
1713// TH1F * hEtaChargedNoOutClone = (TH1F*) fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
1714// TH1F * hPhiChargedNoOutClone = (TH1F*) fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");
1715
1716// sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
1717// TCanvas * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
1718// c33->Divide(2, 2);
1719//
1720// c33->cd(1) ;
1721// hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1722// hEChargedNoOutClone->SetXTitle("E (GeV)");
1723// hEChargedNoOutClone->Divide(fhECharged);
1724// hEChargedNoOutClone->Draw();
1725//
1726// c33->cd(2) ;
1727// hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
1728// hPtChargedNoOutClone->SetXTitle("p_{T} (GeV/c)");
1729// hPtChargedNoOutClone->Divide(fhPtCharged);
1730// hPtChargedNoOutClone->Draw();
1731//
1732// c33->cd(3) ;
1733// hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1734// hPhiChargedNoOutClone->SetXTitle("#phi (rad)");
1735// hPhiChargedNoOutClone->Divide(fhPhiCharged);
1736// hPhiChargedNoOutClone->Draw();
1737//
1738// c33->cd(4) ;
1739// hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1740// hEtaChargedNoOutClone->SetXTitle("#eta");
1741// hEtaChargedNoOutClone->Divide(fhEtaCharged);
1742// hEtaChargedNoOutClone->Draw();
1743//
1744// sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
8a587055 1745// c33->Print(name); printf("Plot: %s\n",name);
06e5656a 1746
1747
9725fd2a 1748 //eta vs phi
1749 //printf("c4\n");
1750 sprintf(cname,"QA_%s_etavsphi",fCalorimeter.Data());
06e5656a 1751 // TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 600, 200) ;
1752 // c4->Divide(3, 1);
1753
1754 TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 400, 200) ;
1755 c4->Divide(2, 1);
1756
9725fd2a 1757 c4->cd(1) ;
1758 fhEtaPhi->Draw("cont");
1759
1760 c4->cd(2) ;
1761 fhEtaPhiCharged->Draw("cont");
1762
06e5656a 1763 // c4->cd(3) ;
1764 // fhEtaPhiChargedNoOut->Draw("cont");
1765
9725fd2a 1766 sprintf(name,"QA_%s_ReconstructedEtaVsPhi.eps",fCalorimeter.Data());
8a587055 1767 c4->Print(name); printf("Plot: %s\n",name);
9725fd2a 1768
1769 //Invariant mass
1770 Int_t binmin = -1;
1771 Int_t binmax = -1;
06e5656a 1772
9725fd2a 1773 if(fhIM->GetEntries() > 1){
1774 Int_t nebins = fhIM->GetNbinsX();
1775 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
1776 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
1777 if (emin != 0 ) printf("emin != 0 \n");
1778 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
1779
1780 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
06e5656a 1781 // printf("c5\n");
9725fd2a 1782 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 400, 400) ;
1783 c5->Divide(2, 2);
1784
1785 c5->cd(1) ;
1786 fhIM->SetLineColor(4);
1787 fhIM->Draw();
1788
1789 c5->cd(2) ;
1790 binmin = 0;
1791 binmax = (Int_t) (5-emin)*nebins/emax;
1792 TH1D *pyim5 = fhIM->ProjectionY("pyim5",binmin,binmax);
1793 pyim5->SetTitle("E_{pair} < 5 GeV");
1794 pyim5->SetLineColor(4);
1795 pyim5->Draw();
1796
1797 c5->cd(3) ;
1798 binmin = (Int_t) (5-emin)*nebins/emax;
1799 binmax = (Int_t) (10-emin)*nebins/emax;
1800 TH1D *pyim510 = fhIM->ProjectionY("pyim5_10",binmin,binmax);
1801 pyim510->SetTitle("5 < E_{pair} < 10 GeV");
1802 pyim510->SetLineColor(4);
1803 pyim510->Draw();
1804
1805 c5->cd(4) ;
1806 binmin = (Int_t) (10-emin)*nebins/emax;
1807 binmax = -1;
1808 TH1D *pyim10 = fhIM->ProjectionY("pyim10",binmin,binmax);
1809 pyim10->SetTitle("E_{pair} > 10 GeV");
1810 pyim10->SetLineColor(4);
1811 pyim10->Draw();
1812
1813 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
8a587055 1814 c5->Print(name); printf("Plot: %s\n",name);
9725fd2a 1815 }
1816
1817 //Asymmetry
1818 if(fhAsym->GetEntries() > 1){
1819 Int_t nebins = fhAsym->GetNbinsX();
1820 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
1821 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
1822 if (emin != 0 ) printf("emin != 0 \n");
1823 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
1824
1825 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
1826 // printf("c5\n");
1827 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
1828 c5b->Divide(2, 2);
1829
1830 c5b->cd(1) ;
06e5656a 1831 fhAsym->SetTitleOffset(1.6,"Y");
9725fd2a 1832 fhAsym->SetLineColor(4);
1833 fhAsym->Draw();
1834
1835 c5b->cd(2) ;
1836 binmin = 0;
1837 binmax = (Int_t) (5-emin)*nebins/emax;
1838 TH1D *pyAsym5 = fhAsym->ProjectionY("pyAsym5",binmin,binmax);
1839 pyAsym5->SetTitle("E_{pair} < 5 GeV");
1840 pyAsym5->SetLineColor(4);
1841 pyAsym5->Draw();
1842
1843 c5b->cd(3) ;
1844 binmin = (Int_t) (5-emin)*nebins/emax;
1845 binmax = (Int_t) (10-emin)*nebins/emax;
1846 TH1D *pyAsym510 = fhAsym->ProjectionY("pyAsym5_10",binmin,binmax);
1847 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
1848 pyAsym510->SetLineColor(4);
1849 pyAsym510->Draw();
1850
1851 c5b->cd(4) ;
1852 binmin = (Int_t) (10-emin)*nebins/emax;
1853 binmax = -1;
1854 TH1D *pyAsym10 = fhAsym->ProjectionY("pyAsym10",binmin,binmax);
1855 pyAsym10->SetTitle("E_{pair} > 10 GeV");
1856 pyAsym10->SetLineColor(4);
1857 pyAsym10->Draw();
1858
1859 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
8a587055 1860 c5b->Print(name); printf("Plot: %s\n",name);
9725fd2a 1861 }
1862
8a587055 1863 if(IsDataMC()){
9725fd2a 1864 //Reconstructed vs MC distributions
1865 //printf("c6\n");
1866 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
1867 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
1868 c6->Divide(2, 2);
1869
1870 c6->cd(1) ;
06e5656a 1871 fh2E->SetTitleOffset(1.6,"Y");
9725fd2a 1872 fh2E->SetLineColor(4);
1873 fh2E->Draw();
1874
1875 c6->cd(2) ;
06e5656a 1876 fh2Pt->SetTitleOffset(1.6,"Y");
9725fd2a 1877 fh2Pt->SetLineColor(4);
1878 fh2Pt->Draw();
1879
1880 c6->cd(3) ;
06e5656a 1881 fh2Phi->SetTitleOffset(1.6,"Y");
9725fd2a 1882 fh2Phi->SetLineColor(4);
1883 fh2Phi->Draw();
1884
1885 c6->cd(4) ;
06e5656a 1886 fh2Eta->SetTitleOffset(1.6,"Y");
9725fd2a 1887 fh2Eta->SetLineColor(4);
1888 fh2Eta->Draw();
1889
1890 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
8a587055 1891 c6->Print(name); printf("Plot: %s\n",name);
9725fd2a 1892
9725fd2a 1893 //Reconstructed vs MC distributions
1894 //printf("c6\n");
1895 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
1896 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
1897 c6Gam->Divide(2, 2);
1898
1899 c6Gam->cd(1) ;
06e5656a 1900 fhGamE->Draw();
9725fd2a 1901
1902 c6Gam->cd(2) ;
06e5656a 1903 fhGamPt->Draw();
9725fd2a 1904
1905 c6Gam->cd(3) ;
06e5656a 1906 fhGamPhi->Draw();
9725fd2a 1907
1908 c6Gam->cd(4) ;
06e5656a 1909 fhGamEta->Draw();
9725fd2a 1910
1911 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
8a587055 1912 c6->Print(name); printf("Plot: %s\n",name);
06e5656a 1913
9725fd2a 1914 //Generated - reconstructed
1915 //printf("c7\n");
1916 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
1917 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
1918 c7->Divide(2, 2);
1919
1920 c7->cd(1) ;
8a587055 1921 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1922 fhGamDeltaE->SetLineColor(4);
1923 fhDeltaE->Draw();
1924 fhGamDeltaE->Draw("same");
06e5656a 1925
9725fd2a 1926 TLegend pLegendd(0.65,0.55,0.9,0.8);
1927 pLegendd.SetTextSize(0.06);
1928 pLegendd.AddEntry(fhDeltaE,"all","L");
1929 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
1930 pLegendd.SetFillColor(10);
1931 pLegendd.SetBorderSize(1);
1932 pLegendd.Draw();
06e5656a 1933
9725fd2a 1934 c7->cd(2) ;
8a587055 1935 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1936 fhGamDeltaPt->SetLineColor(4);
1937 fhDeltaPt->Draw();
06e5656a 1938 fhGamDeltaPt->Draw("same");
1939
9725fd2a 1940 c7->cd(3) ;
1941 fhGamDeltaPhi->SetLineColor(4);
1942 fhDeltaPhi->Draw();
06e5656a 1943 fhGamDeltaPhi->Draw("same");
9725fd2a 1944
1945 c7->cd(4) ;
1946 fhGamDeltaEta->SetLineColor(4);
1947 fhDeltaEta->Draw();
1948 fhGamDeltaEta->Draw("same");
06e5656a 1949
9725fd2a 1950 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
8a587055 1951 c7->Print(name); printf("Plot: %s\n",name);
9725fd2a 1952
9725fd2a 1953 // Reconstructed / Generated
1954 //printf("c8\n");
1955 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
1956 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
1957 c8->Divide(2, 2);
1958
1959 c8->cd(1) ;
8a587055 1960 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1961 fhGamRatioE->SetLineColor(4);
1962 fhRatioE->Draw();
1963 fhGamRatioE->Draw("same");
06e5656a 1964
9725fd2a 1965 TLegend pLegendr(0.65,0.55,0.9,0.8);
1966 pLegendr.SetTextSize(0.06);
1967 pLegendr.AddEntry(fhRatioE,"all","L");
1968 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
1969 pLegendr.SetFillColor(10);
1970 pLegendr.SetBorderSize(1);
1971 pLegendr.Draw();
06e5656a 1972
9725fd2a 1973 c8->cd(2) ;
8a587055 1974 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
9725fd2a 1975 fhGamRatioPt->SetLineColor(4);
1976 fhRatioPt->Draw();
06e5656a 1977 fhGamRatioPt->Draw("same");
1978
9725fd2a 1979 c8->cd(3) ;
1980 fhGamRatioPhi->SetLineColor(4);
1981 fhRatioPhi->Draw();
06e5656a 1982 fhGamRatioPhi->Draw("same");
1983
9725fd2a 1984 c8->cd(4) ;
1985 fhGamRatioEta->SetLineColor(4);
1986 fhRatioEta->Draw();
06e5656a 1987 fhGamRatioEta->Draw("same");
1988
9725fd2a 1989 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
8a587055 1990 c8->Print(name); printf("Plot: %s\n",name);
9725fd2a 1991
1992 //MC
1993
1994 //Generated distributions
1995 //printf("c1\n");
1996 sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
1997 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
1998 c10->Divide(3, 1);
1999
2000 c10->cd(1) ;
2001 gPad->SetLogy();
2002 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone("axispt");
2003 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
2004 fhGenPi0Pt->SetLineColor(1);
2005 fhGenGamPt->SetLineColor(4);
2006 fhGenEtaPt->SetLineColor(2);
2007 fhGenOmegaPt->SetLineColor(7);
2008 fhGenElePt->SetLineColor(6);
2009
2010 //Select the maximum of the histogram to show all lines.
2011 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
2012 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
2013 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
2014 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
06e5656a 2015 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
9725fd2a 2016 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
2017 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
2018 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
2019 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
2020 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
2021 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
2022 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
2023 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
2024 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
2025 haxispt->SetMaximum(fhGenElePt->GetMaximum());
06e5656a 2026 haxispt->SetMinimum(1);
9725fd2a 2027 haxispt->Draw("axis");
2028 fhGenPi0Pt->Draw("same");
2029 fhGenGamPt->Draw("same");
2030 fhGenEtaPt->Draw("same");
2031 fhGenOmegaPt->Draw("same");
2032 fhGenElePt->Draw("same");
2033
06e5656a 2034 TLegend pLegend(0.85,0.65,0.95,0.93);
9725fd2a 2035 pLegend.SetTextSize(0.06);
06e5656a 2036 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
2037 pLegend.AddEntry(fhGenGamPt," #gamma","L");
2038 pLegend.AddEntry(fhGenEtaPt," #eta","L");
2039 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
2040 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
9725fd2a 2041 pLegend.SetFillColor(10);
2042 pLegend.SetBorderSize(1);
2043 pLegend.Draw();
2044
2045 c10->cd(2) ;
2046 gPad->SetLogy();
2047 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone("axiseta");
2048 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
2049 fhGenPi0Eta->SetLineColor(1);
2050 fhGenGamEta->SetLineColor(4);
2051 fhGenEtaEta->SetLineColor(2);
2052 fhGenOmegaEta->SetLineColor(7);
2053 fhGenEleEta->SetLineColor(6);
2054 //Select the maximum of the histogram to show all lines.
2055 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
2056 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
2057 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
2058 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
2059 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
2060 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
2061 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
2062 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
2063 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
2064 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
2065 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
2066 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
2067 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
2068 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
2069 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
06e5656a 2070 haxiseta->SetMinimum(100);
9725fd2a 2071 haxiseta->Draw("axis");
2072 fhGenPi0Eta->Draw("same");
2073 fhGenGamEta->Draw("same");
2074 fhGenEtaEta->Draw("same");
2075 fhGenOmegaEta->Draw("same");
2076 fhGenEleEta->Draw("same");
2077
2078
2079 c10->cd(3) ;
2080 gPad->SetLogy();
2081 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone("axisphi");
2082 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
2083 fhGenPi0Phi->SetLineColor(1);
2084 fhGenGamPhi->SetLineColor(4);
2085 fhGenEtaPhi->SetLineColor(2);
2086 fhGenOmegaPhi->SetLineColor(7);
2087 fhGenElePhi->SetLineColor(6);
2088 //Select the maximum of the histogram to show all lines.
2089 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
2090 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
2091 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
2092 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
2093 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
2094 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
2095 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
2096 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
2097 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
2098 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
2099 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
2100 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
2101 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
2102 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
2103 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
06e5656a 2104 haxisphi->SetMinimum(100);
9725fd2a 2105 haxisphi->Draw("axis");
2106 fhGenPi0Phi->Draw("same");
2107 fhGenGamPhi->Draw("same");
2108 fhGenEtaPhi->Draw("same");
2109 fhGenOmegaPhi->Draw("same");
2110 fhGenElePhi->Draw("same");
2111
2112 sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
8a587055 2113 c10->Print(name); printf("Plot: %s\n",name);
9725fd2a 2114
2115
2116 //Reconstructed clusters depending on its original particle.
2117 //printf("c1\n");
2118 sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
2119 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
2120 c11->Divide(2, 2);
2121
2122
2123 c11->cd(1) ;
2124 gPad->SetLogy();
06e5656a 2125 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX("hGamE",-1,-1);
2126 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX("hPi0E",-1,-1);
2127 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX("hEleE",-1,-1);
2128 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX("hNeHadE",-1,-1);
2129 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX("hChHadE",-1,-1);
9725fd2a 2130 TH1F * haxisE = (TH1F*) hPi0E->Clone("axisE");
2131 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
2132 hPi0E->SetLineColor(1);
2133 hGamE->SetLineColor(4);
2134 hNeHadE->SetLineColor(2);
2135 hChHadE->SetLineColor(7);
2136 hEleE->SetLineColor(6);
2137
2138 //Select the maximum of the histogram to show all lines.
2139 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
2140 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
2141 haxisE->SetMaximum(hPi0E->GetMaximum());
2142 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
2143 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
2144 haxisE->SetMaximum(hGamE->GetMaximum());
2145 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
2146 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
2147 haxisE->SetMaximum(hNeHadE->GetMaximum());
2148 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
2149 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
2150 haxisE->SetMaximum(hChHadE->GetMaximum());
2151 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
2152 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
2153 haxisE->SetMaximum(hEleE->GetMaximum());
06e5656a 2154 haxisE->SetXTitle("E (GeV)");
2155 haxisE->SetMinimum(1);
9725fd2a 2156 haxisE->Draw("axis");
2157 hPi0E->Draw("same");
2158 hGamE->Draw("same");
2159 hNeHadE->Draw("same");
2160 hChHadE->Draw("same");
2161 hEleE->Draw("same");
2162
06e5656a 2163 TLegend pLegend2(0.8,0.65,0.95,0.93);
9725fd2a 2164 pLegend2.SetTextSize(0.06);
06e5656a 2165 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
2166 pLegend2.AddEntry(hGamE," #gamma","L");
2167 pLegend2.AddEntry(hEleE," e^{#pm}","L");
2168 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
2169 pLegend2.AddEntry(hNeHadE," h^{0}","L");
9725fd2a 2170 pLegend2.SetFillColor(10);
2171 pLegend2.SetBorderSize(1);
2172 pLegend2.Draw();
2173
2174
2175 c11->cd(2) ;
2176 gPad->SetLogy();
2177 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
06e5656a 2178 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX("hGamPt",-1,-1);
2179 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX("hPi0Pt",-1,-1);
2180 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX("hElePt",-1,-1);
2181 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX("hNeHadPt",-1,-1);
2182 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX("hChHadPt",-1,-1);
9725fd2a 2183 haxispt = (TH1F*) hPi0Pt->Clone("axispt");
2184 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
2185 hPi0Pt->SetLineColor(1);
2186 hGamPt->SetLineColor(4);
2187 hNeHadPt->SetLineColor(2);
2188 hChHadPt->SetLineColor(7);
2189 hElePt->SetLineColor(6);
2190
2191 //Select the maximum of the histogram to show all lines.
2192 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
2193 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
2194 haxispt->SetMaximum(hPi0Pt->GetMaximum());
2195 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
2196 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
2197 haxispt->SetMaximum(hGamPt->GetMaximum());
2198 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
2199 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
2200 haxispt->SetMaximum(hNeHadPt->GetMaximum());
2201 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
2202 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
2203 haxispt->SetMaximum(hChHadPt->GetMaximum());
2204 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
2205 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
2206 haxispt->SetMaximum(hElePt->GetMaximum());
06e5656a 2207 haxispt->SetXTitle("p_{T} (GeV/c)");
2208 haxispt->SetMinimum(1);
9725fd2a 2209 haxispt->Draw("axis");
2210 hPi0Pt->Draw("same");
2211 hGamPt->Draw("same");
2212 hNeHadPt->Draw("same");
2213 hChHadPt->Draw("same");
06e5656a 2214 hElePt->Draw("same");
9725fd2a 2215
2216
2217 c11->cd(3) ;
2218 gPad->SetLogy();
06e5656a 2219
2220 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX("hGamEta",-1,-1);
2221 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX("hPi0Eta",-1,-1);
2222 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX("hEleEta",-1,-1);
2223 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX("hNeHadEta",-1,-1);
2224 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX("hChHadEta",-1,-1);
9725fd2a 2225 haxiseta = (TH1F*) hPi0Eta->Clone("axiseta");
2226 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
2227 hPi0Eta->SetLineColor(1);
2228 hGamEta->SetLineColor(4);
2229 hNeHadEta->SetLineColor(2);
2230 hChHadEta->SetLineColor(7);
2231 hEleEta->SetLineColor(6);
2232 //Select the maximum of the histogram to show all lines.
2233 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
2234 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
2235 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
2236 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
2237 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
2238 haxiseta->SetMaximum(hGamEta->GetMaximum());
2239 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
2240 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
2241 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
2242 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
2243 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
2244 haxiseta->SetMaximum(hChHadEta->GetMaximum());
2245 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
2246 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
2247 haxiseta->SetMaximum(hEleEta->GetMaximum());
2248
06e5656a 2249 haxiseta->SetXTitle("#eta");
9725fd2a 2250 haxiseta->Draw("axis");
2251 hPi0Eta->Draw("same");
2252 hGamEta->Draw("same");
2253 hNeHadEta->Draw("same");
2254 hChHadEta->Draw("same");
2255 hEleEta->Draw("same");
2256
2257
2258 c11->cd(4) ;
2259 gPad->SetLogy();
06e5656a 2260 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX("hGamPhi",-1,-1);
2261 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX("hPi0Phi",-1,-1);
2262 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX("hElePhi",-1,-1);
2263 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX("hNeHadPhi",-1,-1);
2264 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX("hChHadPhi",-1,-1);
9725fd2a 2265 haxisphi = (TH1F*) hPi0Phi->Clone("axisphi");
2266 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
06e5656a 2267
9725fd2a 2268 hPi0Phi->SetLineColor(1);
2269 hGamPhi->SetLineColor(4);
2270 hNeHadPhi->SetLineColor(2);
2271 hChHadPhi->SetLineColor(7);
2272 hElePhi->SetLineColor(6);
2273 //Select the maximum of the histogram to show all lines.
2274 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
2275 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
2276 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
2277 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
2278 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
2279 haxisphi->SetMaximum(hGamPhi->GetMaximum());
2280 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
2281 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
2282 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
2283 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
2284 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
2285 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
2286 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
2287 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
2288 haxisphi->SetMaximum(hElePhi->GetMaximum());
06e5656a 2289 haxisphi->SetXTitle("#phi (rad)");
9725fd2a 2290 haxisphi->Draw("axis");
2291 hPi0Phi->Draw("same");
2292 hGamPhi->Draw("same");
2293 hNeHadPhi->Draw("same");
2294 hChHadPhi->Draw("same");
2295 hElePhi->Draw("same");
2296
2297 sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
8a587055 2298 c11->Print(name); printf("Plot: %s\n",name);
9725fd2a 2299
2300
2301 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
06e5656a 2302 //printf("c1\n");
9725fd2a 2303
2304 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone("hPi0EClone");
2305 TH1F * hGamEClone = (TH1F*) hGamE ->Clone("hGamEClone");
2306 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone("hPi0PtClone");
2307 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone("hGamPtClone");
2308 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone("hPi0EtaClone");
2309 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone("hGamEtaClone");
2310 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone("hPi0PhiClone");
06e5656a 2311 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone("hGamPhiClone");
2312
9725fd2a 2313 sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
2314 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
2315 c12->Divide(2, 2);
2316
2317 c12->cd(1) ;
2318 gPad->SetLogy();
2319 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
2320 hPi0EClone->Divide(fhGenPi0AccE);
2321 hGamEClone->Divide(fhGenGamAccE);
06e5656a 2322 haxisE->SetMaximum(5);
2323 haxisE->SetMinimum(1e-2);
2324 haxisE->SetXTitle("E (GeV)");
9725fd2a 2325 haxisE->SetYTitle("ratio = rec/gen");
2326 haxisE->Draw("axis");
06e5656a 2327 hPi0E->Draw("same");
2328 hGamE->Draw("same");
9725fd2a 2329
06e5656a 2330 TLegend pLegend3(0.75,0.2,0.9,0.4);
9725fd2a 2331 pLegend3.SetTextSize(0.06);
06e5656a 2332 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
2333 pLegend3.AddEntry(hGamEClone," #gamma","L");
9725fd2a 2334 pLegend3.SetFillColor(10);
2335 pLegend3.SetBorderSize(1);
2336 pLegend3.Draw();
2337
2338 c12->cd(2) ;
2339 gPad->SetLogy();
2340 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
2341 hPi0PtClone->Divide(fhGenPi0AccPt);
2342 hGamPtClone->Divide(fhGenGamAccPt);
06e5656a 2343 haxispt->SetMaximum(5);
2344 haxispt->SetMinimum(1e-2);
2345 haxispt->SetXTitle("p_{T} (GeV/c)");
9725fd2a 2346 haxispt->SetYTitle("ratio = rec/gen");
2347 haxispt->Draw("axis");
9725fd2a 2348 hPi0PtClone->Draw("same");
2349 hGamPtClone->Draw("same");
2350
2351 c12->cd(3) ;
2352 gPad->SetLogy();
2353
2354 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
2355 hPi0EtaClone->Divide(fhGenPi0AccEta);
2356 hGamEtaClone->Divide(fhGenGamAccEta);
2357 haxiseta->SetMaximum(1.2);
06e5656a 2358 haxiseta->SetMinimum(1e-2);
9725fd2a 2359 haxiseta->SetYTitle("ratio = rec/gen");
06e5656a 2360 haxiseta->SetXTitle("#eta");
9725fd2a 2361 haxiseta->Draw("axis");
9725fd2a 2362 hPi0EtaClone->Draw("same");
2363 hGamEtaClone->Draw("same");
2364
2365
2366 c12->cd(4) ;
2367 gPad->SetLogy();
2368 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
2369 hPi0PhiClone->Divide(fhGenPi0AccPhi);
2370 hGamPhiClone->Divide(fhGenGamAccPhi);
06e5656a 2371 haxisphi->SetYTitle("ratio = rec/gen");
2372 haxisphi->SetXTitle("#phi (rad)");
9725fd2a 2373 haxisphi->SetMaximum(1.2);
06e5656a 2374 haxisphi->SetMinimum(1e-2);
9725fd2a 2375 haxisphi->Draw("axis");
9725fd2a 2376 hPi0PhiClone->Draw("same");
2377 hGamPhiClone->Draw("same");
2378
9725fd2a 2379 sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
8a587055 2380 c12->Print(name); printf("Plot: %s\n",name);
2381
9725fd2a 2382
2383
2384 //Reconstructed distributions
2385 //printf("c1\n");
2386 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
2387 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
2388 c13->Divide(2, 2);
2389
2390 c13->cd(1) ;
2391 //gPad->SetLogy();
06e5656a 2392 fhEMVxyz->SetTitleOffset(1.6,"Y");
2393 fhEMVxyz->Draw();
9725fd2a 2394
2395 c13->cd(2) ;
2396 //gPad->SetLogy();
06e5656a 2397 fhHaVxyz->SetTitleOffset(1.6,"Y");
9725fd2a 2398 fhHaVxyz->Draw();
2399
2400 c13->cd(3) ;
2401 gPad->SetLogy();
2402 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY("hEM",-1,-1);
2403 hEMR->SetLineColor(4);
2404 hEMR->Draw();
2405
2406 c13->cd(4) ;
2407 gPad->SetLogy();
2408 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY("hHa",-1,-1);
2409 hHaR->SetLineColor(4);
2410 hHaR->Draw();
2411
2412
2413 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
8a587055 2414 c13->Print(name); printf("Plot: %s\n",name);
9725fd2a 2415
2416
06e5656a 2417 //Track-matching distributions
8a587055 2418
06e5656a 2419 //Reconstructed distributions, matched with tracks, generated particle dependence
2420 //printf("c2\n");
2421 sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
2422 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
2423 c22ch->Divide(2, 2);
2424
2425 c22ch->cd(1) ;
2426
2427 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX("hGamECharged",-1,-1);
2428 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX("hPi0ECharged",-1,-1);
2429 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX("hEleECharged",-1,-1);
2430 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX("hNeHadECharged",-1,-1);
2431 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX("hChHadECharged",-1,-1);
2432 hPi0ECharged->SetLineColor(1);
2433 hGamECharged->SetLineColor(4);
2434 hNeHadECharged->SetLineColor(2);
2435 hChHadECharged->SetLineColor(7);
2436 hEleECharged->SetLineColor(6);
2437 gPad->SetLogy();
2438 fhECharged->SetLineColor(3);
2439 fhECharged->SetMinimum(0.5);
2440 fhECharged->Draw();
2441 hPi0ECharged->Draw("same");
2442 hGamECharged->Draw("same");
2443 hNeHadECharged->Draw("same");
2444 hChHadECharged->Draw("same");
2445 hEleECharged->Draw("same");
2446 TLegend pLegend22(0.75,0.45,0.9,0.8);
2447 pLegend22.SetTextSize(0.06);
2448 pLegend22.AddEntry(fhECharged,"all","L");
2449 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
2450 pLegend22.AddEntry(hGamECharged,"#gamma","L");
2451 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
2452 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
2453 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
2454 pLegend22.SetFillColor(10);
2455 pLegend22.SetBorderSize(1);
2456 pLegend22.Draw();
2457
2458 c22ch->cd(2) ;
2459
2460 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX("hGamPtCharged",-1,-1);
2461 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX("hPi0PtCharged",-1,-1);
2462 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX("hElePtCharged",-1,-1);
2463 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX("hNeHadPtCharged",-1,-1);
2464 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX("hChHadPtCharged",-1,-1);
2465 hPi0PtCharged->SetLineColor(1);
2466 hGamPtCharged->SetLineColor(4);
2467 hNeHadPtCharged->SetLineColor(2);
2468 hChHadPtCharged->SetLineColor(7);
2469 hElePtCharged->SetLineColor(6);
2470 gPad->SetLogy();
2471 fhPtCharged->SetLineColor(3);
2472 fhPtCharged->SetMinimum(0.5);
2473 fhPtCharged->Draw();
2474 hPi0PtCharged->Draw("same");
2475 hGamPtCharged->Draw("same");
2476 hNeHadPtCharged->Draw("same");
2477 hChHadPtCharged->Draw("same");
2478 hElePtCharged->Draw("same");
2479
2480 c22ch->cd(4) ;
2481
2482 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX("hGamEtaCharged",-1,-1);
2483 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX("hPi0EtaCharged",-1,-1);
2484 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX("hEleEtaCharged",-1,-1);
2485 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX("hNeHadEtaCharged",-1,-1);
2486 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX("hChHadEtaCharged",-1,-1);
2487 hPi0EtaCharged->SetLineColor(1);
2488 hGamEtaCharged->SetLineColor(4);
2489 hNeHadEtaCharged->SetLineColor(2);
2490 hChHadEtaCharged->SetLineColor(7);
2491 hEleEtaCharged->SetLineColor(6);
2492 gPad->SetLogy();
2493 fhEtaCharged->SetLineColor(3);
2494 fhEtaCharged->SetMinimum(0.5);
2495 fhEtaCharged->Draw();
2496 hPi0EtaCharged->Draw("same");
2497 hGamEtaCharged->Draw("same");
2498 hNeHadEtaCharged->Draw("same");
2499 hChHadEtaCharged->Draw("same");
2500 hEleEtaCharged->Draw("same");
2501
2502 c22ch->cd(3) ;
2503
2504 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX("hGamPhiCharged",-1,-1);
2505 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX("hPi0PhiCharged",-1,-1);
2506 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX("hElePhiCharged",-1,-1);
2507 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX("hNeHadPhiCharged",-1,-1);
2508 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX("hChHadPhiCharged",-1,-1);
2509 hPi0PhiCharged->SetLineColor(1);
2510 hGamPhiCharged->SetLineColor(4);
2511 hNeHadPhiCharged->SetLineColor(2);
2512 hChHadPhiCharged->SetLineColor(7);
2513 hElePhiCharged->SetLineColor(6);
2514 gPad->SetLogy();
2515 fhPhiCharged->SetLineColor(3);
2516 fhPhiCharged->SetMinimum(0.5);
2517 fhPhiCharged->Draw();
2518 hPi0PhiCharged->Draw("same");
2519 hGamPhiCharged->Draw("same");
2520 hNeHadPhiCharged->Draw("same");
2521 hChHadPhiCharged->Draw("same");
2522 hElePhiCharged->Draw("same");
2523
2524
2525 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
8a587055 2526 c22ch->Print(name); printf("Plot: %s\n",name);
06e5656a 2527
2528 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone("GamEChargedClone");
2529 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone("GamPtChargedClone");
2530 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone("GamEtaChargedClone");
2531 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone("GamPhiChargedClone");
2532
2533 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone("Pi0EChargedClone");
2534 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone("Pi0PtChargedClone");
2535 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone("Pi0EtaChargedClone");
2536 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone("Pi0PhiChargedClone");
2537
2538 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone("EleEChargedClone");
2539 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone("ElePtChargedClone");
2540 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone("EleEtaChargedClone");
2541 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone("ElePhiChargedClone");
2542
2543 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone("NeHadEChargedClone");
2544 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone("NeHadPtChargedClone");
2545 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone("NeHadEtaChargedClone");
2546 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone("NeHadPhiChargedClone");
2547
2548 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone("ChHadEChargedClone");
2549 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone("ChHadPtChargedClone");
2550 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone("ChHadEtaChargedClone");
2551 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone("ChHadPhiChargedClone");
2552
2553 //Ratio: reconstructed track matched/ all reconstructed
2554 //printf("c3\n");
2555 sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
2556 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
2557 c3ch->Divide(2, 2);
2558
2559 c3ch->cd(1) ;
2560 hEChargedClone->SetMaximum(1.2);
2561 hEChargedClone->SetMinimum(0.001);
2562 hEChargedClone->SetLineColor(3);
2563 hEChargedClone->SetYTitle("track matched / all");
2564 hPi0EChargedClone->Divide(hPi0E);
2565 hGamEChargedClone->Divide(hGamE);
2566 hEleEChargedClone->Divide(hEleE);
2567 hNeHadEChargedClone->Divide(hNeHadE);
2568 hChHadEChargedClone->Divide(hChHadE);
2569 hEChargedClone->Draw();
2570 hPi0EChargedClone->Draw("same");
2571 hGamEChargedClone->Draw("same");
2572 hEleEChargedClone->Draw("same");
2573 hNeHadEChargedClone->Draw("same");
2574 hChHadEChargedClone->Draw("same");
2575
2576 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
2577 pLegend3ch.SetTextSize(0.06);
2578 pLegend3ch.AddEntry(hEChargedClone,"all","L");
2579 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
2580 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
2581 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
2582 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
2583 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
2584 pLegend3ch.SetFillColor(10);
2585 pLegend3ch.SetBorderSize(1);
2586 pLegend3ch.Draw();
2587
2588 c3ch->cd(2) ;
2589 hPtChargedClone->SetMaximum(1.2);
2590 hPtChargedClone->SetMinimum(0.001);
2591 hPtChargedClone->SetLineColor(3);
2592 hPtChargedClone->SetYTitle("track matched / all");
2593 hPi0PtChargedClone->Divide(hPi0Pt);
2594 hGamPtChargedClone->Divide(hGamPt);
2595 hElePtChargedClone->Divide(hElePt);
2596 hNeHadPtChargedClone->Divide(hNeHadPt);
2597 hChHadPtChargedClone->Divide(hChHadPt);
2598 hPtChargedClone->Draw();
2599 hPi0PtChargedClone->Draw("same");
2600 hGamPtChargedClone->Draw("same");
2601 hElePtChargedClone->Draw("same");
2602 hNeHadPtChargedClone->Draw("same");
2603 hChHadPtChargedClone->Draw("same");
2604
2605 c3ch->cd(4) ;
2606 hEtaChargedClone->SetMaximum(1.2);
2607 hEtaChargedClone->SetMinimum(0.001);
2608 hEtaChargedClone->SetLineColor(3);
2609 hEtaChargedClone->SetYTitle("track matched / all");
2610 hPi0EtaChargedClone->Divide(hPi0Eta);
2611 hGamEtaChargedClone->Divide(hGamEta);
2612 hEleEtaChargedClone->Divide(hEleEta);
2613 hNeHadEtaChargedClone->Divide(hNeHadEta);
2614 hChHadEtaChargedClone->Divide(hChHadEta);
2615 hEtaChargedClone->Draw();
2616 hPi0EtaChargedClone->Draw("same");
2617 hGamEtaChargedClone->Draw("same");
2618 hEleEtaChargedClone->Draw("same");
2619 hNeHadEtaChargedClone->Draw("same");
2620 hChHadEtaChargedClone->Draw("same");
2621
2622 c3ch->cd(3) ;
2623 hPhiChargedClone->SetMaximum(1.2);
2624 hPhiChargedClone->SetMinimum(0.001);
2625 hPhiChargedClone->SetLineColor(3);
2626 hPhiChargedClone->SetYTitle("track matched / all");
2627 hPi0PhiChargedClone->Divide(hPi0Phi);
2628 hGamPhiChargedClone->Divide(hGamPhi);
2629 hElePhiChargedClone->Divide(hElePhi);
2630 hNeHadPhiChargedClone->Divide(hNeHadPhi);
2631 hChHadPhiChargedClone->Divide(hChHadPhi);
2632 hPhiChargedClone->Draw();
2633 hPi0PhiChargedClone->Draw("same");
2634 hGamPhiChargedClone->Draw("same");
2635 hElePhiChargedClone->Draw("same");
2636 hNeHadPhiChargedClone->Draw("same");
2637 hChHadPhiChargedClone->Draw("same");
2638
2639 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
8a587055 2640 c3ch->Print(name); printf("Plot: %s\n",name);
06e5656a 2641
8a587055 2642 }
9725fd2a 2643 //Track-matching distributions
2644 if(!strcmp(GetReader()->GetInputEvent()->GetName(),"AliESDEvent")){
06e5656a 2645
2646
9725fd2a 2647 sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
2648 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
2649 cme->Divide(2,2);
2650
06e5656a 2651 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
2652 pLegendpE0.SetTextSize(0.04);
2653 pLegendpE0.AddEntry(fh1pOverE,"all","L");
2654 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
2655 pLegendpE0.SetFillColor(10);
2656 pLegendpE0.SetBorderSize(1);
2657 //pLegendpE0.Draw();
2658
9725fd2a 2659 cme->cd(1);
8a587055 2660 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
06e5656a 2661 fh1pOverE->SetTitle("Track matches p/E");
9725fd2a 2662 fh1pOverE->Draw();
06e5656a 2663 fh1pOverER02->SetLineColor(4);
2664 fh1pOverER02->Draw("same");
2665 pLegendpE0.Draw();
9725fd2a 2666
2667 cme->cd(2);
8a587055 2668 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
9725fd2a 2669 fh1dR->Draw();
2670
2671 cme->cd(3);
2672 fh2MatchdEdx->Draw();
2673
2674 cme->cd(4);
2675 fh2EledEdx->Draw();
2676
2677 sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
8a587055 2678 cme->Print(name); printf("Plot: %s\n",name);
06e5656a 2679
8a587055 2680 if(IsDataMC()){
06e5656a 2681 sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
2682 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
2683 cmemc->Divide(3,1);
2684
2685 cmemc->cd(1);
2686 gPad->SetLogy();
2687 fhMCEle1pOverE->Draw();
2688 fhMCEle1pOverER02->SetLineColor(4);
2689 fhMCEle1pOverE->SetLineColor(1);
2690 fhMCEle1pOverER02->Draw("same");
2691 pLegendpE0.Draw();
2692
2693 cmemc->cd(2);
2694 gPad->SetLogy();
2695 fhMCEle1dR->Draw();
2696
2697 cmemc->cd(3);
2698 fhMCEle2MatchdEdx->Draw();
2699
2700 sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
8a587055 2701 cmemc->Print(name); printf("Plot: %s\n",name);
2702
06e5656a 2703
2704 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
2705 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
2706 cmemchad->Divide(3,1);
2707
2708 cmemchad->cd(1);
2709 gPad->SetLogy();
2710 fhMCChHad1pOverE->Draw();
2711 fhMCChHad1pOverER02->SetLineColor(4);
2712 fhMCChHad1pOverE->SetLineColor(1);
2713 fhMCChHad1pOverER02->Draw("same");
2714 pLegendpE0.Draw();
2715
2716 cmemchad->cd(2);
2717 gPad->SetLogy();
2718 fhMCChHad1dR->Draw();
2719
2720 cmemchad->cd(3);
2721 fhMCChHad2MatchdEdx->Draw();
2722
2723 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
8a587055 2724 cmemchad->Print(name); printf("Plot: %s\n",name);
06e5656a 2725
2726 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
2727 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
2728 cmemcn->Divide(3,1);
2729
2730 cmemcn->cd(1);
2731 gPad->SetLogy();
2732 fhMCNeutral1pOverE->Draw();
2733 fhMCNeutral1pOverE->SetLineColor(1);
2734 fhMCNeutral1pOverER02->SetLineColor(4);
2735 fhMCNeutral1pOverER02->Draw("same");
2736 pLegendpE0.Draw();
2737
2738 cmemcn->cd(2);
2739 gPad->SetLogy();
2740 fhMCNeutral1dR->Draw();
2741
2742 cmemcn->cd(3);
2743 fhMCNeutral2MatchdEdx->Draw();
2744
2745 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
8a587055 2746 cmemcn->Print(name); printf("Plot: %s\n",name);
06e5656a 2747
2748 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
2749 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
2750 cmpoe->Divide(2,1);
2751
2752 cmpoe->cd(1);
2753 gPad->SetLogy();
2754 fh1pOverE->SetLineColor(1);
2755 fhMCEle1pOverE->SetLineColor(4);
2756 fhMCChHad1pOverE->SetLineColor(2);
2757 fhMCNeutral1pOverE->SetLineColor(7);
2758 fh1pOverER02->SetMinimum(0.5);
2759 fh1pOverE->Draw();
2760 fhMCEle1pOverE->Draw("same");
2761 fhMCChHad1pOverE->Draw("same");
2762 fhMCNeutral1pOverE->Draw("same");
2763 TLegend pLegendpE(0.65,0.55,0.9,0.8);
2764 pLegendpE.SetTextSize(0.06);
2765 pLegendpE.AddEntry(fh1pOverE,"all","L");
2766 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
2767 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
2768 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
2769 pLegendpE.SetFillColor(10);
2770 pLegendpE.SetBorderSize(1);
2771 pLegendpE.Draw();
2772
2773 cmpoe->cd(2);
2774 gPad->SetLogy();
2775 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
2776 fh1pOverER02->SetLineColor(1);
2777 fhMCEle1pOverER02->SetLineColor(4);
2778 fhMCChHad1pOverER02->SetLineColor(2);
2779 fhMCNeutral1pOverER02->SetLineColor(7);
2780 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
2781 fh1pOverER02->SetMinimum(0.5);
2782 fh1pOverER02->Draw();
2783 fhMCEle1pOverER02->Draw("same");
2784 fhMCChHad1pOverER02->Draw("same");
2785 fhMCNeutral1pOverER02->Draw("same");
2786
2787 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
2788 // pLegendpE2.SetTextSize(0.06);
2789 // pLegendpE2.SetHeader("dR < 0.02");
2790 // pLegendpE2.SetFillColor(10);
2791 // pLegendpE2.SetBorderSize(1);
2792 // pLegendpE2.Draw();
2793
2794 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
8a587055 2795 cmpoe->Print(name); printf("Plot: %s\n",name);
2796 }
06e5656a 2797
9725fd2a 2798 }
06e5656a 2799
9725fd2a 2800 char line[1024] ;
2801 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
2802 gROOT->ProcessLine(line);
2803 sprintf(line, ".!rm -fR *.eps");
2804 gROOT->ProcessLine(line);
2805
2806 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());
2807
2808}