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