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