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