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