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