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