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