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