AliPhysics  720d1f3 (720d1f3)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnaCalorimeterQA.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // --- ROOT system ---
17 #include <TObjArray.h>
18 #include <TParticle.h>
19 #include <TDatabasePDG.h>
20 #include <TH3F.h>
21 #include <TObjString.h>
22 
23 //---- AliRoot system ----
24 #include "AliAnaCalorimeterQA.h"
25 #include "AliCaloTrackReader.h"
26 #include "AliStack.h"
27 #include "AliVCaloCells.h"
28 #include "AliFiducialCut.h"
29 #include "AliVCluster.h"
30 #include "AliVTrack.h"
31 #include "AliVEvent.h"
32 #include "AliVEventHandler.h"
33 #include "AliAODMCParticle.h"
34 #include "AliMCAnalysisUtils.h"
35 
36 // --- Detectors ---
37 #include "AliPHOSGeoUtils.h"
38 #include "AliEMCALGeometry.h"
39 
43 
44 //__________________________________________
46 //__________________________________________
49 
50 // Switches
51 fFillAllCellTimeHisto(kTRUE),
52 fFillAllPosHisto(kFALSE), fFillAllPosHisto2(kFALSE),
53 fFillAllTH3(kFALSE),
54 fFillAllTMHisto(kTRUE),
55 fFillAllPi0Histo(kTRUE), fFillInvMassOpenAngle(kFALSE),
56 fFillPi0PairDiffTime(kFALSE), fFillInvMassInEMCALWithPHOSDCalAcc(kFALSE),
57 fFillEBinAcceptanceHisto(kFALSE),
58 fCorrelate(kTRUE), fStudyBadClusters(kFALSE),
59 fStudyClustersAsymmetry(kFALSE), fStudyExotic(kFALSE),
60 fStudyWeight(kFALSE),
61 fStudyFECCorrelation(kFALSE), fStudyTCardCorrelation(kFALSE),
62 fStudyM02Dependence (kFALSE),
63 
64 // Parameters and cuts
65 fNModules(12), fNRCU(2),
66 fNMaxCols(48), fNMaxRows(24),
67 fTimeCutMin(-10000), fTimeCutMax(10000),
68 fCellAmpMin(0),
69 fEMCALCellAmpMin(0), fPHOSCellAmpMin(0),
70 fEMCALClusterM02Min(0),
71 fEMCALClusterNCellMin(0), fPHOSClusterNCellMin(0),
72 fNEBinCuts(0),
73 
74 // Invariant mass
75 fInvMassMinECut(0), fInvMassMaxECut(0),
76 fInvMassMinM02Cut(0), fInvMassMaxM02Cut(0),
77 fInvMassMaxOpenAngle(0), fInvMassMaxTimeDifference(0),
78 
79 // Exotic
80 fExoNECrossCuts(0), fExoECrossCuts(),
81 fExoNDTimeCuts(0), fExoDTimeCuts(),
82 
83 fClusterMomentum(), fClusterMomentum2(),
84 fPrimaryMomentum(),
85 fConstantTimeShift(0),
86 // Histograms
87 fhE(0), fhPt(0),
88 fhPhi(0), fhEta(0),
89 fhEtaPhi(0), fhEtaPhiE(0),
90 fhECharged(0), fhPtCharged(0),
91 fhPhiCharged(0), fhEtaCharged(0),
92 fhEtaPhiCharged(0), fhEtaPhiECharged(0),
93 
94 // Invariant mass
95 fhIM(0), fhIMSame(0), fhIMDiff(0),
96 fhIMDCAL(0), fhIMDCALSame(0), fhIMDCALDiff(0),
97 fhIMDCALPHOS(0), fhIMDCALPHOSSame(0),
98 fhIMEMCALPHOS(0), fhIMEMCALPHOSSame(0),
99 fhAsym(0),
100 fhOpAngle(0), fhIMvsOpAngle(0),
101 fhNCellsPerCluster(0), fhNCellsPerClusterNoCut(0),
102 fhNCellsPerClusterWithWeight(0), fhNCellsPerClusterRatioWithWeight(0),
103 fhNClusters(0),
104 
105 // Timing
106 fhClusterTimeEnergy(0), fhCellTimeSpreadRespectToCellMax(0),
107 fhCellIdCellLargeTimeSpread(0), fhClusterPairDiffTimeE(0), fhClusterPairDiffTimeESameMod(0),
108 fhClusterMaxCellCloseCellRatio(0), fhClusterMaxCellCloseCellDiff(0),
109 fhClusterMaxCellDiff(0), fhClusterMaxCellDiffNoCut(0),
110 //fhClusterMaxCellDiffAverageTime(0), fhClusterMaxCellDiffWeightedTime(0),
111 fhClusterMaxCellECross(0),
112 fhLambda0(0), fhLambda1(0),
113 fhLambda0MaxFECPair(0), fhLambda1MaxFECPair(0),
114 fhLambda0MaxFECOdd(0), fhLambda1MaxFECOdd(0),
115 fhLambda0Max2FECPair(0), fhLambda1Max2FECPair(0),
116 fhLambda0Max2FECOdd(0), fhLambda1Max2FECOdd(0),
117 fhLambda0MaxFECPairLargeNCells(0), fhLambda1MaxFECPairLargeNCells(0),
118 fhLambda0MaxFECOddLargeNCells(0), fhLambda1MaxFECOddLargeNCells(0),
119 fhLambda0Max2FECPairLargeNCells(0), fhLambda1Max2FECPairLargeNCells(0),
120 fhLambda0Max2FECOddLargeNCells(0), fhLambda1Max2FECOddLargeNCells(0),
121 
122 // fhDispersion(0),
123 fhEtaPhiFECCorrControl(0),
124 // bad clusters
125 fhBadClusterEnergy(0), fhBadClusterTimeEnergy(0), fhBadClusterEtaPhi(0),
126 fhBadClusterPairDiffTimeE(0), fhBadCellTimeSpreadRespectToCellMax(0),
127 fhBadClusterMaxCellCloseCellRatio(0), fhBadClusterMaxCellCloseCellDiff(0), fhBadClusterMaxCellDiff(0),
128 fhBadClusterMaxCellDiffAverageTime(0), fhBadClusterMaxCellDiffWeightedTime(0),
129 fhBadClusterMaxCellECross(0),
130 fhBadClusterLambda0(0), fhBadClusterLambda1(0),
131 fhBadClusterDeltaIEtaDeltaIPhiE0(0), fhBadClusterDeltaIEtaDeltaIPhiE2(0),
132 fhBadClusterDeltaIEtaDeltaIPhiE6(0), fhBadClusterDeltaIA(0),
133 
134 // Position
135 fhRNCells(0), fhXNCells(0),
136 fhYNCells(0), fhZNCells(0),
137 fhRE(0), fhXE(0),
138 fhYE(0), fhZE(0),
139 fhXYZ(0),
140 fhRCellE(0), fhXCellE(0),
141 fhYCellE(0), fhZCellE(0),
142 fhXYZCell(0),
143 fhDeltaCellClusterRNCells(0), fhDeltaCellClusterXNCells(0),
144 fhDeltaCellClusterYNCells(0), fhDeltaCellClusterZNCells(0),
145 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0),
146 fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
147 
148 // Cells
149 fhNCells(0), fhNCellsCutAmpMin(0),
150 fhAmplitude(0), fhAmpId(0),
151 fhEtaPhiAmpCell(0), fhEtaPhiCell(0),
152 fhTime(0), //fhTimeVz(0),
153 fhTimeId(0), fhTimeAmp(0),
154 fhAmpIdLowGain(0), fhTimeIdLowGain(0), fhTimeAmpLowGain(0),
155 
156 fhCellECross(0),
157 
158 fhEMCALPHOSCorrNClusters(0), fhEMCALPHOSCorrEClusters(0),
159 fhEMCALPHOSCorrNCells(0), fhEMCALPHOSCorrECells(0),
160 fhEMCALDCALCorrNClusters(0), fhEMCALDCALCorrEClusters(0),
161 fhEMCALDCALCorrNCells(0), fhEMCALDCALCorrECells(0),
162 fhDCALPHOSCorrNClusters(0), fhDCALPHOSCorrEClusters(0),
163 fhDCALPHOSCorrNCells(0), fhDCALPHOSCorrECells(0),
164 fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0),
165 fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
166 fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0),
167 fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
168 fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0),
169 fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
170 fhCaloCenNClusters(0), fhCaloCenEClusters(0),
171 fhCaloCenNCells(0), fhCaloCenECells(0),
172 fhCaloEvPNClusters(0), fhCaloEvPEClusters(0),
173 fhCaloEvPNCells(0), fhCaloEvPECells(0),
174 
175 // Super-Module dependent histograms
176 fhEMod(0), fhAmpMod(0),
177 fhEWeirdMod(0), fhAmpWeirdMod(0),
178 fhTimeMod(0),
179 fhNClustersMod(0), fhNCellsMod(0),
180 fhNCellsSumAmpPerMod(0), fhNClustersSumEnergyPerMod(0),
181 fhNCellsPerClusterMod(0), fhNCellsPerClusterModNoCut(0),
182 fhNCellsPerClusterWeirdMod(0), fhNCellsPerClusterWeirdModNoCut(0),
183 
184 fhGridCells(0), fhGridCellsE(0), fhGridCellsTime(0),
185 fhGridCellsLowGain(0), fhGridCellsELowGain(0), fhGridCellsTimeLowGain(0),
186 fhTimeAmpPerRCU(0), fhIMMod(0),
187 
188 // Weight studies
189 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
190 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
191 fhECellTotalRatio(0), fhECellTotalLogRatio(0),
192 fhECellTotalRatioMod(0), fhECellTotalLogRatioMod(0),
193 
194 fhExoL0ECross(0), fhExoL1ECross(0),
195 
196 // MC and reco
197 fhRecoMCE(), fhRecoMCPhi(), fhRecoMCEta(),
198 fhRecoMCDeltaE(), fhRecoMCRatioE(),
199 fhRecoMCDeltaPhi(), fhRecoMCDeltaEta(),
200 
201 // MC only
202 fhGenMCE(), fhGenMCPt(), fhGenMCEtaPhi(),
203 fhGenMCAccE(), fhGenMCAccPt(), fhGenMCAccEtaPhi(),
204 
205 // Matched MC
206 fhEMVxyz(0), fhEMR(0),
207 fhHaVxyz(0), fhHaR(0),
208 fh1EOverP(0), fh2dR(0),
209 fh2EledEdx(0), fh2MatchdEdx(0),
210 fh1EOverPR02(0), fh1EleEOverP(0),
211 fhMCEle1EOverP(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
212 fhMCChHad1EOverP(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
213 fhMCNeutral1EOverP(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0),
214 fhMCEle1EOverPR02(0), fhMCChHad1EOverPR02(0), fhMCNeutral1EOverPR02(0),
215 fhMCEle1EleEOverP(0), fhMCChHad1EleEOverP(0), fhMCNeutral1EleEOverP(0),
216 fhTrackMatchedDEtaNeg(0), fhTrackMatchedDPhiNeg(0), fhTrackMatchedDEtaDPhiNeg(0),
217 fhTrackMatchedDEtaPos(0), fhTrackMatchedDPhiPos(0), fhTrackMatchedDEtaDPhiPos(0),
218 fhTrackMatchedDEtaNegMod(0), fhTrackMatchedDPhiNegMod(0),
219 fhTrackMatchedDEtaPosMod(0), fhTrackMatchedDPhiPosMod(0),
220 fhClusterTimeEnergyM02(0), fhCellTimeSpreadRespectToCellMaxM02(0),
221 fhClusterMaxCellCloseCellRatioM02(0), fhClusterMaxCellCloseCellDiffM02(0),
222 fhClusterMaxCellDiffM02(0), fhClusterMaxCellECrossM02(0), fhNCellsPerClusterM02(0)
223 {
224  // Weight studies
225  for(Int_t i =0; i < 12; i++)
226  {
227  for(Int_t j = 0; j < 4; j++)
228  {
229  for(Int_t k = 0; k < 3; k++)
230  {
231  fhLambda0ForW0AndCellCuts [i][j][k] = 0;
232 // fhLambda1ForW0AndCellCuts [i][j][k] = 0;
233  fhLambda0ForW0AndCellCutsEta0[i][j][k] = 0;
234  }
235  }
236  for(Int_t j = 0; j < 5; j++)
237  {
238  fhLambda0ForW0MC[i][j] = 0;
239 // fhLambda1ForW0MC[i][j] = 0;
240  }
241  }
242 
243  // Cluster size
246  fhDeltaIA[0] = 0 ; fhDeltaIAL0[0] = 0; fhDeltaIAL1[0] = 0;
247  fhDeltaIA[1] = 0 ; fhDeltaIAL0[1] = 0; fhDeltaIAL1[1] = 0;
248  fhDeltaIANCells[0] = 0 ; fhDeltaIANCells[1] = 0;
249  fhDeltaIAMC[0] = 0 ; fhDeltaIAMC[1] = 0;
250  fhDeltaIAMC[2] = 0 ; fhDeltaIAMC[3] = 0;
251 
252  // Exotic
253  for (Int_t ie = 0; ie < 10 ; ie++)
254  {
255  fhExoDTime[ie] = 0;
256  for (Int_t idt = 0; idt < 5 ; idt++)
257  {
258  fhExoNCell [ie][idt] = 0;
259  fhExoL0 [ie][idt] = 0;
260  fhExoL1 [ie][idt] = 0;
261  fhExoECross [ie][idt] = 0;
262  fhExoTime [ie][idt] = 0;
263  fhExoL0NCell [ie][idt] = 0;
264  fhExoL1NCell [ie][idt] = 0;
265  }
266  }
267 
268  // MC
269 
270  for(Int_t i = 0; i < 7; i++)
271  {
272  fhRecoMCE[i][0] = 0; fhRecoMCE[i][1] = 0;
273  fhRecoMCPhi[i][0] = 0; fhRecoMCPhi[i][1] = 0;
274  fhRecoMCEta[i][0] = 0; fhRecoMCEta[i][1] = 0;
275  fhRecoMCDeltaE[i][0] = 0; fhRecoMCDeltaE[i][1] = 0;
276  fhRecoMCRatioE[i][0] = 0; fhRecoMCRatioE[i][1] = 0;
277  fhRecoMCDeltaPhi[i][0] = 0; fhRecoMCDeltaPhi[i][1] = 0;
278  fhRecoMCDeltaEta[i][0] = 0; fhRecoMCDeltaEta[i][1] = 0;
279  }
280 
281  for(Int_t i = 0; i < 4; i++)
282  {
283  fhGenMCE[i] = 0;
284  fhGenMCPt[i] = 0;
285  fhGenMCEtaPhi[i] = 0;
286  fhGenMCAccE[i] = 0;
287  fhGenMCAccPt[i] = 0;
288  fhGenMCAccEtaPhi[i] = 0;
289  }
290 
291  for(Int_t i = 0; i < 14; i++)
292  {
293  fhEBinClusterEtaPhi[i] = 0 ;
294  fhEBinClusterColRow[i] = 0 ;
295  fhEBinCellColRow [i] = 0 ;
296  }
297 
298  for(Int_t bc = 0; bc < 4; bc++) fhTimePerSMPerBC[bc] = 0 ;
299 
300  // FEC correl studies
301  for(Int_t i = 0; i < 6; i++)
302  {
303  fhLambda0FECCorrel [i] = 0 ;
304  fhLambda1FECCorrel [i] = 0 ;
307  }
308 
309  for(Int_t i = 0; i < 4; i++)
310  {
311  fhLambda0MaxFECCorrel[i] = 0 ;
312  fhLambda1MaxFECCorrel[i] = 0 ;
315  }
316 
317  // TCard correl studies
318  for(Int_t tm = 0; tm < 2; tm++)
319  {
325  fhNCellsTCardCorrNoSelection [tm] = 0 ;
328  fhExoticTCardCorrNoSelection [tm] = 0 ;
331 
340 
341  for(Int_t i = 0; i < 6; i++)
342  {
343  for(Int_t j = 0; j < 6; j++)
344  {
345  fhLambda0TCardCorrelNCell[i][j][tm] = 0 ;
346  fhLambda1TCardCorrelNCell[i][j][tm] = 0 ;
347  fhLambdaRTCardCorrelNCell[i][j][tm] = 0 ;
348  fhExoticTCardCorrelNCell [i][j][tm] = 0 ;
349  fhColRowTCardCorrelNCellLowE [i][j][tm] = 0 ;
350  fhColRowTCardCorrelNCellHighE[i][j][tm] = 0 ;
351  }
352 
353  fhLambda0TCardCorrelN[i][tm] = 0 ;
354  fhNCellsTCardCorrelN [i][tm] = 0 ;
355  fhExoticTCardCorrelN [i][tm] = 0 ;
356  fhColRowTCardCorrelNLowE [i][tm] = 0 ;
357  fhColRowTCardCorrelNHighE[i][tm] = 0 ;
358 
360  fhNCellsTCardCorrelNAllSameTCard [i][tm] = 0 ;
361  fhExoticTCardCorrelNAllSameTCard [i][tm] = 0 ;
364 
365  fhLambda0TCardCorrelNExotic[i][tm] = 0 ;
366  fhNCellsTCardCorrelNExotic [i][tm] = 0 ;
367  fhColRowTCardCorrelNLowEExotic [i][tm] = 0 ;
368  fhColRowTCardCorrelNHighEExotic[i][tm] = 0 ;
369 
374  // fhLambda0TCardCorrelNearRow[i][tm] = 0 ;
375  // fhNCellsTCardCorrelNearRow [i][tm] = 0 ;
376  }
377 
378  for(Int_t i = 0; i < 4; i++)
379  {
380 // fhLambda0TCardCorrel2ndMax[i][tm] = 0 ;
381 // fhNCellsTCardCorrel2ndMax [i][tm] = 0 ;
382  fhLambda0TCardCorrelExotic[i][tm] = 0 ;
383  fhNCellsTCardCorrelExotic [i][tm] = 0 ;
384  }
385 
386  for(Int_t i = 0; i < 14; i++)
387  {
388  fhLambda0Exoticity[i][tm] = 0;
389  fhLambda1Exoticity[i][tm] = 0;
390  fhLambdaRExoticity[i][tm] = 0;
391  fhNCellsExoticity [i][tm] = 0;
392  fhLambda0Lambda1 [i][tm] = 0;
393 
397  fhNCellsExoticityAllSameTCard [i][tm] = 0;
398  fhLambda0Lambda1AllSameTCard [i][tm] = 0;
399 
400  fhNCellsTCardSameAndDiff [i][tm] = 0;
402  }
403 
404  for(Int_t j = 0; j < 6; j++)
405  {
406  for(Int_t k = 0; k < 6; k++)
407  {
408  fhLambda0ExoticityPerNCell[j][k][tm] = 0;
409  fhLambda1ExoticityPerNCell[j][k][tm] = 0;
410  fhLambdaRExoticityPerNCell[j][k][tm] = 0;
411  }
412  }
413 
414  for(Int_t i = 0; i < 7; i++)
415  {
416  fhLambda0TCardCorrel[i][tm] = 0 ;
417  fhNCellsTCardCorrel [i][tm] = 0 ;
418  fhExoticTCardCorrel [i][tm] = 0 ;
419 
420  fhLambda0TCardCorrelOtherTCard[i][tm] = 0 ;
421  fhNCellsTCardCorrelOtherTCard [i][tm] = 0 ;
422  fhExoticTCardCorrelOtherTCard [i][tm] = 0 ;
423  fhColRowTCardCorrelOtherTCardLowE [i][tm] = 0 ;
425  }
426 
427  for(Int_t i = 0; i < 12; i++)
428  {
429  fhTCardCorrECellMaxDiff[i][tm]=0;
430  fhTCardCorrEClusterDiff[i][tm]=0;
431  fhTCardCorrECellMaxRat [i][tm]=0;
432  fhTCardCorrEClusterRat [i][tm]=0;
433  fhTCardCorrTCellMaxDiff[i][tm]=0;
434 
435  fhTCardCorrECellMaxDiffExo[i][tm]=0;
436  fhTCardCorrEClusterDiffExo[i][tm]=0;
437  fhTCardCorrECellMaxRatExo [i][tm]=0;
438  fhTCardCorrEClusterRatExo [i][tm]=0;
439  fhTCardCorrTCellMaxDiffExo[i][tm]=0;
440  }
441  }
442 
443  for(Int_t i = 0; i < fNEBinCuts; i++)
444  {
449  }
450 
451  InitParameters();
452 }
453 
454 //______________________________________________________________________________________________________________________
464 //______________________________________________________________________________________________________________________
465 void AliAnaCalorimeterQA::BadClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
466  Int_t absIdMax, Double_t maxCellFraction, Float_t eCrossFrac,
467  Double_t tmax)
468 {
469  // printf("AliAnaCalorimeterQA::BadClusterHistograms() - Event %d - Calorimeter %s \n \t E %f, n cells %d, max cell absId %d, maxCellFrac %f\n",
470  // GetReader()->GetEventNumber(), GetCalorimeterString().Data(),
471  // clus->E(),clus->GetNCells(),absIdMax,maxCellFraction);
472 
473  Double_t tof = clus->GetTOF()*1.e9;
474  if(tof > 400) tof-=fConstantTimeShift;
475 
476  Float_t energy = clus->E();
477 
478  fhBadClusterEnergy ->Fill(energy, GetEventWeight());
479  fhBadClusterTimeEnergy ->Fill(energy, tof , GetEventWeight());
480  fhBadClusterMaxCellDiff ->Fill(energy, maxCellFraction, GetEventWeight());
481  fhBadClusterMaxCellECross->Fill(energy, eCrossFrac , GetEventWeight());
482 
483  Float_t phi = fClusterMomentum.Phi();
484  if(phi < 0) phi += TMath::TwoPi();
485 
486  if(energy > 0.5) fhBadClusterEtaPhi->Fill(fClusterMomentum.Eta(), phi, GetEventWeight());
487 
488  fhBadClusterLambda0->Fill(energy, clus->GetM02());
489  fhBadClusterLambda1->Fill(energy, clus->GetM20());
490 
491  if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kFALSE);
492 
493  // Clusters in event time difference bad minus good
494 
495  for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ )
496  {
497  AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
498 
499  if(clus->GetID() == clus2->GetID()) continue;
500 
501  Float_t maxCellFraction2 = 0.;
502  Int_t absIdMax2 = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction2);
503 
504  if(IsGoodCluster(absIdMax2, clus->GetM02(), clus->GetNCells(), cells) && clus2->GetM02() > 0.1 )
505  {
506  Double_t tof2 = clus2->GetTOF()*1.e9;
507  if(tof2>400) tof2-=fConstantTimeShift;
508 
509  fhBadClusterPairDiffTimeE ->Fill(clus->E(), (tof-tof2), GetEventWeight());
510  }
511  } // loop
512 
513  // Max cell compared to other cells in cluster
515  {
516  // Get some time averages
517  Double_t timeAverages[2] = {0.,0.};
518  CalculateAverageTime(clus, cells, timeAverages);
519 
520  fhBadClusterMaxCellDiffAverageTime ->Fill(clus->E(), tmax-timeAverages[0], GetEventWeight());
521  fhBadClusterMaxCellDiffWeightedTime->Fill(clus->E(), tmax-timeAverages[1], GetEventWeight());
522  }
523 
524  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
525  {
526  Int_t absId = clus->GetCellsAbsId()[ipos];
527  if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
528  {
529  Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
530 
531  fhBadClusterMaxCellCloseCellRatio->Fill(clus->E(), frac, GetEventWeight());
532  fhBadClusterMaxCellCloseCellDiff ->Fill(clus->E(), cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId), GetEventWeight());
533 
535  {
536  Double_t time = cells->GetCellTime(absId);
537  GetCaloUtils()->RecalibrateCellTime(time, GetCalorimeter(), absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
538 
539  Float_t diff = (tmax-(time*1e9-fConstantTimeShift));
540  fhBadCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff, GetEventWeight());
541 
542  }
543  } // Not max
544  } // loop
545 }
546 
547 //______________________________________________________________________
552 //______________________________________________________________________
554  AliVCaloCells* cells,
555  Double_t timeAverages[2])
556 {
557  // First recalculate energy in case non linearity was applied
558  Float_t energy = 0;
559  Float_t ampMax = 0, amp = 0;
560 //Int_t absIdMax = -1;
561 
562  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
563  {
564  Int_t id = clus->GetCellsAbsId()[ipos];
565 
566  // Recalibrate cell energy if needed
567  amp = cells->GetCellAmplitude(id);
569 
570  energy += amp;
571 
572  if(amp> ampMax)
573  {
574  ampMax = amp;
575 // absIdMax = id;
576  }
577  } // energy loop
578 
579  // Calculate average time of cells in cluster and weighted average
580  Double_t aTime = 0;
581  Double_t wTime = 0;
582  Float_t wTot = 0;
583  Double_t time = 0;
584  Int_t id =-1;
585  Double_t w = 0;
586  Int_t ncells = clus->GetNCells();
587 
588  for (Int_t ipos = 0; ipos < ncells; ipos++)
589  {
590  id = clus ->GetCellsAbsId()[ipos];
591  amp = cells->GetCellAmplitude(id);
592  time = cells->GetCellTime(id);
593 
594  // Recalibrate energy and time
596  GetCaloUtils()->RecalibrateCellTime (time, GetCalorimeter(), id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
597 
598  w = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cells->GetCellAmplitude(id),energy);
599  aTime += time*1e9;
600  wTime += time*1e9 * w;
601  wTot += w;
602  }
603 
604  if(ncells > 0) aTime /= ncells;
605  else aTime = 0;
606 
607  if(wTot > 0) wTime /= wTot;
608  else wTime = 0;
609 
610  timeAverages[0] = aTime;
611  timeAverages[1] = wTime;
612 }
613 
614 //____________________________________________________________
616 //____________________________________________________________
617 void AliAnaCalorimeterQA::CellHistograms(AliVCaloCells *cells)
618 {
619  Int_t ncells = cells->GetNumberOfCells();
620  if( ncells > 0 ) fhNCells->Fill(ncells, GetEventWeight()) ; // Not ok for PHOS with CPV
621 
622  Int_t ncellsCut = 0;
623  Float_t ecellsCut = 0;
624 
625  AliDebug(1,Form("%s cell entries %d", GetCalorimeterString().Data(), ncells));
626 
627  // Init arrays and used variables
628  Int_t *nCellsInModule = new Int_t [fNModules];
629  Float_t *eCellsInModule = new Float_t[fNModules];
630 
631  for(Int_t imod = 0; imod < fNModules; imod++ )
632  {
633  nCellsInModule[imod] = 0 ;
634  eCellsInModule[imod] = 0.;
635  }
636 
637  Int_t icol = -1, icolAbs = -1;
638  Int_t irow = -1, irowAbs = -1;
639  Int_t iRCU = -1;
640  Float_t amp = 0.;
641  Double_t time = 0.;
642  Int_t id = -1;
643  Bool_t highG = kFALSE;
644  Float_t recalF = 1.;
645  Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
646 
647  for (Int_t iCell = 0; iCell < cells->GetNumberOfCells(); iCell++)
648  {
649  if ( cells->GetCellNumber(iCell) < 0 ) continue; // CPV
650 
651  AliDebug(2,Form("Cell : amp %f, absId %d", cells->GetAmplitude(iCell), cells->GetCellNumber(iCell)));
652 
653  Int_t nModule = GetModuleNumberCellIndexesAbsCaloMap(cells->GetCellNumber(iCell),GetCalorimeter(),
654  icol , irow, iRCU,
655  icolAbs, irowAbs );
656 
657  AliDebug(2,Form("\t module %d, column %d (%d), row %d (%d)", nModule,icolAbs,icol,irowAbs,irow));
658 
659  if(nModule < fNModules)
660  {
661  //Check if the cell is a bad channel
662  if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn())
663  {
664  if(GetCalorimeter()==kEMCAL)
665  {
666  if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
667  }
668  else
669  {
670  if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow) ) continue;
671  }
672  } // use bad channel map
673 
674  amp = cells->GetAmplitude(iCell)*recalF;
675  time = cells->GetTime(iCell);
676  id = cells->GetCellNumber(iCell);
677  highG = cells->GetCellHighGain(id);
678  if(IsDataMC()) highG = kTRUE; // MC does not distinguish High and Low, put them all in high
679 
680  // Amplitude recalibration if set
682 
683  // Time recalibration if set
684  GetCaloUtils()->RecalibrateCellTime (time, GetCalorimeter(), id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
685 
686  // Transform time to ns
687  time *= 1.0e9;
688  time-=fConstantTimeShift;
689 
690  if(time < fTimeCutMin || time > fTimeCutMax)
691  {
692  AliDebug(1,Form("Remove cell with Time %f",time));
693  continue;
694  }
695 
696  // Remove exotic cells, defined only for EMCAL
697  if(GetCalorimeter()==kEMCAL &&
698  GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(id, cells, bc)) continue;
699 
700  fhAmplitude->Fill(amp, GetEventWeight());
701  fhAmpId ->Fill(amp, id , GetEventWeight());
702  fhAmpMod ->Fill(amp, nModule, GetEventWeight());
703  fhAmpWeirdMod->Fill(amp, nModule, GetEventWeight());
704  if(!highG) fhAmpIdLowGain->Fill(amp, id, GetEventWeight());
705 
707  {
708  for(Int_t ie = 0; ie < fNEBinCuts; ie++)
709  {
710  if( amp >= fEBinCuts[ie] && amp < fEBinCuts[ie+1] )
711  {
712  fhEBinCellColRow[ie]->Fill(icolAbs,irowAbs,GetEventWeight()) ;
713  }
714  }
715  }
716 
717  // E cross for exotic cells
718  if(amp > 0.05)
719  {
720  fhCellECross->Fill(amp, 1-GetECross(id,cells)/amp, GetEventWeight());
721  ecellsCut+=amp ;
722  if(fStudyWeight) eCellsInModule[nModule]+=amp ;
723  }
724 
725  if ( amp > fCellAmpMin )
726  {
727  ncellsCut++ ;
728  nCellsInModule[nModule]++ ;
729 
730  if(!fStudyWeight) eCellsInModule[nModule]+=amp ;
731 
732  fhGridCells ->Fill(icolAbs, irowAbs, GetEventWeight());
733  fhGridCellsE->Fill(icolAbs, irowAbs, amp );
734 
735  if(!highG)
736  {
737  fhGridCellsLowGain ->Fill(icolAbs, irowAbs, GetEventWeight());
738  fhGridCellsELowGain->Fill(icolAbs, irowAbs, amp );
739  }
740 
742  {
743  //printf("%s: time %g\n",GetCalorimeterString().Data(), time);
744 
745 // Double_t v[3] = {0,0,0}; //vertex ;
746 // GetReader()->GetVertex(v);
747 // if(amp > 0.5) fhTimeVz ->Fill(TMath::Abs(v[2]), time, GetEventWeight());
748 
749  fhTime ->Fill(time, GetEventWeight());
750  fhTimeId ->Fill(time, id , GetEventWeight());
751  fhTimeAmp->Fill(amp , time, GetEventWeight());
752 
753  Int_t bc = (GetReader()->GetInputEvent()->GetBunchCrossNumber())%4;
754  fhTimePerSMPerBC[bc]->Fill(time, nModule, GetEventWeight());
755 
756  fhGridCellsTime->Fill(icolAbs, irowAbs, time);
757  if(!highG) fhGridCellsTimeLowGain->Fill(icolAbs, irowAbs, time);
758 
759  fhTimeMod->Fill(time, nModule, GetEventWeight());
760  fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time, GetEventWeight());
761 
762  if(!highG)
763  {
764  fhTimeIdLowGain ->Fill(time, id , GetEventWeight());
765  fhTimeAmpLowGain->Fill(amp , time, GetEventWeight());
766  }
767  }
768  }
769 
770  // Get Eta-Phi position of Cell
771  if(fFillAllPosHisto)
772  {
773  if ( GetCalorimeter() == kEMCAL && GetCaloUtils()->IsEMCALGeoMatrixSet() )
774  {
775  Float_t celleta = 0.;
776  Float_t cellphi = 0.;
777  GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
778 
779  if ( cellphi < 0 ) cellphi+=TMath::TwoPi();
780 
781  if(fFillAllTH3)
782  fhEtaPhiAmpCell->Fill(celleta, cellphi, amp, GetEventWeight());
783  else
784  fhEtaPhiCell ->Fill(celleta, cellphi, GetEventWeight());
785 
786  Double_t cellpos[] = {0, 0, 0};
787  GetEMCALGeometry()->GetGlobal(id, cellpos);
788 
789  fhXCellE->Fill(cellpos[0], amp, GetEventWeight()) ;
790  fhYCellE->Fill(cellpos[1], amp, GetEventWeight()) ;
791  fhZCellE->Fill(cellpos[2], amp, GetEventWeight()) ;
792 
793  Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
794  fhRCellE ->Fill(rcell, amp, GetEventWeight()) ;
795 
796  fhXYZCell->Fill(cellpos[0], cellpos[1], cellpos[2], GetEventWeight()) ;
797  } // EMCAL Cells
798  else if ( GetCalorimeter() == kPHOS && GetCaloUtils()->IsPHOSGeoMatrixSet() )
799  {
800  TVector3 xyz;
801  Int_t relId[4], module;
802  Float_t xCell, zCell;
803 
804  GetPHOSGeometry()->AbsToRelNumbering(id,relId);
805  module = relId[0];
806  GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
807  GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
808 
809  Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
810 
811  fhXCellE ->Fill(xyz.X(), amp, GetEventWeight()) ;
812  fhYCellE ->Fill(xyz.Y(), amp, GetEventWeight()) ;
813  fhZCellE ->Fill(xyz.Z(), amp, GetEventWeight()) ;
814  fhRCellE ->Fill(rcell , amp, GetEventWeight()) ;
815 
816  fhXYZCell->Fill(xyz.X(), xyz.Y(), xyz.Z(), GetEventWeight()) ;
817  } // PHOS cells
818  } // Fill cell position histograms
819 
820  } // N modules
821  } // Cell loop
822 
823  // Fill the cells after the cut on min amplitude and bad/exotic channels
824  if( ncellsCut > 0 ) fhNCellsCutAmpMin->Fill(ncellsCut, GetEventWeight()) ;
825 
826  // Number of cells per module
827  for(Int_t imod = 0; imod < fNModules; imod++ )
828  {
829  AliDebug(1,Form("Module %d, calo %s, N cells %d, sum Amp %f", imod, GetCalorimeterString().Data(), nCellsInModule[imod], eCellsInModule[imod]));
830 
831  fhNCellsMod ->Fill(nCellsInModule[imod], imod, GetEventWeight()) ;
832  fhSumCellsAmpMod->Fill(eCellsInModule[imod], imod, GetEventWeight()) ;
833 
834  fhNCellsSumAmpPerMod[imod]->Fill(eCellsInModule[imod], nCellsInModule[imod], GetEventWeight());
835  }
836 
837  // Check energy distribution in calorimeter for selected cells
838  if(fStudyWeight)
839  {
840  for (Int_t iCell = 0; iCell < cells->GetNumberOfCells(); iCell++)
841  {
842  if ( cells->GetCellNumber(iCell) < 0 ) continue; // CPV
843 
844  AliDebug(2,Form("Cell : amp %f, absId %d", cells->GetAmplitude(iCell), cells->GetCellNumber(iCell)));
845 
846  Int_t nModule = GetModuleNumberCellIndexes(cells->GetCellNumber(iCell),GetCalorimeter(), icol, irow, iRCU);
847 
848  AliDebug(2,Form("\t module %d, column %d, row %d", nModule,icol,irow));
849 
850  if(nModule < fNModules)
851  {
852  //Check if the cell is a bad channel
853  if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn())
854  {
855  if(GetCalorimeter()==kEMCAL)
856  {
857  if(GetCaloUtils()->GetEMCALChannelStatus(nModule, icol, irow)) continue;
858  }
859  else
860  {
861  if(GetCaloUtils()->GetPHOSChannelStatus (nModule, icol, irow) ) continue;
862  }
863  } // use bad channel map
864 
865  amp = cells->GetAmplitude(iCell)*recalF;
866  time = cells->GetTime(iCell);
867  id = cells->GetCellNumber(iCell);
868 
869  // Amplitude recalibration if set
871 
872  // Time recalibration if set
874  GetReader()->GetInputEvent()->GetBunchCrossNumber());
875 
876  // Transform time to ns
877  time *= 1.0e9;
878  time -= fConstantTimeShift;
879 
880  if(time < fTimeCutMin || time > fTimeCutMax)
881  {
882  AliDebug(1,Form("Remove cell with Time %f",time));
883  continue;
884  }
885 
886  // Remove exotic cells, defined only for EMCAL
887  if(GetCalorimeter()==kEMCAL &&
888  GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(id, cells, bc)) continue;
889 
890  // E cross for exotic cells
891  if(amp > 0.05)
892  {
893  if(ecellsCut > 0)
894  {
895  Float_t ratio = amp/ecellsCut;
896  fhECellTotalRatio ->Fill(ecellsCut, ratio , GetEventWeight());
897  fhECellTotalLogRatio ->Fill(ecellsCut,TMath::Log(ratio), GetEventWeight());
898  }
899 
900  if(eCellsInModule[nModule] > 0)
901  {
902  Float_t ratioMod = amp/eCellsInModule[nModule];
903  fhECellTotalRatioMod [nModule]->Fill(eCellsInModule[nModule], ratioMod , GetEventWeight());
904  fhECellTotalLogRatioMod[nModule]->Fill(eCellsInModule[nModule],TMath::Log(ratioMod), GetEventWeight());
905  }
906  } // amp > 0.5
907  } // nMod > 0 < Max
908  } // cell loop
909  } // weight studies
910 
911  delete [] nCellsInModule;
912  delete [] eCellsInModule;
913 }
914 
915 //__________________________________________________________________________
917 //__________________________________________________________________________
919 {
920  Int_t nCaloCellsPerCluster = clus->GetNCells();
921 
922  UShort_t * indexList = clus->GetCellsAbsId();
923 
924  Float_t pos[3];
925  clus->GetPosition(pos);
926 
927  Float_t clEnergy = clus->E();
928 
929  // Loop on cluster cells
930  for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
931  {
932  // printf("Index %d\n",ipos);
933  Int_t absId = indexList[ipos];
934 
935  //Get position of cell compare to cluster
936 
937  if ( GetCalorimeter() == kEMCAL && GetCaloUtils()->IsEMCALGeoMatrixSet() )
938  {
939  Double_t cellpos[] = {0, 0, 0};
940  GetEMCALGeometry()->GetGlobal(absId, cellpos);
941 
942  fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0], nCaloCellsPerCluster, GetEventWeight()) ;
943  fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1], nCaloCellsPerCluster, GetEventWeight()) ;
944  fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2], nCaloCellsPerCluster, GetEventWeight()) ;
945 
946  fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0], clEnergy, GetEventWeight()) ;
947  fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1], clEnergy, GetEventWeight()) ;
948  fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2], clEnergy, GetEventWeight()) ;
949 
950  Float_t r = TMath::Sqrt(pos[0] *pos[0] + pos[1] * pos[1] );
951  Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0] + cellpos[1]* cellpos[1]);
952 
953  fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster, GetEventWeight()) ;
954  fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy , GetEventWeight()) ;
955  } // EMCAL and its matrices are available
956  else if ( GetCalorimeter() == kPHOS && GetCaloUtils()->IsPHOSGeoMatrixSet() )
957  {
958  TVector3 xyz;
959  Int_t relId[4], module;
960  Float_t xCell, zCell;
961 
962  GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
963  module = relId[0];
964  GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
965  GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
966 
967  fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(), nCaloCellsPerCluster, GetEventWeight()) ;
968  fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(), nCaloCellsPerCluster, GetEventWeight()) ;
969  fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(), nCaloCellsPerCluster, GetEventWeight()) ;
970 
971  fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(), clEnergy, GetEventWeight()) ;
972  fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(), clEnergy, GetEventWeight()) ;
973  fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(), clEnergy, GetEventWeight()) ;
974 
975  Float_t r = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1] );
976  Float_t rcell = TMath::Sqrt(xyz.X() * xyz.X() + xyz.Y() * xyz.Y());
977 
978  fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster, GetEventWeight()) ;
979  fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy , GetEventWeight()) ;
980  } // PHOS and its matrices are available
981  } // cluster cell loop
982 }
983 
984 
985 //___________________________________________________
993 //___________________________________________________
994 void AliAnaCalorimeterQA::ChannelCorrelationInFEC(AliVCluster* clus, AliVCaloCells* cells,
995  Bool_t matched, Int_t absIdMax) const
996 {
997  // Clean the sample
998 
999  // select neutral
1000  if ( matched ) return;
1001 
1002  // away from dead region
1003  if ( clus->GetDistanceToBadChannel() < 5 ) return ;
1004 
1005  // in center of SM
1006  Int_t etaRegion = -1, phiRegion = -1;
1007  GetCaloUtils()->GetEMCALSubregion(clus,GetReader()->GetEMCALCells(),etaRegion,phiRegion);
1008  // Region 0: center of SM ~0.18<|eta|<0.55
1009  if ( etaRegion !=0 ) return ;
1010 
1012 
1013  Float_t energy = clus->E();
1014  Float_t m02 = clus->GetM02();
1015  Float_t m20 = clus->GetM20();
1016  Int_t ncells = clus->GetNCells();
1017 
1018  Int_t absIdCorr[] = {-1,-1,-1,-1};
1019  Bool_t correlMaxOK = GetCaloUtils()->GetFECCorrelatedCellAbsId(absIdMax, absIdCorr);
1020 
1021  //
1022  // Correlation to max
1023  //
1024  Int_t nCorr = 0;
1025  Int_t nCellWithWeight = 1;
1026  Bool_t near = kFALSE;
1027  Bool_t far = kFALSE;
1028  // Get second highest energy cell
1029  Int_t absId2ndMax = -1;
1030  Float_t emax = 0;
1031  if(correlMaxOK)
1032  {
1033  for (Int_t ipos = 0; ipos < ncells; ipos++)
1034  {
1035  Int_t absId = clus->GetCellsAbsId()[ipos];
1036 
1037  Float_t eCell = cells->GetCellAmplitude(absId);
1038  // consider cells with enough energy weight and not the reference one
1039  Float_t weight = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(eCell, energy);
1040 
1041  if( absId == absIdMax || weight < 0.01 ) continue;
1042 
1043  nCellWithWeight++;
1044 
1045  if ( eCell > emax )
1046  {
1047  emax = eCell;
1048  absId2ndMax = absId;
1049  }
1050 
1051  for(Int_t id = 0; id < 4; id++)
1052  {
1053  if ( absId == absIdCorr[id] )
1054  {
1055  nCorr++;
1056  Int_t diff = TMath::Abs(absId-absIdMax);
1057  if ( diff == 1 ) near = kTRUE;
1058  else if( diff >= 8 ) far = kTRUE;
1059  }
1060  }
1061  }
1062 
1063  fhNCellsPerClusterWithWeight->Fill(energy, nCellWithWeight, GetEventWeight());
1064  Float_t ratioNcells = nCellWithWeight/(ncells*1.);
1065  //printf("E %2.2f, ncells %d, nCellWithWeight %d, ratio %2.2f\n",energy,ncells,nCellWithWeight,ratioNcells);
1066  fhNCellsPerClusterRatioWithWeight->Fill(energy, ratioNcells, GetEventWeight());
1067 
1068  //if ( nCorr || close || far ) printf("nCorr = %d, close %d, far %d; E %2.2f, ncell %d\n",nCorr,close,far,e,nCaloCellsPerCluster);
1069 
1070  //if ( nCorr > 3) printf("More than 3 correlations: %d\n",nCorr);
1071 
1072  // Fill histograms assign index
1073  Int_t index = -1;
1074  if ( nCorr == 0 ) index = 0;
1075  else
1076  {
1077  if ( near && !far ) index = 1;
1078  else if (!near && far ) index = 2;
1079  else if ( near && far ) index = 3;
1080  }
1081 
1082  if ( index >= 0 )
1083  {
1084  fhLambda0MaxFECCorrel[index]->Fill(energy, m02, GetEventWeight());
1085  fhLambda1MaxFECCorrel[index]->Fill(energy, m20, GetEventWeight());
1086 
1087  if(nCellWithWeight > 3)
1088  {
1089  fhLambda0MaxFECCorrelLargeNCells[index]->Fill(energy, m02, GetEventWeight());
1090  fhLambda1MaxFECCorrelLargeNCells[index]->Fill(energy, m20, GetEventWeight());
1091  }
1092  }
1093  } // list of correlated towers is found
1094  else printf("Max cell correl cells not found\n");
1095 
1096  //
1097  // Any cell correlation, excluding max and their associates
1098  //
1099  Int_t absIdCorrSecondary [] = {-1,-1,-1,-1};
1100  Int_t counter = 0;
1101  for (Int_t ipos = 0; ipos < ncells; ipos++)
1102  {
1103  Int_t absId = clus->GetCellsAbsId()[ipos];
1104 
1105  // consider cells with enough energy weight and not the reference one or their correlated
1106  Float_t weight = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cells->GetCellAmplitude(absId), energy);
1107 
1108  if( absId == absIdCorr[0] || absId == absIdCorr[1] ||
1109  absId == absIdCorr[2] || absId == absIdCorr[3] || weight < 0.01 ) continue;
1110 
1111  Bool_t correlOK = GetCaloUtils()->GetFECCorrelatedCellAbsId(absId, absIdCorrSecondary);
1112 
1113  if(!correlOK) continue;
1114 
1115  for (Int_t ipos2 = ipos+1; ipos2 < ncells; ipos2++)
1116  {
1117  Int_t absId2 = clus->GetCellsAbsId()[ipos2];
1118 
1119  // consider cells with enough energy weight and not the reference one or their correlated
1120  Float_t weight = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cells->GetCellAmplitude(absId2), energy);
1121 
1122  if( absId2 == absIdCorr[0] || absId2 == absIdCorr[1] || absId2 == absId ||
1123  absId2 == absIdCorr[2] || absId2 == absIdCorr[3] || weight < 0.01 ) continue;
1124 
1125  for(Int_t id = 0; id < 4; id++)
1126  {
1127  if ( absId2 == absIdCorrSecondary[id] )
1128  counter++;
1129  }
1130  }
1131  }
1132 
1133  Int_t distCase = 0;
1134  if ( counter == 1 ) distCase = 1;
1135  else if ( counter >= 2 ) distCase = 2;
1136 
1137  if ( nCorr > 0 ) distCase+=3;
1138 
1139  fhLambda0FECCorrel[distCase]->Fill(energy, m02, GetEventWeight());
1140  fhLambda1FECCorrel[distCase]->Fill(energy, m20, GetEventWeight());
1141  if(nCellWithWeight > 3)
1142  {
1143  fhLambda0FECCorrelLargeNCells[distCase]->Fill(energy, m02, GetEventWeight());
1144  fhLambda1FECCorrelLargeNCells[distCase]->Fill(energy, m20, GetEventWeight());
1145  }
1146 
1147  //
1148  // Compare pair and odd eta
1149  //
1150  Int_t idMax = -1;
1151  Int_t idMax2 = -1;
1152  Bool_t pairCol = kFALSE;
1153  for(Int_t id = 0; id < 4; id++)
1154  {
1155  if ( absIdMax == absIdCorr[id]) idMax = id;
1156  else if( absId2ndMax == absIdCorr[id]) idMax2 = id;
1157  }
1158 
1159  if(idMax < 0)
1160  {
1161  printf("something wrong, absId max not found in correlated");
1162  return;
1163  }
1164 
1165  if(idMax == 0 || idMax == 3) pairCol = kTRUE; // n and n+8
1166  // else n+1 and n+9
1167 
1168  if(pairCol)
1169  {
1170  fhLambda0MaxFECPair->Fill(energy, m02, GetEventWeight());
1171  fhLambda1MaxFECPair->Fill(energy, m20, GetEventWeight());
1172  if ( idMax2 >=0 )
1173  {
1174  fhLambda0Max2FECPair->Fill(energy, m02, GetEventWeight());
1175  fhLambda1Max2FECPair->Fill(energy, m20, GetEventWeight());
1176  }
1177  }
1178  else
1179  {
1180  fhLambda0MaxFECOdd->Fill(energy, m02, GetEventWeight());
1181  fhLambda1MaxFECOdd->Fill(energy, m20, GetEventWeight());
1182  if ( idMax2 >=0 )
1183  {
1184  fhLambda0Max2FECOdd->Fill(energy, m02, GetEventWeight());
1185  fhLambda1Max2FECOdd->Fill(energy, m20, GetEventWeight());
1186  }
1187  }
1188 
1189  if(nCellWithWeight > 3)
1190  {
1191  if(pairCol)
1192  {
1193  fhLambda0MaxFECPairLargeNCells->Fill(energy, m02, GetEventWeight());
1194  fhLambda1MaxFECPairLargeNCells->Fill(energy, m20, GetEventWeight());
1195  if ( idMax2 >=0 )
1196  {
1197  fhLambda0Max2FECPairLargeNCells->Fill(energy, m02, GetEventWeight());
1198  fhLambda1Max2FECPairLargeNCells->Fill(energy, m20, GetEventWeight());
1199  }
1200  }
1201  else
1202  {
1203  fhLambda0MaxFECOddLargeNCells->Fill(energy, m02, GetEventWeight());
1204  fhLambda1MaxFECOddLargeNCells->Fill(energy, m20, GetEventWeight());
1205  if ( idMax2 >=0 )
1206  {
1207  fhLambda0Max2FECOddLargeNCells->Fill(energy, m02, GetEventWeight());
1208  fhLambda1Max2FECOddLargeNCells->Fill(energy, m20, GetEventWeight());
1209  }
1210  }
1211  }
1212 
1213 }
1214 
1215 
1216 //___________________________________________________
1224 //___________________________________________________
1225 void AliAnaCalorimeterQA::ChannelCorrelationInTCard(AliVCluster* clus, AliVCaloCells* cells,
1226  Bool_t matched, Int_t absIdMax, Float_t exoticity) const
1227 {
1228  // Clean the sample
1229 
1230  // away from dead region
1231  if ( clus->GetDistanceToBadChannel() < 5 ) return ;
1232 
1233  // in center of SM
1234  Int_t etaRegion = -1, phiRegion = -1;
1235  GetCaloUtils()->GetEMCALSubregion(clus,GetReader()->GetEMCALCells(),etaRegion,phiRegion);
1236  // Region 0: center of SM ~0.18<|eta|<0.55
1237  if ( etaRegion !=0 ) return ;
1238 
1239  Float_t energy = clus->E();
1240  Float_t m02 = clus->GetM02();
1241  Float_t m20 = clus->GetM20();
1242  Int_t ncells = clus->GetNCells();
1243 
1244  //
1245  // Correlation to max
1246  //
1247  Int_t nCellWithWeight = 1;
1248  Bool_t nearRow = kFALSE;
1249  Bool_t nearCol = kFALSE;
1250  Int_t nCorr = 0;
1251  Int_t nCorrNo = 0;
1252  Int_t sameCol = 0;
1253  Int_t other = 0;
1254  Int_t sameRow = 0;
1255  Float_t eCellMax = cells->GetCellAmplitude(absIdMax);
1256  Double_t tCellMax = cells->GetCellTime(absIdMax);
1257  //printf("Org E %2.2f, t %2.2f\n",eCellMax,tCellMax*1e9);
1258  GetCaloUtils()->RecalibrateCellAmplitude(eCellMax, GetCalorimeter(), absIdMax);
1259  GetCaloUtils()->RecalibrateCellTime(tCellMax, GetCalorimeter(), absIdMax, GetReader()->GetInputEvent()->GetBunchCrossNumber());
1260  //printf("New E %2.2f, t %2.2f\n",eCellMax,tCellMax*1e9);
1261 
1262  tCellMax *= 1.0e9;
1263  tCellMax-=fConstantTimeShift;
1264 
1265  // Get the col and row of the leading cluster cell
1266  Int_t icol = -1, irow = -1, iRCU = -1, icolAbs = -1, irowAbs = -1;
1267  GetModuleNumberCellIndexesAbsCaloMap(absIdMax,GetCalorimeter(), icol, irow, iRCU, icolAbs, irowAbs);
1268 
1269  // correlation not max cells
1270  Int_t nCorr2 = 0;
1271  Int_t sameCol2 = 0;
1272  Int_t other2 = 0;
1273  Int_t sameRow2 = 0;
1274 
1275  // Get second highest energy cell
1276 //Int_t absId2ndMax = -1;
1277 //Float_t emax = 0;
1278 //Bool_t sameTCard2ndMax = kFALSE;
1279 //Int_t rowDiff2 = -100;
1280 //Int_t colDiff2 = -100;
1281 
1282  Float_t eCellSameRowSameTCardNearCol = 0.;
1283  Float_t eCellSameRowDiffTCardNearCol = 0.;
1284  Double_t tCellSameRowSameTCardNearCol = 0.;
1285  Double_t tCellSameRowDiffTCardNearCol = 0.;
1286 
1287  //printf("Cluster E %2.2f, ncells %d, absIdMax %d, eCell Max %2.2f\n", energy, ncells, absIdMax, cells->GetCellAmplitude(absIdMax));
1288 
1289  //
1290  // Loop on the cluster cells, define correlations
1291  //
1292  for (Int_t ipos = 0; ipos < ncells; ipos++)
1293  {
1294  Int_t absId = clus->GetCellsAbsId()[ipos];
1295 
1296  Float_t eCell = cells->GetCellAmplitude(absId);
1297  Double_t tCell = cells->GetCellTime(absId);
1298 
1300  GetCaloUtils()->RecalibrateCellTime(tCell, GetCalorimeter(), absId, GetReader()->GetInputEvent()->GetBunchCrossNumber());
1301  tCell *= 1.0e9;
1302  tCell-=fConstantTimeShift;
1303 
1304  // consider cells with enough energy weight and not the reference one
1305  Float_t weight = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(eCell, energy);
1306 
1307  if( absId == absIdMax || weight < 0.01 ) continue;
1308 
1309  if(eCellMax < eCell) printf("Check!!! E max %f (id %d), E sec %f (id %d)\n",eCellMax,absIdMax, eCell,absId);
1310 
1311  nCellWithWeight++;
1312 
1313  Int_t rowDiff = -100, colDiff = -100;
1314  Bool_t sameTCard = GetCaloUtils()->IsAbsIDsFromTCard(absIdMax,absId,rowDiff,colDiff);
1315 
1316  //printf("\t cell %d, absId %d, E %2.2f, w %2.2f, tcard %d\n", ipos, absId, eCell, weight, sameTCard);
1317 
1318  Int_t indexType = -1;
1319  if ( sameTCard )
1320  {
1321  nCorr++;
1322 
1323  if(TMath::Abs(rowDiff) == 1) nearRow = kTRUE;
1324  if(TMath::Abs(colDiff) == 1) nearCol = kTRUE;
1325 
1326  if ( rowDiff == 0 && colDiff != 0 )
1327  {
1328  if ( nearCol ) indexType = 6;
1329  else indexType = 7;
1330 
1331  sameRow++;
1332  /*printf("\t \t E %2.2f, Same row, diff row %d, col %d\n",eCell,rowDiff,colDiff);*/
1333  }
1334  else if ( rowDiff != 0 && colDiff == 0 )
1335  {
1336  if ( nearRow ) indexType = 8;
1337  else indexType = 9;
1338 
1339  sameCol++;
1340  /*printf("\t \t E %2.2f, Same col, diff row %d, col %d\n",eCell,rowDiff,colDiff);*/
1341  }
1342  else
1343  {
1344  if ( nearRow && nearCol) indexType = 10;
1345  else indexType = 11;
1346 
1347  other++;
1348  /*printf("\t \t E %2.2f, Diff row/col, diff row %d, col %d\n",eCell,rowDiff,colDiff);*/
1349  }
1350  }
1351  else
1352  {
1353  nCorrNo++;
1354 
1355  if ( rowDiff == 0 && colDiff != 0 )
1356  {
1357  if ( nearCol ) indexType = 0;
1358  else indexType = 1;
1359 
1360  }
1361  else if ( rowDiff != 0 && colDiff == 0 )
1362  {
1363  if ( nearRow ) indexType = 2;
1364  else indexType = 3;
1365  }
1366  else
1367  {
1368  if ( nearCol && nearRow ) indexType = 4;
1369  else indexType = 5;
1370  }
1371  }
1372 
1373  if ( rowDiff == 0 && TMath::Abs(colDiff) == 1 )
1374  {
1375  if(sameTCard)
1376  {
1377  eCellSameRowSameTCardNearCol = eCell;
1378  tCellSameRowSameTCardNearCol = tCell;
1379  }
1380  else
1381  {
1382  eCellSameRowDiffTCardNearCol = eCell;
1383  tCellSameRowDiffTCardNearCol = tCell;
1384  }
1385  }
1386 
1387  if( indexType >=0 )
1388  {
1389  Float_t eCellDiff = eCellMax - eCell;
1390  Float_t eClusDiff = energy - eCell;
1391  Float_t eCellRat = eCell / eCellMax;
1392  Float_t eClusRat = eCell / energy ;
1393  Float_t tCellDiff = tCellMax - tCell;
1394 
1395  fhTCardCorrECellMaxDiff[indexType][matched]->Fill(energy, eCellDiff, GetEventWeight());
1396  fhTCardCorrEClusterDiff[indexType][matched]->Fill(energy, eClusDiff, GetEventWeight());
1397  fhTCardCorrECellMaxRat [indexType][matched]->Fill(energy, eCellRat , GetEventWeight());
1398  fhTCardCorrEClusterRat [indexType][matched]->Fill(energy, eClusRat , GetEventWeight());
1399  fhTCardCorrTCellMaxDiff[indexType][matched]->Fill(energy, tCellDiff, GetEventWeight());
1400 
1401  if(exoticity > 0.97)
1402  {
1403  fhTCardCorrECellMaxDiffExo[indexType][matched]->Fill(energy, eCellDiff, GetEventWeight());
1404  fhTCardCorrEClusterDiffExo[indexType][matched]->Fill(energy, eClusDiff, GetEventWeight());
1405  fhTCardCorrECellMaxRatExo [indexType][matched]->Fill(energy, eCellRat , GetEventWeight());
1406  fhTCardCorrEClusterRatExo [indexType][matched]->Fill(energy, eClusRat , GetEventWeight());
1407  fhTCardCorrTCellMaxDiffExo[indexType][matched]->Fill(energy, tCellDiff, GetEventWeight());
1408  }
1409  }
1410 
1411 // if ( eCell > emax )
1412 // {
1413 // emax = eCell;
1414 // //absId2ndMax = absId;
1415 // if(sameTCard)
1416 // {
1417 // sameTCard2ndMax = kTRUE;
1418 // rowDiff2 = rowDiff;
1419 // colDiff2 = colDiff;
1420 // }
1421 // else
1422 // {
1423 // sameTCard2ndMax = kFALSE;
1424 // rowDiff2 = -100;
1425 // colDiff2 = -100;
1426 // }
1427 // }
1428 
1429  //
1430  // Other TCard correlations
1431  //
1432  if ( sameTCard ) continue;
1433 
1434  for (Int_t ipos2 = 0; ipos2 < ncells; ipos2++)
1435  {
1436  Int_t absId2 = clus->GetCellsAbsId()[ipos2];
1437 
1438  eCell = cells->GetCellAmplitude(absId2);
1439  // consider cells with enough energy weight and not the reference one
1440  weight = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(eCell, energy);
1441 
1442  if( absId2 == absIdMax || absId2 == absId || weight < 0.01 ) continue;
1443 
1444  rowDiff = -100, colDiff = -100;
1445  Bool_t sameTCard2 = GetCaloUtils()->IsAbsIDsFromTCard(absId,absId2,rowDiff,colDiff);
1446 
1447  if(sameTCard2)
1448  {
1449  nCorr2++;
1450  if ( rowDiff == 0 && colDiff != 0 ) sameRow2++;
1451  else if ( rowDiff != 0 && colDiff == 0 ) sameCol2++;
1452  else other2++;
1453  }
1454  //printf("\t cell %d, absId %d, E %2.2f, w %2.2f, tcard %d\n", ipos, absId, eCell, weight, sameTCard);
1455  } // second cluster cell lopp for secondary TCard correlations
1456  } // cluster cell loop
1457 
1458  Float_t ratioNcells = nCellWithWeight/(ncells*1.);
1459  fhNCellsTCardCorrRatioWithWeightNoSelection[matched]->Fill(energy, ratioNcells, GetEventWeight());
1460  //printf("E %2.2f, ncells %d, nCellWithWeight %d, ratio %2.2f\n",energy,ncells,nCellWithWeight,ratioNcells);
1461 
1462  // If only one relevant cell, it makes no sense to continue
1463  if ( nCellWithWeight <= 1 ) return;
1464 
1465  //printf("\t Same col %d, same row %d, diff other %d\n",sameCol,sameRow,other);
1466  //printf("\t Second cell: E %2.2f, absId %d, correl %d, rowDiff %d, rowCol %d\n",emax,absId2ndMax,sameTCard2,rowDiff2, colDiff2);
1467 
1468  //
1469  // Fill histograms for different cell correlation criteria
1470  //
1471  if(energy >= 2 && energy < 8)
1472  fhColRowTCardCorrNoSelectionLowE[matched]->Fill(icolAbs,irowAbs,GetEventWeight()) ;
1473  else if(energy >= 8)
1474  fhColRowTCardCorrNoSelectionHighE[matched]->Fill(icolAbs,irowAbs,GetEventWeight()) ;
1475 
1476  fhLambda0TCardCorrNoSelection[matched]->Fill(energy, m02, GetEventWeight());
1477  fhLambda1TCardCorrNoSelection[matched]->Fill(energy, m20, GetEventWeight());
1478  fhLambdaRTCardCorrNoSelection[matched]->Fill(energy, m20/m02, GetEventWeight());
1479  fhExoticTCardCorrNoSelection [matched]->Fill(energy, exoticity, GetEventWeight());
1480 
1481  fhNCellsTCardCorrNoSelection [matched]->Fill(energy, ncells, GetEventWeight());
1482  fhNCellsTCardCorrWithWeightNoSelection[matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1483 
1484  if(eCellSameRowSameTCardNearCol > 0 && eCellSameRowDiffTCardNearCol > 0)
1485  {
1486  Float_t eDiff = eCellSameRowSameTCardNearCol - eCellSameRowDiffTCardNearCol ;
1487  Float_t tDiff = tCellSameRowSameTCardNearCol - tCellSameRowDiffTCardNearCol ;
1488 
1489  fhSameRowDiffColAndTCardCellsEnergyDiffClusterE[matched]->Fill(energy , eDiff, GetEventWeight());
1490  fhSameRowDiffColAndTCardCellsTimeDiffClusterE [matched]->Fill(energy , tDiff, GetEventWeight());
1491  fhSameRowDiffColAndTCardCellsEnergyDiffCellMaxE[matched]->Fill(eCellMax, eDiff, GetEventWeight());
1492  fhSameRowDiffColAndTCardCellsTimeDiffCellMaxE [matched]->Fill(eCellMax, tDiff, GetEventWeight());
1493 
1494  if(exoticity > 0.97)
1495  {
1496  fhSameRowDiffColAndTCardCellsEnergyDiffClusterEExo[matched]->Fill(energy , eDiff, GetEventWeight());
1497  fhSameRowDiffColAndTCardCellsTimeDiffClusterEExo [matched]->Fill(energy , tDiff, GetEventWeight());
1498  fhSameRowDiffColAndTCardCellsEnergyDiffCellMaxEExo[matched]->Fill(eCellMax, eDiff, GetEventWeight());
1499  fhSameRowDiffColAndTCardCellsTimeDiffCellMaxEExo [matched]->Fill(eCellMax, tDiff, GetEventWeight());
1500  }
1501  }
1502 
1504  Int_t nCorrInd = nCorr;
1505  if(nCorr > 4) nCorrInd = 5;
1506 
1507  Int_t nCorrNoInd = nCorrNo;
1508  if(nCorrNoInd > 4) nCorrNoInd = 5;
1509 
1510  fhLambda0TCardCorrelN[nCorrInd][matched]->Fill(energy, m02, GetEventWeight());
1511  fhNCellsTCardCorrelN [nCorrInd][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1512  fhExoticTCardCorrelN [nCorrInd][matched]->Fill(energy, exoticity, GetEventWeight());
1513  if ( energy >= 2 && energy < 8 )
1514  fhColRowTCardCorrelNLowE[nCorrInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1515  if ( energy >= 8 )
1516  fhColRowTCardCorrelNHighE[nCorrInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1517 
1518  fhLambda0TCardCorrelNCell[nCorrInd][nCorrNoInd][matched]->Fill(energy, m02, GetEventWeight());
1519  fhLambda1TCardCorrelNCell[nCorrInd][nCorrNoInd][matched]->Fill(energy, m20, GetEventWeight());
1520  fhLambdaRTCardCorrelNCell[nCorrInd][nCorrNoInd][matched]->Fill(energy, m20/m02, GetEventWeight());
1521  fhExoticTCardCorrelNCell [nCorrInd][nCorrNoInd][matched]->Fill(energy, exoticity, GetEventWeight());
1522 
1523  if ( energy >= 2 && energy < 8)
1524  fhColRowTCardCorrelNCellLowE [nCorrInd][nCorrNoInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1525  else if ( energy >= 8 )
1526  fhColRowTCardCorrelNCellHighE[nCorrInd][nCorrNoInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1527 
1528  if(nCorrNo == 0)
1529  {
1530  fhLambda0TCardCorrelNAllSameTCard[nCorrInd][matched]->Fill(energy, m02, GetEventWeight());
1531  fhNCellsTCardCorrelNAllSameTCard [nCorrInd][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1532  fhExoticTCardCorrelNAllSameTCard [nCorrInd][matched]->Fill(energy, exoticity, GetEventWeight());
1533  if ( energy >= 2 && energy < 8 )
1534  fhColRowTCardCorrelNAllSameTCardLowE[nCorrInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1535  else if ( energy >= 8 )
1536  fhColRowTCardCorrelNAllSameTCardHighE[nCorrInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1537  }
1539 
1540  if ( exoticity > 0.97 )
1541  {
1542  fhLambda0TCardCorrelNExotic[nCorrInd][matched]->Fill(energy, m02, GetEventWeight());
1543  fhNCellsTCardCorrelNExotic [nCorrInd][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1544 
1545  if ( energy > 2 )
1546  fhColRowTCardCorrelNLowEExotic [nCorrInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1547  if ( energy > 8 )
1548  fhColRowTCardCorrelNHighEExotic[nCorrInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1549 
1550  if(nCorrNo == 0)
1551  {
1552  fhLambda0TCardCorrelNAllSameTCardExotic[nCorrInd][matched]->Fill(energy, m02, GetEventWeight());
1553  fhNCellsTCardCorrelNAllSameTCardExotic [nCorrInd][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1554 
1555  if ( energy > 2 )
1556  fhColRowTCardCorrelNAllSameTCardLowEExotic [nCorrInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1557  if ( energy > 8 )
1558  fhColRowTCardCorrelNAllSameTCardHighEExotic[nCorrInd][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1559  }
1560 
1561  Int_t indexExo = -1;
1562  if (!nearRow && nearCol ) indexExo = 0;
1563  else if (!nearRow && !nearCol ) indexExo = 1;
1564  else if ( nearRow && nearCol ) indexExo = 2;
1565  else if ( nearRow && !nearCol ) indexExo = 3;
1566 
1567  if(indexExo >= 0)
1568  {
1569  fhLambda0TCardCorrelExotic[indexExo][matched]->Fill(energy, m02, GetEventWeight());
1570  fhNCellsTCardCorrelExotic [indexExo][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1571  }
1572  }
1573 
1574  for(Int_t ie = 0; ie < fNEBinCuts; ie++)
1575  {
1576  if( energy >= fEBinCuts[ie] && energy < fEBinCuts[ie+1] )
1577  {
1578  fhLambda0Exoticity[ie][matched]->Fill(exoticity, m02, GetEventWeight());
1579  fhLambda1Exoticity[ie][matched]->Fill(exoticity, m20, GetEventWeight());
1580  fhLambdaRExoticity[ie][matched]->Fill(exoticity, m20/m02, GetEventWeight());
1581  fhNCellsExoticity [ie][matched]->Fill(exoticity, nCellWithWeight, GetEventWeight());
1582  fhLambda0Lambda1 [ie][matched]->Fill(m20, m02, GetEventWeight());
1583 
1584  if(energy > 8)
1585  {
1586  fhLambda0ExoticityPerNCell[nCorrInd][nCorrNoInd][matched]->Fill(exoticity, m02, GetEventWeight());
1587  fhLambda1ExoticityPerNCell[nCorrInd][nCorrNoInd][matched]->Fill(exoticity, m20, GetEventWeight());
1588  fhLambdaRExoticityPerNCell[nCorrInd][nCorrNoInd][matched]->Fill(exoticity, m20/m02, GetEventWeight());
1589  }
1590 
1591  if(nCorrNo == 0)
1592  {
1593  fhLambda0ExoticityAllSameTCard[ie][matched]->Fill(exoticity, m02, GetEventWeight());
1594  fhLambda1ExoticityAllSameTCard[ie][matched]->Fill(exoticity, m20, GetEventWeight());
1595  fhLambdaRExoticityAllSameTCard[ie][matched]->Fill(exoticity, m20/m02, GetEventWeight());
1596  fhNCellsExoticityAllSameTCard [ie][matched]->Fill(exoticity, nCellWithWeight, GetEventWeight());
1597  fhLambda0Lambda1AllSameTCard [ie][matched]->Fill(m20, m02, GetEventWeight());
1598  }
1599 
1600  fhNCellsTCardSameAndDiff[ie][matched]->Fill(nCorrNo, nCorr, GetEventWeight());
1601  if(exoticity > 0.97 )
1602  fhNCellsTCardSameAndDiffExotic[ie][matched]->Fill(nCorrNo, nCorr, GetEventWeight());
1603  }
1604 
1605  // Track matching residuals
1606  Float_t deta = clus->GetTrackDz();
1607  Float_t dphi = clus->GetTrackDx();
1608  fhTMPhiResidualExoticity[ie]->Fill(exoticity,dphi);
1609  fhTMEtaResidualExoticity[ie]->Fill(exoticity,deta);
1610  if(nCorrNo==0)
1611  {
1612  fhTMPhiResidualExoticityAllSameTCard[ie]->Fill(exoticity,dphi);
1613  fhTMEtaResidualExoticityAllSameTCard[ie]->Fill(exoticity,deta);
1614  }
1615  }
1616 
1617  fhNCellsTCardSameAndDiffFraction[matched]->Fill(energy, nCorr*1. / (nCorr+nCorrNo), GetEventWeight());
1618  if(exoticity > 0.97 )
1619  fhNCellsTCardSameAndDiffFractionExotic[matched]->Fill(energy, nCorr*1. / (nCorr+nCorrNo), GetEventWeight());
1620 
1621  if(nCorr > 0)
1622  {
1623  Int_t index = -1;
1624  if (!sameRow && sameCol && !other ) index = 0;
1625  else if (!sameRow && !sameCol && other ) index = 1;
1626  else if (!sameRow && sameCol && other ) index = 2;
1627  else if ( sameRow && sameCol && !other ) index = 3;
1628  else if ( sameRow && !sameCol && other ) index = 4;
1629  else if ( sameRow && sameCol && other ) index = 5;
1630  else if ( sameRow && !sameCol && !other ) index = 6;
1631  else printf("case not considered!!!: sameRow %d, sameCol %d, other %d, nearRow %d\n",sameRow,sameCol,other,nearRow);
1632 
1633  if(index >= 0)
1634  {
1635  fhLambda0TCardCorrel[index][matched]->Fill(energy, m02, GetEventWeight());
1636  fhNCellsTCardCorrel [index][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1637  fhExoticTCardCorrel [index][matched]->Fill(energy, exoticity, GetEventWeight());
1638  }
1639 
1640  // Comment out, no special effect observed
1641 // Int_t indexNR = -1;
1642 // if ( nearRow )
1643 // {
1644 // if (!sameRow && sameCol && !other ) indexNR = 0;
1645 // else if (!sameRow && !sameCol && other ) indexNR = 1;
1646 // else if (!sameRow && sameCol && other ) indexNR = 2;
1647 // else if ( sameRow && sameCol && !other ) indexNR = 3;
1648 // else if ( sameRow && !sameCol && other ) indexNR = 4;
1649 // else if ( sameRow && sameCol && other ) indexNR = 5;
1650 // else printf("\t near row case not considered!!!: sameRow %d, sameCol %d, other %d\n",sameRow,sameCol,other);
1651 // }
1652 //
1653 // if ( indexNR >= 0 )
1654 // {
1655 // fhLambda0TCardCorrelNearRow[indexNR][matched]->Fill(energy, m02, GetEventWeight());
1656 // fhNCellsTCardCorrelNearRow [indexNR][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1657 // }
1658 //
1659 // if ( sameTCard2ndMax )
1660 // {
1661 // Int_t index2nd = -1;
1662 // if ( TMath::Abs(rowDiff2) == 1 && TMath::Abs(colDiff2) != 1 ) index2nd = 0;
1663 // else if( TMath::Abs(rowDiff2) != 1 && TMath::Abs(colDiff2) == 1 ) index2nd = 1;
1664 // else if( TMath::Abs(rowDiff2) == 1 && TMath::Abs(colDiff2) == 1 ) index2nd = 2;
1665 // else index2nd = 3;
1666 //
1667 // fhLambda0TCardCorrel2ndMax[index2nd][matched]->Fill(energy, m02, GetEventWeight());
1668 // fhNCellsTCardCorrel2ndMax [index2nd][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1669 // }
1670  }
1671 
1672  Int_t indexOtherTCard = -1;
1673  if ( nCorr == 0 && nCorr2 == 0 ) indexOtherTCard = 6;
1674  else if ( nCorr == 0 && nCorr2 > 0 )
1675  {
1676  if ( sameRow2 && !sameCol2 && !other2) indexOtherTCard = 0;
1677  else if ( !sameRow2 && sameCol2 && !other2) indexOtherTCard = 1;
1678  else indexOtherTCard = 2;
1679  }
1680  else if ( nCorr > 0 && nCorr2 > 0 )
1681  {
1682  if ( sameRow2 && !sameCol2 && !other2) indexOtherTCard = 3;
1683  else if ( !sameRow2 && sameCol2 && !other2) indexOtherTCard = 4;
1684  else indexOtherTCard = 5;
1685  }
1686 
1687  if ( indexOtherTCard >= 0 )
1688  {
1689  fhLambda0TCardCorrelOtherTCard[indexOtherTCard][matched]->Fill(energy, m02, GetEventWeight());
1690  fhNCellsTCardCorrelOtherTCard [indexOtherTCard][matched]->Fill(energy, nCellWithWeight, GetEventWeight());
1691  fhExoticTCardCorrelOtherTCard [indexOtherTCard][matched]->Fill(energy, exoticity, GetEventWeight());
1692  if ( energy >= 2 && energy < 8 )
1693  fhColRowTCardCorrelOtherTCardLowE[indexOtherTCard][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1694  else if ( energy >= 8 )
1695  fhColRowTCardCorrelOtherTCardHighE[indexOtherTCard][matched]->Fill(icolAbs, irowAbs, GetEventWeight());
1696  }
1697 }
1698 
1699 
1700 //_____________________________________________________________________________________
1701 // Study the shape of the cluster in cell units terms.
1702 //_____________________________________________________________________________________
1704  Bool_t goodCluster)
1705 {
1706  // No use to study clusters with less than 4 cells
1707  if( clus->GetNCells() <= 3 ) return;
1708 
1709  Int_t dIeta = 0;
1710  Int_t dIphi = 0;
1711 
1712  Int_t ietaMax=-1; Int_t iphiMax = 0; Int_t rcuMax = 0;
1713  Int_t smMax = GetModuleNumberCellIndexes(absIdMax,GetCalorimeter(), ietaMax, iphiMax, rcuMax);
1714 
1715  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
1716  {
1717  Int_t absId = clus->GetCellsAbsId()[ipos];
1718 
1719  Int_t ieta=-1; Int_t iphi = 0; Int_t rcu = 0;
1720  Int_t sm = GetModuleNumberCellIndexes(absId,GetCalorimeter(), ieta, iphi, rcu);
1721 
1722  if(dIphi < TMath::Abs(iphi-iphiMax)) dIphi = TMath::Abs(iphi-iphiMax);
1723 
1724  if(smMax==sm)
1725  {
1726  if(dIeta < TMath::Abs(ieta-ietaMax)) dIeta = TMath::Abs(ieta-ietaMax);
1727  }
1728  else
1729  {
1730  Int_t ietaShift = ieta;
1731  Int_t ietaMaxShift = ietaMax;
1732  if (ieta > ietaMax) ietaMaxShift+=48;
1733  else ietaShift +=48;
1734  if(dIeta < TMath::Abs(ietaShift-ietaMaxShift)) dIeta = TMath::Abs(ietaShift-ietaMaxShift);
1735  }
1736  }// Fill cell-cluster histogram loop
1737 
1738  Float_t dIA = 1.*(dIphi-dIeta)/(dIeta+dIphi);
1739 
1740  if(goodCluster)
1741  {
1742  // Was cluster matched?
1743  Bool_t matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(),GetReader()->GetInputEvent());
1744 
1745  if (clus->E() < 2 ) fhDeltaIEtaDeltaIPhiE0[matched]->Fill(dIeta, dIphi, GetEventWeight());
1746  else if(clus->E() < 6 ) fhDeltaIEtaDeltaIPhiE2[matched]->Fill(dIeta, dIphi, GetEventWeight());
1747  else fhDeltaIEtaDeltaIPhiE6[matched]->Fill(dIeta, dIphi, GetEventWeight());
1748 
1749  fhDeltaIA[matched]->Fill(clus->E(), dIA, GetEventWeight());
1750 
1751  if(clus->E() > 0.5)
1752  {
1753  fhDeltaIAL0 [matched]->Fill(clus->GetM02() , dIA, GetEventWeight());
1754  fhDeltaIAL1 [matched]->Fill(clus->GetM20() , dIA, GetEventWeight());
1755  fhDeltaIANCells[matched]->Fill(clus->GetNCells(), dIA, GetEventWeight());
1756  }
1757 
1758  // Origin of clusters
1759  Int_t nLabel = clus->GetNLabels();
1760  Int_t* labels = clus->GetLabels();
1761 
1762  if(IsDataMC())
1763  {
1764  Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabel, GetReader(),GetCalorimeter());
1765  if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
1766  !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
1767  !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
1768  !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
1769  fhDeltaIAMC[0]->Fill(clus->E(), dIA, GetEventWeight()); // Pure Photon
1770  }
1773  fhDeltaIAMC[1]->Fill(clus->E(), dIA, GetEventWeight()); // Pure electron
1774  }
1777  fhDeltaIAMC[2]->Fill(clus->E(), dIA, GetEventWeight()); // Converted cluster
1778  }
1780  fhDeltaIAMC[3]->Fill(clus->E(), dIA, GetEventWeight()); // Hadrons
1781  }
1782 
1783  } // MC
1784  } // good cluster
1785  else
1786  {
1787  if (clus->E() < 2 ) fhBadClusterDeltaIEtaDeltaIPhiE0->Fill(dIeta, dIphi, GetEventWeight());
1788  else if(clus->E() < 6 ) fhBadClusterDeltaIEtaDeltaIPhiE2->Fill(dIeta, dIphi, GetEventWeight());
1789  else fhBadClusterDeltaIEtaDeltaIPhiE6->Fill(dIeta, dIphi, GetEventWeight());
1790 
1791  fhBadClusterDeltaIA->Fill(clus->E(), dIA, GetEventWeight());
1792  }
1793 }
1794 
1795 //__________________________________________________________________________________________________________________
1804 //__________________________________________________________________________________________________________________
1805 void AliAnaCalorimeterQA::ClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
1806  Int_t absIdMax, Double_t maxCellFraction, Float_t eCrossFrac,
1807  Double_t tmax)
1808 {
1809  Double_t tof = clus->GetTOF()*1.e9;
1810  if(tof>400) tof-=fConstantTimeShift;
1811 
1812  fhLambda0 ->Fill(clus->E(), clus->GetM02() , GetEventWeight());
1813  fhLambda1 ->Fill(clus->E(), clus->GetM20() , GetEventWeight());
1814  // fhDispersion ->Fill(clus->E(), clus->GetDispersion(), GetEventWeight());
1815 
1816  fhClusterMaxCellDiff ->Fill(clus->E(), maxCellFraction, GetEventWeight());
1817  fhClusterMaxCellECross->Fill(clus->E(), eCrossFrac , GetEventWeight());
1818  fhClusterTimeEnergy ->Fill(clus->E(), tof , GetEventWeight());
1819 
1821  {
1822  fhClusterMaxCellDiffM02 ->Fill(clus->E(), maxCellFraction, clus->GetM02(), GetEventWeight());
1823  fhClusterMaxCellECrossM02->Fill(clus->E(), eCrossFrac , clus->GetM02(), GetEventWeight());
1824  fhClusterTimeEnergyM02 ->Fill(clus->E(), tof , clus->GetM02(), GetEventWeight());
1825  }
1826 
1827  if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kTRUE);
1828 
1829  Int_t nModule = GetModuleNumber(clus);
1830  Int_t nCaloCellsPerCluster = clus->GetNCells();
1831 
1832  // Clusters in event time difference
1833  for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ )
1834  {
1835  AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
1836 
1837  if( clus->GetID() == clus2->GetID() ) continue;
1838 
1839  if( clus->GetM02() > 0.01 && clus2->GetM02() > 0.01 )
1840  {
1841  Int_t nModule2 = GetModuleNumber(clus2);
1842 
1843  Double_t tof2 = clus2->GetTOF()*1.e9;
1844  if(tof2>400) tof2-=fConstantTimeShift;
1845 
1846  fhClusterPairDiffTimeE ->Fill(clus->E(), tof-tof2, GetEventWeight());
1847 
1848  if ( nModule2 == nModule )
1849  fhClusterPairDiffTimeESameMod->Fill(clus->E(), tof-tof2, GetEventWeight());
1850  }
1851  }
1852 
1853  if(nCaloCellsPerCluster > 1)
1854  {
1855  // Check time of cells respect to max energy cell
1856 
1857 // if(fFillAllCellTimeHisto)
1858 // {
1859 // // Get some time averages
1860 // Double_t timeAverages[2] = {0.,0.};
1861 // CalculateAverageTime(clus, cells, timeAverages);
1862 //
1863 // fhClusterMaxCellDiffAverageTime ->Fill(clus->E(), tmax-timeAverages[0], GetEventWeight());
1864 // fhClusterMaxCellDiffWeightedTime ->Fill(clus->E(), tmax-timeAverages[1], GetEventWeight());
1865 // }
1866 
1867  for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
1868  {
1869  Int_t absId = clus->GetCellsAbsId()[ipos];
1870  if( absId == absIdMax || cells->GetCellAmplitude(absIdMax) < 0.01 ) continue;
1871 
1872  Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
1873  fhClusterMaxCellCloseCellRatio->Fill(clus->E(), frac, GetEventWeight());
1874  fhClusterMaxCellCloseCellDiff ->Fill(clus->E(), cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId), GetEventWeight());
1875 
1877  {
1878  fhClusterMaxCellCloseCellRatioM02->Fill(clus->E(), frac, clus->GetM02(), GetEventWeight());
1879  fhClusterMaxCellCloseCellDiffM02 ->Fill(clus->E(), cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId), clus->GetM02(),GetEventWeight());
1880  }
1881 
1883  {
1884  Double_t time = cells->GetCellTime(absId);
1885  GetCaloUtils()->RecalibrateCellTime(time, GetCalorimeter(), absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
1886 
1887  Float_t diff = (tmax-(time*1.0e9-fConstantTimeShift));
1888  fhCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff, GetEventWeight());
1889  if(fStudyM02Dependence)
1890  fhCellTimeSpreadRespectToCellMaxM02->Fill(clus->E(), diff, clus->GetM02(), GetEventWeight());
1891 
1892  if(TMath::Abs(TMath::Abs(diff) > 100) && clus->E() > 1 ) fhCellIdCellLargeTimeSpread->Fill(absId, GetEventWeight());
1893  }
1894 
1895  } // Fill cell-cluster histogram loop
1896 
1897  } // Check time and energy of cells respect to max energy cell if cluster of more than 1 cell
1898 
1899  Float_t e = fClusterMomentum.E();
1900  Float_t pt = fClusterMomentum.Pt();
1901  Float_t eta = fClusterMomentum.Eta();
1902  Float_t phi = GetPhi(fClusterMomentum.Phi());
1903 
1904  AliDebug(1,Form("cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f",e,pt,eta,phi*TMath::RadToDeg()));
1905 
1906  fhE ->Fill(e, GetEventWeight());
1907  if(nModule >=0 && nModule < fNModules)
1908  {
1909  fhEMod ->Fill(e, nModule, GetEventWeight());
1910  fhEWeirdMod->Fill(e, nModule, GetEventWeight()); // different binning
1911  }
1912 
1913  fhPt ->Fill(pt , GetEventWeight());
1914  fhPhi ->Fill(phi, GetEventWeight());
1915  fhEta ->Fill(eta, GetEventWeight());
1916 
1918  {
1919  Int_t icol = -1, irow = -1, iRCU = -1, icolAbs = -1, irowAbs = -1;
1920  GetModuleNumberCellIndexesAbsCaloMap(absIdMax,GetCalorimeter(), icol, irow, iRCU, icolAbs, irowAbs);
1921 
1922  for(Int_t ie = 0; ie < fNEBinCuts; ie++)
1923  {
1924  if( e >= fEBinCuts[ie] && e < fEBinCuts[ie+1] )
1925  {
1926  fhEBinClusterEtaPhi[ie]->Fill(eta,phi,GetEventWeight()) ;
1927 
1928  fhEBinClusterColRow[ie]->Fill(icolAbs,irowAbs,GetEventWeight()) ;
1929  }
1930  }
1931  }
1932  else if ( fFillAllTH3 ) fhEtaPhiE->Fill(eta, phi, e, GetEventWeight());
1933  else if ( e > 0.5 ) fhEtaPhi ->Fill(eta, phi, GetEventWeight());
1934 
1935  // Cells per cluster
1936  fhNCellsPerCluster->Fill(e, nCaloCellsPerCluster, GetEventWeight());
1937 
1939  fhNCellsPerClusterM02->Fill(e, nCaloCellsPerCluster, clus->GetM02(),GetEventWeight());
1940 
1941  if(e > 100)
1942  fhNCellsPerClusterWeirdMod->Fill(nCaloCellsPerCluster, nModule, GetEventWeight());
1943 
1944  // Position
1945  if(fFillAllPosHisto2)
1946  {
1947  Float_t pos[3] ;
1948  clus->GetPosition(pos);
1949 
1950  fhXE ->Fill(pos[0], e, GetEventWeight());
1951  fhYE ->Fill(pos[1], e, GetEventWeight());
1952  fhZE ->Fill(pos[2], e, GetEventWeight());
1953 
1954  fhXYZ ->Fill(pos[0], pos[1], pos[2], GetEventWeight());
1955 
1956  fhXNCells->Fill(pos[0], nCaloCellsPerCluster, GetEventWeight());
1957  fhYNCells->Fill(pos[1], nCaloCellsPerCluster, GetEventWeight());
1958  fhZNCells->Fill(pos[2], nCaloCellsPerCluster, GetEventWeight());
1959 
1960  Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
1961 
1962  fhRE ->Fill(rxyz, e , GetEventWeight());
1963  fhRNCells->Fill(rxyz, nCaloCellsPerCluster, GetEventWeight());
1964  }
1965 
1966  if( nModule >= 0 && nModule < fNModules ) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster, GetEventWeight());
1967 }
1968 
1969 //____________________________________________________________________________
1981 //____________________________________________________________________________
1983  AliVCaloCells* cells)
1984 {
1985  Int_t nLabel = 0 ;
1986  Int_t *labels = 0x0;
1987  Int_t nCaloClusters = caloClusters->GetEntriesFast() ;
1988  Int_t nCaloClustersAccepted = 0 ;
1989  Int_t nCaloCellsPerCluster = 0 ;
1990  Bool_t matched = kFALSE;
1991  Int_t nModule =-1 ;
1992 
1993  // Get vertex for photon momentum calculation and event selection
1994  Double_t v[3] = {0,0,0}; //vertex ;
1995 //GetReader()->GetVertex(v);
1996 
1997  Int_t *nClustersInModule = new Int_t [fNModules];
1998  Float_t *energyInModule = new Float_t[fNModules];
1999  for(Int_t imod = 0; imod < fNModules; imod++ )
2000  {
2001  nClustersInModule[imod] = 0;
2002  energyInModule [imod] = 0;
2003  }
2004 
2005  AliDebug(1,Form("In %s there are %d clusters", GetCalorimeterString().Data(), nCaloClusters));
2006 
2007  // Loop over CaloClusters
2008  for(Int_t iclus = 0; iclus < nCaloClusters; iclus++)
2009  {
2010  AliDebug(1,Form("Cluster: %d/%d, data %d",iclus+1,nCaloClusters,GetReader()->GetDataType()));
2011 
2012  AliVCluster* clus = (AliVCluster*) caloClusters->At(iclus);
2013 
2014  // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
2015  Float_t maxCellFraction = 0.;
2016  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus,maxCellFraction);
2017 
2018  // Cut on time of clusters
2019  Double_t tof = clus->GetTOF()*1.e9;
2020  if(tof>400) tof-=fConstantTimeShift;
2021 
2022  if( tof < fTimeCutMin || tof > fTimeCutMax )
2023  {
2024  AliDebug(1,Form("Remove cluster with TOF %f",tof));
2025  continue;
2026  }
2027 
2028  // Get cluster kinematics
2029  clus->GetMomentum(fClusterMomentum,v);
2030 
2031  // Check only certain regions
2032  Bool_t in = kTRUE;
2034  if(!in) continue;
2035 
2036  // MC labels
2037  nLabel = clus->GetNLabels();
2038  labels = clus->GetLabels();
2039 
2040  // SuperModule number of cluster
2041  nModule = GetModuleNumber(clus);
2042 
2043  // Cells per cluster
2044  nCaloCellsPerCluster = clus->GetNCells();
2045 
2046  // Cluster mathed with track?
2047  matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(), GetReader()->GetInputEvent());
2048 
2049  // Get time of max cell
2050  Double_t tmax = cells->GetCellTime(absIdMax);
2051  GetCaloUtils()->RecalibrateCellTime(tmax, GetCalorimeter(), absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2052  tmax*=1.e9;
2053  tmax-=fConstantTimeShift;
2054  //
2055  // Fill histograms related to single cluster
2056  //
2057 
2058  // Fill some histograms before applying the exotic cell / bad map cut
2059  if(fStudyBadClusters)
2060  {
2061  fhNCellsPerClusterNoCut->Fill(clus->E(), nCaloCellsPerCluster, GetEventWeight());
2062 
2063  if(nModule >=0 && nModule < fNModules)
2064  {
2065  fhNCellsPerClusterModNoCut[nModule]->Fill(clus->E(), nCaloCellsPerCluster, GetEventWeight());
2066  if(clus->E() > 100) fhNCellsPerClusterWeirdModNoCut->Fill(nCaloCellsPerCluster, nModule, GetEventWeight());
2067  }
2068 
2069  fhClusterMaxCellDiffNoCut->Fill(clus->E(), maxCellFraction, GetEventWeight());
2070  }
2071 
2072  Float_t ampMax = cells->GetCellAmplitude(absIdMax);
2073  GetCaloUtils()->RecalibrateCellAmplitude(ampMax,GetCalorimeter(), absIdMax);
2074 
2075  if(fStudyExotic) ExoticHistograms(absIdMax, ampMax, clus, cells);
2076 
2077  // Check bad clusters if requested and rejection was not on
2078  Bool_t goodCluster = IsGoodCluster(absIdMax, clus->GetM02(), nCaloCellsPerCluster, cells);
2079 
2080  Float_t eCrossFrac = 0;
2081  if(ampMax > 0.01) eCrossFrac = 1-GetECross(absIdMax,cells)/ampMax;
2082 
2083  AliDebug(1,Form("Accept cluster? %d",goodCluster));
2084 
2085  if(!goodCluster)
2086  {
2087  if ( fStudyBadClusters ) BadClusterHistograms(clus, caloClusters,
2088  cells, absIdMax,
2089  maxCellFraction,
2090  eCrossFrac, tmax);
2091  continue;
2092  }
2093 
2094  //
2095  ClusterHistograms(clus, caloClusters, cells, absIdMax,
2096  maxCellFraction, eCrossFrac, tmax);
2097 
2098  nCaloClustersAccepted++;
2099 
2100  //
2101  if(fStudyFECCorrelation ) ChannelCorrelationInFEC (clus, cells, matched, absIdMax);
2102  if(fStudyTCardCorrelation) ChannelCorrelationInTCard(clus, cells, matched, absIdMax, eCrossFrac);
2103 
2104  //
2105  nModule = GetModuleNumber(clus);
2106  if(nModule >=0 && nModule < fNModules && fClusterMomentum.E() > 2*fCellAmpMin)
2107  {
2108  nClustersInModule[nModule]++;
2109  if(clus->E() > 0.5)
2110  energyInModule [nModule] += clus->E();
2111  }
2112 
2113  // Cluster weights
2114  if(fStudyWeight) WeightHistograms(clus, cells);
2115 
2116  // Cells in cluster position
2118 
2119  // Fill histograms related to single cluster, mc vs data
2120  Int_t mcOK = kFALSE;
2121  Int_t pdg = -1;
2122  if(IsDataMC() && nLabel > 0 && labels)
2123  mcOK = ClusterMCHistograms(matched, labels, nLabel, pdg);
2124 
2125  // Matched clusters with tracks, also do some MC comparison, needs input from ClusterMCHistograms
2126  if( matched && fFillAllTMHisto)
2127  ClusterMatchedWithTrackHistograms(clus,mcOK,pdg);
2128 
2129  // Invariant mass
2130  // Try to reduce background with a mild shower shape cut and no more than 1 maxima
2131  // in cluster and remove low energy clusters
2132 
2133  if ( fFillAllPi0Histo
2134  && nCaloClusters > 1
2135  && nCaloCellsPerCluster > 1
2136  && GetCaloUtils()->GetNumberOfLocalMaxima(clus,cells) == 1
2137  && clus->GetM02() < fInvMassMaxM02Cut
2138  && clus->GetM02() > fInvMassMinM02Cut
2139  && clus->E() > fInvMassMinECut
2140  && clus->E() < fInvMassMaxECut
2141  )
2142  InvariantMassHistograms(iclus, nModule, caloClusters,cells);
2143 
2144  } // Cluster loop
2145 
2146  // Number of clusters histograms
2147  if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted, GetEventWeight());
2148 
2149  // Number of clusters per module
2150  for(Int_t imod = 0; imod < fNModules; imod++ )
2151  {
2152  AliDebug(1,Form("Module %d calo %s clusters %d, sum E %f", imod, GetCalorimeterString().Data(), nClustersInModule[imod], energyInModule[imod]));
2153 
2154  fhNClustersMod ->Fill(nClustersInModule[imod], imod, GetEventWeight());
2155  fhSumClustersEnergyMod->Fill(energyInModule [imod], imod, GetEventWeight());
2156 
2157  fhNClustersSumEnergyPerMod[imod]->Fill(energyInModule[imod], nClustersInModule[imod], GetEventWeight());
2158  }
2159 
2160  delete [] nClustersInModule;
2161  delete [] energyInModule;
2162 }
2163 
2164 //__________________________________________________________________________________
2167 //__________________________________________________________________________________
2169  Int_t nLabels, Int_t & pdg )
2170 {
2171  if(!labels || nLabels<=0)
2172  {
2173  AliWarning(Form("Strange, labels array %p, n labels %d", labels,nLabels));
2174  return kFALSE;
2175  }
2176 
2177  AliDebug(1,Form("Primaries: nlabels %d",nLabels));
2178 
2179  Float_t e = fClusterMomentum.E();
2180  Float_t eta = fClusterMomentum.Eta();
2181  Float_t phi = fClusterMomentum.Phi();
2182  if(phi < 0) phi +=TMath::TwoPi();
2183 
2184  AliAODMCParticle * aodprimary = 0x0;
2185  TParticle * primary = 0x0;
2186 
2187  // Play with the MC stack if available
2188  Int_t label = labels[0];
2189 
2190  if(label < 0)
2191  {
2192  AliDebug(1,Form(" *** bad label ***: label %d", label));
2193  return kFALSE;
2194  }
2195 
2196  Int_t pdg0 =-1; Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
2197  Float_t vxMC = 0; Float_t vyMC = 0;
2198  Float_t eMC = 0; //Float_t ptMC= 0;
2199  Float_t phiMC = 0; Float_t etaMC = 0;
2200  Int_t charge = 0;
2201 
2202  // Check the origin.
2203  Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),GetCalorimeter());
2204 
2205  if ( GetReader()->ReadStack() &&
2206  !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
2207  { // If MC stack and known tag
2208 
2209  if( label >= GetMCStack()->GetNtrack())
2210  {
2211  AliDebug(1,Form("*** large label ***: label %d, n tracks %d", label, GetMCStack()->GetNtrack()));
2212  return kFALSE;
2213  }
2214 
2215  primary = GetMCStack()->Particle(label);
2216  iMother = label;
2217  pdg0 = TMath::Abs(primary->GetPdgCode());
2218  pdg = pdg0;
2219  status = primary->GetStatusCode();
2220  vxMC = primary->Vx();
2221  vyMC = primary->Vy();
2222  iParent = primary->GetFirstMother();
2223 
2224  AliDebug(1,"Cluster most contributing mother:");
2225  AliDebug(1,Form("\t Mother label %d, pdg %d, %s, status %d, parent %d",iMother, pdg0, primary->GetName(),status, iParent));
2226 
2227 
2228  // Get final particle, no conversion products
2229  if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
2230  {
2231  // Get the parent
2232  primary = GetMCStack()->Particle(iParent);
2233  pdg = TMath::Abs(primary->GetPdgCode());
2234 
2235  AliDebug(2,"Converted cluster!. Find before conversion:");
2236 
2237  while((pdg == 22 || pdg == 11) && status != 1)
2238  {
2239  Int_t iMotherOrg = iMother;
2240  iMother = iParent;
2241  primary = GetMCStack()->Particle(iMother);
2242  status = primary->GetStatusCode();
2243  pdg = TMath::Abs(primary->GetPdgCode());
2244  iParent = primary->GetFirstMother();
2245 
2246  // If gone too back and non stable, assign the decay photon/electron
2247  // there are other possible decays, ignore them for the moment
2248  if(pdg==111 || pdg==221)
2249  {
2250  primary = GetMCStack()->Particle(iMotherOrg);
2251  break;
2252  }
2253 
2254  if( iParent < 0 )
2255  {
2256  iParent = iMother;
2257  break;
2258  }
2259 
2260  AliDebug(2,Form("\t pdg %d, index %d, %s, status %d",pdg, iMother, primary->GetName(),status));
2261  }
2262 
2263  AliDebug(1,"Converted Cluster mother before conversion:");
2264  AliDebug(1,Form("\t Mother label %d, pdg %d, %s, status %d, parent %d",iMother, pdg, primary->GetName(), status, iParent));
2265 
2266  }
2267 
2268  // Overlapped pi0 (or eta, there will be very few), get the meson
2269  if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2270  GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
2271  {
2272  AliDebug(2,"Overlapped Meson decay!, Find it:");
2273 
2274  while(pdg != 111 && pdg != 221)
2275  {
2276  //printf("iMother %d, pdg %d, iParent %d, pdg %d\n",iMother,pdg,iParent,GetMCStack()->Particle(iParent)->GetPdgCode());
2277  iMother = iParent;
2278  primary = GetMCStack()->Particle(iMother);
2279  status = primary->GetStatusCode();
2280  pdg = TMath::Abs(primary->GetPdgCode());
2281  iParent = primary->GetFirstMother();
2282 
2283  if( iParent < 0 ) break;
2284 
2285  AliDebug(2,Form("\t pdg %d, %s, index %d",pdg, primary->GetName(),iMother));
2286 
2287  if(iMother==-1)
2288  {
2289  AliWarning("Tagged as Overlapped photon but meson not found, why?");
2290  //break;
2291  }
2292  }
2293 
2294  AliDebug(2,Form("Overlapped %s decay, label %d",primary->GetName(),iMother));
2295  }
2296 
2297  eMC = primary->Energy();
2298  //ptMC = primary->Pt();
2299  phiMC = primary->Phi();
2300  etaMC = primary->Eta();
2301  pdg = TMath::Abs(primary->GetPdgCode());
2302  charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2303 
2304  }
2305  else if( GetReader()->ReadAODMCParticles() &&
2306  !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
2307  {
2308  // If MC AOD and known tag
2309  // Get the list of MC particles
2310  if(!GetReader()->GetAODMCParticles())
2311  AliFatal("MCParticles not available!");
2312 
2313  aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles())->At(label);
2314  iMother = label;
2315  pdg0 = TMath::Abs(aodprimary->GetPdgCode());
2316  pdg = pdg0;
2317  status = aodprimary->IsPrimary();
2318  vxMC = aodprimary->Xv();
2319  vyMC = aodprimary->Yv();
2320  iParent = aodprimary->GetMother();
2321 
2322  AliDebug(1,"Cluster most contributing mother:");
2323  AliDebug(1,Form("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d",
2324  iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent));
2325 
2326  //Get final particle, no conversion products
2327  if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) )
2328  {
2329  AliDebug(2,"Converted cluster!. Find before conversion:");
2330 
2331  // Get the parent
2332  aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles())->At(iParent);
2333  pdg = TMath::Abs(aodprimary->GetPdgCode());
2334 
2335  while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary())
2336  {
2337  Int_t iMotherOrg = iMother;
2338  iMother = iParent;
2339  aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles())->At(iMother);
2340  status = aodprimary->IsPrimary();
2341  iParent = aodprimary->GetMother();
2342  pdg = TMath::Abs(aodprimary->GetPdgCode());
2343 
2344  // If gone too back and non stable, assign the decay photon/electron
2345  // there are other possible decays, ignore them for the moment
2346  if( pdg == 111 || pdg == 221 )
2347  {
2348  aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles())->At(iMotherOrg);
2349  break;
2350  }
2351 
2352  if( iParent < 0 )
2353  {
2354  iParent = iMother;
2355  break;
2356  }
2357 
2358  AliDebug(2,Form("\t pdg %d, index %d, Primary? %d, Physical Primary? %d",
2359  pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary()));
2360  }
2361 
2362  AliDebug(1,"Converted Cluster mother before conversion:");
2363  AliDebug(1,Form("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d",
2364  iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary()));
2365 
2366  }
2367 
2368  //Overlapped pi0 (or eta, there will be very few), get the meson
2369  if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
2370  GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
2371  {
2372  AliDebug(2,Form("Overlapped Meson decay!, Find it: PDG %d, mom %d",pdg, iMother));
2373 
2374  while(pdg != 111 && pdg != 221)
2375  {
2376  iMother = iParent;
2377  aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles())->At(iMother);
2378  status = aodprimary->IsPrimary();
2379  iParent = aodprimary->GetMother();
2380  pdg = TMath::Abs(aodprimary->GetPdgCode());
2381 
2382  if( iParent < 0 ) break;
2383 
2384  AliDebug(2,Form("\t pdg %d, index %d",pdg, iMother));
2385 
2386  if(iMother==-1)
2387  {
2388  AliWarning("Tagged as Overlapped photon but meson not found, why?");
2389  //break;
2390  }
2391  }
2392 
2393  AliDebug(2,Form("Overlapped %s decay, label %d",aodprimary->GetName(),iMother));
2394  }
2395 
2396  status = aodprimary->IsPrimary();
2397  eMC = aodprimary->E();
2398  //ptMC = aodprimary->Pt();
2399  phiMC = aodprimary->Phi();
2400  etaMC = aodprimary->Eta();
2401  pdg = TMath::Abs(aodprimary->GetPdgCode());
2402  charge = aodprimary->Charge();
2403  }
2404 
2405  //Float_t vz = primary->Vz();
2406  Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
2407  if( ( pdg == 22 || TMath::Abs(pdg) == 11 ) && status != 1 )
2408  {
2409  fhEMVxyz ->Fill(vxMC, vyMC, GetEventWeight());//,vz);
2410  fhEMR ->Fill(e , rVMC, GetEventWeight());
2411  }
2412 
2413  //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
2414  //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
2415  //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
2416 
2417  // Overlapped pi0 (or eta, there will be very few)
2418  Int_t mcIndex = -1;
2419  if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0 ) )
2420  {
2421  mcIndex = kmcPi0;
2422  } // Overlapped pizero decay
2423  else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta ) )
2424  {
2425  mcIndex = kmcEta;
2426  } // Overlapped eta decay
2427  else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton ) )
2428  {
2429  if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
2430  mcIndex = kmcPhotonConv ;
2431  else
2432  mcIndex = kmcPhoton ;
2433  } // photon
2434  else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) )
2435  {
2436  mcIndex = kmcElectron;
2437  fhEMVxyz->Fill(vxMC, vyMC, GetEventWeight());//,vz);
2438  fhEMR ->Fill(e , rVMC, GetEventWeight());
2439  }
2440  else if(charge == 0)
2441  {
2442  mcIndex = kmcNeHadron;
2443  fhHaVxyz->Fill(vxMC, vyMC, GetEventWeight());//,vz);
2444  fhHaR ->Fill(e , rVMC, GetEventWeight());
2445  }
2446  else if(charge!=0)
2447  {
2448  mcIndex = kmcChHadron;
2449  fhHaVxyz->Fill(vxMC, vyMC, GetEventWeight());//,vz);
2450  fhHaR ->Fill(e , rVMC, GetEventWeight());
2451  }
2452 
2453  //printf("mc index %d\n",mcIndex);
2454 
2455  if( mcIndex >= 0 && mcIndex < 7 && e > 0.5 && eMC > 0.5)
2456  {
2457  fhRecoMCE [mcIndex][(matched)]->Fill(e , eMC , GetEventWeight());
2458  fhRecoMCEta [mcIndex][(matched)]->Fill(eta, etaMC , GetEventWeight());
2459  fhRecoMCPhi [mcIndex][(matched)]->Fill(phi, phiMC , GetEventWeight());
2460  fhRecoMCRatioE [mcIndex][(matched)]->Fill(e , e/eMC , GetEventWeight());
2461  fhRecoMCDeltaE [mcIndex][(matched)]->Fill(e , eMC-e , GetEventWeight());
2462  fhRecoMCDeltaPhi[mcIndex][(matched)]->Fill(e , phiMC-phi, GetEventWeight());
2463  fhRecoMCDeltaEta[mcIndex][(matched)]->Fill(e , etaMC-eta, GetEventWeight());
2464  }
2465 
2466  if( primary || aodprimary ) return kTRUE ;
2467  else return kFALSE;
2468 }
2469 
2470 //_________________________________________________________________________________________________________
2475 //_________________________________________________________________________________________________________
2477 {
2478  Float_t e = fClusterMomentum.E();
2479  Float_t pt = fClusterMomentum.Pt();
2480  Float_t eta = fClusterMomentum.Eta();
2481  Float_t phi = fClusterMomentum.Phi();
2482  if(phi < 0) phi +=TMath::TwoPi();
2483 
2484  fhECharged ->Fill(e , GetEventWeight());
2485  fhPtCharged ->Fill(pt , GetEventWeight());
2486  fhPhiCharged ->Fill(phi, GetEventWeight());
2487  fhEtaCharged ->Fill(eta, GetEventWeight());
2488 
2489  if ( fFillAllTH3 ) fhEtaPhiECharged->Fill(eta, phi, e, GetEventWeight());
2490  else if ( e > 0.5 ) fhEtaPhiCharged ->Fill(eta, phi, GetEventWeight());
2491 
2492  // Study the track and matched cluster if track exists.
2493 
2494  AliVTrack *track = GetCaloUtils()->GetMatchedTrack(clus, GetReader()->GetInputEvent());
2495 
2496  if(!track) return ;
2497 
2498  Double_t tpt = track->Pt();
2499  Double_t tmom = track->P();
2500  Double_t dedx = track->GetTPCsignal();
2501  Int_t nITS = track->GetNcls(0);
2502  Int_t nTPC = track->GetNcls(1);
2503  Bool_t positive = kFALSE;
2504  if(track) positive = (track->Charge()>0);
2505 
2506  // Residuals
2507  Float_t deta = clus->GetTrackDz();
2508  Float_t dphi = clus->GetTrackDx();
2509  Double_t dR = TMath::Sqrt(dphi*dphi + deta*deta);
2510  Int_t nModule = GetModuleNumber(clus);
2511 
2512  if( TMath::Abs(dphi) < 999 )
2513  {
2514  if(positive)
2515  {
2516  fhTrackMatchedDEtaPos->Fill(e, deta, GetEventWeight());
2517  fhTrackMatchedDPhiPos->Fill(e, dphi, GetEventWeight());
2518 
2519  if(e > 0.5)
2520  {
2521  fhTrackMatchedDEtaPosMod ->Fill(deta, nModule, GetEventWeight());
2522  fhTrackMatchedDPhiPosMod ->Fill(dphi, nModule, GetEventWeight());
2523  fhTrackMatchedDEtaDPhiPos->Fill(deta, dphi , GetEventWeight());
2524  }
2525  }
2526  else
2527  {
2528  fhTrackMatchedDEtaNeg->Fill(e, deta, GetEventWeight());
2529  fhTrackMatchedDPhiNeg->Fill(e, dphi, GetEventWeight());
2530 
2531  if(e > 0.5)
2532  {
2533  fhTrackMatchedDEtaNegMod ->Fill(deta, nModule, GetEventWeight());
2534  fhTrackMatchedDPhiNegMod ->Fill(dphi, nModule, GetEventWeight());
2535  fhTrackMatchedDEtaDPhiNeg->Fill(deta, dphi , GetEventWeight());
2536  }
2537  }
2538  }
2539 
2540  Double_t eOverP = e/tmom;
2541  fh1EOverP->Fill(tpt, eOverP, GetEventWeight());
2542  if(e > 0.5 && tpt > 0.5) fh1EOverPMod->Fill(eOverP, nModule, GetEventWeight());
2543 
2544  if(dR < 0.02)
2545  {
2546  fh1EOverPR02->Fill(tpt, eOverP, GetEventWeight());
2547  if(e > 0.5 && tpt > 0.5) fh1EOverPR02Mod->Fill(eOverP, nModule, GetEventWeight());
2548 
2549  if(dedx > 60 && dedx < 100)
2550  {
2551  fh1EleEOverP->Fill(tpt, eOverP, GetEventWeight());
2552  if(e > 0.5 && tpt > 0.5) fh1EleEOverPMod->Fill(eOverP, nModule, GetEventWeight());
2553  }
2554  }
2555 
2556  fh2dR->Fill(e, dR, GetEventWeight());
2557  fh2MatchdEdx->Fill(tmom, dedx, GetEventWeight());
2558 
2559  if(e > 0.5 && tmom > 0.5)
2560  {
2561  fh2dRMod->Fill(dR, nModule, GetEventWeight());
2562  fh2MatchdEdxMod->Fill(dedx, nModule, GetEventWeight());
2563  }
2564 
2565  if(dR < 0.02 && eOverP > 0.6 && eOverP < 1.2
2566  && clus->GetNCells() > 1 && nITS > 3 && nTPC > 20)
2567  {
2568  fh2EledEdx->Fill(tmom, dedx, GetEventWeight());
2569  if(e > 0.5 && tmom > 0.5) fh2EledEdxMod->Fill(dedx, nModule, GetEventWeight());
2570  }
2571 
2572  if(IsDataMC() && okPrimary)
2573  {
2574  Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
2575 
2576  if(TMath::Abs(pdg) == 11)
2577  {
2578  fhMCEle1EOverP ->Fill(tpt , eOverP, GetEventWeight());
2579  fhMCEle1dR ->Fill(dR , GetEventWeight());
2580  fhMCEle2MatchdEdx->Fill(tmom, dedx , GetEventWeight());
2581 
2582  if(dR < 0.02)
2583  {
2584  fhMCEle1EOverPR02->Fill(tpt, eOverP, GetEventWeight());
2585  if(dedx > 60 && dedx < 100) fhMCEle1EleEOverP->Fill(tpt, eOverP, GetEventWeight());
2586  }
2587  }
2588  else if(charge!=0)
2589  {
2590  fhMCChHad1EOverP ->Fill(tpt , eOverP, GetEventWeight());
2591  fhMCChHad1dR ->Fill(dR , GetEventWeight());
2592  fhMCChHad2MatchdEdx->Fill(tmom, dedx , GetEventWeight());
2593 
2594  if(dR < 0.02)
2595  {
2596  fhMCChHad1EOverPR02->Fill(tpt, eOverP, GetEventWeight());
2597  if(dedx > 60 && dedx < 100) fhMCChHad1EleEOverP->Fill(tpt, eOverP, GetEventWeight());
2598  }
2599  }
2600  else if(charge == 0)
2601  {
2602  fhMCNeutral1EOverP ->Fill(tpt , eOverP, GetEventWeight());
2603  fhMCNeutral1dR ->Fill(dR , GetEventWeight());
2604  fhMCNeutral2MatchdEdx->Fill(tmom, dedx , GetEventWeight());
2605 
2606  if(dR < 0.02)
2607  {
2608  fhMCNeutral1EOverPR02->Fill(tpt, eOverP, GetEventWeight());
2609  if(dedx > 60 && dedx < 100) fhMCNeutral1EleEOverP->Fill(tpt, eOverP, GetEventWeight());
2610  }
2611  }
2612  } // DataMC
2613 }
2614 
2615 //___________________________________
2618 //___________________________________
2620 {
2621  // Clusters arrays
2622  TObjArray * caloClustersEMCAL = GetEMCALClusters();
2623  TObjArray * caloClustersPHOS = GetPHOSClusters();
2624 
2625  if(!caloClustersEMCAL || !caloClustersPHOS)
2626  {
2627  AliDebug(1,Form("PHOS (%p) or EMCAL (%p) clusters array not available, do not correlate",caloClustersPHOS,caloClustersEMCAL));
2628  return ;
2629  }
2630 
2631  // Cells arrays
2632  AliVCaloCells * cellsEMCAL = GetEMCALCells();
2633  AliVCaloCells * cellsPHOS = GetPHOSCells();
2634 
2635  if(!cellsEMCAL || !cellsPHOS)
2636  {
2637  AliDebug(1,Form("PHOS (%p) or EMCAL (%p) cells array ot available, do not correlate",cellsPHOS,cellsEMCAL));
2638  return ;
2639  }
2640 
2641  // Clusters parameters
2642  Int_t nclEMCAL = 0;
2643  Int_t nclDCAL = 0;
2644  Int_t nclPHOS = 0;
2645 
2646  Float_t sumClusterEnergyEMCAL = 0;
2647  Float_t sumClusterEnergyDCAL = 0;
2648  Float_t sumClusterEnergyPHOS = 0;
2649 
2650  Int_t iclus = 0;
2651  Float_t energy = 0;
2652  AliVCluster* cluster = 0;
2653  for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2654  {
2655  cluster = (AliVCluster*)caloClustersEMCAL->At(iclus);
2656  Float_t energy = cluster->E();
2657 
2658  if( energy < 0.5 ) continue;
2659 
2660  if(cluster->GetCellsAbsId()[0] < 12288)
2661  {
2662  nclEMCAL++;
2663  sumClusterEnergyEMCAL += energy;
2664  }
2665  else
2666  {
2667  nclDCAL++;
2668  sumClusterEnergyDCAL += energy;
2669  }
2670  }
2671 
2672  for(iclus = 0 ; iclus < caloClustersPHOS ->GetEntriesFast(); iclus++)
2673  {
2674  cluster = (AliVCluster*) caloClustersPHOS->At(iclus);
2675 
2676  energy = cluster->E();
2677 
2678  if( energy < 0.5 ) continue;
2679 
2680  nclPHOS++;
2681  sumClusterEnergyPHOS += energy;
2682  }
2683 
2684  // Cells parameters
2685  Int_t ncellsEMCAL = 0 ;
2686  Int_t ncellsDCAL = 0 ;
2687  Int_t ncellsPHOS = 0;
2688 
2689  Float_t sumCellEnergyEMCAL = 0;
2690  Float_t sumCellEnergyDCAL = 0;
2691  Float_t sumCellEnergyPHOS = 0;
2692  Int_t icell = 0;
2693  for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2694  {
2695  Float_t amp = cellsEMCAL->GetAmplitude(icell);
2696  Int_t cellId = cellsEMCAL->GetCellNumber(icell);
2697 
2698  if (amp < fEMCALCellAmpMin) continue;
2699 
2700  if( cellId < 12288)
2701  {
2702  ncellsEMCAL++;
2703  sumCellEnergyEMCAL += amp;
2704  }
2705  else
2706  {
2707  ncellsDCAL++;
2708  sumCellEnergyDCAL += amp;
2709  }
2710  }
2711 
2712  for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2713  {
2714  Float_t amp = cellsPHOS->GetAmplitude(icell);
2715  Int_t cellId = cellsPHOS->GetCellNumber(icell);
2716 
2717  if ( cellId < 0 ) continue ; // CPV
2718 
2719  if ( amp < fPHOSCellAmpMin ) continue;
2720 
2721  ncellsPHOS++;
2722  sumCellEnergyPHOS += amp;
2723  }
2724 
2725  // Fill Histograms
2726 
2727  fhEMCALPHOSCorrNClusters->Fill(nclEMCAL , nclPHOS , GetEventWeight());
2728  fhEMCALPHOSCorrEClusters->Fill(sumClusterEnergyEMCAL, sumClusterEnergyPHOS, GetEventWeight());
2729  fhEMCALPHOSCorrNCells ->Fill(ncellsEMCAL , ncellsPHOS , GetEventWeight());
2730  fhEMCALPHOSCorrECells ->Fill(sumCellEnergyEMCAL , sumCellEnergyPHOS , GetEventWeight());
2731 
2732  fhEMCALDCALCorrNClusters->Fill(nclEMCAL , nclDCAL , GetEventWeight());
2733  fhEMCALDCALCorrEClusters->Fill(sumClusterEnergyEMCAL, sumClusterEnergyDCAL, GetEventWeight());
2734  fhEMCALDCALCorrNCells ->Fill(ncellsEMCAL , ncellsDCAL , GetEventWeight());
2735  fhEMCALDCALCorrECells ->Fill(sumCellEnergyEMCAL , sumCellEnergyDCAL , GetEventWeight());
2736 
2737  fhDCALPHOSCorrNClusters ->Fill(nclDCAL , nclPHOS , GetEventWeight());
2738  fhDCALPHOSCorrEClusters ->Fill(sumClusterEnergyDCAL , sumClusterEnergyPHOS, GetEventWeight());
2739  fhDCALPHOSCorrNCells ->Fill(ncellsDCAL , ncellsPHOS , GetEventWeight());
2740  fhDCALPHOSCorrECells ->Fill(sumCellEnergyDCAL , sumCellEnergyPHOS , GetEventWeight());
2741 
2742  Int_t v0S = GetV0Signal(0) + GetV0Signal(1);
2744  Int_t trM = GetTrackMultiplicity();
2745  Float_t cen = GetEventCentrality();
2746  Float_t ep = GetEventPlaneAngle();
2747 
2748  Int_t ncl = nclPHOS;
2749  Float_t sumClusterEnergy = sumClusterEnergyPHOS;
2750  Int_t ncells = ncellsPHOS;
2751  Float_t sumCellEnergy = sumCellEnergyPHOS;
2752 
2753  if ( GetCalorimeter() == kEMCAL )
2754  {
2755  ncl = nclEMCAL + nclDCAL;
2756  sumClusterEnergy = sumClusterEnergyEMCAL + sumClusterEnergyDCAL;
2757  ncells = ncellsEMCAL + ncellsDCAL;
2758  sumCellEnergy = sumCellEnergyEMCAL + sumCellEnergyDCAL;
2759  }
2760 
2761  fhCaloV0MCorrNClusters ->Fill(v0M, ncl , GetEventWeight());
2762  fhCaloV0MCorrEClusters ->Fill(v0M, sumClusterEnergy, GetEventWeight());
2763  fhCaloV0MCorrNCells ->Fill(v0M, ncells , GetEventWeight());
2764  fhCaloV0MCorrECells ->Fill(v0M, sumCellEnergy , GetEventWeight());
2765 
2766  fhCaloV0SCorrNClusters ->Fill(v0S, ncl , GetEventWeight());
2767  fhCaloV0SCorrEClusters ->Fill(v0S, sumClusterEnergy, GetEventWeight());
2768  fhCaloV0SCorrNCells ->Fill(v0S, ncells , GetEventWeight());
2769  fhCaloV0SCorrECells ->Fill(v0S, sumCellEnergy , GetEventWeight());
2770 
2771  fhCaloTrackMCorrNClusters->Fill(trM, ncl , GetEventWeight());
2772  fhCaloTrackMCorrEClusters->Fill(trM, sumClusterEnergy, GetEventWeight());
2773  fhCaloTrackMCorrNCells ->Fill(trM, ncells , GetEventWeight());
2774  fhCaloTrackMCorrECells ->Fill(trM, sumCellEnergy , GetEventWeight());
2775 
2776  fhCaloCenNClusters ->Fill(cen, ncl , GetEventWeight());
2777  fhCaloCenEClusters ->Fill(cen, sumClusterEnergy, GetEventWeight());
2778  fhCaloCenNCells ->Fill(cen, ncells , GetEventWeight());
2779  fhCaloCenECells ->Fill(cen, sumCellEnergy , GetEventWeight());
2780 
2781  fhCaloEvPNClusters ->Fill(ep , ncl , GetEventWeight());
2782  fhCaloEvPEClusters ->Fill(ep , sumClusterEnergy, GetEventWeight());
2783  fhCaloEvPNCells ->Fill(ep , ncells , GetEventWeight());
2784  fhCaloEvPECells ->Fill(ep , sumCellEnergy , GetEventWeight());
2785 
2786  AliDebug(1,"Correlate():");
2787  AliDebug(1,Form("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f",
2788  ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL));
2789  AliDebug(1,Form("\t DCAL : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f",
2790  ncellsDCAL,nclDCAL, sumCellEnergyDCAL,sumClusterEnergyDCAL));
2791  AliDebug(1,Form("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f",
2792  ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS));
2793  AliDebug(1,Form("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d", v0S,v0M,trM));
2794  AliDebug(1,Form("\t centrality : %f, Event plane angle %f", cen,ep));
2795 }
2796 
2797 //_________________________________________________
2799 //_________________________________________________
2801 {
2802  TString parList ; //this will be list of parameters used for this analysis.
2803  const Int_t buffersize = 255;
2804  char onePar[buffersize] ;
2805 
2806  snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---:") ;
2807  parList+=onePar ;
2808  snprintf(onePar,buffersize,"Calorimeter: %s;",GetCalorimeterString().Data()) ;
2809  parList+=onePar ;
2810  snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns;",fTimeCutMin, fTimeCutMax) ;
2811  parList+=onePar ;
2812  snprintf(onePar,buffersize,"Cell Amplitude: PHOS > %2.2f GeV, EMCAL > %2.2f GeV;",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
2813  parList+=onePar ;
2814  snprintf(onePar,buffersize,"Cluster M02: EMCAL > %2.2f ;",fEMCALClusterM02Min) ;
2815  parList+=onePar ;
2816  snprintf(onePar,buffersize,"N cells per cluster: PHOS >= %d, EMCAL >= %d;",fPHOSClusterNCellMin, fEMCALClusterNCellMin) ;
2817  parList+=onePar ;
2818  snprintf(onePar,buffersize,"Inv. Mass %2.1f < E_cl < %2.1f GeV;",fInvMassMinECut, fInvMassMaxECut) ;
2819  parList+=onePar ;
2820  snprintf(onePar,buffersize,"Inv. Mass %2.1f < M02 < %2.1f GeV;",fInvMassMinM02Cut, fInvMassMaxM02Cut) ;
2821  parList+=onePar ;
2822  snprintf(onePar,buffersize,"Cluster pair opening angle < %2.1f rad;",fInvMassMaxOpenAngle) ;
2823  parList+=onePar ;
2824  snprintf(onePar,buffersize,"Cluster pair time difference < %2.1f rad;",fInvMassMaxTimeDifference) ;
2825  parList+=onePar ;
2826 
2827  //Get parameters set in base class.
2828  //parList += GetBaseParametersList() ;
2829 
2830  //Get parameters set in FiducialCut class (not available yet)
2831  //parlist += GetFidCut()->GetFidCutParametersList()
2832 
2833  return new TObjString(parList) ;
2834 }
2835 
2836 //_________________________________________________________________________________
2838 //_________________________________________________________________________________
2840  AliVCluster *clus, AliVCaloCells* cells)
2841 {
2842  if(ampMax < 0.01)
2843  {
2844  AliDebug(1,Form("Low amplitude energy %f",ampMax));
2845  return;
2846  }
2847 
2848  Float_t l0 = clus->GetM02();
2849  Float_t l1 = clus->GetM20();
2850  Float_t en = clus->E();
2851  Int_t nc = clus->GetNCells();
2852  Double_t tmax = clus->GetTOF()*1.e9-fConstantTimeShift; // recalibrated elsewhere
2853 
2854  Float_t eCrossFrac = 1-GetECross(absIdMax,cells, 10000000)/ampMax;
2855 
2856  if(en > 5)
2857  {
2858  fhExoL0ECross->Fill(eCrossFrac, l0, GetEventWeight());
2859  fhExoL1ECross->Fill(eCrossFrac, l1, GetEventWeight());
2860  }
2861 
2862  for(Int_t ie = 0; ie < fExoNECrossCuts; ie++)
2863  {
2864  for(Int_t idt = 0; idt < fExoNDTimeCuts; idt++)
2865  {
2866  eCrossFrac = 1-GetECross(absIdMax,cells, fExoDTimeCuts[idt])/ampMax;
2867 
2868  if(eCrossFrac > fExoECrossCuts[ie])
2869  {
2870  // Exotic
2871  fhExoL0 [ie][idt]->Fill(en,l0 , GetEventWeight());
2872  fhExoL1 [ie][idt]->Fill(en,l1 , GetEventWeight());
2873  fhExoTime [ie][idt]->Fill(en,tmax, GetEventWeight());
2874 
2875  if(en > 5)
2876  {
2877  fhExoL0NCell[ie][idt]->Fill(nc, l0, GetEventWeight());
2878  fhExoL1NCell[ie][idt]->Fill(nc, l1, GetEventWeight());
2879  }
2880 
2881  // Diff time, do for one cut in time
2882  if(idt == 0)
2883  {
2884  for (Int_t icell = 0; icell < clus->GetNCells(); icell++)
2885  {
2886  Int_t absId = clus->GetCellsAbsId()[icell];
2887  Double_t time = cells->GetCellTime(absId);
2888  GetCaloUtils()->RecalibrateCellTime(time, GetCalorimeter(), absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2889  time *= 1e9;
2890  time -= fConstantTimeShift;
2891 
2892  Float_t diff = tmax-time;
2893  fhExoDTime[ie]->Fill(en, diff, GetEventWeight());
2894  }
2895  }
2896  }
2897  else
2898  {
2899  fhExoECross[ie][idt]->Fill(en, eCrossFrac, GetEventWeight());
2900  fhExoNCell [ie][idt]->Fill(en, nc , GetEventWeight());
2901  }
2902  } // D time cut loop
2903  } // e cross cut loop
2904 }
2905 
2906 //___________________________________________________
2909 //___________________________________________________
2911 {
2912  TList * outputContainer = new TList() ;
2913  outputContainer->SetName("QAHistos") ;
2914 
2915  // Init the number of modules, set in the class AliCalorimeterUtils
2916 
2918  if(GetCalorimeter()==kPHOS && fNModules > 4) fNModules = 4;
2919 
2920  // Histogram binning and ranges
2921 
2942 
2946 
2947  // TM residuals
2954 
2955  // Calorimeter grid
2956 
2957  // EMCAL
2958  fNMaxCols = 48;
2959  fNMaxRows = 24;
2960  fNRCU = 2 ;
2961  // PHOS
2962  if(GetCalorimeter()==kPHOS)
2963  {
2964  fNMaxCols = 56;
2965  fNMaxRows = 64;
2966  fNRCU = 4 ;
2967  }
2968 
2969 
2970  // Init histograms
2971 
2972  fhE = new TH1F ("hE","#it{E} reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
2973  fhE->SetXTitle("#it{E} (GeV)");
2974  outputContainer->Add(fhE);
2975 
2976  fhPt = new TH1F ("hPt","#it{p}_{T} reconstructed clusters", nptbins,ptmin,ptmax);
2977  fhPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2978  outputContainer->Add(fhPt);
2979 
2980  fhPhi = new TH1F ("hPhi","#varphi reconstructed clusters ",nphibins,phimin,phimax);
2981  fhPhi->SetXTitle("#varphi (rad)");
2982  outputContainer->Add(fhPhi);
2983 
2984  fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
2985  fhEta->SetXTitle("#eta ");
2986  outputContainer->Add(fhEta);
2987 
2989  {
2990  if(fFillAllTH3)
2991  {
2992  fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #varphi vs energy, reconstructed clusters",
2993  netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2994  fhEtaPhiE->SetXTitle("#eta ");
2995  fhEtaPhiE->SetYTitle("#varphi (rad)");
2996  fhEtaPhiE->SetZTitle("#it{E} (GeV) ");
2997  outputContainer->Add(fhEtaPhiE);
2998  }
2999  else
3000  {
3001  fhEtaPhi = new TH2F ("hEtaPhi","#eta vs #varphi for #it{E} > 0.5 GeV, reconstructed clusters",
3002  netabins,etamin,etamax,nphibins,phimin,phimax);
3003  fhEtaPhi->SetXTitle("#eta ");
3004  fhEtaPhi->SetYTitle("#varphi (rad)");
3005  outputContainer->Add(fhEtaPhi);
3006  }
3007  }
3008 
3009  fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
3010  nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
3011  fhClusterTimeEnergy->SetXTitle("#it{E} (GeV) ");
3012  fhClusterTimeEnergy->SetYTitle("TOF (ns)");
3013  outputContainer->Add(fhClusterTimeEnergy);
3014 
3015  fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",
3016  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
3017  fhClusterPairDiffTimeE->SetXTitle("#it{E}_{cluster} (GeV)");
3018  fhClusterPairDiffTimeE->SetYTitle("#Delta #it{t} (ns)");
3019  outputContainer->Add(fhClusterPairDiffTimeE);
3020 
3021  fhClusterPairDiffTimeESameMod = new TH2F("hClusterPairDiffTimeESameMod","cluster pair time difference vs E, only good clusters",
3022  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
3023  fhClusterPairDiffTimeESameMod->SetXTitle("#it{E}_{cluster} (GeV)");
3024  fhClusterPairDiffTimeESameMod->SetYTitle("#Delta #it{t} (ns)");
3025  outputContainer->Add(fhClusterPairDiffTimeESameMod);
3026 
3027 //fhDispersion = new TH2F ("hDispersion","shower shape, Dispersion^{2} vs E for bad cluster ",
3028 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3029 //fhDispersion->SetXTitle("#it{E}_{cluster} (GeV)");
3030 //fhDispersion->SetYTitle("Dispersion");
3031 //outputContainer->Add(fhDispersion);
3032 
3033  fhLambda0 = new TH2F ("hLambda0","shower shape, #lambda^{2}_{0} vs E",
3034  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3035  fhLambda0->SetXTitle("#it{E}_{cluster} (GeV)");
3036  fhLambda0->SetYTitle("#lambda^{2}_{0}");
3037  outputContainer->Add(fhLambda0);
3038 
3039  fhLambda1 = new TH2F ("hLambda1","shower shape, #lambda^{2}_{1} vs E",
3040  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3041  fhLambda1->SetXTitle("#it{E}_{cluster} (GeV)");
3042  fhLambda1->SetYTitle("#lambda^{2}_{1}");
3043  outputContainer->Add(fhLambda1);
3044 
3046  {
3047  fhLambda0MaxFECPair = new TH2F ("hLambda0MaxFECPair","#lambda^{2}_{0} vs E, FEC pair eta column",
3048  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3049  fhLambda0MaxFECPair->SetXTitle("#it{E}_{cluster}");
3050  fhLambda0MaxFECPair->SetYTitle("#lambda^{2}_{0}");
3051  outputContainer->Add(fhLambda0MaxFECPair);
3052 
3053  fhLambda1MaxFECPair = new TH2F ("hLambda1MaxFECPair","#lambda^{2}_{1} vs E, FEC pair eta column",
3054  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3055  fhLambda1MaxFECPair->SetXTitle("#it{E}_{cluster}");
3056  fhLambda1MaxFECPair->SetYTitle("#lambda^{2}_{1}");
3057  outputContainer->Add(fhLambda1MaxFECPair);
3058 
3059  fhLambda0Max2FECPair = new TH2F ("hLambda0Max2FECPair","#lambda^{2}_{0} vs E, FEC pair eta column, 2 highest cells corr.",
3060  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3061  fhLambda0Max2FECPair->SetXTitle("#it{E}_{cluster}");
3062  fhLambda0Max2FECPair->SetYTitle("#lambda^{2}_{0}");
3063  outputContainer->Add(fhLambda0Max2FECPair);
3064 
3065  fhLambda1Max2FECPair = new TH2F ("hLambda1Max2FECPair","#lambda^{2}_{1} vs E, FEC pair eta column, 2 highest cells corr.",
3066  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3067  fhLambda1Max2FECPair->SetXTitle("#it{E}_{cluster}");
3068  fhLambda1Max2FECPair->SetYTitle("#lambda^{2}_{1}");
3069  outputContainer->Add(fhLambda1Max2FECPair);
3070 
3071  fhLambda0MaxFECOdd = new TH2F ("hLambda0MaxFECOdd","#lambda^{2}_{0} vs E, FEC odd eta column",
3072  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3073  fhLambda0MaxFECOdd->SetXTitle("#it{E}_{cluster}");
3074  fhLambda0MaxFECOdd->SetYTitle("#lambda^{2}_{0}");
3075  outputContainer->Add(fhLambda0MaxFECOdd);
3076 
3077  fhLambda1MaxFECOdd = new TH2F ("hLambda1MaxFECOdd","#lambda^{2}_{1} vs E, FEC odd eta column",
3078  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3079  fhLambda1MaxFECOdd->SetXTitle("#it{E}_{cluster}");
3080  fhLambda1MaxFECOdd->SetYTitle("#lambda^{2}_{1}");
3081  outputContainer->Add(fhLambda1MaxFECOdd);
3082 
3083  fhLambda0Max2FECOdd = new TH2F ("hLambda0Max2FECOdd","#lambda^{2}_{0} vs E, FEC odd eta column, 2 highest cells corr.",
3084  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3085  fhLambda0Max2FECOdd->SetXTitle("#it{E}_{cluster}");
3086  fhLambda0Max2FECOdd->SetYTitle("#lambda^{2}_{0}");
3087  outputContainer->Add(fhLambda0Max2FECOdd);
3088 
3089  fhLambda1Max2FECOdd = new TH2F ("hLambda1Max2FECOdd","#lambda^{2}_{1} vs E, FEC odd eta column, 2 highest cells corr.",
3090  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3091  fhLambda1Max2FECOdd->SetXTitle("#it{E}_{cluster}");
3092  fhLambda1Max2FECOdd->SetYTitle("#lambda^{2}_{1}");
3093  outputContainer->Add(fhLambda1Max2FECOdd);
3094 
3095  fhLambda0MaxFECPairLargeNCells = new TH2F ("hLambda0MaxFECPair_LargeNCells","#lambda^{2}_{0} vs E, FEC pair eta column, ncell>5",
3096  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3097  fhLambda0MaxFECPairLargeNCells->SetXTitle("#it{E}_{cluster}");
3098  fhLambda0MaxFECPairLargeNCells->SetYTitle("#lambda^{2}_{0}");
3099  outputContainer->Add(fhLambda0MaxFECPairLargeNCells);
3100 
3101  fhLambda1MaxFECPairLargeNCells = new TH2F ("hLambda1MaxFECPair_LargeNCells","#lambda^{2}_{1} vs E, FEC pair eta column, ncell>5",
3102  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3103  fhLambda1MaxFECPairLargeNCells->SetXTitle("#it{E}_{cluster}");
3104  fhLambda1MaxFECPairLargeNCells->SetYTitle("#lambda^{2}_{1}");
3105  outputContainer->Add(fhLambda1MaxFECPairLargeNCells);
3106 
3107  fhLambda0Max2FECPairLargeNCells = new TH2F ("hLambda0Max2FECPair_LargeNCells","#lambda^{2}_{0} vs E, FEC pair eta column, 2 highest cells corr., ncell>5",
3108  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3109  fhLambda0Max2FECPairLargeNCells->SetXTitle("#it{E}_{cluster}");
3110  fhLambda0Max2FECPairLargeNCells->SetYTitle("#lambda^{2}_{0}");
3111  outputContainer->Add(fhLambda0Max2FECPairLargeNCells);
3112 
3113  fhLambda1Max2FECPairLargeNCells = new TH2F ("hLambda1Max2FECPair_LargeNCells","#lambda^{2}_{1} vs E, FEC pair eta column, 2 highest cells corr., ncell>5",
3114  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3115  fhLambda1Max2FECPairLargeNCells->SetXTitle("#it{E}_{cluster}");
3116  fhLambda1Max2FECPairLargeNCells->SetYTitle("#lambda^{2}_{1}");
3117  outputContainer->Add(fhLambda1Max2FECPairLargeNCells);
3118 
3119  fhLambda0MaxFECOddLargeNCells = new TH2F ("hLambda0MaxFECOdd_LargeNCells","#lambda^{2}_{0} vs E, FEC odd eta column, ncell>5",
3120  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3121  fhLambda0MaxFECOddLargeNCells->SetXTitle("#it{E}_{cluster}");
3122  fhLambda0MaxFECOddLargeNCells->SetYTitle("#lambda^{2}_{0}");
3123  outputContainer->Add(fhLambda0MaxFECOddLargeNCells);
3124 
3125  fhLambda1MaxFECOddLargeNCells = new TH2F ("hLambda1MaxFECOdd_LargeNCells","#lambda^{2}_{1} vs E, FEC odd eta column, ncell>5",
3126  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3127  fhLambda1MaxFECOddLargeNCells->SetXTitle("#it{E}_{cluster}");
3128  fhLambda1MaxFECOddLargeNCells->SetYTitle("#lambda^{2}_{1}");
3129  outputContainer->Add(fhLambda1MaxFECOddLargeNCells);
3130 
3131  fhLambda0Max2FECOddLargeNCells = new TH2F ("hLambda0Max2FECOdd_LargeNCells","#lambda^{2}_{0} vs E, FEC odd eta column, 2 highest cells corr., ncell>5",
3132  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3133  fhLambda0Max2FECOddLargeNCells->SetXTitle("#it{E}_{cluster}");
3134  fhLambda0Max2FECOddLargeNCells->SetYTitle("#lambda^{2}_{0}");
3135  outputContainer->Add(fhLambda0Max2FECOddLargeNCells);
3136 
3137  fhLambda1Max2FECOddLargeNCells = new TH2F ("hLambda1Max2FECOdd_LargeNCells","#lambda^{2}_{1} vs E, FEC odd eta column, 2 highest cells corr., ncell>5",
3138  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3139  fhLambda1Max2FECOddLargeNCells->SetXTitle("#it{E}_{cluster}");
3140  fhLambda1Max2FECOddLargeNCells->SetYTitle("#lambda^{2}_{1}");
3141  outputContainer->Add(fhLambda1Max2FECOddLargeNCells);
3142 
3143 
3144  TString titleMaxFEC[] =
3145  {"No correlation with main cell", "Main cell corr. with near cell",
3146  "Main cell corr. with far cell", "Main cell corr. with near and far"};
3147 
3148  TString titleFEC[] =
3149  {"No main cell corr., no other inside cluster" , "No main cell corr., 1 cell correl in cluster" , "No main cell corr., >=2 cell correl in cluster",
3150  "Main cell corr. & no other inside cluster" , "Main cell corr. & 1 cell corr. inside cluster", "Main cell corr. & >=2 cell corr. inside cluster"};
3151 
3152  fhEtaPhiFECCorrControl = new TH2F ("hEtaPhiFECCorrControl","#eta vs #varphi for FEC correlation selected clusters",
3153  netabins,etamin,etamax,nphibins,phimin,phimax);
3154  fhEtaPhiFECCorrControl->SetXTitle("#eta ");
3155  fhEtaPhiFECCorrControl->SetYTitle("#varphi (rad)");
3156  outputContainer->Add(fhEtaPhiFECCorrControl);
3157 
3158  for(Int_t i = 0; i < 4; i++)
3159  {
3160  fhLambda0MaxFECCorrel[i] = new TH2F
3161  (Form("hLambda0MaxFECCorrel_Case%d",i),
3162  Form("#lambda^{2}_{0} vs E, Max FEC correl %s",titleMaxFEC[i].Data()),
3163  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3164  fhLambda0MaxFECCorrel[i]->SetXTitle("#it{E}_{cluster}");
3165  fhLambda0MaxFECCorrel[i]->SetYTitle("#lambda^{2}_{0}");
3166  outputContainer->Add(fhLambda0MaxFECCorrel[i]);
3167 
3168  fhLambda1MaxFECCorrel[i] = new TH2F
3169  (Form("hLambda1MaxFECCorrel_Case%d",i),
3170  Form("#lambda^{2}_{1} vs E for bad cluster, Max FEC correl %s",titleMaxFEC[i].Data()),
3171  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3172  fhLambda1MaxFECCorrel[i]->SetXTitle("#it{E}_{cluster}");
3173  fhLambda1MaxFECCorrel[i]->SetYTitle("#lambda^{2}_{1}");
3174  outputContainer->Add(fhLambda1MaxFECCorrel[i]);
3175 
3177  (Form("hLambda0MaxFECCorrel_Case%d_LargeNCells",i),
3178  Form("#lambda^{2}_{0} vs E, Max FEC correl %s, ncells>5",titleMaxFEC[i].Data()),
3179  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3180  fhLambda0MaxFECCorrelLargeNCells[i]->SetXTitle("#it{E}_{cluster}");
3181  fhLambda0MaxFECCorrelLargeNCells[i]->SetYTitle("#lambda^{2}_{0}");
3182  outputContainer->Add(fhLambda0MaxFECCorrelLargeNCells[i]);
3183 
3185  (Form("hLambda1MaxFECCorrel_Case%d_LargeNCells",i),
3186  Form("#lambda^{2}_{1} vs E for bad cluster, Max FEC correl %s, ncells>5",titleMaxFEC[i].Data()),
3187  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3188  fhLambda1MaxFECCorrelLargeNCells[i]->SetXTitle("#it{E}_{cluster}");
3189  fhLambda1MaxFECCorrelLargeNCells[i]->SetYTitle("#lambda^{2}_{1}");
3190  outputContainer->Add(fhLambda1MaxFECCorrelLargeNCells[i]);
3191  }
3192 
3193  for(Int_t i = 0; i < 6; i++)
3194  {
3195  fhLambda0FECCorrel[i] = new TH2F
3196  (Form("hLambda0FECCorrel_Case%d",i),
3197  Form("#lambda^{2}_{0} vs E, %s",titleFEC[i].Data()),
3198  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3199  fhLambda0FECCorrel[i]->SetXTitle("#it{E}_{cluster}");
3200  fhLambda0FECCorrel[i]->SetYTitle("#lambda^{2}_{0}");
3201  outputContainer->Add(fhLambda0FECCorrel[i]);
3202 
3203  fhLambda1FECCorrel[i] = new TH2F
3204  (Form("hLambda1FECCorrel_Case%d",i),
3205  Form("#lambda^{2}_{1} vs E for bad cluster, %s",titleFEC[i].Data()),
3206  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3207  fhLambda1FECCorrel[i]->SetXTitle("#it{E}_{cluster}");
3208  fhLambda1FECCorrel[i]->SetYTitle("#lambda^{2}_{1}");
3209  outputContainer->Add(fhLambda1FECCorrel[i]);
3210 
3212  (Form("hLambda0FECCorrel_Case%d_LargeNCells",i),
3213  Form("#lambda^{2}_{0} vs E, %s, ncells>5",titleFEC[i].Data()),
3214  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3215  fhLambda0FECCorrelLargeNCells[i]->SetXTitle("#it{E}_{cluster}");
3216  fhLambda0FECCorrelLargeNCells[i]->SetYTitle("#lambda^{2}_{0}");
3217  outputContainer->Add(fhLambda0FECCorrelLargeNCells[i]);
3218 
3220  (Form("hLambda1FECCorrel_Case%d_LargeNCells",i),
3221  Form("#lambda^{2}_{1} vs E for bad cluster, %s, ncells>5",titleFEC[i].Data()),
3222  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3223  fhLambda1FECCorrelLargeNCells[i]->SetXTitle("#it{E}_{cluster}");
3224  fhLambda1FECCorrelLargeNCells[i]->SetYTitle("#lambda^{2}_{1}");
3225  outputContainer->Add(fhLambda1FECCorrelLargeNCells[i]);
3226  }
3227 
3228  }
3229 
3231  {
3232  TString add[] = {"","TrackMatched"};
3233  for(Int_t tm = 0; tm < 2; tm++)
3234  {
3236  (Form("hColRowTCardCorrNoSelectionLowE%s",add[tm].Data()),
3237  Form("column vs row, max E cell for TCard correlation selected clusters, E > 2 GeV %s",add[tm].Data()),
3238  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3239  fhColRowTCardCorrNoSelectionLowE[tm]->SetYTitle("row");
3240  fhColRowTCardCorrNoSelectionLowE[tm]->SetXTitle("column");
3241  outputContainer->Add(fhColRowTCardCorrNoSelectionLowE[tm]) ;
3242 
3244  (Form("hColRowTCardCorrNoSelectionHighE%s",add[tm].Data()),
3245  Form("column vs row, max E cell for TCard correlation selected clusters, E > 8 GeV %s",add[tm].Data()),
3246  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3247  fhColRowTCardCorrNoSelectionHighE[tm]->SetYTitle("row");
3248  fhColRowTCardCorrNoSelectionHighE[tm]->SetXTitle("column");
3249  outputContainer->Add(fhColRowTCardCorrNoSelectionHighE[tm]) ;
3250 
3252  (Form("hNCellsTCardCorrNoSelection%s",add[tm].Data()),
3253  Form("# custer # cells vs #it{E} %s",add[tm].Data()),
3254  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3255  fhNCellsTCardCorrNoSelection[tm]->SetXTitle("#it{E} (GeV)");
3256  fhNCellsTCardCorrNoSelection[tm]->SetYTitle("#it{n}_{cells}");
3257  outputContainer->Add(fhNCellsTCardCorrNoSelection[tm]);
3258 
3260  (Form("hNCellsTCardCorrWithWeightNoSelection%s",add[tm].Data()),
3261  Form("custer # cells vs #it{E}, w > 0.01 %s",add[tm].Data()),
3262  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3263  fhNCellsTCardCorrWithWeightNoSelection[tm]->SetXTitle("#it{E} (GeV)");
3264  fhNCellsTCardCorrWithWeightNoSelection[tm]->SetYTitle("#it{n}_{cells}");
3265  outputContainer->Add(fhNCellsTCardCorrWithWeightNoSelection[tm]);
3266 
3268  (Form("hNCellsTCardCorrRatioWithWeightNoSelection%s",add[tm].Data()),
3269  Form("custer # cells vs #it{E}, w > 0.01 %s",add[tm].Data()),
3270  nptbins,ptmin,ptmax, 100,0,1);
3271  fhNCellsTCardCorrRatioWithWeightNoSelection[tm]->SetXTitle("#it{E} (GeV)");
3272  fhNCellsTCardCorrRatioWithWeightNoSelection[tm]->SetYTitle("#it{n}^{w>0.01}_{cells} / #it{n}_{cells}");
3273  outputContainer->Add(fhNCellsTCardCorrRatioWithWeightNoSelection[tm]);
3274 
3276  (Form("hLambda0TCardCorrNoSelection%s",add[tm].Data()),
3277  Form("#lambda^{2}_{0} vs #it{E} %s",add[tm].Data()),
3278  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3279  fhLambda0TCardCorrNoSelection[tm]->SetXTitle("#it{E} (GeV)");
3280  fhLambda0TCardCorrNoSelection[tm]->SetYTitle("#lambda^{2}_{0}");
3281  outputContainer->Add(fhLambda0TCardCorrNoSelection[tm]);
3282 
3284  (Form("hLambda1TCardCorrNoSelection%s",add[tm].Data()),
3285  Form("#lambda^{2}_{1} vs #it{E} %s",add[tm].Data()),
3286  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3287  fhLambda1TCardCorrNoSelection[tm]->SetXTitle("#it{E} (GeV)");
3288  fhLambda1TCardCorrNoSelection[tm]->SetYTitle("#lambda^{2}_{1}");
3289  outputContainer->Add(fhLambda1TCardCorrNoSelection[tm]);
3290 
3292  (Form("hLambdaRTCardCorrNoSelection%s",add[tm].Data()),
3293  Form("#lambda^{1}_{0}/#lambda^{2}_{0} vs #it{E} %s",add[tm].Data()),
3294  nptbins,ptmin,ptmax,110,0,1.1);
3295  fhLambdaRTCardCorrNoSelection[tm]->SetXTitle("#it{E} (GeV)");
3296  fhLambdaRTCardCorrNoSelection[tm]->SetYTitle("#lambda^{2}_{1}/#lambda^{2}_{0}");
3297  outputContainer->Add(fhLambdaRTCardCorrNoSelection[tm]);
3298 
3300  (Form("hExoticTCardCorrNoSelection%s",add[tm].Data()),
3301  Form("exoticity vs #it{E} %s",add[tm].Data()),
3302  nptbins,ptmin,ptmax,200,-1,1);
3303  fhExoticTCardCorrNoSelection[tm]->SetXTitle("#it{E} (GeV)");
3304  fhExoticTCardCorrNoSelection[tm]->SetYTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3305  outputContainer->Add(fhExoticTCardCorrNoSelection[tm]);
3306 
3308  (Form("fhNCellsTCardSameAndDiff%s",add[tm].Data()),
3309  Form("#it{n}_{cells} same TCard vs diff TCard fraction, w > 0.01, %s",add[tm].Data()),
3310  nptbins,ptmin,ptmax,100,0,1);
3311  fhNCellsTCardSameAndDiffFraction[tm]->SetXTitle("#it{E} (GeV)");
3312  fhNCellsTCardSameAndDiffFraction[tm]->SetYTitle("#it{n}_{cells} - same TCard / #it{n}_{cells} - total");
3313  outputContainer->Add(fhNCellsTCardSameAndDiffFraction[tm]);
3314 
3316  (Form("fhNCellsTCardSameAndDiffFraction_Exotic%s",add[tm].Data()),
3317  Form("#it{n}_{cells} same TCard vs diff TCard fraction, w > 0.01, exo > 0.97 %s",add[tm].Data()),
3318  nptbins,ptmin,ptmax,100,0,1);
3319  fhNCellsTCardSameAndDiffFractionExotic[tm]->SetXTitle("#it{E} (GeV)");
3320  fhNCellsTCardSameAndDiffFractionExotic[tm]->SetYTitle("#it{n}_{cells} - same TCard / #it{n}_{cells} - total");
3321  outputContainer->Add(fhNCellsTCardSameAndDiffFractionExotic[tm]);
3322 
3323 
3325  (Form("hSameRowDiffColAndTCardCellsEnergyDiffClusterE%s",add[tm].Data()),
3326  Form("#Delta row = 0, |#Delta col = 1|, with respect to leading cell, #it{E}_{cell}^{same TCard}-#it{E}_{cell}^{diff TCard} vs #it{E}_{cluster} %s",add[tm].Data()),
3327  nptbins,ptmin,ptmax,200,-10,10);
3328  fhSameRowDiffColAndTCardCellsEnergyDiffClusterE[tm]->SetXTitle("#it{E}_{cluster} (GeV)");
3329  fhSameRowDiffColAndTCardCellsEnergyDiffClusterE[tm]->SetYTitle("#it{E}_{cell}^{same TCard}-#it{E}_{cell}^{diff TCard} (GeV)");
3330  outputContainer->Add(fhSameRowDiffColAndTCardCellsEnergyDiffClusterE[tm]);
3331 
3333  (Form("hSameRowDiffColAndTCardCellsTimeDiffClusterE%s",add[tm].Data()),
3334  Form("#Delta row = 0, |#Delta col = 1|, with respect to leading cell, #it{t}_{cell}^{same TCard}-#it{t}_{cell}^{diff TCard} vs #it{E}_{cluster} %s",add[tm].Data()),
3335  nptbins,ptmin,ptmax,200,-100,100);
3336  fhSameRowDiffColAndTCardCellsTimeDiffClusterE[tm]->SetXTitle("#it{E}_{cluster} (GeV)");
3337  fhSameRowDiffColAndTCardCellsTimeDiffClusterE[tm]->SetYTitle("#it{t}_{cell}^{same TCard}-#it{t}_{cell}^{diff TCard} (ns)");
3338  outputContainer->Add(fhSameRowDiffColAndTCardCellsTimeDiffClusterE[tm]);
3339 
3341  (Form("hSameRowDiffColAndTCardCellsEnergyDiffCellMaxE%s",add[tm].Data()),
3342  Form("#Delta row = 0, |#Delta col = 1|, with respect to leading cell, #it{E}_{cell}^{same TCard}-#it{E}_{cell}^{diff TCard} vs #it{E}_{cell max} %s",add[tm].Data()),
3343  nptbins,ptmin,ptmax,200,-10,10);
3344  fhSameRowDiffColAndTCardCellsEnergyDiffCellMaxE[tm]->SetXTitle("#it{E}_{cell max} (GeV)");
3345  fhSameRowDiffColAndTCardCellsEnergyDiffCellMaxE[tm]->SetYTitle("#it{E}_{cell}^{same TCard}-#it{E}_{cell}^{diff TCard} (GeV)");
3346  outputContainer->Add(fhSameRowDiffColAndTCardCellsEnergyDiffCellMaxE[tm]);
3347 
3349  (Form("hSameRowDiffColAndTCardCellsTimeDiffCellMaxE%s",add[tm].Data()),
3350  Form("#Delta row = 0, |#Delta col = 1|, with respect to leading cell, #it{t}_{cell}^{same TCard}-#it{t}_{cell}^{diff TCard} vs #it{E}_{cell max} %s",add[tm].Data()),
3351  nptbins,ptmin,ptmax,200,-100,100);
3352  fhSameRowDiffColAndTCardCellsTimeDiffCellMaxE[tm]->SetXTitle("#it{E}_{cell max} (GeV)");
3353  fhSameRowDiffColAndTCardCellsTimeDiffCellMaxE[tm]->SetYTitle("#it{t}_{cell}^{same TCard}-#it{t}_{cell}^{diff TCard} (ns)");
3354  outputContainer->Add(fhSameRowDiffColAndTCardCellsTimeDiffCellMaxE[tm]);
3355 
3357  (Form("hSameRowDiffColAndTCardCellsEnergyDiffClusterEExo%s",add[tm].Data()),
3358  Form("#Delta row = 0, |#Delta col = 1|, with respect to leading cell, #it{E}_{cell}^{same TCard}-#it{E}_{cell}^{diff TCard} vs #it{E}_{cluster}, exo > 0.97 %s",add[tm].Data()),
3359  nptbins,ptmin,ptmax,200,-10,10);
3360  fhSameRowDiffColAndTCardCellsEnergyDiffClusterEExo[tm]->SetXTitle("#it{E}_{cluster} (GeV)");
3361  fhSameRowDiffColAndTCardCellsEnergyDiffClusterEExo[tm]->SetYTitle("#it{E}_{cell}^{same TCard}-#it{E}_{cell}^{diff TCard} (GeV)");
3362  outputContainer->Add(fhSameRowDiffColAndTCardCellsEnergyDiffClusterEExo[tm]);
3363 
3365  (Form("hSameRowDiffColAndTCardCellsTimeDiffClusterEExo%s",add[tm].Data()),
3366  Form("#Delta row = 0, |#Delta col = 1|, with respect to leading cell, #it{t}_{cell}^{same TCard}-#it{t}_{cell}^{diff TCard} vs #it{E}_{cluster}, exo > 0.97 %s",add[tm].Data()),
3367  nptbins,ptmin,ptmax,200,-100,100);
3368  fhSameRowDiffColAndTCardCellsTimeDiffClusterEExo[tm]->SetXTitle("#it{E}_{cluster} (GeV)");
3369  fhSameRowDiffColAndTCardCellsTimeDiffClusterEExo[tm]->SetYTitle("#it{t}_{cell}^{same TCard}-#it{t}_{cell}^{diff TCard} (ns)");
3370  outputContainer->Add(fhSameRowDiffColAndTCardCellsTimeDiffClusterEExo[tm]);
3371 
3373  (Form("hSameRowDiffColAndTCardCellsEnergyDiffCellMaxEExo%s",add[tm].Data()),
3374  Form("#Delta row = 0, |#Delta col = 1|, with respect to leading cell, #it{E}_{cell}^{same TCard}-#it{E}_{cell}^{diff TCard} vs #it{E}_{cell max}, exo > 0.97 %s",add[tm].Data()),
3375  nptbins,ptmin,ptmax,200,-10,10);
3376  fhSameRowDiffColAndTCardCellsEnergyDiffCellMaxEExo[tm]->SetXTitle("#it{E}_{cell max} (GeV)");
3377  fhSameRowDiffColAndTCardCellsEnergyDiffCellMaxEExo[tm]->SetYTitle("#it{E}_{cell}^{same TCard}-#it{E}_{cell}^{diff TCard} (GeV)");
3378  outputContainer->Add(fhSameRowDiffColAndTCardCellsEnergyDiffCellMaxEExo[tm]);
3379 
3381  (Form("hSameRowDiffColAndTCardCellsTimeDiffCellMaxEExo%s",add[tm].Data()),
3382  Form("#Delta row = 0, |#Delta col = 1|, with respect to leading cell, #it{t}_{cell}^{same TCard}-#it{t}_{cell}^{diff TCard} vs #it{E}_{cell max}, exo > 0.97 %s",add[tm].Data()),
3383  nptbins,ptmin,ptmax,200,-100,100);
3384  fhSameRowDiffColAndTCardCellsTimeDiffCellMaxEExo[tm]->SetXTitle("#it{E}_{cell max} (GeV)");
3385  fhSameRowDiffColAndTCardCellsTimeDiffCellMaxEExo[tm]->SetYTitle("#it{t}_{cell}^{same TCard}-#it{t}_{cell}^{diff TCard} (ns)");
3386  outputContainer->Add(fhSameRowDiffColAndTCardCellsTimeDiffCellMaxEExo[tm]);
3387 
3388  for(Int_t i = 0; i < 6; i++)
3389  {
3390  for(Int_t j = 0; j < 6; j++)
3391  {
3392  fhLambda0TCardCorrelNCell[i][j][tm] = new TH2F
3393  (Form("hLambda0TCardCorrelNCell_Same%d_Diff%d%s",i,j,add[tm].Data()),
3394  Form("#lambda^{2}_{0} vs #it{E}, N cells with w > 0.01, TCard same = %d, diff =%d %s",i,j,add[tm].Data()),
3395  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3396  fhLambda0TCardCorrelNCell[i][j][tm]->SetXTitle("#it{E} (GeV)");
3397  fhLambda0TCardCorrelNCell[i][j][tm]->SetYTitle("#lambda^{2}_{0}");
3398  outputContainer->Add(fhLambda0TCardCorrelNCell[i][j][tm]);
3399 
3400  fhLambda1TCardCorrelNCell[i][j][tm] = new TH2F
3401  (Form("hLambda1TCardCorrelNCell_Same%d_Diff%d%s",i,j,add[tm].Data()),
3402  Form("#lambda^{2}_{1} vs #it{E}, N cells with w > 0.01, TCard same = %d, diff =%d %s",i,j,add[tm].Data()),
3403  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3404  fhLambda1TCardCorrelNCell[i][j][tm]->SetXTitle("#it{E} (GeV)");
3405  fhLambda1TCardCorrelNCell[i][j][tm]->SetYTitle("#lambda^{2}_{1}");
3406  outputContainer->Add(fhLambda1TCardCorrelNCell[i][j][tm]);
3407 
3408  fhLambdaRTCardCorrelNCell[i][j][tm] = new TH2F
3409  (Form("hLambdaRTCardCorrelNCell_Same%d_Diff%d%s",i,j,add[tm].Data()),
3410  Form("#lambda^{2}_{1}/#lambda^{2}_{0} vs #it{E}, N cells with w > 0.01, TCard same = %d, diff =%d %s",i,j,add[tm].Data()),
3411  nptbins,ptmin,ptmax,110,0,1.1);
3412  fhLambdaRTCardCorrelNCell[i][j][tm]->SetXTitle("#it{E} (GeV)");
3413  fhLambdaRTCardCorrelNCell[i][j][tm]->SetYTitle("#lambda^{2}_{1}/#lambda^{2}_{0}");
3414  outputContainer->Add(fhLambdaRTCardCorrelNCell[i][j][tm]);
3415 
3416  fhExoticTCardCorrelNCell[i][j][tm] = new TH2F
3417  (Form("hExoticTCardCorrelNCell_Same%d_Diff%d%s",i,j,add[tm].Data()),
3418  Form("exoticity vs #it{E}, N cells with w > 0.01, TCard same = %d, diff =%d %s",i,j,add[tm].Data()),
3419  nptbins,ptmin,ptmax,200,-1,1);
3420  fhExoticTCardCorrelNCell[i][j][tm]->SetXTitle("#it{E} (GeV)");
3421  fhExoticTCardCorrelNCell[i][j][tm]->SetYTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3422  outputContainer->Add(fhExoticTCardCorrelNCell[i][j][tm]);
3423 
3424  fhColRowTCardCorrelNCellLowE[i][j][tm] = new TH2F
3425  (Form("hColRowTCardCorrelNCellLowE_Same%d_Diff%d%s",i,j,add[tm].Data()),
3426  Form("column vs row, N cells with w > 0.01, TCard same = %d, diff =%d %s",i,j,add[tm].Data()),
3427  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3428  fhColRowTCardCorrelNCellLowE[i][j][tm]->SetYTitle("row");
3429  fhColRowTCardCorrelNCellLowE[i][j][tm]->SetXTitle("column");
3430  outputContainer->Add(fhColRowTCardCorrelNCellLowE[i][j][tm]) ;
3431 
3432  fhColRowTCardCorrelNCellHighE[i][j][tm] = new TH2F
3433  (Form("hColRowTCardCorrelNCellHighE_Same%d_Diff%d%s",i,j,add[tm].Data()),
3434  Form("column vs row,N cells with w > 0.01, TCard same = %d, diff =%d %s",i,j,add[tm].Data()),
3435  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3436  fhColRowTCardCorrelNCellHighE[i][j][tm]->SetYTitle("row");
3437  fhColRowTCardCorrelNCellHighE[i][j][tm]->SetXTitle("column");
3438  outputContainer->Add(fhColRowTCardCorrelNCellHighE[i][j][tm]) ;
3439  }
3440 
3443 
3444  fhLambda0TCardCorrelN[i][tm] = new TH2F
3445  (Form("hLambda0TCardCorrelN_Case%d%s",i,add[tm].Data()),
3446  Form("#lambda^{2}_{0} vs #it{E}, max E cell correl with TCard cell, N corr = %d %s",i,add[tm].Data()),
3447  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3448  fhLambda0TCardCorrelN[i][tm]->SetXTitle("#it{E} (GeV)");
3449  fhLambda0TCardCorrelN[i][tm]->SetYTitle("#lambda^{2}_{0}");
3450  outputContainer->Add(fhLambda0TCardCorrelN[i][tm]);
3451 
3452  fhNCellsTCardCorrelN[i][tm] = new TH2F
3453  (Form("hNCellsTCardCorrelN_Case%d%s",i,add[tm].Data()),
3454  Form("custer # cells vs #it{E}, w > 0.01, max E cell correl with TCard cell, N corr = %d %s",i,add[tm].Data()),
3455  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3456  fhNCellsTCardCorrelN[i][tm]->SetXTitle("#it{E} (GeV)");
3457  fhNCellsTCardCorrelN[i][tm]->SetYTitle("#it{n}_{cells}");
3458  outputContainer->Add(fhNCellsTCardCorrelN[i][tm]);
3459 
3460  fhExoticTCardCorrelN[i][tm] = new TH2F
3461  (Form("hExoticTCardCorrelN_Case%d%s",i,add[tm].Data()),
3462  Form("exoticity vs #it{E}, max E cell correl with TCard cell, N corr = %d %s",i,add[tm].Data()),
3463  nptbins,ptmin,ptmax,200,-1,1);
3464  fhExoticTCardCorrelN[i][tm]->SetXTitle("#it{E} (GeV)");
3465  fhExoticTCardCorrelN[i][tm]->SetYTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3466  outputContainer->Add(fhExoticTCardCorrelN[i][tm]);
3467 
3468  fhColRowTCardCorrelNLowE[i][tm] = new TH2F
3469  (Form("hColRowTCardCorrelNLowE_Case%d%s",i,add[tm].Data()),
3470  Form("column vs row, max E cell correl with TCard cell, E > 2 GeV, N corr = %d %s",i,add[tm].Data()),
3471  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3472  fhColRowTCardCorrelNLowE[i][tm]->SetYTitle("row");
3473  fhColRowTCardCorrelNLowE[i][tm]->SetXTitle("column");
3474  outputContainer->Add(fhColRowTCardCorrelNLowE[i][tm]) ;
3475 
3476  fhColRowTCardCorrelNHighE[i][tm] = new TH2F
3477  (Form("hColRowTCardCorrelNHighE_Case%d%s",i,add[tm].Data()),
3478  Form("column vs row, max E cell correl with TCard cell, E > 8 GeV, N corr = %d %s",i,add[tm].Data()),
3479  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3480  fhColRowTCardCorrelNHighE[i][tm]->SetYTitle("row");
3481  fhColRowTCardCorrelNHighE[i][tm]->SetXTitle("column");
3482  outputContainer->Add(fhColRowTCardCorrelNHighE[i][tm]) ;
3483 
3486 
3487  fhLambda0TCardCorrelNExotic[i][tm] = new TH2F
3488  (Form("hLambda0TCardCorrelN_Exotic_Case%d%s",i,add[tm].Data()),
3489  Form("#lambda^{2}_{0} vs #it{E}, max E cell correl with TCard cell, exo > 0.97, N corr = %d %s",i,add[tm].Data()),
3490  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3491  fhLambda0TCardCorrelNExotic[i][tm]->SetXTitle("#it{E} (GeV)");
3492  fhLambda0TCardCorrelNExotic[i][tm]->SetYTitle("#lambda^{2}_{0}");
3493  outputContainer->Add(fhLambda0TCardCorrelNExotic[i][tm]);
3494 
3495  fhNCellsTCardCorrelNExotic[i][tm] = new TH2F
3496  (Form("hNCellsTCardCorrelN_Exotic_Case%d%s",i,add[tm].Data()),
3497  Form("custer # cells vs #it{E}, w > 0.01, max E cell correl with TCard cell, exo > 0.97, N corr = %d %s",i,add[tm].Data()),
3498  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3499  fhNCellsTCardCorrelNExotic[i][tm]->SetXTitle("#it{E} (GeV)");
3500  fhNCellsTCardCorrelNExotic[i][tm]->SetYTitle("#it{n}_{cells}");
3501  outputContainer->Add(fhNCellsTCardCorrelNExotic[i][tm]);
3502 
3504  (Form("hColRowTCardCorrelNLowEExotic_Case%d%s",i,add[tm].Data()),
3505  Form("column vs row, max E cell correl with TCard cell, exo > 0.97, E > 2 GeV, N corr = %d %s",i,add[tm].Data()),
3506  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3507  fhColRowTCardCorrelNLowEExotic[i][tm]->SetYTitle("row");
3508  fhColRowTCardCorrelNLowEExotic[i][tm]->SetXTitle("column");
3509  outputContainer->Add(fhColRowTCardCorrelNLowEExotic[i][tm]) ;
3510 
3512  (Form("hColRowTCardCorrelNHighEExotic_Case%d%s",i,add[tm].Data()),
3513  Form("column vs row, max E cell correl with TCard cell, exo > 0.97, E > 8 GeV, N corr = %d %s",i,add[tm].Data()),
3514  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3515  fhColRowTCardCorrelNHighEExotic[i][tm]->SetYTitle("row");
3516  fhColRowTCardCorrelNHighEExotic[i][tm]->SetXTitle("column");
3517  outputContainer->Add(fhColRowTCardCorrelNHighEExotic[i][tm]) ;
3518 
3521 
3523  (Form("hLambda0TCardCorrelNAllSameTCard_Case%d%s",i,add[tm].Data()),
3524  Form("#lambda^{2}_{0} vs #it{E}, max E cell correl with TCard cell, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3525  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3526  fhLambda0TCardCorrelNAllSameTCard[i][tm]->SetXTitle("#it{E} (GeV)");
3527  fhLambda0TCardCorrelNAllSameTCard[i][tm]->SetYTitle("#lambda^{2}_{0}");
3528  outputContainer->Add(fhLambda0TCardCorrelNAllSameTCard[i][tm]);
3529 
3531  (Form("hNCellsTCardCorrelNAllSameTCard_Case%d%s",i,add[tm].Data()),
3532  Form("custer # cells vs #it{E}, w > 0.01, max E cell correl with TCard cell, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3533  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3534  fhNCellsTCardCorrelNAllSameTCard[i][tm]->SetXTitle("#it{E} (GeV)");
3535  fhNCellsTCardCorrelNAllSameTCard[i][tm]->SetYTitle("#it{n}_{cells}");
3536  outputContainer->Add(fhNCellsTCardCorrelNAllSameTCard[i][tm]);
3537 
3539  (Form("hExoticTCardCorrelNAllSameTCard_Case%d%s",i,add[tm].Data()),
3540  Form("exoticity vs #it{E}, max E cell correl with TCard cell, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3541  nptbins,ptmin,ptmax,200,-1,1);
3542  fhExoticTCardCorrelNAllSameTCard[i][tm]->SetXTitle("#it{E} (GeV)");
3543  fhExoticTCardCorrelNAllSameTCard[i][tm]->SetYTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3544  outputContainer->Add(fhExoticTCardCorrelNAllSameTCard[i][tm]);
3545 
3547  (Form("hColRowTCardCorrelNAllSameTCardLowE_Case%d%s",i,add[tm].Data()),
3548  Form("column vs row, max E cell correl with TCard cell, E > 2 GeV, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3549  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3550  fhColRowTCardCorrelNAllSameTCardLowE[i][tm]->SetYTitle("row");
3551  fhColRowTCardCorrelNAllSameTCardLowE[i][tm]->SetXTitle("column");
3552  outputContainer->Add(fhColRowTCardCorrelNAllSameTCardLowE[i][tm]) ;
3553 
3555  (Form("hColRowTCardCorrelNAllSameTCardHighE_Case%d%s",i,add[tm].Data()),
3556  Form("column vs row, max E cell correl with TCard cell, E > 8 GeV, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3557  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3558  fhColRowTCardCorrelNAllSameTCardHighE[i][tm]->SetYTitle("row");
3559  fhColRowTCardCorrelNAllSameTCardHighE[i][tm]->SetXTitle("column");
3560  outputContainer->Add(fhColRowTCardCorrelNAllSameTCardHighE[i][tm]) ;
3561 
3563 
3565  (Form("hLambda0TCardCorrelNAllSameTCard_Exotic_Case%d%s",i,add[tm].Data()),
3566  Form("#lambda^{2}_{0} vs #it{E}, max E cell correl with TCard cell, exo > 0.97, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3567  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3568  fhLambda0TCardCorrelNAllSameTCardExotic[i][tm]->SetXTitle("#it{E} (GeV)");
3569  fhLambda0TCardCorrelNAllSameTCardExotic[i][tm]->SetYTitle("#lambda^{2}_{0}");
3570  outputContainer->Add(fhLambda0TCardCorrelNAllSameTCardExotic[i][tm]);
3571 
3573  (Form("hNCellsTCardCorrelNAllSameTCard_Exotic_Case%d%s",i,add[tm].Data()),
3574  Form("custer # cells vs #it{E}, w > 0.01, max E cell correl with TCard cell, exo > 0.97, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3575  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3576  fhNCellsTCardCorrelNAllSameTCardExotic[i][tm]->SetXTitle("#it{E} (GeV)");
3577  fhNCellsTCardCorrelNAllSameTCardExotic[i][tm]->SetYTitle("#it{n}_{cells}");
3578  outputContainer->Add(fhNCellsTCardCorrelNAllSameTCardExotic[i][tm]);
3579 
3581  (Form("hColRowTCardCorrelNAllSameTCardLowEExotic_Case%d%s",i,add[tm].Data()),
3582  Form("column vs row, max E cell correl with TCard cell, exo > 0.97, E > 2 GeV, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3583  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3584  fhColRowTCardCorrelNAllSameTCardLowEExotic[i][tm]->SetYTitle("row");
3585  fhColRowTCardCorrelNAllSameTCardLowEExotic[i][tm]->SetXTitle("column");
3586  outputContainer->Add(fhColRowTCardCorrelNAllSameTCardLowEExotic[i][tm]) ;
3587 
3589  (Form("hColRowTCardCorrelNAllSameTCardHighEExotic_Case%d%s",i,add[tm].Data()),
3590  Form("column vs row, max E cell correl with TCard cell, exo > 0.97, E > 8 GeV, N corr = %d, no other TCard cells %s",i,add[tm].Data()),
3591  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3592  fhColRowTCardCorrelNAllSameTCardHighEExotic[i][tm]->SetYTitle("row");
3593  fhColRowTCardCorrelNAllSameTCardHighEExotic[i][tm]->SetXTitle("column");
3594  outputContainer->Add(fhColRowTCardCorrelNAllSameTCardHighEExotic[i][tm]) ;
3595  }
3596 
3597  for(Int_t i = 0; i < 7; i++)
3598  {
3599  fhLambda0TCardCorrel[i][tm] = new TH2F
3600  (Form("hLambda0TCardCorrel_Case%d%s",i,add[tm].Data()),
3601  Form("#lambda^{2}_{0} vs #it{E}, max E cell correl with TCard cell, case %d %s",i,add[tm].Data()),
3602  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3603  fhLambda0TCardCorrel[i][tm]->SetXTitle("#it{E} (GeV)");
3604  fhLambda0TCardCorrel[i][tm]->SetYTitle("#lambda^{2}_{0}");
3605  outputContainer->Add(fhLambda0TCardCorrel[i][tm]);
3606 
3607  fhNCellsTCardCorrel[i][tm] = new TH2F
3608  (Form("hNCellsTCardCorrel_Case%d%s",i,add[tm].Data()),
3609  Form("custer # cells vs #it{E}, w > 0.01, max E cell correl with TCard cell, case %d %s",i,add[tm].Data()),
3610  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3611  fhNCellsTCardCorrel[i][tm]->SetXTitle("#it{E} (GeV)");
3612  fhNCellsTCardCorrel[i][tm]->SetYTitle("#it{n}_{cells}");
3613  outputContainer->Add(fhNCellsTCardCorrel[i][tm]);
3614 
3615  fhExoticTCardCorrel[i][tm] = new TH2F
3616  (Form("hExoticTCardCorrel_Case%d%s",i,add[tm].Data()),
3617  Form("exoticity vs #it{E}, max E cell correl with TCard cell, N corr = %d %s",i,add[tm].Data()),
3618  nptbins,ptmin,ptmax,200,-1,1);
3619  fhExoticTCardCorrel[i][tm]->SetXTitle("#it{E} (GeV)");
3620  fhExoticTCardCorrel[i][tm]->SetYTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3621  outputContainer->Add(fhExoticTCardCorrel[i][tm]);
3622  }
3623 
3624  for(Int_t i = 0; i < 4; i++)
3625  {
3626  fhLambda0TCardCorrelExotic[i][tm] = new TH2F
3627  (Form("hLambda0TCardCorrel_Exotic_Case%d%s",i,add[tm].Data()),
3628  Form("#lambda^{2}_{0} vs #it{E}, max E cell correl with TCard cell, exo>0.97, case %d %s",i,add[tm].Data()),
3629  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3630  fhLambda0TCardCorrelExotic[i][tm]->SetXTitle("#it{E} (GeV)");
3631  fhLambda0TCardCorrelExotic[i][tm]->SetYTitle("#lambda^{2}_{0}");
3632  outputContainer->Add(fhLambda0TCardCorrelExotic[i][tm]);
3633 
3634  fhNCellsTCardCorrelExotic[i][tm] = new TH2F
3635  (Form("hNCellsTCardCorrel_Exotic_Case%d%s",i,add[tm].Data()),
3636  Form("custer # cells vs #it{E}, w > 0.01, max E cell correl with TCard cell, exot > 0.97,case %d %s",i,add[tm].Data()),
3637  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3638  fhNCellsTCardCorrelExotic[i][tm]->SetXTitle("#it{E} (GeV)");
3639  fhNCellsTCardCorrelExotic[i][tm]->SetYTitle("#it{n}_{cells}");
3640  outputContainer->Add(fhNCellsTCardCorrelExotic[i][tm]);
3641  }
3642 
3643  for(Int_t i = 0; i < fNEBinCuts; i++)
3644  {
3645  fhLambda0Exoticity[i][tm] = new TH2F
3646  (Form("hLambda0Exoticity_EBin%d%s",i,add[tm].Data()),
3647  Form("#lambda^{2}_{0} vs #it{exoticity}, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3648  200,-1,1,ssbins,ssmin,ssmax);
3649  fhLambda0Exoticity[i][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3650  fhLambda0Exoticity[i][tm]->SetYTitle("#lambda^{2}_{0}");
3651  outputContainer->Add(fhLambda0Exoticity[i][tm]);
3652 
3653  fhLambda1Exoticity[i][tm] = new TH2F
3654  (Form("hLambda1Exoticity_EBin%d%s",i,add[tm].Data()),
3655  Form("#lambda^{2}_{1} vs #it{exoticity}, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3656  200,-1,1,ssbins,ssmin,ssmax);
3657  fhLambda1Exoticity[i][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3658  fhLambda1Exoticity[i][tm]->SetYTitle("#lambda^{2}_{1}");
3659  outputContainer->Add(fhLambda1Exoticity[i][tm]);
3660 
3661  fhLambdaRExoticity[i][tm] = new TH2F
3662  (Form("hLambdaRExoticity_EBin%d%s",i,add[tm].Data()),
3663  Form("#lambda^{2}_{1}/#lambda^{2}_{0} vs #it{exoticity}, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3664  200,-1,1,110,0,1.1);
3665  fhLambdaRExoticity[i][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3666  fhLambdaRExoticity[i][tm]->SetYTitle("#lambda^{2}_{1}/#lambda^{2}_{0}");
3667  outputContainer->Add(fhLambdaRExoticity[i][tm]);
3668 
3669  fhNCellsExoticity[i][tm] = new TH2F
3670  (Form("hNCellsExoticity_EBin%d%s",i,add[tm].Data()),
3671  Form("#it{n}_{cells} vs #it{exoticity}, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3672  200,-1,1,nceclbins,nceclmin,nceclmax);
3673  fhNCellsExoticity[i][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3674  fhNCellsExoticity[i][tm]->SetYTitle("#it{n}_{cells}");
3675  outputContainer->Add(fhNCellsExoticity[i][tm]);
3676 
3677  fhLambda0Lambda1[i][tm] = new TH2F
3678  (Form("hLambda0Lambda1_EBin%d%s",i,add[tm].Data()),
3679  Form("#lambda^{2}_{0} vs #lambda^{2}_{1}, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3680  200,-1,1,ssbins,ssmin,ssmax);
3681  fhLambda0Lambda1[i][tm]->SetXTitle("#lambda^{2}_{1}");
3682  fhLambda0Lambda1[i][tm]->SetYTitle("#lambda^{2}_{0}");
3683  outputContainer->Add(fhLambda0Lambda1[i][tm]);
3684 
3685  fhLambda0ExoticityAllSameTCard[i][tm] = new TH2F
3686  (Form("hLambda0ExoticityAllSameTCard_EBin%d%s",i,add[tm].Data()),
3687  Form("#lambda^{2}_{0} vs #it{exoticity}, all cells same TCard as leading, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3688  200,-1,1,ssbins,ssmin,ssmax);
3689  fhLambda0ExoticityAllSameTCard[i][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3690  fhLambda0ExoticityAllSameTCard[i][tm]->SetYTitle("#lambda^{2}_{0}");
3691  outputContainer->Add(fhLambda0ExoticityAllSameTCard[i][tm]);
3692 
3693  fhLambda1ExoticityAllSameTCard[i][tm] = new TH2F
3694  (Form("hLambda1ExoticityAllSameTCard_EBin%d%s",i,add[tm].Data()),
3695  Form("#lambda^{2}_{1} vs #it{exoticity}, all cells same TCard as leading, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3696  200,-1,1,ssbins,ssmin,ssmax);
3697  fhLambda1ExoticityAllSameTCard[i][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3698  fhLambda1ExoticityAllSameTCard[i][tm]->SetYTitle("#lambda^{2}_{1}");
3699  outputContainer->Add(fhLambda1ExoticityAllSameTCard[i][tm]);
3700 
3701  fhLambdaRExoticityAllSameTCard[i][tm] = new TH2F
3702  (Form("hLambdaRExoticityAllSameTCard_EBin%d%s",i,add[tm].Data()),
3703  Form("#lambda^{2}_{1}/#lambda^{2}_{0} vs #it{exoticity}, all cells same TCard as leading, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3704  200,-1,1,110,0,1.1);
3705  fhLambdaRExoticityAllSameTCard[i][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3706  fhLambdaRExoticityAllSameTCard[i][tm]->SetYTitle("#lambda^{2}_{1}/#lambda^{2}_{0}");
3707  outputContainer->Add(fhLambdaRExoticityAllSameTCard[i][tm]);
3708 
3709  fhNCellsExoticityAllSameTCard[i][tm] = new TH2F
3710  (Form("hNCellsExoticityAllSameTCard_EBin%d%s",i,add[tm].Data()),
3711  Form("#it{n}_{cells} vs #it{exoticity}, all cells same TCard as leading, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3712  200,-1,1,nceclbins,nceclmin,nceclmax);
3713  fhNCellsExoticityAllSameTCard[i][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3714  fhNCellsExoticityAllSameTCard[i][tm]->SetYTitle("#it{n}_{cells}");
3715  outputContainer->Add(fhNCellsExoticityAllSameTCard[i][tm]);
3716 
3717  fhLambda0Lambda1AllSameTCard[i][tm] = new TH2F
3718  (Form("hLambda0Lambda1_EBin%d%s",i,add[tm].Data()),
3719  Form("#lambda^{2}_{0} vs #lambda^{2}_{1}, , all cells same TCard as leading, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3720  200,-1,1,ssbins,ssmin,ssmax);
3721  fhLambda0Lambda1AllSameTCard[i][tm]->SetXTitle("#lambda^{2}_{1}");
3722  fhLambda0Lambda1AllSameTCard[i][tm]->SetYTitle("#lambda^{2}_{0}");
3723  outputContainer->Add(fhLambda0Lambda1AllSameTCard[i][tm]);
3724 
3725  fhNCellsTCardSameAndDiff[i][tm] = new TH2F
3726  (Form("fhNCellsTCardSameAndDiff_EBin%d%s",i,add[tm].Data()),
3727  Form("#it{n}_{cells} same TCard vs diff TCard, w > 0.01, %2.2f<#it{E}<%2.2f GeV %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3728  nceclbins,nceclmin,nceclmax,nceclbins,nceclmin,nceclmax);
3729  fhNCellsTCardSameAndDiff[i][tm]->SetXTitle("#it{n}_{cells} - diff TCard");
3730  fhNCellsTCardSameAndDiff[i][tm]->SetYTitle("#it{n}_{cells} - same TCard");
3731  outputContainer->Add(fhNCellsTCardSameAndDiff[i][tm]);
3732 
3733  fhNCellsTCardSameAndDiffExotic[i][tm] = new TH2F
3734  (Form("fhNCellsTCardSameAndDiff_Exotic_EBin%d%s",i,add[tm].Data()),
3735  Form("#it{n}_{cells} same TCard vs diff TCard, w > 0.01, %2.2f<#it{E}<%2.2f GeV, exo > 0.97 %s",fEBinCuts[i],fEBinCuts[i+1],add[tm].Data()),
3736  nceclbins,nceclmin,nceclmax,nceclbins,nceclmin,nceclmax);
3737  fhNCellsTCardSameAndDiffExotic[i][tm]->SetXTitle("#it{n}_{cells} - diff TCard");
3738  fhNCellsTCardSameAndDiffExotic[i][tm]->SetYTitle("#it{n}_{cells} - same TCard");
3739  outputContainer->Add(fhNCellsTCardSameAndDiffExotic[i][tm]);
3740  }
3741 
3742  for(Int_t j = 0; j < 6; j++)
3743  {
3744  for(Int_t k = 0; k < 6; k++)
3745  {
3746  fhLambda0ExoticityPerNCell[j][k][tm] = new TH2F
3747  (Form("hLambda0Exoticity_NCell_Same%d_Diff%d%s",j,k,add[tm].Data()),
3748  Form("#lambda^{2}_{0} vs #it{exoticity}, #it{n}_{cell} TCard same = %d, diff =%d, #it{E}>8 GeV %s",j,k,add[tm].Data()),
3749  200,-1,1,ssbins,ssmin,ssmax);
3750  fhLambda0ExoticityPerNCell[j][k][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3751  fhLambda0ExoticityPerNCell[j][k][tm]->SetYTitle("#lambda^{2}_{0}");
3752  outputContainer->Add(fhLambda0ExoticityPerNCell[j][k][tm]);
3753 
3754  fhLambda1ExoticityPerNCell[j][k][tm] = new TH2F
3755  (Form("hLambda1Exoticity_NCell_Same%d_Diff%d%s",j,k,add[tm].Data()),
3756  Form("#lambda^{2}_{1} vs #it{exoticity}, #it{n}_{cell} TCard same = %d, diff =%d, #it{E}>8 GeV %s",j,k,add[tm].Data()),
3757  200,-1,1,ssbins,ssmin,ssmax);
3758  fhLambda1ExoticityPerNCell[j][k][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3759  fhLambda1ExoticityPerNCell[j][k][tm]->SetYTitle("#lambda^{2}_{1}");
3760  outputContainer->Add(fhLambda1ExoticityPerNCell[j][k][tm]);
3761 
3762  fhLambdaRExoticityPerNCell[j][k][tm] = new TH2F
3763  (Form("hLambdaRExoticity_NCell_Same%d_Diff%d%s",j,k,add[tm].Data()),
3764  Form("#lambda^{2}_{1}/#lambda^{2}_{0} vs #it{exoticity}, #it{n}_{cell} TCard same = %d, diff =%d, #it{E}>8 GeV %s",j,k,add[tm].Data()),
3765  200,-1,1,110,0,1.1);
3766  fhLambdaRExoticityPerNCell[j][k][tm]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3767  fhLambdaRExoticityPerNCell[j][k][tm]->SetYTitle("#lambda^{2}_{1}/#lambda^{2}_{0}");
3768  outputContainer->Add(fhLambdaRExoticityPerNCell[j][k][tm]);
3769  }
3770  }
3771 
3772 
3773 // for(Int_t i = 0; i < 6; i++)
3774 // {
3775 // fhLambda0TCardCorrelNearRow[i][tm] = new TH2F
3776 // (Form("hLambda0TCardCorrelNearRow_Case%d%s",i,add[tm].Data()),
3777 // Form("#lambda^{2}_{0} vs #it{E}, max E cell correl with TCard cell, one TCard cell is 1 row away, case %d %s",i,add[tm].Data()),
3778 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3779 // fhLambda0TCardCorrelNearRow[i][tm]->SetXTitle("#it{E} (GeV)");
3780 // fhLambda0TCardCorrelNearRow[i][tm]->SetYTitle("#lambda^{2}_{0}");
3781 // outputContainer->Add(fhLambda0TCardCorrelNearRow[i][tm]);
3782 //
3783 // fhNCellsTCardCorrelNearRow[i][tm] = new TH2F
3784 // (Form("hNCellsTCardCorrelNearRow_Case%d%s",i,add[tm].Data()),
3785 // Form("custer # cells vs #it{E}, w > 0.01, max E cell correl with TCard cell, case %d %s",i,add[tm].Data()),
3786 // nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3787 // fhNCellsTCardCorrelNearRow[i][tm]->SetXTitle("#it{E} (GeV)");
3788 // fhNCellsTCardCorrelNearRow[i][tm]->SetYTitle("#it{n}_{cells}");
3789 // outputContainer->Add(fhNCellsTCardCorrelNearRow[i][tm]);
3790 // }
3791 //
3792 // for(Int_t i = 0; i < 4; i++)
3793 // {
3794 // fhLambda0TCardCorrel2ndMax[i][tm] = new TH2F
3795 // (Form("hLambda0TCardCorrel2ndMax_Case%d%s",i,add[tm].Data()),
3796 // Form("#lambda^{2}_{0} vs #it{E}, max E cell correl with 2nd max TCard cell, case %d %s",i,add[tm].Data()),
3797 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3798 // fhLambda0TCardCorrel2ndMax[i][tm]->SetXTitle("#it{E} (GeV)");
3799 // fhLambda0TCardCorrel2ndMax[i][tm]->SetYTitle("#lambda^{2}_{0}");
3800 // outputContainer->Add(fhLambda0TCardCorrel2ndMax[i][tm]);
3801 //
3802 // fhNCellsTCardCorrel2ndMax[i][tm] = new TH2F
3803 // (Form("hNCellsTCardCorrel2ndMax_Case%d%s",i,add[tm].Data()),
3804 // Form("custer # cells vs #it{E}, w > 0.01, max E cell correl with 2nd max TCard cell, case %d %s",i,add[tm].Data()),
3805 // nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3806 // fhNCellsTCardCorrel2ndMax[i][tm]->SetXTitle("#it{E} (GeV)");
3807 // fhNCellsTCardCorrel2ndMax[i][tm]->SetYTitle("#it{n}_{cells}");
3808 // outputContainer->Add(fhNCellsTCardCorrel2ndMax[i][tm]);
3809 // }
3810 
3811  for(Int_t i = 0; i < 7; i++)
3812  {
3813  fhLambda0TCardCorrelOtherTCard[i][tm] = new TH2F
3814  (Form("hLambda0TCardCorrelOtherTCard_Case%d%s",i,add[tm].Data()),
3815  Form("#lambda^{2}_{0} vs #it{E}, correlation of cells in different TCards, case %d %s",i,add[tm].Data()),
3816  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3817  fhLambda0TCardCorrelOtherTCard[i][tm]->SetXTitle("#it{E} (GeV)");
3818  fhLambda0TCardCorrelOtherTCard[i][tm]->SetYTitle("#lambda^{2}_{0}");
3819  outputContainer->Add(fhLambda0TCardCorrelOtherTCard[i][tm]);
3820 
3821  fhNCellsTCardCorrelOtherTCard[i][tm] = new TH2F
3822  (Form("hNCellsTCardCorrelOtherTCard_Case%d%s",i,add[tm].Data()),
3823  Form("custer # cells vs #it{E}, w > 0.01, correlation of cells in different TCards, case %d %s",i,add[tm].Data()),
3824  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
3825  fhNCellsTCardCorrelOtherTCard[i][tm]->SetXTitle("#it{E} (GeV)");
3826  fhNCellsTCardCorrelOtherTCard[i][tm]->SetYTitle("#it{n}_{cells}");
3827  outputContainer->Add(fhNCellsTCardCorrelOtherTCard[i][tm]);
3828 
3829  fhExoticTCardCorrelOtherTCard[i][tm] = new TH2F
3830  (Form("hExoticTCardCorrelOtherTCard_Case%d%s",i,add[tm].Data()),
3831  Form("exoticity vs #it{E}, w > 0.01, correlation of cells in different TCards, case %d %s",i,add[tm].Data()),
3832  nptbins,ptmin,ptmax,200,-1,1);
3833  fhExoticTCardCorrelOtherTCard[i][tm]->SetXTitle("#it{E} (GeV)");
3834  fhExoticTCardCorrelOtherTCard[i][tm]->SetYTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3835  outputContainer->Add(fhExoticTCardCorrelOtherTCard[i][tm]);
3836 
3838  (Form("hColRowTCardCorrelOtherTCardLowE_Case%d%s",i,add[tm].Data()),
3839  Form("column vs row for different 2 TCard correlation cases, E > 2 GeV, case %d %s",i,add[tm].Data()),
3840  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3841  fhColRowTCardCorrelOtherTCardLowE[i][tm]->SetYTitle("row");
3842  fhColRowTCardCorrelOtherTCardLowE[i][tm]->SetXTitle("column");
3843  outputContainer->Add(fhColRowTCardCorrelOtherTCardLowE[i][tm]) ;
3844 
3846  (Form("hColRowTCardCorrelOtherTCardHighE_Case%d%s",i,add[tm].Data()),
3847  Form("column vs row for different 2 TCard correlation cases, E > 8 GeV, case %d %s",i,add[tm].Data()),
3848  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3849  fhColRowTCardCorrelOtherTCardHighE[i][tm]->SetYTitle("row");
3850  fhColRowTCardCorrelOtherTCardHighE[i][tm]->SetXTitle("column");
3851  outputContainer->Add(fhColRowTCardCorrelOtherTCardHighE[i][tm]) ;
3852  }
3853 
3854  for(Int_t i = 0; i < 12; i++)
3855  {
3856  fhTCardCorrECellMaxDiff[i][tm] = new TH2F
3857  (Form("hTCardCorrECellMaxDiff_Case%d%s",i,add[tm].Data()),
3858  Form("#it{E}_{cell}^{max}-#it{E}_{cell} vs #it{E}_{cluster}, for (un)correlated cells in TCard, case %d %s",i,add[tm].Data()),
3859  nptbins,ptmin,ptmax,210,-1,20);
3860  fhTCardCorrECellMaxDiff[i][tm]->SetXTitle("#it{E} (GeV)");
3861  fhTCardCorrECellMaxDiff[i][tm]->SetYTitle("#it{E}_{cell}^{max}-#it{E}_{cell} (GeV)");
3862  outputContainer->Add(fhTCardCorrECellMaxDiff[i][tm]);
3863 
3864  fhTCardCorrEClusterDiff[i][tm] = new TH2F
3865  (Form("hTCardCorrEClusterDiff_Case%d%s",i,add[tm].Data()),
3866  Form("#it{E}_{cluster}-#it{E}_{cell} vs #it{E}_{cluster}, for (un)correlated cells in TCard, case %d %s",i,add[tm].Data()),
3867  nptbins,ptmin,ptmax,210,-1,20);
3868  fhTCardCorrEClusterDiff[i][tm]->SetXTitle("#it{E} (GeV)");
3869  fhTCardCorrEClusterDiff[i][tm]->SetYTitle("#it{E}_{cluster}-#it{E}_{cell} (GeV)");
3870  outputContainer->Add(fhTCardCorrEClusterDiff[i][tm]);
3871 
3872  fhTCardCorrECellMaxRat[i][tm] = new TH2F
3873  (Form("hTCardCorrECellMaxRat_Case%d%s",i,add[tm].Data()),
3874  Form("#it{E}_{cell}/#it{E}_{cell}^{max} vs #it{E}_{cluster}, for (un)correlated cells in TCard, case %d %s",i,add[tm].Data()),
3875  nptbins,ptmin,ptmax,110,0,1.1);
3876  fhTCardCorrECellMaxRat[i][tm]->SetXTitle("#it{E} (GeV)");
3877  fhTCardCorrECellMaxRat[i][tm]->SetYTitle("#it{E}_{cell}/#it{E}^{max}_{cell}");
3878  outputContainer->Add(fhTCardCorrECellMaxRat[i][tm]);
3879 
3880  fhTCardCorrEClusterRat[i][tm] = new TH2F
3881  (Form("hTCardCorrEClusterRat_Case%d%s",i,add[tm].Data()),
3882  Form("#it{E}_{cell}/#it{E}_{cluster} vs #it{E}_{cluster}, for (un)correlated cells in TCard, case %d %s",i,add[tm].Data()),
3883  nptbins,ptmin,ptmax,110,0,1.1);
3884  fhTCardCorrEClusterRat[i][tm]->SetXTitle("#it{E} (GeV)");
3885  fhTCardCorrEClusterRat[i][tm]->SetYTitle("#it{E}_{cell}/#it{E}_{cluster}");
3886  outputContainer->Add(fhTCardCorrEClusterRat[i][tm]);
3887 
3888  fhTCardCorrTCellMaxDiff[i][tm] = new TH2F
3889  (Form("hTCardCorrTCellMaxDiff_Case%d%s",i,add[tm].Data()),
3890  Form("#it{t}_{cell}^{max}-#it{t}_{cell} vs #it{E}_{cluster}, for (un)correlated cells in TCard, case %d %s",i,add[tm].Data()),
3891  nptbins,ptmin,ptmax,1000,-100,100);
3892  fhTCardCorrTCellMaxDiff[i][tm]->SetXTitle("#it{E} (GeV)");
3893  fhTCardCorrTCellMaxDiff[i][tm]->SetYTitle("#it{t}_{cell}^{max}-#it{t}_{cell} (ns)");
3894  outputContainer->Add(fhTCardCorrTCellMaxDiff[i][tm]);
3895 
3896  fhTCardCorrECellMaxDiffExo[i][tm] = new TH2F
3897  (Form("hTCardCorrECellMaxDiffExo_Case%d%s",i,add[tm].Data()),
3898  Form("#it{E}_{cell}^{max}-#it{E}_{cell} vs #it{E}_{cluster}, for (un)correlated cells in TCard, exoticity > 0.97, case %d %s",i,add[tm].Data()),
3899  nptbins,ptmin,ptmax,210,-1,20);
3900  fhTCardCorrECellMaxDiffExo[i][tm]->SetXTitle("#it{E} (GeV)");
3901  fhTCardCorrECellMaxDiffExo[i][tm]->SetYTitle("#it{E}_{cell}^{max}-#it{E}_{cell} (GeV)");
3902  outputContainer->Add(fhTCardCorrECellMaxDiffExo[i][tm]);
3903 
3904  fhTCardCorrEClusterDiffExo[i][tm] = new TH2F
3905  (Form("hTCardCorrEClusterDiffExo_Case%d%s",i,add[tm].Data()),
3906  Form("#it{E}_{cluster}-#it{E}_{cell} vs #it{E}_{cluster}, for (un)correlated cells in TCard, exoticity > 0.97, case %d %s",i,add[tm].Data()),
3907  nptbins,ptmin,ptmax,210,-1,20);
3908  fhTCardCorrEClusterDiffExo[i][tm]->SetXTitle("#it{E} (GeV)");
3909  fhTCardCorrEClusterDiffExo[i][tm]->SetYTitle("#it{E}_{cluster}-#it{E}_{cell} (GeV)");
3910  outputContainer->Add(fhTCardCorrEClusterDiffExo[i][tm]);
3911 
3912  fhTCardCorrECellMaxRatExo[i][tm] = new TH2F
3913  (Form("hTCardCorrECellMaxRatExo_Case%d%s",i,add[tm].Data()),
3914  Form("#it{E}_{cell}/#it{E}_{cell}^{max} vs #it{E}_{cluster}, for (un)correlated cells in TCard, exoticity > 0.97, case %d %s",i,add[tm].Data()),
3915  nptbins,ptmin,ptmax,110,0,1.1);
3916  fhTCardCorrECellMaxRatExo[i][tm]->SetXTitle("#it{E} (GeV)");
3917  fhTCardCorrECellMaxRatExo[i][tm]->SetYTitle("#it{E}_{cell}/#it{E}^{max}_{cell}");
3918  outputContainer->Add(fhTCardCorrECellMaxRatExo[i][tm]);
3919 
3920  fhTCardCorrEClusterRatExo[i][tm] = new TH2F
3921  (Form("hTCardCorrEClusterRatExo_Case%d%s",i,add[tm].Data()),
3922  Form("#it{E}_{cell}/#it{E}_{cluster} vs #it{E}_{cluster}, for (un)correlated cells in TCard, exoticity > 0.97, case %d %s",i,add[tm].Data()),
3923  nptbins,ptmin,ptmax,110,0,1.1);
3924  fhTCardCorrEClusterRatExo[i][tm]->SetXTitle("#it{E} (GeV)");
3925  fhTCardCorrEClusterRatExo[i][tm]->SetYTitle("#it{E}_{cell}/#it{E}_{cluster}");
3926  outputContainer->Add(fhTCardCorrEClusterRatExo[i][tm]);
3927 
3928  fhTCardCorrTCellMaxDiffExo[i][tm] = new TH2F
3929  (Form("hTCardCorrTCellMaxDiffExo_Case%d%s",i,add[tm].Data()),
3930  Form("#it{t}_{cell}^{max}-#it{t}_{cell} vs #it{E}_{cluster}, for (un)correlated cells in TCard, exoticity > 0.97, case %d %s",i,add[tm].Data()),
3931  nptbins,ptmin,ptmax,1000,-100,100);
3932  fhTCardCorrTCellMaxDiffExo[i][tm]->SetXTitle("#it{E} (GeV)");
3933  fhTCardCorrTCellMaxDiffExo[i][tm]->SetYTitle("#it{t}_{cell}^{max}-#it{t}_{cell} (ns)");
3934  outputContainer->Add(fhTCardCorrTCellMaxDiffExo[i][tm]);
3935  }
3936  } // neutral or charged
3937 
3938  for(Int_t i = 0; i < fNEBinCuts; i++)
3939  {
3940  fhTMPhiResidualExoticity[i] = new TH2F
3941  (Form("hTMPhiResidual_EBin%d",i),
3942  Form("#Delta #varphi_{cluster-track} vs #it{exoticity}, %2.2f<#it{E}<%2.2f GeV",fEBinCuts[i],fEBinCuts[i+1]),
3943  200,-1,1,nresphibins,resphimin,resphimax);
3944  fhTMPhiResidualExoticity[i]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3945  fhTMPhiResidualExoticity[i]->SetYTitle("#Delta #varphi_{cluster-track}");
3946  outputContainer->Add(fhTMPhiResidualExoticity[i]);
3947 
3948  fhTMEtaResidualExoticity[i] = new TH2F
3949  (Form("hTMEtaResidual_EBin%d",i),
3950  Form("#Delta #eta_{cluster-track} vs #it{exoticity}, %2.2f<#it{E}<%2.2f GeV",fEBinCuts[i],fEBinCuts[i+1]),
3951  200,-1,1,nresetabins,resetamin,resetamax);
3952  fhTMEtaResidualExoticity[i]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3953  fhTMEtaResidualExoticity[i]->SetYTitle("#Delta #eta_{cluster-track}");
3954  outputContainer->Add(fhTMEtaResidualExoticity[i]);
3955 
3957  (Form("hTMPhiResidualAllSameTCard_EBin%d",i),
3958  Form("#Delta #varphi_{cluster-track} vs #it{exoticity}, all cells same TCard as leading, %2.2f<#it{E}<%2.2f GeV",fEBinCuts[i],fEBinCuts[i+1]),
3959  200,-1,1,nresphibins,resphimin,resphimax);
3960  fhTMPhiResidualExoticityAllSameTCard[i]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3961  fhTMPhiResidualExoticityAllSameTCard[i]->SetYTitle("#Delta #varphi_{cluster-track}");
3962  outputContainer->Add(fhTMPhiResidualExoticityAllSameTCard[i]);
3963 
3965  (Form("hTMEtaResidualAllSameTCard_EBin%d",i),
3966  Form("#Delta #eta_{cluster-track} vs #it{exoticity}, all cells same TCard as leading, %2.2f<#it{E}<%2.2f GeV",fEBinCuts[i],fEBinCuts[i+1]),
3967  200,-1,1,nresetabins,resetamin,resetamax);
3968  fhTMEtaResidualExoticityAllSameTCard[i]->SetXTitle("#it{F}_{+}=1-#it{E}_{+}/#it{E}_{lead cell}");
3969  fhTMEtaResidualExoticityAllSameTCard[i]->SetYTitle("#Delta #eta_{cluster-track}");
3970  outputContainer->Add(fhTMEtaResidualExoticityAllSameTCard[i]);
3971  }
3972  } // TCard correlation studies
3973 
3974 
3975  fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
3976  nptbins,ptmin,ptmax, 100,0,1.);
3977  fhClusterMaxCellCloseCellRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
3978  fhClusterMaxCellCloseCellRatio->SetYTitle("#it{E}_{cell i}/#it{E}_{cell max}");
3979  outputContainer->Add(fhClusterMaxCellCloseCellRatio);
3980 
3981  fhClusterMaxCellCloseCellDiff = new TH2F ("hClusterMaxCellCloseCellDiff","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
3982  nptbins,ptmin,ptmax, 500,0,100.);
3983  fhClusterMaxCellCloseCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
3984  fhClusterMaxCellCloseCellDiff->SetYTitle("#it{E}_{cell max}-#it{E}_{cell i} (GeV)");
3985  outputContainer->Add(fhClusterMaxCellCloseCellDiff);
3986 
3987  fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
3988  nptbins,ptmin,ptmax, 500,0,1.);
3989  fhClusterMaxCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
3990  fhClusterMaxCellDiff->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
3991  outputContainer->Add(fhClusterMaxCellDiff);
3992 
3993  if(fStudyBadClusters)
3994  {
3995  fhClusterMaxCellDiffNoCut = new TH2F ("hClusterMaxCellDiffNoCut","energy vs difference of cluster energy - max cell energy / cluster energy",
3996  nptbins,ptmin,ptmax, 500,0,1.);
3997  fhClusterMaxCellDiffNoCut->SetXTitle("#it{E}_{cluster} (GeV) ");
3998  fhClusterMaxCellDiffNoCut->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
3999  outputContainer->Add(fhClusterMaxCellDiffNoCut);
4000  }
4001 
4002  fhClusterMaxCellECross = new TH2F ("hClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, good clusters",
4003  nptbins,ptmin,ptmax, 400,-1,1.);
4004  fhClusterMaxCellECross->SetXTitle("#it{E}_{cluster} (GeV) ");
4005  fhClusterMaxCellECross->SetYTitle("1- #it{E}_{cross}/#it{E}_{cell max}");
4006  outputContainer->Add(fhClusterMaxCellECross);
4007 
4008  if(fStudyBadClusters)
4009  {
4010  fhNCellsPerClusterNoCut = new TH2F ("hNCellsPerClusterNoCut","# cells per cluster vs energy, no bad clusters cut",
4011  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
4012  fhNCellsPerClusterNoCut->SetXTitle("#it{E} (GeV)");
4013  fhNCellsPerClusterNoCut->SetYTitle("#it{n}_{cells}");
4014  outputContainer->Add(fhNCellsPerClusterNoCut);
4015  }
4016 
4017  fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy",nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
4018  fhNCellsPerCluster->SetXTitle("#it{E} (GeV)");
4019  fhNCellsPerCluster->SetYTitle("#it{n}_{cells}");
4020  outputContainer->Add(fhNCellsPerCluster);
4021 
4023  {
4025  ("hNCellsPerClusterWithWeight","# cells per cluster vs energy",nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
4026  fhNCellsPerClusterWithWeight->SetXTitle("#it{E} (GeV)");
4027  fhNCellsPerClusterWithWeight->SetYTitle("#it{n}_{cells}");
4028  outputContainer->Add(fhNCellsPerClusterWithWeight);
4029 
4031  ("hNCellsPerClusterRatioWithWeight","# cells per cluster vs energy",nptbins,ptmin,ptmax, 100,0,1);
4032  fhNCellsPerClusterRatioWithWeight->SetXTitle("#it{E} (GeV)");
4033  fhNCellsPerClusterRatioWithWeight->SetYTitle("#it{n}^{w>0.01}_{cells}/#it{n}_{cells}");
4034  outputContainer->Add(fhNCellsPerClusterRatioWithWeight);
4035  }
4036 
4037  if(fStudyBadClusters)
4038  {
4039  fhNCellsPerClusterWeirdModNoCut = new TH2F ("hNCellsPerClusterWeirdNoCutMod","# cells per cluster vs energy, E > 100, no bad clusters cut, per SM",
4040  nceclbins,nceclmin,nceclmax,fNModules,0,fNModules);
4041  fhNCellsPerClusterWeirdModNoCut->SetYTitle("SM number");
4042  fhNCellsPerClusterWeirdModNoCut->SetXTitle("#it{n}_{cells}");
4043  outputContainer->Add(fhNCellsPerClusterWeirdModNoCut);
4044  }
4045 
4046  fhNCellsPerClusterWeirdMod = new TH2F ("hNCellsPerClusterWeirdMod","# cells per cluster, E > 100 GeV, per SM",
4047  nceclbins*2,nceclmin,nceclmax*2,fNModules,0,fNModules);
4048  fhNCellsPerClusterWeirdMod->SetYTitle("SM number");
4049  fhNCellsPerClusterWeirdMod->SetXTitle("#it{n}_{cells}");
4050  outputContainer->Add(fhNCellsPerClusterWeirdMod);
4051 
4052  fhNClusters = new TH1F ("hNClusters","# clusters", nclbins,nclmin,nclmax);
4053  fhNClusters->SetXTitle("#it{n}_{clusters}");
4054  outputContainer->Add(fhNClusters);
4055 
4056  if(fStudyBadClusters)
4057  {
4058  fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
4059  fhBadClusterEnergy->SetXTitle("#it{E}_{cluster} (GeV) ");
4060  outputContainer->Add(fhBadClusterEnergy);
4061 
4062  fhBadClusterEtaPhi = new TH2F ("hBadClusterEtaPhi","Bad cluster, #eta vs #varphi, #it{E} > 0.5 GeV",
4063  netabins,etamin,etamax,nphibins,phimin,phimax);
4064  fhBadClusterEtaPhi->SetXTitle("#eta ");
4065  fhBadClusterEtaPhi->SetXTitle("#varphi (rad) ");
4066  outputContainer->Add(fhBadClusterEtaPhi);
4067 
4068  fhBadClusterLambda0 = new TH2F ("hBadClusterLambda0","Bad cluster,shower shape, #lambda^{2}_{0} vs E",
4069  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4070  fhBadClusterLambda0->SetXTitle("#it{E}_{cluster}");
4071  fhBadClusterLambda0->SetYTitle("#lambda^{2}_{0}");
4072  outputContainer->Add(fhBadClusterLambda0);
4073 
4074  fhBadClusterLambda1 = new TH2F ("hBadClusterLambda1","Bad cluster,shower shape, #lambda^{2}_{1} vs E for bad cluster ",
4075  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4076  fhBadClusterLambda1->SetXTitle("#it{E}_{cluster}");
4077  fhBadClusterLambda1->SetYTitle("#lambda^{2}_{1}");
4078  outputContainer->Add(fhBadClusterLambda1);
4079 
4080  fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
4081  nptbins,ptmin,ptmax, 100,0,1.);
4082  fhBadClusterMaxCellCloseCellRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
4083  fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
4084  outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
4085 
4086  fhBadClusterMaxCellCloseCellDiff = new TH2F ("hBadClusterMaxCellCloseCellDiff","energy vs ratio of max cell - neighbour cell constributing cell, reconstructed bad clusters",
4087  nptbins,ptmin,ptmax, 500,0,100);
4088  fhBadClusterMaxCellCloseCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
4089  fhBadClusterMaxCellCloseCellDiff->SetYTitle("#it{E}_{cell max} - #it{E}_{cell i} (GeV)");
4090  outputContainer->Add(fhBadClusterMaxCellCloseCellDiff);
4091 
4092  fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
4093  nptbins,ptmin,ptmax, 500,0,1.);
4094  fhBadClusterMaxCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
4095  fhBadClusterMaxCellDiff->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max}) / #it{E}_{cluster}");
4096  outputContainer->Add(fhBadClusterMaxCellDiff);
4097 
4098  fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
4099  nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
4100  fhBadClusterTimeEnergy->SetXTitle("#it{E}_{cluster} (GeV) ");
4101  fhBadClusterTimeEnergy->SetYTitle("#it{t} (ns)");
4102  outputContainer->Add(fhBadClusterTimeEnergy);
4103 
4104  fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
4105  fhBadClusterPairDiffTimeE->SetXTitle("#it{E}_{bad cluster} (GeV)");
4106  fhBadClusterPairDiffTimeE->SetYTitle("#Delta #it{t} (ns)");
4107  outputContainer->Add(fhBadClusterPairDiffTimeE);
4108 
4109  fhBadClusterMaxCellECross = new TH2F ("hBadClusterMaxCellECross","1 - #it{E}_{+} around max energy cell / max energy cell vs cluster energy, bad clusters",
4110  nptbins,ptmin,ptmax, 400,-1,1.);
4111  fhBadClusterMaxCellECross->SetXTitle("#it{E}_{cluster} (GeV) ");
4112  fhBadClusterMaxCellECross->SetYTitle("1- #it{E}_{cross}/#it{E}_{cell max}");
4113  outputContainer->Add(fhBadClusterMaxCellECross);
4114 
4116  {
4117  fhBadCellTimeSpreadRespectToCellMax = new TH2F ("hBadCellTimeSpreadRespectToCellMax","#it{t}_{cell max}-#it{t}_{cell i} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
4118  fhBadCellTimeSpreadRespectToCellMax->SetXTitle("#it{E} (GeV)");
4119  fhBadCellTimeSpreadRespectToCellMax->SetYTitle("#Delta #it{t}_{cell max - i} (ns)");
4120  outputContainer->Add(fhBadCellTimeSpreadRespectToCellMax);
4121 
4122  fhBadClusterMaxCellDiffAverageTime = new TH2F ("hBadClusterMaxCellDiffAverageTime","#it{t}_{cell max}-#it{t}_{average} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
4123  fhBadClusterMaxCellDiffAverageTime->SetXTitle("#it{E} (GeV)");
4124  fhBadClusterMaxCellDiffAverageTime->SetYTitle("#Delta #it{t}_{cell max - average} (ns)");
4125  outputContainer->Add(fhBadClusterMaxCellDiffAverageTime);
4126 
4127  fhBadClusterMaxCellDiffWeightedTime = new TH2F ("hBadClusterMaxCellDiffWeightedTime","#it{t}_{cell max}-#it{t}_{weighted} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
4128  fhBadClusterMaxCellDiffWeightedTime->SetXTitle("#it{E} (GeV)");
4129  fhBadClusterMaxCellDiffWeightedTime->SetYTitle("#Delta #it{t}_{cell max - weighted} (ns)");
4130  outputContainer->Add(fhBadClusterMaxCellDiffWeightedTime);
4131 
4132  }
4133 
4134  }
4135 
4136  if(fStudyExotic)
4137  {
4138  fhExoL0ECross = new TH2F("hExoL0_ECross",
4139  "#lambda^{2}_{0} vs 1-#it{E}_{+}/#it{E}_{max} for E > 5 GeV",
4140  400,0,1,ssbins,ssmin,ssmax);
4141  fhExoL0ECross ->SetXTitle("1-#it{E}_{+}/#it{E}_{cell max}");
4142  fhExoL0ECross ->SetYTitle("#lambda^{2}_{0}");
4143  outputContainer->Add(fhExoL0ECross) ;
4144 
4145  fhExoL1ECross = new TH2F("hExoL1_ECross",
4146  "#lambda^{2}_{1} vs 1-#it{E}_{+}/#it{E}_{max} for E > 5 GeV",
4147  400,0,1,ssbins,ssmin,ssmax);
4148  fhExoL1ECross ->SetXTitle("1-#it{E}_{+}/#it{E}_{cell max}");
4149  fhExoL1ECross ->SetYTitle("#lambda^{2}_{1}");
4150  outputContainer->Add(fhExoL1ECross) ;
4151 
4152  for(Int_t ie = 0; ie <fExoNECrossCuts; ie++)
4153  {
4154 
4155  fhExoDTime[ie] = new TH2F(Form("hExoDTime_ECross%d",ie),
4156  Form("#Delta time = t_{max}-t_{cells} vs #it{E}_{cluster} for exotic, 1-#it{E}_{+}/#it{E}_{max} < %2.2f",fExoECrossCuts[ie]),
4157  nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
4158  fhExoDTime[ie] ->SetYTitle("#Delta #it{t} (ns)");
4159  fhExoDTime[ie] ->SetXTitle("#it{E} (GeV)");
4160  outputContainer->Add(fhExoDTime[ie]) ;
4161 
4162  for(Int_t idt = 0; idt < fExoNDTimeCuts; idt++)
4163  {
4164  fhExoNCell[ie][idt] = new TH2F(Form("hExoNCell_ECross%d_DT%d",ie,idt),
4165  Form("N cells per cluster vs E cluster, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t < %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
4166  nptbins,ptmin,ptmax,nceclbins,nceclmin,nceclmax);
4167  fhExoNCell[ie][idt] ->SetYTitle("#it{n}_cells");
4168  fhExoNCell[ie][idt] ->SetXTitle("#it{E} (GeV)");
4169  outputContainer->Add(fhExoNCell[ie][idt]) ;
4170 
4171  fhExoL0 [ie][idt] = new TH2F(Form("hExoL0_ECross%d_DT%d",ie,idt),
4172  Form("#lambda^{2}_{0} vs E cluster for exotic, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
4173  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4174  fhExoL0 [ie][idt] ->SetYTitle("#lambda^{2}_{0}");
4175  fhExoL0 [ie][idt] ->SetXTitle("#it{E} (GeV)");
4176  outputContainer->Add(fhExoL0[ie][idt]) ;
4177 
4178  fhExoL1 [ie][idt] = new TH2F(Form("hExoL1_ECross%d_DT%d",ie,idt),
4179  Form("#lambda^{2}_{1} vs E cluster for exotic, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
4180  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4181  fhExoL1 [ie][idt] ->SetYTitle("#lambda^{2}_{1}");
4182  fhExoL1 [ie][idt] ->SetXTitle("#it{E} (GeV)");
4183  outputContainer->Add(fhExoL1[ie][idt]) ;
4184 
4185  fhExoECross[ie][idt] = new TH2F(Form("hExoECross_ECross%d_DT%d",ie,idt),
4186  Form("#it{E} cross for cells vs E cell, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t < %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
4187  nptbins,ptmin,ptmax,400,0,1);
4188  fhExoECross[ie][idt] ->SetYTitle("1-#it{E}_{+}/#it{E}_{cell max}");
4189  fhExoECross[ie][idt] ->SetXTitle("#it{E}_{cell} (GeV)");
4190  outputContainer->Add(fhExoECross[ie][idt]) ;
4191 
4192  fhExoTime [ie][idt] = new TH2F(Form("hExoTime_ECross%d_DT%d",ie,idt),
4193  Form("Time of cluster (max cell) vs E cluster for exotic, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
4194  nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
4195  fhExoTime [ie][idt] ->SetYTitle("#it{t}_{max} (ns)");
4196  fhExoTime [ie][idt] ->SetXTitle("#it{E} (GeV)");
4197  outputContainer->Add(fhExoTime[ie][idt]) ;
4198 
4199  fhExoL0NCell[ie][idt] = new TH2F(Form("hExoL0_NCell%d_DT%d",ie,idt),
4200  Form("#lambda^{2}_{0} vs N cells per clusters for E > 5 GeV, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
4201  nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
4202  fhExoL0NCell[ie][idt] ->SetYTitle("#it{n}_{cells}");
4203  fhExoL0NCell[ie][idt] ->SetXTitle("#lambda^{2}_{0}");
4204  outputContainer->Add(fhExoL0NCell[ie][idt]) ;
4205 
4206  fhExoL1NCell[ie][idt] = new TH2F(Form("hExoL1_NCell%d_DT%d",ie,idt),
4207  Form("#lambda^{2}_{1} vs N cells per clusters for E > 5 GeV, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
4208  nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
4209  fhExoL1NCell[ie][idt] ->SetYTitle("#it{n}_{cells}");
4210  fhExoL1NCell[ie][idt] ->SetXTitle("#lambda^{2}_{1}");
4211  outputContainer->Add(fhExoL1NCell[ie][idt]) ;
4212  }
4213  }
4214  }
4215 
4216  // Cluster size in terms of cells
4217 
4219  {
4220  fhDeltaIEtaDeltaIPhiE0[0] = new TH2F ("hDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, #it{n}_{cells} > 3",
4221  50,0,50,50,0,50);
4222  fhDeltaIEtaDeltaIPhiE0[0]->SetXTitle("#Delta Column");
4223  fhDeltaIEtaDeltaIPhiE0[0]->SetYTitle("#Delta Row");
4224  outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[0]);
4225 
4226  fhDeltaIEtaDeltaIPhiE2[0] = new TH2F ("hDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, #it{n}_{cells} > 3",
4227  50,0,50,50,0,50);
4228  fhDeltaIEtaDeltaIPhiE2[0]->SetXTitle("#Delta Column");
4229  fhDeltaIEtaDeltaIPhiE2[0]->SetYTitle("#Delta Row");
4230  outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[0]);
4231 
4232  fhDeltaIEtaDeltaIPhiE6[0] = new TH2F ("hDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, #it{n}_{cells} > 3",
4233  50,0,50,50,0,50);
4234  fhDeltaIEtaDeltaIPhiE6[0]->SetXTitle("#Delta Column");
4235  fhDeltaIEtaDeltaIPhiE6[0]->SetYTitle("#Delta Row");
4236  outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[0]);
4237 
4238  fhDeltaIA[0] = new TH2F ("hDeltaIA"," Cluster *asymmetry* in cell units vs E",
4239  nptbins,ptmin,ptmax,21,-1.05,1.05);
4240  fhDeltaIA[0]->SetXTitle("#it{E}_{cluster}");
4241  fhDeltaIA[0]->SetYTitle("#it{A}_{cell in cluster}");
4242  outputContainer->Add(fhDeltaIA[0]);
4243 
4244  fhDeltaIAL0[0] = new TH2F ("hDeltaIAL0"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}",
4245  ssbins,ssmin,ssmax,21,-1.05,1.05);
4246  fhDeltaIAL0[0]->SetXTitle("#lambda^{2}_{0}");
4247  fhDeltaIAL0[0]->SetYTitle("#it{A}_{cell in cluster}");
4248  outputContainer->Add(fhDeltaIAL0[0]);
4249 
4250  fhDeltaIAL1[0] = new TH2F ("hDeltaIAL1"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}",
4251  ssbins,ssmin,ssmax,21,-1.05,1.05);
4252  fhDeltaIAL1[0]->SetXTitle("#lambda^{2}_{1}");
4253  fhDeltaIAL1[0]->SetYTitle("#it{A}_{cell in cluster}");
4254  outputContainer->Add(fhDeltaIAL1[0]);
4255 
4256  fhDeltaIANCells[0] = new TH2F ("hDeltaIANCells"," Cluster *asymmetry* in cell units vs N cells in cluster",
4257  nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
4258  fhDeltaIANCells[0]->SetXTitle("#it{n}_{cell in cluster}");
4259  fhDeltaIANCells[0]->SetYTitle("#it{A}_{cell in cluster}");
4260  outputContainer->Add(fhDeltaIANCells[0]);
4261 
4262 
4263  fhDeltaIEtaDeltaIPhiE0[1] = new TH2F ("hDeltaIEtaDeltaIPhiE0Charged"," Cluster size in columns vs rows for E < 2 GeV, #it{n}_{cells} > 3, matched with track",
4264  50,0,50,50,0,50);
4265  fhDeltaIEtaDeltaIPhiE0[1]->SetXTitle("#Delta Column");
4266  fhDeltaIEtaDeltaIPhiE0[1]->SetYTitle("#Delta Row");
4267  outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[1]);
4268 
4269  fhDeltaIEtaDeltaIPhiE2[1] = new TH2F ("hDeltaIEtaDeltaIPhiE2Charged"," Cluster size in columns vs rows for 2 <E < 6 GeV, #it{n}_{cells} > 3, matched with track",
4270  50,0,50,50,0,50);
4271  fhDeltaIEtaDeltaIPhiE2[1]->SetXTitle("#Delta Column");
4272  fhDeltaIEtaDeltaIPhiE2[1]->SetYTitle("#Delta Row");
4273  outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[1]);
4274 
4275  fhDeltaIEtaDeltaIPhiE6[1] = new TH2F ("hDeltaIEtaDeltaIPhiE6Charged"," Cluster size in columns vs rows for E > 6 GeV, #it{n}_{cells} > 3, matched with track",
4276  50,0,50,50,0,50);
4277  fhDeltaIEtaDeltaIPhiE6[1]->SetXTitle("#Delta Column");
4278  fhDeltaIEtaDeltaIPhiE6[1]->SetYTitle("#Delta Row");
4279  outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[1]);
4280 
4281  fhDeltaIA[1] = new TH2F ("hDeltaIACharged"," Cluster *asymmetry* in cell units vs E, matched with track",
4282  nptbins,ptmin,ptmax,21,-1.05,1.05);
4283  fhDeltaIA[1]->SetXTitle("#it{E}_{cluster}");
4284  fhDeltaIA[1]->SetYTitle("#it{A}_{cell in cluster}");
4285  outputContainer->Add(fhDeltaIA[1]);
4286 
4287  fhDeltaIAL0[1] = new TH2F ("hDeltaIAL0Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}, matched with track",
4288  ssbins,ssmin,ssmax,21,-1.05,1.05);
4289  fhDeltaIAL0[1]->SetXTitle("#lambda^{2}_{0}");
4290  fhDeltaIAL0[1]->SetYTitle("#it{A}_{cell in cluster}");
4291  outputContainer->Add(fhDeltaIAL0[1]);
4292 
4293  fhDeltaIAL1[1] = new TH2F ("hDeltaIAL1Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}, matched with track",
4294  ssbins,ssmin,ssmax,21,-1.05,1.05);
4295  fhDeltaIAL1[1]->SetXTitle("#lambda^{2}_{1}");
4296  fhDeltaIAL1[1]->SetYTitle("#it{A}_{cell in cluster}");
4297  outputContainer->Add(fhDeltaIAL1[1]);
4298 
4299  fhDeltaIANCells[1] = new TH2F ("hDeltaIANCellsCharged"," Cluster *asymmetry* in cell units vs N cells in cluster, matched with track",
4300  nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
4301  fhDeltaIANCells[1]->SetXTitle("#it{n}_{cell in cluster}");
4302  fhDeltaIANCells[1]->SetYTitle("#it{A}_{cell in cluster}");
4303  outputContainer->Add(fhDeltaIANCells[1]);
4304 
4305  if(IsDataMC()){
4306  TString particle[]={"Photon","Electron","Conversion","Hadron"};
4307  for (Int_t iPart = 0; iPart < 4; iPart++) {
4308 
4309  fhDeltaIAMC[iPart] = new TH2F (Form("hDeltaIA_MC%s",particle[iPart].Data()),Form(" Cluster *asymmetry* in cell units vs E, from %s",particle[iPart].Data()),
4310  nptbins,ptmin,ptmax,21,-1.05,1.05);
4311  fhDeltaIAMC[iPart]->SetXTitle("#it{E}_{cluster}");
4312  fhDeltaIAMC[iPart]->SetYTitle("#it{A}_{cell in cluster}");
4313  outputContainer->Add(fhDeltaIAMC[iPart]);
4314  }
4315  }
4316 
4317  if(fStudyBadClusters)
4318  {
4319  fhBadClusterDeltaIEtaDeltaIPhiE0 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, #it{n}_{cells} > 3",
4320  50,0,50,50,0,50);
4321  fhBadClusterDeltaIEtaDeltaIPhiE0->SetXTitle("#Delta Column");
4322  fhBadClusterDeltaIEtaDeltaIPhiE0->SetYTitle("#Delta Row");
4323  outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE0);
4324 
4325  fhBadClusterDeltaIEtaDeltaIPhiE2 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, #it{n}_{cells} > 3",
4326  50,0,50,50,0,50);
4327  fhBadClusterDeltaIEtaDeltaIPhiE2->SetXTitle("#Delta Column");
4328  fhBadClusterDeltaIEtaDeltaIPhiE2->SetYTitle("#Delta Row");
4329  outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE2);
4330 
4331  fhBadClusterDeltaIEtaDeltaIPhiE6 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, #it{n}_{cells} > 3",
4332  50,0,50,50,0,50);
4333  fhBadClusterDeltaIEtaDeltaIPhiE6->SetXTitle("#Delta Column");
4334  fhBadClusterDeltaIEtaDeltaIPhiE6->SetYTitle("#Delta Row");
4335  outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE6);
4336 
4337  fhBadClusterDeltaIA = new TH2F ("hBadClusterDeltaIA"," Cluster *asymmetry* in cell units vs E",
4338  nptbins,ptmin,ptmax,21,-1.05,1.05);
4339  fhBadClusterDeltaIA->SetXTitle("#it{E}_{cluster}");
4340  fhBadClusterDeltaIA->SetYTitle("#it{A}_{cell in cluster}");
4341  outputContainer->Add(fhBadClusterDeltaIA);
4342  }
4343  }
4344 
4345  if(fStudyWeight)
4346  {
4347  fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy",
4348  nptbins,ptmin,ptmax, 100,0,1.);
4349  fhECellClusterRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
4350  fhECellClusterRatio->SetYTitle("#it{E}_{cell i}/#it{E}_{cluster}");
4351  outputContainer->Add(fhECellClusterRatio);
4352 
4353  fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy",
4354  nptbins,ptmin,ptmax, 100,-10,0);
4355  fhECellClusterLogRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
4356  fhECellClusterLogRatio->SetYTitle("Log(#it{E}_{cell i}/#it{E}_{cluster})");
4357  outputContainer->Add(fhECellClusterLogRatio);
4358 
4359  fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy",
4360  nptbins,ptmin,ptmax, 100,0,1.);
4361  fhEMaxCellClusterRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
4362  fhEMaxCellClusterRatio->SetYTitle("#it{E}_{max cell}/#it{E}_{cluster}");
4363  outputContainer->Add(fhEMaxCellClusterRatio);
4364 
4365  fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy",
4366  nptbins,ptmin,ptmax, 100,-10,0);
4367  fhEMaxCellClusterLogRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
4368  fhEMaxCellClusterLogRatio->SetYTitle("Log (#it{E}_{max cell}/#it{E}_{cluster})");
4369  outputContainer->Add(fhEMaxCellClusterLogRatio);
4370 
4371  fhECellTotalRatio = new TH2F ("hECellTotalRatio"," cell energy / sum all energy vs all energy",
4372  nptbins*2,ptmin,ptmax*2, 100,0,1.);
4373  fhECellTotalRatio->SetXTitle("#it{E}_{total} (GeV) ");
4374  fhECellTotalRatio->SetYTitle("#it{E}_{cell i}/#it{E}_{total}");
4375  outputContainer->Add(fhECellTotalRatio);
4376 
4377  fhECellTotalLogRatio = new TH2F ("hECellTotalLogRatio"," Log(cell energy / sum all energy) vs all energy",
4378  nptbins*2,ptmin,ptmax*2, 100,-10,0);
4379  fhECellTotalLogRatio->SetXTitle("#it{E}_{total} (GeV) ");
4380  fhECellTotalLogRatio->SetYTitle("Log(#it{E}_{cell i}/#it{E}_{total})");
4381  outputContainer->Add(fhECellTotalLogRatio);
4382 
4385 
4386  for(Int_t imod = 0; imod < fNModules; imod++)
4387  {
4388  fhECellTotalRatioMod[imod] = new TH2F (Form("hECellTotalRatio_Mod%d",imod),
4389  Form("#cell energy / sum all energy vs all energy in Module %d",imod),
4390  nptbins*2,ptmin,ptmax*2, 100,0,1.);
4391  fhECellTotalRatioMod[imod]->SetXTitle("#it{E} (GeV)");
4392  fhECellTotalRatioMod[imod]->SetYTitle("#it{n}_{cells}");
4393  outputContainer->Add(fhECellTotalRatioMod[imod]);
4394 
4395  fhECellTotalLogRatioMod[imod] = new TH2F (Form("hECellTotalLogRatio_Mod%d",imod),
4396  Form("Log(cell energy / sum all energy) vs all energy in Module %d",imod),
4397  nptbins*2,ptmin,ptmax*2, 100,-10,0);
4398  fhECellTotalLogRatioMod[imod]->SetXTitle("#it{E} (GeV)");
4399  fhECellTotalLogRatioMod[imod]->SetYTitle("#it{n}_{cells}");
4400  outputContainer->Add(fhECellTotalLogRatioMod[imod]);
4401  }
4402 
4403  // To be done properly with setters and data members ...
4404  Float_t cellEmin [] = {0.05,0.1,0.15,0.2};
4405  Float_t cellTmin [] = {50.,100.,1000000.};
4406 
4407  for(Int_t iw = 0; iw < 12; iw++)
4408  {
4409  Float_t w0 = 4+0.05*iw; // 3+0.25*iw;
4410  for(Int_t iEmin = 0; iEmin < 4; iEmin++)
4411  {
4412  for(Int_t iTmin = 0; iTmin < 3; iTmin++)
4413  {
4414  fhLambda0ForW0AndCellCuts[iw][iEmin][iTmin] = new TH2F (Form("hLambda0ForW0%d_CellEMin%d_TimeMax%d",iw,iEmin,iTmin),
4415  Form("#lambda^{2}_{0} vs E, w0=%1.2f, cell E>%2.2f MeV, |t|<%2.0f ns",
4416  w0, cellEmin[iEmin], cellTmin[iTmin]),
4417  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4418  fhLambda0ForW0AndCellCuts[iw][iEmin][iTmin]->SetXTitle("#it{E}_{cluster}");
4419  fhLambda0ForW0AndCellCuts[iw][iEmin][iTmin]->SetYTitle("#lambda^{2}_{0}");
4420  outputContainer->Add(fhLambda0ForW0AndCellCuts[iw][iEmin][iTmin]);
4421 
4422 
4423 // fhLambda1ForW0AndCellCuts[iw][iEmin][iTmin] = new TH2F (Form("hLambda1ForW0%d_CellEMin%d_TimeMax%d",iw,iEmin,iTmin),
4424 // Form("#lambda^{2}_{1} vs E, w0=%1.2f, cell E>%2.2f MeV, |t|<%2.0f ns"",
4425 // w0, cellEmin[iEmin], cellTmin[iTmin]),
4426 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4427 // fhLambda1ForW0AndCellCuts[iw][iEmin][iTmin]->SetXTitle("#it{E}_{cluster}");
4428 // fhLambda1ForW0AndCellCuts[iw][iEmin][iTmin]->SetYTitle("#lambda^{2}_{1}");
4429 // outputContainer->Add(fhLambda1ForW0AndCellCuts[iw][iEmin][iTmin]);
4430 
4431  fhLambda0ForW0AndCellCutsEta0[iw][iEmin][iTmin] = new TH2F (Form("hLambda0ForW0%d_CellEMin%d_TimeMax%d_Eta0",iw,iEmin,iTmin),
4432  Form("#lambda^{2}_{0} vs E, w0=%1.2f, cell E>%2.2f MeV, |t|<%2.0f ns, |#eta| < 0.15",
4433  w0, cellEmin[iEmin], cellTmin[iTmin]),
4434  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4435  fhLambda0ForW0AndCellCutsEta0[iw][iEmin][iTmin]->SetXTitle("#it{E}_{cluster}");
4436  fhLambda0ForW0AndCellCutsEta0[iw][iEmin][iTmin]->SetYTitle("#lambda^{2}_{0}");
4437  outputContainer->Add(fhLambda0ForW0AndCellCutsEta0[iw][iEmin][iTmin]);
4438  }
4439  }
4440 
4441  if(IsDataMC())
4442  {
4443  TString mcnames[] = {"Photon", "Electron","Conversion","Pi0","Hadron"};
4444  for(Int_t imc = 0; imc < 5; imc++)
4445  {
4446  fhLambda0ForW0MC[iw][imc] = new TH2F (Form("hLambda0ForW0%d_MC%s",iw,mcnames[imc].Data()),
4447  Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f, for MC %s",w0,mcnames[imc].Data()),
4448  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4449  fhLambda0ForW0MC[iw][imc]->SetXTitle("#it{E}_{cluster}");
4450  fhLambda0ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{0}");
4451  outputContainer->Add(fhLambda0ForW0MC[iw][imc]);
4452 
4453 // fhLambda1ForW0MC[iw][imc] = new TH2F (Form("hLambda1ForW0%d_MC%s",iw,mcnames[imc].Data()),
4454 // Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f, for MC %s",w0,mcnames[imc].Data()),
4455 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4456 // fhLambda1ForW0MC[iw][imc]->SetXTitle("#it{E}_{cluster}");
4457 // fhLambda1ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{1}");
4458 // outputContainer->Add(fhLambda1ForW0MC[iw][imc]);
4459  }
4460  }
4461  }
4462  }
4463 
4464  // Track Matching
4465  if(fFillAllTMHisto)
4466  {
4467  fhTrackMatchedDEtaNeg = new TH2F("hTrackMatchedDEtaNeg","d#eta of cluster-negative track vs cluster energy",
4468  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
4469  fhTrackMatchedDEtaNeg->SetYTitle("d#eta");
4470  fhTrackMatchedDEtaNeg->SetXTitle("#it{E}_{cluster} (GeV)");
4471 
4472  fhTrackMatchedDPhiNeg = new TH2F("hTrackMatchedDPhiNeg","d#varphi of cluster-negative track vs cluster energy",
4473  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
4474  fhTrackMatchedDPhiNeg->SetYTitle("d#varphi (rad)");
4475  fhTrackMatchedDPhiNeg->SetXTitle("#it{E}_{cluster} (GeV)");
4476 
4477  fhTrackMatchedDEtaDPhiNeg = new TH2F("hTrackMatchedDEtaDPhiNeg","d#eta vs d#varphi of cluster- negative track vs cluster energy",
4478  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
4479  fhTrackMatchedDEtaDPhiNeg->SetYTitle("d#varphi (rad)");
4480  fhTrackMatchedDEtaDPhiNeg->SetXTitle("d#eta");
4481 
4482  fhTrackMatchedDEtaPos = new TH2F("hTrackMatchedDEtaPos","d#eta of cluster-positive track vs cluster energy",
4483  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
4484  fhTrackMatchedDEtaPos->SetYTitle("d#eta");
4485  fhTrackMatchedDEtaPos->SetXTitle("#it{E}_{cluster} (GeV)");
4486 
4487  fhTrackMatchedDPhiPos = new TH2F("hTrackMatchedDPhiPos","d#varphi of cluster-positive track vs cluster energy",
4488  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
4489  fhTrackMatchedDPhiPos->SetYTitle("d#varphi (rad)");
4490  fhTrackMatchedDPhiPos->SetXTitle("#it{E}_{cluster} (GeV)");
4491 
4492  fhTrackMatchedDEtaDPhiPos = new TH2F("hTrackMatchedDEtaDPhiPos","d#eta vs d#varphi of cluster-positive track vs cluster energy",
4493  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
4494  fhTrackMatchedDEtaDPhiPos->SetYTitle("d#varphi (rad)");
4495  fhTrackMatchedDEtaDPhiPos->SetXTitle("d#eta");
4496 
4497 
4498  fhTrackMatchedDEtaNegMod = new TH2F("hTrackMatchedDEtaNegPerModule","d#eta of cluster-negative track vs module, E > 0.5 GeV",
4499  nresetabins,resetamin,resetamax,fNModules,0,fNModules);
4500  fhTrackMatchedDEtaNegMod->SetXTitle("d#eta");
4501  fhTrackMatchedDEtaNegMod->SetYTitle("Module");
4502 
4503  fhTrackMatchedDPhiNegMod = new TH2F("hTrackMatchedDPhiNegPerModule","d#varphi of cluster-negative track vs module, E > 0.5 GeV",
4504  nresetabins,resetamin,resetamax,fNModules,0,fNModules);
4505  fhTrackMatchedDPhiNegMod->SetXTitle("d#varphi (rad)");
4506  fhTrackMatchedDPhiNegMod->SetYTitle("Module");
4507 
4508  fhTrackMatchedDEtaPosMod = new TH2F("hTrackMatchedDEtaPosPerModule","d#eta of cluster-positive track vs module, E > 0.5 GeV",
4509  nresetabins,resetamin,resetamax,fNModules,0,fNModules);
4510  fhTrackMatchedDEtaPosMod->SetXTitle("d#eta");
4511  fhTrackMatchedDEtaPosMod->SetYTitle("Module");
4512 
4513  fhTrackMatchedDPhiPosMod = new TH2F("hTrackMatchedDPhiPosPerModule","d#varphi of cluster-positive track vs module, E > 0.5 GeV",
4514  nresetabins,resetamin,resetamax,fNModules,0,fNModules);
4515  fhTrackMatchedDPhiPosMod->SetXTitle("d#varphi (rad)");
4516  fhTrackMatchedDPhiPosMod->SetYTitle("Module");
4517 
4518  outputContainer->Add(fhTrackMatchedDEtaNeg) ;
4519  outputContainer->Add(fhTrackMatchedDPhiNeg) ;
4520  outputContainer->Add(fhTrackMatchedDEtaPos) ;
4521  outputContainer->Add(fhTrackMatchedDPhiPos) ;
4522  outputContainer->Add(fhTrackMatchedDEtaDPhiNeg) ;
4523  outputContainer->Add(fhTrackMatchedDEtaDPhiPos) ;
4524 
4525  outputContainer->Add(fhTrackMatchedDEtaNegMod) ;
4526  outputContainer->Add(fhTrackMatchedDPhiNegMod) ;
4527  outputContainer->Add(fhTrackMatchedDEtaPosMod) ;
4528  outputContainer->Add(fhTrackMatchedDPhiPosMod) ;
4529 
4530  fhECharged = new TH1F ("hECharged","#it{E} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
4531  fhECharged->SetXTitle("#it{E} (GeV)");
4532  outputContainer->Add(fhECharged);
4533 
4534  fhPtCharged = new TH1F ("hPtCharged","#it{p}_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
4535  fhPtCharged->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4536  outputContainer->Add(fhPtCharged);
4537 
4538  fhPhiCharged = new TH1F ("hPhiCharged","#varphi reconstructed clusters, matched with track",nphibins,phimin,phimax);
4539  fhPhiCharged->SetXTitle("#varphi (rad)");
4540  outputContainer->Add(fhPhiCharged);
4541 
4542  fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
4543  fhEtaCharged->SetXTitle("#eta ");
4544  outputContainer->Add(fhEtaCharged);
4545 
4546  if(fFillAllTH3)
4547  {
4548  fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #varphi, reconstructed clusters, matched with track",
4549  netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
4550  fhEtaPhiECharged->SetXTitle("#eta ");
4551  fhEtaPhiECharged->SetYTitle("#varphi ");
4552  fhEtaPhiECharged->SetZTitle("#it{E} (GeV) ");
4553  outputContainer->Add(fhEtaPhiECharged);
4554  }
4555  else
4556  {
4557  fhEtaPhiCharged = new TH2F ("hEtaPhiCharged","#eta vs #varphi for #it{E} > 0.5 GeV, reconstructed clusters, with matched track",
4558  netabins,etamin,etamax,nphibins,phimin,phimax);
4559  fhEtaPhiCharged->SetXTitle("#eta ");
4560  fhEtaPhiCharged->SetYTitle("#varphi (rad)");
4561  outputContainer->Add(fhEtaPhiCharged);
4562  }
4563 
4564  fh1EOverP = new TH2F("h1EOverP","TRACK matches #it{E}/#it{p}",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
4565  fh1EOverP->SetYTitle("#it{E}/#it{p}");
4566  fh1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4567  outputContainer->Add(fh1EOverP);
4568 
4569  fh2dR = new TH2F("h2dR","TRACK matches #Delta #it{R}",nptbins,ptmin,ptmax,ndRbins,dRmin,dRmax);
4570  fh2dR->SetYTitle("#Delta #it{R} (rad)");
4571  fh2dR->SetXTitle("#it{E} cluster (GeV)");
4572  outputContainer->Add(fh2dR) ;
4573 
4574  fh2MatchdEdx = new TH2F("h2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
4575  fh2MatchdEdx->SetXTitle("p (GeV/#it{c})");
4576  fh2MatchdEdx->SetYTitle("<#it{dE/dx}>");
4577  outputContainer->Add(fh2MatchdEdx);
4578 
4579  fh2EledEdx = new TH2F("h2EledEdx","#it{dE/dx} vs. #it{p} for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
4580  fh2EledEdx->SetXTitle("p (GeV/#it{c})");
4581  fh2EledEdx->SetYTitle("<#it{dE/dx}>");
4582  outputContainer->Add(fh2EledEdx) ;
4583 
4584  fh1EOverPR02 = new TH2F("h1EOverPR02","TRACK matches #it{E}/#it{p}, all",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
4585  fh1EOverPR02->SetYTitle("#it{E}/#it{p}");
4586  fh1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4587  outputContainer->Add(fh1EOverPR02);
4588 
4589  fh1EleEOverP = new TH2F("h1EleEOverP","Electron candidates #it{E}/#it{p} (60<#it{dE/dx}<100)",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
4590  fh1EleEOverP->SetYTitle("#it{E}/#it{p}");
4591  fh1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4592  outputContainer->Add(fh1EleEOverP);
4593 
4594 
4595  // Projections per SM
4596 
4597  fh1EOverPMod = new TH2F("h1EOverP_PerModule","TRACK matches #it{E}/#it{p}, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",nPoverEbins,eOverPmin,eOverPmax,fNModules,0,fNModules);
4598  fh1EOverPMod->SetXTitle("#it{E}/#it{p}");
4599  fh1EOverPMod->SetYTitle("Module");
4600  outputContainer->Add(fh1EOverPMod);
4601 
4602  fh2dRMod = new TH2F("h2dR_PerModule","TRACK matches #Delta #it{R}, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",ndRbins,dRmin,dRmax,fNModules,0,fNModules);
4603  fh2dRMod->SetXTitle("#Delta #it{R} (rad)");
4604  fh2dRMod->SetYTitle("Module");
4605  outputContainer->Add(fh2dRMod) ;
4606 
4607  fh2MatchdEdxMod = new TH2F("h2MatchdEdx_PerModule","#it{dE/dx} vs. #it{p} for all matches, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",ndedxbins,dedxmin,dedxmax,fNModules,0,fNModules);
4608  fh2MatchdEdxMod->SetYTitle("Module");
4609  fh2MatchdEdxMod->SetXTitle("<#it{dE/dx}>");
4610  outputContainer->Add(fh2MatchdEdxMod);
4611 
4612  fh2EledEdxMod = new TH2F("h2EledEdx_PerModule","#it{dE/dx} vs. #it{p} for electrons, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",ndedxbins,dedxmin,dedxmax,fNModules,0,fNModules);
4613  fh2EledEdxMod->SetYTitle("Module");
4614  fh2EledEdxMod->SetXTitle("<#it{dE/dx}>");
4615  outputContainer->Add(fh2EledEdxMod) ;
4616 
4617  fh1EOverPR02Mod = new TH2F("h1EOverPR02_PerModule","TRACK matches #it{E}/#it{p}, all, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",nPoverEbins,eOverPmin,eOverPmax,fNModules,0,fNModules);
4618  fh1EOverPR02Mod->SetXTitle("#it{E}/#it{p}");
4619  fh1EOverPR02Mod->SetYTitle("Module");
4620  outputContainer->Add(fh1EOverPR02Mod);
4621 
4622  fh1EleEOverPMod = new TH2F("h1EleEOverP_PerModule","Electron candidates #it{E}/#it{p} (60<#it{dE/dx}<100), #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",nPoverEbins,eOverPmin,eOverPmax,fNModules,0,fNModules);
4623  fh1EleEOverPMod->SetXTitle("#it{E}/#it{p}");
4624  fh1EleEOverPMod->SetYTitle("Module");
4625  outputContainer->Add(fh1EleEOverPMod);
4626  }
4627 
4628  if(fFillAllPi0Histo)
4629  {
4630  fhIM = new TH2F ("hIM","Cluster pairs (EMCAL or PHOS) Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1",
4631  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4632  fhIM->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4633  fhIM->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4634  outputContainer->Add(fhIM);
4635 
4636  fhIMDiff = new TH2F ("hIMDiff","Cluster pairs (EMCAL or PHOS) Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, different SM",
4637  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4638  fhIMDiff->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4639  fhIMDiff->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4640  outputContainer->Add(fhIMDiff);
4641 
4642  fhIMSame = new TH2F ("hIMSame","Cluster pairs (EMCAL or PHOS) Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, same SM",
4643  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4644  fhIMSame->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4645  fhIMSame->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4646  outputContainer->Add(fhIMSame);
4647 
4648  if(fNModules > 12 && (GetCalorimeter() == kEMCAL || GetCalorimeter() == kDCAL))
4649  {
4650  fhIMDCAL = new TH2F ("hIMDCAL","Cluster pairs in DCAL Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1",
4651  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4652  fhIMDCAL->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4653  fhIMDCAL->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4654  outputContainer->Add(fhIMDCAL);
4655 
4656  fhIMDCALDiff = new TH2F ("hIMDCALDiff","Cluster pairs in DCAL Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, different SM",
4657  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4658  fhIMDCALDiff->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4659  fhIMDCALDiff->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4660  outputContainer->Add(fhIMDCALDiff);
4661 
4662  fhIMDCALSame = new TH2F ("hIMDCALSame","Cluster pairs in DCAL Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, same SM",
4663  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4664  fhIMDCALSame->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4665  fhIMDCALSame->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4666  outputContainer->Add(fhIMDCALSame);
4667 
4668  fhIMDCALPHOS = new TH2F ("hIMDCALPHOS","Cluster pairs in DCAL-PHOS Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1",
4669  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4670  fhIMDCALPHOS->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4671  fhIMDCALPHOS->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4672  outputContainer->Add(fhIMDCALPHOS);
4673 
4674  fhIMDCALPHOSSame = new TH2F ("hIMDCALPHOSSame","Cluster pairs in DCAL-PHOS Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, same #varphi sector",
4675  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4676  fhIMDCALPHOSSame->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4677  fhIMDCALPHOSSame->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4678  outputContainer->Add(fhIMDCALPHOSSame);
4679  }
4680 
4682  {
4683  fhIMEMCALPHOS = new TH2F ("hIMEMCALPHOS","Cluster pairs in DCAL-PHOS Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1",
4684  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4685  fhIMEMCALPHOS->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4686  fhIMEMCALPHOS->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4687  outputContainer->Add(fhIMEMCALPHOS);
4688 
4689  fhIMEMCALPHOSSame = new TH2F ("hIMEMCALPHOSSame","Cluster pairs in DCAL-PHOS Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, same #varphi sector",
4690  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
4691  fhIMEMCALPHOSSame->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4692  fhIMEMCALPHOSSame->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4693  outputContainer->Add(fhIMEMCALPHOSSame);
4694  }
4695 
4697  {
4698  fhClusterPairDiffTimeEPi0Mass = new TH2F("hClusterPairDiffTimeEPi0Mass","cluster pair time difference vs E, only good clusters",
4699  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
4700  fhClusterPairDiffTimeEPi0Mass->SetXTitle("#it{E}_{cluster} (GeV)");
4701  fhClusterPairDiffTimeEPi0Mass->SetYTitle("#Delta #it{t} (ns)");
4702  outputContainer->Add(fhClusterPairDiffTimeEPi0Mass);
4703 
4704  fhClusterPairDiffTimeEPi0MassSame = new TH2F("hClusterPairDiffTimeEPi0MassSame","cluster pair time difference vs E, only good clusters",
4705  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
4706  fhClusterPairDiffTimeEPi0MassSame->SetXTitle("#it{E}_{cluster} (GeV)");
4707  fhClusterPairDiffTimeEPi0MassSame->SetYTitle("#Delta #it{t} (ns)");
4708  outputContainer->Add(fhClusterPairDiffTimeEPi0MassSame);
4709 
4710  if(fNModules > 12 && (GetCalorimeter() == kEMCAL || GetCalorimeter() == kDCAL))
4711  {
4712  fhClusterPairDiffTimeEPi0MassDCal = new TH2F("hClusterPairDiffTimeEPi0MassDCal","cluster pair time difference vs E, only good clusters",
4713  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
4714  fhClusterPairDiffTimeEPi0MassDCal->SetXTitle("#it{E}_{cluster} (GeV)");
4715  fhClusterPairDiffTimeEPi0MassDCal->SetYTitle("#Delta #it{t} (ns)");
4716  outputContainer->Add(fhClusterPairDiffTimeEPi0MassDCal);
4717 
4718  fhClusterPairDiffTimeEPi0MassDCalSame = new TH2F("hClusterPairDiffTimeEPi0MassDCalSame","cluster pair time difference vs E, only good clusters",
4719  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
4720  fhClusterPairDiffTimeEPi0MassDCalSame->SetXTitle("#it{E}_{cluster} (GeV)");
4721  fhClusterPairDiffTimeEPi0MassDCalSame->SetYTitle("#Delta #it{t} (ns)");
4722  outputContainer->Add(fhClusterPairDiffTimeEPi0MassDCalSame);
4723  }
4724  }
4725 
4726  fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
4727  fhAsym->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4728  fhAsym->SetYTitle("#it{Asymmetry}");
4729  outputContainer->Add(fhAsym);
4730 
4732  {
4733  fhOpAngle = new TH2F ("hOpeningAngle","Cluster pairs opening angle vs reconstructed pair #it{p}_{T}, ncell > 1",
4734  nptbins,ptmin,ptmax, 180,0,TMath::Pi());
4735  fhOpAngle->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
4736  fhOpAngle->SetYTitle("Opening angle (degrees)");
4737  outputContainer->Add(fhOpAngle);
4738 
4739  Int_t nBinOpAngle = TMath::Nint(fInvMassMaxOpenAngle*TMath::RadToDeg()); // bin of 1 degree size
4740  fhIMvsOpAngle = new TH2F ("hIMvsOpAngle","Cluster pairs Invariant mass vs reconstructed pair opening angle, ncell > 1",
4741  nBinOpAngle,0.,fInvMassMaxOpenAngle,nmassbins,massmin,massmax);
4742  fhIMvsOpAngle->SetXTitle("Opening angle (degrees)");
4743  fhIMvsOpAngle->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
4744  outputContainer->Add(fhIMvsOpAngle);
4745  }
4746  }
4747 
4748  if(fFillAllPosHisto2)
4749  {
4750  fhXYZ = new TH3F ("hXYZ","Cluster: #it{x} vs #it{y} vs #it{z}",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
4751  fhXYZ->SetXTitle("#it{x} (cm)");
4752  fhXYZ->SetYTitle("#it{y} (cm)");
4753  fhXYZ->SetZTitle("#it{z} (cm) ");
4754  outputContainer->Add(fhXYZ);
4755 
4756  fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
4757  fhXE->SetXTitle("#it{x} (cm)");
4758  fhXE->SetYTitle("#it{E} (GeV)");
4759  outputContainer->Add(fhXE);
4760 
4761  fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
4762  fhYE->SetXTitle("#it{y} (cm)");
4763  fhYE->SetYTitle("#it{E} (GeV)");
4764  outputContainer->Add(fhYE);
4765 
4766  fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
4767  fhZE->SetXTitle("#it{z} (cm)");
4768  fhZE->SetYTitle("#it{E} (GeV)");
4769  outputContainer->Add(fhZE);
4770 
4771  fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
4772  fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
4773  fhRE->SetYTitle("#it{E} (GeV)");
4774  outputContainer->Add(fhRE);
4775 
4776  fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Cells per Cluster",xbins,xmin,xmax,nceclbins,nceclmin,nceclmax);
4777  fhXNCells->SetXTitle("#it{x} (cm)");
4778  fhXNCells->SetYTitle("N cells per cluster");
4779  outputContainer->Add(fhXNCells);
4780 
4781  fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Cells per Cluster",ybins,ymin,ymax,nceclbins,nceclmin,nceclmax);
4782  fhYNCells->SetXTitle("#it{y} (cm)");
4783  fhYNCells->SetYTitle("N cells per cluster");
4784  outputContainer->Add(fhYNCells);
4785 
4786  fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Cells per Cluster",zbins,zmin,zmax,nceclbins,nceclmin,nceclmax);
4787  fhZNCells->SetXTitle("#it{z} (cm)");
4788  fhZNCells->SetYTitle("N cells per cluster");
4789  outputContainer->Add(fhZNCells);
4790 
4791  fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Cells per Cluster",rbins,rmin,rmax,nceclbins,nceclmin,nceclmax);
4792  fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
4793  fhRNCells->SetYTitle("N cells per cluster");
4794  outputContainer->Add(fhRNCells);
4795  }
4796 
4797  if(fFillAllPosHisto)
4798  {
4799  fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
4800  fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
4801  fhRCellE->SetYTitle("#it{E} (GeV)");
4802  outputContainer->Add(fhRCellE);
4803 
4804  fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
4805  fhXCellE->SetXTitle("#it{x} (cm)");
4806  fhXCellE->SetYTitle("#it{E} (GeV)");
4807  outputContainer->Add(fhXCellE);
4808 
4809  fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
4810  fhYCellE->SetXTitle("#it{y} (cm)");
4811  fhYCellE->SetYTitle("#it{E} (GeV)");
4812  outputContainer->Add(fhYCellE);
4813 
4814  fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
4815  fhZCellE->SetXTitle("#it{z} (cm)");
4816  fhZCellE->SetYTitle("#it{