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