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