1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 //_________________________________________________________________________
18 // Class to check results from simulations or reconstructed real data.
19 // Fill few histograms and do some checking plots
21 //-- Author: Gustavo Conesa (INFN-LNF)
22 //_________________________________________________________________________
25 // --- ROOT system ---
26 //#include "Riostream.h"
27 #include "TObjArray.h"
28 #include "TParticle.h"
29 #include "TDatabasePDG.h"
36 #include <TObjString.h>
38 //---- AliRoot system ----
39 #include "AliAnaCalorimeterQA.h"
40 #include "AliCaloTrackReader.h"
42 #include "AliVCaloCells.h"
43 #include "AliFiducialCut.h"
44 #include "AliAODTrack.h"
45 #include "AliVCluster.h"
46 #include "AliVEvent.h"
47 #include "AliVEventHandler.h"
48 #include "AliAnalysisManager.h"
49 #include "AliAODMCParticle.h"
50 #include "AliMCAnalysisUtils.h"
51 #include "AliAODPid.h"
52 #include "AliExternalTrackParam.h"
54 ClassImp(AliAnaCalorimeterQA)
56 //____________________________________________________________________________
57 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
58 AliAnaPartCorrBaseClass(),
60 fFillAllPosHisto(kFALSE), fFillAllPosHisto2(kTRUE),
61 fFillAllTH12(kFALSE), fFillAllTH3(kTRUE),
62 fFillAllTMHisto(kTRUE), fFillAllPi0Histo(kTRUE),
64 fNModules(12), fNRCU(2),
65 fNMaxCols(48), fNMaxRows(24),
66 fTimeCutMin(-1), fTimeCutMax(9999999),
67 fEMCALCellAmpMin(0), fPHOSCellAmpMin(0),
69 fhPhi(0), fhEta(0), fhEtaPhiE(0),
70 fhECharged(0), fhPtCharged(0),
71 fhPhiCharged(0), fhEtaCharged(0), fhEtaPhiECharged(0),
75 fhNCellsPerCluster(0), fhNCellsPerClusterNoCut(0),
76 fhNCellsPerClusterMIP(0), fhNCellsPerClusterMIPCharged(0),
77 fhNCellsvsClusterMaxCellDiffE0(0), fhNCellsvsClusterMaxCellDiffE2(0),
78 fhNCellsvsClusterMaxCellDiffE6(0), fhNClusters(0),
81 fhClusterTimeEnergy(0), fhCellTimeSpreadRespectToCellMax(0),
82 fhClusterMaxCellDiffAverageTime(0), fhClusterMaxCellDiffWeightTime(0),
83 fhClusterDiffWeightAverTime(0),
84 fhClusterMaxCellDiffAverageNoMaxTime(0), fhClusterMaxCellDiffWeightNoMaxTime(0),
85 fhClusterNoMaxCellWeight(0),
86 fhCellIdCellLargeTimeSpread(0), fhClusterPairDiffTimeE(0),
88 fhClusterMaxCellCloseCellRatio(0), fhClusterMaxCellCloseCellDiff(0),
89 fhClusterMaxCellDiff(0), fhClusterMaxCellDiffNoCut(0),
90 fhLambda0vsClusterMaxCellDiffE0(0), fhLambda0vsClusterMaxCellDiffE2(0), fhLambda0vsClusterMaxCellDiffE6(0),
93 fhBadClusterEnergy(0), fhBadClusterTimeEnergy(0), fhBadClusterPairDiffTimeE(0),
94 fhBadClusterMaxCellCloseCellRatio(0), fhBadClusterMaxCellCloseCellDiff(0), fhBadClusterMaxCellDiff(0),
95 fhBadClusterMaxCellDiffAverageTime(0), fhBadClusterMaxCellDiffWeightTime(0),
96 fhBadClusterDiffWeightAverTime(0),
97 fhBadClusterMaxCellDiffAverageNoMaxTime(0), fhBadClusterMaxCellDiffWeightNoMaxTime(0),
98 fhBadClusterNoMaxCellWeight(0), fhBadCellTimeSpreadRespectToCellMax(0),
99 fhBadClusterL0(0), fhBadClusterL1(0), fhBadClusterD(0),
102 fhDeltaIEtaDeltaIPhiE0(), fhDeltaIEtaDeltaIPhiE2(), fhDeltaIEtaDeltaIPhiE6(),
103 fhDeltaIA(), fhDeltaIAL0(),
104 fhDeltaIAL1(), fhDeltaIANCells(),
107 fhRNCells(0), fhXNCells(0),
108 fhYNCells(0), fhZNCells(0),
112 fhRCellE(0), fhXCellE(0),
113 fhYCellE(0), fhZCellE(0),
115 fhDeltaCellClusterRNCells(0), fhDeltaCellClusterXNCells(0),
116 fhDeltaCellClusterYNCells(0), fhDeltaCellClusterZNCells(0),
117 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0),
118 fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
120 fhNCells(0), fhAmplitude(0),
121 fhAmpId(0), fhEtaPhiAmp(0),
122 fhTime(0), fhTimeId(0), fhTimeAmp(0),
123 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0),
124 fhCaloCorrNCells(0), fhCaloCorrECells(0),
125 fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0),
126 fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
127 fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0),
128 fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
129 fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0),
130 fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
131 //Super-Module dependent histgrams
132 fhEMod(0), fhNClustersMod(0),
133 fhNCellsPerClusterMod(0), fhNCellsPerClusterModNoCut(0),
135 fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0),
136 fhTimeAmpPerRCU(0), fhIMMod(0),
139 fhRecoMCE(), fhRecoMCPhi(), fhRecoMCEta(),
140 fhRecoMCDeltaE(), fhRecoMCDeltaPhi(), fhRecoMCDeltaEta(),
143 fhGenMCE(), fhGenMCEtaPhi(),
144 fhGenMCAccE(), fhGenMCAccEtaPhi(),
147 fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0)
148 //fh1pOverE(0), fh1dR(0), fh2EledEdx(0), fh2MatchdEdx(0),
149 //fhMCEle1pOverE(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
150 //fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
151 //fhMCNeutral1pOverE(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0),fh1pOverER02(0),
152 //fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
156 //Initialize parameters
160 //________________________________________________________________________
161 TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
163 //Save parameters used for analysis
164 TString parList ; //this will be list of parameters used for this analysis.
165 const Int_t buffersize = 255;
166 char onePar[buffersize] ;
168 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
170 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
172 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
174 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
176 //Get parameters set in base class.
177 //parList += GetBaseParametersList() ;
179 //Get parameters set in FiducialCut class (not available yet)
180 //parlist += GetFidCut()->GetFidCutParametersList()
182 return new TObjString(parList) ;
186 //________________________________________________________________________
187 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
189 // Create histograms to be saved in output file and
190 // store them in outputContainer
192 TList * outputContainer = new TList() ;
193 outputContainer->SetName("QAHistos") ;
196 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
197 Int_t nfineptbins = GetHistoFinePtBins(); Float_t ptfinemax = GetHistoFinePtMax(); Float_t ptfinemin = GetHistoFinePtMin();
198 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
199 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
200 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
201 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
202 //Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
203 //Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
204 //Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
205 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
206 Int_t nclbins = GetHistoNClustersBins(); Int_t nclmax = GetHistoNClustersMax(); Int_t nclmin = GetHistoNClustersMin();
207 Int_t ncebins = GetHistoNCellsBins(); Int_t ncemax = GetHistoNCellsMax(); Int_t ncemin = GetHistoNCellsMin();
208 Int_t nceclbins = GetHistoNClusterCellBins(); Int_t nceclmax = GetHistoNClusterCellMax(); Int_t nceclmin = GetHistoNClusterCellMin();
209 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
210 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
211 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
212 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
213 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
214 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
215 Int_t tdbins = GetHistoDiffTimeBins() ; Float_t tdmax = GetHistoDiffTimeMax(); Float_t tdmin = GetHistoDiffTimeMin();
217 Int_t nv0sbins = GetHistoV0SignalBins(); Int_t nv0smax = GetHistoV0SignalMax(); Int_t nv0smin = GetHistoV0SignalMin();
218 Int_t nv0mbins = GetHistoV0MultiplicityBins(); Int_t nv0mmax = GetHistoV0MultiplicityMax(); Int_t nv0mmin = GetHistoV0MultiplicityMin();
219 Int_t ntrmbins = GetHistoTrackMultiplicityBins(); Int_t ntrmmax = GetHistoTrackMultiplicityMax(); Int_t ntrmmin = GetHistoTrackMultiplicityMin();
226 if(fCalorimeter=="PHOS"){
232 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
233 fhE->SetXTitle("E (GeV)");
234 outputContainer->Add(fhE);
237 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
238 fhPt->SetXTitle("p_{T} (GeV/c)");
239 outputContainer->Add(fhPt);
241 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
242 fhPhi->SetXTitle("#phi (rad)");
243 outputContainer->Add(fhPhi);
245 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
246 fhEta->SetXTitle("#eta ");
247 outputContainer->Add(fhEta);
250 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
251 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
252 fhEtaPhiE->SetXTitle("#eta ");
253 fhEtaPhiE->SetYTitle("#phi (rad)");
254 fhEtaPhiE->SetZTitle("E (GeV) ");
255 outputContainer->Add(fhEtaPhiE);
257 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
258 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
259 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
260 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
261 outputContainer->Add(fhClusterTimeEnergy);
263 fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",
264 nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
265 fhClusterPairDiffTimeE->SetXTitle("E_{cluster} (GeV)");
266 fhClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
267 outputContainer->Add(fhClusterPairDiffTimeE);
270 fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
271 nptbins,ptmin,ptmax, 100,0,1.);
272 fhClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
273 fhClusterMaxCellCloseCellRatio->SetYTitle("E_{cell i}/E_{cell max}");
274 outputContainer->Add(fhClusterMaxCellCloseCellRatio);
276 fhClusterMaxCellCloseCellDiff = new TH2F ("hClusterMaxCellCloseCellDiff","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
277 nptbins,ptmin,ptmax, 500,0,100.);
278 fhClusterMaxCellCloseCellDiff->SetXTitle("E_{cluster} (GeV) ");
279 fhClusterMaxCellCloseCellDiff->SetYTitle("E_{cell max}-E_{cell i} (GeV)");
280 outputContainer->Add(fhClusterMaxCellCloseCellDiff);
282 fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
283 nptbins,ptmin,ptmax, 500,0,1.);
284 fhClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
285 fhClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
286 outputContainer->Add(fhClusterMaxCellDiff);
288 fhClusterMaxCellDiffNoCut = new TH2F ("hClusterMaxCellDiffNoCut","energy vs difference of cluster energy - max cell energy / cluster energy",
289 nptbins,ptmin,ptmax, 500,0,1.);
290 fhClusterMaxCellDiffNoCut->SetXTitle("E_{cluster} (GeV) ");
291 fhClusterMaxCellDiffNoCut->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
292 outputContainer->Add(fhClusterMaxCellDiffNoCut);
294 fhLambda0vsClusterMaxCellDiffE0 = new TH2F ("hLambda0vsClusterMaxCellDiffE0","shower shape, #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV ",
295 ssbins,ssmin,ssmax,500,0,1.);
296 fhLambda0vsClusterMaxCellDiffE0->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
297 fhLambda0vsClusterMaxCellDiffE0->SetXTitle("#lambda^{2}_{0}");
298 outputContainer->Add(fhLambda0vsClusterMaxCellDiffE0);
300 fhLambda0vsClusterMaxCellDiffE2 = new TH2F ("hLambda0vsClusterMaxCellDiffE2","shower shape, #lambda^{2}_{0} vs fraction of energy carried by max cell, 2 < E < 6 GeV ",
301 ssbins,ssmin,ssmax,500,0,1.);
302 fhLambda0vsClusterMaxCellDiffE2->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
303 fhLambda0vsClusterMaxCellDiffE2->SetXTitle("#lambda^{2}_{0}");
304 outputContainer->Add(fhLambda0vsClusterMaxCellDiffE2);
306 fhLambda0vsClusterMaxCellDiffE6 = new TH2F ("hLambda0vsClusterMaxCellDiffE6","shower shape, #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 ",
307 ssbins,ssmin,ssmax,500,0,1.);
308 fhLambda0vsClusterMaxCellDiffE6->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
309 fhLambda0vsClusterMaxCellDiffE6->SetXTitle("#lambda^{2}_{0}");
310 outputContainer->Add(fhLambda0vsClusterMaxCellDiffE6);
312 fhNCellsvsClusterMaxCellDiffE0 = new TH2F ("hNCellsvsClusterMaxCellDiffE0","N cells per cluster vs fraction of energy carried by max cell, E < 2 GeV ",
313 nceclbins,nceclmin,nceclmax,500,0,1.);
314 fhNCellsvsClusterMaxCellDiffE0->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
315 fhNCellsvsClusterMaxCellDiffE0->SetXTitle("N cells per cluster");
316 outputContainer->Add(fhNCellsvsClusterMaxCellDiffE0);
318 fhNCellsvsClusterMaxCellDiffE2 = new TH2F ("hNCellsvsClusterMaxCellDiffE2","N cells per cluster vs fraction of energy carried by max cell, 2 < E < 6 GeV ",
319 nceclbins,nceclmin,nceclmax,500,0,1.);
320 fhNCellsvsClusterMaxCellDiffE2->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
321 fhNCellsvsClusterMaxCellDiffE2->SetXTitle("N cells per cluster");
322 outputContainer->Add(fhNCellsvsClusterMaxCellDiffE2);
324 fhNCellsvsClusterMaxCellDiffE6 = new TH2F ("hNCellsvsClusterMaxCellDiffE6","N cells per cluster vs fraction of energy carried by max cell, E > 6 ",
325 nceclbins,nceclmin,nceclmax,500,0,1.);
326 fhNCellsvsClusterMaxCellDiffE6->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
327 fhNCellsvsClusterMaxCellDiffE6->SetXTitle("N cells per cluster");
328 outputContainer->Add(fhNCellsvsClusterMaxCellDiffE6);
331 if(fCalorimeter=="EMCAL" && !GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster()){
333 fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
334 fhBadClusterEnergy->SetXTitle("E_{cluster} (GeV) ");
335 outputContainer->Add(fhBadClusterEnergy);
337 fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
338 nptbins,ptmin,ptmax, 100,0,1.);
339 fhBadClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
340 fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
341 outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
343 fhBadClusterMaxCellCloseCellDiff = new TH2F ("hBadClusterMaxCellCloseCellDiff","energy vs ratio of max cell - neighbour cell constributing cell, reconstructed bad clusters",
344 nptbins,ptmin,ptmax, 500,0,100);
345 fhBadClusterMaxCellCloseCellDiff->SetXTitle("E_{cluster} (GeV) ");
346 fhBadClusterMaxCellCloseCellDiff->SetYTitle("E_{cell max} - E_{cell i} (GeV)");
347 outputContainer->Add(fhBadClusterMaxCellCloseCellDiff);
349 fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
350 nptbins,ptmin,ptmax, 500,0,1.);
351 fhBadClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
352 fhBadClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max}) / E_{cluster}");
353 outputContainer->Add(fhBadClusterMaxCellDiff);
355 fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
356 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
357 fhBadClusterTimeEnergy->SetXTitle("E_{cluster} (GeV) ");
358 fhBadClusterTimeEnergy->SetYTitle("TOF (ns)");
359 outputContainer->Add(fhBadClusterTimeEnergy);
361 fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
362 fhBadClusterPairDiffTimeE->SetXTitle("E_{bad cluster} (GeV)");
363 fhBadClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
364 outputContainer->Add(fhBadClusterPairDiffTimeE);
366 fhBadClusterL0 = new TH2F ("hBadClusterL0","shower shape, #lambda^{2}_{0} vs E for bad cluster ",
367 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
368 fhBadClusterL0->SetXTitle("E_{cluster}");
369 fhBadClusterL0->SetYTitle("#lambda^{2}_{0}");
370 outputContainer->Add(fhBadClusterL0);
372 fhBadClusterL1 = new TH2F ("hBadClusterL1","shower shape, #lambda^{2}_{1} vs E for bad cluster ",
373 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
374 fhBadClusterL1->SetXTitle("E_{cluster}");
375 fhBadClusterL1->SetYTitle("#lambda^{2}_{1}");
376 outputContainer->Add(fhBadClusterL1);
378 fhBadClusterD = new TH2F ("hBadClusterD","shower shape, Dispersion^{2} vs E for bad cluster ",
379 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
380 fhBadClusterD->SetXTitle("E_{cluster}");
381 fhBadClusterD->SetYTitle("Dispersion");
382 outputContainer->Add(fhBadClusterD);
384 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
385 fhBadCellTimeSpreadRespectToCellMax = new TH2F ("hBadCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
386 fhBadCellTimeSpreadRespectToCellMax->SetXTitle("E (GeV)");
387 fhBadCellTimeSpreadRespectToCellMax->SetYTitle("#Delta t_{cell max - i} (ns)");
388 outputContainer->Add(fhBadCellTimeSpreadRespectToCellMax);
390 fhBadClusterMaxCellDiffAverageTime = new TH2F ("hBadClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
391 fhBadClusterMaxCellDiffAverageTime->SetXTitle("E (GeV)");
392 fhBadClusterMaxCellDiffAverageTime->SetYTitle("#Delta t_{cell max - average} (ns)");
393 outputContainer->Add(fhBadClusterMaxCellDiffAverageTime);
395 fhBadClusterMaxCellDiffWeightTime = new TH2F ("hBadClusterMaxCellDiffWeightTime","t_{cell max weighted}-t_{average weighted} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
396 fhBadClusterMaxCellDiffWeightTime->SetXTitle("E (GeV)");
397 fhBadClusterMaxCellDiffWeightTime->SetYTitle("#Delta t_{cell max - average weighted} (ns)");
398 outputContainer->Add(fhBadClusterMaxCellDiffWeightTime);
400 fhBadClusterDiffWeightAverTime = new TH2F ("hBadClusterDiffWeightAverTime","Average Time in cluster - Weighted time in cluster", nptbins,ptmin,ptmax, 250,-500,500);
401 fhBadClusterDiffWeightAverTime->SetXTitle("E (GeV)");
402 fhBadClusterDiffWeightAverTime->SetYTitle("#bar{t}-wt");
403 outputContainer->Add(fhBadClusterDiffWeightAverTime);
405 fhBadClusterMaxCellDiffAverageNoMaxTime = new TH2F ("hBadClusterMaxCellDiffAverageNoMaxTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
406 fhBadClusterMaxCellDiffAverageNoMaxTime->SetXTitle("E (GeV)");
407 fhBadClusterMaxCellDiffAverageNoMaxTime->SetYTitle("#Delta t_{cell max - average} (ns)");
408 outputContainer->Add(fhBadClusterMaxCellDiffAverageNoMaxTime);
410 fhBadClusterMaxCellDiffWeightNoMaxTime = new TH2F ("hBadClusterMaxCellDiffWeightNoMaxTime","t_{cell max weighted}-t_{average weighted} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
411 fhBadClusterMaxCellDiffWeightNoMaxTime->SetXTitle("E (GeV)");
412 fhBadClusterMaxCellDiffWeightNoMaxTime->SetYTitle("#Delta t_{cell max - average weighted} (ns)");
413 outputContainer->Add(fhBadClusterMaxCellDiffWeightNoMaxTime);
417 fhBadClusterNoMaxCellWeight = new TH2F ("hBadClusterNoMaxCellWeight"," #S weight_{no max} / #S weight_{tot} per cluster", nptbins,ptmin,ptmax, 100,0,1);
418 fhBadClusterNoMaxCellWeight->SetXTitle("E (GeV)");
419 fhBadClusterNoMaxCellWeight->SetYTitle("#S weight_{no max} / #S weight_{tot}");
420 outputContainer->Add(fhBadClusterNoMaxCellWeight);
424 // Cluster size in terms of cells
426 fhDeltaIEtaDeltaIPhiE0[0] = new TH2F ("hDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3",
428 fhDeltaIEtaDeltaIPhiE0[0]->SetXTitle("#Delta Column");
429 fhDeltaIEtaDeltaIPhiE0[0]->SetYTitle("#Delta Row");
430 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[0]);
432 fhDeltaIEtaDeltaIPhiE2[0] = new TH2F ("hDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3",
434 fhDeltaIEtaDeltaIPhiE2[0]->SetXTitle("#Delta Column");
435 fhDeltaIEtaDeltaIPhiE2[0]->SetYTitle("#Delta Row");
436 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[0]);
438 fhDeltaIEtaDeltaIPhiE6[0] = new TH2F ("hDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3",
440 fhDeltaIEtaDeltaIPhiE6[0]->SetXTitle("#Delta Column");
441 fhDeltaIEtaDeltaIPhiE6[0]->SetYTitle("#Delta Row");
442 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[0]);
444 fhDeltaIA[0] = new TH2F ("hDeltaIA"," Cluster *asymmetry* in cell units vs E",
445 nptbins,ptmin,ptmax,21,-1.05,1.05);
446 fhDeltaIA[0]->SetXTitle("E_{cluster}");
447 fhDeltaIA[0]->SetYTitle("A_{cell in cluster}");
448 outputContainer->Add(fhDeltaIA[0]);
450 fhDeltaIAL0[0] = new TH2F ("hDeltaIAL0"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}",
451 ssbins,ssmin,ssmax,21,-1.05,1.05);
452 fhDeltaIAL0[0]->SetXTitle("#lambda^{2}_{0}");
453 fhDeltaIAL0[0]->SetYTitle("A_{cell in cluster}");
454 outputContainer->Add(fhDeltaIAL0[0]);
456 fhDeltaIAL1[0] = new TH2F ("hDeltaIAL1"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}",
457 ssbins,ssmin,ssmax,21,-1.05,1.05);
458 fhDeltaIAL1[0]->SetXTitle("#lambda^{2}_{1}");
459 fhDeltaIAL1[0]->SetYTitle("A_{cell in cluster}");
460 outputContainer->Add(fhDeltaIAL1[0]);
462 fhDeltaIANCells[0] = new TH2F ("hDeltaIANCells"," Cluster *asymmetry* in cell units vs N cells in cluster",
463 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
464 fhDeltaIANCells[0]->SetXTitle("N_{cell in cluster}");
465 fhDeltaIANCells[0]->SetYTitle("A_{cell in cluster}");
466 outputContainer->Add(fhDeltaIANCells[0]);
469 fhDeltaIEtaDeltaIPhiE0[1] = new TH2F ("hDeltaIEtaDeltaIPhiE0Charged"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3, matched with track",
471 fhDeltaIEtaDeltaIPhiE0[1]->SetXTitle("#Delta Column");
472 fhDeltaIEtaDeltaIPhiE0[1]->SetYTitle("#Delta Row");
473 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[1]);
475 fhDeltaIEtaDeltaIPhiE2[1] = new TH2F ("hDeltaIEtaDeltaIPhiE2Charged"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3, matched with track",
477 fhDeltaIEtaDeltaIPhiE2[1]->SetXTitle("#Delta Column");
478 fhDeltaIEtaDeltaIPhiE2[1]->SetYTitle("#Delta Row");
479 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[1]);
481 fhDeltaIEtaDeltaIPhiE6[1] = new TH2F ("hDeltaIEtaDeltaIPhiE6Charged"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3, matched with track",
483 fhDeltaIEtaDeltaIPhiE6[1]->SetXTitle("#Delta Column");
484 fhDeltaIEtaDeltaIPhiE6[1]->SetYTitle("#Delta Row");
485 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[1]);
487 fhDeltaIA[1] = new TH2F ("hDeltaIACharged"," Cluster *asymmetry* in cell units vs E, matched with track",
488 nptbins,ptmin,ptmax,21,-1.05,1.05);
489 fhDeltaIA[1]->SetXTitle("E_{cluster}");
490 fhDeltaIA[1]->SetYTitle("A_{cell in cluster}");
491 outputContainer->Add(fhDeltaIA[1]);
493 fhDeltaIAL0[1] = new TH2F ("hDeltaIAL0Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}, matched with track",
494 ssbins,ssmin,ssmax,21,-1.05,1.05);
495 fhDeltaIAL0[1]->SetXTitle("#lambda^{2}_{0}");
496 fhDeltaIAL0[1]->SetYTitle("A_{cell in cluster}");
497 outputContainer->Add(fhDeltaIAL0[1]);
499 fhDeltaIAL1[1] = new TH2F ("hDeltaIAL1Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}, matched with track",
500 ssbins,ssmin,ssmax,21,-1.05,1.05);
501 fhDeltaIAL1[1]->SetXTitle("#lambda^{2}_{1}");
502 fhDeltaIAL1[1]->SetYTitle("A_{cell in cluster}");
503 outputContainer->Add(fhDeltaIAL1[1]);
505 fhDeltaIANCells[1] = new TH2F ("hDeltaIANCellsCharged"," Cluster *asymmetry* in cell units vs N cells in cluster, matched with track",
506 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
507 fhDeltaIANCells[1]->SetXTitle("N_{cell in cluster}");
508 fhDeltaIANCells[1]->SetYTitle("A_{cell in cluster}");
509 outputContainer->Add(fhDeltaIANCells[1]);
512 TString particle[]={"Photon","Electron","Conversion","Hadron"};
513 for (Int_t iPart = 0; iPart < 4; iPart++) {
515 fhDeltaIAMC[iPart] = new TH2F (Form("hDeltaIA_MC%s",particle[iPart].Data()),Form(" Cluster *asymmetry* in cell units vs E, from %s",particle[iPart].Data()),
516 nptbins,ptmin,ptmax,21,-1.05,1.05);
517 fhDeltaIAMC[iPart]->SetXTitle("E_{cluster}");
518 fhDeltaIAMC[iPart]->SetYTitle("A_{cell in cluster}");
519 outputContainer->Add(fhDeltaIAMC[iPart]);
526 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
527 fhECharged->SetXTitle("E (GeV)");
528 outputContainer->Add(fhECharged);
530 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
531 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
532 outputContainer->Add(fhPtCharged);
534 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
535 fhPhiCharged->SetXTitle("#phi (rad)");
536 outputContainer->Add(fhPhiCharged);
538 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
539 fhEtaCharged->SetXTitle("#eta ");
540 outputContainer->Add(fhEtaCharged);
543 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
544 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
545 fhEtaPhiECharged->SetXTitle("#eta ");
546 fhEtaPhiECharged->SetYTitle("#phi ");
547 fhEtaPhiECharged->SetZTitle("E (GeV) ");
548 outputContainer->Add(fhEtaPhiECharged);
551 // fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
552 // fh1pOverE->SetYTitle("p/E");
553 // fh1pOverE->SetXTitle("p_{T} (GeV/c)");
554 // outputContainer->Add(fh1pOverE);
556 // fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
557 // fh1dR->SetXTitle("#Delta R (rad)");
558 // outputContainer->Add(fh1dR) ;
560 // fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
561 // fh2MatchdEdx->SetXTitle("p (GeV/c)");
562 // fh2MatchdEdx->SetYTitle("<dE/dx>");
563 // outputContainer->Add(fh2MatchdEdx);
565 // fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
566 // fh2EledEdx->SetXTitle("p (GeV/c)");
567 // fh2EledEdx->SetYTitle("<dE/dx>");
568 // outputContainer->Add(fh2EledEdx) ;
570 // fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
571 // fh1pOverER02->SetYTitle("p/E");
572 // fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
573 // outputContainer->Add(fh1pOverER02);
576 if(fFillAllPi0Histo){
577 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy, ncell > 1",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
578 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
579 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
580 outputContainer->Add(fhIM);
582 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
583 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
584 fhAsym->SetYTitle("Asymmetry");
585 outputContainer->Add(fhAsym);
589 fhNCellsPerClusterNoCut = new TH2F ("hNCellsPerClusterNoCut","# cells per cluster vs energy vs #eta, no bad clusters cut",
590 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
591 fhNCellsPerClusterNoCut->SetXTitle("E (GeV)");
592 fhNCellsPerClusterNoCut->SetYTitle("n cells");
593 outputContainer->Add(fhNCellsPerClusterNoCut);
595 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
596 fhNCellsPerCluster->SetXTitle("E (GeV)");
597 fhNCellsPerCluster->SetYTitle("n cells");
598 outputContainer->Add(fhNCellsPerCluster);
600 if((fCalorimeter=="EMCAL" && GetReader()->GetEMCALPtMin() < 0.3) ||
601 (fCalorimeter=="PHOS" && GetReader()->GetPHOSPtMin() < 0.3)) {
602 fhNCellsPerClusterMIP = new TH2F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
604 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
605 fhNCellsPerClusterMIP->SetYTitle("n cells");
606 outputContainer->Add(fhNCellsPerClusterMIP);
610 fhNCellsPerClusterMIPCharged = new TH2F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
612 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
613 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
614 outputContainer->Add(fhNCellsPerClusterMIPCharged);
618 fhNClusters = new TH1F ("hNClusters","# clusters", nclbins,nclmin,nclmax);
619 fhNClusters->SetXTitle("number of clusters");
620 outputContainer->Add(fhNClusters);
622 if(fFillAllPosHisto2){
625 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
626 fhXYZ->SetXTitle("x (cm)");
627 fhXYZ->SetYTitle("y (cm)");
628 fhXYZ->SetZTitle("z (cm) ");
629 outputContainer->Add(fhXYZ);
632 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Cells per Cluster",xbins,xmin,xmax,nceclbins,nceclmin,nceclmax);
633 fhXNCells->SetXTitle("x (cm)");
634 fhXNCells->SetYTitle("N cells per cluster");
635 outputContainer->Add(fhXNCells);
637 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Cells per Cluster",zbins,zmin,zmax,nceclbins,nceclmin,nceclmax);
638 fhZNCells->SetXTitle("z (cm)");
639 fhZNCells->SetYTitle("N cells per cluster");
640 outputContainer->Add(fhZNCells);
642 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
643 fhXE->SetXTitle("x (cm)");
644 fhXE->SetYTitle("E (GeV)");
645 outputContainer->Add(fhXE);
647 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
648 fhZE->SetXTitle("z (cm)");
649 fhZE->SetYTitle("E (GeV)");
650 outputContainer->Add(fhZE);
652 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Cells per Cluster",rbins,rmin,rmax,nceclbins,nceclmin,nceclmax);
653 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
654 fhRNCells->SetYTitle("N cells per cluster");
655 outputContainer->Add(fhRNCells);
658 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Cells per Cluster",ybins,ymin,ymax,nceclbins,nceclmin,nceclmax);
659 fhYNCells->SetXTitle("y (cm)");
660 fhYNCells->SetYTitle("N cells per cluster");
661 outputContainer->Add(fhYNCells);
663 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
664 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
665 fhRE->SetYTitle("E (GeV)");
666 outputContainer->Add(fhRE);
668 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
669 fhYE->SetXTitle("y (cm)");
670 fhYE->SetYTitle("E (GeV)");
671 outputContainer->Add(fhYE);
673 if(fFillAllPosHisto){
675 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
676 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
677 fhRCellE->SetYTitle("E (GeV)");
678 outputContainer->Add(fhRCellE);
680 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
681 fhXCellE->SetXTitle("x (cm)");
682 fhXCellE->SetYTitle("E (GeV)");
683 outputContainer->Add(fhXCellE);
685 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
686 fhYCellE->SetXTitle("y (cm)");
687 fhYCellE->SetYTitle("E (GeV)");
688 outputContainer->Add(fhYCellE);
690 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
691 fhZCellE->SetXTitle("z (cm)");
692 fhZCellE->SetYTitle("E (GeV)");
693 outputContainer->Add(fhZCellE);
695 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
696 fhXYZCell->SetXTitle("x (cm)");
697 fhXYZCell->SetYTitle("y (cm)");
698 fhXYZCell->SetZTitle("z (cm)");
699 outputContainer->Add(fhXYZCell);
702 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
703 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
704 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
705 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
707 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Cells per Cluster",rbins*2,-dr,dr,nceclbins,nceclmin,nceclmax);
708 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
709 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
710 outputContainer->Add(fhDeltaCellClusterRNCells);
712 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Cells per Cluster",xbins*2,-dx,dx,nceclbins,nceclmin,nceclmax);
713 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
714 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
715 outputContainer->Add(fhDeltaCellClusterXNCells);
717 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Cells per Cluster",ybins*2,-dy,dy,nceclbins,nceclmin,nceclmax);
718 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
719 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
720 outputContainer->Add(fhDeltaCellClusterYNCells);
722 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Cells per Cluster",zbins*2,-dz,dz,nceclbins,nceclmin,nceclmax);
723 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
724 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
725 outputContainer->Add(fhDeltaCellClusterZNCells);
727 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
728 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
729 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
730 outputContainer->Add(fhDeltaCellClusterRE);
732 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
733 fhDeltaCellClusterXE->SetXTitle("x (cm)");
734 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
735 outputContainer->Add(fhDeltaCellClusterXE);
737 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
738 fhDeltaCellClusterYE->SetXTitle("y (cm)");
739 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
740 outputContainer->Add(fhDeltaCellClusterYE);
742 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
743 fhDeltaCellClusterZE->SetXTitle("z (cm)");
744 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
745 outputContainer->Add(fhDeltaCellClusterZE);
747 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
748 fhEtaPhiAmp->SetXTitle("#eta ");
749 fhEtaPhiAmp->SetYTitle("#phi (rad)");
750 fhEtaPhiAmp->SetZTitle("E (GeV) ");
751 outputContainer->Add(fhEtaPhiAmp);
756 fhNCells = new TH1F ("hNCells","# cells", ncebins,ncemin,ncemax);
757 fhNCells->SetXTitle("n cells");
758 outputContainer->Add(fhNCells);
760 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
761 fhAmplitude->SetXTitle("Cell Energy (GeV)");
762 outputContainer->Add(fhAmplitude);
764 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
765 fhAmpId->SetXTitle("Cell Energy (GeV)");
766 outputContainer->Add(fhAmpId);
768 //Cell Time histograms, time only available in ESDs
769 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
771 fhCellTimeSpreadRespectToCellMax = new TH2F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
772 fhCellTimeSpreadRespectToCellMax->SetXTitle("E (GeV)");
773 fhCellTimeSpreadRespectToCellMax->SetYTitle("#Delta t_{cell max-i} (ns)");
774 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
776 fhClusterMaxCellDiffAverageTime = new TH2F ("hClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
777 fhClusterMaxCellDiffAverageTime->SetXTitle("E (GeV)");
778 fhClusterMaxCellDiffAverageTime->SetYTitle("#Delta t_{cell max - average} (ns)");
779 outputContainer->Add(fhClusterMaxCellDiffAverageTime);
781 fhClusterMaxCellDiffWeightTime = new TH2F ("hClusterMaxCellDiffWeightTime","t_{cell max weighted}-t_{average weighted} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
782 fhClusterMaxCellDiffWeightTime->SetXTitle("E (GeV)");
783 fhClusterMaxCellDiffWeightTime->SetYTitle("#Delta t_{cell max - average weighted} (ns)");
784 outputContainer->Add(fhClusterMaxCellDiffWeightTime);
786 fhClusterMaxCellDiffAverageNoMaxTime = new TH2F ("hClusterMaxCellDiffAverageNoMaxTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
787 fhClusterMaxCellDiffAverageNoMaxTime->SetXTitle("E (GeV)");
788 fhClusterMaxCellDiffAverageNoMaxTime->SetYTitle("#Delta t_{cell max - average} (ns)");
789 outputContainer->Add(fhClusterMaxCellDiffAverageNoMaxTime);
791 fhClusterMaxCellDiffWeightNoMaxTime = new TH2F ("hClusterMaxCellDiffWeightNoMaxTime","t_{cell max weighted}-t_{average weighted} per cluster", nptbins,ptmin,ptmax, 250,-500,500);
792 fhClusterMaxCellDiffWeightNoMaxTime->SetXTitle("E (GeV)");
793 fhClusterMaxCellDiffWeightNoMaxTime->SetYTitle("#Delta t_{cell max - average weighted} (ns)");
794 outputContainer->Add(fhClusterMaxCellDiffWeightNoMaxTime);
796 fhClusterDiffWeightAverTime = new TH2F ("hClusterDiffWeightAverTime","Average Time in cluster - Weighted time in cluster", nptbins,ptmin,ptmax, 250,-500,500);
797 fhClusterDiffWeightAverTime->SetXTitle("E (GeV)");
798 fhClusterDiffWeightAverTime->SetYTitle("#bar{t} - wt");
799 outputContainer->Add(fhClusterDiffWeightAverTime);
801 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","Cells with time 100 ns larger than cell max in cluster ",
802 fNMaxCols*fNMaxRows*fNModules,0,fNMaxCols*fNMaxRows*fNModules);
803 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
804 outputContainer->Add(fhCellIdCellLargeTimeSpread);
806 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
807 fhTime->SetXTitle("Cell Time (ns)");
808 outputContainer->Add(fhTime);
810 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",
811 ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
812 fhTimeId->SetXTitle("Cell Time (ns)");
813 fhTimeId->SetYTitle("Cell Absolute Id");
814 outputContainer->Add(fhTimeId);
816 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
817 fhTimeAmp->SetYTitle("Cell Time (ns)");
818 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
819 outputContainer->Add(fhTimeAmp);
824 fhClusterNoMaxCellWeight = new TH2F ("hClusterNoMaxCellWeight"," #S weight_{no max} / #S weight_{tot} per cluster", nptbins,ptmin,ptmax, 100,0,1);
825 fhClusterNoMaxCellWeight->SetXTitle("E (GeV)");
826 fhClusterNoMaxCellWeight->SetYTitle("#S weight_{no max} / #S weight_{tot}");
827 outputContainer->Add(fhClusterNoMaxCellWeight);
831 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nclbins,nclmin,nclmax,nclbins,nclmin,nclmax);
832 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
833 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
834 outputContainer->Add(fhCaloCorrNClusters);
836 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
837 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
838 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
839 outputContainer->Add(fhCaloCorrEClusters);
841 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", ncebins,ncemin,ncemax, ncebins,ncemin,ncemax);
842 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
843 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
844 outputContainer->Add(fhCaloCorrNCells);
846 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins*2,ptmin,ptmax*2);
847 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
848 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
849 outputContainer->Add(fhCaloCorrECells);
851 //Calorimeter VS V0 signal
852 fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nclbins,nclmin,nclmax);
853 fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
854 fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
855 outputContainer->Add(fhCaloV0SCorrNClusters);
857 fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
858 fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
859 fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
860 outputContainer->Add(fhCaloV0SCorrEClusters);
862 fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax, ncebins,ncemin,ncemax);
863 fhCaloV0SCorrNCells->SetXTitle("V0 signal");
864 fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
865 outputContainer->Add(fhCaloV0SCorrNCells);
867 fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
868 fhCaloV0SCorrECells->SetXTitle("V0 signal");
869 fhCaloV0SCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
870 outputContainer->Add(fhCaloV0SCorrECells);
872 //Calorimeter VS V0 multiplicity
873 fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nclbins,nclmin,nclmax);
874 fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
875 fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
876 outputContainer->Add(fhCaloV0MCorrNClusters);
878 fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
879 fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
880 fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
881 outputContainer->Add(fhCaloV0MCorrEClusters);
883 fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax, ncebins,ncemin,ncemax);
884 fhCaloV0MCorrNCells->SetXTitle("V0 signal");
885 fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
886 outputContainer->Add(fhCaloV0MCorrNCells);
888 fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
889 fhCaloV0MCorrECells->SetXTitle("V0 signal");
890 fhCaloV0MCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
891 outputContainer->Add(fhCaloV0MCorrECells);
893 //Calorimeter VS Track multiplicity
894 fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nclbins,nclmin,nclmax);
895 fhCaloTrackMCorrNClusters->SetXTitle("# tracks");
896 fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
897 outputContainer->Add(fhCaloTrackMCorrNClusters);
899 fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
900 fhCaloTrackMCorrEClusters->SetXTitle("# tracks");
901 fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
902 outputContainer->Add(fhCaloTrackMCorrEClusters);
904 fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax, ncebins,ncemin,ncemax);
905 fhCaloTrackMCorrNCells->SetXTitle("# tracks");
906 fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
907 outputContainer->Add(fhCaloTrackMCorrNCells);
909 fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
910 fhCaloTrackMCorrECells->SetXTitle("# tracks");
911 fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
912 outputContainer->Add(fhCaloTrackMCorrECells);
915 }//correlate calorimeters
919 fhEMod = new TH2F ("hE_Mod","Cluster reconstructed Energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
920 fhEMod->SetXTitle("E (GeV)");
921 fhEMod->SetYTitle("Module");
922 outputContainer->Add(fhEMod);
924 fhNClustersMod = new TH2F ("hNClusters_Mod","# clusters vs Module", nclbins,nclmin,nclmax,fNModules,0,fNModules);
925 fhNClustersMod->SetXTitle("number of clusters");
926 fhNClustersMod->SetYTitle("Module");
927 outputContainer->Add(fhNClustersMod);
929 fhNCellsMod = new TH2F ("hNCells_Mod","# cells vs Module", fNMaxCols*fNMaxRows,0,fNMaxCols*fNMaxRows,fNModules,0,fNModules);
930 fhNCellsMod->SetXTitle("n cells");
931 fhNCellsMod->SetYTitle("Module");
932 outputContainer->Add(fhNCellsMod);
934 Int_t colmaxs = fNMaxCols;
935 Int_t rowmaxs = fNMaxRows;
936 if(fCalorimeter=="EMCAL"){
938 rowmaxs=Int_t(fNModules/2)*fNMaxRows;
941 rowmaxs=fNModules*fNMaxRows;
944 fhGridCellsMod = new TH2F ("hGridCells",Form("Entries in grid of cells"),
945 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
946 fhGridCellsMod->SetYTitle("row (phi direction)");
947 fhGridCellsMod->SetXTitle("column (eta direction)");
948 outputContainer->Add(fhGridCellsMod);
950 fhGridCellsEMod = new TH2F ("hGridCellsE","Accumulated energy in grid of cells",
951 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
952 fhGridCellsEMod->SetYTitle("row (phi direction)");
953 fhGridCellsEMod->SetXTitle("column (eta direction)");
954 outputContainer->Add(fhGridCellsEMod);
956 fhGridCellsTimeMod = new TH2F ("hGridCellsTime","Accumulated time in grid of cells",
957 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
958 fhGridCellsTimeMod->SetYTitle("row (phi direction)");
959 fhGridCellsTimeMod->SetXTitle("column (eta direction)");
960 outputContainer->Add(fhGridCellsTimeMod);
962 fhNCellsPerClusterMod = new TH2F*[fNModules];
963 fhNCellsPerClusterModNoCut = new TH2F*[fNModules];
964 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
965 fhIMMod = new TH2F*[fNModules];
967 for(Int_t imod = 0; imod < fNModules; imod++){
969 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
970 Form("# cells per cluster vs cluster energy in Module %d",imod),
971 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
972 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
973 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
974 outputContainer->Add(fhNCellsPerClusterMod[imod]);
976 fhNCellsPerClusterModNoCut[imod] = new TH2F (Form("hNCellsPerClusterNoCut_Mod%d",imod),
977 Form("# cells per cluster vs cluster energy in Module %d, no cut",imod),
978 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
979 fhNCellsPerClusterModNoCut[imod]->SetXTitle("E (GeV)");
980 fhNCellsPerClusterModNoCut[imod]->SetYTitle("n cells");
981 outputContainer->Add(fhNCellsPerClusterModNoCut[imod]);
983 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
985 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
986 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
987 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
988 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
989 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
990 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
991 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
996 if(fFillAllPi0Histo){
997 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
998 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d, n cell > 1",imod),
999 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1000 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
1001 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
1002 outputContainer->Add(fhIMMod[imod]);
1007 //Monte Carlo Histograms
1009 TString particleName[] = { "Photon", "Pi0", "Eta", "Electron", "NeutralHadron", "ChargedHadron" };
1012 for(Int_t iPart = 0; iPart < 6; iPart++){
1013 for(Int_t iCh = 0; iCh < 2; iCh++){
1015 fhRecoMCDeltaE[iPart][iCh] = new TH2F (Form("hRecoMCDeltaE_%s_Match%d",particleName[iPart].Data(),iCh),
1016 Form("MC - Reco E, %s, Matched %d",particleName[iPart].Data(),iCh),
1017 nptbins, ptmin, ptmax, nptbins*2,-ptmax,ptmax);
1018 fhRecoMCDeltaE[iPart][iCh]->SetXTitle("#Delta E (GeV)");
1019 outputContainer->Add(fhRecoMCDeltaE[iPart][iCh]);
1021 fhRecoMCDeltaPhi[iPart][iCh] = new TH2F (Form("hRecoMCDeltaPhi_%s_Match%d",particleName[iPart].Data(),iCh),
1022 Form("MC - Reco #phi, %s, Matched %d",particleName[iPart].Data(),iCh),
1023 nptbins, ptmin, ptmax, nphibins*2,-phimax,phimax);
1024 fhRecoMCDeltaPhi[iPart][iCh]->SetXTitle("#Delta #phi (rad)");
1025 outputContainer->Add(fhRecoMCDeltaPhi[iPart][iCh]);
1027 fhRecoMCDeltaEta[iPart][iCh] = new TH2F (Form("hRecoMCDeltaEta_%s_Match%d",particleName[iPart].Data(),iCh),
1028 Form("MC- Reco #eta, %s, Matched %d",particleName[iPart].Data(),iCh),
1029 nptbins, ptmin, ptmax,netabins*2,-etamax,etamax);
1030 fhRecoMCDeltaEta[iPart][iCh]->SetXTitle("#Delta #eta ");
1031 outputContainer->Add(fhRecoMCDeltaEta[iPart][iCh]);
1033 fhRecoMCE[iPart][iCh] = new TH2F (Form("hRecoMCE_%s_Match%d",particleName[iPart].Data(),iCh),
1034 Form("E distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
1035 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1036 fhRecoMCE[iPart][iCh]->SetXTitle("E_{rec} (GeV)");
1037 fhRecoMCE[iPart][iCh]->SetYTitle("E_{gen} (GeV)");
1038 outputContainer->Add(fhRecoMCE[iPart][iCh]);
1040 fhRecoMCPhi[iPart][iCh] = new TH2F (Form("hRecoMCPhi_%s_Match%d",particleName[iPart].Data(),iCh),
1041 Form("#phi distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
1042 nphibins,phimin,phimax, nphibins,phimin,phimax);
1043 fhRecoMCPhi[iPart][iCh]->SetXTitle("#phi_{rec} (rad)");
1044 fhRecoMCPhi[iPart][iCh]->SetYTitle("#phi_{gen} (rad)");
1045 outputContainer->Add(fhRecoMCPhi[iPart][iCh]);
1047 fhRecoMCEta[iPart][iCh] = new TH2F (Form("hRecoMCEta_%s_Match%d",particleName[iPart].Data(),iCh),
1048 Form("#eta distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
1049 netabins,etamin,etamax,netabins,etamin,etamax);
1050 fhRecoMCEta[iPart][iCh]->SetXTitle("#eta_{rec} ");
1051 fhRecoMCEta[iPart][iCh]->SetYTitle("#eta_{gen} ");
1052 outputContainer->Add(fhRecoMCEta[iPart][iCh]);
1057 for(Int_t iPart = 0; iPart < 4; iPart++){
1058 fhGenMCE[iPart] = new TH1F(Form("hGenMCE_%s",particleName[iPart].Data()) ,
1059 Form("p_{T} of generated %s",particleName[iPart].Data()),
1060 nptbins,ptmin,ptmax);
1061 fhGenMCEtaPhi[iPart] = new TH2F(Form("hGenMCEtaPhi_%s",particleName[iPart].Data()),
1062 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
1063 netabins,etamin,etamax,nphibins,phimin,phimax);
1065 fhGenMCE[iPart] ->SetXTitle("p_{T} (GeV/c)");
1066 fhGenMCEtaPhi[iPart]->SetXTitle("#eta");
1067 fhGenMCEtaPhi[iPart]->SetYTitle("#phi (rad)");
1069 outputContainer->Add(fhGenMCE[iPart]);
1070 outputContainer->Add(fhGenMCEtaPhi[iPart]);
1073 fhGenMCAccE[iPart] = new TH1F(Form("hGenMCAccE_%s",particleName[iPart].Data()) ,
1074 Form("p_{T} of generated %s",particleName[iPart].Data()),
1075 nptbins,ptmin,ptmax);
1076 fhGenMCAccEtaPhi[iPart] = new TH2F(Form("hGenMCAccEtaPhi_%s",particleName[iPart].Data()),
1077 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
1078 netabins,etamin,etamax,nphibins,phimin,phimax);
1080 fhGenMCAccE[iPart] ->SetXTitle("p_{T} (GeV/c)");
1081 fhGenMCAccEtaPhi[iPart]->SetXTitle("#eta");
1082 fhGenMCAccEtaPhi[iPart]->SetYTitle("#phi (rad)");
1084 outputContainer->Add(fhGenMCAccE[iPart]);
1085 outputContainer->Add(fhGenMCAccEtaPhi[iPart]);
1089 //Vertex of generated particles
1091 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1092 fhEMVxyz->SetXTitle("v_{x}");
1093 fhEMVxyz->SetYTitle("v_{y}");
1094 //fhEMVxyz->SetZTitle("v_{z}");
1095 outputContainer->Add(fhEMVxyz);
1097 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1098 fhHaVxyz->SetXTitle("v_{x}");
1099 fhHaVxyz->SetYTitle("v_{y}");
1100 //fhHaVxyz->SetZTitle("v_{z}");
1101 outputContainer->Add(fhHaVxyz);
1103 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1104 fhEMR->SetXTitle("E (GeV)");
1105 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1106 outputContainer->Add(fhEMR);
1108 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1109 fhHaR->SetXTitle("E (GeV)");
1110 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1111 outputContainer->Add(fhHaR);
1116 // fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1117 // fhMCEle1pOverE->SetYTitle("p/E");
1118 // fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1119 // outputContainer->Add(fhMCEle1pOverE);
1121 // fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
1122 // fhMCEle1dR->SetXTitle("#Delta R (rad)");
1123 // outputContainer->Add(fhMCEle1dR) ;
1125 // fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1126 // fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1127 // fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1128 // outputContainer->Add(fhMCEle2MatchdEdx);
1130 // fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1131 // fhMCChHad1pOverE->SetYTitle("p/E");
1132 // fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1133 // outputContainer->Add(fhMCChHad1pOverE);
1135 // fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1136 // fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1137 // outputContainer->Add(fhMCChHad1dR) ;
1139 // fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1140 // fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1141 // fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1142 // outputContainer->Add(fhMCChHad2MatchdEdx);
1144 // fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1145 // fhMCNeutral1pOverE->SetYTitle("p/E");
1146 // fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1147 // outputContainer->Add(fhMCNeutral1pOverE);
1149 // fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1150 // fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1151 // outputContainer->Add(fhMCNeutral1dR) ;
1153 // fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1154 // fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1155 // fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1156 // outputContainer->Add(fhMCNeutral2MatchdEdx);
1158 // fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1159 // fhMCEle1pOverER02->SetYTitle("p/E");
1160 // fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1161 // outputContainer->Add(fhMCEle1pOverER02);
1163 // fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1164 // fhMCChHad1pOverER02->SetYTitle("p/E");
1165 // fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1166 // outputContainer->Add(fhMCChHad1pOverER02);
1168 // fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1169 // fhMCNeutral1pOverER02->SetYTitle("p/E");
1170 // fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1171 // outputContainer->Add(fhMCNeutral1pOverER02);
1174 // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
1175 // printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
1177 return outputContainer;
1180 //__________________________________________________
1181 void AliAnaCalorimeterQA::Init()
1183 //Check if the data or settings are ok
1185 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL")
1186 AliFatal(Form("Wrong calorimeter name <%s>", fCalorimeter.Data()));
1188 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC)
1189 AliFatal("Analysis of reconstructed data, MC reader not aplicable");
1194 //__________________________________________________
1195 void AliAnaCalorimeterQA::InitParameters()
1197 //Initialize the parameters of the analysis.
1198 AddToHistogramsName("AnaCaloQA_");
1200 fCalorimeter = "EMCAL"; //or PHOS
1201 fNModules = 12; // set maximum to maximum number of EMCAL modules
1202 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
1204 fTimeCutMax = 9999999;
1205 fEMCALCellAmpMin = 0.2;
1206 fPHOSCellAmpMin = 0.2;
1210 //__________________________________________________________________
1211 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1213 //Print some relevant parameters set for the analysis
1217 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1218 AliAnaPartCorrBaseClass::Print(" ");
1220 printf("Select Calorimeter %s \n",fCalorimeter.Data());
1221 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
1222 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
1223 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
1227 //__________________________________________________________________
1228 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1230 //Fill Calorimeter QA histograms
1231 TLorentzVector mom ;
1232 TLorentzVector mom2 ;
1233 TObjArray * caloClusters = NULL;
1236 Int_t nCaloClusters = 0;
1237 Int_t nCaloClustersAccepted = 0;
1238 Int_t nCaloCellsPerCluster = 0;
1239 Int_t nTracksMatched = 0;
1240 Int_t trackIndex = 0;
1243 //Get vertex for photon momentum calculation and event selection
1244 Double_t v[3] = {0,0,0}; //vertex ;
1245 GetReader()->GetVertex(v);
1246 if (TMath::Abs(v[2]) > GetZvertexCut()) return ;
1248 //Play with the MC stack if available
1249 //Get the MC arrays and do some checks
1251 if(GetReader()->ReadStack()){
1254 AliFatal("Stack not available, is the MC handler called?\n");
1256 //Fill some pure MC histograms, only primaries.
1257 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
1258 TParticle *primary = GetMCStack()->Particle(i) ;
1259 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
1260 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1261 primary->Momentum(mom);
1262 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
1265 else if(GetReader()->ReadAODMCParticles()){
1267 if(!GetReader()->GetAODMCParticles(0))
1268 AliFatal("AODMCParticles not available!");
1270 //Fill some pure MC histograms, only primaries.
1271 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
1272 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
1273 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1274 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1275 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
1276 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
1277 //aodprimary->Momentum(mom);
1278 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1279 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
1286 //Get List with CaloClusters
1287 if (fCalorimeter == "PHOS") caloClusters = GetPHOSClusters();
1288 else if (fCalorimeter == "EMCAL") caloClusters = GetEMCALClusters();
1290 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
1294 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n"));
1298 //----------------------------------------------------------
1299 //Correlate Calorimeters and V0 and track Multiplicity
1300 //----------------------------------------------------------
1302 if(fCorrelate) Correlate();
1304 //----------------------------------------------------------
1306 //----------------------------------------------------------
1308 nCaloClusters = caloClusters->GetEntriesFast() ;
1309 Int_t *nClustersInModule = new Int_t[fNModules];
1310 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1313 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1315 AliVTrack * track = 0x0;
1318 //Loop over CaloClusters
1319 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1320 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
1322 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1323 iclus+1,nCaloClusters,GetReader()->GetDataType());
1325 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
1326 AliVCaloCells * cell = 0x0;
1327 if(fCalorimeter == "PHOS") cell = GetPHOSCells();
1328 else cell = GetEMCALCells();
1330 //Get cluster kinematics
1331 clus->GetPosition(pos);
1332 clus->GetMomentum(mom,v);
1333 tof = clus->GetTOF()*1e9;
1334 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1336 //Check only certain regions
1338 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1342 nLabel = clus->GetNLabels();
1343 labels = clus->GetLabels();
1346 nCaloCellsPerCluster = clus->GetNCells();
1347 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1349 //matched cluster with tracks
1350 nTracksMatched = clus->GetNTracksMatched();
1351 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1352 trackIndex = clus->GetTrackMatchedIndex();
1353 if(trackIndex >= 0){
1354 track = (AliVTrack*)GetReader()->GetInputEvent()->GetTrack(trackIndex);
1357 if(nTracksMatched == 1) nTracksMatched = 0;
1362 if(nTracksMatched > 0) track = (AliVTrack*)clus->GetTrackMatched(0);
1365 //======================
1367 //======================
1369 //Get list of contributors
1370 UShort_t * indexList = clus->GetCellsAbsId() ;
1372 if(fFillAllPosHisto) FillCellPositionHistograms(nCaloCellsPerCluster,indexList,pos,mom.E());
1374 // Get the fraction of the cluster energy that carries the cell with highest energy
1375 Float_t maxCellFraction = 0.;
1376 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cell, clus,maxCellFraction);
1377 Int_t smMax =0; Int_t ietaaMax=-1; Int_t iphiiMax = 0; Int_t rcuMax = 0;
1378 smMax = GetModuleNumberCellIndexes(absIdMax,fCalorimeter, ietaaMax, iphiiMax, rcuMax);
1381 Double_t tmax = cell->GetCellTime(absIdMax)*1e9;
1382 //Float_t emax = cell->GetCellAmplitude(absIdMax);
1384 if (clus->E() < 2.){
1385 fhLambda0vsClusterMaxCellDiffE0->Fill(clus->GetM02(), maxCellFraction);
1386 fhNCellsvsClusterMaxCellDiffE0 ->Fill(nCaloCellsPerCluster,maxCellFraction);
1388 else if(clus->E() < 6.){
1389 fhLambda0vsClusterMaxCellDiffE2->Fill(clus->GetM02(), maxCellFraction);
1390 fhNCellsvsClusterMaxCellDiffE2 ->Fill(nCaloCellsPerCluster,maxCellFraction);
1393 fhLambda0vsClusterMaxCellDiffE6->Fill(clus->GetM02(), maxCellFraction);
1394 fhNCellsvsClusterMaxCellDiffE6 ->Fill(nCaloCellsPerCluster,maxCellFraction);
1397 fhNCellsPerClusterNoCut ->Fill(clus->E(), nCaloCellsPerCluster);
1398 nModule = GetModuleNumber(clus);
1399 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterModNoCut[nModule]->Fill(clus->E(), nCaloCellsPerCluster);
1401 fhClusterMaxCellDiffNoCut->Fill(clus->E(),maxCellFraction);
1403 // Calculate average time of cells in cluster and weighted average
1404 Double_t averTime = 0;
1405 Double_t weightedTime = 0;
1406 Double_t weight = 0;
1407 Double_t averTimeNoMax = 0;
1408 Double_t weightedTimeNoMax = 0;
1409 Double_t weightNoMax = 0;
1411 //if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1412 Float_t rawEnergy = 0;
1413 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
1414 rawEnergy += cell->GetCellAmplitude(indexList[ipos]);
1416 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1417 Double_t w = TMath::Max( 0., 4.5 + TMath::Log(cell->GetCellAmplitude(indexList[ipos]) / rawEnergy ));
1418 averTime += cell->GetCellTime(indexList[ipos])*1e9;
1419 weightedTime += cell->GetCellTime(indexList[ipos])*1e9 * w;
1421 if(indexList[ipos]!=absIdMax){
1422 averTimeNoMax += cell->GetCellTime(indexList[ipos])*1e9;
1423 weightedTimeNoMax += cell->GetCellTime(indexList[ipos])*1e9 * w;
1428 averTime /= nCaloCellsPerCluster;
1429 if(nCaloCellsPerCluster > 1 ) averTimeNoMax /= (nCaloCellsPerCluster-1);
1431 if(weight > 0 ) weightedTime /= weight;
1433 printf("AliAnaCalorimeterQA:: Null weight! Investigate: E %f GeV, ncells %d, time max cell %f ns, average time %f ns, absIdMax %d, SM %d\n",
1434 rawEnergy,nCaloCellsPerCluster, tmax, averTime,absIdMax,GetModuleNumber(clus));
1437 if(weightNoMax > 0 ) weightedTimeNoMax /= weightNoMax;
1439 //} // only possible in ESDs
1441 //======================
1442 //Bad clusters selection
1443 //======================
1444 //Check bad clusters if rejection was not on
1446 Bool_t badCluster = kFALSE;
1447 if(fCalorimeter=="EMCAL" && !GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster()){
1448 //Bad clusters histograms
1449 Float_t minNCells = 1;
1450 if(clus->E() > 7) minNCells = TMath::Max(1,TMath::FloorNint(1 + TMath::Log(clus->E() - 7 )*1.7 ));
1451 if(nCaloCellsPerCluster <= minNCells) {
1452 //if(clus->GetM02() < 0.05) {
1456 fhBadClusterEnergy ->Fill(clus->E());
1457 fhBadClusterTimeEnergy ->Fill(clus->E(),tof);
1458 fhBadClusterMaxCellDiff->Fill(clus->E(),maxCellFraction);
1460 if(clus->GetM02() > 0 || TMath::Abs(clus->GetM20()) > 0 || clus->GetDispersion() > 0){
1462 fhBadClusterL0 ->Fill(clus->E(),clus->GetM02());
1463 fhBadClusterL1 ->Fill(clus->E(),clus->GetM20());
1464 fhBadClusterD ->Fill(clus->E(),clus->GetDispersion());
1468 //Clusters in event time difference
1470 for(Int_t iclus2 = 0; iclus2 < nCaloClusters; iclus2++ ){
1472 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(iclus2);
1474 if(clus->GetID()==clus2->GetID()) continue;
1476 if(clus->GetM02() > 0.01)
1477 fhBadClusterPairDiffTimeE ->Fill(clus->E(), tof-clus2->GetTOF()*1.e9);
1481 // Max cell compared to other cells in cluster
1482 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1483 fhBadClusterMaxCellDiffAverageTime->Fill(clus->E(),tmax-averTime);
1484 fhBadClusterMaxCellDiffWeightTime ->Fill(clus->E(),tmax-weightedTime);
1485 fhBadClusterDiffWeightAverTime ->Fill(clus->E(),weightedTime-averTime);
1486 fhBadClusterMaxCellDiffAverageNoMaxTime->Fill(clus->E(),tmax-averTimeNoMax);
1487 fhBadClusterMaxCellDiffWeightNoMaxTime ->Fill(clus->E(),tmax-weightedTimeNoMax);
1488 //printf("E %f, tmax %f, aver %f, weigh %f, averNoMax %f, weightNoMax %f\n",
1489 // clus->E(),tmax,averTime,weightedTime,averTimeNoMax,weightedTimeNoMax);
1492 if( weight > 0 ) fhBadClusterNoMaxCellWeight ->Fill(clus->E(),weightNoMax/weight);
1493 //if( weight > 0 && weightNoMax > 0.0)printf("weight %f, weightNoMax %f\n",weight,weightNoMax);
1495 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1496 Int_t absId = indexList[ipos];
1497 if(absId!=absIdMax){
1498 Float_t frac = cell->GetCellAmplitude(absId)/cell->GetCellAmplitude(absIdMax);
1499 fhBadClusterMaxCellCloseCellRatio->Fill(mom.E(),frac);
1500 fhBadClusterMaxCellCloseCellDiff ->Fill(mom.E(),cell->GetCellAmplitude(absIdMax)-cell->GetCellAmplitude(absId));
1501 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1502 Float_t diff = (tmax-cell->GetCellTime(absId)*1e9);
1503 fhBadCellTimeSpreadRespectToCellMax->Fill(mom.E(), diff);
1512 fhClusterMaxCellDiff->Fill(clus->E(),maxCellFraction);
1513 fhClusterTimeEnergy ->Fill(mom.E(),tof);
1515 //Clusters in event time difference
1516 for(Int_t iclus2 = 0; iclus2 < nCaloClusters; iclus2++ ){
1518 AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
1520 if(clus->GetID()==clus2->GetID()) continue;
1522 if(clus->GetM02() > 0.01) {
1523 fhClusterPairDiffTimeE ->Fill(clus->E(), tof-clus2->GetTOF()*1.e9);
1527 if(nCaloCellsPerCluster > 1){
1529 // check time of cells respect to max energy cell
1531 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1532 fhClusterMaxCellDiffAverageTime->Fill(clus->E(),tmax-averTime);
1533 fhClusterMaxCellDiffWeightTime ->Fill(clus->E(),tmax-weightedTime);
1534 fhClusterDiffWeightAverTime ->Fill(clus->E(), weightedTime-averTime);
1535 fhClusterMaxCellDiffAverageNoMaxTime->Fill(clus->E(),tmax-averTimeNoMax);
1536 fhClusterMaxCellDiffWeightNoMaxTime ->Fill(clus->E(),tmax-weightedTimeNoMax);
1540 if( weight > 0 )fhClusterNoMaxCellWeight ->Fill(clus->E(),weightNoMax/weight);
1542 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1544 Int_t absId = indexList[ipos];
1545 if(absId == absIdMax) continue;
1547 Float_t frac = cell->GetCellAmplitude(absId)/cell->GetCellAmplitude(absIdMax);
1548 fhClusterMaxCellCloseCellRatio->Fill(mom.E(),frac);
1549 fhClusterMaxCellCloseCellDiff ->Fill(mom.E(),cell->GetCellAmplitude(absIdMax)-cell->GetCellAmplitude(absId));
1551 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1553 Float_t diff = (tmax-cell->GetCellTime(absId)*1e9);
1554 fhCellTimeSpreadRespectToCellMax->Fill(mom.E(), diff);
1555 if(TMath::Abs(TMath::Abs(diff) > 100) && mom.E() > 1 ) fhCellIdCellLargeTimeSpread->Fill(absId);
1558 Int_t sm =0; Int_t ietaa=-1; Int_t iphii = 0; Int_t rcu = 0;
1559 sm = GetModuleNumberCellIndexes(absId,fCalorimeter, ietaa, iphii, rcu);
1560 if(dIphi < TMath::Abs(iphii-iphiiMax)) dIphi = TMath::Abs(iphii-iphiiMax);
1562 if(dIeta < TMath::Abs(ietaa-ietaaMax)) dIeta = TMath::Abs(ietaa-ietaaMax);
1565 Int_t ietaaShift = ietaa;
1566 Int_t ietaaMaxShift = ietaaMax;
1567 if (ietaa > ietaaMax) ietaaMaxShift+=48;
1568 else ietaaShift +=48;
1569 if(dIeta < TMath::Abs(ietaaShift-ietaaMaxShift)) dIeta = TMath::Abs(ietaaShift-ietaaMaxShift);
1572 //if(TMath::Abs(clus->GetM20()) < 0.0001 && clus->GetNCells() > 3){
1573 // 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",
1574 // clus->E(), clus->GetNCells(),clus->GetM02(), clus->GetM20(), clus->GetDispersion(),tmax, tof,sm,ietaa,iphii, ietaaMax, iphiiMax);
1578 }// fill cell-cluster histogram loop
1580 if(nCaloCellsPerCluster > 3){
1583 if( nTracksMatched > 0 ) matched = 1;
1584 Float_t dIA = 1.*(dIphi-dIeta)/(dIeta+dIphi);
1586 if (mom.E() < 2 ) fhDeltaIEtaDeltaIPhiE0[matched]->Fill(dIeta,dIphi);
1587 else if(mom.E() < 6 ) fhDeltaIEtaDeltaIPhiE2[matched]->Fill(dIeta,dIphi);
1588 else fhDeltaIEtaDeltaIPhiE6[matched]->Fill(dIeta,dIphi);
1590 fhDeltaIA[matched]->Fill(mom.E(),dIA);
1594 fhDeltaIAL0[matched]->Fill(clus->GetM02(),dIA);
1595 fhDeltaIAL1[matched]->Fill(clus->GetM20(),dIA);
1596 fhDeltaIANCells[matched]->Fill(nCaloCellsPerCluster,dIA);
1601 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabel, GetReader(),0);
1602 if( (GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) ||
1603 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1604 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) ) &&
1605 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
1606 fhDeltaIAMC[0]->Fill(mom.E(),dIA);//Pure Photon
1608 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
1609 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
1610 fhDeltaIAMC[1]->Fill(mom.E(),dIA);//Pure electron
1612 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
1613 fhDeltaIAMC[2]->Fill(mom.E(),dIA);//Converted cluster
1616 fhDeltaIAMC[3]->Fill(mom.E(),dIA);//Hadrons
1620 }// 4 cells at least in cluster for size study
1622 }//check time and energy of cells respect to max energy cell if cluster of more than 1 cell
1625 //Get module of cluster
1627 nCaloClustersAccepted++;
1628 if(nModule >=0 && nModule < fNModules) {
1629 if (fCalorimeter=="EMCAL" && mom.E() > 2*fEMCALCellAmpMin) nClustersInModule[nModule]++;
1630 else if(fCalorimeter=="PHOS" && mom.E() > 2*fPHOSCellAmpMin ) nClustersInModule[nModule]++;
1633 //-----------------------------------------------------------
1634 //Fill histograms related to single cluster or track matching
1635 //-----------------------------------------------------------
1636 ClusterHistograms(mom, pos, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1639 //-----------------------------------------------------------
1641 //-----------------------------------------------------------
1642 if(fFillAllPi0Histo){
1643 if(GetDebug()>1) printf("Invariant mass \n");
1645 //do not do for bad vertex
1646 // Float_t fZvtxCut = 40. ;
1647 if(v[2]<-GetZvertexCut() || v[2]> GetZvertexCut()) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
1649 Int_t nModule2 = -1;
1650 if (nCaloClusters > 1 && nCaloCellsPerCluster > 1) {
1651 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1652 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
1653 if( clus2->GetNCells() > 1 ){
1655 //Get cluster kinematics
1656 clus2->GetMomentum(mom2,v);
1658 //Check only certain regions
1660 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1663 //Get module of cluster
1664 nModule2 = GetModuleNumber(clus2);
1666 //Fill invariant mass histograms
1669 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1672 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1673 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1675 //Asymetry histograms
1676 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1678 }// 2nd cluster loop
1679 } // At least one cell in cluster and one cluster in the array
1686 //Number of clusters histograms
1687 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
1688 // Number of clusters per module
1689 for(Int_t imod = 0; imod < fNModules; imod++ ){
1691 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1692 fhNClustersMod->Fill(nClustersInModule[imod],imod);
1694 delete [] nClustersInModule;
1695 //delete caloClusters;
1696 }// calo clusters array exists
1698 //----------------------------------------------------------
1700 //----------------------------------------------------------
1702 AliVCaloCells * cell = 0x0;
1704 if(fCalorimeter == "PHOS")
1705 cell = GetPHOSCells();
1707 cell = GetEMCALCells();
1710 AliFatal(Form("No %s CELLS available for analysis",fCalorimeter.Data()));
1711 return; // just to trick coverity
1715 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - %s cell entries %d\n", fCalorimeter.Data(), cell->GetNumberOfCells());
1717 //Init arrays and used variables
1718 Int_t *nCellsInModule = new Int_t[fNModules];
1719 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1726 Float_t recalF = 1.;
1728 for (Int_t iCell = 0; iCell < cell->GetNumberOfCells(); iCell++) {
1730 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
1731 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
1733 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
1735 if(nModule < fNModules) {
1737 //Check if the cell is a bad channel
1738 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1739 if(fCalorimeter=="EMCAL"){
1740 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1743 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
1744 printf("PHOS bad channel\n");
1748 } // use bad channel map
1750 //Get Recalibration factor if set
1751 if (GetCaloUtils()->IsRecalibrationOn()) {
1752 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1753 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1754 //if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
1757 amp = cell->GetAmplitude(iCell)*recalF;
1758 time = cell->GetTime(iCell)*1e9;//transform time to ns
1760 //Remove noisy channels, only possible in ESDs
1761 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1762 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1764 //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
1765 // amp,time,nModule,icol,irow);
1767 id = cell->GetCellNumber(iCell);
1768 fhAmplitude->Fill(amp);
1769 fhAmpId ->Fill(amp,id);
1771 if ((fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ||
1772 (fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin)) {
1774 nCellsInModule[nModule]++ ;
1778 if(fCalorimeter=="EMCAL"){
1779 icols = (nModule % 2) ? icol + fNMaxCols : icol;
1780 irows = irow + fNMaxRows * Int_t(nModule / 2);
1783 irows = irow + fNMaxRows * fNModules;
1786 fhGridCellsMod ->Fill(icols,irows);
1787 fhGridCellsEMod->Fill(icols,irows,amp);
1789 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1790 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1791 fhTime ->Fill(time);
1792 fhTimeId ->Fill(time,id);
1793 fhTimeAmp ->Fill(amp,time);
1794 fhGridCellsTimeMod->Fill(icols,irows,time);
1796 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
1801 //Get Eta-Phi position of Cell
1802 if(fFillAllPosHisto)
1804 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1805 Float_t celleta = 0.;
1806 Float_t cellphi = 0.;
1807 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
1809 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1810 Double_t cellpos[] = {0, 0, 0};
1811 GetEMCALGeometry()->GetGlobal(id, cellpos);
1812 fhXCellE->Fill(cellpos[0],amp) ;
1813 fhYCellE->Fill(cellpos[1],amp) ;
1814 fhZCellE->Fill(cellpos[2],amp) ;
1815 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1816 fhRCellE->Fill(rcell,amp) ;
1817 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1819 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1821 Int_t relId[4], module;
1822 Float_t xCell, zCell;
1824 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
1826 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1827 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1828 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
1829 fhXCellE ->Fill(xyz.X(),amp) ;
1830 fhYCellE ->Fill(xyz.Y(),amp) ;
1831 fhZCellE ->Fill(xyz.Z(),amp) ;
1832 fhRCellE ->Fill(rcell ,amp) ;
1833 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
1835 }//fill cell position histograms
1837 if (fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ncells ++ ;
1838 else if(fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin) ncells ++ ;
1840 // printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - no %s CELLS passed the analysis cut\n",fCalorimeter.Data());
1844 if(ncells > 0 )fhNCells->Fill(ncells) ; //fill the cells after the cut
1846 //Number of cells per module
1847 for(Int_t imod = 0; imod < fNModules; imod++ ) {
1849 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
1850 fhNCellsMod->Fill(nCellsInModule[imod],imod) ;
1852 delete [] nCellsInModule;
1855 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1859 //_____________________________________________________________________________________________
1860 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom,
1861 Float_t *pos, const Int_t nCaloCellsPerCluster,const Int_t nModule,
1862 const Int_t nTracksMatched, const AliVTrack * /*track*/,
1863 const Int_t * labels, const Int_t nLabels){
1864 //Fill CaloCluster related histograms
1866 AliAODMCParticle * aodprimary = 0x0;
1867 TParticle * primary = 0x0;
1870 Float_t e = mom.E();
1871 Float_t pt = mom.Pt();
1872 Float_t eta = mom.Eta();
1873 Float_t phi = mom.Phi();
1874 if(phi < 0) phi +=TMath::TwoPi();
1875 if(GetDebug() > 0) {
1876 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
1878 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
1879 printf("\t Primaries: nlabels %d\n",nLabels);
1880 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
1885 if(nModule >=0 && nModule < fNModules) fhEMod->Fill(e,nModule);
1892 fhEtaPhiE->Fill(eta,phi,e);
1895 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster);
1896 if((fCalorimeter=="EMCAL" && GetReader()->GetEMCALPtMin() < 0.3) ||
1897 (fCalorimeter=="PHOS" && GetReader()->GetPHOSPtMin() < 0.3)) fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster);
1900 if(fFillAllPosHisto2){
1901 fhXE ->Fill(pos[0],e);
1902 fhYE ->Fill(pos[1],e);
1903 fhZE ->Fill(pos[2],e);
1905 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
1907 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
1908 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
1909 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
1910 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
1911 fhRE ->Fill(rxyz,e);
1912 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
1915 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
1917 //Fill histograms only possible when simulation
1918 if(IsDataMC() && nLabels > 0 && labels){
1920 //Play with the MC stack if available
1921 Int_t label = labels[0];
1924 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
1928 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1929 Float_t vxMC= 0; Float_t vyMC = 0;
1930 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1934 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
1936 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
1938 if( label >= GetMCStack()->GetNtrack()) {
1939 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1943 primary = GetMCStack()->Particle(label);
1945 pdg0 = TMath::Abs(primary->GetPdgCode());
1947 status = primary->GetStatusCode();
1948 vxMC = primary->Vx();
1949 vyMC = primary->Vy();
1950 iParent = primary->GetFirstMother();
1952 if(GetDebug() > 1 ) {
1953 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1954 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1957 //Get final particle, no conversion products
1958 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
1960 primary = GetMCStack()->Particle(iParent);
1961 pdg = TMath::Abs(primary->GetPdgCode());
1962 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1963 while((pdg == 22 || pdg == 11) && status != 1){
1965 primary = GetMCStack()->Particle(iMother);
1966 status = primary->GetStatusCode();
1967 iParent = primary->GetFirstMother();
1968 pdg = TMath::Abs(primary->GetPdgCode());
1969 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1972 if(GetDebug() > 1 ) {
1973 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1974 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1979 //Overlapped pi0 (or eta, there will be very few), get the meson
1980 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1981 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
1982 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1983 while(pdg != 111 && pdg != 221){
1985 primary = GetMCStack()->Particle(iMother);
1986 status = primary->GetStatusCode();
1987 iParent = primary->GetFirstMother();
1988 pdg = TMath::Abs(primary->GetPdgCode());
1989 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1991 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1996 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1997 primary->GetName(),iMother);
2000 eMC = primary->Energy();
2001 ptMC = primary->Pt();
2002 phiMC = primary->Phi();
2003 etaMC = primary->Eta();
2004 pdg = TMath::Abs(primary->GetPdgCode());
2005 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2008 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
2009 //Get the list of MC particles
2010 if(!GetReader()->GetAODMCParticles(0))
2011 AliFatal("MCParticles not available!");
2013 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
2015 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
2017 status = aodprimary->IsPrimary();
2018 vxMC = aodprimary->Xv();
2019 vyMC = aodprimary->Yv();
2020 iParent = aodprimary->GetMother();
2022 if(GetDebug() > 1 ) {
2023 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2024 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
2025 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
2028 //Get final particle, no conversion products
2029 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
2031 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
2033 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
2034 pdg = TMath::Abs(aodprimary->GetPdgCode());
2035 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
2037 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2038 status = aodprimary->IsPrimary();
2039 iParent = aodprimary->GetMother();
2040 pdg = TMath::Abs(aodprimary->GetPdgCode());
2042 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
2043 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2046 if(GetDebug() > 1 ) {
2047 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2048 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
2049 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
2054 //Overlapped pi0 (or eta, there will be very few), get the meson
2055 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2056 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2057 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
2058 while(pdg != 111 && pdg != 221){
2061 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2062 status = aodprimary->IsPrimary();
2063 iParent = aodprimary->GetMother();
2064 pdg = TMath::Abs(aodprimary->GetPdgCode());
2066 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
2069 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
2074 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
2075 aodprimary->GetName(),iMother);
2078 status = aodprimary->IsPrimary();
2079 eMC = aodprimary->E();
2080 ptMC = aodprimary->Pt();
2081 phiMC = aodprimary->Phi();
2082 etaMC = aodprimary->Eta();
2083 pdg = TMath::Abs(aodprimary->GetPdgCode());
2084 charge = aodprimary->Charge();
2088 //Float_t vz = primary->Vz();
2089 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
2090 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
2091 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2092 fhEMR ->Fill(e,rVMC);
2095 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
2096 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
2097 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
2100 //Overlapped pi0 (or eta, there will be very few)
2101 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0)){
2102 fhRecoMCE [mcPi0][(nTracksMatched>0)] ->Fill(e,eMC);
2103 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[mcPi0][(nTracksMatched>0)]->Fill(eta,etaMC);
2104 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[mcPi0][(nTracksMatched>0)]->Fill(phi,phiMC);
2105 fhRecoMCDeltaE [mcPi0][(nTracksMatched>0)]->Fill(e,eMC-e);
2106 fhRecoMCDeltaPhi[mcPi0][(nTracksMatched>0)]->Fill(e,phiMC-phi);
2107 fhRecoMCDeltaEta[mcPi0][(nTracksMatched>0)]->Fill(e,etaMC-eta);
2108 }//Overlapped pizero decay
2109 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2110 fhRecoMCE [mcEta][(nTracksMatched>0)] ->Fill(e,eMC);
2111 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[mcEta][(nTracksMatched>0)]->Fill(eta,etaMC);
2112 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[mcEta][(nTracksMatched>0)]->Fill(phi,phiMC);
2113 fhRecoMCDeltaE [mcEta][(nTracksMatched>0)]->Fill(e,eMC-e);
2114 fhRecoMCDeltaPhi[mcEta][(nTracksMatched>0)]->Fill(e,phiMC-phi);
2115 fhRecoMCDeltaEta[mcEta][(nTracksMatched>0)]->Fill(e,etaMC-eta);
2116 }//Overlapped eta decay
2117 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
2118 fhRecoMCE [mcPhoton][(nTracksMatched>0)] ->Fill(e,eMC);
2119 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[mcPhoton][(nTracksMatched>0)]->Fill(eta,etaMC);
2120 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[mcPhoton][(nTracksMatched>0)]->Fill(phi,phiMC);
2121 fhRecoMCDeltaE [mcPhoton][(nTracksMatched>0)]->Fill(e,eMC-e);
2122 fhRecoMCDeltaPhi[mcPhoton][(nTracksMatched>0)]->Fill(e,phiMC-phi);
2123 fhRecoMCDeltaEta[mcPhoton][(nTracksMatched>0)]->Fill(e,etaMC-eta);
2125 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
2126 fhRecoMCE [mcElectron][(nTracksMatched>0)] ->Fill(e,eMC);
2127 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[mcElectron][(nTracksMatched>0)]->Fill(eta,etaMC);
2128 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[mcElectron][(nTracksMatched>0)]->Fill(phi,phiMC);
2129 fhRecoMCDeltaE [mcElectron][(nTracksMatched>0)]->Fill(e,eMC-e);
2130 fhRecoMCDeltaPhi[mcElectron][(nTracksMatched>0)]->Fill(e,phiMC-phi);
2131 fhRecoMCDeltaEta[mcElectron][(nTracksMatched>0)]->Fill(e,etaMC-eta);
2132 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2133 fhEMR ->Fill(e,rVMC);
2135 else if(charge == 0){
2136 fhRecoMCE [mcNeHadron][(nTracksMatched>0)] ->Fill(e,eMC);
2137 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[mcNeHadron][(nTracksMatched>0)]->Fill(eta,etaMC);
2138 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[mcNeHadron][(nTracksMatched>0)]->Fill(phi,phiMC);
2139 fhRecoMCDeltaE [mcNeHadron][(nTracksMatched>0)]->Fill(e,eMC-e);
2140 fhRecoMCDeltaPhi[mcNeHadron][(nTracksMatched>0)]->Fill(e,phiMC-phi);
2141 fhRecoMCDeltaEta[mcNeHadron][(nTracksMatched>0)]->Fill(e,etaMC-eta);
2142 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2143 fhHaR ->Fill(e,rVMC);
2146 fhRecoMCE [mcChHadron][(nTracksMatched>0)] ->Fill(e,eMC);
2147 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[mcChHadron][(nTracksMatched>0)]->Fill(eta,etaMC);
2148 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[mcChHadron][(nTracksMatched>0)]->Fill(phi,phiMC);
2149 fhRecoMCDeltaE [mcChHadron][(nTracksMatched>0)]->Fill(e,eMC-e);
2150 fhRecoMCDeltaPhi[mcChHadron][(nTracksMatched>0)]->Fill(e,phiMC-phi);
2151 fhRecoMCDeltaEta[mcChHadron][(nTracksMatched>0)]->Fill(e,etaMC-eta);
2152 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2153 fhHaR ->Fill(e,rVMC);
2157 //Match tracks and clusters
2158 //To be Modified in case of AODs
2160 if( nTracksMatched > 0 && fFillAllTMHisto){
2161 if(fFillAllTH12 && fFillAllTMHisto){
2162 fhECharged ->Fill(e);
2163 fhPtCharged ->Fill(pt);
2164 fhPhiCharged ->Fill(phi);
2165 fhEtaCharged ->Fill(eta);
2168 if(fFillAllTMHisto){
2169 if(fFillAllTH3)fhEtaPhiECharged->Fill(eta,phi,e);
2170 if((fCalorimeter=="EMCAL" && GetReader()->GetEMCALPtMin() < 0.3) ||
2171 (fCalorimeter=="PHOS" && GetReader()->GetPHOSPtMin() < 0.3)) fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster);
2173 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2175 // //Study the track and matched cluster if track exists.
2176 // if(!track) return;
2177 // Double_t emcpos[3] = {0.,0.,0.};
2178 // Double_t emcmom[3] = {0.,0.,0.};
2179 // Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2180 // Double_t bfield = 0.;
2181 // Double_t tphi = 0;
2182 // Double_t teta = 0;
2183 // Double_t tmom = 0;
2184 // Double_t tpt = 0;
2185 // Double_t tmom2 = 0;
2186 // Double_t tpcSignal = 0;
2187 // Bool_t okpos = kFALSE;
2188 // Bool_t okmom = kFALSE;
2189 // Bool_t okout = kFALSE;
2193 // //In case of ESDs get the parameters in this way
2194 // if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2195 // if (track->GetOuterParam() ) {
2198 // bfield = GetReader()->GetInputEvent()->GetMagneticField();
2199 // okpos = track->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2200 // okmom = track->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2201 // if(!(okpos && okmom)) return;
2203 // TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2204 // TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2205 // tphi = position.Phi();
2206 // teta = position.Eta();
2207 // tmom = momentum.Mag();
2209 // tpt = track->Pt();
2210 // tmom2 = track->P();
2211 // tpcSignal = track->GetTPCsignal();
2213 // nITS = track->GetNcls(0);
2214 // nTPC = track->GetNcls(1);
2215 // }//Outer param available
2217 // else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2218 // AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2221 // pid->GetEMCALPosition(emcpos);
2222 // pid->GetEMCALMomentum(emcmom);
2224 // TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2225 // TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2226 // tphi = position.Phi();
2227 // teta = position.Eta();
2228 // tmom = momentum.Mag();
2230 // tpt = track->Pt();
2231 // tmom2 = track->P();
2232 // tpcSignal = pid->GetTPCsignal();
2238 // printf("okout\n");
2239 // Double_t deta = teta - eta;
2240 // Double_t dphi = tphi - phi;
2241 // if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2242 // if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2243 // Double_t dR = sqrt(dphi*dphi + deta*deta);
2245 // Double_t pOverE = tmom/e;
2247 // fh1pOverE->Fill(tpt, pOverE);
2248 // if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
2251 // fh2MatchdEdx->Fill(tmom2,tpcSignal);
2253 // if(IsDataMC() && primary){
2254 // Int_t pdg = primary->GetPdgCode();
2255 // Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2257 // if(TMath::Abs(pdg) == 11){
2258 // fhMCEle1pOverE->Fill(tpt,pOverE);
2259 // fhMCEle1dR->Fill(dR);
2260 // fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2261 // if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2263 // else if(charge!=0){
2264 // fhMCChHad1pOverE->Fill(tpt,pOverE);
2265 // fhMCChHad1dR->Fill(dR);
2266 // fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2267 // if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2269 // else if(charge == 0){
2270 // fhMCNeutral1pOverE->Fill(tpt,pOverE);
2271 // fhMCNeutral1dR->Fill(dR);
2272 // fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2273 // if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2277 // if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2278 // && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2279 // fh2EledEdx->Fill(tmom2,tpcSignal);
2282 // else{//no ESD external param or AODPid
2284 // if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
2287 }//matched clusters with tracks
2292 //__________________________________
2293 void AliAnaCalorimeterQA::Correlate(){
2294 // Correlate information from PHOS and EMCAL and with V0 and track multiplicity
2297 TObjArray * caloClustersEMCAL = GetEMCALClusters();
2298 TObjArray * caloClustersPHOS = GetPHOSClusters();
2300 Int_t nclEMCAL = caloClustersEMCAL->GetEntriesFast();
2301 Int_t nclPHOS = caloClustersPHOS ->GetEntriesFast();
2303 Float_t sumClusterEnergyEMCAL = 0;
2304 Float_t sumClusterEnergyPHOS = 0;
2306 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2307 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
2308 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2309 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
2314 AliVCaloCells * cellsEMCAL = GetEMCALCells();
2315 AliVCaloCells * cellsPHOS = GetPHOSCells();
2317 Int_t ncellsEMCAL = cellsEMCAL->GetNumberOfCells();
2318 Int_t ncellsPHOS = cellsPHOS ->GetNumberOfCells();
2320 Float_t sumCellEnergyEMCAL = 0;
2321 Float_t sumCellEnergyPHOS = 0;
2323 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2324 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2325 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2326 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
2330 fhCaloCorrNClusters->Fill(nclEMCAL,nclPHOS);
2331 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2332 fhCaloCorrNCells ->Fill(ncellsEMCAL,ncellsPHOS);
2333 fhCaloCorrECells ->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2335 Int_t v0S = GetV0Signal(0)+GetV0Signal(1);
2336 Int_t v0M = GetV0Multiplicity(0)+GetV0Multiplicity(1);
2337 Int_t trM = GetTrackMultiplicity();
2338 if(fCalorimeter=="PHOS"){
2339 fhCaloV0MCorrNClusters ->Fill(v0M,nclPHOS);
2340 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyPHOS);
2341 fhCaloV0MCorrNCells ->Fill(v0M,ncellsPHOS);
2342 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyPHOS);
2344 fhCaloV0SCorrNClusters ->Fill(v0S,nclPHOS);
2345 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyPHOS);
2346 fhCaloV0SCorrNCells ->Fill(v0S,ncellsPHOS);
2347 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyPHOS);
2349 fhCaloTrackMCorrNClusters->Fill(trM,nclPHOS);
2350 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyPHOS);
2351 fhCaloTrackMCorrNCells ->Fill(trM,ncellsPHOS);
2352 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyPHOS);
2355 fhCaloV0MCorrNClusters ->Fill(v0M,nclEMCAL);
2356 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyEMCAL);
2357 fhCaloV0MCorrNCells ->Fill(v0M,ncellsEMCAL);
2358 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyEMCAL);
2360 fhCaloV0SCorrNClusters ->Fill(v0S,nclEMCAL);
2361 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyEMCAL);
2362 fhCaloV0SCorrNCells ->Fill(v0S,ncellsEMCAL);
2363 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyEMCAL);
2365 fhCaloTrackMCorrNClusters->Fill(trM,nclEMCAL);
2366 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyEMCAL);
2367 fhCaloTrackMCorrNCells ->Fill(trM,ncellsEMCAL);
2368 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyEMCAL);
2373 printf("AliAnaCalorimeterQA::Correlate(): \n");
2374 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2375 ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
2376 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
2377 ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS);
2378 printf("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d \n", v0S,v0M,trM);
2382 //______________________________________________________________________________
2383 void AliAnaCalorimeterQA::FillCellPositionHistograms(const Int_t nCaloCellsPerCluster,const UShort_t * indexList,
2384 const Float_t pos[3], const Float_t clEnergy){
2385 // Fill histograms releated to cell position
2387 //Loop on cluster cells
2388 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
2390 // printf("Index %d\n",ipos);
2391 Int_t absId = indexList[ipos];
2393 //Get position of cell compare to cluster
2395 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
2397 Double_t cellpos[] = {0, 0, 0};
2398 GetEMCALGeometry()->GetGlobal(absId, cellpos);
2400 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
2401 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
2402 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
2404 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],clEnergy) ;
2405 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],clEnergy) ;
2406 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],clEnergy) ;
2408 Float_t r = TMath::Sqrt(pos[0] *pos[0] + pos[1] * pos[1] );
2409 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0] + cellpos[1]* cellpos[1]);
2411 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
2412 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
2414 }//EMCAL and its matrices are available
2415 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
2417 Int_t relId[4], module;
2418 Float_t xCell, zCell;
2420 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
2422 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
2423 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
2425 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
2426 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
2427 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
2429 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),clEnergy) ;
2430 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),clEnergy) ;
2431 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),clEnergy) ;
2433 Float_t r = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1] );
2434 Float_t rcell = TMath::Sqrt(xyz.X() * xyz.X() + xyz.Y() * xyz.Y());
2436 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
2437 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
2439 }//PHOS and its matrices are available
2440 }// cluster cell loop
2441 }//Fill all position histograms
2444 //______________________________________________________________________________
2445 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
2446 //Fill pure monte carlo related histograms
2448 Float_t eMC = mom.E();
2449 Float_t phiMC = mom.Phi();
2451 phiMC += TMath::TwoPi();
2452 Float_t etaMC = mom.Eta();
2454 if (TMath::Abs(etaMC) > 1) return;
2458 //Rough stimate of acceptance for pi0, Eta and electrons
2459 if(fCalorimeter == "PHOS"){
2461 if(GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter))
2463 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),in);
2466 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
2467 if(GetEMCALGeometry()){
2470 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(mom.Eta(),mom.Phi(),absID);
2475 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s Real acceptance? %d\n",fCalorimeter.Data(),in);
2478 if(GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter))
2480 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),in);
2485 fhGenMCE[mcPhoton] ->Fill(eMC);
2486 if(eMC > 0.5) fhGenMCEtaPhi[mcPhoton]->Fill(etaMC,phiMC);
2488 fhGenMCAccE[mcPhoton] ->Fill(eMC);
2489 if(eMC > 0.5) fhGenMCAccEtaPhi[mcPhoton]->Fill(etaMC,phiMC);
2492 else if (pdg==111) {
2493 fhGenMCE[mcPi0] ->Fill(eMC);
2494 if(eMC > 0.5) fhGenMCEtaPhi[mcPi0]->Fill(etaMC,phiMC);
2496 fhGenMCAccE[mcPi0] ->Fill(eMC);
2497 if(eMC > 0.5) fhGenMCAccEtaPhi[mcPi0]->Fill(etaMC,phiMC);
2500 else if (pdg==221) {
2501 fhGenMCE[mcEta] ->Fill(eMC);
2502 if(eMC > 0.5) fhGenMCEtaPhi[mcEta]->Fill(etaMC,phiMC);
2504 fhGenMCAccE[mcEta] ->Fill(eMC);
2505 if(eMC > 0.5) fhGenMCAccEtaPhi[mcEta]->Fill(etaMC,phiMC);
2508 else if (TMath::Abs(pdg)==11) {
2509 fhGenMCE[mcElectron] ->Fill(eMC);
2510 if(eMC > 0.5) fhGenMCEtaPhi[mcElectron]->Fill(etaMC,phiMC);
2512 fhGenMCAccE[mcElectron] ->Fill(eMC);
2513 if(eMC > 0.5) fhGenMCAccEtaPhi[mcElectron]->Fill(etaMC,phiMC);