]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
Be sure to load mapping when needed
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnaCalorimeterQA.cxx
CommitLineData
9725fd2a 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15/* $Id: $ */
16
a6f26052 17//_________________________________________________________________________
18// Class to check results from simulations or reconstructed real data.
19// Fill few histograms and do some checking plots
20//
21//-- Author: Gustavo Conesa (INFN-LNF)
22//_________________________________________________________________________
9725fd2a 23
24
a6f26052 25// --- ROOT system ---
26//#include "Riostream.h"
591cc579 27#include "TObjArray.h"
9725fd2a 28#include "TParticle.h"
c180f65d 29#include "TDatabasePDG.h"
9725fd2a 30#include "TCanvas.h"
31#include "TPad.h"
32#include "TROOT.h"
a5fafd85 33#include "TH3F.h"
9725fd2a 34#include "TH2F.h"
35#include "TLegend.h"
a5fafd85 36#include "TStyle.h"
0c1383b5 37#include <TObjString.h>
9725fd2a 38
a6f26052 39//---- AliRoot system ----
9725fd2a 40#include "AliAnaCalorimeterQA.h"
41#include "AliCaloTrackReader.h"
42#include "AliStack.h"
c8fe2783 43#include "AliVCaloCells.h"
ff45398a 44#include "AliFiducialCut.h"
ff5cc919 45#include "AliAODTrack.h"
c8fe2783 46#include "AliVCluster.h"
47#include "AliVEvent.h"
902aa95c 48#include "AliVEventHandler.h"
49#include "AliAnalysisManager.h"
50#include "AliAODMCParticle.h"
51#include "AliMCAnalysisUtils.h"
6fa7d352 52#include "AliAODPid.h"
c8fe2783 53#include "AliExternalTrackParam.h"
9725fd2a 54
55ClassImp(AliAnaCalorimeterQA)
c8fe2783 56
a6f26052 57//____________________________________________________________________________
c8fe2783 58AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
521636d2 59AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""),
60fFillAllPosHisto(kFALSE), fFillAllPosHisto2(kTRUE),
61fFillAllTH12(kFALSE), fFillAllTH3(kTRUE),
62fFillAllTMHisto(kTRUE), fFillAllPi0Histo(kTRUE),
63fCorrelate(kTRUE), fNModules(12), fNRCU(2),
64fTimeCutMin(-1), fTimeCutMax(9999999),
65fEMCALCellAmpMin(0), fPHOSCellAmpMin(0),
66fhE(0), fhPt(0), fhPhi(0), fhEta(0), fhEtaPhiE(0),
67fhECharged(0), fhPtCharged(0), fhPhiCharged(0), fhEtaCharged(0), fhEtaPhiECharged(0),
521636d2 68
69//Invariant mass
3129a79e 70fhIM(0 ), fhIMCellCut(0), fhAsym(0),
715fd81f 71fhNCellsPerCluster(0), fhNCellsPerClusterNoCut(0), fhNCellsPerClusterMIP(0), fhNCellsPerClusterMIPCharged(0),
72fhNCellsvsClusterMaxCellDiffE0(0), fhNCellsvsClusterMaxCellDiffE2(0), fhNCellsvsClusterMaxCellDiffE6(0),
3129a79e 73fhNClusters(0),
74
e1e62b89 75//Timing
76fhClusterTimeEnergy(0), fhCellTimeSpreadRespectToCellMax(0),
77fhCellIdCellLargeTimeSpread(0), fhClusterPairDiffTimeE(0),
78
715fd81f 79fhClusterMaxCellCloseCellRatio(0), fhClusterMaxCellDiff(0), fhClusterMaxCellDiffNoCut(0),
80//fhClusterMaxCellDiffDivLambda0(0),
81fhLambda0vsClusterMaxCellDiffE0(0), fhLambda0vsClusterMaxCellDiffE2(0), fhLambda0vsClusterMaxCellDiffE6(0),
82
e1e62b89 83//
84//bad cells
85fhBadClusterEnergy(0), fhBadClusterTimeEnergy(0), fhBadClusterPairDiffTimeE(0),
86fhBadClusterMaxCellCloseCellRatio(0), fhBadClusterMaxCellDiff(0),
521636d2 87
88//Position
89fhRNCells(0), fhXNCells(0), fhYNCells(0), fhZNCells(0),
90fhRE(0), fhXE(0), fhYE(0), fhZE(0),
91fhXYZ(0),
92fhRCellE(0), fhXCellE(0), fhYCellE(0), fhZCellE(0),
93fhXYZCell(0),
c8fe2783 94fhDeltaCellClusterRNCells(0),fhDeltaCellClusterXNCells(0),fhDeltaCellClusterYNCells(0),fhDeltaCellClusterZNCells(0),
95fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0), fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
521636d2 96// Cells
97fhNCells(0), fhAmplitude(0), fhAmpId(0), fhEtaPhiAmp(0),
98fhTime(0), fhTimeId(0), fhTimeAmp(0),
99//fhT0Time(0), fhT0TimeId(0), fhT0TimeAmp(0),
100fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
101fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0), fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
102fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0), fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
798a9b04 103fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0), fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
521636d2 104//Super-Module dependent histgrams
715fd81f 105fhEMod(0), fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsPerClusterModNoCut(0), fhNCellsMod(0),
521636d2 106fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0),
107fhAmplitudeMod(0), fhAmplitudeModFraction(0), fhTimeAmpPerRCU(0),
108//fhT0TimeAmpPerRCU(0), fhTimeCorrRCU(0),
109fhIMMod(0), fhIMCellCutMod(0),
715fd81f 110
111// MC and reco
112fhDeltaE(0), fhDeltaPt(0), fhDeltaPhi(0), fhDeltaEta(0),
113fhRatioE(0), fhRatioPt(0), fhRatioPhi(0), fhRatioEta(0),
114fh2E(0), fh2Pt(0), fh2Phi(0), fh2Eta(0),
115
521636d2 116// MC only
117fhGenGamPt(0), fhGenGamEta(0), fhGenGamPhi(0),
118fhGenPi0Pt(0), fhGenPi0Eta(0), fhGenPi0Phi(0),
119fhGenEtaPt(0), fhGenEtaEta(0), fhGenEtaPhi(0),
120fhGenOmegaPt(0), fhGenOmegaEta(0), fhGenOmegaPhi(0),
121fhGenElePt(0), fhGenEleEta(0), fhGenElePhi(0),
122fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
123fhGamE(0), fhGamPt(0), fhGamPhi(0), fhGamEta(0),
124fhGamDeltaE(0), fhGamDeltaPt(0), fhGamDeltaPhi(0), fhGamDeltaEta(0),
125fhGamRatioE(0), fhGamRatioPt(0), fhGamRatioPhi(0), fhGamRatioEta(0),
126fhEleE(0), fhElePt(0), fhElePhi(0), fhEleEta(0),
127fhPi0E(0), fhPi0Pt(0), fhPi0Phi(0), fhPi0Eta(0),
128fhNeHadE(0), fhNeHadPt(0), fhNeHadPhi(0), fhNeHadEta(0),
129fhChHadE(0), fhChHadPt(0), fhChHadPhi(0), fhChHadEta(0),
130fhGamECharged(0), fhGamPtCharged(0), fhGamPhiCharged(0), fhGamEtaCharged(0),
131fhEleECharged(0), fhElePtCharged(0), fhElePhiCharged(0), fhEleEtaCharged(0),
132fhPi0ECharged(0), fhPi0PtCharged(0), fhPi0PhiCharged(0), fhPi0EtaCharged(0),
133fhNeHadECharged(0), fhNeHadPtCharged(0), fhNeHadPhiCharged(0), fhNeHadEtaCharged(0),
134fhChHadECharged(0), fhChHadPtCharged(0), fhChHadPhiCharged(0), fhChHadEtaCharged(0),
135fhGenGamAccE(0), fhGenGamAccPt(0), fhGenGamAccEta(0), fhGenGamAccPhi(0),
136fhGenPi0AccE(0), fhGenPi0AccPt(0), fhGenPi0AccEta(0), fhGenPi0AccPhi(0),
137fh1pOverE(0), fh1dR(0), fh2EledEdx(0), fh2MatchdEdx(0),
138fhMCEle1pOverE(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
139fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
140fhMCNeutral1pOverE(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0),fh1pOverER02(0),
141fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
9725fd2a 142{
a6f26052 143 //Default Ctor
afabc52f 144
a6f26052 145 //Initialize parameters
9725fd2a 146 InitParameters();
147}
a5fafd85 148
a6f26052 149//________________________________________________________________________
0c1383b5 150TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
151{
a6f26052 152 //Save parameters used for analysis
2302a644 153 TString parList ; //this will be list of parameters used for this analysis.
f8006433 154 const Int_t buffersize = 255;
2302a644 155 char onePar[buffersize] ;
c8fe2783 156
2302a644 157 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
158 parList+=onePar ;
159 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
160 parList+=onePar ;
161 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
162 parList+=onePar ;
163 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
164 parList+=onePar ;
a6f26052 165 //Get parameters set in base class.
166 //parList += GetBaseParametersList() ;
2302a644 167
a6f26052 168 //Get parameters set in FiducialCut class (not available yet)
169 //parlist += GetFidCut()->GetFidCutParametersList()
0c1383b5 170
2302a644 171 return new TObjString(parList) ;
0c1383b5 172}
173
a5fafd85 174
a6f26052 175//________________________________________________________________________
9725fd2a 176TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
177{
a6f26052 178 // Create histograms to be saved in output file and
179 // store them in outputContainer
c8fe2783 180
2302a644 181 TList * outputContainer = new TList() ;
182 outputContainer->SetName("QAHistos") ;
183
a6f26052 184 //Histograms
2302a644 185 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
b8187de4 186 Int_t nfineptbins = GetHistoFinePtBins(); Float_t ptfinemax = GetHistoFinePtMax(); Float_t ptfinemin = GetHistoFinePtMin();
2302a644 187 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
188 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
189 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
190 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
191 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
192 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
193 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
194 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
e1e62b89 195 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
2302a644 196 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
197 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
198 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
199 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
200 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
201 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
3f5990d6 202 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
e1e62b89 203 Int_t tdbins = GetHistoDiffTimeBins() ; Float_t tdmax = GetHistoDiffTimeMax(); Float_t tdmin = GetHistoDiffTimeMin();
3f5990d6 204
e1e62b89 205 Int_t nv0sbins = GetHistoV0SignalBins(); Int_t nv0smax = GetHistoV0SignalMax(); Int_t nv0smin = GetHistoV0SignalMin();
206 Int_t nv0mbins = GetHistoV0MultiplicityBins(); Int_t nv0mmax = GetHistoV0MultiplicityMax(); Int_t nv0mmin = GetHistoV0MultiplicityMin();
207 Int_t ntrmbins = GetHistoTrackMultiplicityBins(); Int_t ntrmmax = GetHistoTrackMultiplicityMax(); Int_t ntrmmin = GetHistoTrackMultiplicityMin();
208
209
a6f26052 210 //EMCAL
2302a644 211 Int_t colmax = 48;
212 Int_t rowmax = 24;
213 fNRCU = 2 ;
a6f26052 214 //PHOS
2302a644 215 if(fCalorimeter=="PHOS"){
216 colmax = 56;
217 rowmax = 64;
218 fNRCU = 4 ;
219 }
220
a6f26052 221
3f5990d6 222 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
2302a644 223 fhE->SetXTitle("E (GeV)");
224 outputContainer->Add(fhE);
225
226 if(fFillAllTH12){
a6f26052 227 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
228 fhPt->SetXTitle("p_{T} (GeV/c)");
229 outputContainer->Add(fhPt);
230
231 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
232 fhPhi->SetXTitle("#phi (rad)");
233 outputContainer->Add(fhPhi);
234
235 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
236 fhEta->SetXTitle("#eta ");
237 outputContainer->Add(fhEta);
2302a644 238 }
a6f26052 239
3748ffb5 240 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
521636d2 241 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
3748ffb5 242 fhEtaPhiE->SetXTitle("#eta ");
243 fhEtaPhiE->SetYTitle("#phi (rad)");
244 fhEtaPhiE->SetZTitle("E (GeV) ");
245 outputContainer->Add(fhEtaPhiE);
2302a644 246
247 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
c8fe2783 248 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2302a644 249 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
250 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
251 outputContainer->Add(fhClusterTimeEnergy);
715fd81f 252
253 fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",
254 nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
255 fhClusterPairDiffTimeE->SetXTitle("E_{cluster} (GeV)");
256 fhClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
257 outputContainer->Add(fhClusterPairDiffTimeE);
258
521636d2 259
a95eac90 260 fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCell","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
521636d2 261 nptbins,ptmin,ptmax, 100,0,1.);
a95eac90 262 fhClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
263 fhClusterMaxCellCloseCellRatio->SetYTitle("ratio");
264 outputContainer->Add(fhClusterMaxCellCloseCellRatio);
265
715fd81f 266 fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
e1e62b89 267 nptbins,ptmin,ptmax, 500,0,1.);
268 fhClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
715fd81f 269 fhClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
e1e62b89 270 outputContainer->Add(fhClusterMaxCellDiff);
715fd81f 271
272 fhClusterMaxCellDiffNoCut = new TH2F ("hClusterMaxCellDiffNoCut","energy vs difference of cluster energy - max cell energy / cluster energy",
273 nptbins,ptmin,ptmax, 500,0,1.);
274 fhClusterMaxCellDiffNoCut->SetXTitle("E_{cluster} (GeV) ");
275 fhClusterMaxCellDiffNoCut->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
276 outputContainer->Add(fhClusterMaxCellDiffNoCut);
277
278// fhClusterMaxCellDiffDivLambda0 = new TH2F ("hClusterMaxCellDiffDivLambda0;","",
279// nptbins,ptmin,ptmax, 500,0,5.);
280// fhClusterMaxCellDiffDivLambda0->SetXTitle("E_{cluster} (GeV) ");
281// fhClusterMaxCellDiffDivLambda0->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster} / #lambda_{0}");
282// outputContainer->Add(fhClusterMaxCellDiffDivLambda0);
283
284 fhLambda0vsClusterMaxCellDiffE0 = new TH2F ("hLambda0vsClusterMaxCellDiffE0","shower shape, #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV ",
285 ssbins,ssmin,ssmax,500,0,1.);
286 fhLambda0vsClusterMaxCellDiffE0->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
287 fhLambda0vsClusterMaxCellDiffE0->SetXTitle("#lambda^{2}_{0}");
288 outputContainer->Add(fhLambda0vsClusterMaxCellDiffE0);
289
290 fhLambda0vsClusterMaxCellDiffE2 = new TH2F ("hLambda0vsClusterMaxCellDiffE2","shower shape, #lambda^{2}_{0} vs fraction of energy carried by max cell, 2 < E < 6 GeV ",
291 ssbins,ssmin,ssmax,500,0,1.);
292 fhLambda0vsClusterMaxCellDiffE2->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
293 fhLambda0vsClusterMaxCellDiffE2->SetXTitle("#lambda^{2}_{0}");
294 outputContainer->Add(fhLambda0vsClusterMaxCellDiffE2);
295
296 fhLambda0vsClusterMaxCellDiffE6 = new TH2F ("hLambda0vsClusterMaxCellDiffE6","shower shape, #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 ",
297 ssbins,ssmin,ssmax,500,0,1.);
298 fhLambda0vsClusterMaxCellDiffE6->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
299 fhLambda0vsClusterMaxCellDiffE6->SetXTitle("#lambda^{2}_{0}");
300 outputContainer->Add(fhLambda0vsClusterMaxCellDiffE6);
301
302 fhNCellsvsClusterMaxCellDiffE0 = new TH2F ("hNCellsvsClusterMaxCellDiffE0","N cells per cluster vs fraction of energy carried by max cell, E < 2 GeV ",
303 nbins/5,nmin,nmax/5,500,0,1.);
304 fhNCellsvsClusterMaxCellDiffE0->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
305 fhNCellsvsClusterMaxCellDiffE0->SetXTitle("N cells per cluster");
306 outputContainer->Add(fhNCellsvsClusterMaxCellDiffE0);
307
308 fhNCellsvsClusterMaxCellDiffE2 = new TH2F ("hNCellsvsClusterMaxCellDiffE2","N cells per cluster vs fraction of energy carried by max cell, 2 < E < 6 GeV ",
309 nbins/5,nmin,nmax/5,500,0,1.);
310 fhNCellsvsClusterMaxCellDiffE2->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
311 fhNCellsvsClusterMaxCellDiffE2->SetXTitle("N cells per cluster");
312 outputContainer->Add(fhNCellsvsClusterMaxCellDiffE2);
313
314 fhNCellsvsClusterMaxCellDiffE6 = new TH2F ("hNCellsvsClusterMaxCellDiffE6","N cells per cluster vs fraction of energy carried by max cell, E > 6 ",
315 nbins/5,nmin,nmax/5,500,0,1.);
316 fhNCellsvsClusterMaxCellDiffE6->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
317 fhNCellsvsClusterMaxCellDiffE6->SetXTitle("N cells per cluster");
318 outputContainer->Add(fhNCellsvsClusterMaxCellDiffE6);
319
a95eac90 320
3129a79e 321 if(fCalorimeter=="EMCAL" && !GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster()){
322
e1e62b89 323 fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
324 fhBadClusterEnergy->SetXTitle("E_{cluster} (GeV) ");
325 outputContainer->Add(fhBadClusterEnergy);
326
3129a79e 327 fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCell","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
328 nptbins,ptmin,ptmax, 100,0,1.);
329 fhBadClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
330 fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
331 outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
332
e1e62b89 333 fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
334 nptbins,ptmin,ptmax, 500,0,1.);
335 fhBadClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
715fd81f 336 fhBadClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max}) / E_{cluster}");
e1e62b89 337 outputContainer->Add(fhBadClusterMaxCellDiff);
338
339 fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
3129a79e 340 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
e1e62b89 341 fhBadClusterTimeEnergy->SetXTitle("E_{cluster} (GeV) ");
342 fhBadClusterTimeEnergy->SetYTitle("TOF (ns)");
343 outputContainer->Add(fhBadClusterTimeEnergy);
3f5990d6 344
e1e62b89 345 fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
346 fhBadClusterPairDiffTimeE->SetXTitle("E_{bad cluster} (GeV)");
347 fhBadClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
348 outputContainer->Add(fhBadClusterPairDiffTimeE);
715fd81f 349
3129a79e 350 }
2302a644 351
a6f26052 352 //Track Matching
55c05f8c 353 if(fFillAllTMHisto){
354 if(fFillAllTH12){
355 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
356 fhECharged->SetXTitle("E (GeV)");
357 outputContainer->Add(fhECharged);
358
359 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
360 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
361 outputContainer->Add(fhPtCharged);
362
363 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
364 fhPhiCharged->SetXTitle("#phi (rad)");
365 outputContainer->Add(fhPhiCharged);
366
367 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
368 fhEtaCharged->SetXTitle("#eta ");
369 outputContainer->Add(fhEtaCharged);
370 }
3748ffb5 371 if(fFillAllTH3){
372 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
521636d2 373 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
3748ffb5 374 fhEtaPhiECharged->SetXTitle("#eta ");
375 fhEtaPhiECharged->SetYTitle("#phi ");
376 fhEtaPhiECharged->SetZTitle("E (GeV) ");
377 outputContainer->Add(fhEtaPhiECharged);
378 }
55c05f8c 379
380 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
381 fh1pOverE->SetYTitle("p/E");
382 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
383 outputContainer->Add(fh1pOverE);
384
385 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
386 fh1dR->SetXTitle("#Delta R (rad)");
387 outputContainer->Add(fh1dR) ;
388
389 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
390 fh2MatchdEdx->SetXTitle("p (GeV/c)");
391 fh2MatchdEdx->SetYTitle("<dE/dx>");
392 outputContainer->Add(fh2MatchdEdx);
393
394 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
395 fh2EledEdx->SetXTitle("p (GeV/c)");
396 fh2EledEdx->SetYTitle("<dE/dx>");
397 outputContainer->Add(fh2EledEdx) ;
398
399 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
400 fh1pOverER02->SetYTitle("p/E");
401 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
402 outputContainer->Add(fh1pOverER02);
403 }
404
405 if(fFillAllPi0Histo){
406 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
407 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
408 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
409 outputContainer->Add(fhIM);
a6f26052 410
55c05f8c 411 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
412 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
413 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
414 outputContainer->Add(fhIMCellCut);
a6f26052 415
55c05f8c 416 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
417 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
418 fhAsym->SetYTitle("Asymmetry");
419 outputContainer->Add(fhAsym);
a6f26052 420
a6f26052 421 }
715fd81f 422
423 fhNCellsPerClusterNoCut = new TH2F ("hNCellsPerClusterNoCut","# cells per cluster vs energy vs #eta, no bad clusters cut",nptbins,ptmin,ptmax, nbins/5,nmin,nmax/5);
424 fhNCellsPerClusterNoCut->SetXTitle("E (GeV)");
425 fhNCellsPerClusterNoCut->SetYTitle("n cells");
426 outputContainer->Add(fhNCellsPerClusterNoCut);
55c05f8c 427
715fd81f 428 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins/5,nmin,nmax/5);
3f5990d6 429 fhNCellsPerCluster->SetXTitle("E (GeV)");
430 fhNCellsPerCluster->SetYTitle("n cells");
3f5990d6 431 outputContainer->Add(fhNCellsPerCluster);
55c05f8c 432
715fd81f 433 if((fCalorimeter=="EMCAL" && GetReader()->GetEMCALPtMin() < 0.3) ||
434 (fCalorimeter=="PHOS" && GetReader()->GetPHOSPtMin() < 0.3)) {
435 fhNCellsPerClusterMIP = new TH2F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
3f5990d6 436 40,0.,2., 11,0,10);
715fd81f 437 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
438 fhNCellsPerClusterMIP->SetYTitle("n cells");
439 outputContainer->Add(fhNCellsPerClusterMIP);
55c05f8c 440
715fd81f 441
442 if(fFillAllTMHisto){
443 fhNCellsPerClusterMIPCharged = new TH2F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
3f5990d6 444 40,0.,2., 11,0,10);
715fd81f 445 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
446 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
447 outputContainer->Add(fhNCellsPerClusterMIPCharged);
448 }
55c05f8c 449 }
715fd81f 450
2302a644 451 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
452 fhNClusters->SetXTitle("number of clusters");
453 outputContainer->Add(fhNClusters);
c8fe2783 454
55c05f8c 455 if(fFillAllPosHisto2){
456
457 if(fFillAllTH3){
458 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
459 fhXYZ->SetXTitle("x (cm)");
460 fhXYZ->SetYTitle("y (cm)");
461 fhXYZ->SetZTitle("z (cm) ");
462 outputContainer->Add(fhXYZ);
463 }
464
465 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax);
466 fhXNCells->SetXTitle("x (cm)");
467 fhXNCells->SetYTitle("N cells per cluster");
468 outputContainer->Add(fhXNCells);
469
470 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax);
471 fhZNCells->SetXTitle("z (cm)");
472 fhZNCells->SetYTitle("N cells per cluster");
473 outputContainer->Add(fhZNCells);
474
475 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
476 fhXE->SetXTitle("x (cm)");
477 fhXE->SetYTitle("E (GeV)");
478 outputContainer->Add(fhXE);
479
480 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
481 fhZE->SetXTitle("z (cm)");
482 fhZE->SetYTitle("E (GeV)");
483 outputContainer->Add(fhZE);
484
a6f26052 485
55c05f8c 486 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax);
487 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
488 fhRNCells->SetYTitle("N cells per cluster");
489 outputContainer->Add(fhRNCells);
490
491
492 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax);
493 fhYNCells->SetXTitle("y (cm)");
494 fhYNCells->SetYTitle("N cells per cluster");
495 outputContainer->Add(fhYNCells);
496
497 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
498 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
499 fhRE->SetYTitle("E (GeV)");
500 outputContainer->Add(fhRE);
501
502 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
503 fhYE->SetXTitle("y (cm)");
504 fhYE->SetYTitle("E (GeV)");
505 outputContainer->Add(fhYE);
506 }
b8187de4 507 if(fFillAllPosHisto){
521636d2 508
a6f26052 509 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
510 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
511 fhRCellE->SetYTitle("E (GeV)");
512 outputContainer->Add(fhRCellE);
513
514 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
515 fhXCellE->SetXTitle("x (cm)");
516 fhXCellE->SetYTitle("E (GeV)");
517 outputContainer->Add(fhXCellE);
518
519 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
520 fhYCellE->SetXTitle("y (cm)");
521 fhYCellE->SetYTitle("E (GeV)");
522 outputContainer->Add(fhYCellE);
523
524 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
525 fhZCellE->SetXTitle("z (cm)");
526 fhZCellE->SetYTitle("E (GeV)");
527 outputContainer->Add(fhZCellE);
528
529 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
530 fhXYZCell->SetXTitle("x (cm)");
531 fhXYZCell->SetYTitle("y (cm)");
532 fhXYZCell->SetZTitle("z (cm)");
533 outputContainer->Add(fhXYZCell);
534
535
536 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
537 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
538 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
539 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
540
541 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax);
542 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
543 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
544 outputContainer->Add(fhDeltaCellClusterRNCells);
545
546 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax);
547 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
548 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
549 outputContainer->Add(fhDeltaCellClusterXNCells);
550
551 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax);
552 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
553 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
554 outputContainer->Add(fhDeltaCellClusterYNCells);
555
556 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax);
557 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
558 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
559 outputContainer->Add(fhDeltaCellClusterZNCells);
560
561 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
562 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
563 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
564 outputContainer->Add(fhDeltaCellClusterRE);
565
566 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
567 fhDeltaCellClusterXE->SetXTitle("x (cm)");
568 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
569 outputContainer->Add(fhDeltaCellClusterXE);
570
571 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
572 fhDeltaCellClusterYE->SetXTitle("y (cm)");
573 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
574 outputContainer->Add(fhDeltaCellClusterYE);
575
576 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
577 fhDeltaCellClusterZE->SetXTitle("z (cm)");
578 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
579 outputContainer->Add(fhDeltaCellClusterZE);
580
581 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
582 fhEtaPhiAmp->SetXTitle("#eta ");
583 fhEtaPhiAmp->SetYTitle("#phi (rad)");
584 fhEtaPhiAmp->SetZTitle("E (GeV) ");
585 outputContainer->Add(fhEtaPhiAmp);
586
2302a644 587 }
c8fe2783 588
a6f26052 589 //Calo cells
2302a644 590 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
591 fhNCells->SetXTitle("n cells");
592 outputContainer->Add(fhNCells);
593
594 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
595 fhAmplitude->SetXTitle("Cell Energy (GeV)");
596 outputContainer->Add(fhAmplitude);
597
598 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
599 fhAmpId->SetXTitle("Cell Energy (GeV)");
600 outputContainer->Add(fhAmpId);
601
c8fe2783 602
a6f26052 603 //Cell Time histograms, time only available in ESDs
2302a644 604 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
605
606 fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200);
607 fhCellTimeSpreadRespectToCellMax->SetXTitle("#Delta t (ns)");
608 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
609
610 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
611 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
612 outputContainer->Add(fhCellIdCellLargeTimeSpread);
521636d2 613
2302a644 614 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
615 fhTime->SetXTitle("Cell Time (ns)");
616 outputContainer->Add(fhTime);
617
618 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
619 fhTimeId->SetXTitle("Cell Time (ns)");
620 fhTimeId->SetYTitle("Cell Absolute Id");
621 outputContainer->Add(fhTimeId);
622
623 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
624 fhTimeAmp->SetYTitle("Cell Time (ns)");
625 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
626 outputContainer->Add(fhTimeAmp);
627
a6f26052 628 // fhT0Time = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax);
629 // fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
630 // outputContainer->Add(fhT0Time);
631 //
632 // fhT0TimeId = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
633 // fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
634 // fhT0TimeId->SetYTitle("Cell Absolute Id");
635 // outputContainer->Add(fhT0TimeId);
636 //
637 // fhT0TimeAmp = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
638 // fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
639 // fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
640 // outputContainer->Add(fhT0TimeAmp);
2302a644 641 }
a0bb4dc0 642
798a9b04 643 if(fCorrelate){
644 //PHOS vs EMCAL
2302a644 645 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
646 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
647 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
648 outputContainer->Add(fhCaloCorrNClusters);
649
798a9b04 650 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2302a644 651 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
652 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
653 outputContainer->Add(fhCaloCorrEClusters);
654
655 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
656 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
657 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
658 outputContainer->Add(fhCaloCorrNCells);
659
798a9b04 660 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins*2,ptmin,ptmax*2);
2302a644 661 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
662 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
663 outputContainer->Add(fhCaloCorrECells);
798a9b04 664
665 //Calorimeter VS V0 signal
666 fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nbins,nmin,nmax);
667 fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
668 fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
669 outputContainer->Add(fhCaloV0SCorrNClusters);
670
b3fdfed5 671 fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
798a9b04 672 fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
673 fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
674 outputContainer->Add(fhCaloV0SCorrEClusters);
675
b3fdfed5 676 fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax, nbins,nmin,nmax);
798a9b04 677 fhCaloV0SCorrNCells->SetXTitle("V0 signal");
678 fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
679 outputContainer->Add(fhCaloV0SCorrNCells);
680
681 fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
682 fhCaloV0SCorrECells->SetXTitle("V0 signal");
683 fhCaloV0SCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
684 outputContainer->Add(fhCaloV0SCorrECells);
685
686 //Calorimeter VS V0 multiplicity
687 fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nbins,nmin,nmax);
688 fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
689 fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
690 outputContainer->Add(fhCaloV0MCorrNClusters);
691
b3fdfed5 692 fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
798a9b04 693 fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
694 fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
695 outputContainer->Add(fhCaloV0MCorrEClusters);
696
b3fdfed5 697 fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax, nbins,nmin,nmax);
798a9b04 698 fhCaloV0MCorrNCells->SetXTitle("V0 signal");
699 fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
700 outputContainer->Add(fhCaloV0MCorrNCells);
701
702 fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
703 fhCaloV0MCorrECells->SetXTitle("V0 signal");
704 fhCaloV0MCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
17d63906 705 outputContainer->Add(fhCaloV0MCorrECells);
798a9b04 706
707 //Calorimeter VS Track multiplicity
521636d2 708 fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nbins,nmin,nmax);
709 fhCaloTrackMCorrNClusters->SetXTitle("# tracks");
798a9b04 710 fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
711 outputContainer->Add(fhCaloTrackMCorrNClusters);
712
521636d2 713 fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
714 fhCaloTrackMCorrEClusters->SetXTitle("# tracks");
798a9b04 715 fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
716 outputContainer->Add(fhCaloTrackMCorrEClusters);
717
521636d2 718 fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax, nbins,nmin,nmax);
719 fhCaloTrackMCorrNCells->SetXTitle("# tracks");
798a9b04 720 fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
721 outputContainer->Add(fhCaloTrackMCorrNCells);
722
521636d2 723 fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
724 fhCaloTrackMCorrECells->SetXTitle("# tracks");
798a9b04 725 fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
17d63906 726 outputContainer->Add(fhCaloTrackMCorrECells);
798a9b04 727
728
2302a644 729 }//correlate calorimeters
730
a6f26052 731 //Module histograms
2302a644 732 fhEMod = new TH1F*[fNModules];
733 fhNClustersMod = new TH1F*[fNModules];
734 fhNCellsPerClusterMod = new TH2F*[fNModules];
715fd81f 735 fhNCellsPerClusterModNoCut = new TH2F*[fNModules];
2302a644 736 fhNCellsMod = new TH1F*[fNModules];
737 fhGridCellsMod = new TH2F*[fNModules];
738 fhGridCellsEMod = new TH2F*[fNModules];
739 fhGridCellsTimeMod = new TH2F*[fNModules];
740 fhAmplitudeMod = new TH1F*[fNModules];
741 if(fCalorimeter=="EMCAL")
742 fhAmplitudeModFraction = new TH1F*[fNModules*3];
743
744 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
a6f26052 745 //fhT0TimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
746 //fhTimeCorrRCU = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
c8fe2783 747
2302a644 748 fhIMMod = new TH2F*[fNModules];
749 fhIMCellCutMod = new TH2F*[fNModules];
750
751 for(Int_t imod = 0; imod < fNModules; imod++){
752
753 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
754 fhEMod[imod]->SetXTitle("E (GeV)");
755 outputContainer->Add(fhEMod[imod]);
756
757 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
758 fhNClustersMod[imod]->SetXTitle("number of clusters");
759 outputContainer->Add(fhNClustersMod[imod]);
760
761 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
c8fe2783 762 Form("# cells per cluster vs cluster energy in Module %d",imod),
763 nptbins,ptmin,ptmax, nbins,nmin,nmax);
2302a644 764 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
765 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
766 outputContainer->Add(fhNCellsPerClusterMod[imod]);
715fd81f 767
768 fhNCellsPerClusterModNoCut[imod] = new TH2F (Form("hNCellsPerClusterNoCut_Mod%d",imod),
769 Form("# cells per cluster vs cluster energy in Module %d, no cut",imod),
770 nptbins,ptmin,ptmax, nbins,nmin,nmax);
771 fhNCellsPerClusterModNoCut[imod]->SetXTitle("E (GeV)");
772 fhNCellsPerClusterModNoCut[imod]->SetYTitle("n cells");
773 outputContainer->Add(fhNCellsPerClusterModNoCut[imod]);
774
2302a644 775
776 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
777 fhNCellsMod[imod]->SetXTitle("n cells");
778 outputContainer->Add(fhNCellsMod[imod]);
779 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
c8fe2783 780 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
2302a644 781 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
782 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
783 outputContainer->Add(fhGridCellsMod[imod]);
c8fe2783 784
2302a644 785 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
c8fe2783 786 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
2302a644 787 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
788 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
789 outputContainer->Add(fhGridCellsEMod[imod]);
790
791 fhGridCellsTimeMod[imod] = new TH2F (Form("hGridCellsTime_Mod%d",imod),Form("Accumulated time in grid of cells in Module %d, with E > 0.5 GeV",imod),
c8fe2783 792 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
2302a644 793 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)");
794 fhGridCellsTimeMod[imod]->SetXTitle("column (eta direction)");
795 outputContainer->Add(fhGridCellsTimeMod[imod]);
796
797 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
798 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
799 outputContainer->Add(fhAmplitudeMod[imod]);
800
801 if(fCalorimeter == "EMCAL"){
802 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
17d63906 803 fhAmplitudeModFraction[imod*3+ifrac] = new TH1F (Form("hAmplitude_Mod%d_Frac%d",imod,ifrac),Form("Cell reconstructed Energy in Module %d, Fraction %d ",imod,ifrac), nptbins,ptmin,ptmax);
804 fhAmplitudeModFraction[imod*3+ifrac]->SetXTitle("E (GeV)");
805 outputContainer->Add(fhAmplitudeModFraction[imod*3+ifrac]);
2302a644 806 }
807
808 }
ff5cc919 809 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2302a644 810
ff5cc919 811 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
812 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
813 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
814 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
815 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
816 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
817 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
818
819 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
820 // Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu),
821 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
822 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
823 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
824 // outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
825 //
826
827 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
828 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
829 // Int_t index = (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod;
830 // fhTimeCorrRCU[index] = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
831 // Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
832 // ntimebins,timemin,timemax,ntimebins,timemin,timemax);
833 // fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
834 // fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
835 // outputContainer->Add(fhTimeCorrRCU[index]);
836 // }
837 // }
838 }
2302a644 839 }
55c05f8c 840 if(fFillAllPi0Histo){
841 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
842 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
843 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
844 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
845 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
846 outputContainer->Add(fhIMMod[imod]);
847
848 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
849 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
850 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
851 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
852 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
853 outputContainer->Add(fhIMCellCutMod[imod]);
854 }
2302a644 855 }
856
857
a6f26052 858 //Monte Carlo Histograms
2302a644 859 if(IsDataMC()){
860
861 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
862 fhDeltaE->SetXTitle("#Delta E (GeV)");
863 outputContainer->Add(fhDeltaE);
864
865 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
866 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
867 outputContainer->Add(fhDeltaPt);
868
869 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
870 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
871 outputContainer->Add(fhDeltaPhi);
872
873 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
874 fhDeltaEta->SetXTitle("#Delta #eta ");
875 outputContainer->Add(fhDeltaEta);
876
877 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
878 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
879 outputContainer->Add(fhRatioE);
880
881 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
882 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
883 outputContainer->Add(fhRatioPt);
884
885 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
886 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
887 outputContainer->Add(fhRatioPhi);
888
889 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
890 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
891 outputContainer->Add(fhRatioEta);
892
893 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
894 fh2E->SetXTitle("E_{rec} (GeV)");
895 fh2E->SetYTitle("E_{gen} (GeV)");
896 outputContainer->Add(fh2E);
897
898 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
899 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
900 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
901 outputContainer->Add(fh2Pt);
902
903 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
904 fh2Phi->SetXTitle("#phi_{rec} (rad)");
905 fh2Phi->SetYTitle("#phi_{gen} (rad)");
906 outputContainer->Add(fh2Phi);
907
908 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
909 fh2Eta->SetXTitle("#eta_{rec} ");
910 fh2Eta->SetYTitle("#eta_{gen} ");
911 outputContainer->Add(fh2Eta);
912
a6f26052 913 //Fill histos depending on origin of cluster
2302a644 914 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
915 fhGamE->SetXTitle("E_{rec} (GeV)");
916 fhGamE->SetXTitle("E_{gen} (GeV)");
917 outputContainer->Add(fhGamE);
918
919 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
920 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
921 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
922 outputContainer->Add(fhGamPt);
923
924 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
925 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
926 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
927 outputContainer->Add(fhGamPhi);
928
929 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
930 fhGamEta->SetXTitle("#eta_{rec} ");
931 fhGamEta->SetYTitle("#eta_{gen} ");
932 outputContainer->Add(fhGamEta);
933
934 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
935 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
936 outputContainer->Add(fhGamDeltaE);
937
938 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
939 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
940 outputContainer->Add(fhGamDeltaPt);
941
942 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
943 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
944 outputContainer->Add(fhGamDeltaPhi);
945
946 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
947 fhGamDeltaEta->SetXTitle("#Delta #eta ");
948 outputContainer->Add(fhGamDeltaEta);
949
950 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
951 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
952 outputContainer->Add(fhGamRatioE);
953
954 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
955 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
956 outputContainer->Add(fhGamRatioPt);
957
958 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
959 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
960 outputContainer->Add(fhGamRatioPhi);
961
962 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
963 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
964 outputContainer->Add(fhGamRatioEta);
965
966 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
967 fhPi0E->SetXTitle("E_{rec} (GeV)");
968 fhPi0E->SetYTitle("E_{gen} (GeV)");
969 outputContainer->Add(fhPi0E);
970
971 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
972 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
973 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
974 outputContainer->Add(fhPi0Pt);
975
976 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
977 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
978 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
979 outputContainer->Add(fhPi0Phi);
980
981 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
982 fhPi0Eta->SetXTitle("#eta_{rec} ");
983 fhPi0Eta->SetYTitle("#eta_{gen} ");
984 outputContainer->Add(fhPi0Eta);
985
986 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
987 fhEleE->SetXTitle("E_{rec} (GeV)");
988 fhEleE->SetXTitle("E_{gen} (GeV)");
989 outputContainer->Add(fhEleE);
990
991 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
992 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
993 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
994 outputContainer->Add(fhElePt);
995
996 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
997 fhElePhi->SetXTitle("#phi_{rec} (rad)");
998 fhElePhi->SetYTitle("#phi_{gen} (rad)");
999 outputContainer->Add(fhElePhi);
1000
1001 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
1002 fhEleEta->SetXTitle("#eta_{rec} ");
1003 fhEleEta->SetYTitle("#eta_{gen} ");
1004 outputContainer->Add(fhEleEta);
1005
1006 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1007 fhNeHadE->SetXTitle("E_{rec} (GeV)");
1008 fhNeHadE->SetYTitle("E_{gen} (GeV)");
1009 outputContainer->Add(fhNeHadE);
1010
1011 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1012 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
1013 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
1014 outputContainer->Add(fhNeHadPt);
1015
1016 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
1017 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
1018 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
1019 outputContainer->Add(fhNeHadPhi);
1020
1021 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
1022 fhNeHadEta->SetXTitle("#eta_{rec} ");
1023 fhNeHadEta->SetYTitle("#eta_{gen} ");
1024 outputContainer->Add(fhNeHadEta);
1025
1026 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1027 fhChHadE->SetXTitle("E_{rec} (GeV)");
1028 fhChHadE->SetYTitle("E_{gen} (GeV)");
1029 outputContainer->Add(fhChHadE);
1030
1031 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1032 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
1033 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
1034 outputContainer->Add(fhChHadPt);
1035
1036 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
1037 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
1038 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
1039 outputContainer->Add(fhChHadPhi);
1040
1041 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
1042 fhChHadEta->SetXTitle("#eta_{rec} ");
1043 fhChHadEta->SetYTitle("#eta_{gen} ");
1044 outputContainer->Add(fhChHadEta);
1045
a6f26052 1046 //Charged clusters
2302a644 1047
1048 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1049 fhGamECharged->SetXTitle("E_{rec} (GeV)");
1050 fhGamECharged->SetXTitle("E_{gen} (GeV)");
1051 outputContainer->Add(fhGamECharged);
1052
1053 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1054 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1055 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1056 outputContainer->Add(fhGamPtCharged);
1057
1058 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1059 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
1060 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
1061 outputContainer->Add(fhGamPhiCharged);
1062
1063 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1064 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
1065 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
1066 outputContainer->Add(fhGamEtaCharged);
1067
1068 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1069 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
1070 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
1071 outputContainer->Add(fhPi0ECharged);
1072
1073 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1074 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
1075 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
1076 outputContainer->Add(fhPi0PtCharged);
1077
1078 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1079 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
1080 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
1081 outputContainer->Add(fhPi0PhiCharged);
1082
1083 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1084 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
1085 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
1086 outputContainer->Add(fhPi0EtaCharged);
1087
1088 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1089 fhEleECharged->SetXTitle("E_{rec} (GeV)");
1090 fhEleECharged->SetXTitle("E_{gen} (GeV)");
1091 outputContainer->Add(fhEleECharged);
1092
1093 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1094 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
1095 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
1096 outputContainer->Add(fhElePtCharged);
1097
1098 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1099 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
1100 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
1101 outputContainer->Add(fhElePhiCharged);
1102
1103 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1104 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
1105 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
1106 outputContainer->Add(fhEleEtaCharged);
1107
1108 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1109 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
1110 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
1111 outputContainer->Add(fhNeHadECharged);
1112
1113 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1114 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1115 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1116 outputContainer->Add(fhNeHadPtCharged);
1117
1118 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1119 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1120 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1121 outputContainer->Add(fhNeHadPhiCharged);
1122
1123 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1124 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
1125 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
1126 outputContainer->Add(fhNeHadEtaCharged);
1127
1128 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1129 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
1130 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
1131 outputContainer->Add(fhChHadECharged);
1132
1133 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1134 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1135 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1136 outputContainer->Add(fhChHadPtCharged);
1137
1138 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1139 fhChHadPhiCharged->SetXTitle("#phi (rad)");
1140 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1141 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1142 outputContainer->Add(fhChHadPhiCharged);
1143
1144 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1145 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
1146 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
1147 outputContainer->Add(fhChHadEtaCharged);
1148
a6f26052 1149 //Vertex of generated particles
2302a644 1150
1151 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1152 fhEMVxyz->SetXTitle("v_{x}");
1153 fhEMVxyz->SetYTitle("v_{y}");
a6f26052 1154 //fhEMVxyz->SetZTitle("v_{z}");
2302a644 1155 outputContainer->Add(fhEMVxyz);
1156
1157 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1158 fhHaVxyz->SetXTitle("v_{x}");
1159 fhHaVxyz->SetYTitle("v_{y}");
a6f26052 1160 //fhHaVxyz->SetZTitle("v_{z}");
2302a644 1161 outputContainer->Add(fhHaVxyz);
1162
1163 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1164 fhEMR->SetXTitle("E (GeV)");
1165 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1166 outputContainer->Add(fhEMR);
1167
1168 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1169 fhHaR->SetXTitle("E (GeV)");
1170 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1171 outputContainer->Add(fhHaR);
1172
1173
c8fe2783 1174
a6f26052 1175 //Pure MC
2302a644 1176 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
1177 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
1178 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
1179
1180 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
1181 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
1182 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
1183
1184 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
1185 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
1186 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
1187
1188 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
1189 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
1190 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
1191
1192 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
1193 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
1194 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
1195
1196 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
1197 fhGenGamEta->SetXTitle("#eta");
1198 fhGenGamPhi->SetXTitle("#phi (rad)");
1199 outputContainer->Add(fhGenGamPt);
1200 outputContainer->Add(fhGenGamEta);
1201 outputContainer->Add(fhGenGamPhi);
1202
1203 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
1204 fhGenPi0Eta->SetXTitle("#eta");
1205 fhGenPi0Phi->SetXTitle("#phi (rad)");
1206 outputContainer->Add(fhGenPi0Pt);
1207 outputContainer->Add(fhGenPi0Eta);
1208 outputContainer->Add(fhGenPi0Phi);
1209
1210 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
1211 fhGenEtaEta->SetXTitle("#eta");
1212 fhGenEtaPhi->SetXTitle("#phi (rad)");
1213 outputContainer->Add(fhGenEtaPt);
1214 outputContainer->Add(fhGenEtaEta);
1215 outputContainer->Add(fhGenEtaPhi);
1216
1217 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
1218 fhGenOmegaEta->SetXTitle("#eta");
1219 fhGenOmegaPhi->SetXTitle("#phi (rad)");
1220 outputContainer->Add(fhGenOmegaPt);
1221 outputContainer->Add(fhGenOmegaEta);
1222 outputContainer->Add(fhGenOmegaPhi);
1223
1224 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
1225 fhGenEleEta->SetXTitle("#eta");
1226 fhGenElePhi->SetXTitle("#phi (rad)");
1227 outputContainer->Add(fhGenElePt);
1228 outputContainer->Add(fhGenEleEta);
1229 outputContainer->Add(fhGenElePhi);
1230
1231 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1232 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1233 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
1234 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
1235
1236 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1237 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1238 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
1239 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
1240
1241 fhGenGamAccE ->SetXTitle("E (GeV)");
1242 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
1243 fhGenGamAccEta->SetXTitle("#eta");
1244 fhGenGamAccPhi->SetXTitle("#phi (rad)");
1245 outputContainer->Add(fhGenGamAccE);
1246 outputContainer->Add(fhGenGamAccPt);
1247 outputContainer->Add(fhGenGamAccEta);
1248 outputContainer->Add(fhGenGamAccPhi);
1249
1250 fhGenPi0AccE ->SetXTitle("E (GeV)");
1251 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
1252 fhGenPi0AccEta->SetXTitle("#eta");
1253 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
1254 outputContainer->Add(fhGenPi0AccE);
1255 outputContainer->Add(fhGenPi0AccPt);
1256 outputContainer->Add(fhGenPi0AccEta);
1257 outputContainer->Add(fhGenPi0AccPhi);
1258
a6f26052 1259 //Track Matching
2302a644 1260
1261 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1262 fhMCEle1pOverE->SetYTitle("p/E");
1263 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1264 outputContainer->Add(fhMCEle1pOverE);
1265
1266 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
1267 fhMCEle1dR->SetXTitle("#Delta R (rad)");
1268 outputContainer->Add(fhMCEle1dR) ;
1269
1270 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1271 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1272 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1273 outputContainer->Add(fhMCEle2MatchdEdx);
1274
1275 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1276 fhMCChHad1pOverE->SetYTitle("p/E");
1277 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1278 outputContainer->Add(fhMCChHad1pOverE);
1279
1280 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1281 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1282 outputContainer->Add(fhMCChHad1dR) ;
1283
1284 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1285 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1286 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1287 outputContainer->Add(fhMCChHad2MatchdEdx);
1288
1289 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1290 fhMCNeutral1pOverE->SetYTitle("p/E");
1291 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1292 outputContainer->Add(fhMCNeutral1pOverE);
1293
1294 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1295 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1296 outputContainer->Add(fhMCNeutral1dR) ;
1297
1298 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1299 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1300 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1301 outputContainer->Add(fhMCNeutral2MatchdEdx);
1302
1303 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1304 fhMCEle1pOverER02->SetYTitle("p/E");
1305 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1306 outputContainer->Add(fhMCEle1pOverER02);
1307
1308 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1309 fhMCChHad1pOverER02->SetYTitle("p/E");
1310 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1311 outputContainer->Add(fhMCChHad1pOverER02);
1312
1313 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1314 fhMCNeutral1pOverER02->SetYTitle("p/E");
1315 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1316 outputContainer->Add(fhMCNeutral1pOverER02);
1317 }
c8fe2783 1318
521636d2 1319 // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
1320 // printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
17d63906 1321
2302a644 1322 return outputContainer;
9725fd2a 1323}
1324
a6f26052 1325//_______________________________________________________________________________________________________________________________________
3a75604b 1326Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
1327{
a6f26052 1328 //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
521636d2 1329
3a75604b 1330 Float_t oldbinsize = histo->GetBinWidth(0);
1331 Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
521636d2 1332
a6f26052 1333 //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
3a75604b 1334 if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
1335 else return 1;
521636d2 1336
3a75604b 1337}
a5fafd85 1338
a6f26052 1339//__________________________________________________
9725fd2a 1340void AliAnaCalorimeterQA::Init()
1341{
a6f26052 1342 //Check if the data or settings are ok
2302a644 1343
ad30b142 1344 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL")
1345 AliFatal(Form("Wrong calorimeter name <%s>", fCalorimeter.Data()));
521636d2 1346
ad30b142 1347 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC)
1348 AliFatal("Analysis of reconstructed data, MC reader not aplicable");
2302a644 1349
9725fd2a 1350}
1351
1352
a6f26052 1353//__________________________________________________
9725fd2a 1354void AliAnaCalorimeterQA::InitParameters()
1355{
a6f26052 1356 //Initialize the parameters of the analysis.
9725fd2a 1357 AddToHistogramsName("AnaCaloQA_");
c8fe2783 1358
521636d2 1359 fCalorimeter = "EMCAL"; //or PHOS
1360 fStyleMacro = "" ;
1361 fNModules = 12; // set maximum to maximum number of EMCAL modules
1362 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
1363 fTimeCutMin = -1;
1364 fTimeCutMax = 9999999;
2302a644 1365 fEMCALCellAmpMin = 0.0;
1366 fPHOSCellAmpMin = 0.0;
521636d2 1367
9725fd2a 1368}
1369
a6f26052 1370//__________________________________________________________________
9725fd2a 1371void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1372{
a6f26052 1373 //Print some relevant parameters set for the analysis
9725fd2a 1374 if(! opt)
1375 return;
1376
1377 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1378 AliAnaPartCorrBaseClass::Print(" ");
c8fe2783 1379
9725fd2a 1380 printf("Select Calorimeter %s \n",fCalorimeter.Data());
63f1dd86 1381 printf("Plots style macro %s \n",fStyleMacro.Data());
4cf55759 1382 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2302a644 1383 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
1384 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
521636d2 1385
9725fd2a 1386}
1387
a6f26052 1388//__________________________________________________________________
9725fd2a 1389void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1390{
a6f26052 1391 //Fill Calorimeter QA histograms
2302a644 1392 TLorentzVector mom ;
1393 TLorentzVector mom2 ;
1394 TObjArray * caloClusters = NULL;
1395 Int_t nLabel = 0;
1396 Int_t *labels=0x0;
1397 Int_t nCaloClusters = 0;
1398 Int_t nCaloClustersAccepted = 0;
1399 Int_t nCaloCellsPerCluster = 0;
1400 Int_t nTracksMatched = 0;
1401 Int_t trackIndex = 0;
1402 Int_t nModule = -1;
c8fe2783 1403
5025c139 1404 //Get vertex for photon momentum calculation and event selection
1405 Double_t v[3] = {0,0,0}; //vertex ;
1406 GetReader()->GetVertex(v);
1407 if (TMath::Abs(v[2]) > GetZvertexCut()) return ;
1408
a6f26052 1409 //Play with the MC stack if available
1410 //Get the MC arrays and do some checks
2302a644 1411 if(IsDataMC()){
1412 if(GetReader()->ReadStack()){
c8fe2783 1413
ad30b142 1414 if(!GetMCStack())
1415 AliFatal("Stack not available, is the MC handler called?\n");
521636d2 1416
a6f26052 1417 //Fill some pure MC histograms, only primaries.
2302a644 1418 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
5025c139 1419 TParticle *primary = GetMCStack()->Particle(i) ;
a6f26052 1420 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
5025c139 1421 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1422 primary->Momentum(mom);
1423 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
2302a644 1424 } //primary loop
1425 }
1426 else if(GetReader()->ReadAODMCParticles()){
c8fe2783 1427
ad30b142 1428 if(!GetReader()->GetAODMCParticles(0))
1429 AliFatal("AODMCParticles not available!");
1430
a6f26052 1431 //Fill some pure MC histograms, only primaries.
2302a644 1432 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
5025c139 1433 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
a6f26052 1434 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1435 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1436 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
5025c139 1437 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
a6f26052 1438 //aodprimary->Momentum(mom);
5025c139 1439 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1440 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
2302a644 1441 } //primary loop
1442
1443 }
1444 }// is data and MC
1445
1446
a6f26052 1447 //Get List with CaloClusters
be518ab0 1448 if (fCalorimeter == "PHOS") caloClusters = GetPHOSClusters();
1449 else if (fCalorimeter == "EMCAL") caloClusters = GetEMCALClusters();
f8006433 1450 else
1451 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
17708df9 1452
be518ab0 1453 // if (fCalorimeter == "EMCAL") GetReader()->GetInputEvent()->GetEMCALClusters(caloClusters);//GetEMCALClusters();
1454 // else if(fCalorimeter == "PHOS") GetReader()->GetInputEvent()->GetPHOSClusters (caloClusters);//GetPHOSClusters();
f8006433 1455 // else
1456 // AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
2302a644 1457
1458 if(!caloClusters) {
1459 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n"));
1460 }
f8006433 1461 else{
1462 //----------------------------------------------------------
798a9b04 1463 //Correlate Calorimeters and V0 and track Multiplicity
f8006433 1464 //----------------------------------------------------------
798a9b04 1465 if(fCorrelate) Correlate();
f8006433 1466
f8006433 1467 //----------------------------------------------------------
1468 // CALOCLUSTERS
1469 //----------------------------------------------------------
1470
1471 nCaloClusters = caloClusters->GetEntriesFast() ;
f8006433 1472 Int_t *nClustersInModule = new Int_t[fNModules];
1473 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1474
1475 if(GetDebug() > 0)
1476 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1477
f8006433 1478 AliVTrack * track = 0x0;
f8006433 1479 Float_t pos[3] ;
f8006433 1480 Double_t tof = 0;
1481 //Loop over CaloClusters
1482 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1483 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
c8fe2783 1484
f8006433 1485 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1486 iclus+1,nCaloClusters,GetReader()->GetDataType());
c8fe2783 1487
9cde6de9 1488 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
1489 AliVCaloCells * cell = 0x0;
1490 if(fCalorimeter == "PHOS") cell = GetPHOSCells();
1491 else cell = GetEMCALCells();
1492
1493 //Get cluster kinematics
1494 clus->GetPosition(pos);
1495 clus->GetMomentum(mom,v);
1496 tof = clus->GetTOF()*1e9;
1497 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1498
1499 //Check only certain regions
1500 Bool_t in = kTRUE;
1501 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1502 if(!in) continue;
1503
9cde6de9 1504 //MC labels
1505 nLabel = clus->GetNLabels();
1506 labels = clus->GetLabels();
1507
1508 //Cells per cluster
715fd81f 1509 nCaloCellsPerCluster = clus->GetNCells();
9cde6de9 1510 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1511
1512 //matched cluster with tracks
1513 nTracksMatched = clus->GetNTracksMatched();
ff5cc919 1514 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1515 trackIndex = clus->GetTrackMatchedIndex();
1516 if(trackIndex >= 0){
1517 track = (AliVTrack*)GetReader()->GetInputEvent()->GetTrack(trackIndex);
1518 }
1519 else{
1520 if(nTracksMatched == 1) nTracksMatched = 0;
1521 track = 0;
1522 }
1523 }//kESD
1524 else{//AODs
1525 if(nTracksMatched > 0) track = (AliVTrack*)clus->GetTrackMatched(0);
9cde6de9 1526 }
1527
9cde6de9 1528 //======================
1529 //Cells in cluster
1530 //======================
1531
1532 //Get list of contributors
1533 UShort_t * indexList = clus->GetCellsAbsId() ;
1534 // check time of cells respect to max energy cell
1535 //Get maximum energy cell
1536 Float_t emax = -1;
1537 Double_t tmax = -1;
1538 Int_t imax = -1;
1539 Int_t absId = -1 ;
1540 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1541 //Loop on cluster cells
1542 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1543 // printf("Index %d\n",ipos);
1544 absId = indexList[ipos];
c8fe2783 1545
9cde6de9 1546 //Get position of cell compare to cluster
1547 if(fFillAllPosHisto){
1548 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1549
1550 Double_t cellpos[] = {0, 0, 0};
1551 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1552
1553 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1554 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1555 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1556
1557 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1558 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1559 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1560
1561 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1562 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1563 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1564 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1565
1566 // Float_t celleta = 0, cellphi = 0;
1567 // GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi);
1568 // Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
1569 // GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1570 // GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1571 // iIphi, iIeta,iphi,ieta);
1572 // printf("AbsId %d, SM %d, Index eta %d, phi %d\n", absId, imod, ieta, iphi);
1573 // printf("Cluster E %f, eta %f, phi %f; Cell: Amp %f, eta %f, phi%f\n", mom.E(),mom.Eta(), mom.Phi()*TMath::RadToDeg(), cell->GetCellAmplitude(absId),celleta, cellphi*TMath::RadToDeg());
1574 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1575 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1576 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1577 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1578 //
1579
1580 }//EMCAL and its matrices are available
1581 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1582 TVector3 xyz;
1583 Int_t relId[4], module;
1584 Float_t xCell, zCell;
1585
1586 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1587 module = relId[0];
1588 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1589 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1590
1591 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1592 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1593 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1594
1595 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1596 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1597 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1598
1599 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1600 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1601 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1602 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1603
1604 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1605 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1606 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1607 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1608 }//PHOS and its matrices are available
1609 }//Fill all position histograms
c8fe2783 1610
9cde6de9 1611 //Find maximum energy cluster
1612 if(cell->GetCellAmplitude(absId) > emax) {
1613 imax = ipos;
1614 emax = cell->GetCellAmplitude(absId);
e1e62b89 1615 tmax = cell->GetCellTime(absId)*1e9;
9cde6de9 1616 }
c8fe2783 1617
9cde6de9 1618 }// cluster cell loop
3129a79e 1619
715fd81f 1620 if (clus->E() < 2.){
1621 fhLambda0vsClusterMaxCellDiffE0->Fill(clus->GetM02(), (clus->E()-emax)/clus->E());
1622 fhNCellsvsClusterMaxCellDiffE0 ->Fill(nCaloCellsPerCluster,(clus->E()-emax)/clus->E());
1623 }
1624 else if(clus->E() < 6.){
1625 fhLambda0vsClusterMaxCellDiffE2->Fill(clus->GetM02(), (clus->E()-emax)/clus->E());
1626 fhNCellsvsClusterMaxCellDiffE2 ->Fill(nCaloCellsPerCluster,(clus->E()-emax)/clus->E());
1627 }
1628 else{
1629 fhLambda0vsClusterMaxCellDiffE6->Fill(clus->GetM02(), (clus->E()-emax)/clus->E());
1630 fhNCellsvsClusterMaxCellDiffE6 ->Fill(nCaloCellsPerCluster,(clus->E()-emax)/clus->E());
1631 }
1632
1633 fhNCellsPerClusterNoCut ->Fill(clus->E(), nCaloCellsPerCluster);
1634 nModule = GetModuleNumber(clus);
1635 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterModNoCut[nModule]->Fill(clus->E(), nCaloCellsPerCluster);
1636
1637 fhClusterMaxCellDiffNoCut->Fill(clus->E(),(clus->E()-emax)/clus->E());
1638 //fhClusterMaxCellDiffDivLambda0->Fill(clus->E(),(clus->E()-emax)/clus->E() / clus->GetNCells());
1639
3129a79e 1640 //Check bad clusters if rejection was not on
1641 Bool_t badCluster = kFALSE;
1642 if(fCalorimeter=="EMCAL" && !GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster()){
1643 //Bad clusters histograms
715fd81f 1644 //Float_t minNCells = TMath::Max(1,TMath::Nint(1 + TMath::Log(clus->E() - 5 )*1.5 ));
1645 //if(nCaloCellsPerCluster <= minNCells) {
1646 if(clus->GetM02() < 0.05) {
1647
e1e62b89 1648 //if(clus->GetM02() > 0 || TMath::Abs(clus->GetM20()) > 0 || clus->GetDispersion() > 0)
1649
1650 Int_t sm =0; Int_t ietaa=-1; Int_t iphii = 0; Int_t rcu = 0;
1651 sm = GetModuleNumberCellIndexes(absId,fCalorimeter, ietaa, iphii, rcu);
1652// if(clus->GetNCells() > 3){
1653// printf("Bad : E %f, ncells %d, nclusters %d, dist to bad %f, l0 %f, l1 %f, d %f, cell max t %f, cluster TOF %f, sm %d, icol %d, irow %d, rcu %d\n",
1654// clus->E(), clus->GetNCells(),nCaloClusters, clus->GetDistanceToBadChannel(),
1655// clus->GetM02(), clus->GetM20(), clus->GetDispersion(),tmax, tof,sm,ietaa,iphii,rcu);
1656// }
1657
3129a79e 1658 badCluster = kTRUE;
e1e62b89 1659
1660 fhBadClusterEnergy ->Fill(clus->E());
1661 fhBadClusterMaxCellDiff->Fill(clus->E(),(clus->E()-emax)/clus->E());
1662 fhBadClusterTimeEnergy ->Fill(clus->E(),tof);
3129a79e 1663 //printf("bad tof : %2.3f\n",tof);
e1e62b89 1664 //if(clus->E() - emax < 0)printf("What?\n");
1665
1666 //Clusters in event time difference
1667
1668 for(Int_t iclus2 = 0; iclus2 < nCaloClusters; iclus2++ ){
1669
1670 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(iclus2);
1671
1672 if(clus->GetID()==clus2->GetID()) continue;
1673
1674 if(clus->GetM02() > 0.01) {
1675 fhBadClusterPairDiffTimeE ->Fill(clus->E(), tof-clus2->GetTOF()*1.e9);
1676// if(clus->GetNCells()>3) printf("\t i %d, E %f, nCells %d, dist to bad %f, good tof %f, bad tof %f, diff %f \n",
1677// iclus2, clus2->E(), clus2->GetNCells(), clus->GetDistanceToBadChannel(), tof,clus2->GetTOF()*1.e9,tof-clus2->GetTOF()*1.e9);
1678 }
1679// else{
1680// Int_t absId2 = clus2->GetCellsAbsId()[0];
1681// Int_t sm2 =0; Int_t ietaa2=-1; Int_t iphii2 = 0; Int_t rcu2 = 0;
1682// sm2 = GetModuleNumberCellIndexes(absId2,fCalorimeter, ietaa2, iphii2, rcu2);
1683// if(clus->GetNCells()>3) printf("i %d, E %f, nCells %d, bad tof %f, bad tof %f, diff %f, sm %d, icol %d, irow %d, rcu %d\n",
1684// iclus2, clus2->E(), clus2->GetNCells(), tof,clus2->GetTOF()*1.e9,tof-clus2->GetTOF()*1.e9,sm2,ietaa2,iphii2,rcu2);
1685//
1686// }
1687
1688 }
1689
3129a79e 1690
1691 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1692 // printf("Index %d\n",ipos);
1693 if(ipos!=imax){
1694 absId = indexList[ipos];
1695 Float_t frac = cell->GetCellAmplitude(absId)/emax;
1696 //printf("bad frac : %2.3f, e %2.2f, ncells %d, min %2.1f\n",frac,mom.E(),nCaloCellsPerCluster,minNCells);
1697 fhBadClusterMaxCellCloseCellRatio->Fill(mom.E(),frac);
1698 }
a95eac90 1699 }
3129a79e 1700 }//Bad cluster
1701 }
1702
1703 if(!badCluster){
e1e62b89 1704
1705 // if(TMath::Abs(clus->GetM20()) < 0.0001 && clus->GetNCells() > 3){
1706 // Int_t sm =0; Int_t ietaa=-1; Int_t iphii = 0; Int_t rcu = 0;
1707 // sm = GetModuleNumberCellIndexes(absId,fCalorimeter, ietaa, iphii, rcu);
1708 // printf("Good : E %f, mcells %d, l0 %f, l1 %f, d %f, cell max t %f, cluster TOF %f, sm %d, icol %d, irow %d \n",
1709 // clus->E(), clus->GetNCells(),clus->GetM02(), clus->GetM20(), clus->GetDispersion(),tmax, tof,sm,ietaa,iphii);
1710 //
1711 // }
1712
1713 fhClusterMaxCellDiff->Fill(clus->E(),(clus->E()-emax)/clus->E());
1714 fhClusterTimeEnergy ->Fill(mom.E(),tof);
1715
1716 //Clusters in event time difference
1717 for(Int_t iclus2 = 0; iclus2 < nCaloClusters; iclus2++ ){
1718
1719 AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
1720
1721 if(clus->GetID()==clus2->GetID()) continue;
1722
1723 if(clus->GetM02() > 0.01) {
1724 fhClusterPairDiffTimeE ->Fill(clus->E(), tof-clus2->GetTOF()*1.e9);
1725 }
1726 }
1727
a95eac90 1728 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1729 // printf("Index %d\n",ipos);
1730 if(ipos!=imax){
1731 absId = indexList[ipos];
1732 Float_t frac = cell->GetCellAmplitude(absId)/emax;
1733 //printf("good frac : %2.3f\n",frac);
1734 fhClusterMaxCellCloseCellRatio->Fill(mom.E(),frac);
1735 }
1736 }
f8006433 1737
e1e62b89 1738 // check time of cells respect to max energy cell
1739 if(nCaloCellsPerCluster > 1 && GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1740 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1741 if(imax == ipos) continue;
1742 absId = indexList[ipos];
1743 Float_t diff = (tmax-cell->GetCellTime(absId))*1e9;
1744 fhCellTimeSpreadRespectToCellMax->Fill(diff);
1745 if(TMath::Abs(TMath::Abs(diff) > 100)) fhCellIdCellLargeTimeSpread->Fill(absId);
1746 }// fill cell-cluster histogram loop
1747 }//check time of cells respect to max energy cell
f8006433 1748
e1e62b89 1749
1750 //Get module of cluster
1751 nCaloClustersAccepted++;
e1e62b89 1752 if(nModule >=0 && nModule < fNModules) nClustersInModule[nModule]++;
1753
1754 //-----------------------------------------------------------
1755 //Fill histograms related to single cluster or track matching
1756 //-----------------------------------------------------------
1757 ClusterHistograms(mom, pos, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1758
1759
1760 //-----------------------------------------------------------
1761 //Invariant mass
1762 //-----------------------------------------------------------
1763 if(fFillAllPi0Histo){
1764 if(GetDebug()>1) printf("Invariant mass \n");
55c05f8c 1765
e1e62b89 1766 //do not do for bad vertex
1767 // Float_t fZvtxCut = 40. ;
1768 if(v[2]<-GetZvertexCut() || v[2]> GetZvertexCut()) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
55c05f8c 1769
e1e62b89 1770 Int_t nModule2 = -1;
1771 Int_t nCaloCellsPerCluster2=0;
1772 if (nCaloClusters > 1 ) {
1773 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1774 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
1775
1776 //Get cluster kinematics
1777 clus2->GetMomentum(mom2,v);
1778 //Check only certain regions
1779 Bool_t in2 = kTRUE;
1780 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1781 if(!in2) continue;
1782 //Get module of cluster
1783 nModule2 = GetModuleNumber(clus2);
1784 //Cells per cluster
1785 nCaloCellsPerCluster2 = clus2->GetNCells();
1786 }
1787 //Fill invariant mass histograms
55c05f8c 1788 //All modules
e1e62b89 1789
1790 //printf("QA : Fill inv mass histo: pt1 %f, pt2 %f, pt12 %f, mass %f, calo %s \n",mom.Pt(),mom2.Pt(),(mom+mom2).Pt(),(mom+mom2).M(), fCalorimeter.Data());
1791 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1792 //Single module
55c05f8c 1793 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
e1e62b89 1794 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1795
1796 //Select only clusters with at least 2 cells
1797 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1798 //All modules
1799 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1800 //Single modules
1801 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1802 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1803 }
1804
1805 //Asymetry histograms
1806 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1807
1808 }// 2nd cluster loop
1809 }//Fill Pi0
1810
1811 }//good cluster
1812
1813 }//cluster loop
1814
2302a644 1815 //Number of clusters histograms
1816 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
1817 // Number of clusters per module
f8006433 1818 for(Int_t imod = 0; imod < fNModules; imod++ ){
1819 if(GetDebug() > 1)
1820 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1821 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1822 }
1823 delete [] nClustersInModule;
1824 //delete caloClusters;
1825 }// calo clusters array exists
c8fe2783 1826
a6f26052 1827 //----------------------------------------------------------
1828 // CALOCELLS
1829 //----------------------------------------------------------
521636d2 1830
c8fe2783 1831 AliVCaloCells * cell = 0x0;
1832 Int_t ncells = 0;
1833 if(fCalorimeter == "PHOS")
17708df9 1834 cell = GetPHOSCells();
c8fe2783 1835 else
17708df9 1836 cell = GetEMCALCells();
c8fe2783 1837
cb552579 1838 if(!cell){
ad30b142 1839 AliFatal(Form("No %s CELLS available for analysis",fCalorimeter.Data()));
cb552579 1840 return; // just to trick coverity
1841 }
c8fe2783 1842
c8fe2783 1843 if(GetDebug() > 0)
ff5cc919 1844 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - %s cell entries %d\n", fCalorimeter.Data(), cell->GetNumberOfCells());
c8fe2783 1845
227fca45 1846 //Init arrays and used variables
1847 Int_t *nCellsInModule = new Int_t[fNModules];
1848 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1849 Int_t icol = -1;
1850 Int_t irow = -1;
1851 Int_t iRCU = -1;
1852 Float_t amp = 0.;
1853 Float_t time = 0.;
1854 Int_t id = -1;
1855 Float_t recalF = 1.;
1856
2302a644 1857 for (Int_t iCell = 0; iCell < cell->GetNumberOfCells(); iCell++) {
ff5cc919 1858 if(GetDebug() > 2)
1859 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
c8fe2783 1860 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
ff5cc919 1861 if(GetDebug() > 2)
1862 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
c8fe2783 1863
1864 if(nModule < fNModules) {
adec52a2 1865
a6f26052 1866 //Check if the cell is a bad channel
c8fe2783 1867 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1868 if(fCalorimeter=="EMCAL"){
1869 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1870 }
1871 else {
1872 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
1873 printf("PHOS bad channel\n");
1874 continue;
1875 }
1876 }
adec52a2 1877 } // use bad channel map
521636d2 1878
a6f26052 1879 //Get Recalibration factor if set
c8fe2783 1880 if (GetCaloUtils()->IsRecalibrationOn()) {
1881 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
17708df9 1882 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
2302a644 1883 //if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
c8fe2783 1884 }
1885
1886 amp = cell->GetAmplitude(iCell)*recalF;
1887 time = cell->GetTime(iCell)*1e9;//transform time to ns
1888
ff5cc919 1889 //Remove noisy channels, only possible in ESDs
1890 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1891 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1892 }
a6f26052 1893 //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
1894 // amp,time,nModule,icol,irow);
c8fe2783 1895
c8fe2783 1896 id = cell->GetCellNumber(iCell);
1897 fhAmplitude->Fill(amp);
1898 fhAmpId ->Fill(amp,id);
c8fe2783 1899
1900 fhAmplitudeMod[nModule]->Fill(amp);
1901 if(fCalorimeter=="EMCAL"){
1902 Int_t ifrac = 0;
1903 if(icol > 15 && icol < 32) ifrac = 1;
1904 else if(icol > 31) ifrac = 2;
1905 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
c8fe2783 1906 }
1907
c8fe2783 1908 nCellsInModule[nModule]++;
1909 fhGridCellsMod[nModule] ->Fill(icol,irow);
1910 fhGridCellsEMod[nModule] ->Fill(icol,irow,amp);
ff5cc919 1911
1912 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1913 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1914 fhTime ->Fill(time);
1915 fhTimeId ->Fill(time,id);
1916 fhTimeAmp ->Fill(amp,time);
c8fe2783 1917
ff5cc919 1918 //Double_t t0 = GetReader()->GetInputEvent()->GetT0();
1919 //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0,
1920 // GetReader()->GetInputEvent()->GetT0zVertex(),
1921 // GetReader()->GetInputEvent()->GetT0clock(),
1922 // GetReader()->GetInputEvent()->GetT0Trig());
1923 //fhT0Time ->Fill(time-t0);
1924 //fhT0TimeId ->Fill(time-t0,id);
1925 //fhT0TimeAmp ->Fill(amp,time-t0);
1926
1927 //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
1928 //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
1929
1930 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
1931
1932 if(amp > 0.3){
1933 fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
1934
1935 // AliESDCaloCells * cell2 = 0x0;
1936 // if(fCalorimeter == "PHOS") cell2 = GetReader()->GetInputEvent()->GetPHOSCells();
1937 // else cell2 = GetReader()->GetInputEvent()->GetEMCALCells();
1938 // Int_t icol2 = -1;
1939 // Int_t irow2 = -1;
1940 // Int_t iRCU2 = -1;
1941 // Float_t amp2 = 0.;
1942 // Float_t time2 = 0.;
1943 // Int_t id2 = -1;
1944 // Int_t nModule2 = -1;
1945 // for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {
1946 // amp2 = cell2->GetAmplitude(iCell2);
1947 // if(amp2 < 0.3) continue;
1948 // if(iCell2 == iCell) continue;
1949 // time2 = cell2->GetTime(iCell2)*1e9;//transform time to ns
1950 // //printf("%s: time %g\n",fCalorimeter.Data(), time);
1951 // id2 = cell2->GetCellNumber(iCell2);
1952 // nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
1953 // Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule);
1954 // //printf("id %d, nModule %d, iRCU %d, id2 %d, nModule2 %d, iRCU2 %d, index %d: Histo Name %s\n",id, nModule,iRCU,cell2->GetCellNumber(iCell2),nModule2,iRCU2,index, fhTimeCorrRCU[index]->GetName());
1955 // fhTimeCorrRCU[index]->Fill(time,time2);
1956 //
1957 // }// second cell loop
1958
1959 }// amplitude cut
1960 }
521636d2 1961
1962
1963 //Get Eta-Phi position of Cell
1964 if(fFillAllPosHisto)
1965 {
1966 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1967 Float_t celleta = 0.;
1968 Float_t cellphi = 0.;
1969 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1970
1971 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1972 Double_t cellpos[] = {0, 0, 0};
1973 GetEMCALGeometry()->GetGlobal(id, cellpos);
1974 fhXCellE->Fill(cellpos[0],amp) ;
1975 fhYCellE->Fill(cellpos[1],amp) ;
1976 fhZCellE->Fill(cellpos[2],amp) ;
1977 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1978 fhRCellE->Fill(rcell,amp) ;
1979 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1980 }//EMCAL Cells
1981 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1982 TVector3 xyz;
1983 Int_t relId[4], module;
1984 Float_t xCell, zCell;
1985
1986 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
1987 module = relId[0];
1988 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1989 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1990 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
1991 fhXCellE ->Fill(xyz.X(),amp) ;
1992 fhYCellE ->Fill(xyz.Y(),amp) ;
1993 fhZCellE ->Fill(xyz.Z(),amp) ;
1994 fhRCellE ->Fill(rcell ,amp) ;
1995 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
1996 }//PHOS cells
1997 }//fill cell position histograms
1998
1999 if (fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ncells ++ ;
2000 else if(fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin) ncells ++ ;
2001 //else
2002 // printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - no %s CELLS passed the analysis cut\n",fCalorimeter.Data());
ff5cc919 2003 }//nmodules
c8fe2783 2004 }//cell loop
2302a644 2005 if(ncells > 0 )fhNCells->Fill(ncells) ; //fill the cells after the cut
c8fe2783 2006
a6f26052 2007 //Number of cells per module
521636d2 2008 for(Int_t imod = 0; imod < fNModules; imod++ ) {
2009 if(GetDebug() > 1)
2010 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
2011 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
2012 }
2013 delete [] nCellsInModule;
2014
2015 if(GetDebug() > 0)
2016 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
902aa95c 2017}
2018
a0bb4dc0 2019
17708df9 2020//_____________________________________________________________________________________________
e1e62b89 2021void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom,
521636d2 2022 Float_t *pos, const Int_t nCaloCellsPerCluster,const Int_t nModule,
c8fe2783 2023 const Int_t nTracksMatched, const AliVTrack * track,
2024 const Int_t * labels, const Int_t nLabels){
a6f26052 2025 //Fill CaloCluster related histograms
9725fd2a 2026
2302a644 2027 AliAODMCParticle * aodprimary = 0x0;
2028 TParticle * primary = 0x0;
c8fe2783 2029 Int_t tag = 0;
2302a644 2030
2031 Float_t e = mom.E();
2032 Float_t pt = mom.Pt();
2033 Float_t eta = mom.Eta();
2034 Float_t phi = mom.Phi();
2035 if(phi < 0) phi +=TMath::TwoPi();
2036 if(GetDebug() > 0) {
2037 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
2038 if(IsDataMC()) {
a6f26052 2039 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
2302a644 2040 printf("\t Primaries: nlabels %d\n",nLabels);
2041 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
2042 }
2043 }
c8fe2783 2044
2302a644 2045 fhE ->Fill(e);
2046 if(nModule >=0 && nModule < fNModules) fhEMod[nModule]->Fill(e);
a6f26052 2047 if(fFillAllTH12){
2048 fhPt ->Fill(pt);
2049 fhPhi ->Fill(phi);
2050 fhEta ->Fill(eta);
2051 }
3748ffb5 2052
2053 fhEtaPhiE->Fill(eta,phi,e);
a6f26052 2054
2055 //Cells per cluster
3f5990d6 2056 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster);
715fd81f 2057 if((fCalorimeter=="EMCAL" && GetReader()->GetEMCALPtMin() < 0.3) ||
2058 (fCalorimeter=="PHOS" && GetReader()->GetPHOSPtMin() < 0.3)) fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster);
a6f26052 2059
2060 //Position
55c05f8c 2061 if(fFillAllPosHisto2){
2062 fhXE ->Fill(pos[0],e);
2063 fhYE ->Fill(pos[1],e);
2064 fhZE ->Fill(pos[2],e);
2065 if(fFillAllTH3)
2066 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
2067
2068 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
2069 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
2070 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
2071 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
2072 fhRE ->Fill(rxyz,e);
2073 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
2074 }
2302a644 2075
2076 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
c8fe2783 2077
a6f26052 2078 //Fill histograms only possible when simulation
2302a644 2079 if(IsDataMC() && nLabels > 0 && labels){
c8fe2783 2080
a6f26052 2081 //Play with the MC stack if available
2302a644 2082 Int_t label = labels[0];
c8fe2783 2083
2302a644 2084 if(label < 0) {
2085 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
2086 return;
2087 }
2088
2089 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
2090 Float_t vxMC= 0; Float_t vyMC = 0;
2091 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
2092 Int_t charge = 0;
c8fe2783 2093
a6f26052 2094 //Check the origin.
2302a644 2095 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
c8fe2783 2096
2302a644 2097 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
c8fe2783 2098
2302a644 2099 if( label >= GetMCStack()->GetNtrack()) {
5025c139 2100 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
2101 return ;
2302a644 2102 }
2103
2104 primary = GetMCStack()->Particle(label);
2105 iMother = label;
2106 pdg0 = TMath::Abs(primary->GetPdgCode());
2107 pdg = pdg0;
2108 status = primary->GetStatusCode();
2109 vxMC = primary->Vx();
2110 vyMC = primary->Vy();
2111 iParent = primary->GetFirstMother();
c8fe2783 2112
2302a644 2113 if(GetDebug() > 1 ) {
5025c139 2114 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2115 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
2302a644 2116 }
c8fe2783 2117
a6f26052 2118 //Get final particle, no conversion products
2302a644 2119 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
a6f26052 2120 //Get the parent
5025c139 2121 primary = GetMCStack()->Particle(iParent);
2122 pdg = TMath::Abs(primary->GetPdgCode());
2123 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2124 while((pdg == 22 || pdg == 11) && status != 1){
2125 iMother = iParent;
2126 primary = GetMCStack()->Particle(iMother);
2127 status = primary->GetStatusCode();
2128 iParent = primary->GetFirstMother();
2129 pdg = TMath::Abs(primary->GetPdgCode());
2130 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
2131 }
c8fe2783 2132
5025c139 2133 if(GetDebug() > 1 ) {
2134 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2135 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
2136 }
c8fe2783 2137
2302a644 2138 }
c8fe2783 2139
a6f26052 2140 //Overlapped pi0 (or eta, there will be very few), get the meson
2302a644 2141 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 2142 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
5025c139 2143 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
2144 while(pdg != 111 && pdg != 221){
2145 iMother = iParent;
2146 primary = GetMCStack()->Particle(iMother);
2147 status = primary->GetStatusCode();
2148 iParent = primary->GetFirstMother();
2149 pdg = TMath::Abs(primary->GetPdgCode());
2150 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
2151 if(iMother==-1) {
2152 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
a6f26052 2153 //break;
5025c139 2154 }
2155 }
c8fe2783 2156
5025c139 2157 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
a6f26052 2158 primary->GetName(),iMother);
2302a644 2159 }
c8fe2783 2160
2302a644 2161 eMC = primary->Energy();
2162 ptMC = primary->Pt();
2163 phiMC = primary->Phi();
2164 etaMC = primary->Eta();
2165 pdg = TMath::Abs(primary->GetPdgCode());
2166 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
c8fe2783 2167
2302a644 2168 }
2169 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
a6f26052 2170 //Get the list of MC particles
ad30b142 2171 if(!GetReader()->GetAODMCParticles(0))
2172 AliFatal("MCParticles not available!");
c8fe2783 2173
2302a644 2174 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
2175 iMother = label;
2176 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
2177 pdg = pdg0;
2178 status = aodprimary->IsPrimary();
2179 vxMC = aodprimary->Xv();
2180 vyMC = aodprimary->Yv();
2181 iParent = aodprimary->GetMother();
2182
2183 if(GetDebug() > 1 ) {
5025c139 2184 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2185 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
a6f26052 2186 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
2302a644 2187 }
2188
a6f26052 2189 //Get final particle, no conversion products
2302a644 2190 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
5025c139 2191 if(GetDebug() > 1 )
2192 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
a6f26052 2193 //Get the parent
5025c139 2194 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
2195 pdg = TMath::Abs(aodprimary->GetPdgCode());
2196 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
2197 iMother = iParent;
2198 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2199 status = aodprimary->IsPrimary();
2200 iParent = aodprimary->GetMother();
2201 pdg = TMath::Abs(aodprimary->GetPdgCode());
2202 if(GetDebug() > 1 )
2203 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
a6f26052 2204 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
5025c139 2205 }
2206
2207 if(GetDebug() > 1 ) {
2208 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2209 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
a6f26052 2210 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
5025c139 2211 }
2212
2302a644 2213 }
c8fe2783 2214
a6f26052 2215 //Overlapped pi0 (or eta, there will be very few), get the meson
2302a644 2216 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 2217 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
5025c139 2218 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
2219 while(pdg != 111 && pdg != 221){
c8fe2783 2220
5025c139 2221 iMother = iParent;
2222 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2223 status = aodprimary->IsPrimary();
2224 iParent = aodprimary->GetMother();
2225 pdg = TMath::Abs(aodprimary->GetPdgCode());
2226
2227 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
2228
2229 if(iMother==-1) {
2230 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
a6f26052 2231 //break;
5025c139 2232 }
2233 }
2234
2235 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
a6f26052 2236 aodprimary->GetName(),iMother);
2302a644 2237 }
c8fe2783 2238
2302a644 2239 status = aodprimary->IsPrimary();
2240 eMC = aodprimary->E();
2241 ptMC = aodprimary->Pt();
2242 phiMC = aodprimary->Phi();
2243 etaMC = aodprimary->Eta();
2244 pdg = TMath::Abs(aodprimary->GetPdgCode());
2245 charge = aodprimary->Charge();
c8fe2783 2246
2302a644 2247 }
c8fe2783 2248
a6f26052 2249 //Float_t vz = primary->Vz();
2302a644 2250 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
2251 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
2252 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2253 fhEMR ->Fill(e,rVMC);
2254 }
c8fe2783 2255
a6f26052 2256 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
2257 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
2258 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
c8fe2783 2259
2260
2302a644 2261 fh2E ->Fill(e, eMC);
2262 fh2Pt ->Fill(pt, ptMC);
2263 fh2Phi ->Fill(phi, phiMC);
2264 fh2Eta ->Fill(eta, etaMC);
2265 fhDeltaE ->Fill(eMC-e);
2266 fhDeltaPt ->Fill(ptMC-pt);
2267 fhDeltaPhi->Fill(phiMC-phi);
2268 fhDeltaEta->Fill(etaMC-eta);
2269 if(eMC > 0) fhRatioE ->Fill(e/eMC);
2270 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
2271 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
2272 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
c8fe2783 2273
2274
a6f26052 2275 //Overlapped pi0 (or eta, there will be very few)
2302a644 2276 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 2277 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2278 fhPi0E ->Fill(e,eMC);
2279 fhPi0Pt ->Fill(pt,ptMC);
2280 fhPi0Eta ->Fill(eta,etaMC);
2281 fhPi0Phi ->Fill(phi,phiMC);
2282 if( nTracksMatched > 0){
2283 fhPi0ECharged ->Fill(e,eMC);
2284 fhPi0PtCharged ->Fill(pt,ptMC);
2285 fhPi0PhiCharged ->Fill(phi,phiMC);
2286 fhPi0EtaCharged ->Fill(eta,etaMC);
2287 }
2302a644 2288 }//Overlapped pizero decay
2289 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
c8fe2783 2290 fhGamE ->Fill(e,eMC);
2291 fhGamPt ->Fill(pt,ptMC);
2292 fhGamEta ->Fill(eta,etaMC);
2293 fhGamPhi ->Fill(phi,phiMC);
2294 fhGamDeltaE ->Fill(eMC-e);
2295 fhGamDeltaPt ->Fill(ptMC-pt);
2296 fhGamDeltaPhi->Fill(phiMC-phi);
2297 fhGamDeltaEta->Fill(etaMC-eta);
2298 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
2299 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
2300 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
2301 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
2302 if( nTracksMatched > 0){
2303 fhGamECharged ->Fill(e,eMC);
2304 fhGamPtCharged ->Fill(pt,ptMC);
2305 fhGamPhiCharged ->Fill(phi,phiMC);
2306 fhGamEtaCharged ->Fill(eta,etaMC);
2307 }
2302a644 2308 }//photon
2309 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
2310 fhEleE ->Fill(e,eMC);
2311 fhElePt ->Fill(pt,ptMC);
2312 fhEleEta ->Fill(eta,etaMC);
2313 fhElePhi ->Fill(phi,phiMC);
2314 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2315 fhEMR ->Fill(e,rVMC);
2316 if( nTracksMatched > 0){
5025c139 2317 fhEleECharged ->Fill(e,eMC);
2318 fhElePtCharged ->Fill(pt,ptMC);
2319 fhElePhiCharged ->Fill(phi,phiMC);
2320 fhEleEtaCharged ->Fill(eta,etaMC);
2302a644 2321 }
2322 }
2323 else if(charge == 0){
2324 fhNeHadE ->Fill(e,eMC);
2325 fhNeHadPt ->Fill(pt,ptMC);
2326 fhNeHadEta ->Fill(eta,etaMC);
2327 fhNeHadPhi ->Fill(phi,phiMC);
2328 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2329 fhHaR ->Fill(e,rVMC);
2330 if( nTracksMatched > 0){
5025c139 2331 fhNeHadECharged ->Fill(e,eMC);
2332 fhNeHadPtCharged ->Fill(pt,ptMC);
2333 fhNeHadPhiCharged ->Fill(phi,phiMC);
2334 fhNeHadEtaCharged ->Fill(eta,etaMC);
2302a644 2335 }
2336 }
2337 else if(charge!=0){
2338 fhChHadE ->Fill(e,eMC);
2339 fhChHadPt ->Fill(pt,ptMC);
2340 fhChHadEta ->Fill(eta,etaMC);
2341 fhChHadPhi ->Fill(phi,phiMC);
2342 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2343 fhHaR ->Fill(e,rVMC);
2344 if( nTracksMatched > 0){
5025c139 2345 fhChHadECharged ->Fill(e,eMC);
2346 fhChHadPtCharged ->Fill(pt,ptMC);
2347 fhChHadPhiCharged ->Fill(phi,phiMC);
2348 fhChHadEtaCharged ->Fill(eta,etaMC);
2302a644 2349 }
2350 }
2351 }//Work with MC
c8fe2783 2352
902aa95c 2353
a6f26052 2354 //Match tracks and clusters
2355 //To be Modified in case of AODs
521636d2 2356
55c05f8c 2357 if( nTracksMatched > 0 && fFillAllTMHisto){
2358 if(fFillAllTH12 && fFillAllTMHisto){
a6f26052 2359 fhECharged ->Fill(e);
2360 fhPtCharged ->Fill(pt);
2361 fhPhiCharged ->Fill(phi);
2362 fhEtaCharged ->Fill(eta);
2363 }
2302a644 2364
3f5990d6 2365 if(fFillAllTMHisto){
2366 if(fFillAllTH3)fhEtaPhiECharged->Fill(eta,phi,e);
715fd81f 2367 if((fCalorimeter=="EMCAL" && GetReader()->GetEMCALPtMin() < 0.3) ||
2368 (fCalorimeter=="PHOS" && GetReader()->GetPHOSPtMin() < 0.3)) fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster);
55c05f8c 2369 }
a6f26052 2370 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2371 //Study the track and matched cluster if track exists.
2302a644 2372 if(!track) return;
2373 Double_t emcpos[3] = {0.,0.,0.};
2374 Double_t emcmom[3] = {0.,0.,0.};
2375 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2376 Double_t bfield = 0.;
2377 Double_t tphi = 0;
2378 Double_t teta = 0;
2379 Double_t tmom = 0;
2380 Double_t tpt = 0;
2381 Double_t tmom2 = 0;
2382 Double_t tpcSignal = 0;
2383 Bool_t okpos = kFALSE;
2384 Bool_t okmom = kFALSE;
2385 Bool_t okout = kFALSE;
2386 Int_t nITS = 0;
2387 Int_t nTPC = 0;
2388
a6f26052 2389 //In case of ESDs get the parameters in this way
ff5cc919 2390 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2391 if (track->GetOuterParam() ) {
2392 okout = kTRUE;
2393
2394 bfield = GetReader()->GetInputEvent()->GetMagneticField();
2395 okpos = track->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2396 okmom = track->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2397 if(!(okpos && okmom)) return;
2398
2399 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2400 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2401 tphi = position.Phi();
2402 teta = position.Eta();
2403 tmom = momentum.Mag();
2404
2405 //Double_t tphi = track->GetOuterParam()->Phi();
2406 //Double_t teta = track->GetOuterParam()->Eta();
2407 //Double_t tmom = track->GetOuterParam()->P();
2408 tpt = track->Pt();
2409 tmom2 = track->P();
2410 tpcSignal = track->GetTPCsignal();
2411
2412 nITS = track->GetNcls(0);
2413 nTPC = track->GetNcls(1);
2414 }//Outer param available
2415 }// ESDs
2416 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2417 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2418 if (pid) {
2419 okout = kTRUE;
2420 pid->GetEMCALPosition(emcpos);
2421 pid->GetEMCALMomentum(emcmom);
2422
2423 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2424 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2425 tphi = position.Phi();
2426 teta = position.Eta();
2427 tmom = momentum.Mag();
2428
2429 tpt = track->Pt();
2430 tmom2 = track->P();
2431 tpcSignal = pid->GetTPCsignal();
2432
2433 //nITS = ((AliAODTrack*)track)->GetNcls(0);
2434 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
2435 }//pid
2436 }//AODs
c8fe2783 2437
2438 if(okout){
2439 Double_t deta = teta - eta;
2440 Double_t dphi = tphi - phi;
2441 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2442 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2443 Double_t dR = sqrt(dphi*dphi + deta*deta);
6fa7d352 2444
c8fe2783 2445 Double_t pOverE = tmom/e;
6fa7d352 2446
c8fe2783 2447 fh1pOverE->Fill(tpt, pOverE);
2448 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
6fa7d352 2449
c8fe2783 2450 fh1dR->Fill(dR);
2451 fh2MatchdEdx->Fill(tmom2,tpcSignal);
6fa7d352 2452
c8fe2783 2453 if(IsDataMC() && primary){
2454 Int_t pdg = primary->GetPdgCode();
2455 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
6fa7d352 2456
c8fe2783 2457 if(TMath::Abs(pdg) == 11){
2458 fhMCEle1pOverE->Fill(tpt,pOverE);
2459 fhMCEle1dR->Fill(dR);
2460 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2461 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2462 }
2463 else if(charge!=0){
2464 fhMCChHad1pOverE->Fill(tpt,pOverE);
2465 fhMCChHad1dR->Fill(dR);
2466 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2467 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2468 }
2469 else if(charge == 0){
2470 fhMCNeutral1pOverE->Fill(tpt,pOverE);
2471 fhMCNeutral1dR->Fill(dR);
2472 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2473 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2474 }
2475 }//DataMC
2476
2477 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2478 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2479 fh2EledEdx->Fill(tmom2,tpcSignal);
2480 }
2481 }
2482 else{//no ESD external param or AODPid
a6f26052 2483 // ULong_t status=AliESDtrack::kTPCrefit;
2484 // status|=AliESDtrack::kITSrefit;
2485 //printf("track status %d\n", track->GetStatus() );
2486 // fhEChargedNoOut ->Fill(e);
2487 // fhPtChargedNoOut ->Fill(pt);
2488 // fhPhiChargedNoOut ->Fill(phi);
2489 // fhEtaChargedNoOut ->Fill(eta);
2490 // fhEtaPhiChargedNoOut ->Fill(eta,phi);
2491 // if(GetDebug() >= 0 && ((track->GetStatus() & status) == status)) printf("ITS+TPC\n");
c8fe2783 2492 if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
2493
2494 }//No out params
2302a644 2495 }//matched clusters with tracks
c8fe2783 2496
902aa95c 2497}// Clusters
c8fe2783 2498
17708df9 2499
2500//__________________________________
798a9b04 2501void AliAnaCalorimeterQA::Correlate(){
2502 // Correlate information from PHOS and EMCAL and with V0 and track multiplicity
521636d2 2503
798a9b04 2504 //Clusters
be518ab0 2505 TObjArray * caloClustersEMCAL = GetEMCALClusters();
2506 TObjArray * caloClustersPHOS = GetPHOSClusters();
2302a644 2507
798a9b04 2508 Int_t nclEMCAL = caloClustersEMCAL->GetEntriesFast();
2509 Int_t nclPHOS = caloClustersPHOS ->GetEntriesFast();
c8fe2783 2510
c8fe2783 2511 Float_t sumClusterEnergyEMCAL = 0;
2512 Float_t sumClusterEnergyPHOS = 0;
2513 Int_t iclus = 0;
2514 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2515 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
2516 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2517 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
c8fe2783 2518
521636d2 2519
798a9b04 2520 //Cells
c8fe2783 2521
17708df9 2522 AliVCaloCells * cellsEMCAL = GetEMCALCells();
2523 AliVCaloCells * cellsPHOS = GetPHOSCells();
521636d2 2524
798a9b04 2525 Int_t ncellsEMCAL = cellsEMCAL->GetNumberOfCells();
2526 Int_t ncellsPHOS = cellsPHOS ->GetNumberOfCells();
c8fe2783 2527
c8fe2783 2528 Float_t sumCellEnergyEMCAL = 0;
2529 Float_t sumCellEnergyPHOS = 0;
798a9b04 2530 Int_t icell = 0;
c8fe2783 2531 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2532 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2533 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2534 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
798a9b04 2535
2536
2537 //Fill Histograms
2538 fhCaloCorrNClusters->Fill(nclEMCAL,nclPHOS);
2539 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2540 fhCaloCorrNCells ->Fill(ncellsEMCAL,ncellsPHOS);
2541 fhCaloCorrECells ->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
521636d2 2542
798a9b04 2543 Int_t v0S = GetV0Signal(0)+GetV0Signal(1);
2544 Int_t v0M = GetV0Multiplicity(0)+GetV0Multiplicity(1);
2545 Int_t trM = GetTrackMultiplicity();
2546 if(fCalorimeter=="PHOS"){
2547 fhCaloV0MCorrNClusters ->Fill(v0M,nclPHOS);
2548 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyPHOS);
2549 fhCaloV0MCorrNCells ->Fill(v0M,ncellsPHOS);
2550 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyPHOS);
521636d2 2551
798a9b04 2552 fhCaloV0SCorrNClusters ->Fill(v0S,nclPHOS);
2553 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyPHOS);
2554 fhCaloV0SCorrNCells ->Fill(v0S,ncellsPHOS);
2555 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyPHOS);
521636d2 2556
798a9b04 2557 fhCaloTrackMCorrNClusters->Fill(trM,nclPHOS);
2558 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyPHOS);
2559 fhCaloTrackMCorrNCells ->Fill(trM,ncellsPHOS);
2560 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyPHOS);
2561 }
2562 else{
2563 fhCaloV0MCorrNClusters ->Fill(v0M,nclEMCAL);
2564 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyEMCAL);
2565 fhCaloV0MCorrNCells ->Fill(v0M,ncellsEMCAL);
2566 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyEMCAL);
2567
2568 fhCaloV0SCorrNClusters ->Fill(v0S,nclEMCAL);
2569 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyEMCAL);
2570 fhCaloV0SCorrNCells ->Fill(v0S,ncellsEMCAL);
2571 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyEMCAL);
2572
2573 fhCaloTrackMCorrNClusters->Fill(trM,nclEMCAL);
2574 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyEMCAL);
2575 fhCaloTrackMCorrNCells ->Fill(trM,ncellsEMCAL);
2576 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyEMCAL);
2577 }
2578
2579 if(GetDebug() > 0 )
2580 {
2581 printf("AliAnaCalorimeterQA::Correlate(): \n");
c8fe2783 2582 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
798a9b04 2583 ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
c8fe2783 2584 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
798a9b04 2585 ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS);
2586 printf("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d \n", v0S,v0M,trM);
c8fe2783 2587 }
a0bb4dc0 2588}
2589
17708df9 2590
a6f26052 2591//______________________________________________________________________________
902aa95c 2592void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
a6f26052 2593 //Fill pure monte carlo related histograms
4865e325 2594
2302a644 2595 Float_t eMC = mom.E();
2596 Float_t ptMC = mom.Pt();
2597 Float_t phiMC = mom.Phi();
2598 if(phiMC < 0)
2599 phiMC += TMath::TwoPi();
2600 Float_t etaMC = mom.Eta();
2601
2602 if (TMath::Abs(etaMC) > 1) return;
2603
2604 Bool_t in = kTRUE;
2605 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2606
2607 if (pdg==22) {
2608 fhGenGamPt ->Fill(ptMC);
2609 fhGenGamEta->Fill(etaMC);
2610 fhGenGamPhi->Fill(phiMC);
2611 if(in){
2612 fhGenGamAccE ->Fill(eMC);
2613 fhGenGamAccPt ->Fill(ptMC);
2614 fhGenGamAccEta->Fill(etaMC);
2615 fhGenGamAccPhi->Fill(phiMC);
2616 }
2617 }
2618 else if (pdg==111) {
2619 fhGenPi0Pt ->Fill(ptMC);
2620 fhGenPi0Eta->Fill(etaMC);
2621 fhGenPi0Phi->Fill(phiMC);
2622 if(in){
2623 fhGenPi0AccE ->Fill(eMC);
2624 fhGenPi0AccPt ->Fill(ptMC);
2625 fhGenPi0AccEta->Fill(etaMC);
2626 fhGenPi0AccPhi->Fill(phiMC);
2627 }
2628 }
2629 else if (pdg==221) {
2630 fhGenEtaPt ->Fill(ptMC);
2631 fhGenEtaEta->Fill(etaMC);
2632 fhGenEtaPhi->Fill(phiMC);
2633 }
2634 else if (pdg==223) {
2635 fhGenOmegaPt ->Fill(ptMC);
2636 fhGenOmegaEta->Fill(etaMC);
2637 fhGenOmegaPhi->Fill(phiMC);
2638 }
2639 else if (TMath::Abs(pdg)==11) {
2640 fhGenElePt ->Fill(ptMC);
2641 fhGenEleEta->Fill(etaMC);
2642 fhGenElePhi->Fill(phiMC);
2643 }
c8fe2783 2644
902aa95c 2645}
c8fe2783 2646
a6f26052 2647//________________________________________________________________________
9725fd2a 2648void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2649{
a6f26052 2650 // Needed when Terminate is executed in distributed environment
2651 // Refill analysis histograms of this class with corresponding histograms in output list.
9725fd2a 2652
a6f26052 2653 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2654 // the first one and then add the next
2302a644 2655 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
a6f26052 2656 //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2302a644 2657
a6f26052 2658 //Read histograms, must be in the same order as in GetCreateOutputObject.
2302a644 2659 fhE = (TH1F *) outputList->At(index++);
a6f26052 2660 if(fFillAllTH12){
2661 fhPt = (TH1F *) outputList->At(index++);
2662 fhPhi = (TH1F *) outputList->At(index++);
2663 fhEta = (TH1F *) outputList->At(index++);
2664 }
3748ffb5 2665
2302a644 2666 fhEtaPhiE = (TH3F *) outputList->At(index++);
a6f26052 2667
2302a644 2668 fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
2669
a6f26052 2670 if(fFillAllTH12){
2671 fhECharged = (TH1F *) outputList->At(index++);
2672 fhPtCharged = (TH1F *) outputList->At(index++);
2673 fhPhiCharged = (TH1F *) outputList->At(index++);
2674 fhEtaCharged = (TH1F *) outputList->At(index++);
2675 }
3748ffb5 2676
2302a644 2677 fhEtaPhiECharged = (TH3F *) outputList->At(index++);
2678
2679 fh1pOverE = (TH2F *) outputList->At(index++);
2680 fh1dR = (TH1F *) outputList->At(index++);
2681 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2682 fh2EledEdx = (TH2F *) outputList->At(index++);
2683 fh1pOverER02 = (TH2F *) outputList->At(index++);
2684
2685 fhIM = (TH2F *) outputList->At(index++);
2686 fhIMCellCut = (TH2F *) outputList->At(index++);
b8187de4 2687 fhAsym = (TH2F *) outputList->At(index++);
2302a644 2688
3f5990d6 2689 fhNCellsPerCluster = (TH2F *) outputList->At(index++);
2690 fhNCellsPerClusterMIP = (TH2F *) outputList->At(index++);
2691 fhNCellsPerClusterMIPCharged = (TH2F *) outputList->At(index++);
2302a644 2692 fhNClusters = (TH1F *) outputList->At(index++);
2693
2694 fhRNCells = (TH2F *) outputList->At(index++);
2695 fhXNCells = (TH2F *) outputList->At(index++);
2696 fhYNCells = (TH2F *) outputList->At(index++);
2697 fhZNCells = (TH2F *) outputList->At(index++);
2698 fhRE = (TH2F *) outputList->At(index++);
2699 fhXE = (TH2F *) outputList->At(index++);
2700 fhYE = (TH2F *) outputList->At(index++);
2701 fhZE = (TH2F *) outputList->At(index++);
2702 fhXYZ = (TH3F *) outputList->At(index++);
b8187de4 2703 if(fFillAllPosHisto){
a6f26052 2704 fhRCellE = (TH2F *) outputList->At(index++);
2705 fhXCellE = (TH2F *) outputList->At(index++);
2706 fhYCellE = (TH2F *) outputList->At(index++);
2707 fhZCellE = (TH2F *) outputList->At(index++);
2708 fhXYZCell = (TH3F *) outputList->At(index++);
2709 fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
2710 fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
2711 fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
2712 fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
2713 fhDeltaCellClusterRE = (TH2F *) outputList->At(index++);
2714 fhDeltaCellClusterXE = (TH2F *) outputList->At(index++);
2715 fhDeltaCellClusterYE = (TH2F *) outputList->At(index++);
2716 fhDeltaCellClusterZE = (TH2F *) outputList->At(index++);
2717 fhEtaPhiAmp = (TH3F *) outputList->At(index++);
2302a644 2718 }
a6f26052 2719
2302a644 2720 fhNCells = (TH1F *) outputList->At(index++);
2721 fhAmplitude = (TH1F *) outputList->At(index++);
2722 fhAmpId = (TH2F *) outputList->At(index++);
c8fe2783 2723
2302a644 2724 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2725
2726 fhCellTimeSpreadRespectToCellMax = (TH1F *) outputList->At(index++);
2727 fhCellIdCellLargeTimeSpread = (TH1F *) outputList->At(index++);
2728
2729 fhTime = (TH1F *) outputList->At(index++);
2730 fhTimeId = (TH2F *) outputList->At(index++);
2731 fhTimeAmp = (TH2F *) outputList->At(index++);
c8fe2783 2732
a6f26052 2733 // fhT0Time = (TH1F *) outputList->At(index++);
2734 // fhT0TimeId = (TH2F *) outputList->At(index++);
2735 // fhT0TimeAmp = (TH2F *) outputList->At(index++);
2302a644 2736
2737 }
2738
2739
798a9b04 2740 if(fCorrelate){
2302a644 2741 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2742 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2743 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2744 fhCaloCorrECells = (TH2F *) outputList->At(index++);
798a9b04 2745
2746 fhCaloV0SCorrNClusters = (TH2F *) outputList->At(index++);
2747 fhCaloV0SCorrEClusters = (TH2F *) outputList->At(index++);
2748 fhCaloV0SCorrNCells = (TH2F *) outputList->At(index++);
2749 fhCaloV0SCorrECells = (TH2F *) outputList->At(index++);
2750
2751 fhCaloV0MCorrNClusters = (TH2F *) outputList->At(index++);
2752 fhCaloV0MCorrEClusters = (TH2F *) outputList->At(index++);
2753 fhCaloV0MCorrNCells = (TH2F *) outputList->At(index++);
2754 fhCaloV0MCorrECells = (TH2F *) outputList->At(index++);
2755
2756 fhCaloTrackMCorrNClusters = (TH2F *) outputList->At(index++);
2757 fhCaloTrackMCorrEClusters = (TH2F *) outputList->At(index++);
2758 fhCaloTrackMCorrNCells = (TH2F *) outputList->At(index++);
2759 fhCaloTrackMCorrECells = (TH2F *) outputList->At(index++);
2302a644 2760 }
2761
a6f26052 2762 //Module histograms
2302a644 2763 fhEMod = new TH1F*[fNModules];
2764 fhNClustersMod = new TH1F*[fNModules];
2765 fhNCellsPerClusterMod = new TH2F*[fNModules];
2766 fhNCellsMod = new TH1F*[fNModules];
2767 fhGridCellsMod = new TH2F*[fNModules];
2768 fhGridCellsEMod = new TH2F*[fNModules];
2769 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2770 fhGridCellsTimeMod = new TH2F*[fNModules];
2771 fhAmplitudeMod = new TH1F*[fNModules];
2772 if(fCalorimeter=="EMCAL")
2773 fhAmplitudeModFraction = new TH1F*[fNModules*3];
2774
a6f26052 2775 //EMCAL
2302a644 2776 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2777
2778 fhIMMod = new TH2F*[fNModules];
2779 fhIMCellCutMod = new TH2F*[fNModules];
2780
2781 for(Int_t imod = 0 ; imod < fNModules; imod++){
2782 fhEMod[imod] = (TH1F *) outputList->At(index++);
2783 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2784 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2785 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2786 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2787 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2788 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2789 fhGridCellsTimeMod[imod] = (TH2F *) outputList->At(index++);
2790 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2791
2792 if(fCalorimeter=="EMCAL"){
2793 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
521636d2 2794 fhAmplitudeModFraction[imod*3+ifrac] = (TH1F *) outputList->At(index++);
2302a644 2795 }
2796 }
2797
2798 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
2799 fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
a6f26052 2800 //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2801 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
2802 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
2803 // fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2] = (TH2F *) outputList->At(index++);
2804 // }
2805 // }
2302a644 2806 }
2807 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2808 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
c8fe2783 2809
2302a644 2810 }
2811
2812 if(IsDataMC()){
2813 fhDeltaE = (TH1F *) outputList->At(index++);
2814 fhDeltaPt = (TH1F *) outputList->At(index++);
2815 fhDeltaPhi = (TH1F *) outputList->At(index++);
2816 fhDeltaEta = (TH1F *) outputList->At(index++);
2817
2818 fhRatioE = (TH1F *) outputList->At(index++);
2819 fhRatioPt = (TH1F *) outputList->At(index++);
2820 fhRatioPhi = (TH1F *) outputList->At(index++);
2821 fhRatioEta = (TH1F *) outputList->At(index++);
2822
2823 fh2E = (TH2F *) outputList->At(index++);
2824 fh2Pt = (TH2F *) outputList->At(index++);
2825 fh2Phi = (TH2F *) outputList->At(index++);
2826 fh2Eta = (TH2F *) outputList->At(index++);
2827
2828 fhGamE = (TH2F *) outputList->At(index++);
2829 fhGamPt = (TH2F *) outputList->At(index++);
2830 fhGamPhi = (TH2F *) outputList->At(index++);
2831 fhGamEta = (TH2F *) outputList->At(index++);
2832
2833 fhGamDeltaE = (TH1F *) outputList->At(index++);
2834 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2835 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2836 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2837
2838 fhGamRatioE = (TH1F *) outputList->At(index++);
2839 fhGamRatioPt = (TH1F *) outputList->At(index++);
2840 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2841 fhGamRatioEta = (TH1F *) outputList->At(index++);
2842
2843 fhPi0E = (TH2F *) outputList->At(index++);
2844 fhPi0Pt = (TH2F *) outputList->At(index++);
2845 fhPi0Phi = (TH2F *) outputList->At(index++);
2846 fhPi0Eta = (TH2F *) outputList->At(index++);
2847
2848 fhEleE = (TH2F *) outputList->At(index++);
2849 fhElePt = (TH2F *) outputList->At(index++);
2850 fhElePhi = (TH2F *) outputList->At(index++);
2851 fhEleEta = (TH2F *) outputList->At(index++);
2852
2853 fhNeHadE = (TH2F *) outputList->At(index++);
2854 fhNeHadPt = (TH2F *) outputList->At(index++);
2855 fhNeHadPhi = (TH2F *) outputList->At(index++);
2856 fhNeHadEta = (TH2F *) outputList->At(index++);
2857
2858 fhChHadE = (TH2F *) outputList->At(index++);
2859 fhChHadPt = (TH2F *) outputList->At(index++);
2860 fhChHadPhi = (TH2F *) outputList->At(index++);
2861 fhChHadEta = (TH2F *) outputList->At(index++);
2862
2863 fhGamECharged = (TH2F *) outputList->At(index++);
2864 fhGamPtCharged = (TH2F *) outputList->At(index++);
2865 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2866 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2867
2868 fhPi0ECharged = (TH2F *) outputList->At(index++);
2869 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2870 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2871 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2872
2873 fhEleECharged = (TH2F *) outputList->At(index++);
2874 fhElePtCharged = (TH2F *) outputList->At(index++);
2875 fhElePhiCharged = (TH2F *) outputList->At(index++);
2876 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2877
2878 fhNeHadECharged = (TH2F *) outputList->At(index++);
2879 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2880 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2881 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2882
2883 fhChHadECharged = (TH2F *) outputList->At(index++);
2884 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2885 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2886 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
06e5656a 2887
a6f26052 2888 // fhEMVxyz = (TH3F *) outputList->At(index++);
2889 // fhHaVxyz = (TH3F *) outputList->At(index++);
9725fd2a 2890
2302a644 2891 fhEMVxyz = (TH2F *) outputList->At(index++);
2892 fhHaVxyz = (TH2F *) outputList->At(index++);
2893 fhEMR = (TH2F *) outputList->At(index++);
2894 fhHaR = (TH2F *) outputList->At(index++);
2895
2896 fhGenGamPt = (TH1F *) outputList->At(index++);
2897 fhGenGamEta = (TH1F *) outputList->At(index++);
2898 fhGenGamPhi = (TH1F *) outputList->At(index++);
2899
2900 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2901 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2902 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2903
2904 fhGenEtaPt = (TH1F *) outputList->At(index++);
2905 fhGenEtaEta = (TH1F *) outputList->At(index++);
2906 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2907
2908 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2909 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2910 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2911
2912 fhGenElePt = (TH1F *) outputList->At(index++);
2913 fhGenEleEta = (TH1F *) outputList->At(index++);
2914 fhGenElePhi = (TH1F *) outputList->At(index++);
2915
2916 fhGenGamAccE = (TH1F *) outputList->At(index++);
2917 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2918 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2919 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2920
2921 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2922 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2923 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2924 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2925
2926 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
2927 fhMCEle1dR = (TH1F *) outputList->At(index++);
2928 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2929
2930 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
2931 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2932 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2933
2934 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
2935 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2936 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2937
2938 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2939 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2940 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
2941 }
9725fd2a 2942}
2943
a6f26052 2944//__________________________________________________________________
9725fd2a 2945void AliAnaCalorimeterQA::Terminate(TList* outputList)
2946{
a6f26052 2947 //Do plots if requested
c8fe2783 2948
d7c10d78 2949 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), MakePlotsOn());
521636d2 2950
a6f26052 2951 //Do some plots to end
c8fe2783 2952 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
a6f26052 2953 //Recover histograms from output histograms list, needed for distributed analysis.
54769bc0 2954 ReadHistograms(outputList);
2955
a6f26052 2956 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2957 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
c8fe2783 2958
164a1d84 2959 const Int_t buffersize = 255;
54769bc0 2960 char name[buffersize];
2961 char cname[buffersize];
2962
a6f26052 2963 //In case terminate is executed after the analysis, in a second step, and we want to rebin or to change the range of the histograms for plotting
54769bc0 2964 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
2965 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
2966 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
a6f26052 2967 // Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
2968 // Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
2969 // Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
2970 // Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
2971 // Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
54769bc0 2972 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
2973 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
a6f26052 2974 // Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
2975 // Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
54769bc0 2976 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
2977 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
2978 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
2979 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
2980
a6f26052 2981 //Color code for the different modules
54769bc0 2982 Int_t modColorIndex[]={2,4,6,8};
2983
a6f26052 2984 //--------------------------------------------------
2985 // Cluster energy distributions, module dependence
2986 //--------------------------------------------------
54769bc0 2987 snprintf(cname,buffersize,"QA_%s_ClusterEnergy",fCalorimeter.Data());
2988 TCanvas * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
2989 c->Divide(2, 1);
2990 Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
a6f26052 2991 //printf("new E rb %d\n",rbE);
54769bc0 2992 fhE->Rebin(rbE);
2993 fhE->SetAxisRange(ptmin,ptmax,"X");
2994 c->cd(1) ;
2995 if(fhE->GetEntries() > 0) gPad->SetLogy();
2996 TLegend pLegendE(0.7,0.6,0.9,0.8);
2997 pLegendE.SetTextSize(0.03);
2998 pLegendE.AddEntry(fhE,"all modules","L");
2999 pLegendE.SetFillColor(10);
3000 pLegendE.SetBorderSize(1);
3001
3002 fhE->SetMinimum(1);
3003 fhE->SetLineColor(1);
3004 fhE->Draw("HE");
3005 for(Int_t imod = 0; imod < fNModules; imod++){
3006 fhEMod[imod]->Rebin(rbE);
3007 fhEMod[imod]->SetLineColor(modColorIndex[imod]);
3008 fhEMod[imod]->Draw("HE same");
3009 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
3010 }
3011 pLegendE.Draw();
3012
a6f26052 3013 //Ratio of modules
54769bc0 3014 c->cd(2) ;
3015 TLegend pLegendER(0.55,0.8,0.9,0.9);
3016 pLegendER.SetTextSize(0.03);
3017 pLegendER.SetFillColor(10);
3018 pLegendER.SetBorderSize(1);
3019
3020 for(Int_t imod = 1; imod < fNModules; imod++){
3021 TH1D * htmp = (TH1D*)fhEMod[imod]->Clone(Form("hERat%d",imod));
3022 htmp->Divide(fhEMod[0]);
3023 htmp->SetLineColor(modColorIndex[imod]);
3024 if(imod==1){
3025 htmp->SetTitle("Ratio module X / module 0");
3026 htmp->SetAxisRange(ptmin,ptmax,"X");
3027 htmp->SetMaximum(5);
3028 htmp->SetMinimum(0);
3029 htmp->SetAxisRange(ptmin,ptmax,"X");
3030 htmp->Draw("HE");
3031 }
3032 else
3033 htmp->Draw("same HE");
3034
3035 pLegendER.AddEntry(fhEMod[imod],Form("module %d / module 0",imod),"L");
3036 }
3037 pLegendER.Draw();
3038
3039 snprintf(name,buffersize,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
3040 c->Print(name); printf("Plot: %s\n",name);
3041
a6f26052 3042 //--------------------------------------------------
3043 // Cell energy distributions, module dependence
3044 //--------------------------------------------------
54769bc0 3045 snprintf(cname,buffersize,"%s_QA_CellEnergy",fCalorimeter.Data());
3046 TCanvas * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
3047 ca->Divide(2, 1);
3048
3049 Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
a6f26052 3050 //printf("new Amp rb %d\n",rbAmp);
54769bc0 3051 fhAmplitude->Rebin(rbAmp);
3052 fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
3053
3054 ca->cd(1) ;
3055 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
3056 TLegend pLegendA(0.7,0.6,0.9,0.8);
3057 pLegendA.SetTextSize(0.03);
3058 pLegendA.AddEntry(fhE,"all modules","L");
3059 pLegendA.SetFillColor(10);
3060 pLegendA.SetBorderSize(1);
3061 fhAmplitude->SetMinimum(0.1);
3062 fhAmplitude->SetLineColor(1);
3063 fhAmplitude->Draw("HE");
3064
3065 for(Int_t imod = 0; imod < fNModules; imod++){
3066 fhAmplitudeMod[imod]->Rebin(rbAmp);
3067 fhAmplitudeMod[imod]->SetLineColor(modColorIndex[imod]);
3068 fhAmplitudeMod[imod]->Draw("HE same");
3069 pLegendA.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3070 }
3071 pLegendA.Draw();
3072
3073
3074 ca->cd(2) ;
3075 TLegend pLegendAR(0.55,0.8,0.9,0.9);
3076 pLegendAR.SetTextSize(0.03);
3077 pLegendAR.SetFillColor(10);
3078 pLegendAR.SetBorderSize(1);
3079
3080 for(Int_t imod = 1; imod < fNModules; imod++){
3081 TH1D * htmp = (TH1D*)fhAmplitudeMod[imod]->Clone(Form("hAmpRat%d",imod));
3082 htmp->Divide(fhAmplitudeMod[0]);
3083 htmp->SetLineColor(modColorIndex[imod]);
3084 if(imod==1){
3085 htmp->SetTitle("Ratio cells energy in module X / module 0");
3086 htmp->SetAxisRange(ptmin,ptmax,"X");
3087 htmp->SetMaximum(5);
3088 htmp->SetMinimum(0);
3089 htmp->Draw("HE");
3090 }
3091 else
3092 htmp->Draw("same HE");
3093 pLegendAR.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
3094 }
3095
3096 pLegendAR.Draw();
3097 snprintf(name,buffersize,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
3098 ca->Print(name); printf("Plot: %s\n",name);
c8fe2783 3099
a6f26052 3100 //----------------------------------------------------------
3101 // Cell energy distributions, FRACTION of module dependence
3102 // See Super Module calibration difference
3103 //---------------------------------------------------------
54769bc0 3104 if(fCalorimeter=="EMCAL"){
a6f26052 3105 //Close To Eta 0
54769bc0 3106 snprintf(cname,buffersize,"%s_QA_SMThirds",fCalorimeter.Data());
3107 TCanvas * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
3108 cfrac->Divide(2, 3);
3109 cfrac->cd(1) ;
3110 if(fhAmplitude->GetEntries() > 0)
3111 gPad->SetLogy();
3112 TLegend pLegend1(0.6,0.6,0.9,0.8);
3113 pLegend1.SetTextSize(0.03);
3114 pLegend1.SetFillColor(10);
3115 pLegend1.SetBorderSize(1);
3116 pLegend1.SetHeader("Third close to Eta=0");
3117 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0");
3118 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3119 fhAmplitudeModFraction[0]->Draw("axis");
3120 TH1D * hAverageThird1 = (TH1D *)fhAmplitudeModFraction[3*0+2]->Clone("AverageThird1");
3121 for(Int_t imod = 0; imod < fNModules; imod++){
3122 Int_t ifrac = 0;
3123 if(imod%2==0) ifrac = 2;
3124 if(imod > 0) hAverageThird1->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3125 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3126 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3127 pLegend1.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3128 }
3129 hAverageThird1 ->Scale(1./fNModules);
3130 pLegend1.Draw();
a6f26052 3131 //Ratio
54769bc0 3132 cfrac->cd(2) ;
3133 for(Int_t imod = 0; imod < fNModules; imod++){
3134 Int_t ifrac = 0;
3135 if(imod%2==0) ifrac = 2;
3136 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3137 htmp->Divide(hAverageThird1);
3138 if(imod ==0) {
521636d2 3139 htmp ->SetTitle("Close to eta = 0");
3140 htmp ->SetMaximum(5);
3141 htmp ->SetMinimum(0);
3142 htmp ->SetAxisRange(ptmin,ptmax,"X");
3143 htmp ->SetYTitle("ratio third to average");
3144 htmp -> Draw("HE");
54769bc0 3145 }
3146 else htmp -> Draw("same HE");
3147 }
a6f26052 3148 //pLegend1.Draw();
54769bc0 3149
a6f26052 3150 //Middle Eta
54769bc0 3151 cfrac->cd(3) ;
3152 if(fhAmplitude->GetEntries() > 0)
3153 gPad->SetLogy();
3154 TLegend pLegend2(0.6,0.6,0.9,0.8);
3155 pLegend2.SetTextSize(0.03);
3156 pLegend2.SetFillColor(10);
3157 pLegend2.SetBorderSize(1);
3158 pLegend2.SetHeader("Middle Third");
3159
3160 fhAmplitudeModFraction[0]->SetTitle("Middle Third");
3161 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3162 fhAmplitudeModFraction[0]->Draw("axis");
3163
3164 TH1D * hAverageThird2 = (TH1D *)fhAmplitudeModFraction[3*0+1]->Clone("AverageThird2");
3165 for(Int_t imod = 0; imod < fNModules; imod++){
3166 Int_t ifrac = 1;
3167 if(imod > 0) hAverageThird2->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3168 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3169 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3170 pLegend2.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3171 }
3172 hAverageThird2->Scale(1./fNModules);
3173 pLegend2.Draw();
3174
a6f26052 3175 //Ratio
54769bc0 3176 cfrac->cd(4) ;
3177
3178 for(Int_t imod = 0; imod < fNModules; imod++){
3179 Int_t ifrac = 1;
3180 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3181 htmp->Divide(hAverageThird2);
3182 if(imod ==0) {
521636d2 3183 htmp ->SetTitle("Middle");
3184 htmp ->SetMaximum(5);
3185 htmp ->SetMinimum(0);
3186 htmp ->SetAxisRange(ptmin,ptmax,"X");
3187 htmp ->SetYTitle("ratio third to average");
3188 htmp -> Draw("HE");
54769bc0 3189 }
3190 else htmp -> Draw("same HE");
3191 }
a6f26052 3192 //pLegend2.Draw();
54769bc0 3193
a6f26052 3194 //Close To Eta 0.7
54769bc0 3195 cfrac->cd(5) ;
3196 if(fhAmplitude->GetEntries() > 0)
3197 gPad->SetLogy();
3198 TLegend pLegend3(0.6,0.6,0.9,0.8);
3199 pLegend3.SetTextSize(0.03);
3200 pLegend3.SetFillColor(10);
3201 pLegend3.SetBorderSize(1);
3202 pLegend3.SetHeader("Third close to Eta=0.7");
3203
3204 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0.7");
3205 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3206 fhAmplitudeModFraction[0]->Draw("axis");
3207
3208 TH1D * hAverageThird3 = (TH1D *)fhAmplitudeModFraction[3*0+0]->Clone("AverageThird3");
3209 for(Int_t imod = 0; imod < 4; imod++){
3210 Int_t ifrac = 2;
3211 if(imod%2==0) ifrac = 0;
3212 if(imod > 0) hAverageThird3->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3213 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3214 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3215 pLegend3.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3216 }
3217 hAverageThird3 ->Scale(1./fNModules);
3218 pLegend3.Draw();
3219
3220 cfrac->cd(6) ;
3221
3222 for(Int_t imod = 0; imod < fNModules; imod++){
3223 Int_t ifrac = 2;
3224 if(imod%2==0) ifrac = 0;
3225 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3226 htmp->Divide(hAverageThird3);
3227 if(imod ==0) {
521636d2 3228 htmp ->SetTitle("Close to eta = 0.7");
3229 htmp ->SetMaximum(5);
3230 htmp ->SetMinimum(0);
3231 htmp ->SetAxisRange(ptmin,ptmax,"X");
3232 htmp ->SetYTitle("ratio third to average");
3233 htmp ->Draw("HE");
54769bc0 3234 }
3235 else htmp ->Draw("same HE");
3236 }
a6f26052 3237 //pLegend3.Draw();
54769bc0 3238
3239 snprintf(name,buffersize,"QA_%s_CellEnergyModuleFraction.eps",fCalorimeter.Data());
3240 cfrac->Print(name); printf("Create plot %s\n",name);
3241 }//EMCAL
3242
3243
a6f26052 3244 //----------------------------------------------------------
3245 // Cluster eta and phi distributions, energy cut dependence
3246 //---------------------------------------------------------
54769bc0 3247
3248 snprintf(cname,buffersize,"%s_QA_EtaPhiCluster",fCalorimeter.Data());
3249 TCanvas * cetaphic = new TCanvas(cname, "Eta-Phi Reconstructed distributions", 1200, 400) ;
3250 cetaphic->Divide(3, 1);
3251 Int_t binmin = 0;
3252 Int_t rbPhi = 1;
3253 Int_t rbEta = 1;
3254 Int_t ncuts = 7;
3255 Float_t ecut[] = {0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3};
3256 Int_t ecutcolor[]= {2, 4, 6, 7, 8, 9, 12};
3257 TH1D * hE = fhEtaPhiE->ProjectionZ();
3258
a6f26052 3259 //PHI
54769bc0 3260 cetaphic->cd(1) ;
3261 gPad->SetLogy();
3262 gPad->SetGridy();
3263
3264 TLegend pLegendPhiCl(0.83,0.6,0.95,0.93);
3265 pLegendPhiCl.SetTextSize(0.03);
3266 pLegendPhiCl.SetFillColor(10);
3267 pLegendPhiCl.SetBorderSize(1);
3268
3269 TH1D * htmp = fhEtaPhiE->ProjectionY("hphi_cluster_nocut",0,-1,0,-1);
3270 if(htmp){
3271 htmp->SetMinimum(1);
3272 rbPhi = GetNewRebinForRePlotting(htmp, phimin, phimax,nphibins) ;
a6f26052 3273 //printf("new Phi rb %d\n",rbPhi);
54769bc0 3274 htmp->Rebin(rbPhi);
3275 htmp->SetTitle("#phi of clusters for energy in cluster > threshold");
3276 htmp->SetAxisRange(phimin,phimax,"X");
3277 htmp->Draw("HE");
3278 pLegendPhiCl.AddEntry(htmp,"No cut","L");
3279
3280 for (Int_t i = 0; i < ncuts; i++) {
3281 binmin = hE->FindBin(ecut[i]);
a6f26052 3282 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
54769bc0 3283 htmp = fhEtaPhiE->ProjectionY(Form("hphi_cluster_cut%d",i),0,-1,binmin,-1);
3284 htmp->SetLineColor(ecutcolor[i]);
3285 htmp->Rebin(rbPhi);
3286 htmp->Draw("same HE");
3287 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3288
3289 }
3290 }
3291 pLegendPhiCl.Draw();
3292
3293 //ETA
3294 cetaphic->cd(2) ;
3295 gPad->SetLogy();
3296 gPad->SetGridy();
3297
3298 delete htmp;
3299 htmp = fhEtaPhiE->ProjectionX("heta_cluster_nocut",0,-1,0,-1);
fbad5435 3300 if(htmp){
3301 rbEta = GetNewRebinForRePlotting(htmp,etamin, etamax,netabins) ;
3302 //printf("new Eta rb %d\n",rbEta);
54769bc0 3303 htmp->Rebin(rbEta);
3304 htmp->SetMinimum(1);
3305 htmp ->SetLineColor(1);
3306 htmp->SetTitle("#eta of clusters for energy in cluster > threshold");
3307 htmp->SetAxisRange(etamin,etamax,"X");
3308 htmp->Draw("HE");
3309
3310 for (Int_t i = 0; i < ncuts; i++) {
3311 binmin = hE->FindBin(ecut[i]);
a6f26052 3312 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
54769bc0 3313 htmp = fhEtaPhiE->ProjectionX(Form("heta_cluster_cut%d",i),0,-1,binmin,-1);
3314 htmp->SetLineColor(ecutcolor[i]);
3315 htmp->Rebin(rbEta);
3316 htmp->Draw("same HE");
3317 }
3318 }
a6f26052 3319 //ETA vs PHI
54769bc0 3320 cetaphic->cd(3) ;
3321 TH2D* hEtaPhiCl = (TH2D*) fhEtaPhiE->Project3D("xy");
3322 hEtaPhiCl->SetAxisRange(etamin,etamax,"X");
3323 hEtaPhiCl->SetAxisRange(phimin,phimax,"Y");
3324 hEtaPhiCl->Draw("colz");
c8fe2783 3325
54769bc0 3326 snprintf(name,buffersize,"QA_%s_ClusterEtaPhi.eps",fCalorimeter.Data());
3327 cetaphic->Print(name); printf("Create plot %s\n",name);
c8fe2783 3328
a6f26052 3329 //----------------------------------------------------------
3330 // Cell eta and phi distributions, energy cut dependence
3331 //---------------------------------------------------------
255b904d 3332
54769bc0 3333 snprintf(cname,buffersize,"%s_QA_EtaPhiCell",fCalorimeter.Data());
3334 TCanvas * cetaphicell = new TCanvas(cname, "Eta-Phi Cells distributions", 1200, 400) ;
3335 cetaphicell->Divide(3, 1);
3336
a6f26052 3337 //PHI
54769bc0 3338 cetaphicell->cd(1) ;
3339 gPad->SetLogy();
3340 gPad->SetGridy();
3341
3342 TLegend pLegendPhiCell(0.83,0.6,0.95,0.93);
3343 pLegendPhiCell.SetTextSize(0.03);
3344 pLegendPhiCell.SetFillColor(10);
3345 pLegendPhiCell.SetBorderSize(1);
3346
3347 delete htmp;
3348 htmp = fhEtaPhiAmp->ProjectionY("hphi_cell_nocut",0,-1,0,-1);
3349 if(htmp){
3350 htmp->SetMinimum(1);
3351 htmp->Rebin(rbPhi);
3352 htmp->SetTitle("#phi of cells for cell energy > threshold");
3353 htmp->SetAxisRange(phimin,phimax,"X");
3354 htmp->Draw("HE");
3355 pLegendPhiCell.AddEntry(htmp,"No cut","L");
3356
3357 for (Int_t i = 0; i < ncuts; i++) {
3358 binmin = hE->FindBin(ecut[i]);
a6f26052 3359 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
54769bc0 3360 htmp = fhEtaPhiAmp->ProjectionY(Form("hphi_cell_cut%d",i),0,-1,binmin,-1);
3361 htmp->SetLineColor(ecutcolor[i]);
3362 htmp->Rebin(rbPhi);
3363 htmp->Draw("same HE");
3364 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3365
3366 }
3367 }
3368 pLegendPhiCell.Draw();
3369
a6f26052 3370 //ETA
54769bc0 3371 cetaphicell->cd(2) ;
3372 gPad->SetLogy();
3373 gPad->SetGridy();
3374
3375 delete htmp;
3376 htmp = fhEtaPhiAmp->ProjectionX("heta_cell_nocut",0,-1,0,-1);
3377 if(htmp){
3378 htmp ->SetLineColor(1);
3379 htmp->Rebin(rbEta);
3380 htmp->SetMinimum(1);
3381 htmp->SetTitle("#eta of cells for cell energy > threshold");
3382 htmp->SetAxisRange(etamin,etamax,"X");
3383 htmp->Draw("HE");
3384
3385 for (Int_t i = 0; i < ncuts; i++) {
3386 binmin = hE->FindBin(ecut[i]);
a6f26052 3387 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
54769bc0 3388 htmp = fhEtaPhiAmp->ProjectionX(Form("heta_cell_cut%d",i),0,-1,binmin,-1);
3389 htmp->SetLineColor(ecutcolor[i]);
3390 htmp->Rebin(rbEta);
3391 htmp->Draw("same HE");
3392
3393 }
3394 }
a6f26052 3395 //ETA vs PHI
54769bc0 3396 cetaphicell->cd(3) ;
3397 TH2D* hEtaPhiCell = (TH2D*) fhEtaPhiAmp->Project3D("xy");
3398 hEtaPhiCell->SetAxisRange(etamin,etamax,"X");
3399 hEtaPhiCell->SetAxisRange(phimin,phimax,"Y");
3400 hEtaPhiCell->Draw("colz");
3401
3402 snprintf(name,buffersize,"QA_%s_CellEtaPhi.eps",fCalorimeter.Data());
3403 cetaphicell->Print(name); printf("Create plot %s\n",name);
3404
c8fe2783 3405
a6f26052 3406 ////////////////////////////////////////
3407 ///////// Global Positions /////////////
3408 ////////////////////////////////////////
3409
3410 //CLUSTERS
b8187de4 3411 Int_t rbX = 1;
3412 Int_t rbY = 1;
3413 Int_t rbZ = 1;
4b892846 3414 if(fFillAllPosHisto)
b8187de4 3415 {
164a1d84 3416 snprintf(cname,buffersize,"%s_QA_ClusterXY",fCalorimeter.Data());
a6f26052 3417 TCanvas * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
3418 cxyz->Divide(3, 1);
3419
3420 cxyz->cd(1) ;
3421 TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
3422 hXY->SetTitle("Cluster X vs Y");
3423 hXY->GetYaxis()->SetTitleOffset(1.6);
3424 hXY->Draw("colz");
3425 cxyz->cd(2) ;
3426 TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
3427 hYZ->SetTitle("Cluster Z vs Y");
3428 hYZ->GetYaxis()->SetTitleOffset(1.6);
3429 hYZ->Draw("colz");
3430 cxyz->cd(3) ;
3431 TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
3432 hXZ->SetTitle("Cluster X vs Z");
3433 hXZ->GetYaxis()->SetTitleOffset(1.6);
3434 hXZ->Draw("colz");
3435
164a1d84 3436 snprintf(name,buffersize,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
a6f26052 3437 cxyz->Print(name); printf("Create plot %s\n",name);
3438
164a1d84 3439 snprintf(cname,buffersize,"QA_%s_ClusterX",fCalorimeter.Data());
a6f26052 3440 TCanvas * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
3441 cx->Divide(3, 1);
3442
3443 cx->cd(1) ;
3444 TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
c8fe2783 3445 //gPad->SetLogy();
a6f26052 3446 gPad->SetGridy();
3447 hX->SetTitle("Cluster X ");
3448 hX->Draw("HE");
3449 rbX = GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
c8fe2783 3450 //printf("new X rb %d\n",rbX);
a6f26052 3451 hX->Rebin(rbX);
3452 hX->SetMinimum(hX->GetMaximum()/2);
3453 hX->SetAxisRange(xmin,xmax);
3454
3455 cx->cd(2) ;
3456 TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
c8fe2783 3457 //gPad->SetLogy();
a6f26052 3458 hY->SetTitle("Cluster Y ");
3459 rbY = GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
c8fe2783 3460 //printf("new Y rb %d\n",rbY);
a6f26052 3461 hY->Rebin(rbY);
3462 hY->SetMinimum(1);
3463 hY->SetAxisRange(ymin,ymax);
3464 hY->Draw("HE");
3465
3466 cx->cd(3) ;
3467 TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
c8fe2783 3468 //gPad->SetLogy();
a6f26052 3469 gPad->SetGridy();
3470 rbZ = GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
c8fe2783 3471 //printf("new Z rb %d\n",rbZ);
a6f26052 3472 hZ->Rebin(rbZ);
3473 hZ->SetMinimum(hZ->GetMaximum()/2);
3474 hZ->SetAxisRange(zmin,zmax);
3475 hZ->Draw("HE");
3476
164a1d84 3477 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
a6f26052 3478 cx->Print(name); printf("Create plot %s\n",name);
b8187de4 3479 }
5025c139 3480 //CELLS
b8187de4 3481 if(fFillAllPosHisto)
3482 {
164a1d84 3483 snprintf(cname,buffersize,"%s_QA_CellXY",fCalorimeter.Data());
a6f26052 3484 TCanvas * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
3485 cellxyz->Divide(3, 1);
3486
3487 cellxyz->cd(1) ;
3488 TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
3489 hXYCell->SetTitle("Cell X vs Y");
3490 hXYCell->GetYaxis()->SetTitleOffset(1.6);
3491 hXYCell->Draw("colz");
3492 cellxyz->cd(2) ;
3493 TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
3494 hYZCell->SetTitle("Cell Z vs Y");
3495 hYZCell->GetYaxis()->SetTitleOffset(1.6);
3496 hYZCell->Draw("colz");
3497 cellxyz->cd(3) ;
3498 TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
3499 hXZCell->SetTitle("Cell X vs Z");
3500 hXZCell->GetYaxis()->SetTitleOffset(1.6);
3501 hXZCell->Draw("colz");
3502
164a1d84 3503 snprintf(name,buffersize,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
a6f26052 3504 cellxyz->Print(name); printf("Create plot %s\n",name);
3505
3506
164a1d84 3507 snprintf(cname,buffersize,"%s_QA_CellX",fCalorimeter.Data());
a6f26052 3508 TCanvas * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
3509 cellx->Divide(3, 1);
3510
3511 cellx->cd(1) ;
3512 TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
c8fe2783 3513 //gPad->SetLogy();
a6f26052 3514 gPad->SetGridy();
3515 hXCell->SetTitle("Cell X ");
3516 hXCell->Rebin(rbX);
3517 hXCell->SetMinimum(hXCell->GetMaximum()/2);
3518 hXCell->SetAxisRange(xmin,xmax);
3519 hXCell->Draw("HE");
3520
3521 cellx->cd(2) ;
3522 TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
c8fe2783 3523 //gPad->SetLogy();
a6f26052 3524 hYCell->SetTitle("Cell Y ");
3525 hYCell->Rebin(rbY);
3526 hYCell->SetAxisRange(ymin,ymax);
3527 hYCell->SetMinimum(1);
3528 hYCell->Draw("HE");
3529
3530 cellx->cd(3) ;
3531 TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
c8fe2783 3532 //gPad->SetLogy();
a6f26052 3533 gPad->SetGridy();
3534 hZCell->SetAxisRange(zmin,zmax);
3535 hZCell->SetTitle("Cell Z ");
3536 hZCell->Rebin(rbZ);
3537 hZCell->SetMinimum(hZCell->GetMaximum()/2);
3538 hZCell->Draw("HE");
3539
164a1d84 3540 snprintf(name,buffersize,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
a6f26052 3541 cellx->Print(name); printf("Create plot %s\n",name);
3542
3543
c8fe2783 3544 //----------------------------------------------------------
3545 // Cluster X, Y, Z, R, energy cut dependence
3546 //---------------------------------------------------------
a6f26052 3547
164a1d84 3548 snprintf(cname,buffersize,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
a6f26052 3549 TCanvas * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
3550 cxe->Divide(2, 2);
c8fe2783 3551 //R
a6f26052 3552 cxe->cd(1) ;
3553 gPad->SetLogy();
3554 gPad->SetGridy();
3555
3556 TLegend pLegendXCl(0.83,0.6,0.95,0.93);
3557 pLegendXCl.SetTextSize(0.03);
3558 pLegendXCl.SetFillColor(10);
3559 pLegendXCl.SetBorderSize(1);
3560
5025c139 3561 delete htmp;
a6f26052 3562 htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
3563 Int_t rbR=1;
3564 if(htmp){
3565 htmp->SetMinimum(1);
3566 rbR = GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
c8fe2783 3567 //printf("new R rb %d\n",rbR);
a6f26052 3568 htmp->Rebin(rbR);
3569 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3570 htmp->SetAxisRange(rmin,rmax,"X");
3571 htmp->Draw("HE");
3572 pLegendXCl.AddEntry(htmp,"No cut","L");
3573
3574 for (Int_t i = 0; i < ncuts; i++) {
3575 binmin = hE->FindBin(ecut[i]);
c8fe2783 3576 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3577 htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
3578 htmp->SetLineColor(ecutcolor[i]);
3579 htmp->Rebin(rbR);
3580 htmp->Draw("same HE");
3581 pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3582 }
3583 }
3584 pLegendXCl.Draw();
3585
c8fe2783 3586 //X
a6f26052 3587 cxe->cd(2) ;
3588 gPad->SetLogy();
3589 gPad->SetGridy();
5025c139 3590 delete htmp;
a6f26052 3591 htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
3592 if(htmp){
3593 htmp->SetMinimum(1);
3594 htmp->Rebin(rbX);
3595 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3596 htmp->SetAxisRange(xmin,xmax,"X");
3597 htmp->Draw("HE");
3598
3599 for (Int_t i = 0; i < ncuts; i++) {
3600 binmin = hE->FindBin(ecut[i]);
c8fe2783 3601 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3602 htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
3603 htmp->SetLineColor(ecutcolor[i]);
3604 htmp->Rebin(rbX);
3605 htmp->Draw("same HE");
3606 }
3607 }
c8fe2783 3608 //Y
a6f26052 3609 cxe->cd(3) ;
3610 gPad->SetLogy();
3611 gPad->SetGridy();
5025c139 3612
3613 delete htmp;
a6f26052 3614 htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
3615 if(htmp){
3616 htmp->SetMinimum(1);
3617 htmp->Rebin(rbY);
3618 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3619 htmp->SetAxisRange(ymin,ymax,"X");
3620 htmp->Draw("HE");
3621
3622 for (Int_t i = 0; i < ncuts; i++) {
3623 binmin = hE->FindBin(ecut[i]);
c8fe2783 3624 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3625 htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
3626 htmp->SetLineColor(ecutcolor[i]);
3627 htmp->Rebin(rbY);
3628 htmp->Draw("same HE");
3629 }
3630 }
c8fe2783 3631 //Z
a6f26052 3632 cxe->cd(4) ;
3633 gPad->SetLogy();
3634 gPad->SetGridy();
3635
5025c139 3636 delete htmp;
a6f26052 3637 htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
3638 if(htmp){
3639 htmp->SetMinimum(1);
3640 htmp->Rebin(rbZ);
3641 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3642 htmp->SetAxisRange(zmin,zmax,"X");
3643 htmp->Draw("HE");
3644
3645 for (Int_t i = 0; i < ncuts; i++) {
3646 binmin = hE->FindBin(ecut[i]);
c8fe2783 3647 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3648 htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
3649 htmp->SetLineColor(ecutcolor[i]);
3650 htmp->Rebin(rbZ);
3651 htmp->Draw("same HE");
3652 }
3653 }
3654
164a1d84 3655 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
a6f26052 3656 cxe->Print(name); printf("Create plot %s\n",name);
3657
3658
c8fe2783 3659 //----------------------------------------------------------
3660 // Cluster X, Y, Z, R, NCells in cluster dependence
3661 //---------------------------------------------------------
a6f26052 3662 Int_t ncellcut[]={2, 3, 4};
3663 Int_t ncellcuts = 3;
164a1d84 3664 snprintf(cname,buffersize,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
a6f26052 3665 TCanvas * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
3666 cxn->Divide(2, 2);
c8fe2783 3667 //R
a6f26052 3668 cxn->cd(1) ;
3669 gPad->SetLogy();
3670 gPad->SetGridy();
3671
3672 TLegend pLegendXClN(0.83,0.6,0.95,0.93);
3673 pLegendXClN.SetTextSize(0.03);
3674 pLegendXClN.SetFillColor(10);
3675 pLegendXClN.SetBorderSize(1);
3676
5025c139 3677 delete htmp;
a6f26052 3678 htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
3679 if(htmp){
3680 htmp->SetMinimum(1);
3681 htmp->Rebin(rbR);
3682 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3683 htmp->SetAxisRange(rmin,rmax,"X");
3684 htmp->Draw("HE");
3685 pLegendXClN.AddEntry(htmp,"No cut","L");
3686
3687 for (Int_t i = 0; i < ncellcuts; i++) {
3688 if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3689 else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
3690 htmp->SetLineColor(ecutcolor[i]);
3691 htmp->Rebin(rbR);
3692 htmp->Draw("same HE");
3693 if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3694 else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3695
3696 }
3697 }
3698 pLegendXClN.Draw();
3699
c8fe2783 3700 //X
a6f26052 3701 cxn->cd(2) ;
3702 gPad->SetLogy();
3703 gPad->SetGridy();
5025c139 3704
3705 delete htmp;
a6f26052 3706 htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
3707 if(htmp){
3708 htmp->SetMinimum(1);
3709 htmp->Rebin(rbX);
3710 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3711 htmp->SetAxisRange(xmin,xmax,"X");
3712 htmp->Draw("HE");
3713
3714 for (Int_t i = 0; i < ncellcuts; i++) {
3715 if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3716 else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
3717 htmp->SetLineColor(ecutcolor[i]);
3718 htmp->Rebin(rbX);
3719 htmp->Draw("same HE");
3720 }
3721 }
c8fe2783 3722 //Y
a6f26052 3723 cxn->cd(3) ;
3724 gPad->SetLogy();
3725 gPad->SetGridy();
5025c139 3726 delete htmp;
a6f26052 3727 htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
3728 if(htmp){
3729 htmp->SetMinimum(1);
3730 htmp->Rebin(rbY);
3731 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3732 htmp->SetAxisRange(ymin,ymax,"X");
3733 htmp->Draw("HE");
3734
3735 for (Int_t i = 0; i < ncellcuts; i++) {
3736 if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3737 else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
3738 htmp->SetLineColor(ecutcolor[i]);
3739 htmp->Rebin(rbY);
3740 htmp->Draw("same HE");
3741 }
3742 }
c8fe2783 3743 //Z
a6f26052 3744 cxn->cd(4) ;
3745 gPad->SetLogy();
3746 gPad->SetGridy();
3747
5025c139 3748 delete htmp;
a6f26052 3749 htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
3750 if(htmp){
3751 htmp->SetMinimum(1);
3752 htmp->Rebin(rbZ);
3753 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3754 htmp->SetAxisRange(zmin,zmax,"X");
3755 htmp->Draw("HE");
3756
3757 for (Int_t i = 0; i < ncellcuts; i++) {
3758 if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3759 else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
3760 htmp->SetLineColor(ecutcolor[i]);
3761 htmp->Rebin(rbZ);
3762 htmp->Draw("same HE");
3763 }
3764 }
3765
164a1d84 3766 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
a6f26052 3767 cxn->Print(name); printf("Create plot %s\n",name);
3768
3769
c8fe2783 3770 //----------------------------------------------------------
3771 // Cell X, Y, Z, R, energy cut dependence
3772 //---------------------------------------------------------
a6f26052 3773
164a1d84 3774 snprintf(cname,buffersize,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
a6f26052 3775 TCanvas * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
3776 cxecell->Divide(2, 2);
c8fe2783 3777 //R
a6f26052 3778 cxecell->cd(1) ;
3779 gPad->SetLogy();
3780 gPad->SetGridy();
3781
3782 TLegend pLegendXCell(0.83,0.6,0.95,0.93);
3783 pLegendXCell.SetTextSize(0.03);
3784 pLegendXCell.SetFillColor(10);
3785 pLegendXCell.SetBorderSize(1);
3786
5025c139 3787 delete htmp;
a6f26052 3788 htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
3789 if(htmp){
3790 htmp->SetMinimum(1);
3791 htmp->Rebin(rbR);
3792 htmp->SetTitle("r of cells for energy in cluster > threshold");
3793 htmp->SetAxisRange(rmin,rmax,"X");
3794 htmp->Draw("HE");
3795 pLegendXCell.AddEntry(htmp,"No cut","L");
3796
3797 for (Int_t i = 0; i < ncuts; i++) {
3798 binmin = hE->FindBin(ecut[i]);
c8fe2783 3799 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3800 htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
3801 htmp->SetLineColor(ecutcolor[i]);
3802 htmp->Rebin(rbR);
3803 htmp->Draw("same HE");
3804 pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3805 }
3806 }
3807 pLegendXCell.Draw();
3808
c8fe2783 3809 //X
a6f26052 3810 cxecell->cd(2) ;
3811 gPad->SetLogy();
3812 gPad->SetGridy();
3813
5025c139 3814 delete htmp;
a6f26052 3815 htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
3816 if(htmp){
3817 htmp->SetMinimum(1);
3818 htmp->Rebin(rbX);
3819 htmp->SetTitle("x of cells for energy in cluster > threshold");
3820 htmp->SetAxisRange(xmin,xmax,"X");
3821 htmp->Draw("HE");
3822
3823 for (Int_t i = 0; i < ncuts; i++) {
3824 binmin = hE->FindBin(ecut[i]);
c8fe2783 3825 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3826 htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
3827 htmp->SetLineColor(ecutcolor[i]);
3828 htmp->Rebin(rbX);
3829 htmp->Draw("same HE");
3830 }
3831 }
c8fe2783 3832 //Y
a6f26052 3833 cxecell->cd(3) ;
3834 gPad->SetLogy();
3835 gPad->SetGridy();
5025c139 3836 delete htmp;
a6f26052 3837 htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
3838 if(htmp){
3839 htmp->SetMinimum(1);
3840 htmp->Rebin(rbY);
3841 htmp->SetTitle("y of cells for energy in cluster > threshold");
3842 htmp->SetAxisRange(ymin,ymax,"X");
3843 htmp->Draw("HE");
3844
3845 for (Int_t i = 0; i < ncuts; i++) {
3846 binmin = hE->FindBin(ecut[i]);
c8fe2783 3847 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3848 delete htmp;
a6f26052 3849 htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
3850 htmp->SetLineColor(ecutcolor[i]);
3851 htmp->Rebin(rbY);
3852 htmp->Draw("same HE");
3853 }
3854 }
c8fe2783 3855 //Z
a6f26052 3856 cxecell->cd(4) ;
3857 gPad->SetLogy();
3858 gPad->SetGridy();
5025c139 3859 delete htmp;
a6f26052 3860 htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
3861 if(htmp){
3862 htmp->SetMinimum(1);
3863 htmp->Rebin(rbZ);
3864 htmp->SetTitle("z of cells for energy in cluster > threshold");
3865 htmp->SetAxisRange(zmin,zmax,"X");
3866 htmp->Draw("HE");
3867
3868 for (Int_t i = 0; i < ncuts; i++) {
3869 binmin = hE->FindBin(ecut[i]);
c8fe2783 3870 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3871 delete htmp;
a6f26052 3872 htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
3873 htmp->SetLineColor(ecutcolor[i]);
3874 htmp->Rebin(rbZ);
3875 htmp->Draw("same HE");
3876 }
3877 }
164a1d84 3878 snprintf(name,buffersize,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
a6f26052 3879 cxecell->Print(name); printf("Create plot %s\n",name);
3880
3881
c8fe2783 3882 //----------------------------------------------------------
3883 // Cluster-Cell X, Y, Z, R, cluster energy cut dependence
3884 //---------------------------------------------------------
a6f26052 3885 Int_t rbDR= 1;//rbR;
3886 Int_t rbDX= 1;//rbX;
3887 Int_t rbDY= 1;//rbY;
3888 Int_t rbDZ= 1;//rbZ;
3889
164a1d84 3890 snprintf(cname,buffersize,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
a6f26052 3891 TCanvas * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
3892 cxde->Divide(2, 2);
c8fe2783 3893 //R
a6f26052 3894 cxde->cd(1) ;
3895 gPad->SetLogy();
3896 gPad->SetGridy();
3897
3898 TLegend pLegendXClD(0.83,0.6,0.95,0.93);
3899 pLegendXClD.SetTextSize(0.03);
3900 pLegendXClD.SetFillColor(10);
3901 pLegendXClD.SetBorderSize(1);
3902
5025c139 3903 delete htmp;
a6f26052 3904 htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
3905 if(htmp){
3906 htmp->SetMinimum(1);
3907 htmp->Rebin(rbDR);
3908 htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
3909 htmp->SetAxisRange(-50,50,"X");
3910 htmp->Draw("HE");
3911 pLegendXCl.AddEntry(htmp,"No cut","L");
3912
3913 for (Int_t i = 0; i < ncuts; i++) {
3914 binmin = hE->FindBin(ecut[i]);
c8fe2783 3915 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3916 delete htmp;
a6f26052 3917 htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
3918 htmp->SetLineColor(ecutcolor[i]);
3919 htmp->Rebin(rbDR);
3920 htmp->Draw("same HE");
3921 pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3922 }
3923 }
3924 pLegendXClD.Draw();
3925
c8fe2783 3926 //X
a6f26052 3927 cxde->cd(2) ;
3928 gPad->SetLogy();
3929 gPad->SetGridy();
5025c139 3930 delete htmp;
a6f26052 3931 htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
3932 if(htmp){
3933 htmp->SetMinimum(1);
3934 htmp->Rebin(rbDX);
3935 htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
3936 htmp->SetAxisRange(-50,50,"X");
3937 htmp->Draw("HE");
3938
3939 for (Int_t i = 0; i < ncuts; i++) {
3940 binmin = hE->FindBin(ecut[i]);
c8fe2783 3941 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3942 delete htmp;
a6f26052 3943 htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
3944 htmp->SetLineColor(ecutcolor[i]);
3945 htmp->Rebin(rbDX);
3946 htmp->Draw("same HE");
3947
3948 }
3949 }
c8fe2783 3950 //Y
a6f26052 3951 cxde->cd(3) ;
3952 gPad->SetLogy();
3953 gPad->SetGridy();
5025c139 3954 delete htmp;
a6f26052 3955 htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
3956 if(htmp){
3957 htmp->SetMinimum(1);
3958 htmp->Rebin(rbDY);
3959 htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
3960 htmp->SetAxisRange(-50,50,"X");
3961 htmp->Draw("HE");
3962
3963 for (Int_t i = 0; i < ncuts; i++) {
3964 binmin = hE->FindBin(ecut[i]);
c8fe2783 3965 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3966 delete htmp;
a6f26052 3967 htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
3968 htmp->SetLineColor(ecutcolor[i]);
3969 htmp->Rebin(rbDY);
3970 htmp->Draw("same HE");
3971
3972 }
3973 }
c8fe2783 3974 //Z
a6f26052 3975 cxde->cd(4) ;
3976 gPad->SetLogy();
3977 gPad->SetGridy();
3978
5025c139 3979 delete htmp;
a6f26052 3980 htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
3981 if(htmp){
3982 htmp->SetMinimum(1);
3983 htmp->Rebin(rbZ);
3984 htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
3985 htmp->SetAxisRange(-50,50,"X");
3986 htmp->Draw("HE");
3987
3988 for (Int_t i = 0; i < ncuts; i++) {
3989 binmin = hE->FindBin(ecut[i]);
c8fe2783 3990 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3991 delete htmp;
a6f26052 3992 htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
3993 htmp->SetLineColor(ecutcolor[i]);
3994 htmp->Rebin(rbZ);
3995 htmp->Draw("same HE");
3996
3997 }
3998 }
3999
164a1d84 4000 snprintf(name,buffersize,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
a6f26052 4001 cxde->Print(name); printf("Create plot %s\n",name);
4002
4003
c8fe2783 4004 //----------------------------------------------------------
4005 // Cluster-Cell X, Y, Z, R, NCells in cluster dependence
4006 //---------------------------------------------------------
164a1d84 4007 snprintf(cname,buffersize,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
a6f26052 4008 TCanvas * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
4009 cxdn->Divide(2, 2);
c8fe2783 4010 //R
a6f26052 4011 cxdn->cd(1) ;
4012 gPad->SetLogy();
4013 gPad->SetGridy();
4014
4015 TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
4016 pLegendXClDN.SetTextSize(0.03);
4017 pLegendXClDN.SetFillColor(10);
4018 pLegendXClDN.SetBorderSize(1);
5025c139 4019 delete htmp;
a6f26052 4020 htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
4021 if(htmp){
4022 htmp->SetMinimum(1);
4023 htmp->Rebin(rbDR);
4024 htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
4025 htmp->SetAxisRange(-50,50,"X");
4026 htmp->Draw("HE");
4027 pLegendXClDN.AddEntry(htmp,"No cut","L");
4028
4029 for (Int_t i = 0; i < ncellcuts; i++) {
5025c139 4030 delete htmp;
a6f26052 4031 if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
4032 else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
4033 htmp->SetLineColor(ecutcolor[i]);
4034 htmp->Rebin(rbDR);
4035 htmp->Draw("same HE");
4036 if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
4037 else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
4038
4039 }
4040 }
4041 pLegendXClDN.Draw();
4042
c8fe2783 4043 //X
a6f26052 4044 cxdn->cd(2) ;
4045 gPad->SetLogy();
4046 gPad->SetGridy();
5025c139 4047 delete htmp;
a6f26052 4048 htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
4049 if(htmp){
4050 htmp->SetMinimum(1);
4051 htmp->Rebin(rbDX);
4052 htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
4053 htmp->SetAxisRange(-50,50,"X");
4054 htmp->Draw("HE");
4055
4056 for (Int_t i = 0; i < ncellcuts; i++) {
5025c139 4057 delete htmp;
a6f26052 4058 if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
4059 else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
4060 htmp->SetLineColor(ecutcolor[i]);
4061 htmp->Rebin(rbDX);
4062 htmp->Draw("same HE");
4063
4064 }
4065 }
c8fe2783 4066 //Y
a6f26052 4067 cxdn->cd(3) ;
4068 gPad->SetLogy();
4069 gPad->SetGridy();
5025c139 4070 delete htmp;
a6f26052 4071 htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
4072 if(htmp){
4073 htmp->SetMinimum(1);
4074 htmp->Rebin(rbDY);
4075 htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
4076 htmp->SetAxisRange(-50,50,"X");
4077 htmp->Draw("HE");
4078
4079 for (Int_t i = 0; i < ncellcuts; i++) {
5025c139 4080 delete htmp;
a6f26052 4081 if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
4082 else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
4083 htmp->SetLineColor(ecutcolor[i]);
4084 htmp->Rebin(rbDY);
4085 htmp->Draw("same HE");
4086
4087 }
4088 }
c8fe2783 4089 //Z
a6f26052 4090 cxdn->cd(4) ;
4091 gPad->SetLogy();
4092 gPad->SetGridy();
5025c139 4093 delete htmp;
a6f26052 4094 htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
4095 if(htmp){
4096 htmp->SetMinimum(1);
4097 htmp->Rebin(rbDZ);
4098 htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
4099 htmp->SetAxisRange(-50,50,"X");
4100 htmp->Draw("HE");
4101
4102 for (Int_t i = 0; i < ncellcuts; i++) {
5025c139 4103 delete htmp;
a6f26052 4104 if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
4105 else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
4106 htmp->SetLineColor(ecutcolor[i]);
4107 htmp->Rebin(rbDZ);
4108 htmp->Draw("same HE");
4109
4110 }
4111 }
4112
164a1d84 4113 snprintf(name,buffersize,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
a6f26052 4114 cxdn->Print(name); printf("Create plot %s\n",name);
4115
54769bc0 4116 }
c8fe2783 4117
a6f26052 4118 //----------------------------------------------------------
4119 //Reconstructed clusters energy-eta-phi distributions, matched with tracks
4120 //----------------------------------------------------------
4121 TH1F * hEChargedClone = 0 ;
4122 TH1F * hPtChargedClone = 0 ;
4123 TH1F * hEtaChargedClone = 0 ;
4124 TH1F * hPhiChargedClone = 0 ;
54769bc0 4125 if(fFillAllTH12){
a6f26052 4126 hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
4127 hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
4128 hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
4129 hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
4130
164a1d84 4131 snprintf(cname,buffersize,"QA_%s_rectrackmatch",fCalorimeter.Data());
a6f26052 4132 TCanvas * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
4133 ccltm->Divide(3, 1);
4134
4135 ccltm->cd(1) ;
4136 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
4137 fhECharged->Rebin(rbE);
4138 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4139 fhECharged->SetMinimum(1);
4140 fhECharged->Draw();
4141
4142 ccltm->cd(2) ;
4143 if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
4144 fhPhiCharged->Rebin(rbPhi);
4145 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4146 fhPhiCharged->Draw();
4147 fhPhiCharged->Draw();
4148
4149 ccltm->cd(3) ;
4150 if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
4151 fhEtaCharged->Rebin(rbEta);
4152 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4153 fhEtaCharged->Draw();
4154 fhEtaCharged->Draw();
4155
164a1d84 4156 snprintf(name,buffersize,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
a6f26052 4157 ccltm->Print(name); printf("Plot: %s\n",name);
4158
c8fe2783 4159 //----------------------------------------------------------
4160 // Ratio of reconstructed clusters energy-eta-phi distributions, matched with tracks over all
4161 //----------------------------------------------------------
a6f26052 4162
164a1d84 4163 snprintf(cname,buffersize,"%s_QA_ChargedRatio",fCalorimeter.Data());
a6f26052 4164 TCanvas * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
4165 ccharge->Divide(3, 1);
4166
4167 ccharge->cd(1) ;
4168 fhECharged->Sumw2();
4169 fhE->Sumw2();
4170 fhECharged->Divide(fhE);
4171 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4172 fhECharged->SetMaximum(0.5);
4173 fhECharged->SetYTitle("track-matched clusters / all clusters");
4174 fhECharged->Draw("HE");
4175
4176 ccharge->cd(2) ;
4177 fhPhiCharged->Sumw2();
4178 fhPhi->Rebin(rbPhi);
4179 fhPhi->Sumw2();
4180 fhPhiCharged->Divide(fhPhi);
4181 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4182 fhPhiCharged->SetMaximum(0.5);
4183 fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
4184 fhPhiCharged->Draw("HE");
4185
4186 ccharge->cd(3) ;
4187 fhEtaCharged->Sumw2();
4188 fhEta->Rebin(rbEta);
4189 fhEta->Sumw2();
4190 fhEtaCharged->Divide(fhEta);
4191 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4192 fhEtaCharged->SetMaximum(0.5);
4193 fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
4194 fhEtaCharged->Draw("HE");
4195
164a1d84 4196 snprintf(name,buffersize,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
a6f26052 4197 ccharge->Print(name); printf("Create plot %s\n",name);
54769bc0 4198 }
a6f26052 4199 //-------------------------------------------
4200 // N Cells - N Clusters - N Cells per cluster
4201 //-------------------------------------------
54769bc0 4202 snprintf(cname,buffersize,"QA_%s_nclustercells",fCalorimeter.Data());
4203 TCanvas * cN = new TCanvas(cname, " Number of CaloClusters and CaloCells", 800, 1200) ;
4204 cN->Divide(2, 3);
4205
4206 cN->cd(1) ;
4207
4208 TLegend pLegendN(0.7,0.6,0.9,0.8);
4209 pLegendN.SetTextSize(0.03);
4210 pLegendN.AddEntry(fhNClusters,"all modules","L");
4211 pLegendN.SetFillColor(10);
4212 pLegendN.SetBorderSize(1);
4213
4214 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
4215 gPad->SetLogx();
4216 fhNClusters->SetLineColor(1);
4217
4218 Int_t rbN = 1;
4219 if(fhNClusters->GetNbinsX()> nbins) rbN = fhNClusters->GetNbinsX()/nbins;
4220
4221 fhNClusters->SetAxisRange(nmin,nmax,"X");
4222 fhNClusters->Draw("HE");
4223 for(Int_t imod = 0; imod < fNModules; imod++){
4224 fhNClustersMod[imod]->SetAxisRange(nmin,nmax,"X");
4225 fhNClustersMod[imod]->SetLineColor(modColorIndex[imod]);
4226 fhNClustersMod[imod]->Draw("same");
4227 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
4228 }
4229 pLegendN.Draw();
4230
4231 cN->cd(2) ;
4232 gPad->SetLogx();
4233 for(Int_t imod = 1; imod < fNModules; imod++){
5025c139 4234 delete htmp;
54769bc0 4235 htmp = (TH1D*)fhNClustersMod[imod]->Clone(Form("hNClustersRat%d",imod));
4236 htmp->Divide(fhNClustersMod[0]);
4237 htmp->SetLineColor(modColorIndex[imod]);
4238 if(imod==1){
4239 htmp->SetTitle("Ratio # clusters in module X / module 0");
4240 htmp->SetMaximum(5);
4241 htmp->SetMinimum(0);
4242 htmp->Draw("HE");
4243 }
4244 else
4245 htmp->Draw("same HE");
4246
4247 }
4248
4249 cN->cd(3) ;
4250 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
4251 gPad->SetLogx();
4252 fhNCells->SetLineColor(1);
4253 fhNCells->SetAxisRange(nmin,nmax,"X");
4254 fhNCells->Draw("HE");
4255 for(Int_t imod = 0; imod < fNModules; imod++){
4256 fhNCellsMod[imod]->SetAxisRange(nmin,nmax,"X");
4257 fhNCellsMod[imod]->SetLineColor(modColorIndex[imod]);
4258 fhNCellsMod[imod]->Draw("same HE");
4259 }
4260
4261
4262 cN->cd(4) ;
4263 gPad->SetLogx();
4264 for(Int_t imod = 1; imod < fNModules; imod++){
5025c139 4265 delete htmp;
54769bc0 4266 htmp = (TH1D*)fhNCellsMod[imod]->Clone(Form("hNCellsRat%d",imod));
4267 htmp->Divide(fhNCellsMod[0]);
4268 htmp->SetLineColor(modColorIndex[imod]);
4269 if(imod==1){
4270 htmp->SetTitle("Ratio # cells in module X / module 0");
4271 htmp->SetMaximum(5);
4272 htmp->SetMinimum(0);
4273 htmp->Draw("HE");
4274 }
4275 else
4276 htmp->Draw("same HE");
4277
4278 }
4279
4280 cN->cd(5) ;
4281 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
4282 gPad->SetLogx();
3f5990d6 4283 TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1);
54769bc0 4284 cpc->SetLineColor(1);
4285 cpc->SetTitle("# cells per cluster");
4286 cpc->Draw("HE");
4287 TH1D ** hNCellsCluster1D = new TH1D*[fNModules];
4288
4289 for(Int_t imod = 0; imod < fNModules; imod++){
4290 hNCellsCluster1D[imod] = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
4291 hNCellsCluster1D[imod]->SetLineColor(modColorIndex[imod]);
4292 hNCellsCluster1D[imod]->Draw("same HE");
4293 }
4294
4295
4296 cN->cd(6) ;
4297 gPad->SetLogx();
4298 for(Int_t imod = 1; imod < fNModules; imod++){
5025c139 4299 delete htmp;
54769bc0 4300 htmp = (TH1D*)hNCellsCluster1D[imod]->Clone(Form("hNClustersCells1DRat%d",imod));
4301 htmp->Divide(hNCellsCluster1D[0]);
4302 htmp->SetLineColor(modColorIndex[imod]);
4303 if(imod==1){
4304 htmp->SetTitle("Ratio # cells per cluster in module X / module 0");
a6f26052 4305 //htmp->SetAxisRange(ptmin,ptmax,"X");
54769bc0 4306 htmp->SetMaximum(3.5);
4307 htmp->SetMinimum(0);
4308 htmp->Draw("HE");
4309 }
4310 else
4311 htmp->Draw("same HE");
4312 }
572157db 4313 delete [] hNCellsCluster1D;
54769bc0 4314
4315 snprintf(name,buffersize,"QA_%s_NumberCaloClustersAndCaloCells.eps",fCalorimeter.Data());
4316 cN->Print(name); printf("Print plot %s\n",name);
4317
a6f26052 4318 //----------------------------------------------------
4319 // Cell Time histograms, time only available in ESDs
4320 //----------------------------------------------------
54769bc0 4321 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
c8fe2783 4322
54769bc0 4323 snprintf(cname,buffersize,"QA_%s_cellstime",fCalorimeter.Data());
4324 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
4325 ctime->Divide(3, 1);
4326
4327 Int_t rbTime = 1;
4328 if(fhTime->GetNbinsX()> ntimebins) rbTime = fhTime->GetNbinsX()/ntimebins;
4329
4330 ctime->cd(1) ;
4331 if(fhTime->GetEntries() > 0) gPad->SetLogy();
4332 fhTime->Rebin(rbTime);
4333 fhTime->SetAxisRange(timemin,timemax,"X");
4334 fhTime->Draw();
4335
4336 ctime->cd(2) ;
4337 fhTimeId->SetTitleOffset(1.8,"Y");
4338 fhTimeId->SetAxisRange(timemin,timemax,"X");
4339 fhTimeId->Draw("colz");
4340
4341 ctime->cd(3) ;
4342 fhTimeAmp->SetTitle("Cell Energy vs Cell Time");
4343 fhTimeAmp->SetTitleOffset(1.8,"Y");
4344 fhTimeAmp->SetAxisRange(timemin,timemax,"Y");
4345 fhTimeAmp->SetAxisRange(ptmin,ptmax,"X");
4346 fhTimeAmp->Draw("colz");
4347
4348 snprintf(name,buffersize,"QA_%s_CellsTime.eps",fCalorimeter.Data());
4349 ctime->Print(name); printf("Plot: %s\n",name);
4350 }
4351
4352
a6f26052 4353 //---------------------------------
4354 //Grid of cell per module plots
4355 //---------------------------------
54769bc0 4356 {
a6f26052 4357 //Number of entries per cell
c8fe2783 4358 gStyle->SetPadRightMargin(0.15);
164a1d84 4359 snprintf(cname,buffersize,"%s_QA_GridCellEntries",fCalorimeter.Data());
c8fe2783 4360 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
4361 if(fNModules%2 == 0)
4362 cgrid->Divide(fNModules/2,2);
4363 else
4364 cgrid->Divide(fNModules/2+1,2);
4365
4366 for(Int_t imod = 0; imod < fNModules ; imod++){
4367 cgrid->cd(imod+1);
4368 gPad->SetLogz();
4369 gPad->SetGridy();
4370 gPad->SetGridx();
a6f26052 4371 //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
c8fe2783 4372 fhGridCellsMod[imod]->SetZTitle("Counts ");
4373 fhGridCellsMod[imod]->SetYTitle("row (phi direction) ");
a6f26052 4374 //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
c8fe2783 4375 fhGridCellsMod[imod]->Draw("colz");
4376 }
164a1d84 4377 snprintf(name,buffersize,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
c8fe2783 4378 cgrid->Print(name); printf("Create plot %s\n",name);
4379
164a1d84 4380 snprintf(cname,buffersize,"%s_QA_GridCellAccumEnergy",fCalorimeter.Data());
c8fe2783 4381 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
4382 if(fNModules%2 == 0)
4383 cgridE->Divide(fNModules/2,2);
4384 else
4385 cgridE->Divide(fNModules/2+1,2);
4386 for(Int_t imod = 0; imod < fNModules ; imod++){
4387 cgridE->cd(imod+1);
4388 gPad->SetLogz();
4389 gPad->SetGridy();
4390 gPad->SetGridx();
a6f26052 4391 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
c8fe2783 4392 fhGridCellsEMod[imod]->SetZTitle("Accumulated Energy (GeV) ");
4393 fhGridCellsEMod[imod]->SetYTitle("row (phi direction) ");
4394 fhGridCellsEMod[imod]->Draw("colz");
4395 }
164a1d84 4396 snprintf(name,buffersize,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
c8fe2783 4397 cgridE->Print(name); printf("Create plot %s\n",name);
4398
a6f26052 4399 //Accumulated energy per cell
164a1d84 4400 snprintf(cname,buffersize,"%s_QA_GridCellAverageEnergy",fCalorimeter.Data());
c8fe2783 4401 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
4402 if(fNModules%2 == 0)
4403 cgridEA->Divide(fNModules/2,2);
4404 else
4405 cgridEA->Divide(fNModules/2+1,2);
4406 for(Int_t imod = 0; imod < fNModules ; imod++){
4407 cgridEA->cd(imod+1);
4408 gPad->SetLogz();
4409 gPad->SetGridy();
4410 gPad->SetGridx();
a6f26052 4411 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
c8fe2783 4412 fhGridCellsEMod[imod]->SetZTitle("Average Energy (GeV) ");
4413 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
4414 fhGridCellsEMod[imod]->Draw("colz");
4415 }
164a1d84 4416 snprintf(name,buffersize,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
c8fe2783 4417 cgridEA->Print(name); printf("Create plot %s\n",name);
4418
a6f26052 4419 //Accumulated Time per cell, E > 0.5 GeV
c8fe2783 4420
164a1d84 4421 snprintf(cname,buffersize,"%s_QA_GridCellAccumTime",fCalorimeter.Data());
c8fe2783 4422 TCanvas *cgridT = new TCanvas("cgridT","Summed time per cell", 12,12,800,400);
4423 if(fNModules%2 == 0)
4424 cgridT->Divide(fNModules/2,2);
4425 else
4426 cgridE->Divide(fNModules/2+1,2);
4427 for(Int_t imod = 0; imod < fNModules ; imod++){
4428 cgridT->cd(imod+1);
4429 gPad->SetLogz();
4430 gPad->SetGridy();
4431 gPad->SetGridx();
a6f26052 4432 //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
c8fe2783 4433 fhGridCellsTimeMod[imod]->SetZTitle("Accumulated Time (ns) ");
4434 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction) ");
4435 fhGridCellsTimeMod[imod]->Draw("colz");
4436 }
164a1d84 4437 snprintf(name,buffersize,"QA_%s_GridCellsAccumTime.eps",fCalorimeter.Data());
c8fe2783 4438 cgridT->Print(name); printf("Create plot %s\n",name);
255b904d 4439
54769bc0 4440 }
4441
a6f26052 4442 //---------------------------------------------
4443 //Calorimeter Correlation, PHOS vs EMCAL
4444 //---------------------------------------------
798a9b04 4445 if(fCorrelate){
54769bc0 4446
4447 snprintf(cname,buffersize,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
4448 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
4449 ccorr->Divide(2, 2);
c8fe2783 4450
54769bc0 4451 ccorr->cd(1) ;
a6f26052 4452 //gPad->SetLogy();
4453 //gPad->SetLogx();
54769bc0 4454 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"X");
4455 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"Y");
4456 fhCaloCorrNClusters ->Draw();
c8fe2783 4457
54769bc0 4458 ccorr->cd(2) ;
a6f26052 4459 //gPad->SetLogy();
4460 //gPad->SetLogx();
54769bc0 4461 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"X");
4462 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"Y");
4463 fhCaloCorrNCells->Draw();
c8fe2783 4464
a6f26052 4465 //gPad->SetLogy();
4466 //gPad->SetLogx();
54769bc0 4467 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"X");
4468 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"Y");
4469 fhCaloCorrEClusters->Draw();
c8fe2783 4470
54769bc0 4471 ccorr->cd(4) ;
a6f26052 4472 //gPad->SetLogy();
4473 //gPad->SetLogx();
54769bc0 4474 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"X");
4475 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"Y");
4476 fhCaloCorrECells->Draw();
c8fe2783 4477
54769bc0 4478 snprintf(name,buffersize,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
4479 ccorr->Print(name); printf("Plot: %s\n",name);
4480 }
c8fe2783 4481
a6f26052 4482 //----------------------------
4483 //Invariant mass
4484 //-----------------------------
255b904d 4485
54769bc0 4486 Int_t imbinmin = -1;
4487 Int_t imbinmax = -1;
4488
4489 if(fhIM->GetEntries() > 1){
4490 Int_t nebins = fhIM->GetNbinsX();
4491 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
4492 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
4493 if (emin != 0 ) printf("emin != 0 \n");
a6f26052 4494 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
54769bc0 4495
4496 snprintf(cname,buffersize,"QA_%s_IM",fCalorimeter.Data());
a6f26052 4497 // printf("c5\n");
54769bc0 4498 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
4499 c5->Divide(2, 3);
4500
4501 c5->cd(1) ;
a6f26052 4502 //fhIM->SetLineColor(4);
4503 //fhIM->Draw();
54769bc0 4504 imbinmin = 0;
4505 imbinmax = (Int_t) (1-emin)*nebins/emax;
4506 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),imbinmin,imbinmax);
4507 pyim1->SetTitle("E_{pair} < 1 GeV");
4508 pyim1->SetLineColor(1);
4509 pyim1->Draw();
4510 TLegend pLegendIM(0.7,0.6,0.9,0.8);
4511 pLegendIM.SetTextSize(0.03);
4512 pLegendIM.AddEntry(pyim1,"all modules","L");
4513 pLegendIM.SetFillColor(10);
4514 pLegendIM.SetBorderSize(1);
a6f26052 4515 //FIXME
54769bc0 4516 for(Int_t imod = 0; imod < fNModules; imod++){
4517 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4518 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
4519 pyim1->SetLineColor(imod+1);
4520 pyim1->Draw("same");
4521 }
4522 pLegendIM.Draw();
4523
4524 c5->cd(2) ;
4525 imbinmin = (Int_t) (1-emin)*nebins/emax;
4526 imbinmax = (Int_t) (2-emin)*nebins/emax;
4527 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),imbinmin,imbinmax);
4528 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
4529 pyim2->SetLineColor(1);
4530 pyim2->Draw();
4531 for(Int_t imod = 0; imod < fNModules; imod++){
4532 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4533 pyim2->SetLineColor(imod+1);
4534 pyim2->Draw("same");
4535 }
4536
4537 c5->cd(3) ;
4538 imbinmin = (Int_t) (2-emin)*nebins/emax;
4539 imbinmax = (Int_t) (3-emin)*nebins/emax;
4540 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),imbinmin,imbinmax);
4541 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
4542 pyim3->SetLineColor(1);
4543 pyim3->Draw();
4544 for(Int_t imod = 0; imod < fNModules; imod++){
4545 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4546 pyim3->SetLineColor(imod+1);
4547 pyim3->Draw("same");
4548 }
4549
4550 c5->cd(4) ;
4551 imbinmin = (Int_t) (3-emin)*nebins/emax;
4552 imbinmax = (Int_t) (4-emin)*nebins/emax;
4553 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),imbinmin,imbinmax);
4554 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
4555 pyim4->SetLineColor(1);
4556 pyim4->Draw();
4557 for(Int_t imod = 0; imod < fNModules; imod++){
4558 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4559 pyim4->SetLineColor(imod+1);
4560 pyim4->Draw("same");
4561 }
4562
4563 c5->cd(5) ;
4564 imbinmin = (Int_t) (4-emin)*nebins/emax;
4565 imbinmax = (Int_t) (5-emin)*nebins/emax;
4566 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),imbinmin,imbinmax);
4567 pyim5->SetTitle("4< E_{pair} < 5 GeV");
4568 pyim5->SetLineColor(1);
4569 pyim5->Draw();
4570 for(Int_t imod = 0; imod < fNModules; imod++){
4571 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4572 pyim5->SetLineColor(imod+1);
4573 pyim5->Draw("same");
4574 }
4575
4576 c5->cd(6) ;
4577 imbinmin = (Int_t) (5-emin)*nebins/emax;
4578 imbinmax = -1;
4579 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),imbinmin,imbinmax);
4580 pyim10->SetTitle("E_{pair} > 5 GeV");
4581 pyim10->SetLineColor(1);
4582 pyim10->Draw();
4583 for(Int_t imod = 0; imod < fNModules; imod++){
4584 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4585 pyim10->SetLineColor(imod+1);
4586 pyim10->Draw("same");
4587 }
4588
4589 snprintf(name,buffersize,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
4590 c5->Print(name); printf("Plot: %s\n",name);
4591 }
4592
a6f26052 4593 //--------------------------------------------------
4594 //Invariant mass, clusters with more than one cell
4595 //-------------------------------------------------
54769bc0 4596 if(fhIMCellCut->GetEntries() > 1){
4597 Int_t nebins = fhIMCellCut->GetNbinsX();
4598 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
4599 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
4600 if (emin != 0 ) printf("emin != 0 \n");
a6f26052 4601 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
a5fafd85 4602
54769bc0 4603 snprintf(cname,buffersize,"QA_%s_IMCellCut",fCalorimeter.Data());
a6f26052 4604 // printf("c5cc\n");
54769bc0 4605 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
4606 c5cc->Divide(2, 3);
4607
4608 c5cc->cd(1) ;
a6f26052 4609 //fhIMCellCut->SetLineColor(4);
4610 //fhIMCellCut->Draw();
54769bc0 4611 imbinmin = 0;
4612 imbinmax = (Int_t) (1-emin)*nebins/emax;
4613 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),imbinmin,imbinmax);
4614 pyimcc1->SetTitle("E_{pair} < 1 GeV");
4615 pyimcc1->SetLineColor(1);
4616 pyimcc1->Draw();
4617 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
4618 pLegendIMCellCut.SetTextSize(0.03);
4619 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
4620 pLegendIMCellCut.SetFillColor(10);
4621 pLegendIMCellCut.SetBorderSize(1);
4622
4623 for(Int_t imod = 0; imod < fNModules; imod++){
4624 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4625 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
4626 pyimcc1->SetLineColor(imod+1);
4627 pyimcc1->Draw("same");
4628 }
4629 pLegendIMCellCut.Draw();
4630
4631 c5cc->cd(2) ;
4632 imbinmin = (Int_t) (1-emin)*nebins/emax;
4633 imbinmax = (Int_t) (2-emin)*nebins/emax;
4634 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),imbinmin,imbinmax);
4635 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
4636 pyimcc2->SetLineColor(1);
4637 pyimcc2->Draw();
4638 for(Int_t imod = 0; imod < fNModules; imod++){
4639 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4640 pyimcc2->SetLineColor(imod+1);
4641 pyimcc2->Draw("same");
4642 }
4643
4644 c5cc->cd(3) ;
4645 imbinmin = (Int_t) (2-emin)*nebins/emax;
4646 imbinmax = (Int_t) (3-emin)*nebins/emax;
4647 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),imbinmin,imbinmax);
4648 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
4649 pyimcc3->SetLineColor(1);
4650 pyimcc3->Draw();
4651 for(Int_t imod = 0; imod < fNModules; imod++){
4652 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4653 pyimcc3->SetLineColor(imod+1);
4654 pyimcc3->Draw("same");
4655 }
4656
4657 c5cc->cd(4) ;
4658 imbinmin = (Int_t) (3-emin)*nebins/emax;
4659 imbinmax = (Int_t) (4-emin)*nebins/emax;
4660 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),imbinmin,imbinmax);
4661 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
4662 pyimcc4->SetLineColor(1);
4663 pyimcc4->Draw();
4664 for(Int_t imod = 0; imod < fNModules; imod++){
4665 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4666 pyimcc4->SetLineColor(imod+1);
4667 pyimcc4->Draw("same");
4668 }
4669
4670 c5cc->cd(5) ;
4671 imbinmin = (Int_t) (4-emin)*nebins/emax;
4672 imbinmax = (Int_t) (5-emin)*nebins/emax;
4673 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),imbinmin,imbinmax);
4674 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
4675 pyimcc5cc->SetLineColor(1);
4676 pyimcc5cc->Draw();
4677 for(Int_t imod = 0; imod < fNModules; imod++){
4678 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4679 pyimcc5cc->SetLineColor(imod+1);
4680 pyimcc5cc->Draw("same");
4681 }
4682
4683 c5cc->cd(6) ;
4684 imbinmin = (Int_t) (5-emin)*nebins/emax;
4685 imbinmax = -1;
4686 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),imbinmin,imbinmax);
4687 pyimcc10->SetTitle("E_{pair} > 5 GeV");
4688 pyimcc10->SetLineColor(1);
4689 pyimcc10->Draw();
4690 for(Int_t imod = 0; imod < fNModules; imod++){
4691 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4692 pyimcc10->SetLineColor(imod+1);
4693 pyimcc10->Draw("same");
4694 }
4695
4696 snprintf(name,buffersize,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
4697 c5cc->Print(name); printf("Plot: %s\n",name);
4698 }
4699
4700
a6f26052 4701 //Asymmetry
54769bc0 4702 if(fhAsym->GetEntries() > 1){
4703 Int_t nebins = fhAsym->GetNbinsX();
4704 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
4705 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
4706 if (emin != 0 ) printf("emin != 0 \n");
a6f26052 4707 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
54769bc0 4708
4709 snprintf(cname,buffersize,"QA_%s_Asym",fCalorimeter.Data());
a6f26052 4710 // printf("c5\n");
54769bc0 4711 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
4712 c5b->Divide(2, 2);
4713
4714 c5b->cd(1) ;
4715 fhAsym->SetTitleOffset(1.6,"Y");
4716 fhAsym->SetLineColor(4);
4717 fhAsym->Draw();
4718
4719 c5b->cd(2) ;
4720 imbinmin = 0;
4721 imbinmax = (Int_t) (5-emin)*nebins/emax;
4722 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),imbinmin,imbinmax);
4723 pyAsym5->SetTitle("E_{pair} < 5 GeV");
4724 pyAsym5->SetLineColor(4);
4725 pyAsym5->Draw();
4726
4727 c5b->cd(3) ;
4728 imbinmin = (Int_t) (5-emin)*nebins/emax;
4729 imbinmax = (Int_t) (10-emin)*nebins/emax;
4730 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),imbinmin,imbinmax);
4731 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
4732 pyAsym510->SetLineColor(4);
4733 pyAsym510->Draw();
4734
4735 c5b->cd(4) ;
4736 imbinmin = (Int_t) (10-emin)*nebins/emax;
4737 imbinmax = -1;
4738 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),imbinmin,imbinmax);
4739 pyAsym10->SetTitle("E_{pair} > 10 GeV");
4740 pyAsym10->SetLineColor(4);
4741 pyAsym10->Draw();
4742
4743 snprintf(name,buffersize,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
4744 c5b->Print(name); printf("Plot: %s\n",name);
4745 }
4746
4747
4748 if(IsDataMC()){
a6f26052 4749 //Reconstructed vs MC distributions
4750 //printf("c6\n");
164a1d84 4751 snprintf(cname,buffersize,"QA_%s_recvsmc",fCalorimeter.Data());
c8fe2783 4752 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4753 c6->Divide(2, 2);
4754
4755 c6->cd(1) ;
4756 fh2E->SetTitleOffset(1.6,"Y");
4757 fh2E->SetLineColor(4);
4758 fh2E->Draw();
4759
4760 c6->cd(2) ;
4761 fh2Pt->SetTitleOffset(1.6,"Y");
4762 fh2Pt->SetLineColor(4);
4763 fh2Pt->Draw();
4764
4765 c6->cd(3) ;
4766 fh2Phi->SetTitleOffset(1.6,"Y");
4767 fh2Phi->SetLineColor(4);
4768 fh2Phi->Draw();
4769
4770 c6->cd(4) ;
4771 fh2Eta->SetTitleOffset(1.6,"Y");
4772 fh2Eta->SetLineColor(4);
4773 fh2Eta->Draw();
4774
164a1d84 4775 snprintf(name,buffersize,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
c8fe2783 4776 c6->Print(name); printf("Plot: %s\n",name);
4777
a6f26052 4778 //Reconstructed vs MC distributions
4779 //printf("c6\n");
164a1d84 4780 snprintf(cname,buffersize,"QA_%s_gamrecvsmc",fCalorimeter.Data());
c8fe2783 4781 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4782 c6Gam->Divide(2, 2);
4783
4784 c6Gam->cd(1) ;
4785 fhGamE->Draw();
4786
4787 c6Gam->cd(2) ;
4788 fhGamPt->Draw();
4789
4790 c6Gam->cd(3) ;
4791 fhGamPhi->Draw();
4792
4793 c6Gam->cd(4) ;
4794 fhGamEta->Draw();
4795
164a1d84 4796 snprintf(name,buffersize,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
c8fe2783 4797 c6->Print(name); printf("Plot: %s\n",name);
4798
a6f26052 4799 //Generated - reconstructed
4800 //printf("c7\n");
164a1d84 4801 snprintf(cname,buffersize,"QA_%s_diffgenrec",fCalorimeter.Data());
c8fe2783 4802 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
4803 c7->Divide(2, 2);
4804
4805 c7->cd(1) ;
4806 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
4807 fhGamDeltaE->SetLineColor(4);
4808 fhDeltaE->Draw();
4809 fhGamDeltaE->Draw("same");
4810
4811 TLegend pLegendd(0.65,0.55,0.9,0.8);
4812 pLegendd.SetTextSize(0.06);
4813 pLegendd.AddEntry(fhDeltaE,"all","L");
4814 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
4815 pLegendd.SetFillColor(10);
4816 pLegendd.SetBorderSize(1);
4817 pLegendd.Draw();
4818
4819 c7->cd(2) ;
4820 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
4821 fhGamDeltaPt->SetLineColor(4);
4822 fhDeltaPt->Draw();
4823 fhGamDeltaPt->Draw("same");
4824
4825 c7->cd(3) ;
4826 fhGamDeltaPhi->SetLineColor(4);
4827 fhDeltaPhi->Draw();
4828 fhGamDeltaPhi->Draw("same");
4829
4830 c7->cd(4) ;
4831 fhGamDeltaEta->SetLineColor(4);
4832 fhDeltaEta->Draw();
4833 fhGamDeltaEta->Draw("same");
4834
164a1d84 4835 snprintf(name,buffersize,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
c8fe2783 4836 c7->Print(name); printf("Plot: %s\n",name);
4837
a6f26052 4838 // Reconstructed / Generated
4839 //printf("c8\n");
164a1d84 4840 snprintf(cname,buffersize,"QA_%s_ratiorecgen",fCalorimeter.Data());
c8fe2783 4841 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
4842 c8->Divide(2, 2);
4843
4844 c8->cd(1) ;
4845 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
4846 fhGamRatioE->SetLineColor(4);
4847 fhRatioE->Draw();
4848 fhGamRatioE->Draw("same");
4849
4850 TLegend pLegendr(0.65,0.55,0.9,0.8);
4851 pLegendr.SetTextSize(0.06);
4852 pLegendr.AddEntry(fhRatioE,"all","L");
4853 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
4854 pLegendr.SetFillColor(10);
4855 pLegendr.SetBorderSize(1);
4856 pLegendr.Draw();
4857
4858 c8->cd(2) ;
4859 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
4860 fhGamRatioPt->SetLineColor(4);
4861 fhRatioPt->Draw();
4862 fhGamRatioPt->Draw("same");
4863
4864 c8->cd(3) ;
4865 fhGamRatioPhi->SetLineColor(4);
4866 fhRatioPhi->Draw();
4867 fhGamRatioPhi->Draw("same");
4868
4869 c8->cd(4) ;
4870 fhGamRatioEta->SetLineColor(4);
4871 fhRatioEta->Draw();
4872 fhGamRatioEta->Draw("same");
4873
164a1d84 4874 snprintf(name,buffersize,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
c8fe2783 4875 c8->Print(name); printf("Plot: %s\n",name);
4876
a6f26052 4877 //MC
c8fe2783 4878
a6f26052 4879 //Generated distributions
4880 //printf("c1\n");
164a1d84 4881 snprintf(cname,buffersize,"QA_%s_gen",fCalorimeter.Data());
c8fe2783 4882 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
4883 c10->Divide(3, 1);
4884
4885 c10->cd(1) ;
4886 gPad->SetLogy();
4887 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
4888 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
4889 fhGenPi0Pt->SetLineColor(1);
4890 fhGenGamPt->SetLineColor(4);
4891 fhGenEtaPt->SetLineColor(2);
4892 fhGenOmegaPt->SetLineColor(7);
4893 fhGenElePt->SetLineColor(6);
4894
a6f26052 4895 //Select the maximum of the histogram to show all lines.
c8fe2783 4896 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4897 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
4898 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
4899 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4900 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
4901 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
4902 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
4903 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4904 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
4905 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4906 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4907 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
4908 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4909 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
4910 haxispt->SetMaximum(fhGenElePt->GetMaximum());
4911 haxispt->SetMinimum(1);
4912 haxispt->Draw("axis");
4913 fhGenPi0Pt->Draw("same");
4914 fhGenGamPt->Draw("same");
4915 fhGenEtaPt->Draw("same");
4916 fhGenOmegaPt->Draw("same");
4917 fhGenElePt->Draw("same");
4918
4919 TLegend pLegend(0.85,0.65,0.95,0.93);
4920 pLegend.SetTextSize(0.06);
4921 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
4922 pLegend.AddEntry(fhGenGamPt," #gamma","L");
4923 pLegend.AddEntry(fhGenEtaPt," #eta","L");
4924 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
4925 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
4926 pLegend.SetFillColor(10);
4927 pLegend.SetBorderSize(1);
4928 pLegend.Draw();
4929
4930 c10->cd(2) ;
4931 gPad->SetLogy();
4932 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
4933 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
4934 fhGenPi0Eta->SetLineColor(1);
4935 fhGenGamEta->SetLineColor(4);
4936 fhGenEtaEta->SetLineColor(2);
4937 fhGenOmegaEta->SetLineColor(7);
4938 fhGenEleEta->SetLineColor(6);
a6f26052 4939 //Select the maximum of the histogram to show all lines.
c8fe2783 4940 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4941 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
4942 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
4943 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4944 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4945 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
4946 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
4947 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4948 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
4949 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4950 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4951 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
4952 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4953 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
4954 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
4955 haxiseta->SetMinimum(100);
4956 haxiseta->Draw("axis");
4957 fhGenPi0Eta->Draw("same");
4958 fhGenGamEta->Draw("same");
4959 fhGenEtaEta->Draw("same");
4960 fhGenOmegaEta->Draw("same");
4961 fhGenEleEta->Draw("same");
4962
4963
4964 c10->cd(3) ;
4965 gPad->SetLogy();
4966 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
4967 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
4968 fhGenPi0Phi->SetLineColor(1);
4969 fhGenGamPhi->SetLineColor(4);
4970 fhGenEtaPhi->SetLineColor(2);
4971 fhGenOmegaPhi->SetLineColor(7);
4972 fhGenElePhi->SetLineColor(6);
a6f26052 4973 //Select the maximum of the histogram to show all lines.
c8fe2783 4974 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4975 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
4976 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
4977 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4978 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4979 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
4980 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
4981 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4982 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
4983 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4984 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4985 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
4986 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4987 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
4988 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
4989 haxisphi->SetMinimum(100);
4990 haxisphi->Draw("axis");
4991 fhGenPi0Phi->Draw("same");
4992 fhGenGamPhi->Draw("same");
4993 fhGenEtaPhi->Draw("same");
4994 fhGenOmegaPhi->Draw("same");
4995 fhGenElePhi->Draw("same");
4996
164a1d84 4997 snprintf(name,buffersize,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
c8fe2783 4998 c10->Print(name); printf("Plot: %s\n",name);
4999
5000
a6f26052 5001 //Reconstructed clusters depending on its original particle.
5002 //printf("c1\n");
164a1d84 5003 snprintf(cname,buffersize,"QA_%s_recgenid",fCalorimeter.Data());
c8fe2783 5004 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
5005 c11->Divide(2, 2);
5006
5007
5008 c11->cd(1) ;
5009 gPad->SetLogy();
5010 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
5011 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
5012 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
5013 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
5014 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
5015 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
5016 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
5017 hPi0E->SetLineColor(1);
5018 hGamE->SetLineColor(4);
5019 hNeHadE->SetLineColor(2);
5020 hChHadE->SetLineColor(7);
5021 hEleE->SetLineColor(6);
5022
a6f26052 5023 //Select the maximum of the histogram to show all lines.
c8fe2783 5024 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
5025 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
5026 haxisE->SetMaximum(hPi0E->GetMaximum());
5027 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
5028 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
5029 haxisE->SetMaximum(hGamE->GetMaximum());
5030 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
5031 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
5032 haxisE->SetMaximum(hNeHadE->GetMaximum());
5033 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
5034 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
5035 haxisE->SetMaximum(hChHadE->GetMaximum());
5036 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
5037 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
5038 haxisE->SetMaximum(hEleE->GetMaximum());
5039 haxisE->SetXTitle("E (GeV)");
5040 haxisE->SetMinimum(1);
5041 haxisE->Draw("axis");
5042 hPi0E->Draw("same");
5043 hGamE->Draw("same");
5044 hNeHadE->Draw("same");
5045 hChHadE->Draw("same");
5046 hEleE->Draw("same");
5047
5048 TLegend pLegend2(0.8,0.65,0.95,0.93);
5049 pLegend2.SetTextSize(0.06);
5050 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
5051 pLegend2.AddEntry(hGamE," #gamma","L");
5052 pLegend2.AddEntry(hEleE," e^{#pm}","L");
5053 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
5054 pLegend2.AddEntry(hNeHadE," h^{0}","L");
5055 pLegend2.SetFillColor(10);
5056 pLegend2.SetBorderSize(1);
5057 pLegend2.Draw();
5058
5059
5060 c11->cd(2) ;
5061 gPad->SetLogy();
a6f26052 5062 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
c8fe2783 5063 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
5064 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
5065 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
5066 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
5067 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
5068 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
5069 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
5070 hPi0Pt->SetLineColor(1);
5071 hGamPt->SetLineColor(4);
5072 hNeHadPt->SetLineColor(2);
5073 hChHadPt->SetLineColor(7);
5074 hElePt->SetLineColor(6);
5075
a6f26052 5076 //Select the maximum of the histogram to show all lines.
c8fe2783 5077 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5078 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
5079 haxispt->SetMaximum(hPi0Pt->GetMaximum());
5080 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5081 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
5082 haxispt->SetMaximum(hGamPt->GetMaximum());
5083 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
5084 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
5085 haxispt->SetMaximum(hNeHadPt->GetMaximum());
5086 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5087 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
5088 haxispt->SetMaximum(hChHadPt->GetMaximum());
5089 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
5090 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
5091 haxispt->SetMaximum(hElePt->GetMaximum());
5092 haxispt->SetXTitle("p_{T} (GeV/c)");
5093 haxispt->SetMinimum(1);
5094 haxispt->Draw("axis");
5095 hPi0Pt->Draw("same");
5096 hGamPt->Draw("same");
5097 hNeHadPt->Draw("same");
5098 hChHadPt->Draw("same");
5099 hElePt->Draw("same");
5100
5101 c11->cd(3) ;
5102 gPad->SetLogy();
5103
5104 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
5105 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
5106 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
5107 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
5108 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
5109 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
5110 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
5111 hPi0Eta->SetLineColor(1);
5112 hGamEta->SetLineColor(4);
5113 hNeHadEta->SetLineColor(2);
5114 hChHadEta->SetLineColor(7);
5115 hEleEta->SetLineColor(6);
a6f26052 5116 //Select the maximum of the histogram to show all lines.
c8fe2783 5117 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5118 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
5119 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
5120 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5121 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
5122 haxiseta->SetMaximum(hGamEta->GetMaximum());
5123 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
5124 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
5125 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
5126 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5127 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
5128 haxiseta->SetMaximum(hChHadEta->GetMaximum());
5129 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
5130 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
5131 haxiseta->SetMaximum(hEleEta->GetMaximum());
5132
5133 haxiseta->SetXTitle("#eta");
5134 haxiseta->Draw("axis");
5135 hPi0Eta->Draw("same");
5136 hGamEta->Draw("same");
5137 hNeHadEta->Draw("same");
5138 hChHadEta->Draw("same");
5139 hEleEta->Draw("same");
5140
5141
5142 c11->cd(4) ;
5143 gPad->SetLogy();
5144 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
5145 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
5146 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
5147 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
5148 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
5149 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
5150 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
5151
5152 hPi0Phi->SetLineColor(1);
5153 hGamPhi->SetLineColor(4);
5154 hNeHadPhi->SetLineColor(2);
5155 hChHadPhi->SetLineColor(7);
5156 hElePhi->SetLineColor(6);
a6f26052 5157 //Select the maximum of the histogram to show all lines.
c8fe2783 5158 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5159 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
5160 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
5161 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5162 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
5163 haxisphi->SetMaximum(hGamPhi->GetMaximum());
5164 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
5165 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5166 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
5167 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5168 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5169 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
5170 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5171 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
5172 haxisphi->SetMaximum(hElePhi->GetMaximum());
5173 haxisphi->SetXTitle("#phi (rad)");
5174 haxisphi->Draw("axis");
5175 hPi0Phi->Draw("same");
5176 hGamPhi->Draw("same");
5177 hNeHadPhi->Draw("same");
5178 hChHadPhi->Draw("same");
5179 hElePhi->Draw("same");
5180
164a1d84 5181 snprintf(name,buffersize,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
c8fe2783 5182 c11->Print(name); printf("Plot: %s\n",name);
5183
5184
a6f26052 5185 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
5186 //printf("c1\n");
c8fe2783 5187
5188 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
5189 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
5190 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
5191 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
5192 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
5193 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
5194 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
5195 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
5196
164a1d84 5197 snprintf(cname,buffersize,"QA_%s_recgenidratio",fCalorimeter.Data());
c8fe2783 5198 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
5199 c12->Divide(2, 2);
5200
5201 c12->cd(1) ;
5202 gPad->SetLogy();
5203 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5204 hPi0EClone->Divide(fhGenPi0AccE);
5205 hGamEClone->Divide(fhGenGamAccE);
5206 haxisE->SetMaximum(5);
5207 haxisE->SetMinimum(1e-2);
5208 haxisE->SetXTitle("E (GeV)");
5209 haxisE->SetYTitle("ratio = rec/gen");
5210 haxisE->Draw("axis");
5211 hPi0E->Draw("same");
5212 hGamE->Draw("same");
5213
5214 TLegend pLegend3(0.75,0.2,0.9,0.4);
5215 pLegend3.SetTextSize(0.06);
5216 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
5217 pLegend3.AddEntry(hGamEClone," #gamma","L");
5218 pLegend3.SetFillColor(10);
5219 pLegend3.SetBorderSize(1);
5220 pLegend3.Draw();
5221
5222 c12->cd(2) ;
5223 gPad->SetLogy();
5224 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5225 hPi0PtClone->Divide(fhGenPi0AccPt);
5226 hGamPtClone->Divide(fhGenGamAccPt);
5227 haxispt->SetMaximum(5);
5228 haxispt->SetMinimum(1e-2);
5229 haxispt->SetXTitle("p_{T} (GeV/c)");
5230 haxispt->SetYTitle("ratio = rec/gen");
5231 haxispt->Draw("axis");
5232 hPi0PtClone->Draw("same");
5233 hGamPtClone->Draw("same");
5234
5235 c12->cd(3) ;
5236 gPad->SetLogy();
5237
5238 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5239 hPi0EtaClone->Divide(fhGenPi0AccEta);
5240 hGamEtaClone->Divide(fhGenGamAccEta);
5241 haxiseta->SetMaximum(1.2);
5242 haxiseta->SetMinimum(1e-2);
5243 haxiseta->SetYTitle("ratio = rec/gen");
5244 haxiseta->SetXTitle("#eta");
5245 haxiseta->Draw("axis");
5246 hPi0EtaClone->Draw("same");
5247 hGamEtaClone->Draw("same");
5248
5249
5250 c12->cd(4) ;
5251 gPad->SetLogy();
5252 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5253 hPi0PhiClone->Divide(fhGenPi0AccPhi);
5254 hGamPhiClone->Divide(fhGenGamAccPhi);
5255 haxisphi->SetYTitle("ratio = rec/gen");
5256 haxisphi->SetXTitle("#phi (rad)");
5257 haxisphi->SetMaximum(1.2);
5258 haxisphi->SetMinimum(1e-2);
5259 haxisphi->Draw("axis");
5260 hPi0PhiClone->Draw("same");
5261 hGamPhiClone->Draw("same");
5262
164a1d84 5263 snprintf(name,buffersize,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
c8fe2783 5264 c12->Print(name); printf("Plot: %s\n",name);
5265
5266
5267
a6f26052 5268 //Reconstructed distributions
5269 //printf("c1\n");
164a1d84 5270 snprintf(cname,buffersize,"QA_%s_vertex",fCalorimeter.Data());
c8fe2783 5271 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
5272 c13->Divide(2, 2);
5273
5274 c13->cd(1) ;
a6f26052 5275 //gPad->SetLogy();
c8fe2783 5276 fhEMVxyz->SetTitleOffset(1.6,"Y");
5277 fhEMVxyz->Draw();
5278
5279 c13->cd(2) ;
a6f26052 5280 //gPad->SetLogy();
c8fe2783 5281 fhHaVxyz->SetTitleOffset(1.6,"Y");
5282 fhHaVxyz->Draw();
5283
5284 c13->cd(3) ;
5285 gPad->SetLogy();
5286 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
5287 hEMR->SetLineColor(4);
5288 hEMR->Draw();
5289
5290 c13->cd(4) ;
5291 gPad->SetLogy();
5292 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
5293 hHaR->SetLineColor(4);
5294 hHaR->Draw();
5295
5296
164a1d84 5297 snprintf(name,buffersize,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
c8fe2783 5298 c13->Print(name); printf("Plot: %s\n",name);
5299
5300
a6f26052 5301 //Track-matching distributions
5302 if(fFillAllTH12){
c8fe2783 5303 //Reconstructed distributions, matched with tracks, generated particle dependence
5304 //printf("c2\n");
164a1d84 5305 snprintf(cname,buffersize,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
a6f26052 5306 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
5307 c22ch->Divide(2, 2);
5308
5309 c22ch->cd(1) ;
5310
5311 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
5312 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
5313 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
5314 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
5315 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
5316 hPi0ECharged->SetLineColor(1);
5317 hGamECharged->SetLineColor(4);
5318 hNeHadECharged->SetLineColor(2);
5319 hChHadECharged->SetLineColor(7);
5320 hEleECharged->SetLineColor(6);
5321 gPad->SetLogy();
5322 fhECharged->SetLineColor(3);
5323 fhECharged->SetMinimum(0.5);
5324 fhECharged->Draw();
5325 hPi0ECharged->Draw("same");
5326 hGamECharged->Draw("same");
5327 hNeHadECharged->Draw("same");
5328 hChHadECharged->Draw("same");
5329 hEleECharged->Draw("same");
5330 TLegend pLegend22(0.75,0.45,0.9,0.8);
5331 pLegend22.SetTextSize(0.06);
5332 pLegend22.AddEntry(fhECharged,"all","L");
5333 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
5334 pLegend22.AddEntry(hGamECharged,"#gamma","L");
5335 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
5336 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
5337 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
5338 pLegend22.SetFillColor(10);
5339 pLegend22.SetBorderSize(1);
5340 pLegend22.Draw();
5341
5342 c22ch->cd(2) ;
5343
5344 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
5345 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
5346 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
5347 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
5348 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
5349 hPi0PtCharged->SetLineColor(1);
5350 hGamPtCharged->SetLineColor(4);
5351 hNeHadPtCharged->SetLineColor(2);
5352 hChHadPtCharged->SetLineColor(7);
5353 hElePtCharged->SetLineColor(6);
5354 gPad->SetLogy();
5355 fhPtCharged->SetLineColor(3);
5356 fhPtCharged->SetMinimum(0.5);
5357 fhPtCharged->Draw();
5358 hPi0PtCharged->Draw("same");
5359 hGamPtCharged->Draw("same");
5360 hNeHadPtCharged->Draw("same");
5361 hChHadPtCharged->Draw("same");
5362 hElePtCharged->Draw("same");
5363
5364 c22ch->cd(4) ;
5365
5366 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
5367 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
5368 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
5369 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
5370 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
5371 hPi0EtaCharged->SetLineColor(1);
5372 hGamEtaCharged->SetLineColor(4);
5373 hNeHadEtaCharged->SetLineColor(2);
5374 hChHadEtaCharged->SetLineColor(7);
5375 hEleEtaCharged->SetLineColor(6);
5376 gPad->SetLogy();
5377 fhEtaCharged->SetLineColor(3);
5378 fhEtaCharged->SetMinimum(0.5);
5379 fhEtaCharged->Draw();
5380 hPi0EtaCharged->Draw("same");
5381 hGamEtaCharged->Draw("same");
5382 hNeHadEtaCharged->Draw("same");
5383 hChHadEtaCharged->Draw("same");
5384 hEleEtaCharged->Draw("same");
5385
5386 c22ch->cd(3) ;
5387
5388 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
5389 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
5390 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
5391 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
5392 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
5393 hPi0PhiCharged->SetLineColor(1);
5394 hGamPhiCharged->SetLineColor(4);
5395 hNeHadPhiCharged->SetLineColor(2);
5396 hChHadPhiCharged->SetLineColor(7);
5397 hElePhiCharged->SetLineColor(6);
5398 gPad->SetLogy();
5399 fhPhiCharged->SetLineColor(3);
5400 fhPhiCharged->SetMinimum(0.5);
5401 fhPhiCharged->Draw();
5402 hPi0PhiCharged->Draw("same");
5403 hGamPhiCharged->Draw("same");
5404 hNeHadPhiCharged->Draw("same");
5405 hChHadPhiCharged->Draw("same");
5406 hElePhiCharged->Draw("same");
5407
5408
164a1d84 5409 snprintf(name,buffersize,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
a6f26052 5410 c22ch->Print(name); printf("Plot: %s\n",name);
5411
5412 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
5413 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
5414 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
5415 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
5416
5417 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
5418 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
5419 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
5420 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
5421
5422 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
5423 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
5424 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
5425 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
5426
5427 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
5428 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
5429 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
5430 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
5431
5432 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
5433 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
5434 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
5435 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
5436
c8fe2783 5437 //Ratio: reconstructed track matched/ all reconstructed
5438 //printf("c3\n");
164a1d84 5439 snprintf(cname,buffersize,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
a6f26052 5440 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
5441 c3ch->Divide(2, 2);
5442
5443 c3ch->cd(1) ;
5444 hEChargedClone->SetMaximum(1.2);
5445 hEChargedClone->SetMinimum(0.001);
5446 hEChargedClone->SetLineColor(3);
5447 hEChargedClone->SetYTitle("track matched / all");
5448 hPi0EChargedClone->Divide(hPi0E);
5449 hGamEChargedClone->Divide(hGamE);
5450 hEleEChargedClone->Divide(hEleE);
5451 hNeHadEChargedClone->Divide(hNeHadE);
5452 hChHadEChargedClone->Divide(hChHadE);
5453 hEChargedClone->Draw();
5454 hPi0EChargedClone->Draw("same");
5455 hGamEChargedClone->Draw("same");
5456 hEleEChargedClone->Draw("same");
5457 hNeHadEChargedClone->Draw("same");
5458 hChHadEChargedClone->Draw("same");
5459
5460 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
5461 pLegend3ch.SetTextSize(0.06);
5462 pLegend3ch.AddEntry(hEChargedClone,"all","L");
5463 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
5464 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
5465 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
5466 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
5467 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
5468 pLegend3ch.SetFillColor(10);
5469 pLegend3ch.SetBorderSize(1);
5470 pLegend3ch.Draw();
5471
5472 c3ch->cd(2) ;
5473 hPtChargedClone->SetMaximum(1.2);
5474 hPtChargedClone->SetMinimum(0.001);
5475 hPtChargedClone->SetLineColor(3);
5476 hPtChargedClone->SetYTitle("track matched / all");
5477 hPi0PtChargedClone->Divide(hPi0Pt);
5478 hGamPtChargedClone->Divide(hGamPt);
5479 hElePtChargedClone->Divide(hElePt);
5480 hNeHadPtChargedClone->Divide(hNeHadPt);
5481 hChHadPtChargedClone->Divide(hChHadPt);
5482 hPtChargedClone->Draw();
5483 hPi0PtChargedClone->Draw("same");
5484 hGamPtChargedClone->Draw("same");
5485 hElePtChargedClone->Draw("same");
5486 hNeHadPtChargedClone->Draw("same");
5487 hChHadPtChargedClone->Draw("same");
5488
5489 c3ch->cd(4) ;
5490 hEtaChargedClone->SetMaximum(1.2);
5491 hEtaChargedClone->SetMinimum(0.001);
5492 hEtaChargedClone->SetLineColor(3);
5493 hEtaChargedClone->SetYTitle("track matched / all");
5494 hPi0EtaChargedClone->Divide(hPi0Eta);
5495 hGamEtaChargedClone->Divide(hGamEta);
5496 hEleEtaChargedClone->Divide(hEleEta);
5497 hNeHadEtaChargedClone->Divide(hNeHadEta);
5498 hChHadEtaChargedClone->Divide(hChHadEta);
5499 hEtaChargedClone->Draw();
5500 hPi0EtaChargedClone->Draw("same");
5501 hGamEtaChargedClone->Draw("same");
5502 hEleEtaChargedClone->Draw("same");
5503 hNeHadEtaChargedClone->Draw("same");
5504 hChHadEtaChargedClone->Draw("same");
5505
5506 c3ch->cd(3) ;
5507 hPhiChargedClone->SetMaximum(1.2);
5508 hPhiChargedClone->SetMinimum(0.001);
5509 hPhiChargedClone->SetLineColor(3);
5510 hPhiChargedClone->SetYTitle("track matched / all");
5511 hPi0PhiChargedClone->Divide(hPi0Phi);
5512 hGamPhiChargedClone->Divide(hGamPhi);
5513 hElePhiChargedClone->Divide(hElePhi);
5514 hNeHadPhiChargedClone->Divide(hNeHadPhi);
5515 hChHadPhiChargedClone->Divide(hChHadPhi);
5516 hPhiChargedClone->Draw();
5517 hPi0PhiChargedClone->Draw("same");
5518 hGamPhiChargedClone->Draw("same");
5519 hElePhiChargedClone->Draw("same");
5520 hNeHadPhiChargedClone->Draw("same");
5521 hChHadPhiChargedClone->Draw("same");
5522
164a1d84 5523 snprintf(name,buffersize,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
a6f26052 5524 c3ch->Print(name); printf("Plot: %s\n",name);
5525
5526 }
5527 }
5528 //Track-matching distributions
c8fe2783 5529
54769bc0 5530 snprintf(cname,buffersize,"QA_%s_trkmatch",fCalorimeter.Data());
5531 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
5532 cme->Divide(2,2);
c8fe2783 5533
54769bc0 5534 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
5535 pLegendpE0.SetTextSize(0.04);
5536 pLegendpE0.AddEntry(fh1pOverE,"all","L");
5537 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
5538 pLegendpE0.SetFillColor(10);
5539 pLegendpE0.SetBorderSize(1);
a6f26052 5540 //pLegendpE0.Draw();
c8fe2783 5541
54769bc0 5542 cme->cd(1);
5543 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
5544 fh1pOverE->SetTitle("Track matches p/E");
5545 fh1pOverE->Draw();
5546 fh1pOverER02->SetLineColor(4);
5547 fh1pOverER02->Draw("same");
5548 pLegendpE0.Draw();
5549
5550 cme->cd(2);
5551 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
5552 fh1dR->Draw();
5553
5554 cme->cd(3);
5555 fh2MatchdEdx->Draw();
5556
5557 cme->cd(4);
5558 fh2EledEdx->Draw();
5559
5560 snprintf(name,buffersize,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
5561 cme->Print(name); printf("Plot: %s\n",name);
5562
5563 if(IsDataMC()){
164a1d84 5564 snprintf(cname,buffersize,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
c8fe2783 5565 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
5566 cmemc->Divide(3,1);
5567
5568 cmemc->cd(1);
5569 gPad->SetLogy();
5570 fhMCEle1pOverE->Draw();
5571 fhMCEle1pOverER02->SetLineColor(4);
5572 fhMCEle1pOverE->SetLineColor(1);
5573 fhMCEle1pOverER02->Draw("same");
5574 pLegendpE0.Draw();
5575
5576 cmemc->cd(2);
5577 gPad->SetLogy();
5578 fhMCEle1dR->Draw();
5579
5580 cmemc->cd(3);
5581 fhMCEle2MatchdEdx->Draw();
5582
164a1d84 5583 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
c8fe2783 5584 cmemc->Print(name); printf("Plot: %s\n",name);
5585
6fa7d352 5586
164a1d84 5587 snprintf(cname,buffersize,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
c8fe2783 5588 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
5589 cmemchad->Divide(3,1);
5590
5591 cmemchad->cd(1);
5592 gPad->SetLogy();
5593 fhMCChHad1pOverE->Draw();
5594 fhMCChHad1pOverER02->SetLineColor(4);
5595 fhMCChHad1pOverE->SetLineColor(1);
5596 fhMCChHad1pOverER02->Draw("same");
5597 pLegendpE0.Draw();
5598
5599 cmemchad->cd(2);
5600 gPad->SetLogy();
5601 fhMCChHad1dR->Draw();
5602
5603 cmemchad->cd(3);
5604 fhMCChHad2MatchdEdx->Draw();
6fa7d352 5605
164a1d84 5606 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
c8fe2783 5607 cmemchad->Print(name); printf("Plot: %s\n",name);
5608
164a1d84 5609 snprintf(cname,buffersize,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
c8fe2783 5610 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
5611 cmemcn->Divide(3,1);
5612
5613 cmemcn->cd(1);
5614 gPad->SetLogy();
5615 fhMCNeutral1pOverE->Draw();
5616 fhMCNeutral1pOverE->SetLineColor(1);
5617 fhMCNeutral1pOverER02->SetLineColor(4);
5618 fhMCNeutral1pOverER02->Draw("same");
5619 pLegendpE0.Draw();
5620
5621 cmemcn->cd(2);
5622 gPad->SetLogy();
5623 fhMCNeutral1dR->Draw();
5624
5625 cmemcn->cd(3);
5626 fhMCNeutral2MatchdEdx->Draw();
5627
164a1d84 5628 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
c8fe2783 5629 cmemcn->Print(name); printf("Plot: %s\n",name);
5630
164a1d84 5631 snprintf(cname,buffersize,"QA_%s_trkmatchpE",fCalorimeter.Data());
c8fe2783 5632 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
5633 cmpoe->Divide(2,1);
5634
5635 cmpoe->cd(1);
5636 gPad->SetLogy();
5637 fh1pOverE->SetLineColor(1);
5638 fhMCEle1pOverE->SetLineColor(4);
5639 fhMCChHad1pOverE->SetLineColor(2);
5640 fhMCNeutral1pOverE->SetLineColor(7);
5641 fh1pOverER02->SetMinimum(0.5);
5642 fh1pOverE->Draw();
5643 fhMCEle1pOverE->Draw("same");
5644 fhMCChHad1pOverE->Draw("same");
5645 fhMCNeutral1pOverE->Draw("same");
5646 TLegend pLegendpE(0.65,0.55,0.9,0.8);
5647 pLegendpE.SetTextSize(0.06);
5648 pLegendpE.AddEntry(fh1pOverE,"all","L");
5649 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
5650 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
5651 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
5652 pLegendpE.SetFillColor(10);
5653 pLegendpE.SetBorderSize(1);
5654 pLegendpE.Draw();
5655
5656 cmpoe->cd(2);
5657 gPad->SetLogy();
5658 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
5659 fh1pOverER02->SetLineColor(1);
5660 fhMCEle1pOverER02->SetLineColor(4);
5661 fhMCChHad1pOverER02->SetLineColor(2);
5662 fhMCNeutral1pOverER02->SetLineColor(7);
5663 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
5664 fh1pOverER02->SetMinimum(0.5);
5665 fh1pOverER02->Draw();
5666 fhMCEle1pOverER02->Draw("same");
5667 fhMCChHad1pOverER02->Draw("same");
5668 fhMCNeutral1pOverER02->Draw("same");
5669
a6f26052 5670 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
5671 // pLegendpE2.SetTextSize(0.06);
5672 // pLegendpE2.SetHeader("dR < 0.02");
5673 // pLegendpE2.SetFillColor(10);
5674 // pLegendpE2.SetBorderSize(1);
5675 // pLegendpE2.Draw();
c8fe2783 5676
164a1d84 5677 snprintf(name,buffersize,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
c8fe2783 5678 cmpoe->Print(name); printf("Plot: %s\n",name);
54769bc0 5679 }
5680
5681 char line[buffersize] ;
5682 snprintf(line, buffersize,".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
5683 gROOT->ProcessLine(line);
5684 snprintf(line, buffersize,".!rm -fR *.eps");
5685 gROOT->ProcessLine(line);
5686
5687 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());
5688
9725fd2a 5689}