Correct and clean the vertex retrieval in case of SE or ME analysis
[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"
c8fe2783 45#include "AliVTrack.h"
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() :
59AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""),
a6f26052 60fMakePlots(kFALSE), fFillAllPosHisto(kFALSE), fFillAllTH12(kFALSE),
61fCorrelateCalos(kFALSE), fNModules(12), fNRCU(2),
c8fe2783 62fTimeCutMin(-1), fTimeCutMax(9999999),
b8187de4 63fHistoFinePtBins(1000), fHistoFinePtMax(5.), fHistoFinePtMin(0.),
a6f26052 64fHistoPOverEBins(100), fHistoPOverEMax(100.), fHistoPOverEMin(0.),
65fHistodEdxBins(100), fHistodEdxMax(100.), fHistodEdxMin(0.),
66fHistodRBins(100), fHistodRMax(100.), fHistodRMin(0.),
67fHistoTimeBins(100), fHistoTimeMax(100.), fHistoTimeMin(0.),
68fHistoNBins(100), fHistoNMax(100), fHistoNMin(0),
69fHistoRatioBins(100), fHistoRatioMax(100.), fHistoRatioMin(0.),
70fHistoVertexDistBins(100), fHistoVertexDistMax(100.), fHistoVertexDistMin(0.),
c8fe2783 71fHistoRBins(100), fHistoRMax(1000), fHistoRMin(-1000),
72fHistoXBins(100), fHistoXMax(1000), fHistoXMin(-1000),
73fHistoYBins(100), fHistoYMax(1000), fHistoYMin(-1000),
74fHistoZBins(100), fHistoZMax(1000), fHistoZMin(-1000),
a6f26052 75fHistoSSBins(25), fHistoSSMax(5), fHistoSSMin(0),
c8fe2783 76fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhiE(0),
77fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiECharged(0),
c8fe2783 78fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
79fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0),
80fhLambda(0), fhDispersion(0),
81fhIM(0), fhIMCellCut(0),fhAsym(0),
82fhNCellsPerCluster(0),fhNCellsPerClusterMIP(0), fhNCellsPerClusterMIPCharged(0), fhNClusters(0),
83fhClusterTimeEnergy(0),fhCellTimeSpreadRespectToCellMax(0),fhCellIdCellLargeTimeSpread(0),
84fhRNCells(0),fhXNCells(0),fhYNCells(0),fhZNCells(0),
85fhRE(0), fhXE(0), fhYE(0), fhZE(0), fhXYZ(0),
86fhRCellE(0), fhXCellE(0), fhYCellE(0), fhZCellE(0),fhXYZCell(0),
87fhDeltaCellClusterRNCells(0),fhDeltaCellClusterXNCells(0),fhDeltaCellClusterYNCells(0),fhDeltaCellClusterZNCells(0),
88fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0), fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
89fhNCells(0), fhAmplitude(0), fhAmpId(0), fhEtaPhiAmp(0),
90fhTime(0), fhTimeId(0), fhTimeAmp(0), //fhT0Time(0), fhT0TimeId(0), fhT0TimeAmp(0),
91fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
92fhEMod(0), fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),
93fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0),
a6f26052 94fhAmplitudeMod(0), fhAmplitudeModFraction(0),fhTimeAmpPerRCU(0), //fhT0TimeAmpPerRCU(0), fhTimeCorrRCU(0),
c8fe2783 95fhIMMod(0), fhIMCellCutMod(0),
96fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
97fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
98fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
99fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
100fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0),
101fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
102fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
103fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0),
104fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
105fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
106fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
107fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
108fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
109fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
110fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
111fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
112fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
113fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
114fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
115fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
116fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
9725fd2a 117{
a6f26052 118 //Default Ctor
afabc52f 119
a6f26052 120 //Initialize parameters
9725fd2a 121 InitParameters();
122}
a5fafd85 123
a6f26052 124//________________________________________________________________________
0c1383b5 125TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
126{
a6f26052 127 //Save parameters used for analysis
0c1383b5 128 TString parList ; //this will be list of parameters used for this analysis.
f8006433 129 const Int_t buffersize = 255;
130 char onePar[buffersize] ;
0c1383b5 131
f8006433 132 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
0c1383b5 133 parList+=onePar ;
f8006433 134 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
0c1383b5 135 parList+=onePar ;
f8006433 136 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
0c1383b5 137 parList+=onePar ;
c8fe2783 138
a6f26052 139 //Get parameters set in base class.
140 //parList += GetBaseParametersList() ;
0c1383b5 141
a6f26052 142 //Get parameters set in FiducialCut class (not available yet)
143 //parlist += GetFidCut()->GetFidCutParametersList()
0c1383b5 144
145 return new TObjString(parList) ;
146}
147
a5fafd85 148
a6f26052 149//________________________________________________________________________
9725fd2a 150TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
151{
a6f26052 152 // Create histograms to be saved in output file and
153 // store them in outputContainer
c8fe2783 154
9725fd2a 155 TList * outputContainer = new TList() ;
4865e325 156 outputContainer->SetName("QAHistos") ;
9725fd2a 157
a6f26052 158 //Histograms
5a2dbc3c 159 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
b8187de4 160 Int_t nfineptbins = GetHistoFinePtBins(); Float_t ptfinemax = GetHistoFinePtMax(); Float_t ptfinemin = GetHistoFinePtMin();
5a2dbc3c 161 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
162 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
163 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
164 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
165 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
166 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
167 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
168 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
169 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
170 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
171 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
5a35dd37 172 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
173 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
174 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
175 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
eb5a51ae 176 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
5a2dbc3c 177
a6f26052 178 //EMCAL
5a2dbc3c 179 Int_t colmax = 48;
180 Int_t rowmax = 24;
eb5a51ae 181 fNRCU = 2 ;
a6f26052 182 //PHOS
5a2dbc3c 183 if(fCalorimeter=="PHOS"){
eb5a51ae 184 colmax = 56;
185 rowmax = 64;
186 fNRCU = 4 ;
5a2dbc3c 187 }
188
9725fd2a 189
a6f26052 190 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
9725fd2a 191 fhE->SetXTitle("E (GeV)");
192 outputContainer->Add(fhE);
a6f26052 193
194 if(fFillAllTH12){
195 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
196 fhPt->SetXTitle("p_{T} (GeV/c)");
197 outputContainer->Add(fhPt);
198
199 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
200 fhPhi->SetXTitle("#phi (rad)");
201 outputContainer->Add(fhPhi);
202
203 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
204 fhEta->SetXTitle("#eta ");
205 outputContainer->Add(fhEta);
206 }
207
0866d83a 208 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
c8fe2783 209 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
a5fafd85 210 fhEtaPhiE->SetXTitle("#eta ");
211 fhEtaPhiE->SetYTitle("#phi (rad)");
212 fhEtaPhiE->SetZTitle("E (GeV) ");
213 outputContainer->Add(fhEtaPhiE);
eb5a51ae 214
4cf55759 215 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
c8fe2783 216 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
4cf55759 217 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
218 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
219 outputContainer->Add(fhClusterTimeEnergy);
220
221
a6f26052 222 //Shower shape
eb5a51ae 223 fhLambda = new TH3F ("hLambda","#lambda_{0}^{2} vs #lambda_{1}^{2} vs energy, reconstructed clusters",
c8fe2783 224 ssbins,ssmin,ssmax,ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
eb5a51ae 225 fhLambda->SetXTitle("#lambda_{0}^{2} ");
226 fhLambda->SetYTitle("#lambda_{1}^{2} ");
227 fhLambda->SetZTitle("E (GeV) ");
228 outputContainer->Add(fhLambda);
229
230 fhDispersion = new TH2F ("hDispersion"," dispersion vs energy, reconstructed clusters",
c8fe2783 231 ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
eb5a51ae 232 fhDispersion->SetXTitle("Dispersion ");
233 fhDispersion->SetYTitle("E (GeV) ");
234 outputContainer->Add(fhDispersion);
235
a6f26052 236 //Track Matching
237 if(fFillAllTH12){
238 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
239 fhECharged->SetXTitle("E (GeV)");
240 outputContainer->Add(fhECharged);
241
242 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
243 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
244 outputContainer->Add(fhPtCharged);
245
246 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
247 fhPhiCharged->SetXTitle("#phi (rad)");
248 outputContainer->Add(fhPhiCharged);
249
250 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
251 fhEtaCharged->SetXTitle("#eta ");
252 outputContainer->Add(fhEtaCharged);
253 }
c8fe2783 254
0866d83a 255 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
c8fe2783 256 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
0866d83a 257 fhEtaPhiECharged->SetXTitle("#eta ");
258 fhEtaPhiECharged->SetYTitle("#phi ");
259 fhEtaPhiECharged->SetZTitle("E (GeV) ");
260 outputContainer->Add(fhEtaPhiECharged);
c8fe2783 261
5a2dbc3c 262 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
a0bb4dc0 263 fh1pOverE->SetYTitle("p/E");
264 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
265 outputContainer->Add(fh1pOverE);
266
5a2dbc3c 267 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
a0bb4dc0 268 fh1dR->SetXTitle("#Delta R (rad)");
269 outputContainer->Add(fh1dR) ;
270
5a2dbc3c 271 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
a0bb4dc0 272 fh2MatchdEdx->SetXTitle("p (GeV/c)");
273 fh2MatchdEdx->SetYTitle("<dE/dx>");
274 outputContainer->Add(fh2MatchdEdx);
275
5a2dbc3c 276 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
a0bb4dc0 277 fh2EledEdx->SetXTitle("p (GeV/c)");
278 fh2EledEdx->SetYTitle("<dE/dx>");
279 outputContainer->Add(fh2EledEdx) ;
280
5a2dbc3c 281 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
a0bb4dc0 282 fh1pOverER02->SetYTitle("p/E");
283 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
284 outputContainer->Add(fh1pOverER02);
285
5a2dbc3c 286 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
583c48f1 287 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
9725fd2a 288 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
289 outputContainer->Add(fhIM);
290
5a2dbc3c 291 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
583c48f1 292 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
a5fafd85 293 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
294 outputContainer->Add(fhIMCellCut);
a6f26052 295
b8187de4 296 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
297 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
298 fhAsym->SetYTitle("Asymmetry");
299 outputContainer->Add(fhAsym);
300
a6f26052 301
b8187de4 302 Int_t nlargeetabins = 3;
303 if(fCalorimeter=="EMCAL") nlargeetabins = 8;
304
305 fhNCellsPerCluster = new TH3F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax, nlargeetabins,etamin,etamax);
9725fd2a 306 fhNCellsPerCluster->SetXTitle("E (GeV)");
307 fhNCellsPerCluster->SetYTitle("n cells");
0866d83a 308 fhNCellsPerCluster->SetZTitle("#eta");
9725fd2a 309 outputContainer->Add(fhNCellsPerCluster);
310
8b5f17b6 311
0866d83a 312 fhNCellsPerClusterMIP = new TH3F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
b8187de4 313 40,0.,2., 11,0,10,nlargeetabins,etamin,etamax);
0cdb88b8 314 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
315 fhNCellsPerClusterMIP->SetYTitle("n cells");
0866d83a 316 fhNCellsPerClusterMIP->SetZTitle("#eta");
0cdb88b8 317 outputContainer->Add(fhNCellsPerClusterMIP);
318
b8187de4 319
0866d83a 320 fhNCellsPerClusterMIPCharged = new TH3F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
b8187de4 321 40,0.,2., 11,0,10,nlargeetabins,etamin,etamax);
0866d83a 322 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
323 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
324 fhNCellsPerClusterMIPCharged->SetZTitle("#eta");
325 outputContainer->Add(fhNCellsPerClusterMIPCharged);
326
8b5f17b6 327
5a2dbc3c 328 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
9725fd2a 329 fhNClusters->SetXTitle("number of clusters");
330 outputContainer->Add(fhNClusters);
c8fe2783 331
b8187de4 332 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
333 fhXYZ->SetXTitle("x (cm)");
334 fhXYZ->SetYTitle("y (cm)");
335 fhXYZ->SetZTitle("z (cm) ");
336 outputContainer->Add(fhXYZ);
337
338 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax);
339 fhXNCells->SetXTitle("x (cm)");
340 fhXNCells->SetYTitle("N cells per cluster");
341 outputContainer->Add(fhXNCells);
342
343 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax);
344 fhZNCells->SetXTitle("z (cm)");
345 fhZNCells->SetYTitle("N cells per cluster");
346 outputContainer->Add(fhZNCells);
347
348 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
349 fhXE->SetXTitle("x (cm)");
350 fhXE->SetYTitle("E (GeV)");
351 outputContainer->Add(fhXE);
352
353 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
354 fhZE->SetXTitle("z (cm)");
355 fhZE->SetYTitle("E (GeV)");
356 outputContainer->Add(fhZE);
357
358
359 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax);
360 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
361 fhRNCells->SetYTitle("N cells per cluster");
362 outputContainer->Add(fhRNCells);
363
364
365 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax);
366 fhYNCells->SetXTitle("y (cm)");
367 fhYNCells->SetYTitle("N cells per cluster");
368 outputContainer->Add(fhYNCells);
369
370 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
371 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
372 fhRE->SetYTitle("E (GeV)");
373 outputContainer->Add(fhRE);
374
375 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
376 fhYE->SetXTitle("y (cm)");
377 fhYE->SetYTitle("E (GeV)");
378 outputContainer->Add(fhYE);
a6f26052 379
b8187de4 380 if(fFillAllPosHisto){
381
382
a6f26052 383 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
384 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
385 fhRCellE->SetYTitle("E (GeV)");
386 outputContainer->Add(fhRCellE);
387
388 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
389 fhXCellE->SetXTitle("x (cm)");
390 fhXCellE->SetYTitle("E (GeV)");
391 outputContainer->Add(fhXCellE);
392
393 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
394 fhYCellE->SetXTitle("y (cm)");
395 fhYCellE->SetYTitle("E (GeV)");
396 outputContainer->Add(fhYCellE);
397
398 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
399 fhZCellE->SetXTitle("z (cm)");
400 fhZCellE->SetYTitle("E (GeV)");
401 outputContainer->Add(fhZCellE);
402
403 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
404 fhXYZCell->SetXTitle("x (cm)");
405 fhXYZCell->SetYTitle("y (cm)");
406 fhXYZCell->SetZTitle("z (cm)");
407 outputContainer->Add(fhXYZCell);
408
409
410 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
411 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
412 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
413 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
414
415 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax);
416 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
417 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
418 outputContainer->Add(fhDeltaCellClusterRNCells);
419
420 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax);
421 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
422 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
423 outputContainer->Add(fhDeltaCellClusterXNCells);
424
425 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax);
426 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
427 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
428 outputContainer->Add(fhDeltaCellClusterYNCells);
429
430 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax);
431 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
432 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
433 outputContainer->Add(fhDeltaCellClusterZNCells);
434
435 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
436 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
437 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
438 outputContainer->Add(fhDeltaCellClusterRE);
439
440 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
441 fhDeltaCellClusterXE->SetXTitle("x (cm)");
442 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
443 outputContainer->Add(fhDeltaCellClusterXE);
444
445 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
446 fhDeltaCellClusterYE->SetXTitle("y (cm)");
447 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
448 outputContainer->Add(fhDeltaCellClusterYE);
449
450 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
451 fhDeltaCellClusterZE->SetXTitle("z (cm)");
452 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
453 outputContainer->Add(fhDeltaCellClusterZE);
454
455 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
456 fhEtaPhiAmp->SetXTitle("#eta ");
457 fhEtaPhiAmp->SetYTitle("#phi (rad)");
458 fhEtaPhiAmp->SetZTitle("E (GeV) ");
459 outputContainer->Add(fhEtaPhiAmp);
460
461 }
c8fe2783 462
a6f26052 463 //Calo cells
5a2dbc3c 464 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
9725fd2a 465 fhNCells->SetXTitle("n cells");
466 outputContainer->Add(fhNCells);
c8fe2783 467
3a75604b 468 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
a5fafd85 469 fhAmplitude->SetXTitle("Cell Energy (GeV)");
9725fd2a 470 outputContainer->Add(fhAmplitude);
b8187de4 471
472 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
0cdb88b8 473 fhAmpId->SetXTitle("Cell Energy (GeV)");
474 outputContainer->Add(fhAmpId);
475
0866d83a 476
a6f26052 477 //Cell Time histograms, time only available in ESDs
5a2dbc3c 478 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
50f39b97 479
480 fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200);
481 fhCellTimeSpreadRespectToCellMax->SetXTitle("#Delta t (ns)");
482 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
483
484 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
485 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
486 outputContainer->Add(fhCellIdCellLargeTimeSpread);
487
5a2dbc3c 488 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
489 fhTime->SetXTitle("Cell Time (ns)");
490 outputContainer->Add(fhTime);
c8fe2783 491
50f39b97 492 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
5a2dbc3c 493 fhTimeId->SetXTitle("Cell Time (ns)");
494 fhTimeId->SetYTitle("Cell Absolute Id");
495 outputContainer->Add(fhTimeId);
c8fe2783 496
f2a06a87 497 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
5a2dbc3c 498 fhTimeAmp->SetYTitle("Cell Time (ns)");
499 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
500 outputContainer->Add(fhTimeAmp);
c1ac3823 501
a6f26052 502 // fhT0Time = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax);
503 // fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
504 // outputContainer->Add(fhT0Time);
505 //
506 // fhT0TimeId = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
507 // fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
508 // fhT0TimeId->SetYTitle("Cell Absolute Id");
509 // outputContainer->Add(fhT0TimeId);
510 //
511 // fhT0TimeAmp = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
512 // fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
513 // fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
514 // outputContainer->Add(fhT0TimeAmp);
5a2dbc3c 515 }
516
a0bb4dc0 517 if(fCorrelateCalos){
5a2dbc3c 518 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
a0bb4dc0 519 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
520 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
521 outputContainer->Add(fhCaloCorrNClusters);
c8fe2783 522
5a2dbc3c 523 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
a0bb4dc0 524 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
525 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
526 outputContainer->Add(fhCaloCorrEClusters);
c8fe2783 527
5a2dbc3c 528 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
a0bb4dc0 529 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
530 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
531 outputContainer->Add(fhCaloCorrNCells);
c8fe2783 532
5a2dbc3c 533 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
a0bb4dc0 534 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
535 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
536 outputContainer->Add(fhCaloCorrECells);
537 }//correlate calorimeters
538
a6f26052 539 //Module histograms
50f39b97 540 fhEMod = new TH1F*[fNModules];
541 fhNClustersMod = new TH1F*[fNModules];
542 fhNCellsPerClusterMod = new TH2F*[fNModules];
543 fhNCellsMod = new TH1F*[fNModules];
544 fhGridCellsMod = new TH2F*[fNModules];
545 fhGridCellsEMod = new TH2F*[fNModules];
546 fhGridCellsTimeMod = new TH2F*[fNModules];
547 fhAmplitudeMod = new TH1F*[fNModules];
548 if(fCalorimeter=="EMCAL")
549 fhAmplitudeModFraction = new TH1F*[fNModules*3];
c8fe2783 550
eb5a51ae 551 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
a6f26052 552 //fhT0TimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
553 //fhTimeCorrRCU = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
c1ac3823 554
50f39b97 555 fhIMMod = new TH2F*[fNModules];
556 fhIMCellCutMod = new TH2F*[fNModules];
c8fe2783 557
a5fafd85 558 for(Int_t imod = 0; imod < fNModules; imod++){
559
560 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
561 fhEMod[imod]->SetXTitle("E (GeV)");
562 outputContainer->Add(fhEMod[imod]);
563
5a2dbc3c 564 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
a5fafd85 565 fhNClustersMod[imod]->SetXTitle("number of clusters");
566 outputContainer->Add(fhNClustersMod[imod]);
567
568 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
c8fe2783 569 Form("# cells per cluster vs cluster energy in Module %d",imod),
570 nptbins,ptmin,ptmax, nbins,nmin,nmax);
a5fafd85 571 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
572 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
573 outputContainer->Add(fhNCellsPerClusterMod[imod]);
574
5a2dbc3c 575 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
a5fafd85 576 fhNCellsMod[imod]->SetXTitle("n cells");
577 outputContainer->Add(fhNCellsMod[imod]);
a5fafd85 578 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
c8fe2783 579 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
f2a06a87 580 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
a5fafd85 581 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
582 outputContainer->Add(fhGridCellsMod[imod]);
c8fe2783 583
a5fafd85 584 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
c8fe2783 585 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
f2a06a87 586 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
a5fafd85 587 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
588 outputContainer->Add(fhGridCellsEMod[imod]);
589
50f39b97 590 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 591 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
50f39b97 592 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)");
593 fhGridCellsTimeMod[imod]->SetXTitle("column (eta direction)");
594 outputContainer->Add(fhGridCellsTimeMod[imod]);
595
5a2dbc3c 596 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
a5fafd85 597 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
598 outputContainer->Add(fhAmplitudeMod[imod]);
599
50f39b97 600 if(fCalorimeter == "EMCAL"){
601 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
602 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);
603 fhAmplitudeModFraction[imod*3+ifrac]->SetXTitle("E (GeV)");
604 outputContainer->Add(fhAmplitudeModFraction[imod*3+ifrac]);
605 }
eb5a51ae 606
50f39b97 607 }
608
eb5a51ae 609 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
c8fe2783 610 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
611 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
612 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
613 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
614 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
615 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
c1ac3823 616
a6f26052 617 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
618 // Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu),
619 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
620 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
621 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
622 // outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
623 //
c1ac3823 624
a6f26052 625 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
626 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
627 // Int_t index = (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod;
628 // fhTimeCorrRCU[index] = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
629 // Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
630 // ntimebins,timemin,timemax,ntimebins,timemin,timemax);
631 // fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
632 // fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
633 // outputContainer->Add(fhTimeCorrRCU[index]);
634 // }
635 // }
eb5a51ae 636 }
637
638
a5fafd85 639 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
c8fe2783 640 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
641 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
583c48f1 642 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
a5fafd85 643 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
644 outputContainer->Add(fhIMMod[imod]);
c8fe2783 645
a5fafd85 646 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
c8fe2783 647 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
648 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
583c48f1 649 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
a5fafd85 650 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
651 outputContainer->Add(fhIMCellCutMod[imod]);
652
653 }
654
655
a6f26052 656 //Monte Carlo Histograms
9725fd2a 657 if(IsDataMC()){
658
5a2dbc3c 659 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
9725fd2a 660 fhDeltaE->SetXTitle("#Delta E (GeV)");
661 outputContainer->Add(fhDeltaE);
662
5a2dbc3c 663 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
9725fd2a 664 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
665 outputContainer->Add(fhDeltaPt);
666
5a2dbc3c 667 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
9725fd2a 668 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
669 outputContainer->Add(fhDeltaPhi);
670
5a2dbc3c 671 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
9725fd2a 672 fhDeltaEta->SetXTitle("#Delta #eta ");
673 outputContainer->Add(fhDeltaEta);
674
5a2dbc3c 675 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
9725fd2a 676 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
677 outputContainer->Add(fhRatioE);
678
5a2dbc3c 679 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
9725fd2a 680 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
681 outputContainer->Add(fhRatioPt);
682
5a2dbc3c 683 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
9725fd2a 684 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
685 outputContainer->Add(fhRatioPhi);
686
5a2dbc3c 687 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
9725fd2a 688 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
689 outputContainer->Add(fhRatioEta);
690
691 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
692 fh2E->SetXTitle("E_{rec} (GeV)");
693 fh2E->SetYTitle("E_{gen} (GeV)");
694 outputContainer->Add(fh2E);
695
696 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
697 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
698 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
699 outputContainer->Add(fh2Pt);
700
701 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
702 fh2Phi->SetXTitle("#phi_{rec} (rad)");
703 fh2Phi->SetYTitle("#phi_{gen} (rad)");
704 outputContainer->Add(fh2Phi);
705
706 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
707 fh2Eta->SetXTitle("#eta_{rec} ");
708 fh2Eta->SetYTitle("#eta_{gen} ");
709 outputContainer->Add(fh2Eta);
710
a6f26052 711 //Fill histos depending on origin of cluster
9725fd2a 712 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 713 fhGamE->SetXTitle("E_{rec} (GeV)");
714 fhGamE->SetXTitle("E_{gen} (GeV)");
9725fd2a 715 outputContainer->Add(fhGamE);
716
717 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 718 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
719 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 720 outputContainer->Add(fhGamPt);
721
722 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 723 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
724 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 725 outputContainer->Add(fhGamPhi);
726
727 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 728 fhGamEta->SetXTitle("#eta_{rec} ");
729 fhGamEta->SetYTitle("#eta_{gen} ");
9725fd2a 730 outputContainer->Add(fhGamEta);
731
5a2dbc3c 732 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
9725fd2a 733 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
734 outputContainer->Add(fhGamDeltaE);
735
5a2dbc3c 736 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
9725fd2a 737 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
738 outputContainer->Add(fhGamDeltaPt);
739
5a2dbc3c 740 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
9725fd2a 741 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
742 outputContainer->Add(fhGamDeltaPhi);
743
5a2dbc3c 744 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
9725fd2a 745 fhGamDeltaEta->SetXTitle("#Delta #eta ");
746 outputContainer->Add(fhGamDeltaEta);
747
5a2dbc3c 748 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
9725fd2a 749 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
750 outputContainer->Add(fhGamRatioE);
751
5a2dbc3c 752 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
9725fd2a 753 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
754 outputContainer->Add(fhGamRatioPt);
755
5a2dbc3c 756 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
9725fd2a 757 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
758 outputContainer->Add(fhGamRatioPhi);
759
5a2dbc3c 760 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
9725fd2a 761 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
762 outputContainer->Add(fhGamRatioEta);
c8fe2783 763
06e5656a 764 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
765 fhPi0E->SetXTitle("E_{rec} (GeV)");
766 fhPi0E->SetYTitle("E_{gen} (GeV)");
9725fd2a 767 outputContainer->Add(fhPi0E);
768
769 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 770 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
771 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 772 outputContainer->Add(fhPi0Pt);
773
774 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 775 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
776 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 777 outputContainer->Add(fhPi0Phi);
778
779 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 780 fhPi0Eta->SetXTitle("#eta_{rec} ");
781 fhPi0Eta->SetYTitle("#eta_{gen} ");
9725fd2a 782 outputContainer->Add(fhPi0Eta);
783
784 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 785 fhEleE->SetXTitle("E_{rec} (GeV)");
786 fhEleE->SetXTitle("E_{gen} (GeV)");
9725fd2a 787 outputContainer->Add(fhEleE);
788
789 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 790 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
791 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 792 outputContainer->Add(fhElePt);
793
06e5656a 794 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
795 fhElePhi->SetXTitle("#phi_{rec} (rad)");
796 fhElePhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 797 outputContainer->Add(fhElePhi);
798
799 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 800 fhEleEta->SetXTitle("#eta_{rec} ");
801 fhEleEta->SetYTitle("#eta_{gen} ");
9725fd2a 802 outputContainer->Add(fhEleEta);
803
06e5656a 804 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
805 fhNeHadE->SetXTitle("E_{rec} (GeV)");
806 fhNeHadE->SetYTitle("E_{gen} (GeV)");
9725fd2a 807 outputContainer->Add(fhNeHadE);
808
809 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 810 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
811 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 812 outputContainer->Add(fhNeHadPt);
813
814 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 815 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
816 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 817 outputContainer->Add(fhNeHadPhi);
818
819 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 820 fhNeHadEta->SetXTitle("#eta_{rec} ");
821 fhNeHadEta->SetYTitle("#eta_{gen} ");
9725fd2a 822 outputContainer->Add(fhNeHadEta);
823
06e5656a 824 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
825 fhChHadE->SetXTitle("E_{rec} (GeV)");
826 fhChHadE->SetYTitle("E_{gen} (GeV)");
9725fd2a 827 outputContainer->Add(fhChHadE);
828
829 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
06e5656a 830 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
831 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
9725fd2a 832 outputContainer->Add(fhChHadPt);
833
834 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
06e5656a 835 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
836 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
9725fd2a 837 outputContainer->Add(fhChHadPhi);
838
839 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
06e5656a 840 fhChHadEta->SetXTitle("#eta_{rec} ");
841 fhChHadEta->SetYTitle("#eta_{gen} ");
9725fd2a 842 outputContainer->Add(fhChHadEta);
843
a6f26052 844 //Charged clusters
06e5656a 845
846 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
847 fhGamECharged->SetXTitle("E_{rec} (GeV)");
848 fhGamECharged->SetXTitle("E_{gen} (GeV)");
849 outputContainer->Add(fhGamECharged);
850
851 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
852 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
853 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
854 outputContainer->Add(fhGamPtCharged);
855
856 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
857 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
858 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
859 outputContainer->Add(fhGamPhiCharged);
860
861 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
862 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
863 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
864 outputContainer->Add(fhGamEtaCharged);
865
866 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
867 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
868 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
869 outputContainer->Add(fhPi0ECharged);
870
871 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
872 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
873 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
874 outputContainer->Add(fhPi0PtCharged);
875
876 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
877 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
878 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
879 outputContainer->Add(fhPi0PhiCharged);
880
881 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
882 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
883 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
884 outputContainer->Add(fhPi0EtaCharged);
885
886 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
887 fhEleECharged->SetXTitle("E_{rec} (GeV)");
888 fhEleECharged->SetXTitle("E_{gen} (GeV)");
889 outputContainer->Add(fhEleECharged);
890
891 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
892 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
893 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
894 outputContainer->Add(fhElePtCharged);
895
896 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
897 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
898 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
899 outputContainer->Add(fhElePhiCharged);
900
901 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
902 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
903 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
904 outputContainer->Add(fhEleEtaCharged);
905
906 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
907 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
908 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
909 outputContainer->Add(fhNeHadECharged);
910
911 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
912 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
913 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
914 outputContainer->Add(fhNeHadPtCharged);
915
916 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
917 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
918 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
919 outputContainer->Add(fhNeHadPhiCharged);
920
921 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
922 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
923 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
924 outputContainer->Add(fhNeHadEtaCharged);
925
926 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
927 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
928 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
929 outputContainer->Add(fhChHadECharged);
930
931 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
932 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
933 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
934 outputContainer->Add(fhChHadPtCharged);
935
936 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
937 fhChHadPhiCharged->SetXTitle("#phi (rad)");
938 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
939 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
940 outputContainer->Add(fhChHadPhiCharged);
941
942 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
943 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
944 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
945 outputContainer->Add(fhChHadEtaCharged);
946
a6f26052 947 //Vertex of generated particles
9725fd2a 948
5a2dbc3c 949 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
9725fd2a 950 fhEMVxyz->SetXTitle("v_{x}");
951 fhEMVxyz->SetYTitle("v_{y}");
a6f26052 952 //fhEMVxyz->SetZTitle("v_{z}");
9725fd2a 953 outputContainer->Add(fhEMVxyz);
954
5a2dbc3c 955 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
9725fd2a 956 fhHaVxyz->SetXTitle("v_{x}");
957 fhHaVxyz->SetYTitle("v_{y}");
a6f26052 958 //fhHaVxyz->SetZTitle("v_{z}");
9725fd2a 959 outputContainer->Add(fhHaVxyz);
960
5a2dbc3c 961 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
9725fd2a 962 fhEMR->SetXTitle("E (GeV)");
963 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
964 outputContainer->Add(fhEMR);
965
5a2dbc3c 966 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
9725fd2a 967 fhHaR->SetXTitle("E (GeV)");
968 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
969 outputContainer->Add(fhHaR);
970
c8fe2783 971
9725fd2a 972
a6f26052 973 //Pure MC
9725fd2a 974 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
975 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
976 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
977
978 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
979 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
980 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
981
982 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
983 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
984 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
985
986 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
987 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
988 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
989
990 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
991 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
992 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
993
994 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
995 fhGenGamEta->SetXTitle("#eta");
996 fhGenGamPhi->SetXTitle("#phi (rad)");
997 outputContainer->Add(fhGenGamPt);
998 outputContainer->Add(fhGenGamEta);
999 outputContainer->Add(fhGenGamPhi);
c8fe2783 1000
9725fd2a 1001 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
1002 fhGenPi0Eta->SetXTitle("#eta");
1003 fhGenPi0Phi->SetXTitle("#phi (rad)");
1004 outputContainer->Add(fhGenPi0Pt);
1005 outputContainer->Add(fhGenPi0Eta);
1006 outputContainer->Add(fhGenPi0Phi);
1007
1008 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
1009 fhGenEtaEta->SetXTitle("#eta");
1010 fhGenEtaPhi->SetXTitle("#phi (rad)");
1011 outputContainer->Add(fhGenEtaPt);
1012 outputContainer->Add(fhGenEtaEta);
1013 outputContainer->Add(fhGenEtaPhi);
c8fe2783 1014
9725fd2a 1015 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
1016 fhGenOmegaEta->SetXTitle("#eta");
1017 fhGenOmegaPhi->SetXTitle("#phi (rad)");
1018 outputContainer->Add(fhGenOmegaPt);
1019 outputContainer->Add(fhGenOmegaEta);
1020 outputContainer->Add(fhGenOmegaPhi);
1021
1022 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
1023 fhGenEleEta->SetXTitle("#eta");
1024 fhGenElePhi->SetXTitle("#phi (rad)");
1025 outputContainer->Add(fhGenElePt);
1026 outputContainer->Add(fhGenEleEta);
1027 outputContainer->Add(fhGenElePhi);
1028
1029 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1030 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1031 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
1032 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
1033
17708df9 1034 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
9725fd2a 1035 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1036 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
1037 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
1038
1039 fhGenGamAccE ->SetXTitle("E (GeV)");
1040 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
1041 fhGenGamAccEta->SetXTitle("#eta");
1042 fhGenGamAccPhi->SetXTitle("#phi (rad)");
1043 outputContainer->Add(fhGenGamAccE);
1044 outputContainer->Add(fhGenGamAccPt);
1045 outputContainer->Add(fhGenGamAccEta);
1046 outputContainer->Add(fhGenGamAccPhi);
1047
1048 fhGenPi0AccE ->SetXTitle("E (GeV)");
1049 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
1050 fhGenPi0AccEta->SetXTitle("#eta");
1051 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
1052 outputContainer->Add(fhGenPi0AccE);
1053 outputContainer->Add(fhGenPi0AccPt);
1054 outputContainer->Add(fhGenPi0AccEta);
1055 outputContainer->Add(fhGenPi0AccPhi);
1056
a6f26052 1057 //Track Matching
a0bb4dc0 1058
5a2dbc3c 1059 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
a0bb4dc0 1060 fhMCEle1pOverE->SetYTitle("p/E");
1061 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1062 outputContainer->Add(fhMCEle1pOverE);
1063
5a2dbc3c 1064 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
a0bb4dc0 1065 fhMCEle1dR->SetXTitle("#Delta R (rad)");
1066 outputContainer->Add(fhMCEle1dR) ;
1067
5a2dbc3c 1068 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
a0bb4dc0 1069 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1070 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1071 outputContainer->Add(fhMCEle2MatchdEdx);
1072
5a2dbc3c 1073 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
a0bb4dc0 1074 fhMCChHad1pOverE->SetYTitle("p/E");
1075 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1076 outputContainer->Add(fhMCChHad1pOverE);
1077
5a2dbc3c 1078 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
a0bb4dc0 1079 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1080 outputContainer->Add(fhMCChHad1dR) ;
1081
5a2dbc3c 1082 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
a0bb4dc0 1083 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1084 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1085 outputContainer->Add(fhMCChHad2MatchdEdx);
1086
5a2dbc3c 1087 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
a0bb4dc0 1088 fhMCNeutral1pOverE->SetYTitle("p/E");
1089 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1090 outputContainer->Add(fhMCNeutral1pOverE);
1091
5a2dbc3c 1092 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
a0bb4dc0 1093 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1094 outputContainer->Add(fhMCNeutral1dR) ;
1095
5a2dbc3c 1096 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
a0bb4dc0 1097 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1098 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1099 outputContainer->Add(fhMCNeutral2MatchdEdx);
c8fe2783 1100
5a2dbc3c 1101 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
a0bb4dc0 1102 fhMCEle1pOverER02->SetYTitle("p/E");
1103 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1104 outputContainer->Add(fhMCEle1pOverER02);
1105
5a2dbc3c 1106 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
a0bb4dc0 1107 fhMCChHad1pOverER02->SetYTitle("p/E");
1108 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1109 outputContainer->Add(fhMCChHad1pOverER02);
1110
5a2dbc3c 1111 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
a0bb4dc0 1112 fhMCNeutral1pOverER02->SetYTitle("p/E");
1113 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1114 outputContainer->Add(fhMCNeutral1pOverER02);
9725fd2a 1115 }
c8fe2783 1116
9725fd2a 1117 return outputContainer;
1118}
1119
a6f26052 1120//_______________________________________________________________________________________________________________________________________
3a75604b 1121Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
1122{
a6f26052 1123 //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
3a75604b 1124 Float_t oldbinsize = histo->GetBinWidth(0);
1125 Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
a6f26052 1126 //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
3a75604b 1127 if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
1128 else return 1;
1129}
a5fafd85 1130
a6f26052 1131//__________________________________________________
9725fd2a 1132void AliAnaCalorimeterQA::Init()
1133{
a6f26052 1134 //Check if the data or settings are ok
9725fd2a 1135 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1136 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1137 abort();
1138 }
1139
1140 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1141 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1142 abort();
1143 }
1144
1145}
1146
1147
a6f26052 1148//__________________________________________________
9725fd2a 1149void AliAnaCalorimeterQA::InitParameters()
1150{
a6f26052 1151 //Initialize the parameters of the analysis.
9725fd2a 1152 AddToHistogramsName("AnaCaloQA_");
c8fe2783 1153
9725fd2a 1154 fCalorimeter = "EMCAL"; //or PHOS
5a2dbc3c 1155 fStyleMacro = "" ;
1156 fNModules = 12; // set maximum to maximum number of EMCAL modules
eb5a51ae 1157 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
4cf55759 1158 fTimeCutMin = -1;
1159 fTimeCutMax = 9999999;
eb5a51ae 1160
5a2dbc3c 1161 fHistoPOverEBins = 100 ; fHistoPOverEMax = 10. ; fHistoPOverEMin = 0. ;
1162 fHistodEdxBins = 200 ; fHistodEdxMax = 400. ; fHistodEdxMin = 0. ;
1163 fHistodRBins = 300 ; fHistodRMax = 3.15 ; fHistodRMin = 0. ;
c9141a7c 1164 fHistoTimeBins = 1000; fHistoTimeMax = 1.e3 ; fHistoTimeMin = 0. ;//ns
5a2dbc3c 1165 fHistoNBins = 300 ; fHistoNMax = 300 ; fHistoNMin = 0 ;
1166 fHistoRatioBins = 200 ; fHistoRatioMax = 2 ; fHistoRatioMin = 0. ;
1167 fHistoVertexDistBins = 100 ; fHistoVertexDistMax = 500. ; fHistoVertexDistMin = 0. ;
0866d83a 1168 fHistoRBins = 100 ; fHistoRMax = 500 ; fHistoRMin = -500 ;//cm
1169 fHistoXBins = 100 ; fHistoXMax = 500 ; fHistoXMin = -500 ;//cm
1170 fHistoYBins = 100 ; fHistoYMax = 500 ; fHistoYMin = -500 ;//cm
1171 fHistoZBins = 100 ; fHistoZMax = 600 ; fHistoZMin = -500 ;//cm
eb5a51ae 1172 fHistoSSBins = 40 ; fHistoSSMax = 10 ; fHistoSSMin = 0 ;
1173
9725fd2a 1174}
1175
a6f26052 1176//__________________________________________________________________
9725fd2a 1177void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1178{
a6f26052 1179 //Print some relevant parameters set for the analysis
9725fd2a 1180 if(! opt)
1181 return;
1182
1183 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1184 AliAnaPartCorrBaseClass::Print(" ");
c8fe2783 1185
9725fd2a 1186 printf("Select Calorimeter %s \n",fCalorimeter.Data());
63f1dd86 1187 printf("Make plots? %d \n",fMakePlots);
1188 printf("Plots style macro %s \n",fStyleMacro.Data());
4cf55759 1189 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
5a2dbc3c 1190 printf("Histograms: %3.1f < p/E < %3.1f, Nbin = %d\n", fHistoPOverEMin, fHistoPOverEMax, fHistoPOverEBins);
1191 printf("Histograms: %3.1f < dEdx < %3.1f, Nbin = %d\n", fHistodEdxMin, fHistodEdxMax, fHistodEdxBins);
0866d83a 1192 printf("Histograms: %3.1f < dR (track cluster) < %3.1f, Nbin = %d\n", fHistodRMin, fHistodRMax, fHistodRBins);
255b904d 1193 printf("Histograms: %3.1f < R=sqrt{x^2+y^2} < %3.1f, Nbin = %d\n", fHistoRMin, fHistoRMax, fHistoRBins);
0866d83a 1194 printf("Histograms: %3.1f < X < %3.1f, Nbin = %d\n", fHistoXMin, fHistoXMax, fHistoXBins);
1195 printf("Histograms: %3.1f < Y < %3.1f, Nbin = %d\n", fHistoYMin, fHistoYMax, fHistoYBins);
1196 printf("Histograms: %3.1f < Z < %3.1f, Nbin = %d\n", fHistoZMin, fHistoZMax, fHistoZBins);
5a2dbc3c 1197 printf("Histograms: %g < Time < %g, Nbin = %d\n" , fHistoTimeMin, fHistoTimeMax, fHistoTimeBins);
1198 printf("Histograms: %d < N < %d, Nbin = %d\n" , fHistoNMin, fHistoNMax, fHistoNBins);
1199 printf("Histograms: %3.1f < Ratio< %3.1f, Nbin = %d\n", fHistoRatioMin, fHistoRatioMax, fHistoRatioBins);
1200 printf("Histograms: %3.1f < Vertex Distance < %3.1f, Nbin = %d\n", fHistoVertexDistMin, fHistoVertexDistMax, fHistoVertexDistBins);
c8fe2783 1201
9725fd2a 1202}
1203
a6f26052 1204//__________________________________________________________________
9725fd2a 1205void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1206{
a6f26052 1207 //Fill Calorimeter QA histograms
17708df9 1208 TLorentzVector mom ;
9725fd2a 1209 TLorentzVector mom2 ;
17708df9 1210 TObjArray * caloClusters = NULL;
902aa95c 1211 Int_t nLabel = 0;
1212 Int_t *labels=0x0;
1213 Int_t nCaloClusters = 0;
1214 Int_t nCaloCellsPerCluster = 0;
1215 Int_t nTracksMatched = 0;
1216 Int_t trackIndex = 0;
a5fafd85 1217 Int_t nModule = -1;
c8fe2783 1218
a6f26052 1219 //Play with the MC stack if available
1220 //Get the MC arrays and do some checks
902aa95c 1221 if(IsDataMC()){
1222 if(GetReader()->ReadStack()){
c8fe2783 1223
902aa95c 1224 if(!GetMCStack()) {
1225 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1226 abort();
1227 }
a6f26052 1228 //Fill some pure MC histograms, only primaries.
902aa95c 1229 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1230 TParticle *primary = GetMCStack()->Particle(i) ;
a6f26052 1231 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
902aa95c 1232 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1233 primary->Momentum(mom);
1234 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1235 } //primary loop
1236 }
1237 else if(GetReader()->ReadAODMCParticles()){
c8fe2783 1238
902aa95c 1239 if(!GetReader()->GetAODMCParticles(0)) {
1240 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1241 abort();
1242 }
a6f26052 1243 //Fill some pure MC histograms, only primaries.
902aa95c 1244 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1245 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
a6f26052 1246 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1247 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1248 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
902aa95c 1249 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
a6f26052 1250 //aodprimary->Momentum(mom);
902aa95c 1251 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1252 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1253 } //primary loop
1254
1255 }
1256 }// is data and MC
1257
1258
a6f26052 1259 //Get List with CaloClusters
17708df9 1260 if (fCalorimeter == "PHOS") caloClusters = GetAODPHOS();
1261 else if (fCalorimeter == "EMCAL") caloClusters = GetAODEMCAL();
f8006433 1262 else
1263 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
17708df9 1264
f8006433 1265 // if (fCalorimeter == "EMCAL") GetReader()->GetInputEvent()->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1266 // else if(fCalorimeter == "PHOS") GetReader()->GetInputEvent()->GetPHOSClusters (caloClusters);//GetAODPHOS();
1267 // else
1268 // AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
9725fd2a 1269
f8006433 1270 if(!caloClusters) {
c8fe2783 1271 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n"));
f8006433 1272 }
1273 else{
1274 //----------------------------------------------------------
1275 //Correlate Calorimeters
1276 //----------------------------------------------------------
1277 //if(fCorrelateCalos) CorrelateCalorimeters(caloClusters);
1278 if(fCorrelateCalos) CorrelateCalorimeters();
1279
1280
1281 //----------------------------------------------------------
1282 // CALOCLUSTERS
1283 //----------------------------------------------------------
1284
1285 nCaloClusters = caloClusters->GetEntriesFast() ;
1286 fhNClusters->Fill(nCaloClusters);
1287 Int_t *nClustersInModule = new Int_t[fNModules];
1288 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1289
1290 if(GetDebug() > 0)
1291 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1292
1293 //Get vertex for photon momentum calculation
1294 Double_t v[3] = {0,0,0}; //vertex ;
1295 GetReader()->GetVertex(v);
1296 AliVTrack * track = 0x0;
1297
1298 Float_t pos[3] ;
1299 Float_t showerShape[3] ;
1300 Double_t tof = 0;
1301 //Loop over CaloClusters
1302 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1303 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
c8fe2783 1304
f8006433 1305 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1306 iclus+1,nCaloClusters,GetReader()->GetDataType());
c8fe2783 1307
f8006433 1308 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
1309 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
1310 AliVCaloCells * cell = 0x0;
1311 if(fCalorimeter == "PHOS") cell = GetPHOSCells();
1312 else cell = GetEMCALCells();
c8fe2783 1313
f8006433 1314 //Get cluster kinematics
1315 clus->GetPosition(pos);
1316 clus->GetMomentum(mom,v);
1317 tof = clus->GetTOF()*1e9;
1318 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
c8fe2783 1319
f8006433 1320 //Check only certain regions
1321 Bool_t in = kTRUE;
1322 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1323 if(!in) continue;
1324 //Get module of cluster
1325 nModule = GetModuleNumber(clus);
1326 if(nModule >=0 && nModule < fNModules) nClustersInModule[nModule]++;
1327 //MC labels
1328 nLabel = clus->GetNLabels();
1329 labels = clus->GetLabels();
1330 //Cells per cluster
1331 nCaloCellsPerCluster = clus->GetNCells();
1332 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1333 //matched cluster with tracks
1334 nTracksMatched = clus->GetNTracksMatched();
1335 trackIndex = clus->GetTrackMatchedIndex();
1336 if(trackIndex >= 0){
1337 track = (AliVTrack*)GetReader()->GetInputEvent()->GetTrack(trackIndex);
1338 }
1339 else{
1340 if(nTracksMatched == 1) nTracksMatched = 0;
1341 track = 0;
c8fe2783 1342 }
c8fe2783 1343
f8006433 1344 //Shower shape parameters
1345 showerShape[0] = clus->GetM20();
1346 showerShape[1] = clus->GetM02();
1347 showerShape[2] = clus->GetDispersion();
c8fe2783 1348
f8006433 1349 //======================
1350 //Cells in cluster
1351 //======================
c8fe2783 1352
f8006433 1353 //Get list of contributors
1354 UShort_t * indexList = clus->GetCellsAbsId() ;
1355 // check time of cells respect to max energy cell
1356 //Get maximum energy cell
1357 Float_t emax = -1;
1358 Double_t tmax = -1;
1359 Int_t imax = -1;
1360 Int_t absId = -1 ;
1361 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1362 //Loop on cluster cells
1363 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1364 // printf("Index %d\n",ipos);
1365 absId = indexList[ipos];
1366
1367 //Get position of cell compare to cluster
1368 if(fFillAllPosHisto){
1369 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1370
1371 Double_t cellpos[] = {0, 0, 0};
1372 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1373
1374 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1375 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1376 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1377
1378 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1379 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1380 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1381
1382 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1383 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1384 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1385 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1386
1387 // Float_t celleta = 0, cellphi = 0;
1388 // GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi);
1389 // Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
1390 // GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1391 // GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1392 // iIphi, iIeta,iphi,ieta);
1393 // printf("AbsId %d, SM %d, Index eta %d, phi %d\n", absId, imod, ieta, iphi);
1394 // 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());
1395 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1396 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1397 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1398 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1399 //
1400
1401 }//EMCAL and its matrices are available
1402 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1403 TVector3 xyz;
1404 Int_t relId[4], module;
1405 Float_t xCell, zCell;
1406
1407 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1408 module = relId[0];
1409 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1410 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1411
1412 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1413 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1414 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1415
1416 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1417 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1418 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1419
1420 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1421 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1422 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1423 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1424
1425 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1426 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1427 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1428 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1429 }//PHOS and its matrices are available
1430 }//Fill all position histograms
1431
1432 //Find maximum energy cluster
1433 if(cell->GetCellAmplitude(absId) > emax) {
1434 imax = ipos;
1435 emax = cell->GetCellAmplitude(absId);
1436 tmax = cell->GetCellTime(absId);
1437 }
1438
1439 }// cluster cell loop
c8fe2783 1440
f8006433 1441 // check time of cells respect to max energy cell
1442 if(nCaloCellsPerCluster > 1){
1443 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1444 if(imax == ipos) continue;
1445 absId = indexList[ipos];
1446 Float_t diff = (tmax-cell->GetCellTime(absId))*1e9;
1447 fhCellTimeSpreadRespectToCellMax->Fill(diff);
1448 if(TMath::Abs(TMath::Abs(diff) > 100)) fhCellIdCellLargeTimeSpread->Fill(absId);
1449 }// fill cell-cluster histogram loop
1450
1451 }//check time of cells respect to max energy cell
1452
1453 //-----------------------------------------------------------
1454 //Fill histograms related to single cluster or track matching
1455 //-----------------------------------------------------------
1456
1457 ClusterHistograms(mom, tof, pos, showerShape, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1458
1459
1460 //-----------------------------------------------------------
1461 //Invariant mass
1462 //-----------------------------------------------------------
1463 if(GetDebug()>1) printf("Invariant mass \n");
1464
1465 //do not do for bad vertex
1466 Float_t fZvtxCut = 40. ;
1467 if(v[2]<-fZvtxCut || v[2]> fZvtxCut) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
1468
1469 Int_t nModule2 = -1;
1470 Int_t nCaloCellsPerCluster2=0;
1471 if (nCaloClusters > 1 ) {
1472 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1473 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
1474
1475 //Get cluster kinematics
1476 clus2->GetMomentum(mom2,v);
1477 //Check only certain regions
1478 Bool_t in2 = kTRUE;
1479 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1480 if(!in2) continue;
1481 //Get module of cluster
1482 nModule2 = GetModuleNumber(clus2);
1483 //Cells per cluster
1484 nCaloCellsPerCluster2 = clus2->GetNCells();
1485 }
1486 //Fill invariant mass histograms
1487 //All modules
1488
1489 //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());
1490 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1491 //Single module
1492 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1493 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1494
1495 //Select only clusters with at least 2 cells
1496 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
1497 //All modules
1498 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1499 //Single modules
1500 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1501 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1502 }
1503
1504 //Asymetry histograms
1505 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1506
1507 }// 2nd cluster loop
1508 }////more than 1 cluster in calorimeter
1509 }//cluster loop
1510
1511 //Number of clusters per module
1512 for(Int_t imod = 0; imod < fNModules; imod++ ){
1513 if(GetDebug() > 1)
1514 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1515 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1516 }
1517 delete [] nClustersInModule;
1518 //delete caloClusters;
1519 }// calo clusters array exists
c8fe2783 1520
a6f26052 1521 //----------------------------------------------------------
1522 // CALOCELLS
1523 //----------------------------------------------------------
0866d83a 1524
491e4f8b 1525 Int_t *nCellsInModule = new Int_t[fNModules];
a5fafd85 1526 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
fa991e42 1527 Int_t icol = -1;
1528 Int_t irow = -1;
1529 Int_t iRCU = -1;
1530 Float_t amp = 0.;
1531 Float_t time = 0.;
1532 Int_t id = -1;
1533 Float_t recalF = 1.;
1534
c8fe2783 1535 AliVCaloCells * cell = 0x0;
1536 Int_t ncells = 0;
1537 if(fCalorimeter == "PHOS")
17708df9 1538 cell = GetPHOSCells();
c8fe2783 1539 else
17708df9 1540 cell = GetEMCALCells();
c8fe2783 1541
1542 if(!cell) {
1543 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s ESD CELLS available for analysis\n",fCalorimeter.Data());
1544 abort();
1545 }
1546
1547 ncells = cell->GetNumberOfCells() ;
1548 fhNCells->Fill(ncells) ;
1549 if(GetDebug() > 0)
1550 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In ESD %s cell entries %d\n", fCalorimeter.Data(), ncells);
1551
1552 for (Int_t iCell = 0; iCell < ncells; iCell++) {
1553 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1554 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
1555 if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1556
1557 if(nModule < fNModules) {
a6f26052 1558 //Check if the cell is a bad channel
c8fe2783 1559 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1560 if(fCalorimeter=="EMCAL"){
1561 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1562 }
1563 else {
1564 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
1565 printf("PHOS bad channel\n");
1566 continue;
1567 }
1568 }
1569 }
1570
a6f26052 1571 //Get Recalibration factor if set
c8fe2783 1572 if (GetCaloUtils()->IsRecalibrationOn()) {
1573 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
17708df9 1574 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
c8fe2783 1575 if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
1576 }
1577
1578 amp = cell->GetAmplitude(iCell)*recalF;
1579 time = cell->GetTime(iCell)*1e9;//transform time to ns
1580
a6f26052 1581 //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
1582 // amp,time,nModule,icol,irow);
c8fe2783 1583
1584 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1585
a6f26052 1586 //printf("%s: time %g\n",fCalorimeter.Data(), time);
c8fe2783 1587 id = cell->GetCellNumber(iCell);
1588 fhAmplitude->Fill(amp);
1589 fhAmpId ->Fill(amp,id);
1590 fhTime ->Fill(time);
1591 fhTimeId ->Fill(time,id);
1592 fhTimeAmp ->Fill(amp,time);
a6f26052 1593 //Double_t t0 = GetReader()->GetInputEvent()->GetT0();
1594 //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0,
1595 // GetReader()->GetInputEvent()->GetT0zVertex(),
1596 // GetReader()->GetInputEvent()->GetT0clock(),
1597 // GetReader()->GetInputEvent()->GetT0Trig());
1598 //fhT0Time ->Fill(time-t0);
1599 //fhT0TimeId ->Fill(time-t0,id);
1600 //fhT0TimeAmp ->Fill(amp,time-t0);
c8fe2783 1601
1602 fhAmplitudeMod[nModule]->Fill(amp);
1603 if(fCalorimeter=="EMCAL"){
1604 Int_t ifrac = 0;
1605 if(icol > 15 && icol < 32) ifrac = 1;
1606 else if(icol > 31) ifrac = 2;
1607 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
1608
1609
1610 }
1611
1612 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
a6f26052 1613 //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
1614 //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
c8fe2783 1615 nCellsInModule[nModule]++;
1616 fhGridCellsMod[nModule] ->Fill(icol,irow);
1617 fhGridCellsEMod[nModule] ->Fill(icol,irow,amp);
1618 if(amp > 0.3){
1619 fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
1620
a6f26052 1621 // AliESDCaloCells * cell2 = 0x0;
1622 // if(fCalorimeter == "PHOS") cell2 = GetReader()->GetInputEvent()->GetPHOSCells();
1623 // else cell2 = GetReader()->GetInputEvent()->GetEMCALCells();
1624 // Int_t icol2 = -1;
1625 // Int_t irow2 = -1;
1626 // Int_t iRCU2 = -1;
1627 // Float_t amp2 = 0.;
1628 // Float_t time2 = 0.;
1629 // Int_t id2 = -1;
1630 // Int_t nModule2 = -1;
1631 // for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {
1632 // amp2 = cell2->GetAmplitude(iCell2);
1633 // if(amp2 < 0.3) continue;
1634 // if(iCell2 == iCell) continue;
1635 // time2 = cell2->GetTime(iCell2)*1e9;//transform time to ns
1636 // //printf("%s: time %g\n",fCalorimeter.Data(), time);
1637 // id2 = cell2->GetCellNumber(iCell2);
1638 // nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
1639 // Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule);
1640 // //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());
1641 // fhTimeCorrRCU[index]->Fill(time,time2);
1642 //
1643 // }// second cell loop
c8fe2783 1644 }// amplitude cut
1645 }//nmodules
1646
a6f26052 1647 //Get Eta-Phi position of Cell
b8187de4 1648 //if(fFillAllPosHisto)
a6f26052 1649 {
1650 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1651 Float_t celleta = 0.;
1652 Float_t cellphi = 0.;
1653 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1654 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1655 Double_t cellpos[] = {0, 0, 0};
1656 GetEMCALGeometry()->GetGlobal(id, cellpos);
1657 fhXCellE->Fill(cellpos[0],amp) ;
1658 fhYCellE->Fill(cellpos[1],amp) ;
1659 fhZCellE->Fill(cellpos[2],amp) ;
1660 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1661 fhRCellE->Fill(rcell,amp) ;
1662 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1663 }//EMCAL Cells
1664 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1665 TVector3 xyz;
1666 Int_t relId[4], module;
1667 Float_t xCell, zCell;
1668
1669 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
1670 module = relId[0];
1671 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1672 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1673 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
1674 fhXCellE ->Fill(xyz.X(),amp) ;
1675 fhYCellE ->Fill(xyz.Y(),amp) ;
1676 fhZCellE ->Fill(xyz.Z(),amp) ;
1677 fhRCellE ->Fill(rcell ,amp) ;
1678 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
1679 }//PHOS cells
1680 }//fill cell position histograms
c8fe2783 1681 }//cell loop
1682
a6f26052 1683 //Number of cells per module
63f1dd86 1684 for(Int_t imod = 0; imod < fNModules; imod++ ) {
1685 if(GetDebug() > 1)
1686 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
1687 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
1688 }
4a745797 1689 delete [] nCellsInModule;
1690
902aa95c 1691 if(GetDebug() > 0)
1692 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1693}
1694
a0bb4dc0 1695
17708df9 1696//_____________________________________________________________________________________________
1697void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof,
1698 Float_t *pos, Float_t *showerShape,
c8fe2783 1699 const Int_t nCaloCellsPerCluster,const Int_t nModule,
1700 const Int_t nTracksMatched, const AliVTrack * track,
1701 const Int_t * labels, const Int_t nLabels){
a6f26052 1702 //Fill CaloCluster related histograms
9725fd2a 1703
902aa95c 1704 AliAODMCParticle * aodprimary = 0x0;
1705 TParticle * primary = 0x0;
c8fe2783 1706 Int_t tag = 0;
902aa95c 1707
1708 Float_t e = mom.E();
1709 Float_t pt = mom.Pt();
1710 Float_t eta = mom.Eta();
1711 Float_t phi = mom.Phi();
1712 if(phi < 0) phi +=TMath::TwoPi();
1713 if(GetDebug() > 0) {
1714 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
1715 if(IsDataMC()) {
a6f26052 1716 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
491e4f8b 1717 printf("\t Primaries: nlabels %d\n",nLabels);
902aa95c 1718 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
1719 }
9725fd2a 1720 }
c8fe2783 1721
13d4407a 1722 fhE ->Fill(e);
f8006433 1723 if(nModule >=0 && nModule < fNModules) fhEMod[nModule]->Fill(e);
a6f26052 1724 if(fFillAllTH12){
1725 fhPt ->Fill(pt);
1726 fhPhi ->Fill(phi);
1727 fhEta ->Fill(eta);
1728 }
a5fafd85 1729 fhEtaPhiE->Fill(eta,phi,e);
a6f26052 1730
1731 //Cells per cluster
1732 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster,eta);
1733 fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster,eta);
1734
1735 //Position
b8187de4 1736 //if(fFillAllPosHisto)
1737 {
a6f26052 1738 fhXE ->Fill(pos[0],e);
1739 fhYE ->Fill(pos[1],e);
1740 fhZE ->Fill(pos[2],e);
1741 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
1742
1743 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
1744 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
1745 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
1746 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
1747 fhRE ->Fill(rxyz,e);
1748 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
1749 }
b8187de4 1750
4cf55759 1751 fhClusterTimeEnergy->Fill(e,tof);
0866d83a 1752
a6f26052 1753 //Shower shape parameters
eb5a51ae 1754 fhLambda->Fill(showerShape[0], showerShape[1], e);
1755 fhDispersion->Fill(showerShape[2],e);
c8fe2783 1756
f8006433 1757 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
50f39b97 1758
a6f26052 1759 //Fill histograms only possible when simulation
902aa95c 1760 if(IsDataMC() && nLabels > 0 && labels){
c8fe2783 1761
a6f26052 1762 //Play with the MC stack if available
902aa95c 1763 Int_t label = labels[0];
c8fe2783 1764
902aa95c 1765 if(label < 0) {
1766 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
1767 return;
1768 }
c8fe2783 1769
902aa95c 1770 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1771 Float_t vxMC= 0; Float_t vyMC = 0;
1772 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1773 Int_t charge = 0;
1774
a6f26052 1775 //Check the origin.
902aa95c 1776 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
c8fe2783 1777
902aa95c 1778 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
c8fe2783 1779
902aa95c 1780 if( label >= GetMCStack()->GetNtrack()) {
1781 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1782 return ;
1783 }
9725fd2a 1784
902aa95c 1785 primary = GetMCStack()->Particle(label);
1786 iMother = label;
1787 pdg0 = TMath::Abs(primary->GetPdgCode());
1788 pdg = pdg0;
1789 status = primary->GetStatusCode();
1790 vxMC = primary->Vx();
1791 vyMC = primary->Vy();
1792 iParent = primary->GetFirstMother();
c8fe2783 1793
902aa95c 1794 if(GetDebug() > 1 ) {
1795 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1796 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1797 }
c8fe2783 1798
a6f26052 1799 //Get final particle, no conversion products
902aa95c 1800 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
a6f26052 1801 //Get the parent
902aa95c 1802 primary = GetMCStack()->Particle(iParent);
1803 pdg = TMath::Abs(primary->GetPdgCode());
1804 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1805 while((pdg == 22 || pdg == 11) && status != 1){
1806 iMother = iParent;
1807 primary = GetMCStack()->Particle(iMother);
1808 status = primary->GetStatusCode();
1809 iParent = primary->GetFirstMother();
1810 pdg = TMath::Abs(primary->GetPdgCode());
1811 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1812 }
c8fe2783 1813
902aa95c 1814 if(GetDebug() > 1 ) {
1815 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1816 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1817 }
c8fe2783 1818
902aa95c 1819 }
c8fe2783 1820
a6f26052 1821 //Overlapped pi0 (or eta, there will be very few), get the meson
902aa95c 1822 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 1823 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
902aa95c 1824 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1825 while(pdg != 111 && pdg != 221){
1826 iMother = iParent;
1827 primary = GetMCStack()->Particle(iMother);
1828 status = primary->GetStatusCode();
1829 iParent = primary->GetFirstMother();
1830 pdg = TMath::Abs(primary->GetPdgCode());
1831 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1832 if(iMother==-1) {
1833 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
a6f26052 1834 //break;
902aa95c 1835 }
1836 }
c8fe2783 1837
902aa95c 1838 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
a6f26052 1839 primary->GetName(),iMother);
902aa95c 1840 }
c8fe2783 1841
902aa95c 1842 eMC = primary->Energy();
1843 ptMC = primary->Pt();
1844 phiMC = primary->Phi();
1845 etaMC = primary->Eta();
1846 pdg = TMath::Abs(primary->GetPdgCode());
1847 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
c8fe2783 1848
902aa95c 1849 }
1850 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
a6f26052 1851 //Get the list of MC particles
902aa95c 1852 if(!GetReader()->GetAODMCParticles(0)) {
1853 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
1854 abort();
1855 }
9725fd2a 1856
902aa95c 1857 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
1858 iMother = label;
1859 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1860 pdg = pdg0;
1861 status = aodprimary->IsPrimary();
1862 vxMC = aodprimary->Xv();
1863 vyMC = aodprimary->Yv();
1864 iParent = aodprimary->GetMother();
c8fe2783 1865
902aa95c 1866 if(GetDebug() > 1 ) {
1867 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1868 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
a6f26052 1869 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
902aa95c 1870 }
9725fd2a 1871
a6f26052 1872 //Get final particle, no conversion products
902aa95c 1873 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1874 if(GetDebug() > 1 )
1875 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
a6f26052 1876 //Get the parent
902aa95c 1877 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
1878 pdg = TMath::Abs(aodprimary->GetPdgCode());
1879 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
1880 iMother = iParent;
1881 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1882 status = aodprimary->IsPrimary();
1883 iParent = aodprimary->GetMother();
1884 pdg = TMath::Abs(aodprimary->GetPdgCode());
1885 if(GetDebug() > 1 )
1886 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
a6f26052 1887 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
902aa95c 1888 }
1889
1890 if(GetDebug() > 1 ) {
1891 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1892 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
a6f26052 1893 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
9725fd2a 1894 }
902aa95c 1895
9725fd2a 1896 }
c8fe2783 1897
a6f26052 1898 //Overlapped pi0 (or eta, there will be very few), get the meson
902aa95c 1899 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 1900 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
902aa95c 1901 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1902 while(pdg != 111 && pdg != 221){
1903
1904 iMother = iParent;
1905 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1906 status = aodprimary->IsPrimary();
1907 iParent = aodprimary->GetMother();
1908 pdg = TMath::Abs(aodprimary->GetPdgCode());
c8fe2783 1909
902aa95c 1910 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1911
1912 if(iMother==-1) {
1913 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
a6f26052 1914 //break;
902aa95c 1915 }
1916 }
1917
1918 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
a6f26052 1919 aodprimary->GetName(),iMother);
902aa95c 1920 }
c8fe2783 1921
902aa95c 1922 status = aodprimary->IsPrimary();
1923 eMC = aodprimary->E();
1924 ptMC = aodprimary->Pt();
1925 phiMC = aodprimary->Phi();
1926 etaMC = aodprimary->Eta();
1927 pdg = TMath::Abs(aodprimary->GetPdgCode());
1928 charge = aodprimary->Charge();
c8fe2783 1929
902aa95c 1930 }
c8fe2783 1931
a6f26052 1932 //Float_t vz = primary->Vz();
0866d83a 1933 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
902aa95c 1934 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
1935 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
0866d83a 1936 fhEMR ->Fill(e,rVMC);
902aa95c 1937 }
c8fe2783 1938
a6f26052 1939 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1940 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1941 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
c8fe2783 1942
1943
902aa95c 1944 fh2E ->Fill(e, eMC);
1945 fh2Pt ->Fill(pt, ptMC);
1946 fh2Phi ->Fill(phi, phiMC);
1947 fh2Eta ->Fill(eta, etaMC);
1948 fhDeltaE ->Fill(eMC-e);
1949 fhDeltaPt ->Fill(ptMC-pt);
1950 fhDeltaPhi->Fill(phiMC-phi);
1951 fhDeltaEta->Fill(etaMC-eta);
1952 if(eMC > 0) fhRatioE ->Fill(e/eMC);
1953 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
1954 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
1955 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
c8fe2783 1956
1957
a6f26052 1958 //Overlapped pi0 (or eta, there will be very few)
902aa95c 1959 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 1960 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1961 fhPi0E ->Fill(e,eMC);
1962 fhPi0Pt ->Fill(pt,ptMC);
1963 fhPi0Eta ->Fill(eta,etaMC);
1964 fhPi0Phi ->Fill(phi,phiMC);
1965 if( nTracksMatched > 0){
1966 fhPi0ECharged ->Fill(e,eMC);
1967 fhPi0PtCharged ->Fill(pt,ptMC);
1968 fhPi0PhiCharged ->Fill(phi,phiMC);
1969 fhPi0EtaCharged ->Fill(eta,etaMC);
1970 }
902aa95c 1971 }//Overlapped pizero decay
1972 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
c8fe2783 1973 fhGamE ->Fill(e,eMC);
1974 fhGamPt ->Fill(pt,ptMC);
1975 fhGamEta ->Fill(eta,etaMC);
1976 fhGamPhi ->Fill(phi,phiMC);
1977 fhGamDeltaE ->Fill(eMC-e);
1978 fhGamDeltaPt ->Fill(ptMC-pt);
1979 fhGamDeltaPhi->Fill(phiMC-phi);
1980 fhGamDeltaEta->Fill(etaMC-eta);
1981 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
1982 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
1983 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
1984 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
1985 if( nTracksMatched > 0){
1986 fhGamECharged ->Fill(e,eMC);
1987 fhGamPtCharged ->Fill(pt,ptMC);
1988 fhGamPhiCharged ->Fill(phi,phiMC);
1989 fhGamEtaCharged ->Fill(eta,etaMC);
1990 }
902aa95c 1991 }//photon
1992 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
1993 fhEleE ->Fill(e,eMC);
1994 fhElePt ->Fill(pt,ptMC);
1995 fhEleEta ->Fill(eta,etaMC);
1996 fhElePhi ->Fill(phi,phiMC);
1997 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
0866d83a 1998 fhEMR ->Fill(e,rVMC);
902aa95c 1999 if( nTracksMatched > 0){
2000 fhEleECharged ->Fill(e,eMC);
2001 fhElePtCharged ->Fill(pt,ptMC);
2002 fhElePhiCharged ->Fill(phi,phiMC);
2003 fhEleEtaCharged ->Fill(eta,etaMC);
2004 }
2005 }
2006 else if(charge == 0){
2007 fhNeHadE ->Fill(e,eMC);
2008 fhNeHadPt ->Fill(pt,ptMC);
2009 fhNeHadEta ->Fill(eta,etaMC);
2010 fhNeHadPhi ->Fill(phi,phiMC);
2011 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
0866d83a 2012 fhHaR ->Fill(e,rVMC);
902aa95c 2013 if( nTracksMatched > 0){
2014 fhNeHadECharged ->Fill(e,eMC);
2015 fhNeHadPtCharged ->Fill(pt,ptMC);
2016 fhNeHadPhiCharged ->Fill(phi,phiMC);
2017 fhNeHadEtaCharged ->Fill(eta,etaMC);
9725fd2a 2018 }
902aa95c 2019 }
2020 else if(charge!=0){
2021 fhChHadE ->Fill(e,eMC);
2022 fhChHadPt ->Fill(pt,ptMC);
2023 fhChHadEta ->Fill(eta,etaMC);
2024 fhChHadPhi ->Fill(phi,phiMC);
2025 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
0866d83a 2026 fhHaR ->Fill(e,rVMC);
902aa95c 2027 if( nTracksMatched > 0){
2028 fhChHadECharged ->Fill(e,eMC);
2029 fhChHadPtCharged ->Fill(pt,ptMC);
2030 fhChHadPhiCharged ->Fill(phi,phiMC);
2031 fhChHadEtaCharged ->Fill(eta,etaMC);
9725fd2a 2032 }
902aa95c 2033 }
2034 }//Work with MC
c8fe2783 2035
902aa95c 2036
a6f26052 2037 //Match tracks and clusters
2038 //To be Modified in case of AODs
902aa95c 2039
a6f26052 2040 //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
902aa95c 2041
2042 if( nTracksMatched > 0){
a6f26052 2043 if(fFillAllTH12){
2044 fhECharged ->Fill(e);
2045 fhPtCharged ->Fill(pt);
2046 fhPhiCharged ->Fill(phi);
2047 fhEtaCharged ->Fill(eta);
2048 }
0866d83a 2049 fhEtaPhiECharged->Fill(eta,phi,e);
2050 fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster,eta);
902aa95c 2051
a6f26052 2052 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2053 //Study the track and matched cluster if track exists.
6fa7d352 2054 if(!track) return;
2055 Double_t emcpos[3] = {0.,0.,0.};
2056 Double_t emcmom[3] = {0.,0.,0.};
2057 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2058 Double_t bfield = 0.;
2059 Double_t tphi = 0;
2060 Double_t teta = 0;
2061 Double_t tmom = 0;
2062 Double_t tpt = 0;
2063 Double_t tmom2 = 0;
2064 Double_t tpcSignal = 0;
2065 Bool_t okpos = kFALSE;
2066 Bool_t okmom = kFALSE;
2067 Bool_t okout = kFALSE;
2068 Int_t nITS = 0;
2069 Int_t nTPC = 0;
2070
a6f26052 2071 //In case of ESDs get the parameters in this way
2072 // if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
c8fe2783 2073 if (track->GetOuterParam() ) {
2074 okout = kTRUE;
2075
2076 bfield = GetReader()->GetInputEvent()->GetMagneticField();
2077 okpos = track->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2078 okmom = track->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2079 if(!(okpos && okmom)) return;
2080
2081 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2082 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2083 tphi = position.Phi();
2084 teta = position.Eta();
2085 tmom = momentum.Mag();
2086
a6f26052 2087 //Double_t tphi = track->GetOuterParam()->Phi();
2088 //Double_t teta = track->GetOuterParam()->Eta();
2089 //Double_t tmom = track->GetOuterParam()->P();
c8fe2783 2090 tpt = track->Pt();
2091 tmom2 = track->P();
2092 tpcSignal = track->GetTPCsignal();
2093
2094 nITS = track->GetNcls(0);
2095 nTPC = track->GetNcls(1);
2096 }//Outer param available
a6f26052 2097 //}// ESDs
2098 // else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2099 // AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2100 // if (pid) {
2101 // okout = kTRUE;
2102 // pid->GetEMCALPosition(emcpos);
2103 // pid->GetEMCALMomentum(emcmom);
2104 //
2105 // TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2106 // TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2107 // tphi = position.Phi();
2108 // teta = position.Eta();
2109 // tmom = momentum.Mag();
2110 //
2111 // tpt = ((AliAODTrack*)track)->Pt();
2112 // tmom2 = ((AliAODTrack*)track)->P();
2113 // tpcSignal = pid->GetTPCsignal();
2114 //
2115 // //nITS = ((AliAODTrack*)track)->GetNcls(0);
2116 // //nTPC = ((AliAODTrack*)track)->GetNcls(1);
2117 // }//Outer param available
2118 // }//AODs
2119 // else return; //Do nothing case not implemented.
c8fe2783 2120
2121 if(okout){
2122 Double_t deta = teta - eta;
2123 Double_t dphi = tphi - phi;
2124 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2125 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2126 Double_t dR = sqrt(dphi*dphi + deta*deta);
6fa7d352 2127
c8fe2783 2128 Double_t pOverE = tmom/e;
6fa7d352 2129
c8fe2783 2130 fh1pOverE->Fill(tpt, pOverE);
2131 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
6fa7d352 2132
c8fe2783 2133 fh1dR->Fill(dR);
2134 fh2MatchdEdx->Fill(tmom2,tpcSignal);
6fa7d352 2135
c8fe2783 2136 if(IsDataMC() && primary){
2137 Int_t pdg = primary->GetPdgCode();
2138 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
6fa7d352 2139
c8fe2783 2140 if(TMath::Abs(pdg) == 11){
2141 fhMCEle1pOverE->Fill(tpt,pOverE);
2142 fhMCEle1dR->Fill(dR);
2143 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2144 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2145 }
2146 else if(charge!=0){
2147 fhMCChHad1pOverE->Fill(tpt,pOverE);
2148 fhMCChHad1dR->Fill(dR);
2149 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2150 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2151 }
2152 else if(charge == 0){
2153 fhMCNeutral1pOverE->Fill(tpt,pOverE);
2154 fhMCNeutral1dR->Fill(dR);
2155 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2156 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2157 }
2158 }//DataMC
2159
2160 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2161 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2162 fh2EledEdx->Fill(tmom2,tpcSignal);
2163 }
2164 }
2165 else{//no ESD external param or AODPid
a6f26052 2166 // ULong_t status=AliESDtrack::kTPCrefit;
2167 // status|=AliESDtrack::kITSrefit;
2168 //printf("track status %d\n", track->GetStatus() );
2169 // fhEChargedNoOut ->Fill(e);
2170 // fhPtChargedNoOut ->Fill(pt);
2171 // fhPhiChargedNoOut ->Fill(phi);
2172 // fhEtaChargedNoOut ->Fill(eta);
2173 // fhEtaPhiChargedNoOut ->Fill(eta,phi);
2174 // if(GetDebug() >= 0 && ((track->GetStatus() & status) == status)) printf("ITS+TPC\n");
c8fe2783 2175 if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
2176
2177 }//No out params
6fa7d352 2178 }//matched clusters with tracks
c8fe2783 2179
902aa95c 2180}// Clusters
c8fe2783 2181
a6f26052 2182//__________________________________
17708df9 2183//void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
2184// // Correlate information from PHOS and EMCAL
2185// TRefArray * caloClustersEMCAL = 0;
2186// TRefArray * caloClustersPHOS = 0;
2187//
2188// // Get once the array of clusters per calorimeter, avoid an extra loop.
2189// if(fCalorimeter == "EMCAL"){
2190// caloClustersPHOS = new TRefArray();
2191// GetReader()->GetInputEvent()->GetPHOSClusters(caloClustersPHOS);
2192// caloClustersEMCAL = new TRefArray(*refArray);
2193// }
2194// else if(fCalorimeter == "PHOS") {
2195// caloClustersEMCAL = new TRefArray();
2196// GetReader()->GetInputEvent()->GetEMCALClusters (caloClustersEMCAL);
2197// caloClustersPHOS = new TRefArray(*refArray);
2198// }
2199//
2200// //Fill histograms with clusters
2201//
2202// fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2203// Float_t sumClusterEnergyEMCAL = 0;
2204// Float_t sumClusterEnergyPHOS = 0;
2205// Int_t iclus = 0;
2206// for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2207// sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
2208// for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2209// sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
2210// fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2211//
2212// //Fill histograms with cells
2213//
2214// AliVCaloCells * cellsEMCAL = GetReader()->GetInputEvent()->GetEMCALCells();
2215// AliVCaloCells * cellsPHOS = GetReader()->GetInputEvent()->GetPHOSCells();
2216// fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2217//
2218// Int_t icell = 0;
2219// Float_t sumCellEnergyEMCAL = 0;
2220// Float_t sumCellEnergyPHOS = 0;
2221// for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2222// sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2223// for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2224// sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2225// fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2226// if(GetDebug() > 0 ){
2227// printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2228// printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2229// cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2230// printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2231// cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
2232// }
2233//
2234// delete caloClustersEMCAL;
2235// delete caloClustersPHOS;
2236//
2237//}
2238
2239//__________________________________
2240void AliAnaCalorimeterQA::CorrelateCalorimeters(){
a6f26052 2241 // Correlate information from PHOS and EMCAL
17708df9 2242 TObjArray * caloClustersEMCAL = GetAODEMCAL();
2243 TObjArray * caloClustersPHOS = GetAODPHOS();
2244
a6f26052 2245 //Fill histograms with clusters
c8fe2783 2246
2247 fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
2248 Float_t sumClusterEnergyEMCAL = 0;
2249 Float_t sumClusterEnergyPHOS = 0;
2250 Int_t iclus = 0;
2251 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2252 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
2253 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2254 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
2255 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2256
a6f26052 2257 //Fill histograms with cells
c8fe2783 2258
17708df9 2259 AliVCaloCells * cellsEMCAL = GetEMCALCells();
2260 AliVCaloCells * cellsPHOS = GetPHOSCells();
c8fe2783 2261 fhCaloCorrNCells ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
2262
2263 Int_t icell = 0;
2264 Float_t sumCellEnergyEMCAL = 0;
2265 Float_t sumCellEnergyPHOS = 0;
2266 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2267 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2268 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2269 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2270 fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2271 if(GetDebug() > 0 ){
2272 printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
2273 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
a6f26052 2274 cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
c8fe2783 2275 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
a6f26052 2276 cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
c8fe2783 2277 }
a0bb4dc0 2278}
2279
17708df9 2280
a6f26052 2281//______________________________________________________________________________
902aa95c 2282void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
a6f26052 2283 //Fill pure monte carlo related histograms
4865e325 2284
902aa95c 2285 Float_t eMC = mom.E();
2286 Float_t ptMC = mom.Pt();
2287 Float_t phiMC = mom.Phi();
2288 if(phiMC < 0)
2289 phiMC += TMath::TwoPi();
2290 Float_t etaMC = mom.Eta();
2291
2292 if (TMath::Abs(etaMC) > 1) return;
c8fe2783 2293
902aa95c 2294 Bool_t in = kTRUE;
ff45398a 2295 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
902aa95c 2296
2297 if (pdg==22) {
2298 fhGenGamPt ->Fill(ptMC);
2299 fhGenGamEta->Fill(etaMC);
2300 fhGenGamPhi->Fill(phiMC);
2301 if(in){
2302 fhGenGamAccE ->Fill(eMC);
2303 fhGenGamAccPt ->Fill(ptMC);
2304 fhGenGamAccEta->Fill(etaMC);
2305 fhGenGamAccPhi->Fill(phiMC);
2306 }
2307 }
2308 else if (pdg==111) {
2309 fhGenPi0Pt ->Fill(ptMC);
2310 fhGenPi0Eta->Fill(etaMC);
2311 fhGenPi0Phi->Fill(phiMC);
2312 if(in){
2313 fhGenPi0AccE ->Fill(eMC);
2314 fhGenPi0AccPt ->Fill(ptMC);
2315 fhGenPi0AccEta->Fill(etaMC);
2316 fhGenPi0AccPhi->Fill(phiMC);
2317 }
2318 }
2319 else if (pdg==221) {
2320 fhGenEtaPt ->Fill(ptMC);
2321 fhGenEtaEta->Fill(etaMC);
2322 fhGenEtaPhi->Fill(phiMC);
2323 }
2324 else if (pdg==223) {
2325 fhGenOmegaPt ->Fill(ptMC);
2326 fhGenOmegaEta->Fill(etaMC);
2327 fhGenOmegaPhi->Fill(phiMC);
2328 }
2329 else if (TMath::Abs(pdg)==11) {
2330 fhGenElePt ->Fill(ptMC);
2331 fhGenEleEta->Fill(etaMC);
2332 fhGenElePhi->Fill(phiMC);
2333 }
2334
2335}
c8fe2783 2336
a6f26052 2337//________________________________________________________________________
9725fd2a 2338void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2339{
a6f26052 2340 // Needed when Terminate is executed in distributed environment
2341 // Refill analysis histograms of this class with corresponding histograms in output list.
9725fd2a 2342
a6f26052 2343 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2344 // the first one and then add the next
9725fd2a 2345 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
a6f26052 2346 //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
63f1dd86 2347
a6f26052 2348 //Read histograms, must be in the same order as in GetCreateOutputObject.
a5fafd85 2349 fhE = (TH1F *) outputList->At(index++);
a6f26052 2350 if(fFillAllTH12){
2351 fhPt = (TH1F *) outputList->At(index++);
2352 fhPhi = (TH1F *) outputList->At(index++);
2353 fhEta = (TH1F *) outputList->At(index++);
2354 }
a5fafd85 2355 fhEtaPhiE = (TH3F *) outputList->At(index++);
a6f26052 2356
4cf55759 2357 fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
2358
eb5a51ae 2359 fhLambda = (TH3F *) outputList->At(index++);
2360 fhDispersion = (TH2F *) outputList->At(index++);
a6f26052 2361 if(fFillAllTH12){
2362 fhECharged = (TH1F *) outputList->At(index++);
2363 fhPtCharged = (TH1F *) outputList->At(index++);
2364 fhPhiCharged = (TH1F *) outputList->At(index++);
2365 fhEtaCharged = (TH1F *) outputList->At(index++);
2366 }
0866d83a 2367 fhEtaPhiECharged = (TH3F *) outputList->At(index++);
9725fd2a 2368
a0bb4dc0 2369 fh1pOverE = (TH2F *) outputList->At(index++);
2370 fh1dR = (TH1F *) outputList->At(index++);
2371 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2372 fh2EledEdx = (TH2F *) outputList->At(index++);
2373 fh1pOverER02 = (TH2F *) outputList->At(index++);
2374
a5fafd85 2375 fhIM = (TH2F *) outputList->At(index++);
2376 fhIMCellCut = (TH2F *) outputList->At(index++);
b8187de4 2377 fhAsym = (TH2F *) outputList->At(index++);
9725fd2a 2378
0866d83a 2379 fhNCellsPerCluster = (TH3F *) outputList->At(index++);
2380 fhNCellsPerClusterMIP = (TH3F *) outputList->At(index++);
2381 fhNCellsPerClusterMIPCharged = (TH3F *) outputList->At(index++);
9725fd2a 2382 fhNClusters = (TH1F *) outputList->At(index++);
a6f26052 2383
a6f26052 2384 fhRNCells = (TH2F *) outputList->At(index++);
2385 fhXNCells = (TH2F *) outputList->At(index++);
2386 fhYNCells = (TH2F *) outputList->At(index++);
2387 fhZNCells = (TH2F *) outputList->At(index++);
2388 fhRE = (TH2F *) outputList->At(index++);
2389 fhXE = (TH2F *) outputList->At(index++);
2390 fhYE = (TH2F *) outputList->At(index++);
2391 fhZE = (TH2F *) outputList->At(index++);
b8187de4 2392 fhXYZ = (TH3F *) outputList->At(index++);
2393 if(fFillAllPosHisto){
a6f26052 2394 fhRCellE = (TH2F *) outputList->At(index++);
2395 fhXCellE = (TH2F *) outputList->At(index++);
2396 fhYCellE = (TH2F *) outputList->At(index++);
2397 fhZCellE = (TH2F *) outputList->At(index++);
2398 fhXYZCell = (TH3F *) outputList->At(index++);
2399 fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
2400 fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
2401 fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
2402 fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
2403 fhDeltaCellClusterRE = (TH2F *) outputList->At(index++);
2404 fhDeltaCellClusterXE = (TH2F *) outputList->At(index++);
2405 fhDeltaCellClusterYE = (TH2F *) outputList->At(index++);
2406 fhDeltaCellClusterZE = (TH2F *) outputList->At(index++);
2407 fhEtaPhiAmp = (TH3F *) outputList->At(index++);
2408 }
2409
9725fd2a 2410 fhNCells = (TH1F *) outputList->At(index++);
2411 fhAmplitude = (TH1F *) outputList->At(index++);
0cdb88b8 2412 fhAmpId = (TH2F *) outputList->At(index++);
c8fe2783 2413
5a2dbc3c 2414 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
50f39b97 2415
2416 fhCellTimeSpreadRespectToCellMax = (TH1F *) outputList->At(index++);
2417 fhCellIdCellLargeTimeSpread = (TH1F *) outputList->At(index++);
c8fe2783 2418
5a2dbc3c 2419 fhTime = (TH1F *) outputList->At(index++);
2420 fhTimeId = (TH2F *) outputList->At(index++);
2421 fhTimeAmp = (TH2F *) outputList->At(index++);
c1ac3823 2422
a6f26052 2423 // fhT0Time = (TH1F *) outputList->At(index++);
2424 // fhT0TimeId = (TH2F *) outputList->At(index++);
2425 // fhT0TimeAmp = (TH2F *) outputList->At(index++);
c1ac3823 2426
5a2dbc3c 2427 }
9725fd2a 2428
0866d83a 2429
a0bb4dc0 2430 if(fCorrelateCalos){
2431 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2432 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2433 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2434 fhCaloCorrECells = (TH2F *) outputList->At(index++);
2435 }
63f1dd86 2436
a6f26052 2437 //Module histograms
50f39b97 2438 fhEMod = new TH1F*[fNModules];
2439 fhNClustersMod = new TH1F*[fNModules];
2440 fhNCellsPerClusterMod = new TH2F*[fNModules];
2441 fhNCellsMod = new TH1F*[fNModules];
2442 fhGridCellsMod = new TH2F*[fNModules];
2443 fhGridCellsEMod = new TH2F*[fNModules];
2444 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2445 fhGridCellsTimeMod = new TH2F*[fNModules];
2446 fhAmplitudeMod = new TH1F*[fNModules];
2447 if(fCalorimeter=="EMCAL")
eb5a51ae 2448 fhAmplitudeModFraction = new TH1F*[fNModules*3];
2449
a6f26052 2450 //EMCAL
eb5a51ae 2451 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2452
50f39b97 2453 fhIMMod = new TH2F*[fNModules];
2454 fhIMCellCutMod = new TH2F*[fNModules];
c8fe2783 2455
a5fafd85 2456 for(Int_t imod = 0 ; imod < fNModules; imod++){
50f39b97 2457 fhEMod[imod] = (TH1F *) outputList->At(index++);
2458 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2459 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2460 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2461 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2462 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2463 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2464 fhGridCellsTimeMod[imod] = (TH2F *) outputList->At(index++);
2465 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
eb5a51ae 2466
50f39b97 2467 if(fCalorimeter=="EMCAL"){
2468 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
2469 fhAmplitudeModFraction[imod*3+ifrac] = (TH1F *) outputList->At(index++);
2470 }
2471 }
eb5a51ae 2472
c1ac3823 2473 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
eb5a51ae 2474 fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
a6f26052 2475 //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2476 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
2477 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
2478 // fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2] = (TH2F *) outputList->At(index++);
2479 // }
2480 // }
c1ac3823 2481 }
50f39b97 2482 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2483 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
c8fe2783 2484
a5fafd85 2485 }
a0bb4dc0 2486
9725fd2a 2487 if(IsDataMC()){
2488 fhDeltaE = (TH1F *) outputList->At(index++);
2489 fhDeltaPt = (TH1F *) outputList->At(index++);
2490 fhDeltaPhi = (TH1F *) outputList->At(index++);
2491 fhDeltaEta = (TH1F *) outputList->At(index++);
2492
2493 fhRatioE = (TH1F *) outputList->At(index++);
2494 fhRatioPt = (TH1F *) outputList->At(index++);
2495 fhRatioPhi = (TH1F *) outputList->At(index++);
2496 fhRatioEta = (TH1F *) outputList->At(index++);
2497
2498 fh2E = (TH2F *) outputList->At(index++);
2499 fh2Pt = (TH2F *) outputList->At(index++);
2500 fh2Phi = (TH2F *) outputList->At(index++);
2501 fh2Eta = (TH2F *) outputList->At(index++);
2502
2503 fhGamE = (TH2F *) outputList->At(index++);
2504 fhGamPt = (TH2F *) outputList->At(index++);
2505 fhGamPhi = (TH2F *) outputList->At(index++);
2506 fhGamEta = (TH2F *) outputList->At(index++);
2507
2508 fhGamDeltaE = (TH1F *) outputList->At(index++);
2509 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2510 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2511 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2512
2513 fhGamRatioE = (TH1F *) outputList->At(index++);
2514 fhGamRatioPt = (TH1F *) outputList->At(index++);
2515 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2516 fhGamRatioEta = (TH1F *) outputList->At(index++);
c8fe2783 2517
9725fd2a 2518 fhPi0E = (TH2F *) outputList->At(index++);
2519 fhPi0Pt = (TH2F *) outputList->At(index++);
2520 fhPi0Phi = (TH2F *) outputList->At(index++);
2521 fhPi0Eta = (TH2F *) outputList->At(index++);
2522
2523 fhEleE = (TH2F *) outputList->At(index++);
2524 fhElePt = (TH2F *) outputList->At(index++);
2525 fhElePhi = (TH2F *) outputList->At(index++);
2526 fhEleEta = (TH2F *) outputList->At(index++);
2527
2528 fhNeHadE = (TH2F *) outputList->At(index++);
2529 fhNeHadPt = (TH2F *) outputList->At(index++);
2530 fhNeHadPhi = (TH2F *) outputList->At(index++);
2531 fhNeHadEta = (TH2F *) outputList->At(index++);
2532
2533 fhChHadE = (TH2F *) outputList->At(index++);
2534 fhChHadPt = (TH2F *) outputList->At(index++);
2535 fhChHadPhi = (TH2F *) outputList->At(index++);
2536 fhChHadEta = (TH2F *) outputList->At(index++);
2537
06e5656a 2538 fhGamECharged = (TH2F *) outputList->At(index++);
2539 fhGamPtCharged = (TH2F *) outputList->At(index++);
2540 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2541 fhGamEtaCharged = (TH2F *) outputList->At(index++);
c8fe2783 2542
06e5656a 2543 fhPi0ECharged = (TH2F *) outputList->At(index++);
2544 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2545 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2546 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2547
2548 fhEleECharged = (TH2F *) outputList->At(index++);
2549 fhElePtCharged = (TH2F *) outputList->At(index++);
2550 fhElePhiCharged = (TH2F *) outputList->At(index++);
2551 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2552
2553 fhNeHadECharged = (TH2F *) outputList->At(index++);
2554 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2555 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2556 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2557
2558 fhChHadECharged = (TH2F *) outputList->At(index++);
2559 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2560 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2561 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
2562
a6f26052 2563 // fhEMVxyz = (TH3F *) outputList->At(index++);
2564 // fhHaVxyz = (TH3F *) outputList->At(index++);
9725fd2a 2565
2566 fhEMVxyz = (TH2F *) outputList->At(index++);
2567 fhHaVxyz = (TH2F *) outputList->At(index++);
2568 fhEMR = (TH2F *) outputList->At(index++);
2569 fhHaR = (TH2F *) outputList->At(index++);
2570
2571 fhGenGamPt = (TH1F *) outputList->At(index++);
2572 fhGenGamEta = (TH1F *) outputList->At(index++);
2573 fhGenGamPhi = (TH1F *) outputList->At(index++);
2574
2575 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2576 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2577 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2578
2579 fhGenEtaPt = (TH1F *) outputList->At(index++);
2580 fhGenEtaEta = (TH1F *) outputList->At(index++);
2581 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2582
2583 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2584 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2585 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2586
2587 fhGenElePt = (TH1F *) outputList->At(index++);
2588 fhGenEleEta = (TH1F *) outputList->At(index++);
2589 fhGenElePhi = (TH1F *) outputList->At(index++);
2590
2591 fhGenGamAccE = (TH1F *) outputList->At(index++);
2592 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2593 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2594 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2595
2596 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2597 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2598 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2599 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2600
6fa7d352 2601 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
06e5656a 2602 fhMCEle1dR = (TH1F *) outputList->At(index++);
2603 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2604
6fa7d352 2605 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
06e5656a 2606 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2607 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2608
6fa7d352 2609 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
06e5656a 2610 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2611 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2612
6fa7d352 2613 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2614 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2615 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
06e5656a 2616 }
9725fd2a 2617}
2618
a6f26052 2619//__________________________________________________________________
9725fd2a 2620void AliAnaCalorimeterQA::Terminate(TList* outputList)
2621{
a6f26052 2622 //Do plots if requested
c8fe2783 2623
5a2dbc3c 2624 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
21d9bc2a 2625 if(!fMakePlots) return;
9725fd2a 2626
a6f26052 2627 //Do some plots to end
c8fe2783 2628 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
a6f26052 2629 //Recover histograms from output histograms list, needed for distributed analysis.
9725fd2a 2630 ReadHistograms(outputList);
2631
a6f26052 2632 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2633 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
c8fe2783 2634
9725fd2a 2635 char name[128];
2636 char cname[128];
255b904d 2637
a6f26052 2638 //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
255b904d 2639 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
3a75604b 2640 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
255b904d 2641 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
a6f26052 2642 // Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
2643 // Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
2644 // Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
2645 // Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
2646 // Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
255b904d 2647 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
2648 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
a6f26052 2649 // Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
2650 // Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
5a35dd37 2651 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
2652 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
2653 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
2654 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
255b904d 2655
a6f26052 2656 //Color code for the different modules
255b904d 2657 Int_t modColorIndex[]={2,4,6,8};
2658
a6f26052 2659 //--------------------------------------------------
2660 // Cluster energy distributions, module dependence
2661 //--------------------------------------------------
255b904d 2662 sprintf(cname,"QA_%s_ClusterEnergy",fCalorimeter.Data());
2663 TCanvas * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
2664 c->Divide(2, 1);
3a75604b 2665 Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
a6f26052 2666 //printf("new E rb %d\n",rbE);
255b904d 2667 fhE->Rebin(rbE);
2668 fhE->SetAxisRange(ptmin,ptmax,"X");
2669 c->cd(1) ;
2670 if(fhE->GetEntries() > 0) gPad->SetLogy();
2671 TLegend pLegendE(0.7,0.6,0.9,0.8);
2672 pLegendE.SetTextSize(0.03);
2673 pLegendE.AddEntry(fhE,"all modules","L");
2674 pLegendE.SetFillColor(10);
2675 pLegendE.SetBorderSize(1);
2676
2677 fhE->SetMinimum(1);
2678 fhE->SetLineColor(1);
2679 fhE->Draw("HE");
2680 for(Int_t imod = 0; imod < fNModules; imod++){
2681 fhEMod[imod]->Rebin(rbE);
2682 fhEMod[imod]->SetLineColor(modColorIndex[imod]);
2683 fhEMod[imod]->Draw("HE same");
2684 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
2685 }
2686 pLegendE.Draw();
2687
a6f26052 2688 //Ratio of modules
255b904d 2689 c->cd(2) ;
2690 TLegend pLegendER(0.55,0.8,0.9,0.9);
2691 pLegendER.SetTextSize(0.03);
2692 pLegendER.SetFillColor(10);
2693 pLegendER.SetBorderSize(1);
c8fe2783 2694
255b904d 2695 for(Int_t imod = 1; imod < fNModules; imod++){
2696 TH1D * htmp = (TH1D*)fhEMod[imod]->Clone(Form("hERat%d",imod));
2697 htmp->Divide(fhEMod[0]);
2698 htmp->SetLineColor(modColorIndex[imod]);
2699 if(imod==1){
2700 htmp->SetTitle("Ratio module X / module 0");
2701 htmp->SetAxisRange(ptmin,ptmax,"X");
2702 htmp->SetMaximum(5);
2703 htmp->SetMinimum(0);
2704 htmp->SetAxisRange(ptmin,ptmax,"X");
2705 htmp->Draw("HE");
2706 }
2707 else
2708 htmp->Draw("same HE");
2709
2710 pLegendER.AddEntry(fhEMod[imod],Form("module %d / module 0",imod),"L");
2711 }
2712 pLegendER.Draw();
2713
2714 sprintf(name,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
2715 c->Print(name); printf("Plot: %s\n",name);
2716
a6f26052 2717 //--------------------------------------------------
2718 // Cell energy distributions, module dependence
2719 //--------------------------------------------------
255b904d 2720 sprintf(cname,"%s_QA_CellEnergy",fCalorimeter.Data());
2721 TCanvas * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
2722 ca->Divide(2, 1);
2723
3a75604b 2724 Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
a6f26052 2725 //printf("new Amp rb %d\n",rbAmp);
255b904d 2726 fhAmplitude->Rebin(rbAmp);
2727 fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
2728
2729 ca->cd(1) ;
2730 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
2731 TLegend pLegendA(0.7,0.6,0.9,0.8);
2732 pLegendA.SetTextSize(0.03);
2733 pLegendA.AddEntry(fhE,"all modules","L");
2734 pLegendA.SetFillColor(10);
2735 pLegendA.SetBorderSize(1);
2736 fhAmplitude->SetMinimum(0.1);
2737 fhAmplitude->SetLineColor(1);
2738 fhAmplitude->Draw("HE");
2739
2740 for(Int_t imod = 0; imod < fNModules; imod++){
2741 fhAmplitudeMod[imod]->Rebin(rbAmp);
2742 fhAmplitudeMod[imod]->SetLineColor(modColorIndex[imod]);
2743 fhAmplitudeMod[imod]->Draw("HE same");
2744 pLegendA.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
2745 }
2746 pLegendA.Draw();
2747
2748
2749 ca->cd(2) ;
2750 TLegend pLegendAR(0.55,0.8,0.9,0.9);
2751 pLegendAR.SetTextSize(0.03);
2752 pLegendAR.SetFillColor(10);
2753 pLegendAR.SetBorderSize(1);
2754
2755 for(Int_t imod = 1; imod < fNModules; imod++){
2756 TH1D * htmp = (TH1D*)fhAmplitudeMod[imod]->Clone(Form("hAmpRat%d",imod));
2757 htmp->Divide(fhAmplitudeMod[0]);
2758 htmp->SetLineColor(modColorIndex[imod]);
2759 if(imod==1){
2760 htmp->SetTitle("Ratio cells energy in module X / module 0");
2761 htmp->SetAxisRange(ptmin,ptmax,"X");
2762 htmp->SetMaximum(5);
2763 htmp->SetMinimum(0);
2764 htmp->Draw("HE");
2765 }
2766 else
2767 htmp->Draw("same HE");
2768 pLegendAR.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
255b904d 2769 }
2770
2771 pLegendAR.Draw();
2772 sprintf(name,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
2773 ca->Print(name); printf("Plot: %s\n",name);
c8fe2783 2774
a6f26052 2775 //----------------------------------------------------------
2776 // Cell energy distributions, FRACTION of module dependence
2777 // See Super Module calibration difference
2778 //---------------------------------------------------------
255b904d 2779 if(fCalorimeter=="EMCAL"){
a6f26052 2780 //Close To Eta 0
255b904d 2781 sprintf(cname,"%s_QA_SMThirds",fCalorimeter.Data());
2782 TCanvas * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
2783 cfrac->Divide(2, 3);
2784 cfrac->cd(1) ;
2785 if(fhAmplitude->GetEntries() > 0)
2786 gPad->SetLogy();
2787 TLegend pLegend1(0.6,0.6,0.9,0.8);
2788 pLegend1.SetTextSize(0.03);
2789 pLegend1.SetFillColor(10);
2790 pLegend1.SetBorderSize(1);
2791 pLegend1.SetHeader("Third close to Eta=0");
2792 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0");
2793 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
2794 fhAmplitudeModFraction[0]->Draw("axis");
2795 TH1D * hAverageThird1 = (TH1D *)fhAmplitudeModFraction[3*0+2]->Clone("AverageThird1");
2796 for(Int_t imod = 0; imod < fNModules; imod++){
2797 Int_t ifrac = 0;
2798 if(imod%2==0) ifrac = 2;
2799 if(imod > 0) hAverageThird1->Add( fhAmplitudeModFraction[3*imod+ifrac]);
2800 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
2801 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
2802 pLegend1.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
2803 }
2804 hAverageThird1 ->Scale(1./fNModules);
2805 pLegend1.Draw();
a6f26052 2806 //Ratio
255b904d 2807 cfrac->cd(2) ;
2808 for(Int_t imod = 0; imod < fNModules; imod++){
2809 Int_t ifrac = 0;
2810 if(imod%2==0) ifrac = 2;
2811 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
2812 htmp->Divide(hAverageThird1);
2813 if(imod ==0) {
2814 htmp ->SetTitle("Close to eta = 0");
2815 htmp ->SetMaximum(5);
2816 htmp ->SetMinimum(0);
2817 htmp ->SetAxisRange(ptmin,ptmax,"X");
2818 htmp ->SetYTitle("ratio third to average");
2819 htmp -> Draw("HE");
2820 }
2821 else htmp -> Draw("same HE");
2822 }
a6f26052 2823 //pLegend1.Draw();
255b904d 2824
a6f26052 2825 //Middle Eta
255b904d 2826 cfrac->cd(3) ;
2827 if(fhAmplitude->GetEntries() > 0)
2828 gPad->SetLogy();
2829 TLegend pLegend2(0.6,0.6,0.9,0.8);
2830 pLegend2.SetTextSize(0.03);
2831 pLegend2.SetFillColor(10);
2832 pLegend2.SetBorderSize(1);
2833 pLegend2.SetHeader("Middle Third");
2834
2835 fhAmplitudeModFraction[0]->SetTitle("Middle Third");
2836 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
2837 fhAmplitudeModFraction[0]->Draw("axis");
2838
2839 TH1D * hAverageThird2 = (TH1D *)fhAmplitudeModFraction[3*0+1]->Clone("AverageThird2");
2840 for(Int_t imod = 0; imod < fNModules; imod++){
2841 Int_t ifrac = 1;
2842 if(imod > 0) hAverageThird2->Add( fhAmplitudeModFraction[3*imod+ifrac]);
2843 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
2844 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
2845 pLegend2.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
2846 }
2847 hAverageThird2->Scale(1./fNModules);
2848 pLegend2.Draw();
2849
a6f26052 2850 //Ratio
255b904d 2851 cfrac->cd(4) ;
2852
2853 for(Int_t imod = 0; imod < fNModules; imod++){
2854 Int_t ifrac = 1;
2855 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
2856 htmp->Divide(hAverageThird2);
2857 if(imod ==0) {
2858 htmp ->SetTitle("Middle");
2859 htmp ->SetMaximum(5);
2860 htmp ->SetMinimum(0);
2861 htmp ->SetAxisRange(ptmin,ptmax,"X");
2862 htmp ->SetYTitle("ratio third to average");
2863 htmp -> Draw("HE");
2864 }
2865 else htmp -> Draw("same HE");
2866 }
a6f26052 2867 //pLegend2.Draw();
255b904d 2868
a6f26052 2869 //Close To Eta 0.7
255b904d 2870 cfrac->cd(5) ;
2871 if(fhAmplitude->GetEntries() > 0)
2872 gPad->SetLogy();
2873 TLegend pLegend3(0.6,0.6,0.9,0.8);
2874 pLegend3.SetTextSize(0.03);
2875 pLegend3.SetFillColor(10);
2876 pLegend3.SetBorderSize(1);
2877 pLegend3.SetHeader("Third close to Eta=0.7");
2878
2879 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0.7");
2880 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
2881 fhAmplitudeModFraction[0]->Draw("axis");
2882
2883 TH1D * hAverageThird3 = (TH1D *)fhAmplitudeModFraction[3*0+0]->Clone("AverageThird3");
2884 for(Int_t imod = 0; imod < 4; imod++){
2885 Int_t ifrac = 2;
2886 if(imod%2==0) ifrac = 0;
2887 if(imod > 0) hAverageThird3->Add( fhAmplitudeModFraction[3*imod+ifrac]);
2888 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
2889 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
2890 pLegend3.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
2891 }
2892 hAverageThird3 ->Scale(1./fNModules);
2893 pLegend3.Draw();
2894
2895 cfrac->cd(6) ;
2896
2897 for(Int_t imod = 0; imod < fNModules; imod++){
2898 Int_t ifrac = 2;
2899 if(imod%2==0) ifrac = 0;
2900 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
2901 htmp->Divide(hAverageThird3);
2902 if(imod ==0) {
2903 htmp ->SetTitle("Close to eta = 0.7");
2904 htmp ->SetMaximum(5);
2905 htmp ->SetMinimum(0);
2906 htmp ->SetAxisRange(ptmin,ptmax,"X");
2907 htmp ->SetYTitle("ratio third to average");
2908 htmp ->Draw("HE");
2909 }
2910 else htmp ->Draw("same HE");
2911 }