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