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