1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 //_________________________________________________________________________
18 // Class to check results from simulations or reconstructed real data.
19 // Fill few histograms and do some checking plots
21 //-- Author: Gustavo Conesa (INFN-LNF)
22 //_________________________________________________________________________
25 // --- ROOT system ---
26 //#include "Riostream.h"
27 #include "TObjArray.h"
28 #include "TParticle.h"
29 #include "TDatabasePDG.h"
37 //---- AliRoot system ----
38 #include "AliAnaCalorimeterQA.h"
39 #include "AliCaloTrackReader.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"
48 ClassImp(AliAnaCalorimeterQA)
50 //____________________________________________________________________________
51 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
52 AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""), fMakePlots(kFALSE),
53 fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhi(0),
54 fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiCharged(0),
55 fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0),
56 fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
57 fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0), fhIM(0), fhAsym(0), fhNCellsPerCluster(0), fhNClusters(0), fhNCells(0), fhAmplitude(0),
58 fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
59 fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
60 fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
61 fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
62 fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0), fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
63 fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
64 fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0), fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
65 fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
66 fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
67 fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
68 fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
69 fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
70 fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
71 fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
72 fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
73 fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
74 fhMCChHad1pOverE(0),fhMCChHad1dR(0),fhMCChHad2MatchdEdx(0),fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
75 fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
79 //Initialize parameters
83 //____________________________________________________________________________
84 AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
85 AliAnaPartCorrBaseClass(qa), fCalorimeter(qa.fCalorimeter), fStyleMacro(qa.fStyleMacro), fMakePlots(qa.fMakePlots),
86 fhE(qa.fhE),fhPt(qa.fhPt), fhPhi(qa.fhPhi), fhEta(qa.fhEta),
87 fhEtaPhi(qa.fhEtaPhi), fhECharged(qa.fhECharged),fhPtCharged(qa.fhPtCharged),fhPhiCharged(qa.fhPhiCharged),
88 fhEtaCharged(qa.fhEtaCharged), fhEtaPhiCharged(qa.fhEtaPhiCharged),
89 fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
90 fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut),
91 fhDeltaE(qa.fhDeltaE), fhDeltaPt(qa.fhDeltaPt), fhDeltaPhi(qa.fhDeltaPhi), fhDeltaEta(qa.fhDeltaEta),
92 fhRatioE(qa.fhRatioE), fhRatioPt(qa.fhRatioPt), fhRatioPhi(qa.fhRatioPhi), fhRatioEta(qa.fhRatioEta),
93 fh2E(qa.fh2E), fh2Pt(qa.fh2Pt), fh2Phi(qa.fh2Phi),fh2Eta(qa.fh2Eta),
94 fhIM(qa.fhIM), fhAsym(qa.fhAsym), fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNClusters(qa.fhNClusters),
95 fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude),
96 fhGenGamPt(qa.fhGenGamPt), fhGenGamEta(qa.fhGenGamEta), fhGenGamPhi(qa.fhGenGamPhi),
97 fhGenPi0Pt(qa.fhGenPi0Pt), fhGenPi0Eta(qa.fhGenPi0Eta), fhGenPi0Phi(qa.fhGenPi0Phi),
98 fhGenEtaPt(qa.fhGenEtaPt), fhGenEtaEta(qa.fhGenEtaEta), fhGenEtaPhi(qa.fhGenEtaPhi),
99 fhGenOmegaPt(qa.fhGenOmegaPt), fhGenOmegaEta(qa.fhGenOmegaEta), fhGenOmegaPhi(qa.fhGenOmegaPhi),
100 fhGenElePt(qa.fhGenElePt), fhGenEleEta(qa.fhGenEleEta), fhGenElePhi(qa.fhGenElePhi),
101 fhEMVxyz(qa.fhEMVxyz), fhEMR(qa.fhEMR), fhHaVxyz(qa.fhHaVxyz), fhHaR(qa.fhHaR),
102 fhGamE(qa.fhGamE),fhGamPt(qa.fhGamPt),fhGamPhi(qa.fhGamPhi),fhGamEta(qa.fhGamEta),
103 fhGamDeltaE(qa.fhGamDeltaE), fhGamDeltaPt(qa.fhGamDeltaPt), fhGamDeltaPhi(qa.fhGamDeltaPhi), fhGamDeltaEta(qa.fhGamDeltaEta),
104 fhGamRatioE(qa.fhGamRatioE), fhGamRatioPt(qa.fhGamRatioPt), fhGamRatioPhi(qa.fhGamRatioPhi), fhGamRatioEta(qa.fhGamRatioEta),
105 fhEleE(qa.fhEleE),fhElePt(qa.fhElePt),fhElePhi(qa.fhElePhi),fhEleEta(qa.fhEleEta),
106 fhPi0E(qa.fhPi0E),fhPi0Pt(qa.fhPi0Pt),fhPi0Phi(qa.fhPi0Phi),fhPi0Eta(qa.fhPi0Eta),
107 fhNeHadE(qa.fhNeHadE),fhNeHadPt(qa.fhNeHadPt),fhNeHadPhi(qa.fhNeHadPhi),fhNeHadEta(qa.fhNeHadEta),
108 fhChHadE(qa.fhChHadE),fhChHadPt(qa.fhChHadPt),fhChHadPhi(qa.fhChHadPhi),fhChHadEta(qa.fhChHadEta),
109 fhGamECharged(qa.fhGamECharged),fhGamPtCharged(qa.fhGamPtCharged),fhGamPhiCharged(qa.fhGamPhiCharged),fhGamEtaCharged(qa.fhGamEtaCharged),
110 fhEleECharged(qa.fhEleECharged),fhElePtCharged(qa.fhElePtCharged),fhElePhiCharged(qa.fhElePhiCharged),fhEleEtaCharged(qa.fhEleEtaCharged),
111 fhPi0ECharged(qa.fhPi0ECharged),fhPi0PtCharged(qa.fhPi0PtCharged),fhPi0PhiCharged(qa.fhPi0PhiCharged),fhPi0EtaCharged(qa.fhPi0EtaCharged),
112 fhNeHadECharged(qa.fhNeHadECharged),fhNeHadPtCharged(qa.fhNeHadPtCharged),fhNeHadPhiCharged(qa.fhNeHadPhiCharged),fhNeHadEtaCharged(qa.fhNeHadEtaCharged),
113 fhChHadECharged(qa.fhChHadECharged),fhChHadPtCharged(qa.fhChHadPtCharged),fhChHadPhiCharged(qa.fhChHadPhiCharged),fhChHadEtaCharged(qa.fhChHadEtaCharged),
114 fhGenGamAccE(qa.fhGenGamAccE),fhGenGamAccPt(qa.fhGenGamAccPt),fhGenGamAccEta(qa.fhGenGamAccEta),fhGenGamAccPhi(qa.fhGenGamAccPhi),
115 fhGenPi0AccE(qa.fhGenPi0AccE),fhGenPi0AccPt(qa.fhGenPi0AccPt),fhGenPi0AccEta(qa.fhGenPi0AccEta),fhGenPi0AccPhi(qa.fhGenPi0AccPhi),
116 fh1pOverE(qa.fh1pOverE),fh1dR(qa.fh1dR),fh2EledEdx(qa.fh2EledEdx), fh2MatchdEdx(qa.fh2MatchdEdx),
117 fhMCEle1pOverE(qa.fhMCEle1pOverE),fhMCEle1dR(qa.fhMCEle1dR), fhMCEle2MatchdEdx(qa.fhMCEle2MatchdEdx),
118 fhMCChHad1pOverE(qa.fhMCChHad1pOverE),fhMCChHad1dR(qa.fhMCChHad1dR), fhMCChHad2MatchdEdx(qa.fhMCChHad2MatchdEdx),
119 fhMCNeutral1pOverE(qa.fhMCNeutral1pOverE),fhMCNeutral1dR(qa.fhMCNeutral1dR), fhMCNeutral2MatchdEdx(qa.fhMCNeutral2MatchdEdx),
120 fh1pOverER02(qa.fh1pOverER02), fhMCEle1pOverER02(qa.fhMCEle1pOverER02),fhMCChHad1pOverER02(qa.fhMCChHad1pOverER02), fhMCNeutral1pOverER02(qa.fhMCNeutral1pOverER02)
126 //_________________________________________________________________________
127 AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA & qa)
129 // assignment operator
131 if(this == &qa)return *this;
132 ((AliAnaPartCorrBaseClass *)this)->operator=(qa);
134 fCalorimeter = qa.fCalorimeter;
135 fStyleMacro = qa.fStyleMacro;
136 fMakePlots = qa.fMakePlots;
142 fhEtaPhi = qa.fhEtaPhi;
144 fhECharged = qa.fhECharged;
145 fhPtCharged = qa.fhPtCharged;
146 fhPhiCharged = qa.fhPhiCharged;
147 fhEtaCharged = qa.fhEtaCharged;
148 fhEtaPhiCharged = qa.fhEtaPhiCharged;
150 fhEChargedNoOut = qa.fhEChargedNoOut;
151 fhPtChargedNoOut = qa.fhPtChargedNoOut;
152 fhPhiChargedNoOut = qa.fhPhiChargedNoOut;
153 fhEtaChargedNoOut = qa.fhEtaChargedNoOut;
154 fhEtaPhiChargedNoOut = qa.fhEtaPhiChargedNoOut;
159 fhNCellsPerCluster = qa.fhNCellsPerCluster;
160 fhNClusters = qa.fhNClusters;
162 fhDeltaE = qa.fhDeltaE;
163 fhDeltaPt = qa.fhDeltaPt;
164 fhDeltaPhi = qa.fhDeltaPhi;
165 fhDeltaEta = qa.fhDeltaEta;
167 fhRatioE = qa.fhRatioE;
168 fhRatioPt = qa.fhRatioPt;
169 fhRatioPhi = qa.fhRatioPhi;
170 fhRatioEta = qa.fhRatioEta;
178 fhNCells = qa.fhNCells;
179 fhAmplitude = qa.fhAmplitude;
181 fhGenGamPt = qa.fhGenGamPt ; fhGenGamEta = qa.fhGenGamEta ; fhGenGamPhi = qa.fhGenGamPhi ;
182 fhGenPi0Pt = qa.fhGenPi0Pt ; fhGenPi0Eta = qa.fhGenPi0Eta ; fhGenPi0Phi = qa.fhGenPi0Phi ;
183 fhGenEtaPt = qa.fhGenEtaPt ; fhGenEtaEta = qa.fhGenEtaEta ; fhGenEtaPhi = qa.fhGenEtaPhi ;
184 fhGenOmegaPt = qa.fhGenOmegaPt ; fhGenOmegaEta = qa.fhGenOmegaEta ; fhGenOmegaPhi = qa.fhGenOmegaPhi ;
185 fhGenElePt = qa.fhGenElePt ; fhGenEleEta = qa.fhGenEleEta ; fhGenElePhi = qa.fhGenElePhi ;
187 fhEMVxyz = qa.fhEMVxyz ; fhEMR = qa.fhEMR ; fhHaVxyz = qa.fhHaVxyz ; fhHaR = qa.fhHaR ;
188 fhGamE = qa.fhGamE ;fhGamPt = qa.fhGamPt ;fhGamPhi = qa.fhGamPhi ;fhGamEta = qa.fhGamEta ;
189 fhGamDeltaE = qa.fhDeltaE; fhGamDeltaPt = qa.fhDeltaPt; fhGamDeltaPhi = qa.fhDeltaPhi; fhGamDeltaEta = qa.fhDeltaEta;
191 fhGamRatioE = qa.fhGamRatioE; fhGamRatioPt = qa.fhGamRatioPt; fhGamRatioPhi = qa.fhGamRatioPhi; fhGamRatioEta = qa.fhGamRatioEta;
193 fhEleE = qa.fhEleE ;fhElePt = qa.fhElePt ;fhElePhi = qa.fhElePhi ;fhEleEta = qa.fhEleEta ;
194 fhPi0E = qa.fhPi0E ;fhPi0Pt = qa.fhPi0Pt ;fhPi0Phi = qa.fhPi0Phi ;fhPi0Eta = qa.fhPi0Eta ;
195 fhNeHadE = qa.fhNeHadE ;fhNeHadPt = qa.fhNeHadPt ;fhNeHadPhi = qa.fhNeHadPhi ;fhNeHadEta = qa.fhNeHadEta ;
196 fhChHadE = qa.fhChHadE ;fhChHadPt = qa.fhChHadPt ;fhChHadPhi = qa.fhChHadPhi ;fhChHadEta = qa.fhChHadEta ;
197 fhGenGamAccE = qa.fhGenGamAccE ; fhGenPi0AccE = qa.fhGenPi0AccE ;
198 fhGenGamAccPt = qa.fhGenGamAccPt ;fhGenGamAccEta = qa.fhGenGamAccEta ;fhGenGamAccPhi = qa.fhGenGamAccPhi ;
199 fhGenPi0AccPt = qa.fhGenPi0AccPt ;fhGenPi0AccEta = qa.fhGenPi0AccEta; fhGenPi0AccPhi = qa.fhGenPi0AccPhi ;
201 fhGamECharged = qa.fhGamECharged; fhGamPtCharged = qa.fhGamPtCharged; fhGamPhiCharged = qa.fhGamPhiCharged; fhGamEtaCharged = qa.fhGamEtaCharged;
202 fhEleECharged = qa.fhEleECharged; fhElePtCharged = qa.fhElePtCharged; fhElePhiCharged = qa.fhElePhiCharged; fhEleEtaCharged = qa.fhEleEtaCharged;
203 fhPi0ECharged = qa.fhPi0ECharged; fhPi0PtCharged = qa.fhPi0PtCharged; fhPi0PhiCharged = qa.fhPi0PhiCharged; fhPi0EtaCharged = qa.fhPi0EtaCharged;
204 fhNeHadECharged = qa.fhNeHadECharged; fhNeHadPtCharged = qa.fhNeHadPtCharged; fhNeHadPhiCharged = qa.fhNeHadPhiCharged; fhNeHadEtaCharged = qa.fhNeHadEtaCharged;
205 fhChHadECharged = qa.fhChHadECharged; fhChHadPtCharged = qa.fhChHadPtCharged; fhChHadPhiCharged = qa.fhChHadPhiCharged; fhChHadEtaCharged = qa.fhChHadEtaCharged;
207 fh1pOverE = qa.fh1pOverE;
209 fh2MatchdEdx = qa.fh2MatchdEdx;
210 fh2EledEdx = qa.fh2EledEdx;
212 fhMCEle1pOverE = qa.fhMCEle1pOverE;
213 fhMCEle1dR = qa.fhMCEle1dR;
214 fhMCEle2MatchdEdx = qa.fhMCEle2MatchdEdx ;
216 fhMCChHad1pOverE = qa.fhMCChHad1pOverE; fhMCChHad1dR = qa.fhMCChHad1dR; fhMCChHad2MatchdEdx = qa.fhMCChHad2MatchdEdx;
217 fhMCNeutral1pOverE = qa.fhMCNeutral1pOverE; fhMCNeutral1dR = qa.fhMCNeutral1dR; fhMCNeutral2MatchdEdx = qa.fhMCNeutral2MatchdEdx;
218 fh1pOverER02 = qa.fh1pOverER02; fhMCEle1pOverER02 = qa.fhMCEle1pOverER02; fhMCChHad1pOverER02 = qa.fhMCChHad1pOverER02;
219 fhMCNeutral1pOverER02 = qa.fhMCNeutral1pOverER02;
225 //________________________________________________________________________
226 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
228 // Create histograms to be saved in output file and
229 // store them in fOutputContainer
231 TList * outputContainer = new TList() ;
232 outputContainer->SetName("QAHistos") ;
234 Int_t nptbins = GetHistoNPtBins();
235 Int_t nphibins = GetHistoNPhiBins();
236 Int_t netabins = GetHistoNEtaBins();
237 Float_t ptmax = GetHistoPtMax();
238 Float_t phimax = GetHistoPhiMax();
239 Float_t etamax = GetHistoEtaMax();
240 Float_t ptmin = GetHistoPtMin();
241 Float_t phimin = GetHistoPhiMin();
242 Float_t etamin = GetHistoEtaMin();
244 fhE = new TH1F ("hE","E reconstructed", nptbins,ptmin,ptmax);
245 fhE->SetXTitle("E (GeV)");
246 outputContainer->Add(fhE);
248 fhPt = new TH1F ("hPt","p_{T} reconstructed", nptbins,ptmin,ptmax);
249 fhPt->SetXTitle("p_{T} (GeV/c)");
250 outputContainer->Add(fhPt);
252 fhPhi = new TH1F ("hPhi","#phi reconstructed",nphibins,phimin,phimax);
253 fhPhi->SetXTitle("#phi (rad)");
254 outputContainer->Add(fhPhi);
256 fhEta = new TH1F ("hEta","#eta reconstructed",netabins,etamin,etamax);
257 fhEta->SetXTitle("#eta ");
258 outputContainer->Add(fhEta);
260 fhEtaPhi = new TH2F ("hEtaPhi","#eta vs #phi, reconstructed",netabins,etamin,etamax,nphibins,phimin,phimax);
261 fhEtaPhi->SetXTitle("#eta ");
262 fhEtaPhi->SetYTitle("#phi ");
263 outputContainer->Add(fhEtaPhi);
265 fhECharged = new TH1F ("hECharged","E reconstructed, matched with track", nptbins,ptmin,ptmax);
266 fhECharged->SetXTitle("E (GeV)");
267 outputContainer->Add(fhECharged);
269 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed, matched with track", nptbins,ptmin,ptmax);
270 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
271 outputContainer->Add(fhPtCharged);
273 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed, matched with track",nphibins,phimin,phimax);
274 fhPhiCharged->SetXTitle("#phi (rad)");
275 outputContainer->Add(fhPhiCharged);
277 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed, matched with track",netabins,etamin,etamax);
278 fhEtaCharged->SetXTitle("#eta ");
279 outputContainer->Add(fhEtaCharged);
281 fhEtaPhiCharged = new TH2F ("hEtaPhiCharged","#eta vs #phi, reconstructed , matched with track",netabins,etamin,etamax,nphibins,phimin,phimax);
282 fhEtaPhiCharged->SetXTitle("#eta ");
283 fhEtaPhiCharged->SetYTitle("#phi ");
284 outputContainer->Add(fhEtaPhiCharged);
287 fhEChargedNoOut = new TH1F ("hEChargedNoOut","E reconstructed, matched with track, no output track params", nptbins,ptmin,ptmax);
288 fhEChargedNoOut->SetXTitle("E (GeV)");
289 outputContainer->Add(fhEChargedNoOut);
291 fhPtChargedNoOut = new TH1F ("hPtChargedNoOut","p_{T} reconstructed, matched with track, no output track params", nptbins,ptmin,ptmax);
292 fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
293 outputContainer->Add(fhPtChargedNoOut);
295 fhPhiChargedNoOut = new TH1F ("hPhiChargedNoOut","#phi reconstructed, matched with track, no output track params",nphibins,phimin,phimax);
296 fhPhiChargedNoOut->SetXTitle("#phi (rad)");
297 outputContainer->Add(fhPhiChargedNoOut);
299 fhEtaChargedNoOut = new TH1F ("hEtaChargedNoOut","#eta reconstructed, matched with track, no output track params",netabins,etamin,etamax);
300 fhEtaChargedNoOut->SetXTitle("#eta ");
301 outputContainer->Add(fhEtaChargedNoOut);
303 fhEtaPhiChargedNoOut = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed , matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);
304 fhEtaPhiChargedNoOut->SetXTitle("#eta ");
305 fhEtaPhiChargedNoOut->SetYTitle("#phi ");
306 outputContainer->Add(fhEtaPhiChargedNoOut);
308 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,200,0,1);
309 fhIM->SetXTitle("E_{cluster pairs} (GeV) ");
310 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
311 outputContainer->Add(fhIM);
313 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,100,0,1);
314 fhAsym->SetXTitle("E_{cluster pairs} (GeV) ");
315 fhAsym->SetYTitle("Asymmetry");
316 outputContainer->Add(fhAsym);
318 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs cluster energy", nptbins,ptmin,ptmax, 100,0,1000);
319 fhNCellsPerCluster->SetXTitle("E (GeV)");
320 fhNCellsPerCluster->SetYTitle("n cells");
321 outputContainer->Add(fhNCellsPerCluster);
323 fhNClusters = new TH1F ("hNClusters","# clusters", 300,0,300);
324 fhNClusters->SetXTitle("number of clusters");
325 outputContainer->Add(fhNClusters);
328 fhNCells = new TH1F ("hNCells","# cells", 13000,0,13000);
329 fhNCells->SetXTitle("n cells");
330 outputContainer->Add(fhNCells);
332 fhAmplitude = new TH1F ("hAmplitude","Amplitude", 100,0,1000);
333 fhAmplitude->SetXTitle("Amplitude ");
334 outputContainer->Add(fhAmplitude);
338 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", 200,-50,50);
339 fhDeltaE->SetXTitle("#Delta E (GeV)");
340 outputContainer->Add(fhDeltaE);
342 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", 200,-50,50);
343 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
344 outputContainer->Add(fhDeltaPt);
346 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",100,-2,2);
347 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
348 outputContainer->Add(fhDeltaPhi);
350 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",100,-1,1);
351 fhDeltaEta->SetXTitle("#Delta #eta ");
352 outputContainer->Add(fhDeltaEta);
354 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", 200,0,2);
355 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
356 outputContainer->Add(fhRatioE);
358 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", 200,0,2);
359 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
360 outputContainer->Add(fhRatioPt);
362 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",200,0,2);
363 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
364 outputContainer->Add(fhRatioPhi);
366 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",200,0,2);
367 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
368 outputContainer->Add(fhRatioEta);
370 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
371 fh2E->SetXTitle("E_{rec} (GeV)");
372 fh2E->SetYTitle("E_{gen} (GeV)");
373 outputContainer->Add(fh2E);
375 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
376 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
377 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
378 outputContainer->Add(fh2Pt);
380 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
381 fh2Phi->SetXTitle("#phi_{rec} (rad)");
382 fh2Phi->SetYTitle("#phi_{gen} (rad)");
383 outputContainer->Add(fh2Phi);
385 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
386 fh2Eta->SetXTitle("#eta_{rec} ");
387 fh2Eta->SetYTitle("#eta_{gen} ");
388 outputContainer->Add(fh2Eta);
390 //Fill histos depending on origin of cluster
391 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
392 fhGamE->SetXTitle("E_{rec} (GeV)");
393 fhGamE->SetXTitle("E_{gen} (GeV)");
394 outputContainer->Add(fhGamE);
396 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
397 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
398 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
399 outputContainer->Add(fhGamPt);
401 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
402 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
403 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
404 outputContainer->Add(fhGamPhi);
406 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
407 fhGamEta->SetXTitle("#eta_{rec} ");
408 fhGamEta->SetYTitle("#eta_{gen} ");
409 outputContainer->Add(fhGamEta);
411 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", 200,-50,50);
412 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
413 outputContainer->Add(fhGamDeltaE);
415 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", 200,-50,50);
416 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
417 outputContainer->Add(fhGamDeltaPt);
419 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",100,-2,2);
420 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
421 outputContainer->Add(fhGamDeltaPhi);
423 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",100,-1,1);
424 fhGamDeltaEta->SetXTitle("#Delta #eta ");
425 outputContainer->Add(fhGamDeltaEta);
427 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", 200,0,2);
428 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
429 outputContainer->Add(fhGamRatioE);
431 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", 200,0,2);
432 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
433 outputContainer->Add(fhGamRatioPt);
435 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",200,0,2);
436 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
437 outputContainer->Add(fhGamRatioPhi);
439 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",200,0,2);
440 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
441 outputContainer->Add(fhGamRatioEta);
443 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
444 fhPi0E->SetXTitle("E_{rec} (GeV)");
445 fhPi0E->SetYTitle("E_{gen} (GeV)");
446 outputContainer->Add(fhPi0E);
448 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
449 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
450 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
451 outputContainer->Add(fhPi0Pt);
453 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
454 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
455 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
456 outputContainer->Add(fhPi0Phi);
458 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
459 fhPi0Eta->SetXTitle("#eta_{rec} ");
460 fhPi0Eta->SetYTitle("#eta_{gen} ");
461 outputContainer->Add(fhPi0Eta);
463 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
464 fhEleE->SetXTitle("E_{rec} (GeV)");
465 fhEleE->SetXTitle("E_{gen} (GeV)");
466 outputContainer->Add(fhEleE);
468 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
469 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
470 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
471 outputContainer->Add(fhElePt);
473 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
474 fhElePhi->SetXTitle("#phi_{rec} (rad)");
475 fhElePhi->SetYTitle("#phi_{gen} (rad)");
476 outputContainer->Add(fhElePhi);
478 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
479 fhEleEta->SetXTitle("#eta_{rec} ");
480 fhEleEta->SetYTitle("#eta_{gen} ");
481 outputContainer->Add(fhEleEta);
483 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
484 fhNeHadE->SetXTitle("E_{rec} (GeV)");
485 fhNeHadE->SetYTitle("E_{gen} (GeV)");
486 outputContainer->Add(fhNeHadE);
488 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
489 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
490 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
491 outputContainer->Add(fhNeHadPt);
493 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
494 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
495 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
496 outputContainer->Add(fhNeHadPhi);
498 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
499 fhNeHadEta->SetXTitle("#eta_{rec} ");
500 fhNeHadEta->SetYTitle("#eta_{gen} ");
501 outputContainer->Add(fhNeHadEta);
503 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
504 fhChHadE->SetXTitle("E_{rec} (GeV)");
505 fhChHadE->SetYTitle("E_{gen} (GeV)");
506 outputContainer->Add(fhChHadE);
508 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
509 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
510 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
511 outputContainer->Add(fhChHadPt);
513 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
514 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
515 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
516 outputContainer->Add(fhChHadPhi);
518 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
519 fhChHadEta->SetXTitle("#eta_{rec} ");
520 fhChHadEta->SetYTitle("#eta_{gen} ");
521 outputContainer->Add(fhChHadEta);
525 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
526 fhGamECharged->SetXTitle("E_{rec} (GeV)");
527 fhGamECharged->SetXTitle("E_{gen} (GeV)");
528 outputContainer->Add(fhGamECharged);
530 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
531 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
532 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
533 outputContainer->Add(fhGamPtCharged);
535 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
536 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
537 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
538 outputContainer->Add(fhGamPhiCharged);
540 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
541 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
542 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
543 outputContainer->Add(fhGamEtaCharged);
545 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
546 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
547 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
548 outputContainer->Add(fhPi0ECharged);
550 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
551 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
552 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
553 outputContainer->Add(fhPi0PtCharged);
555 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
556 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
557 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
558 outputContainer->Add(fhPi0PhiCharged);
560 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
561 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
562 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
563 outputContainer->Add(fhPi0EtaCharged);
565 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
566 fhEleECharged->SetXTitle("E_{rec} (GeV)");
567 fhEleECharged->SetXTitle("E_{gen} (GeV)");
568 outputContainer->Add(fhEleECharged);
570 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
571 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
572 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
573 outputContainer->Add(fhElePtCharged);
575 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
576 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
577 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
578 outputContainer->Add(fhElePhiCharged);
580 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
581 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
582 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
583 outputContainer->Add(fhEleEtaCharged);
585 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
586 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
587 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
588 outputContainer->Add(fhNeHadECharged);
590 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
591 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
592 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
593 outputContainer->Add(fhNeHadPtCharged);
595 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
596 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
597 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
598 outputContainer->Add(fhNeHadPhiCharged);
600 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
601 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
602 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
603 outputContainer->Add(fhNeHadEtaCharged);
605 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
606 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
607 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
608 outputContainer->Add(fhChHadECharged);
610 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
611 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
612 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
613 outputContainer->Add(fhChHadPtCharged);
615 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
616 fhChHadPhiCharged->SetXTitle("#phi (rad)");
617 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
618 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
619 outputContainer->Add(fhChHadPhiCharged);
621 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
622 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
623 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
624 outputContainer->Add(fhChHadEtaCharged);
626 //Vertex of generated particles
628 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",100,0,500,100,0,500);//,100,0,500);
629 fhEMVxyz->SetXTitle("v_{x}");
630 fhEMVxyz->SetYTitle("v_{y}");
631 //fhEMVxyz->SetZTitle("v_{z}");
632 outputContainer->Add(fhEMVxyz);
634 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",100,0,500,100,0,500);//,100,0,500);
635 fhHaVxyz->SetXTitle("v_{x}");
636 fhHaVxyz->SetYTitle("v_{y}");
637 //fhHaVxyz->SetZTitle("v_{z}");
638 outputContainer->Add(fhHaVxyz);
640 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,100,0,500);
641 fhEMR->SetXTitle("E (GeV)");
642 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
643 outputContainer->Add(fhEMR);
645 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,100,0,500);
646 fhHaR->SetXTitle("E (GeV)");
647 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
648 outputContainer->Add(fhHaR);
653 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
654 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
655 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
657 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
658 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
659 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
661 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
662 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
663 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
665 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
666 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
667 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
669 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
670 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
671 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
673 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
674 fhGenGamEta->SetXTitle("#eta");
675 fhGenGamPhi->SetXTitle("#phi (rad)");
676 outputContainer->Add(fhGenGamPt);
677 outputContainer->Add(fhGenGamEta);
678 outputContainer->Add(fhGenGamPhi);
680 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
681 fhGenPi0Eta->SetXTitle("#eta");
682 fhGenPi0Phi->SetXTitle("#phi (rad)");
683 outputContainer->Add(fhGenPi0Pt);
684 outputContainer->Add(fhGenPi0Eta);
685 outputContainer->Add(fhGenPi0Phi);
687 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
688 fhGenEtaEta->SetXTitle("#eta");
689 fhGenEtaPhi->SetXTitle("#phi (rad)");
690 outputContainer->Add(fhGenEtaPt);
691 outputContainer->Add(fhGenEtaEta);
692 outputContainer->Add(fhGenEtaPhi);
694 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
695 fhGenOmegaEta->SetXTitle("#eta");
696 fhGenOmegaPhi->SetXTitle("#phi (rad)");
697 outputContainer->Add(fhGenOmegaPt);
698 outputContainer->Add(fhGenOmegaEta);
699 outputContainer->Add(fhGenOmegaPhi);
701 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
702 fhGenEleEta->SetXTitle("#eta");
703 fhGenElePhi->SetXTitle("#phi (rad)");
704 outputContainer->Add(fhGenElePt);
705 outputContainer->Add(fhGenEleEta);
706 outputContainer->Add(fhGenElePhi);
708 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
709 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
710 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
711 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
713 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
714 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
715 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
716 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
718 fhGenGamAccE ->SetXTitle("E (GeV)");
719 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
720 fhGenGamAccEta->SetXTitle("#eta");
721 fhGenGamAccPhi->SetXTitle("#phi (rad)");
722 outputContainer->Add(fhGenGamAccE);
723 outputContainer->Add(fhGenGamAccPt);
724 outputContainer->Add(fhGenGamAccEta);
725 outputContainer->Add(fhGenGamAccPhi);
727 fhGenPi0AccE ->SetXTitle("E (GeV)");
728 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
729 fhGenPi0AccEta->SetXTitle("#eta");
730 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
731 outputContainer->Add(fhGenPi0AccE);
732 outputContainer->Add(fhGenPi0AccPt);
733 outputContainer->Add(fhGenPi0AccEta);
734 outputContainer->Add(fhGenPi0AccPhi);
739 fh1pOverE = new TH1F("h1pOverE","TRACK matches p/E",100,0.,10.);
740 fh1pOverE->SetXTitle("p/E");
741 outputContainer->Add(fh1pOverE);
743 fh1dR = new TH1F("h1dR","TRACK matches dR",300, 0.,TMath::Pi());
744 fh1dR->SetXTitle("#Delta R (rad)");
745 outputContainer->Add(fh1dR) ;
747 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",200,0.,50.,200,0.,400.);
748 fh2MatchdEdx->SetXTitle("p (GeV/c)");
749 fh2MatchdEdx->SetYTitle("<dE/dx>");
750 outputContainer->Add(fh2MatchdEdx);
752 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",200,0.,50.,200,0.,400.);
753 fh2EledEdx->SetXTitle("p (GeV/c)");
754 fh2EledEdx->SetYTitle("<dE/dx>");
755 outputContainer->Add(fh2EledEdx) ;
757 fhMCEle1pOverE = new TH1F("hMCEle1pOverE","TRACK matches p/E, MC electrons",100,0.,10.);
758 fhMCEle1pOverE->SetXTitle("p/E");
759 outputContainer->Add(fhMCEle1pOverE);
761 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",300, 0.,TMath::Pi());
762 fhMCEle1dR->SetXTitle("#Delta R (rad)");
763 outputContainer->Add(fhMCEle1dR) ;
765 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",200,0.,50.,200,0.,400.);
766 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
767 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
768 outputContainer->Add(fhMCEle2MatchdEdx);
770 fhMCChHad1pOverE = new TH1F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",100,0.,10.);
771 fhMCChHad1pOverE->SetXTitle("p/E");
772 outputContainer->Add(fhMCChHad1pOverE);
774 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",300, 0.,TMath::Pi());
775 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
776 outputContainer->Add(fhMCChHad1dR) ;
778 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",200,0.,50.,200,0.,400.);
779 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
780 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
781 outputContainer->Add(fhMCChHad2MatchdEdx);
783 fhMCNeutral1pOverE = new TH1F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",100,0.,10.);
784 fhMCNeutral1pOverE->SetXTitle("p/E");
785 outputContainer->Add(fhMCNeutral1pOverE);
787 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",300, 0.,TMath::Pi());
788 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
789 outputContainer->Add(fhMCNeutral1dR) ;
791 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",200,0.,50.,200,0.,400.);
792 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
793 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
794 outputContainer->Add(fhMCNeutral2MatchdEdx);
796 fh1pOverER02 = new TH1F("h1pOverER02","TRACK matches p/E, all",100,0.,10.);
797 fh1pOverER02->SetXTitle("p/E");
798 outputContainer->Add(fh1pOverER02);
800 fhMCEle1pOverER02 = new TH1F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",100,0.,10.);
801 fhMCEle1pOverER02->SetXTitle("p/E");
802 outputContainer->Add(fhMCEle1pOverER02);
804 fhMCChHad1pOverER02 = new TH1F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",100,0.,10.);
805 fhMCChHad1pOverER02->SetXTitle("p/E");
806 outputContainer->Add(fhMCChHad1pOverER02);
808 fhMCNeutral1pOverER02 = new TH1F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",100,0.,10.);
809 fhMCNeutral1pOverER02->SetXTitle("p/E");
810 outputContainer->Add(fhMCNeutral1pOverER02);
812 return outputContainer;
815 //__________________________________________________
816 void AliAnaCalorimeterQA::Init()
818 //Check if the data or settings are ok
819 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
820 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
824 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
825 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
832 //__________________________________________________
833 void AliAnaCalorimeterQA::InitParameters()
835 //Initialize the parameters of the analysis.
836 AddToHistogramsName("AnaCaloQA_");
838 fCalorimeter = "EMCAL"; //or PHOS
842 //__________________________________________________________________
843 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
845 //Print some relevant parameters set for the analysis
849 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
850 AliAnaPartCorrBaseClass::Print(" ");
852 printf("Select Calorimeter %s \n",fCalorimeter.Data());
853 printf("Plots style macro %s \n",fStyleMacro.Data());
856 //__________________________________________________________________
857 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
859 //Do analysis and fill histograms
861 TLorentzVector mom2 ;
862 //Play with the MC stack if available
863 AliStack * stack = 0x0;
864 TParticle * primary = 0x0;
866 stack = GetMCStack() ;
868 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Stack not available, have you switched on the MC data?\n");
873 //Get List with clusters
874 TObjArray * partList = new TObjArray();
875 if(fCalorimeter == "EMCAL") partList = GetAODEMCAL();
876 else if(fCalorimeter == "PHOS") partList = GetAODPHOS();
878 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
882 if(!partList || partList->GetEntriesFast() == 0) return ;
884 Int_t nclusters = partList->GetEntriesFast() ;
885 fhNClusters->Fill(nclusters);
888 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nclusters);
890 //Get vertex for photon momentum calculation
891 Double_t v[3] ; //vertex ;
892 GetReader()->GetVertex(v);
894 for(Int_t iclus = 0; iclus < partList->GetEntriesFast(); iclus++){
895 //printf(" cluster %d\n",iclus);
896 AliAODCaloCluster * calo = (AliAODCaloCluster*) (partList->At(iclus));
897 //if(calo->GetNCells() <= 2) continue;
898 //Get cluster kinematics
899 calo->GetMomentum(mom,v);
901 //if(e < 0.5) continue;
902 //printf("e %2.2f, n %f\n",e, calo->GetNCells());
903 Float_t pt = mom.Pt();
904 Float_t eta = mom.Eta();
905 Float_t phi = mom.Phi();
906 if(phi < 0) phi +=TMath::TwoPi();
907 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster %d: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",iclus,e,pt,eta,phi*TMath::RadToDeg());
912 fhEtaPhi->Fill(eta,phi);
914 //matched cluster with tracks
915 Int_t ntracksmatched = calo->GetNTracksMatched();
917 //Fill histograms only possible when simulation
919 //Play with the MC stack if available
920 Int_t label = calo->GetLabel(0);
922 if(label < 0 || !stack) {
923 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() *** bad label or no stack ***: label %d \n", label);
927 if(label >= stack->GetNtrack()) {
928 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
932 //cout<<"LABEL "<<label<<endl;
933 primary = GetMCStack()->Particle(label);
935 Int_t pdg = primary->GetPdgCode();
936 Float_t vx = primary->Vx();
937 Float_t vy = primary->Vy();
938 //Float_t vz = primary->Vz();
939 Float_t r = TMath::Sqrt(vx*vx + vy*vy);
940 if((pdg == 22 || TMath::Abs(pdg)==11) && primary->GetStatusCode()!=1) {
941 fhEMVxyz ->Fill(vx,vy);//,vz);
945 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
946 //printf("prim e %f, pt %f, phi %f, eta %f \n", primary->Energy(),primary->Pt() ,primary->Phi() ,primary->Eta() );
947 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vx, vy, vz, r);
949 //Get final particle, no conversion products
950 Int_t status = primary->GetStatusCode();
951 Int_t mother= primary->GetFirstMother();
954 primary = GetMCStack()->Particle(mother);
955 status = primary->GetStatusCode();
956 mother= primary->GetFirstMother();
957 if(status == 1) break;
958 //printf("mother %d\n",mother);
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());
975 //cout<<"Final Label "<<finallabel<<" mother "<<mother<<endl;
976 pdg = primary->GetPdgCode();
977 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
980 //cout<<"pdg "<<pdg<<" status "<<status<<" "<<primary->GetStatusCode()<<endl;
981 TParticle *pi0 = 0x0;
984 TParticle * tmp = 0x0;
987 //Check if it is a decay photon from pi0, in this case, check if both decay contribute cluster
991 if(calo->GetNLabel() > 1){
994 pi0 = GetMCStack()->Particle(mother);
995 pdgpi0 = pi0->GetPdgCode();
997 //cout<<"pi0!!!"<<endl;
1000 mother= pi0->GetFirstMother();
1001 //printf("mother %d\n",mother);
1006 if(!pi0 || mother < 0 ) continue ;
1007 //cout<<"pi0 pointer "<<pi0<<" pdg "<<pdgpi0<<" "<<pi0->GetPdgCode()<<endl;
1008 //cout<<"MOTHER PI0 LABEL "<<mother<<" pt" << pi0->Pt()<<" status "<<pi0->GetStatusCode()<<endl;
1009 if(pi0->GetNDaughters() == 2){
1010 //cout<<"pi0, 2 daughters "<<endl;
1011 Int_t id1 = pi0->GetFirstDaughter();
1012 Int_t id2 = pi0->GetFirstDaughter()+1;
1013 p1=GetMCStack()->Particle(id1);
1014 p2=GetMCStack()->Particle(id2);
1016 //if(p1->GetFirstMother()!=p2->GetFirstMother()) cout <<"Decay photon mothers are not the same!!"<<endl;
1017 if(p1->GetPdgCode()==22 && p2->GetPdgCode()==22){
1018 // cout<<"2 photons, labels "<< id1<<" "<<id2<<endl;
1019 for(UInt_t ilabel = 0; ilabel < calo->GetNLabel(); ilabel++){
1020 Int_t iprim = calo->GetLabel(ilabel);
1021 //cout<<"iprim "<<iprim<<endl;
1022 if (iprim == id1) ok1 = kTRUE;
1023 else if (iprim == id2) ok2 = kTRUE;
1025 while(mothertmp >= 0){
1026 tmp = GetMCStack()->Particle(mothertmp);
1027 mothertmp= tmp->GetFirstMother();
1028 // cout<<"mothertmp "<<mothertmp<<" "<<tmp->GetName()<< " pt "<<tmp->Pt()<<endl;
1029 if (mothertmp == id1) ok1 = kTRUE;
1030 else if (mothertmp == id2) ok2 = kTRUE;
1031 if(ok1 && ok2) break;
1032 //printf("mother %d\n",mother);
1035 }//2 photon daughters
1036 }////mother pi0, 2 daughers
1037 }//more than one contribution to clust
1040 //cout<<"Fill pi0"<< "E "<< e <<" prim E "<<primary->Energy()<<endl;
1041 fhPi0E ->Fill(e,primary->Energy());
1042 fhPi0Pt ->Fill(pt,primary->Pt());
1043 fhPi0Eta ->Fill(eta,primary->Eta());
1044 fhPi0Phi ->Fill(phi,primary->Phi());
1045 if( ntracksmatched > 0){
1046 fhPi0ECharged ->Fill(e,primary->Energy());
1047 fhPi0PtCharged ->Fill(pt,primary->Pt());
1048 fhPi0PhiCharged ->Fill(phi,primary->Phi());
1049 fhPi0EtaCharged ->Fill(eta,primary->Eta());
1053 fhGamE ->Fill(e,primary->Energy());
1054 fhGamPt ->Fill(pt,primary->Pt());
1055 fhGamEta ->Fill(eta,primary->Eta());
1056 fhGamPhi ->Fill(phi,primary->Phi());
1057 fhGamDeltaE ->Fill(primary->Energy()-e);
1058 fhGamDeltaPt ->Fill(primary->Pt()-pt);
1059 fhGamDeltaPhi->Fill(primary->Phi()-phi);
1060 fhGamDeltaEta->Fill(primary->Eta()-eta);
1061 if(primary->Energy() > 0) fhGamRatioE ->Fill(e/primary->Energy());
1062 if(primary->Pt() > 0) fhGamRatioPt ->Fill(pt/primary->Pt());
1063 if(primary->Phi() > 0) fhGamRatioPhi->Fill(phi/primary->Phi());
1064 if(primary->Eta() > 0) fhGamRatioEta->Fill(eta/primary->Eta());
1065 if( ntracksmatched > 0){
1066 fhGamECharged ->Fill(e,primary->Energy());
1067 fhGamPtCharged ->Fill(pt,primary->Pt());
1068 fhGamPhiCharged ->Fill(phi,primary->Phi());
1069 fhGamEtaCharged ->Fill(eta,primary->Eta());
1073 else if(TMath::Abs(pdg) == 11) {
1074 fhEleE ->Fill(e,primary->Energy());
1075 fhElePt ->Fill(pt,primary->Pt());
1076 fhEleEta ->Fill(eta,primary->Eta());
1077 fhElePhi ->Fill(phi,primary->Phi());
1078 fhEMVxyz ->Fill(vx,vy);//,vz);
1080 if( ntracksmatched > 0){
1081 fhEleECharged ->Fill(e,primary->Energy());
1082 fhElePtCharged ->Fill(pt,primary->Pt());
1083 fhElePhiCharged ->Fill(phi,primary->Phi());
1084 fhEleEtaCharged ->Fill(eta,primary->Eta());
1087 else if(pdg == 111) {
1088 fhPi0E ->Fill(e,primary->Energy());
1089 fhPi0Pt ->Fill(pt,primary->Pt());
1090 fhPi0Eta ->Fill(eta,primary->Eta());
1091 fhPi0Phi ->Fill(phi,primary->Phi());
1092 if( ntracksmatched > 0){
1093 fhPi0ECharged ->Fill(e,primary->Energy());
1094 fhPi0PtCharged ->Fill(pt,primary->Pt());
1095 fhPi0PhiCharged ->Fill(phi,primary->Phi());
1096 fhPi0EtaCharged ->Fill(eta,primary->Eta());
1099 else if(charge == 0){
1100 fhNeHadE ->Fill(e,primary->Energy());
1101 fhNeHadPt ->Fill(pt,primary->Pt());
1102 fhNeHadEta ->Fill(eta,primary->Eta());
1103 fhNeHadPhi ->Fill(phi,primary->Phi());
1104 fhHaVxyz ->Fill(vx,vy);//,vz);
1106 if( ntracksmatched > 0){
1107 fhNeHadECharged ->Fill(e,primary->Energy());
1108 fhNeHadPtCharged ->Fill(pt,primary->Pt());
1109 fhNeHadPhiCharged ->Fill(phi,primary->Phi());
1110 fhNeHadEtaCharged ->Fill(eta,primary->Eta());
1114 fhChHadE ->Fill(e,primary->Energy());
1115 fhChHadPt ->Fill(pt,primary->Pt());
1116 fhChHadEta ->Fill(eta,primary->Eta());
1117 fhChHadPhi ->Fill(phi,primary->Phi());
1118 fhHaVxyz ->Fill(vx,vy);//,vz);
1120 if( ntracksmatched > 0){
1121 fhChHadECharged ->Fill(e,primary->Energy());
1122 fhChHadPtCharged ->Fill(pt,primary->Pt());
1123 fhChHadPhiCharged ->Fill(phi,primary->Phi());
1124 fhChHadEtaCharged ->Fill(eta,primary->Eta());
1127 }//Work with stack also
1129 //matched cluster with tracks
1130 if( ntracksmatched > 0){
1131 fhECharged ->Fill(e);
1132 fhPtCharged ->Fill(pt);
1133 fhPhiCharged ->Fill(phi);
1134 fhEtaCharged ->Fill(eta);
1135 fhEtaPhiCharged->Fill(eta,phi);
1136 if((!strcmp(GetReader()->GetInputEvent()->GetName(),"AliESDEvent"))) {
1137 AliESDEvent *esd = (AliESDEvent*) GetReader()->GetInputEvent();
1138 AliESDCaloCluster * esdcalo = (AliESDCaloCluster*) esd->GetCaloCluster(calo->GetID());
1139 Int_t trackIndex = esdcalo->GetTrackMatched();
1140 //printf("track index %d ntracks %d\n", trackIndex, esd->GetNumberOfTracks());
1141 if(trackIndex >= 0){
1142 AliESDtrack* track = (AliESDtrack*) esd->GetTrack(trackIndex);
1143 if (track && track->GetOuterParam() ) {
1145 Double_t tphi = track->GetOuterParam()->Phi();
1146 Double_t teta = track->GetOuterParam()->Eta();
1147 Double_t tmom = track->GetOuterParam()->P();
1149 Double_t deta = teta - eta;
1150 Double_t dphi = tphi - phi;
1151 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
1152 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
1153 Double_t dR = sqrt(dphi*dphi + deta*deta);
1155 Double_t pOverE = tmom/e;
1157 fh1pOverE->Fill(pOverE);
1158 if(dR < 0.02) fh1pOverER02->Fill(pOverE);
1161 fh2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1163 if(IsDataMC() && primary){
1164 Int_t pdg = primary->GetPdgCode();
1165 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1167 if(TMath::Abs(pdg) == 11){
1168 fhMCEle1pOverE->Fill(pOverE);
1169 fhMCEle1dR->Fill(dR);
1170 fhMCEle2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1171 if(dR < 0.02) fhMCEle1pOverER02->Fill(pOverE);
1174 fhMCChHad1pOverE->Fill(pOverE);
1175 fhMCChHad1dR->Fill(dR);
1176 fhMCChHad2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1177 if(dR < 0.02) fhMCChHad1pOverER02->Fill(pOverE);
1179 else if(charge == 0){
1180 fhMCNeutral1pOverE->Fill(pOverE);
1181 fhMCNeutral1dR->Fill(dR);
1182 fhMCNeutral2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
1183 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(pOverE);
1186 int nITS = track->GetNcls(0);
1187 int nTPC = track->GetNcls(1);
1188 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
1189 && calo->GetNCells() > 1 && nITS > 3 && nTPC > 20) {
1190 fh2EledEdx->Fill(track->P(),track->GetTPCsignal());
1193 else if(!track->GetOuterParam()){
1194 ULong_t status=AliESDtrack::kTPCrefit;
1195 status|=AliESDtrack::kITSrefit;
1196 //printf("track status %d\n", track->GetStatus() );
1197 fhEChargedNoOut ->Fill(e);
1198 fhPtChargedNoOut ->Fill(pt);
1199 fhPhiChargedNoOut ->Fill(phi);
1200 fhEtaChargedNoOut ->Fill(eta);
1201 fhEtaPhiChargedNoOut ->Fill(eta,phi);
1202 if(GetDebug() >= 0 && ((track->GetStatus() & status) == status)) printf("ITS+TPC\n");
1205 if(GetDebug() >= 0) printf("ERROR: Could not receive track %d\n", trackIndex);
1207 }// non negative track index
1208 }//do only if input are ESDs
1209 }// at least one track matched
1212 if (nclusters > 1 ) {
1213 for(Int_t jclus = iclus + 1 ; jclus < nclusters ; jclus++) {
1214 AliAODCaloCluster * calo2 = (AliAODCaloCluster*) (partList->At(jclus));
1215 //Get cluster kinematics
1216 calo2->GetMomentum(mom2,v);
1217 fhIM ->Fill((mom+mom2).E(),(mom+mom2).M());
1218 fhAsym->Fill((mom+mom2).E(),TMath::Abs((e-mom2.E())/(e+mom2.E())));
1219 }// 2nd cluster loop
1220 }////more than 1 cluster in calorimeter
1223 fhNCellsPerCluster->Fill(e,calo->GetNCells());
1225 }// 1st cluster loop
1228 AliAODCaloCells * cell = new AliAODCaloCells ;
1229 if(fCalorimeter == "PHOS")
1230 cell = (AliAODCaloCells *) GetPHOSCells();
1232 cell = (AliAODCaloCells *) GetEMCALCells();
1235 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No CELLS available for analysis");
1240 if(GetDebug() > 0 && cell )
1241 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), cell->GetNumberOfCells());
1243 Int_t ncells = cell->GetNumberOfCells() ;
1244 fhNCells->Fill(ncells) ;
1246 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1247 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1248 fhAmplitude->Fill(cell->GetAmplitude(iCell));
1253 //Play with the MC stack if available
1254 for(Int_t i=8 ; i<stack->GetNprimary(); i++){
1255 primary = stack->Particle(i) ;
1257 //if (!primary->IsPrimary()) continue;
1258 if (TMath::Abs(primary->Eta()) > 1) continue;
1260 Int_t kf = primary->GetPdgCode();
1261 //printf("kf %d\n",kf);
1264 primary->Momentum(mom);
1265 if(IsFidutialCutOn()) in = GetFidutialCut()->IsInFidutialCut(mom,fCalorimeter) ;
1268 fhGenGamPt ->Fill(primary->Pt());
1269 fhGenGamEta->Fill(primary->Eta());
1270 fhGenGamPhi->Fill(primary->Phi());
1272 fhGenGamAccE ->Fill(primary->Energy());
1273 fhGenGamAccPt ->Fill(primary->Pt());
1274 fhGenGamAccEta->Fill(primary->Eta());
1275 fhGenGamAccPhi->Fill(primary->Phi());
1279 fhGenPi0Pt ->Fill(primary->Pt());
1280 fhGenPi0Eta->Fill(primary->Eta());
1281 fhGenPi0Phi->Fill(primary->Phi());
1283 fhGenPi0AccE ->Fill(primary->Energy());
1284 fhGenPi0AccPt ->Fill(primary->Pt());
1285 fhGenPi0AccEta->Fill(primary->Eta());
1286 fhGenPi0AccPhi->Fill(primary->Phi());
1290 fhGenEtaPt ->Fill(primary->Pt());
1291 fhGenEtaEta->Fill(primary->Eta());
1292 fhGenEtaPhi->Fill(primary->Phi());
1295 fhGenOmegaPt ->Fill(primary->Pt());
1296 fhGenOmegaEta->Fill(primary->Eta());
1297 fhGenOmegaPhi->Fill(primary->Phi());
1299 else if (TMath::Abs(kf)==11) {
1300 fhGenElePt ->Fill(primary->Pt());
1301 fhGenEleEta->Fill(primary->Eta());
1302 fhGenElePhi->Fill(primary->Phi());
1308 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1313 //________________________________________________________________________
1314 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
1316 // Needed when Terminate is executed in distributed environment
1317 // Refill analysis histograms of this class with corresponding histograms in output list.
1319 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
1320 // the first one and then add the next
1321 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
1322 //printf("Calo: %s, index: %d\n",fCalorimeter.Data(),index);
1323 //Read histograms, must be in the same order as in GetCreateOutputObject.
1324 fhE = (TH1F *) outputList->At(index++);
1325 fhPt = (TH1F *) outputList->At(index++);
1326 fhPhi = (TH1F *) outputList->At(index++);
1327 fhEta = (TH1F *) outputList->At(index++);
1328 fhEtaPhi = (TH2F *) outputList->At(index++);
1330 fhECharged = (TH1F *) outputList->At(index++);
1331 fhPtCharged = (TH1F *) outputList->At(index++);
1332 fhPhiCharged = (TH1F *) outputList->At(index++);
1333 fhEtaCharged = (TH1F *) outputList->At(index++);
1334 fhEtaPhiCharged = (TH2F *) outputList->At(index++);
1336 fhEChargedNoOut = (TH1F *) outputList->At(index++);
1337 fhPtChargedNoOut = (TH1F *) outputList->At(index++);
1338 fhPhiChargedNoOut = (TH1F *) outputList->At(index++);
1339 fhEtaChargedNoOut = (TH1F *) outputList->At(index++);
1340 fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
1342 fhIM = (TH2F *) outputList->At(index++);
1343 fhAsym = (TH2F *) outputList->At(index++);
1345 fhNCellsPerCluster = (TH2F *) outputList->At(index++);
1346 fhNClusters = (TH1F *) outputList->At(index++);
1347 fhNCells = (TH1F *) outputList->At(index++);
1348 fhAmplitude = (TH1F *) outputList->At(index++);
1351 fhDeltaE = (TH1F *) outputList->At(index++);
1352 fhDeltaPt = (TH1F *) outputList->At(index++);
1353 fhDeltaPhi = (TH1F *) outputList->At(index++);
1354 fhDeltaEta = (TH1F *) outputList->At(index++);
1356 fhRatioE = (TH1F *) outputList->At(index++);
1357 fhRatioPt = (TH1F *) outputList->At(index++);
1358 fhRatioPhi = (TH1F *) outputList->At(index++);
1359 fhRatioEta = (TH1F *) outputList->At(index++);
1361 fh2E = (TH2F *) outputList->At(index++);
1362 fh2Pt = (TH2F *) outputList->At(index++);
1363 fh2Phi = (TH2F *) outputList->At(index++);
1364 fh2Eta = (TH2F *) outputList->At(index++);
1366 fhGamE = (TH2F *) outputList->At(index++);
1367 fhGamPt = (TH2F *) outputList->At(index++);
1368 fhGamPhi = (TH2F *) outputList->At(index++);
1369 fhGamEta = (TH2F *) outputList->At(index++);
1371 fhGamDeltaE = (TH1F *) outputList->At(index++);
1372 fhGamDeltaPt = (TH1F *) outputList->At(index++);
1373 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
1374 fhGamDeltaEta = (TH1F *) outputList->At(index++);
1376 fhGamRatioE = (TH1F *) outputList->At(index++);
1377 fhGamRatioPt = (TH1F *) outputList->At(index++);
1378 fhGamRatioPhi = (TH1F *) outputList->At(index++);
1379 fhGamRatioEta = (TH1F *) outputList->At(index++);
1381 fhPi0E = (TH2F *) outputList->At(index++);
1382 fhPi0Pt = (TH2F *) outputList->At(index++);
1383 fhPi0Phi = (TH2F *) outputList->At(index++);
1384 fhPi0Eta = (TH2F *) outputList->At(index++);
1386 fhEleE = (TH2F *) outputList->At(index++);
1387 fhElePt = (TH2F *) outputList->At(index++);
1388 fhElePhi = (TH2F *) outputList->At(index++);
1389 fhEleEta = (TH2F *) outputList->At(index++);
1391 fhNeHadE = (TH2F *) outputList->At(index++);
1392 fhNeHadPt = (TH2F *) outputList->At(index++);
1393 fhNeHadPhi = (TH2F *) outputList->At(index++);
1394 fhNeHadEta = (TH2F *) outputList->At(index++);
1396 fhChHadE = (TH2F *) outputList->At(index++);
1397 fhChHadPt = (TH2F *) outputList->At(index++);
1398 fhChHadPhi = (TH2F *) outputList->At(index++);
1399 fhChHadEta = (TH2F *) outputList->At(index++);
1401 fhGamECharged = (TH2F *) outputList->At(index++);
1402 fhGamPtCharged = (TH2F *) outputList->At(index++);
1403 fhGamPhiCharged = (TH2F *) outputList->At(index++);
1404 fhGamEtaCharged = (TH2F *) outputList->At(index++);
1406 fhPi0ECharged = (TH2F *) outputList->At(index++);
1407 fhPi0PtCharged = (TH2F *) outputList->At(index++);
1408 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
1409 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
1411 fhEleECharged = (TH2F *) outputList->At(index++);
1412 fhElePtCharged = (TH2F *) outputList->At(index++);
1413 fhElePhiCharged = (TH2F *) outputList->At(index++);
1414 fhEleEtaCharged = (TH2F *) outputList->At(index++);
1416 fhNeHadECharged = (TH2F *) outputList->At(index++);
1417 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
1418 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
1419 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
1421 fhChHadECharged = (TH2F *) outputList->At(index++);
1422 fhChHadPtCharged = (TH2F *) outputList->At(index++);
1423 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
1424 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
1426 // fhEMVxyz = (TH3F *) outputList->At(index++);
1427 // fhHaVxyz = (TH3F *) outputList->At(index++);
1429 fhEMVxyz = (TH2F *) outputList->At(index++);
1430 fhHaVxyz = (TH2F *) outputList->At(index++);
1431 fhEMR = (TH2F *) outputList->At(index++);
1432 fhHaR = (TH2F *) outputList->At(index++);
1434 fhGenGamPt = (TH1F *) outputList->At(index++);
1435 fhGenGamEta = (TH1F *) outputList->At(index++);
1436 fhGenGamPhi = (TH1F *) outputList->At(index++);
1438 fhGenPi0Pt = (TH1F *) outputList->At(index++);
1439 fhGenPi0Eta = (TH1F *) outputList->At(index++);
1440 fhGenPi0Phi = (TH1F *) outputList->At(index++);
1442 fhGenEtaPt = (TH1F *) outputList->At(index++);
1443 fhGenEtaEta = (TH1F *) outputList->At(index++);
1444 fhGenEtaPhi = (TH1F *) outputList->At(index++);
1446 fhGenOmegaPt = (TH1F *) outputList->At(index++);
1447 fhGenOmegaEta = (TH1F *) outputList->At(index++);
1448 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
1450 fhGenElePt = (TH1F *) outputList->At(index++);
1451 fhGenEleEta = (TH1F *) outputList->At(index++);
1452 fhGenElePhi = (TH1F *) outputList->At(index++);
1454 fhGenGamAccE = (TH1F *) outputList->At(index++);
1455 fhGenGamAccPt = (TH1F *) outputList->At(index++);
1456 fhGenGamAccEta = (TH1F *) outputList->At(index++);
1457 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
1459 fhGenPi0AccE = (TH1F *) outputList->At(index++);
1460 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
1461 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
1462 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
1466 fh1pOverE = (TH1F *) outputList->At(index++);
1467 fh1dR = (TH1F *) outputList->At(index++);
1468 fh2MatchdEdx = (TH2F *) outputList->At(index++);
1469 fh2EledEdx = (TH2F *) outputList->At(index++);
1472 fhMCEle1pOverE = (TH1F *) outputList->At(index++);
1473 fhMCEle1dR = (TH1F *) outputList->At(index++);
1474 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
1476 fhMCChHad1pOverE = (TH1F *) outputList->At(index++);
1477 fhMCChHad1dR = (TH1F *) outputList->At(index++);
1478 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
1480 fhMCNeutral1pOverE = (TH1F *) outputList->At(index++);
1481 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
1482 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
1484 fh1pOverER02 = (TH1F *) outputList->At(index++);
1485 fhMCEle1pOverER02 = (TH1F *) outputList->At(index++);
1486 fhMCChHad1pOverER02 = (TH1F *) outputList->At(index++);
1487 fhMCNeutral1pOverER02 = (TH1F *) outputList->At(index++);
1489 //for(Int_t i = 0; i<index ; i++) cout<<outputList->At(i)->GetName()<<endl;
1492 //__________________________________________________________________
1493 void AliAnaCalorimeterQA::Terminate(TList* outputList)
1495 //Do plots if requested
1496 if(!fMakePlots) return;
1498 //Do some plots to end
1499 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
1500 //Recover histograms from output histograms list, needed for distributed analysis.
1501 ReadHistograms(outputList);
1503 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
1504 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
1511 sprintf(cname,"QA_%s_nclustercellsamp",fCalorimeter.Data());
1512 TCanvas * c9 = new TCanvas(cname, " CaloClusters and CaloCells", 400, 400) ;
1516 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
1518 fhNClusters->SetLineColor(4);
1519 fhNClusters->Draw();
1522 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
1524 fhNCells->SetLineColor(4);
1528 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
1530 fhNCellsPerCluster->SetLineColor(4);
1531 fhNCellsPerCluster->Draw();
1534 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
1536 fhAmplitude->SetLineColor(4);
1537 fhAmplitude->Draw();
1539 sprintf(name,"QA_%s_CaloClustersAndCaloCells.eps",fCalorimeter.Data());
1540 c9->Print(name); printf("Plot: %s\n",name);
1543 //Reconstructed distributions
1545 sprintf(cname,"QA_%s_rec",fCalorimeter.Data());
1546 TCanvas * c = new TCanvas(cname, "Reconstructed distributions", 400, 400) ;
1550 if(fhE->GetEntries() > 0) gPad->SetLogy();
1551 fhE->SetLineColor(4);
1555 if(fhPt->GetEntries() > 0) gPad->SetLogy();
1556 fhPt->SetLineColor(4);
1560 fhPhi->SetLineColor(4);
1564 fhEta->SetLineColor(4);
1567 sprintf(name,"QA_%s_ReconstructedDistributions.eps",fCalorimeter.Data());
1568 c->Print(name); printf("Plot: %s\n",name);
1570 //Reconstructed distributions, matched with tracks
1572 sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
1573 TCanvas * c2 = new TCanvas(cname, "Reconstructed distributions, matched with tracks", 400, 400) ;
1577 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
1578 fhECharged->SetLineColor(4);
1582 if(fhPtCharged->GetEntries() > 0) gPad->SetLogy();
1583 fhPtCharged->SetLineColor(4);
1584 fhPtCharged->Draw();
1587 fhPhiCharged->SetLineColor(4);
1588 fhPhiCharged->Draw();
1591 fhEtaCharged->SetLineColor(4);
1592 fhEtaCharged->Draw();
1594 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched.eps",fCalorimeter.Data());
1595 c2->Print(name); printf("Plot: %s\n",name);
1597 TH1F * hEChargedClone = (TH1F*) fhECharged->Clone("EChargedClone");
1598 TH1F * hPtChargedClone = (TH1F*) fhPtCharged->Clone("PtChargedClone");
1599 TH1F * hEtaChargedClone = (TH1F*) fhEtaCharged->Clone("EtaChargedClone");
1600 TH1F * hPhiChargedClone = (TH1F*) fhPhiCharged->Clone("PhiChargedClone");
1602 TH1F * hEChargedClone2 = (TH1F*) fhECharged->Clone("EChargedClone2");
1603 TH1F * hPtChargedClone2 = (TH1F*) fhPtCharged->Clone("PtChargedClone2");
1604 TH1F * hEtaChargedClone2 = (TH1F*) fhEtaCharged->Clone("EtaChargedClone2");
1605 TH1F * hPhiChargedClone2 = (TH1F*) fhPhiCharged->Clone("PhiChargedClone2");
1607 //Ratio: reconstructed track matched/ all reconstructed
1609 sprintf(cname,"QA_%s_rectrackmatchrat",fCalorimeter.Data());
1610 TCanvas * c3 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
1614 if(hEChargedClone->GetEntries() > 0) gPad->SetLogy();
1615 hEChargedClone->SetTitleOffset(1.6,"Y");
1616 hEChargedClone->SetYTitle("track matched / all ");
1617 hEChargedClone->SetXTitle("E (GeV)");
1618 hEChargedClone->Divide(fhE);
1619 hEChargedClone->Draw();
1622 if(hPtChargedClone->GetEntries() > 0) gPad->SetLogy();
1623 hPtChargedClone->SetTitleOffset(1.6,"Y");
1624 hPtChargedClone->SetYTitle("track matched / all ");
1625 hPtChargedClone->SetXTitle("p_{T} (GeV/c)");
1626 hPtChargedClone->Divide(fhPt);
1627 hPtChargedClone->Draw();
1630 if(hPhiChargedClone->GetEntries() > 0) gPad->SetLogy();
1631 hPhiChargedClone->SetTitleOffset(1.6,"Y");
1632 hPhiChargedClone->SetYTitle("track matched / all ");
1633 hPhiChargedClone->SetXTitle("#phi (rad)");
1634 hPhiChargedClone->Divide(fhPhi);
1635 hPhiChargedClone->Draw();
1638 if(hEtaChargedClone->GetEntries() > 0) gPad->SetLogy();
1639 hEtaChargedClone->SetTitleOffset(1.6,"Y");
1640 hEtaChargedClone->SetYTitle("track matched / all ");
1641 hEtaChargedClone->SetXTitle("#eta");
1642 hEtaChargedClone->Divide(fhEta);
1643 hEtaChargedClone->Draw();
1645 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributions.eps",fCalorimeter.Data());
1646 c3->Print(name); printf("Plot: %s\n",name);
1648 //Ratio: reconstructed track matched (minus no track param) / all
1650 sprintf(cname,"QA_%s_rectrackmatchratout",fCalorimeter.Data());
1651 TCanvas * c333 = new TCanvas(cname, "Ratio: reconstructed track matched (with outer track param)/ all", 400, 400) ;
1655 hEChargedClone2->Add(fhEChargedNoOut,-1);
1656 hEChargedClone2->SetYTitle("track matched / all");
1657 hEChargedClone2->SetXTitle("E (GeV)");
1658 hEChargedClone2->Divide(fhE);
1659 hEChargedClone2->Draw();
1662 hPtChargedClone2->Add(fhPtChargedNoOut,-1);
1663 hPtChargedClone2->SetYTitle("track matched / all");
1664 hPtChargedClone2->SetXTitle("p_{T} (GeV/c)");
1665 hPtChargedClone2->Divide(fhPt);
1666 hPtChargedClone2->Draw();
1669 hPhiChargedClone2->Add(fhPhiChargedNoOut,-1);
1670 hPhiChargedClone2->SetYTitle("track matched / all");
1671 hPhiChargedClone2->SetXTitle("#phi (rad)");
1672 hPhiChargedClone2->Divide(fhPhi);
1673 hPhiChargedClone2->Draw();
1676 hEtaChargedClone2->Add(fhEtaChargedNoOut,-1);
1677 hEtaChargedClone2->SetYTitle("track matched / all");
1678 hEtaChargedClone2->SetXTitle("#eta");
1679 hEtaChargedClone2->Divide(fhEta);
1680 hEtaChargedClone2->Draw();
1682 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsOuter.eps",fCalorimeter.Data());
1683 c333->Print(name); printf("Plot: %s\n",name);
1685 //Reconstructed distributions, matched with tracks but no outer param
1687 sprintf(cname,"QA_%s_rectrackmatch_noout",fCalorimeter.Data());
1688 TCanvas * c22 = new TCanvas(cname, "Reconstructed distributions, matched with tracks, no outer track param", 400, 400) ;
1692 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
1693 fhEChargedNoOut->SetLineColor(4);
1694 fhEChargedNoOut->Draw();
1697 if(fhEChargedNoOut->GetEntries() > 0) gPad->SetLogy();
1698 fhPtChargedNoOut->SetLineColor(4);
1699 fhPtChargedNoOut->Draw();
1702 fhPhiChargedNoOut->SetLineColor(4);
1703 fhPhiChargedNoOut->Draw();
1706 fhEtaChargedNoOut->SetLineColor(4);
1707 fhEtaChargedNoOut->Draw();
1709 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched_NoOutParam.eps",fCalorimeter.Data());
1710 c22->Print(name); printf("Plot: %s\n",name);
1712 //Ratio: reconstructed track matched/ all reconstructed
1715 // TH1F * hEChargedNoOutClone = (TH1F*) fhEChargedNoOut->Clone("EChargedNoOutClone");
1716 // TH1F * hPtChargedNoOutClone = (TH1F*) fhPtChargedNoOut->Clone("PtChargedNoOutClone");
1717 // TH1F * hEtaChargedNoOutClone = (TH1F*) fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
1718 // TH1F * hPhiChargedNoOutClone = (TH1F*) fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");
1720 // sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
1721 // TCanvas * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
1722 // c33->Divide(2, 2);
1725 // hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1726 // hEChargedNoOutClone->SetXTitle("E (GeV)");
1727 // hEChargedNoOutClone->Divide(fhECharged);
1728 // hEChargedNoOutClone->Draw();
1731 // hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
1732 // hPtChargedNoOutClone->SetXTitle("p_{T} (GeV/c)");
1733 // hPtChargedNoOutClone->Divide(fhPtCharged);
1734 // hPtChargedNoOutClone->Draw();
1737 // hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1738 // hPhiChargedNoOutClone->SetXTitle("#phi (rad)");
1739 // hPhiChargedNoOutClone->Divide(fhPhiCharged);
1740 // hPhiChargedNoOutClone->Draw();
1743 // hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
1744 // hEtaChargedNoOutClone->SetXTitle("#eta");
1745 // hEtaChargedNoOutClone->Divide(fhEtaCharged);
1746 // hEtaChargedNoOutClone->Draw();
1748 // sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
1749 // c33->Print(name); printf("Plot: %s\n",name);
1754 sprintf(cname,"QA_%s_etavsphi",fCalorimeter.Data());
1755 // TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 600, 200) ;
1756 // c4->Divide(3, 1);
1758 TCanvas * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 400, 200) ;
1762 fhEtaPhi->Draw("cont");
1765 fhEtaPhiCharged->Draw("cont");
1768 // fhEtaPhiChargedNoOut->Draw("cont");
1770 sprintf(name,"QA_%s_ReconstructedEtaVsPhi.eps",fCalorimeter.Data());
1771 c4->Print(name); printf("Plot: %s\n",name);
1777 if(fhIM->GetEntries() > 1){
1778 Int_t nebins = fhIM->GetNbinsX();
1779 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
1780 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
1781 if (emin != 0 ) printf("emin != 0 \n");
1782 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
1784 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
1786 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 400, 400) ;
1790 fhIM->SetLineColor(4);
1795 binmax = (Int_t) (5-emin)*nebins/emax;
1796 TH1D *pyim5 = fhIM->ProjectionY("pyim5",binmin,binmax);
1797 pyim5->SetTitle("E_{pair} < 5 GeV");
1798 pyim5->SetLineColor(4);
1802 binmin = (Int_t) (5-emin)*nebins/emax;
1803 binmax = (Int_t) (10-emin)*nebins/emax;
1804 TH1D *pyim510 = fhIM->ProjectionY("pyim5_10",binmin,binmax);
1805 pyim510->SetTitle("5 < E_{pair} < 10 GeV");
1806 pyim510->SetLineColor(4);
1810 binmin = (Int_t) (10-emin)*nebins/emax;
1812 TH1D *pyim10 = fhIM->ProjectionY("pyim10",binmin,binmax);
1813 pyim10->SetTitle("E_{pair} > 10 GeV");
1814 pyim10->SetLineColor(4);
1817 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
1818 c5->Print(name); printf("Plot: %s\n",name);
1822 if(fhAsym->GetEntries() > 1){
1823 Int_t nebins = fhAsym->GetNbinsX();
1824 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
1825 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
1826 if (emin != 0 ) printf("emin != 0 \n");
1827 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
1829 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
1831 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
1835 fhAsym->SetTitleOffset(1.6,"Y");
1836 fhAsym->SetLineColor(4);
1841 binmax = (Int_t) (5-emin)*nebins/emax;
1842 TH1D *pyAsym5 = fhAsym->ProjectionY("pyAsym5",binmin,binmax);
1843 pyAsym5->SetTitle("E_{pair} < 5 GeV");
1844 pyAsym5->SetLineColor(4);
1848 binmin = (Int_t) (5-emin)*nebins/emax;
1849 binmax = (Int_t) (10-emin)*nebins/emax;
1850 TH1D *pyAsym510 = fhAsym->ProjectionY("pyAsym5_10",binmin,binmax);
1851 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
1852 pyAsym510->SetLineColor(4);
1856 binmin = (Int_t) (10-emin)*nebins/emax;
1858 TH1D *pyAsym10 = fhAsym->ProjectionY("pyAsym10",binmin,binmax);
1859 pyAsym10->SetTitle("E_{pair} > 10 GeV");
1860 pyAsym10->SetLineColor(4);
1863 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
1864 c5b->Print(name); printf("Plot: %s\n",name);
1868 //Reconstructed vs MC distributions
1870 sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
1871 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
1875 fh2E->SetTitleOffset(1.6,"Y");
1876 fh2E->SetLineColor(4);
1880 fh2Pt->SetTitleOffset(1.6,"Y");
1881 fh2Pt->SetLineColor(4);
1885 fh2Phi->SetTitleOffset(1.6,"Y");
1886 fh2Phi->SetLineColor(4);
1890 fh2Eta->SetTitleOffset(1.6,"Y");
1891 fh2Eta->SetLineColor(4);
1894 sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
1895 c6->Print(name); printf("Plot: %s\n",name);
1897 //Reconstructed vs MC distributions
1899 sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
1900 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
1901 c6Gam->Divide(2, 2);
1915 sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
1916 c6->Print(name); printf("Plot: %s\n",name);
1918 //Generated - reconstructed
1920 sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
1921 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
1925 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
1926 fhGamDeltaE->SetLineColor(4);
1928 fhGamDeltaE->Draw("same");
1930 TLegend pLegendd(0.65,0.55,0.9,0.8);
1931 pLegendd.SetTextSize(0.06);
1932 pLegendd.AddEntry(fhDeltaE,"all","L");
1933 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
1934 pLegendd.SetFillColor(10);
1935 pLegendd.SetBorderSize(1);
1939 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
1940 fhGamDeltaPt->SetLineColor(4);
1942 fhGamDeltaPt->Draw("same");
1945 fhGamDeltaPhi->SetLineColor(4);
1947 fhGamDeltaPhi->Draw("same");
1950 fhGamDeltaEta->SetLineColor(4);
1952 fhGamDeltaEta->Draw("same");
1954 sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
1955 c7->Print(name); printf("Plot: %s\n",name);
1957 // Reconstructed / Generated
1959 sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
1960 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
1964 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
1965 fhGamRatioE->SetLineColor(4);
1967 fhGamRatioE->Draw("same");
1969 TLegend pLegendr(0.65,0.55,0.9,0.8);
1970 pLegendr.SetTextSize(0.06);
1971 pLegendr.AddEntry(fhRatioE,"all","L");
1972 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
1973 pLegendr.SetFillColor(10);
1974 pLegendr.SetBorderSize(1);
1978 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
1979 fhGamRatioPt->SetLineColor(4);
1981 fhGamRatioPt->Draw("same");
1984 fhGamRatioPhi->SetLineColor(4);
1986 fhGamRatioPhi->Draw("same");
1989 fhGamRatioEta->SetLineColor(4);
1991 fhGamRatioEta->Draw("same");
1993 sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
1994 c8->Print(name); printf("Plot: %s\n",name);
1998 //Generated distributions
2000 sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
2001 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
2006 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone("axispt");
2007 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
2008 fhGenPi0Pt->SetLineColor(1);
2009 fhGenGamPt->SetLineColor(4);
2010 fhGenEtaPt->SetLineColor(2);
2011 fhGenOmegaPt->SetLineColor(7);
2012 fhGenElePt->SetLineColor(6);
2014 //Select the maximum of the histogram to show all lines.
2015 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
2016 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
2017 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
2018 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
2019 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
2020 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
2021 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
2022 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
2023 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
2024 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
2025 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
2026 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
2027 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
2028 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
2029 haxispt->SetMaximum(fhGenElePt->GetMaximum());
2030 haxispt->SetMinimum(1);
2031 haxispt->Draw("axis");
2032 fhGenPi0Pt->Draw("same");
2033 fhGenGamPt->Draw("same");
2034 fhGenEtaPt->Draw("same");
2035 fhGenOmegaPt->Draw("same");
2036 fhGenElePt->Draw("same");
2038 TLegend pLegend(0.85,0.65,0.95,0.93);
2039 pLegend.SetTextSize(0.06);
2040 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
2041 pLegend.AddEntry(fhGenGamPt," #gamma","L");
2042 pLegend.AddEntry(fhGenEtaPt," #eta","L");
2043 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
2044 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
2045 pLegend.SetFillColor(10);
2046 pLegend.SetBorderSize(1);
2051 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone("axiseta");
2052 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
2053 fhGenPi0Eta->SetLineColor(1);
2054 fhGenGamEta->SetLineColor(4);
2055 fhGenEtaEta->SetLineColor(2);
2056 fhGenOmegaEta->SetLineColor(7);
2057 fhGenEleEta->SetLineColor(6);
2058 //Select the maximum of the histogram to show all lines.
2059 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
2060 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
2061 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
2062 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
2063 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
2064 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
2065 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
2066 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
2067 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
2068 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
2069 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
2070 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
2071 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
2072 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
2073 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
2074 haxiseta->SetMinimum(100);
2075 haxiseta->Draw("axis");
2076 fhGenPi0Eta->Draw("same");
2077 fhGenGamEta->Draw("same");
2078 fhGenEtaEta->Draw("same");
2079 fhGenOmegaEta->Draw("same");
2080 fhGenEleEta->Draw("same");
2085 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone("axisphi");
2086 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
2087 fhGenPi0Phi->SetLineColor(1);
2088 fhGenGamPhi->SetLineColor(4);
2089 fhGenEtaPhi->SetLineColor(2);
2090 fhGenOmegaPhi->SetLineColor(7);
2091 fhGenElePhi->SetLineColor(6);
2092 //Select the maximum of the histogram to show all lines.
2093 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
2094 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
2095 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
2096 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
2097 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
2098 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
2099 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
2100 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
2101 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
2102 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
2103 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
2104 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
2105 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
2106 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
2107 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
2108 haxisphi->SetMinimum(100);
2109 haxisphi->Draw("axis");
2110 fhGenPi0Phi->Draw("same");
2111 fhGenGamPhi->Draw("same");
2112 fhGenEtaPhi->Draw("same");
2113 fhGenOmegaPhi->Draw("same");
2114 fhGenElePhi->Draw("same");
2116 sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
2117 c10->Print(name); printf("Plot: %s\n",name);
2120 //Reconstructed clusters depending on its original particle.
2122 sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
2123 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
2129 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX("hGamE",-1,-1);
2130 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX("hPi0E",-1,-1);
2131 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX("hEleE",-1,-1);
2132 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX("hNeHadE",-1,-1);
2133 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX("hChHadE",-1,-1);
2134 TH1F * haxisE = (TH1F*) hPi0E->Clone("axisE");
2135 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
2136 hPi0E->SetLineColor(1);
2137 hGamE->SetLineColor(4);
2138 hNeHadE->SetLineColor(2);
2139 hChHadE->SetLineColor(7);
2140 hEleE->SetLineColor(6);
2142 //Select the maximum of the histogram to show all lines.
2143 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
2144 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
2145 haxisE->SetMaximum(hPi0E->GetMaximum());
2146 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
2147 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
2148 haxisE->SetMaximum(hGamE->GetMaximum());
2149 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
2150 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
2151 haxisE->SetMaximum(hNeHadE->GetMaximum());
2152 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
2153 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
2154 haxisE->SetMaximum(hChHadE->GetMaximum());
2155 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
2156 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
2157 haxisE->SetMaximum(hEleE->GetMaximum());
2158 haxisE->SetXTitle("E (GeV)");
2159 haxisE->SetMinimum(1);
2160 haxisE->Draw("axis");
2161 hPi0E->Draw("same");
2162 hGamE->Draw("same");
2163 hNeHadE->Draw("same");
2164 hChHadE->Draw("same");
2165 hEleE->Draw("same");
2167 TLegend pLegend2(0.8,0.65,0.95,0.93);
2168 pLegend2.SetTextSize(0.06);
2169 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
2170 pLegend2.AddEntry(hGamE," #gamma","L");
2171 pLegend2.AddEntry(hEleE," e^{#pm}","L");
2172 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
2173 pLegend2.AddEntry(hNeHadE," h^{0}","L");
2174 pLegend2.SetFillColor(10);
2175 pLegend2.SetBorderSize(1);
2181 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
2182 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX("hGamPt",-1,-1);
2183 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX("hPi0Pt",-1,-1);
2184 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX("hElePt",-1,-1);
2185 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX("hNeHadPt",-1,-1);
2186 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX("hChHadPt",-1,-1);
2187 haxispt = (TH1F*) hPi0Pt->Clone("axispt");
2188 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
2189 hPi0Pt->SetLineColor(1);
2190 hGamPt->SetLineColor(4);
2191 hNeHadPt->SetLineColor(2);
2192 hChHadPt->SetLineColor(7);
2193 hElePt->SetLineColor(6);
2195 //Select the maximum of the histogram to show all lines.
2196 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
2197 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
2198 haxispt->SetMaximum(hPi0Pt->GetMaximum());
2199 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
2200 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
2201 haxispt->SetMaximum(hGamPt->GetMaximum());
2202 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
2203 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
2204 haxispt->SetMaximum(hNeHadPt->GetMaximum());
2205 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
2206 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
2207 haxispt->SetMaximum(hChHadPt->GetMaximum());
2208 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
2209 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
2210 haxispt->SetMaximum(hElePt->GetMaximum());
2211 haxispt->SetXTitle("p_{T} (GeV/c)");
2212 haxispt->SetMinimum(1);
2213 haxispt->Draw("axis");
2214 hPi0Pt->Draw("same");
2215 hGamPt->Draw("same");
2216 hNeHadPt->Draw("same");
2217 hChHadPt->Draw("same");
2218 hElePt->Draw("same");
2224 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX("hGamEta",-1,-1);
2225 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX("hPi0Eta",-1,-1);
2226 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX("hEleEta",-1,-1);
2227 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX("hNeHadEta",-1,-1);
2228 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX("hChHadEta",-1,-1);
2229 haxiseta = (TH1F*) hPi0Eta->Clone("axiseta");
2230 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
2231 hPi0Eta->SetLineColor(1);
2232 hGamEta->SetLineColor(4);
2233 hNeHadEta->SetLineColor(2);
2234 hChHadEta->SetLineColor(7);
2235 hEleEta->SetLineColor(6);
2236 //Select the maximum of the histogram to show all lines.
2237 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
2238 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
2239 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
2240 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
2241 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
2242 haxiseta->SetMaximum(hGamEta->GetMaximum());
2243 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
2244 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
2245 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
2246 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
2247 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
2248 haxiseta->SetMaximum(hChHadEta->GetMaximum());
2249 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
2250 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
2251 haxiseta->SetMaximum(hEleEta->GetMaximum());
2253 haxiseta->SetXTitle("#eta");
2254 haxiseta->Draw("axis");
2255 hPi0Eta->Draw("same");
2256 hGamEta->Draw("same");
2257 hNeHadEta->Draw("same");
2258 hChHadEta->Draw("same");
2259 hEleEta->Draw("same");
2264 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX("hGamPhi",-1,-1);
2265 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX("hPi0Phi",-1,-1);
2266 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX("hElePhi",-1,-1);
2267 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX("hNeHadPhi",-1,-1);
2268 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX("hChHadPhi",-1,-1);
2269 haxisphi = (TH1F*) hPi0Phi->Clone("axisphi");
2270 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
2272 hPi0Phi->SetLineColor(1);
2273 hGamPhi->SetLineColor(4);
2274 hNeHadPhi->SetLineColor(2);
2275 hChHadPhi->SetLineColor(7);
2276 hElePhi->SetLineColor(6);
2277 //Select the maximum of the histogram to show all lines.
2278 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
2279 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
2280 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
2281 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
2282 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
2283 haxisphi->SetMaximum(hGamPhi->GetMaximum());
2284 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
2285 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
2286 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
2287 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
2288 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
2289 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
2290 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
2291 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
2292 haxisphi->SetMaximum(hElePhi->GetMaximum());
2293 haxisphi->SetXTitle("#phi (rad)");
2294 haxisphi->Draw("axis");
2295 hPi0Phi->Draw("same");
2296 hGamPhi->Draw("same");
2297 hNeHadPhi->Draw("same");
2298 hChHadPhi->Draw("same");
2299 hElePhi->Draw("same");
2301 sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
2302 c11->Print(name); printf("Plot: %s\n",name);
2305 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
2308 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone("hPi0EClone");
2309 TH1F * hGamEClone = (TH1F*) hGamE ->Clone("hGamEClone");
2310 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone("hPi0PtClone");
2311 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone("hGamPtClone");
2312 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone("hPi0EtaClone");
2313 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone("hGamEtaClone");
2314 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone("hPi0PhiClone");
2315 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone("hGamPhiClone");
2317 sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
2318 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
2323 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
2324 hPi0EClone->Divide(fhGenPi0AccE);
2325 hGamEClone->Divide(fhGenGamAccE);
2326 haxisE->SetMaximum(5);
2327 haxisE->SetMinimum(1e-2);
2328 haxisE->SetXTitle("E (GeV)");
2329 haxisE->SetYTitle("ratio = rec/gen");
2330 haxisE->Draw("axis");
2331 hPi0E->Draw("same");
2332 hGamE->Draw("same");
2334 TLegend pLegend3(0.75,0.2,0.9,0.4);
2335 pLegend3.SetTextSize(0.06);
2336 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
2337 pLegend3.AddEntry(hGamEClone," #gamma","L");
2338 pLegend3.SetFillColor(10);
2339 pLegend3.SetBorderSize(1);
2344 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
2345 hPi0PtClone->Divide(fhGenPi0AccPt);
2346 hGamPtClone->Divide(fhGenGamAccPt);
2347 haxispt->SetMaximum(5);
2348 haxispt->SetMinimum(1e-2);
2349 haxispt->SetXTitle("p_{T} (GeV/c)");
2350 haxispt->SetYTitle("ratio = rec/gen");
2351 haxispt->Draw("axis");
2352 hPi0PtClone->Draw("same");
2353 hGamPtClone->Draw("same");
2358 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
2359 hPi0EtaClone->Divide(fhGenPi0AccEta);
2360 hGamEtaClone->Divide(fhGenGamAccEta);
2361 haxiseta->SetMaximum(1.2);
2362 haxiseta->SetMinimum(1e-2);
2363 haxiseta->SetYTitle("ratio = rec/gen");
2364 haxiseta->SetXTitle("#eta");
2365 haxiseta->Draw("axis");
2366 hPi0EtaClone->Draw("same");
2367 hGamEtaClone->Draw("same");
2372 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
2373 hPi0PhiClone->Divide(fhGenPi0AccPhi);
2374 hGamPhiClone->Divide(fhGenGamAccPhi);
2375 haxisphi->SetYTitle("ratio = rec/gen");
2376 haxisphi->SetXTitle("#phi (rad)");
2377 haxisphi->SetMaximum(1.2);
2378 haxisphi->SetMinimum(1e-2);
2379 haxisphi->Draw("axis");
2380 hPi0PhiClone->Draw("same");
2381 hGamPhiClone->Draw("same");
2383 sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
2384 c12->Print(name); printf("Plot: %s\n",name);
2388 //Reconstructed distributions
2390 sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
2391 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
2396 fhEMVxyz->SetTitleOffset(1.6,"Y");
2401 fhHaVxyz->SetTitleOffset(1.6,"Y");
2406 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY("hEM",-1,-1);
2407 hEMR->SetLineColor(4);
2412 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY("hHa",-1,-1);
2413 hHaR->SetLineColor(4);
2417 sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
2418 c13->Print(name); printf("Plot: %s\n",name);
2421 //Track-matching distributions
2423 //Reconstructed distributions, matched with tracks, generated particle dependence
2425 sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
2426 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
2427 c22ch->Divide(2, 2);
2431 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX("hGamECharged",-1,-1);
2432 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX("hPi0ECharged",-1,-1);
2433 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX("hEleECharged",-1,-1);
2434 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX("hNeHadECharged",-1,-1);
2435 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX("hChHadECharged",-1,-1);
2436 hPi0ECharged->SetLineColor(1);
2437 hGamECharged->SetLineColor(4);
2438 hNeHadECharged->SetLineColor(2);
2439 hChHadECharged->SetLineColor(7);
2440 hEleECharged->SetLineColor(6);
2442 fhECharged->SetLineColor(3);
2443 fhECharged->SetMinimum(0.5);
2445 hPi0ECharged->Draw("same");
2446 hGamECharged->Draw("same");
2447 hNeHadECharged->Draw("same");
2448 hChHadECharged->Draw("same");
2449 hEleECharged->Draw("same");
2450 TLegend pLegend22(0.75,0.45,0.9,0.8);
2451 pLegend22.SetTextSize(0.06);
2452 pLegend22.AddEntry(fhECharged,"all","L");
2453 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
2454 pLegend22.AddEntry(hGamECharged,"#gamma","L");
2455 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
2456 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
2457 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
2458 pLegend22.SetFillColor(10);
2459 pLegend22.SetBorderSize(1);
2464 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX("hGamPtCharged",-1,-1);
2465 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX("hPi0PtCharged",-1,-1);
2466 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX("hElePtCharged",-1,-1);
2467 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX("hNeHadPtCharged",-1,-1);
2468 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX("hChHadPtCharged",-1,-1);
2469 hPi0PtCharged->SetLineColor(1);
2470 hGamPtCharged->SetLineColor(4);
2471 hNeHadPtCharged->SetLineColor(2);
2472 hChHadPtCharged->SetLineColor(7);
2473 hElePtCharged->SetLineColor(6);
2475 fhPtCharged->SetLineColor(3);
2476 fhPtCharged->SetMinimum(0.5);
2477 fhPtCharged->Draw();
2478 hPi0PtCharged->Draw("same");
2479 hGamPtCharged->Draw("same");
2480 hNeHadPtCharged->Draw("same");
2481 hChHadPtCharged->Draw("same");
2482 hElePtCharged->Draw("same");
2486 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX("hGamEtaCharged",-1,-1);
2487 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX("hPi0EtaCharged",-1,-1);
2488 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX("hEleEtaCharged",-1,-1);
2489 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX("hNeHadEtaCharged",-1,-1);
2490 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX("hChHadEtaCharged",-1,-1);
2491 hPi0EtaCharged->SetLineColor(1);
2492 hGamEtaCharged->SetLineColor(4);
2493 hNeHadEtaCharged->SetLineColor(2);
2494 hChHadEtaCharged->SetLineColor(7);
2495 hEleEtaCharged->SetLineColor(6);
2497 fhEtaCharged->SetLineColor(3);
2498 fhEtaCharged->SetMinimum(0.5);
2499 fhEtaCharged->Draw();
2500 hPi0EtaCharged->Draw("same");
2501 hGamEtaCharged->Draw("same");
2502 hNeHadEtaCharged->Draw("same");
2503 hChHadEtaCharged->Draw("same");
2504 hEleEtaCharged->Draw("same");
2508 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX("hGamPhiCharged",-1,-1);
2509 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX("hPi0PhiCharged",-1,-1);
2510 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX("hElePhiCharged",-1,-1);
2511 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX("hNeHadPhiCharged",-1,-1);
2512 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX("hChHadPhiCharged",-1,-1);
2513 hPi0PhiCharged->SetLineColor(1);
2514 hGamPhiCharged->SetLineColor(4);
2515 hNeHadPhiCharged->SetLineColor(2);
2516 hChHadPhiCharged->SetLineColor(7);
2517 hElePhiCharged->SetLineColor(6);
2519 fhPhiCharged->SetLineColor(3);
2520 fhPhiCharged->SetMinimum(0.5);
2521 fhPhiCharged->Draw();
2522 hPi0PhiCharged->Draw("same");
2523 hGamPhiCharged->Draw("same");
2524 hNeHadPhiCharged->Draw("same");
2525 hChHadPhiCharged->Draw("same");
2526 hElePhiCharged->Draw("same");
2529 sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
2530 c22ch->Print(name); printf("Plot: %s\n",name);
2532 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone("GamEChargedClone");
2533 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone("GamPtChargedClone");
2534 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone("GamEtaChargedClone");
2535 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone("GamPhiChargedClone");
2537 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone("Pi0EChargedClone");
2538 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone("Pi0PtChargedClone");
2539 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone("Pi0EtaChargedClone");
2540 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone("Pi0PhiChargedClone");
2542 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone("EleEChargedClone");
2543 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone("ElePtChargedClone");
2544 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone("EleEtaChargedClone");
2545 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone("ElePhiChargedClone");
2547 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone("NeHadEChargedClone");
2548 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone("NeHadPtChargedClone");
2549 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone("NeHadEtaChargedClone");
2550 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone("NeHadPhiChargedClone");
2552 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone("ChHadEChargedClone");
2553 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone("ChHadPtChargedClone");
2554 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone("ChHadEtaChargedClone");
2555 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone("ChHadPhiChargedClone");
2557 //Ratio: reconstructed track matched/ all reconstructed
2559 sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
2560 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
2564 hEChargedClone->SetMaximum(1.2);
2565 hEChargedClone->SetMinimum(0.001);
2566 hEChargedClone->SetLineColor(3);
2567 hEChargedClone->SetYTitle("track matched / all");
2568 hPi0EChargedClone->Divide(hPi0E);
2569 hGamEChargedClone->Divide(hGamE);
2570 hEleEChargedClone->Divide(hEleE);
2571 hNeHadEChargedClone->Divide(hNeHadE);
2572 hChHadEChargedClone->Divide(hChHadE);
2573 hEChargedClone->Draw();
2574 hPi0EChargedClone->Draw("same");
2575 hGamEChargedClone->Draw("same");
2576 hEleEChargedClone->Draw("same");
2577 hNeHadEChargedClone->Draw("same");
2578 hChHadEChargedClone->Draw("same");
2580 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
2581 pLegend3ch.SetTextSize(0.06);
2582 pLegend3ch.AddEntry(hEChargedClone,"all","L");
2583 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
2584 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
2585 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
2586 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
2587 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
2588 pLegend3ch.SetFillColor(10);
2589 pLegend3ch.SetBorderSize(1);
2593 hPtChargedClone->SetMaximum(1.2);
2594 hPtChargedClone->SetMinimum(0.001);
2595 hPtChargedClone->SetLineColor(3);
2596 hPtChargedClone->SetYTitle("track matched / all");
2597 hPi0PtChargedClone->Divide(hPi0Pt);
2598 hGamPtChargedClone->Divide(hGamPt);
2599 hElePtChargedClone->Divide(hElePt);
2600 hNeHadPtChargedClone->Divide(hNeHadPt);
2601 hChHadPtChargedClone->Divide(hChHadPt);
2602 hPtChargedClone->Draw();
2603 hPi0PtChargedClone->Draw("same");
2604 hGamPtChargedClone->Draw("same");
2605 hElePtChargedClone->Draw("same");
2606 hNeHadPtChargedClone->Draw("same");
2607 hChHadPtChargedClone->Draw("same");
2610 hEtaChargedClone->SetMaximum(1.2);
2611 hEtaChargedClone->SetMinimum(0.001);
2612 hEtaChargedClone->SetLineColor(3);
2613 hEtaChargedClone->SetYTitle("track matched / all");
2614 hPi0EtaChargedClone->Divide(hPi0Eta);
2615 hGamEtaChargedClone->Divide(hGamEta);
2616 hEleEtaChargedClone->Divide(hEleEta);
2617 hNeHadEtaChargedClone->Divide(hNeHadEta);
2618 hChHadEtaChargedClone->Divide(hChHadEta);
2619 hEtaChargedClone->Draw();
2620 hPi0EtaChargedClone->Draw("same");
2621 hGamEtaChargedClone->Draw("same");
2622 hEleEtaChargedClone->Draw("same");
2623 hNeHadEtaChargedClone->Draw("same");
2624 hChHadEtaChargedClone->Draw("same");
2627 hPhiChargedClone->SetMaximum(1.2);
2628 hPhiChargedClone->SetMinimum(0.001);
2629 hPhiChargedClone->SetLineColor(3);
2630 hPhiChargedClone->SetYTitle("track matched / all");
2631 hPi0PhiChargedClone->Divide(hPi0Phi);
2632 hGamPhiChargedClone->Divide(hGamPhi);
2633 hElePhiChargedClone->Divide(hElePhi);
2634 hNeHadPhiChargedClone->Divide(hNeHadPhi);
2635 hChHadPhiChargedClone->Divide(hChHadPhi);
2636 hPhiChargedClone->Draw();
2637 hPi0PhiChargedClone->Draw("same");
2638 hGamPhiChargedClone->Draw("same");
2639 hElePhiChargedClone->Draw("same");
2640 hNeHadPhiChargedClone->Draw("same");
2641 hChHadPhiChargedClone->Draw("same");
2643 sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
2644 c3ch->Print(name); printf("Plot: %s\n",name);
2647 //Track-matching distributions
2648 if(!strcmp(GetReader()->GetInputEvent()->GetName(),"AliESDEvent")){
2651 sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
2652 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
2655 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
2656 pLegendpE0.SetTextSize(0.04);
2657 pLegendpE0.AddEntry(fh1pOverE,"all","L");
2658 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
2659 pLegendpE0.SetFillColor(10);
2660 pLegendpE0.SetBorderSize(1);
2661 //pLegendpE0.Draw();
2664 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
2665 fh1pOverE->SetTitle("Track matches p/E");
2667 fh1pOverER02->SetLineColor(4);
2668 fh1pOverER02->Draw("same");
2672 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
2676 fh2MatchdEdx->Draw();
2681 sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
2682 cme->Print(name); printf("Plot: %s\n",name);
2685 sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
2686 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
2691 fhMCEle1pOverE->Draw();
2692 fhMCEle1pOverER02->SetLineColor(4);
2693 fhMCEle1pOverE->SetLineColor(1);
2694 fhMCEle1pOverER02->Draw("same");
2702 fhMCEle2MatchdEdx->Draw();
2704 sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
2705 cmemc->Print(name); printf("Plot: %s\n",name);
2708 sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
2709 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
2710 cmemchad->Divide(3,1);
2714 fhMCChHad1pOverE->Draw();
2715 fhMCChHad1pOverER02->SetLineColor(4);
2716 fhMCChHad1pOverE->SetLineColor(1);
2717 fhMCChHad1pOverER02->Draw("same");
2722 fhMCChHad1dR->Draw();
2725 fhMCChHad2MatchdEdx->Draw();
2727 sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
2728 cmemchad->Print(name); printf("Plot: %s\n",name);
2730 sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
2731 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
2732 cmemcn->Divide(3,1);
2736 fhMCNeutral1pOverE->Draw();
2737 fhMCNeutral1pOverE->SetLineColor(1);
2738 fhMCNeutral1pOverER02->SetLineColor(4);
2739 fhMCNeutral1pOverER02->Draw("same");
2744 fhMCNeutral1dR->Draw();
2747 fhMCNeutral2MatchdEdx->Draw();
2749 sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
2750 cmemcn->Print(name); printf("Plot: %s\n",name);
2752 sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
2753 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
2758 fh1pOverE->SetLineColor(1);
2759 fhMCEle1pOverE->SetLineColor(4);
2760 fhMCChHad1pOverE->SetLineColor(2);
2761 fhMCNeutral1pOverE->SetLineColor(7);
2762 fh1pOverER02->SetMinimum(0.5);
2764 fhMCEle1pOverE->Draw("same");
2765 fhMCChHad1pOverE->Draw("same");
2766 fhMCNeutral1pOverE->Draw("same");
2767 TLegend pLegendpE(0.65,0.55,0.9,0.8);
2768 pLegendpE.SetTextSize(0.06);
2769 pLegendpE.AddEntry(fh1pOverE,"all","L");
2770 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
2771 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
2772 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
2773 pLegendpE.SetFillColor(10);
2774 pLegendpE.SetBorderSize(1);
2779 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
2780 fh1pOverER02->SetLineColor(1);
2781 fhMCEle1pOverER02->SetLineColor(4);
2782 fhMCChHad1pOverER02->SetLineColor(2);
2783 fhMCNeutral1pOverER02->SetLineColor(7);
2784 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
2785 fh1pOverER02->SetMinimum(0.5);
2786 fh1pOverER02->Draw();
2787 fhMCEle1pOverER02->Draw("same");
2788 fhMCChHad1pOverER02->Draw("same");
2789 fhMCNeutral1pOverER02->Draw("same");
2791 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
2792 // pLegendpE2.SetTextSize(0.06);
2793 // pLegendpE2.SetHeader("dR < 0.02");
2794 // pLegendpE2.SetFillColor(10);
2795 // pLegendpE2.SetBorderSize(1);
2796 // pLegendpE2.Draw();
2798 sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
2799 cmpoe->Print(name); printf("Plot: %s\n",name);
2805 sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
2806 gROOT->ProcessLine(line);
2807 sprintf(line, ".!rm -fR *.eps");
2808 gROOT->ProcessLine(line);
2810 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());