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