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