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