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