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