AliPhysics  251aa1e (251aa1e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnaPhoton.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 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 <TH2F.h>
18 #include <TClonesArray.h>
19 #include <TObjString.h>
20 #include "TParticle.h"
21 #include "TDatabasePDG.h"
22 
23 // --- Analysis system ---
24 #include "AliAnaPhoton.h"
25 #include "AliCaloTrackReader.h"
26 #include "AliStack.h"
27 #include "AliCaloPID.h"
28 #include "AliMCAnalysisUtils.h"
29 #include "AliFiducialCut.h"
30 #include "AliVCluster.h"
31 #include "AliAODMCParticle.h"
32 #include "AliMixedEvent.h"
33 #include "AliAODEvent.h"
34 #include "AliESDEvent.h"
35 #include "AliMCEvent.h"
36 
37 // --- Detectors ---
38 #include "AliPHOSGeoUtils.h"
39 #include "AliEMCALGeometry.h"
40 
44 
45 //____________________________
48 //____________________________
51 fMinDist(0.), fMinDist2(0.), fMinDist3(0.),
52 fRejectTrackMatch(0), fFillTMHisto(kFALSE),
53 fTimeCutMin(-10000), fTimeCutMax(10000),
54 fNCellsCut(0),
55 fNLMCutMin(-1), fNLMCutMax(10),
56 fFillSSHistograms(0), fFillEMCALRegionSSHistograms(0),
57 fFillConversionVertexHisto(0),fFillOnlySimpleSSHisto(1),
58 fFillSSNLocMaxHisto(0),
59 fNOriginHistograms(9), fNPrimaryHistograms(5),
60 fMomentum(), fMomentum2(),
61 fPrimaryMom(), fProdVertex(),
62 fConstantTimeShift(0), fFillEBinAcceptanceHisto(0), fNEBinCuts(0),
63 fStudyActivityNearCluster(0), fStudyClusterOverlapsPerGenerator(0),
64 
65 // Histograms
66 
67 // Control histograms
68 fhNCellsE(0), fhCellsE(0),
69 fhMaxCellDiffClusterE(0), fhTimePt(0), fhEtaPhi(0),
70 
71 fhEPhoton(0), fhPtPhoton(0),
72 fhPhiPhoton(0), fhEtaPhoton(0),
73 fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
74 fhPtCentralityPhoton(0), fhPtEventPlanePhoton(0),
75 
76 // Shower shape histograms
77 fhNLocMax(0),
78 fhDispE(0), fhDispPt(0),
79 fhLam0E(0), fhLam0Pt(0),
80 fhLam1E(0), fhLam1Pt(0),
81 fhLam0PtNLM1(0), fhLam0PtNLM2(0),
82 fhLam1PtNLM1(0), fhLam1PtNLM2(0),
83 fhDispETRD(0), fhLam0ETRD(0), fhLam0PtTRD(0), fhLam1ETRD(0),
84 fhDispETM(0), fhLam0ETM(0), fhLam0PtTM(0), fhLam1ETM(0),
85 fhDispETMTRD(0), fhLam0ETMTRD(0), fhLam0PtTMTRD(0), fhLam1ETMTRD(0),
86 
87 fhNCellsLam0LowE(0), fhNCellsLam1LowE(0), fhNCellsDispLowE(0),
88 fhNCellsLam0HighE(0), fhNCellsLam1HighE(0), fhNCellsDispHighE(0),
89 
90 fhEtaLam0LowE(0), fhPhiLam0LowE(0),
91 fhEtaLam0HighE(0), fhPhiLam0HighE(0),
92 fhLam0DispLowE(0), fhLam0DispHighE(0),
93 fhLam1Lam0LowE(0), fhLam1Lam0HighE(0),
94 fhDispLam1LowE(0), fhDispLam1HighE(0),
95 fhDispEtaE(0), fhDispPhiE(0),
96 fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
97 fhDispEtaPhiDiffE(0), fhSphericityE(0),
98 fhDispSumEtaDiffE(0), fhDispSumPhiDiffE(0),
99 
100 // MC histograms
101 fhMCPhotonELambda0NoOverlap(0), fhMCPhotonELambda0TwoOverlap(0), fhMCPhotonELambda0NOverlap(0),
102 // Embedding
103 fhEmbeddedSignalFractionEnergy(0),
104 fhEmbedPhotonELambda0FullSignal(0), fhEmbedPhotonELambda0MostlySignal(0),
105 fhEmbedPhotonELambda0MostlyBkg(0), fhEmbedPhotonELambda0FullBkg(0),
106 fhEmbedPi0ELambda0FullSignal(0), fhEmbedPi0ELambda0MostlySignal(0),
107 fhEmbedPi0ELambda0MostlyBkg(0), fhEmbedPi0ELambda0FullBkg(0),
108 
109 fhTimePtPhotonNoCut(0), fhTimePtPhotonSPD(0),
110 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
111 fhPtPhotonNPileUpSPDVtx(0), fhPtPhotonNPileUpTrkVtx(0),
112 fhPtPhotonNPileUpSPDVtxTimeCut(0), fhPtPhotonNPileUpTrkVtxTimeCut(0),
113 fhPtPhotonNPileUpSPDVtxTimeCut2(0), fhPtPhotonNPileUpTrkVtxTimeCut2(0),
114 
115 fhEClusterSM(0), fhEPhotonSM(0),
116 fhPtClusterSM(0), fhPtPhotonSM(0),
117 fhMCConversionVertex(0), fhMCConversionVertexTRD(0),
118 fhLocalRegionClusterEnergySum(0), fhLocalRegionClusterMultiplicity(0),
119 fhLocalRegionClusterEnergySumPerCentrality(0),
120 fhLocalRegionClusterMultiplicityPerCentrality(0),
121 fhLocalRegionClusterEnergySumHijing(0),fhLocalRegionClusterMultiplicityHijing(0),
122 fhLocalRegionClusterEnergySumPerCentralityHijing(0),
123 fhLocalRegionClusterMultiplicityPerCentralityHijing(0),
124 fhMergeGeneratorCluster(0), fhMergeGeneratorClusterNotHijing(0),
125 fhMergeGeneratorClusterHijingAndOther(0), fhCleanGeneratorCluster(0)
126 
127 {
128  for(Int_t i = 0; i < fgkNmcTypes; i++)
129  {
130  fhMCPt [i] = 0;
131  fhMCE [i] = 0;
132  fhMCPhi [i] = 0;
133  fhMCEta [i] = 0;
134  fhMCDeltaE [i] = 0;
135  fhMCDeltaPt[i] = 0;
136  fhMC2E [i] = 0;
137  fhMC2Pt [i] = 0;
138  }
139 
140  for(Int_t i = 0; i < fgkNmcPrimTypes; i++)
141  {
142  fhPtPrimMC [i] = 0;
143  fhEPrimMC [i] = 0;
144  fhPhiPrimMC[i] = 0;
145  fhEtaPrimMC[i] = 0;
146  fhYPrimMC [i] = 0;
147 
148  fhPtPrimMCAcc [i] = 0;
149  fhEPrimMCAcc [i] = 0;
150  fhPhiPrimMCAcc[i] = 0;
151  fhEtaPrimMCAcc[i] = 0;
152  fhYPrimMCAcc [i] = 0;
153  }
154 
155  for(Int_t i = 0; i < 7; i++)
156  {
157  fhDispEtaDispPhi[i] = 0;
158  fhLambda0DispPhi[i] = 0;
159  fhLambda0DispEta[i] = 0;
160 
161  fhPtPhotonPileUp[i] = 0;
163 
164  for(Int_t j = 0; j < fgkNssTypes; j++)
165  {
166  fhMCDispEtaDispPhi[i][j] = 0;
167  fhMCLambda0DispEta[i][j] = 0;
168  fhMCLambda0DispPhi[i][j] = 0;
169  }
170  }
171 
172  for(Int_t i = 0; i < fgkNssTypes; i++)
173  {
174  fhMCELambda0 [i] = 0;
175  fhMCPtLambda0 [i] = 0;
176  fhMCELambda1 [i] = 0;
177  fhMCEDispersion [i] = 0;
178  fhMCNCellsE [i] = 0;
180  fhLambda0DispEta[i] = 0;
181  fhLambda0DispPhi[i] = 0;
182 
189 
190  fhMCEDispEta [i] = 0;
191  fhMCEDispPhi [i] = 0;
192  fhMCESumEtaPhi [i] = 0;
193  fhMCEDispEtaPhiDiff[i] = 0;
194  fhMCESphericity [i] = 0;
195  }
196 
197  for(Int_t i = 0; i < 5; i++)
198  {
199  fhClusterCutsE [i] = 0;
200  fhClusterCutsPt[i] = 0;
201  }
202 
203  // Track matching residuals
204  for(Int_t i = 0; i < 2; i++)
205  {
214  fhdEdx[i] = 0; fhEOverP[i] = 0;
215  fhEOverPTRD[i] = 0;
216  }
217 
218  for(Int_t i = 0; i < 6; i++)
219  {
220  fhMCConversionLambda0Rcut [i] = 0;
222  fhMCConversionLambda1Rcut [i] = 0;
224  }
225 
226  for(Int_t ieta = 0; ieta < 4; ieta++)
227  {
228  for(Int_t iphi = 0; iphi < 3; iphi++)
229  {
230 // fhLam0EMCALRegion [ieta][iphi] = 0;
231 // fhLam0EMCALRegionTRD[ieta][iphi] = 0;
232 //
233 // for(Int_t i = 0; i < 6; i++)
234 // {
235 // fhLam0EMCALRegionMCConvRcut [ieta][iphi][i] = 0;
236 // fhLam0EMCALRegionTRDMCConvRcut[ieta][iphi][i] = 0;
237 // }
238  for(Int_t ism =0; ism < 20; ism++)
239  {
240  fhLam0EMCALRegionPerSM[ieta][iphi][ism] = 0;
241  fhLam1EMCALRegionPerSM[ieta][iphi][ism] = 0;
242  }
243  }
244  }
245 
246  for(Int_t il0 = 0; il0 < 2; il0++)
247  {
248  for(Int_t i = 0; i < 7; i++)
249  {
250  fhEtaPhiLam0BinPtBin [il0][i] = 0 ;
251  fhEtaPhiLargeTimeInClusterCell[il0][i] = 0 ;
252 
253  fhColRowLam0BinPtBin [il0][i] = 0 ;
254  fhColRowLam0BinPtBinWeighted [il0][i] = 0 ;
255  fhColRowLam0BinPtBinLargeTime [il0][i] = 0 ;
256  fhCellClusterIndexEAndTime [il0][i] = 0 ;
257  fhCellClusterEAndTime [il0][i] = 0 ;
258  fhCellClusterEFracAndTime [il0][i] = 0 ;
259  }
260 
261  for(Int_t ism =0; ism < 20; ism++)
262  {
263  fhLam1Lam0BinPerSM [il0][ism] = 0;
264  fhTimeLam0BinPerSM [il0][ism] = 0;
265  fhTimeLam0BinPerSMWeighted [il0][ism] = 0;
266  fhDTimeLam0BinPerSM [il0][ism] = 0;
267  fhDTimeLam0BinPerSMWeighted [il0][ism] = 0;
268  fhCellClusterEFracLam0BinPerSM [il0][ism] = 0;
269 // fhCellClusterEFracLam0BinPerSMWeighted[il0][ism] = 0;
270  fhCellClusterELam0BinPerSM [il0][ism] = 0;
272 
275  fhCellClusterELam0BinPerSMLargeTime [il0][ism] = 0;
277  fhNCellsWithLargeTimeInCluster [il0][ism] = 0;
278  }
279  }
280 
281 // for(Int_t il0 = 0; il0 < 2; il0++)
282 // {
283 // for(Int_t i = 0; i < 7; i++)
284 // {
285 // fhEtaPhiLam0BinPtBinSMShared [il0][i] = 0 ;
286 // fhColRowLam0BinPtBinSMShared [il0][i] = 0 ;
287 // }
288 //
289 // for(Int_t ism =0; ism < 12; ism++)
290 // {
291 // fhTimeLam0BinPerSMShared[il0][ism] = 0;
292 // fhLam0PerSMShared [ism] = 0;
293 // fhLam1PerSMShared [ism] = 0;
294 // }
295 // }
296 
297  for(Int_t ism = 0; ism < 20; ism++)
298  {
299  fhLam0PerSM [ism] = 0;
300  fhLam1PerSM [ism] = 0;
303 // fhLam0PerSMSPDPileUp [ism] = 0;
304 // fhLam1PerSMSPDPileUp [ism] = 0;
305  }
306 
307  for(Int_t ilarge = 0; ilarge < 5; ilarge++)
308  {
311  }
312 
313  for(Int_t i = 0; i < 14; i++)
314  {
315  fhEBinClusterEtaPhi[i] = 0 ;
316  fhEBinClusterColRow[i] = 0 ;
317  fhEBinClusterEtaPhiPID[i] = 0 ;
318  fhEBinClusterColRowPID[i] = 0 ;
319  }
320 
321  // Initialize parameters
322  InitParameters();
323 }
324 
325 //_____________________________________________________________________
341 //_____________________________________________________________________
342 Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, Int_t nMaxima)
343 {
344  Float_t ptcluster = fMomentum.Pt();
345  Float_t ecluster = fMomentum.E();
346  Float_t etacluster = fMomentum.Eta();
347  Float_t phicluster = fMomentum.Phi();
348 
349  if(phicluster < 0) phicluster+=TMath::TwoPi();
350 
351  Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
352 
353  AliDebug(2,Form("Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f",
355  ecluster,ptcluster, phicluster*TMath::RadToDeg(),etacluster));
356 
357  fhClusterCutsE [1]->Fill( ecluster, GetEventWeight());
358  fhClusterCutsPt[1]->Fill(ptcluster, GetEventWeight());
359 
360  if(ecluster > 0.5) fhEtaPhi->Fill(etacluster, phicluster, GetEventWeight());
361 
362  Int_t nSM = GetModuleNumber(calo);
363  if(nSM < GetCaloUtils()->GetNumberOfSuperModulesUsed() && nSM >=0)
364  {
365  fhEClusterSM ->Fill(ecluster , nSM, GetEventWeight());
366  fhPtClusterSM->Fill(ptcluster, nSM, GetEventWeight());
367  }
368 
369  //.......................................
370  //If too small or big energy, skip it
371  if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ;
372 
373  AliDebug(2,Form("\t Cluster %d Pass E Cut",calo->GetID()));
374 
375  fhClusterCutsE [2]->Fill( ecluster, GetEventWeight());
376  fhClusterCutsPt[2]->Fill(ptcluster, GetEventWeight());
377 
378  //.......................................
379  // TOF cut, BE CAREFUL WITH THIS CUT
380  Double_t tof = calo->GetTOF()*1e9;
381  if(tof > 400) tof-=fConstantTimeShift; // only for MC, rest shift = 0
382 
383  if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
384 
385  AliDebug(2,Form("\t Cluster %d Pass Time Cut",calo->GetID()));
386 
387  fhClusterCutsE [3]->Fill( ecluster, GetEventWeight());
388  fhClusterCutsPt[3]->Fill(ptcluster, GetEventWeight());
389 
390  //.......................................
391  if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
392 
393  AliDebug(2,Form("\t Cluster %d Pass NCell Cut",calo->GetID()));
394 
395  fhClusterCutsE [4]->Fill( ecluster, GetEventWeight());
396  fhClusterCutsPt[4]->Fill(ptcluster, GetEventWeight());
397 
398  if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
399  AliDebug(2,Form("\t Cluster %d pass NLM %d of out of range",calo->GetID(), nMaxima));
400 
401  fhClusterCutsE [5]->Fill( ecluster, GetEventWeight());
402  fhClusterCutsPt[5]->Fill(ptcluster, GetEventWeight());
403 
404  //.......................................
405  //Check acceptance selection
406  if(IsFiducialCutOn())
407  {
409  if(! in ) return kFALSE ;
410  }
411 
412  AliDebug(2,Form("\t Fiducial cut passed"));
413 
414  fhClusterCutsE [6]->Fill( ecluster, GetEventWeight());
415  fhClusterCutsPt[6]->Fill(ptcluster, GetEventWeight());
416 
417  //.......................................
418  //Skip matched clusters with tracks
419 
420  // Fill matching residual histograms before PID cuts
422 
424  {
425  if(matched)
426  {
427  AliDebug(2,"\t Reject track-matched clusters");
428  return kFALSE ;
429  }
430  else
431  AliDebug(2,"\t Track-matching cut passed");
432  }// reject matched clusters
433 
434  fhClusterCutsE [7]->Fill( ecluster, GetEventWeight());
435  fhClusterCutsPt[7]->Fill(ptcluster, GetEventWeight());
436 
437  //.......................................
438  //Check Distance to Bad channel, set bit.
439  Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
440  if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
441  if(distBad < fMinDist)
442  {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
443  return kFALSE ;
444  }
445  else AliDebug(2,Form("\t Bad channel cut passed %4.2f > %2.2f",distBad, fMinDist));
446 
447  fhClusterCutsE [8]->Fill( ecluster, GetEventWeight());
448  fhClusterCutsPt[8]->Fill(ptcluster, GetEventWeight());
449 
450  AliDebug(1,Form("Current Event %d; After selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f",
452  ecluster, ptcluster,fMomentum.Phi()*TMath::RadToDeg(),fMomentum.Eta()));
453 
454  //All checks passed, cluster selected
455  return kTRUE;
456 
457 }
458 
459 //___________________________________________
464 //___________________________________________
466 {
467  Double_t photonY = -100 ;
468  Double_t photonE = -1 ;
469  Double_t photonPt = -1 ;
470  Double_t photonPhi = 100 ;
471  Double_t photonEta = -1 ;
472 
473  Int_t pdg = 0 ;
474  Int_t tag = 0 ;
475  Int_t status = 0 ;
476  Int_t mcIndex = 0 ;
477  Int_t nprim = 0 ;
478  Bool_t inacceptance = kFALSE ;
479 
480  TParticle * primStack = 0;
481  AliAODMCParticle * primAOD = 0;
482 
483  // Get the ESD MC particles container
484  AliStack * stack = 0;
485  if( GetReader()->ReadStack() )
486  {
487  stack = GetMCStack();
488  if( !stack )
489  {
490  AliFatal("Stack not available, is the MC handler called? STOP");
491  return;
492  }
493  nprim = stack->GetNtrack();
494  }
495 
496  // Get the AOD MC particles container
497  TClonesArray * mcparticles = 0;
498  if( GetReader()->ReadAODMCParticles() )
499  {
500  mcparticles = GetReader()->GetAODMCParticles();
501  if( !mcparticles )
502  {
503  AliFatal("Standard MCParticles not available!");
504  return;
505  }
506  nprim = mcparticles->GetEntriesFast();
507  }
508 
509  for(Int_t i=0 ; i < nprim; i++)
510  {
511  if ( !GetReader()->AcceptParticleMCLabel( i ) ) continue ;
512 
513  if(GetReader()->ReadStack())
514  {
515  primStack = stack->Particle(i) ;
516  if(!primStack)
517  {
518  AliWarning("ESD primaries pointer not available!!");
519  continue;
520  }
521 
522  pdg = primStack->GetPdgCode();
523  status = primStack->GetStatusCode();
524 
525  // Protection against floating point exception
526  if ( primStack->Energy() == TMath::Abs(primStack->Pz()) ||
527  (primStack->Energy() - primStack->Pz()) < 1e-3 ||
528  (primStack->Energy() + primStack->Pz()) < 0 ) continue ;
529 
530  //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
531  // prim->GetName(), prim->GetPdgCode());
532 
533  // Photon kinematics
534  primStack->Momentum(fMomentum);
535 
536  photonY = 0.5*TMath::Log((primStack->Energy()+primStack->Pz())/(primStack->Energy()-primStack->Pz())) ;
537  }
538  else
539  {
540  primAOD = (AliAODMCParticle *) mcparticles->At(i);
541  if(!primAOD)
542  {
543  AliWarning("AOD primaries pointer not available!!");
544  continue;
545  }
546 
547  pdg = primAOD->GetPdgCode();
548  status = primAOD->GetStatus();
549 
550  // Protection against floating point exception
551  if ( primAOD->E() == TMath::Abs(primAOD->Pz()) ||
552  (primAOD->E() - primAOD->Pz()) < 1e-3 ||
553  (primAOD->E() + primAOD->Pz()) < 0 ) continue ;
554 
555  // Photon kinematics
556  fMomentum.SetPxPyPzE(primAOD->Px(),primAOD->Py(),primAOD->Pz(),primAOD->E());
557 
558  photonY = 0.5*TMath::Log((primAOD->E()+primAOD->Pz())/(primAOD->E()-primAOD->Pz())) ;
559  }
560 
561  // Select only photons in the final state
562  if(pdg != 22 ) continue ;
563 
564  // If too small or too large pt, skip, same cut as for data analysis
565  photonPt = fMomentum.Pt () ;
566 
567  if(photonPt < GetMinPt() || photonPt > GetMaxPt() ) continue ;
568 
569  photonE = fMomentum.E () ;
570  photonEta = fMomentum.Eta() ;
571  photonPhi = fMomentum.Phi() ;
572 
573  if(photonPhi < 0) photonPhi+=TMath::TwoPi();
574 
575  // Check if photons hit desired acceptance
576  inacceptance = kTRUE;
577 
578  // Check same fidutial borders as in data analysis on top of real acceptance if real was requested.
579  if( IsFiducialCutOn() && !GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),GetCalorimeter())) inacceptance = kFALSE ;
580 
581  // Check if photons hit the Calorimeter acceptance
582  if(IsRealCaloAcceptanceOn()) // defined on base class
583  {
584  if(GetReader()->ReadStack() &&
585  !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance(GetCalorimeter(), primStack)) inacceptance = kFALSE ;
586  if(GetReader()->ReadAODMCParticles() &&
587  !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance(GetCalorimeter(), primAOD )) inacceptance = kFALSE ;
588  }
589 
590  // Get tag of this particle photon from fragmentation, decay, prompt ...
591  // Set the origin of the photon.
593 
594  if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
595  {
596  // A conversion photon from a hadron, skip this kind of photon
597  // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
598  // GetMCAnalysisUtils()->PrintMCTag(tag);
599 
600  continue;
601  }
602 
603  // Consider only final state particles, but this depends on generator,
604  // status 1 is the usual one, in case of not being ok, leave the possibility
605  // to not consider this.
606  if(status > 1) continue ; // Avoid "partonic" photons
607 
608  Bool_t takeIt = kFALSE ;
609  if(status == 1 && GetMCAnalysisUtils()->GetMCGenerator() != AliMCAnalysisUtils::kBoxLike ) takeIt = kTRUE ;
610 
611  if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) continue;
612 
613  // Origin of photon
614  if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt))
615  {
616  mcIndex = kmcPPrompt;
617  }
618  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation))
619  {
620  mcIndex = kmcPFragmentation ;
621  }
622  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR))
623  {
624  mcIndex = kmcPISR;
625  }
626  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay))
627  {
628  mcIndex = kmcPPi0Decay;
629  }
630  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay))
631  {
632  mcIndex = kmcPEtaDecay;
633  }
634  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay))
635  {
636  mcIndex = kmcPOtherDecay;
637  }
638  else
639  {
640  // Other decay but from non final state particle
641  mcIndex = kmcPOtherDecay;
642  } // Other origin
643 
644  if(!takeIt && (mcIndex == kmcPPi0Decay || mcIndex == kmcPOtherDecay)) takeIt = kTRUE ;
645 
646  if(!takeIt) continue ;
647 
648  // Fill histograms for all photons
649  fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY, GetEventWeight()) ;
650  if(TMath::Abs(photonY) < 1.0)
651  {
652  fhEPrimMC [kmcPPhoton]->Fill(photonE , GetEventWeight()) ;
653  fhPtPrimMC [kmcPPhoton]->Fill(photonPt, GetEventWeight()) ;
654  fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi, GetEventWeight()) ;
655  fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta, GetEventWeight()) ;
656  }
657 
658  if(inacceptance)
659  {
660  fhEPrimMCAcc [kmcPPhoton]->Fill(photonE , GetEventWeight()) ;
661  fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt, GetEventWeight()) ;
662  fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi, GetEventWeight()) ;
663  fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta, GetEventWeight()) ;
664  fhYPrimMCAcc [kmcPPhoton]->Fill(photonE , photonY , GetEventWeight()) ;
665  } // Accepted
666 
667  // Fill histograms for photons origin
668  if(mcIndex < fNPrimaryHistograms)
669  {
670  fhYPrimMC[mcIndex]->Fill(photonPt, photonY, GetEventWeight()) ;
671  if(TMath::Abs(photonY) < 1.0)
672  {
673  fhEPrimMC [mcIndex]->Fill(photonE , GetEventWeight()) ;
674  fhPtPrimMC [mcIndex]->Fill(photonPt, GetEventWeight()) ;
675  fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi, GetEventWeight()) ;
676  fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta, GetEventWeight()) ;
677  }
678 
679  if(inacceptance)
680  {
681  fhEPrimMCAcc [mcIndex]->Fill(photonE , GetEventWeight()) ;
682  fhPtPrimMCAcc [mcIndex]->Fill(photonPt, GetEventWeight()) ;
683  fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi, GetEventWeight()) ;
684  fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta, GetEventWeight()) ;
685  fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY , GetEventWeight()) ;
686  } // Accepted
687  }
688  } // loop on primaries
689 }
690 
691 //________________________________________________________________________________
693 //________________________________________________________________________________
694 void AliAnaPhoton::FillPileUpHistograms(AliVCluster* cluster, AliVCaloCells *cells,
695  Int_t absIdMax)
696 {
697  Float_t pt = fMomentum.Pt();
698  Float_t time = cluster->GetTOF()*1.e9;
699  if ( time > 400 ) time-=fConstantTimeShift; // Only for MC, rest shift = 0
700 
701  AliVEvent * event = GetReader()->GetInputEvent();
702 
703  if(GetReader()->IsPileUpFromSPD()) fhPtPhotonPileUp[0]->Fill(pt, GetEventWeight()) ;
704  if(GetReader()->IsPileUpFromEMCal()) fhPtPhotonPileUp[1]->Fill(pt, GetEventWeight()) ;
705  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPhotonPileUp[2]->Fill(pt, GetEventWeight()) ;
706  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPhotonPileUp[3]->Fill(pt, GetEventWeight()) ;
707  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPhotonPileUp[4]->Fill(pt, GetEventWeight()) ;
708  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPhotonPileUp[5]->Fill(pt, GetEventWeight()) ;
709  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt, GetEventWeight()) ;
710 
711  fhTimePtPhotonNoCut->Fill(pt, time, GetEventWeight());
712  if(GetReader()->IsPileUpFromSPD()) fhTimePtPhotonSPD->Fill(pt, time, GetEventWeight());
713 
714  //
715  // Cells inside the cluster
716  //
717 
718  // Loop on cells inside cluster, max cell must be over 100 MeV and time in BC=0
719  if(cells->GetCellAmplitude(absIdMax) > 0.1 && TMath::Abs(time) < 30)
720  {
721  for (Int_t ipos = 0; ipos < cluster->GetNCells(); ipos++)
722  {
723  Int_t absId = cluster->GetCellsAbsId()[ipos];
724 
725  if( absId == absIdMax ) continue ;
726 
727  Double_t tcell = cells->GetCellTime(absId);
728  Float_t amp = cells->GetCellAmplitude(absId);
729  Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
730 
731  GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,tcell,cells);
732  tcell*=1e9;
733  tcell-=fConstantTimeShift;
734 
735  Float_t diff = (time-tcell);
736 
737  if( cells->GetCellAmplitude(absIdMax) < 0.1 ) continue ;
738 
746 
747  } // loop
748  }
749 
750  AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
751  AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
752 
753  //
754  // N pile up vertices
755  //
756 
757  Int_t nVtxSPD = -1;
758  Int_t nVtxTrk = -1;
759 
760  if (esdEv)
761  {
762  nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
763  nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
764 
765  } // ESD
766  else if (aodEv)
767  {
768  nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
769  nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
770  } // AOD
771 
772  if(pt < 8)
773  {
774  fhTimeNPileUpVertSPD ->Fill(time, nVtxSPD, GetEventWeight());
775  fhTimeNPileUpVertTrack->Fill(time, nVtxTrk, GetEventWeight());
776  }
777 
778  fhPtPhotonNPileUpSPDVtx->Fill(pt, nVtxSPD, GetEventWeight());
779  fhPtPhotonNPileUpTrkVtx->Fill(pt, nVtxTrk, GetEventWeight());
780 
781  if(TMath::Abs(time) < 25)
782  {
783  fhPtPhotonNPileUpSPDVtxTimeCut->Fill(pt, nVtxSPD, GetEventWeight());
784  fhPtPhotonNPileUpTrkVtxTimeCut->Fill(pt, nVtxTrk, GetEventWeight());
785  }
786 
787  if(time < 75 && time > -25)
788  {
789  fhPtPhotonNPileUpSPDVtxTimeCut2->Fill(pt, nVtxSPD, GetEventWeight());
790  fhPtPhotonNPileUpTrkVtxTimeCut2->Fill(pt, nVtxTrk, GetEventWeight());
791  }
792 }
793 
794 //_________________________________________________________________________________
796 //_________________________________________________________________________________
797 void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag, Int_t nlm,
798  Float_t maxCellFraction, Int_t & largeTime)
799 {
800  if(!fFillSSHistograms || GetMixedEvent()) return;
801 
802  Float_t energy = cluster->E();
803  Int_t ncells = cluster->GetNCells();
804  Float_t lambda0 = cluster->GetM02();
805  Float_t lambda1 = cluster->GetM20();
806  Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
807 
808  Float_t pt = fMomentum.Pt();
809  Float_t eta = fMomentum.Eta();
810  Float_t phi = fMomentum.Phi();
811  if(phi < 0) phi+=TMath::TwoPi();
812 
813  fhLam0E ->Fill(energy, lambda0, GetEventWeight());
814  fhLam0Pt->Fill(pt , lambda0, GetEventWeight());
815  fhLam1E ->Fill(energy, lambda1, GetEventWeight());
816  fhLam1Pt->Fill(pt , lambda1, GetEventWeight());
817  fhDispE ->Fill(energy, disp , GetEventWeight());
818  fhDispPt->Fill(pt , disp , GetEventWeight());
819 
821  {
822  if(nlm==1)
823  {
824  fhLam0PtNLM1->Fill(pt, lambda0, GetEventWeight());
825  fhLam1PtNLM1->Fill(pt, lambda1, GetEventWeight());
826  }
827  else if(nlm==2)
828  {
829  fhLam0PtNLM2->Fill(pt, lambda0, GetEventWeight());
830  fhLam1PtNLM2->Fill(pt, lambda1, GetEventWeight());
831  }
832  }
833 
834  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
836  {
837  fhLam0ETRD ->Fill(energy, lambda0, GetEventWeight());
838  fhLam0PtTRD->Fill(pt , lambda0, GetEventWeight());
839  fhLam1ETRD ->Fill(energy, lambda1, GetEventWeight());
840  fhDispETRD ->Fill(energy, disp, GetEventWeight());
841  }
842 
843  //
844  // EMCal SM regions
845  //
846  if(cluster->IsEMCAL() && fFillEMCALRegionSSHistograms)
847  {
848  Int_t sm = GetModuleNumber(cluster);
849 
850 // Bool_t shared = GetCaloUtils()->IsClusterSharedByTwoSuperModules(GetEMCALGeometry(),cluster);
851 
852  fhLam0PerSM[sm]->Fill(pt, lambda0, GetEventWeight());
853  fhLam1PerSM[sm]->Fill(pt, lambda1, GetEventWeight());
854 
855 // if(GetReader()->IsPileUpFromSPD())
856 // {
857 // fhLam0PerSMSPDPileUp[sm]->Fill(pt, lambda0, GetEventWeight());
858 // fhLam1PerSMSPDPileUp[sm]->Fill(pt, lambda1, GetEventWeight());
859 // }
860 
861  Int_t etaRegion = -1, phiRegion = -1;
862  GetCaloUtils()->GetEMCALSubregion(cluster,GetReader()->GetEMCALCells(),etaRegion,phiRegion);
863  if(etaRegion >= 0 && etaRegion < 4 && phiRegion >=0 && phiRegion < 3)
864  {
865 
866  // fhLam0EMCALRegion[etaRegion][phiRegion]->Fill(pt,lambda0, GetEventWeight());
867  //
868  // if(GetFirstSMCoveredByTRD() >= 0 && sm >= GetFirstSMCoveredByTRD() )
869  // {
870  // fhLam0EMCALRegionTRD[etaRegion][phiRegion]->Fill(pt, lambda0, GetEventWeight());
871  // }
872 
873  fhLam0EMCALRegionPerSM[etaRegion][phiRegion][sm]->Fill(pt,lambda0, GetEventWeight());
874  fhLam1EMCALRegionPerSM[etaRegion][phiRegion][sm]->Fill(pt,lambda1, GetEventWeight());
875 
876 // if(shared)
877 // {
878 // fhLam0PerSMShared[sm]->Fill(pt,lambda0, GetEventWeight());
879 // fhLam1PerSMShared[sm]->Fill(pt,lambda1, GetEventWeight());
880 // }
881  }
882 
883  // Define l0 bin and cluster pt bin
884  Int_t l0bin = -1;
885  if ( lambda0 >=0.30 && lambda0 <= 0.40 ) l0bin = 1;
886  else if( lambda0 >=0.23 && lambda0 <= 0.26 ) l0bin = 0;
887 
888  Float_t ptLimit[] = {2,3,4,5,6,8,10,12};
889  Int_t ptbin = -1;
890  for(Int_t ipt = 0; ipt < 7; ipt++)
891  {
892  if( pt >= ptLimit[ipt] && pt < ptLimit[ipt+1] )
893  {
894  ptbin = ipt;
895  break;
896  }
897  }
898 
899  if(l0bin!=-1)
900  {
901  fhLam1Lam0BinPerSM[l0bin][sm]->Fill(pt,lambda1);
902 
903  if(ptbin >= 0)
904  {
905  fhEtaPhiLam0BinPtBin[l0bin][ptbin]->Fill(eta, phi, GetEventWeight());
906 // if(shared) fhEtaPhiLam0BinPtBinSMShared[l0bin][ptbin]->Fill(eta, phi, GetEventWeight());
907  }
908  }
909 
910  //
911  // Histograms with time of secondary cells, only if they contribute with a non null
912  // weight to the shower shape
913  //
914  AliVCaloCells* cells = GetReader()->GetEMCALCells();
915 
916  Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
917 
918  //
919  // Sort the cluster cells in energy, find maximum energy cell
920  //
921  Int_t ncell = cluster->GetNCells();
922  Int_t * sortList = new Int_t [ncell];
923  Float_t * enerList = new Float_t [ncell];
924  Double_t * timeList = new Double_t[ncell];
925 
926  for(Int_t icell = 0; icell < ncell; icell++)
927  {
928  Int_t absId = cluster->GetCellAbsId(icell);
929  Float_t cellE = cells->GetCellAmplitude(absId);
930  Double_t cellTime = cells->GetCellTime(absId);
931 
932  GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,cellE,cellTime,cells);
933  cellTime*=1e9;
934  cellTime-=fConstantTimeShift;
935 
936  enerList[icell] = cellE;
937  timeList[icell] = cellTime;
938  }
939 
940  TMath::Sort(ncell,enerList,sortList);
941 
942  //
943  // Location of max cell
944  // First in sorted list.
945  //
946  Int_t absIdMax = cluster->GetCellAbsId(sortList[0]);
947  // Float_t cellEMax = enerList[sortList[0]];
948  Double_t cellTimeMax = timeList[sortList[0]];
949 
950  //
951  // Cluster cell loop, select only secondary cells with enough contribution to cluster
952  // Start from second highest energy cell
953  //
954  largeTime = 0;
955  Float_t largeTimeE = 0;
956  for(Int_t icell = 1; icell < ncell; icell++)
957  {
958  Int_t absId = cluster->GetCellAbsId(sortList[icell]);
959  Float_t cellE = enerList[sortList[icell]];
960  Double_t cellTime = timeList[sortList[icell]];
961 
962  //printf("\t icell %d, absId %d, ener %2.2f, time %2.2f, sort %d\n",icell,absId,cellE,cellTime,sortList[icell]);
963 
964  if ( absId == absIdMax ) continue;
965 
966  Float_t weight = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cellE,cluster->E());
967 
968  //printf("Cluster E %2.2f, cell E %2.2f, time %2.2f, weight %2.3f\n",cluster->E(),cellE,cellTime,weight);
969  if(weight < 0.01) continue;
970 
971  if ( TMath::Abs(cellTime) > 50 )
972  {
973  largeTime++;
974  largeTimeE += cellE;
975  //printf(" cluster pT %2.2f, cell E %2.2f, large time %d; ",pt, cellE, largeTime);
976  }
977  if ( l0bin == -1 ) continue;
978 
979  fhTimeLam0BinPerSM [l0bin][sm]->Fill(pt, cellTime, GetEventWeight());
980  fhTimeLam0BinPerSMWeighted[l0bin][sm]->Fill(pt, cellTime, weight*GetEventWeight());
981 
982  fhDTimeLam0BinPerSM [l0bin][sm]->Fill(pt, cellTimeMax-cellTime, GetEventWeight());
983  fhDTimeLam0BinPerSMWeighted[l0bin][sm]->Fill(pt, cellTimeMax-cellTime, weight*GetEventWeight());
984 
985  fhCellClusterEFracLam0BinPerSM [l0bin][sm]->Fill(pt, cellE/cluster->E(), GetEventWeight());
986 // fhCellClusterEFracLam0BinPerSMWeighted[l0bin][sm]->Fill(pt, cellE/cluster->E(), weight*GetEventWeight());
987 
988  fhCellClusterELam0BinPerSM [l0bin][sm]->Fill(pt, cellE, GetEventWeight());
989  fhCellClusterELam0BinPerSMWeighted[l0bin][sm]->Fill(pt, cellE, weight*GetEventWeight());
990 
991  if(ptbin >= 0)
992  {
993  fhCellClusterIndexEAndTime[l0bin][ptbin] ->Fill(cellTime, icell , GetEventWeight());
994  fhCellClusterEAndTime [l0bin][ptbin] ->Fill(cellTime, cellE , GetEventWeight());
995  fhCellClusterEFracAndTime [l0bin][ptbin] ->Fill(cellTime, cellE/cluster->E(), GetEventWeight());
996  }
997 
998  if ( TMath::Abs(cellTime) > 50 )
999  {
1000  fhCellClusterEFracLam0BinPerSMLargeTime [l0bin][sm]->Fill(pt, cellE/cluster->E(), GetEventWeight());
1001  fhCellClusterELam0BinPerSMLargeTime [l0bin][sm]->Fill(pt, cellE , GetEventWeight());
1002  fhCellClusterIndexELam0BinPerSMLargeTime[l0bin][sm]->Fill(pt, icell , GetEventWeight());
1003  }
1004 // if(shared)
1005 // fhTimeLam0BinPerSMShared[l0bin][sm]->Fill(pt, cellTime, GetEventWeight());
1006 
1007  if(ptbin >= 0)
1008  {
1009  Int_t icol = -1, icolAbs = -1;
1010  Int_t irow = -1, irowAbs = -1;
1011  Int_t iRCU = -1;
1012  GetModuleNumberCellIndexesAbsCaloMap(absId,GetCalorimeter(), icol, irow, iRCU, icolAbs, irowAbs);
1013 
1014  fhColRowLam0BinPtBin [l0bin][ptbin]->Fill(icolAbs, irowAbs, GetEventWeight());
1015  fhColRowLam0BinPtBinWeighted[l0bin][ptbin]->Fill(icolAbs, irowAbs, weight*GetEventWeight());
1016 
1017  if ( TMath::Abs(cellTime) > 50 )
1018  fhColRowLam0BinPtBinLargeTime[l0bin][ptbin]->Fill(icolAbs, irowAbs, GetEventWeight());
1019 
1020 // if(shared) fhColRowLam0BinPtBinSMShared[l0bin][ptbin]->Fill(icolAbs, irowAbs, GetEventWeight());
1021  }
1022 
1023 
1024  } // cluster cell loop
1025  //if(largeTime > 0) printf("\n");
1026 
1027  if ( largeTime > 0 )
1028  {
1029  if ( l0bin != -1 )
1030  {
1031  if ( ptbin > 0 )
1032  fhEtaPhiLargeTimeInClusterCell[l0bin][ptbin]->Fill(eta, phi, GetEventWeight());
1033 
1034  fhCellClusterEFracLam0BinPerSMLargeTimeTotal[l0bin][sm]->Fill(pt, largeTimeE/cluster->E(), GetEventWeight());
1035  fhNCellsWithLargeTimeInCluster [l0bin][sm]->Fill(pt, largeTime , GetEventWeight());
1036  }
1037 
1038  fhLam0PerSMLargeTimeInClusterCell[sm]->Fill(pt, lambda0, GetEventWeight());
1039  fhLam1PerSMLargeTimeInClusterCell[sm]->Fill(pt, lambda1, GetEventWeight());
1040 
1041  if(largeTime < 6)
1042  {
1043  fhLam0PerNLargeTimeInClusterCell[largeTime-1]->Fill(pt, lambda0, GetEventWeight());
1044  fhLam1PerNLargeTimeInClusterCell[largeTime-1]->Fill(pt, lambda1, GetEventWeight());
1045  }
1046  }
1047 
1048  delete [] sortList ;
1049  delete [] enerList ;
1050  delete [] timeList ;
1051  //printf("Cluster %d, E %2.2f, sm %d, eta %2.2f, phi %2.2f ---> region %d %d\n",cluster->GetID(),cluster->E(),GetModuleNumber(cluster),eta,RadToDeg(phi),etaRegion,phiRegion);
1052  } // Check EMCal SM and regions
1053 
1054  Float_t l0 = 0., l1 = 0.;
1055  Float_t dispp= 0., dEta = 0., dPhi = 0.;
1056  Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
1058  {
1059  GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
1060  l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
1061  //printf("AliAnaPhoton::FillShowerShapeHistogram - l0 %2.6f, l1 %2.6f, disp %2.6f, dEta %2.6f, dPhi %2.6f, sEta %2.6f, sPhi %2.6f, sEtaPhi %2.6f \n",
1062  // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
1063  //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
1064  // disp, dPhi+dEta );
1065  fhDispEtaE -> Fill(energy, dEta , GetEventWeight());
1066  fhDispPhiE -> Fill(energy, dPhi , GetEventWeight());
1067  fhSumEtaE -> Fill(energy, sEta , GetEventWeight());
1068  fhSumPhiE -> Fill(energy, sPhi , GetEventWeight());
1069  fhSumEtaPhiE -> Fill(energy, sEtaPhi , GetEventWeight());
1070  fhDispEtaPhiDiffE -> Fill(energy, dPhi-dEta, GetEventWeight());
1071 
1072  if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi) , GetEventWeight());
1073  if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.), GetEventWeight());
1074  if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.), GetEventWeight());
1075 
1076  Int_t ebin = -1;
1077  if (energy < 2 ) ebin = 0;
1078  else if (energy < 4 ) ebin = 1;
1079  else if (energy < 6 ) ebin = 2;
1080  else if (energy < 10) ebin = 3;
1081  else if (energy < 15) ebin = 4;
1082  else if (energy < 20) ebin = 5;
1083  else ebin = 6;
1084 
1085  fhDispEtaDispPhi[ebin]->Fill(dEta , dPhi, GetEventWeight());
1086  fhLambda0DispEta[ebin]->Fill(lambda0, dEta, GetEventWeight());
1087  fhLambda0DispPhi[ebin]->Fill(lambda0, dPhi, GetEventWeight());
1088  }
1089 
1090  // If track-matching was off, check effect of track-matching residual cut
1091 
1092  if(!fRejectTrackMatch)
1093  {
1094  Float_t dZ = cluster->GetTrackDz();
1095  Float_t dR = cluster->GetTrackDx();
1096 // if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1097 // {
1098 // dR = 2000., dZ = 2000.;
1099 // GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
1100 // }
1101 
1102  if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1103  {
1104  fhLam0ETM ->Fill(energy, lambda0, GetEventWeight());
1105  fhLam0PtTM->Fill(pt , lambda0, GetEventWeight());
1106  fhLam1ETM ->Fill(energy, lambda1, GetEventWeight());
1107  fhDispETM ->Fill(energy, disp , GetEventWeight());
1108 
1109  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
1110  GetModuleNumber(cluster) >= GetFirstSMCoveredByTRD() )
1111  {
1112  fhLam0ETMTRD ->Fill(energy, lambda0, GetEventWeight());
1113  fhLam0PtTMTRD->Fill(pt , lambda0, GetEventWeight());
1114  fhLam1ETMTRD ->Fill(energy, lambda1, GetEventWeight());
1115  fhDispETMTRD ->Fill(energy, disp , GetEventWeight());
1116  }
1117  }
1118  } // If track-matching was off, check effect of matching residual cut
1119 
1121  {
1122  if(energy < 2)
1123  {
1124  fhNCellsLam0LowE ->Fill(ncells, lambda0, GetEventWeight());
1125  fhNCellsLam1LowE ->Fill(ncells, lambda1, GetEventWeight());
1126  fhNCellsDispLowE ->Fill(ncells, disp , GetEventWeight());
1127 
1128  fhLam1Lam0LowE ->Fill(lambda1, lambda0, GetEventWeight());
1129  fhLam0DispLowE ->Fill(lambda0, disp , GetEventWeight());
1130  fhDispLam1LowE ->Fill(disp , lambda1, GetEventWeight());
1131  fhEtaLam0LowE ->Fill(eta , lambda0, GetEventWeight());
1132  fhPhiLam0LowE ->Fill(phi , lambda0, GetEventWeight());
1133  }
1134  else
1135  {
1136  fhNCellsLam0HighE ->Fill(ncells, lambda0, GetEventWeight());
1137  fhNCellsLam1HighE ->Fill(ncells, lambda1, GetEventWeight());
1138  fhNCellsDispHighE ->Fill(ncells, disp , GetEventWeight());
1139 
1140  fhLam1Lam0HighE ->Fill(lambda1, lambda0, GetEventWeight());
1141  fhLam0DispHighE ->Fill(lambda0, disp , GetEventWeight());
1142  fhDispLam1HighE ->Fill(disp , lambda1, GetEventWeight());
1143  fhEtaLam0HighE ->Fill(eta , lambda0, GetEventWeight());
1144  fhPhiLam0HighE ->Fill(phi , lambda0, GetEventWeight());
1145  }
1146  }
1147 
1148  if(IsDataMC())
1149  {
1150  AliVCaloCells* cells = 0;
1151  if(GetCalorimeter() == kEMCAL) cells = GetEMCALCells();
1152  else cells = GetPHOSCells();
1153 
1154  // Fill histograms to check shape of embedded clusters
1155  Float_t fraction = 0;
1156  // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
1157 
1158  if(GetReader()->IsEmbeddedClusterSelectionOn())
1159  {
1160  // Only working for EMCAL
1161  // printf("embedded\n");
1162 
1163  Float_t clusterE = 0; // recalculate in case corrections applied.
1164  Float_t cellE = 0;
1165  for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
1166  {
1167  cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
1168  clusterE+=cellE;
1169  fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
1170  }
1171 
1172  //Fraction of total energy due to the embedded signal
1173  fraction/=clusterE;
1174 
1175  AliDebug(1,Form("Energy fraction of embedded signal %2.3f, Energy %2.3f",fraction, clusterE));
1176 
1177  fhEmbeddedSignalFractionEnergy->Fill(clusterE, fraction, GetEventWeight());
1178  } // embedded fraction
1179 
1180  // Check the origin and fill histograms
1181 
1182  Int_t mcIndex = -1;
1183 
1184  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1185  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
1186  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1187  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1188  {
1189  mcIndex = kmcssPhoton ;
1190 
1191  if(!GetReader()->IsEmbeddedClusterSelectionOn())
1192  {
1193  //Check particle overlaps in cluster
1194 
1195  // Compare the primary depositing more energy with the rest,
1196  // if no photon/electron as comon ancestor (conversions), count as other particle
1197  const UInt_t nlabels = cluster->GetNLabels();
1198  Int_t overpdg[nlabels];
1199  Int_t overlab[nlabels];
1200  Int_t noverlaps = GetMCAnalysisUtils()->GetNOverlaps(cluster->GetLabels(), nlabels,mcTag,-1,GetReader(),overpdg,overlab);
1201 
1202  //printf("N overlaps %d \n",noverlaps);
1203 
1204  if(noverlaps == 0)
1205  {
1206  fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0, GetEventWeight());
1207  }
1208  else if(noverlaps == 1)
1209  {
1210  fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0, GetEventWeight());
1211  }
1212  else if(noverlaps > 1)
1213  {
1214  fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0, GetEventWeight());
1215  }
1216  else
1217  {
1218  AliWarning(Form("n overlaps = %d!!", noverlaps));
1219  }
1220  } // No embedding
1221 
1222  // Fill histograms to check shape of embedded clusters
1223  if(GetReader()->IsEmbeddedClusterSelectionOn())
1224  {
1225  if (fraction > 0.9)
1226  {
1227  fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0, GetEventWeight());
1228  }
1229  else if(fraction > 0.5)
1230  {
1231  fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0, GetEventWeight());
1232  }
1233  else if(fraction > 0.1)
1234  {
1235  fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0, GetEventWeight());
1236  }
1237  else
1238  {
1239  fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0, GetEventWeight());
1240  }
1241  } // embedded
1242  } // photon no conversion
1243  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1244  GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
1245  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1246  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1247  {
1248  mcIndex = kmcssConversion ;
1249  }//conversion photon
1250 
1251  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
1252  {
1253  mcIndex = kmcssElectron ;
1254  }//electron
1255  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
1256  {
1257  mcIndex = kmcssPi0 ;
1258 
1259  //Fill histograms to check shape of embedded clusters
1260  if(GetReader()->IsEmbeddedClusterSelectionOn())
1261  {
1262  if (fraction > 0.9)
1263  {
1264  fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0, GetEventWeight());
1265  }
1266  else if(fraction > 0.5)
1267  {
1268  fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0, GetEventWeight());
1269  }
1270  else if(fraction > 0.1)
1271  {
1272  fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0, GetEventWeight());
1273  }
1274  else
1275  {
1276  fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0, GetEventWeight());
1277  }
1278  } // embedded
1279 
1280  }//pi0
1281  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
1282  {
1283  mcIndex = kmcssEta ;
1284  }//eta
1285  else
1286  {
1287  mcIndex = kmcssOther ;
1288  }//other particles
1289 
1290  fhMCELambda0 [mcIndex]->Fill(energy, lambda0, GetEventWeight());
1291  fhMCPtLambda0 [mcIndex]->Fill(pt , lambda0, GetEventWeight());
1292  fhMCELambda1 [mcIndex]->Fill(energy, lambda1, GetEventWeight());
1293  fhMCEDispersion [mcIndex]->Fill(energy, disp , GetEventWeight());
1294  fhMCNCellsE [mcIndex]->Fill(energy, ncells , GetEventWeight());
1295  fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction, GetEventWeight());
1296 
1298  {
1299  if (energy < 2.)
1300  {
1301  fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction, GetEventWeight());
1302  fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction, GetEventWeight());
1303  }
1304  else if(energy < 6.)
1305  {
1306  fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction, GetEventWeight());
1307  fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction, GetEventWeight());
1308  }
1309  else
1310  {
1311  fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction, GetEventWeight());
1312  fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction, GetEventWeight());
1313  }
1314 
1315  if(GetCalorimeter() == kEMCAL)
1316  {
1317  fhMCEDispEta [mcIndex]-> Fill(energy, dEta , GetEventWeight());
1318  fhMCEDispPhi [mcIndex]-> Fill(energy, dPhi , GetEventWeight());
1319  fhMCESumEtaPhi [mcIndex]-> Fill(energy, sEtaPhi , GetEventWeight());
1320  fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy, dPhi-dEta, GetEventWeight());
1321 
1322  if( dEta+dPhi > 0 ) fhMCESphericity[mcIndex]-> Fill(energy, (dPhi-dEta)/(dEta+dPhi), GetEventWeight());
1323 
1324  Int_t ebin = -1;
1325  if (energy < 2 ) ebin = 0;
1326  else if (energy < 4 ) ebin = 1;
1327  else if (energy < 6 ) ebin = 2;
1328  else if (energy < 10) ebin = 3;
1329  else if (energy < 15) ebin = 4;
1330  else if (energy < 20) ebin = 5;
1331  else ebin = 6;
1332 
1333  fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta , dPhi, GetEventWeight());
1334  fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0, dEta, GetEventWeight());
1335  fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0, dPhi, GetEventWeight());
1336  }
1337  }
1338  }// MC data
1339 }
1340 
1341 //__________________________________________________________________________
1347 //__________________________________________________________________________
1349  Int_t cut)
1350 {
1351  Float_t dZ = cluster->GetTrackDz();
1352  Float_t dR = cluster->GetTrackDx();
1353 
1354 // if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1355 // {
1356 // dR = 2000., dZ = 2000.;
1357 // GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
1358 // }
1359 
1360  AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
1361 
1362  Bool_t positive = kFALSE;
1363  if(track) positive = (track->Charge()>0);
1364 
1365  if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
1366  {
1367  fhTrackMatchedDEta[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1368  fhTrackMatchedDPhi[cut]->Fill(cluster->E(), dR, GetEventWeight());
1369  if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ, dR, GetEventWeight());
1370 
1371  if(track)
1372  {
1373  if(positive)
1374  {
1375  fhTrackMatchedDEtaPos[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1376  fhTrackMatchedDPhiPos[cut]->Fill(cluster->E(), dR, GetEventWeight());
1377  if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiPos[cut]->Fill(dZ,dR, GetEventWeight());
1378  }
1379  else
1380  {
1381  fhTrackMatchedDEtaNeg[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1382  fhTrackMatchedDPhiNeg[cut]->Fill(cluster->E(), dR, GetEventWeight());
1383  if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiNeg[cut]->Fill(dZ, dR, GetEventWeight());
1384  }
1385  }
1386 
1387  Int_t nSMod = GetModuleNumber(cluster);
1388 
1389  if( GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
1390  nSMod >= GetFirstSMCoveredByTRD() )
1391  {
1392  fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1393  fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(), dR, GetEventWeight());
1394  }
1395 
1396  // Check dEdx and E/p of matched clusters
1397 
1398  if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1399  {
1400  if(track)
1401  {
1402  Float_t dEdx = track->GetTPCsignal();
1403  Float_t eOverp = cluster->E()/track->P();
1404 
1405  fhdEdx[cut] ->Fill(cluster->E(), dEdx , GetEventWeight());
1406  fhEOverP[cut]->Fill(cluster->E(), eOverp, GetEventWeight());
1407 
1408  if(GetCalorimeter()==kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
1409  nSMod >= GetFirstSMCoveredByTRD() )
1410  fhEOverPTRD[cut]->Fill(cluster->E(), eOverp, GetEventWeight());
1411 
1412 
1413  }
1414  else
1415  AliWarning(Form("Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT?", dR,dZ));
1416 
1417  if(IsDataMC())
1418  {
1419 
1420  Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader(),GetCalorimeter());
1421 
1423  {
1426  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5, GetEventWeight());
1428  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5, GetEventWeight());
1430  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5, GetEventWeight());
1431  else
1432  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5, GetEventWeight());
1433 
1434  // Check if several particles contributed to cluster and discard overlapped mesons
1437  {
1438  if(cluster->GetNLabels()==1)
1439  {
1440  fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1441  fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(), dR, GetEventWeight());
1442  }
1443  else
1444  {
1445  fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1446  fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(), dR, GetEventWeight());
1447  }
1448 
1449  }// Check overlaps
1450 
1451  }
1452  else
1453  {
1456  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5, GetEventWeight());
1458  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5, GetEventWeight());
1460  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5, GetEventWeight());
1461  else
1462  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5, GetEventWeight());
1463 
1464  // Check if several particles contributed to cluster
1467  {
1468  fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1469  fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(), dR, GetEventWeight());
1470 
1471  }// Check overlaps
1472 
1473  }
1474 
1475  } // MC
1476 
1477  } // residuals window
1478 
1479  } // Small residual
1480 }
1481 
1482 //___________________________________________
1484 //___________________________________________
1486 {
1487  TString parList ; //this will be list of parameters used for this analysis.
1488  const Int_t buffersize = 255;
1489  char onePar[buffersize] ;
1490 
1491  snprintf(onePar,buffersize,"--- AliAnaPhoton ---:") ;
1492  parList+=onePar ;
1493  snprintf(onePar,buffersize,"Calorimeter: %s;",GetCalorimeterString().Data()) ;
1494  parList+=onePar ;
1495  snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster);",fMinDist) ;
1496  parList+=onePar ;
1497  snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation);",fMinDist2) ;
1498  parList+=onePar ;
1499  snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study);",fMinDist3) ;
1500  parList+=onePar ;
1501  snprintf(onePar,buffersize,"fRejectTrackMatch: %d",fRejectTrackMatch) ;
1502  parList+=onePar ;
1503 
1504  // Get parameters set in base class.
1505  parList += GetBaseParametersList() ;
1506 
1507  // Get parameters set in PID class.
1508  parList += GetCaloPID()->GetPIDParametersList() ;
1509 
1510  // Get parameters set in FiducialCut class (not available yet)
1511  //parlist += GetFidCut()->GetFidCutParametersList()
1512 
1513  return new TObjString(parList) ;
1514 }
1515 
1516 //_____________________________________________
1519 //_____________________________________________
1521 {
1522  TList * outputContainer = new TList() ;
1523  outputContainer->SetName("PhotonHistos") ;
1524 
1531 
1538 
1539  Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1542  Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1543  Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
1544  Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1545 
1546  Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1547 
1548  TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
1549  for (Int_t i = 0; i < 10 ; i++)
1550  {
1551  fhClusterCutsE[i] = new TH1F(Form("hE_Cut_%d_%s", i, cut[i].Data()),
1552  Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1553  nptbins,ptmin,ptmax);
1554  fhClusterCutsE[i]->SetYTitle("d#it{N}/d#it{E} ");
1555  fhClusterCutsE[i]->SetXTitle("#it{E} (GeV)");
1556  outputContainer->Add(fhClusterCutsE[i]) ;
1557 
1558  fhClusterCutsPt[i] = new TH1F(Form("hPt_Cut_%d_%s", i, cut[i].Data()),
1559  Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1560  nptbins,ptmin,ptmax);
1561  fhClusterCutsPt[i]->SetYTitle("d#it{N}/d#it{E} ");
1562  fhClusterCutsPt[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1563  outputContainer->Add(fhClusterCutsPt[i]) ;
1564  }
1565 
1566  fhEClusterSM = new TH2F("hEClusterSM","Raw clusters E and super-module number",
1567  nptbins,ptmin,ptmax,
1568  GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1569  fhEClusterSM->SetYTitle("SuperModule ");
1570  fhEClusterSM->SetXTitle("#it{E} (GeV)");
1571  outputContainer->Add(fhEClusterSM) ;
1572 
1573  fhPtClusterSM = new TH2F("hPtClusterSM","Raw clusters #it{p}_{T} and super-module number",
1574  nptbins,ptmin,ptmax,
1575  GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1576  fhPtClusterSM->SetYTitle("SuperModule ");
1577  fhPtClusterSM->SetXTitle("#it{E} (GeV)");
1578  outputContainer->Add(fhPtClusterSM) ;
1579 
1580  fhEPhotonSM = new TH2F("hEPhotonSM","Selected clusters E and super-module number",
1581  nptbins,ptmin,ptmax,
1582  GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1583  fhEPhotonSM->SetYTitle("SuperModule ");
1584  fhEPhotonSM->SetXTitle("#it{E} (GeV)");
1585  outputContainer->Add(fhEPhotonSM) ;
1586 
1587  fhPtPhotonSM = new TH2F("hPtPhotonSM","Selected clusters #it{p}_{T} and super-module number",
1588  nptbins,ptmin,ptmax,
1589  GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1590  fhPtPhotonSM->SetYTitle("SuperModule ");
1591  fhPtPhotonSM->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1592  outputContainer->Add(fhPtPhotonSM) ;
1593 
1594  fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
1595  fhNCellsE->SetXTitle("#it{E} (GeV)");
1596  fhNCellsE->SetYTitle("# of cells in cluster");
1597  outputContainer->Add(fhNCellsE);
1598 
1599  fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
1600  fhCellsE->SetXTitle("#it{E}_{cluster} (GeV)");
1601  fhCellsE->SetYTitle("#it{E}_{cell} (GeV)");
1602  outputContainer->Add(fhCellsE);
1603 
1604  fhTimePt = new TH2F ("hTimePt","time of cluster vs pT of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1605  fhTimePt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1606  fhTimePt->SetYTitle("#it{time} (ns)");
1607  outputContainer->Add(fhTimePt);
1608 
1609  fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1610  nptbins,ptmin,ptmax, 500,0,1.);
1611  fhMaxCellDiffClusterE->SetXTitle("#it{E}_{cluster} (GeV) ");
1612  fhMaxCellDiffClusterE->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
1613  outputContainer->Add(fhMaxCellDiffClusterE);
1614 
1615  fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
1616  fhEPhoton->SetYTitle("#it{counts}");
1617  fhEPhoton->SetXTitle("#it{E}_{#gamma}(GeV)");
1618  outputContainer->Add(fhEPhoton) ;
1619 
1620  fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs #it{p}_{T}",nptbins,ptmin,ptmax);
1621  fhPtPhoton->SetYTitle("#it{counts}");
1622  fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/#it{c})");
1623  outputContainer->Add(fhPtPhoton) ;
1624 
1626  {
1627  fhPtCentralityPhoton = new TH2F("hPtCentralityPhoton","centrality vs #it{p}_{T}",nptbins,ptmin,ptmax, 100,0,100);
1628  fhPtCentralityPhoton->SetYTitle("Centrality");
1629  fhPtCentralityPhoton->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1630  outputContainer->Add(fhPtCentralityPhoton) ;
1631 
1632  fhPtEventPlanePhoton = new TH2F("hPtEventPlanePhoton","centrality vs #it{p}_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1633  fhPtEventPlanePhoton->SetYTitle("Event plane angle (rad)");
1634  fhPtEventPlanePhoton->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1635  outputContainer->Add(fhPtEventPlanePhoton) ;
1636  }
1637 
1638  fhEtaPhi = new TH2F
1639  ("hEtaPhi","cluster,#it{E} > 0.5 GeV, #eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1640  fhEtaPhi->SetYTitle("#phi (rad)");
1641  fhEtaPhi->SetXTitle("#eta");
1642  outputContainer->Add(fhEtaPhi) ;
1643 
1644  fhPhiPhoton = new TH2F
1645  ("hPhiPhoton","#phi_{#gamma} vs #it{p}_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1646  fhPhiPhoton->SetYTitle("#phi (rad)");
1647  fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/#it{c})");
1648  outputContainer->Add(fhPhiPhoton) ;
1649 
1650  fhEtaPhoton = new TH2F
1651  ("hEtaPhoton","#eta_{#gamma} vs #it{p}_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
1652  fhEtaPhoton->SetYTitle("#eta");
1653  fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/#it{c})");
1654  outputContainer->Add(fhEtaPhoton) ;
1655 
1656  fhEtaPhiPhoton = new TH2F
1657  ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1658  fhEtaPhiPhoton->SetYTitle("#phi (rad)");
1659  fhEtaPhiPhoton->SetXTitle("#eta");
1660  outputContainer->Add(fhEtaPhiPhoton) ;
1661  if(GetMinPt() < 0.5)
1662  {
1663  fhEtaPhi05Photon = new TH2F
1664  ("hEtaPhi05Photon","#eta vs #phi, E < 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
1665  fhEtaPhi05Photon->SetYTitle("#phi (rad)");
1666  fhEtaPhi05Photon->SetXTitle("#eta");
1667  outputContainer->Add(fhEtaPhi05Photon) ;
1668  }
1669 
1670  fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
1671  nptbins,ptmin,ptmax,10,0,10);
1672  fhNLocMax ->SetYTitle("N maxima");
1673  fhNLocMax ->SetXTitle("#it{E} (GeV)");
1674  outputContainer->Add(fhNLocMax) ;
1675 
1676  //Shower shape
1677  if(fFillSSHistograms)
1678  {
1679  fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1680  fhLam0E->SetYTitle("#lambda_{0}^{2}");
1681  fhLam0E->SetXTitle("#it{E} (GeV)");
1682  outputContainer->Add(fhLam0E);
1683 
1684  fhLam0Pt = new TH2F ("hLam0Pt","#lambda_{0}^{2} vs #it{p}_{T}", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1685  fhLam0Pt->SetYTitle("#lambda_{0}^{2}");
1686  fhLam0Pt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1687  outputContainer->Add(fhLam0Pt);
1688 
1689  fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1690  fhLam1E->SetYTitle("#lambda_{1}^{2}");
1691  fhLam1E->SetXTitle("#it{E} (GeV)");
1692  outputContainer->Add(fhLam1E);
1693 
1694  fhLam1Pt = new TH2F ("hLam1Pt","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1695  fhLam1Pt->SetYTitle("#lambda_{1}^{2}");
1696  fhLam1Pt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1697  outputContainer->Add(fhLam1Pt);
1698 
1699  fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1700  fhDispE->SetYTitle("D^{2}");
1701  fhDispE->SetXTitle("#it{E} (GeV) ");
1702  outputContainer->Add(fhDispE);
1703 
1704  fhDispPt = new TH2F ("hDispPt"," dispersion^{2} vs #it{p}_{T}", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1705  fhDispPt->SetYTitle("D^{2}");
1706  fhDispPt->SetXTitle("#it{p}_{T} (GeV/#it{c}) ");
1707  outputContainer->Add(fhDispPt);
1708 
1710  {
1711  fhLam0PtNLM1 = new TH2F ("hLam0PtNLM1","#lambda_{0}^{2} vs #it{p}_{T}, #it{n}_{LM}=1", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1712  fhLam0PtNLM1->SetYTitle("#lambda_{0}^{2}");
1713  fhLam0PtNLM1->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1714  outputContainer->Add(fhLam0PtNLM1);
1715 
1716  fhLam0PtNLM2 = new TH2F ("hLam0PtNLM2","#lambda_{0}^{2} vs #it{p}_{T}, #it{n}_{LM}=2", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1717  fhLam0PtNLM2->SetYTitle("#lambda_{0}^{2}");
1718  fhLam0PtNLM2->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1719  outputContainer->Add(fhLam0PtNLM2);
1720 
1721  fhLam1PtNLM1 = new TH2F ("hLam1PtNLM1","#lambda_{1}^{2} vs #it{p}_{T}, #it{n}_{LM}=1", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1722  fhLam1PtNLM1->SetYTitle("#lambda_{1}^{2}");
1723  fhLam1PtNLM1->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1724  outputContainer->Add(fhLam1PtNLM1);
1725 
1726  fhLam1PtNLM2 = new TH2F ("hLam1PtNLM2","#lambda_{1}^{2} vs #it{p}_{T}, #it{n}_{LM}=2", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1727  fhLam1PtNLM2->SetYTitle("#lambda_{1}^{2}");
1728  fhLam1PtNLM2->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1729  outputContainer->Add(fhLam1PtNLM2);
1730  }
1731 
1732  if(!fRejectTrackMatch)
1733  {
1734  fhLam0ETM = new TH2F ("hLam0ETM","#lambda_{0}^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1735  fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
1736  fhLam0ETM->SetXTitle("#it{E} (GeV)");
1737  outputContainer->Add(fhLam0ETM);
1738 
1739  fhLam0PtTM = new TH2F ("hLam0PtTM","#lambda_{0}^{2} vs #it{p}_{T}, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1740  fhLam0PtTM->SetYTitle("#lambda_{0}^{2}");
1741  fhLam0PtTM->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1742  outputContainer->Add(fhLam0PtTM);
1743 
1744  fhLam1ETM = new TH2F ("hLam1ETM","#lambda_{1}^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1745  fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
1746  fhLam1ETM->SetXTitle("#it{E} (GeV)");
1747  outputContainer->Add(fhLam1ETM);
1748 
1749  fhDispETM = new TH2F ("hDispETM"," dispersion^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1750  fhDispETM->SetYTitle("D^{2}");
1751  fhDispETM->SetXTitle("#it{E} (GeV) ");
1752  outputContainer->Add(fhDispETM);
1753  }
1754 
1755  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0)
1756  {
1757  fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1758  fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
1759  fhLam0ETRD->SetXTitle("#it{E} (GeV)");
1760  outputContainer->Add(fhLam0ETRD);
1761 
1762  fhLam0PtTRD = new TH2F ("hLam0PtTRD","#lambda_{0}^{2} vs #it{p}_{T}, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1763  fhLam0PtTRD->SetYTitle("#lambda_{0}^{2}");
1764  fhLam0PtTRD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1765  outputContainer->Add(fhLam0PtTRD);
1766 
1767  fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1768  fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
1769  fhLam1ETRD->SetXTitle("#it{E} (GeV)");
1770  outputContainer->Add(fhLam1ETRD);
1771 
1772  fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1773  fhDispETRD->SetYTitle("Dispersion^{2}");
1774  fhDispETRD->SetXTitle("#it{E} (GeV) ");
1775  outputContainer->Add(fhDispETRD);
1776 
1778  {
1779  fhLam0ETMTRD = new TH2F ("hLam0ETMTRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1780  fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
1781  fhLam0ETMTRD->SetXTitle("#it{E} (GeV)");
1782  outputContainer->Add(fhLam0ETMTRD);
1783 
1784  fhLam0PtTMTRD = new TH2F ("hLam0PtTMTRD","#lambda_{0}^{2} vs #it{p}_{T}, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1785  fhLam0PtTMTRD->SetYTitle("#lambda_{0}^{2}");
1786  fhLam0PtTMTRD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1787  outputContainer->Add(fhLam0PtTMTRD);
1788 
1789  fhLam1ETMTRD = new TH2F ("hLam1ETMTRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1790  fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
1791  fhLam1ETMTRD->SetXTitle("#it{E} (GeV)");
1792  outputContainer->Add(fhLam1ETMTRD);
1793 
1794  fhDispETMTRD = new TH2F ("hDispETMTRD"," dispersion^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1795  fhDispETMTRD->SetYTitle("Dispersion^{2}");
1796  fhDispETMTRD->SetXTitle("#it{E} (GeV) ");
1797  outputContainer->Add(fhDispETMTRD);
1798  }
1799  }
1800 
1802  {
1803  fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1804  fhNCellsLam0LowE->SetXTitle("N_{cells}");
1805  fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
1806  outputContainer->Add(fhNCellsLam0LowE);
1807 
1808  fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, #it{E} > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1809  fhNCellsLam0HighE->SetXTitle("N_{cells}");
1810  fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
1811  outputContainer->Add(fhNCellsLam0HighE);
1812 
1813  fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1814  fhNCellsLam1LowE->SetXTitle("N_{cells}");
1815  fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
1816  outputContainer->Add(fhNCellsLam1LowE);
1817 
1818  fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, #it{E} > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1819  fhNCellsLam1HighE->SetXTitle("N_{cells}");
1820  fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
1821  outputContainer->Add(fhNCellsLam1HighE);
1822 
1823  fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1824  fhNCellsDispLowE->SetXTitle("N_{cells}");
1825  fhNCellsDispLowE->SetYTitle("D^{2}");
1826  outputContainer->Add(fhNCellsDispLowE);
1827 
1828  fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1829  fhNCellsDispHighE->SetXTitle("N_{cells}");
1830  fhNCellsDispHighE->SetYTitle("D^{2}");
1831  outputContainer->Add(fhNCellsDispHighE);
1832 
1833  fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1834  fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
1835  fhEtaLam0LowE->SetXTitle("#eta");
1836  outputContainer->Add(fhEtaLam0LowE);
1837 
1838  fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1839  fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
1840  fhPhiLam0LowE->SetXTitle("#phi");
1841  outputContainer->Add(fhPhiLam0LowE);
1842 
1843  fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, #it{E} > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1844  fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
1845  fhEtaLam0HighE->SetXTitle("#eta");
1846  outputContainer->Add(fhEtaLam0HighE);
1847 
1848  fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, #it{E} > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1849  fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
1850  fhPhiLam0HighE->SetXTitle("#phi");
1851  outputContainer->Add(fhPhiLam0HighE);
1852 
1853  fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1854  fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
1855  fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
1856  outputContainer->Add(fhLam1Lam0LowE);
1857 
1858  fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of #it{E} > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1859  fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
1860  fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
1861  outputContainer->Add(fhLam1Lam0HighE);
1862 
1863  fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1864  fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
1865  fhLam0DispLowE->SetYTitle("D^{2}");
1866  outputContainer->Add(fhLam0DispLowE);
1867 
1868  fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of #it{E} > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1869  fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
1870  fhLam0DispHighE->SetYTitle("D^{2}");
1871  outputContainer->Add(fhLam0DispHighE);
1872 
1873  fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1874  fhDispLam1LowE->SetXTitle("D^{2}");
1875  fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
1876  outputContainer->Add(fhDispLam1LowE);
1877 
1878  fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of #it{E} > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1879  fhDispLam1HighE->SetXTitle("D^{2}");
1880  fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
1881  outputContainer->Add(fhDispLam1HighE);
1882 
1883  if(GetCalorimeter() == kEMCAL)
1884  {
1885  fhDispEtaE = new TH2F ("hDispEtaE","#sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E", nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1886  fhDispEtaE->SetXTitle("#it{E} (GeV)");
1887  fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
1888  outputContainer->Add(fhDispEtaE);
1889 
1890  fhDispPhiE = new TH2F ("hDispPhiE","#sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E", nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1891  fhDispPhiE->SetXTitle("#it{E} (GeV)");
1892  fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
1893  outputContainer->Add(fhDispPhiE);
1894 
1895  fhSumEtaE = new TH2F ("hSumEtaE","#delta^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i})^{2} / #Sigma w_{i} - <#eta>^{2} vs E", nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1896  fhSumEtaE->SetXTitle("#it{E} (GeV)");
1897  fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
1898  outputContainer->Add(fhSumEtaE);
1899 
1900  fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
1901  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1902  fhSumPhiE->SetXTitle("#it{E} (GeV)");
1903  fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
1904  outputContainer->Add(fhSumPhiE);
1905 
1906  fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
1907  nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1908  fhSumEtaPhiE->SetXTitle("#it{E} (GeV)");
1909  fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
1910  outputContainer->Add(fhSumEtaPhiE);
1911 
1912  fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
1913  nptbins,ptmin,ptmax,200, -10,10);
1914  fhDispEtaPhiDiffE->SetXTitle("#it{E} (GeV)");
1915  fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1916  outputContainer->Add(fhDispEtaPhiDiffE);
1917 
1918  fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
1919  nptbins,ptmin,ptmax, 200, -1,1);
1920  fhSphericityE->SetXTitle("#it{E} (GeV)");
1921  fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1922  outputContainer->Add(fhSphericityE);
1923 
1924  fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1925  fhDispSumEtaDiffE->SetXTitle("#it{E} (GeV)");
1926  fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
1927  outputContainer->Add(fhDispSumEtaDiffE);
1928 
1929  fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1930  fhDispSumPhiDiffE->SetXTitle("#it{E} (GeV)");
1931  fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
1932  outputContainer->Add(fhDispSumPhiDiffE);
1933 
1934  for(Int_t i = 0; i < 7; i++)
1935  {
1936  fhDispEtaDispPhi[i] = new TH2F (Form("hDispEtaDispPhi_EBin%d",i),Form("#sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",bin[i],bin[i+1]),
1937  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1938  fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1939  fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1940  outputContainer->Add(fhDispEtaDispPhi[i]);
1941 
1942  fhLambda0DispEta[i] = new TH2F (Form("hLambda0DispEta_EBin%d",i),Form("#lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",bin[i],bin[i+1]),
1943  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1944  fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
1945  fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1946  outputContainer->Add(fhLambda0DispEta[i]);
1947 
1948  fhLambda0DispPhi[i] = new TH2F (Form("hLambda0DispPhi_EBin%d",i),Form("#lambda^{2}_{0}} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",bin[i],bin[i+1]),
1949  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1950  fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
1951  fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1952  outputContainer->Add(fhLambda0DispPhi[i]);
1953  }
1954  }
1955  }
1956  } // Shower shape
1957 
1958  // Track Matching
1959 
1960  if(fFillTMHisto)
1961  {
1962  TString cutTM [] = {"NoCut",""};
1963 
1964  for(Int_t i = 0; i < 2; i++)
1965  {
1966  fhTrackMatchedDEta[i] = new TH2F
1967  (Form("hTrackMatchedDEta%s",cutTM[i].Data()),
1968  Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1969  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1970  fhTrackMatchedDEta[i]->SetYTitle("d#eta");
1971  fhTrackMatchedDEta[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1972 
1973  fhTrackMatchedDPhi[i] = new TH2F
1974  (Form("hTrackMatchedDPhi%s",cutTM[i].Data()),
1975  Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1976  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1977  fhTrackMatchedDPhi[i]->SetYTitle("d#phi (rad)");
1978  fhTrackMatchedDPhi[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1979 
1980  fhTrackMatchedDEtaDPhi[i] = new TH2F
1981  (Form("hTrackMatchedDEtaDPhi%s",cutTM[i].Data()),
1982  Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1983  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1984  fhTrackMatchedDEtaDPhi[i]->SetYTitle("d#phi (rad)");
1985  fhTrackMatchedDEtaDPhi[i]->SetXTitle("d#eta");
1986 
1987  fhTrackMatchedDEtaPos[i] = new TH2F
1988  (Form("hTrackMatchedDEtaPos%s",cutTM[i].Data()),
1989  Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1990  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1991  fhTrackMatchedDEtaPos[i]->SetYTitle("d#eta");
1992  fhTrackMatchedDEtaPos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1993 
1994  fhTrackMatchedDPhiPos[i] = new TH2F
1995  (Form("hTrackMatchedDPhiPos%s",cutTM[i].Data()),
1996  Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1997  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1998  fhTrackMatchedDPhiPos[i]->SetYTitle("d#phi (rad)");
1999  fhTrackMatchedDPhiPos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2000 
2002  (Form("hTrackMatchedDEtaDPhiPos%s",cutTM[i].Data()),
2003  Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2004  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2005  fhTrackMatchedDEtaDPhiPos[i]->SetYTitle("d#phi (rad)");
2006  fhTrackMatchedDEtaDPhiPos[i]->SetXTitle("d#eta");
2007 
2008  fhTrackMatchedDEtaNeg[i] = new TH2F
2009  (Form("hTrackMatchedDEtaNeg%s",cutTM[i].Data()),
2010  Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2011  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2012  fhTrackMatchedDEtaNeg[i]->SetYTitle("d#eta");
2013  fhTrackMatchedDEtaNeg[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2014 
2015  fhTrackMatchedDPhiNeg[i] = new TH2F
2016  (Form("hTrackMatchedDPhiNeg%s",cutTM[i].Data()),
2017  Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2018  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2019  fhTrackMatchedDPhiNeg[i]->SetYTitle("d#phi (rad)");
2020  fhTrackMatchedDPhiNeg[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2021 
2023  (Form("hTrackMatchedDEtaDPhiNeg%s",cutTM[i].Data()),
2024  Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2025  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2026  fhTrackMatchedDEtaDPhiNeg[i]->SetYTitle("d#phi (rad)");
2027  fhTrackMatchedDEtaDPhiNeg[i]->SetXTitle("d#eta");
2028 
2029  fhdEdx[i] = new TH2F (Form("hdEdx%s",cutTM[i].Data()),Form("matched track <dE/dx> vs cluster E, %s",cutTM[i].Data()),
2030  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
2031  fhdEdx[i]->SetXTitle("#it{E} (GeV)");
2032  fhdEdx[i]->SetYTitle("<dE/dx>");
2033 
2034  fhEOverP[i] = new TH2F (Form("hEOverP%s",cutTM[i].Data()),Form("matched track E/p vs cluster E, %s",cutTM[i].Data()),
2035  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2036  fhEOverP[i]->SetXTitle("#it{E} (GeV)");
2037  fhEOverP[i]->SetYTitle("E/p");
2038 
2039  outputContainer->Add(fhTrackMatchedDEta[i]) ;
2040  outputContainer->Add(fhTrackMatchedDPhi[i]) ;
2041  outputContainer->Add(fhTrackMatchedDEtaDPhi[i]) ;
2042  outputContainer->Add(fhTrackMatchedDEtaPos[i]) ;
2043  outputContainer->Add(fhTrackMatchedDPhiPos[i]) ;
2044  outputContainer->Add(fhTrackMatchedDEtaDPhiPos[i]) ;
2045  outputContainer->Add(fhTrackMatchedDEtaNeg[i]) ;
2046  outputContainer->Add(fhTrackMatchedDPhiNeg[i]) ;
2047  outputContainer->Add(fhTrackMatchedDEtaDPhiNeg[i]) ;
2048  outputContainer->Add(fhdEdx[i]);
2049  outputContainer->Add(fhEOverP[i]);
2050 
2052  {
2053  fhTrackMatchedDEtaTRD[i] = new TH2F
2054  (Form("hTrackMatchedDEtaTRD%s",cutTM[i].Data()),
2055  Form("d#eta of cluster-track vs cluster energy, SM behind TRD, %s",cutTM[i].Data()),
2056  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2057  fhTrackMatchedDEtaTRD[i]->SetYTitle("d#eta");
2058  fhTrackMatchedDEtaTRD[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2059 
2060  fhTrackMatchedDPhiTRD[i] = new TH2F
2061  (Form("hTrackMatchedDPhiTRD%s",cutTM[i].Data()),
2062  Form("d#phi of cluster-track vs cluster energy, SM behing TRD, %s",cutTM[i].Data()),
2063  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2064  fhTrackMatchedDPhiTRD[i]->SetYTitle("d#phi (rad)");
2065  fhTrackMatchedDPhiTRD[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2066 
2067  fhEOverPTRD[i] = new TH2F
2068  (Form("hEOverPTRD%s",cutTM[i].Data()),
2069  Form("matched track E/p vs cluster E, behind TRD, %s",cutTM[i].Data()),
2070  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2071  fhEOverPTRD[i]->SetXTitle("#it{E} (GeV)");
2072  fhEOverPTRD[i]->SetYTitle("E/p");
2073 
2074  outputContainer->Add(fhTrackMatchedDEtaTRD[i]) ;
2075  outputContainer->Add(fhTrackMatchedDPhiTRD[i]) ;
2076  outputContainer->Add(fhEOverPTRD[i]);
2077  }
2078 
2079  if(IsDataMC())
2080  {
2082  (Form("hTrackMatchedDEtaMCNoOverlap%s",cutTM[i].Data()),
2083  Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
2084  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2085  fhTrackMatchedDEtaMCNoOverlap[i]->SetYTitle("d#eta");
2086  fhTrackMatchedDEtaMCNoOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2087 
2089  (Form("hTrackMatchedDPhiMCNoOverlap%s",cutTM[i].Data()),
2090  Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
2091  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2092  fhTrackMatchedDPhiMCNoOverlap[i]->SetYTitle("d#phi (rad)");
2093  fhTrackMatchedDPhiMCNoOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2094 
2095  outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[i]) ;
2096  outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[i]) ;
2098  (Form("hTrackMatchedDEtaMCOverlap%s",cutTM[i].Data()),
2099  Form("d#eta of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
2100  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2101  fhTrackMatchedDEtaMCOverlap[i]->SetYTitle("d#eta");
2102  fhTrackMatchedDEtaMCOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2103 
2105  (Form("hTrackMatchedDPhiMCOverlap%s",cutTM[i].Data()),
2106  Form("d#phi of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
2107  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2108  fhTrackMatchedDPhiMCOverlap[i]->SetYTitle("d#phi (rad)");
2109  fhTrackMatchedDPhiMCOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2110 
2111  outputContainer->Add(fhTrackMatchedDEtaMCOverlap[i]) ;
2112  outputContainer->Add(fhTrackMatchedDPhiMCOverlap[i]) ;
2113 
2115  (Form("hTrackMatchedDEtaMCConversion%s",cutTM[i].Data()),
2116  Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
2117  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2118  fhTrackMatchedDEtaMCConversion[i]->SetYTitle("d#eta");
2119  fhTrackMatchedDEtaMCConversion[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2120 
2122  (Form("hTrackMatchedDPhiMCConversion%s",cutTM[i].Data()),
2123  Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
2124  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2125  fhTrackMatchedDPhiMCConversion[i]->SetYTitle("d#phi (rad)");
2126  fhTrackMatchedDPhiMCConversion[i]->SetXTitle("#it{E}_{cluster} (GeV)");
2127 
2128  outputContainer->Add(fhTrackMatchedDEtaMCConversion[i]) ;
2129  outputContainer->Add(fhTrackMatchedDPhiMCConversion[i]) ;
2130 
2132  (Form("hTrackMatchedMCParticle%s",cutTM[i].Data()),
2133  Form("Origin of particle vs energy %s",cutTM[i].Data()),
2134  nptbins,ptmin,ptmax,8,0,8);
2135  fhTrackMatchedMCParticle[i]->SetXTitle("#it{E} (GeV)");
2136  //fhTrackMatchedMCParticle[i]->SetYTitle("Particle type");
2137 
2138  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(1 ,"Photon");
2139  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(2 ,"Electron");
2140  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
2141  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(4 ,"Rest");
2142  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
2143  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
2144  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
2145  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
2146 
2147  outputContainer->Add(fhTrackMatchedMCParticle[i]);
2148  }
2149  }
2150  }
2151 
2152  if(IsPileUpAnalysisOn())
2153  {
2154  TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
2155 
2156  for(Int_t i = 0 ; i < 7 ; i++)
2157  {
2158  fhPtPhotonPileUp[i] = new TH1F(Form("hPtPhotonPileUp%s",pileUpName[i].Data()),
2159  Form("Selected photon #it{p}_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2160  fhPtPhotonPileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2161  outputContainer->Add(fhPtPhotonPileUp[i]);
2162 
2163  fhClusterTimeDiffPhotonPileUp[i] = new TH2F(Form("hClusterTimeDiffPhotonPileUp%s",pileUpName[i].Data()),
2164  Form("Photon cluster E vs #it{t}_{max}-#it{t}_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2165  nptbins,ptmin,ptmax,400,-200,200);
2166  fhClusterTimeDiffPhotonPileUp[i]->SetXTitle("#it{E} (GeV)");
2167  fhClusterTimeDiffPhotonPileUp[i]->SetYTitle("#it{t}_{max}-#it{t}_{cell} (ns)");
2168  outputContainer->Add(fhClusterTimeDiffPhotonPileUp[i]);
2169  }
2170 
2171  fhTimePtPhotonNoCut = new TH2F ("hTimePtPhoton_NoCut","time of photon cluster vs pT of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2172  fhTimePtPhotonNoCut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2173  fhTimePtPhotonNoCut->SetYTitle("#it{time} (ns)");
2174  outputContainer->Add(fhTimePtPhotonNoCut);
2175 
2176  fhTimePtPhotonSPD = new TH2F ("hTimePtPhoton_SPD","time of photon cluster vs pT of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2177  fhTimePtPhotonSPD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2178  fhTimePtPhotonSPD->SetYTitle("#it{time} (ns)");
2179  outputContainer->Add(fhTimePtPhotonSPD);
2180 
2181  fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,20,0,20);
2182  fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
2183  fhTimeNPileUpVertSPD->SetXTitle("#it{time} (ns)");
2184  outputContainer->Add(fhTimeNPileUpVertSPD);
2185 
2186  fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 20,0,20 );
2187  fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
2188  fhTimeNPileUpVertTrack->SetXTitle("#it{time} (ns)");
2189  outputContainer->Add(fhTimeNPileUpVertTrack);
2190 
2191  fhPtPhotonNPileUpSPDVtx = new TH2F ("hPtPhoton_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
2192  nptbins,ptmin,ptmax,20,0,20);
2193  fhPtPhotonNPileUpSPDVtx->SetYTitle("# vertex ");
2194  fhPtPhotonNPileUpSPDVtx->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2195  outputContainer->Add(fhPtPhotonNPileUpSPDVtx);
2196 
2197  fhPtPhotonNPileUpTrkVtx = new TH2F ("hPtPhoton_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
2198  nptbins,ptmin,ptmax, 20,0,20 );
2199  fhPtPhotonNPileUpTrkVtx->SetYTitle("# vertex ");
2200  fhPtPhotonNPileUpTrkVtx->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2201  outputContainer->Add(fhPtPhotonNPileUpTrkVtx);
2202 
2203  fhPtPhotonNPileUpSPDVtxTimeCut = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut","pT of cluster vs N pile-up SPD vertex, |tof| < 25 ns",
2204  nptbins,ptmin,ptmax,20,0,20);
2205  fhPtPhotonNPileUpSPDVtxTimeCut->SetYTitle("# vertex ");
2206  fhPtPhotonNPileUpSPDVtxTimeCut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2207  outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut);
2208 
2209  fhPtPhotonNPileUpTrkVtxTimeCut = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut","pT of cluster vs N pile-up Tracks vertex, |tof| < 25 ns",
2210  nptbins,ptmin,ptmax, 20,0,20 );
2211  fhPtPhotonNPileUpTrkVtxTimeCut->SetYTitle("# vertex ");
2212  fhPtPhotonNPileUpTrkVtxTimeCut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2213  outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut);
2214 
2215  fhPtPhotonNPileUpSPDVtxTimeCut2 = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut2","pT of cluster vs N pile-up SPD vertex, -25 < tof < 75 ns",
2216  nptbins,ptmin,ptmax,20,0,20);
2217  fhPtPhotonNPileUpSPDVtxTimeCut2->SetYTitle("# vertex ");
2218  fhPtPhotonNPileUpSPDVtxTimeCut2->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2219  outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut2);
2220 
2221  fhPtPhotonNPileUpTrkVtxTimeCut2 = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut2","pT of cluster vs N pile-up Tracks vertex, -25 < tof < 75 ns",
2222  nptbins,ptmin,ptmax, 20,0,20 );
2223  fhPtPhotonNPileUpTrkVtxTimeCut2->SetYTitle("# vertex ");
2224  fhPtPhotonNPileUpTrkVtxTimeCut2->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2225  outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut2);
2226 
2227  }
2228 
2230  {
2231  for(Int_t ieta = 0; ieta < 4; ieta++)
2232  {
2233  for(Int_t iphi = 0; iphi < 3; iphi++)
2234  {
2235 // fhLam0EMCALRegion[ieta][iphi] =
2236 // new TH2F(Form("hLam0_eta%d_phi%d",ieta,iphi),
2237 // Form("cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, region eta %d, phi %d",ieta,iphi),
2238 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2239 // fhLam0EMCALRegion[ieta][iphi]->SetYTitle("#lambda_{0}^{2}");
2240 // fhLam0EMCALRegion[ieta][iphi]->SetXTitle("#it{p}_{T} (GeV)");
2241 // outputContainer->Add(fhLam0EMCALRegion[ieta][iphi]) ;
2242 //
2243 // if(GetFirstSMCoveredByTRD() >= 0)
2244 // {
2245 // fhLam0EMCALRegionTRD[ieta][iphi] =
2246 // new TH2F(Form("hLam0TRD_eta%d_phi%d",ieta,iphi),
2247 // Form("cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, region eta %d, phi %d, SM covered by TRD",ieta,iphi),
2248 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2249 // fhLam0EMCALRegionTRD[ieta][iphi]->SetYTitle("#lambda_{0}^{2}");
2250 // fhLam0EMCALRegionTRD[ieta][iphi]->SetXTitle("#it{p}_{T} (GeV)");
2251 // outputContainer->Add(fhLam0EMCALRegionTRD[ieta][iphi]) ;
2252 // } // TRD
2253 
2254  for(Int_t ism = 0; ism < GetCaloUtils()->GetNumberOfSuperModulesUsed(); ism++)
2255  {
2256  fhLam0EMCALRegionPerSM[ieta][iphi][ism] =
2257  new TH2F(Form("hLam0_eta%d_phi%d_sm%d",ieta,iphi,ism),
2258  Form("cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, sm %d, region eta %d, phi %d",ism,ieta,iphi),
2259  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2260  fhLam0EMCALRegionPerSM[ieta][iphi][ism]->SetYTitle("#lambda_{0}^{2}");
2261  fhLam0EMCALRegionPerSM[ieta][iphi][ism]->SetXTitle("#it{p}_{T} (GeV)");
2262  outputContainer->Add(fhLam0EMCALRegionPerSM[ieta][iphi][ism]) ;
2263 
2264  fhLam1EMCALRegionPerSM[ieta][iphi][ism] =
2265  new TH2F(Form("hLam1_eta%d_phi%d_sm%d",ieta,iphi,ism),
2266  Form("cluster from converted photon, #it{p}_{T} vs #lambda_{1}^{2}, sm %d, region eta %d, phi %d",ism,ieta,iphi),
2267  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2268  fhLam1EMCALRegionPerSM[ieta][iphi][ism]->SetYTitle("#lambda_{1}^{2}");
2269  fhLam1EMCALRegionPerSM[ieta][iphi][ism]->SetXTitle("#it{p}_{T} (GeV)");
2270  outputContainer->Add(fhLam1EMCALRegionPerSM[ieta][iphi][ism]) ;
2271  }
2272  } // iphi
2273  } // ieta
2274 
2275  Float_t ptLimit[] = {2,3,4,5,6,8,10,12};
2276  TString l0bin [] = {"0.23<#lambda^{2}_{0}<0.26","0.3<#lambda^{2}_{0}<0.4"};
2277 
2278  for(Int_t il0 = 0; il0 < 2; il0++)
2279  {
2280  for(Int_t ipt = 0; ipt < 7; ipt++)
2281  {
2282  fhEtaPhiLam0BinPtBin[il0][ipt] = new TH2F
2283  (Form("hEtaPhiLam0Bin%d_PtBin%d",il0,ipt),
2284  Form("#eta vs #phi in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, %s",
2285  ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2286  netabins,etamin,etamax,nphibins,phimin,phimax);
2287  fhEtaPhiLam0BinPtBin[il0][ipt]->SetYTitle("#phi (rad)");
2288  fhEtaPhiLam0BinPtBin[il0][ipt]->SetXTitle("#eta");
2289  outputContainer->Add(fhEtaPhiLam0BinPtBin[il0][ipt]) ;
2290 
2291  fhColRowLam0BinPtBin[il0][ipt] = new TH2F
2292  (Form("hColRowLam0Bin%d_PtBin%d",il0,ipt),
2293  Form("row vs column in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, %s, w > 0",
2294  ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2295  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5); // fix to generalize to other periods
2296  fhColRowLam0BinPtBin[il0][ipt]->SetYTitle("row");
2297  fhColRowLam0BinPtBin[il0][ipt]->SetXTitle("column");
2298  outputContainer->Add(fhColRowLam0BinPtBin[il0][ipt]) ;
2299 
2300  fhColRowLam0BinPtBinWeighted[il0][ipt] = new TH2F
2301  (Form("hColRowLam0Bin%d_PtBin%dWeighted",il0,ipt),
2302  Form("cluster cell row vs column weighted in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, %s",
2303  ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2304  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5); // fix to generalize to other periods
2305  fhColRowLam0BinPtBinWeighted[il0][ipt]->SetYTitle("row");
2306  fhColRowLam0BinPtBinWeighted[il0][ipt]->SetXTitle("column");
2307  outputContainer->Add(fhColRowLam0BinPtBinWeighted[il0][ipt]) ;
2308 
2309  fhColRowLam0BinPtBinLargeTime[il0][ipt] = new TH2F
2310  (Form("hColRowLam0Bin%d_PtBin%d_LargeTimeInClusterCell",il0,ipt),
2311  Form("row vs column in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, %s, |t| > 50 ns, w > 0",
2312  ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2313  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5); // fix to generalize to other periods
2314  fhColRowLam0BinPtBinLargeTime[il0][ipt]->SetYTitle("row");
2315  fhColRowLam0BinPtBinLargeTime[il0][ipt]->SetXTitle("column");
2316  outputContainer->Add(fhColRowLam0BinPtBinLargeTime[il0][ipt]) ;
2317 
2318 // fhEtaPhiLam0BinPtBinSMShared[il0][ipt] = new TH2F
2319 // (Form("hEtaPhiLam0Bin%d_PtBin%d_SMShared",il0,ipt),
2320 // Form("#eta vs #phi in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, %s",
2321 // ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2322 // netabins,etamin,etamax,nphibins,phimin,phimax);
2323 // fhEtaPhiLam0BinPtBinSMShared[il0][ipt]->SetYTitle("#phi (rad)");
2324 // fhEtaPhiLam0BinPtBinSMShared[il0][ipt]->SetXTitle("#eta");
2325 // outputContainer->Add(fhEtaPhiLam0BinPtBinSMShared[il0][ipt]) ;
2326 //
2327 // fhColRowLam0BinPtBinSMShared[il0][ipt] = new TH2F
2328 // (Form("hColRowLam0Bin%d_PtBin%d_SMShared",il0,ipt),
2329 // Form("row vs column in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, %s, w > 0",
2330 // ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2331 // 96,0,96,5*24,0,5*24); // fix to generalize to other periods
2332 // fhColRowLam0BinPtBinSMShared[il0][ipt]->SetYTitle("row");
2333 // fhColRowLam0BinPtBinSMShared[il0][ipt]->SetXTitle("column");
2334 // outputContainer->Add(fhColRowLam0BinPtBinSMShared[il0][ipt]) ;
2335 
2336  fhEtaPhiLargeTimeInClusterCell[il0][ipt] = new TH2F
2337  (Form("hEtaPhiLam0Bin%d_PtBin%d_LargeTimeInClusterCell",il0,ipt),
2338  Form("#eta vs #phi in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, w > 0, t > 50 ns, %s",
2339  ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2340  netabins,etamin,etamax,nphibins,phimin,phimax);
2341  fhEtaPhiLargeTimeInClusterCell[il0][ipt]->SetYTitle("#phi (rad)");
2342  fhEtaPhiLargeTimeInClusterCell[il0][ipt]->SetXTitle("#eta");
2343  outputContainer->Add(fhEtaPhiLargeTimeInClusterCell[il0][ipt]) ;
2344 
2345  fhCellClusterIndexEAndTime[il0][ipt] = new TH2F
2346  (Form("hCellClusterIndexEAndTimeLam0Bin%d_PtBin%d",il0,ipt),
2347  Form("#it{t}_{cell} vs cell index (E sorted) in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, w > 0, %s",
2348  ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2349  ntimebins,timemin,timemax,30,0,30);
2350  fhCellClusterIndexEAndTime[il0][ipt] ->SetYTitle("Index (sorted #it{E})");
2351  fhCellClusterIndexEAndTime[il0][ipt] ->SetXTitle("#it{time}_{cell} (ns)");
2352  outputContainer->Add(fhCellClusterIndexEAndTime[il0][ipt] ) ;
2353 
2354  fhCellClusterEAndTime[il0][ipt] = new TH2F
2355  (Form("hCellClusterEAndTimeLam0Bin%d_PtBin%d",il0,ipt),
2356  Form("#it{E}_{cell} vs #it{t}_{cell} in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, w > 0, %s",
2357  ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2358  ntimebins,timemin,timemax,100,0,5);
2359  fhCellClusterEAndTime[il0][ipt] ->SetYTitle("#it{E}_{cell} (GeV)");
2360  fhCellClusterEAndTime[il0][ipt] ->SetXTitle("#it{time}_{cell} (ns)");
2361  outputContainer->Add(fhCellClusterEAndTime[il0][ipt] ) ;
2362 
2363  fhCellClusterEFracAndTime[il0][ipt] = new TH2F
2364  (Form("hCellClusterEFracAndTimeLam0Bin%d_PtBin%d",il0,ipt),
2365  Form("#it{E}_{cell} vs #it{t}_{cell} in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c}, w > 0, %s",
2366  ptLimit[ipt],ptLimit[ipt+1],l0bin[il0].Data()),
2367  ntimebins,timemin,timemax,100,0,1);
2368  fhCellClusterEFracAndTime[il0][ipt] ->SetYTitle("#it{E}_{cell} (GeV)");
2369  fhCellClusterEFracAndTime[il0][ipt] ->SetXTitle("#it{time}_{cell} (ns)");
2370  outputContainer->Add(fhCellClusterEFracAndTime[il0][ipt] ) ;
2371  } // pt bin
2372 
2373  for(Int_t ism = 0; ism < GetCaloUtils()->GetNumberOfSuperModulesUsed(); ism++)
2374  {
2375  fhLam1Lam0BinPerSM[il0][ism] = new TH2F
2376  (Form("hLam1Lam0Bin%d_sm%d",il0,ism),
2377  Form("#it{p}_{T} vs #lambda^{2}_{1} in sm %d, %s",ism,l0bin[il0].Data()),
2378  nptbins,ptmin,ptmax,40,0,0.4);
2379  fhLam1Lam0BinPerSM[il0][ism]->SetYTitle("#lambda^{2}_{1}");
2380  fhLam1Lam0BinPerSM[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2381  outputContainer->Add(fhLam1Lam0BinPerSM[il0][ism]) ;
2382 
2383  fhTimeLam0BinPerSM[il0][ism] = new TH2F
2384  (Form("hTimeLam0Bin%d_sm%d",il0,ism),
2385  Form("#it{p}_{T} vs cluster cell time in sm %d, %s, w > 0",ism,l0bin[il0].Data()),
2386  nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2387  fhTimeLam0BinPerSM[il0][ism]->SetYTitle("cell time (ns)");
2388  fhTimeLam0BinPerSM[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2389  outputContainer->Add(fhTimeLam0BinPerSM[il0][ism]) ;
2390 
2391  fhTimeLam0BinPerSMWeighted[il0][ism] = new TH2F
2392  (Form("hTimeLam0Bin%d_sm%d_Weighted",il0,ism),
2393  Form("#it{p}_{T} vs cluster cell time weighted in sm %d, %s",ism,l0bin[il0].Data()),
2394  nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2395  fhTimeLam0BinPerSMWeighted[il0][ism]->SetYTitle("cell time (ns)");
2396  fhTimeLam0BinPerSMWeighted[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2397  outputContainer->Add(fhTimeLam0BinPerSMWeighted[il0][ism]) ;
2398 
2399  fhDTimeLam0BinPerSM[il0][ism] = new TH2F
2400  (Form("hDTimeLam0Bin%d_sm%d",il0,ism),
2401  Form("#it{p}_{T} vs t_{cluster}-t_{cell} in sm %d, %s, w > 0",ism,l0bin[il0].Data()),
2402  nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2403  fhDTimeLam0BinPerSM[il0][ism]->SetYTitle("t_{cluster}-t_{cell} (ns)");
2404  fhDTimeLam0BinPerSM[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2405  outputContainer->Add(fhDTimeLam0BinPerSM[il0][ism]) ;
2406 
2407  fhDTimeLam0BinPerSMWeighted[il0][ism] = new TH2F
2408  (Form("hDTimeLam0Bin%d_sm%d_Weighted",il0,ism),
2409  Form("#it{p}_{T} vs t_{cluster}-t_{cell} weighted in sm %d, %s",ism,l0bin[il0].Data()),
2410  nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2411  fhDTimeLam0BinPerSMWeighted[il0][ism]->SetYTitle("t_{cluster}-t_{cell} (ns)");
2412  fhDTimeLam0BinPerSMWeighted[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2413  outputContainer->Add(fhDTimeLam0BinPerSMWeighted[il0][ism]) ;
2414 
2415  fhCellClusterEFracLam0BinPerSM[il0][ism] = new TH2F
2416  (Form("hCellClusterEFracLam0Bin%d_sm%d",il0,ism),
2417  Form("#it{p}_{T} vs cell E / cluster E in sm %d, %s, w > 0",ism,l0bin[il0].Data()),
2418  nptbins,ptmin,ptmax,100,0,1);
2419  fhCellClusterEFracLam0BinPerSM[il0][ism]->SetYTitle("cell E / cluster E ");
2420  fhCellClusterEFracLam0BinPerSM[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2421  outputContainer->Add(fhCellClusterEFracLam0BinPerSM[il0][ism]) ;
2422 
2423 // fhCellClusterEFracLam0BinPerSMWeighted[il0][ism] = new TH2F
2424 // (Form("hCellClusterEFracLam0Bin%d_sm%d_Weighted",il0,ism),
2425 // Form("#it{p}_{T} vs cell E / cluster E weighted in sm %d, %s",ism,l0bin[il0].Data()),
2426 // nptbins,ptmin,ptmax,100,0,1);
2427 // fhCellClusterEFracLam0BinPerSMWeighted[il0][ism]->SetYTitle("cell E / cluster E ");
2428 // fhCellClusterEFracLam0BinPerSMWeighted[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2429 // outputContainer->Add(fhCellClusterEFracLam0BinPerSMWeighted[il0][ism]) ;
2430 
2432  (Form("hCellClusterEFracLam0Bin%d_sm%d_LargeTimeInClusterCell",il0,ism),
2433  Form("#it{p}_{T} vs cell E / cluster E in sm %d, %s, w > 0, |t_{cell}| > 50 ns",ism,l0bin[il0].Data()),
2434  nptbins,ptmin,ptmax,100,0,1);
2435  fhCellClusterEFracLam0BinPerSMLargeTime[il0][ism]->SetYTitle("cell E / cluster E ");
2436  fhCellClusterEFracLam0BinPerSMLargeTime[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2437  outputContainer->Add(fhCellClusterEFracLam0BinPerSMLargeTime[il0][ism]) ;
2438 
2440  (Form("hCellClusterEFracLam0Bin%d_sm%d_LargeTimeInClusterCell_Total",il0,ism),
2441  Form("#it{p}_{T} vs cell E / cluster E in sm %d, %s, w > 0, all |t_{cell}| > 50 ns",ism,l0bin[il0].Data()),
2442  nptbins,ptmin,ptmax,100,0,1);
2443  fhCellClusterEFracLam0BinPerSMLargeTimeTotal[il0][ism]->SetYTitle("cell E / cluster E ");
2444  fhCellClusterEFracLam0BinPerSMLargeTimeTotal[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2445  outputContainer->Add(fhCellClusterEFracLam0BinPerSMLargeTimeTotal[il0][ism]) ;
2446 
2447  fhCellClusterELam0BinPerSM[il0][ism] = new TH2F
2448  (Form("hCellClusterELam0Bin%d_sm%d",il0,ism),
2449  Form("#it{p}_{T} vs cell E in sm %d, %s, w > 0",ism,l0bin[il0].Data()),
2450  nptbins,ptmin,ptmax,500,0,10);
2451  fhCellClusterELam0BinPerSM[il0][ism]->SetYTitle("cell E (GeV)");
2452  fhCellClusterELam0BinPerSM[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2453  outputContainer->Add(fhCellClusterELam0BinPerSM[il0][ism]) ;
2454 
2456  (Form("hCellClusterELam0Bin%d_sm%d_Weighted",il0,ism),
2457  Form("#it{p}_{T} vs cell E weighted in sm %d, %s",ism,l0bin[il0].Data()),
2458  nptbins,ptmin,ptmax,500,0,10);
2459  fhCellClusterELam0BinPerSMWeighted[il0][ism]->SetYTitle("cell E (GeV)");
2460  fhCellClusterELam0BinPerSMWeighted[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2461  outputContainer->Add(fhCellClusterELam0BinPerSMWeighted[il0][ism]) ;
2462 
2464  (Form("hCellClusterELam0Bin%d_sm%d_LargeTimeInClusterCell",il0,ism),
2465  Form("#it{p}_{T} vs cell E in sm %d, %s, w > 0, |t_{cell}| > 50 ns",ism,l0bin[il0].Data()),
2466  nptbins,ptmin,ptmax,500,0,10);
2467  fhCellClusterELam0BinPerSMLargeTime[il0][ism]->SetYTitle("cell E (GeV)");
2468  fhCellClusterELam0BinPerSMLargeTime[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2469  outputContainer->Add(fhCellClusterELam0BinPerSMLargeTime[il0][ism]) ;
2470 
2472  (Form("hCellClusterIndexELam0Bin%d_sm%d_LargeTimeInClusterCell",il0,ism),
2473  Form("#it{p}_{T} vs cell index (E sorted) in sm %d, %s, w > 0, |t_{cell}| > 50 ns",ism,l0bin[il0].Data()),
2474  nptbins,ptmin,ptmax,30,0,30);
2475  fhCellClusterIndexELam0BinPerSMLargeTime[il0][ism]->SetYTitle("Index");
2476  fhCellClusterIndexELam0BinPerSMLargeTime[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2477  outputContainer->Add(fhCellClusterIndexELam0BinPerSMLargeTime[il0][ism]) ;
2478 
2479  fhNCellsWithLargeTimeInCluster[il0][ism] = new TH2F
2480  (Form("hNCellsWithLargeTimeInClusterLam0Bin%d_sm%d",il0,ism),
2481  Form("#it{p}_{T} vs number of cells in sm %d, %s, w > 0, |t_{cell}| > 50 ns",ism,l0bin[il0].Data()),
2482  nptbins,ptmin,ptmax,30,0,30);
2483  fhNCellsWithLargeTimeInCluster[il0][ism]->SetYTitle("#it{n}_{cells}");
2484  fhNCellsWithLargeTimeInCluster[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2485  outputContainer->Add(fhNCellsWithLargeTimeInCluster[il0][ism]) ;
2486 
2487 // if(ism < 12)
2488 // {
2489 // fhTimeLam0BinPerSMShared[il0][ism] = new TH2F
2490 // (Form("hTimeLam0Bin%d_sm%d_SMShared",il0,ism),
2491 // Form("#it{p}_{T} vs cluster cell time in sm %d, %s, w > 0",ism,l0bin[il0].Data()),
2492 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2493 // fhTimeLam0BinPerSMShared[il0][ism]->SetYTitle("cell time (ns)");
2494 // fhTimeLam0BinPerSMShared[il0][ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2495 // outputContainer->Add(fhTimeLam0BinPerSMShared[il0][ism]) ;
2496 // } // Run 1 SM
2497  } // sm
2498  } // l0 bin
2499 
2500  for(Int_t ism = 0; ism < GetCaloUtils()->GetNumberOfSuperModulesUsed(); ism++)
2501  {
2502  fhLam0PerSM[ism] = new TH2F
2503  (Form("hLam0_sm%d",ism),
2504  Form("#it{p}_{T} vs #lambda^{2}_{0} in sm %d",ism),
2505  nptbins,ptmin,ptmax,40,0,0.4);
2506  fhLam0PerSM[ism]->SetYTitle("#lambda^{2}_{0}");
2507  fhLam0PerSM[ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2508  outputContainer->Add(fhLam0PerSM[ism]) ;
2509 
2510  fhLam1PerSM[ism] = new TH2F
2511  (Form("hLam1_sm%d",ism),
2512  Form("#it{p}_{T} vs #lambda^{2}_{1} in sm %d",ism),
2513  nptbins,ptmin,ptmax,40,0,0.4);
2514  fhLam1PerSM[ism]->SetYTitle("#lambda^{2}_{1}");
2515  fhLam1PerSM[ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2516  outputContainer->Add(fhLam1PerSM[ism]) ;
2517 
2519  (Form("hLam0_sm%d_LargeTimeInClusterCell",ism),
2520  Form("#it{p}_{T} vs #lambda^{2}_{0} in sm %d,|t_{secondary cell}| > 50 ns",ism),
2521  nptbins,ptmin,ptmax,40,0,0.4);
2522  fhLam0PerSMLargeTimeInClusterCell[ism]->SetYTitle("#lambda^{2}_{0}");
2523  fhLam0PerSMLargeTimeInClusterCell[ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2524  outputContainer->Add(fhLam0PerSMLargeTimeInClusterCell[ism]) ;
2525 
2527  (Form("hLam1_sm%d_LargeTimeInClusterCell",ism),
2528  Form("#it{p}_{T} vs #lambda^{2}_{1} in sm %d, |t_{secondary cell}| > 50 ns",ism),
2529  nptbins,ptmin,ptmax,40,0,0.4);
2530  fhLam1PerSMLargeTimeInClusterCell[ism]->SetYTitle("#lambda^{2}_{1}");
2531  fhLam1PerSMLargeTimeInClusterCell[ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2532  outputContainer->Add(fhLam1PerSMLargeTimeInClusterCell[ism]) ;
2533 
2534 // fhLam0PerSMSPDPileUp[ism] = new TH2F
2535 // (Form("hLam0_sm%d_SPDPileUp",ism),
2536 // Form("#it{p}_{T} vs #lambda^{2}_{0} in sm %d, Pile-up event SPD",ism),
2537 // nptbins,ptmin,ptmax,40,0,0.4);
2538 // fhLam0PerSMSPDPileUp[ism]->SetYTitle("#lambda^{2}_{0}");
2539 // fhLam0PerSMSPDPileUp[ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2540 // outputContainer->Add(fhLam0PerSMSPDPileUp[ism]) ;
2541 //
2542 // fhLam1PerSMSPDPileUp[ism] = new TH2F
2543 // (Form("hLam1_sm%d_SPDPileUp",ism),
2544 // Form("#it{p}_{T} vs #lambda^{2}_{1} in sm %d, Pile-up event SPD",ism),
2545 // nptbins,ptmin,ptmax,40,0,0.4);
2546 // fhLam1PerSMSPDPileUp[ism]->SetYTitle("#lambda^{2}_{1}");
2547 // fhLam1PerSMSPDPileUp[ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2548 // outputContainer->Add(fhLam1PerSMSPDPileUp[ism]) ;
2549 
2550 // if(ism < 12)
2551 // {
2552 // fhLam0PerSMShared[ism] = new TH2F
2553 // (Form("hLam0_sm%d_SMShared",ism),
2554 // Form("#it{p}_{T} vs #lambda^{2}_{0} in sm %d, SM shared",ism),
2555 // nptbins,ptmin,ptmax,40,0,0.4);
2556 // fhLam0PerSMShared[ism]->SetYTitle("#lambda^{2}_{0}");
2557 // fhLam0PerSMShared[ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2558 // outputContainer->Add(fhLam0PerSMShared[ism]) ;
2559 //
2560 // fhLam1PerSMShared[ism] = new TH2F
2561 // (Form("hLam1_sm%d_SMShared",ism),
2562 // Form("#it{p}_{T} vs #lambda^{2}_{1} in sm %d, SM shared",ism),
2563 // nptbins,ptmin,ptmax,40,0,0.4);
2564 // fhLam1PerSMShared[ism]->SetYTitle("#lambda^{2}_{1}");
2565 // fhLam1PerSMShared[ism]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2566 // outputContainer->Add(fhLam1PerSMShared[ism]) ;
2567 // } // run1
2568  } // sm
2569 
2570  for(Int_t ilarge = 0; ilarge < 5; ilarge++)
2571  {
2573  (Form("hLam0_NLargeTimeInClusterCell%d",ilarge),
2574  Form("#it{p}_{T} vs #lambda^{2}_{0} in sm %d,|t_{secondary cell}| > 50 ns",ilarge),
2575  nptbins,ptmin,ptmax,40,0,0.4);
2576  fhLam0PerNLargeTimeInClusterCell[ilarge]->SetYTitle("#lambda^{2}_{0}");
2577  fhLam0PerNLargeTimeInClusterCell[ilarge]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2578  outputContainer->Add(fhLam0PerNLargeTimeInClusterCell[ilarge]) ;
2579 
2581  (Form("hLam1_NLargeTimeInClusterCell%d",ilarge),
2582  Form("#it{p}_{T} vs #lambda^{2}_{1} in sm %d, |t_{secondary cell}| > 50 ns",ilarge),
2583  nptbins,ptmin,ptmax,40,0,0.4);
2584  fhLam1PerNLargeTimeInClusterCell[ilarge]->SetYTitle("#lambda^{2}_{1}");
2585  fhLam1PerNLargeTimeInClusterCell[ilarge]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2586  outputContainer->Add(fhLam1PerNLargeTimeInClusterCell[ilarge]) ;
2587  }
2588 
2589  } // regions in EMCal
2590 
2591 
2592  if(IsDataMC())
2593  {
2594  TString ptype[] = { "#gamma" , "#gamma_{#pi decay}" , "#gamma_{#eta decay}", "#gamma_{other decay}",
2595  "#pi^{0}" , "#eta" , "e^{#pm}" , "#gamma->e^{#pm}" ,
2596  "hadron?" , "Anti-N" , "Anti-P" ,
2597  "Neutron" , "Proton" , "#pi^{#pm}" ,
2598  "#gamma_{prompt}", "#gamma_{fragmentation}", "#gamma_{ISR}" , "String" } ;
2599 
2600  TString pname[] = { "Photon" , "PhotonPi0Decay" , "PhotonEtaDecay", "PhotonOtherDecay",
2601  "Pi0" , "Eta" , "Electron" , "Conversion" ,
2602  "Hadron" , "AntiNeutron" , "AntiProton" ,
2603  "Neutron" , "Proton" , "ChPion" ,
2604  "PhotonPrompt", "PhotonFragmentation", "PhotonISR" , "String" } ;
2605 
2606  for(Int_t i = 0; i < fNOriginHistograms; i++)
2607  {
2608  fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
2609  Form("cluster from %s : E ",ptype[i].Data()),
2610  nptbins,ptmin,ptmax);
2611  fhMCE[i]->SetXTitle("#it{E} (GeV)");
2612  outputContainer->Add(fhMCE[i]) ;
2613 
2614  fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
2615  Form("cluster from %s : #it{p}_{T} ",ptype[i].Data()),
2616  nptbins,ptmin,ptmax);
2617  fhMCPt[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2618  outputContainer->Add(fhMCPt[i]) ;
2619 
2620  fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
2621  Form("cluster from %s : #eta ",ptype[i].Data()),
2622  nptbins,ptmin,ptmax,netabins,etamin,etamax);
2623  fhMCEta[i]->SetYTitle("#eta");
2624  fhMCEta[i]->SetXTitle("#it{E} (GeV)");
2625  outputContainer->Add(fhMCEta[i]) ;
2626 
2627  fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
2628  Form("cluster from %s : #phi ",ptype[i].Data()),
2629  nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2630  fhMCPhi[i]->SetYTitle("#phi (rad)");
2631  fhMCPhi[i]->SetXTitle("#it{E} (GeV)");
2632  outputContainer->Add(fhMCPhi[i]) ;
2633 
2634 
2635  fhMCDeltaE[i] = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
2636  Form("MC - Reco E from %s",pname[i].Data()),
2637  nptbins,ptmin,ptmax, 200,-50,50);
2638  fhMCDeltaE[i]->SetYTitle("#Delta #it{E} (GeV)");
2639  fhMCDeltaE[i]->SetXTitle("#it{E} (GeV)");
2640  outputContainer->Add(fhMCDeltaE[i]);
2641 
2642  fhMCDeltaPt[i] = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
2643  Form("MC - Reco #it{p}_{T} from %s",pname[i].Data()),
2644  nptbins,ptmin,ptmax, 200,-50,50);
2645  fhMCDeltaPt[i]->SetXTitle("p_{T,rec} (GeV/#it{c})");
2646  fhMCDeltaPt[i]->SetYTitle("#Delta #it{p}_{T} (GeV/#it{c})");
2647  outputContainer->Add(fhMCDeltaPt[i]);
2648 
2649  fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
2650  Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
2651  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2652  fhMC2E[i]->SetXTitle("#it{E}_{rec} (GeV)");
2653  fhMC2E[i]->SetYTitle("#it{E}_{gen} (GeV)");
2654  outputContainer->Add(fhMC2E[i]);
2655 
2656  fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
2657  Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
2658  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2659  fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/#it{c})");
2660  fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/#it{c})");
2661  outputContainer->Add(fhMC2Pt[i]);
2662  }
2663 
2664  TString pptype[] = { "#gamma" , "#gamma_{#pi decay}" ,
2665  "#gamma_{#eta decay}", "#gamma_{other decay}" ,
2666  "#gamma_{prompt}" , "#gamma_{fragmentation}", "#gamma_{ISR}" } ;
2667 
2668  TString ppname[] = { "Photon" , "PhotonPi0Decay" ,
2669  "PhotonEtaDecay", "PhotonOtherDecay" ,
2670  "PhotonPrompt" , "PhotonFragmentation", "PhotonISR" } ;
2671 
2672  for(Int_t i = 0; i < fNPrimaryHistograms; i++)
2673  {
2674  fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
2675  Form("primary photon %s : E ",pptype[i].Data()),
2676  nptbins,ptmin,ptmax);
2677  fhEPrimMC[i]->SetXTitle("#it{E} (GeV)");
2678  outputContainer->Add(fhEPrimMC[i]) ;
2679 
2680  fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
2681  Form("primary photon %s : #it{p}_{T} ",pptype[i].Data()),
2682  nptbins,ptmin,ptmax);
2683  fhPtPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2684  outputContainer->Add(fhPtPrimMC[i]) ;
2685 
2686  fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
2687  Form("primary photon %s : Rapidity ",pptype[i].Data()),
2688  nptbins,ptmin,ptmax,200,-2,2);
2689  fhYPrimMC[i]->SetYTitle("Rapidity");
2690  fhYPrimMC[i]->SetXTitle("#it{E} (GeV)");
2691  outputContainer->Add(fhYPrimMC[i]) ;
2692 
2693  fhEtaPrimMC[i] = new TH2F(Form("hEtaPrim_MC%s",ppname[i].Data()),
2694  Form("primary photon %s : #eta",pptype[i].Data()),
2695  nptbins,ptmin,ptmax,200,-2,2);
2696  fhEtaPrimMC[i]->SetYTitle("#eta");
2697  fhEtaPrimMC[i]->SetXTitle("#it{E} (GeV)");
2698  outputContainer->Add(fhEtaPrimMC[i]) ;
2699 
2700  fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
2701  Form("primary photon %s : #phi ",pptype[i].Data()),
2702  nptbins,ptmin,ptmax,nphibins,0,TMath::TwoPi());
2703  fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
2704  fhPhiPrimMC[i]->SetXTitle("#it{E} (GeV)");
2705  outputContainer->Add(fhPhiPrimMC[i]) ;
2706 
2707 
2708  fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
2709  Form("primary photon %s in acceptance: E ",pptype[i].Data()),
2710  nptbins,ptmin,ptmax);
2711  fhEPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
2712  outputContainer->Add(fhEPrimMCAcc[i]) ;
2713 
2714  fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
2715  Form("primary photon %s in acceptance: #it{p}_{T} ",pptype[i].Data()),
2716  nptbins,ptmin,ptmax);
2717  fhPtPrimMCAcc[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2718  outputContainer->Add(fhPtPrimMCAcc[i]) ;
2719 
2720  fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
2721  Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
2722  nptbins,ptmin,ptmax,100,-1,1);
2723  fhYPrimMCAcc[i]->SetYTitle("Rapidity");
2724  fhYPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
2725  outputContainer->Add(fhYPrimMCAcc[i]) ;
2726 
2727  fhEtaPrimMCAcc[i] = new TH2F(Form("hEtaPrimAcc_MC%s",ppname[i].Data()),
2728  Form("primary photon %s in acceptance: #eta ",pptype[i].Data()),
2729  nptbins,ptmin,ptmax,netabins,etamin,etamax);
2730  fhEtaPrimMCAcc[i]->SetYTitle("#eta");
2731  fhEtaPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
2732  outputContainer->Add(fhEtaPrimMCAcc[i]) ;
2733 
2734  fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
2735  Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
2736  nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2737  fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
2738  fhPhiPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
2739  outputContainer->Add(fhPhiPrimMCAcc[i]) ;
2740  }
2741 
2742  if(fFillSSHistograms)
2743  {
2744  TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
2745 
2746  TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
2747 
2748  for(Int_t i = 0; i < 6; i++)
2749  {
2750  fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
2751  Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
2752  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2753  fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
2754  fhMCELambda0[i]->SetXTitle("#it{E} (GeV)");
2755  outputContainer->Add(fhMCELambda0[i]) ;
2756 
2757  fhMCPtLambda0[i] = new TH2F(Form("hPtLambda0_MC%s",pnamess[i].Data()),
2758  Form("cluster from %s : #it{p}_{T} vs #lambda_{0}^{2}",ptypess[i].Data()),
2759  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2760  fhMCPtLambda0[i]->SetYTitle("#lambda_{0}^{2}");
2761  fhMCPtLambda0[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2762  outputContainer->Add(fhMCPtLambda0[i]) ;
2763 
2764  fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
2765  Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
2766  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2767  fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
2768  fhMCELambda1[i]->SetXTitle("#it{E} (GeV)");
2769  outputContainer->Add(fhMCELambda1[i]) ;
2770 
2771  fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
2772  Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
2773  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2774  fhMCEDispersion[i]->SetYTitle("D^{2}");
2775  fhMCEDispersion[i]->SetXTitle("#it{E} (GeV)");
2776  outputContainer->Add(fhMCEDispersion[i]) ;
2777 
2778  fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
2779  Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
2780  nptbins,ptmin,ptmax, nbins,nmin,nmax);
2781  fhMCNCellsE[i]->SetXTitle("#it{E} (GeV)");
2782  fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
2783  outputContainer->Add(fhMCNCellsE[i]);
2784 
2785  fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
2786  Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
2787  nptbins,ptmin,ptmax, 500,0,1.);
2788  fhMCMaxCellDiffClusterE[i]->SetXTitle("#it{E}_{cluster} (GeV) ");
2789  fhMCMaxCellDiffClusterE[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2790  outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
2791 
2793  {
2794  fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
2795  Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
2796  ssbins,ssmin,ssmax,500,0,1.);
2797  fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
2798  fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2799  outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
2800 
2801  fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
2802  Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
2803  ssbins,ssmin,ssmax,500,0,1.);
2804  fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
2805  fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2806  outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
2807 
2808  fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
2809  Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, #it{E} > 6 GeV",ptypess[i].Data()),
2810  ssbins,ssmin,ssmax,500,0,1.);
2811  fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
2812  fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2813  outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
2814 
2815  fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
2816  Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
2817  nbins/5,nmin,nmax/5,500,0,1.);
2818  fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
2819  fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2820  outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
2821 
2822  fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
2823  Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
2824  nbins/5,nmin,nmax/5,500,0,1.);
2825  fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
2826  fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2827  outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
2828 
2829  fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
2830  Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, #it{E} > 6 GeV",ptypess[i].Data()),
2831  nbins/5,nmin,nmax/5,500,0,1.);
2832  fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
2833  fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("#it{E} (GeV)");
2834  outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
2835 
2836  if(GetCalorimeter()==kEMCAL)
2837  {
2838  fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pnamess[i].Data()),
2839  Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data()),
2840  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2841  fhMCEDispEta[i]->SetXTitle("#it{E} (GeV)");
2842  fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
2843  outputContainer->Add(fhMCEDispEta[i]);
2844 
2845  fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pnamess[i].Data()),
2846  Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptypess[i].Data()),
2847  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2848  fhMCEDispPhi[i]->SetXTitle("#it{E} (GeV)");
2849  fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2850  outputContainer->Add(fhMCEDispPhi[i]);
2851 
2852  fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pnamess[i].Data()),
2853  Form("cluster from %s : #delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",ptypess[i].Data()),
2854  nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
2855  fhMCESumEtaPhi[i]->SetXTitle("#it{E} (GeV)");
2856  fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
2857  outputContainer->Add(fhMCESumEtaPhi[i]);
2858 
2859  fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pnamess[i].Data()),
2860  Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),
2861  nptbins,ptmin,ptmax,200,-10,10);
2862  fhMCEDispEtaPhiDiff[i]->SetXTitle("#it{E} (GeV)");
2863  fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
2864  outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
2865 
2866  fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pnamess[i].Data()),
2867  Form("cluster from %s : (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",ptypess[i].Data()),
2868  nptbins,ptmin,ptmax, 200,-1,1);
2869  fhMCESphericity[i]->SetXTitle("#it{E} (GeV)");
2870  fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
2871  outputContainer->Add(fhMCESphericity[i]);
2872 
2873  for(Int_t ie = 0; ie < 7; ie++)
2874  {
2875  fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
2876  Form("cluster from %s : #sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
2877  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2878  fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
2879  fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2880  outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
2881 
2882  fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pnamess[i].Data()),
2883  Form("cluster from %s : #lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
2884  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2885  fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
2886  fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2887  outputContainer->Add(fhMCLambda0DispEta[ie][i]);
2888 
2889  fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
2890  Form("cluster from %s :#lambda^{2}_{0} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
2891  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2892  fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
2893  fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2894  outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
2895  }
2896  }
2897  }
2898  }// loop
2899 
2900  if(!GetReader()->IsEmbeddedClusterSelectionOn())
2901  {
2902  fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
2903  "cluster from Photon : E vs #lambda_{0}^{2}",
2904  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2905  fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
2906  fhMCPhotonELambda0NoOverlap->SetXTitle("#it{E} (GeV)");
2907  outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
2908 
2909  fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
2910  "cluster from Photon : E vs #lambda_{0}^{2}",
2911  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2912  fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
2913  fhMCPhotonELambda0TwoOverlap->SetXTitle("#it{E} (GeV)");
2914  outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
2915 
2916  fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
2917  "cluster from Photon : E vs #lambda_{0}^{2}",
2918  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2919  fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
2920  fhMCPhotonELambda0NOverlap->SetXTitle("#it{E} (GeV)");
2921  outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
2922  } // No embedding
2923 
2924  if(GetReader()->IsEmbeddedClusterSelectionOn())
2925  {
2926  fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
2927  "Energy Fraction of embedded signal versus cluster energy",
2928  nptbins,ptmin,ptmax,100,0.,1.);
2929  fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
2930  fhEmbeddedSignalFractionEnergy->SetXTitle("#it{E} (GeV)");
2931  outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
2932 
2933  fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
2934  "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2935  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2936  fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2937  fhEmbedPhotonELambda0FullSignal->SetXTitle("#it{E} (GeV)");
2938  outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
2939 
2940  fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
2941  "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2942  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2943  fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2944  fhEmbedPhotonELambda0MostlySignal->SetXTitle("#it{E} (GeV)");
2945  outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
2946 
2947  fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
2948  "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2949  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2950  fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2951  fhEmbedPhotonELambda0MostlyBkg->SetXTitle("#it{E} (GeV)");
2952  outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
2953 
2954  fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
2955  "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2956  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2957  fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2958  fhEmbedPhotonELambda0FullBkg->SetXTitle("#it{E} (GeV)");
2959  outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
2960 
2961  fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
2962  "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2963  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2964  fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2965  fhEmbedPi0ELambda0FullSignal->SetXTitle("#it{E} (GeV)");
2966  outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
2967 
2968  fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
2969  "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2970  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2971  fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2972  fhEmbedPi0ELambda0MostlySignal->SetXTitle("#it{E} (GeV)");
2973  outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
2974 
2975  fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
2976  "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2977  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2978  fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2979  fhEmbedPi0ELambda0MostlyBkg->SetXTitle("#it{E} (GeV)");
2980  outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
2981 
2982  fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
2983  "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2984  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2985  fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2986  fhEmbedPi0ELambda0FullBkg->SetXTitle("#it{E} (GeV)");
2987  outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
2988  }// embedded histograms
2989  }// Fill SS MC histograms
2990 
2991 
2993  {
2994  fhMCConversionVertex = new TH2F("hMCPhotonConversionVertex","cluster from converted photon, #it{p}_{T} vs vertex distance",
2995  nptbins,ptmin,ptmax,500,0,500);
2996  fhMCConversionVertex->SetYTitle("#it{R} (cm)");
2997  fhMCConversionVertex->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2998  outputContainer->Add(fhMCConversionVertex) ;
2999 
3000  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0)
3001  {
3002  fhMCConversionVertexTRD = new TH2F("hMCPhotonConversionVertexTRD","cluster from converted photon, #it{p}_{T} vs vertex distance, SM covered by TRD",
3003  nptbins,ptmin,ptmax,500,0,500);
3004  fhMCConversionVertexTRD->SetYTitle("#it{R} (cm)");
3005  fhMCConversionVertexTRD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3006  outputContainer->Add(fhMCConversionVertexTRD) ;
3007  }
3008 
3009  if(fFillSSHistograms)
3010  {
3011  TString region[] = {"ITS","TPC","TRD","TOF","Top EMCal","In EMCal"};
3012  for(Int_t iR = 0; iR < 6; iR++)
3013  {
3014  fhMCConversionLambda0Rcut[iR] = new TH2F(Form("hMCPhotonConversionLambda0_R%d",iR),
3015  Form("cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, conversion in %s",region[iR].Data()),
3016  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3017  fhMCConversionLambda0Rcut[iR]->SetYTitle("#lambda_{0}^{2}");
3018  fhMCConversionLambda0Rcut[iR]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3019  outputContainer->Add(fhMCConversionLambda0Rcut[iR]) ;
3020 
3021  fhMCConversionLambda1Rcut[iR] = new TH2F(Form("hMCPhotonConversionLambda1_R%d",iR),
3022  Form("cluster from converted photon, #it{p}_{T} vs #lambda_{1}^{2}, conversion in %s",region[iR].Data()),
3023  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3024  fhMCConversionLambda1Rcut[iR]->SetYTitle("#lambda_{1}^{2}");
3025  fhMCConversionLambda1Rcut[iR]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3026  outputContainer->Add(fhMCConversionLambda1Rcut[iR]) ;
3027  } // R cut
3028 
3029 
3030  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0)
3031  {
3032  for(Int_t iR = 0; iR < 6; iR++)
3033  {
3034  fhMCConversionLambda0RcutTRD[iR] = new TH2F(Form("hMCPhotonConversionLambda0TRD_R%d",iR),
3035  Form("cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, conversion in %s, SM covered by TRD",region[iR].Data()),
3036  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3037  fhMCConversionLambda0RcutTRD[iR]->SetYTitle("#lambda_{0}^{2}");
3038  fhMCConversionLambda0RcutTRD[iR]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3039  outputContainer->Add(fhMCConversionLambda0RcutTRD[iR]) ;
3040 
3041  fhMCConversionLambda1RcutTRD[iR] = new TH2F(Form("hMCPhotonConversionLambda1TRD_R%d",iR),
3042  Form("cluster from converted photon, #it{p}_{T} vs #lambda_{1}^{2}, conversion in %s, SM covered by TRD",region[iR].Data()),
3043  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3044  fhMCConversionLambda1RcutTRD[iR]->SetYTitle("#lambda_{1}^{2}");
3045  fhMCConversionLambda1RcutTRD[iR]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3046  outputContainer->Add(fhMCConversionLambda1RcutTRD[iR]) ;
3047  } // R cut
3048  }
3049 
3050  // if(GetCalorimeter() == kEMCAL && fFillEMCALRegionSSHistograms)
3051  // {
3052  // for(Int_t ieta = 0; ieta < 4; ieta++)
3053  // {
3054  // for(Int_t iphi = 0; iphi < 3; iphi++)
3055  // {
3056  // for(Int_t iR = 0; iR < 6; iR++)
3057  // {
3058  // fhLam0EMCALRegionMCConvRcut[ieta][iphi][iR] =
3059  // new TH2F(Form("hMCPhotonConversionLambda0_R%d_eta%d_phi%d",iR,ieta,iphi),
3060  // Form("cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, conversion in %s, region eta %d, phi %d",region[iR].Data(),ieta,iphi),
3061  // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3062  // fhLam0EMCALRegionMCConvRcut[ieta][iphi][iR]->SetYTitle("#lambda_{0}^{2}");
3063  // fhLam0EMCALRegionMCConvRcut[ieta][iphi][iR]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3064  // outputContainer->Add(fhLam0EMCALRegionMCConvRcut[ieta][iphi][iR]) ;
3065  //
3066  // if(GetFirstSMCoveredByTRD() >= 0)
3067  // {
3068  // fhLam0EMCALRegionTRDMCConvRcut[ieta][iphi][iR] =
3069  // new TH2F(Form("hMCPhotonConversionLambda0TRD_R%d_eta%d_phi%d",iR,ieta,iphi),
3070  // Form("cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, conversion in %s, region eta %d, phi %d, SM covered by TRD",region[iR].Data(),ieta,iphi),
3071  // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3072  // fhLam0EMCALRegionTRDMCConvRcut[ieta][iphi][iR]->SetYTitle("#lambda_{0}^{2}");
3073  // fhLam0EMCALRegionTRDMCConvRcut[ieta][iphi][iR]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3074  // outputContainer->Add(fhLam0EMCALRegionTRDMCConvRcut[ieta][iphi][iR]) ;
3075  // } // TRD
3076  //
3077  // } // iR
3078  // } // iphi
3079  // } // ieta
3080  // } // regions in EMCal
3081  } // shower shape
3082  } // conversion vertex
3083  } // Histos with MC
3084 
3086  {
3087  for(Int_t ie=0; ie<fNEBinCuts; ie++)
3088  {
3089  fhEBinClusterEtaPhi[ie] = new TH2F
3090  (Form("hEBin%d_Cluster_EtaPhi",ie),
3091  Form("#eta vs #phi, cluster, %2.2f<#it{p}_{T}<%2.2f GeV/#it{c}",fEBinCuts[ie],fEBinCuts[ie+1]),
3092  netabins,etamin,etamax,nphibins,phimin,phimax);
3093  fhEBinClusterEtaPhi[ie]->SetYTitle("#phi (rad)");
3094  fhEBinClusterEtaPhi[ie]->SetXTitle("#eta");
3095  outputContainer->Add(fhEBinClusterEtaPhi[ie]) ;
3096 
3097  fhEBinClusterColRow[ie] = new TH2F
3098  (Form("hEBin%d_Cluster_ColRow",ie),
3099  Form("column vs row, cluster max E cell, %2.2f<#it{p}_{T}<%2.2f GeV/#it{c}",fEBinCuts[ie],fEBinCuts[ie+1]),
3100  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3101  fhEBinClusterColRow[ie]->SetYTitle("row");
3102  fhEBinClusterColRow[ie]->SetXTitle("column");
3103  outputContainer->Add(fhEBinClusterColRow[ie]) ;
3104 
3105  fhEBinClusterEtaPhiPID[ie] = new TH2F
3106  (Form("hEBin%d_Cluster_EtaPhi_PID",ie),
3107  Form("#eta vs #phi, cluster, %2.2f<#it{p}_{T}<%2.2f GeV/#it{c}, PID cut",fEBinCuts[ie],fEBinCuts[ie+1]),
3108  netabins,etamin,etamax,nphibins,phimin,phimax);
3109  fhEBinClusterEtaPhiPID[ie]->SetYTitle("#phi (rad)");
3110  fhEBinClusterEtaPhiPID[ie]->SetXTitle("#eta");
3111  outputContainer->Add(fhEBinClusterEtaPhiPID[ie]) ;
3112 
3113  fhEBinClusterColRowPID[ie] = new TH2F
3114  (Form("hEBin%d_Cluster_ColRow_PID",ie),
3115  Form("column vs row, cluster max E cell, %2.2f<#it{p}_{T}<%2.2f GeV/#it{c}, PID cut",fEBinCuts[ie],fEBinCuts[ie+1]),
3116  96+2,-1.5,96+0.5,(8*24+2*8)+2,-1.5,(8*24+2*8)+0.5);
3117  fhEBinClusterColRowPID[ie]->SetYTitle("row");
3118  fhEBinClusterColRowPID[ie]->SetXTitle("column");
3119  outputContainer->Add(fhEBinClusterColRowPID[ie]) ;
3120  }
3121  }
3122 
3124  {
3125  fhLocalRegionClusterEnergySum = new TH2F ("hLocalRegionClusterEnergySum",
3126  "Sum of cluster energy around trigger cluster #it{E} with R=0.2",
3127  nptbins,ptmin,ptmax, 200,0,100);
3128  fhLocalRegionClusterEnergySum->SetXTitle("#it{E} (GeV)");
3129  fhLocalRegionClusterEnergySum->SetYTitle("#Sigma #it{E} (GeV)");
3130  outputContainer->Add(fhLocalRegionClusterEnergySum);
3131 
3132  fhLocalRegionClusterMultiplicity = new TH2F ("hLocalRegionClusterMultiplicity",
3133  "Cluster multiplicity around trigger cluster #it{E} with R=0.2",
3134  nptbins,ptmin,ptmax, 200,0,200);
3135  fhLocalRegionClusterMultiplicity->SetXTitle("#it{E} (GeV)");
3136  fhLocalRegionClusterMultiplicity->SetYTitle("Multiplicity");
3137  outputContainer->Add(fhLocalRegionClusterMultiplicity);
3138 
3140  {
3141  fhLocalRegionClusterEnergySumPerCentrality = new TH2F ("hLocalRegionClusterEnergySumPerCentrality",
3142  "Sum of cluster energy around trigger cluster vs centrality with R=0.2",
3143  100,0,100, 200,0,100);
3144  fhLocalRegionClusterEnergySumPerCentrality->SetXTitle("Centrality");
3145  fhLocalRegionClusterEnergySumPerCentrality->SetYTitle("#Sigma #it{E} (GeV)");
3146  outputContainer->Add(fhLocalRegionClusterEnergySumPerCentrality);
3147 
3148  fhLocalRegionClusterMultiplicityPerCentrality = new TH2F ("hLocalRegionClusterMultiplicityPerCentrality",
3149  "Cluster multiplicity around trigger cluster vs centrality with R=0.2",
3150  100,0,100, 200,0,200);
3151  fhLocalRegionClusterMultiplicityPerCentrality->SetXTitle("Centrality");
3152  fhLocalRegionClusterMultiplicityPerCentrality->SetYTitle("Multiplicity");
3153  outputContainer->Add(fhLocalRegionClusterMultiplicityPerCentrality);
3154  }
3155 
3157  {
3158  fhLocalRegionClusterEnergySumHijing = new TH2F ("hLocalRegionClusterEnergySumHijing",
3159  "Sum of cluster energy (HIJING) around trigger cluster #it{E} with R=0.2",
3160  nptbins,ptmin,ptmax, 200,0,100);
3161  fhLocalRegionClusterEnergySumHijing->SetXTitle("#it{E} (GeV)");
3162  fhLocalRegionClusterEnergySumHijing->SetYTitle("#Sigma #it{E} (GeV)");
3163  outputContainer->Add(fhLocalRegionClusterEnergySumHijing);
3164 
3165  fhLocalRegionClusterMultiplicityHijing = new TH2F ("hLocalRegionClusterMultiplicityHijing",
3166  "Cluster multiplicity (HIJING) around trigger cluster #it{E} with R=0.2",
3167  nptbins,ptmin,ptmax, 200,0,200);
3168  fhLocalRegionClusterMultiplicityHijing->SetXTitle("#it{E} (GeV)");
3169  fhLocalRegionClusterMultiplicityHijing->SetYTitle("Multiplicity");
3170  outputContainer->Add(fhLocalRegionClusterMultiplicityHijing);
3171 
3173  {
3174  fhLocalRegionClusterEnergySumPerCentralityHijing = new TH2F ("hLocalRegionClusterEnergySumPerCentralityHijing",
3175  "Sum of cluster energy (HIJING) around trigger cluster vs centrality with R=0.2",
3176  100,0,100, 200,0,100);
3177  fhLocalRegionClusterEnergySumPerCentralityHijing->SetXTitle("Centrality");
3178  fhLocalRegionClusterEnergySumPerCentralityHijing->SetYTitle("#Sigma #it{E} (GeV)");
3179  outputContainer->Add(fhLocalRegionClusterEnergySumPerCentralityHijing);
3180 
3181  fhLocalRegionClusterMultiplicityPerCentralityHijing = new TH2F ("hLocalRegionClusterMultiplicityPerCentralityHijing",
3182  "Cluster multiplicity (HIJING) around trigger cluster vs centrality with R=0.2",
3183  100,0,100, 200,0,200);
3184  fhLocalRegionClusterMultiplicityPerCentralityHijing->SetXTitle("Centrality");
3185  fhLocalRegionClusterMultiplicityPerCentralityHijing->SetYTitle("Multiplicity");
3187  }
3188  }
3189  }
3190 
3192  {
3193  fhCleanGeneratorCluster = new TH1F("hCleanGeneratorCluster",
3194  "Number of selected clusters with contribution of just 1 generator",
3195  nptbins,ptmin,ptmax);
3196  fhCleanGeneratorCluster->SetYTitle("#it{counts}");
3197  fhCleanGeneratorCluster->SetXTitle("#it{E} (GeV)");
3198  outputContainer->Add(fhCleanGeneratorCluster) ;
3199 
3200  fhMergeGeneratorCluster = new TH1F("hMergeGeneratorCluster",
3201  "Number of selected clusters with contribution of 2 generators",
3202  nptbins,ptmin,ptmax);
3203  fhMergeGeneratorCluster->SetYTitle("#it{counts}");
3204  fhMergeGeneratorCluster->SetXTitle("#it{E} (GeV)");
3205  outputContainer->Add(fhMergeGeneratorCluster) ;
3206 
3207  fhMergeGeneratorClusterNotHijing = new TH1F("hMergeGeneratorClusterNotHijing",
3208  "Number of selected clusters with contribution of 2 generators, none is HIJING",
3209  nptbins,ptmin,ptmax);
3210  fhMergeGeneratorClusterNotHijing->SetYTitle("#it{counts}");
3211  fhMergeGeneratorClusterNotHijing->SetXTitle("#it{E} (GeV)");
3212  outputContainer->Add(fhMergeGeneratorClusterNotHijing) ;
3213 
3214 
3215  fhMergeGeneratorClusterHijingAndOther = new TH1F("hMergeGeneratorClusterHijingAndOther",
3216  "Number of selected clusters with contribution of 2 generators, main one is HIJING",
3217  nptbins,ptmin,ptmax);
3218  fhMergeGeneratorClusterHijingAndOther->SetYTitle("#it{counts}");
3219  fhMergeGeneratorClusterHijingAndOther->SetXTitle("#it{E} (GeV)");
3220  outputContainer->Add(fhMergeGeneratorClusterHijingAndOther) ;
3221  }
3222 
3223  return outputContainer ;
3224 }
3225 
3226 //_______________________
3228 //_______________________
3230 {
3231  if ( GetCalorimeter() == kPHOS && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD() )
3232  AliFatal("!!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!");
3233  else if( GetCalorimeter() == kEMCAL && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD() )
3234  AliFatal("!!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!");
3235 
3236  // Trick to select primary photon particles in the analysis of pure MC input
3237  if(GetReader()->GetDataType() == AliCaloTrackReader::kMC) GetCaloPID()->SwitchOnBayesian();
3238 }
3239 
3240 //_________________________________
3242 //_________________________________
3244 {
3245  AddToHistogramsName("AnaPhoton_");
3246 
3247  fMinDist = 2.;
3248  fMinDist2 = 4.;
3249  fMinDist3 = 5.;
3250 
3251  fTimeCutMin =-1000000;
3252  fTimeCutMax = 1000000;
3253  fNCellsCut = 0;
3254 
3255  fRejectTrackMatch = kTRUE ;
3256 
3257  fNEBinCuts = 14;
3258  fEBinCuts[0] = 0.; fEBinCuts[1] = 0.3; fEBinCuts[2] = 0.5;
3259  fEBinCuts[3] = 1.; fEBinCuts[4] = 2. ; fEBinCuts[5] = 3. ;
3260  fEBinCuts[6] = 4.; fEBinCuts[7] = 5. ; fEBinCuts[8] = 7. ;
3261  fEBinCuts[9] = 9.; fEBinCuts[10]= 12.; fEBinCuts[11]= 15.;
3262  fEBinCuts[12]= 20.; fEBinCuts[13]= 50.; fEBinCuts[14]= 100.;
3263  for(Int_t i = fNEBinCuts; i < 15; i++) fEBinCuts[i] = 1000.;
3264 }
3265 
3266 //_______________________________________
3270 //_______________________________________
3272 {
3273  // Get the vertex
3274  Double_t v[3] = {0,0,0}; //vertex ;
3275  GetReader()->GetVertex(v);
3276 
3277  // Select the Calorimeter of the photon
3278  TObjArray * pl = 0x0;
3279  AliVCaloCells* cells = 0;
3280  if (GetCalorimeter() == kPHOS )
3281  {
3282  pl = GetPHOSClusters();
3283  cells = GetPHOSCells();
3284  }
3285  else if (GetCalorimeter() == kEMCAL)
3286  {
3287  pl = GetEMCALClusters();
3288  cells = GetEMCALCells();
3289  }
3290 
3291  if(!pl)
3292  {
3293  AliWarning(Form("TObjArray with %s clusters is NULL!",GetCalorimeterString().Data()));
3294  return;
3295  }
3296 
3297  // Loop on raw clusters before filtering in the reader and fill control histogram
3298  if((GetReader()->GetEMCALClusterListName()=="" && GetCalorimeter()==kEMCAL) || GetCalorimeter()==kPHOS)
3299  {
3300  for(Int_t iclus = 0; iclus < GetReader()->GetInputEvent()->GetNumberOfCaloClusters(); iclus++ )
3301  {
3302  AliVCluster * clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
3303 
3304  if (GetCalorimeter() == kPHOS && clus->IsPHOS() && clus->E() > GetReader()->GetPHOSPtMin() )
3305  {
3306  clus->GetMomentum(fMomentum,GetVertex(0)) ;
3307 
3308  fhClusterCutsE [0]->Fill(fMomentum.E() , GetEventWeight());
3309  fhClusterCutsPt[0]->Fill(fMomentum.Pt(), GetEventWeight());
3310  }
3311  else if(GetCalorimeter() == kEMCAL && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin())
3312  {
3313  clus->GetMomentum(fMomentum,GetVertex(0)) ;
3314 
3315  fhClusterCutsE [0]->Fill(fMomentum.E(), GetEventWeight());
3316  fhClusterCutsPt[0]->Fill(fMomentum.Pt(), GetEventWeight());
3317  }
3318  }
3319  }
3320  else
3321  { // reclusterized
3322  TClonesArray * clusterList = 0;
3323 
3324  if(GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()))
3325  clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
3326  else if(GetReader()->GetOutputEvent())
3327  clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
3328 
3329  if(clusterList)
3330  {
3331  Int_t nclusters = clusterList->GetEntriesFast();
3332  for (Int_t iclus = 0; iclus < nclusters; iclus++)
3333  {
3334  AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
3335 
3336  if(clus && clus->E() > GetReader()->GetEMCALPtMin())
3337  {
3338  clus->GetMomentum(fMomentum,GetVertex(0)) ;
3339 
3340  fhClusterCutsE [0]->Fill(clus->E() , GetEventWeight());
3341  fhClusterCutsPt[0]->Fill(fMomentum.Pt(), GetEventWeight());
3342  }
3343  }
3344  }
3345  }
3346 
3347  // Init arrays, variables, get number of clusters
3348  Int_t nCaloClusters = pl->GetEntriesFast();
3349 
3350  AliDebug(1,Form("Input %s cluster entries %d", GetCalorimeterString().Data(), nCaloClusters));
3351 
3352  //----------------------------------------------------
3353  // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
3354  //----------------------------------------------------
3355  // Loop on clusters
3356  for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
3357  {
3358  AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
3359  //printf("calo %d, %f\n",icalo,calo->E());
3360 
3361  //Get the index where the cluster comes, to retrieve the corresponding vertex
3362  Int_t evtIndex = 0 ;
3363  if (GetMixedEvent())
3364  {
3365  evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
3366  //Get the vertex and check it is not too large in z
3367  if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
3368  }
3369 
3370  //Cluster selection, not charged, with photon id and in fiducial cut
3372  {
3373  calo->GetMomentum(fMomentum,GetVertex(evtIndex)) ;
3374  }//Assume that come from vertex in straight line
3375  else
3376  {
3377  Double_t vertex[]={0,0,0};
3378  calo->GetMomentum(fMomentum,vertex) ;
3379  }
3380 
3381  //-----------------------------
3382  // Cluster selection
3383  //-----------------------------
3384  Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
3385  if(!ClusterSelected(calo,nMaxima)) continue;
3386 
3387  //----------------------------
3388  // Create AOD for analysis
3389  //----------------------------
3390  AliAODPWG4Particle aodph = AliAODPWG4Particle(fMomentum);
3391 
3392  //...............................................
3393  // Set the indeces of the original caloclusters (MC, ID), and calorimeter
3394  Int_t label = calo->GetLabel();
3395  aodph.SetLabel(label);
3396  aodph.SetCaloLabel(calo->GetID(),-1);
3397  aodph.SetDetectorTag(GetCalorimeter());
3398  //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
3399 
3400  //...............................................
3401  // Set bad channel distance bit
3402  Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
3403  if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
3404  else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
3405  else aodph.SetDistToBad(0) ;
3406  //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
3407 
3408  //-------------------------------------
3409  // Play with the MC stack if available
3410  //-------------------------------------
3411 
3412  // Check origin of the candidates
3413  Int_t tag = -1;
3414 
3415  if(IsDataMC())
3416  {
3417  tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(),GetCalorimeter());
3418  aodph.SetTag(tag);
3419 
3420  AliDebug(1,Form("Origin of candidate, bit map %d",aodph.GetTag()));
3421  }//Work with stack also
3422 
3423  //--------------------------------------------------------
3424  // Fill some shower shape histograms before PID is applied
3425  //--------------------------------------------------------
3426 
3427  Float_t maxCellFraction = 0;
3428  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo, maxCellFraction);
3429  if( absIdMax < 0 ) AliFatal("Wrong absID");
3430 
3431  Int_t largeTimeInCellCluster = kFALSE;
3432  FillShowerShapeHistograms(calo,tag,nMaxima,maxCellFraction,largeTimeInCellCluster);
3433  aodph.SetFiducialArea(largeTimeInCellCluster); // Temporary use of this container, FIXME
3434  //if(largeTimeInCellCluster > 1) printf("Set n cells large time %d, pt %2.2f\n",aodph.GetFiducialArea(),aodph.Pt());
3435 
3436  aodph.SetM02(calo->GetM02());
3437  aodph.SetM20(calo->GetM20());
3438  aodph.SetNLM(nMaxima);
3439 
3440  Float_t time = calo->GetTOF()*1e9;
3441  if(time > 400) time-=fConstantTimeShift; // in case of clusterizer running before (calibrate clusters not cells)
3442  aodph.SetTime(time);
3443 
3444  aodph.SetNCells(calo->GetNCells());
3445  Int_t nSM = GetModuleNumber(calo);
3446  aodph.SetSModNumber(nSM);
3447 
3448  Float_t en = fMomentum.E ();
3449  Float_t pt = fMomentum.Pt();
3450  Float_t eta = fMomentum.Eta();
3451  Float_t phi = GetPhi(fMomentum.Phi());
3452  Int_t ebin = -1;
3453  for(Int_t ie = 0; ie < fNEBinCuts; ie++)
3454  {
3455  if( en >= fEBinCuts[ie] && en < fEBinCuts[ie+1] ) ebin = ie;
3456  }
3457 
3458  Int_t icolAbs = -1, irowAbs = -1;
3460  {
3461  Float_t maxCellFraction = 0;
3462  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells,calo,maxCellFraction);
3463 
3464  Int_t icol = -1, irow = -1, iRCU = -1;
3465  GetModuleNumberCellIndexesAbsCaloMap(absIdMax,GetCalorimeter(), icol, irow, iRCU, icolAbs, irowAbs);
3466 
3467  if(ebin>=0 && ebin < fNEBinCuts)
3468  {
3469  fhEBinClusterEtaPhi[ebin]->Fill(eta,phi,GetEventWeight()) ;
3470 
3471  fhEBinClusterColRow[ebin]->Fill(icolAbs,irowAbs,GetEventWeight()) ;
3472  }
3473  }
3474 
3475  //-------------------------------------
3476  // PID selection or bit setting
3477  //-------------------------------------
3478 
3479  //...............................................
3480  // Data, PID check on
3481  if(IsCaloPIDOn())
3482  {
3483  // Get most probable PID, 2 options check bayesian PID weights or redo PID
3484  // By default, redo PID
3485 
3486  aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(calo));
3487 
3488  AliDebug(1,Form("PDG of identified particle %d",aodph.GetIdentifiedParticleType()));
3489 
3490  //If cluster does not pass pid, not photon, skip it.
3491  if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
3492  }
3493 
3494  //...............................................
3495  // Data, PID check off
3496  else
3497  {
3498  // Set PID bits for later selection (AliAnaPi0 for example)
3499  // GetIdentifiedParticleType already called in SetPIDBits.
3500 
3501  GetCaloPID()->SetPIDBits(calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
3502 
3503  AliDebug(1,"PID Bits set");
3504  }
3505 
3506  AliDebug(1,Form("Photon selection cuts passed: pT %3.2f, pdg %d",aodph.Pt(),aodph.GetIdentifiedParticleType()));
3507 
3508  fhClusterCutsE [9]->Fill(en, GetEventWeight());
3509  fhClusterCutsPt[9]->Fill(pt, GetEventWeight());
3510 
3511  //
3512  // Check local cluster activity around the current cluster
3513  //
3515  {
3516  Float_t radius = 0.2;
3517  // Accept cluster on EMCal limits - radius
3518  if(phi < 3.15 - radius && phi > 1.4 + radius && TMath::Abs(eta) < 0.7-radius)
3519  {
3520  Float_t sumE = 0;
3521  Int_t sumM = 0;
3522  Float_t sumEHi = 0;
3523  Int_t sumMHi = 0;
3524  for(Int_t icalo2 = 0; icalo2 < nCaloClusters; icalo2++)
3525  {
3526  if ( icalo2 == icalo ) continue;
3527 
3528  AliVCluster * calo2 = (AliVCluster*) (pl->At(icalo2));
3529 
3530  // Select clusters in a radius of R=0.2
3531  calo2->GetMomentum(fMomentum2,GetVertex(evtIndex)) ;
3532 
3533  Float_t dEta = eta-fMomentum2.Eta();
3534  Float_t dPhi = phi-GetPhi(fMomentum2.Phi());
3535 
3536  if(TMath::Abs(dPhi) >= TMath::Pi())
3537  dPhi = TMath::TwoPi()-TMath::Abs(dPhi);
3538 
3539  if (TMath::Sqrt( dEta*dEta + dPhi*dPhi ) > 0.2) continue;
3540 
3541  sumM++;
3542  sumE += calo2->E();
3543 
3544  if( IsDataMC() && fStudyClusterOverlapsPerGenerator && calo2->GetNLabels() > 0)
3545  {
3546  TString genName;
3547  (GetReader()->GetMC())->GetCocktailGenerator(calo2->GetLabel(),genName);
3548 
3549  if(genName.Contains("ijing"))
3550  {
3551  sumMHi++;
3552  sumEHi += calo2->E();
3553  }
3554  }
3555  }
3556 
3557  fhLocalRegionClusterEnergySum ->Fill(en,sumE);
3558  fhLocalRegionClusterMultiplicity->Fill(en,sumM);
3559 
3561  {
3564  }
3565 
3567  {
3568  fhLocalRegionClusterEnergySumHijing ->Fill(en,sumEHi);
3569  fhLocalRegionClusterMultiplicityHijing->Fill(en,sumMHi);
3570 
3572  {
3575  }
3576  }
3577  }
3578  }
3579 
3580  //
3581  // Check if other generators contributed to the cluster
3582  //
3583  if( IsDataMC() && fStudyClusterOverlapsPerGenerator && calo->GetNLabels() > 0 )
3584  {
3585  TString genName;
3586  (GetReader()->GetMC())->GetCocktailGenerator(calo->GetLabel(),genName);
3587 
3588  Bool_t overlapGener = kFALSE;
3589  Bool_t overlapGenerNotHIJING = kFALSE;
3590  Bool_t overlapHIJINGAndOther = kFALSE;
3591 
3592  const UInt_t nlabels = calo->GetNLabels();
3593  for(UInt_t ilabel = 1; ilabel < nlabels; ilabel++)
3594  {
3595  Int_t label2 = calo->GetLabels()[ilabel];
3596  TString genName2;
3597  (GetReader()->GetMC())->GetCocktailGenerator(label2,genName2);
3598  if(genName2 != genName)
3599  {
3600  overlapGener = kTRUE;
3601  if(!genName.Contains("ijing") && !genName2.Contains("ijing"))
3602  overlapGenerNotHIJING = kTRUE;
3603  if (genName.Contains("ijing"))
3604  overlapHIJINGAndOther = kTRUE;
3605  }
3606  }
3607 
3608  if(overlapGener)
3609  {
3610  fhMergeGeneratorCluster->Fill(en);
3611  if(overlapGenerNotHIJING)
3613  if(overlapHIJINGAndOther)
3615  }
3616  else
3617  fhCleanGeneratorCluster->Fill(en);
3618  }
3619 
3620 
3622  {
3623  if(ebin>=0 && ebin < fNEBinCuts)
3624  {
3625  fhEBinClusterEtaPhiPID[ebin]->Fill(eta,phi,GetEventWeight()) ;
3626 
3627  fhEBinClusterColRowPID[ebin]->Fill(icolAbs,irowAbs,GetEventWeight()) ;
3628  }
3629  }
3630 
3631  if(nSM < GetCaloUtils()->GetNumberOfSuperModulesUsed() && nSM >=0)
3632  {
3633  fhEPhotonSM ->Fill(en, nSM, GetEventWeight());
3634  fhPtPhotonSM->Fill(pt, nSM, GetEventWeight());
3635  }
3636 
3637  fhNLocMax->Fill(calo->E(),nMaxima);
3638 
3639  // Few more control histograms for selected clusters
3640  fhMaxCellDiffClusterE->Fill(en, maxCellFraction , GetEventWeight());
3641  fhNCellsE ->Fill(en, calo->GetNCells() , GetEventWeight());
3642  fhTimePt ->Fill(pt, time , GetEventWeight());
3643 
3644  if(cells)
3645  {
3646  for(Int_t icell = 0; icell < calo->GetNCells(); icell++)
3647  fhCellsE->Fill(en, cells->GetCellAmplitude(calo->GetCellsAbsId()[icell]), GetEventWeight());
3648  }
3649 
3650  // Matching after cuts
3652 
3653  // Fill histograms to undertand pile-up before other cuts applied
3654  // Remember to relax time cuts in the reader
3655  if( IsPileUpAnalysisOn() ) FillPileUpHistograms(calo,cells, absIdMax);
3656 
3657  // Add AOD with photon object to aod branch
3658  AddAODParticle(aodph);
3659  }// loop
3660 
3661  AliDebug(1,Form("End fill AODs, with %d entries",GetOutputAODBranch()->GetEntriesFast()));
3662 }
3663 
3664 //______________________________________________
3665 // Fill histograms with selected clusters/output AOD particles.
3666 //______________________________________________
3668 {
3669  // In case of simulated data, fill acceptance histograms
3671 
3672  // Get vertex
3673  Double_t v[3] = {0,0,0}; //vertex ;
3674  GetReader()->GetVertex(v);
3675  //fhVertex->Fill(v[0],v[1],v[2]);
3676  if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
3677 
3678  //----------------------------------
3679  // Loop on stored AOD photons
3680  Int_t naod = GetOutputAODBranch()->GetEntriesFast();
3681  AliDebug(1,Form("AOD branch entries %d", naod));
3682 
3683  Float_t cen = GetEventCentrality();
3684  // printf("++++++++++ GetEventCentrality() %f\n",cen);
3685 
3686  Float_t ep = GetEventPlaneAngle();
3687 
3688  for(Int_t iaod = 0; iaod < naod ; iaod++)
3689  {
3690  AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
3691  Int_t pdg = ph->GetIdentifiedParticleType();
3692 
3693  AliDebug(2,Form("PDG %d, MC TAG %d, Calorimeter <%d>",ph->GetIdentifiedParticleType(),ph->GetTag(), ph->GetDetectorTag())) ;
3694 
3695  // If PID used, fill histos with photons in Calorimeter GetCalorimeter()
3696  if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
3697 
3698  if(((Int_t) ph->GetDetectorTag()) != GetCalorimeter()) continue;
3699 
3700  AliDebug(2,Form("ID Photon: pt %f, phi %f, eta %f", ph->Pt(),ph->Phi(),ph->Eta())) ;
3701 
3702  //................................
3703  //Fill photon histograms
3704  Float_t ptcluster = ph->Pt();
3705  Float_t phicluster = ph->Phi();
3706  Float_t etacluster = ph->Eta();
3707  Float_t ecluster = ph->E();
3708 
3709  fhEPhoton ->Fill(ecluster , GetEventWeight());
3710  fhPtPhoton ->Fill(ptcluster, GetEventWeight());
3711 
3712  fhPhiPhoton ->Fill(ptcluster, phicluster, GetEventWeight());
3713  fhEtaPhoton ->Fill(ptcluster, etacluster, GetEventWeight());
3714 
3715  if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster, GetEventWeight());
3716  else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster, GetEventWeight());
3717 
3719  {
3720  fhPtCentralityPhoton ->Fill(ptcluster,cen, GetEventWeight()) ;
3721  fhPtEventPlanePhoton ->Fill(ptcluster,ep , GetEventWeight()) ;
3722  }
3723 
3724 // Comment this part, not needed but in case to know how to do it in the future
3725 // // Get original cluster, to recover some information
3726 // AliVCaloCells* cells = 0;
3727 // TObjArray * clusters = 0;
3728 // if(GetCalorimeter() == kEMCAL)
3729 // {
3730 // cells = GetEMCALCells();
3731 // clusters = GetEMCALClusters();
3732 // }
3733 // else
3734 // {
3735 // cells = GetPHOSCells();
3736 // clusters = GetPHOSClusters();
3737 // }
3738 //
3739 // Int_t iclus = -1;
3740 // AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
3741 // if(cluster)
3742 
3743  //.......................................
3744  // Play with the MC data if available
3745  if(IsDataMC())
3746  {
3747  //....................................................................
3748  // Access MC information in stack if requested, check that it exists.
3749  Int_t label = ph->GetLabel();
3750 
3751  if(label < 0)
3752  {
3753  AliDebug(1,Form("*** bad label ***: label %d", label));
3754  continue;
3755  }
3756 
3757  Float_t eprim = 0;
3758  Float_t ptprim = 0;
3759  Bool_t ok = kFALSE;
3760  Int_t pdg = 0, status = 0, momLabel = -1;
3761 
3762  //fPrimaryMom = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
3763  fPrimaryMom = GetMCAnalysisUtils()->GetMother(label,GetReader(), pdg, status, ok, momLabel);
3764 
3765  if(ok)
3766  {
3767  eprim = fPrimaryMom.Energy();
3768  ptprim = fPrimaryMom.Pt();
3769  }
3770 
3771  Int_t tag =ph->GetTag();
3772  Int_t mcParticleTag = -1;
3774  {
3775  fhMCE [kmcPhoton] ->Fill(ecluster , GetEventWeight());
3776  fhMCPt [kmcPhoton] ->Fill(ptcluster, GetEventWeight());
3777 
3778  fhMCPhi[kmcPhoton] ->Fill(ecluster,phicluster, GetEventWeight());
3779  fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster, GetEventWeight());
3780 
3781  fhMC2E [kmcPhoton] ->Fill(ecluster , eprim , GetEventWeight());
3782  fhMC2Pt [kmcPhoton] ->Fill(ptcluster, ptprim, GetEventWeight());
3783 
3784  fhMCDeltaE [kmcPhoton] ->Fill(ecluster , eprim-ecluster , GetEventWeight());
3785  fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster, ptprim-ptcluster, GetEventWeight());
3786 
3787  if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) &&
3789  {
3790  fhMCE [kmcConversion] ->Fill(ecluster , GetEventWeight());
3791  fhMCPt [kmcConversion] ->Fill(ptcluster, GetEventWeight());
3792 
3793  fhMCPhi[kmcConversion] ->Fill(ecluster, phicluster, GetEventWeight());
3794  fhMCEta[kmcConversion] ->Fill(ecluster, etacluster, GetEventWeight());
3795 
3796  fhMC2E [kmcConversion] ->Fill(ecluster , eprim , GetEventWeight());
3797  fhMC2Pt [kmcConversion] ->Fill(ptcluster, ptprim, GetEventWeight());
3798 
3799  fhMCDeltaE [kmcConversion] ->Fill(ecluster , eprim-ecluster , GetEventWeight());
3800  fhMCDeltaPt[kmcConversion] ->Fill(ptcluster, ptprim-ptcluster, GetEventWeight());
3801 
3802  Int_t pdgD = 0, statusD = 0, daugLabel = -1;
3803  Bool_t okD = kFALSE;
3804 
3805  //fMomentum =
3806  GetMCAnalysisUtils()->GetDaughter(0,momLabel,GetReader(),pdgD, statusD, okD, daugLabel, fProdVertex);
3807 
3808  if(okD)
3809  {
3810  Float_t prodR = TMath::Sqrt(fProdVertex.X()*fProdVertex.X()+fProdVertex.Y()*fProdVertex.Y());
3811 
3812  //printf("Conversion: mom pdg %d (stat %d), 1st daugher %d (stat %d), mom label %d, org label %d, daugh label %d, prodR %f\n",pdg,status, pdgD, statusD,
3813  // momLabel, label,daugLabel,prodR);
3814 
3816  {
3817 
3818  fhMCConversionVertex->Fill(ptcluster,prodR,GetEventWeight());
3819 
3820  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 && ph->GetSModNumber() >= GetFirstSMCoveredByTRD() )
3821  fhMCConversionVertexTRD->Fill(ptcluster,prodR,GetEventWeight());
3822  }
3823 
3824  if ( fFillSSHistograms )
3825  {
3826  Float_t m02 = ph->GetM02();
3827  Float_t m20 = ph->GetM20();
3828 
3829  // conversion vertex vs shower shape
3831  {
3832  Int_t convR = -1;
3833  if ( prodR < 75. ) convR = 0;
3834  else if ( prodR < 275. ) convR = 1;
3835  else if ( prodR < 375. ) convR = 2;
3836  else if ( prodR < 400. ) convR = 3;
3837  else if ( prodR < 430. ) convR = 4;
3838  else convR = 5;
3839 
3840  if ( convR >= 0 )
3841  {
3842  fhMCConversionLambda0Rcut[convR]->Fill(ptcluster,m02,GetEventWeight());
3843  fhMCConversionLambda1Rcut[convR]->Fill(ptcluster,m20,GetEventWeight());
3844 
3845  if ( GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 && ph->GetSModNumber() >= GetFirstSMCoveredByTRD() )
3846  {
3847  fhMCConversionLambda0RcutTRD[convR]->Fill(ptcluster,m02,GetEventWeight());
3848  fhMCConversionLambda1RcutTRD[convR]->Fill(ptcluster,m20,GetEventWeight());
3849  }
3850  // //
3851  // // EMCAL SM regions
3852  // //
3853  // if ( GetCalorimeter() == kEMCAL && fFillEMCALRegionSSHistograms )
3854  // {
3855  // // Get original cluster, needed to feed the subregion selection method
3856  //
3857  // Int_t iclus = -1;
3858  // AliVCluster *cluster = FindCluster(GetEMCALClusters(),ph->GetCaloLabel(0),iclus);
3859  //
3860  // Int_t etaRegion = -1, phiRegion = -1;
3861  //
3862  // if ( cluster ) GetCaloUtils()->GetEMCALSubregion(cluster,GetReader()->GetEMCALCells(),etaRegion,phiRegion);
3863  //
3864  // if( etaRegion >= 0 && etaRegion < 4 && phiRegion >=0 && phiRegion < 3 )
3865  // {
3866  // fhLam0EMCALRegionMCConvRcut[etaRegion][phiRegion][convR]->Fill(ptcluster,m02, GetEventWeight());
3867  //
3868  // if ( GetFirstSMCoveredByTRD() >= 0 && ph->GetSModNumber() >= GetFirstSMCoveredByTRD() )
3869  // fhLam0EMCALRegionTRDMCConvRcut[etaRegion][phiRegion][convR]->Fill(ptcluster, m02, GetEventWeight());
3870  //
3871  // } // region found
3872  // } // check region
3873  } // conv region
3874  } // check conv region
3875 
3876  } // fill Sh Sh histograms
3877  } // okD
3878  } // conversion
3879 
3880  if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) )
3881  {
3882  mcParticleTag = kmcPrompt;
3883  }
3884  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) )
3885  {
3886  mcParticleTag = kmcFragmentation;
3887  }
3888  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) )
3889  {
3890  mcParticleTag = kmcISR;
3891  }
3892  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) )
3893  {
3894  mcParticleTag = kmcPi0;
3895  }
3896  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) )
3897  {
3898  mcParticleTag = kmcEta;
3899  }
3900  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) )
3901  {
3902  mcParticleTag = kmcPi0Decay;
3903  }
3904  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) )
3905  {
3906  mcParticleTag = kmcEtaDecay;
3907  }
3908  else
3909  {
3910  mcParticleTag = kmcOtherDecay;
3911  }
3912  }
3913  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) )
3914  {
3915  mcParticleTag = kmcAntiNeutron;
3916  }
3917  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) )
3918  {
3919  mcParticleTag = kmcAntiProton;
3920  }
3921  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCNeutron) )
3922  {
3923  mcParticleTag = kmcNeutron;
3924  }
3925  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCProton) )
3926  {
3927  mcParticleTag = kmcProton;
3928  }
3929  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPion) )
3930  {
3931  mcParticleTag = kmcChPion;
3932  }
3933  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) )
3934  {
3935  mcParticleTag = kmcElectron;
3936  }
3937  else if( fhMCE[kmcOther] )
3938  {
3939  mcParticleTag = kmcOther;
3940 
3941  // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
3942  // ph->GetLabel(),ph->Pt());
3943  // for(Int_t i = 0; i < 20; i++) {
3944  // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
3945  // }
3946  // printf("\n");
3947  }
3948 
3949  if(mcParticleTag >= 0 && fhMCE[mcParticleTag])
3950  {
3951  fhMCE [mcParticleTag]->Fill(ecluster , GetEventWeight());
3952  fhMCPt [mcParticleTag]->Fill(ptcluster, GetEventWeight());
3953 
3954  fhMCPhi [mcParticleTag]->Fill(ecluster, phicluster, GetEventWeight());
3955  fhMCEta [mcParticleTag]->Fill(ecluster, etacluster, GetEventWeight());
3956 
3957  fhMC2E [mcParticleTag]->Fill(ecluster , eprim , GetEventWeight());
3958  fhMC2Pt [mcParticleTag]->Fill(ptcluster, ptprim, GetEventWeight());
3959 
3960  fhMCDeltaE [mcParticleTag]->Fill(ecluster , eprim-ecluster , GetEventWeight());
3961  fhMCDeltaPt[mcParticleTag]->Fill(ptcluster, ptprim-ptcluster, GetEventWeight());
3962  }
3963  }// Histograms with MC
3964  }// aod loop
3965 }
3966 
3967 //__________________________________________________
3969 //__________________________________________________
3970 void AliAnaPhoton::Print(const Option_t * opt) const
3971 {
3972  if(! opt)
3973  return;
3974 
3975  printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
3977 
3978  printf("Calorimeter = %s\n", GetCalorimeterString().Data()) ;
3979  printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
3980  printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
3981  printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
3982  printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
3983  printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
3984  printf("Number of cells in cluster is > %d \n", fNCellsCut);
3985  printf(" \n") ;
3986 }
Bool_t IsPileUpFromSPD() const
Bool_t fFillOnlySimpleSSHisto
Fill selected cluster histograms, selected SS histograms.
Definition: AliAnaPhoton.h:183
Float_t GetHistoPtMax() const
TH2F * fhEBinClusterColRowPID[14]
! Column and row location of cluster max E cell in different energy bins, after PID cut ...
Definition: AliAnaPhoton.h:467
TH2F * fhLam1ETMTRD
! Cluster lambda1 vs E, SM covered by TRD, cut on Track Matching residual
Definition: AliAnaPhoton.h:253
TH1F * fhClusterCutsE[10]
! control histogram on the different photon selection cuts, E
Definition: AliAnaPhoton.h:207
TH2F * fhPhiLam0LowE
! Cluster phi vs lambda0, E<2
Definition: AliAnaPhoton.h:263
TH2F * fhNCellsLam1HighE
! number of cells in cluster vs lambda1, E>2
Definition: AliAnaPhoton.h:259
TH2F * fhLam1Lam0HighE
! Cluster lambda1 vs lambda0, E>2
Definition: AliAnaPhoton.h:269
Int_t pdg
TH2F * fhTrackMatchedDEtaTRD[2]
! Eta distance between track and cluster vs cluster E, after and before photon cuts, behind TRD
Definition: AliAnaPhoton.h:366
TH1F * fhMCPt[fgkNmcTypes]
! Number of identified photon vs cluster pT coming from MC particle
Definition: AliAnaPhoton.h:294
TH2F * fhTrackMatchedDEtaDPhiNeg[2]
! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV, after and before photon cuts ...
Definition: AliAnaPhoton.h:364
Int_t fNCellsCut
Accept for the analysis clusters with more than fNCellsCut cells.
Definition: AliAnaPhoton.h:172
TH2F * fhEmbedPi0ELambda0FullBkg
! Lambda0 vs E for embedded photons with less than 10% of the cluster energy
Definition: AliAnaPhoton.h:350
TH2F * fhDispE
! Cluster dispersion vs E
Definition: AliAnaPhoton.h:228
TH2F * fhMCEta[fgkNmcTypes]
! eta of identified photon coming from MC particle
Definition: AliAnaPhoton.h:296
virtual AliMCEvent * GetMC() const
Int_t fNLMCutMax
Remove clusters/cells with number of local maxima larger than this value.
Definition: AliAnaPhoton.h:175
TH2F * fhMCNCellsE[fgkNssTypes]
! NCells per cluster vs energy
Definition: AliAnaPhoton.h:327
TH2F * fhDTimeLam0BinPerSMWeighted[2][20]
! t_max-t_cell, not maximum cluster cell, in a l0 bin per SM, log weight Cell E / Cluster E ...
Definition: AliAnaPhoton.h:424
Int_t GetHistoNClusterCellMin() const
Float_t GetHistoPtMin() const
TH2F * fhDispEtaDispPhi[7]
! shower dispersion in eta direction vs phi direction for 5 E bins [0-2],[2-4],[4-6],[6-10],[> 10]
Definition: AliAnaPhoton.h:282
TH2F * fhCellClusterEFracAndTime[2][7]
! Cell in Cluster E cell/ E cluster vs cell Time, in a l0 bin, different Pt bins
Definition: AliAnaPhoton.h:436
TH2F * fhLam1ETRD
! Cluster lambda1 vs E, SM covered by TRD
Definition: AliAnaPhoton.h:243
TH2F * fhEClusterSM
! Cluster E distribution per SM, before any selection, after reader
Definition: AliAnaPhoton.h:397
TH2F * fhMaxCellDiffClusterE
! Fraction of energy carried by cell with maximum energy
Definition: AliAnaPhoton.h:211
TH2F * fhPtClusterSM
! Cluster E distribution per SM, before any selection, after reader
Definition: AliAnaPhoton.h:399
double Double_t
Definition: External.C:58
TH2F * fhDispETRD
! Cluster dispersion vs E, SM covered by TRD
Definition: AliAnaPhoton.h:240
Int_t GetHistoShowerShapeBins() const
Float_t GetHistodEdxMax() const
virtual void AddToHistogramsName(TString add)
virtual AliVCaloCells * GetEMCALCells() const
TH2F * fhLam1PerNLargeTimeInClusterCell[5]
! Cluster lambda1 vs Pt, when any secondary cell has t > 50 ns, per number of large time secondary ce...
Definition: AliAnaPhoton.h:460
TH2F * fhTrackMatchedDEtaDPhiPos[2]
! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV, after and before ...
Definition: AliAnaPhoton.h:360
TH2F * fhLam0PerNLargeTimeInClusterCell[5]
! Cluster lambda0 vs Pt, when any secondary cell has t > 50 ns, per number of large time secondary ce...
Definition: AliAnaPhoton.h:459
Definition: External.C:236
TH2F * fhMCPtLambda0[fgkNssTypes]
! pT vs Lambda0 from MC particle
Definition: AliAnaPhoton.h:313
TH2F * fhNCellsLam1LowE
! number of cells in cluster vs lambda1
Definition: AliAnaPhoton.h:256
Bool_t fFillTMHisto
Fill track matching plots.
Definition: AliAnaPhoton.h:167
TH2F * fhPtPhotonNPileUpSPDVtx
! photon pt vs number of spd pile-up vertices
Definition: AliAnaPhoton.h:390
Bool_t fFillEBinAcceptanceHisto
Fill histograms with cluster eta-phi distribution and column-row cell, for different energy bins...
Definition: AliAnaPhoton.h:197
TH2F * fhPtPhotonNPileUpTrkVtx
! photon pt vs number of track pile-up vertices
Definition: AliAnaPhoton.h:391
TH2F * fhLocalRegionClusterEnergySumPerCentrality
! Sum of energy near the cluster, R<0.2, vs centrality percentile
Definition: AliAnaPhoton.h:471
TH2F * fhNCellsDispLowE
! number of cells in cluster vs dispersion
Definition: AliAnaPhoton.h:257
TH2F * fhTrackMatchedDEtaPos[2]
! Eta distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:358
TH2F * fhSphericityE
! shower sphericity in eta vs phi
Definition: AliAnaPhoton.h:279
TH2F * fhDispEtaE
! shower dispersion in eta direction
Definition: AliAnaPhoton.h:273
TH2F * fhPtPhotonNPileUpTrkVtxTimeCut
! photon pt vs number of track pile-up vertices, time cut +- 25 ns
Definition: AliAnaPhoton.h:393
virtual Int_t GetModuleNumberCellIndexesAbsCaloMap(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU, Int_t &icolAbs, Int_t &irowAbs) const
TH2F * fhEtaPrimMC[fgkNmcPrimTypes]
! Eta of generated photon
Definition: AliAnaPhoton.h:302
AliEMCALRecoUtils * GetEMCALRecoUtils() const
TH2F * fhPtPhotonSM
! photon-like cluster E distribution per SM
Definition: AliAnaPhoton.h:400
TH2F * fhEBinClusterEtaPhiPID[14]
! Eta-Phi location of cluster in different energy bins, after PID cut
Definition: AliAnaPhoton.h:466
Bool_t ReadAODMCParticles() const
Bool_t fFillEMCALRegionSSHistograms
Fill shower shape histograms in EMCal slices.
Definition: AliAnaPhoton.h:179
virtual void GetVertex(Double_t vertex[3]) const
TH2F * fhTrackMatchedDPhiTRD[2]
! Phi distance between track and cluster vs cluster E, after and before photon cuts, behind TRD
Definition: AliAnaPhoton.h:367
Float_t fMinDist2
Cuts on Minimal distance to study acceptance evaluation.
Definition: AliAnaPhoton.h:162
TH1F * fhPtPhotonPileUp[7]
! pT distribution of selected photons
Definition: AliAnaPhoton.h:383
TH1F * fhPtPhoton
! Number of identified photon vs transerse momentum
Definition: AliAnaPhoton.h:216
Bool_t fRejectTrackMatch
If PID on, reject clusters which have an associated TPC track.
Definition: AliAnaPhoton.h:165
TH2F * fhLocalRegionClusterMultiplicity
! Cluster multiplicity near cluster, R<0.2, vs cluster E
Definition: AliAnaPhoton.h:470
void MakeAnalysisFillAOD()
Float_t GetPhi(Float_t phi) const
Shift phi angle in case of negative value 360 degrees. Example TLorenzVector::Phi defined in -pi to p...
TLorentzVector fMomentum2
! Cluster momentum, temporary container
Definition: AliAnaPhoton.h:191
TH2F * fhTrackMatchedDPhiMCNoOverlap[2]
! Phi distance between track and cluster vs cluster E, not other particle overlap, after and before photon cuts
Definition: AliAnaPhoton.h:372
TH2F * fhPtEventPlanePhoton
! event plane vs photon pT
Definition: AliAnaPhoton.h:223
TH2F * fhLam0PtNLM1
! Cluster lambda0 vs pT, for clusters with NLM=1
Definition: AliAnaPhoton.h:235
TH2F * fhLam1PtNLM1
! Cluster lambda0 vs pT, for clusters with NLM=1
Definition: AliAnaPhoton.h:237
virtual AliVEvent * GetInputEvent() const
TH2F * fhLam0PtTRD
! Cluster lambda0 vs pT, SM covered by TRD
Definition: AliAnaPhoton.h:242
TH2F * fhMCConversionVertex
! Conversion distance for photon clusters that have at least a contributor from the conversion...
Definition: AliAnaPhoton.h:402
TH2F * fhEmbedPi0ELambda0FullSignal
! Lambda0 vs E for embedded photons with more than 90% of the cluster energy
Definition: AliAnaPhoton.h:347
Bool_t IsPileUpFromSPDAndNotEMCal() const
Check if event is from pile-up determined by SPD and not by EMCal.
TH2F * fhEmbedPi0ELambda0MostlyBkg
! Lambda0 vs E for embedded photons with 50%<fraction<10%
Definition: AliAnaPhoton.h:349
TH2F * fhMCESphericity[fgkNssTypes]
! shower sphericity, eta vs phi
Definition: AliAnaPhoton.h:334
TH2F * fhEtaPhiLargeTimeInClusterCell[2][7]
! Cluster eta/phi, with at least one significant cell with large time
Definition: AliAnaPhoton.h:447
TH2F * fhMC2Pt[fgkNmcTypes]
! pT distribution, Reco vs MC coming from MC particle
Definition: AliAnaPhoton.h:291
TH2F * fhEtaPhiPhoton
! Pseudorapidity vs Phi of identified photon for E > 0.5
Definition: AliAnaPhoton.h:219
virtual Float_t GetZvertexCut() const
Maximal number of events for mixin.
TH2F * fhPhiPhoton
! Azimuthal angle of identified photon vs transerse momentum
Definition: AliAnaPhoton.h:217
virtual Double_t GetEventPlaneAngle() const
TH2F * fhYPrimMC[fgkNmcPrimTypes]
! Rapidity of generated photon
Definition: AliAnaPhoton.h:301
TH2F * fhTrackMatchedDEtaDPhi[2]
! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV, after and before ...
Definition: AliAnaPhoton.h:356
void FillAcceptanceHistograms()
TH2F * fhSumEtaE
! shower dispersion in eta direction
Definition: AliAnaPhoton.h:275
virtual Bool_t IsTrackMatched(AliVCluster *cluster, AliVEvent *event)
TH2F * fhMCEDispEtaPhiDiff[fgkNssTypes]
! shower dispersion in eta -phi direction
Definition: AliAnaPhoton.h:333
TH2F * fhColRowLam0BinPtBin[2][7]
! Cell hits, not maximum cluster cell, in a l0 bin, different Pt bins
Definition: AliAnaPhoton.h:432
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
TH2F * fhCellClusterELam0BinPerSM[2][20]
! Cell E vs cluster pT, not maximum cluster cell, in a l0 bin per SM
Definition: AliAnaPhoton.h:427
Int_t GetHistoPhiBins() const
TH2F * fhEtaLam0LowE
! Cluster eta vs lambda0, E<2
Definition: AliAnaPhoton.h:262
Float_t fEBinCuts[15]
Energy bins cut.
Definition: AliAnaPhoton.h:198
TH2F * fhPtPhotonNPileUpSPDVtxTimeCut
! photon pt vs number of spd pile-up vertices, time cut +-25 ns
Definition: AliAnaPhoton.h:392
TH2F * fhMCConversionVertexTRD
! Conversion distance for photon clusters that have at least a contributor from the conversion...
Definition: AliAnaPhoton.h:403
Bool_t fFillSSHistograms
Fill shower shape histograms.
Definition: AliAnaPhoton.h:177
TH2F * fhdEdx[2]
! Matched track dEdx vs cluster E, after and before photon cuts
Definition: AliAnaPhoton.h:377
TH2F * fhLam0ETRD
! Cluster lambda0 vs E, SM covered by TRD
Definition: AliAnaPhoton.h:241
Bool_t fStudyClusterOverlapsPerGenerator
In case of coctail generators, check the content of the cluster.
Definition: AliAnaPhoton.h:202
TH2F * fhDispETM
! Cluster dispersion vs E, cut on Track Matching residual
Definition: AliAnaPhoton.h:245
TH2F * fhLocalRegionClusterEnergySum
! Sum of energy near the cluster, R<0.2, vs cluster E
Definition: AliAnaPhoton.h:469
TH2F * fhEmbedPhotonELambda0FullSignal
! Lambda0 vs E for embedded photons with more than 90% of the cluster energy
Definition: AliAnaPhoton.h:342
Float_t GetHistoTrackResidualPhiMin() const
TH2F * fhEtaPhoton
! Pseudorapidity of identified photon vs transerse momentum
Definition: AliAnaPhoton.h:218
TH2F * fhDispSumEtaDiffE
! difference of 2 eta dispersions
Definition: AliAnaPhoton.h:280
void SwitchOnBayesian()
Definition: AliCaloPID.h:136
Bool_t IsPileUpFromNotSPDAndNotEMCal() const
Check if event not from pile-up determined neither by SPD nor by EMCal.
TH2F * fhTimePtPhotonSPD
! Time of photon cluster vs Pt, IsSPDPileUp
Definition: AliAnaPhoton.h:386
TH2F * fhMCDispEtaDispPhi[7][fgkNssTypes]
! shower dispersion in eta direction vs phi direction for 5 E bins [0-2],[2-4],[4-6],[6-10],[> 10]
Definition: AliAnaPhoton.h:335
Float_t GetHistoTrackResidualEtaMin() const
Int_t GetHistoNClusterCellBins() const
virtual TClonesArray * GetOutputAODBranch() const
TH2F * fhLam0EMCALRegionPerSM[4][3][20]
! Cluster lambda0 vs Pt, in different EMCal regions
Definition: AliAnaPhoton.h:414
virtual void GetVertex(Double_t v[3]) const
void InitParameters()
Initialize the parameters of the analysis.
Int_t GetHistoPOverEBins() const
TH2F * fhNCellsE
! number of cells in cluster vs E
Definition: AliAnaPhoton.h:209
TH1F * fhPtPrimMC[fgkNmcPrimTypes]
! Number of generated photon vs pT
Definition: AliAnaPhoton.h:299
Bool_t IsMCParticleInCalorimeterAcceptance(Int_t calo, TParticle *particle)
Float_t GetHistoPhiMin() const
TH2F * fhTimePt
! Time of photon cluster vs pt
Definition: AliAnaPhoton.h:212
TH2F * fhEtaPhi
! Pseudorapidity vs Phi of clusters for E > 0.5
Definition: AliAnaPhoton.h:213
TH2F * fhMCLambda0DispPhi[7][fgkNssTypes]
! shower shape correlation l0 vs disp phi
Definition: AliAnaPhoton.h:337
TH2F * fhLam0PerSMLargeTimeInClusterCell[20]
! Cluster lambda0 vs Pt, when any secondary cell has t > 50 ns, in different SM
Definition: AliAnaPhoton.h:457
TH2F * fhCellClusterEAndTime[2][7]
! Cell in Cluster E cell vs cell Time, in a l0 bin, different Pt bins
Definition: AliAnaPhoton.h:435
TH2F * fhNCellsWithLargeTimeInCluster[2][20]
! Number of cells in cluster with large time
Definition: AliAnaPhoton.h:453
TH2F * fhEPhotonSM
! photon-like cluster E distribution per SM
Definition: AliAnaPhoton.h:398
TH2F * fhEOverPTRD[2]
! Matched track E cluster over P track vs cluster E, after dEdx cut, after and before photon cuts...
Definition: AliAnaPhoton.h:379
TString GetPIDParametersList()
Put data member values in string to keep in output container.
Definition: AliCaloPID.cxx:892
TH2F * fhMCELambda0[fgkNssTypes]
! E vs Lambda0 from MC particle
Definition: AliAnaPhoton.h:312
TLorentzVector GetMother(Int_t label, const AliCaloTrackReader *reader, Bool_t &ok)
Bool_t IsPileUpFromSPDOrEMCal() const
Check if event is from pile-up determined by SPD or EMCal.
TH2F * fhTrackMatchedDPhiNeg[2]
! Phi distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:363
Bool_t IsPileUpFromEMCalAndNotSPD() const
Check if event is from pile-up determined by EMCal, not by SPD.
void MakeAnalysisFillHistograms()
TH2F * fhMCELambda1[fgkNssTypes]
! E vs Lambda1 from MC particle
Definition: AliAnaPhoton.h:314
TH2F * fhLocalRegionClusterMultiplicityPerCentrality
! Cluster multiplicity near cluster, R<0.2, vs centrality percentile
Definition: AliAnaPhoton.h:472
TH2F * fhLambda0DispPhi[7]
! shower shape correlation l0 vs disp phi
Definition: AliAnaPhoton.h:284
const Double_t etamin
TH2F * fhLambda0DispEta[7]
! shower shape correlation l0 vs disp eta
Definition: AliAnaPhoton.h:283
virtual AliVCaloCells * GetEMCALCells() const
Base class for CaloTrackCorr analysis algorithms.
TH2F * fhCellClusterEFracLam0BinPerSMLargeTime[2][20]
! Cell in Cluster E cell / Ecluster vs cluster pT, with large time
Definition: AliAnaPhoton.h:449
virtual TString GetCalorimeterString() const
TH2F * fhLocalRegionClusterEnergySumHijing
! Sum of energy near the cluster, R<0.2, vs cluster E, hijing tagged mc clusters
Definition: AliAnaPhoton.h:474
Int_t fNOriginHistograms
Fill only NOriginHistograms of the 14 defined types.
Definition: AliAnaPhoton.h:187
static const Int_t fgkNmcPrimTypes
Total number of MC primary histograms.
Definition: AliAnaPhoton.h:150
virtual Bool_t IsRealCaloAcceptanceOn() const
Float_t GetHistodEdxMin() const
virtual AliFiducialCut * GetFiducialCut()
TH2F * fhCellClusterEFracLam0BinPerSMLargeTimeTotal[2][20]
! Sum of all Cell in Cluster , with large time E cell / Ecluster vs cluster pT
Definition: AliAnaPhoton.h:450
int Int_t
Definition: External.C:63
TH2F * fhTimePtPhotonNoCut
! Time of photon cluster vs Pt, no cut
Definition: AliAnaPhoton.h:385
TH2F * fhPtPhotonNPileUpSPDVtxTimeCut2
! photon pt vs number of spd pile-up vertices, time cut +-75 ns
Definition: AliAnaPhoton.h:394
TH2F * fhEOverP[2]
! Matched track E cluster over P track vs cluster E, after dEdx cut, after and before photon cuts ...
Definition: AliAnaPhoton.h:378
TH2F * fhTrackMatchedDEta[2]
! Eta distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:354
TH1F * fhEPrimMC[fgkNmcPrimTypes]
! Number of generated photon vs energy
Definition: AliAnaPhoton.h:298
virtual TClonesArray * GetAODMCParticles() const
virtual AliHistogramRanges * GetHistogramRanges()
TH2F * fhCellsE
! energy of cells in cluster vs E of cluster
Definition: AliAnaPhoton.h:210
Bool_t ReadStack() const
unsigned int UInt_t
Definition: External.C:33
TH2F * fhDispPt
! Cluster dispersion vs pT
Definition: AliAnaPhoton.h:229
TH2F * fhDispETMTRD
! Cluster dispersion vs E, SM covered by TRD, cut on Track Matching residual
Definition: AliAnaPhoton.h:250
float Float_t
Definition: External.C:68
TH2F * fhPhiPrimMC[fgkNmcPrimTypes]
! Phi of generted photon
Definition: AliAnaPhoton.h:300
TH2F * fhLam1ETM
! Cluster lambda1 vs E, cut on Track Matching residual
Definition: AliAnaPhoton.h:248
Float_t GetHistoTrackResidualPhiMax() const
Filter EMCal/PHOS clusters for photon analysis.
Definition: AliAnaPhoton.h:32
const Double_t ptmax
TH2F * fhLam1PerSM[20]
! Cluster lambda0 vs Pt, in different SM
Definition: AliAnaPhoton.h:456
TH2F * fhEtaPhi05Photon
! Pseudorapidity vs Phi of identified photon for E < 0.5
Definition: AliAnaPhoton.h:220
virtual AliEMCALGeometry * GetEMCALGeometry() const
TH2F * fhDispSumPhiDiffE
! difference of 2 phi dispersions
Definition: AliAnaPhoton.h:281
TH2F * fhEBinClusterColRow[14]
! Column and row location of cluster max E cell in different energy bins.
Definition: AliAnaPhoton.h:465
TH2F * fhLam0PtNLM2
! Cluster lambda0 vs pT, for clusters with NLM=2
Definition: AliAnaPhoton.h:236
TH2F * fhNCellsLam0HighE
! number of cells in cluster vs lambda0, E>2
Definition: AliAnaPhoton.h:258
Bool_t IsInFiducialCut(Float_t eta, Float_t phi, Int_t det) const
TH2F * fhLocalRegionClusterMultiplicityPerCentralityHijing
! Cluster multiplicity near cluster, R<0.2, vs centrality percentile, hijing tagged mc clusters ...
Definition: AliAnaPhoton.h:477
Int_t CheckOrigin(Int_t label, const AliCaloTrackReader *reader, Int_t calorimeter)
virtual AliAODEvent * GetOutputEvent() const
Float_t GetHistoShowerShapeMin() const
TList * GetCreateOutputObjects()
TH2F * fhMCLambda0DispEta[7][fgkNssTypes]
! shower shape correlation l0 vs disp eta
Definition: AliAnaPhoton.h:336
Int_t GetHistodEdxBins() const
TH2F * fhMCNCellsvsClusterMaxCellDiffE6[fgkNssTypes]
! NCells vs fraction of energy of max cell for E > 6
Definition: AliAnaPhoton.h:326
virtual AliCalorimeterUtils * GetCaloUtils() const
Int_t GetHistoNClusterCellMax() const
TH2F * fhCellClusterELam0BinPerSMLargeTime[2][20]
! Cell in Cluster E cell vs cluster pT, with large time
Definition: AliAnaPhoton.h:451
Int_t GetHistoTrackResidualEtaBins() const
TH2F * fhLam1PerSMLargeTimeInClusterCell[20]
! Cluster lambda1 vs Pt, when any secondary cell has t > 50 ns, in different SM
Definition: AliAnaPhoton.h:458
Float_t fMinDist3
One more cut on distance used for acceptance-efficiency study.
Definition: AliAnaPhoton.h:163
Int_t GetHistoTrackResidualPhiBins() const
TH2F * fhMCPhotonELambda0TwoOverlap
! E vs Lambda0 from MC photons, 2 particles overlap
Definition: AliAnaPhoton.h:318
Int_t GetNumberOfSuperModulesUsed() const
TH2F * fhMCConversionLambda1RcutTRD[6]
! Shower shape M20 of photon conversions, depending on conversion vertex, SM covered by TRD ...
Definition: AliAnaPhoton.h:407
const Double_t ptmin
virtual Bool_t IsHighMultiplicityAnalysisOn() const
TH2F * fhMCPhotonELambda0NOverlap
! E vs Lambda0 from MC photons, N particles overlap
Definition: AliAnaPhoton.h:319
TH1F * fhClusterCutsPt[10]
! control histogram on the different photon selection cuts, pT
Definition: AliAnaPhoton.h:208
Float_t fMinDist
Minimal distance to bad channel to accept cluster.
Definition: AliAnaPhoton.h:161
TH2F * fhTrackMatchedMCParticle[2]
! Trace origin of matched particle
Definition: AliAnaPhoton.h:376
TH2F * fhMCMaxCellDiffClusterE[fgkNssTypes]
! Fraction of energy carried by cell with maximum energy
Definition: AliAnaPhoton.h:328
TH2F * fhMC2E[fgkNmcTypes]
! E distribution, Reco vs MC coming from MC particle
Definition: AliAnaPhoton.h:290
TH2F * fhCellClusterEFracLam0BinPerSM[2][20]
! Cell E / Cluster E vs cluster pT, not maximum cluster cell, in a l0 bin per SM
Definition: AliAnaPhoton.h:425
Float_t fConstantTimeShift
Apply a 600 ns time shift in case of simulation, shift in ns.
Definition: AliAnaPhoton.h:195
TH2F * fhEmbedPhotonELambda0MostlySignal
! Lambda0 vs E for embedded photons with 90%<fraction<50%
Definition: AliAnaPhoton.h:343
virtual Double_t GetEventWeight() const
void SetPIDBits(AliVCluster *cluster, AliAODPWG4Particle *aodph, AliCalorimeterUtils *cu, AliVEvent *event)
Set Bits for PID selection.
Int_t fNPrimaryHistograms
Fill only NPrimaryHistograms of the 7 defined types.
Definition: AliAnaPhoton.h:188
void FillPileUpHistograms(AliVCluster *cluster, AliVCaloCells *cells, Int_t absIdMax)
Fill some histograms to understand effect of pile-up.
Int_t GetNumberOfLocalMaxima(AliVCluster *cluster, AliVCaloCells *cells)
Find the number of local maxima in cluster.
TH2F * fhMCNCellsvsClusterMaxCellDiffE2[fgkNssTypes]
! NCells vs fraction of energy of max cell for 2 < E < 6 GeV
Definition: AliAnaPhoton.h:325
TH2F * fhNCellsDispHighE
! number of cells in cluster vs dispersion, E>2
Definition: AliAnaPhoton.h:260
TH2F * fhEmbeddedSignalFractionEnergy
! Fraction of photon energy of embedded signal vs cluster energy
Definition: AliAnaPhoton.h:340
virtual TObjArray * GetPHOSClusters() const
Float_t GetHistoEtaMin() const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH1F * fhEPhoton
! Number of identified photon vs energy
Definition: AliAnaPhoton.h:215
TH2F * fhTrackMatchedDEtaMCConversion[2]
! Eta distance between track and cluster vs cluster E, originated in conversion, after and before pho...
Definition: AliAnaPhoton.h:373
energy
TH2F * fhLam0ETMTRD
! Cluster lambda0 vs E, SM covered by TRD, cut on Track Matching residual
Definition: AliAnaPhoton.h:251
TH2F * fhLam0DispLowE
! Cluster lambda0 vs dispersion, E<2
Definition: AliAnaPhoton.h:266
virtual Int_t GetModuleNumber(AliAODPWG4Particle *part) const
Double_t fTimeCutMax
Remove clusters/cells with time larger than this value, in ns.
Definition: AliAnaPhoton.h:170
TH2F * fhTrackMatchedDPhiMCConversion[2]
! Phi distance between track and cluster vs cluster E, originated in conversion, after and before pho...
Definition: AliAnaPhoton.h:374
TH1F * fhMCE[fgkNmcTypes]
! Number of identified photon vs cluster energy coming from MC particle
Definition: AliAnaPhoton.h:293
TH2F * fhCellClusterIndexEAndTime[2][7]
! Cell in Cluster index (low index high energy, high index low energy) vs cell Time ...
Definition: AliAnaPhoton.h:434
TH2F * fhColRowLam0BinPtBinLargeTime[2][7]
! Cell hits, not maximum cluster cell, in a l0 bin, different Pt bins, cell with large time ...
Definition: AliAnaPhoton.h:448
TH2F * fhDispLam1LowE
! Cluster disp vs lambda1, E<2
Definition: AliAnaPhoton.h:270
TH2F * fhMCEDispEta[fgkNssTypes]
! shower dispersion in eta direction
Definition: AliAnaPhoton.h:330
TLorentzVector GetDaughter(Int_t daughter, Int_t label, const AliCaloTrackReader *reader, Int_t &pdg, Int_t &status, Bool_t &ok, Int_t &daugLabel, TVector3 &prodVertex)
Float_t GetHistoEtaMax() const
TH1F * fhPtPrimMCAcc[fgkNmcPrimTypes]
! Number of generated photon vs pT, in calorimeter acceptance
Definition: AliAnaPhoton.h:305
virtual void AddAODParticle(AliAODPWG4Particle part)
Float_t GetPHOSPtMin() const
Int_t GetNOverlaps(const Int_t *label, UInt_t nlabels, Int_t mctag, Int_t mesonLabel, AliCaloTrackReader *reader, Int_t *overpdg, Int_t *overlabel)
TH2F * fhLam0E
! Cluster lambda0 vs E
Definition: AliAnaPhoton.h:230
TH2F * fhLam0PtTMTRD
! Cluster lambda0 vs pT, SM covered by TRD, cut on Track Matching residual
Definition: AliAnaPhoton.h:252
Int_t GetHistoPtBins() const
Double_t fTimeCutMin
Remove clusters/cells with time smaller than this value, in ns.
Definition: AliAnaPhoton.h:169
static const Int_t fgkNssTypes
Total number of MC histograms for shower shape studies.
Definition: AliAnaPhoton.h:157
TH2F * fhTimeLam0BinPerSMWeighted[2][20]
! Cell time, not maximum cluster cell, in a l0 bin per SM, log weight Cell E / Cluster E ...
Definition: AliAnaPhoton.h:422
Float_t GetEMCALPtMin() const
TH2F * fhMCDeltaE[fgkNmcTypes]
! MC-Reco E distribution coming from MC particle
Definition: AliAnaPhoton.h:288
TH1F * fhCleanGeneratorCluster
! Cluster energy, only one generator is the contributor
Definition: AliAnaPhoton.h:483
TH2F * fhTrackMatchedDEtaNeg[2]
! Eta distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:362
TH2F * fhLam1EMCALRegionPerSM[4][3][20]
! Cluster lambda1 vs Pt, in different EMCal regions
Definition: AliAnaPhoton.h:415
TH2F * fhSumPhiE
! shower dispersion in phi direction
Definition: AliAnaPhoton.h:276
TH2F * fhEmbedPhotonELambda0FullBkg
! Lambda0 vs E for embedded photons with less than 10% of the cluster energy
Definition: AliAnaPhoton.h:345
TH2F * fhLam0ETM
! Cluster lambda0 vs E, cut on Track Matching residual
Definition: AliAnaPhoton.h:246
TH2F * fhMCEDispersion[fgkNssTypes]
! E vs Dispersion from MC particle
Definition: AliAnaPhoton.h:315
TH2F * fhEtaLam0HighE
! Cluster eta vs lambda0, E>2
Definition: AliAnaPhoton.h:264
AliVTrack * GetMatchedTrack(AliVCluster *cluster, AliVEvent *event, Int_t index=-1) const
TH2F * fhLam1E
! Cluster lambda1 vs E
Definition: AliAnaPhoton.h:232
TH2F * fhPtPhotonNPileUpTrkVtxTimeCut2
! photon pt vs number of track pile-up vertices, time cut +- 75 ns
Definition: AliAnaPhoton.h:395
TH2F * fhDispEtaPhiDiffE
! shower dispersion eta - phi
Definition: AliAnaPhoton.h:278
Bool_t fFillSSNLocMaxHisto
Fill shower shape histograms for different NLM.
Definition: AliAnaPhoton.h:185
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TH2F * fhMCDeltaPt[fgkNmcTypes]
! MC-Reco pT distribution coming from MC particle
Definition: AliAnaPhoton.h:289
TH2F * fhDispPhiE
! shower dispersion in phi direction
Definition: AliAnaPhoton.h:274
TH2F * fhMCLambda0vsClusterMaxCellDiffE0[fgkNssTypes]
! Lambda0 vs fraction of energy of max cell for E < 2 GeV
Definition: AliAnaPhoton.h:321
Float_t GetHistoPOverEMax() const
TH2F * fhLocalRegionClusterMultiplicityHijing
! Cluster multiplicity near cluster, R<0.2, vs cluster E, hijing tagged mc clusters ...
Definition: AliAnaPhoton.h:475
TH2F * fhYPrimMCAcc[fgkNmcPrimTypes]
! Rapidity of generated photon, in calorimeter acceptance
Definition: AliAnaPhoton.h:308
TH2F * fhPhiPrimMCAcc[fgkNmcPrimTypes]
! Phi of generted photon, in calorimeter acceptance
Definition: AliAnaPhoton.h:306
TH2F * fhNCellsLam0LowE
! number of cells in cluster vs lambda0
Definition: AliAnaPhoton.h:255
TH2F * fhLocalRegionClusterEnergySumPerCentralityHijing
! Sum of energy near the cluster, R<0.2, vs centrality percentile, hijing tagged mc clusters ...
Definition: AliAnaPhoton.h:476
TH2F * fhMCPhotonELambda0NoOverlap
! E vs Lambda0 from MC photons, no overlap
Definition: AliAnaPhoton.h:317
const Double_t etamax
TH2F * fhColRowLam0BinPtBinWeighted[2][7]
! Cell hits, not maximum cluster cell, in a l0 bin, different Pt bins and log weight Cell E / Cluster...
Definition: AliAnaPhoton.h:433
virtual AliMCAnalysisUtils * GetMCAnalysisUtils()
TH2F * fhSumEtaPhiE
! shower dispersion in eta and phi direction
Definition: AliAnaPhoton.h:277
TH2F * fhLam0PerSM[20]
! Cluster lambda0 vs Pt, in different SM
Definition: AliAnaPhoton.h:455
void Init()
Init. Do some checks, abort if the cluster is not the expected PHOS or EMCal.
TH2F * fhMCPhi[fgkNmcTypes]
! Phi of identified photon coming from MC particle
Definition: AliAnaPhoton.h:295
TH1F * fhMergeGeneratorClusterNotHijing
! Cluster energy, at least 2 generators contributions, none is HIJING
Definition: AliAnaPhoton.h:481
TH2F * fhClusterTimeDiffPhotonPileUp[7]
! E vs Time difference inside cluster for selected photons
Definition: AliAnaPhoton.h:384
TLorentzVector fPrimaryMom
! Primary MC momentum, temporary container
Definition: AliAnaPhoton.h:192
virtual void Print(const Option_t *) const
Print some relevant parameters set for the analysis.
Bool_t ClusterSelected(AliVCluster *cl, Int_t nlm)
Int_t GetHistoTimeBins() const
Float_t GetHistoPOverEMin() const
TH1F * fhEPrimMCAcc[fgkNmcPrimTypes]
! Number of generated photon vs energy, in calorimeter acceptance
Definition: AliAnaPhoton.h:304
const char Option_t
Definition: External.C:48
TH2F * fhTrackMatchedDEtaMCOverlap[2]
! Eta distance between track and cluster vs cluster E, several particle overlap, after and before pho...
Definition: AliAnaPhoton.h:369
TH2F * fhTimeNPileUpVertTrack
! Time of cluster vs n pile-up vertices from Tracks
Definition: AliAnaPhoton.h:388
Float_t GetHistoTimeMax() const
virtual Int_t GetDataType() const
Float_t GetHistoTimeMin() const
Float_t GetHistoShowerShapeMax() const
Bool_t IsPileUpFromEMCal() const
Check if event is from pile-up determined by EMCal.
void FillTrackMatchingResidualHistograms(AliVCluster *calo, Int_t cut)
TH2F * fhTrackMatchedDPhi[2]
! Phi distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:355
TH2F * fhCellClusterELam0BinPerSMWeighted[2][20]
! Cell E vs cluster pT, not maximum cluster cell, in a l0 bin per SM, log weight Cell E / Cluster E ...
Definition: AliAnaPhoton.h:428
TH2F * fhDispLam1HighE
! Cluster disp vs lambda1, E>2
Definition: AliAnaPhoton.h:271
TH2F * fhPtCentralityPhoton
! centrality vs photon pT
Definition: AliAnaPhoton.h:222
TH2F * fhCellClusterIndexELam0BinPerSMLargeTime[2][20]
! Cell in Cluster index (low index high energy, high index low energy) vs cluster pT...
Definition: AliAnaPhoton.h:452
const Int_t nbins
Float_t GetHistoPhiMax() const
TH2F * fhTrackMatchedDPhiMCOverlap[2]
! Phi distance between track and cluster vs cluster E, several particle overlap, after and before pho...
Definition: AliAnaPhoton.h:370
TH2F * fhEBinClusterEtaPhi[14]
! Eta-Phi location of cluster in different energy bins.
Definition: AliAnaPhoton.h:464
virtual AliCaloTrackReader * GetReader() const
bool Bool_t
Definition: External.C:53
TH2F * fhLam1Pt
! Cluster lambda1 vs pT
Definition: AliAnaPhoton.h:233
TH1F * fhMergeGeneratorCluster
! Cluster energy, at least 2 generators contributions
Definition: AliAnaPhoton.h:480
Int_t GetHistoEtaBins() const
TH2F * fhMCLambda0vsClusterMaxCellDiffE6[fgkNssTypes]
! Lambda0 vs fraction of energy of max cell for E > 6 GeV
Definition: AliAnaPhoton.h:323
TH2F * fhTrackMatchedDPhiPos[2]
! Phi distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:359
Float_t GetHistoTrackResidualEtaMax() const
TLorentzVector fMomentum
! Cluster momentum, temporary container
Definition: AliAnaPhoton.h:190
TH2F * fhLam0DispHighE
! Cluster lambda0 vs dispersion, E>2
Definition: AliAnaPhoton.h:267
TH2F * fhEtaPhiLam0BinPtBin[2][7]
! Cluster eta/phi in a l0 bin, different Pt bins
Definition: AliAnaPhoton.h:431
virtual TObjArray * GetEMCALClusters() const
TH2F * fhMCESumEtaPhi[fgkNssTypes]
! shower dispersion in eta vs phi direction
Definition: AliAnaPhoton.h:332
TH2F * fhTrackMatchedDEtaMCNoOverlap[2]
! Eta distance between track and cluster vs cluster E, not other particle overlap, after and before photon cuts
Definition: AliAnaPhoton.h:371
TH2F * fhLam0PtTM
! Cluster lambda0 vs pT, cut on Track Matching residual
Definition: AliAnaPhoton.h:247