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