AliPhysics  59e0e03 (59e0e03)
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 <TDatabasePDG.h>
19 #include <TH3F.h>
20 #include <TObjString.h>
21 
22 //---- AliRoot system ----
23 #include "AliAnaCalorimeterQA.h"
24 #include "AliCaloTrackReader.h"
25 #include "AliVCaloCells.h"
26 #include "AliFiducialCut.h"
27 #include "AliVCluster.h"
28 #include "AliVTrack.h"
29 #include "AliVEvent.h"
30 #include "AliMCEvent.h"
31 #include "AliVEventHandler.h"
32 #include "AliVParticle.h"
33 #include "AliMCAnalysisUtils.h"
34 #include "TCustomBinning.h"
35 
36 // --- Detectors ---
37 #include "AliPHOSGeoUtils.h"
38 #include "AliEMCALGeometry.h"
39 
41 ClassImp(AliAnaCalorimeterQA) ;
43 
44 //__________________________________________
47 //__________________________________________
50 
51 // Switches
52 fFillAllCellTimeHisto(kTRUE),
53 fFillAllPosHisto(kFALSE), fFillAllPosHisto2(kFALSE),
54 fFillAllTH3(kFALSE),
55 fFillAllTMHisto(kTRUE), fFillClusterMaxCellHisto(kFALSE),
56 fFillAllPi0Histo(kTRUE), fFillInvMassOpenAngle(kFALSE),
57 fFillPi0PairDiffTime(kFALSE), fFillInvMassInEMCALWithPHOSDCalAcc(kFALSE),
58 fFillEBinAcceptanceHisto(kFALSE), fFillAllClusterHistograms(kTRUE),
59 fFillAllCellHistograms(kTRUE), fFillAllCellAbsIdHistograms(kTRUE),
60 fCorrelate(kTRUE), fStudyBadClusters(kFALSE),
61 
62 // Parameters and cuts
63 fTimeCutMin(-10000), fTimeCutMax(10000),
64 fCellAmpMin(0),
65 fEMCALCellAmpMin(0), fPHOSCellAmpMin(0),
66 fEMCALClusterM02Min(0),
67 fEMCALClusterNCellMin(0), fPHOSClusterNCellMin(0),
68 fNEBinCuts(0),
69 
70 // Invariant mass
71 fInvMassMinECut(0), fInvMassMaxECut(0),
72 fInvMassMinM02Cut(0), fInvMassMaxM02Cut(0),
73 fInvMassMaxOpenAngle(0), fInvMassMaxTimeDifference(0),
74 
75 fClusterMomentum(), fClusterMomentum2(),
76 fPrimaryMomentum(),
77 fConstantTimeShift(0),
78 
79 // Histograms
80 fhE(0), fhPt(0),
81 fhPhi(0), fhEta(0),
82 fhEtaPhi(0), fhEtaPhiE(0),
83 fhECharged(0), fhPtCharged(0),
84 fhPhiCharged(0), fhEtaCharged(0),
85 fhEtaPhiCharged(0), fhEtaPhiECharged(0),
86 
87 // Invariant mass
88 fhIM(0), fhIMSame(0), fhIMDiff(0),
89 fhIMDCAL(0), fhIMDCALSame(0), fhIMDCALDiff(0),
90 fhIMDCALPHOS(0), fhIMDCALPHOSSame(0),
91 fhIMEMCALPHOS(0), fhIMEMCALPHOSSame(0),
92 fhAsym(0),
93 fhOpAngle(0), fhIMvsOpAngle(0),
94 fhNCellsPerCluster(0), fhNCellsPerClusterNoCut(0),
95 fhNClusters(0),
96 
97 // Timing
98 fhClusterTimeEnergy(0), fhCellTimeSpreadRespectToCellMax(0),
99 fhCellIdCellLargeTimeSpread(0), fhClusterPairDiffTimeE(0), fhClusterPairDiffTimeESameMod(0),
100 fhClusterMaxCellCloseCellRatio(0), fhClusterMaxCellCloseCellDiff(0),
101 fhClusterMaxCellDiff(0), fhClusterMaxCellDiffNoCut(0),
102 //fhClusterMaxCellDiffAverageTime(0), fhClusterMaxCellDiffWeightedTime(0),
103 fhClusterMaxCellECross(0),
104 // fhDispersion(0),
105 fhLambda0(0), fhLambda1(0),
106 fhNLocMax(0), fhNLocMaxStd(0),
107 
108 // bad clusters
109 fhBadClusterEnergy(0), fhBadClusterTimeEnergy(0), fhBadClusterEtaPhi(0),
110 fhBadClusterPairDiffTimeE(0), fhBadCellTimeSpreadRespectToCellMax(0),
111 fhBadClusterMaxCellCloseCellRatio(0), fhBadClusterMaxCellCloseCellDiff(0), fhBadClusterMaxCellDiff(0),
112 //fhBadClusterMaxCellDiffAverageTime(0), fhBadClusterMaxCellDiffWeightedTime(0),
113 fhBadClusterMaxCellECross(0),
114 fhBadClusterLambda0(0), fhBadClusterLambda1(0),
115 
116 // Position
117 fhRNCells(0), fhXNCells(0),
118 fhYNCells(0), fhZNCells(0),
119 fhRE(0), fhXE(0),
120 fhYE(0), fhZE(0),
121 fhXYZ(0),
122 fhRCellE(0), fhXCellE(0),
123 fhYCellE(0), fhZCellE(0),
124 fhXYZCell(0),
125 fhDeltaCellClusterRNCells(0), fhDeltaCellClusterXNCells(0),
126 fhDeltaCellClusterYNCells(0), fhDeltaCellClusterZNCells(0),
127 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0),
128 fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
129 
130 // Cells
131 fhNCells(0), fhNCellsCutAmpMin(0),
132 fhAmplitude(0), fhAmpId(0),
133 fhEtaPhiAmpCell(0), fhEtaPhiCell(0),
134 fhTime(0), //fhTimeVz(0),
135 fhTimeId(0), fhTimeL1UnCorrId(0), fhTimeAmp(0),
136 fhAmpIdLowGain(0), fhTimeIdLowGain(0), fhTimeAmpLowGain(0),
137 
138 fhCellECross(0),
139 
140 fhEMCALPHOSCorrNClusters(0), fhEMCALPHOSCorrEClusters(0),
141 fhEMCALPHOSCorrNCells(0), fhEMCALPHOSCorrECells(0),
142 fhEMCALDCALCorrNClusters(0), fhEMCALDCALCorrEClusters(0),
143 fhEMCALDCALCorrNCells(0), fhEMCALDCALCorrECells(0),
144 fhDCALPHOSCorrNClusters(0), fhDCALPHOSCorrEClusters(0),
145 fhDCALPHOSCorrNCells(0), fhDCALPHOSCorrECells(0),
146 fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0),
147 fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
148 fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0),
149 fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
150 fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0),
151 fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
152 fhCaloCenNClusters(0), fhCaloCenEClusters(0),
153 fhCaloCenNCells(0), fhCaloCenECells(0),
154 fhCaloEvPNClusters(0), fhCaloEvPEClusters(0),
155 fhCaloEvPNCells(0), fhCaloEvPECells(0),
156 
157 // Super-Module dependent histograms
158 fhEMod(0), fhAmpMod(0),
159 fhEWeirdMod(0), fhAmpWeirdMod(0),
160 fhTimeMod(0),
161 fhNClustersMod(0), fhNCellsMod(0),
162 fhNCellsSumAmpPerMod(0), fhNClustersSumEnergyPerMod(0),
163 fhNCellsPerClusterMod(0), fhNCellsPerClusterModNoCut(0),
164 fhNCellsPerClusterWeirdMod(0), fhNCellsPerClusterWeirdModNoCut(0),
165 
166 fhGridCells(0), fhGridCellsE(0), fhGridCellsTime(0),
167 fhGridCellsLowGain(0), fhGridCellsELowGain(0), fhGridCellsTimeLowGain(0),
168 fhTimeAmpPerRCU(0), fhIMMod(0),
169 
170 // MC and reco
171 fhRecoMCE(), fhRecoMCPhi(), fhRecoMCEta(),
172 fhRecoMCDeltaE(), fhRecoMCRatioE(),
173 fhRecoMCDeltaPhi(), fhRecoMCDeltaEta(),
174 
175 // MC only
176 fhGenMCE(), fhGenMCPt(), fhGenMCEtaPhi(),
177 fhGenMCAccE(), fhGenMCAccPt(), fhGenMCAccEtaPhi(),
178 
179 // Matched MC
180 fhEMVxyz(0), fhEMR(0),
181 fhHaVxyz(0), fhHaR(0),
182 fh1EOverP(0), fh2dR(0),
183 fh2EledEdx(0), fh2MatchdEdx(0),
184 fh1EOverPR02(0), fh1EleEOverP(0),
185 fhMCEle1EOverP(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
186 fhMCChHad1EOverP(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
187 fhMCNeutral1EOverP(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0),
188 fhMCEle1EOverPR02(0), fhMCChHad1EOverPR02(0), fhMCNeutral1EOverPR02(0),
189 fhMCEle1EleEOverP(0), fhMCChHad1EleEOverP(0), fhMCNeutral1EleEOverP(0),
190 fhTrackMatchedDEtaNeg(0), fhTrackMatchedDPhiNeg(0), fhTrackMatchedDEtaDPhiNeg(0),
191 fhTrackMatchedDEtaPos(0), fhTrackMatchedDPhiPos(0), fhTrackMatchedDEtaDPhiPos(0),
192 fhTrackMatchedDEtaNegMod(0), fhTrackMatchedDPhiNegMod(0),
193 fhTrackMatchedDEtaPosMod(0), fhTrackMatchedDPhiPosMod(0)
194 {
195  // MC
196 
197  for(Int_t i = 0; i < 7; i++)
198  {
199  fhRecoMCE[i][0] = 0; fhRecoMCE[i][1] = 0;
200  fhRecoMCPhi[i][0] = 0; fhRecoMCPhi[i][1] = 0;
201  fhRecoMCEta[i][0] = 0; fhRecoMCEta[i][1] = 0;
202  fhRecoMCDeltaE[i][0] = 0; fhRecoMCDeltaE[i][1] = 0;
203  fhRecoMCRatioE[i][0] = 0; fhRecoMCRatioE[i][1] = 0;
204  fhRecoMCDeltaPhi[i][0] = 0; fhRecoMCDeltaPhi[i][1] = 0;
205  fhRecoMCDeltaEta[i][0] = 0; fhRecoMCDeltaEta[i][1] = 0;
206  }
207 
208  for(Int_t i = 0; i < 4; i++)
209  {
210  fhGenMCE[i] = 0;
211  fhGenMCPt[i] = 0;
212  fhGenMCEtaPhi[i] = 0;
213  fhGenMCAccE[i] = 0;
214  fhGenMCAccPt[i] = 0;
215  fhGenMCAccEtaPhi[i] = 0;
216  }
217 
218  //
219 
220  for(Int_t i = 0; i < 14; i++)
221  {
222  fhEBinClusterEtaPhi[i] = 0 ;
223  fhEBinClusterColRow[i] = 0 ;
224  fhEBinCellColRow [i] = 0 ;
225  }
226 
227  for(Int_t bc = 0; bc < 4; bc++) fhTimePerSMPerBC[bc] = 0 ;
228 
229  InitParameters();
230 }
231 
232 //______________________________________________________________________________________________________________________
241 //______________________________________________________________________________________________________________________
242 void AliAnaCalorimeterQA::BadClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
243  Int_t absIdMax, Double_t maxCellFraction, Float_t eCrossFrac,
244  Double_t tmax)
245 {
246  // printf("AliAnaCalorimeterQA::BadClusterHistograms() - Event %d - Calorimeter %s \n \t E %f, n cells %d, max cell absId %d, maxCellFrac %f\n",
247  // GetReader()->GetEventNumber(), GetCalorimeterString().Data(),
248  // clus->E(),clus->GetNCells(),absIdMax,maxCellFraction);
249 
250  Double_t tof = clus->GetTOF()*1.e9;
251  if(tof > 400) tof-=fConstantTimeShift;
252 
253  Float_t energy = clus->E();
254 
255  fhBadClusterEnergy ->Fill(energy, GetEventWeight());
256  fhBadClusterTimeEnergy ->Fill(energy, tof , GetEventWeight());
257 
259  {
260  fhBadClusterMaxCellDiff ->Fill(energy, maxCellFraction, GetEventWeight());
261  fhBadClusterMaxCellECross->Fill(energy, eCrossFrac , GetEventWeight());
262  }
263 
264  Float_t phi = fClusterMomentum.Phi();
265  if(phi < 0) phi += TMath::TwoPi();
266 
267  if(energy > 0.5) fhBadClusterEtaPhi->Fill(fClusterMomentum.Eta(), phi, GetEventWeight());
268 
269  fhBadClusterLambda0->Fill(energy, clus->GetM02());
270  fhBadClusterLambda1->Fill(energy, clus->GetM20());
271 
273  {
274  // Clusters in event time difference bad minus good
275 
276  for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ )
277  {
278  AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
279 
280  if(clus->GetID() == clus2->GetID()) continue;
281 
282  Float_t maxCellFraction2 = 0.;
283  Int_t absIdMax2 = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction2);
284 
285  if(IsGoodCluster(absIdMax2, clus->GetM02(), clus->GetNCells(), cells) && clus2->GetM02() > 0.1 )
286  {
287  Double_t tof2 = clus2->GetTOF()*1.e9;
288  if(tof2>400) tof2-=fConstantTimeShift;
289 
290  fhBadClusterPairDiffTimeE ->Fill(clus->E(), (tof-tof2), GetEventWeight());
291  }
292  } // loop
293  }
294 
295 // // Max cell compared to other cells in cluster
296 // if(fFillAllCellTimeHisto && fFillClusterMaxCellHisto)
297 // {
298 // // Get some time averages
299 // Double_t timeAverages[2] = {0.,0.};
300 // CalculateAverageTime(clus, cells, timeAverages);
301 //
302 // fhBadClusterMaxCellDiffAverageTime ->Fill(clus->E(), tmax-timeAverages[0], GetEventWeight());
303 // fhBadClusterMaxCellDiffWeightedTime->Fill(clus->E(), tmax-timeAverages[1], GetEventWeight());
304 // }
305 
307  {
308  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
309  {
310  Int_t absId = clus->GetCellsAbsId()[ipos];
311  if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
312  {
313  Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
314 
315  fhBadClusterMaxCellCloseCellRatio->Fill(clus->E(), frac, GetEventWeight());
316  fhBadClusterMaxCellCloseCellDiff ->Fill(clus->E(), cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId), GetEventWeight());
317 
319  {
320  Double_t time = cells->GetCellTime(absId);
321  GetCaloUtils()->RecalibrateCellTime(time, GetCalorimeter(), absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
322 
323  Float_t diff = (tmax-(time*1e9-fConstantTimeShift));
324  fhBadCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff, GetEventWeight());
325 
326  }
327  } // Not max
328  } // loop
329  }
330 }
331 
332 //______________________________________________________________________
337 //______________________________________________________________________
339  AliVCaloCells* cells,
340  Double_t timeAverages[2])
341 {
342  // First recalculate energy in case non linearity was applied
343  Float_t energy = 0;
344  Float_t ampMax = 0, amp = 0;
345 //Int_t absIdMax = -1;
346 
347  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
348  {
349  Int_t id = clus->GetCellsAbsId()[ipos];
350 
351  // Recalibrate cell energy if needed
352  amp = cells->GetCellAmplitude(id);
354 
355  energy += amp;
356 
357  if(amp> ampMax)
358  {
359  ampMax = amp;
360 // absIdMax = id;
361  }
362  } // energy loop
363 
364  // Calculate average time of cells in cluster and weighted average
365  Double_t aTime = 0;
366  Double_t wTime = 0;
367  Float_t wTot = 0;
368  Double_t time = 0;
369  Int_t id =-1;
370  Double_t w = 0;
371  Int_t ncells = clus->GetNCells();
372 
373  for (Int_t ipos = 0; ipos < ncells; ipos++)
374  {
375  id = clus ->GetCellsAbsId()[ipos];
376  amp = cells->GetCellAmplitude(id);
377  time = cells->GetCellTime(id);
378 
379  // Recalibrate energy and time
381  GetCaloUtils()->RecalibrateCellTime (time, GetCalorimeter(), id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
382 
383  w = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cells->GetCellAmplitude(id),energy);
384  aTime += time*1e9;
385  wTime += time*1e9 * w;
386  wTot += w;
387  }
388 
389  if(ncells > 0) aTime /= ncells;
390  else aTime = 0;
391 
392  if(wTot > 0) wTime /= wTot;
393  else wTime = 0;
394 
395  timeAverages[0] = aTime;
396  timeAverages[1] = wTime;
397 }
398 
399 //____________________________________________________________
402 //____________________________________________________________
403 void AliAnaCalorimeterQA::CellHistograms(AliVCaloCells *cells)
404 {
405  if(!fFillAllCellHistograms) return;
406 
407  Int_t ncells = cells->GetNumberOfCells();
408  if( ncells > 0 ) fhNCells->Fill(ncells, GetEventWeight()) ; // Not ok for PHOS with CPV
409 
410  Int_t ncellsCut = 0;
411  Float_t ecellsCut = 0;
412 
413  AliDebug(1,Form("%s cell entries %d", GetCalorimeterString().Data(), ncells));
414 
415  // Init arrays and used variables
416  Int_t *nCellsInModule = new Int_t [fNModules];
417  Float_t *eCellsInModule = new Float_t[fNModules];
418 
419  for(Int_t imod = 0; imod < fNModules; imod++ )
420  {
421  nCellsInModule[imod] = 0 ;
422  eCellsInModule[imod] = 0.;
423  }
424 
425  Int_t icol = -1, icolAbs = -1;
426  Int_t irow = -1, irowAbs = -1;
427  Int_t iRCU = -1;
428  Float_t amp = 0.;
429  Double_t time = 0.;
430  Double_t timeL1UnCorr= 0.;
431  Int_t id = -1;
432  Bool_t highG = kFALSE;
433  Float_t recalF = 1.;
434  Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
435  Int_t status = 0;
436  for (Int_t iCell = 0; iCell < cells->GetNumberOfCells(); iCell++)
437  {
438  if ( cells->GetCellNumber(iCell) < 0 ) continue; // CPV
439 
440  AliDebug(2,Form("Cell : amp %f, absId %d", cells->GetAmplitude(iCell), cells->GetCellNumber(iCell)));
441 
442  Int_t nModule = GetModuleNumberCellIndexesAbsCaloMap(cells->GetCellNumber(iCell),GetCalorimeter(),
443  icol , irow, iRCU,
444  icolAbs, irowAbs );
445 
446  if ( nModule < fFirstModule || nModule > fLastModule )
447  {
448  AliDebug(1,Form("Cell module out of range %d",nModule));
449  continue ;
450  }
451 
452  AliDebug(2,Form("\t module %d, column %d (%d), row %d (%d)", nModule,icolAbs,icol,irowAbs,irow));
453 
454  // Check if the cell is a bad channel
455  if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn())
456  {
457  if(GetCalorimeter()==kEMCAL)
458  {
459  if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow,status)) continue;
460  }
461  else
462  {
463  if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow) ) continue;
464  }
465  } // use bad channel map
466 
467  amp = cells->GetAmplitude(iCell)*recalF;
468  time = cells->GetTime(iCell);
469  id = cells->GetCellNumber(iCell);
470  highG = cells->GetCellHighGain(id);
471  if(IsDataMC()) highG = kTRUE; // MC does not distinguish High and Low, put them all in high
472 
473  // Amplitude recalibration if set
475 
476  // Time recalibration if set
477  GetCaloUtils()->RecalibrateCellTime (time, GetCalorimeter(), id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
478  timeL1UnCorr=time;
479  // Correction of L1 phase if set
480  GetCaloUtils()->RecalibrateCellTimeL1Phase(time,0 , nModule, GetReader()->GetInputEvent()->GetBunchCrossNumber());
481  // Transform time to ns
482  time *= 1.0e9;
483  time-=fConstantTimeShift;
484  timeL1UnCorr *= 1.0e9;
485  timeL1UnCorr-=fConstantTimeShift;
486 
487  if(time < fTimeCutMin || time > fTimeCutMax)
488  {
489  AliDebug(1,Form("Remove cell with Time %f",time));
490  continue;
491  }
492 
493  // Remove exotic cells, defined only for EMCAL
494  if(GetCalorimeter()==kEMCAL &&
495  GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(id, cells, bc)) continue;
496 
497  Double_t binWidthCorrection=1;
498  if(amp>=10)binWidthCorrection=1.0/4;
499  if(amp>=20)binWidthCorrection=1.0/10;
500  fhAmplitude ->Fill(amp, GetEventWeight());
501  fhAmpMod ->Fill(amp, nModule, GetEventWeight());
502  fhAmpWeirdMod->Fill(amp, nModule, GetEventWeight());
503 
505  {
506  fhAmpId->Fill(amp, id , GetEventWeight()*binWidthCorrection);
507 
508  if(!highG) fhAmpIdLowGain->Fill(amp, id, GetEventWeight());
509  }
510 
512  {
513  for(Int_t ie = 0; ie < fNEBinCuts; ie++)
514  {
515  if( amp >= fEBinCuts[ie] && amp < fEBinCuts[ie+1] )
516  {
517  fhEBinCellColRow[ie]->Fill(icolAbs,irowAbs,GetEventWeight()) ;
518  }
519  }
520  }
521 
522  // E cross for exotic cells
523  if(amp > 0.05)
524  {
525  fhCellECross->Fill(amp, 1-GetCaloUtils()->GetECross(id,cells,bc)/amp, GetEventWeight());
526  ecellsCut+=amp ;
527  }
528 
529  if ( amp > fCellAmpMin )
530  {
531  ncellsCut++ ;
532  nCellsInModule[nModule]++ ;
533  eCellsInModule[nModule]+=amp;
534 
535  fhGridCells ->Fill(icolAbs, irowAbs, GetEventWeight());
536  fhGridCellsE->Fill(icolAbs, irowAbs, amp );
537 
538  if(!highG)
539  {
540  fhGridCellsLowGain ->Fill(icolAbs, irowAbs, GetEventWeight());
541  fhGridCellsELowGain->Fill(icolAbs, irowAbs, amp );
542  }
543 
545  {
546  //printf("%s: time %g\n",GetCalorimeterString().Data(), time);
547 
548  // Double_t v[3] = {0,0,0}; //vertex ;
549  // GetReader()->GetVertex(v);
550  // if(amp > 0.5) fhTimeVz ->Fill(TMath::Abs(v[2]), time, GetEventWeight());
551 
552  fhTime ->Fill(time, GetEventWeight());
553  fhTimeAmp ->Fill(amp , time, GetEventWeight());
554 
556  {
557  fhTimeId ->Fill(time, id , GetEventWeight());
558 
559  if(GetCaloUtils()->IsL1PhaseInTimeRecalibrationOn()==1)
560  fhTimeL1UnCorrId ->Fill(timeL1UnCorr, id , GetEventWeight());
561  }
562 
563  Int_t bc = (GetReader()->GetInputEvent()->GetBunchCrossNumber())%4;
564  fhTimePerSMPerBC[bc]->Fill(time, nModule, GetEventWeight());
565 
566  fhGridCellsTime->Fill(icolAbs, irowAbs, time);
567  if(!highG) fhGridCellsTimeLowGain->Fill(icolAbs, irowAbs, time);
568 
569  fhTimeMod->Fill(time, nModule, GetEventWeight());
570 
572  fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time, GetEventWeight());
573 
574  if(!highG)
575  {
577  fhTimeIdLowGain ->Fill(time, id , GetEventWeight());
578  fhTimeAmpLowGain->Fill(amp , time, GetEventWeight());
579  }
580  }
581  }
582 
583  // Get Eta-Phi position of Cell
584  if(fFillAllPosHisto)
585  {
586  if ( GetCalorimeter() == kEMCAL && GetCaloUtils()->IsEMCALGeoMatrixSet() )
587  {
588  Float_t celleta = 0.;
589  Float_t cellphi = 0.;
590  GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
591 
592  if ( cellphi < 0 ) cellphi+=TMath::TwoPi();
593 
594  if(fFillAllTH3)
595  fhEtaPhiAmpCell->Fill(celleta, cellphi, amp, GetEventWeight());
596  else
597  fhEtaPhiCell ->Fill(celleta, cellphi, GetEventWeight());
598 
599  Double_t cellpos[] = {0, 0, 0};
600  GetEMCALGeometry()->GetGlobal(id, cellpos);
601 
602  fhXCellE->Fill(cellpos[0], amp, GetEventWeight()) ;
603  fhYCellE->Fill(cellpos[1], amp, GetEventWeight()) ;
604  fhZCellE->Fill(cellpos[2], amp, GetEventWeight()) ;
605 
606  Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
607  fhRCellE ->Fill(rcell, amp, GetEventWeight()) ;
608 
609  fhXYZCell->Fill(cellpos[0], cellpos[1], cellpos[2], GetEventWeight()) ;
610  } // EMCAL Cells
611  else if ( GetCalorimeter() == kPHOS && GetCaloUtils()->IsPHOSGeoMatrixSet() )
612  {
613  TVector3 xyz;
614  Int_t relId[4], module;
615  Float_t xCell, zCell;
616 
617  GetPHOSGeometry()->AbsToRelNumbering(id,relId);
618  module = relId[0];
619  GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
620  GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
621 
622  Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
623 
624  fhXCellE ->Fill(xyz.X(), amp, GetEventWeight()) ;
625  fhYCellE ->Fill(xyz.Y(), amp, GetEventWeight()) ;
626  fhZCellE ->Fill(xyz.Z(), amp, GetEventWeight()) ;
627  fhRCellE ->Fill(rcell , amp, GetEventWeight()) ;
628 
629  fhXYZCell->Fill(xyz.X(), xyz.Y(), xyz.Z(), GetEventWeight()) ;
630  } // PHOS cells
631  } // Fill cell position histograms
632 
633 
634  } // Cell loop
635 
636  // Fill the cells after the cut on min amplitude and bad/exotic channels
637  if( ncellsCut > 0 ) fhNCellsCutAmpMin->Fill(ncellsCut, GetEventWeight()) ;
638 
639  // Number of cells per module
640  for(Int_t imod = 0; imod < fNModules; imod++ )
641  {
642  if ( imod < fFirstModule || imod > fLastModule ) continue ;
643 
644  AliDebug(1,Form("Module %d, calo %s, N cells %d, sum Amp %f", imod, GetCalorimeterString().Data(), nCellsInModule[imod], eCellsInModule[imod]));
645 
646  fhNCellsMod ->Fill(nCellsInModule[imod], imod, GetEventWeight()) ;
647  fhSumCellsAmpMod->Fill(eCellsInModule[imod], imod, GetEventWeight()) ;
648 
650  fhNCellsSumAmpPerMod[imod]->Fill(eCellsInModule[imod], nCellsInModule[imod], GetEventWeight());
651  }
652 
653  delete [] nCellsInModule;
654  delete [] eCellsInModule;
655 }
656 
657 //__________________________________________________________________________
660 //__________________________________________________________________________
662 {
663  Int_t nCaloCellsPerCluster = clus->GetNCells();
664 
665  UShort_t * indexList = clus->GetCellsAbsId();
666 
667  Float_t pos[3];
668  clus->GetPosition(pos);
669 
670  Float_t clEnergy = clus->E();
671 
672  // Loop on cluster cells
673  for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
674  {
675  // printf("Index %d\n",ipos);
676  Int_t absId = indexList[ipos];
677 
678  //Get position of cell compare to cluster
679 
680  if ( GetCalorimeter() == kEMCAL && GetCaloUtils()->IsEMCALGeoMatrixSet() )
681  {
682  Double_t cellpos[] = {0, 0, 0};
683  GetEMCALGeometry()->GetGlobal(absId, cellpos);
684 
685  fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0], nCaloCellsPerCluster, GetEventWeight()) ;
686  fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1], nCaloCellsPerCluster, GetEventWeight()) ;
687  fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2], nCaloCellsPerCluster, GetEventWeight()) ;
688 
689  fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0], clEnergy, GetEventWeight()) ;
690  fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1], clEnergy, GetEventWeight()) ;
691  fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2], clEnergy, GetEventWeight()) ;
692 
693  Float_t r = TMath::Sqrt(pos[0] *pos[0] + pos[1] * pos[1] );
694  Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0] + cellpos[1]* cellpos[1]);
695 
696  fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster, GetEventWeight()) ;
697  fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy , GetEventWeight()) ;
698  } // EMCAL and its matrices are available
699  else if ( GetCalorimeter() == kPHOS && GetCaloUtils()->IsPHOSGeoMatrixSet() )
700  {
701  TVector3 xyz;
702  Int_t relId[4], module;
703  Float_t xCell, zCell;
704 
705  GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
706  module = relId[0];
707  GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
708  GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
709 
710  fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(), nCaloCellsPerCluster, GetEventWeight()) ;
711  fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(), nCaloCellsPerCluster, GetEventWeight()) ;
712  fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(), nCaloCellsPerCluster, GetEventWeight()) ;
713 
714  fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(), clEnergy, GetEventWeight()) ;
715  fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(), clEnergy, GetEventWeight()) ;
716  fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(), clEnergy, GetEventWeight()) ;
717 
718  Float_t r = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1] );
719  Float_t rcell = TMath::Sqrt(xyz.X() * xyz.X() + xyz.Y() * xyz.Y());
720 
721  fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster, GetEventWeight()) ;
722  fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy , GetEventWeight()) ;
723  } // PHOS and its matrices are available
724  } // cluster cell loop
725 }
726 
727 //__________________________________________________________________________________________________________________
736 //__________________________________________________________________________________________________________________
737 void AliAnaCalorimeterQA::ClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
738  Int_t absIdMax, Double_t maxCellFraction, Float_t eCrossFrac,
739  Double_t tmax)
740 {
741  Double_t tof = clus->GetTOF()*1.e9;
742  if(tof>400) tof-=fConstantTimeShift;
743  fhClusterTimeEnergy ->Fill(clus->E(), tof , GetEventWeight());
744 
745  fhLambda0 ->Fill(clus->E(), clus->GetM02() , GetEventWeight());
746  fhLambda1 ->Fill(clus->E(), clus->GetM20() , GetEventWeight());
747 //fhDispersion ->Fill(clus->E(), clus->GetDispersion(), GetEventWeight());
748  fhNLocMax ->Fill(clus->E(), GetCaloUtils()->GetNumberOfLocalMaxima(clus,cells), GetEventWeight());
749  fhNLocMaxStd ->Fill(clus->E(), clus->GetNExMax() , GetEventWeight());
750 
752  {
753  fhClusterMaxCellDiff ->Fill(clus->E(), maxCellFraction, GetEventWeight());
754  fhClusterMaxCellECross->Fill(clus->E(), eCrossFrac , GetEventWeight());
755  }
756 
757  Int_t nModule = GetModuleNumber(clus);
758  Int_t nCaloCellsPerCluster = clus->GetNCells();
759 
760  // Clusters in event time difference
762  {
763  for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ )
764  {
765  AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
766 
767  if( clus->GetID() == clus2->GetID() ) continue;
768 
769  if( clus->GetM02() > 0.01 && clus2->GetM02() > 0.01 )
770  {
771  Int_t nModule2 = GetModuleNumber(clus2);
772 
773  Double_t tof2 = clus2->GetTOF()*1.e9;
774  if(tof2>400) tof2-=fConstantTimeShift;
775 
776 
777  fhClusterPairDiffTimeE ->Fill(clus->E(), tof-tof2, GetEventWeight());
778 
779  if ( nModule2 == nModule )
780  fhClusterPairDiffTimeESameMod->Fill(clus->E(), tof-tof2, GetEventWeight());
781  }
782  } // loop
783  } // fill cluster pair time diff
784 
785  if(nCaloCellsPerCluster > 1 &&
787  {
788  // Check time of cells respect to max energy cell
789 
790 // if(fFillAllCellTimeHisto && fFillClusterMaxCellHisto)
791 // {
792 // // Get some time averages
793 // Double_t timeAverages[2] = {0.,0.};
794 // CalculateAverageTime(clus, cells, timeAverages);
795 //
796 // fhClusterMaxCellDiffAverageTime ->Fill(clus->E(), tmax-timeAverages[0], GetEventWeight());
797 // fhClusterMaxCellDiffWeightedTime ->Fill(clus->E(), tmax-timeAverages[1], GetEventWeight());
798 // }
799 
800  for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
801  {
802  Int_t absId = clus->GetCellsAbsId()[ipos];
803  if( absId == absIdMax || cells->GetCellAmplitude(absIdMax) < 0.01 ) continue;
804 
805  Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
806 
808  {
809  fhClusterMaxCellCloseCellRatio->Fill(clus->E(), frac, GetEventWeight());
810  fhClusterMaxCellCloseCellDiff ->Fill(clus->E(), cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId), GetEventWeight());
811  }
812 
814  {
815  Double_t time = cells->GetCellTime(absId);
816  GetCaloUtils()->RecalibrateCellTime(time, GetCalorimeter(), absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
817 
818  Float_t diff = (tmax-(time*1.0e9-fConstantTimeShift));
819 
821  fhCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff, GetEventWeight());
822 
824  TMath::Abs(TMath::Abs(diff) > 100) && clus->E() > 1 )
826  }
827 
828  } // Fill cell-cluster histogram loop
829  } // Check time and energy of cells respect to max energy cell if cluster of more than 1 cell
830 
831  Float_t e = fClusterMomentum.E();
832  Float_t pt = fClusterMomentum.Pt();
833  Float_t eta = fClusterMomentum.Eta();
834  Float_t phi = GetPhi(fClusterMomentum.Phi());
835 
836  AliDebug(1,Form("cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f",e,pt,eta,phi*TMath::RadToDeg()));
837 
838  fhE ->Fill(e, GetEventWeight());
839  if(nModule >=0 && nModule < fNModules)
840  {
841  fhEMod ->Fill(e, nModule, GetEventWeight());
842  fhEWeirdMod->Fill(e, nModule, GetEventWeight()); // different binning
843  }
844 
845  fhPt ->Fill(pt , GetEventWeight());
846  fhPhi ->Fill(phi, GetEventWeight());
847  fhEta ->Fill(eta, GetEventWeight());
848 
850  {
851  Int_t icol = -1, irow = -1, iRCU = -1, icolAbs = -1, irowAbs = -1;
852  GetModuleNumberCellIndexesAbsCaloMap(absIdMax,GetCalorimeter(), icol, irow, iRCU, icolAbs, irowAbs);
853 
854  for(Int_t ie = 0; ie < fNEBinCuts; ie++)
855  {
856  if( e >= fEBinCuts[ie] && e < fEBinCuts[ie+1] )
857  {
858  fhEBinClusterEtaPhi[ie]->Fill(eta,phi,GetEventWeight()) ;
859 
860  fhEBinClusterColRow[ie]->Fill(icolAbs,irowAbs,GetEventWeight()) ;
861  }
862  }
863  }
864  else if ( fFillAllTH3 ) fhEtaPhiE->Fill(eta, phi, e, GetEventWeight());
865  else if ( e > 0.5 ) fhEtaPhi ->Fill(eta, phi, GetEventWeight());
866 
867  // Cells per cluster
868  fhNCellsPerCluster->Fill(e, nCaloCellsPerCluster, GetEventWeight());
869 
870  if(e > 100)
871  fhNCellsPerClusterWeirdMod->Fill(nCaloCellsPerCluster, nModule, GetEventWeight());
872 
873  // Position
875  {
876  Float_t pos[3] ;
877  clus->GetPosition(pos);
878 
879  fhXE ->Fill(pos[0], e, GetEventWeight());
880  fhYE ->Fill(pos[1], e, GetEventWeight());
881  fhZE ->Fill(pos[2], e, GetEventWeight());
882 
883  fhXYZ ->Fill(pos[0], pos[1], pos[2], GetEventWeight());
884 
885  fhXNCells->Fill(pos[0], nCaloCellsPerCluster, GetEventWeight());
886  fhYNCells->Fill(pos[1], nCaloCellsPerCluster, GetEventWeight());
887  fhZNCells->Fill(pos[2], nCaloCellsPerCluster, GetEventWeight());
888 
889  Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
890 
891  fhRE ->Fill(rxyz, e , GetEventWeight());
892  fhRNCells->Fill(rxyz, nCaloCellsPerCluster, GetEventWeight());
893  }
894 
895  if( nModule >= 0 && nModule < fNModules ) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster, GetEventWeight());
896 }
897 
898 //____________________________________________________________________________
910 //____________________________________________________________________________
912  AliVCaloCells* cells)
913 {
914  if(!fFillAllClusterHistograms) return;
915 
916  Int_t nLabel = 0 ;
917  Int_t *labels = 0x0;
918  Int_t nCaloClusters = caloClusters->GetEntriesFast() ;
919  Int_t nCaloClustersAccepted = 0 ;
920  Int_t nCaloCellsPerCluster = 0 ;
921  Bool_t matched = kFALSE;
922  Int_t nModule =-1 ;
923  Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
924 
925  // Get vertex for photon momentum calculation and event selection
926  Double_t v[3] = {0,0,0}; //vertex ;
927 //GetReader()->GetVertex(v);
928 
929  Int_t *nClustersInModule = new Int_t [fNModules];
930  Float_t *energyInModule = new Float_t[fNModules];
931  for(Int_t imod = 0; imod < fNModules; imod++ )
932  {
933  nClustersInModule[imod] = 0;
934  energyInModule [imod] = 0;
935  }
936 
937  AliDebug(1,Form("In %s there are %d clusters", GetCalorimeterString().Data(), nCaloClusters));
938 
939  // Loop over CaloClusters
940  for(Int_t iclus = 0; iclus < nCaloClusters; iclus++)
941  {
942  AliDebug(1,Form("Cluster: %d/%d, data %d",iclus+1,nCaloClusters,GetReader()->GetDataType()));
943 
944  AliVCluster* clus = (AliVCluster*) caloClusters->At(iclus);
945 
946  // SuperModule number of cluster
947  nModule = GetModuleNumber(clus);
948  if ( nModule < fFirstModule || nModule > fLastModule )
949  {
950  AliDebug(1,Form("Cluster module out of range %d",nModule));
951  continue ;
952  }
953 
954  // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
955  Float_t maxCellFraction = 0.;
956  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus,maxCellFraction);
957 
958  // Cut on time of clusters
959  Double_t tof = clus->GetTOF()*1.e9;
960  if(tof>400) tof-=fConstantTimeShift;
961 
962  if( tof < fTimeCutMin || tof > fTimeCutMax )
963  {
964  AliDebug(1,Form("Remove cluster with TOF %2.2f",tof));
965  continue;
966  }
967 
968  // Get cluster kinematics
969  clus->GetMomentum(fClusterMomentum,v);
970 
971  // Check only certain regions
972  Bool_t in = kTRUE;
974  if(!in)
975  {
976  AliDebug(1,Form("Remove cluster with phi %2.2f and eta %2.2f",
977  GetPhi(fClusterMomentum.Phi())*TMath::RadToDeg(),fClusterMomentum.Eta()));
978  continue;
979  }
980 
981  // MC labels
982  nLabel = clus->GetNLabels();
983  labels = clus->GetLabels();
984 
985  // Cells per cluster
986  nCaloCellsPerCluster = clus->GetNCells();
987 
988  // Cluster mathed with track?
989  matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(), GetReader()->GetInputEvent());
990 
991  // Get time of max cell
992  Double_t tmax = cells->GetCellTime(absIdMax);
993  GetCaloUtils()->RecalibrateCellTime(tmax, GetCalorimeter(), absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
994  tmax*=1.e9;
995  tmax-=fConstantTimeShift;
996  //
997  // Fill histograms related to single cluster
998  //
999 
1000  // Fill some histograms before applying the exotic cell / bad map cut
1001  if(fStudyBadClusters)
1002  {
1003  fhNCellsPerClusterNoCut->Fill(clus->E(), nCaloCellsPerCluster, GetEventWeight());
1004 
1005  if(nModule >=0 && nModule < fNModules)
1006  {
1007  fhNCellsPerClusterModNoCut[nModule]->Fill(clus->E(), nCaloCellsPerCluster, GetEventWeight());
1008  if(clus->E() > 100) fhNCellsPerClusterWeirdModNoCut->Fill(nCaloCellsPerCluster, nModule, GetEventWeight());
1009  }
1010 
1012  fhClusterMaxCellDiffNoCut->Fill(clus->E(), maxCellFraction, GetEventWeight());
1013  }
1014 
1015  Float_t ampMax = cells->GetCellAmplitude(absIdMax);
1016  GetCaloUtils()->RecalibrateCellAmplitude(ampMax,GetCalorimeter(), absIdMax);
1017 
1018  // Check bad clusters if requested and rejection was not on
1019  Bool_t goodCluster = IsGoodCluster(absIdMax, clus->GetM02(), nCaloCellsPerCluster, cells);
1020 
1021  Float_t eCrossFrac = 0;
1022  if(ampMax > 0.01) eCrossFrac = 1-GetCaloUtils()->GetECross(absIdMax,cells,bc)/ampMax;
1023 
1024  AliDebug(1,Form("Accept cluster? %d",goodCluster));
1025 
1026  if(!goodCluster)
1027  {
1028  if ( fStudyBadClusters ) BadClusterHistograms(clus, caloClusters,
1029  cells, absIdMax,
1030  maxCellFraction,
1031  eCrossFrac, tmax);
1032  continue;
1033  }
1034 
1035  //
1036  ClusterHistograms(clus, caloClusters, cells, absIdMax,
1037  maxCellFraction, eCrossFrac, tmax);
1038 
1039  nCaloClustersAccepted++;
1040 
1041  //
1042  if(nModule >=0 && nModule < fNModules && fClusterMomentum.E() > 2*fCellAmpMin)
1043  {
1044  nClustersInModule[nModule]++;
1045  if(clus->E() > 0.5)
1046  energyInModule [nModule] += clus->E();
1047  }
1048 
1049  // Cells in cluster position
1051 
1052  // Fill histograms related to single cluster, mc vs data
1053  Int_t mcOK = kFALSE;
1054  Int_t pdg = -1;
1055  if(IsDataMC() && nLabel > 0 && labels)
1056  mcOK = ClusterMCHistograms(matched, labels, nLabel, pdg);
1057 
1058  // Matched clusters with tracks, also do some MC comparison, needs input from ClusterMCHistograms
1059  if( matched && fFillAllTMHisto)
1060  ClusterMatchedWithTrackHistograms(clus,mcOK,pdg);
1061 
1062  // Invariant mass
1063  // Try to reduce background with a mild shower shape cut and no more than 1 maxima
1064  // in cluster and remove low energy clusters
1065 
1066  if ( fFillAllPi0Histo
1067  && nCaloClusters > 1
1068  && nCaloCellsPerCluster > 1
1069  && GetCaloUtils()->GetNumberOfLocalMaxima(clus,cells) == 1
1070  && clus->GetM02() < fInvMassMaxM02Cut
1071  && clus->GetM02() > fInvMassMinM02Cut
1072  && clus->E() > fInvMassMinECut
1073  && clus->E() < fInvMassMaxECut
1074  )
1075  InvariantMassHistograms(iclus, nModule, caloClusters,cells);
1076 
1077  } // Cluster loop
1078 
1079  // Number of clusters histograms
1080  if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted, GetEventWeight());
1081 
1082  // Number of clusters per module
1083  for(Int_t imod = 0; imod < fNModules; imod++ )
1084  {
1085  if ( imod < fFirstModule || imod > fLastModule ) continue ;
1086 
1087  AliDebug(1,Form("Module %d calo %s clusters %d, sum E %f", imod, GetCalorimeterString().Data(), nClustersInModule[imod], energyInModule[imod]));
1088 
1089  fhNClustersMod ->Fill(nClustersInModule[imod], imod, GetEventWeight());
1090  fhSumClustersEnergyMod->Fill(energyInModule [imod], imod, GetEventWeight());
1091 
1092  fhNClustersSumEnergyPerMod[imod]->Fill(energyInModule[imod], nClustersInModule[imod], GetEventWeight());
1093  }
1094 
1095  delete [] nClustersInModule;
1096  delete [] energyInModule;
1097 }
1098 
1099 //__________________________________________________________________________________
1108 //__________________________________________________________________________________
1110  Int_t nLabels, Int_t & pdg )
1111 {
1112  if(!labels || nLabels<=0)
1113  {
1114  AliWarning(Form("Strange, labels array %p, n labels %d", labels,nLabels));
1115  return kFALSE;
1116  }
1117 
1118  AliDebug(1,Form("Primaries: nlabels %d",nLabels));
1119 
1120  // Play with the MC stack if available
1121  Int_t label = labels[0];
1122 
1123  if(label < 0)
1124  {
1125  AliDebug(1,Form(" *** bad label ***: label %d", label));
1126  return kFALSE;
1127  }
1128 
1129  if( label >= GetMC()->GetNumberOfTracks())
1130  {
1131  AliDebug(1,Form("*** large label ***: label %d, n tracks %d", label, GetMC()->GetNumberOfTracks()));
1132  return kFALSE;
1133  }
1134 
1135  Float_t e = fClusterMomentum.E();
1136  Float_t eta = fClusterMomentum.Eta();
1137  Float_t phi = fClusterMomentum.Phi();
1138  if(phi < 0) phi +=TMath::TwoPi();
1139 
1140  AliVParticle * primary = 0x0;
1141 
1142  Int_t pdg0 =-1; Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1143  Float_t vxMC = 0; Float_t vyMC = 0;
1144  Float_t eMC = 0; //Float_t ptMC= 0;
1145  Float_t phiMC = 0; Float_t etaMC = 0;
1146  Int_t charge = 0;
1147 
1148  // Check the origin.
1149  Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels, nLabels, GetMC(),
1150  GetReader()->GetNameOfMCEventHederGeneratorToAccept());
1151 
1152  if ( !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown) )
1153  {
1154  primary = GetMC()->GetTrack(label);
1155  iMother = label;
1156  pdg0 = TMath::Abs(primary->PdgCode());
1157  pdg = pdg0;
1158  status = primary->MCStatusCode();
1159  vxMC = primary->Xv();
1160  vyMC = primary->Yv();
1161  iParent = primary->GetMother();
1162 
1163  AliDebug(1,"Cluster most contributing mother:");
1164  AliDebug(1,Form("\t Mother label %d, pdg %d, %s, status %d, Primary? %d, Physical Primary? %d, parent %d",
1165  iMother, pdg0, primary->GetName(),status, primary->IsPrimary(), primary->IsPhysicalPrimary(), iParent));
1166 
1167  // Get final particle, no conversion products
1168  if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1169  {
1170  // Get the parent
1171  primary = GetMC()->GetTrack(iParent);
1172  pdg = TMath::Abs(primary->PdgCode());
1173 
1174  AliDebug(2,"Converted cluster!. Find before conversion:");
1175 
1176  while((pdg == 22 || pdg == 11) && status != 1) //&& !aodprimary->IsPhysicalPrimary()
1177  {
1178  Int_t iMotherOrg = iMother;
1179  iMother = iParent;
1180  primary = GetMC()->GetTrack(iMother);
1181  status = primary->MCStatusCode();
1182  pdg = TMath::Abs(primary->PdgCode());
1183  iParent = primary->GetMother();
1184 
1185  // If gone too back and non stable, assign the decay photon/electron
1186  // there are other possible decays, ignore them for the moment
1187  if(pdg==111 || pdg==221)
1188  {
1189  primary = GetMC()->GetTrack(iMotherOrg);
1190  break;
1191  }
1192 
1193  if( iParent < 0 )
1194  {
1195  iParent = iMother;
1196  break;
1197  }
1198 
1199  AliDebug(2,Form("\t pdg %d, index %d, %s, status %d",pdg, iMother, primary->GetName(),status));
1200  }
1201 
1202  AliDebug(1,"Converted Cluster mother before conversion:");
1203  AliDebug(1,Form("\t Mother label %d, pdg %d, %s, status %d, Primary? %d, Physical Primary? %d, parent %d",
1204  iMother, pdg, primary->GetName(), status, primary->IsPrimary(), primary->IsPhysicalPrimary(), iParent));
1205 
1206  }
1207 
1208  // Overlapped pi0 (or eta, there will be very few), get the meson
1209  if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1210  GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1211  {
1212  AliDebug(2,"Overlapped Meson decay!, Find it:");
1213 
1214  while(pdg != 111 && pdg != 221)
1215  {
1216  //printf("iMother %d, pdg %d, iParent %d, pdg %d\n",iMother,pdg,iParent,GetMC()->Particle(iParent)->GetPdgCode());
1217  iMother = iParent;
1218  primary = GetMC()->GetTrack(iMother);
1219  status = primary->MCStatusCode();
1220  pdg = TMath::Abs(primary->PdgCode());
1221  iParent = primary->GetMother();
1222 
1223  if( iParent < 0 ) break;
1224 
1225  AliDebug(2,Form("\t pdg %d, %s, index %d",pdg, primary->GetName(),iMother));
1226 
1227  if(iMother==-1)
1228  {
1229  AliWarning("Tagged as Overlapped photon but meson not found, why?");
1230  //break;
1231  }
1232  }
1233 
1234  AliDebug(2,Form("Overlapped %s decay, label %d",primary->GetName(),iMother));
1235  }
1236 
1237  eMC = primary->E();
1238  //ptMC = primary->Pt();
1239  phiMC = primary->Phi();
1240  etaMC = primary->Eta();
1241  pdg = TMath::Abs(primary->PdgCode());
1242  //charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1243  charge = primary->Charge();
1244  }
1245 
1246  //Float_t vz = primary->Vz();
1247  Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1248  if( ( pdg == 22 || TMath::Abs(pdg) == 11 ) && status != 1 )
1249  {
1250  fhEMVxyz ->Fill(vxMC, vyMC, GetEventWeight());//,vz);
1251  fhEMR ->Fill(e , rVMC, GetEventWeight());
1252  }
1253 
1254  //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1255  //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1256  //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1257 
1258  // Overlapped pi0 (or eta, there will be very few)
1259  Int_t mcIndex = -1;
1260  if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0 ) )
1261  {
1262  mcIndex = kmcPi0;
1263  } // Overlapped pizero decay
1264  else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta ) )
1265  {
1266  mcIndex = kmcEta;
1267  } // Overlapped eta decay
1268  else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton ) )
1269  {
1270  if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1271  mcIndex = kmcPhotonConv ;
1272  else
1273  mcIndex = kmcPhoton ;
1274  } // photon
1275  else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) )
1276  {
1277  mcIndex = kmcElectron;
1278  fhEMVxyz->Fill(vxMC, vyMC, GetEventWeight());//,vz);
1279  fhEMR ->Fill(e , rVMC, GetEventWeight());
1280  }
1281  else if(charge == 0)
1282  {
1283  mcIndex = kmcNeHadron;
1284  fhHaVxyz->Fill(vxMC, vyMC, GetEventWeight());//,vz);
1285  fhHaR ->Fill(e , rVMC, GetEventWeight());
1286  }
1287  else if(charge!=0)
1288  {
1289  mcIndex = kmcChHadron;
1290  fhHaVxyz->Fill(vxMC, vyMC, GetEventWeight());//,vz);
1291  fhHaR ->Fill(e , rVMC, GetEventWeight());
1292  }
1293 
1294  //printf("mc index %d\n",mcIndex);
1295 
1296  if( mcIndex >= 0 && mcIndex < 7 && e > 0.5 && eMC > 0.5)
1297  {
1298  fhRecoMCE [mcIndex][(matched)]->Fill(e , eMC , GetEventWeight());
1299  fhRecoMCEta [mcIndex][(matched)]->Fill(eta, etaMC , GetEventWeight());
1300  fhRecoMCPhi [mcIndex][(matched)]->Fill(phi, phiMC , GetEventWeight());
1301  fhRecoMCRatioE [mcIndex][(matched)]->Fill(e , e/eMC , GetEventWeight());
1302  fhRecoMCDeltaE [mcIndex][(matched)]->Fill(e , eMC-e , GetEventWeight());
1303  fhRecoMCDeltaPhi[mcIndex][(matched)]->Fill(e , phiMC-phi, GetEventWeight());
1304  fhRecoMCDeltaEta[mcIndex][(matched)]->Fill(e , etaMC-eta, GetEventWeight());
1305  }
1306 
1307  if( primary ) return kTRUE ;
1308  else return kFALSE;
1309 }
1310 
1311 //_________________________________________________________________________________________________________
1316 //_________________________________________________________________________________________________________
1318 {
1319  Float_t e = fClusterMomentum.E();
1320  Float_t pt = fClusterMomentum.Pt();
1321  Float_t eta = fClusterMomentum.Eta();
1322  Float_t phi = fClusterMomentum.Phi();
1323  if(phi < 0) phi +=TMath::TwoPi();
1324 
1325  fhECharged ->Fill(e , GetEventWeight());
1326  fhPtCharged ->Fill(pt , GetEventWeight());
1327  fhPhiCharged ->Fill(phi, GetEventWeight());
1328  fhEtaCharged ->Fill(eta, GetEventWeight());
1329 
1330  if ( fFillAllTH3 ) fhEtaPhiECharged->Fill(eta, phi, e, GetEventWeight());
1331  else if ( e > 0.5 ) fhEtaPhiCharged ->Fill(eta, phi, GetEventWeight());
1332 
1333  // Study the track and matched cluster if track exists.
1334 
1335  AliVTrack *track = GetCaloUtils()->GetMatchedTrack(clus, GetReader()->GetInputEvent());
1336 
1337  if(!track) return ;
1338 
1339  Double_t tpt = track->Pt();
1340  Double_t tmom = track->P();
1341  Double_t dedx = track->GetTPCsignal();
1342  Int_t nITS = track->GetNcls(0);
1343  Int_t nTPC = track->GetNcls(1);
1344  Bool_t positive = kFALSE;
1345  if(track) positive = (track->Charge()>0);
1346 
1347  // Residuals
1348  Float_t deta = clus->GetTrackDz();
1349  Float_t dphi = clus->GetTrackDx();
1350  Double_t dR = TMath::Sqrt(dphi*dphi + deta*deta);
1351  Int_t nModule = GetModuleNumber(clus);
1352 
1353  if( TMath::Abs(dphi) < 999 )
1354  {
1355  if(positive)
1356  {
1357  fhTrackMatchedDEtaPos->Fill(e, deta, GetEventWeight());
1358  fhTrackMatchedDPhiPos->Fill(e, dphi, GetEventWeight());
1359 
1360  if(e > 0.5)
1361  {
1362  fhTrackMatchedDEtaPosMod ->Fill(deta, nModule, GetEventWeight());
1363  fhTrackMatchedDPhiPosMod ->Fill(dphi, nModule, GetEventWeight());
1364  fhTrackMatchedDEtaDPhiPos->Fill(deta, dphi , GetEventWeight());
1365  }
1366  }
1367  else
1368  {
1369  fhTrackMatchedDEtaNeg->Fill(e, deta, GetEventWeight());
1370  fhTrackMatchedDPhiNeg->Fill(e, dphi, GetEventWeight());
1371 
1372  if(e > 0.5)
1373  {
1374  fhTrackMatchedDEtaNegMod ->Fill(deta, nModule, GetEventWeight());
1375  fhTrackMatchedDPhiNegMod ->Fill(dphi, nModule, GetEventWeight());
1376  fhTrackMatchedDEtaDPhiNeg->Fill(deta, dphi , GetEventWeight());
1377  }
1378  }
1379  }
1380 
1381  Double_t eOverP = e/tmom;
1382  fh1EOverP->Fill(tpt, eOverP, GetEventWeight());
1383  if(e > 0.5 && tpt > 0.5) fh1EOverPMod->Fill(eOverP, nModule, GetEventWeight());
1384 
1385  if(dR < 0.02)
1386  {
1387  fh1EOverPR02->Fill(tpt, eOverP, GetEventWeight());
1388  if(e > 0.5 && tpt > 0.5) fh1EOverPR02Mod->Fill(eOverP, nModule, GetEventWeight());
1389 
1390  if(dedx > 60 && dedx < 100)
1391  {
1392  fh1EleEOverP->Fill(tpt, eOverP, GetEventWeight());
1393  if(e > 0.5 && tpt > 0.5) fh1EleEOverPMod->Fill(eOverP, nModule, GetEventWeight());
1394  }
1395  }
1396 
1397  fh2dR->Fill(e, dR, GetEventWeight());
1398  fh2MatchdEdx->Fill(tmom, dedx, GetEventWeight());
1399 
1400  if(e > 0.5 && tmom > 0.5)
1401  {
1402  fh2dRMod->Fill(dR, nModule, GetEventWeight());
1403  fh2MatchdEdxMod->Fill(dedx, nModule, GetEventWeight());
1404  }
1405 
1406  if(dR < 0.02 && eOverP > 0.6 && eOverP < 1.2
1407  && clus->GetNCells() > 1 && nITS > 3 && nTPC > 20)
1408  {
1409  fh2EledEdx->Fill(tmom, dedx, GetEventWeight());
1410  if(e > 0.5 && tmom > 0.5) fh2EledEdxMod->Fill(dedx, nModule, GetEventWeight());
1411  }
1412 
1413  if(IsDataMC() && okPrimary)
1414  {
1415  Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1416 
1417  if(TMath::Abs(pdg) == 11)
1418  {
1419  fhMCEle1EOverP ->Fill(tpt , eOverP, GetEventWeight());
1420  fhMCEle1dR ->Fill(dR , GetEventWeight());
1421  fhMCEle2MatchdEdx->Fill(tmom, dedx , GetEventWeight());
1422 
1423  if(dR < 0.02)
1424  {
1425  fhMCEle1EOverPR02->Fill(tpt, eOverP, GetEventWeight());
1426  if(dedx > 60 && dedx < 100) fhMCEle1EleEOverP->Fill(tpt, eOverP, GetEventWeight());
1427  }
1428  }
1429  else if(charge!=0)
1430  {
1431  fhMCChHad1EOverP ->Fill(tpt , eOverP, GetEventWeight());
1432  fhMCChHad1dR ->Fill(dR , GetEventWeight());
1433  fhMCChHad2MatchdEdx->Fill(tmom, dedx , GetEventWeight());
1434 
1435  if(dR < 0.02)
1436  {
1437  fhMCChHad1EOverPR02->Fill(tpt, eOverP, GetEventWeight());
1438  if(dedx > 60 && dedx < 100) fhMCChHad1EleEOverP->Fill(tpt, eOverP, GetEventWeight());
1439  }
1440  }
1441  else if(charge == 0)
1442  {
1443  fhMCNeutral1EOverP ->Fill(tpt , eOverP, GetEventWeight());
1444  fhMCNeutral1dR ->Fill(dR , GetEventWeight());
1445  fhMCNeutral2MatchdEdx->Fill(tmom, dedx , GetEventWeight());
1446 
1447  if(dR < 0.02)
1448  {
1449  fhMCNeutral1EOverPR02->Fill(tpt, eOverP, GetEventWeight());
1450  if(dedx > 60 && dedx < 100) fhMCNeutral1EleEOverP->Fill(tpt, eOverP, GetEventWeight());
1451  }
1452  }
1453  } // DataMC
1454 }
1455 
1456 //___________________________________
1459 //___________________________________
1461 {
1462  // Clusters arrays
1463  TObjArray * caloClustersEMCAL = GetEMCALClusters();
1464  TObjArray * caloClustersPHOS = GetPHOSClusters();
1465 
1466  if(!caloClustersEMCAL || !caloClustersPHOS)
1467  {
1468  AliDebug(1,Form("PHOS (%p) or EMCAL (%p) clusters array not available, do not correlate",caloClustersPHOS,caloClustersEMCAL));
1469  return ;
1470  }
1471 
1472  // Cells arrays
1473  AliVCaloCells * cellsEMCAL = GetEMCALCells();
1474  AliVCaloCells * cellsPHOS = GetPHOSCells();
1475 
1476  if(!cellsEMCAL || !cellsPHOS)
1477  {
1478  AliDebug(1,Form("PHOS (%p) or EMCAL (%p) cells array ot available, do not correlate",cellsPHOS,cellsEMCAL));
1479  return ;
1480  }
1481 
1482  // Clusters parameters
1483  Int_t nclEMCAL = 0;
1484  Int_t nclDCAL = 0;
1485  Int_t nclPHOS = 0;
1486 
1487  Float_t sumClusterEnergyEMCAL = 0;
1488  Float_t sumClusterEnergyDCAL = 0;
1489  Float_t sumClusterEnergyPHOS = 0;
1490 
1491  Int_t iclus = 0;
1492  Float_t energy = 0;
1493  AliVCluster* cluster = 0;
1494  for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1495  {
1496  cluster = (AliVCluster*)caloClustersEMCAL->At(iclus);
1497  Float_t energy = cluster->E();
1498 
1499  if( energy < 0.5 ) continue;
1500 
1501  if(cluster->GetCellsAbsId()[0] < 12288)
1502  {
1503  nclEMCAL++;
1504  sumClusterEnergyEMCAL += energy;
1505  }
1506  else
1507  {
1508  nclDCAL++;
1509  sumClusterEnergyDCAL += energy;
1510  }
1511  }
1512 
1513  for(iclus = 0 ; iclus < caloClustersPHOS ->GetEntriesFast(); iclus++)
1514  {
1515  cluster = (AliVCluster*) caloClustersPHOS->At(iclus);
1516 
1517  energy = cluster->E();
1518 
1519  if( energy < 0.5 ) continue;
1520 
1521  nclPHOS++;
1522  sumClusterEnergyPHOS += energy;
1523  }
1524 
1525  // Cells parameters
1526  Int_t ncellsEMCAL = 0 ;
1527  Int_t ncellsDCAL = 0 ;
1528  Int_t ncellsPHOS = 0;
1529 
1530  Float_t sumCellEnergyEMCAL = 0;
1531  Float_t sumCellEnergyDCAL = 0;
1532  Float_t sumCellEnergyPHOS = 0;
1533  Int_t icell = 0;
1534  for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
1535  {
1536  Float_t amp = cellsEMCAL->GetAmplitude(icell);
1537  Int_t cellId = cellsEMCAL->GetCellNumber(icell);
1538 
1539  if (amp < fEMCALCellAmpMin) continue;
1540 
1541  if( cellId < 12288)
1542  {
1543  ncellsEMCAL++;
1544  sumCellEnergyEMCAL += amp;
1545  }
1546  else
1547  {
1548  ncellsDCAL++;
1549  sumCellEnergyDCAL += amp;
1550  }
1551  }
1552 
1553  for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
1554  {
1555  Float_t amp = cellsPHOS->GetAmplitude(icell);
1556  Int_t cellId = cellsPHOS->GetCellNumber(icell);
1557 
1558  if ( cellId < 0 ) continue ; // CPV
1559 
1560  if ( amp < fPHOSCellAmpMin ) continue;
1561 
1562  ncellsPHOS++;
1563  sumCellEnergyPHOS += amp;
1564  }
1565 
1566  // Fill Histograms
1567 
1568  fhEMCALPHOSCorrNClusters->Fill(nclEMCAL , nclPHOS , GetEventWeight());
1569  fhEMCALPHOSCorrEClusters->Fill(sumClusterEnergyEMCAL, sumClusterEnergyPHOS, GetEventWeight());
1570  fhEMCALPHOSCorrNCells ->Fill(ncellsEMCAL , ncellsPHOS , GetEventWeight());
1571  fhEMCALPHOSCorrECells ->Fill(sumCellEnergyEMCAL , sumCellEnergyPHOS , GetEventWeight());
1572 
1573  fhEMCALDCALCorrNClusters->Fill(nclEMCAL , nclDCAL , GetEventWeight());
1574  fhEMCALDCALCorrEClusters->Fill(sumClusterEnergyEMCAL, sumClusterEnergyDCAL, GetEventWeight());
1575  fhEMCALDCALCorrNCells ->Fill(ncellsEMCAL , ncellsDCAL , GetEventWeight());
1576  fhEMCALDCALCorrECells ->Fill(sumCellEnergyEMCAL , sumCellEnergyDCAL , GetEventWeight());
1577 
1578  fhDCALPHOSCorrNClusters ->Fill(nclDCAL , nclPHOS , GetEventWeight());
1579  fhDCALPHOSCorrEClusters ->Fill(sumClusterEnergyDCAL , sumClusterEnergyPHOS, GetEventWeight());
1580  fhDCALPHOSCorrNCells ->Fill(ncellsDCAL , ncellsPHOS , GetEventWeight());
1581  fhDCALPHOSCorrECells ->Fill(sumCellEnergyDCAL , sumCellEnergyPHOS , GetEventWeight());
1582 
1583  Int_t v0S = GetV0Signal(0) + GetV0Signal(1);
1585  Int_t trM = GetTrackMultiplicity();
1586  Float_t cen = GetEventCentrality();
1587  Float_t ep = GetEventPlaneAngle();
1588 
1589  Int_t ncl = nclPHOS;
1590  Float_t sumClusterEnergy = sumClusterEnergyPHOS;
1591  Int_t ncells = ncellsPHOS;
1592  Float_t sumCellEnergy = sumCellEnergyPHOS;
1593 
1594  if ( GetCalorimeter() == kEMCAL )
1595  {
1596  ncl = nclEMCAL + nclDCAL;
1597  sumClusterEnergy = sumClusterEnergyEMCAL + sumClusterEnergyDCAL;
1598  ncells = ncellsEMCAL + ncellsDCAL;
1599  sumCellEnergy = sumCellEnergyEMCAL + sumCellEnergyDCAL;
1600  }
1601 
1602  fhCaloV0MCorrNClusters ->Fill(v0M, ncl , GetEventWeight());
1603  fhCaloV0MCorrEClusters ->Fill(v0M, sumClusterEnergy, GetEventWeight());
1604  fhCaloV0MCorrNCells ->Fill(v0M, ncells , GetEventWeight());
1605  fhCaloV0MCorrECells ->Fill(v0M, sumCellEnergy , GetEventWeight());
1606 
1607  fhCaloV0SCorrNClusters ->Fill(v0S, ncl , GetEventWeight());
1608  fhCaloV0SCorrEClusters ->Fill(v0S, sumClusterEnergy, GetEventWeight());
1609  fhCaloV0SCorrNCells ->Fill(v0S, ncells , GetEventWeight());
1610  fhCaloV0SCorrECells ->Fill(v0S, sumCellEnergy , GetEventWeight());
1611 
1612  fhCaloTrackMCorrNClusters->Fill(trM, ncl , GetEventWeight());
1613  fhCaloTrackMCorrEClusters->Fill(trM, sumClusterEnergy, GetEventWeight());
1614  fhCaloTrackMCorrNCells ->Fill(trM, ncells , GetEventWeight());
1615  fhCaloTrackMCorrECells ->Fill(trM, sumCellEnergy , GetEventWeight());
1616 
1617  fhCaloCenNClusters ->Fill(cen, ncl , GetEventWeight());
1618  fhCaloCenEClusters ->Fill(cen, sumClusterEnergy, GetEventWeight());
1619  fhCaloCenNCells ->Fill(cen, ncells , GetEventWeight());
1620  fhCaloCenECells ->Fill(cen, sumCellEnergy , GetEventWeight());
1621 
1622  fhCaloEvPNClusters ->Fill(ep , ncl , GetEventWeight());
1623  fhCaloEvPEClusters ->Fill(ep , sumClusterEnergy, GetEventWeight());
1624  fhCaloEvPNCells ->Fill(ep , ncells , GetEventWeight());
1625  fhCaloEvPECells ->Fill(ep , sumCellEnergy , GetEventWeight());
1626 
1627  AliDebug(1,"Correlate():");
1628  AliDebug(1,Form("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f",
1629  ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL));
1630  AliDebug(1,Form("\t DCAL : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f",
1631  ncellsDCAL,nclDCAL, sumCellEnergyDCAL,sumClusterEnergyDCAL));
1632  AliDebug(1,Form("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f",
1633  ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS));
1634  AliDebug(1,Form("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d", v0S,v0M,trM));
1635  AliDebug(1,Form("\t centrality : %f, Event plane angle %f", cen,ep));
1636 }
1637 
1638 //_________________________________________________
1640 //_________________________________________________
1642 {
1643  TString parList ; //this will be list of parameters used for this analysis.
1644  const Int_t buffersize = 255;
1645  char onePar[buffersize] ;
1646 
1647  snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---:") ;
1648  parList+=onePar ;
1649  snprintf(onePar,buffersize,"Calorimeter: %s;",GetCalorimeterString().Data()) ;
1650  parList+=onePar ;
1651  snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns;",fTimeCutMin, fTimeCutMax) ;
1652  parList+=onePar ;
1653  snprintf(onePar,buffersize,"Cell Amplitude: PHOS > %2.2f GeV, EMCAL > %2.2f GeV;",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
1654  parList+=onePar ;
1655  snprintf(onePar,buffersize,"Cluster M02: EMCAL > %2.2f ;",fEMCALClusterM02Min) ;
1656  parList+=onePar ;
1657  snprintf(onePar,buffersize,"N cells per cluster: PHOS >= %d, EMCAL >= %d;",fPHOSClusterNCellMin, fEMCALClusterNCellMin) ;
1658  parList+=onePar ;
1659  snprintf(onePar,buffersize,"Inv. Mass %2.1f < E_cl < %2.1f GeV;",fInvMassMinECut, fInvMassMaxECut) ;
1660  parList+=onePar ;
1661  snprintf(onePar,buffersize,"Inv. Mass %2.1f < M02 < %2.1f GeV;",fInvMassMinM02Cut, fInvMassMaxM02Cut) ;
1662  parList+=onePar ;
1663  snprintf(onePar,buffersize,"Cluster pair opening angle < %2.1f rad;",fInvMassMaxOpenAngle) ;
1664  parList+=onePar ;
1665  snprintf(onePar,buffersize,"Cluster pair time difference < %2.1f rad;",fInvMassMaxTimeDifference) ;
1666  parList+=onePar ;
1667 
1668  //Get parameters set in base class.
1669  //parList += GetBaseParametersList() ;
1670 
1671  //Get parameters set in FiducialCut class (not available yet)
1672  //parlist += GetFidCut()->GetFidCutParametersList()
1673 
1674  return new TObjString(parList) ;
1675 }
1676 
1677 //___________________________________________________
1680 //___________________________________________________
1682 {
1683  TList * outputContainer = new TList() ;
1684  outputContainer->SetName("QAHistos") ;
1685 
1686  // Init the number of modules, set in the class AliCalorimeterUtils
1687  //
1688  InitCaloParameters(); // See AliCaloTrackCorrBaseClass
1689 
1690  Int_t totalSM = fLastModule-fFirstModule+1;
1691 
1692  //printf("N SM %d, first SM %d, last SM %d, total %d\n",fNModules,fFirstModule,fLastModule, totalSM);
1693 
1694  // Histogram binning and ranges
1695  //
1716 
1720 
1721  // TM residuals
1728 
1729  // Cell column-row histograms, see base class for data members setting
1730  //fNMaxColsFull+2,-1.5,fNMaxColsFull+0.5, fNMaxRowsFull+2,-1.5,fNMaxRowsFull+0.5
1731  Int_t ncolcell = fNMaxColsFull+2;
1732  Float_t colcellmin = -1.5;
1733  Float_t colcellmax = fNMaxColsFull+0.5;
1734 
1736  Float_t rowcellmin = fNMaxRowsFullMin-1.5;
1737  Float_t rowcellmax = fNMaxRowsFullMax+0.5;
1738 
1739  //
1740  // Init histograms
1741  //
1742 
1743  // Calorimeter cluster histograms
1744  //
1746  {
1747  fhE = new TH1F ("hE","#it{E} reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
1748  fhE->SetXTitle("#it{E} (GeV)");
1749  outputContainer->Add(fhE);
1750 
1751  fhPt = new TH1F ("hPt","#it{p}_{T} reconstructed clusters", nptbins,ptmin,ptmax);
1752  fhPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1753  outputContainer->Add(fhPt);
1754 
1755  fhNClusters = new TH1F ("hNClusters","# clusters", nclbins,nclmin,nclmax);
1756  fhNClusters->SetXTitle("#it{n}_{clusters}");
1757  outputContainer->Add(fhNClusters);
1758 
1759  fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy",nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
1760  fhNCellsPerCluster->SetXTitle("#it{E} (GeV)");
1761  fhNCellsPerCluster->SetYTitle("#it{n}_{cells}");
1762  outputContainer->Add(fhNCellsPerCluster);
1763 
1764  fhNCellsPerClusterWeirdMod = new TH2F ("hNCellsPerClusterWeirdMod","# cells per cluster, E > 100 GeV, per SM",
1765  nceclbins*2,nceclmin,nceclmax*2,totalSM,fFirstModule-0.5,fLastModule+0.5);
1766  fhNCellsPerClusterWeirdMod->SetYTitle("SM number");
1767  fhNCellsPerClusterWeirdMod->SetXTitle("#it{n}_{cells}");
1768  outputContainer->Add(fhNCellsPerClusterWeirdMod);
1769 
1770  // Acceptance plots
1771  //
1772  fhPhi = new TH1F ("hPhi","#varphi reconstructed clusters ",nphibins,phimin,phimax);
1773  fhPhi->SetXTitle("#varphi (rad)");
1774  outputContainer->Add(fhPhi);
1775 
1776  fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
1777  fhEta->SetXTitle("#eta ");
1778  outputContainer->Add(fhEta);
1779 
1781  {
1782  for(Int_t ie=0; ie<fNEBinCuts; ie++)
1783  {
1784  fhEBinClusterEtaPhi[ie] = new TH2F
1785  (Form("hEBin%d_Cluster_EtaPhi",ie),
1786  Form("#eta vs #varphi, cluster, %2.2f<#it{p}_{T}<%2.2f GeV/#it{c}",fEBinCuts[ie],fEBinCuts[ie+1]),
1787  netabins,etamin,etamax,nphibins,phimin,phimax);
1788  fhEBinClusterEtaPhi[ie]->SetYTitle("#varphi (rad)");
1789  fhEBinClusterEtaPhi[ie]->SetXTitle("#eta");
1790  outputContainer->Add(fhEBinClusterEtaPhi[ie]) ;
1791 
1792  fhEBinClusterColRow[ie] = new TH2F
1793  (Form("hEBin%d_Cluster_ColRow",ie),
1794  Form("column vs row, cluster max E cell, %2.2f<#it{p}_{T}<%2.2f GeV/#it{c}",fEBinCuts[ie],fEBinCuts[ie+1]),
1795  ncolcell,colcellmin,colcellmax,nrowcell,rowcellmin,rowcellmax);
1796  fhEBinClusterColRow[ie]->SetYTitle("row");
1797  fhEBinClusterColRow[ie]->SetXTitle("column");
1798  outputContainer->Add(fhEBinClusterColRow[ie]) ;
1799 
1801  {
1802  fhEBinCellColRow[ie] = new TH2F
1803  (Form("hEBin%d_Cell_ColRow",ie),
1804  Form("column vs row, cell, %2.2f<#it{p}_{T}<%2.2f GeV/#it{c}",fEBinCuts[ie],fEBinCuts[ie+1]),
1805  ncolcell,colcellmin,colcellmax,nrowcell,rowcellmin,rowcellmax);
1806  fhEBinCellColRow[ie]->SetYTitle("row");
1807  fhEBinCellColRow[ie]->SetXTitle("column");
1808  outputContainer->Add(fhEBinCellColRow[ie]) ;
1809  }
1810  }
1811  }
1812  else
1813  {
1814  if(fFillAllTH3)
1815  {
1816  fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #varphi vs energy, reconstructed clusters",
1817  netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
1818  fhEtaPhiE->SetXTitle("#eta ");
1819  fhEtaPhiE->SetYTitle("#varphi (rad)");
1820  fhEtaPhiE->SetZTitle("#it{E} (GeV) ");
1821  outputContainer->Add(fhEtaPhiE);
1822  }
1823  else
1824  {
1825  fhEtaPhi = new TH2F ("hEtaPhi","#eta vs #varphi for #it{E} > 0.5 GeV, reconstructed clusters",
1826  netabins,etamin,etamax,nphibins,phimin,phimax);
1827  fhEtaPhi->SetXTitle("#eta ");
1828  fhEtaPhi->SetYTitle("#varphi (rad)");
1829  outputContainer->Add(fhEtaPhi);
1830  }
1831  }
1832 
1833  fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
1834  nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1835  fhClusterTimeEnergy->SetXTitle("#it{E} (GeV) ");
1836  fhClusterTimeEnergy->SetYTitle("TOF (ns)");
1837  outputContainer->Add(fhClusterTimeEnergy);
1838 
1840  {
1841  fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",
1842  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1843  fhClusterPairDiffTimeE->SetXTitle("#it{E}_{cluster} (GeV)");
1844  fhClusterPairDiffTimeE->SetYTitle("#Delta #it{t} (ns)");
1845  outputContainer->Add(fhClusterPairDiffTimeE);
1846 
1847  fhClusterPairDiffTimeESameMod = new TH2F("hClusterPairDiffTimeESameMod","cluster pair time difference vs E, only good clusters",
1848  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1849  fhClusterPairDiffTimeESameMod->SetXTitle("#it{E}_{cluster} (GeV)");
1850  fhClusterPairDiffTimeESameMod->SetYTitle("#Delta #it{t} (ns)");
1851  outputContainer->Add(fhClusterPairDiffTimeESameMod);
1852  }
1853 
1854  // Shower shape
1855  //
1856  //fhDispersion = new TH2F ("hDispersion","shower shape, Dispersion^{2} vs E for bad cluster ",
1857  // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1858  //fhDispersion->SetXTitle("#it{E}_{cluster} (GeV)");
1859  //fhDispersion->SetYTitle("Dispersion");
1860  //outputContainer->Add(fhDispersion);
1861 
1862  fhLambda0 = new TH2F ("hLambda0","shower shape, #lambda^{2}_{0} vs E",
1863  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1864  fhLambda0->SetXTitle("#it{E}_{cluster} (GeV)");
1865  fhLambda0->SetYTitle("#lambda^{2}_{0}");
1866  outputContainer->Add(fhLambda0);
1867 
1868  fhLambda1 = new TH2F ("hLambda1","shower shape, #lambda^{2}_{1} vs E",
1869  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1870  fhLambda1->SetXTitle("#it{E}_{cluster} (GeV)");
1871  fhLambda1->SetYTitle("#lambda^{2}_{1}");
1872  outputContainer->Add(fhLambda1);
1873 
1874  fhNLocMax = new TH2F ("hNLocMax","#it{n}_{LM} vs E",
1875  nptbins,ptmin,ptmax,10,0,10);
1876  fhNLocMax->SetXTitle("#it{E}_{cluster} (GeV)");
1877  fhNLocMax->SetYTitle("#it{n}_{LM}");
1878  outputContainer->Add(fhNLocMax);
1879 
1880  fhNLocMaxStd = new TH2F ("hNLocMaxStd","#it{n}_{LM} vs E",
1881  nptbins,ptmin,ptmax,10,0,10);
1882  fhNLocMaxStd->SetXTitle("#it{E}_{cluster} (GeV)");
1883  fhNLocMaxStd->SetYTitle("#it{n}_{LM}");
1884  outputContainer->Add(fhNLocMaxStd);
1885 
1887  {
1888  fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1889  nptbins,ptmin,ptmax, 100,0,1.);
1890  fhClusterMaxCellCloseCellRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
1891  fhClusterMaxCellCloseCellRatio->SetYTitle("#it{E}_{cell i}/#it{E}_{cell max}");
1892  outputContainer->Add(fhClusterMaxCellCloseCellRatio);
1893 
1894  fhClusterMaxCellCloseCellDiff = new TH2F ("hClusterMaxCellCloseCellDiff","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1895  nptbins,ptmin,ptmax, 500,0,100.);
1896  fhClusterMaxCellCloseCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
1897  fhClusterMaxCellCloseCellDiff->SetYTitle("#it{E}_{cell max}-#it{E}_{cell i} (GeV)");
1898  outputContainer->Add(fhClusterMaxCellCloseCellDiff);
1899 
1900  fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1901  nptbins,ptmin,ptmax, 500,0,1.);
1902  fhClusterMaxCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
1903  fhClusterMaxCellDiff->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
1904  outputContainer->Add(fhClusterMaxCellDiff);
1905 
1906  fhClusterMaxCellECross = new TH2F ("hClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, good clusters",
1907  nptbins,ptmin,ptmax, 400,-1,1.);
1908  fhClusterMaxCellECross->SetXTitle("#it{E}_{cluster} (GeV) ");
1909  fhClusterMaxCellECross->SetYTitle("1- #it{E}_{cross}/#it{E}_{cell max}");
1910  outputContainer->Add(fhClusterMaxCellECross);
1911  }
1912 
1913  if(fStudyBadClusters)
1914  {
1915  fhNCellsPerClusterNoCut = new TH2F ("hNCellsPerClusterNoCut","# cells per cluster vs energy, no bad clusters cut",
1916  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
1917  fhNCellsPerClusterNoCut->SetXTitle("#it{E} (GeV)");
1918  fhNCellsPerClusterNoCut->SetYTitle("#it{n}_{cells}");
1919  outputContainer->Add(fhNCellsPerClusterNoCut);
1920 
1921  fhNCellsPerClusterWeirdModNoCut = new TH2F ("hNCellsPerClusterWeirdNoCutMod","# cells per cluster vs energy, E > 100, no bad clusters cut, per SM",
1922  nceclbins,nceclmin,nceclmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
1923  fhNCellsPerClusterWeirdModNoCut->SetYTitle("SM number");
1924  fhNCellsPerClusterWeirdModNoCut->SetXTitle("#it{n}_{cells}");
1925  outputContainer->Add(fhNCellsPerClusterWeirdModNoCut);
1926 
1927  fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
1928  fhBadClusterEnergy->SetXTitle("#it{E}_{cluster} (GeV) ");
1929  outputContainer->Add(fhBadClusterEnergy);
1930 
1931  fhBadClusterEtaPhi = new TH2F ("hBadClusterEtaPhi","Bad cluster, #eta vs #varphi, #it{E} > 0.5 GeV",
1932  netabins,etamin,etamax,nphibins,phimin,phimax);
1933  fhBadClusterEtaPhi->SetXTitle("#eta ");
1934  fhBadClusterEtaPhi->SetXTitle("#varphi (rad) ");
1935  outputContainer->Add(fhBadClusterEtaPhi);
1936 
1937  fhBadClusterLambda0 = new TH2F ("hBadClusterLambda0","Bad cluster,shower shape, #lambda^{2}_{0} vs E",
1938  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1939  fhBadClusterLambda0->SetXTitle("#it{E}_{cluster}");
1940  fhBadClusterLambda0->SetYTitle("#lambda^{2}_{0}");
1941  outputContainer->Add(fhBadClusterLambda0);
1942 
1943  fhBadClusterLambda1 = new TH2F ("hBadClusterLambda1","Bad cluster,shower shape, #lambda^{2}_{1} vs E for bad cluster ",
1944  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1945  fhBadClusterLambda1->SetXTitle("#it{E}_{cluster}");
1946  fhBadClusterLambda1->SetYTitle("#lambda^{2}_{1}");
1947  outputContainer->Add(fhBadClusterLambda1);
1948 
1949  fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
1950  nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1951  fhBadClusterTimeEnergy->SetXTitle("#it{E}_{cluster} (GeV) ");
1952  fhBadClusterTimeEnergy->SetYTitle("#it{t} (ns)");
1953  outputContainer->Add(fhBadClusterTimeEnergy);
1954 
1956  {
1957  fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1958  fhBadClusterPairDiffTimeE->SetXTitle("#it{E}_{bad cluster} (GeV)");
1959  fhBadClusterPairDiffTimeE->SetYTitle("#Delta #it{t} (ns)");
1960  outputContainer->Add(fhBadClusterPairDiffTimeE);
1961  }
1962 
1964  {
1965  fhClusterMaxCellDiffNoCut = new TH2F ("hClusterMaxCellDiffNoCut","energy vs difference of cluster energy - max cell energy / cluster energy",
1966  nptbins,ptmin,ptmax, 500,0,1.);
1967  fhClusterMaxCellDiffNoCut->SetXTitle("#it{E}_{cluster} (GeV) ");
1968  fhClusterMaxCellDiffNoCut->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
1969  outputContainer->Add(fhClusterMaxCellDiffNoCut);
1970 
1971  fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
1972  nptbins,ptmin,ptmax, 100,0,1.);
1973  fhBadClusterMaxCellCloseCellRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
1974  fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
1975  outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
1976 
1977  fhBadClusterMaxCellCloseCellDiff = new TH2F ("hBadClusterMaxCellCloseCellDiff","energy vs ratio of max cell - neighbour cell constributing cell, reconstructed bad clusters",
1978  nptbins,ptmin,ptmax, 500,0,100);
1979  fhBadClusterMaxCellCloseCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
1980  fhBadClusterMaxCellCloseCellDiff->SetYTitle("#it{E}_{cell max} - #it{E}_{cell i} (GeV)");
1981  outputContainer->Add(fhBadClusterMaxCellCloseCellDiff);
1982 
1983  fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
1984  nptbins,ptmin,ptmax, 500,0,1.);
1985  fhBadClusterMaxCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
1986  fhBadClusterMaxCellDiff->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max}) / #it{E}_{cluster}");
1987  outputContainer->Add(fhBadClusterMaxCellDiff);
1988 
1989  fhBadClusterMaxCellECross = new TH2F ("hBadClusterMaxCellECross","1 - #it{E}_{+} around max energy cell / max energy cell vs cluster energy, bad clusters",
1990  nptbins,ptmin,ptmax, 400,-1,1.);
1991  fhBadClusterMaxCellECross->SetXTitle("#it{E}_{cluster} (GeV) ");
1992  fhBadClusterMaxCellECross->SetYTitle("1- #it{E}_{cross}/#it{E}_{cell max}");
1993  outputContainer->Add(fhBadClusterMaxCellECross);
1994 
1996  {
1997  fhBadCellTimeSpreadRespectToCellMax = new TH2F ("hBadCellTimeSpreadRespectToCellMax","#it{t}_{cell max}-#it{t}_{cell i} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1998  fhBadCellTimeSpreadRespectToCellMax->SetXTitle("#it{E} (GeV)");
1999  fhBadCellTimeSpreadRespectToCellMax->SetYTitle("#Delta #it{t}_{cell max - i} (ns)");
2000  outputContainer->Add(fhBadCellTimeSpreadRespectToCellMax);
2001 
2002  // fhBadClusterMaxCellDiffAverageTime = new TH2F ("hBadClusterMaxCellDiffAverageTime","#it{t}_{cell max}-#it{t}_{average} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2003  // fhBadClusterMaxCellDiffAverageTime->SetXTitle("#it{E} (GeV)");
2004  // fhBadClusterMaxCellDiffAverageTime->SetYTitle("#Delta #it{t}_{cell max - average} (ns)");
2005  // outputContainer->Add(fhBadClusterMaxCellDiffAverageTime);
2006  //
2007  // fhBadClusterMaxCellDiffWeightedTime = new TH2F ("hBadClusterMaxCellDiffWeightedTime","#it{t}_{cell max}-#it{t}_{weighted} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2008  // fhBadClusterMaxCellDiffWeightedTime->SetXTitle("#it{E} (GeV)");
2009  // fhBadClusterMaxCellDiffWeightedTime->SetYTitle("#Delta #it{t}_{cell max - weighted} (ns)");
2010  // outputContainer->Add(fhBadClusterMaxCellDiffWeightedTime);
2011  }
2012  }
2013  }
2014 
2015  // Track Matching
2016  if(fFillAllTMHisto)
2017  {
2018  fhTrackMatchedDEtaNeg = new TH2F("hTrackMatchedDEtaNeg","d#eta of cluster-negative track vs cluster energy",
2019  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2020  fhTrackMatchedDEtaNeg->SetYTitle("d#eta");
2021  fhTrackMatchedDEtaNeg->SetXTitle("#it{E}_{cluster} (GeV)");
2022 
2023  fhTrackMatchedDPhiNeg = new TH2F("hTrackMatchedDPhiNeg","d#varphi of cluster-negative track vs cluster energy",
2024  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2025  fhTrackMatchedDPhiNeg->SetYTitle("d#varphi (rad)");
2026  fhTrackMatchedDPhiNeg->SetXTitle("#it{E}_{cluster} (GeV)");
2027 
2028  fhTrackMatchedDEtaDPhiNeg = new TH2F("hTrackMatchedDEtaDPhiNeg","d#eta vs d#varphi of cluster- negative track vs cluster energy",
2029  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2030  fhTrackMatchedDEtaDPhiNeg->SetYTitle("d#varphi (rad)");
2031  fhTrackMatchedDEtaDPhiNeg->SetXTitle("d#eta");
2032 
2033  fhTrackMatchedDEtaPos = new TH2F("hTrackMatchedDEtaPos","d#eta of cluster-positive track vs cluster energy",
2034  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2035  fhTrackMatchedDEtaPos->SetYTitle("d#eta");
2036  fhTrackMatchedDEtaPos->SetXTitle("#it{E}_{cluster} (GeV)");
2037 
2038  fhTrackMatchedDPhiPos = new TH2F("hTrackMatchedDPhiPos","d#varphi of cluster-positive track vs cluster energy",
2039  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2040  fhTrackMatchedDPhiPos->SetYTitle("d#varphi (rad)");
2041  fhTrackMatchedDPhiPos->SetXTitle("#it{E}_{cluster} (GeV)");
2042 
2043  fhTrackMatchedDEtaDPhiPos = new TH2F("hTrackMatchedDEtaDPhiPos","d#eta vs d#varphi of cluster-positive track vs cluster energy",
2044  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2045  fhTrackMatchedDEtaDPhiPos->SetYTitle("d#varphi (rad)");
2046  fhTrackMatchedDEtaDPhiPos->SetXTitle("d#eta");
2047 
2048 
2049  fhTrackMatchedDEtaNegMod = new TH2F("hTrackMatchedDEtaNegPerModule","d#eta of cluster-negative track vs module, E > 0.5 GeV",
2050  nresetabins,resetamin,resetamax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2051  fhTrackMatchedDEtaNegMod->SetXTitle("d#eta");
2052  fhTrackMatchedDEtaNegMod->SetYTitle("Module");
2053 
2054  fhTrackMatchedDPhiNegMod = new TH2F("hTrackMatchedDPhiNegPerModule","d#varphi of cluster-negative track vs module, E > 0.5 GeV",
2055  nresetabins,resetamin,resetamax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2056  fhTrackMatchedDPhiNegMod->SetXTitle("d#varphi (rad)");
2057  fhTrackMatchedDPhiNegMod->SetYTitle("Module");
2058 
2059  fhTrackMatchedDEtaPosMod = new TH2F("hTrackMatchedDEtaPosPerModule","d#eta of cluster-positive track vs module, E > 0.5 GeV",
2060  nresetabins,resetamin,resetamax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2061  fhTrackMatchedDEtaPosMod->SetXTitle("d#eta");
2062  fhTrackMatchedDEtaPosMod->SetYTitle("Module");
2063 
2064  fhTrackMatchedDPhiPosMod = new TH2F("hTrackMatchedDPhiPosPerModule","d#varphi of cluster-positive track vs module, E > 0.5 GeV",
2065  nresetabins,resetamin,resetamax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2066  fhTrackMatchedDPhiPosMod->SetXTitle("d#varphi (rad)");
2067  fhTrackMatchedDPhiPosMod->SetYTitle("Module");
2068 
2069  outputContainer->Add(fhTrackMatchedDEtaNeg) ;
2070  outputContainer->Add(fhTrackMatchedDPhiNeg) ;
2071  outputContainer->Add(fhTrackMatchedDEtaPos) ;
2072  outputContainer->Add(fhTrackMatchedDPhiPos) ;
2073  outputContainer->Add(fhTrackMatchedDEtaDPhiNeg) ;
2074  outputContainer->Add(fhTrackMatchedDEtaDPhiPos) ;
2075 
2076  outputContainer->Add(fhTrackMatchedDEtaNegMod) ;
2077  outputContainer->Add(fhTrackMatchedDPhiNegMod) ;
2078  outputContainer->Add(fhTrackMatchedDEtaPosMod) ;
2079  outputContainer->Add(fhTrackMatchedDPhiPosMod) ;
2080 
2081  fhECharged = new TH1F ("hECharged","#it{E} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
2082  fhECharged->SetXTitle("#it{E} (GeV)");
2083  outputContainer->Add(fhECharged);
2084 
2085  fhPtCharged = new TH1F ("hPtCharged","#it{p}_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
2086  fhPtCharged->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2087  outputContainer->Add(fhPtCharged);
2088 
2089  fhPhiCharged = new TH1F ("hPhiCharged","#varphi reconstructed clusters, matched with track",nphibins,phimin,phimax);
2090  fhPhiCharged->SetXTitle("#varphi (rad)");
2091  outputContainer->Add(fhPhiCharged);
2092 
2093  fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
2094  fhEtaCharged->SetXTitle("#eta ");
2095  outputContainer->Add(fhEtaCharged);
2096 
2097  if(fFillAllTH3)
2098  {
2099  fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #varphi, reconstructed clusters, matched with track",
2100  netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2101  fhEtaPhiECharged->SetXTitle("#eta ");
2102  fhEtaPhiECharged->SetYTitle("#varphi ");
2103  fhEtaPhiECharged->SetZTitle("#it{E} (GeV) ");
2104  outputContainer->Add(fhEtaPhiECharged);
2105  }
2106  else
2107  {
2108  fhEtaPhiCharged = new TH2F ("hEtaPhiCharged","#eta vs #varphi for #it{E} > 0.5 GeV, reconstructed clusters, with matched track",
2109  netabins,etamin,etamax,nphibins,phimin,phimax);
2110  fhEtaPhiCharged->SetXTitle("#eta ");
2111  fhEtaPhiCharged->SetYTitle("#varphi (rad)");
2112  outputContainer->Add(fhEtaPhiCharged);
2113  }
2114 
2115  fh1EOverP = new TH2F("h1EOverP","TRACK matches #it{E}/#it{p}",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2116  fh1EOverP->SetYTitle("#it{E}/#it{p}");
2117  fh1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2118  outputContainer->Add(fh1EOverP);
2119 
2120  fh2dR = new TH2F("h2dR","TRACK matches #Delta #it{R}",nptbins,ptmin,ptmax,ndRbins,dRmin,dRmax);
2121  fh2dR->SetYTitle("#Delta #it{R} (rad)");
2122  fh2dR->SetXTitle("#it{E} cluster (GeV)");
2123  outputContainer->Add(fh2dR) ;
2124 
2125  fh2MatchdEdx = new TH2F("h2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2126  fh2MatchdEdx->SetXTitle("p (GeV/#it{c})");
2127  fh2MatchdEdx->SetYTitle("<#it{dE/dx}>");
2128  outputContainer->Add(fh2MatchdEdx);
2129 
2130  fh2EledEdx = new TH2F("h2EledEdx","#it{dE/dx} vs. #it{p} for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2131  fh2EledEdx->SetXTitle("p (GeV/#it{c})");
2132  fh2EledEdx->SetYTitle("<#it{dE/dx}>");
2133  outputContainer->Add(fh2EledEdx) ;
2134 
2135  fh1EOverPR02 = new TH2F("h1EOverPR02","TRACK matches #it{E}/#it{p}, all",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2136  fh1EOverPR02->SetYTitle("#it{E}/#it{p}");
2137  fh1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2138  outputContainer->Add(fh1EOverPR02);
2139 
2140  fh1EleEOverP = new TH2F("h1EleEOverP","Electron candidates #it{E}/#it{p} (60<#it{dE/dx}<100)",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2141  fh1EleEOverP->SetYTitle("#it{E}/#it{p}");
2142  fh1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2143  outputContainer->Add(fh1EleEOverP);
2144 
2145 
2146  // Projections per SM
2147 
2148  fh1EOverPMod = new TH2F
2149  ("h1EOverP_PerModule","TRACK matches #it{E}/#it{p}, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",
2150  nPoverEbins,eOverPmin,eOverPmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2151  fh1EOverPMod->SetXTitle("#it{E}/#it{p}");
2152  fh1EOverPMod->SetYTitle("Module");
2153  outputContainer->Add(fh1EOverPMod);
2154 
2155  fh2dRMod = new TH2F
2156  ("h2dR_PerModule","TRACK matches #Delta #it{R}, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",
2157  ndRbins,dRmin,dRmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2158  fh2dRMod->SetXTitle("#Delta #it{R} (rad)");
2159  fh2dRMod->SetYTitle("Module");
2160  outputContainer->Add(fh2dRMod) ;
2161 
2162  fh2MatchdEdxMod = new TH2F
2163  ("h2MatchdEdx_PerModule","#it{dE/dx} vs. #it{p} for all matches, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",
2164  ndedxbins,dedxmin,dedxmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2165  fh2MatchdEdxMod->SetYTitle("Module");
2166  fh2MatchdEdxMod->SetXTitle("<#it{dE/dx}>");
2167  outputContainer->Add(fh2MatchdEdxMod);
2168 
2169  fh2EledEdxMod = new TH2F
2170  ("h2EledEdx_PerModule","#it{dE/dx} vs. #it{p} for electrons, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",
2171  ndedxbins,dedxmin,dedxmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2172  fh2EledEdxMod->SetYTitle("Module");
2173  fh2EledEdxMod->SetXTitle("<#it{dE/dx}>");
2174  outputContainer->Add(fh2EledEdxMod) ;
2175 
2176  fh1EOverPR02Mod = new TH2F
2177  ("h1EOverPR02_PerModule","TRACK matches #it{E}/#it{p}, all, #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",
2178  nPoverEbins,eOverPmin,eOverPmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2179  fh1EOverPR02Mod->SetXTitle("#it{E}/#it{p}");
2180  fh1EOverPR02Mod->SetYTitle("Module");
2181  outputContainer->Add(fh1EOverPR02Mod);
2182 
2183  fh1EleEOverPMod = new TH2F
2184  ("h1EleEOverP_PerModule","Electron candidates #it{E}/#it{p} (60<#it{dE/dx}<100), #it{E}_{cl}&#it{p}_{tr}>0.5 Gev/#it{c}",
2185  nPoverEbins,eOverPmin,eOverPmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2186  fh1EleEOverPMod->SetXTitle("#it{E}/#it{p}");
2187  fh1EleEOverPMod->SetYTitle("Module");
2188  outputContainer->Add(fh1EleEOverPMod);
2189  }
2190 
2191  if(fFillAllPi0Histo)
2192  {
2193  if ( fFirstModule < 12 )
2194  {
2195  fhIM = new TH2F ("hIM","Cluster pairs (EMCAL or PHOS) Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1",
2196  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2197  fhIM->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2198  fhIM->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2199  outputContainer->Add(fhIM);
2200 
2201  fhIMDiff = new TH2F ("hIMDiff","Cluster pairs (EMCAL or PHOS) Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, different SM",
2202  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2203  fhIMDiff->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2204  fhIMDiff->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2205  outputContainer->Add(fhIMDiff);
2206 
2207  fhIMSame = new TH2F ("hIMSame","Cluster pairs (EMCAL or PHOS) Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, same SM",
2208  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2209  fhIMSame->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2210  fhIMSame->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2211  outputContainer->Add(fhIMSame);
2212 
2214  {
2215  fhIMEMCALPHOS = new TH2F ("hIMEMCALPHOS","Cluster pairs in DCAL-PHOS Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1",
2216  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2217  fhIMEMCALPHOS->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2218  fhIMEMCALPHOS->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2219  outputContainer->Add(fhIMEMCALPHOS);
2220 
2221  fhIMEMCALPHOSSame = new TH2F ("hIMEMCALPHOSSame","Cluster pairs in DCAL-PHOS Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, same #varphi sector",
2222  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2223  fhIMEMCALPHOSSame->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2224  fhIMEMCALPHOSSame->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2225  outputContainer->Add(fhIMEMCALPHOSSame);
2226  }
2227  }
2228 
2229  if ( fNModules > 12 && (GetCalorimeter() == kEMCAL || GetCalorimeter() == kDCAL) && fLastModule > 11 )
2230  {
2231  fhIMDCAL = new TH2F ("hIMDCAL","Cluster pairs in DCAL Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1",
2232  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2233  fhIMDCAL->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2234  fhIMDCAL->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2235  outputContainer->Add(fhIMDCAL);
2236 
2237  fhIMDCALDiff = new TH2F ("hIMDCALDiff","Cluster pairs in DCAL Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, different SM",
2238  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2239  fhIMDCALDiff->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2240  fhIMDCALDiff->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2241  outputContainer->Add(fhIMDCALDiff);
2242 
2243  fhIMDCALSame = new TH2F ("hIMDCALSame","Cluster pairs in DCAL Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, same SM",
2244  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2245  fhIMDCALSame->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2246  fhIMDCALSame->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2247  outputContainer->Add(fhIMDCALSame);
2248 
2249  fhIMDCALPHOS = new TH2F ("hIMDCALPHOS","Cluster pairs in DCAL-PHOS Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1",
2250  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2251  fhIMDCALPHOS->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2252  fhIMDCALPHOS->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2253  outputContainer->Add(fhIMDCALPHOS);
2254 
2255  fhIMDCALPHOSSame = new TH2F ("hIMDCALPHOSSame","Cluster pairs in DCAL-PHOS Invariant mass vs reconstructed pair #it{p}_{T}, ncell > 1, same #varphi sector",
2256  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2257  fhIMDCALPHOSSame->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2258  fhIMDCALPHOSSame->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2259  outputContainer->Add(fhIMDCALPHOSSame);
2260  }
2261 
2263  {
2264  if ( fFirstModule < 12 )
2265  {
2266  fhClusterPairDiffTimeEPi0Mass = new TH2F("hClusterPairDiffTimeEPi0Mass","cluster pair time difference vs E, only good clusters",
2267  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2268  fhClusterPairDiffTimeEPi0Mass->SetXTitle("#it{E}_{cluster} (GeV)");
2269  fhClusterPairDiffTimeEPi0Mass->SetYTitle("#Delta #it{t} (ns)");
2270  outputContainer->Add(fhClusterPairDiffTimeEPi0Mass);
2271 
2272  fhClusterPairDiffTimeEPi0MassSame = new TH2F("hClusterPairDiffTimeEPi0MassSame","cluster pair time difference vs E, only good clusters",
2273  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2274  fhClusterPairDiffTimeEPi0MassSame->SetXTitle("#it{E}_{cluster} (GeV)");
2275  fhClusterPairDiffTimeEPi0MassSame->SetYTitle("#Delta #it{t} (ns)");
2276  outputContainer->Add(fhClusterPairDiffTimeEPi0MassSame);
2277  }
2278 
2279  if ( fNModules > 12 && (GetCalorimeter() == kEMCAL || GetCalorimeter() == kDCAL) && fLastModule > 11 )
2280  {
2281  fhClusterPairDiffTimeEPi0MassDCal = new TH2F("hClusterPairDiffTimeEPi0MassDCal","cluster pair time difference vs E, only good clusters",
2282  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2283  fhClusterPairDiffTimeEPi0MassDCal->SetXTitle("#it{E}_{cluster} (GeV)");
2284  fhClusterPairDiffTimeEPi0MassDCal->SetYTitle("#Delta #it{t} (ns)");
2285  outputContainer->Add(fhClusterPairDiffTimeEPi0MassDCal);
2286 
2287  fhClusterPairDiffTimeEPi0MassDCalSame = new TH2F("hClusterPairDiffTimeEPi0MassDCalSame","cluster pair time difference vs E, only good clusters",
2288  nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2289  fhClusterPairDiffTimeEPi0MassDCalSame->SetXTitle("#it{E}_{cluster} (GeV)");
2290  fhClusterPairDiffTimeEPi0MassDCalSame->SetYTitle("#Delta #it{t} (ns)");
2291  outputContainer->Add(fhClusterPairDiffTimeEPi0MassDCalSame);
2292  }
2293  }
2294 
2295  fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
2296  fhAsym->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2297  fhAsym->SetYTitle("#it{Asymmetry}");
2298  outputContainer->Add(fhAsym);
2299 
2301  {
2302  fhOpAngle = new TH2F ("hOpeningAngle","Cluster pairs opening angle vs reconstructed pair #it{p}_{T}, ncell > 1",
2303  nptbins,ptmin,ptmax, 180,0,TMath::Pi());
2304  fhOpAngle->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2305  fhOpAngle->SetYTitle("Opening angle (degrees)");
2306  outputContainer->Add(fhOpAngle);
2307 
2308  Int_t nBinOpAngle = TMath::Nint(fInvMassMaxOpenAngle*TMath::RadToDeg()); // bin of 1 degree size
2309  fhIMvsOpAngle = new TH2F ("hIMvsOpAngle","Cluster pairs Invariant mass vs reconstructed pair opening angle, ncell > 1",
2310  nBinOpAngle,0.,fInvMassMaxOpenAngle,nmassbins,massmin,massmax);
2311  fhIMvsOpAngle->SetXTitle("Opening angle (degrees)");
2312  fhIMvsOpAngle->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2313  outputContainer->Add(fhIMvsOpAngle);
2314  }
2315  }
2316 
2317  if(fFillAllPosHisto2)
2318  {
2319  fhXYZ = new TH3F ("hXYZ","Cluster: #it{x} vs #it{y} vs #it{z}",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2320  fhXYZ->SetXTitle("#it{x} (cm)");
2321  fhXYZ->SetYTitle("#it{y} (cm)");
2322  fhXYZ->SetZTitle("#it{z} (cm) ");
2323  outputContainer->Add(fhXYZ);
2324 
2325  fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2326  fhXE->SetXTitle("#it{x} (cm)");
2327  fhXE->SetYTitle("#it{E} (GeV)");
2328  outputContainer->Add(fhXE);
2329 
2330  fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2331  fhYE->SetXTitle("#it{y} (cm)");
2332  fhYE->SetYTitle("#it{E} (GeV)");
2333  outputContainer->Add(fhYE);
2334 
2335  fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2336  fhZE->SetXTitle("#it{z} (cm)");
2337  fhZE->SetYTitle("#it{E} (GeV)");
2338  outputContainer->Add(fhZE);
2339 
2340  fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2341  fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2342  fhRE->SetYTitle("#it{E} (GeV)");
2343  outputContainer->Add(fhRE);
2344 
2345  fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Cells per Cluster",xbins,xmin,xmax,nceclbins,nceclmin,nceclmax);
2346  fhXNCells->SetXTitle("#it{x} (cm)");
2347  fhXNCells->SetYTitle("N cells per cluster");
2348  outputContainer->Add(fhXNCells);
2349 
2350  fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Cells per Cluster",ybins,ymin,ymax,nceclbins,nceclmin,nceclmax);
2351  fhYNCells->SetXTitle("#it{y} (cm)");
2352  fhYNCells->SetYTitle("N cells per cluster");
2353  outputContainer->Add(fhYNCells);
2354 
2355  fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Cells per Cluster",zbins,zmin,zmax,nceclbins,nceclmin,nceclmax);
2356  fhZNCells->SetXTitle("#it{z} (cm)");
2357  fhZNCells->SetYTitle("N cells per cluster");
2358  outputContainer->Add(fhZNCells);
2359 
2360  fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Cells per Cluster",rbins,rmin,rmax,nceclbins,nceclmin,nceclmax);
2361  fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2362  fhRNCells->SetYTitle("N cells per cluster");
2363  outputContainer->Add(fhRNCells);
2364  }
2365 
2366  if(fFillAllPosHisto)
2367  {
2368  fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2369  fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2370  fhRCellE->SetYTitle("#it{E} (GeV)");
2371  outputContainer->Add(fhRCellE);
2372 
2373  fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2374  fhXCellE->SetXTitle("#it{x} (cm)");
2375  fhXCellE->SetYTitle("#it{E} (GeV)");
2376  outputContainer->Add(fhXCellE);
2377 
2378  fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2379  fhYCellE->SetXTitle("#it{y} (cm)");
2380  fhYCellE->SetYTitle("#it{E} (GeV)");
2381  outputContainer->Add(fhYCellE);
2382 
2383  fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2384  fhZCellE->SetXTitle("#it{z} (cm)");
2385  fhZCellE->SetYTitle("#it{E} (GeV)");
2386  outputContainer->Add(fhZCellE);
2387 
2388  fhXYZCell = new TH3F ("hXYZCell","Cell : #it{x} vs #it{y} vs #it{z}",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2389  fhXYZCell->SetXTitle("#it{x} (cm)");
2390  fhXYZCell->SetYTitle("#it{y} (cm)");
2391  fhXYZCell->SetZTitle("#it{z} (cm)");
2392  outputContainer->Add(fhXYZCell);
2393 
2394  Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
2395  Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
2396  Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
2397  Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
2398 
2399  fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Cells per Cluster",rbins*2,-dr,dr,nceclbins,nceclmin,nceclmax);
2400  fhDeltaCellClusterRNCells->SetXTitle("#it{r} = #sqrt{x^{2}+y^{2}}, #it{r}_{clus}-#it{r}_{cell} (cm)");
2401  fhDeltaCellClusterRNCells->SetYTitle("#it{n}_{cells per cluster}");
2402  outputContainer->Add(fhDeltaCellClusterRNCells);
2403 
2404  fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Cells per Cluster",xbins*2,-dx,dx,nceclbins,nceclmin,nceclmax);
2405  fhDeltaCellClusterXNCells->SetXTitle("#it{x}_{clus}-#it{x}_{cell} (cm)");
2406  fhDeltaCellClusterXNCells->SetYTitle("#it{n}_{cells per cluster}");
2407  outputContainer->Add(fhDeltaCellClusterXNCells);
2408 
2409  fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Cells per Cluster",ybins*2,-dy,dy,nceclbins,nceclmin,nceclmax);
2410  fhDeltaCellClusterYNCells->SetXTitle("#it{y}_{clus}-#it{y}_{cell} (cm)");
2411  fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
2412  outputContainer->Add(fhDeltaCellClusterYNCells);
2413 
2414  fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Cells per Cluster",zbins*2,-dz,dz,nceclbins,nceclmin,nceclmax);
2415  fhDeltaCellClusterZNCells->SetXTitle("#it{z}_{clus}-#it{z}_{cell} (cm)");
2416  fhDeltaCellClusterZNCells->SetYTitle("#it{n}_{cells per cluster}");
2417  outputContainer->Add(fhDeltaCellClusterZNCells);
2418 
2419  fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
2420  fhDeltaCellClusterRE->SetXTitle("#it{r} = #sqrt{x^{2}+y^{2}}, #it{r}_{clus}-#it{r}_{cell} (cm)");
2421  fhDeltaCellClusterRE->SetYTitle("#it{E} (GeV)");
2422  outputContainer->Add(fhDeltaCellClusterRE);
2423 
2424  fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
2425  fhDeltaCellClusterXE->SetXTitle("#it{x}_{clus}-#it{x}_{cell} (cm)");
2426  fhDeltaCellClusterXE->SetYTitle("#it{E} (GeV)");
2427  outputContainer->Add(fhDeltaCellClusterXE);
2428 
2429  fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
2430  fhDeltaCellClusterYE->SetXTitle("#it{y}_{clus}-#it{y}_{cell} (cm)");
2431  fhDeltaCellClusterYE->SetYTitle("#it{E} (GeV)");
2432  outputContainer->Add(fhDeltaCellClusterYE);
2433 
2434  fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
2435  fhDeltaCellClusterZE->SetXTitle("#it{z}_{clus}-#it{z}_{cell} (cm)");
2436  fhDeltaCellClusterZE->SetYTitle("#it{E} (GeV)");
2437  outputContainer->Add(fhDeltaCellClusterZE);
2438 
2439  if(fFillAllTH3)
2440  {
2441  fhEtaPhiAmpCell = new TH3F ("hEtaPhiAmpCell","Cell #eta vs cell #varphi vs cell energy",
2442  netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2443  fhEtaPhiAmpCell->SetXTitle("#eta ");
2444  fhEtaPhiAmpCell->SetYTitle("#varphi (rad)");
2445  fhEtaPhiAmpCell->SetZTitle("#it{E} (GeV) ");
2446  outputContainer->Add(fhEtaPhiAmpCell);
2447  }
2448  else
2449  {
2450  fhEtaPhiCell = new TH2F ("hEtaPhiCell","Cell #eta vs cell #varphi vs cell energy",
2451  netabins,etamin,etamax,nphibins,phimin,phimax);
2452  fhEtaPhiCell->SetXTitle("#eta ");
2453  fhEtaPhiCell->SetYTitle("#varphi (rad)");
2454  outputContainer->Add(fhEtaPhiCell);
2455  }
2456  }
2457 
2459  {
2460  fhCellTimeSpreadRespectToCellMax = new TH2F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
2461  fhCellTimeSpreadRespectToCellMax->SetXTitle("#it{E} (GeV)");
2462  fhCellTimeSpreadRespectToCellMax->SetYTitle("#Delta #it{t}_{cell max-i} (ns)");
2463  outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
2464 
2465  // fhClusterMaxCellDiffAverageTime = new TH2F ("hClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2466  // fhClusterMaxCellDiffAverageTime->SetXTitle("#it{E} (GeV)");
2467  // fhClusterMaxCellDiffAverageTime->SetYTitle("#Delta #it{t}_{cell max - average} (ns)");
2468  // outputContainer->Add(fhClusterMaxCellDiffAverageTime);
2469  //
2470  // fhClusterMaxCellDiffWeightedTime = new TH2F ("hClusterMaxCellDiffWeightedTime","t_{cell max}-t_{weighted} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2471  // fhClusterMaxCellDiffWeightedTime->SetXTitle("#it{E} (GeV)");
2472  // fhClusterMaxCellDiffWeightedTime->SetYTitle("#Delta #it{t}_{cell max - weighted} (ns)");
2473  // outputContainer->Add(fhClusterMaxCellDiffWeightedTime);
2474  }
2475 
2476  // Module histograms
2477 
2478  fhEMod = new TH2F ("hE_Mod","Cluster reconstructed Energy in each present Module",nptbins,ptmin,ptmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2479  fhEMod->SetXTitle("#it{E} (GeV)");
2480  fhEMod->SetYTitle("Module");
2481  outputContainer->Add(fhEMod);
2482 
2483  fhEWeirdMod = new TH2F ("hEWeird_Mod","Cluster reconstructed Energy in each present Module, ridiculously large E",200,0,10000,totalSM,fFirstModule-0.5,fLastModule+0.5);
2484  fhEWeirdMod->SetXTitle("#it{E} (GeV)");
2485  fhEWeirdMod->SetYTitle("Module");
2486  outputContainer->Add(fhEWeirdMod);
2487 
2488  fhNClustersMod = new TH2F ("hNClusters_Mod","# clusters vs Module", nclbins,nclmin+0.5,nclmax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2489  fhNClustersMod->SetXTitle("number of clusters");
2490  fhNClustersMod->SetYTitle("Module");
2491  outputContainer->Add(fhNClustersMod);
2492 
2493  fhSumClustersEnergyMod = new TH2F ("hSumClustersEnergy_Mod","# clusters vs Module", 1000, 0, 2000,totalSM,fFirstModule-0.5,fLastModule+0.5);
2494  fhSumClustersEnergyMod->SetXTitle("#Sigma_{clusters} #it{E} (GeV)");
2495  fhSumClustersEnergyMod->SetYTitle("Module");
2496  outputContainer->Add(fhSumClustersEnergyMod);
2497 
2499 
2500  fhIMMod = new TH2F*[fNModules];
2501 
2503 
2504  if(fStudyBadClusters)
2506 
2507 
2508  for(Int_t imod = 0; imod < fNModules; imod++)
2509  {
2510  if(imod < fFirstModule || imod > fLastModule) continue;
2511 
2512  fhNClustersSumEnergyPerMod[imod] = new TH2F (Form("hNClustersSumEnergy_Mod%d",imod),
2513  Form("# clusters in SM vs sum of clusters energy in Module %d",imod),
2514  nptbins,ptmin,ptmax*4, nclbins,nclmin,nclmax);
2515  fhNClustersSumEnergyPerMod[imod]->SetXTitle("#Sigma #it{E} (GeV)");
2516  fhNClustersSumEnergyPerMod[imod]->SetYTitle("#Sigma #it{n}_{clusters}");
2517  outputContainer->Add(fhNClustersSumEnergyPerMod[imod]);
2518 
2519  fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
2520  Form("# cells per cluster vs cluster energy in Module %d",imod),
2521  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2522  fhNCellsPerClusterMod[imod]->SetXTitle("#it{E} (GeV)");
2523  fhNCellsPerClusterMod[imod]->SetYTitle("#it{n}_{cells per cluster}");
2524  outputContainer->Add(fhNCellsPerClusterMod[imod]);
2525 
2526  if(fStudyBadClusters)
2527  {
2528  fhNCellsPerClusterModNoCut[imod] = new TH2F (Form("hNCellsPerClusterNoCut_Mod%d",imod),
2529  Form("# cells per cluster vs cluster energy in Module %d, no cut",imod),
2530  nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2531  fhNCellsPerClusterModNoCut[imod]->SetXTitle("#it{E} (GeV)");
2532  fhNCellsPerClusterModNoCut[imod]->SetYTitle("#it{n}_{cells per cluster}");
2533  outputContainer->Add(fhNCellsPerClusterModNoCut[imod]);
2534  }
2535 
2536  if(fFillAllPi0Histo)
2537  {
2538  fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
2539  Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d, n cell > 1",imod),
2540  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2541  fhIMMod[imod]->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2542  fhIMMod[imod]->SetYTitle("#it{M}_{cluster pairs} (GeV/#it{c}^{2})");
2543  outputContainer->Add(fhIMMod[imod]);
2544  }
2545  }
2546  }
2547 
2548  // Calorimeter cells
2549  //
2551  {
2552  fhNCells = new TH1F ("hNCells","# cells", ncebins,ncemin+0.5,ncemax);
2553  fhNCells->SetXTitle("#it{n}_{cells}");
2554  outputContainer->Add(fhNCells);
2555 
2556  fhNCellsCutAmpMin = new TH1F ("hNCellsCutAmpMin",Form("# cells amp > %1.2f-%1.2f",fEMCALCellAmpMin,fPHOSCellAmpMin), ncebins,ncemin+0.5,ncemax);
2557  fhNCellsCutAmpMin->SetXTitle("#it{n}_{cells}");
2558  outputContainer->Add(fhNCellsCutAmpMin);
2559 
2560  fhAmplitude = new TH1F ("hAmplitude","#it{E}_{cell}", nptbins,ptmin,ptmax/2);
2561  fhAmplitude->SetXTitle("#it{E}_{cell} (GeV)");
2562  outputContainer->Add(fhAmplitude);
2563 
2564  fhAmpMod = new TH2F ("hAmp_Mod","Cell energy in each present Module",nptbins,ptmin,ptmax/2,totalSM,fFirstModule-0.5,fLastModule+0.5);
2565  fhAmpMod->SetXTitle("#it{E} (GeV)");
2566  fhAmpMod->SetYTitle("Module");
2567  outputContainer->Add(fhAmpMod);
2568 
2569  fhAmpWeirdMod = new TH2F ("hAmpWeird_Mod","Cell energy in each present Module, ridiculously large E",200,0,10000,totalSM,fFirstModule-0.5,fLastModule+0.5);
2570  fhAmpWeirdMod->SetXTitle("#it{E} (GeV)");
2571  fhAmpWeirdMod->SetYTitle("Module");
2572  outputContainer->Add(fhAmpWeirdMod);
2573 
2575  {
2576  fhTimeMod = new TH2F ("hTime_Mod","Cell time in each present Module",ntimebins,timemin,timemax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2577  fhTimeMod->SetXTitle("t (ns)");
2578  fhTimeMod->SetYTitle("Module");
2579  outputContainer->Add(fhTimeMod);
2580  }
2581 
2583  {
2584  //..Create the fhAmpId TH2D with increasing binwidth
2585  //..0-10 GeV (0.05), 10-20 GeV (0.2), 20-30 GeV (0.5)
2586  Double_t binWidth=(ptfinemax-ptfinemin)/nfineptbins;
2587  TCustomBinning xBinning;
2588  xBinning.SetMinimum(ptfinemin);
2589  xBinning.AddStep(ptfinemax,binWidth); //..first entries of the array are the set ranges and bins
2590  xBinning.AddStep(ptfinemax*2,binWidth*4); //..expand the previously defined range by 2 but increase the bin width
2591  xBinning.AddStep(ptfinemax*4,binWidth*10);//..expand the previously defined range by 4 but increase the bin width
2592 
2593  TCustomBinning yBinning;
2594  yBinning.SetMinimum(0);
2595  yBinning.AddStep(fNMaxRows*fNMaxCols*fNModules,1); //..add cells with binwidth 1
2596 
2597  TArrayD xbinsArray;
2598  xBinning.CreateBinEdges(xbinsArray);
2599  TArrayD ybinsArray;
2600  yBinning.CreateBinEdges(ybinsArray);
2601 
2602  fhAmpId = new TH2F ("hAmpId","#it{E}_{cell}", xbinsArray.GetSize() - 1, xbinsArray.GetArray(), ybinsArray.GetSize() - 1, ybinsArray.GetArray());
2603  fhAmpId->SetXTitle("#it{E}_{cell} (GeV)");
2604  outputContainer->Add(fhAmpId);
2605 
2606  fhAmpIdLowGain = new TH2F ("hAmpIdLG","Low gain: #it{E}_{cell}", nfineptbins,15,ptfinemax+15,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2607  fhAmpIdLowGain->SetXTitle("#it{E}_{cell} (GeV)");
2608  outputContainer->Add(fhAmpIdLowGain);
2609  }
2610 
2612  {
2613  fhTime = new TH1F ("hTime","#it{t}_{cell}",ntimebins,timemin,timemax);
2614  fhTime->SetXTitle("#it{t}_{cell} (ns)");
2615  outputContainer->Add(fhTime);
2616 
2617  // fhTimeVz = new TH2F ("hTimeVz","#it{t}_{cell} vs vertex, amplitude > 0.5 GeV",100, 0, 50,ntimebins,timemin,timemax);
2618  // fhTimeVz->SetXTitle("|v_{z}| (cm)");
2619  // fhTimeVz->SetYTitle("#it{t}_{cell} (ns)");
2620  // outputContainer->Add(fhTimeVz);
2621 
2622  fhTimeAmp = new TH2F ("hTimeAmp","#it{t}_{cell} vs #it{E}_{cell}",nptbins,ptmin,ptmax/2,ntimebins,timemin,timemax);
2623  fhTimeAmp->SetYTitle("#it{t}_{cell} (ns)");
2624  fhTimeAmp->SetXTitle("#it{E}_{cell} (GeV)");
2625  outputContainer->Add(fhTimeAmp);
2626 
2627  fhTimeAmpLowGain = new TH2F ("hTimeAmpLG","Low gain: #it{t}_{cell} vs #it{E}_{cell}",nptbins,ptmin,ptmax/2,ntimebins,timemin,timemax);
2628  fhTimeAmpLowGain->SetYTitle("#it{t}_{cell} (ns)");
2629  fhTimeAmpLowGain->SetXTitle("#it{E}_{cell} (GeV)");
2630  outputContainer->Add(fhTimeAmpLowGain);
2631 
2633  {
2634  fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","Cells with time 100 ns larger than cell max in cluster ",
2636  fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
2637  outputContainer->Add(fhCellIdCellLargeTimeSpread);
2638 
2639  fhTimeId = new TH2F ("hTimeId","#it{t}_{cell} vs Absolute Id",
2640  ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2641  fhTimeId->SetXTitle("#it{t}_{cell} (ns)");
2642  fhTimeId->SetYTitle("Cell Absolute Id");
2643  outputContainer->Add(fhTimeId);
2644 
2645  fhTimeIdLowGain = new TH2F ("hTimeIdLG","Low gain: #it{t}_{cell} vs Absolute Id",
2646  ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2647  fhTimeIdLowGain->SetXTitle("#it{t}_{cell} (ns)");
2648  fhTimeIdLowGain->SetYTitle("Cell Absolute Id");
2649  outputContainer->Add(fhTimeIdLowGain);
2650 
2651  if(GetCaloUtils()->IsL1PhaseInTimeRecalibrationOn()==1)
2652  {
2653  fhTimeL1UnCorrId = new TH2F ("hTimeL1UnCorrId","#it{t}_{cell} vs Absolute Id",
2654  ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2655  fhTimeL1UnCorrId->SetXTitle("#it{t}_{cell} (ns)");
2656  fhTimeL1UnCorrId->SetYTitle("Cell Absolute Id");
2657  outputContainer->Add(fhTimeL1UnCorrId);
2658  }
2659  }
2660 
2661  for(Int_t bc = 0; bc < 4; bc++)
2662  {
2663  fhTimePerSMPerBC[bc] = new TH2F (Form("hTimePerSM_BC%d",bc),
2664  Form("#it{t}_{cell} vs super-module, for BC/4=%d",bc),
2665  ntimebins,timemin,timemax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2666  fhTimePerSMPerBC[bc]->SetXTitle("#it{t}_{cell} (ns)");
2667  fhTimePerSMPerBC[bc]->SetYTitle("Module");
2668  outputContainer->Add(fhTimePerSMPerBC[bc]);
2669  }
2670  }
2671 
2672  fhCellECross = new TH2F ("hCellECross","1 - Energy in cross around cell / cell energy",
2673  nptbins,ptmin,ptmax/2, 400,-1,1.);
2674  fhCellECross->SetXTitle("#it{E}_{cell} (GeV) ");
2675  fhCellECross->SetYTitle("1- #it{E}_{cross}/#it{E}_{cell}");
2676  outputContainer->Add(fhCellECross);
2677 
2678  fhNCellsMod = new TH2F ("hNCells_Mod","# cells vs Module", ncebins,ncemin+0.5,ncemax,totalSM,fFirstModule-0.5,fLastModule+0.5);
2679  fhNCellsMod->SetXTitle("#it{n}_{cells}");
2680  fhNCellsMod->SetYTitle("Module");
2681  outputContainer->Add(fhNCellsMod);
2682 
2683  fhSumCellsAmpMod = new TH2F ("hSumCellsAmp_Mod","# cells vs Module", 1000, 0, 2000,totalSM,fFirstModule-0.5,fLastModule+0.5);
2684  fhSumCellsAmpMod->SetXTitle("#Sigma_{cells} #it{Amp} (GeV)");
2685  fhSumCellsAmpMod->SetYTitle("Module");
2686  outputContainer->Add(fhSumCellsAmpMod);
2687 
2688  fhGridCells = new TH2F ("hGridCells",Form("Entries in grid of cells"),
2689  ncolcell,colcellmin,colcellmax,nrowcell,rowcellmin,rowcellmax);
2690  fhGridCells->SetYTitle("row (phi direction)");
2691  fhGridCells->SetXTitle("column (eta direction)");
2692  outputContainer->Add(fhGridCells);
2693 
2694  fhGridCellsE = new TH2F ("hGridCellsE","Accumulated energy in grid of cells",
2695  ncolcell,colcellmin,colcellmax,nrowcell,rowcellmin,rowcellmax);
2696  fhGridCellsE->SetYTitle("row (phi direction)");
2697  fhGridCellsE->SetXTitle("column (eta direction)");
2698  outputContainer->Add(fhGridCellsE);
2699 
2700  fhGridCellsLowGain = new TH2F ("hGridCellsLG",Form("Low gain: Entries in grid of cells"),
2701  ncolcell,colcellmin,colcellmax,nrowcell,rowcellmin,rowcellmax);
2702  fhGridCellsLowGain->SetYTitle("row (phi direction)");
2703  fhGridCellsLowGain->SetXTitle("column (eta direction)");
2704  outputContainer->Add(fhGridCellsLowGain);
2705 
2706  fhGridCellsELowGain = new TH2F ("hGridCellsELG","Low gain: Accumulated energy in grid of cells",
2707  ncolcell,colcellmin,colcellmax,nrowcell,rowcellmin,rowcellmax);
2708  fhGridCellsELowGain->SetYTitle("row (phi direction)");
2709  fhGridCellsELowGain->SetXTitle("column (eta direction)");
2710  outputContainer->Add(fhGridCellsELowGain);
2711 
2713  {
2714  fhGridCellsTime = new TH2F ("hGridCellsTime","Accumulated time in grid of cells",
2715  ncolcell,colcellmin,colcellmax,nrowcell,rowcellmin,rowcellmax);
2716  fhGridCellsTime->SetYTitle("row (phi direction)");
2717  fhGridCellsTime->SetXTitle("column (eta direction)");
2718  outputContainer->Add(fhGridCellsTime);
2719 
2720  fhGridCellsTimeLowGain = new TH2F ("hGridCellsTimeLG","Low gain: Accumulated time in grid of cells",
2721  ncolcell,colcellmin,colcellmax,nrowcell,rowcellmin,rowcellmax);
2722  fhGridCellsTimeLowGain->SetYTitle("row (phi direction)");
2723  fhGridCellsTimeLowGain->SetXTitle("column (eta direction)");
2724  outputContainer->Add(fhGridCellsTimeLowGain);
2725  }
2726 
2728  {
2730 
2731  for(Int_t imod = 0; imod < fNModules; imod++)
2732  {
2733  if(imod < fFirstModule || imod > fLastModule) continue;
2734 
2735  fhNCellsSumAmpPerMod[imod] = new TH2F (Form("hNCellsSumAmp_Mod%d",imod),
2736  Form("# cells in SM vs sum of cells energy in Module %d",imod),
2737  nptbins,ptmin,ptmax*4, ncebins,ncemin,ncemax);
2738  fhNCellsSumAmpPerMod[imod]->SetXTitle("#Sigma #it{Amplitude} (GeV)");
2739  fhNCellsSumAmpPerMod[imod]->SetYTitle("#Sigma #it{n}_{cells}");
2740  outputContainer->Add(fhNCellsSumAmpPerMod[imod]);}
2741  }
2742 
2744  {
2746 
2747  for(Int_t imod = 0; imod < fNModules; imod++)
2748  {
2749  for(Int_t ircu = 0; ircu < fNRCU; ircu++)
2750  {
2751  if( ircu ==1 &&
2752  (imod == 10 || imod== 11 || imod == 18 || imod == 19)
2753  ) continue;
2754 
2755  fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
2756  Form("#it{E}_{cell} vs #it{t}_{cell} in Module %d, RCU %d ",imod,ircu),
2757  nptbins,ptmin,ptmax/2,ntimebins,timemin,timemax);
2758  fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("#it{E} (GeV)");
2759  fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("#it{t} (ns)");
2760  outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
2761 
2762  }
2763  }
2764  }
2765  }
2766 
2767  // Detectors correlation
2768  //
2769  if(fCorrelate)
2770  {
2771  // PHOS vs EMCAL
2772  fhEMCALPHOSCorrNClusters = new TH2F ("hEMCALPHOSCorrNClusters","# clusters in EMCAL vs PHOS", nclbins,nclmin,nclmax,nclbins,nclmin,nclmax);
2773  fhEMCALPHOSCorrNClusters->SetXTitle("number of clusters in EMCAL");
2774  fhEMCALPHOSCorrNClusters->SetYTitle("number of clusters in PHOS");
2775  outputContainer->Add(fhEMCALPHOSCorrNClusters);
2776 
2777  fhEMCALPHOSCorrEClusters = new TH2F ("hEMCALPHOSCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
2778  fhEMCALPHOSCorrEClusters->SetXTitle("#Sigma #it{E} of clusters in EMCAL (GeV)");
2779  fhEMCALPHOSCorrEClusters->SetYTitle("#Sigma #it{E} of clusters in PHOS (GeV)");
2780  outputContainer->Add(fhEMCALPHOSCorrEClusters);
2781 
2782  fhEMCALPHOSCorrNCells = new TH2F ("hEMCALPHOSCorrNCells","# Cells in EMCAL vs PHOS", ncebins,ncemin,ncemax, ncebins,ncemin,ncemax);
2783  fhEMCALPHOSCorrNCells->SetXTitle("number of Cells in EMCAL");
2784  fhEMCALPHOSCorrNCells->SetYTitle("number of Cells in PHOS");
2785  outputContainer->Add(fhEMCALPHOSCorrNCells);
2786 
2787  fhEMCALPHOSCorrECells = new TH2F ("hEMCALPHOSCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*4,nptbins*2,ptmin,ptmax*4);
2788  fhEMCALPHOSCorrECells->SetXTitle("#Sigma #it{E} of Cells in EMCAL (GeV)");
2789  fhEMCALPHOSCorrECells->SetYTitle("#Sigma #it{E} of Cells in PHOS (GeV)");
2790  outputContainer->Add(fhEMCALPHOSCorrECells);
2791 
2792  // DCal vs EMCAL
2793  fhEMCALDCALCorrNClusters = new TH2F ("hEMCALDCALCorrNClusters","# clusters in EMCAL vs DCAL", nclbins,nclmin,nclmax,nclbins,nclmin,nclmax);
2794  fhEMCALDCALCorrNClusters->SetXTitle("number of clusters in EMCAL");
2795  fhEMCALDCALCorrNClusters->SetYTitle("number of clusters in DCAL");
2796  outputContainer->Add(fhEMCALDCALCorrNClusters);
2797 
2798  fhEMCALDCALCorrEClusters = new TH2F ("hEMCALDCALCorrEClusters","summed energy of clusters in EMCAL vs DCAL", nptbins,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
2799  fhEMCALDCALCorrEClusters->SetXTitle("#Sigma #it{E} of clusters in EMCAL (GeV)");
2800  fhEMCALDCALCorrEClusters->SetYTitle("#Sigma #it{E} of clusters in DCAL (GeV)");
2801  outputContainer->Add(fhEMCALDCALCorrEClusters);
2802 
2803  fhEMCALDCALCorrNCells = new TH2F ("hEMCALDCALCorrNCells","# Cells in EMCAL vs DCAL", ncebins,ncemin,ncemax, ncebins,ncemin,ncemax);
2804  fhEMCALDCALCorrNCells->SetXTitle("number of Cells in EMCAL");
2805  fhEMCALDCALCorrNCells->SetYTitle("number of Cells in DCAL");
2806  outputContainer->Add(fhEMCALDCALCorrNCells);
2807 
2808  fhEMCALDCALCorrECells = new TH2F ("hEMCALDCALCorrECells","summed energy of Cells in EMCAL vs DCAL", nptbins*2,ptmin,ptmax*4,nptbins*2,ptmin,ptmax*4);
2809  fhEMCALDCALCorrECells->SetXTitle("#Sigma #it{E} of Cells in EMCAL (GeV)");
2810  fhEMCALDCALCorrECells->SetYTitle("#Sigma #it{E} of Cells in DCAL (GeV)");
2811  outputContainer->Add(fhEMCALDCALCorrECells);
2812 
2813 
2814  // DCAL vs PHOS
2815  fhDCALPHOSCorrNClusters = new TH2F ("hDCALPHOSCorrNClusters","# clusters in DCAL vs PHOS", nclbins,nclmin,nclmax,nclbins,nclmin,nclmax);
2816  fhDCALPHOSCorrNClusters->SetXTitle("number of clusters in DCAL");
2817  fhDCALPHOSCorrNClusters->SetYTitle("number of clusters in PHOS");
2818  outputContainer->Add(fhDCALPHOSCorrNClusters);
2819 
2820  fhDCALPHOSCorrEClusters = new TH2F ("hDCALPHOSCorrEClusters","summed energy of clusters in DCAL vs PHOS", nptbins,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
2821  fhDCALPHOSCorrEClusters->SetXTitle("#Sigma #it{E} of clusters in DCAL (GeV)");
2822  fhDCALPHOSCorrEClusters->SetYTitle("#Sigma #it{E} of clusters in PHOS (GeV)");
2823  outputContainer->Add(fhDCALPHOSCorrEClusters);
2824 
2825  fhDCALPHOSCorrNCells = new TH2F ("hDCALPHOSCorrNCells","# Cells in DCAL vs PHOS", ncebins,ncemin,ncemax, ncebins,ncemin,ncemax);
2826  fhDCALPHOSCorrNCells->SetXTitle("number of Cells in DCAL");
2827  fhDCALPHOSCorrNCells->SetYTitle("number of Cells in PHOS");
2828  outputContainer->Add(fhDCALPHOSCorrNCells);
2829 
2830  fhDCALPHOSCorrECells = new TH2F ("hDCALPHOSCorrECells","summed energy of Cells in DCAL vs PHOS", nptbins*2,ptmin,ptmax*4,nptbins*2,ptmin,ptmax*4);
2831  fhDCALPHOSCorrECells->SetXTitle("#Sigma #it{E} of Cells in DCAL (GeV)");
2832  fhDCALPHOSCorrECells->SetYTitle("#Sigma #it{E} of Cells in PHOS (GeV)");
2833  outputContainer->Add(fhDCALPHOSCorrECells);
2834 
2835  // Calorimeter vs. V0 signal
2836 
2837  fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",GetCalorimeterString().Data()), nv0sbins,nv0smin,nv0smax,nclbins,nclmin,nclmax);
2838  fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
2839  fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",GetCalorimeterString().Data()));
2840  outputContainer->Add(fhCaloV0SCorrNClusters);
2841 
2842  fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",GetCalorimeterString().Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax*2);
2843  fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
2844  fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma #it{E} of clusters in %s (GeV)",GetCalorimeterString().Data()));
2845  outputContainer->Add(fhCaloV0SCorrEClusters);
2846 
2847  fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",GetCalorimeterString().Data()), nv0sbins,nv0smin,nv0smax, ncebins,ncemin,ncemax);
2848  fhCaloV0SCorrNCells->SetXTitle("V0 signal");
2849  fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",GetCalorimeterString().Data()));
2850  outputContainer->Add(fhCaloV0SCorrNCells);
2851 
2852  fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",GetCalorimeterString().Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax*2);
2853  fhCaloV0SCorrECells->SetXTitle("V0 signal");
2854  fhCaloV0SCorrECells->SetYTitle(Form("#Sigma #it{E} of Cells in %s (GeV)",GetCalorimeterString().Data()));
2855  outputContainer->Add(fhCaloV0SCorrECells);
2856 
2857  // Calorimeter vs V0 multiplicity
2858 
2859  fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",GetCalorimeterString().Data()), nv0mbins,nv0mmin,nv0mmax,nclbins,nclmin,nclmax);
2860  fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
2861  fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",GetCalorimeterString().Data()));
2862  outputContainer->Add(fhCaloV0MCorrNClusters);
2863 
2864  fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",GetCalorimeterString().Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax*2);
2865  fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
2866  fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma #it{E} of clusters in %s (GeV)",GetCalorimeterString().Data()));
2867  outputContainer->Add(fhCaloV0MCorrEClusters);
2868 
2869  fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",GetCalorimeterString().Data()), nv0mbins,nv0mmin,nv0mmax, ncebins,ncemin,ncemax);
2870  fhCaloV0MCorrNCells->SetXTitle("V0 signal");
2871  fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",GetCalorimeterString().Data()));
2872  outputContainer->Add(fhCaloV0MCorrNCells);
2873 
2874  fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",GetCalorimeterString().Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax*2);
2875  fhCaloV0MCorrECells->SetXTitle("V0 signal");
2876  fhCaloV0MCorrECells->SetYTitle(Form("#Sigma #it{E} of Cells in %s (GeV)",GetCalorimeterString().Data()));
2877  outputContainer->Add(fhCaloV0MCorrECells);
2878 
2879  //Calorimeter VS Track multiplicity
2880  fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs # tracks",GetCalorimeterString().Data()), ntrmbins,ntrmmin,ntrmmax,nclbins,nclmin,nclmax);
2881  fhCaloTrackMCorrNClusters->SetXTitle("# tracks");
2882  fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",GetCalorimeterString().Data()));
2883  outputContainer->Add(fhCaloTrackMCorrNClusters);
2884 
2885  fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs # tracks",GetCalorimeterString().Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax*2);
2886  fhCaloTrackMCorrEClusters->SetXTitle("# tracks");
2887  fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma #it{E} of clusters in %s (GeV)",GetCalorimeterString().Data()));
2888  outputContainer->Add(fhCaloTrackMCorrEClusters);
2889 
2890  fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs # tracks",GetCalorimeterString().Data()), ntrmbins,ntrmmin,ntrmmax, ncebins,ncemin,ncemax);
2891  fhCaloTrackMCorrNCells->SetXTitle("# tracks");
2892  fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",GetCalorimeterString().Data()));
2893  outputContainer->Add(fhCaloTrackMCorrNCells);
2894 
2895  fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs # tracks",GetCalorimeterString().Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax*2);
2896  fhCaloTrackMCorrECells->SetXTitle("# tracks");
2897  fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma #it{E} of Cells in %s (GeV)",GetCalorimeterString().Data()));
2898  outputContainer->Add(fhCaloTrackMCorrECells);
2899 
2900  fhCaloCenNClusters = new TH2F ("hCaloCenNClusters","# clusters in calorimeter vs centrality",100,0,100,nclbins,nclmin,nclmax);
2901  fhCaloCenNClusters->SetYTitle("number of clusters in calorimeter");
2902  fhCaloCenNClusters->SetXTitle("Centrality");
2903  outputContainer->Add(fhCaloCenNClusters);
2904 
2905  fhCaloCenEClusters = new TH2F ("hCaloCenEClusters","summed energy of clusters in calorimeter vs centrality",100,0,100,nptbins,ptmin,ptmax*2);
2906  fhCaloCenEClusters->SetYTitle("#Sigma #it{E} of clusters in calorimeter (GeV)");
2907  fhCaloCenEClusters->SetXTitle("Centrality");
2908  outputContainer->Add(fhCaloCenEClusters);
2909 
2910  fhCaloCenNCells = new TH2F ("hCaloCenNCells","# Cells in calorimeter vs centrality",100,0,100,ncebins,ncemin,ncemax);
2911  fhCaloCenNCells->SetYTitle("number of Cells in calorimeter");
2912  fhCaloCenNCells->SetXTitle("Centrality");
2913  outputContainer->Add(fhCaloCenNCells);
2914 
2915  fhCaloCenECells = new TH2F ("hCaloCenECells","summed energy of Cells in calorimeter vs centrality",100,0,100,nptbins*2,ptmin,ptmax*4);
2916  fhCaloCenECells->SetYTitle("#Sigma #it{E} of Cells in calorimeter (GeV)");
2917  fhCaloCenECells->SetXTitle("Centrality");
2918  outputContainer->Add(fhCaloCenECells);
2919 
2920  fhCaloEvPNClusters = new TH2F ("hCaloEvPNClusters","# clusters in calorimeter vs event plane angle",100,0,TMath::Pi(),nclbins,nclmin,nclmax);
2921  fhCaloEvPNClusters->SetYTitle("number of clusters in calorimeter");
2922  fhCaloEvPNClusters->SetXTitle("Event plane angle (rad)");
2923  outputContainer->Add(fhCaloEvPNClusters);
2924 
2925  fhCaloEvPEClusters = new TH2F ("hCaloEvPEClusters","summed energy of clusters in calorimeter vs event plane angle",100,0,TMath::Pi(),nptbins,ptmin,ptmax*2);
2926  fhCaloEvPEClusters->SetYTitle("#Sigma #it{E} of clusters in calorimeter (GeV)");
2927  fhCaloEvPEClusters->SetXTitle("Event plane angle (rad)");
2928  outputContainer->Add(fhCaloEvPEClusters);
2929 
2930  fhCaloEvPNCells = new TH2F ("hCaloEvPNCells","# Cells in calorimeter vs event plane angle",100,0,TMath::Pi(),ncebins,ncemin,ncemax);
2931  fhCaloEvPNCells->SetYTitle("number of Cells in calorimeter");
2932  fhCaloEvPNCells->SetXTitle("Event plane angle (rad)");
2933  outputContainer->Add(fhCaloEvPNCells);
2934 
2935  fhCaloEvPECells = new TH2F ("hCaloEvPECells","summed energy of Cells in calorimeter vs event plane angle",100,0,TMath::Pi(),nptbins*2,ptmin,ptmax*4);
2936  fhCaloEvPECells->SetYTitle("#Sigma #it{E} of Cells in calorimeter (GeV)");
2937  fhCaloEvPECells->SetXTitle("Event plane angle (rad)");
2938  outputContainer->Add(fhCaloEvPECells);
2939  } // correlate calorimeters
2940 
2941  // Monte Carlo Histograms
2942  //
2943  if(IsDataMC())
2944  {
2945  TString particleName[] = {
2946  "Photon", "Pi0", "Eta",
2947  "Electron", "PhotonConv",
2948  "NeutralHadron", "ChargedHadron" };
2949 
2950  // Pure MC
2951 
2952  for(Int_t iPart = 0; iPart < 4; iPart++)
2953  {
2954  fhGenMCE [iPart] = new TH1F(Form("hGenMCE_%s",particleName[iPart].Data()) ,
2955  Form("#it{E} of generated %s",particleName[iPart].Data()),
2956  nptbins,ptmin,ptmax);
2957 
2958  fhGenMCPt[iPart] = new TH1F(Form("hGenMCPt_%s",particleName[iPart].Data()) ,
2959  Form("#it{p}_{T} of generated %s",particleName[iPart].Data()),
2960  nptbins,ptmin,ptmax);
2961 
2962  fhGenMCEtaPhi[iPart] = new TH2F(Form("hGenMCEtaPhi_%s",particleName[iPart].Data()),
2963  Form("Y vs #varphi of generated %s",particleName[iPart].Data()),
2964  200,-1,1,360,0,TMath::TwoPi());
2965 
2966  fhGenMCE [iPart] ->SetXTitle("#it{E} (GeV)");
2967  fhGenMCPt[iPart] ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2968  fhGenMCEtaPhi[iPart]->SetXTitle("#eta");
2969  fhGenMCEtaPhi[iPart]->SetYTitle("#varphi (rad)");
2970 
2971  outputContainer->Add(fhGenMCE [iPart]);
2972  outputContainer->Add(fhGenMCPt [iPart]);
2973  outputContainer->Add(fhGenMCEtaPhi[iPart]);
2974 
2975 
2976  fhGenMCAccE [iPart] = new TH1F(Form("hGenMCAccE_%s",particleName[iPart].Data()) ,
2977  Form("#it{E} of generated %s",particleName[iPart].Data()),
2978  nptbins,ptmin,ptmax);
2979  fhGenMCAccPt[iPart] = new TH1F(Form("hGenMCAccPt_%s",particleName[iPart].Data()) ,
2980  Form("#it{p}_{T} of generated %s",particleName[iPart].Data()),
2981  nptbins,ptmin,ptmax);
2982  fhGenMCAccEtaPhi[iPart] = new TH2F(Form("hGenMCAccEtaPhi_%s",particleName[iPart].Data()),
2983  Form("Y vs #varphi of generated %s",particleName[iPart].Data()),
2984  netabins,etamin,etamax,nphibins,phimin,phimax);
2985 
2986  fhGenMCAccE [iPart] ->SetXTitle("#it{E} (GeV)");
2987  fhGenMCAccPt[iPart] ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2988  fhGenMCAccEtaPhi[iPart]->SetXTitle("#eta");
2989  fhGenMCAccEtaPhi[iPart]->SetYTitle("#varphi (rad)");
2990 
2991  outputContainer->Add(fhGenMCAccE [iPart]);
2992  outputContainer->Add(fhGenMCAccPt [iPart]);
2993  outputContainer->Add(fhGenMCAccEtaPhi[iPart]);
2994 
2995  }
2996 
2998  {
2999  for(Int_t iPart = 0; iPart < 7; iPart++)
3000  {
3001  for(Int_t iCh = 0; iCh < 2; iCh++)
3002  {
3003  fhRecoMCRatioE[iPart][iCh] = new TH2F (Form("hRecoMCRatioE_%s_Match%d",particleName[iPart].Data(),iCh),
3004  Form("Reconstructed/Generated E, %s, Matched %d",particleName[iPart].Data(),iCh),
3005  nptbins, ptmin, ptmax, 200,0,2);
3006  fhRecoMCRatioE[iPart][iCh]->SetYTitle("#it{E}_{reconstructed}/#it{E}_{generated}");
3007  fhRecoMCRatioE[iPart][iCh]->SetXTitle("#it{E}_{reconstructed} (GeV)");
3008  outputContainer->Add(fhRecoMCRatioE[iPart][iCh]);
3009 
3010 
3011  fhRecoMCDeltaE[iPart][iCh] = new TH2F (Form("hRecoMCDeltaE_%s_Match%d",particleName[iPart].Data(),iCh),
3012  Form("Generated - Reconstructed E, %s, Matched %d",particleName[iPart].Data(),iCh),
3013  nptbins, ptmin, ptmax, nptbins*2,-ptmax,ptmax);
3014  fhRecoMCDeltaE[iPart][iCh]->SetYTitle("#Delta #it{E} (GeV)");
3015  fhRecoMCDeltaE[iPart][iCh]->SetXTitle("#it{E}_{reconstructed} (GeV)");
3016  outputContainer->Add(fhRecoMCDeltaE[iPart][iCh]);
3017 
3018  fhRecoMCDeltaPhi[iPart][iCh] = new TH2F (Form("hRecoMCDeltaPhi_%s_Match%d",particleName[iPart].Data(),iCh),
3019  Form("Generated - Reconstructed #varphi, %s, Matched %d",particleName[iPart].Data(),iCh),
3020  nptbins, ptmin, ptmax, nphibins*2,-phimax,phimax);
3021  fhRecoMCDeltaPhi[iPart][iCh]->SetYTitle("#Delta #varphi (rad)");
3022  fhRecoMCDeltaPhi[iPart][iCh]->SetXTitle("#it{E}_{reconstructed} (GeV)");
3023  outputContainer->Add(fhRecoMCDeltaPhi[iPart][iCh]);
3024 
3025  fhRecoMCDeltaEta[iPart][iCh] = new TH2F (Form("hRecoMCDeltaEta_%s_Match%d",particleName[iPart].Data(),iCh),
3026  Form("Generated - Reconstructed #eta, %s, Matched %d",particleName[iPart].Data(),iCh),
3027  nptbins, ptmin, ptmax,netabins*2,-etamax,etamax);
3028  fhRecoMCDeltaEta[iPart][iCh]->SetYTitle("#Delta #eta ");
3029  fhRecoMCDeltaEta[iPart][iCh]->SetXTitle("#it{E}_{reconstructed} (GeV)");
3030  outputContainer->Add(fhRecoMCDeltaEta[iPart][iCh]);
3031 
3032  fhRecoMCE[iPart][iCh] = new TH2F (Form("hRecoMCE_%s_Match%d",particleName[iPart].Data(),iCh),
3033  Form("#it{E} distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
3034  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
3035  fhRecoMCE[iPart][iCh]->SetXTitle("#it{E}_{rec} (GeV)");
3036  fhRecoMCE[iPart][iCh]->SetYTitle("#it{E}_{gen} (GeV)");
3037  outputContainer->Add(fhRecoMCE[iPart][iCh]);
3038 
3039  fhRecoMCPhi[iPart][iCh] = new TH2F (Form("hRecoMCPhi_%s_Match%d",particleName[iPart].Data(),iCh),
3040  Form("#varphi distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
3041  nphibins,phimin,phimax, nphibins,phimin,phimax);
3042  fhRecoMCPhi[iPart][iCh]->SetXTitle("#varphi_{reconstructed} (rad)");
3043  fhRecoMCPhi[iPart][iCh]->SetYTitle("#varphi_{generated} (rad)");
3044  outputContainer->Add(fhRecoMCPhi[iPart][iCh]);
3045 
3046  fhRecoMCEta[iPart][iCh] = new TH2F (Form("hRecoMCEta_%s_Match%d",particleName[iPart].Data(),iCh),
3047  Form("#eta distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
3048  netabins,etamin,etamax,netabins,etamin,etamax);
3049  fhRecoMCEta[iPart][iCh]->SetXTitle("#eta_{reconstructed} ");
3050  fhRecoMCEta[iPart][iCh]->SetYTitle("#eta_{generated} ");
3051  outputContainer->Add(fhRecoMCEta[iPart][iCh]);
3052  }
3053  }
3054 
3055  // Vertex of generated particles
3056 
3057  fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
3058  fhEMVxyz->SetXTitle("#it{v}_{x}");
3059  fhEMVxyz->SetYTitle("#it{v}_{y}");
3060  //fhEMVxyz->SetZTitle("v_{z}");
3061  outputContainer->Add(fhEMVxyz);
3062 
3063  fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
3064  fhHaVxyz->SetXTitle("#it{v}_{x}");
3065  fhHaVxyz->SetYTitle("#it{v}_{y}");
3066  //fhHaVxyz->SetZTitle("v_{z}");
3067  outputContainer->Add(fhHaVxyz);
3068 
3069  fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
3070  fhEMR->SetXTitle("#it{E} (GeV)");
3071  fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
3072  outputContainer->Add(fhEMR);
3073 
3074  fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
3075  fhHaR->SetXTitle("#it{E} (GeV)");
3076  fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
3077  outputContainer->Add(fhHaR);
3078 
3079  // Track Matching
3080 
3081  fhMCEle1EOverP = new TH2F("hMCEle1EOverP","TRACK matches #it{E}/#it{p}, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3082  fhMCEle1EOverP->SetYTitle("#it{E}/#it{p}");
3083  fhMCEle1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3084  outputContainer->Add(fhMCEle1EOverP);
3085 
3086  fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
3087  fhMCEle1dR->SetXTitle("#Delta #it{R} (rad)");
3088  outputContainer->Add(fhMCEle1dR) ;
3089 
3090  fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
3091  fhMCEle2MatchdEdx->SetXTitle("#it{p} (GeV/#it{c})");
3092  fhMCEle2MatchdEdx->SetYTitle("<#it{dE/dx}>");
3093  outputContainer->Add(fhMCEle2MatchdEdx);
3094 
3095  fhMCChHad1EOverP = new TH2F("hMCChHad1EOverP","TRACK matches #it{E}/#it{p}, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3096  fhMCChHad1EOverP->SetYTitle("#it{E}/#it{p}");
3097  fhMCChHad1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3098  outputContainer->Add(fhMCChHad1EOverP);
3099 
3100  fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
3101  fhMCChHad1dR->SetXTitle("#Delta R (rad)");
3102  outputContainer->Add(fhMCChHad1dR) ;
3103 
3104  fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
3105  fhMCChHad2MatchdEdx->SetXTitle("#it{p} (GeV/#it{c})");
3106  fhMCChHad2MatchdEdx->SetYTitle("#it{dE/dx}>");
3107  outputContainer->Add(fhMCChHad2MatchdEdx);
3108 
3109  fhMCNeutral1EOverP = new TH2F("hMCNeutral1EOverP","TRACK matches #it{E}/#it{p}, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3110  fhMCNeutral1EOverP->SetYTitle("#it{E}/#it{p}");
3111  fhMCNeutral1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3112  outputContainer->Add(fhMCNeutral1EOverP);
3113 
3114  fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
3115  fhMCNeutral1dR->SetXTitle("#Delta #it{R} (rad)");
3116  outputContainer->Add(fhMCNeutral1dR) ;
3117 
3118  fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
3119  fhMCNeutral2MatchdEdx->SetXTitle("#it{p} (GeV/#it{c})");
3120  fhMCNeutral2MatchdEdx->SetYTitle("#it{dE/dx}>");
3121  outputContainer->Add(fhMCNeutral2MatchdEdx);
3122 
3123  fhMCEle1EOverPR02 = new TH2F("hMCEle1EOverPR02","TRACK matches #it{E}/#it{p}, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3124  fhMCEle1EOverPR02->SetYTitle("#it{E}/#it{p}");
3125  fhMCEle1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3126  outputContainer->Add(fhMCEle1EOverPR02);
3127 
3128  fhMCChHad1EOverPR02 = new TH2F("hMCChHad1EOverPR02","TRACK matches #it{E}/#it{p}, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3129  fhMCChHad1EOverPR02->SetYTitle("#it{E}/#it{p}");
3130  fhMCChHad1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3131  outputContainer->Add(fhMCChHad1EOverPR02);
3132 
3133  fhMCNeutral1EOverPR02 = new TH2F("hMCNeutral1EOverPR02","TRACK matches #it{E}/#it{p}, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3134  fhMCNeutral1EOverPR02->SetYTitle("#it{E}/#it{p}");
3135  fhMCNeutral1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3136  outputContainer->Add(fhMCNeutral1EOverPR02);
3137 
3138  fhMCEle1EleEOverP = new TH2F("hMCEle1EleEOverP","Electron candidates #it{E}/#it{p} (60<dEdx<100), MC electrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3139  fhMCEle1EleEOverP->SetYTitle("#it{E}/#it{p}");
3140  fhMCEle1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3141  outputContainer->Add(fhMCEle1EleEOverP);
3142 
3143  fhMCChHad1EleEOverP = new TH2F("hMCEle1EleEOverP","Electron candidates #it{E}/#it{p} (60<dEdx<100), MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3144  fhMCChHad1EleEOverP->SetYTitle("#it{E}/#it{p}");
3145  fhMCChHad1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3146  outputContainer->Add(fhMCChHad1EleEOverP);
3147 
3148  fhMCNeutral1EleEOverP = new TH2F("hMCNeutral1EleEOverP","Electron candidates #it{E}/#it{p} (60<dEdx<100), MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3149  fhMCNeutral1EleEOverP->SetYTitle("#it{E}/#it{p}");
3150  fhMCNeutral1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3151  outputContainer->Add(fhMCNeutral1EleEOverP);
3152  }
3153  }
3154 
3155  // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
3156  // printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
3157 
3158  return outputContainer;
3159 }
3160 
3161 //___________________________________________________________________________________________________________
3167 //___________________________________________________________________________________________________________
3168 void AliAnaCalorimeterQA::InvariantMassHistograms(Int_t iclus, Int_t nModule, const TObjArray* caloClusters,
3169  AliVCaloCells * cells)
3170 {
3171  AliDebug(1,"Start");
3172 
3173  //Get vertex for photon momentum calculation and event selection
3174  Double_t v[3] = {0,0,0}; //vertex ;
3175  //GetReader()->GetVertex(v);
3176 
3177  Int_t nModule2 = -1;
3178  Int_t nCaloClusters = caloClusters->GetEntriesFast();
3179 
3180  Float_t phi1 = fClusterMomentum.Phi();
3181  if(phi1 < 0) phi1 += TMath::TwoPi();
3182 
3183  Double_t tof1 = ((AliVCluster*) caloClusters->At(iclus))->GetTOF()*1.e9;
3184  if(tof1>400) tof1-=fConstantTimeShift;
3185 
3186  for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++)
3187  {
3188  AliVCluster* clus2 = (AliVCluster*) caloClusters->At(jclus);
3189 
3190  Float_t maxCellFraction = 0.;
3191  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus2, maxCellFraction);
3192 
3193  Double_t tof2 = clus2->GetTOF()*1.e9;
3194  if(tof2>400) tof2-=fConstantTimeShift;
3195 
3196  Double_t diffTof = tof1-tof2;
3197 
3198  // Try to reduce background with a mild shower shape cut and no more
3199  // than 1 local maximum in cluster and remove low energy clusters
3200 
3201  if( !IsGoodCluster(absIdMax, clus2->GetM02(), clus2->GetNCells(), cells)
3202  || GetCaloUtils()->GetNumberOfLocalMaxima(clus2,cells) > 1
3203  || clus2->GetM02() > fInvMassMaxM02Cut
3204  || clus2->GetM02() < fInvMassMinM02Cut
3205  || clus2->E() < fInvMassMinECut
3206  || clus2->E() > fInvMassMaxECut
3207  || TMath::Abs(diffTof) > fInvMassMaxTimeDifference
3208  ) continue;
3209 
3210  // Get cluster kinematics
3211  clus2->GetMomentum(fClusterMomentum2,v);
3212 
3213  // Check only certain regions
3214  Bool_t in2 = kTRUE;
3216  if(!in2) continue;
3217 
3218  Float_t pairPt = (fClusterMomentum+fClusterMomentum2).Pt();
3219 
3220  // Opening angle cut, avoid combination of DCal and EMCal clusters
3221  Double_t angle = fClusterMomentum.Angle(fClusterMomentum2.Vect());
3222 
3223  if ( fFillInvMassOpenAngle ) fhOpAngle->Fill(pairPt, angle, GetEventWeight()) ;
3224 
3225  if( angle > fInvMassMaxOpenAngle ) continue;
3226 
3227  // Get module of cluster
3228  nModule2 = GetModuleNumber(clus2);
3229 
3230  // Fill histograms
3232  Float_t asym = TMath::Abs( fClusterMomentum.E() - fClusterMomentum2.E() ) /
3233  ( fClusterMomentum.E() + fClusterMomentum2.E() );
3234 
3235  // All modules
3236  // Combine EMCal or PHOS clusters
3237 
3238  Float_t phi2 = fClusterMomentum2.Phi();
3239  if(phi2 < 0) phi2 += TMath::TwoPi();
3240 
3241  AliDebug(1,Form("Selected pair: pT %f, mass %f, asym %f, angle %f, diffTof %f, SM1 %d, SM2 %d\n",pairPt,mass,asym,angle,diffTof,nModule,nModule2));
3242 
3243  Bool_t inPi0Window = kFALSE;
3244  if(mass < 0.18 && mass > 0.1) inPi0Window = kTRUE ;
3245 
3246  if ( nModule < 12 && nModule2 < 12 )
3247  {
3248  fhIM ->Fill(pairPt, mass, GetEventWeight());
3249 
3250  if( fFillPi0PairDiffTime && inPi0Window )
3251  fhClusterPairDiffTimeEPi0Mass->Fill(pairPt, diffTof, GetEventWeight());
3252 
3253  if ( nModule == nModule2 )
3254  {
3255  fhIMSame->Fill(pairPt, mass, GetEventWeight());
3256 
3257  if( fFillPi0PairDiffTime && inPi0Window )
3258  fhClusterPairDiffTimeEPi0MassSame->Fill(pairPt, diffTof, GetEventWeight());
3259  }
3260  else
3261  {
3262  fhIMDiff->Fill(pairPt, mass, GetEventWeight());
3263  }
3264  }
3265  // Combine DCal clusters
3266  else if ( ( GetCalorimeter() == kEMCAL || GetCalorimeter() == kDCAL ) &&
3267  nModule > 11 && nModule2 > 11 && fNModules > 12 )
3268  {
3269  fhIMDCAL->Fill(pairPt, mass, GetEventWeight());
3270 
3271  if( fFillPi0PairDiffTime && inPi0Window )
3272  fhClusterPairDiffTimeEPi0MassDCal->Fill(pairPt, diffTof, GetEventWeight());
3273 
3274  if ( nModule == nModule2 )
3275  {
3276  fhIMDCALSame->Fill(pairPt, mass, GetEventWeight());
3277 
3278  if( fFillPi0PairDiffTime && inPi0Window )
3279  fhClusterPairDiffTimeEPi0MassDCalSame->Fill(pairPt, diffTof, GetEventWeight());
3280  }
3281  else
3282  {
3283  fhIMDCALDiff->Fill(pairPt, mass, GetEventWeight());
3284  }
3285  }
3286 
3287  if ( fFillInvMassOpenAngle ) fhIMvsOpAngle->Fill(mass, angle, GetEventWeight());
3288 
3289  // Single module
3290  if(nModule == nModule2 && nModule >= 0 && nModule < fNModules)
3291  fhIMMod[nModule]->Fill(pairPt, mass, GetEventWeight());
3292 
3293  // Asymetry histograms
3294  fhAsym->Fill(pairPt, asym, GetEventWeight());
3295  } // 2nd cluster loop
3296 
3297  //
3298  // Combine PHOS and DCal
3299  //
3300 
3301  if( ( GetCalorimeter() == kEMCAL || GetCalorimeter() == kDCAL ) &&
3302  fNModules > 12 && nModule > 11)
3303  {
3304  AliDebug(1,"Check DCal-PHOS pairs\n");
3305 
3306  Int_t sector1 = -1;
3307  Int_t sector2 = -1;
3308 
3309  if(phi1 >= 260*TMath::DegToRad() && phi1 < 280) sector1 = 0;
3310  if(phi1 >= 280*TMath::DegToRad() && phi1 < 300) sector1 = 1;
3311  if(phi1 >= 300*TMath::DegToRad() && phi1 < 320) sector1 = 2;
3312 
3313  for(Int_t jclus = 0 ; jclus < GetPHOSClusters()->GetEntriesFast() ; jclus++)
3314  {
3315  AliVCluster* clus2 = (AliVCluster*) GetPHOSClusters()->At(jclus);
3316 
3317  Float_t maxCellFraction = 0.;
3318  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus2, maxCellFraction);
3319 
3320  // Try to reduce background, remove low energy clusters
3321  if( !IsGoodCluster(absIdMax, clus2->GetM02(), clus2->GetNCells(), cells)
3322  || clus2->E() < fInvMassMinECut
3323  || clus2->E() > fInvMassMaxECut
3324  ) continue;
3325 
3326  // Get cluster kinematics
3327  clus2->GetMomentum(fClusterMomentum2,v);
3328 
3329  // Fill histograms
3330 
3332  Float_t pairPt = (fClusterMomentum+fClusterMomentum2).Pt();
3333  //Float_t asym = TMath::Abs( fClusterMomentum.E() - fClusterMomentum2.E() ) /
3334  //( fClusterMomentum.E() + fClusterMomentum2.E() );
3335 
3336  fhIMDCALPHOS->Fill(pairPt, mass, GetEventWeight());
3337 
3338  Float_t phiPHOS = fClusterMomentum2.Phi();
3339  if(phiPHOS < 0) phiPHOS += TMath::TwoPi();
3340 
3341  if(phiPHOS >= 260*TMath::DegToRad() && phiPHOS < 280) sector2 = 0;
3342  if(phiPHOS >= 280*TMath::DegToRad() && phiPHOS < 300) sector2 = 1;
3343  if(phiPHOS >= 300*TMath::DegToRad() && phiPHOS < 320) sector2 = 2;
3344 
3345  if(sector1 == sector2) fhIMDCALPHOSSame->Fill(pairPt, mass, GetEventWeight());
3346 
3347  } // PHOS cluster loop
3348  } // DCal-PHOS combination
3349 
3350 
3351  // Select EMCal clusters in DCal eta acceptance
3352  // Cross check combination of DCal-PHOS pairs
3353  if( fFillInvMassInEMCALWithPHOSDCalAcc && TMath::Abs(fClusterMomentum.Eta() > 0.22))
3354  {
3355  AliDebug(1,"Check EMCAL(DCal)-EMCAL(PHOS) pairs\n");
3356 
3357  Int_t sector1 = -1;
3358  Int_t sector2 = -1;
3359 
3360  if(phi1 >= 80*TMath::DegToRad() && phi1 < 100) sector1 = 0;
3361  if(phi1 >= 100*TMath::DegToRad() && phi1 < 120) sector1 = 1;
3362  if(phi1 >= 120*TMath::DegToRad() && phi1 < 140) sector1 = 2;
3363  if(phi1 >= 140*TMath::DegToRad() && phi1 < 160) sector1 = 3;
3364  if(phi1 >= 160*TMath::DegToRad() && phi1 < 180) sector1 = 4;
3365  if(phi1 >= 180*TMath::DegToRad() && phi1 < 190) sector1 = 5;
3366 
3367  for(Int_t jclus = 0 ; jclus < caloClusters->GetEntriesFast() ; jclus++)
3368  {
3369  AliVCluster* clus2 = (AliVCluster*) caloClusters->At(jclus);
3370 
3371  Float_t maxCellFraction = 0.;
3372  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus2, maxCellFraction);
3373 
3374  Double_t tof2 = clus2->GetTOF()*1.e9;
3375  if(tof2>400) tof2-=fConstantTimeShift;
3376 
3377  Double_t diffTof = TMath::Abs(tof1-tof2);
3378 
3379  // Try to reduce background with a mild shower shape cut and no more
3380  // than 1 local maximum in cluster and remove low energy clusters
3381  if( !IsGoodCluster(absIdMax, clus2->GetM02(), clus2->GetNCells(), cells)
3382  || GetCaloUtils()->GetNumberOfLocalMaxima(clus2,cells) > 1
3383  || clus2->GetM02() > fInvMassMaxM02Cut
3384  || clus2->GetM02() < fInvMassMinM02Cut
3385  || clus2->E() < fInvMassMinECut
3386  || clus2->E() > fInvMassMaxECut
3387  || TMath::Abs(diffTof) > fInvMassMaxTimeDifference
3388  ) continue;
3389 
3390  // Get cluster kinematics
3391  clus2->GetMomentum(fClusterMomentum2,v);
3392 
3393  // Select EMCal clusters in PHOS acceptance
3394  if(TMath::Abs(fClusterMomentum2.Eta() > 0.13)) continue ;
3395 
3396  // Fill histograms
3397 
3399  Float_t pairPt = (fClusterMomentum+fClusterMomentum2).Pt();
3400  //Float_t asym = TMath::Abs( fClusterMomentum.E() - fClusterMomentum2.E() ) /
3401  //( fClusterMomentum.E() + fClusterMomentum2.E() );
3402 
3403  fhIMEMCALPHOS->Fill(pairPt, mass, GetEventWeight());
3404 
3405  Float_t phiPHOS = fClusterMomentum2.Phi();
3406  if(phiPHOS < 0) phiPHOS += TMath::TwoPi();
3407 
3408  if(phiPHOS >= 80*TMath::DegToRad() && phiPHOS < 100) sector2 = 0;
3409  if(phiPHOS >= 100*TMath::DegToRad() && phiPHOS < 120) sector2 = 1;
3410  if(phiPHOS >= 120*TMath::DegToRad() && phiPHOS < 140) sector2 = 2;
3411  if(phiPHOS >= 140*TMath::DegToRad() && phiPHOS < 160) sector2 = 3;
3412  if(phiPHOS >= 160*TMath::DegToRad() && phiPHOS < 180) sector2 = 4;
3413  if(phiPHOS >= 180*TMath::DegToRad() && phiPHOS < 190) sector2 = 5;
3414 
3415  if(sector1 == sector2) fhIMEMCALPHOSSame->Fill(pairPt, mass, GetEventWeight());
3416 
3417  } // PHOS cluster loop
3418  } // EMCal(DCal)-EMCAL(PHOS) combination
3419 
3420  AliDebug(1,"End");
3421 }
3422 
3423 //______________________________
3425 //______________________________
3427 {
3428  if(GetCalorimeter() != kPHOS && GetCalorimeter() !=kEMCAL)
3429  AliFatal(Form("Wrong calorimeter name <%s>", GetCalorimeterString().Data()));
3430 
3431  //if(GetReader()->GetDataType()== AliCaloTrackReader::kMC)
3432  // AliFatal("Analysis of reconstructed data, MC reader not aplicable");
3433 }
3434 
3435 //________________________________________
3437 //________________________________________
3439 {
3440  AddToHistogramsName("AnaCaloQA_");
3441 
3442  fTimeCutMin = -9999999;
3443  fTimeCutMax = 9999999;
3444 
3445  fEMCALCellAmpMin = 0.2; // 200 MeV
3446  fPHOSCellAmpMin = 0.2; // 200 MeV
3447  fCellAmpMin = 0.2; // 200 MeV
3448 
3449  fEMCALClusterM02Min = 0.05;
3450 
3451  fEMCALClusterNCellMin = 2; // at least 2
3452  fPHOSClusterNCellMin = 3; // at least 3
3453 
3454  fInvMassMinECut = 0.5; // 500 MeV
3455  fInvMassMaxECut = 10;
3456 
3457  fInvMassMinM02Cut = 0.1;
3458  fInvMassMaxM02Cut = 0.4;
3459 
3460  fInvMassMaxTimeDifference = 200; // ns, quite open
3461 
3462  fInvMassMaxOpenAngle = 100*TMath::DegToRad(); // 100 degrees
3463 
3464 // fNEBinCuts = 14;
3465 // fEBinCuts[0] = 0.; fEBinCuts[1] = 0.3; fEBinCuts[2] = 0.5;
3466 // fEBinCuts[3] = 1.; fEBinCuts[4] = 2. ; fEBinCuts[5] = 3. ;
3467 // fEBinCuts[6] = 4.; fEBinCuts[7] = 6. ; fEBinCuts[8] = 8. ;
3468 // fEBinCuts[9] = 10.; fEBinCuts[10]= 12.; fEBinCuts[11]= 16.;
3469 // fEBinCuts[12]= 20.; fEBinCuts[13]= 50.; fEBinCuts[14]= 100.;
3470 // for(Int_t i = fNEBinCuts; i < 15; i++) fEBinCuts[i] = 1000.;
3471 
3472  fNEBinCuts = 7;
3473  fEBinCuts[0] = 2. ; fEBinCuts[1] = 4. ; fEBinCuts[2] = 6. ;
3474  fEBinCuts[3] = 8. ; fEBinCuts[4] = 10.; fEBinCuts[5] = 12.;
3475  fEBinCuts[6] = 16.; fEBinCuts[7] = 20.;
3476  for(Int_t i = fNEBinCuts+1; i < 15; i++) fEBinCuts[i] = 1000.;
3477 }
3478 
3479 //_____________________________________________________________________________
3487 //_____________________________________________________________________________
3489  Int_t nCellsPerCluster, AliVCaloCells* cells)
3490 {
3491  //if(!fStudyBadClusters) return kTRUE;
3492 
3493  if(GetCalorimeter() == kEMCAL)
3494  {
3495 
3496  if( m02 < fEMCALClusterM02Min || nCellsPerCluster < fEMCALClusterNCellMin )
3497  return kFALSE ; // mild shower shape cut for exotics
3498 
3499  if(!GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster())
3500  {
3501  return !(GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(absIdMax,cells,(GetReader()->GetInputEvent())->GetBunchCrossNumber()));
3502  }
3503  else
3504  {
3505  return kTRUE;
3506  }
3507  }
3508  else // PHOS
3509  {
3510  if( m02 < 0.05 || nCellsPerCluster < fPHOSClusterNCellMin ) return kFALSE ; // mild shower shape cut for exotics
3511 
3512  Float_t ampMax = cells->GetCellAmplitude(absIdMax);
3513  GetCaloUtils()->RecalibrateCellAmplitude(ampMax, GetCalorimeter(), absIdMax);
3514 
3515  if(ampMax < 0.01) return kFALSE;
3516 
3517  Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
3518 
3519  if(1-GetCaloUtils()->GetECross(absIdMax,cells,bc)/ampMax > 0.95)
3520  return kFALSE;
3521  else
3522  return kTRUE;
3523  }
3524 }
3525 
3526 //_________________________________________________________
3528 //_________________________________________________________
3530 {
3531  if(! opt)
3532  return;
3533 
3534  printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
3536 
3537  printf("Select Calorimeter %s \n",GetCalorimeterString().Data());
3538  printf("Time Cut: %3.1f < TOF < %3.1f\n" , fTimeCutMin, fTimeCutMax);
3539  printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
3540  printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
3541  printf("EMCAL Min M02 : %2.2f\n" , fEMCALClusterM02Min) ;
3542  printf("EMCAL Min n cells : %d\n" , fEMCALClusterNCellMin) ;
3543  printf("PHOS Min n cells : %d\n" , fPHOSClusterNCellMin) ;
3544 
3545  printf("Inv. Mass %2.1f < E_clus < %2.1f GeV/c\n" , fInvMassMinECut , fInvMassMaxECut ) ;
3546  printf("Inv. Mass %2.1f < M02_clus < %2.1f GeV/c\n", fInvMassMinM02Cut, fInvMassMaxM02Cut) ;
3547  printf("Inv. Mass open angle : %2.1f deg\n" , fInvMassMaxOpenAngle*TMath::RadToDeg()) ;
3548  printf("Inv. Mass time difference: %2.1f ns\n" , fInvMassMaxTimeDifference) ;
3549 }
3550 
3551 //_____________________________________________________
3553 //_____________________________________________________
3555 {
3556  AliDebug(1,"Start");
3557 
3558  //Print("");
3559 
3560  // Play with the MC stack if available
3561  if(IsDataMC()) MCHistograms();
3562 
3563  // Correlate Calorimeters and V0 and track Multiplicity
3564  if(fCorrelate) Correlate();
3565 
3566  // Get List with CaloClusters , calo Cells, init min amplitude
3567  TObjArray * caloClusters = NULL;
3568  AliVCaloCells * cells = 0x0;
3569  if (GetCalorimeter() == kPHOS)
3570  {
3572  caloClusters = GetPHOSClusters();
3573  cells = GetPHOSCells();
3574  }
3575  else if (GetCalorimeter() == kEMCAL)
3576  {
3578  caloClusters = GetEMCALClusters();
3579  cells = GetEMCALCells();
3580  }
3581  else
3582  AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END", GetCalorimeterString().Data()));
3583 
3584  if( !caloClusters || !cells )
3585  {
3586  AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters or CaloCells available"));
3587  return; // trick coverity
3588  }
3589 
3590  if(caloClusters->GetEntriesFast() == 0) return ;
3591 
3592  //printf("QA: N cells %d, N clusters %d \n",cells->GetNumberOfCells(),caloClusters->GetEntriesFast());
3593 
3594  // Clusters
3595  ClusterLoopHistograms(caloClusters,cells);
3596 
3597  // Cells
3598  CellHistograms(cells);
3599 
3600  AliDebug(1,"End");
3601 }
3602 
3603 //______________________________________
3607 //______________________________________
3609 {
3610  if ( !GetMC() ) return;
3611 
3612  Int_t pdg = 0 ;
3613  Int_t status = 0 ;
3614  Int_t nprim = GetMC()->GetNumberOfTracks();
3615 
3616  AliVParticle * primary= 0;
3617 
3618  //printf("N primaries %d\n",nprim);
3619  for(Int_t i=0 ; i < nprim; i++)
3620  {
3621  if ( !GetReader()->AcceptParticleMCLabel( i ) ) continue ;
3622 
3623  // Get the generated particles, check that it is primary (not parton, resonance)
3624  // and get its momentum. Different way to recover from ESD or AOD
3625 
3626  primary = GetMC()->GetTrack(i) ;
3627  if(!primary)
3628  {
3629  AliWarning("Primaries pointer not available!!");
3630  continue;
3631  }
3632 
3633  pdg = primary->PdgCode();
3634  status = primary->MCStatusCode();
3635 
3636  //printf("Input: i %d, %s, pdg %d, status %d \n",i, primStack->GetName(), pdg, status);
3637 
3638  //if (!primAOD->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
3639 
3640  if ( status > 11 ) continue; //Working for PYTHIA and simple generators, check for HERWIG, HIJING?
3641 
3642  // Protection against floating point exception
3643  if ( primary->E() == TMath::Abs(primary->Pz()) ||
3644  (primary->E() - primary->Pz()) < 1e-3 ||
3645  (primary->E() + primary->Pz()) < 0 ) continue ;
3646 
3647  //printf("Take : i %d, %s, pdg %d, status %d \n",i, primStack->GetName(), pdg, status);
3648 
3649  // Photon kinematics
3650  primary->Momentum(fPrimaryMomentum);
3651 
3652  Float_t eMC = fPrimaryMomentum.E();
3653  if(eMC < 0.2) continue;
3654 
3655  Float_t ptMC = fPrimaryMomentum.E();
3656 
3657  Float_t etaMC = fPrimaryMomentum.Eta();
3658 
3659  // Only particles in |eta| < 1
3660  if (TMath::Abs(etaMC) > 1) continue;
3661 
3662  Float_t phiMC = fPrimaryMomentum.Phi();
3663  if(phiMC < 0)
3664  phiMC += TMath::TwoPi();
3665 
3666  Int_t mcIndex = -1;
3667  if (pdg==22) mcIndex = kmcPhoton;
3668  else if (pdg==111) mcIndex = kmcPi0;
3669  else if (pdg==221) mcIndex = kmcEta;
3670  else if (TMath::Abs(pdg)==11) mcIndex = kmcElectron;
3671 
3672  if( mcIndex >=0 )
3673  {
3674  fhGenMCE [mcIndex]->Fill( eMC, GetEventWeight());
3675  fhGenMCPt[mcIndex]->Fill(ptMC, GetEventWeight());
3676  if(eMC > 0.5) fhGenMCEtaPhi[mcIndex]->Fill(etaMC, phiMC, GetEventWeight());
3677 
3678  Bool_t inacceptance = kTRUE;
3679  // Check same fidutial borders as in data analysis on top of real acceptance if real was requested.
3680  if( IsFiducialCutOn() && !GetFiducialCut()->IsInFiducialCut(fPrimaryMomentum.Eta(),fPrimaryMomentum.Phi(),GetCalorimeter()) )
3681  inacceptance = kFALSE ;
3682 
3683  if ( IsRealCaloAcceptanceOn() ) // defined on base class
3684  {
3685  if ( !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance(GetCalorimeter(), primary) ) inacceptance = kFALSE ;
3686  }
3687 
3688  if(!inacceptance) continue;
3689 
3690  fhGenMCAccE [mcIndex]->Fill( eMC, GetEventWeight());
3691  fhGenMCAccPt[mcIndex]->Fill(ptMC, GetEventWeight());
3692  if(eMC > 0.5) fhGenMCAccEtaPhi[mcIndex]->Fill(etaMC, phiMC, GetEventWeight());
3693  }
3694  }
3695 }
3696 
3697 
Int_t charge
Float_t GetHistoZMax() const
TH2F * fhCaloV0MCorrEClusters
! Calo vs V0 multiplicity, total measured cluster energy
Float_t GetHistoPtMax() const
TH2F * fhTimeIdLowGain
! Time vs Absolute cell Id, low gain
TH2F * fhDeltaCellClusterRE
! R cluster - R cell distribution (cm) vs cluster energy
Bool_t IsGoodCluster(Int_t absIdMax, Float_t m02, Int_t nCellsPerCluster, AliVCaloCells *cells)
TH2F * fhDCALPHOSCorrNCells
! DCAL vs PHOS, number of cells
Int_t pdg
TH2F * fhNCellsPerClusterNoCut
! N cells per cluster vs cluster energy, before cuts
TH2F * fhMCNeutral1EOverPR02
! p/E for track-cluster matches, dR < 0.2, MC neutral
TH2F * fhNCellsMod
! Number of towers/crystals with signal for different module, Reco
TH3F * fhXYZ
! cluster X vs Y vs Z (cm)
TH2F * fh1EOverPMod
! p/E for track-cluster matches, per SM
TH2F * fh1EOverPR02Mod
! p/E for track-cluster matches, dR < 0.2, per SM
Int_t GetHistoNClusterCellMin() const
TH2F * fhDeltaCellClusterYNCells
! Y cluster - Y cell distribution (cm) vs N cells in cluster
TH1F * fhPt
! pT distribution, Reco
Float_t GetHistoPtMin() const
Int_t GetHistoFinePtBins() const
TH2F * fhClusterMaxCellECross
! 1 - Energy in cross around max energy cell / max energy cell vs cluster energy, good clusters ...
const Double_t ymax
Definition: AddTaskCFDStar.C:7
Bool_t IsMCParticleInCalorimeterAcceptance(Int_t calo, AliVParticle *particle)
Check that a MC AOD is in the calorimeter acceptance.
Int_t fNMaxColsFull
Number of EMCAL/PHOS columns full detector.
Bool_t fFillPi0PairDiffTime
Fill time difference histograms of cluster pairs in pi0 mass window, only if fFillAllPi0Histo=kTRUE.
double Double_t
Definition: External.C:58
Int_t GetHistoShowerShapeBins() const
Definition: External.C:260
TH2F * fhGridCellsE
! Cells ordered in column/row for different module, weighted with energy, Reco
TH1F * fhPtCharged
! pT distribution, Reco, matched with track
Float_t GetHistodEdxMax() const
TH2F * fhClusterMaxCellDiff
! Difference between cluster energy and energy of cell with more energy, good clusters only ...
virtual void AddToHistogramsName(TString add)
virtual AliVCaloCells * GetEMCALCells() const
TH2F * fh2dR
! distance between projected track and cluster (eta-phi units)
Float_t fInvMassMinECut
Minimum energy cut value for clusters entering the invariant mass calculation.
TH2F * fh2dRMod
! distance between projected track and cluster (eta-phi units), per SM
Definition: External.C:236
Int_t GetHistoNCellsMin() const
TH2F * fhBadClusterEtaPhi
! Time Max cell of bad cluster
Float_t fEMCALCellAmpMin
Amplitude Threshold on EMCal cells.
TH2F * fhIMDCALPHOS
! Cluster pairs invariant mass vs pair pT, for DCal-PHOS pairs
TH1F * fhEta
! eta distribution, Reco
TH2F * fhTimeMod
! Cell time distribution for different module, Reco
TH2F * fhMCChHad1EleEOverP
! p/E for track-cluster matches, dR < 0.2, 60 < dEdx < 100, MC charged hadrons
TH2F * fh2MatchdEdxMod
! dE/dx for all matches, per SM
TH2F * fh2EledEdx
! dE/dx vs. momentum for electron candidates
TH2F * fhTrackMatchedDPhiNeg
! Phi distance between track and cluster vs cluster E, after and before photon cuts ...
virtual Int_t GetModuleNumberCellIndexesAbsCaloMap(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU, Int_t &icolAbs, Int_t &irowAbs) const
TH2F * fhSumCellsAmpMod
! Sum of towers/crystals signal for different module, Reco
Int_t fLastModule
Last EMCAL/PHOS module, set in CaloUtils or depending fidutial cuts.
AliEMCALRecoUtils * GetEMCALRecoUtils() const
Bool_t fFillInvMassOpenAngle
Fill opening angle histograms of cluster pairs, only if fFillAllPi0Histo=kTRUE.
Int_t GetHistoTrackMultiplicityMax() const
TH2F * fhCaloTrackMCorrNClusters
! Calo vs Track Multiplicity, number of clusters
Float_t GetECross(Int_t absId, AliVCaloCells *cells, Int_t bc)
Float_t GetPhi(Float_t phi) const
Shift phi angle in case of negative value 360 degrees. Example TLorenzVector::Phi defined in -pi to p...
TH3F * fhEtaPhiE
! eta vs phi vs E, Reco
Float_t GetHistoVertexDistMin() const
Float_t fPHOSCellAmpMin
Amplitude Threshold on PHOS cells.
TH1F * fhBadClusterEnergy
! Energy of bad cluster
virtual AliVEvent * GetInputEvent() const
TH2F * fhRecoMCRatioE[7][2]
! Reco/Gen E generated particle vs reconstructed E
Double_t mass
TH2F * fhCaloCenECells
! Calo vs centrality, total measured cell energy
TH2F * fhIMDCALDiff
! Cluster pairs invariant mass vs pair pT, for DCal pairs
TH2F ** fhNClustersSumEnergyPerMod
! N clusters vs sum of energies in different module, Reco
energy
Definition: HFPtSpectrum.C:44
TH2F * fhEMCALDCALCorrEClusters
! EMCAL vs DCAL, total measured cluster energy
TH1F * fhGenMCAccE[4]
! pt of primary particle, in acceptance
TH2F * fhXNCells
! X (cm) cluster distribution vs N cells in cluster
TH2F * fhRCellE
! R=sqrt(x^2+y^2) (cm) cell distribution vs cell energy
TH1F * fhGenMCPt[4]
! pt of primary particle
TH2F * fhClusterPairDiffTimeESameMod
! Pair of clusters time difference vs E, in same Mod
Float_t GetHistodRMax() const
Int_t fNModules
Number of EMCAL/PHOS modules to use in analysis, set in CaloUtils.
virtual Double_t GetEventPlaneAngle() const
void ClusterMatchedWithTrackHistograms(AliVCluster *clus, Bool_t mcOK, Int_t pdg)
TH2F * fhEtaPhi
! eta-phi distribution, Reco
TH2F * fhIMSame
! Cluster pairs invariant mass vs pair pT, for EMCAL or PHOS pairs
TH1F * fhGenMCAccPt[4]
! pt of primary particle, in acceptance
Float_t GetHistoXMin() const
Bool_t fFillAllCellAbsIdHistograms
Fill all cell related histograms where one axis is the cell absId.
TH2F * fhNLocMaxStd
! Cluster Number of local Maxima, stored
Double_t fTimeCutMax
Remove clusters/cells with time larger than this value, in ns.
Float_t fCellAmpMin
Amplitude Threshold on calorimeter cells, set at execution time.
TH2F * fhIMEMCALPHOSSame
! Cluster pairs invariant mass vs pair pT, for EMCAL(DCal eta acceptance)-EMCAL (PHOS eta acceptance)...
TH2F * fhCaloEvPECells
! Calo vs event plane angle, total measured cell energy
virtual Int_t GetV0Multiplicity(Int_t i) const
Int_t fNMaxCols
Number of EMCAL/PHOS columns per SM.
TH1F * fhNCellsCutAmpMin
! Number of towers/crystals with signal, with min amplitude
Bool_t IsTrackMatched(AliVCluster *cluster, AliCalorimeterUtils *cu, AliVEvent *event)
void Init()
Check if the calorimeter setting is ok, if not abort.
Int_t GetHistoMassBins() const
TH2F ** fhNCellsPerClusterModNoCut
! N cells per clusters different module, Reco, No cut
Int_t GetHistoPhiBins() const
TH2F * fhClusterMaxCellCloseCellRatio
! Ratio between max cell energy and cell energy of the same cluster
void InvariantMassHistograms(Int_t iclus, Int_t nModule, const TObjArray *caloClusters, AliVCaloCells *cells)
TH2F * fhRecoMCDeltaE[7][2]
! Gen-Reco E generated particle vs reconstructed E
TH2F ** fhTimeAmpPerRCU
! Time vs Amplitude measured in towers/crystals different RCU
Class for the Calorimeter QA analysis.
Float_t fInvMassMaxECut
Maximum energy cut value for clusters entering the invariant mass calculation.
Float_t GetHistoMassMin() const
Bool_t fFillAllPosHisto
Fill all the position related histograms.
void AddStep(Double_t max, Double_t binwidth)
TH2F * fhEMCALPHOSCorrEClusters
! EMCAL vs PHOS, total measured cluster energy
Float_t fEBinCuts[15]
Energy bins cut.
TH2F * fhNCellsPerClusterWeirdModNoCut
! N cells per clusters different module, Reco, No cut, ridiculously large energy
Bool_t fFillAllTH3
Fill TH3 histograms.
Int_t GetHistoXBins() const
Int_t GetHistoV0SignalBins() const
TH2F * fhClusterTimeEnergy
! Cluster Time vs Energy
TH2F * fhDeltaCellClusterRNCells
! R cluster - R cell distribution (cm) vs N cells in cluster
Int_t GetHistoTrackMultiplicityMin() const
Bool_t IsExoticCell(Int_t absId, AliVCaloCells *cells, Int_t bc=-1)
TH1F * fhMCChHad1dR
! distance between projected track and cluster, MC charged hadrons
TH1F * fhTime
! Time measured in towers/crystals
Int_t fFirstModule
First EMCAL/PHOS module, set in CaloUtils or depending fidutial cuts.
TH2F * fhCaloCenNClusters
! Calo vs centrality, number of clusters
Float_t GetHistoTrackResidualPhiMin() const
TH2F * fhBadClusterMaxCellDiff
! Difference between cluster energy and energy of cell with more energy
TH2F * fhBadClusterMaxCellECross
! 1 - Energy in cross around max energy cell / max energy cell vs cluster energy, bad clusters ...
Float_t GetHistoTrackResidualEtaMin() const
TH2F * fhTrackMatchedDEtaDPhiNeg
! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV, after and before ...
Int_t GetHistoNClusterCellBins() const
TH1F * fhPhiCharged
! phi distribution, Reco, matched with track
TH2F * fh1EOverPR02
! p/E for track-cluster matches, dR < 0.2
TH2F * fhMCEle1EleEOverP
! p/E for track-cluster matches, dR < 0.2, 60 < dEdx < 100, MC electrons
TH2F * fhBadClusterMaxCellCloseCellDiff
! Difference between max cell energy and cell energy of the same cluster for bad clusters ...
Float_t GetHistoYMax() const
Float_t GetHistoDiffTimeMin() const
void MakeAnalysisFillHistograms()
Main task method, call all the methods filling QA histograms.
TH2F * fhCellECross
! 1 - Energy in cross around cell / cell energy
TH2F * fhClusterPairDiffTimeE
! Pair of clusters time difference vs E
Int_t GetHistoPOverEBins() const
TH2F * fhClusterPairDiffTimeEPi0Mass
! EMCal/PHOS Cluster time TOF difference, for pairs in 0.1 < mass < 0.18
TH2F * fhBadClusterMaxCellCloseCellRatio
! Ratio between max cell energy and cell energy of the same cluster for bad clusters ...
Float_t GetHistoPhiMin() const
Float_t GetHistoDiffTimeMax() const
TH1F * fhCellIdCellLargeTimeSpread
! Cells with large time respect to max (diff > 100 ns)
Int_t GetHistoVertexDistBins() const
TH2F * fhEMCALPHOSCorrNClusters
! EMCAL vs PHOS, number of clusters
TH2F * fhIMDCALSame
! Cluster pairs invariant mass vs pair pT, for DCal pairs
TH2F * fhCaloTrackMCorrEClusters
! Calo vs Track Multiplicity, total measured cluster energy
TH2F * fhZNCells
! Z (cm) cluster distribution vs N cells in cluster
Int_t GetHistoZBins() const
TH1F * fhE
! E distribution, Reco
TH2F * fhTrackMatchedDPhiPosMod
! Phi distance between positive track and cluster vs module for E > 0.5 GeV
TH2F * fhDeltaCellClusterYE
! Y cluster - Y cell distribution (cm) vs cluster energy
TH2F * fhEBinCellColRow[14]
! Column and row location of cell in different energy bins.
TH2F * fhZE
! Z (cm) cluster distribution vs cluster energy
TH2F * fhEMCALDCALCorrNClusters
! EMCAL vs DCAL, number of clusters
TH1F * fhEtaCharged
! eta-phi distribution, Reco, matched with track
Bool_t fFillAllPi0Histo
Fill invariant mass histograms.
TH2F * fhTimePerSMPerBC[4]
! Time vs SM number for BC%4=0,1,2,3
Float_t GetCellWeight(Float_t eCell, Float_t eCluster) const
const Double_t etamin
Float_t GetHistoAsymmetryMax() const
Float_t GetHistoMassMax() const
TH1F * fhPhi
! phi distribution, Reco
Base class for CaloTrackCorr analysis algorithms.
Bool_t fFillAllClusterHistograms
Fill all cluster related histograms.
virtual TString GetCalorimeterString() const
Bool_t fFillInvMassInEMCALWithPHOSDCalAcc
Fill invariant mass histograms of EMCal clusters in DCal and PHOS eta acceptance each, only if fFillAllPi0Histo=kTRUE.
TH2F * fhBadClusterPairDiffTimeE
! Pair of clusters time difference vs E, bad cluster
TLorentzVector fClusterMomentum
! Cluster momentum, temporary container
TH2F * fhEtaPhiCharged
! eta distribution, Reco, matched with track
TH2F * fhRecoMCDeltaPhi[7][2]
! Gen-Reco phi generated particle vs reconstructed E
virtual Bool_t IsRealCaloAcceptanceOn() const
Float_t GetHistodEdxMin() const
TLorentzVector fClusterMomentum2
! Cluster momentum, temporary container
virtual AliFiducialCut * GetFiducialCut()
int Int_t
Definition: External.C:63
TH2F * fhClusterMaxCellDiffNoCut
! Difference between cluster energy and energy of cell with more energy, no bad cluster rejection ...
virtual AliHistogramRanges * GetHistogramRanges()
TH2F * fhMCNeutral2MatchdEdx
! dE/dx vs. momentum for all matches, MC neutral
Float_t fEMCALClusterM02Min
Minimum M02 on EMCal clusters.
TH2F * fhCaloCenEClusters
! Calo vs centrality, total measured cluster energy
Int_t GetHistoDiffTimeBins() const
TH2F * fhNLocMax
! Cluster Number of local Maxima, from CaloUtils
float Float_t
Definition: External.C:68
TH3F * fhEtaPhiECharged
! eta vs phi vs E, Reco, matched with track
TH2F * fhBadCellTimeSpreadRespectToCellMax
! Difference of the time of cell with maximum dep energy and the rest of cells for bad clusters ...
TH2F * fhDeltaCellClusterXE
! X cluster - X cell distribution (cm) vs cluster energy
Float_t GetHistoTrackResidualPhiMax() const
TH2F * fhEMCALPHOSCorrNCells
! EMCAL vs PHOS, number of cells
TH2F * fhEtaPhiCell
! eta vs phi, cells
Int_t GetHistoAsymmetryBins() const
const Double_t ptmax
Float_t fInvMassMinM02Cut
Minimum M02 shower shape cut value for clusters entering the invariant mass calculation.
Double_t fTimeCutMin
Remove clusters/cells with time smaller than this value, in ns.
Float_t GetHistoRMin() const
virtual AliEMCALGeometry * GetEMCALGeometry() const
Int_t fNEBinCuts
Number of energy bin cuts.
Float_t GetHistoRMax() const
Bool_t fFillClusterMaxCellHisto
Fill cluster cell max histograms.
TH2F * fhTrackMatchedDPhiNegMod
! Phi distance between negative track and cluster vs module for E > 0.5 GeV
void InitParameters()
Initialize the parameters of the analysis.
TH2F * fhNCellsPerCluster
! N cells per cluster vs cluster energy
TH2F * fhNCellsPerClusterWeirdMod
! N cells per clusters different module, Reco, ridiculously large energy
TH2F * fhGenMCAccEtaPhi[4]
! eta vs phi of primary particle, in acceptance
Bool_t IsInFiducialCut(Float_t eta, Float_t phi, Int_t det) const
TH2F * fhAmpMod
! Cell amplitude distribution for different module, Reco
const Double_t zmin
TH2F * fhCaloV0SCorrNCells
! Calo vs V0 signal, number of cells
Int_t GetHistoV0MultiplicityBins() const
TH2F ** fhIMMod
! cluster pairs invariant mass, different module,
TH2F ** fhNCellsPerClusterMod
! N cells per clusters different module, Reco
TH2F * fhTrackMatchedDEtaPos
! Eta distance between track and cluster vs cluster E, after and before photon cuts ...
Int_t GetHistoV0SignalMin() const
Helper class creating user defined custom binning.
Int_t GetHistoV0MultiplicityMin() const
Float_t GetHistoShowerShapeMin() const
TH3F * fhEtaPhiAmpCell
! eta vs phi vs amplitude, cells
TH2F * fh1EleEOverPMod
! p/E for track-cluster matches, dR < 0.2, 60 < dEdx < 100, per SM
TH2F * fhCaloEvPNCells
! Calo vs event plane angle, number of cells
TH2F * fhBadClusterLambda0
! Cluster Lambda0 vs Energy, clusters declared bad
Float_t GetHistoXMax() const
TH2F * fhClusterPairDiffTimeEPi0MassDCalSame
! DCal Cluster time TOF difference, for pairs in 0.1 < mass < 0.18, pairs in same Module ...
TH2F * fhRecoMCPhi[7][2]
! phi generated particle vs reconstructed phi
Int_t GetHistodEdxBins() const
TH2F * fhTimeId
! Time vs Absolute cell Id
virtual AliCalorimeterUtils * GetCaloUtils() const
TH2F * fh1EOverP
! p/E for track-cluster matches
Int_t fNMaxRowsFullMin
Last of EMCAL/PHOS rows full detector.
Int_t GetHistoNClusterCellMax() const
TH2F * fhIMvsOpAngle
! Cluster pairs opening angle vs mass
TH2F * fhRecoMCEta[7][2]
! eta generated particle vs reconstructed Eta
Int_t GetHistoTrackResidualEtaBins() const
TH2F * fh2EledEdxMod
! dE/dx for electron candidates, per SM
TH2F * fhBadClusterLambda1
! Cluster Lambda1 vs Energy, clusters declared bad
TH2F * fhMCEle1EOverPR02
! p/E for track-cluster matches, dR < 0.2, MC electrons
Int_t fEMCALClusterNCellMin
Minimum number of cells on EMCal clusters.
Int_t GetHistoTrackResidualPhiBins() const
TH1F * fhNClusters
! Number of clusters
virtual AliPHOSGeoUtils * GetPHOSGeometry() const
TH2F * fhMCEle1EOverP
! p/E for track-cluster matches, MC electrons
const Double_t ptmin
TH1F * fhMCEle1dR
! distance between projected track and cluster, MC electrons
virtual Int_t GetV0Signal(Int_t i) const
TH2F * fhOpAngle
! Cluster pairs opening angle vs pair pT
TH1F * fhGenMCE[4]
! pt of primary particle
TH2F * fhIMDiff
! Cluster pairs invariant mass vs pair pT, for EMCAL or PHOS pairs
TH2F * fhEMR
! Electromagnetic distance to vertex vs rec energy
virtual Double_t GetEventWeight() const
TH2F * fhClusterPairDiffTimeEPi0MassDCal
! DCal Cluster time TOF difference, for pairs in 0.1 < mass < 0.18
TH2F * fhCaloTrackMCorrNCells
! Calo vs V0 Track Multiplicity, number of cells
Int_t GetNumberOfLocalMaxima(AliVCluster *cluster, AliVCaloCells *cells)
Find the number of local maxima in cluster.
Int_t GetHistoTrackMultiplicityBins() const
TH2F * fhIMDCALPHOSSame
! Cluster pairs invariant mass vs pair pT, for DCal-PHOS pairs
TH2F * fhDeltaCellClusterXNCells
! X cluster - X cell distribution (cm) vs N cells in cluster
TH2F * fhTrackMatchedDEtaDPhiPos
! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV, after and before ...
TH2F * fhEBinClusterEtaPhi[14]
! Eta-Phi location of cluster in different energy bins.
TH1F * fhNCells
! Number of towers/crystals with signal
TH2F * fhIMDCAL
! Cluster pairs invariant mass vs pair pT, for DCal pairs
TH2F * fhTrackMatchedDPhiPos
! Phi distance between track and cluster vs cluster E, after and before photon cuts ...
TH2F * fhCaloEvPNClusters
! Calo vs event plane angle, number of clusters
virtual TObjArray * GetPHOSClusters() const
TH2F * fhDCALPHOSCorrNClusters
! DCAL vs PHOS, number of clusters
Int_t GetHistoRBins() const
Float_t GetHistoEtaMin() const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH2F * fhXCellE
! X (cm) cell distribution vs cell energy
TH2F * fhIMEMCALPHOS
! Cluster pairs invariant mass vs pair pT, for EMCAL(DCal eta acceptance)-EMCAL (PHOS eta acceptance)...
TH2F * fhHaR
! Hadron distance to vertex vs rec energy
TH2F * fhAmpWeirdMod
! Cell amplitude distribution for different module, very large Amp, Reco
TH2F * fhRE
! R=sqrt(x^2+y^2) (cm) cluster distribution vs cluster energy
Int_t GetHistoNClustersMin() const
virtual void CreateBinEdges(TArrayD &edges) const
TH2F * fhIM
! Cluster pairs invariant mass vs pair pT, for EMCAL or PHOS pairs
Float_t GetHistoVertexDistMax() const
TH2F * fhTimeAmp
! Time vs Amplitude
Float_t GetHistoZMin() const
void CalculateAverageTime(AliVCluster *clus, AliVCaloCells *cells, Double_t timeAverages[2])
TH2F * fhMCEle2MatchdEdx
! dE/dx vs. momentum for all matches, MC electrons
Int_t GetHistoYBins() const
Int_t GetHistoNClustersBins() const
TH1F * fhECharged
! E distribution, Reco, matched with track
TH2F * fhNClustersMod
! Number of clusters for different module, Reco
Int_t fNRCU
Number of EMCAL/PHOS RCU.
TH2F * fhHaVxyz
! Hadron production vertex
TH2F * fhAmpId
! Amplitude measured in towers/crystals vs id of tower.
TH2F * fhCaloV0SCorrECells
! Calo vs V0 signal, total measured cell energy
Float_t GetHistoEtaMax() const
Float_t GetHistodRMin() const
TH1F * fhAmplitude
! Amplitude measured in towers/crystals
Int_t GetHistoPtBins() const
TH2F * fhEMod
! Cluster E distribution for different module, Reco
TH2F * fhRNCells
! R=sqrt(x^2+y^2) (cm) cluster distribution vs N cells in cluster
Int_t fPHOSClusterNCellMin
Minimum number of cells on PHOS clusters.
TH2F * fhTrackMatchedDEtaNeg
! Eta distance between track and cluster vs cluster E, after and before photon cuts ...
TH2F * fhZCellE
! Z (cm) cell distribution vs cell energy
TH2F * fhGridCellsTime
! Cells ordered in column/row for different module, weighted with time, Reco
AliVTrack * GetMatchedTrack(AliVCluster *cluster, AliVEvent *event, Int_t index=-1) const
TH2F * fhEBinClusterColRow[14]
! Column and row location of cluster max E cell in different energy bins.
void RecalibrateCellTimeL1Phase(Double_t &time, Int_t calo, Int_t iSM, Int_t bunchCrossNumber) const
Recalculate time L1 phase shift if time recalibration available for EMCAL.
TH3F * fhXYZCell
! cell X vs Y vs Z (cm)
Float_t fInvMassMaxOpenAngle
Combine clusters within with a maximum opening angle between them. In radians.
TLorentzVector fPrimaryMomentum
! Primary MC momentum, temporary container
virtual Int_t GetModuleNumber(AliCaloTrackParticle *part) const
Float_t GetHistoPOverEMax() const
TH2F * fhCaloEvPEClusters
! Calo vs event plane angle, total measured cluster energy
Bool_t fCorrelate
Correlate PHOS/EMCAL cells/clusters, also with V0 and track multiplicity.
Bool_t fFillAllCellTimeHisto
Fill all cell time histo.
TH2F * fhTrackMatchedDEtaPosMod
! Eta distance between positive track and cluster vs module for E > 0.5 GeV
TH2F * fhDeltaCellClusterZNCells
! Z cluster - Z cell distribution (cm) vs N cells in cluster
void ClusterHistograms(AliVCluster *cluster, const TObjArray *caloClusters, AliVCaloCells *cells, Int_t absIdMax, Double_t maxCellFraction, Float_t eCrossFrac, Double_t tmax)
Bool_t fFillAllPosHisto2
Fill all the position related histograms 2.
const Double_t etamax
TObjString * GetAnalysisCuts()
Save parameters used for analysis in a string.
void RecalibrateCellAmplitude(Float_t &amp, Int_t calo, Int_t absId) const
Recalculate cell energy if recalibration factor.
TH2F * fhYCellE
! Y (cm) cell distribution vs cell energy
Int_t GetHistoV0MultiplicityMax() const
virtual AliMCAnalysisUtils * GetMCAnalysisUtils()
Float_t GetHistoAsymmetryMin() const
Int_t GetHistoV0SignalMax() const
const Double_t ymin
Definition: AddTaskCFDStar.C:6
TH2F * fhCaloV0MCorrNClusters
! Calo vs V0 multiplicity , number of clusters
TH2F * fh1EleEOverP
! p/E for track-cluster matches, dR < 0.2, 60 < dEdx < 100
Int_t GetHistoNCellsMax() const
virtual void Print(const Option_t *) const
Print some relevant parameters set for the analysis.
TH2F ** fhNCellsSumAmpPerMod
! N cells vs sum of amplitude in different modules, Reco
Int_t GetHistoTimeBins() const
Float_t GetHistoPOverEMin() const
unsigned short UShort_t
Definition: External.C:28
TH2F * fhDeltaCellClusterZE
! Z cluster - Z cell distribution (cm) vs cluster energy
Float_t GetHistoFinePtMin() const
TH2F * fhAmpIdLowGain
! Amplitude measured in towers/crystals vs id of tower, low gain towers
void CellInClusterPositionHistograms(AliVCluster *cluster)
Bool_t ClusterMCHistograms(Bool_t matched, const Int_t *labels, Int_t nLabels, Int_t &pdg)
TH2F * fhGridCellsELowGain
! Cells ordered in column/row for different module, weighted with energy, Reco, low gain ...
TH2F * fh2MatchdEdx
! dE/dx vs. momentum for all matches
void BadClusterHistograms(AliVCluster *clus, const TObjArray *caloClusters, AliVCaloCells *cells, Int_t absIdMax, Double_t maxCellFraction, Float_t eCrossFrac, Double_t tmax)
const char Option_t
Definition: External.C:48
Float_t GetHistoTimeMax() const
Float_t GetHistoTimeMin() const
Float_t GetHistoShowerShapeMax() const
TH2F * fhMCChHad1EOverP
! p/E for track-cluster matches, MC charged hadrons
TH2F * fhRecoMCDeltaEta[7][2]
! Gen-Reco eta generated particle vs reconstructed E
TH2F * fhMCChHad2MatchdEdx
! dE/dx vs. momentum for all matches, MC charged
TH2F * fhClusterMaxCellCloseCellDiff
! Difference between max cell energy and cell energy of the same cluster
TH2F * fhXE
! X (cm) cluster distribution vs cluster energy
const Double_t zmax
TH2F * fhGridCells
! Cells ordered in column/row for different module, Reco
Float_t GetHistoPhiMax() const
Int_t GetHistoNCellsBins() const
TH2F * fhGridCellsTimeLowGain
! Cells ordered in column/row for different module, weighted with time, Reco, low gain ...
TH2F * fhCaloTrackMCorrECells
! Calo vs V0 Track Multipliticy, total measured cell energy
bool Bool_t
Definition: External.C:53
virtual AliCaloTrackReader * GetReader() const
Float_t fInvMassMaxM02Cut
Maximum M02 shower shape cut value for clusters entering the invariant mass calculation.
Int_t fNMaxRowsFullMax
First of EMCAL/PHOS rows full detector.
TH2F * fhEMVxyz
! Electromagnetic particle production vertex
Int_t GetHistoEtaBins() const
Int_t CheckOrigin(Int_t label, AliMCEvent *mcevent, TString selectHeaderName)
TH2F * fhLambda0
! Cluster Lambda0 vs Energy
void CellHistograms(AliVCaloCells *cells)
TH2F * fhCaloV0MCorrECells
! Calo vs V0 multiplicity, total measured cell energy
Float_t GetHistoTrackResidualEtaMax() const
TH2F * fhEMCALDCALCorrNCells
! EMCAL vs DCAL, number of cells
TH2F * fhMCNeutral1EleEOverP
! p/E for track-cluster matches, dR < 0.2, 60 < dEdx < 100, MC neutral
virtual TObjArray * GetEMCALClusters() const
TH2F * fhClusterPairDiffTimeEPi0MassSame
! EMCal/PHOS Cluster time TOF difference, for pairs in 0.1 < mass < 0.18, pairs in same Module ...
Float_t GetHistoFinePtMax() const
TH2F * fhYE
! Y (cm) cluster distribution vs cluster energy
virtual AliVCaloCells * GetPHOSCells() const
TH1F * fhMCNeutral1dR
! Distance between projected track and cluster, MC neutral
Float_t GetHistoYMin() const
TH2F * fhBadClusterTimeEnergy
! Time Max cell of bad cluster
TH2F * fhCaloV0SCorrEClusters
! Calo vs V0 signal, total measured cluster energy
Bool_t fFillAllCellHistograms
Fill all cell related histograms.
TH2F * fhDCALPHOSCorrEClusters
! DCAL vs PHOS, total measured cluster energy
Bool_t fStudyBadClusters
Study bad clusters not passing selection criteria (exotic, shower shape, n cells).
TH2F * fhCaloCenNCells
! Calo vs centrality, number of cells
TH2F * fhYNCells
! Y (cm) cluster distribution vs N cells in cluster
void RecalibrateCellTime(Double_t &time, Int_t calo, Int_t absId, Int_t bunchCrossNumber) const
Recalculate time if time recalibration available for EMCAL not ready for PHOS.
Int_t GetMaxEnergyCell(AliVCaloCells *cells, AliVCluster *clu, Float_t &fraction) const
For a given CaloCluster, it gets the absId of the cell with maximum energy deposit.
TH2F * fhCaloV0MCorrNCells
! Calo vs V0 multiplicity, number of cells
TH2F * fhMCNeutral1EOverP
! p/E for track-cluster matches, MC neutral
TH2F * fhMCChHad1EOverPR02
! p/E for track-cluster matches, dR < 0.2, MC charged hadrons
Int_t nptbins
Int_t GetHistodRBins() const
TH2F * fhGridCellsLowGain
! Cells ordered in column/row for different module, Reco, low gain
TH2F * fhAsym
! Cluster pairs invariant mass vs pair pT
TH2F * fhRecoMCE[7][2]
! E generated particle vs reconstructed E
TH2F * fhTrackMatchedDEtaNegMod
! Eta distance between negative track and cluster vs module for E > 0.5 GeV
TH2F * fhEMCALPHOSCorrECells
! EMCAL vs PHOS, total measured cell energy
Int_t GetHistoNClustersMax() const
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
TH2F * fhTimeAmpLowGain
! Time vs Amplitude, low gain
void ClusterLoopHistograms(const TObjArray *clusters, AliVCaloCells *cells)
TH2F * fhDCALPHOSCorrECells
! DCAL vs PHOS, total measured cell energy
Bool_t fFillEBinAcceptanceHisto
Fill histograms with cluster eta-phi distribution and column-row cell, for different energy bins...
const Double_t phimin
TH2F * fhEMCALDCALCorrECells
! EMCAL vs DCAL, total measured cell energy
Float_t fInvMassMaxTimeDifference
Maximum difference between the time of the 2 clusters to be considered in invariant mass...
TH2F * fhEWeirdMod
! Cluster E distribution for different module, very large E, Reco
TH2F * fhCellTimeSpreadRespectToCellMax
! Difference of the time of cell with maximum dep energy and the rest of cells
Bool_t fFillAllTMHisto
Fill track matching histograms.
TH2F * fhSumClustersEnergyMod
! Sum of clusters energy for different module, Reco
void SetMinimum(Double_t min)
TH2F * fhTimeL1UnCorrId
! Time (not corrected for L1 phase) vs Absolute cell Id
Int_t fNMaxRows
Number of EMCAL/PHOS rows per SM.
TH2F * fhCaloV0SCorrNClusters
! Calo vs V0 signal , number of clusters
TH2F * fhGenMCEtaPhi[4]
! eta vs phi of primary particle
TH2F * fhLambda1
! Cluster Lambda1 vs Energy
Float_t fConstantTimeShift
Apply a 600 ns time shift in case of simulation, shift in ns.