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