AliPhysics  vAN-20150427 (e6e7aad)
 All Classes Namespaces Files Functions Variables 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(kFALSE), fFillOnlySimpleSSHisto(1),
56 fNOriginHistograms(9), fNPrimaryHistograms(5),
57 fMomentum(), fPrimaryMom(),
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), fhLam1E(0),
72 fhDispETRD(0), fhLam0ETRD(0), fhLam1ETRD(0),
73 fhDispETM(0), fhLam0ETM(0), fhLam1ETM(0),
74 fhDispETMTRD(0), fhLam0ETMTRD(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 {
107  for(Int_t i = 0; i < fgkNmcTypes; i++)
108  {
109  fhMCPt [i] = 0;
110  fhMCE [i] = 0;
111  fhMCPhi [i] = 0;
112  fhMCEta [i] = 0;
113  fhMCDeltaE [i] = 0;
114  fhMCDeltaPt[i] = 0;
115  fhMC2E [i] = 0;
116  fhMC2Pt [i] = 0;
117  }
118 
119  for(Int_t i = 0; i < fgkNmcPrimTypes; i++)
120  {
121  fhPtPrimMC [i] = 0;
122  fhEPrimMC [i] = 0;
123  fhPhiPrimMC[i] = 0;
124  fhEtaPrimMC[i] = 0;
125  fhYPrimMC [i] = 0;
126 
127  fhPtPrimMCAcc [i] = 0;
128  fhEPrimMCAcc [i] = 0;
129  fhPhiPrimMCAcc[i] = 0;
130  fhEtaPrimMCAcc[i] = 0;
131  fhYPrimMCAcc [i] = 0;
132  }
133 
134  for(Int_t i = 0; i < 7; i++)
135  {
136  fhDispEtaDispPhi[i] = 0;
137  fhLambda0DispPhi[i] = 0;
138  fhLambda0DispEta[i] = 0;
139 
140  fhPtPhotonPileUp[i] = 0;
142 
143  for(Int_t j = 0; j < fgkNssTypes; j++)
144  {
145  fhMCDispEtaDispPhi[i][j] = 0;
146  fhMCLambda0DispEta[i][j] = 0;
147  fhMCLambda0DispPhi[i][j] = 0;
148  }
149  }
150 
151  for(Int_t i = 0; i < fgkNssTypes; i++)
152  {
153  fhMCELambda0 [i] = 0;
154  fhMCELambda1 [i] = 0;
155  fhMCEDispersion [i] = 0;
156  fhMCNCellsE [i] = 0;
158  fhLambda0DispEta[i] = 0;
159  fhLambda0DispPhi[i] = 0;
160 
167 
168  fhMCEDispEta [i] = 0;
169  fhMCEDispPhi [i] = 0;
170  fhMCESumEtaPhi [i] = 0;
171  fhMCEDispEtaPhiDiff[i] = 0;
172  fhMCESphericity [i] = 0;
173  }
174 
175  for(Int_t i = 0; i < 5; i++)
176  {
177  fhClusterCutsE [i] = 0;
178  fhClusterCutsPt[i] = 0;
179  }
180 
181  // Track matching residuals
182  for(Int_t i = 0; i < 2; i++)
183  {
192  fhdEdx[i] = 0; fhEOverP[i] = 0;
193  fhEOverPTRD[i] = 0;
194  }
195 
196  // Initialize parameters
197  InitParameters();
198 }
199 
200 //_____________________________________________________________________
216 //_____________________________________________________________________
217 Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, Int_t nMaxima)
218 {
219  Float_t ptcluster = fMomentum.Pt();
220  Float_t ecluster = fMomentum.E();
221  Float_t etacluster = fMomentum.Eta();
222  Float_t phicluster = fMomentum.Phi();
223 
224  if(phicluster < 0) phicluster+=TMath::TwoPi();
225 
226  Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
227 
228  AliDebug(2,Form("Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f",
230  ecluster,ptcluster, phicluster*TMath::RadToDeg(),etacluster));
231 
232  fhClusterCutsE [1]->Fill( ecluster, GetEventWeight());
233  fhClusterCutsPt[1]->Fill(ptcluster, GetEventWeight());
234 
235  if(ecluster > 0.5) fhEtaPhi->Fill(etacluster, phicluster, GetEventWeight());
236 
237  Int_t nSM = GetModuleNumber(calo);
238  if(nSM < GetCaloUtils()->GetNumberOfSuperModulesUsed() && nSM >=0)
239  {
240  fhEClusterSM ->Fill(ecluster , nSM, GetEventWeight());
241  fhPtClusterSM->Fill(ptcluster, nSM, GetEventWeight());
242  }
243 
244  //.......................................
245  //If too small or big energy, skip it
246  if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ;
247 
248  AliDebug(2,Form("\t Cluster %d Pass E Cut",calo->GetID()));
249 
250  fhClusterCutsE [2]->Fill( ecluster, GetEventWeight());
251  fhClusterCutsPt[2]->Fill(ptcluster, GetEventWeight());
252 
253  //.......................................
254  // TOF cut, BE CAREFUL WITH THIS CUT
255  Double_t tof = calo->GetTOF()*1e9;
256  if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
257 
258  AliDebug(2,Form("\t Cluster %d Pass Time Cut",calo->GetID()));
259 
260  fhClusterCutsE [3]->Fill( ecluster, GetEventWeight());
261  fhClusterCutsPt[3]->Fill(ptcluster, GetEventWeight());
262 
263  //.......................................
264  if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
265 
266  AliDebug(2,Form("\t Cluster %d Pass NCell Cut",calo->GetID()));
267 
268  fhClusterCutsE [4]->Fill( ecluster, GetEventWeight());
269  fhClusterCutsPt[4]->Fill(ptcluster, GetEventWeight());
270 
271  if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
272  AliDebug(2,Form("\t Cluster %d pass NLM %d of out of range",calo->GetID(), nMaxima));
273 
274  fhClusterCutsE [5]->Fill( ecluster, GetEventWeight());
275  fhClusterCutsPt[5]->Fill(ptcluster, GetEventWeight());
276 
277  //.......................................
278  //Check acceptance selection
279  if(IsFiducialCutOn())
280  {
281  Bool_t in = GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),GetCalorimeter()) ;
282  if(! in ) return kFALSE ;
283  }
284 
285  AliDebug(2,Form("\t Fiducial cut passed"));
286 
287  fhClusterCutsE [6]->Fill( ecluster, GetEventWeight());
288  fhClusterCutsPt[6]->Fill(ptcluster, GetEventWeight());
289 
290  //.......................................
291  //Skip matched clusters with tracks
292 
293  // Fill matching residual histograms before PID cuts
295 
297  {
298  if(matched)
299  {
300  AliDebug(2,"\t Reject track-matched clusters");
301  return kFALSE ;
302  }
303  else
304  AliDebug(2,"\t Track-matching cut passed");
305  }// reject matched clusters
306 
307  fhClusterCutsE [7]->Fill( ecluster, GetEventWeight());
308  fhClusterCutsPt[7]->Fill(ptcluster, GetEventWeight());
309 
310  //.......................................
311  //Check Distance to Bad channel, set bit.
312  Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
313  if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
314  if(distBad < fMinDist)
315  {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
316  return kFALSE ;
317  }
318  else AliDebug(2,Form("\t Bad channel cut passed %4.2f > %2.2f",distBad, fMinDist));
319 
320  fhClusterCutsE [8]->Fill( ecluster, GetEventWeight());
321  fhClusterCutsPt[8]->Fill(ptcluster, GetEventWeight());
322 
323  AliDebug(1,Form("Current Event %d; After selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f",
325  ecluster, ptcluster,fMomentum.Phi()*TMath::RadToDeg(),fMomentum.Eta()));
326 
327  //All checks passed, cluster selected
328  return kTRUE;
329 
330 }
331 
332 //___________________________________________
337 //___________________________________________
339 {
340  Double_t photonY = -100 ;
341  Double_t photonE = -1 ;
342  Double_t photonPt = -1 ;
343  Double_t photonPhi = 100 ;
344  Double_t photonEta = -1 ;
345 
346  Int_t pdg = 0 ;
347  Int_t tag = 0 ;
348  Int_t status = 0 ;
349  Int_t mcIndex = 0 ;
350  Int_t nprim = 0 ;
351  Bool_t inacceptance = kFALSE ;
352 
353  TParticle * primStack = 0;
354  AliAODMCParticle * primAOD = 0;
355 
356  // Get the ESD MC particles container
357  AliStack * stack = 0;
358  if( GetReader()->ReadStack() )
359  {
360  stack = GetMCStack();
361  if( !stack )
362  {
363  AliFatal("Stack not available, is the MC handler called? STOP");
364  return;
365  }
366  nprim = stack->GetNtrack();
367  }
368 
369  // Get the AOD MC particles container
370  TClonesArray * mcparticles = 0;
371  if( GetReader()->ReadAODMCParticles() )
372  {
373  mcparticles = GetReader()->GetAODMCParticles();
374  if( !mcparticles )
375  {
376  AliFatal("Standard MCParticles not available!");
377  return;
378  }
379  nprim = mcparticles->GetEntriesFast();
380  }
381 
382  for(Int_t i=0 ; i < nprim; i++)
383  {
384  if(GetReader()->AcceptOnlyHIJINGLabels() && !GetReader()->IsHIJINGLabel(i)) continue ;
385 
386  if(GetReader()->ReadStack())
387  {
388  primStack = stack->Particle(i) ;
389  if(!primStack)
390  {
391  AliWarning("ESD primaries pointer not available!!");
392  continue;
393  }
394 
395  pdg = primStack->GetPdgCode();
396  status = primStack->GetStatusCode();
397 
398  if(primStack->Energy() == TMath::Abs(primStack->Pz())) continue ; //Protection against floating point exception
399 
400  //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
401  // prim->GetName(), prim->GetPdgCode());
402 
403  // Photon kinematics
404  primStack->Momentum(fMomentum);
405 
406  photonY = 0.5*TMath::Log((primStack->Energy()+primStack->Pz())/(primStack->Energy()-primStack->Pz())) ;
407  }
408  else
409  {
410  primAOD = (AliAODMCParticle *) mcparticles->At(i);
411  if(!primAOD)
412  {
413  AliWarning("AOD primaries pointer not available!!");
414  continue;
415  }
416 
417  pdg = primAOD->GetPdgCode();
418  status = primAOD->GetStatus();
419 
420  if(primAOD->E() == TMath::Abs(primAOD->Pz())) continue ; //Protection against floating point exception
421 
422  // Photon kinematics
423  fMomentum.SetPxPyPzE(primAOD->Px(),primAOD->Py(),primAOD->Pz(),primAOD->E());
424 
425  photonY = 0.5*TMath::Log((primAOD->E()+primAOD->Pz())/(primAOD->E()-primAOD->Pz())) ;
426  }
427 
428  // Select only photons in the final state
429  if(pdg != 22 ) continue ;
430 
431  // If too small or too large pt, skip, same cut as for data analysis
432  photonPt = fMomentum.Pt () ;
433 
434  if(photonPt < GetMinPt() || photonPt > GetMaxPt() ) continue ;
435 
436  photonE = fMomentum.E () ;
437  photonEta = fMomentum.Eta() ;
438  photonPhi = fMomentum.Phi() ;
439 
440  if(photonPhi < 0) photonPhi+=TMath::TwoPi();
441 
442  // Check if photons hit desired acceptance
443  inacceptance = kTRUE;
444 
445  // Check same fidutial borders as in data analysis on top of real acceptance if real was requested.
446  if( IsFiducialCutOn() && !GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),GetCalorimeter())) inacceptance = kFALSE ;
447 
448  // Check if photons hit the Calorimeter acceptance
449  if(IsRealCaloAcceptanceOn()) // defined on base class
450  {
451  if(GetReader()->ReadStack() &&
452  !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance(GetCalorimeter(), primStack)) inacceptance = kFALSE ;
453  if(GetReader()->ReadAODMCParticles() &&
454  !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance(GetCalorimeter(), primAOD )) inacceptance = kFALSE ;
455  }
456 
457  // Get tag of this particle photon from fragmentation, decay, prompt ...
458  // Set the origin of the photon.
460 
461  if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
462  {
463  // A conversion photon from a hadron, skip this kind of photon
464  // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
465  // GetMCAnalysisUtils()->PrintMCTag(tag);
466 
467  continue;
468  }
469 
470  // Consider only final state particles, but this depends on generator,
471  // status 1 is the usual one, in case of not being ok, leave the possibility
472  // to not consider this.
473  if(status > 1) continue ; // Avoid "partonic" photons
474 
475  Bool_t takeIt = kFALSE ;
476  if(status == 1 && GetMCAnalysisUtils()->GetMCGenerator() != AliMCAnalysisUtils::kBoxLike ) takeIt = kTRUE ;
477 
478  if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) continue;
479 
480  // Origin of photon
481  if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt))
482  {
483  mcIndex = kmcPPrompt;
484  }
485  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation))
486  {
487  mcIndex = kmcPFragmentation ;
488  }
489  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR))
490  {
491  mcIndex = kmcPISR;
492  }
493  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay))
494  {
495  mcIndex = kmcPPi0Decay;
496  }
497  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay))
498  {
499  mcIndex = kmcPEtaDecay;
500  }
501  else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay))
502  {
503  mcIndex = kmcPOtherDecay;
504  }
505  else
506  {
507  // Other decay but from non final state particle
508  mcIndex = kmcPOtherDecay;
509  } // Other origin
510 
511  if(!takeIt && (mcIndex == kmcPPi0Decay || mcIndex == kmcPOtherDecay)) takeIt = kTRUE ;
512 
513  if(!takeIt) continue ;
514 
515  // Fill histograms for all photons
516  fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY, GetEventWeight()) ;
517  if(TMath::Abs(photonY) < 1.0)
518  {
519  fhEPrimMC [kmcPPhoton]->Fill(photonE , GetEventWeight()) ;
520  fhPtPrimMC [kmcPPhoton]->Fill(photonPt, GetEventWeight()) ;
521  fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi, GetEventWeight()) ;
522  fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta, GetEventWeight()) ;
523  }
524 
525  if(inacceptance)
526  {
527  fhEPrimMCAcc [kmcPPhoton]->Fill(photonE , GetEventWeight()) ;
528  fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt, GetEventWeight()) ;
529  fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi, GetEventWeight()) ;
530  fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta, GetEventWeight()) ;
531  fhYPrimMCAcc [kmcPPhoton]->Fill(photonE , photonY , GetEventWeight()) ;
532  } // Accepted
533 
534  // Fill histograms for photons origin
535  if(mcIndex < fNPrimaryHistograms)
536  {
537  fhYPrimMC[mcIndex]->Fill(photonPt, photonY, GetEventWeight()) ;
538  if(TMath::Abs(photonY) < 1.0)
539  {
540  fhEPrimMC [mcIndex]->Fill(photonE , GetEventWeight()) ;
541  fhPtPrimMC [mcIndex]->Fill(photonPt, GetEventWeight()) ;
542  fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi, GetEventWeight()) ;
543  fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta, GetEventWeight()) ;
544  }
545 
546  if(inacceptance)
547  {
548  fhEPrimMCAcc [mcIndex]->Fill(photonE , GetEventWeight()) ;
549  fhPtPrimMCAcc [mcIndex]->Fill(photonPt, GetEventWeight()) ;
550  fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi, GetEventWeight()) ;
551  fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta, GetEventWeight()) ;
552  fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY , GetEventWeight()) ;
553  } // Accepted
554  }
555  } // loop on primaries
556 }
557 
558 //________________________________________________________________________________
560 //________________________________________________________________________________
561 void AliAnaPhoton::FillPileUpHistograms(AliVCluster* cluster, AliVCaloCells *cells,
562  Int_t absIdMax)
563 {
564  Float_t pt = fMomentum.Pt();
565  Float_t time = cluster->GetTOF()*1.e9;
566 
567  AliVEvent * event = GetReader()->GetInputEvent();
568 
569  if(GetReader()->IsPileUpFromSPD()) fhPtPhotonPileUp[0]->Fill(pt, GetEventWeight()) ;
570  if(GetReader()->IsPileUpFromEMCal()) fhPtPhotonPileUp[1]->Fill(pt, GetEventWeight()) ;
571  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPhotonPileUp[2]->Fill(pt, GetEventWeight()) ;
572  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPhotonPileUp[3]->Fill(pt, GetEventWeight()) ;
573  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPhotonPileUp[4]->Fill(pt, GetEventWeight()) ;
574  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPhotonPileUp[5]->Fill(pt, GetEventWeight()) ;
575  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt, GetEventWeight()) ;
576 
577  fhTimePtPhotonNoCut->Fill(pt, time, GetEventWeight());
578  if(GetReader()->IsPileUpFromSPD()) fhTimePtPhotonSPD->Fill(pt, time, GetEventWeight());
579 
580  //
581  // Cells inside the cluster
582  //
583 
584  // Loop on cells inside cluster, max cell must be over 100 MeV and time in BC=0
585  if(cells->GetCellAmplitude(absIdMax) > 0.1 && TMath::Abs(time) < 30)
586  {
587  for (Int_t ipos = 0; ipos < cluster->GetNCells(); ipos++)
588  {
589  Int_t absId = cluster->GetCellsAbsId()[ipos];
590 
591  if( absId == absIdMax ) continue ;
592 
593  Double_t tcell = cells->GetCellTime(absId);
594  Float_t amp = cells->GetCellAmplitude(absId);
595  Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
596 
597  GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,tcell,cells);
598  tcell*=1e9;
599 
600  Float_t diff = (time-tcell);
601 
602  if( cells->GetCellAmplitude(absIdMax) < 0.1 ) continue ;
603 
611 
612  } // loop
613  }
614 
615  AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
616  AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
617 
618  //
619  // N pile up vertices
620  //
621 
622  Int_t nVtxSPD = -1;
623  Int_t nVtxTrk = -1;
624 
625  if (esdEv)
626  {
627  nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
628  nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
629 
630  } // ESD
631  else if (aodEv)
632  {
633  nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
634  nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
635  } // AOD
636 
637  if(pt < 8)
638  {
639  fhTimeNPileUpVertSPD ->Fill(time, nVtxSPD, GetEventWeight());
640  fhTimeNPileUpVertTrack->Fill(time, nVtxTrk, GetEventWeight());
641  }
642 
643  fhPtPhotonNPileUpSPDVtx->Fill(pt, nVtxSPD, GetEventWeight());
644  fhPtPhotonNPileUpTrkVtx->Fill(pt, nVtxTrk, GetEventWeight());
645 
646  if(TMath::Abs(time) < 25)
647  {
648  fhPtPhotonNPileUpSPDVtxTimeCut->Fill(pt, nVtxSPD, GetEventWeight());
649  fhPtPhotonNPileUpTrkVtxTimeCut->Fill(pt, nVtxTrk, GetEventWeight());
650  }
651 
652  if(time < 75 && time > -25)
653  {
654  fhPtPhotonNPileUpSPDVtxTimeCut2->Fill(pt, nVtxSPD, GetEventWeight());
655  fhPtPhotonNPileUpTrkVtxTimeCut2->Fill(pt, nVtxTrk, GetEventWeight());
656  }
657 }
658 
659 //_________________________________________________________________________________
661 //_________________________________________________________________________________
662 void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster,
663  Int_t mcTag, Float_t maxCellFraction)
664 {
665  if(!fFillSSHistograms || GetMixedEvent()) return;
666 
667  Float_t energy = cluster->E();
668  Int_t ncells = cluster->GetNCells();
669  Float_t lambda0 = cluster->GetM02();
670  Float_t lambda1 = cluster->GetM20();
671  Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
672 
673  Float_t eta = fMomentum.Eta();
674  Float_t phi = fMomentum.Phi();
675  if(phi < 0) phi+=TMath::TwoPi();
676 
677  fhLam0E ->Fill(energy, lambda0, GetEventWeight());
678  fhLam1E ->Fill(energy, lambda1, GetEventWeight());
679  fhDispE ->Fill(energy, disp , GetEventWeight());
680 
681  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
683  {
684  fhLam0ETRD->Fill(energy, lambda0, GetEventWeight());
685  fhLam1ETRD->Fill(energy, lambda1, GetEventWeight());
686  fhDispETRD->Fill(energy, disp, GetEventWeight());
687  }
688 
689  Float_t l0 = 0., l1 = 0.;
690  Float_t dispp= 0., dEta = 0., dPhi = 0.;
691  Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
693  {
694  GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
695  l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
696  //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",
697  // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
698  //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
699  // disp, dPhi+dEta );
700  fhDispEtaE -> Fill(energy, dEta , GetEventWeight());
701  fhDispPhiE -> Fill(energy, dPhi , GetEventWeight());
702  fhSumEtaE -> Fill(energy, sEta , GetEventWeight());
703  fhSumPhiE -> Fill(energy, sPhi , GetEventWeight());
704  fhSumEtaPhiE -> Fill(energy, sEtaPhi , GetEventWeight());
705  fhDispEtaPhiDiffE -> Fill(energy, dPhi-dEta, GetEventWeight());
706 
707  if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi) , GetEventWeight());
708  if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.), GetEventWeight());
709  if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.), GetEventWeight());
710 
711  Int_t ebin = -1;
712  if (energy < 2 ) ebin = 0;
713  else if (energy < 4 ) ebin = 1;
714  else if (energy < 6 ) ebin = 2;
715  else if (energy < 10) ebin = 3;
716  else if (energy < 15) ebin = 4;
717  else if (energy < 20) ebin = 5;
718  else ebin = 6;
719 
720  fhDispEtaDispPhi[ebin]->Fill(dEta , dPhi, GetEventWeight());
721  fhLambda0DispEta[ebin]->Fill(lambda0, dEta, GetEventWeight());
722  fhLambda0DispPhi[ebin]->Fill(lambda0, dPhi, GetEventWeight());
723  }
724 
725  // If track-matching was off, check effect of track-matching residual cut
726 
727  if(!fRejectTrackMatch)
728  {
729  Float_t dZ = cluster->GetTrackDz();
730  Float_t dR = cluster->GetTrackDx();
731  if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
732  {
733  dR = 2000., dZ = 2000.;
734  GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
735  }
736 
737  if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
738  {
739  fhLam0ETM ->Fill(energy, lambda0, GetEventWeight());
740  fhLam1ETM ->Fill(energy, lambda1, GetEventWeight());
741  fhDispETM ->Fill(energy, disp , GetEventWeight());
742 
743  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
745  {
746  fhLam0ETMTRD->Fill(energy, lambda0, GetEventWeight());
747  fhLam1ETMTRD->Fill(energy, lambda1, GetEventWeight());
748  fhDispETMTRD->Fill(energy, disp , GetEventWeight());
749  }
750  }
751  } // If track-matching was off, check effect of matching residual cut
752 
754  {
755  if(energy < 2)
756  {
757  fhNCellsLam0LowE ->Fill(ncells, lambda0, GetEventWeight());
758  fhNCellsLam1LowE ->Fill(ncells, lambda1, GetEventWeight());
759  fhNCellsDispLowE ->Fill(ncells, disp , GetEventWeight());
760 
761  fhLam1Lam0LowE ->Fill(lambda1, lambda0, GetEventWeight());
762  fhLam0DispLowE ->Fill(lambda0, disp , GetEventWeight());
763  fhDispLam1LowE ->Fill(disp , lambda1, GetEventWeight());
764  fhEtaLam0LowE ->Fill(eta , lambda0, GetEventWeight());
765  fhPhiLam0LowE ->Fill(phi , lambda0, GetEventWeight());
766  }
767  else
768  {
769  fhNCellsLam0HighE ->Fill(ncells, lambda0, GetEventWeight());
770  fhNCellsLam1HighE ->Fill(ncells, lambda1, GetEventWeight());
771  fhNCellsDispHighE ->Fill(ncells, disp , GetEventWeight());
772 
773  fhLam1Lam0HighE ->Fill(lambda1, lambda0, GetEventWeight());
774  fhLam0DispHighE ->Fill(lambda0, disp , GetEventWeight());
775  fhDispLam1HighE ->Fill(disp , lambda1, GetEventWeight());
776  fhEtaLam0HighE ->Fill(eta , lambda0, GetEventWeight());
777  fhPhiLam0HighE ->Fill(phi , lambda0, GetEventWeight());
778  }
779  }
780 
781  if(IsDataMC())
782  {
783  AliVCaloCells* cells = 0;
784  if(GetCalorimeter() == kEMCAL) cells = GetEMCALCells();
785  else cells = GetPHOSCells();
786 
787  // Fill histograms to check shape of embedded clusters
788  Float_t fraction = 0;
789  // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
790 
791  if(GetReader()->IsEmbeddedClusterSelectionOn())
792  {
793  // Only working for EMCAL
794  // printf("embedded\n");
795 
796  Float_t clusterE = 0; // recalculate in case corrections applied.
797  Float_t cellE = 0;
798  for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
799  {
800  cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
801  clusterE+=cellE;
802  fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
803  }
804 
805  //Fraction of total energy due to the embedded signal
806  fraction/=clusterE;
807 
808  AliDebug(1,Form("Energy fraction of embedded signal %2.3f, Energy %2.3f",fraction, clusterE));
809 
810  fhEmbeddedSignalFractionEnergy->Fill(clusterE, fraction, GetEventWeight());
811  } // embedded fraction
812 
813  // Check the origin and fill histograms
814 
815  Int_t mcIndex = -1;
816 
817  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
818  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
819  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
820  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
821  {
822  mcIndex = kmcssPhoton ;
823 
824  if(!GetReader()->IsEmbeddedClusterSelectionOn())
825  {
826  //Check particle overlaps in cluster
827 
828  // Compare the primary depositing more energy with the rest,
829  // if no photon/electron as comon ancestor (conversions), count as other particle
830  const UInt_t nlabels = cluster->GetNLabels();
831  Int_t overpdg[nlabels];
832  Int_t noverlaps = GetMCAnalysisUtils()->GetNOverlaps(cluster->GetLabels(), nlabels,mcTag,-1,GetReader(),overpdg);
833 
834  //printf("N overlaps %d \n",noverlaps);
835 
836  if(noverlaps == 0)
837  {
838  fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0, GetEventWeight());
839  }
840  else if(noverlaps == 1)
841  {
842  fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0, GetEventWeight());
843  }
844  else if(noverlaps > 1)
845  {
846  fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0, GetEventWeight());
847  }
848  else
849  {
850  AliWarning(Form("n overlaps = %d!!", noverlaps));
851  }
852  } // No embedding
853 
854  // Fill histograms to check shape of embedded clusters
855  if(GetReader()->IsEmbeddedClusterSelectionOn())
856  {
857  if (fraction > 0.9)
858  {
859  fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0, GetEventWeight());
860  }
861  else if(fraction > 0.5)
862  {
863  fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0, GetEventWeight());
864  }
865  else if(fraction > 0.1)
866  {
867  fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0, GetEventWeight());
868  }
869  else
870  {
871  fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0, GetEventWeight());
872  }
873  } // embedded
874  } // photon no conversion
875  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
877  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
878  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
879  {
880  mcIndex = kmcssConversion ;
881  }//conversion photon
882 
883  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
884  {
885  mcIndex = kmcssElectron ;
886  }//electron
887  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
888  {
889  mcIndex = kmcssPi0 ;
890 
891  //Fill histograms to check shape of embedded clusters
892  if(GetReader()->IsEmbeddedClusterSelectionOn())
893  {
894  if (fraction > 0.9)
895  {
896  fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0, GetEventWeight());
897  }
898  else if(fraction > 0.5)
899  {
900  fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0, GetEventWeight());
901  }
902  else if(fraction > 0.1)
903  {
904  fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0, GetEventWeight());
905  }
906  else
907  {
908  fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0, GetEventWeight());
909  }
910  } // embedded
911 
912  }//pi0
913  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
914  {
915  mcIndex = kmcssEta ;
916  }//eta
917  else
918  {
919  mcIndex = kmcssOther ;
920  }//other particles
921 
922  fhMCELambda0 [mcIndex]->Fill(energy, lambda0, GetEventWeight());
923  fhMCELambda1 [mcIndex]->Fill(energy, lambda1, GetEventWeight());
924  fhMCEDispersion [mcIndex]->Fill(energy, disp , GetEventWeight());
925  fhMCNCellsE [mcIndex]->Fill(energy, ncells , GetEventWeight());
926  fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction, GetEventWeight());
927 
929  {
930  if (energy < 2.)
931  {
932  fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction, GetEventWeight());
933  fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction, GetEventWeight());
934  }
935  else if(energy < 6.)
936  {
937  fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction, GetEventWeight());
938  fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction, GetEventWeight());
939  }
940  else
941  {
942  fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction, GetEventWeight());
943  fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction, GetEventWeight());
944  }
945 
946  if(GetCalorimeter() == kEMCAL)
947  {
948  fhMCEDispEta [mcIndex]-> Fill(energy, dEta , GetEventWeight());
949  fhMCEDispPhi [mcIndex]-> Fill(energy, dPhi , GetEventWeight());
950  fhMCESumEtaPhi [mcIndex]-> Fill(energy, sEtaPhi , GetEventWeight());
951  fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy, dPhi-dEta, GetEventWeight());
952 
953  if( dEta+dPhi > 0 ) fhMCESphericity[mcIndex]-> Fill(energy, (dPhi-dEta)/(dEta+dPhi), GetEventWeight());
954 
955  Int_t ebin = -1;
956  if (energy < 2 ) ebin = 0;
957  else if (energy < 4 ) ebin = 1;
958  else if (energy < 6 ) ebin = 2;
959  else if (energy < 10) ebin = 3;
960  else if (energy < 15) ebin = 4;
961  else if (energy < 20) ebin = 5;
962  else ebin = 6;
963 
964  fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta , dPhi, GetEventWeight());
965  fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0, dEta, GetEventWeight());
966  fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0, dPhi, GetEventWeight());
967  }
968  }
969  }// MC data
970 }
971 
972 //__________________________________________________________________________
978 //__________________________________________________________________________
980  Int_t cut)
981 {
982  Float_t dZ = cluster->GetTrackDz();
983  Float_t dR = cluster->GetTrackDx();
984 
985  if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
986  {
987  dR = 2000., dZ = 2000.;
988  GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
989  }
990 
991  AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
992 
993  Bool_t positive = kFALSE;
994  if(track) positive = (track->Charge()>0);
995 
996  if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
997  {
998  fhTrackMatchedDEta[cut]->Fill(cluster->E(), dZ, GetEventWeight());
999  fhTrackMatchedDPhi[cut]->Fill(cluster->E(), dR, GetEventWeight());
1000  if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ, dR, GetEventWeight());
1001 
1002  if(track)
1003  {
1004  if(positive)
1005  {
1006  fhTrackMatchedDEtaPos[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1007  fhTrackMatchedDPhiPos[cut]->Fill(cluster->E(), dR, GetEventWeight());
1008  if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiPos[cut]->Fill(dZ,dR, GetEventWeight());
1009  }
1010  else
1011  {
1012  fhTrackMatchedDEtaNeg[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1013  fhTrackMatchedDPhiNeg[cut]->Fill(cluster->E(), dR, GetEventWeight());
1014  if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiNeg[cut]->Fill(dZ, dR, GetEventWeight());
1015  }
1016  }
1017 
1018  Int_t nSMod = GetModuleNumber(cluster);
1019 
1020  if( GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
1021  nSMod >= GetFirstSMCoveredByTRD() )
1022  {
1023  fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1024  fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(), dR, GetEventWeight());
1025  }
1026 
1027  // Check dEdx and E/p of matched clusters
1028 
1029  if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1030  {
1031  if(track)
1032  {
1033  Float_t dEdx = track->GetTPCsignal();
1034  Float_t eOverp = cluster->E()/track->P();
1035 
1036  fhdEdx[cut] ->Fill(cluster->E(), dEdx , GetEventWeight());
1037  fhEOverP[cut]->Fill(cluster->E(), eOverp, GetEventWeight());
1038 
1039  if(GetCalorimeter()==kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
1040  nSMod >= GetFirstSMCoveredByTRD() )
1041  fhEOverPTRD[cut]->Fill(cluster->E(), eOverp, GetEventWeight());
1042 
1043 
1044  }
1045  else
1046  AliWarning(Form("Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT?", dR,dZ));
1047 
1048  if(IsDataMC())
1049  {
1050 
1051  Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader(),GetCalorimeter());
1052 
1054  {
1057  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5, GetEventWeight());
1059  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5, GetEventWeight());
1061  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5, GetEventWeight());
1062  else
1063  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5, GetEventWeight());
1064 
1065  // Check if several particles contributed to cluster and discard overlapped mesons
1068  {
1069  if(cluster->GetNLabels()==1)
1070  {
1071  fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1072  fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(), dR, GetEventWeight());
1073  }
1074  else
1075  {
1076  fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1077  fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(), dR, GetEventWeight());
1078  }
1079 
1080  }// Check overlaps
1081 
1082  }
1083  else
1084  {
1087  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5, GetEventWeight());
1089  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5, GetEventWeight());
1091  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5, GetEventWeight());
1092  else
1093  fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5, GetEventWeight());
1094 
1095  // Check if several particles contributed to cluster
1098  {
1099  fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(), dZ, GetEventWeight());
1100  fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(), dR, GetEventWeight());
1101 
1102  }// Check overlaps
1103 
1104  }
1105 
1106  } // MC
1107 
1108  } // residuals window
1109 
1110  } // Small residual
1111 }
1112 
1113 //___________________________________________
1115 //___________________________________________
1117 {
1118  TString parList ; //this will be list of parameters used for this analysis.
1119  const Int_t buffersize = 255;
1120  char onePar[buffersize] ;
1121 
1122  snprintf(onePar,buffersize,"--- AliAnaPhoton ---:") ;
1123  parList+=onePar ;
1124  snprintf(onePar,buffersize,"Calorimeter: %s;",GetCalorimeterString().Data()) ;
1125  parList+=onePar ;
1126  snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster);",fMinDist) ;
1127  parList+=onePar ;
1128  snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation);",fMinDist2) ;
1129  parList+=onePar ;
1130  snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study);",fMinDist3) ;
1131  parList+=onePar ;
1132  snprintf(onePar,buffersize,"fRejectTrackMatch: %d",fRejectTrackMatch) ;
1133  parList+=onePar ;
1134 
1135  // Get parameters set in base class.
1136  parList += GetBaseParametersList() ;
1137 
1138  // Get parameters set in PID class.
1139  parList += GetCaloPID()->GetPIDParametersList() ;
1140 
1141  // Get parameters set in FiducialCut class (not available yet)
1142  //parlist += GetFidCut()->GetFidCutParametersList()
1143 
1144  return new TObjString(parList) ;
1145 }
1146 
1147 //_____________________________________________
1150 //_____________________________________________
1152 {
1153  TList * outputContainer = new TList() ;
1154  outputContainer->SetName("PhotonHistos") ;
1155 
1156  Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1157  Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1158  Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1161  Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1162 
1163  Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1164  Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
1165  Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
1166  Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1167  Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
1168  Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1169 
1170  Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1171  Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
1172  Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1173  Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1174  Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
1175  Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1176 
1177  Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1178 
1179  TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
1180  for (Int_t i = 0; i < 10 ; i++)
1181  {
1182  fhClusterCutsE[i] = new TH1F(Form("hE_Cut_%d_%s", i, cut[i].Data()),
1183  Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1184  nptbins,ptmin,ptmax);
1185  fhClusterCutsE[i]->SetYTitle("d#it{N}/d#it{E} ");
1186  fhClusterCutsE[i]->SetXTitle("#it{E} (GeV)");
1187  outputContainer->Add(fhClusterCutsE[i]) ;
1188 
1189  fhClusterCutsPt[i] = new TH1F(Form("hPt_Cut_%d_%s", i, cut[i].Data()),
1190  Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1191  nptbins,ptmin,ptmax);
1192  fhClusterCutsPt[i]->SetYTitle("d#it{N}/d#it{E} ");
1193  fhClusterCutsPt[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1194  outputContainer->Add(fhClusterCutsPt[i]) ;
1195  }
1196 
1197  fhEClusterSM = new TH2F("hEClusterSM","Raw clusters E and super-module number",
1198  nptbins,ptmin,ptmax,
1199  GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1200  fhEClusterSM->SetYTitle("SuperModule ");
1201  fhEClusterSM->SetXTitle("#it{E} (GeV)");
1202  outputContainer->Add(fhEClusterSM) ;
1203 
1204  fhPtClusterSM = new TH2F("hPtClusterSM","Raw clusters #it{p}_{T} and super-module number",
1205  nptbins,ptmin,ptmax,
1206  GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1207  fhPtClusterSM->SetYTitle("SuperModule ");
1208  fhPtClusterSM->SetXTitle("#it{E} (GeV)");
1209  outputContainer->Add(fhPtClusterSM) ;
1210 
1211  fhEPhotonSM = new TH2F("hEPhotonSM","Selected clusters E and super-module number",
1212  nptbins,ptmin,ptmax,
1213  GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1214  fhEPhotonSM->SetYTitle("SuperModule ");
1215  fhEPhotonSM->SetXTitle("#it{E} (GeV)");
1216  outputContainer->Add(fhEPhotonSM) ;
1217 
1218  fhPtPhotonSM = new TH2F("hPtPhotonSM","Selected clusters #it{p}_{T} and super-module number",
1219  nptbins,ptmin,ptmax,
1220  GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1221  fhPtPhotonSM->SetYTitle("SuperModule ");
1222  fhPtPhotonSM->SetXTitle("#it{E} (GeV)");
1223  outputContainer->Add(fhPtPhotonSM) ;
1224 
1225  fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
1226  fhNCellsE->SetXTitle("#it{E} (GeV)");
1227  fhNCellsE->SetYTitle("# of cells in cluster");
1228  outputContainer->Add(fhNCellsE);
1229 
1230  fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
1231  fhCellsE->SetXTitle("#it{E}_{cluster} (GeV)");
1232  fhCellsE->SetYTitle("#it{E}_{cell} (GeV)");
1233  outputContainer->Add(fhCellsE);
1234 
1235  fhTimePt = new TH2F ("hTimePt","time of cluster vs pT of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1236  fhTimePt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1237  fhTimePt->SetYTitle("#it{time} (ns)");
1238  outputContainer->Add(fhTimePt);
1239 
1240  fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1241  nptbins,ptmin,ptmax, 500,0,1.);
1242  fhMaxCellDiffClusterE->SetXTitle("#it{E}_{cluster} (GeV) ");
1243  fhMaxCellDiffClusterE->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
1244  outputContainer->Add(fhMaxCellDiffClusterE);
1245 
1246  fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
1247  fhEPhoton->SetYTitle("#it{counts}");
1248  fhEPhoton->SetXTitle("#it{E}_{#gamma}(GeV)");
1249  outputContainer->Add(fhEPhoton) ;
1250 
1251  fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs #it{p}_{T}",nptbins,ptmin,ptmax);
1252  fhPtPhoton->SetYTitle("#it{counts}");
1253  fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/#it{c})");
1254  outputContainer->Add(fhPtPhoton) ;
1255 
1257  {
1258  fhPtCentralityPhoton = new TH2F("hPtCentralityPhoton","centrality vs #it{p}_{T}",nptbins,ptmin,ptmax, 100,0,100);
1259  fhPtCentralityPhoton->SetYTitle("Centrality");
1260  fhPtCentralityPhoton->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1261  outputContainer->Add(fhPtCentralityPhoton) ;
1262 
1263  fhPtEventPlanePhoton = new TH2F("hPtEventPlanePhoton","centrality vs #it{p}_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1264  fhPtEventPlanePhoton->SetYTitle("Event plane angle (rad)");
1265  fhPtEventPlanePhoton->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1266  outputContainer->Add(fhPtEventPlanePhoton) ;
1267  }
1268 
1269  fhEtaPhi = new TH2F
1270  ("hEtaPhi","cluster,#it{E} > 0.5 GeV, #eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1271  fhEtaPhi->SetYTitle("#phi (rad)");
1272  fhEtaPhi->SetXTitle("#eta");
1273  outputContainer->Add(fhEtaPhi) ;
1274 
1275  fhPhiPhoton = new TH2F
1276  ("hPhiPhoton","#phi_{#gamma} vs #it{p}_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1277  fhPhiPhoton->SetYTitle("#phi (rad)");
1278  fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/#it{c})");
1279  outputContainer->Add(fhPhiPhoton) ;
1280 
1281  fhEtaPhoton = new TH2F
1282  ("hEtaPhoton","#eta_{#gamma} vs #it{p}_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
1283  fhEtaPhoton->SetYTitle("#eta");
1284  fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/#it{c})");
1285  outputContainer->Add(fhEtaPhoton) ;
1286 
1287  fhEtaPhiPhoton = new TH2F
1288  ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1289  fhEtaPhiPhoton->SetYTitle("#phi (rad)");
1290  fhEtaPhiPhoton->SetXTitle("#eta");
1291  outputContainer->Add(fhEtaPhiPhoton) ;
1292  if(GetMinPt() < 0.5)
1293  {
1294  fhEtaPhi05Photon = new TH2F
1295  ("hEtaPhi05Photon","#eta vs #phi, E < 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
1296  fhEtaPhi05Photon->SetYTitle("#phi (rad)");
1297  fhEtaPhi05Photon->SetXTitle("#eta");
1298  outputContainer->Add(fhEtaPhi05Photon) ;
1299  }
1300 
1301  fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
1302  nptbins,ptmin,ptmax,10,0,10);
1303  fhNLocMax ->SetYTitle("N maxima");
1304  fhNLocMax ->SetXTitle("#it{E} (GeV)");
1305  outputContainer->Add(fhNLocMax) ;
1306 
1307  //Shower shape
1308  if(fFillSSHistograms)
1309  {
1310  fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1311  fhLam0E->SetYTitle("#lambda_{0}^{2}");
1312  fhLam0E->SetXTitle("#it{E} (GeV)");
1313  outputContainer->Add(fhLam0E);
1314 
1315  fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1316  fhLam1E->SetYTitle("#lambda_{1}^{2}");
1317  fhLam1E->SetXTitle("#it{E} (GeV)");
1318  outputContainer->Add(fhLam1E);
1319 
1320  fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1321  fhDispE->SetYTitle("D^{2}");
1322  fhDispE->SetXTitle("#it{E} (GeV) ");
1323  outputContainer->Add(fhDispE);
1324 
1325  if(!fRejectTrackMatch)
1326  {
1327  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);
1328  fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
1329  fhLam0ETM->SetXTitle("#it{E} (GeV)");
1330  outputContainer->Add(fhLam0ETM);
1331 
1332  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);
1333  fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
1334  fhLam1ETM->SetXTitle("#it{E} (GeV)");
1335  outputContainer->Add(fhLam1ETM);
1336 
1337  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);
1338  fhDispETM->SetYTitle("D^{2}");
1339  fhDispETM->SetXTitle("#it{E} (GeV) ");
1340  outputContainer->Add(fhDispETM);
1341  }
1342 
1343  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0)
1344  {
1345  fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1346  fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
1347  fhLam0ETRD->SetXTitle("#it{E} (GeV)");
1348  outputContainer->Add(fhLam0ETRD);
1349 
1350  fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1351  fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
1352  fhLam1ETRD->SetXTitle("#it{E} (GeV)");
1353  outputContainer->Add(fhLam1ETRD);
1354 
1355  fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1356  fhDispETRD->SetYTitle("Dispersion^{2}");
1357  fhDispETRD->SetXTitle("#it{E} (GeV) ");
1358  outputContainer->Add(fhDispETRD);
1359 
1361  {
1362  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);
1363  fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
1364  fhLam0ETMTRD->SetXTitle("#it{E} (GeV)");
1365  outputContainer->Add(fhLam0ETMTRD);
1366 
1367  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);
1368  fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
1369  fhLam1ETMTRD->SetXTitle("#it{E} (GeV)");
1370  outputContainer->Add(fhLam1ETMTRD);
1371 
1372  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);
1373  fhDispETMTRD->SetYTitle("Dispersion^{2}");
1374  fhDispETMTRD->SetXTitle("#it{E} (GeV) ");
1375  outputContainer->Add(fhDispETMTRD);
1376  }
1377  }
1378 
1380  {
1381  fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1382  fhNCellsLam0LowE->SetXTitle("N_{cells}");
1383  fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
1384  outputContainer->Add(fhNCellsLam0LowE);
1385 
1386  fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, #it{E} > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1387  fhNCellsLam0HighE->SetXTitle("N_{cells}");
1388  fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
1389  outputContainer->Add(fhNCellsLam0HighE);
1390 
1391  fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1392  fhNCellsLam1LowE->SetXTitle("N_{cells}");
1393  fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
1394  outputContainer->Add(fhNCellsLam1LowE);
1395 
1396  fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, #it{E} > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1397  fhNCellsLam1HighE->SetXTitle("N_{cells}");
1398  fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
1399  outputContainer->Add(fhNCellsLam1HighE);
1400 
1401  fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1402  fhNCellsDispLowE->SetXTitle("N_{cells}");
1403  fhNCellsDispLowE->SetYTitle("D^{2}");
1404  outputContainer->Add(fhNCellsDispLowE);
1405 
1406  fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1407  fhNCellsDispHighE->SetXTitle("N_{cells}");
1408  fhNCellsDispHighE->SetYTitle("D^{2}");
1409  outputContainer->Add(fhNCellsDispHighE);
1410 
1411  fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1412  fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
1413  fhEtaLam0LowE->SetXTitle("#eta");
1414  outputContainer->Add(fhEtaLam0LowE);
1415 
1416  fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1417  fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
1418  fhPhiLam0LowE->SetXTitle("#phi");
1419  outputContainer->Add(fhPhiLam0LowE);
1420 
1421  fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, #it{E} > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1422  fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
1423  fhEtaLam0HighE->SetXTitle("#eta");
1424  outputContainer->Add(fhEtaLam0HighE);
1425 
1426  fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, #it{E} > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1427  fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
1428  fhPhiLam0HighE->SetXTitle("#phi");
1429  outputContainer->Add(fhPhiLam0HighE);
1430 
1431  fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1432  fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
1433  fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
1434  outputContainer->Add(fhLam1Lam0LowE);
1435 
1436  fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of #it{E} > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1437  fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
1438  fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
1439  outputContainer->Add(fhLam1Lam0HighE);
1440 
1441  fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1442  fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
1443  fhLam0DispLowE->SetYTitle("D^{2}");
1444  outputContainer->Add(fhLam0DispLowE);
1445 
1446  fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of #it{E} > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1447  fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
1448  fhLam0DispHighE->SetYTitle("D^{2}");
1449  outputContainer->Add(fhLam0DispHighE);
1450 
1451  fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1452  fhDispLam1LowE->SetXTitle("D^{2}");
1453  fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
1454  outputContainer->Add(fhDispLam1LowE);
1455 
1456  fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of #it{E} > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1457  fhDispLam1HighE->SetXTitle("D^{2}");
1458  fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
1459  outputContainer->Add(fhDispLam1HighE);
1460 
1461  if(GetCalorimeter() == kEMCAL)
1462  {
1463  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);
1464  fhDispEtaE->SetXTitle("#it{E} (GeV)");
1465  fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
1466  outputContainer->Add(fhDispEtaE);
1467 
1468  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);
1469  fhDispPhiE->SetXTitle("#it{E} (GeV)");
1470  fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
1471  outputContainer->Add(fhDispPhiE);
1472 
1473  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);
1474  fhSumEtaE->SetXTitle("#it{E} (GeV)");
1475  fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
1476  outputContainer->Add(fhSumEtaE);
1477 
1478  fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
1479  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1480  fhSumPhiE->SetXTitle("#it{E} (GeV)");
1481  fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
1482  outputContainer->Add(fhSumPhiE);
1483 
1484  fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
1485  nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1486  fhSumEtaPhiE->SetXTitle("#it{E} (GeV)");
1487  fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
1488  outputContainer->Add(fhSumEtaPhiE);
1489 
1490  fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
1491  nptbins,ptmin,ptmax,200, -10,10);
1492  fhDispEtaPhiDiffE->SetXTitle("#it{E} (GeV)");
1493  fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1494  outputContainer->Add(fhDispEtaPhiDiffE);
1495 
1496  fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
1497  nptbins,ptmin,ptmax, 200, -1,1);
1498  fhSphericityE->SetXTitle("#it{E} (GeV)");
1499  fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1500  outputContainer->Add(fhSphericityE);
1501 
1502  fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1503  fhDispSumEtaDiffE->SetXTitle("#it{E} (GeV)");
1504  fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
1505  outputContainer->Add(fhDispSumEtaDiffE);
1506 
1507  fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1508  fhDispSumPhiDiffE->SetXTitle("#it{E} (GeV)");
1509  fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
1510  outputContainer->Add(fhDispSumPhiDiffE);
1511 
1512  for(Int_t i = 0; i < 7; i++)
1513  {
1514  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]),
1515  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1516  fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1517  fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1518  outputContainer->Add(fhDispEtaDispPhi[i]);
1519 
1520  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]),
1521  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1522  fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
1523  fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1524  outputContainer->Add(fhLambda0DispEta[i]);
1525 
1526  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]),
1527  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1528  fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
1529  fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1530  outputContainer->Add(fhLambda0DispPhi[i]);
1531  }
1532  }
1533  }
1534  } // Shower shape
1535 
1536  // Track Matching
1537 
1538  if(fFillTMHisto)
1539  {
1540  TString cutTM [] = {"NoCut",""};
1541 
1542  for(Int_t i = 0; i < 2; i++)
1543  {
1544  fhTrackMatchedDEta[i] = new TH2F
1545  (Form("hTrackMatchedDEta%s",cutTM[i].Data()),
1546  Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1547  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1548  fhTrackMatchedDEta[i]->SetYTitle("d#eta");
1549  fhTrackMatchedDEta[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1550 
1551  fhTrackMatchedDPhi[i] = new TH2F
1552  (Form("hTrackMatchedDPhi%s",cutTM[i].Data()),
1553  Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1554  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1555  fhTrackMatchedDPhi[i]->SetYTitle("d#phi (rad)");
1556  fhTrackMatchedDPhi[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1557 
1558  fhTrackMatchedDEtaDPhi[i] = new TH2F
1559  (Form("hTrackMatchedDEtaDPhi%s",cutTM[i].Data()),
1560  Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1561  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1562  fhTrackMatchedDEtaDPhi[i]->SetYTitle("d#phi (rad)");
1563  fhTrackMatchedDEtaDPhi[i]->SetXTitle("d#eta");
1564 
1565  fhTrackMatchedDEtaPos[i] = new TH2F
1566  (Form("hTrackMatchedDEtaPos%s",cutTM[i].Data()),
1567  Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1568  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1569  fhTrackMatchedDEtaPos[i]->SetYTitle("d#eta");
1570  fhTrackMatchedDEtaPos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1571 
1572  fhTrackMatchedDPhiPos[i] = new TH2F
1573  (Form("hTrackMatchedDPhiPos%s",cutTM[i].Data()),
1574  Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1575  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1576  fhTrackMatchedDPhiPos[i]->SetYTitle("d#phi (rad)");
1577  fhTrackMatchedDPhiPos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1578 
1579  fhTrackMatchedDEtaDPhiPos[i] = new TH2F
1580  (Form("hTrackMatchedDEtaDPhiPos%s",cutTM[i].Data()),
1581  Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1582  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1583  fhTrackMatchedDEtaDPhiPos[i]->SetYTitle("d#phi (rad)");
1584  fhTrackMatchedDEtaDPhiPos[i]->SetXTitle("d#eta");
1585 
1586  fhTrackMatchedDEtaNeg[i] = new TH2F
1587  (Form("hTrackMatchedDEtaNeg%s",cutTM[i].Data()),
1588  Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1589  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1590  fhTrackMatchedDEtaNeg[i]->SetYTitle("d#eta");
1591  fhTrackMatchedDEtaNeg[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1592 
1593  fhTrackMatchedDPhiNeg[i] = new TH2F
1594  (Form("hTrackMatchedDPhiNeg%s",cutTM[i].Data()),
1595  Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1596  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1597  fhTrackMatchedDPhiNeg[i]->SetYTitle("d#phi (rad)");
1598  fhTrackMatchedDPhiNeg[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1599 
1600  fhTrackMatchedDEtaDPhiNeg[i] = new TH2F
1601  (Form("hTrackMatchedDEtaDPhiNeg%s",cutTM[i].Data()),
1602  Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
1603  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1604  fhTrackMatchedDEtaDPhiNeg[i]->SetYTitle("d#phi (rad)");
1605  fhTrackMatchedDEtaDPhiNeg[i]->SetXTitle("d#eta");
1606 
1607  fhdEdx[i] = new TH2F (Form("hdEdx%s",cutTM[i].Data()),Form("matched track <dE/dx> vs cluster E, %s",cutTM[i].Data()),
1608  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1609  fhdEdx[i]->SetXTitle("#it{E} (GeV)");
1610  fhdEdx[i]->SetYTitle("<dE/dx>");
1611 
1612  fhEOverP[i] = new TH2F (Form("hEOverP%s",cutTM[i].Data()),Form("matched track E/p vs cluster E, %s",cutTM[i].Data()),
1613  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1614  fhEOverP[i]->SetXTitle("#it{E} (GeV)");
1615  fhEOverP[i]->SetYTitle("E/p");
1616 
1617  outputContainer->Add(fhTrackMatchedDEta[i]) ;
1618  outputContainer->Add(fhTrackMatchedDPhi[i]) ;
1619  outputContainer->Add(fhTrackMatchedDEtaDPhi[i]) ;
1620  outputContainer->Add(fhTrackMatchedDEtaPos[i]) ;
1621  outputContainer->Add(fhTrackMatchedDPhiPos[i]) ;
1622  outputContainer->Add(fhTrackMatchedDEtaDPhiPos[i]) ;
1623  outputContainer->Add(fhTrackMatchedDEtaNeg[i]) ;
1624  outputContainer->Add(fhTrackMatchedDPhiNeg[i]) ;
1625  outputContainer->Add(fhTrackMatchedDEtaDPhiNeg[i]) ;
1626  outputContainer->Add(fhdEdx[i]);
1627  outputContainer->Add(fhEOverP[i]);
1628 
1630  {
1631  fhTrackMatchedDEtaTRD[i] = new TH2F
1632  (Form("hTrackMatchedDEtaTRD%s",cutTM[i].Data()),
1633  Form("d#eta of cluster-track vs cluster energy, SM behind TRD, %s",cutTM[i].Data()),
1634  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1635  fhTrackMatchedDEtaTRD[i]->SetYTitle("d#eta");
1636  fhTrackMatchedDEtaTRD[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1637 
1638  fhTrackMatchedDPhiTRD[i] = new TH2F
1639  (Form("hTrackMatchedDPhiTRD%s",cutTM[i].Data()),
1640  Form("d#phi of cluster-track vs cluster energy, SM behing TRD, %s",cutTM[i].Data()),
1641  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1642  fhTrackMatchedDPhiTRD[i]->SetYTitle("d#phi (rad)");
1643  fhTrackMatchedDPhiTRD[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1644 
1645  fhEOverPTRD[i] = new TH2F
1646  (Form("hEOverPTRD%s",cutTM[i].Data()),
1647  Form("matched track E/p vs cluster E, behind TRD, %s",cutTM[i].Data()),
1648  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1649  fhEOverPTRD[i]->SetXTitle("#it{E} (GeV)");
1650  fhEOverPTRD[i]->SetYTitle("E/p");
1651 
1652  outputContainer->Add(fhTrackMatchedDEtaTRD[i]) ;
1653  outputContainer->Add(fhTrackMatchedDPhiTRD[i]) ;
1654  outputContainer->Add(fhEOverPTRD[i]);
1655  }
1656 
1657  if(IsDataMC())
1658  {
1659  fhTrackMatchedDEtaMCNoOverlap[i] = new TH2F
1660  (Form("hTrackMatchedDEtaMCNoOverlap%s",cutTM[i].Data()),
1661  Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
1662  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1663  fhTrackMatchedDEtaMCNoOverlap[i]->SetYTitle("d#eta");
1664  fhTrackMatchedDEtaMCNoOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1665 
1666  fhTrackMatchedDPhiMCNoOverlap[i] = new TH2F
1667  (Form("hTrackMatchedDPhiMCNoOverlap%s",cutTM[i].Data()),
1668  Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
1669  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1670  fhTrackMatchedDPhiMCNoOverlap[i]->SetYTitle("d#phi (rad)");
1671  fhTrackMatchedDPhiMCNoOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1672 
1673  outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[i]) ;
1674  outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[i]) ;
1675  fhTrackMatchedDEtaMCOverlap[i] = new TH2F
1676  (Form("hTrackMatchedDEtaMCOverlap%s",cutTM[i].Data()),
1677  Form("d#eta of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
1678  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1679  fhTrackMatchedDEtaMCOverlap[i]->SetYTitle("d#eta");
1680  fhTrackMatchedDEtaMCOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1681 
1682  fhTrackMatchedDPhiMCOverlap[i] = new TH2F
1683  (Form("hTrackMatchedDPhiMCOverlap%s",cutTM[i].Data()),
1684  Form("d#phi of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
1685  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1686  fhTrackMatchedDPhiMCOverlap[i]->SetYTitle("d#phi (rad)");
1687  fhTrackMatchedDPhiMCOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1688 
1689  outputContainer->Add(fhTrackMatchedDEtaMCOverlap[i]) ;
1690  outputContainer->Add(fhTrackMatchedDPhiMCOverlap[i]) ;
1691 
1692  fhTrackMatchedDEtaMCConversion[i] = new TH2F
1693  (Form("hTrackMatchedDEtaMCConversion%s",cutTM[i].Data()),
1694  Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
1695  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1696  fhTrackMatchedDEtaMCConversion[i]->SetYTitle("d#eta");
1697  fhTrackMatchedDEtaMCConversion[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1698 
1699  fhTrackMatchedDPhiMCConversion[i] = new TH2F
1700  (Form("hTrackMatchedDPhiMCConversion%s",cutTM[i].Data()),
1701  Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
1702  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1703  fhTrackMatchedDPhiMCConversion[i]->SetYTitle("d#phi (rad)");
1704  fhTrackMatchedDPhiMCConversion[i]->SetXTitle("#it{E}_{cluster} (GeV)");
1705 
1706  outputContainer->Add(fhTrackMatchedDEtaMCConversion[i]) ;
1707  outputContainer->Add(fhTrackMatchedDPhiMCConversion[i]) ;
1708 
1709  fhTrackMatchedMCParticle[i] = new TH2F
1710  (Form("hTrackMatchedMCParticle%s",cutTM[i].Data()),
1711  Form("Origin of particle vs energy %s",cutTM[i].Data()),
1712  nptbins,ptmin,ptmax,8,0,8);
1713  fhTrackMatchedMCParticle[i]->SetXTitle("#it{E} (GeV)");
1714  //fhTrackMatchedMCParticle[i]->SetYTitle("Particle type");
1715 
1716  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(1 ,"Photon");
1717  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(2 ,"Electron");
1718  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1719  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(4 ,"Rest");
1720  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1721  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1722  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1723  fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1724 
1725  outputContainer->Add(fhTrackMatchedMCParticle[i]);
1726  }
1727  }
1728  }
1729 
1730  if(IsPileUpAnalysisOn())
1731  {
1732  TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1733 
1734  for(Int_t i = 0 ; i < 7 ; i++)
1735  {
1736  fhPtPhotonPileUp[i] = new TH1F(Form("hPtPhotonPileUp%s",pileUpName[i].Data()),
1737  Form("Selected photon #it{p}_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
1738  fhPtPhotonPileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1739  outputContainer->Add(fhPtPhotonPileUp[i]);
1740 
1741  fhClusterTimeDiffPhotonPileUp[i] = new TH2F(Form("hClusterTimeDiffPhotonPileUp%s",pileUpName[i].Data()),
1742  Form("Photon cluster E vs #it{t}_{max}-#it{t}_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
1743  nptbins,ptmin,ptmax,400,-200,200);
1744  fhClusterTimeDiffPhotonPileUp[i]->SetXTitle("#it{E} (GeV)");
1745  fhClusterTimeDiffPhotonPileUp[i]->SetYTitle("#it{t}_{max}-#it{t}_{cell} (ns)");
1746  outputContainer->Add(fhClusterTimeDiffPhotonPileUp[i]);
1747  }
1748 
1749  fhTimePtPhotonNoCut = new TH2F ("hTimePtPhoton_NoCut","time of photon cluster vs pT of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1750  fhTimePtPhotonNoCut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1751  fhTimePtPhotonNoCut->SetYTitle("#it{time} (ns)");
1752  outputContainer->Add(fhTimePtPhotonNoCut);
1753 
1754  fhTimePtPhotonSPD = new TH2F ("hTimePtPhoton_SPD","time of photon cluster vs pT of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1755  fhTimePtPhotonSPD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1756  fhTimePtPhotonSPD->SetYTitle("#it{time} (ns)");
1757  outputContainer->Add(fhTimePtPhotonSPD);
1758 
1759  fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,20,0,20);
1760  fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
1761  fhTimeNPileUpVertSPD->SetXTitle("#it{time} (ns)");
1762  outputContainer->Add(fhTimeNPileUpVertSPD);
1763 
1764  fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 20,0,20 );
1765  fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
1766  fhTimeNPileUpVertTrack->SetXTitle("#it{time} (ns)");
1767  outputContainer->Add(fhTimeNPileUpVertTrack);
1768 
1769  fhPtPhotonNPileUpSPDVtx = new TH2F ("hPtPhoton_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
1770  nptbins,ptmin,ptmax,20,0,20);
1771  fhPtPhotonNPileUpSPDVtx->SetYTitle("# vertex ");
1772  fhPtPhotonNPileUpSPDVtx->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1773  outputContainer->Add(fhPtPhotonNPileUpSPDVtx);
1774 
1775  fhPtPhotonNPileUpTrkVtx = new TH2F ("hPtPhoton_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
1776  nptbins,ptmin,ptmax, 20,0,20 );
1777  fhPtPhotonNPileUpTrkVtx->SetYTitle("# vertex ");
1778  fhPtPhotonNPileUpTrkVtx->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1779  outputContainer->Add(fhPtPhotonNPileUpTrkVtx);
1780 
1781  fhPtPhotonNPileUpSPDVtxTimeCut = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut","pT of cluster vs N pile-up SPD vertex, |tof| < 25 ns",
1782  nptbins,ptmin,ptmax,20,0,20);
1783  fhPtPhotonNPileUpSPDVtxTimeCut->SetYTitle("# vertex ");
1784  fhPtPhotonNPileUpSPDVtxTimeCut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1785  outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut);
1786 
1787  fhPtPhotonNPileUpTrkVtxTimeCut = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut","pT of cluster vs N pile-up Tracks vertex, |tof| < 25 ns",
1788  nptbins,ptmin,ptmax, 20,0,20 );
1789  fhPtPhotonNPileUpTrkVtxTimeCut->SetYTitle("# vertex ");
1790  fhPtPhotonNPileUpTrkVtxTimeCut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1791  outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut);
1792 
1793  fhPtPhotonNPileUpSPDVtxTimeCut2 = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut2","pT of cluster vs N pile-up SPD vertex, -25 < tof < 75 ns",
1794  nptbins,ptmin,ptmax,20,0,20);
1795  fhPtPhotonNPileUpSPDVtxTimeCut2->SetYTitle("# vertex ");
1796  fhPtPhotonNPileUpSPDVtxTimeCut2->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1797  outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut2);
1798 
1799  fhPtPhotonNPileUpTrkVtxTimeCut2 = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut2","pT of cluster vs N pile-up Tracks vertex, -25 < tof < 75 ns",
1800  nptbins,ptmin,ptmax, 20,0,20 );
1801  fhPtPhotonNPileUpTrkVtxTimeCut2->SetYTitle("# vertex ");
1802  fhPtPhotonNPileUpTrkVtxTimeCut2->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1803  outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut2);
1804 
1805  }
1806 
1807  if(IsDataMC())
1808  {
1809  TString ptype[] = { "#gamma" , "#gamma_{#pi decay}" , "#gamma_{#eta decay}", "#gamma_{other decay}",
1810  "#pi^{0}" , "#eta" , "e^{#pm}" , "#gamma->e^{#pm}" ,
1811  "hadron?" , "Anti-N" , "Anti-P" ,
1812  "#gamma_{prompt}", "#gamma_{fragmentation}", "#gamma_{ISR}" , "String" } ;
1813 
1814  TString pname[] = { "Photon" , "PhotonPi0Decay" , "PhotonEtaDecay", "PhotonOtherDecay",
1815  "Pi0" , "Eta" , "Electron" , "Conversion" ,
1816  "Hadron" , "AntiNeutron" , "AntiProton" ,
1817  "PhotonPrompt", "PhotonFragmentation", "PhotonISR" , "String" } ;
1818 
1819  for(Int_t i = 0; i < fNOriginHistograms; i++)
1820  {
1821  fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
1822  Form("cluster from %s : E ",ptype[i].Data()),
1823  nptbins,ptmin,ptmax);
1824  fhMCE[i]->SetXTitle("#it{E} (GeV)");
1825  outputContainer->Add(fhMCE[i]) ;
1826 
1827  fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
1828  Form("cluster from %s : #it{p}_{T} ",ptype[i].Data()),
1829  nptbins,ptmin,ptmax);
1830  fhMCPt[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1831  outputContainer->Add(fhMCPt[i]) ;
1832 
1833  fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
1834  Form("cluster from %s : #eta ",ptype[i].Data()),
1835  nptbins,ptmin,ptmax,netabins,etamin,etamax);
1836  fhMCEta[i]->SetYTitle("#eta");
1837  fhMCEta[i]->SetXTitle("#it{E} (GeV)");
1838  outputContainer->Add(fhMCEta[i]) ;
1839 
1840  fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
1841  Form("cluster from %s : #phi ",ptype[i].Data()),
1842  nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1843  fhMCPhi[i]->SetYTitle("#phi (rad)");
1844  fhMCPhi[i]->SetXTitle("#it{E} (GeV)");
1845  outputContainer->Add(fhMCPhi[i]) ;
1846 
1847 
1848  fhMCDeltaE[i] = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
1849  Form("MC - Reco E from %s",pname[i].Data()),
1850  nptbins,ptmin,ptmax, 200,-50,50);
1851  fhMCDeltaE[i]->SetYTitle("#Delta #it{E} (GeV)");
1852  fhMCDeltaE[i]->SetXTitle("#it{E} (GeV)");
1853  outputContainer->Add(fhMCDeltaE[i]);
1854 
1855  fhMCDeltaPt[i] = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
1856  Form("MC - Reco #it{p}_{T} from %s",pname[i].Data()),
1857  nptbins,ptmin,ptmax, 200,-50,50);
1858  fhMCDeltaPt[i]->SetXTitle("p_{T,rec} (GeV/#it{c})");
1859  fhMCDeltaPt[i]->SetYTitle("#Delta #it{p}_{T} (GeV/#it{c})");
1860  outputContainer->Add(fhMCDeltaPt[i]);
1861 
1862  fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
1863  Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
1864  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1865  fhMC2E[i]->SetXTitle("#it{E}_{rec} (GeV)");
1866  fhMC2E[i]->SetYTitle("#it{E}_{gen} (GeV)");
1867  outputContainer->Add(fhMC2E[i]);
1868 
1869  fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
1870  Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
1871  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1872  fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/#it{c})");
1873  fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/#it{c})");
1874  outputContainer->Add(fhMC2Pt[i]);
1875  }
1876 
1877  TString pptype[] = { "#gamma" , "#gamma_{#pi decay}" ,
1878  "#gamma_{#eta decay}", "#gamma_{other decay}" ,
1879  "#gamma_{prompt}" , "#gamma_{fragmentation}", "#gamma_{ISR}" } ;
1880 
1881  TString ppname[] = { "Photon" , "PhotonPi0Decay" ,
1882  "PhotonEtaDecay", "PhotonOtherDecay" ,
1883  "PhotonPrompt" , "PhotonFragmentation", "PhotonISR" } ;
1884 
1885  for(Int_t i = 0; i < fNPrimaryHistograms; i++)
1886  {
1887  fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
1888  Form("primary photon %s : E ",pptype[i].Data()),
1889  nptbins,ptmin,ptmax);
1890  fhEPrimMC[i]->SetXTitle("#it{E} (GeV)");
1891  outputContainer->Add(fhEPrimMC[i]) ;
1892 
1893  fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
1894  Form("primary photon %s : #it{p}_{T} ",pptype[i].Data()),
1895  nptbins,ptmin,ptmax);
1896  fhPtPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1897  outputContainer->Add(fhPtPrimMC[i]) ;
1898 
1899  fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
1900  Form("primary photon %s : Rapidity ",pptype[i].Data()),
1901  nptbins,ptmin,ptmax,200,-2,2);
1902  fhYPrimMC[i]->SetYTitle("Rapidity");
1903  fhYPrimMC[i]->SetXTitle("#it{E} (GeV)");
1904  outputContainer->Add(fhYPrimMC[i]) ;
1905 
1906  fhEtaPrimMC[i] = new TH2F(Form("hEtaPrim_MC%s",ppname[i].Data()),
1907  Form("primary photon %s : #eta",pptype[i].Data()),
1908  nptbins,ptmin,ptmax,200,-2,2);
1909  fhEtaPrimMC[i]->SetYTitle("#eta");
1910  fhEtaPrimMC[i]->SetXTitle("#it{E} (GeV)");
1911  outputContainer->Add(fhEtaPrimMC[i]) ;
1912 
1913  fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
1914  Form("primary photon %s : #phi ",pptype[i].Data()),
1915  nptbins,ptmin,ptmax,nphibins,0,TMath::TwoPi());
1916  fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
1917  fhPhiPrimMC[i]->SetXTitle("#it{E} (GeV)");
1918  outputContainer->Add(fhPhiPrimMC[i]) ;
1919 
1920 
1921  fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
1922  Form("primary photon %s in acceptance: E ",pptype[i].Data()),
1923  nptbins,ptmin,ptmax);
1924  fhEPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
1925  outputContainer->Add(fhEPrimMCAcc[i]) ;
1926 
1927  fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
1928  Form("primary photon %s in acceptance: #it{p}_{T} ",pptype[i].Data()),
1929  nptbins,ptmin,ptmax);
1930  fhPtPrimMCAcc[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1931  outputContainer->Add(fhPtPrimMCAcc[i]) ;
1932 
1933  fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
1934  Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
1935  nptbins,ptmin,ptmax,100,-1,1);
1936  fhYPrimMCAcc[i]->SetYTitle("Rapidity");
1937  fhYPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
1938  outputContainer->Add(fhYPrimMCAcc[i]) ;
1939 
1940  fhEtaPrimMCAcc[i] = new TH2F(Form("hEtaPrimAcc_MC%s",ppname[i].Data()),
1941  Form("primary photon %s in acceptance: #eta ",pptype[i].Data()),
1942  nptbins,ptmin,ptmax,netabins,etamin,etamax);
1943  fhEtaPrimMCAcc[i]->SetYTitle("#eta");
1944  fhEtaPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
1945  outputContainer->Add(fhEtaPrimMCAcc[i]) ;
1946 
1947  fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
1948  Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
1949  nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1950  fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
1951  fhPhiPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
1952  outputContainer->Add(fhPhiPrimMCAcc[i]) ;
1953  }
1954 
1955  if(fFillSSHistograms)
1956  {
1957  TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
1958 
1959  TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
1960 
1961  for(Int_t i = 0; i < 6; i++)
1962  {
1963  fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
1964  Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
1965  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1966  fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
1967  fhMCELambda0[i]->SetXTitle("#it{E} (GeV)");
1968  outputContainer->Add(fhMCELambda0[i]) ;
1969 
1970  fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
1971  Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
1972  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1973  fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
1974  fhMCELambda1[i]->SetXTitle("#it{E} (GeV)");
1975  outputContainer->Add(fhMCELambda1[i]) ;
1976 
1977  fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
1978  Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
1979  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1980  fhMCEDispersion[i]->SetYTitle("D^{2}");
1981  fhMCEDispersion[i]->SetXTitle("#it{E} (GeV)");
1982  outputContainer->Add(fhMCEDispersion[i]) ;
1983 
1984  fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
1985  Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
1986  nptbins,ptmin,ptmax, nbins,nmin,nmax);
1987  fhMCNCellsE[i]->SetXTitle("#it{E} (GeV)");
1988  fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
1989  outputContainer->Add(fhMCNCellsE[i]);
1990 
1991  fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
1992  Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
1993  nptbins,ptmin,ptmax, 500,0,1.);
1994  fhMCMaxCellDiffClusterE[i]->SetXTitle("#it{E}_{cluster} (GeV) ");
1995  fhMCMaxCellDiffClusterE[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
1996  outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
1997 
1999  {
2000  fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
2001  Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
2002  ssbins,ssmin,ssmax,500,0,1.);
2003  fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
2004  fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2005  outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
2006 
2007  fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
2008  Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
2009  ssbins,ssmin,ssmax,500,0,1.);
2010  fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
2011  fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2012  outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
2013 
2014  fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
2015  Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, #it{E} > 6 GeV",ptypess[i].Data()),
2016  ssbins,ssmin,ssmax,500,0,1.);
2017  fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
2018  fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2019  outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
2020 
2021  fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
2022  Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
2023  nbins/5,nmin,nmax/5,500,0,1.);
2024  fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
2025  fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2026  outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
2027 
2028  fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
2029  Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
2030  nbins/5,nmin,nmax/5,500,0,1.);
2031  fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
2032  fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
2033  outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
2034 
2035  fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
2036  Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, #it{E} > 6 GeV",ptypess[i].Data()),
2037  nbins/5,nmin,nmax/5,500,0,1.);
2038  fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
2039  fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("#it{E} (GeV)");
2040  outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
2041 
2042  if(GetCalorimeter()==kEMCAL)
2043  {
2044  fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pnamess[i].Data()),
2045  Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data()),
2046  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2047  fhMCEDispEta[i]->SetXTitle("#it{E} (GeV)");
2048  fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
2049  outputContainer->Add(fhMCEDispEta[i]);
2050 
2051  fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pnamess[i].Data()),
2052  Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptypess[i].Data()),
2053  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2054  fhMCEDispPhi[i]->SetXTitle("#it{E} (GeV)");
2055  fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2056  outputContainer->Add(fhMCEDispPhi[i]);
2057 
2058  fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pnamess[i].Data()),
2059  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()),
2060  nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
2061  fhMCESumEtaPhi[i]->SetXTitle("#it{E} (GeV)");
2062  fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
2063  outputContainer->Add(fhMCESumEtaPhi[i]);
2064 
2065  fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pnamess[i].Data()),
2066  Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),
2067  nptbins,ptmin,ptmax,200,-10,10);
2068  fhMCEDispEtaPhiDiff[i]->SetXTitle("#it{E} (GeV)");
2069  fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
2070  outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
2071 
2072  fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pnamess[i].Data()),
2073  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()),
2074  nptbins,ptmin,ptmax, 200,-1,1);
2075  fhMCESphericity[i]->SetXTitle("#it{E} (GeV)");
2076  fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
2077  outputContainer->Add(fhMCESphericity[i]);
2078 
2079  for(Int_t ie = 0; ie < 7; ie++)
2080  {
2081  fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
2082  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]),
2083  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2084  fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
2085  fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2086  outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
2087 
2088  fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pnamess[i].Data()),
2089  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]),
2090  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2091  fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
2092  fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2093  outputContainer->Add(fhMCLambda0DispEta[ie][i]);
2094 
2095  fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
2096  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]),
2097  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2098  fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
2099  fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2100  outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
2101  }
2102  }
2103  }
2104  }// loop
2105 
2106  if(!GetReader()->IsEmbeddedClusterSelectionOn())
2107  {
2108  fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
2109  "cluster from Photon : E vs #lambda_{0}^{2}",
2110  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2111  fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
2112  fhMCPhotonELambda0NoOverlap->SetXTitle("#it{E} (GeV)");
2113  outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
2114 
2115  fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
2116  "cluster from Photon : E vs #lambda_{0}^{2}",
2117  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2118  fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
2119  fhMCPhotonELambda0TwoOverlap->SetXTitle("#it{E} (GeV)");
2120  outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
2121 
2122  fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
2123  "cluster from Photon : E vs #lambda_{0}^{2}",
2124  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2125  fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
2126  fhMCPhotonELambda0NOverlap->SetXTitle("#it{E} (GeV)");
2127  outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
2128  } // No embedding
2129 
2130  if(GetReader()->IsEmbeddedClusterSelectionOn())
2131  {
2132  fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
2133  "Energy Fraction of embedded signal versus cluster energy",
2134  nptbins,ptmin,ptmax,100,0.,1.);
2135  fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
2136  fhEmbeddedSignalFractionEnergy->SetXTitle("#it{E} (GeV)");
2137  outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
2138 
2139  fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
2140  "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2141  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2142  fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2143  fhEmbedPhotonELambda0FullSignal->SetXTitle("#it{E} (GeV)");
2144  outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
2145 
2146  fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
2147  "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2148  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2149  fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2150  fhEmbedPhotonELambda0MostlySignal->SetXTitle("#it{E} (GeV)");
2151  outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
2152 
2153  fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
2154  "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2155  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2156  fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2157  fhEmbedPhotonELambda0MostlyBkg->SetXTitle("#it{E} (GeV)");
2158  outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
2159 
2160  fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
2161  "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2162  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2163  fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2164  fhEmbedPhotonELambda0FullBkg->SetXTitle("#it{E} (GeV)");
2165  outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
2166 
2167  fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
2168  "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2169  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2170  fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2171  fhEmbedPi0ELambda0FullSignal->SetXTitle("#it{E} (GeV)");
2172  outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
2173 
2174  fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
2175  "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2176  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2177  fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2178  fhEmbedPi0ELambda0MostlySignal->SetXTitle("#it{E} (GeV)");
2179  outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
2180 
2181  fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
2182  "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2183  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2184  fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2185  fhEmbedPi0ELambda0MostlyBkg->SetXTitle("#it{E} (GeV)");
2186  outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
2187 
2188  fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
2189  "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2190  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2191  fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2192  fhEmbedPi0ELambda0FullBkg->SetXTitle("#it{E} (GeV)");
2193  outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
2194  }// embedded histograms
2195 
2196  }// Fill SS MC histograms
2197 
2198  } // Histos with MC
2199 
2200  return outputContainer ;
2201 }
2202 
2203 //_______________________
2205 //_______________________
2207 {
2208  if ( GetCalorimeter() == kPHOS && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD() )
2209  AliFatal("!!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!");
2210  else if( GetCalorimeter() == kEMCAL && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD() )
2211  AliFatal("!!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!");
2212 
2213  // Trick to select primary photon particles in the analysis of pure MC input
2214  if(GetReader()->GetDataType() == AliCaloTrackReader::kMC) GetCaloPID()->SwitchOnBayesian();
2215 }
2216 
2217 //_________________________________
2219 //_________________________________
2221 {
2222  AddToHistogramsName("AnaPhoton_");
2223 
2224  fMinDist = 2.;
2225  fMinDist2 = 4.;
2226  fMinDist3 = 5.;
2227 
2228  fTimeCutMin =-1000000;
2229  fTimeCutMax = 1000000;
2230  fNCellsCut = 0;
2231 
2232  fRejectTrackMatch = kTRUE ;
2233 }
2234 
2235 //_______________________________________
2239 //_______________________________________
2241 {
2242  // Get the vertex
2243  Double_t v[3] = {0,0,0}; //vertex ;
2244  GetReader()->GetVertex(v);
2245 
2246  // Select the Calorimeter of the photon
2247  TObjArray * pl = 0x0;
2248  AliVCaloCells* cells = 0;
2249  if (GetCalorimeter() == kPHOS )
2250  {
2251  pl = GetPHOSClusters();
2252  cells = GetPHOSCells();
2253  }
2254  else if (GetCalorimeter() == kEMCAL)
2255  {
2256  pl = GetEMCALClusters();
2257  cells = GetEMCALCells();
2258  }
2259 
2260  if(!pl)
2261  {
2262  AliWarning(Form("TObjArray with %s clusters is NULL!",GetCalorimeterString().Data()));
2263  return;
2264  }
2265 
2266  // Loop on raw clusters before filtering in the reader and fill control histogram
2267  if((GetReader()->GetEMCALClusterListName()=="" && GetCalorimeter()==kEMCAL) || GetCalorimeter()==kPHOS)
2268  {
2269  for(Int_t iclus = 0; iclus < GetReader()->GetInputEvent()->GetNumberOfCaloClusters(); iclus++ )
2270  {
2271  AliVCluster * clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
2272 
2273  if (GetCalorimeter() == kPHOS && clus->IsPHOS() && clus->E() > GetReader()->GetPHOSPtMin() )
2274  {
2275  clus->GetMomentum(fMomentum,GetVertex(0)) ;
2276 
2277  fhClusterCutsE [0]->Fill(fMomentum.E() , GetEventWeight());
2278  fhClusterCutsPt[0]->Fill(fMomentum.Pt(), GetEventWeight());
2279  }
2280  else if(GetCalorimeter() == kEMCAL && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin())
2281  {
2282  clus->GetMomentum(fMomentum,GetVertex(0)) ;
2283 
2284  fhClusterCutsE [0]->Fill(fMomentum.E(), GetEventWeight());
2285  fhClusterCutsPt[0]->Fill(fMomentum.Pt(), GetEventWeight());
2286  }
2287  }
2288  }
2289  else
2290  { // reclusterized
2291  TClonesArray * clusterList = 0;
2292 
2293  if(GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()))
2294  clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
2295  else if(GetReader()->GetOutputEvent())
2296  clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
2297 
2298  if(clusterList)
2299  {
2300  Int_t nclusters = clusterList->GetEntriesFast();
2301  for (Int_t iclus = 0; iclus < nclusters; iclus++)
2302  {
2303  AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
2304 
2305  if(clus && clus->E() > GetReader()->GetEMCALPtMin())
2306  {
2307  clus->GetMomentum(fMomentum,GetVertex(0)) ;
2308 
2309  fhClusterCutsE [0]->Fill(clus->E() , GetEventWeight());
2310  fhClusterCutsPt[0]->Fill(fMomentum.Pt(), GetEventWeight());
2311  }
2312  }
2313  }
2314  }
2315 
2316  // Init arrays, variables, get number of clusters
2317  Int_t nCaloClusters = pl->GetEntriesFast();
2318 
2319  AliDebug(1,Form("Input %s cluster entries %d", GetCalorimeterString().Data(), nCaloClusters));
2320 
2321  //----------------------------------------------------
2322  // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
2323  //----------------------------------------------------
2324  // Loop on clusters
2325  for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
2326  {
2327  AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
2328  //printf("calo %d, %f\n",icalo,calo->E());
2329 
2330  //Get the index where the cluster comes, to retrieve the corresponding vertex
2331  Int_t evtIndex = 0 ;
2332  if (GetMixedEvent())
2333  {
2334  evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
2335  //Get the vertex and check it is not too large in z
2336  if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
2337  }
2338 
2339  //Cluster selection, not charged, with photon id and in fiducial cut
2341  {
2342  calo->GetMomentum(fMomentum,GetVertex(evtIndex)) ;
2343  }//Assume that come from vertex in straight line
2344  else
2345  {
2346  Double_t vertex[]={0,0,0};
2347  calo->GetMomentum(fMomentum,vertex) ;
2348  }
2349 
2350  //-----------------------------
2351  // Cluster selection
2352  //-----------------------------
2353  Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
2354  if(!ClusterSelected(calo,nMaxima)) continue;
2355 
2356  //----------------------------
2357  // Create AOD for analysis
2358  //----------------------------
2359  AliAODPWG4Particle aodph = AliAODPWG4Particle(fMomentum);
2360 
2361  //...............................................
2362  // Set the indeces of the original caloclusters (MC, ID), and calorimeter
2363  Int_t label = calo->GetLabel();
2364  aodph.SetLabel(label);
2365  aodph.SetCaloLabel(calo->GetID(),-1);
2366  aodph.SetDetectorTag(GetCalorimeter());
2367  //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
2368 
2369  //...............................................
2370  // Set bad channel distance bit
2371  Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
2372  if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
2373  else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
2374  else aodph.SetDistToBad(0) ;
2375  //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
2376 
2377  //-------------------------------------
2378  // Play with the MC stack if available
2379  //-------------------------------------
2380 
2381  // Check origin of the candidates
2382  Int_t tag = -1;
2383 
2384  if(IsDataMC())
2385  {
2386  tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(),GetCalorimeter());
2387  aodph.SetTag(tag);
2388 
2389  AliDebug(1,Form("Origin of candidate, bit map %d",aodph.GetTag()));
2390  }//Work with stack also
2391 
2392  //--------------------------------------------------------
2393  // Fill some shower shape histograms before PID is applied
2394  //--------------------------------------------------------
2395 
2396  Float_t maxCellFraction = 0;
2397  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo, maxCellFraction);
2398  if( absIdMax < 0 ) AliFatal("Wrong absID");
2399 
2400  FillShowerShapeHistograms(calo,tag,maxCellFraction);
2401 
2402  aodph.SetM02(calo->GetM02());
2403  aodph.SetNLM(nMaxima);
2404  aodph.SetTime(calo->GetTOF()*1e9);
2405  aodph.SetNCells(calo->GetNCells());
2406  Int_t nSM = GetModuleNumber(calo);
2407  aodph.SetSModNumber(nSM);
2408 
2409  //-------------------------------------
2410  // PID selection or bit setting
2411  //-------------------------------------
2412 
2413  //...............................................
2414  // Data, PID check on
2415  if(IsCaloPIDOn())
2416  {
2417  // Get most probable PID, 2 options check bayesian PID weights or redo PID
2418  // By default, redo PID
2419 
2420  aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(calo));
2421 
2422  AliDebug(1,Form("PDG of identified particle %d",aodph.GetIdentifiedParticleType()));
2423 
2424  //If cluster does not pass pid, not photon, skip it.
2425  if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
2426  }
2427 
2428  //...............................................
2429  // Data, PID check off
2430  else
2431  {
2432  // Set PID bits for later selection (AliAnaPi0 for example)
2433  // GetIdentifiedParticleType already called in SetPIDBits.
2434 
2435  GetCaloPID()->SetPIDBits(calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
2436 
2437  AliDebug(1,"PID Bits set");
2438  }
2439 
2440  AliDebug(1,Form("Photon selection cuts passed: pT %3.2f, pdg %d",aodph.Pt(),aodph.GetIdentifiedParticleType()));
2441 
2442 
2443  Float_t en = fMomentum.E ();
2444  Float_t pt = fMomentum.Pt();
2445 
2446  fhClusterCutsE [9]->Fill(en, GetEventWeight());
2447  fhClusterCutsPt[9]->Fill(pt, GetEventWeight());
2448 
2449  if(nSM < GetCaloUtils()->GetNumberOfSuperModulesUsed() && nSM >=0)
2450  {
2451  fhEPhotonSM ->Fill(en, nSM, GetEventWeight());
2452  fhPtPhotonSM->Fill(pt, nSM, GetEventWeight());
2453  }
2454 
2455  fhNLocMax->Fill(calo->E(),nMaxima);
2456 
2457  // Few more control histograms for selected clusters
2458  fhMaxCellDiffClusterE->Fill(en, maxCellFraction , GetEventWeight());
2459  fhNCellsE ->Fill(en, calo->GetNCells() , GetEventWeight());
2460  fhTimePt ->Fill(pt, calo->GetTOF()*1.e9, GetEventWeight());
2461 
2462  if(cells)
2463  {
2464  for(Int_t icell = 0; icell < calo->GetNCells(); icell++)
2465  fhCellsE->Fill(en, cells->GetCellAmplitude(calo->GetCellsAbsId()[icell]), GetEventWeight());
2466  }
2467 
2468  // Matching after cuts
2470 
2471  // Fill histograms to undertand pile-up before other cuts applied
2472  // Remember to relax time cuts in the reader
2473  if( IsPileUpAnalysisOn() ) FillPileUpHistograms(calo,cells, absIdMax);
2474 
2475  // Add AOD with photon object to aod branch
2476  AddAODParticle(aodph);
2477  }// loop
2478 
2479  AliDebug(1,Form("End fill AODs, with %d entries",GetOutputAODBranch()->GetEntriesFast()));
2480 }
2481 
2482 //______________________________________________
2483 // Fill histograms with selected clusters/output AOD particles.
2484 //______________________________________________
2486 {
2487  // In case of simulated data, fill acceptance histograms
2489 
2490  // Get vertex
2491  Double_t v[3] = {0,0,0}; //vertex ;
2492  GetReader()->GetVertex(v);
2493  //fhVertex->Fill(v[0],v[1],v[2]);
2494  if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
2495 
2496  //----------------------------------
2497  // Loop on stored AOD photons
2498  Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2499  AliDebug(1,Form("AOD branch entries %d", naod));
2500 
2501  Float_t cen = GetEventCentrality();
2502  // printf("++++++++++ GetEventCentrality() %f\n",cen);
2503 
2504  Float_t ep = GetEventPlaneAngle();
2505 
2506  for(Int_t iaod = 0; iaod < naod ; iaod++)
2507  {
2508  AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2509  Int_t pdg = ph->GetIdentifiedParticleType();
2510 
2511  AliDebug(2,Form("PDG %d, MC TAG %d, Calorimeter <%d>",ph->GetIdentifiedParticleType(),ph->GetTag(), ph->GetDetectorTag())) ;
2512 
2513  // If PID used, fill histos with photons in Calorimeter GetCalorimeter()
2514  if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
2515 
2516  if(((Int_t) ph->GetDetectorTag()) != GetCalorimeter()) continue;
2517 
2518  AliDebug(2,Form("ID Photon: pt %f, phi %f, eta %f", ph->Pt(),ph->Phi(),ph->Eta())) ;
2519 
2520  //................................
2521  //Fill photon histograms
2522  Float_t ptcluster = ph->Pt();
2523  Float_t phicluster = ph->Phi();
2524  Float_t etacluster = ph->Eta();
2525  Float_t ecluster = ph->E();
2526 
2527  fhEPhoton ->Fill(ecluster , GetEventWeight());
2528  fhPtPhoton ->Fill(ptcluster, GetEventWeight());
2529 
2530  fhPhiPhoton ->Fill(ptcluster,phicluster, GetEventWeight());
2531  fhEtaPhoton ->Fill(ptcluster,etacluster, GetEventWeight());
2532 
2533  if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster, GetEventWeight());
2534  else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster, GetEventWeight());
2535 
2537  {
2538  fhPtCentralityPhoton ->Fill(ptcluster,cen, GetEventWeight()) ;
2539  fhPtEventPlanePhoton ->Fill(ptcluster,ep , GetEventWeight()) ;
2540  }
2541 
2542 // Comment this part, not needed but in case to know how to do it in the future
2543 // // Get original cluster, to recover some information
2544 // AliVCaloCells* cells = 0;
2545 // TObjArray * clusters = 0;
2546 // if(GetCalorimeter() == kEMCAL)
2547 // {
2548 // cells = GetEMCALCells();
2549 // clusters = GetEMCALClusters();
2550 // }
2551 // else
2552 // {
2553 // cells = GetPHOSCells();
2554 // clusters = GetPHOSClusters();
2555 // }
2556 
2557 // Int_t iclus = -1;
2558 // AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
2559 // if(cluster)
2560 
2561  //.......................................
2562  // Play with the MC data if available
2563  if(IsDataMC())
2564  {
2565  //....................................................................
2566  // Access MC information in stack if requested, check that it exists.
2567  Int_t label = ph->GetLabel();
2568 
2569  if(label < 0)
2570  {
2571  AliDebug(1,Form("*** bad label ***: label %d", label));
2572  continue;
2573  }
2574 
2575  Float_t eprim = 0;
2576  Float_t ptprim = 0;
2577  Bool_t ok = kFALSE;
2579 
2580  if(ok)
2581  {
2582  eprim = fPrimaryMom.Energy();
2583  ptprim = fPrimaryMom.Pt();
2584  }
2585 
2586  Int_t tag =ph->GetTag();
2587  Int_t mcParticleTag = -1;
2589  {
2590  fhMCE [kmcPhoton] ->Fill(ecluster , GetEventWeight());
2591  fhMCPt [kmcPhoton] ->Fill(ptcluster, GetEventWeight());
2592 
2593  fhMCPhi[kmcPhoton] ->Fill(ecluster,phicluster, GetEventWeight());
2594  fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster, GetEventWeight());
2595 
2596  fhMC2E [kmcPhoton] ->Fill(ecluster , eprim , GetEventWeight());
2597  fhMC2Pt [kmcPhoton] ->Fill(ptcluster, ptprim, GetEventWeight());
2598 
2599  fhMCDeltaE [kmcPhoton] ->Fill(ecluster , eprim-ecluster , GetEventWeight());
2600  fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster, ptprim-ptcluster, GetEventWeight());
2601 
2602  if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) &&
2604  {
2605  fhMCE [kmcConversion] ->Fill(ecluster , GetEventWeight());
2606  fhMCPt [kmcConversion] ->Fill(ptcluster, GetEventWeight());
2607 
2608  fhMCPhi[kmcConversion] ->Fill(ecluster, phicluster, GetEventWeight());
2609  fhMCEta[kmcConversion] ->Fill(ecluster, etacluster, GetEventWeight());
2610 
2611  fhMC2E [kmcConversion] ->Fill(ecluster , eprim , GetEventWeight());
2612  fhMC2Pt [kmcConversion] ->Fill(ptcluster, ptprim, GetEventWeight());
2613 
2614  fhMCDeltaE [kmcConversion] ->Fill(ecluster , eprim-ecluster , GetEventWeight());
2615  fhMCDeltaPt[kmcConversion] ->Fill(ptcluster, ptprim-ptcluster, GetEventWeight());
2616  }
2617 
2618  if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) )
2619  {
2620  mcParticleTag = kmcPrompt;
2621  }
2622  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) )
2623  {
2624  mcParticleTag = kmcFragmentation;
2625  }
2626  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) )
2627  {
2628  mcParticleTag = kmcISR;
2629  }
2630  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) )
2631  {
2632  mcParticleTag = kmcPi0;
2633  }
2634  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) )
2635  {
2636  mcParticleTag = kmcEta;
2637  }
2638  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) )
2639  {
2640  mcParticleTag = kmcPi0Decay;
2641  }
2642  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) )
2643  {
2644  mcParticleTag = kmcEtaDecay;
2645  }
2646  else
2647  {
2648  mcParticleTag = kmcOtherDecay;
2649  }
2650  }
2651  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) )
2652  {
2653  mcParticleTag = kmcAntiNeutron;
2654  }
2655  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) )
2656  {
2657  mcParticleTag = kmcAntiProton;
2658  }
2659  else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) )
2660  {
2661  mcParticleTag = kmcElectron;
2662  }
2663  else if( fhMCE[kmcOther] )
2664  {
2665  mcParticleTag = kmcOther;
2666 
2667  // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
2668  // ph->GetLabel(),ph->Pt());
2669  // for(Int_t i = 0; i < 20; i++) {
2670  // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
2671  // }
2672  // printf("\n");
2673  }
2674 
2675  if(mcParticleTag >= 0 && fhMCE[mcParticleTag])
2676  {
2677  fhMCE [mcParticleTag]->Fill(ecluster , GetEventWeight());
2678  fhMCPt [mcParticleTag]->Fill(ptcluster, GetEventWeight());
2679 
2680  fhMCPhi [mcParticleTag]->Fill(ecluster, phicluster, GetEventWeight());
2681  fhMCEta [mcParticleTag]->Fill(ecluster, etacluster, GetEventWeight());
2682 
2683  fhMC2E [mcParticleTag]->Fill(ecluster , eprim , GetEventWeight());
2684  fhMC2Pt [mcParticleTag]->Fill(ptcluster, ptprim, GetEventWeight());
2685 
2686  fhMCDeltaE [mcParticleTag]->Fill(ecluster , eprim-ecluster , GetEventWeight());
2687  fhMCDeltaPt[mcParticleTag]->Fill(ptcluster, ptprim-ptcluster, GetEventWeight());
2688  }
2689  }// Histograms with MC
2690  }// aod loop
2691 }
2692 
2693 //__________________________________________________
2695 //__________________________________________________
2696 void AliAnaPhoton::Print(const Option_t * opt) const
2697 {
2698  if(! opt)
2699  return;
2700 
2701  printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2703 
2704  printf("Calorimeter = %s\n", GetCalorimeterString().Data()) ;
2705  printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
2706  printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
2707  printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
2708  printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
2709  printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2710  printf("Number of cells in cluster is > %d \n", fNCellsCut);
2711  printf(" \n") ;
2712 }
Bool_t IsPileUpFromSPD() const
Bool_t fFillOnlySimpleSSHisto
Fill selected cluster histograms, selected SS histograms.
Definition: AliAnaPhoton.h:154
Float_t GetHistoPtMax() const
TH2F * fhLam1ETMTRD
! Cluster lambda1 vs E, SM covered by TRD, cut on Track Matching residual
Definition: AliAnaPhoton.h:201
TH1F * fhClusterCutsE[10]
! control histogram on the different photon selection cuts, E
Definition: AliAnaPhoton.h:166
TH2F * fhPhiLam0LowE
! Cluster phi vs lambda0, E<2
Definition: AliAnaPhoton.h:211
TH2F * fhNCellsLam1HighE
! number of cells in cluster vs lambda1, E>2
Definition: AliAnaPhoton.h:207
TH2F * fhLam1Lam0HighE
! Cluster lambda1 vs lambda0, E>2
Definition: AliAnaPhoton.h:217
TH2F * fhTrackMatchedDEtaTRD[2]
! Eta distance between track and cluster vs cluster E, after and before photon cuts, behind TRD
Definition: AliAnaPhoton.h:313
TH1F * fhMCPt[fgkNmcTypes]
! Number of identified photon vs cluster pT coming from MC particle
Definition: AliAnaPhoton.h:242
TH2F * fhTrackMatchedDEtaDPhiNeg[2]
! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV, after and before photon cuts ...
Definition: AliAnaPhoton.h:311
Int_t fNCellsCut
Accept for the analysis clusters with more than fNCellsCut cells.
Definition: AliAnaPhoton.h:147
TH2F * fhEmbedPi0ELambda0FullBkg
! Lambda0 vs E for embedded photons with less than 10% of the cluster energy
Definition: AliAnaPhoton.h:297
TH2F * fhDispE
! Cluster dispersion vs E
Definition: AliAnaPhoton.h:187
TH2F * fhMCEta[fgkNmcTypes]
! eta of identified photon coming from MC particle
Definition: AliAnaPhoton.h:244
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Int_t fNLMCutMax
Remove clusters/cells with number of local maxima larger than this value.
Definition: AliAnaPhoton.h:150
TH2F * fhMCNCellsE[fgkNssTypes]
! NCells per cluster vs energy
Definition: AliAnaPhoton.h:274
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:230
TH2F * fhLam1ETRD
! Cluster lambda1 vs E, SM covered by TRD
Definition: AliAnaPhoton.h:193
TH2F * fhEClusterSM
! Cluster E distribution per SM, before any selection, after reader
Definition: AliAnaPhoton.h:344
TH2F * fhMaxCellDiffClusterE
! Fraction of energy carried by cell with maximum energy
Definition: AliAnaPhoton.h:170
TH2F * fhPtClusterSM
! Cluster E distribution per SM, before any selection, after reader
Definition: AliAnaPhoton.h:346
TH2F * fhDispETRD
! Cluster dispersion vs E, SM covered by TRD
Definition: AliAnaPhoton.h:191
Int_t GetHistoShowerShapeBins() const
Float_t GetHistodEdxMax() const
virtual void AddToHistogramsName(TString add)
virtual AliVCaloCells * GetEMCALCells() const
Bool_t IsRecalculationOfClusterTrackMatchingOn() const
TH2F * fhTrackMatchedDEtaDPhiPos[2]
! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV, after and before ...
Definition: AliAnaPhoton.h:307
TH2F * fhNCellsLam1LowE
! number of cells in cluster vs lambda1
Definition: AliAnaPhoton.h:204
Bool_t fFillTMHisto
Fill track matching plots.
Definition: AliAnaPhoton.h:142
TH2F * fhPtPhotonNPileUpSPDVtx
! photon pt vs number of spd pile-up vertices
Definition: AliAnaPhoton.h:337
TH2F * fhPtPhotonNPileUpTrkVtx
! photon pt vs number of track pile-up vertices
Definition: AliAnaPhoton.h:338
TH2F * fhNCellsDispLowE
! number of cells in cluster vs dispersion
Definition: AliAnaPhoton.h:205
TH2F * fhTrackMatchedDEtaPos[2]
! Eta distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:305
TH2F * fhSphericityE
! shower sphericity in eta vs phi
Definition: AliAnaPhoton.h:227
TH2F * fhDispEtaE
! shower dispersion in eta direction
Definition: AliAnaPhoton.h:221
TH2F * fhPtPhotonNPileUpTrkVtxTimeCut
! photon pt vs number of track pile-up vertices, time cut +- 25 ns
Definition: AliAnaPhoton.h:340
TH2F * fhEtaPrimMC[fgkNmcPrimTypes]
! Eta of generated photon
Definition: AliAnaPhoton.h:250
AliEMCALRecoUtils * GetEMCALRecoUtils() const
TH2F * fhPtPhotonSM
! photon-like cluster E distribution per SM
Definition: AliAnaPhoton.h:347
Bool_t ReadAODMCParticles() const
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:314
Float_t fMinDist2
Cuts on Minimal distance to study acceptance evaluation.
Definition: AliAnaPhoton.h:137
TH1F * fhPtPhotonPileUp[7]
! pT distribution of selected photons
Definition: AliAnaPhoton.h:330
TH1F * fhPtPhoton
! Number of identified photon vs transerse momentum
Definition: AliAnaPhoton.h:175
Bool_t fRejectTrackMatch
If PID on, reject clusters which have an associated TPC track.
Definition: AliAnaPhoton.h:140
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:319
TH2F * fhPtEventPlanePhoton
! event plane vs photon pT
Definition: AliAnaPhoton.h:182
virtual AliVEvent * GetInputEvent() const
TH2F * fhEmbedPi0ELambda0FullSignal
! Lambda0 vs E for embedded photons with more than 90% of the cluster energy
Definition: AliAnaPhoton.h:294
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:296
TH2F * fhMCESphericity[fgkNssTypes]
! shower sphericity, eta vs phi
Definition: AliAnaPhoton.h:281
TH2F * fhMC2Pt[fgkNmcTypes]
! pT distribution, Reco vs MC coming from MC particle
Definition: AliAnaPhoton.h:239
TH2F * fhEtaPhiPhoton
! Pseudorapidity vs Phi of identified photon for E > 0.5
Definition: AliAnaPhoton.h:178
TH2F * fhPhiPhoton
! Azimuthal angle of identified photon vs transerse momentum
Definition: AliAnaPhoton.h:176
virtual Double_t GetEventPlaneAngle() const
TH2F * fhYPrimMC[fgkNmcPrimTypes]
! Rapidity of generated photon
Definition: AliAnaPhoton.h:249
TH2F * fhTrackMatchedDEtaDPhi[2]
! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV, after and before ...
Definition: AliAnaPhoton.h:303
void FillAcceptanceHistograms()
TH2F * fhSumEtaE
! shower dispersion in eta direction
Definition: AliAnaPhoton.h:223
virtual Bool_t IsTrackMatched(AliVCluster *cluster, AliVEvent *event)
TH2F * fhMCEDispEtaPhiDiff[fgkNssTypes]
! shower dispersion in eta -phi direction
Definition: AliAnaPhoton.h:280
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
Int_t GetHistoPhiBins() const
TH2F * fhEtaLam0LowE
! Cluster eta vs lambda0, E<2
Definition: AliAnaPhoton.h:210
TH2F * fhPtPhotonNPileUpSPDVtxTimeCut
! photon pt vs number of spd pile-up vertices, time cut +-25 ns
Definition: AliAnaPhoton.h:339
Bool_t fFillSSHistograms
Fill shower shape histograms.
Definition: AliAnaPhoton.h:152
TH2F * fhdEdx[2]
! Matched track dEdx vs cluster E, after and before photon cuts
Definition: AliAnaPhoton.h:324
TH2F * fhLam0ETRD
! Cluster lambda0 vs E, SM covered by TRD
Definition: AliAnaPhoton.h:192
TH2F * fhDispETM
! Cluster dispersion vs E, cut on Track Matching residual
Definition: AliAnaPhoton.h:195
TH2F * fhEmbedPhotonELambda0FullSignal
! Lambda0 vs E for embedded photons with more than 90% of the cluster energy
Definition: AliAnaPhoton.h:289
Float_t GetHistoTrackResidualPhiMin() const
TH2F * fhEtaPhoton
! Pseudorapidity of identified photon vs transerse momentum
Definition: AliAnaPhoton.h:177
TH2F * fhDispSumEtaDiffE
! difference of 2 eta dispersions
Definition: AliAnaPhoton.h:228
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:333
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:282
Float_t GetHistoTrackResidualEtaMin() const
Int_t GetHistoNClusterCellBins() const
virtual TClonesArray * GetOutputAODBranch() const
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:168
TH1F * fhPtPrimMC[fgkNmcPrimTypes]
! Number of generated photon vs pT
Definition: AliAnaPhoton.h:247
Bool_t IsMCParticleInCalorimeterAcceptance(Int_t calo, TParticle *particle)
Float_t GetHistoPhiMin() const
TH2F * fhTimePt
! Time of photon cluster vs pt
Definition: AliAnaPhoton.h:171
TH2F * fhEtaPhi
! Pseudorapidity vs Phi of clusters for E > 0.5
Definition: AliAnaPhoton.h:172
TH2F * fhMCLambda0DispPhi[7][fgkNssTypes]
! shower shape correlation l0 vs disp phi
Definition: AliAnaPhoton.h:284
TH2F * fhEPhotonSM
! photon-like cluster E distribution per SM
Definition: AliAnaPhoton.h:345
TH2F * fhEOverPTRD[2]
! Matched track E cluster over P track vs cluster E, after dEdx cut, after and before photon cuts...
Definition: AliAnaPhoton.h:326
TString GetPIDParametersList()
Put data member values in string to keep in output container.
Definition: AliCaloPID.cxx:890
TH2F * fhMCELambda0[fgkNssTypes]
! E vs Lambda0 from MC particle
Definition: AliAnaPhoton.h:260
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:310
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:261
TH2F * fhLambda0DispPhi[7]
! shower shape correlation l0 vs disp phi
Definition: AliAnaPhoton.h:232
TH2F * fhLambda0DispEta[7]
! shower shape correlation l0 vs disp eta
Definition: AliAnaPhoton.h:231
Base class for CaloTrackCorr analysis algorithms.
virtual TString GetCalorimeterString() const
Int_t fNOriginHistograms
Fill only NOriginHistograms of the 14 defined types.
Definition: AliAnaPhoton.h:156
static const Int_t fgkNmcPrimTypes
Total number of MC primary histograms.
Definition: AliAnaPhoton.h:125
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:332
TH2F * fhPtPhotonNPileUpSPDVtxTimeCut2
! photon pt vs number of spd pile-up vertices, time cut +-75 ns
Definition: AliAnaPhoton.h:341
TH2F * fhEOverP[2]
! Matched track E cluster over P track vs cluster E, after dEdx cut, after and before photon cuts ...
Definition: AliAnaPhoton.h:325
TH2F * fhTrackMatchedDEta[2]
! Eta distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:301
TH1F * fhEPrimMC[fgkNmcPrimTypes]
! Number of generated photon vs energy
Definition: AliAnaPhoton.h:246
virtual TClonesArray * GetAODMCParticles() const
virtual AliHistogramRanges * GetHistogramRanges()
TH2F * fhCellsE
! energy of cells in cluster vs E of cluster
Definition: AliAnaPhoton.h:169
Bool_t ReadStack() const
TH2F * fhDispETMTRD
! Cluster dispersion vs E, SM covered by TRD, cut on Track Matching residual
Definition: AliAnaPhoton.h:199
Int_t GetMaxEnergyCell(AliVCaloCells *cells, const AliVCluster *clu, Float_t &fraction) const
For a given CaloCluster, it gets the absId of the cell with maximum energy deposit.
TH2F * fhPhiPrimMC[fgkNmcPrimTypes]
! Phi of generted photon
Definition: AliAnaPhoton.h:248
TH2F * fhLam1ETM
! Cluster lambda1 vs E, cut on Track Matching residual
Definition: AliAnaPhoton.h:197
Float_t GetHistoTrackResidualPhiMax() const
Filter EMCal/PHOS clusters for photon analysis.
Definition: AliAnaPhoton.h:32
TH2F * fhEtaPhi05Photon
! Pseudorapidity vs Phi of identified photon for E < 0.5
Definition: AliAnaPhoton.h:179
virtual AliEMCALGeometry * GetEMCALGeometry() const
TH2F * fhDispSumPhiDiffE
! difference of 2 phi dispersions
Definition: AliAnaPhoton.h:229
TH2F * fhNCellsLam0HighE
! number of cells in cluster vs lambda0, E>2
Definition: AliAnaPhoton.h:206
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:283
Int_t GetHistodEdxBins() const
TH2F * fhMCNCellsvsClusterMaxCellDiffE6[fgkNssTypes]
! NCells vs fraction of energy of max cell for E > 6
Definition: AliAnaPhoton.h:273
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:138
Int_t GetHistoTrackResidualPhiBins() const
TH2F * fhMCPhotonELambda0TwoOverlap
! E vs Lambda0 from MC photons, 2 particles overlap
Definition: AliAnaPhoton.h:265
virtual Bool_t IsHighMultiplicityAnalysisOn() const
TH2F * fhMCPhotonELambda0NOverlap
! E vs Lambda0 from MC photons, N particles overlap
Definition: AliAnaPhoton.h:266
TH1F * fhClusterCutsPt[10]
! control histogram on the different photon selection cuts, pT
Definition: AliAnaPhoton.h:167
Float_t fMinDist
Minimal distance to bad channel to accept cluster.
Definition: AliAnaPhoton.h:136
TH2F * fhTrackMatchedMCParticle[2]
! Trace origin of matched particle
Definition: AliAnaPhoton.h:323
TH2F * fhMCMaxCellDiffClusterE[fgkNssTypes]
! Fraction of energy carried by cell with maximum energy
Definition: AliAnaPhoton.h:275
TH2F * fhMC2E[fgkNmcTypes]
! E distribution, Reco vs MC coming from MC particle
Definition: AliAnaPhoton.h:238
TH2F * fhEmbedPhotonELambda0MostlySignal
! Lambda0 vs E for embedded photons with 90%<fraction<50%
Definition: AliAnaPhoton.h:290
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:157
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:272
TH2F * fhNCellsDispHighE
! number of cells in cluster vs dispersion, E>2
Definition: AliAnaPhoton.h:208
TH2F * fhEmbeddedSignalFractionEnergy
! Fraction of photon energy of embedded signal vs cluster energy
Definition: AliAnaPhoton.h:287
virtual TObjArray * GetPHOSClusters() const
Float_t GetHistoEtaMin() const
TH1F * fhEPhoton
! Number of identified photon vs energy
Definition: AliAnaPhoton.h:174
TH2F * fhTrackMatchedDEtaMCConversion[2]
! Eta distance between track and cluster vs cluster E, originated in conversion, after and before pho...
Definition: AliAnaPhoton.h:320
TH2F * fhLam0ETMTRD
! Cluster lambda0 vs E, SM covered by TRD, cut on Track Matching residual
Definition: AliAnaPhoton.h:200
TH2F * fhLam0DispLowE
! Cluster lambda0 vs dispersion, E<2
Definition: AliAnaPhoton.h:214
virtual Int_t GetModuleNumber(AliAODPWG4Particle *part) const
Double_t fTimeCutMax
Remove clusters/cells with time larger than this value, in ns.
Definition: AliAnaPhoton.h:145
TH2F * fhTrackMatchedDPhiMCConversion[2]
! Phi distance between track and cluster vs cluster E, originated in conversion, after and before pho...
Definition: AliAnaPhoton.h:321
TH1F * fhMCE[fgkNmcTypes]
! Number of identified photon vs cluster energy coming from MC particle
Definition: AliAnaPhoton.h:241
TH2F * fhDispLam1LowE
! Cluster disp vs lambda1, E<2
Definition: AliAnaPhoton.h:218
TH2F * fhMCEDispEta[fgkNssTypes]
! shower dispersion in eta direction
Definition: AliAnaPhoton.h:277
Float_t GetHistoEtaMax() const
TH1F * fhPtPrimMCAcc[fgkNmcPrimTypes]
! Number of generated photon vs pT, in calorimeter acceptance
Definition: AliAnaPhoton.h:253
virtual void AddAODParticle(AliAODPWG4Particle part)
Float_t GetPHOSPtMin() const
TH2F * fhLam0E
! Cluster lambda0 vs E
Definition: AliAnaPhoton.h:188
Int_t GetHistoPtBins() const
Double_t fTimeCutMin
Remove clusters/cells with time smaller than this value, in ns.
Definition: AliAnaPhoton.h:144
static const Int_t fgkNssTypes
Total number of MC histograms for shower shape studies.
Definition: AliAnaPhoton.h:132
Float_t GetEMCALPtMin() const
TH2F * fhMCDeltaE[fgkNmcTypes]
! MC-Reco E distribution coming from MC particle
Definition: AliAnaPhoton.h:236
TH2F * fhTrackMatchedDEtaNeg[2]
! Eta distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:309
TH2F * fhSumPhiE
! shower dispersion in phi direction
Definition: AliAnaPhoton.h:224
TH2F * fhEmbedPhotonELambda0FullBkg
! Lambda0 vs E for embedded photons with less than 10% of the cluster energy
Definition: AliAnaPhoton.h:292
TH2F * fhLam0ETM
! Cluster lambda0 vs E, cut on Track Matching residual
Definition: AliAnaPhoton.h:196
TH2F * fhMCEDispersion[fgkNssTypes]
! E vs Dispersion from MC particle
Definition: AliAnaPhoton.h:262
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:212
AliVTrack * GetMatchedTrack(AliVCluster *cluster, AliVEvent *event, Int_t index=-1) const
TH2F * fhLam1E
! Cluster lambda1 vs E
Definition: AliAnaPhoton.h:189
TH2F * fhPtPhotonNPileUpTrkVtxTimeCut2
! photon pt vs number of track pile-up vertices, time cut +- 75 ns
Definition: AliAnaPhoton.h:342
TH2F * fhDispEtaPhiDiffE
! shower dispersion eta - phi
Definition: AliAnaPhoton.h:226
TH2F * fhMCDeltaPt[fgkNmcTypes]
! MC-Reco pT distribution coming from MC particle
Definition: AliAnaPhoton.h:237
TH2F * fhDispPhiE
! shower dispersion in phi direction
Definition: AliAnaPhoton.h:222
TH2F * fhMCLambda0vsClusterMaxCellDiffE0[fgkNssTypes]
! Lambda0 vs fraction of energy of max cell for E < 2 GeV
Definition: AliAnaPhoton.h:268
Float_t GetHistoPOverEMax() const
TH2F * fhYPrimMCAcc[fgkNmcPrimTypes]
! Rapidity of generated photon, in calorimeter acceptance
Definition: AliAnaPhoton.h:256
TH2F * fhPhiPrimMCAcc[fgkNmcPrimTypes]
! Phi of generted photon, in calorimeter acceptance
Definition: AliAnaPhoton.h:254
TH2F * fhNCellsLam0LowE
! number of cells in cluster vs lambda0
Definition: AliAnaPhoton.h:203
TH2F * fhMCPhotonELambda0NoOverlap
! E vs Lambda0 from MC photons, no overlap
Definition: AliAnaPhoton.h:264
virtual AliMCAnalysisUtils * GetMCAnalysisUtils()
TH2F * fhSumEtaPhiE
! shower dispersion in eta and phi direction
Definition: AliAnaPhoton.h:225
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:243
TH2F * fhClusterTimeDiffPhotonPileUp[7]
! E vs Time difference inside cluster for selected photons
Definition: AliAnaPhoton.h:331
TLorentzVector fPrimaryMom
! Primary MC momentum
Definition: AliAnaPhoton.h:160
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:252
TH2F * fhTrackMatchedDEtaMCOverlap[2]
! Eta distance between track and cluster vs cluster E, several particle overlap, after and before pho...
Definition: AliAnaPhoton.h:316
TH2F * fhTimeNPileUpVertTrack
! Time of cluster vs n pile-up vertices from Tracks
Definition: AliAnaPhoton.h:335
Float_t GetHistoTimeMax() const
virtual Int_t GetDataType() const
Float_t GetHistoTimeMin() const
Float_t GetHistoShowerShapeMax() const
Bool_t IsPileUpFromEMCal() const
Check if event is from pile-up determined by EMCal.
void FillTrackMatchingResidualHistograms(AliVCluster *calo, Int_t cut)
TH2F * fhTrackMatchedDPhi[2]
! Phi distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:302
TH2F * fhDispLam1HighE
! Cluster disp vs lambda1, E>2
Definition: AliAnaPhoton.h:219
TH2F * fhPtCentralityPhoton
! centrality vs photon pT
Definition: AliAnaPhoton.h:181
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:317
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:270
TH2F * fhTrackMatchedDPhiPos[2]
! Phi distance between track and cluster vs cluster E, after and before photon cuts ...
Definition: AliAnaPhoton.h:306
Float_t GetHistoTrackResidualEtaMax() const
TLorentzVector fMomentum
! Cluster momentum
Definition: AliAnaPhoton.h:159
TH2F * fhLam0DispHighE
! Cluster lambda0 vs dispersion, E>2
Definition: AliAnaPhoton.h:215
virtual TObjArray * GetEMCALClusters() const
TH2F * fhMCESumEtaPhi[fgkNssTypes]
! shower dispersion in eta vs phi direction
Definition: AliAnaPhoton.h:279
TH2F * fhTrackMatchedDEtaMCNoOverlap[2]
! Eta distance between track and cluster vs cluster E, not other particle overlap, after and before photon cuts
Definition: AliAnaPhoton.h:318
virtual AliVCaloCells * GetPHOSCells() const
TH2F * fhTimeNPileUpVertSPD
! Time of cluster vs n pile-up vertices from SPD
Definition: AliAnaPhoton.h:334
TH2F * fhEtaPrimMCAcc[fgkNmcPrimTypes]
! Phi of generted photon, in calorimeter acceptance
Definition: AliAnaPhoton.h:255
TH2F * fhNLocMax
! number of maxima in selected clusters
Definition: AliAnaPhoton.h:185
static const Int_t fgkNmcTypes
Total number of cluster MC origin histograms.
Definition: AliAnaPhoton.h:118
TH2F * fhEmbedPi0ELambda0MostlySignal
! Lambda0 vs E for embedded photons with 90%<fraction<50%
Definition: AliAnaPhoton.h:295
Bool_t CheckTagBit(Int_t tag, UInt_t test) const
TH2F * fhPhiLam0HighE
! Cluster phi vs lambda0, E>2
Definition: AliAnaPhoton.h:213
TH2F * fhMCEDispPhi[fgkNssTypes]
! shower dispersion in phi direction
Definition: AliAnaPhoton.h:278
virtual AliMixedEvent * GetMixedEvent() const
TH2F * fhEmbedPhotonELambda0MostlyBkg
! Lambda0 vs E for embedded photons with 50%<fraction<10%
Definition: AliAnaPhoton.h:291
TObjString * GetAnalysisCuts()
Save parameters used for analysis in a string.
TH2F * fhLam1Lam0LowE
! Cluster lambda1 vs lambda0, E<2
Definition: AliAnaPhoton.h:216
TH2F * fhMCNCellsvsClusterMaxCellDiffE0[fgkNssTypes]
! NCells vs fraction of energy of max cell for E < 2
Definition: AliAnaPhoton.h:271
Bool_t IsPileUpFromSPDAndEMCal() const
Check if event is from pile-up determined by SPD and EMCal.
TH2F * fhMCLambda0vsClusterMaxCellDiffE2[fgkNssTypes]
! Lambda0 vs fraction of energy of max cell for 2< E < 6 GeV
Definition: AliAnaPhoton.h:269