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