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