]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
include CalorimeterQA in analysis train, some debug prints in QA added
[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"
27#include "TRefArray.h"
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
872 TRefArray * partList = new TRefArray();
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();
905
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
9725fd2a 930 //cout<<"LABEL > "<<label<<endl;
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
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);
946
947 //Get final particle, no conversion products
948 Int_t status = primary->GetStatusCode();
949 Int_t mother= primary->GetFirstMother();
950 Int_t finallabel = -1;
951 if(status == 0){
06e5656a 952 while(mother >= 0){
953 primary = GetMCStack()->Particle(mother);
954 finallabel = mother;
955 status = primary->GetStatusCode();
956 mother= primary->GetFirstMother();
957 if(status == 1) break;
958 //printf("mother %d\n",mother);
959 }
9725fd2a 960 }
961
962 fh2E ->Fill(e, primary->Energy());
963 fh2Pt ->Fill(pt, primary->Pt());
964 fh2Phi ->Fill(phi, primary->Phi());
965 fh2Eta ->Fill(eta, primary->Eta());
966 fhDeltaE ->Fill(primary->Energy()-e);
967 fhDeltaPt ->Fill(primary->Pt()-pt);
968 fhDeltaPhi->Fill(primary->Phi()-phi);
969 fhDeltaEta->Fill(primary->Eta()-eta);
970 if(primary->Energy() > 0) fhRatioE ->Fill(e/primary->Energy());
971 if(primary->Pt() > 0) fhRatioPt ->Fill(pt/primary->Pt());
972 if(primary->Phi() > 0) fhRatioPhi->Fill(phi/primary->Phi());
973 if(primary->Eta() > 0) fhRatioEta->Fill(eta/primary->Eta());
974
975 //cout<<"Final Label "<<finallabel<<" mother "<<mother<<endl;
976 pdg = primary->GetPdgCode();
977 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
06e5656a 978
9725fd2a 979 if(pdg == 22){
06e5656a 980 //cout<<"pdg "<<pdg<<" status "<<status<<" "<<primary->GetStatusCode()<<endl;
981 TParticle *pi0 = 0x0;
982 TParticle *p1 = 0x0;
983 TParticle *p2 = 0x0;
984 TParticle * tmp = 0x0;
985 Int_t pdgpi0 = 0;
986 Int_t mothertmp = 0;
987 //Check if it is a decay photon from pi0, in this case, check if both decay contribute cluster
988 Bool_t ok1 = kFALSE;
989 Bool_t ok2 = kFALSE;
990
991 if(calo->GetNLabel() > 1){
992 if(pdg !=111){
993 while(mother >= 0){
994 pi0 = GetMCStack()->Particle(mother);
995 pdgpi0 = pi0->GetPdgCode();
996 if(pdgpi0 == 111) break;
997 mother= pi0->GetFirstMother();
998 //printf("mother %d\n",mother);
999 }
1000 }
1001 else pi0 = primary;
1002 //cout<<"MOTHER PI0 LABEL "<<mother<<" pt" << pi0->Pt()<<endl;
1003 if(pi0->GetNDaughters() == 2){
1004 // cout<<"pi0, 2 daughters "<<endl;
1005 Int_t id1 = pi0->GetFirstDaughter();
1006 Int_t id2 = pi0->GetFirstDaughter()+1;
1007 p1=GetMCStack()->Particle(id1);
1008 p2=GetMCStack()->Particle(id2);
1009
1010 if(p1->GetFirstMother()!=p2->GetFirstMother()) cout <<"Decay photon mothers are not the same!!"<<endl;
1011 if(p1->GetPdgCode()==22 && p2->GetPdgCode()==22){
1012 // cout<<"2 photons, labels "<< id1<<" "<<id2<<endl;
1013 for(UInt_t ilabel = 0; ilabel < calo->GetNLabel(); ilabel++){
1014 Int_t iprim = calo->GetLabel(ilabel);
1015 //cout<<"iprim "<<iprim<<endl;
1016 if (iprim == id1) ok1 = kTRUE;
1017 else if (iprim == id2) ok2 = kTRUE;
1018 mothertmp = iprim;
1019 while(mothertmp >= 0){
1020 tmp = GetMCStack()->Particle(mothertmp);
1021 mothertmp= tmp->GetFirstMother();
1022 // cout<<"mothertmp "<<mothertmp<<" "<<tmp->GetName()<< " pt "<<tmp->Pt()<<endl;
1023 if (mothertmp == id1) ok1 = kTRUE;
1024 else if (mothertmp == id2) ok2 = kTRUE;
1025 if(ok1 && ok2) break;
1026 //printf("mother %d\n",mother);
1027 }
1028 }
1029 }//2 photon daughters
1030 }////mother pi0, 2 daughers
1031 }//more than one contribution to clust
1032
1033 if(ok1 && ok2){
1034 //cout<<"Fill pi0"<< "E "<< e <<" prim E "<<primary->Energy()<<endl;
1035 fhPi0E ->Fill(e,primary->Energy());
1036 fhPi0Pt ->Fill(pt,primary->Pt());
1037 fhPi0Eta ->Fill(eta,primary->Eta());
1038 fhPi0Phi ->Fill(phi,primary->Phi());
1039 if( ntracksmatched > 0){
1040 fhPi0ECharged ->Fill(e,primary->Energy());
1041 fhPi0PtCharged ->Fill(pt,primary->Pt());
1042 fhPi0PhiCharged ->Fill(phi,primary->Phi());
1043 fhPi0EtaCharged ->Fill(eta,primary->Eta());
1044 }
1045 }
1046 else{
1047 fhGamE ->Fill(e,primary->Energy());
1048 fhGamPt ->Fill(pt,primary->Pt());
1049 fhGamEta ->Fill(eta,primary->Eta());
1050 fhGamPhi ->Fill(phi,primary->Phi());
1051 fhGamDeltaE ->Fill(primary->Energy()-e);
1052 fhGamDeltaPt ->Fill(primary->Pt()-pt);
1053 fhGamDeltaPhi->Fill(primary->Phi()-phi);
1054 fhGamDeltaEta->Fill(primary->Eta()-eta);
1055 if(primary->Energy() > 0) fhGamRatioE ->Fill(e/primary->Energy());
1056 if(primary->Pt() > 0) fhGamRatioPt ->Fill(pt/primary->Pt());
1057 if(primary->Phi() > 0) fhGamRatioPhi->Fill(phi/primary->Phi());
1058 if(primary->Eta() > 0) fhGamRatioEta->Fill(eta/primary->Eta());
1059 if( ntracksmatched > 0){
1060 fhGamECharged ->Fill(e,primary->Energy());
1061 fhGamPtCharged ->Fill(pt,primary->Pt());
1062 fhGamPhiCharged ->Fill(phi,primary->Phi());
1063 fhGamEtaCharged ->Fill(eta,primary->Eta());
1064 }
1065 }
9725fd2a 1066 }//pdg == 22
1067 else if(TMath::Abs(pdg) == 11) {
06e5656a 1068 fhEleE ->Fill(e,primary->Energy());
1069 fhElePt ->Fill(pt,primary->Pt());
1070 fhEleEta ->Fill(eta,primary->Eta());
1071 fhElePhi ->Fill(phi,primary->Phi());
1072 fhEMVxyz ->Fill(vx,vy);//,vz);
1073 fhEMR ->Fill(e,r);
1074 if( ntracksmatched > 0){
1075 fhEleECharged ->Fill(e,primary->Energy());
1076 fhElePtCharged ->Fill(pt,primary->Pt());
1077 fhElePhiCharged ->Fill(phi,primary->Phi());
1078 fhEleEtaCharged ->Fill(eta,primary->Eta());
1079 }
9725fd2a 1080 }
1081 else if(pdg == 111) {
06e5656a 1082 fhPi0E ->Fill(e,primary->Energy());
1083 fhPi0Pt ->Fill(pt,primary->Pt());
1084 fhPi0Eta ->Fill(eta,primary->Eta());
1085 fhPi0Phi ->Fill(phi,primary->Phi());
1086 if( ntracksmatched > 0){
1087 fhPi0ECharged ->Fill(e,primary->Energy());
1088 fhPi0PtCharged ->Fill(pt,primary->Pt());
1089 fhPi0PhiCharged ->Fill(phi,primary->Phi());
1090 fhPi0EtaCharged ->Fill(eta,primary->Eta());
1091 }
9725fd2a 1092 }
1093 else if(charge == 0){
06e5656a 1094 fhNeHadE ->Fill(e,primary->Energy());
1095 fhNeHadPt ->Fill(pt,primary->Pt());
1096 fhNeHadEta ->Fill(eta,primary->Eta());
1097 fhNeHadPhi ->Fill(phi,primary->Phi());
1098 fhHaVxyz ->Fill(vx,vy);//,vz);
1099 fhHaR ->Fill(e,r);
1100 if( ntracksmatched > 0){
1101 fhNeHadECharged ->Fill(e,primary->Energy());
1102 fhNeHadPtCharged ->Fill(pt,primary->Pt());
1103 fhNeHadPhiCharged ->Fill(phi,primary->Phi());
1104 fhNeHadEtaCharged ->Fill(eta,primary->Eta());
1105 }
9725fd2a 1106 }
1107 else if(charge!=0){
06e5656a 1108 fhChHadE ->Fill(e,primary->Energy());
1109 fhChHadPt ->Fill(pt,primary->Pt());
1110 fhChHadEta ->Fill(eta,primary->Eta());
1111 fhChHadPhi ->Fill(phi,primary->Phi());
1112 fhHaVxyz ->Fill(vx,vy);//,vz);
1113 fhHaR ->Fill(e,r);
1114 if( ntracksmatched > 0){
1115 fhChHadECharged ->Fill(e,primary->Energy());
1116 fhChHadPtCharged ->Fill(pt,primary->Pt());
1117 fhChHadPhiCharged ->Fill(phi,primary->Phi());
1118 fhChHadEtaCharged ->Fill(eta,primary->Eta());
1119 }
9725fd2a 1120 }
1121 }//Work with stack also
1122
06e5656a 1123 //matched cluster with tracks
1124 if( ntracksmatched > 0){
1125 fhECharged ->Fill(e);
1126 fhPtCharged ->Fill(pt);
1127 fhPhiCharged ->Fill(phi);
1128 fhEtaCharged ->Fill(eta);
1129 fhEtaPhiCharged->Fill(eta,phi);
1130 if((!strcmp(GetReader()->GetInputEvent()->GetName(),"AliESDEvent"))) {
1131 AliESDEvent *esd = (AliESDEvent*) GetReader()->GetInputEvent();
1132 AliESDCaloCluster * esdcalo = (AliESDCaloCluster*) esd->GetCaloCluster(calo->GetID());
1133 Int_t trackIndex = esdcalo->GetTrackMatched();
1134 //printf("track index %d ntracks %d\n", trackIndex, esd->GetNumberOfTracks());
1135 if(trackIndex >= 0){
1136 AliESDtrack* track = (AliESDtrack*) esd->GetTrack(trackIndex);
1137 if (track && track->GetOuterParam() ) {
4865e325 1138
06e5656a 1139 Double_t tphi = track->GetOuterParam()->Phi();
1140 Double_t teta = track->GetOuterParam()->Eta();
1141 Double_t tmom = track->GetOuterParam()->P();
4865e325 1142
06e5656a 1143 Double_t deta = teta - eta;
1144 Double_t dphi = tphi - phi;
1145 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
1146 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
1147 Double_t dR = sqrt(dphi*dphi + deta*deta);
1148
1149 Double_t pOverE = tmom/e;
1150
1151 fh1pOverE->Fill(pOverE);
1152 if(dR < 0.02) fh1pOverER02->Fill(pOverE);
1153
1154 fh1dR->Fill(dR);
1155 fh2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
4865e325 1156
06e5656a 1157 if(IsDataMC() && primary){
4865e325 1158 Int_t pdg = primary->GetPdgCode();
1159 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1160
06e5656a 1161 if(TMath::Abs(pdg) == 11){
1162 fhMCEle1pOverE->Fill(pOverE);
1163 fhMCEle1dR->Fill(dR);
1164 fhMCEle2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1165 if(dR < 0.02) fhMCEle1pOverER02->Fill(pOverE);
1166 }
1167 else if(charge!=0){
1168 fhMCChHad1pOverE->Fill(pOverE);
1169 fhMCChHad1dR->Fill(dR);
1170 fhMCChHad2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1171 if(dR < 0.02) fhMCChHad1pOverER02->Fill(pOverE);
1172 }
1173 else if(charge == 0){
1174 fhMCNeutral1pOverE->Fill(pOverE);
1175 fhMCNeutral1dR->Fill(dR);
1176 fhMCNeutral2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1177 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(pOverE);
1178 }
1179 }
1180 int nITS = track->GetNcls(0);
1181 int nTPC = track->GetNcls(1);
1182 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
1183 && calo->GetNCells() > 1 && nITS > 3 && nTPC > 20) {
1184 fh2EledEdx->Fill(track->P(),track->GetTPCsignal());
1185 }
1186 }
1187 else if(!track->GetOuterParam()){
1188 ULong_t status=AliESDtrack::kTPCrefit;
1189 status|=AliESDtrack::kITSrefit;
1190 //printf("track status %d\n", track->GetStatus() );
1191 fhEChargedNoOut ->Fill(e);
1192 fhPtChargedNoOut ->Fill(pt);
1193 fhPhiChargedNoOut ->Fill(phi);
1194 fhEtaChargedNoOut ->Fill(eta);
1195 fhEtaPhiChargedNoOut ->Fill(eta,phi);
1196 if ( (track->GetStatus() & status) == status) printf("ITS+TPC\n");
1197 }
1198 else {
4865e325 1199 printf("ERROR: Could not receive track %d\n", trackIndex);
06e5656a 1200 }
1201 }// non negative track index
1202 }//do only if input are ESDs
1203 }// at least one track matched
1204
9725fd2a 1205 //Invariant mass
1206 if (nclusters > 1 ) {
1207 for(Int_t jclus = iclus + 1 ; jclus < nclusters ; jclus++) {
1208 AliAODCaloCluster * calo2 = (AliAODCaloCluster*) (partList->At(jclus));
1209 //Get cluster kinematics
1210 calo2->GetMomentum(mom2,v);
1211 fhIM ->Fill((mom+mom2).E(),(mom+mom2).M());
1212 fhAsym->Fill((mom+mom2).E(),TMath::Abs((e-mom2.E())/(e+mom2.E())));
1213 }// 2nd cluster loop
1214 }////more than 1 cluster in calorimeter
1215
1216 //Cells per cluster
1217 fhNCellsPerCluster->Fill(e,calo->GetNCells());
1218
1219 }// 1st cluster loop
1220
1221 //CaloCells
1222 AliAODCaloCells * cell = new AliAODCaloCells ;
1223 if(fCalorimeter == "PHOS")
1224 cell = (AliAODCaloCells *) GetPHOSCells();
1225 else
1226 cell = (AliAODCaloCells *) GetEMCALCells();
1227
1228 if(!cell) {
1229 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - ABORT: No CELLS available for analysis");
1230 abort();
1231 }
1232
1233 //Some prints
1234 if(GetDebug() > 0 && cell )
1235 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), cell->GetNumberOfCells());
1236
1237 Int_t ncells = cell->GetNumberOfCells() ;
1238 fhNCells->Fill(ncells) ;
1239
1240 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1241 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1242 fhAmplitude->Fill(cell->GetAmplitude(iCell));
1243 }
1244
1245 if(GetDebug() > 0)
1246 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - end \n");
1247
1248 //Monte Carlo
1249 if(IsDataMC()){
1250 //Play with the MC stack if available
1251 for(Int_t i=8 ; i<stack->GetNprimary(); i++){
1252 primary = stack->Particle(i) ;
1253
1254 //if (!primary->IsPrimary()) continue;
1255 if (TMath::Abs(primary->Eta()) > 1) continue;
1256
1257 Int_t kf = primary->GetPdgCode();
1258 //printf("kf %d\n",kf);
1259
1260 Bool_t in = kTRUE;
1261 primary->Momentum(mom);
1262 if(IsFidutialCutOn()) in = GetFidutialCut()->IsInFidutialCut(mom,fCalorimeter) ;
1263
1264 if (kf==22) {
1265 fhGenGamPt ->Fill(primary->Pt());
1266 fhGenGamEta->Fill(primary->Eta());
1267 fhGenGamPhi->Fill(primary->Phi());
1268 if(in){
1269 fhGenGamAccE ->Fill(primary->Energy());
1270 fhGenGamAccPt ->Fill(primary->Pt());
1271 fhGenGamAccEta->Fill(primary->Eta());
1272 fhGenGamAccPhi->Fill(primary->Phi());
1273 }
1274 }
1275 else if (kf==111) {
1276 fhGenPi0Pt ->Fill(primary->Pt());
1277 fhGenPi0Eta->Fill(primary->Eta());
1278 fhGenPi0Phi->Fill(primary->Phi());
1279 if(in){
1280 fhGenPi0AccE ->Fill(primary->Energy());
1281 fhGenPi0AccPt ->Fill(primary->Pt());
1282 fhGenPi0AccEta->Fill(primary->Eta());
1283 fhGenPi0AccPhi->Fill(primary->Phi());
1284 }
1285 }
1286 else if (kf==221) {
1287 fhGenEtaPt ->Fill(primary->Pt());
1288 fhGenEtaEta->Fill(primary->Eta());
1289 fhGenEtaPhi->Fill(primary->Phi());
1290 }
1291 else if (kf==223) {
1292 fhGenOmegaPt ->Fill(primary->Pt());
1293 fhGenOmegaEta->Fill(primary->Eta());
1294 fhGenOmegaPhi->Fill(primary->Phi());
1295 }
1296 else if (TMath::Abs(kf)==11) {
1297 fhGenElePt ->Fill(primary->Pt());
1298 fhGenEleEta->Fill(primary->Eta());
1299 fhGenElePhi->Fill(primary->Phi());
1300 }
1301 } //primary loop
1302 } //Is data MC
1303
4865e325 1304 if(GetDebug() > 0)
1305 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1306
1307
9725fd2a 1308}
1309
1310//________________________________________________________________________
1311void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
1312{
1313 // Needed when Terminate is executed in distributed environment
1314 // Refill analysis histograms of this class with corresponding histograms in output list.
1315
1316 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
1317 // the first one and then add the next
1318 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
1319 //printf("Calo: %s, index: %d\n",fCalorimeter.Data(),index);
1320 //Read histograms, must be in the same order as in GetCreateOutputObject.
1321 fhE = (TH1F *) outputList->At(index++);
1322 fhPt = (TH1F *) outputList->At(index++);
1323 fhPhi = (TH1F *) outputList->At(index++);
1324 fhEta = (TH1F *) outputList->At(index++);
1325 fhEtaPhi = (TH2F *) outputList->At(index++);
1326
1327 fhECharged = (TH1F *) outputList->At(index++);
1328 fhPtCharged = (TH1F *) outputList->At(index++);
1329 fhPhiCharged = (TH1F *) outputList->At(index++);
1330 fhEtaCharged = (TH1F *) outputList->At(index++);
1331 fhEtaPhiCharged = (TH2F *) outputList->At(index++);
1332
1333 fhEChargedNoOut = (TH1F *) outputList->At(index++);
1334 fhPtChargedNoOut = (TH1F *) outputList->At(index++);
1335 fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
1336 fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
1337 fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
1338
1339 fhIM = (TH2F *) outputList->At(index++);
1340 fhAsym = (TH2F *) outputList->At(index++);
1341
1342 fhNCellsPerCluster = (TH2F *) outputList->At(index++);
1343 fhNClusters = (TH1F *) outputList->At(index++);
1344 fhNCells = (TH1F *) outputList->At(index++);
1345 fhAmplitude = (TH1F *) outputList->At(index++);
1346
1347 if(IsDataMC()){
1348 fhDeltaE = (TH1F *) outputList->At(index++);
1349 fhDeltaPt = (TH1F *) outputList->At(index++);
1350 fhDeltaPhi = (TH1F *) outputList->At(index++);
1351 fhDeltaEta = (TH1F *) outputList->At(index++);
1352
1353 fhRatioE = (TH1F *) outputList->At(index++);
1354 fhRatioPt = (TH1F *) outputList->At(index++);
1355 fhRatioPhi = (TH1F *) outputList->At(index++);
1356 fhRatioEta = (TH1F *) outputList->At(index++);
1357
1358 fh2E = (TH2F *) outputList->At(index++);
1359 fh2Pt = (TH2F *) outputList->At(index++);
1360 fh2Phi = (TH2F *) outputList->At(index++);
1361 fh2Eta = (TH2F *) outputList->At(index++);
1362
1363 fhGamE = (TH2F *) outputList->At(index++);
1364 fhGamPt = (TH2F *) outputList->At(index++);
1365 fhGamPhi = (TH2F *) outputList->At(index++);
1366 fhGamEta = (TH2F *) outputList->At(index++);
1367
1368 fhGamDeltaE = (TH1F *) outputList->At(index++);
1369 fhGamDeltaPt = (TH1F *) outputList->At(index++);
1370 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
1371 fhGamDeltaEta = (TH1F *) outputList->At(index++);
1372
1373 fhGamRatioE = (TH1F *) outputList->At(index++);
1374 fhGamRatioPt = (TH1F *) outputList->At(index++);
1375 fhGamRatioPhi = (TH1F *) outputList->At(index++);
1376 fhGamRatioEta = (TH1F *) outputList->At(index++);
1377
9725fd2a 1378 fhPi0E = (TH2F *) outputList->At(index++);
1379 fhPi0Pt = (TH2F *) outputList->At(index++);
1380 fhPi0Phi = (TH2F *) outputList->At(index++);
1381 fhPi0Eta = (TH2F *) outputList->At(index++);
1382
1383 fhEleE = (TH2F *) outputList->At(index++);
1384 fhElePt = (TH2F *) outputList->At(index++);
1385 fhElePhi = (TH2F *) outputList->At(index++);
1386 fhEleEta = (TH2F *) outputList->At(index++);
1387
1388 fhNeHadE = (TH2F *) outputList->At(index++);
1389 fhNeHadPt = (TH2F *) outputList->At(index++);
1390 fhNeHadPhi = (TH2F *) outputList->At(index++);
1391 fhNeHadEta = (TH2F *) outputList->At(index++);
1392
1393 fhChHadE = (TH2F *) outputList->At(index++);
1394 fhChHadPt = (TH2F *) outputList->At(index++);
1395 fhChHadPhi = (TH2F *) outputList->At(index++);
1396 fhChHadEta = (TH2F *) outputList->At(index++);
1397
06e5656a 1398 fhGamECharged = (TH2F *) outputList->At(index++);
1399 fhGamPtCharged = (TH2F *) outputList->At(index++);
1400 fhGamPhiCharged = (TH2F *) outputList->At(index++);
1401 fhGamEtaCharged = (TH2F *) outputList->At(index++);
1402
1403 fhPi0ECharged = (TH2F *) outputList->At(index++);
1404 fhPi0PtCharged = (TH2F *) outputList->At(index++);
1405 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
1406 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
1407
1408 fhEleECharged = (TH2F *) outputList->At(index++);
1409 fhElePtCharged = (TH2F *) outputList->At(index++);
1410 fhElePhiCharged = (TH2F *) outputList->At(index++);
1411 fhEleEtaCharged = (TH2F *) outputList->At(index++);
1412
1413 fhNeHadECharged = (TH2F *) outputList->At(index++);
1414 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
1415 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
1416 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
1417
1418 fhChHadECharged = (TH2F *) outputList->At(index++);
1419 fhChHadPtCharged = (TH2F *) outputList->At(index++);
1420 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
1421 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
1422
9725fd2a 1423// fhEMVxyz = (TH3F *) outputList->At(index++);
1424// fhHaVxyz = (TH3F *) outputList->At(index++);
1425
1426 fhEMVxyz = (TH2F *) outputList->At(index++);
1427 fhHaVxyz = (TH2F *) outputList->At(index++);
1428 fhEMR = (TH2F *) outputList->At(index++);
1429 fhHaR = (TH2F *) outputList->At(index++);
1430
1431 fhGenGamPt = (TH1F *) outputList->At(index++);
1432 fhGenGamEta = (TH1F *) outputList->At(index++);
1433 fhGenGamPhi = (TH1F *) outputList->At(index++);
1434
1435 fhGenPi0Pt = (TH1F *) outputList->At(index++);
1436 fhGenPi0Eta = (TH1F *) outputList->At(index++);
1437 fhGenPi0Phi = (TH1F *) outputList->At(index++);
1438
1439 fhGenEtaPt = (TH1F *) outputList->At(index++);
1440 fhGenEtaEta = (TH1F *) outputList->At(index++);
1441 fhGenEtaPhi = (TH1F *) outputList->At(index++);
1442
1443 fhGenOmegaPt = (TH1F *) outputList->At(index++);
1444 fhGenOmegaEta = (TH1F *) outputList->At(index++);
1445 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
1446
1447 fhGenElePt = (TH1F *) outputList->At(index++);
1448 fhGenEleEta = (TH1F *) outputList->At(index++);
1449 fhGenElePhi = (TH1F *) outputList->At(index++);
1450
1451 fhGenGamAccE = (TH1F *) outputList->At(index++);
1452 fhGenGamAccPt = (TH1F *) outputList->At(index++);
1453 fhGenGamAccEta = (TH1F *) outputList->At(index++);
1454 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
1455
1456 fhGenPi0AccE = (TH1F *) outputList->At(index++);
1457 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
1458 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
1459 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
1460
1461 }//Is data MC
1462
1463 fh1pOverE = (TH1F *) outputList->At(index++);
1464 fh1dR = (TH1F *) outputList->At(index++);
1465 fh2MatchdEdx = (TH2F *) outputList->At(index++);
1466 fh2EledEdx = (TH2F *) outputList->At(index++);
1467
06e5656a 1468 if(IsDataMC()){
1469 fhMCEle1pOverE = (TH1F *) outputList->At(index++);
1470 fhMCEle1dR = (TH1F *) outputList->At(index++);
1471 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
1472
1473 fhMCChHad1pOverE = (TH1F *) outputList->At(index++);
1474 fhMCChHad1dR = (TH1F *) outputList->At(index++);
1475 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
1476
1477 fhMCNeutral1pOverE = (TH1F *) outputList->At(index++);
1478 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
1479 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
1480
1481 fh1pOverER02 = (TH1F *) outputList->At(index++);
1482 fhMCEle1pOverER02 = (TH1F *) outputList->At(index++);
1483 fhMCChHad1pOverER02 = (TH1F *) outputList->At(index++);
1484 fhMCNeutral1pOverER02 = (TH1F *) outputList->At(index++);
1485 }
1486 //for(Int_t i = 0; i<index ; i++) cout<<outputList->At(i)->GetName()<<endl;
9725fd2a 1487}
1488
1489//__________________________________________________________________
1490void AliAnaCalorimeterQA::Terminate(TList* outputList)
1491{
1492
1493 //Do some plots to end
1494 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
1495 //Recover histograms from output histograms list, needed for distributed analysis.
1496 ReadHistograms(outputList);
1497
1498 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
1499 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
1500
1501 char name[128];
1502 char cname[128];
06e5656a 1503
9725fd2a 1504 //Reconstructed distributions
06e5656a 1505 //printf("c1\n");
9725fd2a 1506 sprintf(cname,"QA_%s_rec",fCalorimeter.Data());
1507 TCanvas * c = new TCanvas(cname, "Reconstructed distributions", 400, 400) ;
1508 c->Divide(2, 2);
1509
1510 c->cd(1) ;
1511 gPad->SetLogy();
1512 fhE->SetLineColor(4);
1513 fhE->Draw();
1514
1515 c->cd(2) ;
1516 gPad->SetLogy();
1517 fhPt->SetLineColor(4);
1518 fhPt->Draw();
1519
1520 c->cd(3) ;
1521 fhPhi->SetLineColor(4);
1522 fhPhi->Draw();
1523
1524 c->cd(4) ;
1525 fhEta->SetLineColor(4);
1526 fhEta->Draw();
1527
1528 sprintf(name,"QA_%s_ReconstructedDistributions.eps",fCalorimeter.Data());
1529 c->Print(name);
1530
1531 //Reconstructed distributions, matched with tracks
1532 //printf("c2\n");
1533 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
1534 TCanvas * c2 = new TCanvas(cname, "Reconstructed distributions, matched with tracks", 400, 400) ;
1535 c2->Divide(2, 2);
1536
1537 c2->cd(1) ;
1538 gPad->SetLogy();
1539 fhECharged->SetLineColor(4);
1540 fhECharged->Draw();
1541
1542 c2->cd(2) ;
1543 gPad->SetLogy();
1544 fhPtCharged->SetLineColor(4);
1545 fhPtCharged->Draw();
1546
1547 c2->cd(3) ;
1548 fhPhiCharged->SetLineColor(4);
1549 fhPhiCharged->Draw();
1550
1551 c2->cd(4) ;
1552 fhEtaCharged->SetLineColor(4);
1553 fhEtaCharged->Draw();
1554
1555 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched.eps",fCalorimeter.Data());
1556 c2->Print(name);
1557
1558 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone("EChargedClone");
1559 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone("PtChargedClone");
1560 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone("EtaChargedClone");
1561 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone("PhiChargedClone");
06e5656a 1562
9725fd2a 1563 TH1F * hEChargedClone2 = (TH1F*) fhECharged->Clone("EChargedClone2");
1564 TH1F * hPtChargedClone2 = (TH1F*) fhPtCharged->Clone("PtChargedClone2");
1565 TH1F * hEtaChargedClone2 = (TH1F*) fhEtaCharged->Clone("EtaChargedClone2");
1566 TH1F * hPhiChargedClone2 = (TH1F*) fhPhiCharged->Clone("PhiChargedClone2");
06e5656a 1567
9725fd2a 1568 //Ratio: reconstructed track matched/ all reconstructed
1569 //printf("c3\n");
1570 sprintf(cname,"QA_%s_rectrackmatchrat",fCalorimeter.Data());
1571 TCanvas * c3 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
1572 c3->Divide(2, 2);
1573
1574 c3->cd(1) ;
06e5656a 1575 gPad->SetLogy();
1576 hEChargedClone->SetTitleOffset(1.6,"Y");
1577 hEChargedClone->SetYTitle("track matched / all ");
1578 hEChargedClone->SetXTitle("E (GeV)");
9725fd2a 1579 hEChargedClone->Divide(fhE);
1580 hEChargedClone->Draw();
1581
1582 c3->cd(2) ;
06e5656a 1583 gPad->SetLogy();
1584 hPtChargedClone->SetTitleOffset(1.6,"Y");
1585 hPtChargedClone->SetYTitle("track matched / all ");
1586 hPtChargedClone->SetXTitle("p_{T} (GeV/c)");
9725fd2a 1587 hPtChargedClone->Divide(fhPt);
1588 hPtChargedClone->Draw();
1589
1590 c3->cd(3) ;
06e5656a 1591 gPad->SetLogy();
1592 hPhiChargedClone->SetTitleOffset(1.6,"Y");
1593 hPhiChargedClone->SetYTitle("track matched / all ");
1594 hPhiChargedClone->SetXTitle("#phi (rad)");
9725fd2a 1595 hPhiChargedClone->Divide(fhPhi);
1596 hPhiChargedClone->Draw();
1597
1598 c3->cd(4) ;
06e5656a 1599 gPad->SetLogy();
1600 hEtaChargedClone->SetTitleOffset(1.6,"Y");
1601 hEtaChargedClone->SetYTitle("track matched / all ");
1602 hEtaChargedClone->SetXTitle("#eta");
1603 hEtaChargedClone->Divide(fhEta);
9725fd2a 1604 hEtaChargedClone->Draw();
1605
1606 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributions.eps",fCalorimeter.Data());
1607 c3->Print(name);
1608
1609 //Ratio: reconstructed track matched (minus no track param) / all
06e5656a 1610 //printf("c3\n");
9725fd2a 1611 sprintf(cname,"QA_%s_rectrackmatchratout",fCalorimeter.Data());
1612 TCanvas * c333 = new TCanvas(cname, "Ratio: reconstructed track matched (with outer track param)/ all", 400, 400) ;
1613 c333->Divide(2, 2);
06e5656a 1614
9725fd2a 1615 c333->cd(1) ;
1616 hEChargedClone2->Add(fhEChargedNoOut,-1);
1617 hEChargedClone2->SetYTitle("track matched / all");
06e5656a 1618 hEChargedClone2->SetXTitle("E (GeV)");
9725fd2a 1619 hEChargedClone2->Divide(fhE);
1620 hEChargedClone2->Draw();
1621
1622 c333->cd(2) ;
1623 hPtChargedClone2->Add(fhPtChargedNoOut,-1);
1624 hPtChargedClone2->SetYTitle("track matched / all");
06e5656a 1625 hPtChargedClone2->SetXTitle("p_{T} (GeV/c)");
9725fd2a 1626 hPtChargedClone2->Divide(fhPt);
1627 hPtChargedClone2->Draw();
1628
1629 c333->cd(3) ;
1630 hPhiChargedClone2->Add(fhPhiChargedNoOut,-1);
1631 hPhiChargedClone2->SetYTitle("track matched / all");
06e5656a 1632 hPhiChargedClone2->SetXTitle("#phi (rad)");
9725fd2a 1633 hPhiChargedClone2->Divide(fhPhi);
1634 hPhiChargedClone2->Draw();
1635
1636 c333->cd(4) ;
1637 hEtaChargedClone2->Add(fhEtaChargedNoOut,-1);
1638 hEtaChargedClone2->SetYTitle("track matched / all");
06e5656a 1639 hEtaChargedClone2->SetXTitle("#eta");
9725fd2a 1640 hEtaChargedClone2->Divide(fhEta);
1641 hEtaChargedClone2->Draw();
1642
1643 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsOuter.eps",fCalorimeter.Data());
1644 c333->Print(name);
06e5656a 1645
1646 //Reconstructed distributions, matched with tracks but no outer param
9725fd2a 1647 //printf("c2\n");
1648 sprintf(cname,"QA_%s_rectrackmatch_noout",fCalorimeter.Data());
1649 TCanvas * c22 = new TCanvas(cname, "Reconstructed distributions, matched with tracks, no outer track param", 400, 400) ;
1650 c22->Divide(2, 2);
1651
1652 c22->cd(1) ;
1653 gPad->SetLogy();
1654 fhEChargedNoOut->SetLineColor(4);
1655 fhEChargedNoOut->Draw();
1656
1657 c22->cd(2) ;
1658 gPad->SetLogy();
1659 fhPtChargedNoOut->SetLineColor(4);
1660 fhPtChargedNoOut->Draw();
1661
1662 c22->cd(3) ;
1663 fhPhiChargedNoOut->SetLineColor(4);
1664 fhPhiChargedNoOut->Draw();
1665
1666 c22->cd(4) ;
1667 fhEtaChargedNoOut->SetLineColor(4);
1668 fhEtaChargedNoOut->Draw();
1669
1670 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched_NoOutParam.eps",fCalorimeter.Data());
1671 c22->Print(name);
1672
1673 //Ratio: reconstructed track matched/ all reconstructed
06e5656a 1674 //printf("c3\n");
1675
1676// TH1F * hEChargedNoOutClone = (TH1F*) fhEChargedNoOut->Clone("EChargedNoOutClone");
1677// TH1F * hPtChargedNoOutClone = (TH1F*) fhPtChargedNoOut->Clone("PtChargedNoOutClone");
1678// TH1F * hEtaChargedNoOutClone = (TH1F*) fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
1679// TH1F * hPhiChargedNoOutClone = (TH1F*) fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");
1680
1681// sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
1682// TCanvas * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
1683// c33->Divide(2, 2);
1684//
1685// c33->cd(1) ;
1686// hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1687// hEChargedNoOutClone->SetXTitle("E (GeV)");
1688// hEChargedNoOutClone->Divide(fhECharged);
1689// hEChargedNoOutClone->Draw();
1690//
1691// c33->cd(2) ;
1692// hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
1693// hPtChargedNoOutClone->SetXTitle("p_{T} (GeV/c)");
1694// hPtChargedNoOutClone->Divide(fhPtCharged);
1695// hPtChargedNoOutClone->Draw();
1696//
1697// c33->cd(3) ;
1698// hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1699// hPhiChargedNoOutClone->SetXTitle("#phi (rad)");
1700// hPhiChargedNoOutClone->Divide(fhPhiCharged);
1701// hPhiChargedNoOutClone->Draw();
1702//
1703// c33->cd(4) ;
1704// hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1705// hEtaChargedNoOutClone->SetXTitle("#eta");
1706// hEtaChargedNoOutClone->Divide(fhEtaCharged);
1707// hEtaChargedNoOutClone->Draw();
1708//
1709// sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
1710// c33->Print(name);
1711
1712
9725fd2a 1713 //eta vs phi
1714 //printf("c4\n");
1715 sprintf(cname,"QA_%s_etavsphi",fCalorimeter.Data());
06e5656a 1716 // TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 600, 200) ;
1717 // c4->Divide(3, 1);
1718
1719 TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 400, 200) ;
1720 c4->Divide(2, 1);
1721
9725fd2a 1722 c4->cd(1) ;
1723 fhEtaPhi->Draw("cont");
1724
1725 c4->cd(2) ;
1726 fhEtaPhiCharged->Draw("cont");
1727
06e5656a 1728 // c4->cd(3) ;
1729 // fhEtaPhiChargedNoOut->Draw("cont");
1730
9725fd2a 1731 sprintf(name,"QA_%s_ReconstructedEtaVsPhi.eps",fCalorimeter.Data());
1732 c4->Print(name);
1733
1734 //Invariant mass
1735 Int_t binmin = -1;
1736 Int_t binmax = -1;
06e5656a 1737
9725fd2a 1738 if(fhIM->GetEntries() > 1){
1739 Int_t nebins = fhIM->GetNbinsX();
1740 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
1741 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
1742 if (emin != 0 ) printf("emin != 0 \n");
1743 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
1744
1745 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
06e5656a 1746 // printf("c5\n");
9725fd2a 1747 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 400, 400) ;
1748 c5->Divide(2, 2);
1749
1750 c5->cd(1) ;
1751 fhIM->SetLineColor(4);
1752 fhIM->Draw();
1753
1754 c5->cd(2) ;
1755 binmin = 0;
1756 binmax = (Int_t) (5-emin)*nebins/emax;
1757 TH1D *pyim5 = fhIM->ProjectionY("pyim5",binmin,binmax);
1758 pyim5->SetTitle("E_{pair} < 5 GeV");
1759 pyim5->SetLineColor(4);
1760 pyim5->Draw();
1761
1762 c5->cd(3) ;
1763 binmin = (Int_t) (5-emin)*nebins/emax;
1764 binmax = (Int_t) (10-emin)*nebins/emax;
1765 TH1D *pyim510 = fhIM->ProjectionY("pyim5_10",binmin,binmax);
1766 pyim510->SetTitle("5 < E_{pair} < 10 GeV");
1767 pyim510->SetLineColor(4);
1768 pyim510->Draw();
1769
1770 c5->cd(4) ;
1771 binmin = (Int_t) (10-emin)*nebins/emax;
1772 binmax = -1;
1773 TH1D *pyim10 = fhIM->ProjectionY("pyim10",binmin,binmax);
1774 pyim10->SetTitle("E_{pair} > 10 GeV");
1775 pyim10->SetLineColor(4);
1776 pyim10->Draw();
1777
1778 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
1779 c5->Print(name);
1780 }
1781
1782 //Asymmetry
1783 if(fhAsym->GetEntries() > 1){
1784 Int_t nebins = fhAsym->GetNbinsX();
1785 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
1786 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
1787 if (emin != 0 ) printf("emin != 0 \n");
1788 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
1789
1790 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
1791 // printf("c5\n");
1792 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
1793 c5b->Divide(2, 2);
1794
1795 c5b->cd(1) ;
06e5656a 1796 fhAsym->SetTitleOffset(1.6,"Y");
9725fd2a 1797 fhAsym->SetLineColor(4);
1798 fhAsym->Draw();
1799
1800 c5b->cd(2) ;
1801 binmin = 0;
1802 binmax = (Int_t) (5-emin)*nebins/emax;
1803 TH1D *pyAsym5 = fhAsym->ProjectionY("pyAsym5",binmin,binmax);
1804 pyAsym5->SetTitle("E_{pair} < 5 GeV");
1805 pyAsym5->SetLineColor(4);
1806 pyAsym5->Draw();
1807
1808 c5b->cd(3) ;
1809 binmin = (Int_t) (5-emin)*nebins/emax;
1810 binmax = (Int_t) (10-emin)*nebins/emax;
1811 TH1D *pyAsym510 = fhAsym->ProjectionY("pyAsym5_10",binmin,binmax);
1812 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
1813 pyAsym510->SetLineColor(4);
1814 pyAsym510->Draw();
1815
1816 c5b->cd(4) ;
1817 binmin = (Int_t) (10-emin)*nebins/emax;
1818 binmax = -1;
1819 TH1D *pyAsym10 = fhAsym->ProjectionY("pyAsym10",binmin,binmax);
1820 pyAsym10->SetTitle("E_{pair} > 10 GeV");
1821 pyAsym10->SetLineColor(4);
1822 pyAsym10->Draw();
1823
1824 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
1825 c5b->Print(name);
1826 }
1827
1828
1829 //Reconstructed vs MC distributions
1830 //printf("c6\n");
1831 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
1832 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
1833 c6->Divide(2, 2);
1834
1835 c6->cd(1) ;
06e5656a 1836 fh2E->SetTitleOffset(1.6,"Y");
9725fd2a 1837 fh2E->SetLineColor(4);
1838 fh2E->Draw();
1839
1840 c6->cd(2) ;
06e5656a 1841 fh2Pt->SetTitleOffset(1.6,"Y");
9725fd2a 1842 fh2Pt->SetLineColor(4);
1843 fh2Pt->Draw();
1844
1845 c6->cd(3) ;
06e5656a 1846 fh2Phi->SetTitleOffset(1.6,"Y");
9725fd2a 1847 fh2Phi->SetLineColor(4);
1848 fh2Phi->Draw();
1849
1850 c6->cd(4) ;
06e5656a 1851 fh2Eta->SetTitleOffset(1.6,"Y");
9725fd2a 1852 fh2Eta->SetLineColor(4);
1853 fh2Eta->Draw();
1854
1855 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
1856 c6->Print(name);
1857
9725fd2a 1858 //Reconstructed vs MC distributions
1859 //printf("c6\n");
1860 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
1861 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
1862 c6Gam->Divide(2, 2);
1863
1864 c6Gam->cd(1) ;
06e5656a 1865 fhGamE->Draw();
9725fd2a 1866
1867 c6Gam->cd(2) ;
06e5656a 1868 fhGamPt->Draw();
9725fd2a 1869
1870 c6Gam->cd(3) ;
06e5656a 1871 fhGamPhi->Draw();
9725fd2a 1872
1873 c6Gam->cd(4) ;
06e5656a 1874 fhGamEta->Draw();
9725fd2a 1875
1876 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
1877 c6->Print(name);
06e5656a 1878
9725fd2a 1879 //Generated - reconstructed
1880 //printf("c7\n");
1881 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
1882 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
1883 c7->Divide(2, 2);
1884
1885 c7->cd(1) ;
1886 gPad->SetLogy();
1887 fhGamDeltaE->SetLineColor(4);
1888 fhDeltaE->Draw();
1889 fhGamDeltaE->Draw("same");
06e5656a 1890
9725fd2a 1891 TLegend pLegendd(0.65,0.55,0.9,0.8);
1892 pLegendd.SetTextSize(0.06);
1893 pLegendd.AddEntry(fhDeltaE,"all","L");
1894 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
1895 pLegendd.SetFillColor(10);
1896 pLegendd.SetBorderSize(1);
1897 pLegendd.Draw();
06e5656a 1898
9725fd2a 1899 c7->cd(2) ;
1900 gPad->SetLogy();
1901 fhGamDeltaPt->SetLineColor(4);
1902 fhDeltaPt->Draw();
06e5656a 1903 fhGamDeltaPt->Draw("same");
1904
9725fd2a 1905 c7->cd(3) ;
1906 fhGamDeltaPhi->SetLineColor(4);
1907 fhDeltaPhi->Draw();
06e5656a 1908 fhGamDeltaPhi->Draw("same");
9725fd2a 1909
1910 c7->cd(4) ;
1911 fhGamDeltaEta->SetLineColor(4);
1912 fhDeltaEta->Draw();
1913 fhGamDeltaEta->Draw("same");
06e5656a 1914
9725fd2a 1915 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
1916 c7->Print(name);
1917
9725fd2a 1918 // Reconstructed / Generated
1919 //printf("c8\n");
1920 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
1921 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
1922 c8->Divide(2, 2);
1923
1924 c8->cd(1) ;
1925 gPad->SetLogy();
1926 fhGamRatioE->SetLineColor(4);
1927 fhRatioE->Draw();
1928 fhGamRatioE->Draw("same");
06e5656a 1929
9725fd2a 1930 TLegend pLegendr(0.65,0.55,0.9,0.8);
1931 pLegendr.SetTextSize(0.06);
1932 pLegendr.AddEntry(fhRatioE,"all","L");
1933 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
1934 pLegendr.SetFillColor(10);
1935 pLegendr.SetBorderSize(1);
1936 pLegendr.Draw();
06e5656a 1937
9725fd2a 1938 c8->cd(2) ;
1939 gPad->SetLogy();
1940 fhGamRatioPt->SetLineColor(4);
1941 fhRatioPt->Draw();
06e5656a 1942 fhGamRatioPt->Draw("same");
1943
9725fd2a 1944 c8->cd(3) ;
1945 fhGamRatioPhi->SetLineColor(4);
1946 fhRatioPhi->Draw();
06e5656a 1947 fhGamRatioPhi->Draw("same");
1948
9725fd2a 1949 c8->cd(4) ;
1950 fhGamRatioEta->SetLineColor(4);
1951 fhRatioEta->Draw();
06e5656a 1952 fhGamRatioEta->Draw("same");
1953
9725fd2a 1954 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
1955 c8->Print(name);
1956
06e5656a 1957
9725fd2a 1958 // CaloClusters CaloCells
1959 //printf("c9\n");
1960 sprintf(cname,"QA_%s_nclustercellsamp",fCalorimeter.Data());
1961 TCanvas * c9 = new TCanvas(cname, " CaloClusters and CaloCells", 400, 400) ;
1962 c9->Divide(2, 2);
1963
1964 c9->cd(1) ;
1965 gPad->SetLogy();
1966 gPad->SetLogx();
1967 fhNClusters->SetLineColor(4);
1968 fhNClusters->Draw();
1969
1970 c9->cd(2) ;
1971 gPad->SetLogy();
1972 gPad->SetLogx();
1973 fhNCells->SetLineColor(4);
1974 fhNCells->Draw();
1975
1976 c9->cd(3) ;
1977 gPad->SetLogy();
1978 gPad->SetLogx();
1979 fhNCellsPerCluster->SetLineColor(4);
1980 fhNCellsPerCluster->Draw();
1981
1982 c9->cd(4) ;
1983 gPad->SetLogy();
1984 //gPad->SetLogx();
1985 fhAmplitude->SetLineColor(4);
1986 fhAmplitude->Draw();
1987
1988 sprintf(name,"QA_%s_CaloClustersAndCaloCells.eps",fCalorimeter.Data());
1989 c9->Print(name);
1990
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());
2113 c10->Print(name);
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());
2298 c11->Print(name);
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());
2380 c12->Print(name);
2381
2382
2383 //Reconstructed distributions
2384 //printf("c1\n");
2385 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
2386 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
2387 c13->Divide(2, 2);
2388
2389 c13->cd(1) ;
2390 //gPad->SetLogy();
06e5656a 2391 fhEMVxyz->SetTitleOffset(1.6,"Y");
2392 fhEMVxyz->Draw();
9725fd2a 2393
2394 c13->cd(2) ;
2395 //gPad->SetLogy();
06e5656a 2396 fhHaVxyz->SetTitleOffset(1.6,"Y");
9725fd2a 2397 fhHaVxyz->Draw();
2398
2399 c13->cd(3) ;
2400 gPad->SetLogy();
2401 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY("hEM",-1,-1);
2402 hEMR->SetLineColor(4);
2403 hEMR->Draw();
2404
2405 c13->cd(4) ;
2406 gPad->SetLogy();
2407 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY("hHa",-1,-1);
2408 hHaR->SetLineColor(4);
2409 hHaR->Draw();
2410
2411
2412 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
2413 c13->Print(name);
2414
2415
06e5656a 2416 //Track-matching distributions
2417
2418
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());
2526 c22ch->Print(name);
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());
2640 c3ch->Print(name);
2641
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);
06e5656a 2660 gPad->SetLogy();
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);
06e5656a 2668 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());
2678 cme->Print(name);
06e5656a 2679
2680
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());
2701 cmemc->Print(name);
2702
2703 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
2704 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
2705 cmemchad->Divide(3,1);
2706
2707 cmemchad->cd(1);
2708 gPad->SetLogy();
2709 fhMCChHad1pOverE->Draw();
2710 fhMCChHad1pOverER02->SetLineColor(4);
2711 fhMCChHad1pOverE->SetLineColor(1);
2712 fhMCChHad1pOverER02->Draw("same");
2713 pLegendpE0.Draw();
2714
2715 cmemchad->cd(2);
2716 gPad->SetLogy();
2717 fhMCChHad1dR->Draw();
2718
2719 cmemchad->cd(3);
2720 fhMCChHad2MatchdEdx->Draw();
2721
2722 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
2723 cmemchad->Print(name);
2724
2725 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
2726 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
2727 cmemcn->Divide(3,1);
2728
2729 cmemcn->cd(1);
2730 gPad->SetLogy();
2731 fhMCNeutral1pOverE->Draw();
2732 fhMCNeutral1pOverE->SetLineColor(1);
2733 fhMCNeutral1pOverER02->SetLineColor(4);
2734 fhMCNeutral1pOverER02->Draw("same");
2735 pLegendpE0.Draw();
2736
2737 cmemcn->cd(2);
2738 gPad->SetLogy();
2739 fhMCNeutral1dR->Draw();
2740
2741 cmemcn->cd(3);
2742 fhMCNeutral2MatchdEdx->Draw();
2743
2744 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
2745 cmemcn->Print(name);
2746
2747 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
2748 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
2749 cmpoe->Divide(2,1);
2750
2751 cmpoe->cd(1);
2752 gPad->SetLogy();
2753 fh1pOverE->SetLineColor(1);
2754 fhMCEle1pOverE->SetLineColor(4);
2755 fhMCChHad1pOverE->SetLineColor(2);
2756 fhMCNeutral1pOverE->SetLineColor(7);
2757 fh1pOverER02->SetMinimum(0.5);
2758 fh1pOverE->Draw();
2759 fhMCEle1pOverE->Draw("same");
2760 fhMCChHad1pOverE->Draw("same");
2761 fhMCNeutral1pOverE->Draw("same");
2762 TLegend pLegendpE(0.65,0.55,0.9,0.8);
2763 pLegendpE.SetTextSize(0.06);
2764 pLegendpE.AddEntry(fh1pOverE,"all","L");
2765 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
2766 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
2767 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
2768 pLegendpE.SetFillColor(10);
2769 pLegendpE.SetBorderSize(1);
2770 pLegendpE.Draw();
2771
2772 cmpoe->cd(2);
2773 gPad->SetLogy();
2774 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
2775 fh1pOverER02->SetLineColor(1);
2776 fhMCEle1pOverER02->SetLineColor(4);
2777 fhMCChHad1pOverER02->SetLineColor(2);
2778 fhMCNeutral1pOverER02->SetLineColor(7);
2779 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
2780 fh1pOverER02->SetMinimum(0.5);
2781 fh1pOverER02->Draw();
2782 fhMCEle1pOverER02->Draw("same");
2783 fhMCChHad1pOverER02->Draw("same");
2784 fhMCNeutral1pOverER02->Draw("same");
2785
2786 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
2787 // pLegendpE2.SetTextSize(0.06);
2788 // pLegendpE2.SetHeader("dR < 0.02");
2789 // pLegendpE2.SetFillColor(10);
2790 // pLegendpE2.SetBorderSize(1);
2791 // pLegendpE2.Draw();
2792
2793 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
2794 cmpoe->Print(name);
2795
2796
9725fd2a 2797 }
06e5656a 2798
9725fd2a 2799 char line[1024] ;
2800 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
2801 gROOT->ProcessLine(line);
2802 sprintf(line, ".!rm -fR *.eps");
2803 gROOT->ProcessLine(line);
2804
2805 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());
2806
2807}