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