]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/CaloTrackCorrelations/AliAnaPhoton.cxx
updated for systematic study
[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>
2244659d 30#include <TH3D.h>
477d6cee 31#include <TClonesArray.h>
0c1383b5 32#include <TObjString.h>
123fc3bd 33#include "TParticle.h"
6175da48 34#include "TDatabasePDG.h"
1c5acb87 35
85c4406e 36// --- Analysis system ---
37#include "AliAnaPhoton.h"
1c5acb87 38#include "AliCaloTrackReader.h"
123fc3bd 39#include "AliStack.h"
1c5acb87 40#include "AliCaloPID.h"
6639984f 41#include "AliMCAnalysisUtils.h"
ff45398a 42#include "AliFiducialCut.h"
0ae57829 43#include "AliVCluster.h"
591cc579 44#include "AliAODMCParticle.h"
c8fe2783 45#include "AliMixedEvent.h"
fc195fd0 46#include "AliAODEvent.h"
2ad19c3d 47#include "AliESDEvent.h"
c8fe2783 48
85c4406e 49// --- Detectors ---
c5693f62 50#include "AliPHOSGeoUtils.h"
51#include "AliEMCALGeometry.h"
1c5acb87 52
53ClassImp(AliAnaPhoton)
521636d2 54
85c4406e 55//____________________________
56AliAnaPhoton::AliAnaPhoton() :
57AliAnaCaloTrackCorrBaseClass(), fCalorimeter(""),
58fMinDist(0.), fMinDist2(0.), fMinDist3(0.),
59fRejectTrackMatch(0), fFillTMHisto(kFALSE),
60fTimeCutMin(-10000), fTimeCutMax(10000),
61fNCellsCut(0),
62fNLMCutMin(-1), fNLMCutMax(10),
63fFillSSHistograms(kFALSE), fFillOnlySimpleSSHisto(1),
64fNOriginHistograms(8), fNPrimaryHistograms(4),
65fFillPileUpHistograms(0), fFillEMCALBCHistograms(0),
66// Histograms
67fhNCellsE(0), fhCellsE(0), // Control histograms
b2e375c7 68fhMaxCellDiffClusterE(0), fhTimePt(0), // Control histograms
85c4406e 69fhEtaPhi(0), fhEtaPhiEMCALBC0(0),
70fhEtaPhiEMCALBC1(0), fhEtaPhiEMCALBCN(0),
126b8c62 71fhTimeTriggerEMCALBCCluster(0),
72fhTimeTriggerEMCALBCUMCluster(0),
85c4406e 73fhEtaPhiTriggerEMCALBCClusterOverTh(0),
74fhEtaPhiTriggerEMCALBCUMClusterOverTh(0),
75fhEtaPhiTriggerEMCALBCClusterBelowTh1(0),
76fhEtaPhiTriggerEMCALBCUMClusterBelowTh1(0),
77fhEtaPhiTriggerEMCALBCClusterBelowTh2(0),
78fhEtaPhiTriggerEMCALBCUMClusterBelowTh2(0),
79fhEtaPhiTriggerEMCALBCExotic(0), fhTimeTriggerEMCALBCExotic(0),
80fhEtaPhiTriggerEMCALBCUMExotic(0), fhTimeTriggerEMCALBCUMExotic(0),
81fhEtaPhiTriggerEMCALBCBad(0), fhTimeTriggerEMCALBCBad(0),
82fhEtaPhiTriggerEMCALBCUMBad(0), fhTimeTriggerEMCALBCUMBad(0),
83fhEtaPhiTriggerEMCALBCBadExotic(0), fhTimeTriggerEMCALBCBadExotic(0),
84fhEtaPhiTriggerEMCALBCUMBadExotic(0), fhTimeTriggerEMCALBCUMBadExotic(0),
85fhEtaPhiTriggerEMCALBCExoticCluster(0), fhTimeTriggerEMCALBCExoticCluster(0),
86fhEtaPhiTriggerEMCALBCUMExoticCluster(0), fhTimeTriggerEMCALBCUMExoticCluster(0),
87fhEtaPhiTriggerEMCALBCBadCluster(0), fhTimeTriggerEMCALBCBadCluster(0),
88fhEtaPhiTriggerEMCALBCUMBadCluster(0), fhTimeTriggerEMCALBCUMBadCluster(0),
89fhEtaPhiTriggerEMCALBCBadExoticCluster(0), fhTimeTriggerEMCALBCBadExoticCluster(0),
90fhEtaPhiTriggerEMCALBCUMBadExoticCluster(0), fhTimeTriggerEMCALBCUMBadExoticCluster(0),
91fhTimeTriggerEMCALBCBadMaxCell(0), fhTimeTriggerEMCALBCUMBadMaxCell(0),
92fhTimeTriggerEMCALBCBadMaxCellExotic(0), fhTimeTriggerEMCALBCUMBadMaxCellExotic(0),
126b8c62 93fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster (0), fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster(0),
94fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster(0),fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster(0),
95fhEtaPhiTriggerEMCALBCUMReMatchBothCluster(0), fhTimeTriggerEMCALBCUMReMatchBothCluster(0),
96fhTimeTriggerEMCALBC0UMReMatchOpenTime(0),
97fhTimeTriggerEMCALBC0UMReMatchCheckNeigh(0),
98fhTimeTriggerEMCALBC0UMReMatchBoth(0),
99
85c4406e 100fhEtaPhiNoTrigger(0), fhTimeNoTrigger(0),
101
102fhEPhoton(0), fhPtPhoton(0),
103fhPhiPhoton(0), fhEtaPhoton(0),
104fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
105fhEtaPhiPhotonEMCALBC0(0), fhEtaPhiPhotonEMCALBC1(0), fhEtaPhiPhotonEMCALBCN(0),
126b8c62 106fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime(0),
107fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh(0),
108fhTimePhotonTriggerEMCALBC0UMReMatchBoth(0),
109
85c4406e 110fhPtCentralityPhoton(0), fhPtEventPlanePhoton(0),
111
112// Shower shape histograms
113fhNLocMax(0),
114fhDispE(0), fhLam0E(0), fhLam1E(0),
115fhDispETRD(0), fhLam0ETRD(0), fhLam1ETRD(0),
116fhDispETM(0), fhLam0ETM(0), fhLam1ETM(0),
117fhDispETMTRD(0), fhLam0ETMTRD(0), fhLam1ETMTRD(0),
118
119fhNCellsLam0LowE(0), fhNCellsLam1LowE(0), fhNCellsDispLowE(0),
120fhNCellsLam0HighE(0), fhNCellsLam1HighE(0), fhNCellsDispHighE(0),
121
122fhEtaLam0LowE(0), fhPhiLam0LowE(0),
123fhEtaLam0HighE(0), fhPhiLam0HighE(0),
124fhLam0DispLowE(0), fhLam0DispHighE(0),
125fhLam1Lam0LowE(0), fhLam1Lam0HighE(0),
126fhDispLam1LowE(0), fhDispLam1HighE(0),
127fhDispEtaE(0), fhDispPhiE(0),
128fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
129fhDispEtaPhiDiffE(0), fhSphericityE(0),
130fhDispSumEtaDiffE(0), fhDispSumPhiDiffE(0),
131
132// MC histograms
133fhMCPhotonELambda0NoOverlap(0), fhMCPhotonELambda0TwoOverlap(0), fhMCPhotonELambda0NOverlap(0),
134// Embedding
135fhEmbeddedSignalFractionEnergy(0),
136fhEmbedPhotonELambda0FullSignal(0), fhEmbedPhotonELambda0MostlySignal(0),
137fhEmbedPhotonELambda0MostlyBkg(0), fhEmbedPhotonELambda0FullBkg(0),
138fhEmbedPi0ELambda0FullSignal(0), fhEmbedPi0ELambda0MostlySignal(0),
139fhEmbedPi0ELambda0MostlyBkg(0), fhEmbedPi0ELambda0FullBkg(0),
140// PileUp
b2e375c7 141fhTimePtNoCut(0), fhTimePtSPD(0),
142fhTimePtPhotonNoCut(0), fhTimePtPhotonSPD(0),
85c4406e 143fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
144fhTimeNPileUpVertContributors(0),
145fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0),
146fhClusterMultSPDPileUp(), fhClusterMultNoPileUp(),
147fhEtaPhiBC0(0), fhEtaPhiBCPlus(0), fhEtaPhiBCMinus(0),
148fhEtaPhiBC0PileUpSPD(0),
149fhEtaPhiBCPlusPileUpSPD(0), fhEtaPhiBCMinusPileUpSPD(0),
150fhPtNPileUpSPDVtx(0), fhPtNPileUpTrkVtx(0),
151fhPtNPileUpSPDVtxTimeCut(0), fhPtNPileUpTrkVtxTimeCut(0),
152fhPtNPileUpSPDVtxTimeCut2(0), fhPtNPileUpTrkVtxTimeCut2(0),
153fhPtPhotonNPileUpSPDVtx(0), fhPtPhotonNPileUpTrkVtx(0),
154fhPtPhotonNPileUpSPDVtxTimeCut(0), fhPtPhotonNPileUpTrkVtxTimeCut(0),
155fhPtPhotonNPileUpSPDVtxTimeCut2(0), fhPtPhotonNPileUpTrkVtxTimeCut2(0)
156{
1c5acb87 157 //default ctor
158
4bfeae64 159 for(Int_t i = 0; i < 14; i++)
160 {
4c8f7c2e 161 fhMCPt [i] = 0;
162 fhMCE [i] = 0;
163 fhMCPhi [i] = 0;
164 fhMCEta [i] = 0;
85c4406e 165 fhMCDeltaE [i] = 0;
4c8f7c2e 166 fhMCDeltaPt[i] = 0;
85c4406e 167 fhMC2E [i] = 0;
4c8f7c2e 168 fhMC2Pt [i] = 0;
521636d2 169 }
170
4bfeae64 171 for(Int_t i = 0; i < 7; i++)
172 {
3d5d5078 173 fhPtPrimMC [i] = 0;
174 fhEPrimMC [i] = 0;
175 fhPhiPrimMC[i] = 0;
4cf13296 176 fhEtaPrimMC[i] = 0;
3d5d5078 177 fhYPrimMC [i] = 0;
178
179 fhPtPrimMCAcc [i] = 0;
180 fhEPrimMCAcc [i] = 0;
181 fhPhiPrimMCAcc[i] = 0;
4cf13296 182 fhEtaPrimMCAcc[i] = 0;
3d5d5078 183 fhYPrimMCAcc [i] = 0;
d2655d46 184
185 fhDispEtaDispPhi[i] = 0;
186 fhLambda0DispPhi[i] = 0;
187 fhLambda0DispEta[i] = 0;
5e5e056f 188
fad96885 189 fhPtPileUp [i] = 0;
190 fhPtChargedPileUp[i] = 0;
191 fhPtPhotonPileUp [i] = 0;
85c4406e 192
fad96885 193 fhLambda0PileUp [i] = 0;
194 fhLambda0ChargedPileUp[i] = 0;
5e5e056f 195
650d1938 196 fhClusterEFracLongTimePileUp [i] = 0;
197
126b8c62 198 fhClusterCellTimePileUp [i] = 0;
fad96885 199 fhClusterTimeDiffPileUp [i] = 0;
200 fhClusterTimeDiffChargedPileUp[i] = 0;
201 fhClusterTimeDiffPhotonPileUp [i] = 0;
85c4406e 202
d2655d46 203 for(Int_t j = 0; j < 6; j++)
204 {
205 fhMCDispEtaDispPhi[i][j] = 0;
206 fhMCLambda0DispEta[i][j] = 0;
207 fhMCLambda0DispPhi[i][j] = 0;
208 }
85c4406e 209 }
3d5d5078 210
4bfeae64 211 for(Int_t i = 0; i < 6; i++)
212 {
f66d95af 213 fhMCELambda0 [i] = 0;
214 fhMCELambda1 [i] = 0;
215 fhMCEDispersion [i] = 0;
85c4406e 216 fhMCNCellsE [i] = 0;
217 fhMCMaxCellDiffClusterE[i] = 0;
bfdcf7fb 218 fhLambda0DispEta[i] = 0;
219 fhLambda0DispPhi[i] = 0;
85c4406e 220
f66d95af 221 fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
222 fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
223 fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
224 fhMCNCellsvsClusterMaxCellDiffE0 [i] = 0;
225 fhMCNCellsvsClusterMaxCellDiffE2 [i] = 0;
226 fhMCNCellsvsClusterMaxCellDiffE6 [i] = 0;
34c16486 227
228 fhMCEDispEta [i] = 0;
229 fhMCEDispPhi [i] = 0;
230 fhMCESumEtaPhi [i] = 0;
231 fhMCEDispEtaPhiDiff[i] = 0;
232 fhMCESphericity [i] = 0;
521636d2 233 }
234
85c4406e 235 for(Int_t i = 0; i < 5; i++)
236 {
237 fhClusterCuts[i] = 0;
238 }
239
240 // Track matching residuals
241 for(Int_t i = 0; i < 2; i++)
242 {
126b8c62 243 fhTrackMatchedDEta [i] = 0; fhTrackMatchedDPhi [i] = 0; fhTrackMatchedDEtaDPhi [i] = 0;
244 fhTrackMatchedDEtaNeg[i] = 0; fhTrackMatchedDPhiNeg[i] = 0; fhTrackMatchedDEtaDPhiNeg[i] = 0;
245 fhTrackMatchedDEtaPos[i] = 0; fhTrackMatchedDPhiPos[i] = 0; fhTrackMatchedDEtaDPhiPos[i] = 0;
85c4406e 246 fhTrackMatchedDEtaTRD[i] = 0; fhTrackMatchedDPhiTRD[i] = 0;
247 fhTrackMatchedDEtaMCOverlap[i] = 0; fhTrackMatchedDPhiMCOverlap[i] = 0;
248 fhTrackMatchedDEtaMCNoOverlap[i] = 0; fhTrackMatchedDPhiMCNoOverlap[i] = 0;
249 fhTrackMatchedDEtaMCConversion[i] = 0; fhTrackMatchedDPhiMCConversion[i] = 0;
250 fhTrackMatchedMCParticle[i] = 0; fhTrackMatchedMCParticle[i] = 0;
251 fhdEdx[i] = 0; fhEOverP[i] = 0;
252 fhEOverPTRD[i] = 0;
253 }
254
255 for(Int_t i = 0; i < 4; i++)
256 {
257 fhClusterMultSPDPileUp[i] = 0;
258 fhClusterMultNoPileUp [i] = 0;
259 }
260
261 for(Int_t i = 0; i < 11; i++)
262 {
263 fhEtaPhiTriggerEMCALBC [i] = 0 ;
264 fhTimeTriggerEMCALBC [i] = 0 ;
265 fhEtaPhiTriggerEMCALBCUM [i] = 0 ;
266 fhTimeTriggerEMCALBCUM [i] = 0 ;
267
268 fhEtaPhiPhotonTriggerEMCALBC [i] = 0 ;
269 fhTimePhotonTriggerEMCALBC [i] = 0 ;
270 fhEtaPhiPhotonTriggerEMCALBCUM [i] = 0 ;
271 fhTimePhotonTriggerEMCALBCUM [i] = 0 ;
272
273 fhTimePhotonTriggerEMCALBCPileUpSPD[i] = 0 ;
274 fhTimeTriggerEMCALBCPileUpSPD [i] = 0 ;
275
276 fhEtaPhiTriggerEMCALBCCluster [i] = 0 ;
126b8c62 277 fhEtaPhiTriggerEMCALBCUMCluster [i] = 0 ;
85c4406e 278 }
279
1c5acb87 280 //Initialize parameters
281 InitParameters();
85c4406e 282
1c5acb87 283}
284
b2e375c7 285//_________________________________________________________________________________________
85c4406e 286Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int_t nMaxima)
c4a7d28a 287{
288 //Select clusters if they pass different cuts
fad96885 289
c2a62a94 290 Float_t ptcluster = mom.Pt();
291 Float_t ecluster = mom.E();
292 Float_t l0cluster = calo->GetM02();
293 Float_t etacluster = mom.Eta();
294 Float_t phicluster = mom.Phi();
295 if(phicluster<0) phicluster+=TMath::TwoPi();
296 Float_t tofcluster = calo->GetTOF()*1.e9;
c2a62a94 297
b2e375c7 298 Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
fad96885 299
300 if(GetDebug() > 2)
afb3af8a 301 printf("AliAnaPhoton::ClusterSelected() - Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
c4a7d28a 302 GetReader()->GetEventNumber(),
c2a62a94 303 ecluster,ptcluster, phicluster*TMath::RadToDeg(),etacluster);
fad96885 304
305 fhClusterCuts[1]->Fill(ecluster);
c4a7d28a 306
c2a62a94 307 if(ecluster > 0.5) fhEtaPhi->Fill(etacluster, phicluster);
308
b2e375c7 309 FillEMCALTriggerClusterBCHistograms(calo->GetID(),ecluster,tofcluster,etacluster,phicluster);
c2a62a94 310
c4a7d28a 311 //.......................................
312 //If too small or big energy, skip it
afb3af8a 313 if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ;
09273901 314
c4a7d28a 315 if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
09273901 316
fad96885 317 fhClusterCuts[2]->Fill(ecluster);
85c4406e 318
126b8c62 319 FillClusterPileUpHistograms(calo,matched,ptcluster,etacluster,phicluster,l0cluster);
fad96885 320
c4a7d28a 321 //.......................................
322 // TOF cut, BE CAREFUL WITH THIS CUT
323 Double_t tof = calo->GetTOF()*1e9;
324 if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
09273901 325
c4a7d28a 326 if(GetDebug() > 2) printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
09273901 327
fad96885 328 fhClusterCuts[3]->Fill(ecluster);
85c4406e 329
c4a7d28a 330 //.......................................
331 if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
09273901 332
c4a7d28a 333 if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
09273901 334
fad96885 335 fhClusterCuts[4]->Fill(ecluster);
85c4406e 336
9e51e29a 337 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
338 if(GetDebug() > 2) printf(" \t Cluster %d pass NLM %d of out of range \n",calo->GetID(), nMaxima);
85c4406e 339
fad96885 340 fhClusterCuts[5]->Fill(ecluster);
85c4406e 341
c4a7d28a 342 //.......................................
343 //Check acceptance selection
34c16486 344 if(IsFiducialCutOn())
345 {
c4a7d28a 346 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
347 if(! in ) return kFALSE ;
348 }
09273901 349
c4a7d28a 350 if(GetDebug() > 2) printf("Fiducial cut passed \n");
09273901 351
fad96885 352 fhClusterCuts[6]->Fill(ecluster);
85c4406e 353
c4a7d28a 354 //.......................................
355 //Skip matched clusters with tracks
09273901 356
4bfeae64 357 // Fill matching residual histograms before PID cuts
358 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,0);
09273901 359
34c16486 360 if(fRejectTrackMatch)
361 {
b2e375c7 362 if(matched)
34c16486 363 {
c4a7d28a 364 if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
365 return kFALSE ;
366 }
85c4406e 367 else
c4a7d28a 368 if(GetDebug() > 2) printf(" Track-matching cut passed \n");
369 }// reject matched clusters
09273901 370
fad96885 371 fhClusterCuts[7]->Fill(ecluster);
85c4406e 372
fad96885 373 if(fFillPileUpHistograms)
374 {
375 if(GetReader()->IsPileUpFromSPD()) {fhPtChargedPileUp[0]->Fill(ptcluster); fhLambda0ChargedPileUp[0]->Fill(ecluster,l0cluster); }
376 if(GetReader()->IsPileUpFromEMCal()) {fhPtChargedPileUp[1]->Fill(ptcluster); fhLambda0ChargedPileUp[1]->Fill(ecluster,l0cluster); }
377 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtChargedPileUp[2]->Fill(ptcluster); fhLambda0ChargedPileUp[2]->Fill(ecluster,l0cluster); }
378 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtChargedPileUp[3]->Fill(ptcluster); fhLambda0ChargedPileUp[3]->Fill(ecluster,l0cluster); }
379 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtChargedPileUp[4]->Fill(ptcluster); fhLambda0ChargedPileUp[4]->Fill(ecluster,l0cluster); }
380 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtChargedPileUp[5]->Fill(ptcluster); fhLambda0ChargedPileUp[5]->Fill(ecluster,l0cluster); }
381 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtChargedPileUp[6]->Fill(ptcluster); fhLambda0ChargedPileUp[6]->Fill(ecluster,l0cluster); }
382 }
383
c4a7d28a 384 //.......................................
385 //Check Distance to Bad channel, set bit.
386 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
387 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
85c4406e 388 if(distBad < fMinDist)
34c16486 389 {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
c4a7d28a 390 return kFALSE ;
391 }
392 else if(GetDebug() > 2) printf("\t Bad channel cut passed %4.2f > %2.2f \n",distBad, fMinDist);
fc195fd0 393
fad96885 394 fhClusterCuts[8]->Fill(ecluster);
09273901 395
85c4406e 396 if(GetDebug() > 0)
fad96885 397 printf("AliAnaPhoton::ClusterSelected() Current Event %d; After selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
85c4406e 398 GetReader()->GetEventNumber(),
fad96885 399 ecluster, ptcluster,mom.Phi()*TMath::RadToDeg(),mom.Eta());
c4a7d28a 400
401 //All checks passed, cluster selected
402 return kTRUE;
85c4406e 403
c4a7d28a 404}
405
34c16486 406//___________________________________________
407void AliAnaPhoton::FillAcceptanceHistograms()
408{
3d5d5078 409 //Fill acceptance histograms if MC data is available
410
34c16486 411 Double_t photonY = -100 ;
412 Double_t photonE = -1 ;
413 Double_t photonPt = -1 ;
414 Double_t photonPhi = 100 ;
415 Double_t photonEta = -1 ;
85c4406e 416
34c16486 417 Int_t pdg = 0 ;
418 Int_t tag = 0 ;
419 Int_t mcIndex = 0 ;
420 Bool_t inacceptance = kFALSE;
85c4406e 421
34c16486 422 if(GetReader()->ReadStack())
85c4406e 423 {
3d5d5078 424 AliStack * stack = GetMCStack();
34c16486 425 if(stack)
426 {
427 for(Int_t i=0 ; i<stack->GetNtrack(); i++)
428 {
3d5d5078 429 TParticle * prim = stack->Particle(i) ;
34c16486 430 pdg = prim->GetPdgCode();
3d5d5078 431 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
432 // prim->GetName(), prim->GetPdgCode());
433
34c16486 434 if(pdg == 22)
435 {
3d5d5078 436 // Get tag of this particle photon from fragmentation, decay, prompt ...
2644ead9 437 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader());
34c16486 438 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
439 {
3d5d5078 440 //A conversion photon from a hadron, skip this kind of photon
34c16486 441 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
442 // GetMCAnalysisUtils()->PrintMCTag(tag);
3d5d5078 443
444 return;
445 }
446
447 //Get photon kinematics
85c4406e 448 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
3d5d5078 449
34c16486 450 photonY = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
451 photonE = prim->Energy() ;
452 photonPt = prim->Pt() ;
453 photonPhi = TMath::RadToDeg()*prim->Phi() ;
3d5d5078 454 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
34c16486 455 photonEta = prim->Eta() ;
3d5d5078 456
457 //Check if photons hit the Calorimeter
458 TLorentzVector lv;
459 prim->Momentum(lv);
34c16486 460 inacceptance = kFALSE;
461 if (fCalorimeter == "PHOS")
462 {
463 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
464 {
3d5d5078 465 Int_t mod ;
466 Double_t x,z ;
85c4406e 467 if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
3d5d5078 468 inacceptance = kTRUE;
469 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
470 }
34c16486 471 else
472 {
85c4406e 473 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
3d5d5078 474 inacceptance = kTRUE ;
475 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
476 }
85c4406e 477 }
34c16486 478 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
479 {
480 if(GetEMCALGeometry())
481 {
3d5d5078 482 Int_t absID=0;
483
484 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
485
85c4406e 486 if( absID >= 0)
3d5d5078 487 inacceptance = kTRUE;
488
85c4406e 489 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
3d5d5078 490 // inacceptance = kTRUE;
491 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
492 }
34c16486 493 else
494 {
85c4406e 495 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
3d5d5078 496 inacceptance = kTRUE ;
497 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
498 }
499 } //In EMCAL
500
501 //Fill histograms
c5693f62 502 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
3d5d5078 503 if(TMath::Abs(photonY) < 1.0)
504 {
c5693f62 505 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
506 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
507 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
4cf13296 508 fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
3d5d5078 509 }
34c16486 510 if(inacceptance)
511 {
512 fhEPrimMCAcc [kmcPPhoton]->Fill(photonE ) ;
513 fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt) ;
c5693f62 514 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
4cf13296 515 fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta) ;
34c16486 516 fhYPrimMCAcc [kmcPPhoton]->Fill(photonE , photonY) ;
3d5d5078 517 }//Accepted
518
519 //Origin of photon
c5693f62 520 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
3d5d5078 521 {
34c16486 522 mcIndex = kmcPPrompt;
3d5d5078 523 }
c5693f62 524 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
3d5d5078 525 {
34c16486 526 mcIndex = kmcPFragmentation ;
3d5d5078 527 }
c5693f62 528 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
3d5d5078 529 {
34c16486 530 mcIndex = kmcPISR;
3d5d5078 531 }
c5693f62 532 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
3d5d5078 533 {
34c16486 534 mcIndex = kmcPPi0Decay;
3d5d5078 535 }
85c4406e 536 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
c5693f62 537 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
3d5d5078 538 {
34c16486 539 mcIndex = kmcPOtherDecay;
3d5d5078 540 }
c5693f62 541 else if(fhEPrimMC[kmcPOther])
3d5d5078 542 {
34c16486 543 mcIndex = kmcPOther;
3d5d5078 544 }//Other origin
34c16486 545
546 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
547 if(TMath::Abs(photonY) < 1.0)
548 {
549 fhEPrimMC [mcIndex]->Fill(photonE ) ;
550 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
551 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
4cf13296 552 fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta) ;
34c16486 553 }
4cf13296 554
34c16486 555 if(inacceptance)
556 {
557 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
558 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
559 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
4cf13296 560 fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta) ;
34c16486 561 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
562 }//Accepted
563
85c4406e 564 }// Primary photon
565 }//loop on primaries
3d5d5078 566 }//stack exists and data is MC
567 }//read stack
34c16486 568 else if(GetReader()->ReadAODMCParticles())
569 {
2644ead9 570 TClonesArray * mcparticles = GetReader()->GetAODMCParticles();
34c16486 571 if(mcparticles)
572 {
3d5d5078 573 Int_t nprim = mcparticles->GetEntriesFast();
574
575 for(Int_t i=0; i < nprim; i++)
576 {
85c4406e 577 AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
3d5d5078 578
34c16486 579 pdg = prim->GetPdgCode();
3d5d5078 580
34c16486 581 if(pdg == 22)
582 {
3d5d5078 583 // Get tag of this particle photon from fragmentation, decay, prompt ...
2644ead9 584 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader());
34c16486 585 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
586 {
3d5d5078 587 //A conversion photon from a hadron, skip this kind of photon
34c16486 588 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
589 // GetMCAnalysisUtils()->PrintMCTag(tag);
3d5d5078 590
591 return;
592 }
593
594 //Get photon kinematics
85c4406e 595 if(prim->E() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
3d5d5078 596
34c16486 597 photonY = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
598 photonE = prim->E() ;
599 photonPt = prim->Pt() ;
03734799 600 photonPhi = prim->Phi() ;
3d5d5078 601 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
34c16486 602 photonEta = prim->Eta() ;
3d5d5078 603
604 //Check if photons hit the Calorimeter
605 TLorentzVector lv;
606 lv.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E());
34c16486 607 inacceptance = kFALSE;
608 if (fCalorimeter == "PHOS")
609 {
610 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
611 {
3d5d5078 612 Int_t mod ;
613 Double_t x,z ;
614 Double_t vtx[]={prim->Xv(),prim->Yv(),prim->Zv()};
615 if(GetPHOSGeometry()->ImpactOnEmc(vtx, prim->Theta(),prim->Phi(),mod,z,x))
616 inacceptance = kTRUE;
617 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
618 }
34c16486 619 else
620 {
85c4406e 621 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
3d5d5078 622 inacceptance = kTRUE ;
623 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
624 }
85c4406e 625 }
34c16486 626 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
627 {
628 if(GetEMCALGeometry())
629 {
3d5d5078 630 Int_t absID=0;
631
632 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
633
85c4406e 634 if( absID >= 0)
3d5d5078 635 inacceptance = kTRUE;
636
637 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
638 }
34c16486 639 else
640 {
85c4406e 641 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
3d5d5078 642 inacceptance = kTRUE ;
643 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
644 }
645 } //In EMCAL
646
647 //Fill histograms
648
c5693f62 649 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
3d5d5078 650 if(TMath::Abs(photonY) < 1.0)
651 {
c5693f62 652 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
653 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
654 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
4cf13296 655 fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
3d5d5078 656 }
34c16486 657
658 if(inacceptance)
659 {
c5693f62 660 fhEPrimMCAcc[kmcPPhoton] ->Fill(photonE ) ;
661 fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
662 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
4cf13296 663 fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta) ;
c5693f62 664 fhYPrimMCAcc[kmcPPhoton] ->Fill(photonE , photonY) ;
3d5d5078 665 }//Accepted
666
3d5d5078 667 //Origin of photon
c5693f62 668 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
3d5d5078 669 {
34c16486 670 mcIndex = kmcPPrompt;
3d5d5078 671 }
34c16486 672 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
3d5d5078 673 {
34c16486 674 mcIndex = kmcPFragmentation ;
3d5d5078 675 }
c5693f62 676 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
3d5d5078 677 {
34c16486 678 mcIndex = kmcPISR;
3d5d5078 679 }
c5693f62 680 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
3d5d5078 681 {
34c16486 682 mcIndex = kmcPPi0Decay;
3d5d5078 683 }
85c4406e 684 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
34c16486 685 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
3d5d5078 686 {
34c16486 687 mcIndex = kmcPOtherDecay;
3d5d5078 688 }
c5693f62 689 else if(fhEPrimMC[kmcPOther])
3d5d5078 690 {
34c16486 691 mcIndex = kmcPOther;
3d5d5078 692 }//Other origin
34c16486 693
694 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
695 if(TMath::Abs(photonY) < 1.0)
696 {
697 fhEPrimMC [mcIndex]->Fill(photonE ) ;
698 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
699 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
4cf13296 700 fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta) ;
34c16486 701 }
702 if(inacceptance)
703 {
704 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
705 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
706 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
4cf13296 707 fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta) ;
34c16486 708 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
709 }//Accepted
85c4406e 710
711 }// Primary photon
712 }//loop on primaries
3d5d5078 713
c5693f62 714 }//kmc array exists and data is MC
3d5d5078 715 } // read AOD MC
716}
521636d2 717
b2e375c7 718//__________________________________________________________________________________________________________________________
719void AliAnaPhoton::FillEMCALTriggerClusterBCHistograms(const Int_t idcalo, const Float_t ecluster, const Float_t tofcluster,
720 const Float_t etacluster, const Float_t phicluster)
721
722{
723 // Fill trigger related histograms
724
725 if(!fFillEMCALBCHistograms || fCalorimeter!="EMCAL") return ;
726
727 Float_t tofclusterUS = TMath::Abs(tofcluster);
728
729 if(ecluster > 2)
730 {
731 if (tofclusterUS < 25) fhEtaPhiEMCALBC0->Fill(etacluster, phicluster);
732 else if (tofclusterUS < 75) fhEtaPhiEMCALBC1->Fill(etacluster, phicluster);
733 else fhEtaPhiEMCALBCN->Fill(etacluster, phicluster);
734 }
735
736 Int_t bc = GetReader()->GetTriggerClusterBC();
737 Int_t id = GetReader()->GetTriggerClusterId();
738 Bool_t badMax = GetReader()->IsBadMaxCellTriggerEvent();
739
740 if(id==-2)
741 {
742 //printf("AliAnaPhoton::ClusterSelected() - No trigger found bc=%d\n",bc);
743 fhEtaPhiNoTrigger->Fill(etacluster, phicluster);
744 fhTimeNoTrigger ->Fill(ecluster, tofcluster);
745 }
746 else if(TMath::Abs(bc) < 6)
747 {
748 if(!GetReader()->IsBadCellTriggerEvent() && !GetReader()->IsExoticEvent() )
749 {
750 if(GetReader()->IsTriggerMatched())
751 {
752 if(ecluster > 2) fhEtaPhiTriggerEMCALBC[bc+5]->Fill(etacluster, phicluster);
753 fhTimeTriggerEMCALBC[bc+5]->Fill(ecluster, tofcluster);
754 if(GetReader()->IsPileUpFromSPD()) fhTimeTriggerEMCALBCPileUpSPD[bc+5]->Fill(ecluster, tofcluster);
755
756 if(idcalo == GetReader()->GetTriggerClusterId())
757 {
758 fhEtaPhiTriggerEMCALBCCluster[bc+5]->Fill(etacluster, phicluster);
126b8c62 759 fhTimeTriggerEMCALBCCluster ->Fill(ecluster, tofcluster);
b2e375c7 760
761 if(bc==0)
762 {
763 Float_t threshold = GetReader()->GetEventTriggerThreshold() ;
764 if(ecluster > threshold)
765 fhEtaPhiTriggerEMCALBCClusterOverTh->Fill(etacluster, phicluster);
766 else if(ecluster > threshold-1)
767 fhEtaPhiTriggerEMCALBCClusterBelowTh1->Fill(etacluster, phicluster);
768 else
769 fhEtaPhiTriggerEMCALBCClusterBelowTh2->Fill(etacluster, phicluster);
770 }
771 }
772 }
773 else
774 {
775 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUM[bc+5]->Fill(etacluster, phicluster);
776 fhTimeTriggerEMCALBCUM[bc+5]->Fill(ecluster, tofcluster);
777
126b8c62 778 if(bc==0)
779 {
780 if(GetReader()->IsTriggerMatchedOpenCuts(0)) fhTimeTriggerEMCALBC0UMReMatchOpenTime ->Fill(ecluster, tofcluster);
781 if(GetReader()->IsTriggerMatchedOpenCuts(1)) fhTimeTriggerEMCALBC0UMReMatchCheckNeigh ->Fill(ecluster, tofcluster);
782 if(GetReader()->IsTriggerMatchedOpenCuts(2)) fhTimeTriggerEMCALBC0UMReMatchBoth ->Fill(ecluster, tofcluster);
783 }
784
b2e375c7 785 if(idcalo == GetReader()->GetTriggerClusterId())
786 {
787 fhEtaPhiTriggerEMCALBCUMCluster[bc+5]->Fill(etacluster, phicluster);
126b8c62 788 fhTimeTriggerEMCALBCUMCluster->Fill(ecluster, tofcluster);
b2e375c7 789 if(bc==0)
790 {
791 Float_t threshold = GetReader()->GetEventTriggerThreshold() ;
792 if(ecluster > threshold)
793 fhEtaPhiTriggerEMCALBCUMClusterOverTh->Fill(etacluster, phicluster);
794 else if(ecluster > threshold-1)
795 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->Fill(etacluster, phicluster);
796 else
797 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->Fill(etacluster, phicluster);
798
799 if(GetReader()->IsTriggerMatchedOpenCuts(0))
800 {
126b8c62 801 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->Fill(etacluster, phicluster);
802 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster ->Fill(ecluster, tofcluster);
b2e375c7 803 }
804 if(GetReader()->IsTriggerMatchedOpenCuts(1))
805 {
126b8c62 806 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->Fill(etacluster, phicluster);
807 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster ->Fill(ecluster, tofcluster);
b2e375c7 808 }
809 if(GetReader()->IsTriggerMatchedOpenCuts(2))
810 {
126b8c62 811 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->Fill(etacluster, phicluster);
812 fhTimeTriggerEMCALBCUMReMatchBothCluster ->Fill(ecluster, tofcluster);
b2e375c7 813 }
814
815 }
816 }
817 }
818 }// neither bad nor exotic
819 else if(GetReader()->IsBadCellTriggerEvent() && GetReader()->IsExoticEvent())
820 {
821 if(GetReader()->IsTriggerMatched())
822 {
823 if(ecluster > 2) fhEtaPhiTriggerEMCALBCBadExotic->Fill(etacluster, phicluster);
824 fhTimeTriggerEMCALBCBadExotic->Fill(ecluster, tofcluster);
825 if(badMax) fhTimeTriggerEMCALBCBadMaxCellExotic->Fill(ecluster, tofcluster);
826 }
827 else
828 {
829 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBadExotic->Fill(etacluster, phicluster);
830 fhTimeTriggerEMCALBCUMBadExotic->Fill(ecluster, tofcluster);
831 if(badMax) fhTimeTriggerEMCALBCUMBadMaxCellExotic->Fill(ecluster, tofcluster);
832
833 }
834 }// Bad and exotic cluster trigger
835 else if(GetReader()->IsBadCellTriggerEvent() )
836 {
837 if(GetReader()->IsTriggerMatched())
838 {
839 if(ecluster > 2) fhEtaPhiTriggerEMCALBCBad->Fill(etacluster, phicluster);
840 fhTimeTriggerEMCALBCBad->Fill(ecluster, tofcluster);
841 if(badMax) fhTimeTriggerEMCALBCBadMaxCell->Fill(ecluster, tofcluster);
842 }
843 else
844 {
845 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBad->Fill(etacluster, phicluster);
846 fhTimeTriggerEMCALBCUMBad->Fill(ecluster, tofcluster);
847 if(badMax) fhTimeTriggerEMCALBCUMBadMaxCell->Fill(ecluster, tofcluster);
848 }
849 }// Bad cluster trigger
850 else if(GetReader()->IsExoticEvent() )
851 {
852 if(GetReader()->IsTriggerMatched())
853 {
854 if(ecluster > 2) fhEtaPhiTriggerEMCALBCExotic->Fill(etacluster, phicluster);
855 fhTimeTriggerEMCALBCExotic->Fill(ecluster, tofcluster);
856 }
857 else
858 {
859 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMExotic->Fill(etacluster, phicluster);
860 fhTimeTriggerEMCALBCUMExotic->Fill(ecluster, tofcluster);
861 }
862 }
863 }
864 else if(TMath::Abs(bc) >= 6)
865 printf("AliAnaPhoton::ClusterSelected() - Trigger BC not expected = %d\n",bc);
866
867}
868
869//______________________________________________________________________________________________
870void AliAnaPhoton::FillClusterPileUpHistograms(AliVCluster * calo, const Bool_t matched,
126b8c62 871 const Float_t ptcluster,
b2e375c7 872 const Float_t etacluster, const Float_t phicluster,
873 const Float_t l0cluster)
874{
875 // Fill some histograms related to pile up before any cluster cut is applied
876
877 if(!fFillPileUpHistograms) return ;
878
879 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
880 AliVCaloCells* cells = 0;
881 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
882 else cells = GetPHOSCells();
883
884 Float_t maxCellFraction = 0.;
885 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
886
887 Double_t tmax = cells->GetCellTime(absIdMax);
888 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
889 tmax*=1.e9;
890
891 Bool_t okPhoton = kFALSE;
892 if( GetCaloPID()->GetIdentifiedParticleType(calo)== AliCaloPID::kPhoton) okPhoton = kTRUE;
893
894 Float_t clusterLongTimePt = 0;
895 Float_t clusterOKTimePt = 0;
126b8c62 896
897 //Loop on cells inside cluster, max cell must be over 100 MeV and time in BC=0
898 if(cells->GetCellAmplitude(absIdMax) > 0.1 && TMath::Abs(tmax) < 30)
b2e375c7 899 {
126b8c62 900 for (Int_t ipos = 0; ipos < calo->GetNCells(); ipos++)
b2e375c7 901 {
126b8c62 902 Int_t absId = calo->GetCellsAbsId()[ipos];
903
904 if( absId == absIdMax ) continue ;
905
b2e375c7 906 Double_t time = cells->GetCellTime(absId);
907 Float_t amp = cells->GetCellAmplitude(absId);
908 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
909 GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,time,cells);
910 time*=1e9;
911
912 Float_t diff = (tmax-time);
913
914 if(GetReader()->IsInTimeWindow(time,amp)) clusterOKTimePt += amp;
915 else clusterLongTimePt += amp;
916
36769d30 917 if( cells->GetCellAmplitude(absIdMax) < 0.1 ) continue ;
126b8c62 918
b2e375c7 919 if(GetReader()->IsPileUpFromSPD())
920 {
126b8c62 921 fhClusterCellTimePileUp[0]->Fill(ptcluster, time);
922 fhClusterTimeDiffPileUp[0]->Fill(ptcluster, diff);
b2e375c7 923 if(!matched)
924 {
126b8c62 925 fhClusterTimeDiffChargedPileUp[0]->Fill(ptcluster, diff);
926 if(okPhoton) fhClusterTimeDiffPhotonPileUp[0]->Fill(ptcluster, diff);
b2e375c7 927 }
928 }
929
930 if(GetReader()->IsPileUpFromEMCal())
931 {
126b8c62 932 fhClusterCellTimePileUp[1]->Fill(ptcluster, time);
933 fhClusterTimeDiffPileUp[1]->Fill(ptcluster, diff);
b2e375c7 934 if(!matched)
935 {
126b8c62 936 fhClusterTimeDiffChargedPileUp[1]->Fill(ptcluster, diff);
937 if(okPhoton) fhClusterTimeDiffPhotonPileUp[1]->Fill(ptcluster, diff);
b2e375c7 938 }
939 }
940
941 if(GetReader()->IsPileUpFromSPDOrEMCal())
942 {
126b8c62 943 fhClusterCellTimePileUp[2]->Fill(ptcluster, time);
944 fhClusterTimeDiffPileUp[2]->Fill(ptcluster, diff);
b2e375c7 945 if(!matched)
946 {
126b8c62 947 fhClusterTimeDiffChargedPileUp[2]->Fill(ptcluster, diff);
948 if(okPhoton) fhClusterTimeDiffPhotonPileUp[2]->Fill(ptcluster, diff);
b2e375c7 949 }
950 }
951
952 if(GetReader()->IsPileUpFromSPDAndEMCal())
953 {
126b8c62 954 fhClusterCellTimePileUp[3]->Fill(ptcluster, time);
955 fhClusterTimeDiffPileUp[3]->Fill(ptcluster, diff);
b2e375c7 956 if(!matched)
957 {
126b8c62 958 fhClusterTimeDiffChargedPileUp[3]->Fill(ptcluster, diff);
959 if(okPhoton) fhClusterTimeDiffPhotonPileUp[3]->Fill(ptcluster, diff);
b2e375c7 960 }
961 }
962
963 if(GetReader()->IsPileUpFromSPDAndNotEMCal())
964 {
126b8c62 965 fhClusterCellTimePileUp[4]->Fill(ptcluster, time);
966 fhClusterTimeDiffPileUp[4]->Fill(ptcluster, diff);
b2e375c7 967 if(!matched)
968 {
126b8c62 969 fhClusterTimeDiffChargedPileUp[4]->Fill(ptcluster, diff);
970 if(okPhoton) fhClusterTimeDiffPhotonPileUp[4]->Fill(ptcluster, diff);
b2e375c7 971 }
972 }
973
974 if(GetReader()->IsPileUpFromEMCalAndNotSPD())
975 {
126b8c62 976 fhClusterCellTimePileUp[5]->Fill(ptcluster, time);
977 fhClusterTimeDiffPileUp[5]->Fill(ptcluster, diff);
b2e375c7 978 if(!matched)
979 {
126b8c62 980 fhClusterTimeDiffChargedPileUp[5]->Fill(ptcluster, diff);
981 if(okPhoton) fhClusterTimeDiffPhotonPileUp[5]->Fill(ptcluster, diff);
b2e375c7 982 }
983 }
984
985 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
986 {
126b8c62 987 fhClusterCellTimePileUp[6]->Fill(ptcluster, time);
988 fhClusterTimeDiffPileUp[6]->Fill(ptcluster, diff);
b2e375c7 989 if(!matched)
990 {
126b8c62 991 fhClusterTimeDiffChargedPileUp[6]->Fill(ptcluster, diff);
992 if(okPhoton) fhClusterTimeDiffPhotonPileUp[6]->Fill(ptcluster, diff);
b2e375c7 993 }
994 }
126b8c62 995 }//loop
996
997
998 Float_t frac = 0;
999 if(clusterLongTimePt+clusterOKTimePt > 0.001)
1000 frac = clusterLongTimePt/(clusterLongTimePt+clusterOKTimePt);
1001 //printf("E long %f, E OK %f, Fraction large time %f, E %f\n",clusterLongTimePt,clusterOKTimePt,frac,ptcluster);
1002
1003 if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(ptcluster); fhLambda0PileUp[0]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[0]->Fill(ptcluster,frac);}
1004 if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(ptcluster); fhLambda0PileUp[1]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[1]->Fill(ptcluster,frac);}
1005 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(ptcluster); fhLambda0PileUp[2]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[2]->Fill(ptcluster,frac);}
1006 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(ptcluster); fhLambda0PileUp[3]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[3]->Fill(ptcluster,frac);}
1007 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ptcluster,frac);}
1008 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ptcluster,frac);}
1009 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ptcluster,frac);}
1010
1011 fhEtaPhiBC0->Fill(etacluster,phicluster);
1012 if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD ->Fill(etacluster,phicluster);
1013 }
b2e375c7 1014
b2e375c7 1015 else if (tmax > 25) {fhEtaPhiBCPlus ->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(etacluster,phicluster); }
1016 else if (tmax <-25) {fhEtaPhiBCMinus->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(etacluster,phicluster); }
1017}
1018
1019//_______________________________________________
85c4406e 1020void AliAnaPhoton::FillPileUpHistogramsPerEvent()
acd56ca4 1021{
1022 // Fill some histograms per event to understand pile-up
6227a9fd 1023 // Open the time cut in the reader to be more meaningful
1024
acd56ca4 1025 if(!fFillPileUpHistograms) return;
85c4406e 1026
0f7e7205 1027 AliVEvent * event = GetReader()->GetInputEvent();
1028
1029 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1030 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1031
1032 // N pile up vertices
1033 Int_t nVtxSPD = -1;
1034 Int_t nVtxTrk = -1;
1035 TLorentzVector mom;
1036
1037 if (esdEv)
1038 {
1039 nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
1040 nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
1041 }//ESD
1042 else if (aodEv)
1043 {
1044 nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
1045 nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
85c4406e 1046 }//AOD
0f7e7205 1047
1048
85c4406e 1049 // Get the appropriate list of clusters
0f7e7205 1050 TClonesArray * clusterList = 0;
1051 TString clusterListName = GetReader()->GetEMCALClusterListName();
1052 if (event->FindListObject(clusterListName))
1053 clusterList = dynamic_cast<TClonesArray*> (event->FindListObject(clusterListName));
1054 else if(GetReader()->GetOutputEvent())
1055 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(clusterListName));
1056
1057 // Loop on clusters, get the maximum energy cluster as reference
85c4406e 1058 Int_t nclusters = 0;
0f7e7205 1059 if(clusterList) nclusters = clusterList->GetEntriesFast();
1060 else nclusters = event->GetNumberOfCaloClusters();
1061
85c4406e 1062 Int_t idMax = 0;
acd56ca4 1063 Float_t eMax = 0;
85c4406e 1064 Float_t tMax = 0;
acd56ca4 1065 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
1066 {
0f7e7205 1067 AliVCluster * clus = 0;
85c4406e 1068 if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
0f7e7205 1069 else clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1070
1071 if(!clus) continue;
1072
1073 if(!clus->IsEMCAL()) continue;
1074
1075 Float_t tof = clus->GetTOF()*1e9;
b2e375c7 1076 if(clus->E() > eMax && TMath::Abs(tof) < 30)
acd56ca4 1077 {
1078 eMax = clus->E();
0f7e7205 1079 tMax = tof;
acd56ca4 1080 idMax = iclus;
1081 }
0f7e7205 1082
1083 clus->GetMomentum(mom,GetVertex(0));
1084 Float_t pt = mom.Pt();
1085
85c4406e 1086 fhPtNPileUpSPDVtx->Fill(pt,nVtxSPD);
0f7e7205 1087 fhPtNPileUpTrkVtx->Fill(pt,nVtxTrk);
85c4406e 1088
b2e375c7 1089 if(TMath::Abs(tof) < 30)
85c4406e 1090 {
1091 fhPtNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
1092 fhPtNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
0f7e7205 1093 }
85c4406e 1094
b2e375c7 1095 if(tof < 75 && tof > -30)
85c4406e 1096 {
1097 fhPtNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
1098 fhPtNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
1099 }
1100
b2e375c7 1101 fhTimePtNoCut->Fill(pt,tof);
1102 if(GetReader()->IsPileUpFromSPD()) fhTimePtSPD->Fill(pt,tof);
1103
acd56ca4 1104 }
0f7e7205 1105
6227a9fd 1106 if(eMax < 5) return;
acd56ca4 1107
1108 // Loop again on clusters to compare this max cluster t and the rest of the clusters, if E > 0.3
1109 Int_t n20 = 0;
1110 Int_t n40 = 0;
1111 Int_t n = 0;
1112 Int_t nOK = 0;
85c4406e 1113
acd56ca4 1114 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
1115 {
0f7e7205 1116 AliVCluster * clus = 0;
85c4406e 1117 if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
0f7e7205 1118 else clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1119
1120 if(!clus) continue;
1121
1122 if(!clus->IsEMCAL()) continue;
acd56ca4 1123
1124 if(clus->E() < 0.3 || iclus==idMax) continue;
1125
1126 Float_t tdiff = TMath::Abs(tMax-clus->GetTOF()*1e9);
1127 n++;
0f7e7205 1128 if(tdiff < 25) nOK++;
acd56ca4 1129 else
1130 {
1131 n20++;
1132 if(tdiff > 40 ) n40++;
1133 }
1134 }
1135
1136 // Check pile-up and fill histograms depending on the different cluster multiplicities
1137 if(GetReader()->IsPileUpFromSPD())
85c4406e 1138 {
acd56ca4 1139 fhClusterMultSPDPileUp[0]->Fill(eMax,n );
1140 fhClusterMultSPDPileUp[1]->Fill(eMax,nOK);
1141 fhClusterMultSPDPileUp[2]->Fill(eMax,n20);
1142 fhClusterMultSPDPileUp[3]->Fill(eMax,n40);
1143 }
85c4406e 1144 else
acd56ca4 1145 {
1146 fhClusterMultNoPileUp[0]->Fill(eMax,n );
1147 fhClusterMultNoPileUp[1]->Fill(eMax,nOK);
1148 fhClusterMultNoPileUp[2]->Fill(eMax,n20);
85c4406e 1149 fhClusterMultNoPileUp[3]->Fill(eMax,n40);
1150 }
acd56ca4 1151
1152}
1153
1154
fad96885 1155//_________________________________________________________________________________________________
22ad7981 1156void AliAnaPhoton::FillPileUpHistograms(Float_t energy, Float_t pt, Float_t time)
2ad19c3d 1157{
1158 // Fill some histograms to understand pile-up
1159 if(!fFillPileUpHistograms) return;
1160
1161 //printf("E %f, time %f\n",energy,time);
1162 AliVEvent * event = GetReader()->GetInputEvent();
1163
fad96885 1164 if(GetReader()->IsPileUpFromSPD()) fhPtPhotonPileUp[0]->Fill(pt);
1165 if(GetReader()->IsPileUpFromEMCal()) fhPtPhotonPileUp[1]->Fill(pt);
1166 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPhotonPileUp[2]->Fill(pt);
1167 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPhotonPileUp[3]->Fill(pt);
1168 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPhotonPileUp[4]->Fill(pt);
1169 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPhotonPileUp[5]->Fill(pt);
1170 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt);
1171
b2e375c7 1172 fhTimePtPhotonNoCut->Fill(pt,time);
1173 if(GetReader()->IsPileUpFromSPD()) fhTimePtPhotonSPD->Fill(pt,time);
2ad19c3d 1174
de101942 1175 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
2ad19c3d 1176
1177 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1178 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1179
1180 // N pile up vertices
0f7e7205 1181 Int_t nVtxSPD = -1;
1182 Int_t nVtxTrk = -1;
2ad19c3d 1183
1184 if (esdEv)
1185 {
0f7e7205 1186 nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
1187 nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
85c4406e 1188
2ad19c3d 1189 }//ESD
1190 else if (aodEv)
1191 {
0f7e7205 1192 nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
1193 nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
2ad19c3d 1194 }//AOD
1195
0f7e7205 1196 fhTimeNPileUpVertSPD ->Fill(time,nVtxSPD);
1197 fhTimeNPileUpVertTrack->Fill(time,nVtxTrk);
2ad19c3d 1198
85c4406e 1199 fhPtPhotonNPileUpSPDVtx->Fill(pt,nVtxSPD);
0f7e7205 1200 fhPtPhotonNPileUpTrkVtx->Fill(pt,nVtxTrk);
1201
1202 if(TMath::Abs(time) < 25)
85c4406e 1203 {
1204 fhPtPhotonNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
1205 fhPtPhotonNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
0f7e7205 1206 }
1207
85c4406e 1208 if(time < 75 && time > -25)
1209 {
1210 fhPtPhotonNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
1211 fhPtPhotonNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
1212 }
1213
1214 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
0f7e7205 1215 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVtxSPD,nVtxTrk);
2ad19c3d 1216
1217 Int_t ncont = -1;
5559f30a 1218 Float_t z1 = -1, z2 = -1;
2ad19c3d 1219 Float_t diamZ = -1;
0f7e7205 1220 for(Int_t iVert=0; iVert<nVtxSPD;iVert++)
2ad19c3d 1221 {
1222 if (esdEv)
1223 {
1224 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
1225 ncont=pv->GetNContributors();
1226 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
1227 z2 = pv->GetZ();
1228 diamZ = esdEv->GetDiamondZ();
1229 }//ESD
1230 else if (aodEv)
1231 {
1232 AliAODVertex *pv=aodEv->GetVertex(iVert);
1233 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
1234 ncont=pv->GetNContributors();
1235 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
1236 z2=pv->GetZ();
1237 diamZ = aodEv->GetDiamondZ();
1238 }// AOD
1239
1240 Double_t distZ = TMath::Abs(z2-z1);
1241 diamZ = TMath::Abs(z2-diamZ);
85c4406e 1242
2ad19c3d 1243 fhTimeNPileUpVertContributors ->Fill(time,ncont);
1244 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
1245 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
85c4406e 1246
2ad19c3d 1247 }// loop
1248}
1249
34c16486 1250//____________________________________________________________________________________
22ad7981 1251void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
34c16486 1252{
85c4406e 1253 //Fill cluster Shower Shape histograms
521636d2 1254
1255 if(!fFillSSHistograms || GetMixedEvent()) return;
85c4406e 1256
521636d2 1257 Float_t energy = cluster->E();
1258 Int_t ncells = cluster->GetNCells();
521636d2 1259 Float_t lambda0 = cluster->GetM02();
1260 Float_t lambda1 = cluster->GetM20();
1261 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
1262
1263 TLorentzVector mom;
34c16486 1264 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1265 {
1266 cluster->GetMomentum(mom,GetVertex(0)) ;
1267 }//Assume that come from vertex in straight line
1268 else
1269 {
521636d2 1270 Double_t vertex[]={0,0,0};
1271 cluster->GetMomentum(mom,vertex) ;
1272 }
1273
1274 Float_t eta = mom.Eta();
1275 Float_t phi = mom.Phi();
1276 if(phi < 0) phi+=TMath::TwoPi();
1277
1278 fhLam0E ->Fill(energy,lambda0);
1279 fhLam1E ->Fill(energy,lambda1);
1280 fhDispE ->Fill(energy,disp);
85c4406e 1281
34c16486 1282 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1283 {
521636d2 1284 fhLam0ETRD->Fill(energy,lambda0);
1285 fhLam1ETRD->Fill(energy,lambda1);
1286 fhDispETRD->Fill(energy,disp);
521636d2 1287 }
1288
34c16486 1289 Float_t l0 = 0., l1 = 0.;
85c4406e 1290 Float_t dispp= 0., dEta = 0., dPhi = 0.;
1291 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
764ab1f4 1292 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
34c16486 1293 {
1294 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
1295 l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
1296 //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",
1297 // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
1298 //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
1299 // disp, dPhi+dEta );
1300 fhDispEtaE -> Fill(energy,dEta);
1301 fhDispPhiE -> Fill(energy,dPhi);
1302 fhSumEtaE -> Fill(energy,sEta);
1303 fhSumPhiE -> Fill(energy,sPhi);
1304 fhSumEtaPhiE -> Fill(energy,sEtaPhi);
1305 fhDispEtaPhiDiffE -> Fill(energy,dPhi-dEta);
1306 if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
1307 if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.));
85c4406e 1308 if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));
34c16486 1309
bfdcf7fb 1310 Int_t ebin = -1;
1311 if (energy < 2 ) ebin = 0;
1312 else if (energy < 4 ) ebin = 1;
1313 else if (energy < 6 ) ebin = 2;
1314 else if (energy < 10) ebin = 3;
85c4406e 1315 else if (energy < 15) ebin = 4;
1316 else if (energy < 20) ebin = 5;
1317 else ebin = 6;
bfdcf7fb 1318
1319 fhDispEtaDispPhi[ebin]->Fill(dEta ,dPhi);
1320 fhLambda0DispEta[ebin]->Fill(lambda0,dEta);
1321 fhLambda0DispPhi[ebin]->Fill(lambda0,dPhi);
1322
34c16486 1323 }
1324
85c4406e 1325 // if track-matching was of, check effect of track-matching residual cut
b5dbb99b 1326
1327 if(!fRejectTrackMatch)
1328 {
1329 Float_t dZ = cluster->GetTrackDz();
1330 Float_t dR = cluster->GetTrackDx();
34c16486 1331 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1332 {
b5dbb99b 1333 dR = 2000., dZ = 2000.;
1334 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
85c4406e 1335 }
b5dbb99b 1336
1337 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1338 {
1339 fhLam0ETM ->Fill(energy,lambda0);
1340 fhLam1ETM ->Fill(energy,lambda1);
1341 fhDispETM ->Fill(energy,disp);
1342
34c16486 1343 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1344 {
b5dbb99b 1345 fhLam0ETMTRD->Fill(energy,lambda0);
1346 fhLam1ETMTRD->Fill(energy,lambda1);
1347 fhDispETMTRD->Fill(energy,disp);
1348 }
1349 }
85c4406e 1350 }// if track-matching was of, check effect of matching residual cut
b5dbb99b 1351
764ab1f4 1352
1353 if(!fFillOnlySimpleSSHisto){
1354 if(energy < 2)
1355 {
1356 fhNCellsLam0LowE ->Fill(ncells,lambda0);
1357 fhNCellsLam1LowE ->Fill(ncells,lambda1);
1358 fhNCellsDispLowE ->Fill(ncells,disp);
1359
1360 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
1361 fhLam0DispLowE ->Fill(lambda0,disp);
1362 fhDispLam1LowE ->Fill(disp,lambda1);
1363 fhEtaLam0LowE ->Fill(eta,lambda0);
85c4406e 1364 fhPhiLam0LowE ->Fill(phi,lambda0);
764ab1f4 1365 }
85c4406e 1366 else
764ab1f4 1367 {
1368 fhNCellsLam0HighE ->Fill(ncells,lambda0);
1369 fhNCellsLam1HighE ->Fill(ncells,lambda1);
1370 fhNCellsDispHighE ->Fill(ncells,disp);
1371
1372 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
1373 fhLam0DispHighE ->Fill(lambda0,disp);
1374 fhDispLam1HighE ->Fill(disp,lambda1);
1375 fhEtaLam0HighE ->Fill(eta, lambda0);
1376 fhPhiLam0HighE ->Fill(phi, lambda0);
1377 }
521636d2 1378 }
34c16486 1379 if(IsDataMC())
1380 {
f66d95af 1381 AliVCaloCells* cells = 0;
1382 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
1383 else cells = GetPHOSCells();
3d5d5078 1384
1385 //Fill histograms to check shape of embedded clusters
1386 Float_t fraction = 0;
85c4406e 1387 // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
1388
34c16486 1389 if(GetReader()->IsEmbeddedClusterSelectionOn())
1390 {//Only working for EMCAL
85c4406e 1391 // printf("embedded\n");
3d5d5078 1392 Float_t clusterE = 0; // recalculate in case corrections applied.
1393 Float_t cellE = 0;
34c16486 1394 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
1395 {
3d5d5078 1396 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
85c4406e 1397 clusterE+=cellE;
3d5d5078 1398 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
1399 }
1400
1401 //Fraction of total energy due to the embedded signal
1402 fraction/=clusterE;
1403
85c4406e 1404 if(GetDebug() > 1 )
8d6b7f60 1405 printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
3d5d5078 1406
1407 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
1408
85c4406e 1409 } // embedded fraction
3d5d5078 1410
f66d95af 1411 // Get the fraction of the cluster energy that carries the cell with highest energy
34c16486 1412 Int_t absID =-1 ;
f66d95af 1413 Float_t maxCellFraction = 0.;
1414
1415 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
1416
1417 // Check the origin and fill histograms
34c16486 1418
1419 Int_t mcIndex = -1;
1420
85c4406e 1421 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
3d5d5078 1422 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
34c16486 1423 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1424 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1425 {
1426 mcIndex = kmcssPhoton ;
85c4406e 1427
34c16486 1428 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1429 {
3d5d5078 1430 //Check particle overlaps in cluster
1431
85c4406e 1432 // Compare the primary depositing more energy with the rest,
8d6b7f60 1433 // if no photon/electron as comon ancestor (conversions), count as other particle
3d5d5078 1434 Int_t ancPDG = 0, ancStatus = -1;
1435 TLorentzVector momentum; TVector3 prodVertex;
1436 Int_t ancLabel = 0;
85c4406e 1437 Int_t noverlaps = 1;
b2e375c7 1438 for (UInt_t ilab = 1; ilab < cluster->GetNLabels(); ilab++ )
34c16486 1439 {
85c4406e 1440 ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab],
34c16486 1441 GetReader(),ancPDG,ancStatus,momentum,prodVertex);
3d5d5078 1442 if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
1443 }
8d6b7f60 1444 //printf("N overlaps %d \n",noverlaps);
3d5d5078 1445
34c16486 1446 if(noverlaps == 1)
1447 {
3d5d5078 1448 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
3d5d5078 1449 }
34c16486 1450 else if(noverlaps == 2)
85c4406e 1451 {
3d5d5078 1452 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
3d5d5078 1453 }
34c16486 1454 else if(noverlaps > 2)
85c4406e 1455 {
3d5d5078 1456 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
3d5d5078 1457 }
85c4406e 1458 else
34c16486 1459 {
3d5d5078 1460 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!", noverlaps);
1461 }
1462 }//No embedding
1463
1464 //Fill histograms to check shape of embedded clusters
34c16486 1465 if(GetReader()->IsEmbeddedClusterSelectionOn())
1466 {
85c4406e 1467 if (fraction > 0.9)
3d5d5078 1468 {
1469 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
3d5d5078 1470 }
1471 else if(fraction > 0.5)
1472 {
1473 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
3d5d5078 1474 }
1475 else if(fraction > 0.1)
85c4406e 1476 {
3d5d5078 1477 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
3d5d5078 1478 }
1479 else
1480 {
1481 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
3d5d5078 1482 }
1483 } // embedded
1484
521636d2 1485 }//photon no conversion
34c16486 1486 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
1487 {
1488 mcIndex = kmcssElectron ;
521636d2 1489 }//electron
85c4406e 1490 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1491 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
34c16486 1492 {
1493 mcIndex = kmcssConversion ;
521636d2 1494 }//conversion photon
34c16486 1495 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
1496 {
1497 mcIndex = kmcssPi0 ;
3d5d5078 1498
1499 //Fill histograms to check shape of embedded clusters
34c16486 1500 if(GetReader()->IsEmbeddedClusterSelectionOn())
1501 {
85c4406e 1502 if (fraction > 0.9)
3d5d5078 1503 {
1504 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
3d5d5078 1505 }
1506 else if(fraction > 0.5)
1507 {
1508 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
3d5d5078 1509 }
1510 else if(fraction > 0.1)
85c4406e 1511 {
3d5d5078 1512 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
3d5d5078 1513 }
1514 else
1515 {
1516 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
3d5d5078 1517 }
85c4406e 1518 } // embedded
3d5d5078 1519
521636d2 1520 }//pi0
34c16486 1521 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
1522 {
1523 mcIndex = kmcssEta ;
85c4406e 1524 }//eta
1525 else
34c16486 1526 {
85c4406e 1527 mcIndex = kmcssOther ;
1528 }//other particles
521636d2 1529
34c16486 1530 fhMCELambda0 [mcIndex]->Fill(energy, lambda0);
1531 fhMCELambda1 [mcIndex]->Fill(energy, lambda1);
1532 fhMCEDispersion [mcIndex]->Fill(energy, disp);
1533 fhMCNCellsE [mcIndex]->Fill(energy, ncells);
1534 fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction);
1535
764ab1f4 1536 if(!fFillOnlySimpleSSHisto)
34c16486 1537 {
764ab1f4 1538 if (energy < 2.)
1539 {
1540 fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction);
1541 fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction);
1542 }
1543 else if(energy < 6.)
1544 {
1545 fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction);
1546 fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction);
1547 }
1548 else
1549 {
1550 fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction);
1551 fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction);
1552 }
1553
1554 if(fCalorimeter == "EMCAL")
1555 {
1556 fhMCEDispEta [mcIndex]-> Fill(energy,dEta);
1557 fhMCEDispPhi [mcIndex]-> Fill(energy,dPhi);
1558 fhMCESumEtaPhi [mcIndex]-> Fill(energy,sEtaPhi);
1559 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy,dPhi-dEta);
85c4406e 1560 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
764ab1f4 1561
1562 Int_t ebin = -1;
1563 if (energy < 2 ) ebin = 0;
1564 else if (energy < 4 ) ebin = 1;
1565 else if (energy < 6 ) ebin = 2;
1566 else if (energy < 10) ebin = 3;
85c4406e 1567 else if (energy < 15) ebin = 4;
1568 else if (energy < 20) ebin = 5;
1569 else ebin = 6;
764ab1f4 1570
1571 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta ,dPhi);
1572 fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0,dEta);
85c4406e 1573 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);
764ab1f4 1574 }
34c16486 1575 }
521636d2 1576 }//MC data
1577
1578}
1579
4bfeae64 1580//__________________________________________________________________________
85c4406e 1581void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
22ad7981 1582 Int_t cut)
4bfeae64 1583{
1584 // If selected, fill histograms with residuals of matched clusters, help to define track matching cut
1585 // Residual filled for different cuts 0 (No cut), after 1 PID cut
85c4406e 1586
4bfeae64 1587 Float_t dZ = cluster->GetTrackDz();
1588 Float_t dR = cluster->GetTrackDx();
1589
1590 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1591 {
1592 dR = 2000., dZ = 2000.;
1593 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
85c4406e 1594 }
1595
b2e375c7 1596 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
1597
1598 Bool_t positive = kFALSE;
1599 if(track) positive = (track->Charge()>0);
1600
4bfeae64 1601 if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
1602 {
1603 fhTrackMatchedDEta[cut]->Fill(cluster->E(),dZ);
1604 fhTrackMatchedDPhi[cut]->Fill(cluster->E(),dR);
4bfeae64 1605 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ,dR);
b2e375c7 1606
1607 if(track)
1608 {
1609 if(positive)
1610 {
1611 fhTrackMatchedDEtaPos[cut]->Fill(cluster->E(),dZ);
1612 fhTrackMatchedDPhiPos[cut]->Fill(cluster->E(),dR);
1613 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiPos[cut]->Fill(dZ,dR);
1614 }
1615 else
1616 {
1617 fhTrackMatchedDEtaNeg[cut]->Fill(cluster->E(),dZ);
1618 fhTrackMatchedDPhiNeg[cut]->Fill(cluster->E(),dR);
1619 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiNeg[cut]->Fill(dZ,dR);
1620 }
1621 }
4bfeae64 1622
1623 Int_t nSMod = GetModuleNumber(cluster);
1624
1625 if(fCalorimeter=="EMCAL" && nSMod > 5)
1626 {
1627 fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(),dZ);
1628 fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(),dR);
1629 }
1630
1631 // Check dEdx and E/p of matched clusters
b2e375c7 1632
4bfeae64 1633 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
85c4406e 1634 {
85c4406e 1635 if(track)
4bfeae64 1636 {
4bfeae64 1637 Float_t dEdx = track->GetTPCsignal();
1638 Float_t eOverp = cluster->E()/track->P();
1639
1640 fhdEdx[cut] ->Fill(cluster->E(), dEdx);
1641 fhEOverP[cut]->Fill(cluster->E(), eOverp);
1642
1643 if(fCalorimeter=="EMCAL" && nSMod > 5)
1644 fhEOverPTRD[cut]->Fill(cluster->E(), eOverp);
1645
1646
1647 }
1648 else
85c4406e 1649 printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
4bfeae64 1650
1651
1652
1653 if(IsDataMC())
1654 {
1655
2644ead9 1656 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader());
4bfeae64 1657
1658 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1659 {
1660 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
85c4406e 1661 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
4bfeae64 1662 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5 );
1663 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5 );
1664 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5 );
1665
1666 // Check if several particles contributed to cluster and discard overlapped mesons
85c4406e 1667 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
34c16486 1668 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1669 {
4bfeae64 1670 if(cluster->GetNLabels()==1)
1671 {
1672 fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(),dZ);
1673 fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(),dR);
1674 }
85c4406e 1675 else
4bfeae64 1676 {
1677 fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(),dZ);
1678 fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(),dR);
1679 }
1680
1681 }// Check overlaps
1682
1683 }
1684 else
1685 {
1686 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
85c4406e 1687 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
4bfeae64 1688 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5 );
1689 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5 );
1690 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5 );
1691
1692 // Check if several particles contributed to cluster
85c4406e 1693 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
34c16486 1694 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1695 {
4bfeae64 1696 fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(),dZ);
1697 fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(),dR);
1698
85c4406e 1699 }// Check overlaps
4bfeae64 1700
1701 }
1702
85c4406e 1703 } // MC
4bfeae64 1704
1705 } // residuals window
1706
1707 } // Small residual
1708
1709}
1710
1711//___________________________________________
0c1383b5 1712TObjString * AliAnaPhoton::GetAnalysisCuts()
85c4406e 1713{
0c1383b5 1714 //Save parameters used for analysis
1715 TString parList ; //this will be list of parameters used for this analysis.
5ae09196 1716 const Int_t buffersize = 255;
1717 char onePar[buffersize] ;
0c1383b5 1718
5ae09196 1719 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
85c4406e 1720 parList+=onePar ;
5ae09196 1721 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
0c1383b5 1722 parList+=onePar ;
5ae09196 1723 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
0c1383b5 1724 parList+=onePar ;
5ae09196 1725 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
0c1383b5 1726 parList+=onePar ;
5ae09196 1727 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
0c1383b5 1728 parList+=onePar ;
5ae09196 1729 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
85c4406e 1730 parList+=onePar ;
0c1383b5 1731
1732 //Get parameters set in base class.
1733 parList += GetBaseParametersList() ;
1734
1735 //Get parameters set in PID class.
1736 parList += GetCaloPID()->GetPIDParametersList() ;
1737
1738 //Get parameters set in FiducialCut class (not available yet)
85c4406e 1739 //parlist += GetFidCut()->GetFidCutParametersList()
0c1383b5 1740
1741 return new TObjString(parList) ;
1742}
1743
1c5acb87 1744//________________________________________________________________________
1745TList * AliAnaPhoton::GetCreateOutputObjects()
c2a62a94 1746{
85c4406e 1747 // Create histograms to be saved in output file and
477d6cee 1748 // store them in outputContainer
85c4406e 1749 TList * outputContainer = new TList() ;
1750 outputContainer->SetName("PhotonHistos") ;
4a745797 1751
85c4406e 1752 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1753 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1754 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
745913ae 1755 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
85c4406e 1756 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1757 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1758
1759 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1760 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
09273901 1761 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
85c4406e 1762 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1763 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
09273901 1764 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1765
85c4406e 1766 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1767 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
31ae6d59 1768 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
85c4406e 1769 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1770 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
31ae6d59 1771 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
09273901 1772
d2655d46 1773 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1774
9e51e29a 1775 TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
85c4406e 1776 for (Int_t i = 0; i < 10 ; i++)
fc195fd0 1777 {
1778 fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
1779 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
85c4406e 1780 nptbins,ptmin,ptmax);
fc195fd0 1781 fhClusterCuts[i]->SetYTitle("dN/dE ");
1782 fhClusterCuts[i]->SetXTitle("E (GeV)");
85c4406e 1783 outputContainer->Add(fhClusterCuts[i]) ;
fc195fd0 1784 }
1785
85c4406e 1786 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
c4a7d28a 1787 fhNCellsE->SetXTitle("E (GeV)");
1788 fhNCellsE->SetYTitle("# of cells in cluster");
85c4406e 1789 outputContainer->Add(fhNCellsE);
f15c25da 1790
85c4406e 1791 fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
5c46c992 1792 fhCellsE->SetXTitle("E_{cluster} (GeV)");
1793 fhCellsE->SetYTitle("E_{cell} (GeV)");
85c4406e 1794 outputContainer->Add(fhCellsE);
5c46c992 1795
b2e375c7 1796 fhTimePt = new TH2F ("hTimePt","time of cluster vs pT of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1797 fhTimePt->SetXTitle("p_{T} (GeV/c)");
1798 fhTimePt->SetYTitle("time (ns)");
1799 outputContainer->Add(fhTimePt);
6175da48 1800
f66d95af 1801 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
85c4406e 1802 nptbins,ptmin,ptmax, 500,0,1.);
f66d95af 1803 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1804 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 1805 outputContainer->Add(fhMaxCellDiffClusterE);
f66d95af 1806
85c4406e 1807 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
20218aea 1808 fhEPhoton->SetYTitle("N");
1809 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
85c4406e 1810 outputContainer->Add(fhEPhoton) ;
20218aea 1811
85c4406e 1812 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
477d6cee 1813 fhPtPhoton->SetYTitle("N");
1814 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
85c4406e 1815 outputContainer->Add(fhPtPhoton) ;
1816
c8710850 1817 fhPtCentralityPhoton = new TH2F("hPtCentralityPhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
1818 fhPtCentralityPhoton->SetYTitle("Centrality");
1819 fhPtCentralityPhoton->SetXTitle("p_{T}(GeV/c)");
1820 outputContainer->Add(fhPtCentralityPhoton) ;
1821
1822 fhPtEventPlanePhoton = new TH2F("hPtEventPlanePhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1823 fhPtEventPlanePhoton->SetYTitle("Event plane angle (rad)");
1824 fhPtEventPlanePhoton->SetXTitle("p_{T} (GeV/c)");
1825 outputContainer->Add(fhPtEventPlanePhoton) ;
85c4406e 1826
c2a62a94 1827 fhEtaPhi = new TH2F
1828 ("hEtaPhi","cluster,E > 0.5 GeV, #eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1829 fhEtaPhi->SetYTitle("#phi (rad)");
1830 fhEtaPhi->SetXTitle("#eta");
1831 outputContainer->Add(fhEtaPhi) ;
85c4406e 1832
c2a62a94 1833 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
1834 {
1835 fhEtaPhiEMCALBC0 = new TH2F
1836 ("hEtaPhiEMCALBC0","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
1837 fhEtaPhiEMCALBC0->SetYTitle("#phi (rad)");
1838 fhEtaPhiEMCALBC0->SetXTitle("#eta");
1839 outputContainer->Add(fhEtaPhiEMCALBC0) ;
1840
1841 fhEtaPhiEMCALBC1 = new TH2F
1842 ("hEtaPhiEMCALBC1","cluster,E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
1843 fhEtaPhiEMCALBC1->SetYTitle("#phi (rad)");
1844 fhEtaPhiEMCALBC1->SetXTitle("#eta");
1845 outputContainer->Add(fhEtaPhiEMCALBC1) ;
1846
1847 fhEtaPhiEMCALBCN = new TH2F
1848 ("hEtaPhiEMCALBCN","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
1849 fhEtaPhiEMCALBCN->SetYTitle("#phi (rad)");
1850 fhEtaPhiEMCALBCN->SetXTitle("#eta");
1851 outputContainer->Add(fhEtaPhiEMCALBCN) ;
1852
afb3af8a 1853 for(Int_t i = 0; i < 11; i++)
c2a62a94 1854 {
1855 fhEtaPhiTriggerEMCALBC[i] = new TH2F
1856 (Form("hEtaPhiTriggerEMCALBC%d",i-5),
afb3af8a 1857 Form("cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=%d",i-5),
c2a62a94 1858 netabins,etamin,etamax,nphibins,phimin,phimax);
1859 fhEtaPhiTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
1860 fhEtaPhiTriggerEMCALBC[i]->SetXTitle("#eta");
1861 outputContainer->Add(fhEtaPhiTriggerEMCALBC[i]) ;
1862
1863 fhTimeTriggerEMCALBC[i] = new TH2F
1864 (Form("hTimeTriggerEMCALBC%d",i-5),
afb3af8a 1865 Form("cluster time vs E of clusters, Trigger EMCAL-BC=%d",i-5),
c2a62a94 1866 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1867 fhTimeTriggerEMCALBC[i]->SetXTitle("E (GeV)");
1868 fhTimeTriggerEMCALBC[i]->SetYTitle("time (ns)");
1869 outputContainer->Add(fhTimeTriggerEMCALBC[i]);
1870
1871 fhTimeTriggerEMCALBCPileUpSPD[i] = new TH2F
1872 (Form("hTimeTriggerEMCALBC%dPileUpSPD",i-5),
afb3af8a 1873 Form("cluster time vs E of clusters, Trigger EMCAL-BC=%d",i-5),
c2a62a94 1874 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1875 fhTimeTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
1876 fhTimeTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
1877 outputContainer->Add(fhTimeTriggerEMCALBCPileUpSPD[i]);
afb3af8a 1878
1879 fhEtaPhiTriggerEMCALBCUM[i] = new TH2F
1880 (Form("hEtaPhiTriggerEMCALBC%d_UnMatch",i-5),
1881 Form("cluster E > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-5),
1882 netabins,etamin,etamax,nphibins,phimin,phimax);
1883 fhEtaPhiTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
1884 fhEtaPhiTriggerEMCALBCUM[i]->SetXTitle("#eta");
1885 outputContainer->Add(fhEtaPhiTriggerEMCALBCUM[i]) ;
1886
1887 fhTimeTriggerEMCALBCUM[i] = new TH2F
1888 (Form("hTimeTriggerEMCALBC%d_UnMatch",i-5),
1889 Form("cluster time vs E of clusters, unmatched trigger EMCAL-BC=%d",i-5),
1890 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1891 fhTimeTriggerEMCALBCUM[i]->SetXTitle("E (GeV)");
1892 fhTimeTriggerEMCALBCUM[i]->SetYTitle("time (ns)");
1893 outputContainer->Add(fhTimeTriggerEMCALBCUM[i]);
1894
1895 fhEtaPhiTriggerEMCALBCCluster[i] = new TH2F
1896 (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger",i-5),
1897 Form("trigger cluster, #eta vs #phi, Trigger EMCAL-BC=%d",i-5),
1898 netabins,etamin,etamax,nphibins,phimin,phimax);
1899 fhEtaPhiTriggerEMCALBCCluster[i]->SetYTitle("#phi (rad)");
1900 fhEtaPhiTriggerEMCALBCCluster[i]->SetXTitle("#eta");
1901 outputContainer->Add(fhEtaPhiTriggerEMCALBCCluster[i]) ;
126b8c62 1902
afb3af8a 1903 fhEtaPhiTriggerEMCALBCUMCluster[i] = new TH2F
1904 (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger_UnMatch",i-5),
1905 Form("trigger cluster, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-5),
1906 netabins,etamin,etamax,nphibins,phimin,phimax);
1907 fhEtaPhiTriggerEMCALBCUMCluster[i]->SetYTitle("#phi (rad)");
1908 fhEtaPhiTriggerEMCALBCUMCluster[i]->SetXTitle("#eta");
1909 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMCluster[i]) ;
c2a62a94 1910 }
afb3af8a 1911
126b8c62 1912 fhTimeTriggerEMCALBCCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger",
1913 "trigger cluster time vs E of clusters",
1914 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1915 fhTimeTriggerEMCALBCCluster->SetXTitle("E (GeV)");
1916 fhTimeTriggerEMCALBCCluster->SetYTitle("time (ns)");
1917 outputContainer->Add(fhTimeTriggerEMCALBCCluster);
1918
1919 fhTimeTriggerEMCALBCUMCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger_UnMatch",
1920 "trigger cluster time vs E of clusters, unmatched trigger",
1921 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1922 fhTimeTriggerEMCALBCUMCluster->SetXTitle("E (GeV)");
1923 fhTimeTriggerEMCALBCUMCluster->SetYTitle("time (ns)");
1924 outputContainer->Add(fhTimeTriggerEMCALBCUMCluster);
1925
afb3af8a 1926 fhEtaPhiTriggerEMCALBCClusterOverTh = new TH2F
1927 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold",
1928 "trigger cluster E > trigger threshold, #eta vs #phi, Trigger EMCAL-BC=0",
1929 netabins,etamin,etamax,nphibins,phimin,phimax);
1930 fhEtaPhiTriggerEMCALBCClusterOverTh->SetYTitle("#phi (rad)");
1931 fhEtaPhiTriggerEMCALBCClusterOverTh->SetXTitle("#eta");
1932 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterOverTh) ;
85c4406e 1933
afb3af8a 1934 fhEtaPhiTriggerEMCALBCUMClusterOverTh = new TH2F
1935 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold_UnMatch",
1936 "trigger cluster E > trigger threshold, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1937 netabins,etamin,etamax,nphibins,phimin,phimax);
1938 fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetYTitle("#phi (rad)");
1939 fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetXTitle("#eta");
1940 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterOverTh) ;
85c4406e 1941
afb3af8a 1942 fhEtaPhiTriggerEMCALBCClusterBelowTh1 = new TH2F
1943 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1",
1944 "trigger cluster thresh-1 < E < thres, #eta vs #phi, Trigger EMCAL-BC=0",
1945 netabins,etamin,etamax,nphibins,phimin,phimax);
1946 fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetYTitle("#phi (rad)");
1947 fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetXTitle("#eta");
1948 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh1) ;
1949
1950 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1 = new TH2F
1951 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1_UnMatch",
1952 "trigger cluster thresh-1 < E < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1953 netabins,etamin,etamax,nphibins,phimin,phimax);
1954 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetYTitle("#phi (rad)");
1955 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetXTitle("#eta");
1956 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh1) ;
85c4406e 1957
afb3af8a 1958 fhEtaPhiTriggerEMCALBCClusterBelowTh2 = new TH2F
1959 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2",
1960 "trigger cluster thresh-2 < E < thres, #eta vs #phi, Trigger EMCAL-BC=0",
1961 netabins,etamin,etamax,nphibins,phimin,phimax);
1962 fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetYTitle("#phi (rad)");
1963 fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetXTitle("#eta");
1964 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh2) ;
1965
1966 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2 = new TH2F
1967 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2_UnMatch",
1968 "trigger cluster thresh-2 < E < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1969 netabins,etamin,etamax,nphibins,phimin,phimax);
1970 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetYTitle("#phi (rad)");
1971 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetXTitle("#eta");
1972 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh2) ;
85c4406e 1973
afb3af8a 1974 fhEtaPhiTriggerEMCALBCExotic = new TH2F
1975 ("hEtaPhiTriggerExotic",
1976 "cluster E > 2 GeV, #eta vs #phi, Trigger Exotic",
1977 netabins,etamin,etamax,nphibins,phimin,phimax);
1978 fhEtaPhiTriggerEMCALBCExotic->SetYTitle("#phi (rad)");
1979 fhEtaPhiTriggerEMCALBCExotic->SetXTitle("#eta");
1980 outputContainer->Add(fhEtaPhiTriggerEMCALBCExotic) ;
1981
1982 fhTimeTriggerEMCALBCExotic = new TH2F
1983 ("hTimeTriggerExotic",
1984 "cluster time vs E of clusters, Trigger Exotic ",
1985 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1986 fhTimeTriggerEMCALBCExotic->SetXTitle("E (GeV)");
1987 fhTimeTriggerEMCALBCExotic->SetYTitle("time (ns)");
1988 outputContainer->Add(fhTimeTriggerEMCALBCExotic);
85c4406e 1989
afb3af8a 1990 fhEtaPhiTriggerEMCALBCUMExotic = new TH2F
1991 ("hEtaPhiTriggerExotic_UnMatch",
1992 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
1993 netabins,etamin,etamax,nphibins,phimin,phimax);
1994 fhEtaPhiTriggerEMCALBCUMExotic->SetYTitle("#phi (rad)");
1995 fhEtaPhiTriggerEMCALBCUMExotic->SetXTitle("#eta");
1996 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExotic) ;
1997
1998 fhTimeTriggerEMCALBCUMExotic = new TH2F
1999 ("hTimeTriggerExotic_UnMatch",
2000 "cluster time vs E of clusters, unmatched trigger Exotic",
2001 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2002 fhTimeTriggerEMCALBCUMExotic->SetXTitle("E (GeV)");
2003 fhTimeTriggerEMCALBCUMExotic->SetYTitle("time (ns)");
2004 outputContainer->Add(fhTimeTriggerEMCALBCUMExotic);
2005
2006 fhEtaPhiTriggerEMCALBCExoticCluster = new TH2F
2007 ("hEtaPhiTriggerExotic_OnlyTrigger",
2008 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Exotic",
2009 netabins,etamin,etamax,nphibins,phimin,phimax);
2010 fhEtaPhiTriggerEMCALBCExoticCluster->SetYTitle("#phi (rad)");
2011 fhEtaPhiTriggerEMCALBCExoticCluster->SetXTitle("#eta");
2012 outputContainer->Add(fhEtaPhiTriggerEMCALBCExoticCluster) ;
2013
2014 fhTimeTriggerEMCALBCExoticCluster = new TH2F
2015 ("hTimeTriggerExotic_OnlyTrigger",
2016 "trigger cluster time vs E of clusters, Trigger Exotic",
2017 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2018 fhTimeTriggerEMCALBCExoticCluster->SetXTitle("E (GeV)");
2019 fhTimeTriggerEMCALBCExoticCluster->SetYTitle("time (ns)");
2020 outputContainer->Add(fhTimeTriggerEMCALBCExoticCluster);
2021
2022 fhEtaPhiTriggerEMCALBCUMExoticCluster = new TH2F
2023 ("hEtaPhiTriggerExotic_OnlyTrigger_UnMatch",
2024 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
2025 netabins,etamin,etamax,nphibins,phimin,phimax);
2026 fhEtaPhiTriggerEMCALBCUMExoticCluster->SetYTitle("#phi (rad)");
2027 fhEtaPhiTriggerEMCALBCUMExoticCluster->SetXTitle("#eta");
2028 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExoticCluster) ;
2029
2030 fhTimeTriggerEMCALBCUMExoticCluster = new TH2F
2031 ("hTimeTriggerExotic_OnlyTrigger_UnMatch",
2032 "trigger cluster time vs E of clusters, unmatched trigger Exotic",
2033 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2034 fhTimeTriggerEMCALBCUMExoticCluster->SetXTitle("E (GeV)");
2035 fhTimeTriggerEMCALBCUMExoticCluster->SetYTitle("time (ns)");
2036 outputContainer->Add(fhTimeTriggerEMCALBCUMExoticCluster);
2037
2038 fhEtaPhiTriggerEMCALBCBad = new TH2F
2039 ("hEtaPhiTriggerBad",
2040 "cluster E > 2 GeV, #eta vs #phi, Trigger Bad",
2041 netabins,etamin,etamax,nphibins,phimin,phimax);
2042 fhEtaPhiTriggerEMCALBCBad->SetYTitle("#phi (rad)");
2043 fhEtaPhiTriggerEMCALBCBad->SetXTitle("#eta");
2044 outputContainer->Add(fhEtaPhiTriggerEMCALBCBad) ;
2045
2046 fhTimeTriggerEMCALBCBad = new TH2F
2047 ("hTimeTriggerBad",
2048 "cluster time vs E of clusters, Trigger Bad ",
2049 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2050 fhTimeTriggerEMCALBCBad->SetXTitle("E (GeV)");
2051 fhTimeTriggerEMCALBCBad->SetYTitle("time (ns)");
2052 outputContainer->Add(fhTimeTriggerEMCALBCBad);
2053
2054 fhEtaPhiTriggerEMCALBCUMBad = new TH2F
2055 ("hEtaPhiTriggerBad_UnMatch",
2056 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad",
2057 netabins,etamin,etamax,nphibins,phimin,phimax);
2058 fhEtaPhiTriggerEMCALBCUMBad->SetYTitle("#phi (rad)");
2059 fhEtaPhiTriggerEMCALBCUMBad->SetXTitle("#eta");
2060 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBad) ;
2061
2062 fhTimeTriggerEMCALBCUMBad = new TH2F
2063 ("hTimeTriggerBad_UnMatch",
2064 "cluster time vs E of clusters, unmatched trigger Bad",
2065 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2066 fhTimeTriggerEMCALBCUMBad->SetXTitle("E (GeV)");
2067 fhTimeTriggerEMCALBCUMBad->SetYTitle("time (ns)");
2068 outputContainer->Add(fhTimeTriggerEMCALBCUMBad);
2069
2070 fhEtaPhiTriggerEMCALBCBadCluster = new TH2F
2071 ("hEtaPhiTriggerBad_OnlyTrigger",
2072 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Bad",
2073 netabins,etamin,etamax,nphibins,phimin,phimax);
2074 fhEtaPhiTriggerEMCALBCBadCluster->SetYTitle("#phi (rad)");
2075 fhEtaPhiTriggerEMCALBCBadCluster->SetXTitle("#eta");
2076 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadCluster) ;
2077
2078 fhTimeTriggerEMCALBCBadCluster = new TH2F
2079 ("hTimeTriggerBad_OnlyTrigger",
2080 "trigger cluster time vs E of clusters, Trigger Bad",
2081 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2082 fhTimeTriggerEMCALBCBadCluster->SetXTitle("E (GeV)");
2083 fhTimeTriggerEMCALBCBadCluster->SetYTitle("time (ns)");
2084 outputContainer->Add(fhTimeTriggerEMCALBCBadCluster);
2085
2086 fhEtaPhiTriggerEMCALBCUMBadCluster = new TH2F
2087 ("hEtaPhiTriggerBad_OnlyTrigger_UnMatch",
2088 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad",
2089 netabins,etamin,etamax,nphibins,phimin,phimax);
2090 fhEtaPhiTriggerEMCALBCUMBadCluster->SetYTitle("#phi (rad)");
2091 fhEtaPhiTriggerEMCALBCUMBadCluster->SetXTitle("#eta");
2092 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadCluster) ;
2093
2094 fhTimeTriggerEMCALBCUMBadCluster = new TH2F
2095 ("hTimeTriggerBad_OnlyTrigger_UnMatch",
2096 "trigger cluster time vs E of clusters, unmatched trigger Bad",
2097 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2098 fhTimeTriggerEMCALBCUMBadCluster->SetXTitle("E (GeV)");
2099 fhTimeTriggerEMCALBCUMBadCluster->SetYTitle("time (ns)");
2100 outputContainer->Add(fhTimeTriggerEMCALBCUMBadCluster);
2101
6265ad55 2102 fhEtaPhiTriggerEMCALBCBadExotic = new TH2F
2103 ("hEtaPhiTriggerBadExotic",
2104 "cluster E > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
2105 netabins,etamin,etamax,nphibins,phimin,phimax);
2106 fhEtaPhiTriggerEMCALBCBadExotic->SetYTitle("#phi (rad)");
2107 fhEtaPhiTriggerEMCALBCBadExotic->SetXTitle("#eta");
2108 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExotic) ;
2109
2110 fhTimeTriggerEMCALBCBadExotic = new TH2F
2111 ("hTimeTriggerBadExotic",
2112 "cluster time vs E of clusters, Trigger Bad&Exotic ",
2113 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2114 fhTimeTriggerEMCALBCBadExotic->SetXTitle("E (GeV)");
2115 fhTimeTriggerEMCALBCBadExotic->SetYTitle("time (ns)");
2116 outputContainer->Add(fhTimeTriggerEMCALBCBadExotic);
2117
2118 fhEtaPhiTriggerEMCALBCUMBadExotic = new TH2F
2119 ("hEtaPhiTriggerBadExotic_UnMatch",
2120 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
2121 netabins,etamin,etamax,nphibins,phimin,phimax);
2122 fhEtaPhiTriggerEMCALBCUMBadExotic->SetYTitle("#phi (rad)");
2123 fhEtaPhiTriggerEMCALBCUMBadExotic->SetXTitle("#eta");
2124 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExotic) ;
2125
2126 fhTimeTriggerEMCALBCUMBadExotic = new TH2F
2127 ("hTimeTriggerBadExotic_UnMatch",
2128 "cluster time vs E of clusters, unmatched trigger Bad&Exotic",
2129 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2130 fhTimeTriggerEMCALBCUMBadExotic->SetXTitle("E (GeV)");
2131 fhTimeTriggerEMCALBCUMBadExotic->SetYTitle("time (ns)");
2132 outputContainer->Add(fhTimeTriggerEMCALBCUMBadExotic);
2133
2134 fhEtaPhiTriggerEMCALBCBadExoticCluster = new TH2F
2135 ("hEtaPhiTriggerBadExotic_OnlyTrigger",
2136 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
2137 netabins,etamin,etamax,nphibins,phimin,phimax);
2138 fhEtaPhiTriggerEMCALBCBadExoticCluster->SetYTitle("#phi (rad)");
2139 fhEtaPhiTriggerEMCALBCBadExoticCluster->SetXTitle("#eta");
2140 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExoticCluster) ;
2141
2142 fhTimeTriggerEMCALBCBadExoticCluster = new TH2F
2143 ("hTimeTriggerBadExotic_OnlyTrigger",
2144 "trigger cluster time vs E of clusters, Trigger Bad&Exotic",
2145 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2146 fhTimeTriggerEMCALBCBadExoticCluster->SetXTitle("E (GeV)");
2147 fhTimeTriggerEMCALBCBadExoticCluster->SetYTitle("time (ns)");
2148 outputContainer->Add(fhTimeTriggerEMCALBCBadExoticCluster);
2149
2150 fhEtaPhiTriggerEMCALBCUMBadExoticCluster = new TH2F
2151 ("hEtaPhiTriggerBadExotic_OnlyTrigger_UnMatch",
2152 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
2153 netabins,etamin,etamax,nphibins,phimin,phimax);
2154 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetYTitle("#phi (rad)");
2155 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetXTitle("#eta");
2156 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExoticCluster) ;
2157
2158 fhTimeTriggerEMCALBCUMBadExoticCluster = new TH2F
2159 ("hTimeTriggerBadExotic_OnlyTrigger_UnMatch",
2160 "trigger cluster time vs E of clusters, unmatched trigger Bad&Exotic",
2161 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2162 fhTimeTriggerEMCALBCUMBadExoticCluster->SetXTitle("E (GeV)");
2163 fhTimeTriggerEMCALBCUMBadExoticCluster->SetYTitle("time (ns)");
2164 outputContainer->Add(fhTimeTriggerEMCALBCUMBadExoticCluster);
2165
1035a8d9 2166 fhTimeTriggerEMCALBCBadMaxCell = new TH2F
2167 ("hTimeTriggerBadMaxCell",
2168 "cluster time vs E of clusters, Trigger BadMaxCell",
2169 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2170 fhTimeTriggerEMCALBCBadMaxCell->SetXTitle("E (GeV)");
2171 fhTimeTriggerEMCALBCBadMaxCell->SetYTitle("time (ns)");
2172 outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCell);
85c4406e 2173
1035a8d9 2174 fhTimeTriggerEMCALBCUMBadMaxCell = new TH2F
2175 ("hTimeTriggerBadMaxCell_UnMatch",
2176 "cluster time vs E of clusters, unmatched trigger BadMaxCell",
2177 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2178 fhTimeTriggerEMCALBCUMBadMaxCell->SetXTitle("E (GeV)");
2179 fhTimeTriggerEMCALBCUMBadMaxCell->SetYTitle("time (ns)");
2180 outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCell);
2181
2182
2183 fhTimeTriggerEMCALBCBadMaxCellExotic = new TH2F
2184 ("hTimeTriggerBadMaxCellExotic",
2185 "cluster time vs E of clusters, Trigger BadMaxCell&Exotic",
2186 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2187 fhTimeTriggerEMCALBCBadMaxCellExotic->SetXTitle("E (GeV)");
2188 fhTimeTriggerEMCALBCBadMaxCellExotic->SetYTitle("time (ns)");
2189 outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCellExotic);
2190
2191 fhTimeTriggerEMCALBCUMBadMaxCellExotic = new TH2F
2192 ("hTimeTriggerBadMaxCellExotic_UnMatch",
2193 "cluster time vs E of clusters, unmatched trigger BadMaxCell&Exotic",
2194 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2195 fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetXTitle("E (GeV)");
2196 fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetYTitle("time (ns)");
2197 outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCellExotic);
85c4406e 2198
afb3af8a 2199 fhTimeNoTrigger = new TH2F
2200 ("hTimeNoTrigger",
2201 "events with no foundable trigger, time vs e of clusters",
2202 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2203 fhTimeNoTrigger->SetXTitle("E (GeV)");
2204 fhTimeNoTrigger->SetYTitle("time (ns)");
2205 outputContainer->Add(fhTimeNoTrigger);
85c4406e 2206
afb3af8a 2207 fhEtaPhiNoTrigger = new TH2F
2208 ("hEtaPhiNoTrigger",
2209 "events with no foundable trigger, eta vs phi of clusters",
2210 netabins,etamin,etamax,nphibins,phimin,phimax);
2211 fhEtaPhiNoTrigger->SetYTitle("#phi (rad)");
2212 fhEtaPhiNoTrigger->SetXTitle("#eta");
2213 outputContainer->Add(fhEtaPhiNoTrigger) ;
85c4406e 2214
2215
126b8c62 2216 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_OpenTime",
85c4406e 2217 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time",
2218 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2219 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("#phi (rad)");
2220 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("#eta");
2221 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster) ;
85c4406e 2222
126b8c62 2223 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_OpenTime",
85c4406e 2224 "cluster time vs E of clusters, no match, rematch open time",
2225 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2226 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("E (GeV)");
2227 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("time (ns)");
2228 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster);
85c4406e 2229
2230
126b8c62 2231 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
85c4406e 2232 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch with neighbour patches",
2233 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2234 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("#phi (rad)");
2235 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("#eta");
2236 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster) ;
85c4406e 2237
126b8c62 2238 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
85c4406e 2239 "cluster time vs E of clusters, no match, rematch with neigbour parches",
2240 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2241 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("E (GeV)");
2242 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("time (ns)");
2243 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster);
85c4406e 2244
126b8c62 2245 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_Both",
85c4406e 2246 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time and neighbour",
2247 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2248 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetYTitle("#phi (rad)");
2249 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetXTitle("#eta");
2250 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchBothCluster) ;
85c4406e 2251
126b8c62 2252 fhTimeTriggerEMCALBCUMReMatchBothCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_Both",
85c4406e 2253 "cluster time vs E of clusters, no match, rematch open time and neigbour",
2254 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2255 fhTimeTriggerEMCALBCUMReMatchBothCluster->SetXTitle("E (GeV)");
2256 fhTimeTriggerEMCALBCUMReMatchBothCluster->SetYTitle("time (ns)");
2257 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchBothCluster);
2258
2259 fhTimeTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_OpenTime",
2260 "cluster time vs E of clusters, no match, rematch open time",
2261 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2262 fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("E (GeV)");
2263 fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("time (ns)");
2264 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchOpenTime);
2265
2266
2267 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
2268 "cluster time vs E of clusters, no match, rematch with neigbour parches",
2269 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2270 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("E (GeV)");
2271 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("time (ns)");
2272 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchCheckNeigh);
2273
2274 fhTimeTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_Both",
2275 "cluster time vs E of clusters, no match, rematch open time and neigbour",
2276 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2277 fhTimeTriggerEMCALBC0UMReMatchBoth->SetXTitle("E (GeV)");
2278 fhTimeTriggerEMCALBC0UMReMatchBoth->SetYTitle("time (ns)");
2279 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchBoth);
85c4406e 2280
c2a62a94 2281 }
2282
477d6cee 2283 fhPhiPhoton = new TH2F
85c4406e 2284 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
6175da48 2285 fhPhiPhoton->SetYTitle("#phi (rad)");
477d6cee 2286 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
85c4406e 2287 outputContainer->Add(fhPhiPhoton) ;
477d6cee 2288
2289 fhEtaPhoton = new TH2F
85c4406e 2290 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
477d6cee 2291 fhEtaPhoton->SetYTitle("#eta");
2292 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
2293 outputContainer->Add(fhEtaPhoton) ;
2294
6175da48 2295 fhEtaPhiPhoton = new TH2F
85c4406e 2296 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
6175da48 2297 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
2298 fhEtaPhiPhoton->SetXTitle("#eta");
2299 outputContainer->Add(fhEtaPhiPhoton) ;
34c16486 2300 if(GetMinPt() < 0.5)
2301 {
20218aea 2302 fhEtaPhi05Photon = new TH2F
85c4406e 2303 ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
20218aea 2304 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
2305 fhEtaPhi05Photon->SetXTitle("#eta");
2306 outputContainer->Add(fhEtaPhi05Photon) ;
2307 }
85c4406e 2308
c2a62a94 2309 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
2310 {
2311 fhEtaPhiPhotonEMCALBC0 = new TH2F
ba490f85 2312 ("hEtaPhiPhotonEMCALBC0","identified photon, E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
c2a62a94 2313 fhEtaPhiPhotonEMCALBC0->SetYTitle("#phi (rad)");
2314 fhEtaPhiPhotonEMCALBC0->SetXTitle("#eta");
2315 outputContainer->Add(fhEtaPhiPhotonEMCALBC0) ;
2316
2317 fhEtaPhiPhotonEMCALBC1 = new TH2F
ba490f85 2318 ("hEtaPhiPhotonEMCALBC1","identified photon, E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
c2a62a94 2319 fhEtaPhiPhotonEMCALBC1->SetYTitle("#phi (rad)");
2320 fhEtaPhiPhotonEMCALBC1->SetXTitle("#eta");
2321 outputContainer->Add(fhEtaPhiPhotonEMCALBC1) ;
2322
2323 fhEtaPhiPhotonEMCALBCN = new TH2F
ba490f85 2324 ("hEtaPhiPhotonEMCALBCN","identified photon, E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
c2a62a94 2325 fhEtaPhiPhotonEMCALBCN->SetYTitle("#phi (rad)");
2326 fhEtaPhiPhotonEMCALBCN->SetXTitle("#eta");
2327 outputContainer->Add(fhEtaPhiPhotonEMCALBCN) ;
2328
afb3af8a 2329 for(Int_t i = 0; i < 11; i++)
c2a62a94 2330 {
2331 fhEtaPhiPhotonTriggerEMCALBC[i] = new TH2F
2332 (Form("hEtaPhiPhotonTriggerEMCALBC%d",i-5),
afb3af8a 2333 Form("photon E > 2 GeV, #eta vs #phi, PhotonTrigger EMCAL-BC=%d",i-5),
c2a62a94 2334 netabins,etamin,etamax,nphibins,phimin,phimax);
2335 fhEtaPhiPhotonTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
2336 fhEtaPhiPhotonTriggerEMCALBC[i]->SetXTitle("#eta");
2337 outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBC[i]) ;
2338
2339 fhTimePhotonTriggerEMCALBC[i] = new TH2F
2340 (Form("hTimePhotonTriggerEMCALBC%d",i-5),
afb3af8a 2341 Form("photon time vs E of clusters, PhotonTrigger EMCAL-BC=%d",i-5),
c2a62a94 2342 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2343 fhTimePhotonTriggerEMCALBC[i]->SetXTitle("E (GeV)");
2344 fhTimePhotonTriggerEMCALBC[i]->SetYTitle("time (ns)");
2345 outputContainer->Add(fhTimePhotonTriggerEMCALBC[i]);
2346
2347 fhTimePhotonTriggerEMCALBCPileUpSPD[i] = new TH2F
2348 (Form("hTimePhotonTriggerEMCALBC%dPileUpSPD",i-5),
afb3af8a 2349 Form("photon time vs E, PhotonTrigger EMCAL-BC=%d",i-5),
c2a62a94 2350 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2351 fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
2352 fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
2353 outputContainer->Add(fhTimePhotonTriggerEMCALBCPileUpSPD[i]);
2354
afb3af8a 2355 fhEtaPhiPhotonTriggerEMCALBCUM[i] = new TH2F
2356 (Form("hEtaPhiPhotonTriggerEMCALBC%d_UnMatch",i-5),
2357 Form("photon E > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-5),
2358 netabins,etamin,etamax,nphibins,phimin,phimax);
2359 fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
2360 fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetXTitle("#eta");
2361 outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBCUM[i]) ;
2362
2363 fhTimePhotonTriggerEMCALBCUM[i] = new TH2F
2364 (Form("hTimePhotonTriggerEMCALBC%d_UnMatch",i-5),
2365 Form("photon time vs E, unmatched trigger EMCAL-BC=%d",i-5),
2366 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2367 fhTimePhotonTriggerEMCALBCUM[i]->SetXTitle("E (GeV)");
2368 fhTimePhotonTriggerEMCALBCUM[i]->SetYTitle("time (ns)");
2369 outputContainer->Add(fhTimePhotonTriggerEMCALBCUM[i]);
2370
c2a62a94 2371 }
126b8c62 2372
2373 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_OpenTime",
2374 "cluster time vs E of photons, no match, rematch open time",
2375 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2376 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("E (GeV)");
2377 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("time (ns)");
2378 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime);
2379
2380
2381 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
2382 "cluster time vs E of photons, no match, rematch with neigbour parches",
2383 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2384 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("E (GeV)");
2385 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("time (ns)");
2386 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh);
2387
2388 fhTimePhotonTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_Both",
2389 "cluster time vs E of photons, no match, rematch open time and neigbour",
2390 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2391 fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetXTitle("E (GeV)");
2392 fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetYTitle("time (ns)");
2393 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchBoth);
2394
c2a62a94 2395 }
6175da48 2396
9e51e29a 2397 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
85c4406e 2398 nptbins,ptmin,ptmax,10,0,10);
9e51e29a 2399 fhNLocMax ->SetYTitle("N maxima");
2400 fhNLocMax ->SetXTitle("E (GeV)");
85c4406e 2401 outputContainer->Add(fhNLocMax) ;
9e51e29a 2402
521636d2 2403 //Shower shape
34c16486 2404 if(fFillSSHistograms)
2405 {
85c4406e 2406 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2407 fhLam0E->SetYTitle("#lambda_{0}^{2}");
2408 fhLam0E->SetXTitle("E (GeV)");
85c4406e 2409 outputContainer->Add(fhLam0E);
521636d2 2410
85c4406e 2411 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2412 fhLam1E->SetYTitle("#lambda_{1}^{2}");
2413 fhLam1E->SetXTitle("E (GeV)");
85c4406e 2414 outputContainer->Add(fhLam1E);
521636d2 2415
85c4406e 2416 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2417 fhDispE->SetYTitle("D^{2}");
2418 fhDispE->SetXTitle("E (GeV) ");
2419 outputContainer->Add(fhDispE);
85c4406e 2420
b5dbb99b 2421 if(!fRejectTrackMatch)
2422 {
85c4406e 2423 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 2424 fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
2425 fhLam0ETM->SetXTitle("E (GeV)");
85c4406e 2426 outputContainer->Add(fhLam0ETM);
b5dbb99b 2427
85c4406e 2428 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 2429 fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
2430 fhLam1ETM->SetXTitle("E (GeV)");
85c4406e 2431 outputContainer->Add(fhLam1ETM);
b5dbb99b 2432
85c4406e 2433 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 2434 fhDispETM->SetYTitle("D^{2}");
2435 fhDispETM->SetXTitle("E (GeV) ");
2436 outputContainer->Add(fhDispETM);
2437 }
521636d2 2438
b5dbb99b 2439 if(fCalorimeter == "EMCAL")
2440 {
85c4406e 2441 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2442 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
2443 fhLam0ETRD->SetXTitle("E (GeV)");
85c4406e 2444 outputContainer->Add(fhLam0ETRD);
521636d2 2445
85c4406e 2446 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2447 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
2448 fhLam1ETRD->SetXTitle("E (GeV)");
85c4406e 2449 outputContainer->Add(fhLam1ETRD);
521636d2 2450
85c4406e 2451 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2452 fhDispETRD->SetYTitle("Dispersion^{2}");
2453 fhDispETRD->SetXTitle("E (GeV) ");
b5dbb99b 2454 outputContainer->Add(fhDispETRD);
2455
2456 if(!fRejectTrackMatch)
2457 {
85c4406e 2458 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 2459 fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
2460 fhLam0ETMTRD->SetXTitle("E (GeV)");
85c4406e 2461 outputContainer->Add(fhLam0ETMTRD);
b5dbb99b 2462
85c4406e 2463 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 2464 fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
2465 fhLam1ETMTRD->SetXTitle("E (GeV)");
85c4406e 2466 outputContainer->Add(fhLam1ETMTRD);
b5dbb99b 2467
85c4406e 2468 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 2469 fhDispETMTRD->SetYTitle("Dispersion^{2}");
2470 fhDispETMTRD->SetXTitle("E (GeV) ");
85c4406e 2471 outputContainer->Add(fhDispETMTRD);
2472 }
2473 }
521636d2 2474
764ab1f4 2475 if(!fFillOnlySimpleSSHisto)
34c16486 2476 {
85c4406e 2477 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2478 fhNCellsLam0LowE->SetXTitle("N_{cells}");
2479 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2480 outputContainer->Add(fhNCellsLam0LowE);
764ab1f4 2481
85c4406e 2482 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2483 fhNCellsLam0HighE->SetXTitle("N_{cells}");
2484 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2485 outputContainer->Add(fhNCellsLam0HighE);
764ab1f4 2486
85c4406e 2487 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2488 fhNCellsLam1LowE->SetXTitle("N_{cells}");
2489 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2490 outputContainer->Add(fhNCellsLam1LowE);
764ab1f4 2491
85c4406e 2492 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2493 fhNCellsLam1HighE->SetXTitle("N_{cells}");
2494 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2495 outputContainer->Add(fhNCellsLam1HighE);
764ab1f4 2496
85c4406e 2497 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2498 fhNCellsDispLowE->SetXTitle("N_{cells}");
2499 fhNCellsDispLowE->SetYTitle("D^{2}");
85c4406e 2500 outputContainer->Add(fhNCellsDispLowE);
764ab1f4 2501
85c4406e 2502 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2503 fhNCellsDispHighE->SetXTitle("N_{cells}");
2504 fhNCellsDispHighE->SetYTitle("D^{2}");
85c4406e 2505 outputContainer->Add(fhNCellsDispHighE);
764ab1f4 2506
85c4406e 2507 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
764ab1f4 2508 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
2509 fhEtaLam0LowE->SetXTitle("#eta");
85c4406e 2510 outputContainer->Add(fhEtaLam0LowE);
764ab1f4 2511
85c4406e 2512 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
764ab1f4 2513 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
2514 fhPhiLam0LowE->SetXTitle("#phi");
85c4406e 2515 outputContainer->Add(fhPhiLam0LowE);
764ab1f4 2516
85c4406e 2517 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
764ab1f4 2518 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
2519 fhEtaLam0HighE->SetXTitle("#eta");
85c4406e 2520 outputContainer->Add(fhEtaLam0HighE);
764ab1f4 2521
85c4406e 2522 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
764ab1f4 2523 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
2524 fhPhiLam0HighE->SetXTitle("#phi");
85c4406e 2525 outputContainer->Add(fhPhiLam0HighE);
764ab1f4 2526
85c4406e 2527 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2528 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
2529 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
85c4406e 2530 outputContainer->Add(fhLam1Lam0LowE);
764ab1f4 2531
85c4406e 2532 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2533 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
2534 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
85c4406e 2535 outputContainer->Add(fhLam1Lam0HighE);
764ab1f4 2536
85c4406e 2537 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2538 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
2539 fhLam0DispLowE->SetYTitle("D^{2}");
85c4406e 2540 outputContainer->Add(fhLam0DispLowE);
764ab1f4 2541
85c4406e 2542 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2543 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
2544 fhLam0DispHighE->SetYTitle("D^{2}");
85c4406e 2545 outputContainer->Add(fhLam0DispHighE);
764ab1f4 2546
85c4406e 2547 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2548 fhDispLam1LowE->SetXTitle("D^{2}");
2549 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
85c4406e 2550 outputContainer->Add(fhDispLam1LowE);
764ab1f4 2551
85c4406e 2552 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2553 fhDispLam1HighE->SetXTitle("D^{2}");
2554 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
85c4406e 2555 outputContainer->Add(fhDispLam1HighE);
764ab1f4 2556
2557 if(fCalorimeter == "EMCAL")
34c16486 2558 {
85c4406e 2559 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);
764ab1f4 2560 fhDispEtaE->SetXTitle("E (GeV)");
2561 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
85c4406e 2562 outputContainer->Add(fhDispEtaE);
764ab1f4 2563
85c4406e 2564 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);
764ab1f4 2565 fhDispPhiE->SetXTitle("E (GeV)");
2566 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2567 outputContainer->Add(fhDispPhiE);
764ab1f4 2568
85c4406e 2569 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);
764ab1f4 2570 fhSumEtaE->SetXTitle("E (GeV)");
2571 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
85c4406e 2572 outputContainer->Add(fhSumEtaE);
764ab1f4 2573
85c4406e 2574 fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
2575 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
764ab1f4 2576 fhSumPhiE->SetXTitle("E (GeV)");
2577 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
85c4406e 2578 outputContainer->Add(fhSumPhiE);
764ab1f4 2579
85c4406e 2580 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
2581 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
764ab1f4 2582 fhSumEtaPhiE->SetXTitle("E (GeV)");
2583 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
2584 outputContainer->Add(fhSumEtaPhiE);
2585
85c4406e 2586 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
2587 nptbins,ptmin,ptmax,200, -10,10);
764ab1f4 2588 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
2589 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
85c4406e 2590 outputContainer->Add(fhDispEtaPhiDiffE);
bfdcf7fb 2591
85c4406e 2592 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
2593 nptbins,ptmin,ptmax, 200, -1,1);
764ab1f4 2594 fhSphericityE->SetXTitle("E (GeV)");
2595 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
2596 outputContainer->Add(fhSphericityE);
bfdcf7fb 2597
85c4406e 2598 fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
764ab1f4 2599 fhDispSumEtaDiffE->SetXTitle("E (GeV)");
2600 fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
85c4406e 2601 outputContainer->Add(fhDispSumEtaDiffE);
764ab1f4 2602
85c4406e 2603 fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
764ab1f4 2604 fhDispSumPhiDiffE->SetXTitle("E (GeV)");
2605 fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
85c4406e 2606 outputContainer->Add(fhDispSumPhiDiffE);
764ab1f4 2607
2608 for(Int_t i = 0; i < 7; i++)
2609 {
85c4406e 2610 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]),
2611 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2612 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
2613 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2614 outputContainer->Add(fhDispEtaDispPhi[i]);
764ab1f4 2615
85c4406e 2616 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]),
2617 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2618 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
2619 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
85c4406e 2620 outputContainer->Add(fhLambda0DispEta[i]);
764ab1f4 2621
85c4406e 2622 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]),
2623 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2624 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
2625 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2626 outputContainer->Add(fhLambda0DispPhi[i]);
764ab1f4 2627 }
34c16486 2628 }
2629 }
521636d2 2630 } // Shower shape
2631
09273901 2632 // Track Matching
2633
b5dbb99b 2634 if(fFillTMHisto)
2635 {
b2e375c7 2636 TString cutTM [] = {"NoCut",""};
b5dbb99b 2637
b2e375c7 2638 for(Int_t i = 0; i < 2; i++)
31ae6d59 2639 {
b2e375c7 2640 fhTrackMatchedDEta[i] = new TH2F
2641 (Form("hTrackMatchedDEta%s",cutTM[i].Data()),
2642 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2643 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2644 fhTrackMatchedDEta[i]->SetYTitle("d#eta");
2645 fhTrackMatchedDEta[i]->SetXTitle("E_{cluster} (GeV)");
4bfeae64 2646
b2e375c7 2647 fhTrackMatchedDPhi[i] = new TH2F
2648 (Form("hTrackMatchedDPhi%s",cutTM[i].Data()),
2649 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2650 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2651 fhTrackMatchedDPhi[i]->SetYTitle("d#phi (rad)");
2652 fhTrackMatchedDPhi[i]->SetXTitle("E_{cluster} (GeV)");
2653
2654 fhTrackMatchedDEtaDPhi[i] = new TH2F
2655 (Form("hTrackMatchedDEtaDPhi%s",cutTM[i].Data()),
2656 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2657 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2658 fhTrackMatchedDEtaDPhi[i]->SetYTitle("d#phi (rad)");
2659 fhTrackMatchedDEtaDPhi[i]->SetXTitle("d#eta");
2660
2661 fhTrackMatchedDEtaPos[i] = new TH2F
2662 (Form("hTrackMatchedDEtaPos%s",cutTM[i].Data()),
2663 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2664 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2665 fhTrackMatchedDEtaPos[i]->SetYTitle("d#eta");
2666 fhTrackMatchedDEtaPos[i]->SetXTitle("E_{cluster} (GeV)");
8d6b7f60 2667
b2e375c7 2668 fhTrackMatchedDPhiPos[i] = new TH2F
2669 (Form("hTrackMatchedDPhiPos%s",cutTM[i].Data()),
2670 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2671 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2672 fhTrackMatchedDPhiPos[i]->SetYTitle("d#phi (rad)");
2673 fhTrackMatchedDPhiPos[i]->SetXTitle("E_{cluster} (GeV)");
2674
2675 fhTrackMatchedDEtaDPhiPos[i] = new TH2F
2676 (Form("hTrackMatchedDEtaDPhiPos%s",cutTM[i].Data()),
2677 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2678 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2679 fhTrackMatchedDEtaDPhiPos[i]->SetYTitle("d#phi (rad)");
2680 fhTrackMatchedDEtaDPhiPos[i]->SetXTitle("d#eta");
2681
2682 fhTrackMatchedDEtaNeg[i] = new TH2F
2683 (Form("hTrackMatchedDEtaNeg%s",cutTM[i].Data()),
2684 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2685 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2686 fhTrackMatchedDEtaNeg[i]->SetYTitle("d#eta");
2687 fhTrackMatchedDEtaNeg[i]->SetXTitle("E_{cluster} (GeV)");
4bfeae64 2688
b2e375c7 2689 fhTrackMatchedDPhiNeg[i] = new TH2F
2690 (Form("hTrackMatchedDPhiNeg%s",cutTM[i].Data()),
2691 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2692 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2693 fhTrackMatchedDPhiNeg[i]->SetYTitle("d#phi (rad)");
2694 fhTrackMatchedDPhiNeg[i]->SetXTitle("E_{cluster} (GeV)");
2695
2696 fhTrackMatchedDEtaDPhiNeg[i] = new TH2F
2697 (Form("hTrackMatchedDEtaDPhiNeg%s",cutTM[i].Data()),
2698 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2699 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2700 fhTrackMatchedDEtaDPhiNeg[i]->SetYTitle("d#phi (rad)");
2701 fhTrackMatchedDEtaDPhiNeg[i]->SetXTitle("d#eta");
2702
2703 fhdEdx[i] = new TH2F (Form("hdEdx%s",cutTM[i].Data()),Form("matched track <dE/dx> vs cluster E, %s",cutTM[i].Data()),
2704 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
2705 fhdEdx[i]->SetXTitle("E (GeV)");
2706 fhdEdx[i]->SetYTitle("<dE/dx>");
2707
2708 fhEOverP[i] = new TH2F (Form("hEOverP%s",cutTM[i].Data()),Form("matched track E/p vs cluster E, %s",cutTM[i].Data()),
2709 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2710 fhEOverP[i]->SetXTitle("E (GeV)");
2711 fhEOverP[i]->SetYTitle("E/p");
2712
2713 outputContainer->Add(fhTrackMatchedDEta[i]) ;
2714 outputContainer->Add(fhTrackMatchedDPhi[i]) ;
2715 outputContainer->Add(fhTrackMatchedDEtaDPhi[i]) ;
2716 outputContainer->Add(fhTrackMatchedDEtaPos[i]) ;
2717 outputContainer->Add(fhTrackMatchedDPhiPos[i]) ;
2718 outputContainer->Add(fhTrackMatchedDEtaDPhiPos[i]) ;
2719 outputContainer->Add(fhTrackMatchedDEtaNeg[i]) ;
2720 outputContainer->Add(fhTrackMatchedDPhiNeg[i]) ;
2721 outputContainer->Add(fhTrackMatchedDEtaDPhiNeg[i]) ;
2722 outputContainer->Add(fhdEdx[i]);
2723 outputContainer->Add(fhEOverP[i]);
2724
2725 if(fCalorimeter=="EMCAL")
2726 {
2727 fhTrackMatchedDEtaTRD[i] = new TH2F
2728 (Form("hTrackMatchedDEtaTRD%s",cutTM[i].Data()),
2729 Form("d#eta of cluster-track vs cluster energy, SM behind TRD, %s",cutTM[i].Data()),
2730 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2731 fhTrackMatchedDEtaTRD[i]->SetYTitle("d#eta");
2732 fhTrackMatchedDEtaTRD[i]->SetXTitle("E_{cluster} (GeV)");
2733
2734 fhTrackMatchedDPhiTRD[i] = new TH2F
2735 (Form("hTrackMatchedDPhiTRD%s",cutTM[i].Data()),
2736 Form("d#phi of cluster-track vs cluster energy, SM behing TRD, %s",cutTM[i].Data()),
2737 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2738 fhTrackMatchedDPhiTRD[i]->SetYTitle("d#phi (rad)");
2739 fhTrackMatchedDPhiTRD[i]->SetXTitle("E_{cluster} (GeV)");
2740
2741 fhEOverPTRD[i] = new TH2F
2742 (Form("hEOverPTRD%s",cutTM[i].Data()),
2743 Form("matched track E/p vs cluster E, behind TRD, %s",cutTM[i].Data()),
2744 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2745 fhEOverPTRD[i]->SetXTitle("E (GeV)");
2746 fhEOverPTRD[i]->SetYTitle("E/p");
2747
2748 outputContainer->Add(fhTrackMatchedDEtaTRD[i]) ;
2749 outputContainer->Add(fhTrackMatchedDPhiTRD[i]) ;
2750 outputContainer->Add(fhEOverPTRD[i]);
2751 }
8d6b7f60 2752
b2e375c7 2753 if(IsDataMC())
2754 {
2755 fhTrackMatchedDEtaMCNoOverlap[i] = new TH2F
2756 (Form("hTrackMatchedDEtaMCNoOverlap%s",cutTM[i].Data()),
2757 Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
2758 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2759 fhTrackMatchedDEtaMCNoOverlap[i]->SetYTitle("d#eta");
2760 fhTrackMatchedDEtaMCNoOverlap[i]->SetXTitle("E_{cluster} (GeV)");
2761
2762 fhTrackMatchedDPhiMCNoOverlap[i] = new TH2F
2763 (Form("hTrackMatchedDPhiMCNoOverlap%s",cutTM[i].Data()),
2764 Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
2765 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2766 fhTrackMatchedDPhiMCNoOverlap[i]->SetYTitle("d#phi (rad)");
2767 fhTrackMatchedDPhiMCNoOverlap[i]->SetXTitle("E_{cluster} (GeV)");
2768
2769 outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[i]) ;
2770 outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[i]) ;
2771 fhTrackMatchedDEtaMCOverlap[i] = new TH2F
2772 (Form("hTrackMatchedDEtaMCOverlap%s",cutTM[i].Data()),
2773 Form("d#eta of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
2774 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2775 fhTrackMatchedDEtaMCOverlap[i]->SetYTitle("d#eta");
2776 fhTrackMatchedDEtaMCOverlap[i]->SetXTitle("E_{cluster} (GeV)");
2777
2778 fhTrackMatchedDPhiMCOverlap[i] = new TH2F
2779 (Form("hTrackMatchedDPhiMCOverlap%s",cutTM[i].Data()),
2780 Form("d#phi of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
2781 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2782 fhTrackMatchedDPhiMCOverlap[i]->SetYTitle("d#phi (rad)");
2783 fhTrackMatchedDPhiMCOverlap[i]->SetXTitle("E_{cluster} (GeV)");
2784
2785 outputContainer->Add(fhTrackMatchedDEtaMCOverlap[i]) ;
2786 outputContainer->Add(fhTrackMatchedDPhiMCOverlap[i]) ;
2787
2788 fhTrackMatchedDEtaMCConversion[i] = new TH2F
2789 (Form("hTrackMatchedDEtaMCConversion%s",cutTM[i].Data()),
2790 Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
2791 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2792 fhTrackMatchedDEtaMCConversion[i]->SetYTitle("d#eta");
2793 fhTrackMatchedDEtaMCConversion[i]->SetXTitle("E_{cluster} (GeV)");
2794
2795 fhTrackMatchedDPhiMCConversion[i] = new TH2F
2796 (Form("hTrackMatchedDPhiMCConversion%s",cutTM[i].Data()),
2797 Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
2798 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2799 fhTrackMatchedDPhiMCConversion[i]->SetYTitle("d#phi (rad)");
2800 fhTrackMatchedDPhiMCConversion[i]->SetXTitle("E_{cluster} (GeV)");
2801
2802 outputContainer->Add(fhTrackMatchedDEtaMCConversion[i]) ;
2803 outputContainer->Add(fhTrackMatchedDPhiMCConversion[i]) ;
2804
2805 fhTrackMatchedMCParticle[i] = new TH2F
2806 (Form("hTrackMatchedMCParticle%s",cutTM[i].Data()),
2807 Form("Origin of particle vs energy %s",cutTM[i].Data()),
2808 nptbins,ptmin,ptmax,8,0,8);
2809 fhTrackMatchedMCParticle[i]->SetXTitle("E (GeV)");
2810 //fhTrackMatchedMCParticle[i]->SetYTitle("Particle type");
2811
2812 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(1 ,"Photon");
2813 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(2 ,"Electron");
2814 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
2815 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(4 ,"Rest");
2816 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
2817 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
2818 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
2819 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
2820
2821 outputContainer->Add(fhTrackMatchedMCParticle[i]);
2822 }
31ae6d59 2823 }
85c4406e 2824 }
09273901 2825
2ad19c3d 2826 if(fFillPileUpHistograms)
2827 {
5e5e056f 2828
2829 TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
2830
2831 for(Int_t i = 0 ; i < 7 ; i++)
2832 {
fad96885 2833 fhPtPileUp[i] = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()),
85c4406e 2834 Form("Cluster p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
fad96885 2835 fhPtPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2836 outputContainer->Add(fhPtPileUp[i]);
2837
2838 fhPtChargedPileUp[i] = new TH1F(Form("hPtChargedPileUp%s",pileUpName[i].Data()),
85c4406e 2839 Form("Charged clusters p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
fad96885 2840 fhPtChargedPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2841 outputContainer->Add(fhPtChargedPileUp[i]);
85c4406e 2842
5e5e056f 2843 fhPtPhotonPileUp[i] = new TH1F(Form("hPtPhotonPileUp%s",pileUpName[i].Data()),
fad96885 2844 Form("Selected photon p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
5e5e056f 2845 fhPtPhotonPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2846 outputContainer->Add(fhPtPhotonPileUp[i]);
fad96885 2847
650d1938 2848
2849 fhClusterEFracLongTimePileUp[i] = new TH2F(Form("hClusterEFracLongTimePileUp%s",pileUpName[i].Data()),
85c4406e 2850 Form("Cluster E vs fraction of cluster energy from large T cells, %s Pile-Up event",pileUpName[i].Data()),
2851 nptbins,ptmin,ptmax,200,0,1);
650d1938 2852 fhClusterEFracLongTimePileUp[i]->SetXTitle("E (GeV)");
2853 fhClusterEFracLongTimePileUp[i]->SetYTitle("E(large time) / E");
2854 outputContainer->Add(fhClusterEFracLongTimePileUp[i]);
2855
126b8c62 2856 fhClusterCellTimePileUp[i] = new TH2F(Form("hClusterCellTimePileUp%s",pileUpName[i].Data()),
2857 Form("Cluster E vs cell time in cluster, %s Pile-Up event",pileUpName[i].Data()),
2858 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2859 fhClusterCellTimePileUp[i]->SetXTitle("E (GeV)");
2860 fhClusterCellTimePileUp[i]->SetYTitle("t_{cell} (ns)");
2861 outputContainer->Add(fhClusterCellTimePileUp[i]);
2862
fad96885 2863 fhClusterTimeDiffPileUp[i] = new TH2F(Form("hClusterTimeDiffPileUp%s",pileUpName[i].Data()),
85c4406e 2864 Form("Cluster E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
fad96885 2865 nptbins,ptmin,ptmax,200,-100,100);
2866 fhClusterTimeDiffPileUp[i]->SetXTitle("E (GeV)");
2867 fhClusterTimeDiffPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2868 outputContainer->Add(fhClusterTimeDiffPileUp[i]);
2869
2870 fhClusterTimeDiffChargedPileUp[i] = new TH2F(Form("hClusterTimeDiffChargedPileUp%s",pileUpName[i].Data()),
85c4406e 2871 Form("Charged clusters E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
fad96885 2872 nptbins,ptmin,ptmax,200,-100,100);
2873 fhClusterTimeDiffChargedPileUp[i]->SetXTitle("E (GeV)");
2874 fhClusterTimeDiffChargedPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2875 outputContainer->Add(fhClusterTimeDiffChargedPileUp[i]);
2876
2877 fhClusterTimeDiffPhotonPileUp[i] = new TH2F(Form("hClusterTimeDiffPhotonPileUp%s",pileUpName[i].Data()),
85c4406e 2878 Form("Selected photon E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
fad96885 2879 nptbins,ptmin,ptmax,200,-100,100);
2880 fhClusterTimeDiffPhotonPileUp[i]->SetXTitle("E (GeV)");
2881 fhClusterTimeDiffPhotonPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2882 outputContainer->Add(fhClusterTimeDiffPhotonPileUp[i]);
85c4406e 2883
fad96885 2884 fhLambda0PileUp[i] = new TH2F(Form("hLambda0PileUp%s",pileUpName[i].Data()),
2885 Form("Cluster E vs #lambda^{2}_{0} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2886 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2887 fhLambda0PileUp[i]->SetXTitle("E (GeV)");
2888 fhLambda0PileUp[i]->SetYTitle("#lambda^{2}_{0}");
2889 outputContainer->Add(fhLambda0PileUp[i]);
2890
2891 fhLambda0ChargedPileUp[i] = new TH2F(Form("hLambda0ChargedPileUp%s",pileUpName[i].Data()),
85c4406e 2892 Form("Charged clusters E vs #lambda^{2}_{0}in cluster, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
fad96885 2893 fhLambda0ChargedPileUp[i]->SetXTitle("E (GeV)");
2894 fhLambda0ChargedPileUp[i]->SetYTitle("#lambda^{2}_{0}");
2895 outputContainer->Add(fhLambda0ChargedPileUp[i]);
85c4406e 2896
5e5e056f 2897 }
2898
fedea415 2899 fhEtaPhiBC0 = new TH2F ("hEtaPhiBC0","eta-phi for clusters tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
2900 fhEtaPhiBC0->SetXTitle("#eta ");
2901 fhEtaPhiBC0->SetYTitle("#phi (rad)");
2902 outputContainer->Add(fhEtaPhiBC0);
2903
2904 fhEtaPhiBCPlus = new TH2F ("hEtaPhiBCPlus","eta-phi for clusters tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax);
2905 fhEtaPhiBCPlus->SetXTitle("#eta ");
2906 fhEtaPhiBCPlus->SetYTitle("#phi (rad)");
2907 outputContainer->Add(fhEtaPhiBCPlus);
2908
2909 fhEtaPhiBCMinus = new TH2F ("hEtaPhiBCMinus","eta-phi for clusters tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax);
2910 fhEtaPhiBCMinus->SetXTitle("#eta ");
2911 fhEtaPhiBCMinus->SetYTitle("#phi (rad)");
2912 outputContainer->Add(fhEtaPhiBCMinus);
2913
2914 fhEtaPhiBC0PileUpSPD = new TH2F ("hEtaPhiBC0PileUpSPD","eta-phi for clusters tof corresponding to BC=0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2915 fhEtaPhiBC0PileUpSPD->SetXTitle("#eta ");
2916 fhEtaPhiBC0PileUpSPD->SetYTitle("#phi (rad)");
2917 outputContainer->Add(fhEtaPhiBC0PileUpSPD);
2918
2919 fhEtaPhiBCPlusPileUpSPD = new TH2F ("hEtaPhiBCPlusPileUpSPD","eta-phi for clusters tof corresponding to BC>0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2920 fhEtaPhiBCPlusPileUpSPD->SetXTitle("#eta ");
2921 fhEtaPhiBCPlusPileUpSPD->SetYTitle("#phi (rad)");
2922 outputContainer->Add(fhEtaPhiBCPlusPileUpSPD);
2923
2924 fhEtaPhiBCMinusPileUpSPD = new TH2F ("hEtaPhiBCMinusPileUpSPD","eta-phi for clusters tof corresponding to BC<0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2925 fhEtaPhiBCMinusPileUpSPD->SetXTitle("#eta ");
2926 fhEtaPhiBCMinusPileUpSPD->SetYTitle("#phi (rad)");
2927 outputContainer->Add(fhEtaPhiBCMinusPileUpSPD);
85c4406e 2928
b2e375c7 2929 fhTimePtNoCut = new TH2F ("hTimePt_NoCut","time of cluster vs pT of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2930 fhTimePtNoCut->SetXTitle("p_{T} (GeV/c)");
2931 fhTimePtNoCut->SetYTitle("time (ns)");
2932 outputContainer->Add(fhTimePtNoCut);
2933
2934 fhTimePtSPD = new TH2F ("hTimePt_SPD","time of cluster vs pT of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2935 fhTimePtSPD->SetXTitle("p_{T} (GeV/c)");
2936 fhTimePtSPD->SetYTitle("time (ns)");
2937 outputContainer->Add(fhTimePtSPD);
2938
2939 fhTimePtPhotonNoCut = new TH2F ("hTimePtPhoton_NoCut","time of photon cluster vs pT of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2940 fhTimePtPhotonNoCut->SetXTitle("p_{T} (GeV/c)");
2941 fhTimePtPhotonNoCut->SetYTitle("time (ns)");
2942 outputContainer->Add(fhTimePtPhotonNoCut);
2943
2944 fhTimePtPhotonSPD = new TH2F ("hTimePtPhoton_SPD","time of photon cluster vs pT of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2945 fhTimePtPhotonSPD->SetXTitle("p_{T} (GeV/c)");
2946 fhTimePtPhotonSPD->SetYTitle("time (ns)");
2947 outputContainer->Add(fhTimePtPhotonSPD);
2948
85c4406e 2949 fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,20,0,20);
2ad19c3d 2950 fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
2951 fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
fad96885 2952 outputContainer->Add(fhTimeNPileUpVertSPD);
2ad19c3d 2953
85c4406e 2954 fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 20,0,20 );
2ad19c3d 2955 fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
2956 fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
85c4406e 2957 outputContainer->Add(fhTimeNPileUpVertTrack);
2ad19c3d 2958
85c4406e 2959 fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
2ad19c3d 2960 fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
2961 fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
85c4406e 2962 outputContainer->Add(fhTimeNPileUpVertContributors);
2ad19c3d 2963
85c4406e 2964 fhTimePileUpMainVertexZDistance = new TH2F ("hTime_PileUpMainVertexZDistance","time of cluster vs distance in Z pile-up SPD vertex - main SPD vertex",ntimebins,timemin,timemax,100,0,50);
2ad19c3d 2965 fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
2966 fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
85c4406e 2967 outputContainer->Add(fhTimePileUpMainVertexZDistance);
2ad19c3d 2968
85c4406e 2969 fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
2ad19c3d 2970 fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
2971 fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
85c4406e 2972 outputContainer->Add(fhTimePileUpMainVertexZDiamond);
acd56ca4 2973
2974 TString title[] = {"no |t diff| cut","|t diff|<20 ns","|t diff|>20 ns","|t diff|>40 ns"};
2975 TString name [] = {"TDiffNoCut","TDiffSmaller20ns","TDiffLarger20ns","TDiffLarger40ns"};
85c4406e 2976 for(Int_t i = 0; i < 4; i++)
2977 {
acd56ca4 2978 fhClusterMultSPDPileUp[i] = new TH2F(Form("fhClusterMultSPDPileUp_%s", name[i].Data()),
2979 Form("Number of clusters per pile up event with E > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
85c4406e 2980 nptbins,ptmin,ptmax,100,0,100);
acd56ca4 2981 fhClusterMultSPDPileUp[i]->SetYTitle("n clusters ");
2982 fhClusterMultSPDPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
85c4406e 2983 outputContainer->Add(fhClusterMultSPDPileUp[i]) ;
acd56ca4 2984
2985 fhClusterMultNoPileUp[i] = new TH2F(Form("fhClusterMultNoPileUp_%s", name[i].Data()),
2986 Form("Number of clusters per non pile up event with E > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
85c4406e 2987 nptbins,ptmin,ptmax,100,0,100);
acd56ca4 2988 fhClusterMultNoPileUp[i]->SetYTitle("n clusters ");
2989 fhClusterMultNoPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
85c4406e 2990 outputContainer->Add(fhClusterMultNoPileUp[i]) ;
acd56ca4 2991 }
2ad19c3d 2992
85c4406e 2993 fhPtNPileUpSPDVtx = new TH2F ("hPt_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
2994 nptbins,ptmin,ptmax,20,0,20);
2995 fhPtNPileUpSPDVtx->SetYTitle("# vertex ");
2996 fhPtNPileUpSPDVtx->SetXTitle("p_{T} (GeV/c)");
2997 outputContainer->Add(fhPtNPileUpSPDVtx);
0f7e7205 2998
85c4406e 2999 fhPtNPileUpTrkVtx = new TH2F ("hPt_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
3000 nptbins,ptmin,ptmax, 20,0,20 );
3001 fhPtNPileUpTrkVtx->SetYTitle("# vertex ");
3002 fhPtNPileUpTrkVtx->SetXTitle("p_{T} (GeV/c)");
3003 outputContainer->Add(fhPtNPileUpTrkVtx);
3004
3005 fhPtNPileUpSPDVtxTimeCut = new TH2F ("hPt_NPileUpVertSPD_TimeCut","pT of cluster vs N pile-up SPD vertex, |tof| < 25 ns",
3006 nptbins,ptmin,ptmax,20,0,20);
3007 fhPtNPileUpSPDVtxTimeCut->SetYTitle("# vertex ");
3008 fhPtNPileUpSPDVtxTimeCut->SetXTitle("p_{T} (GeV/c)");
3009 outputContainer->Add(fhPtNPileUpSPDVtxTimeCut);
3010
3011 fhPtNPileUpTrkVtxTimeCut = new TH2F ("hPt_NPileUpVertTracks_TimeCut","pT of cluster vs N pile-up Tracks vertex, |tof| < 25 ns",
3012 nptbins,ptmin,ptmax, 20,0,20 );
3013 fhPtNPileUpTrkVtxTimeCut->SetYTitle("# vertex ");
3014 fhPtNPileUpTrkVtxTimeCut->SetXTitle("p_{T} (GeV/c)");
3015 outputContainer->Add(fhPtNPileUpTrkVtxTimeCut);
3016
3017 fhPtNPileUpSPDVtxTimeCut2 = new TH2F ("hPt_NPileUpVertSPD_TimeCut2","pT of cluster vs N pile-up SPD vertex, -25 < tof < 75 ns",
3018 nptbins,ptmin,ptmax,20,0,20);
3019 fhPtNPileUpSPDVtxTimeCut2->SetYTitle("# vertex ");
3020 fhPtNPileUpSPDVtxTimeCut2->SetXTitle("p_{T} (GeV/c)");
3021 outputContainer->Add(fhPtNPileUpSPDVtxTimeCut2);
0f7e7205 3022
85c4406e 3023 fhPtNPileUpTrkVtxTimeCut2 = new TH2F ("hPt_NPileUpVertTracks_TimeCut2","pT of cluster vs N pile-up Tracks vertex, -25 < tof < 75 ns",
3024 nptbins,ptmin,ptmax, 20,0,20 );
3025 fhPtNPileUpTrkVtxTimeCut2->SetYTitle("# vertex ");
3026 fhPtNPileUpTrkVtxTimeCut2->SetXTitle("p_{T} (GeV/c)");
3027 outputContainer->Add(fhPtNPileUpTrkVtxTimeCut2);
3028
3029 fhPtPhotonNPileUpSPDVtx = new TH2F ("hPtPhoton_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
3030 nptbins,ptmin,ptmax,20,0,20);
3031 fhPtPhotonNPileUpSPDVtx->SetYTitle("# vertex ");
3032 fhPtPhotonNPileUpSPDVtx->SetXTitle("p_{T} (GeV/c)");
3033 outputContainer->Add(fhPtPhotonNPileUpSPDVtx);
0f7e7205 3034
85c4406e 3035 fhPtPhotonNPileUpTrkVtx = new TH2F ("hPtPhoton_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
3036 nptbins,ptmin,ptmax, 20,0,20 );
3037 fhPtPhotonNPileUpTrkVtx->SetYTitle("# vertex ");
3038 fhPtPhotonNPileUpTrkVtx->SetXTitle("p_{T} (GeV/c)");
3039 outputContainer->Add(fhPtPhotonNPileUpTrkVtx);
0f7e7205 3040
85c4406e 3041 fhPtPhotonNPileUpSPDVtxTimeCut = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut","pT of cluster vs N pile-up SPD vertex, |tof| < 25 ns",
3042 nptbins,ptmin,ptmax,20,0,20);
3043 fhPtPhotonNPileUpSPDVtxTimeCut->SetYTitle("# vertex ");
3044 fhPtPhotonNPileUpSPDVtxTimeCut->SetXTitle("p_{T} (GeV/c)");
3045 outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut);
0f7e7205 3046
85c4406e 3047 fhPtPhotonNPileUpTrkVtxTimeCut = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut","pT of cluster vs N pile-up Tracks vertex, |tof| < 25 ns",
3048 nptbins,ptmin,ptmax, 20,0,20 );
3049 fhPtPhotonNPileUpTrkVtxTimeCut->SetYTitle("# vertex ");
3050 fhPtPhotonNPileUpTrkVtxTimeCut->SetXTitle("p_{T} (GeV/c)");
3051 outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut);
0f7e7205 3052
85c4406e 3053 fhPtPhotonNPileUpSPDVtxTimeCut2 = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut2","pT of cluster vs N pile-up SPD vertex, -25 < tof < 75 ns",
3054 nptbins,ptmin,ptmax,20,0,20);
3055 fhPtPhotonNPileUpSPDVtxTimeCut2->SetYTitle("# vertex ");
3056 fhPtPhotonNPileUpSPDVtxTimeCut2->SetXTitle("p_{T} (GeV/c)");
3057 outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut2);
0f7e7205 3058
85c4406e 3059 fhPtPhotonNPileUpTrkVtxTimeCut2 = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut2","pT of cluster vs N pile-up Tracks vertex, -25 < tof < 75 ns",
3060 nptbins,ptmin,ptmax, 20,0,20 );
3061 fhPtPhotonNPileUpTrkVtxTimeCut2->SetYTitle("# vertex ");
3062 fhPtPhotonNPileUpTrkVtxTimeCut2->SetXTitle("p_{T} (GeV/c)");
3063 outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut2);
3064
2ad19c3d 3065 }
3066
34c16486 3067 if(IsDataMC())
3068 {
f66d95af 3069 TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
85c4406e 3070 "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
3071 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String" } ;
3d5d5078 3072
f66d95af 3073 TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
85c4406e 3074 "Conversion", "Hadron", "AntiNeutron","AntiProton",
3075 "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
521636d2 3076
34c16486 3077 for(Int_t i = 0; i < fNOriginHistograms; i++)
85c4406e 3078 {
3d5d5078 3079 fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
85c4406e 3080 Form("cluster from %s : E ",ptype[i].Data()),
3081 nptbins,ptmin,ptmax);
3d5d5078 3082 fhMCE[i]->SetXTitle("E (GeV)");
85c4406e 3083 outputContainer->Add(fhMCE[i]) ;
521636d2 3084
4c8f7c2e 3085 fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
85c4406e 3086 Form("cluster from %s : p_{T} ",ptype[i].Data()),
3087 nptbins,ptmin,ptmax);
4c8f7c2e 3088 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
3089 outputContainer->Add(fhMCPt[i]) ;
521636d2 3090
4c8f7c2e 3091 fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
85c4406e 3092 Form("cluster from %s : #eta ",ptype[i].Data()),
3093 nptbins,ptmin,ptmax,netabins,etamin,etamax);
4c8f7c2e 3094 fhMCEta[i]->SetYTitle("#eta");
3095 fhMCEta[i]->SetXTitle("E (GeV)");
3096 outputContainer->Add(fhMCEta[i]) ;
521636d2 3097
4c8f7c2e 3098 fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
85c4406e 3099 Form("cluster from %s : #phi ",ptype[i].Data()),
3100 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
4c8f7c2e 3101 fhMCPhi[i]->SetYTitle("#phi (rad)");
3102 fhMCPhi[i]->SetXTitle("E (GeV)");
3103 outputContainer->Add(fhMCPhi[i]) ;
3104
3105
d9105d92 3106 fhMCDeltaE[i] = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
85c4406e 3107 Form("MC - Reco E from %s",pname[i].Data()),
3108 nptbins,ptmin,ptmax, 200,-50,50);
57299f91 3109 fhMCDeltaE[i]->SetYTitle("#Delta E (GeV)");
3110 fhMCDeltaE[i]->SetXTitle("E (GeV)");
4c8f7c2e 3111 outputContainer->Add(fhMCDeltaE[i]);
3112
d9105d92 3113 fhMCDeltaPt[i] = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
85c4406e 3114 Form("MC - Reco p_{T} from %s",pname[i].Data()),
3115 nptbins,ptmin,ptmax, 200,-50,50);
57299f91 3116 fhMCDeltaPt[i]->SetXTitle("p_{T,rec} (GeV/c)");
3117 fhMCDeltaPt[i]->SetYTitle("#Delta p_{T} (GeV/c)");
4c8f7c2e 3118 outputContainer->Add(fhMCDeltaPt[i]);
85c4406e 3119
4c8f7c2e 3120 fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
85c4406e 3121 Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
3122 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
4c8f7c2e 3123 fhMC2E[i]->SetXTitle("E_{rec} (GeV)");
3124 fhMC2E[i]->SetYTitle("E_{gen} (GeV)");
85c4406e 3125 outputContainer->Add(fhMC2E[i]);
4c8f7c2e 3126
3127 fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
85c4406e 3128 Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
3129 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
4c8f7c2e 3130 fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/c)");
3131 fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/c)");
3132 outputContainer->Add(fhMC2Pt[i]);
3133
521636d2 3134
3135 }
3d5d5078 3136
f66d95af 3137 TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
85c4406e 3138 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
f66d95af 3139
3140 TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
85c4406e 3141 "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
f66d95af 3142
34c16486 3143 for(Int_t i = 0; i < fNPrimaryHistograms; i++)
85c4406e 3144 {
f66d95af 3145 fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
85c4406e 3146 Form("primary photon %s : E ",pptype[i].Data()),
3147 nptbins,ptmin,ptmax);
3d5d5078 3148 fhEPrimMC[i]->SetXTitle("E (GeV)");
85c4406e 3149 outputContainer->Add(fhEPrimMC[i]) ;
3d5d5078 3150
f66d95af 3151 fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
85c4406e 3152 Form("primary photon %s : p_{T} ",pptype[i].Data()),
3153 nptbins,ptmin,ptmax);
3d5d5078 3154 fhPtPrimMC[i]->SetXTitle("p_{T} (GeV/c)");
3155 outputContainer->Add(fhPtPrimMC[i]) ;
3156
f66d95af 3157 fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
85c4406e 3158 Form("primary photon %s : Rapidity ",pptype[i].Data()),
3159 nptbins,ptmin,ptmax,800,-8,8);
3d5d5078 3160 fhYPrimMC[i]->SetYTitle("Rapidity");
3161 fhYPrimMC[i]->SetXTitle("E (GeV)");
3162 outputContainer->Add(fhYPrimMC[i]) ;
3163
4cf13296 3164 fhEtaPrimMC[i] = new TH2F(Form("hEtaPrim_MC%s",ppname[i].Data()),
3165 Form("primary photon %s : #eta",pptype[i].Data()),
3166 nptbins,ptmin,ptmax,800,-8,8);
3167 fhEtaPrimMC[i]->SetYTitle("#eta");
3168 fhEtaPrimMC[i]->SetXTitle("E (GeV)");
3169 outputContainer->Add(fhEtaPrimMC[i]) ;
3170
f66d95af 3171 fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
85c4406e 3172 Form("primary photon %s : #phi ",pptype[i].Data()),
3173 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
3d5d5078 3174 fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
3175 fhPhiPrimMC[i]->SetXTitle("E (GeV)");
3176 outputContainer->Add(fhPhiPrimMC[i]) ;
85c4406e 3177
3d5d5078 3178
f66d95af 3179 fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
85c4406e 3180 Form("primary photon %s in acceptance: E ",pptype[i].Data()),
3181 nptbins,ptmin,ptmax);
3d5d5078 3182 fhEPrimMCAcc[i]->SetXTitle("E (GeV)");
85c4406e 3183 outputContainer->Add(fhEPrimMCAcc[i]) ;
3d5d5078 3184
f66d95af 3185 fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
85c4406e 3186 Form("primary photon %s in acceptance: p_{T} ",pptype[i].Data()),
3187 nptbins,ptmin,ptmax);
3d5d5078 3188 fhPtPrimMCAcc[i]->SetXTitle("p_{T} (GeV/c)");
3189 outputContainer->Add(fhPtPrimMCAcc[i]) ;
3190
f66d95af 3191 fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
85c4406e 3192 Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
3193 nptbins,ptmin,ptmax,100,-1,1);
3d5d5078 3194 fhYPrimMCAcc[i]->SetYTitle("Rapidity");
3195 fhYPrimMCAcc[i]->SetXTitle("E (GeV)");
3196 outputContainer->Add(fhYPrimMCAcc[i]) ;
4cf13296 3197
3198 fhEtaPrimMCAcc[i] = new TH2F(Form("hEtaPrimAcc_MC%s",ppname[i].Data()),
3199 Form("primary photon %s in acceptance: #eta ",pptype[i].Data()),
3200 nptbins,ptmin,ptmax,netabins,etamin,etamax);
3201 fhEtaPrimMCAcc[i]->SetYTitle("#eta");
3202 fhEtaPrimMCAcc[i]->SetXTitle("E (GeV)");
3203 outputContainer->Add(fhYPrimMCAcc[i]) ;
3d5d5078 3204
f66d95af 3205 fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
85c4406e 3206 Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
3207 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
3d5d5078 3208 fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
3209 fhPhiPrimMCAcc[i]->SetXTitle("E (GeV)");
3210 outputContainer->Add(fhPhiPrimMCAcc[i]) ;
3211
3212 }
85c4406e 3213
34c16486 3214 if(fFillSSHistograms)
3215 {
85c4406e 3216 TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
3d5d5078 3217
3218 TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
3219
34c16486 3220 for(Int_t i = 0; i < 6; i++)
85c4406e 3221 {
3d5d5078 3222 fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
3223 Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
85c4406e 3224 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3225 fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
3226 fhMCELambda0[i]->SetXTitle("E (GeV)");
85c4406e 3227 outputContainer->Add(fhMCELambda0[i]) ;
521636d2 3228
3d5d5078 3229 fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
3230 Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
85c4406e 3231 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3232 fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
3233 fhMCELambda1[i]->SetXTitle("E (GeV)");
85c4406e 3234 outputContainer->Add(fhMCELambda1[i]) ;
34c16486 3235
3d5d5078 3236 fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
3237 Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
85c4406e 3238 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3239 fhMCEDispersion[i]->SetYTitle("D^{2}");
3240 fhMCEDispersion[i]->SetXTitle("E (GeV)");
85c4406e 3241 outputContainer->Add(fhMCEDispersion[i]) ;
34c16486 3242
f66d95af 3243 fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
85c4406e 3244 Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
3245 nptbins,ptmin,ptmax, nbins,nmin,nmax);
f66d95af 3246 fhMCNCellsE[i]->SetXTitle("E (GeV)");
3247 fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
85c4406e 3248 outputContainer->Add(fhMCNCellsE[i]);
f66d95af 3249
3250 fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
34c16486 3251 Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
85c4406e 3252 nptbins,ptmin,ptmax, 500,0,1.);
f66d95af 3253 fhMCMaxCellDiffClusterE[i]->SetXTitle("E_{cluster} (GeV) ");
3254 fhMCMaxCellDiffClusterE[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 3255 outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
f66d95af 3256
764ab1f4 3257 if(!fFillOnlySimpleSSHisto)
34c16486 3258 {
764ab1f4 3259 fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
3260 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
85c4406e 3261 ssbins,ssmin,ssmax,500,0,1.);
764ab1f4 3262 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
3263 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 3264 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
764ab1f4 3265
3266 fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
3267 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
85c4406e 3268 ssbins,ssmin,ssmax,500,0,1.);
764ab1f4 3269 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
3270 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 3271 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
34c16486 3272
764ab1f4 3273 fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
3274 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
85c4406e 3275 ssbins,ssmin,ssmax,500,0,1.);
764ab1f4 3276 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
3277 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 3278 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
34c16486 3279
764ab1f4 3280 fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
3281 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
85c4406e 3282 nbins/5,nmin,nmax/5,500,0,1.);
764ab1f4 3283 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
3284 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 3285 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
34c16486 3286
764ab1f4 3287 fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
3288 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
85c4406e 3289 nbins/5,nmin,nmax/5,500,0,1.);
764ab1f4 3290 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
3291 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 3292 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
34c16486 3293
764ab1f4 3294 fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
3295 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
85c4406e 3296 nbins/5,nmin,nmax/5,500,0,1.);
764ab1f4 3297 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
3298 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("E (GeV)");
85c4406e 3299 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
34c16486 3300
764ab1f4 3301 if(fCalorimeter=="EMCAL")
34c16486 3302 {
764ab1f4 3303 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pnamess[i].Data()),
3304 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data()),
85c4406e 3305 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
764ab1f4 3306 fhMCEDispEta[i]->SetXTitle("E (GeV)");
3307 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
85c4406e 3308 outputContainer->Add(fhMCEDispEta[i]);
764ab1f4 3309
3310 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pnamess[i].Data()),
3311 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptypess[i].Data()),
85c4406e 3312 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
764ab1f4 3313 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
3314 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 3315 outputContainer->Add(fhMCEDispPhi[i]);
764ab1f4 3316
3317 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pnamess[i].Data()),
85c4406e 3318 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()),
3319 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
764ab1f4 3320 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
3321 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
3322 outputContainer->Add(fhMCESumEtaPhi[i]);
3323
3324 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pnamess[i].Data()),
85c4406e 3325 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),
3326 nptbins,ptmin,ptmax,200,-10,10);
764ab1f4 3327 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
3328 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
85c4406e 3329 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
764ab1f4 3330
3331 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pnamess[i].Data()),
85c4406e 3332 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()),
3333 nptbins,ptmin,ptmax, 200,-1,1);
764ab1f4 3334 fhMCESphericity[i]->SetXTitle("E (GeV)");
3335 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
3336 outputContainer->Add(fhMCESphericity[i]);
3337
3338 for(Int_t ie = 0; ie < 7; ie++)
3339 {
3340 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
85c4406e 3341 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]),
3342 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 3343 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
3344 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 3345 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
764ab1f4 3346
3347 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pnamess[i].Data()),
85c4406e 3348 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]),
3349 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 3350 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
3351 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 3352 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
764ab1f4 3353
3354 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
85c4406e 3355 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]),
3356 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 3357 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
3358 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 3359 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
764ab1f4 3360 }
34c16486 3361 }
34c16486 3362 }
85c4406e 3363 }// loop
3d5d5078 3364
3365 if(!GetReader()->IsEmbeddedClusterSelectionOn())
3366 {
3367 fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
3368 "cluster from Photon : E vs #lambda_{0}^{2}",
85c4406e 3369 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3370 fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
3371 fhMCPhotonELambda0NoOverlap->SetXTitle("E (GeV)");
85c4406e 3372 outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
3d5d5078 3373
3d5d5078 3374 fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
3375 "cluster from Photon : E vs #lambda_{0}^{2}",
85c4406e 3376 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3377 fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
3378 fhMCPhotonELambda0TwoOverlap->SetXTitle("E (GeV)");
85c4406e 3379 outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
3d5d5078 3380
3d5d5078 3381 fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
3382 "cluster from Photon : E vs #lambda_{0}^{2}",
85c4406e 3383 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3384 fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
3385 fhMCPhotonELambda0NOverlap->SetXTitle("E (GeV)");
85c4406e 3386 outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
521636d2 3387
85c4406e 3388 } //No embedding
3d5d5078 3389
3d5d5078 3390 if(GetReader()->IsEmbeddedClusterSelectionOn())
3391 {
3392
3393 fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
34c16486 3394 "Energy Fraction of embedded signal versus cluster energy",
85c4406e 3395 nptbins,ptmin,ptmax,100,0.,1.);
3d5d5078 3396 fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
3397 fhEmbeddedSignalFractionEnergy->SetXTitle("E (GeV)");
85c4406e 3398 outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
3d5d5078 3399
3400 fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
34c16486 3401 "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
85c4406e 3402 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3403 fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
3404 fhEmbedPhotonELambda0FullSignal->SetXTitle("E (GeV)");
85c4406e 3405 outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
34c16486 3406
3d5d5078 3407 fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
34c16486 3408 "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
85c4406e 3409 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3410 fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
3411 fhEmbedPhotonELambda0MostlySignal->SetXTitle("E (GeV)");
85c4406e 3412 outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
3d5d5078 3413
3d5d5078 3414 fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
34c16486 3415 "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
85c4406e 3416 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3417 fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
3418 fhEmbedPhotonELambda0MostlyBkg->SetXTitle("E (GeV)");
85c4406e 3419 outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
34c16486 3420
3d5d5078 3421 fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
34c16486 3422 "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
85c4406e 3423 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3424 fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
3425 fhEmbedPhotonELambda0FullBkg->SetXTitle("E (GeV)");
85c4406e 3426 outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
3d5d5078 3427
3d5d5078 3428 fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
34c16486 3429 "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
85c4406e 3430 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3431 fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
3432 fhEmbedPi0ELambda0FullSignal->SetXTitle("E (GeV)");
85c4406e 3433 outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
34c16486 3434
3d5d5078 3435 fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
34c16486 3436 "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
85c4406e 3437 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3438 fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
3439 fhEmbedPi0ELambda0MostlySignal->SetXTitle("E (GeV)");
85c4406e 3440 outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
3d5d5078 3441
3d5d5078 3442 fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
34c16486 3443 "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
85c4406e 3444 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3445 fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
3446 fhEmbedPi0ELambda0MostlyBkg->SetXTitle("E (GeV)");
85c4406e 3447 outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
3d5d5078 3448
3d5d5078 3449 fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
34c16486 3450 "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
85c4406e 3451 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 3452 fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
3453 fhEmbedPi0ELambda0FullBkg->SetXTitle("E (GeV)");
85c4406e 3454 outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
34c16486 3455
3d5d5078 3456 }// embedded histograms
3457
521636d2 3458
3459 }// Fill SS MC histograms
3460
477d6cee 3461 }//Histos with MC
1035a8d9 3462
477d6cee 3463 return outputContainer ;
3464
1c5acb87 3465}
3466
34c16486 3467//_______________________
6639984f 3468void AliAnaPhoton::Init()
3469{
3470
3471 //Init
3472 //Do some checks
34c16486 3473 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD())
3474 {
591cc579 3475 printf("AliAnaPhoton::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
6639984f 3476 abort();
3477 }
34c16486 3478 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD())
3479 {
591cc579 3480 printf("AliAnaPhoton::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
6639984f 3481 abort();
3482 }
3483
49b5c49b 3484 if(GetReader()->GetDataType() == AliCaloTrackReader::kMC) GetCaloPID()->SwitchOnBayesian();
3485
6639984f 3486}
3487
1c5acb87 3488//____________________________________________________________________________
3489void AliAnaPhoton::InitParameters()
3490{
3491
3492 //Initialize the parameters of the analysis.
a3aebfff 3493 AddToHistogramsName("AnaPhoton_");
521636d2 3494
6175da48 3495 fCalorimeter = "EMCAL" ;
3496 fMinDist = 2.;
3497 fMinDist2 = 4.;
3498 fMinDist3 = 5.;
1e86c71e 3499
caa8a222 3500 fTimeCutMin =-1000000;
3501 fTimeCutMax = 1000000;
6175da48 3502 fNCellsCut = 0;
2ac125bf 3503
1e86c71e 3504 fRejectTrackMatch = kTRUE ;
1e86c71e 3505
1c5acb87 3506}
3507
3508//__________________________________________________________________
85c4406e 3509void AliAnaPhoton::MakeAnalysisFillAOD()
1c5acb87 3510{
f8006433 3511 //Do photon analysis and fill aods
f37fa8d2 3512
85c4406e 3513 //Get the vertex
5025c139 3514 Double_t v[3] = {0,0,0}; //vertex ;
3515 GetReader()->GetVertex(v);
f8006433 3516
f37fa8d2 3517 //Select the Calorimeter of the photon
85c4406e 3518 TObjArray * pl = 0x0;
3519 AliVCaloCells* cells = 0;
71e3889f 3520 if (fCalorimeter == "PHOS" )
3521 {
3522 pl = GetPHOSClusters();
3523 cells = GetPHOSCells();
3524 }
477d6cee 3525 else if (fCalorimeter == "EMCAL")
71e3889f 3526 {
3527 pl = GetEMCALClusters();
3528 cells = GetEMCALCells();
3529 }
5ae09196 3530
85c4406e 3531 if(!pl)
34c16486 3532 {
5ae09196 3533 Info("MakeAnalysisFillAOD","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
3534 return;
3535 }
521636d2 3536
85c4406e 3537 FillPileUpHistogramsPerEvent();
acd56ca4 3538
fc195fd0 3539 // Loop on raw clusters before filtering in the reader and fill control histogram
34c16486 3540 if((GetReader()->GetEMCALClusterListName()=="" && fCalorimeter=="EMCAL") || fCalorimeter=="PHOS")
3541 {
3542 for(Int_t iclus = 0; iclus < GetReader()->GetInputEvent()->GetNumberOfCaloClusters(); iclus++ )
3543 {
fc195fd0 3544 AliVCluster * clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
3545 if (fCalorimeter == "PHOS" && clus->IsPHOS() && clus->E() > GetReader()->GetPHOSPtMin() ) fhClusterCuts[0]->Fill(clus->E());
3546 else if(fCalorimeter == "EMCAL" && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin()) fhClusterCuts[0]->Fill(clus->E());
3547 }
3548 }
85c4406e 3549 else
34c16486 3550 { // reclusterized
fc195fd0 3551 TClonesArray * clusterList = 0;
85c4406e 3552
7d650cb7 3553 if(GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()))
3554 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
3555 else if(GetReader()->GetOutputEvent())
4a9e1073 3556 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
7d650cb7 3557
34c16486 3558 if(clusterList)
3559 {
fc195fd0 3560 Int_t nclusters = clusterList->GetEntriesFast();
85c4406e 3561 for (Int_t iclus = 0; iclus < nclusters; iclus++)
34c16486 3562 {
85c4406e 3563 AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
fc195fd0 3564 if(clus)fhClusterCuts[0]->Fill(clus->E());
6265ad55 3565 }
fc195fd0 3566 }
3567 }
fc195fd0 3568
afb3af8a 3569 // Fill some trigger related histograms
1035a8d9 3570 Int_t idTrig = GetReader()->GetTriggerClusterIndex();
3571 Bool_t exotic = GetReader()->IsExoticEvent();
3572 Bool_t bad = GetReader()->IsBadCellTriggerEvent();
85c4406e 3573
afb3af8a 3574 if( fFillEMCALBCHistograms && fCalorimeter=="EMCAL" &&
85c4406e 3575 ( bad || exotic ) && idTrig >= 0)
afb3af8a 3576 {
0f8098cc 3577 // printf("Index %d, Id %d, bad %d, exo %d\n",
3578 // GetReader()->GetTriggerClusterIndex(),
3579 // GetReader()->GetTriggerClusterId(),
3580 // GetReader()->IsBadCellTriggerEvent(),
3581 // GetReader()->IsExoticEvent() );
6265ad55 3582
3583 TClonesArray * clusterList = 0;
3584 TString clusterListName = GetReader()->GetEMCALClusterListName();
3585 if (GetReader()->GetInputEvent()->FindListObject(clusterListName))
3586 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent() ->FindListObject(clusterListName));
3587 else if(GetReader()->GetOutputEvent())
3588 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(clusterListName));
3589
3590 AliVCluster * badClusTrig = 0;
3591 if(clusterList) badClusTrig = (AliVCluster*) clusterList->At(idTrig);
3592 else badClusTrig = GetReader()->GetInputEvent()->GetCaloCluster(idTrig);
6265ad55 3593
0f8098cc 3594 if(!badClusTrig)
3595 printf("AliAnaPhoton::MakeAnalysisFillAOD() - No cluster (bad-exotic trigger) found with requested index %d \n",idTrig);
3596 else
afb3af8a 3597 {
0f8098cc 3598 TLorentzVector momBadClus;
3599
3600 badClusTrig->GetMomentum(momBadClus,GetVertex(0));
3601
3602 Float_t etaclusterBad = momBadClus.Eta();
3603 Float_t phiclusterBad = momBadClus.Phi();
3604 if( phiclusterBad < 0 ) phiclusterBad+=TMath::TwoPi();
3605 Float_t tofclusterBad = badClusTrig->GetTOF()*1.e9;
3606 Float_t eclusterBad = badClusTrig->E();
3607
3608 if( bad && exotic )
afb3af8a 3609 {
0f8098cc 3610 if(GetReader()->IsTriggerMatched())
3611 {
3612 fhEtaPhiTriggerEMCALBCBadExoticCluster->Fill(etaclusterBad, phiclusterBad);
3613 fhTimeTriggerEMCALBCBadExoticCluster ->Fill(eclusterBad, tofclusterBad);
3614 }
3615 else
3616 {
3617 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->Fill(etaclusterBad, phiclusterBad);
3618 fhTimeTriggerEMCALBCUMBadExoticCluster ->Fill(eclusterBad, tofclusterBad);
3619 }
afb3af8a 3620 }
0f8098cc 3621 else if( bad && !exotic )
afb3af8a 3622 {
0f8098cc 3623 if(GetReader()->IsTriggerMatched())
3624 {
3625 fhEtaPhiTriggerEMCALBCBadCluster->Fill(etaclusterBad, phiclusterBad);
3626 fhTimeTriggerEMCALBCBadCluster ->Fill(eclusterBad, tofclusterBad);
3627 }
3628 else
3629 {
3630 fhEtaPhiTriggerEMCALBCUMBadCluster->Fill(etaclusterBad, phiclusterBad);
3631 fhTimeTriggerEMCALBCUMBadCluster ->Fill(eclusterBad, tofclusterBad);
3632 }
3633 }// Bad cluster trigger
3634 else if( !bad && exotic )
afb3af8a 3635 {
0f8098cc 3636 if(GetReader()->IsTriggerMatched())
3637 {
3638 fhEtaPhiTriggerEMCALBCExoticCluster->Fill(etaclusterBad, phiclusterBad);
3639 fhTimeTriggerEMCALBCExoticCluster ->Fill(eclusterBad, tofclusterBad);
3640 }
3641 else
3642 {
3643 fhEtaPhiTriggerEMCALBCUMExoticCluster->Fill(etaclusterBad, phiclusterBad);
3644 fhTimeTriggerEMCALBCUMExoticCluster ->Fill(eclusterBad, tofclusterBad);
3645 }
afb3af8a 3646 }
0f8098cc 3647 }// cluster exists
3648 } // study bad/exotic trigger BC
afb3af8a 3649
6175da48 3650 //Init arrays, variables, get number of clusters
1e86c71e 3651 TLorentzVector mom, mom2 ;
3652 Int_t nCaloClusters = pl->GetEntriesFast();
20218aea 3653
6175da48 3654 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters);
521636d2 3655
6175da48 3656 //----------------------------------------------------
3657 // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
3658 //----------------------------------------------------
3659 // Loop on clusters
34c16486 3660 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
85c4406e 3661 {
3662 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
0ae57829 3663 //printf("calo %d, %f\n",icalo,calo->E());
521636d2 3664
f8006433 3665 //Get the index where the cluster comes, to retrieve the corresponding vertex
85c4406e 3666 Int_t evtIndex = 0 ;
3667 if (GetMixedEvent())
34c16486 3668 {
85c4406e 3669 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
5025c139 3670 //Get the vertex and check it is not too large in z
96539743 3671 if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
c8fe2783 3672 }
521636d2 3673
85c4406e 3674 //Cluster selection, not charged, with photon id and in fiducial cut
34c16486 3675 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
3676 {
afb3af8a 3677 calo->GetMomentum(mom,GetVertex(evtIndex)) ;
3678 }//Assume that come from vertex in straight line
34c16486 3679 else
3680 {
f8006433 3681 Double_t vertex[]={0,0,0};
3682 calo->GetMomentum(mom,vertex) ;
3683 }
c2a62a94 3684
6175da48 3685 //--------------------------------------
3686 // Cluster selection
3687 //--------------------------------------
9e51e29a 3688 Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
3689 if(!ClusterSelected(calo,mom,nMaxima)) continue;
85c4406e 3690
6175da48 3691 //----------------------------
3692 //Create AOD for analysis
3693 //----------------------------
3694 AliAODPWG4Particle aodph = AliAODPWG4Particle(mom);
3695
3696 //...............................................
85c4406e 3697 //Set the indeces of the original caloclusters (MC, ID), and calorimeter
6175da48 3698 Int_t label = calo->GetLabel();
3699 aodph.SetLabel(label);
6175da48 3700 aodph.SetCaloLabel(calo->GetID(),-1);
3701 aodph.SetDetector(fCalorimeter);
c4a7d28a 3702 //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
521636d2 3703
6175da48 3704 //...............................................
3705 //Set bad channel distance bit
c4a7d28a 3706 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
f37fa8d2 3707 if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
85c4406e 3708 else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
f37fa8d2 3709 else aodph.SetDistToBad(0) ;
af7b3903 3710 //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
c8fe2783 3711
8d6b7f60 3712 //--------------------------------------------------------------------------------------
3713 // Play with the MC stack if available
3714 //--------------------------------------------------------------------------------------
3715
3716 //Check origin of the candidates
3717 Int_t tag = -1;
3718
34c16486 3719 if(IsDataMC())
3720 {
2644ead9 3721 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader());
8d6b7f60 3722 aodph.SetTag(tag);
3723
3724 if(GetDebug() > 0)
3725 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
85c4406e 3726 }//Work with stack also
3727
8d6b7f60 3728
521636d2 3729 //--------------------------------------------------------------------------------------
3730 //Fill some shower shape histograms before PID is applied
3731 //--------------------------------------------------------------------------------------
3732
8d6b7f60 3733 FillShowerShapeHistograms(calo,tag);
6175da48 3734
3735 //-------------------------------------
f37fa8d2 3736 //PID selection or bit setting
6175da48 3737 //-------------------------------------
49b5c49b 3738
6175da48 3739 //...............................................
3740 // Data, PID check on
3c1d9afb 3741 if(IsCaloPIDOn())
3742 {
49b5c49b 3743 // Get most probable PID, 2 options check bayesian PID weights or redo PID
3744 // By default, redo PID
09273901 3745
3c1d9afb 3746 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(calo));
477d6cee 3747
21a4b1c0 3748 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
477d6cee 3749
f37fa8d2 3750 //If cluster does not pass pid, not photon, skip it.
85c4406e 3751 if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
477d6cee 3752
3753 }
85c4406e 3754
6175da48 3755 //...............................................
3756 // Data, PID check off
3c1d9afb 3757 else
3758 {
f37fa8d2 3759 //Set PID bits for later selection (AliAnaPi0 for example)
49b5c49b 3760 //GetIdentifiedParticleType already called in SetPIDBits.
3761
3c1d9afb 3762 GetCaloPID()->SetPIDBits(calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
49b5c49b 3763
85c4406e 3764 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");
477d6cee 3765 }
3766
3c1d9afb 3767 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",
3768 aodph.Pt(), aodph.GetIdentifiedParticleType());
09273901 3769
9e51e29a 3770 fhClusterCuts[9]->Fill(calo->E());
85c4406e 3771
9e51e29a 3772 fhNLocMax->Fill(calo->E(),nMaxima);
85c4406e 3773
09273901 3774 // Matching after cuts
4bfeae64 3775 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,1);
09273901 3776
2ad19c3d 3777 // Fill histograms to undertand pile-up before other cuts applied
3778 // Remember to relax time cuts in the reader
fad96885 3779 FillPileUpHistograms(calo->E(),mom.Pt(),calo->GetTOF()*1e9);
2ad19c3d 3780
5c46c992 3781 // Add number of local maxima to AOD, method name in AOD to be FIXED
9e51e29a 3782 aodph.SetFiducialArea(nMaxima);
5c46c992 3783
afb3af8a 3784 if(fFillEMCALBCHistograms && fCalorimeter=="EMCAL" && idTrig >= 0)
c2a62a94 3785 {
3786 Double_t calotof = calo->GetTOF()*1e9;
3787 Float_t calotofUS = TMath::Abs(calotof);
3788 Float_t phicluster = aodph.Phi();
3789 if(phicluster < 0) phicluster+=TMath::TwoPi();
3790
3791 if(calo->E() > 2)
3792 {
3793 if (calotofUS < 25) fhEtaPhiPhotonEMCALBC0->Fill(aodph.Eta(), phicluster);
3794 else if (calotofUS < 75) fhEtaPhiPhotonEMCALBC1->Fill(aodph.Eta(), phicluster);
3795 else fhEtaPhiPhotonEMCALBCN->Fill(aodph.Eta(), phicluster);
3796 }
3797
afb3af8a 3798 Int_t bc = GetReader()->GetTriggerClusterBC();
3799 if(TMath::Abs(bc) < 6 && !GetReader()->IsBadCellTriggerEvent() && !GetReader()->IsExoticEvent())
c2a62a94 3800 {
afb3af8a 3801 if(GetReader()->IsTriggerMatched())
3802 {
3803 if(calo->E() > 2) fhEtaPhiPhotonTriggerEMCALBC[bc+5]->Fill(aodph.Eta(), phicluster);
3804 fhTimePhotonTriggerEMCALBC[bc+5]->Fill(calo->E(), calotof);
3805 if(GetReader()->IsPileUpFromSPD()) fhTimePhotonTriggerEMCALBCPileUpSPD[bc+5]->Fill(calo->E(), calotof);
3806 }
3807 else
3808 {
3809 if(calo->E() > 2) fhEtaPhiPhotonTriggerEMCALBCUM[bc+5]->Fill(aodph.Eta(), phicluster);
3810 fhTimePhotonTriggerEMCALBCUM[bc+5]->Fill(calo->E(), calotof);
126b8c62 3811
3812 if(bc==0)
3813 {
3814 if(GetReader()->IsTriggerMatchedOpenCuts(0)) fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime ->Fill(calo->E(), calotof);
3815 if(GetReader()->IsTriggerMatchedOpenCuts(1)) fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh ->Fill(calo->E(), calotof);
3816 if(GetReader()->IsTriggerMatchedOpenCuts(2)) fhTimePhotonTriggerEMCALBC0UMReMatchBoth ->Fill(calo->E(), calotof);
3817 }
afb3af8a 3818 }
c2a62a94 3819 }
afb3af8a 3820 else if(TMath::Abs(bc) >= 6)
3821 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Trigger BC not expected = %d\n",bc);
c2a62a94 3822 }
3823
f37fa8d2 3824 //Add AOD with photon object to aod branch
477d6cee 3825 AddAODParticle(aodph);
3826
3827 }//loop
85c4406e 3828
3829 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());
477d6cee 3830
1c5acb87 3831}
3832
3833//__________________________________________________________________
85c4406e 3834void AliAnaPhoton::MakeAnalysisFillHistograms()
1c5acb87 3835{
6175da48 3836 //Fill histograms
85c4406e 3837
6175da48 3838 // Get vertex
2244659d 3839 Double_t v[3] = {0,0,0}; //vertex ;
3840 GetReader()->GetVertex(v);
85c4406e 3841 //fhVertex->Fill(v[0],v[1],v[2]);
6175da48 3842 if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
3843
3844 //----------------------------------
577d9801 3845 //Loop on stored AOD photons
3846 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
577d9801 3847 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
521636d2 3848
c8710850 3849 Float_t cen = GetEventCentrality();
85c4406e 3850 // printf("++++++++++ GetEventCentrality() %f\n",cen);
3851
c8710850 3852 Float_t ep = GetEventPlaneAngle();
3853
3c1d9afb 3854 for(Int_t iaod = 0; iaod < naod ; iaod++)
3855 {
577d9801 3856 AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
3857 Int_t pdg = ph->GetIdentifiedParticleType();
521636d2 3858
85c4406e 3859 if(GetDebug() > 3)
3860 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n",
3c1d9afb 3861 ph->GetIdentifiedParticleType(),ph->GetTag(), (ph->GetDetector()).Data()) ;
521636d2 3862
577d9801 3863 //If PID used, fill histos with photons in Calorimeter fCalorimeter
85c4406e 3864 if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
577d9801 3865 if(ph->GetDetector() != fCalorimeter) continue;
521636d2 3866
85c4406e 3867 if(GetDebug() > 2)
577d9801 3868 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ;
521636d2 3869
6175da48 3870 //................................
85c4406e 3871 //Fill photon histograms
577d9801 3872 Float_t ptcluster = ph->Pt();
3873 Float_t phicluster = ph->Phi();
3874 Float_t etacluster = ph->Eta();
3875 Float_t ecluster = ph->E();
521636d2 3876
20218aea 3877 fhEPhoton ->Fill(ecluster);
577d9801 3878 fhPtPhoton ->Fill(ptcluster);
3879 fhPhiPhoton ->Fill(ptcluster,phicluster);
85c4406e 3880 fhEtaPhoton ->Fill(ptcluster,etacluster);
fad96885 3881 if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster);
20218aea 3882 else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
85c4406e 3883
c8710850 3884 fhPtCentralityPhoton ->Fill(ptcluster,cen) ;
3885 fhPtEventPlanePhoton ->Fill(ptcluster,ep ) ;
3886
5812a064 3887 //Get original cluster, to recover some information
85c4406e 3888 Int_t absID = 0;
5812a064 3889 Float_t maxCellFraction = 0;
3890 AliVCaloCells* cells = 0;
85c4406e 3891 TObjArray * clusters = 0;
34c16486 3892 if(fCalorimeter == "EMCAL")
3893 {
5812a064 3894 cells = GetEMCALCells();
3895 clusters = GetEMCALClusters();
3896 }
34c16486 3897 else
3898 {
5812a064 3899 cells = GetPHOSCells();
3900 clusters = GetPHOSClusters();
6175da48 3901 }
20218aea 3902
5812a064 3903 Int_t iclus = -1;
85c4406e 3904 AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
5c46c992 3905 if(cluster)
3906 {
06f1b12a 3907 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
3908
3909 // Control histograms
b2e375c7 3910 fhMaxCellDiffClusterE->Fill(ph->E() ,maxCellFraction);
3911 fhNCellsE ->Fill(ph->E() ,cluster->GetNCells());
3912 fhTimePt ->Fill(ph->Pt(),cluster->GetTOF()*1.e9);
5c46c992 3913 if(cells)
3914 {
85c4406e 3915 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
3916 fhCellsE->Fill(ph->E(),cells->GetCellAmplitude(cluster->GetCellsAbsId()[icell]));
5c46c992 3917 }
06f1b12a 3918 }
5812a064 3919
6175da48 3920 //.......................................
577d9801 3921 //Play with the MC data if available
34c16486 3922 if(IsDataMC())
3923 {
51a0ace5 3924 if(GetDebug()>0)
3925 {
3926 if(GetReader()->ReadStack() && !GetMCStack())
3927 {
3928 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called?\n");
3929 }
2644ead9 3930 else if(GetReader()->ReadAODMCParticles() && !GetReader()->GetAODMCParticles())
51a0ace5 3931 {
3932 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");
85c4406e 3933 }
3934 }
51a0ace5 3935
3d5d5078 3936 FillAcceptanceHistograms();
3937
4c8f7c2e 3938 //....................................................................
3939 // Access MC information in stack if requested, check that it exists.
3940 Int_t label =ph->GetLabel();
51a0ace5 3941
85c4406e 3942 if(label < 0)
34c16486 3943 {
4c8f7c2e 3944 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label);
3945 continue;
3946 }
3947
3948 Float_t eprim = 0;
3949 Float_t ptprim = 0;
51a0ace5 3950 Bool_t ok = kFALSE;
3951 TLorentzVector primary = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
3952 if(ok)
34c16486 3953 {
51a0ace5 3954 eprim = primary.Energy();
85c4406e 3955 ptprim = primary.Pt();
4c8f7c2e 3956 }
3957
577d9801 3958 Int_t tag =ph->GetTag();
51a0ace5 3959 Int_t mcParticleTag = -1;
c5693f62 3960 if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[kmcPhoton])
3d5d5078 3961 {
8e81c2cf 3962 fhMCE [kmcPhoton] ->Fill(ecluster);
3963 fhMCPt [kmcPhoton] ->Fill(ptcluster);
3964 fhMCPhi[kmcPhoton] ->Fill(ecluster,phicluster);
3965 fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster);
3966
3967 fhMC2E [kmcPhoton] ->Fill(ecluster, eprim);
85c4406e 3968 fhMC2Pt [kmcPhoton] ->Fill(ptcluster, ptprim);
8e81c2cf 3969 fhMCDeltaE [kmcPhoton] ->Fill(ecluster,eprim-ecluster);
85c4406e 3970 fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster,ptprim-ptcluster);
8e81c2cf 3971
85c4406e 3972 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) &&
764ab1f4 3973 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
3974 fhMCE[kmcConversion])
3d5d5078 3975 {
8e81c2cf 3976 fhMCE [kmcConversion] ->Fill(ecluster);
3977 fhMCPt [kmcConversion] ->Fill(ptcluster);
3978 fhMCPhi[kmcConversion] ->Fill(ecluster,phicluster);
3979 fhMCEta[kmcConversion] ->Fill(ecluster,etacluster);
3980
3981 fhMC2E [kmcConversion] ->Fill(ecluster, eprim);
85c4406e 3982 fhMC2Pt [kmcConversion] ->Fill(ptcluster, ptprim);
8e81c2cf 3983 fhMCDeltaE [kmcConversion] ->Fill(ecluster,eprim-ecluster);
85c4406e 3984 fhMCDeltaPt[kmcConversion] ->Fill(ptcluster,ptprim-ptcluster);
3985 }
3d5d5078 3986
51a0ace5 3987 if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhMCE[kmcPrompt])
34c16486 3988 {
51a0ace5 3989 mcParticleTag = kmcPrompt;
3d5d5078 3990 }
c5693f62 3991 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)&& fhMCE[kmcFragmentation])
3d5d5078 3992 {
51a0ace5 3993 mcParticleTag = kmcFragmentation;
3d5d5078 3994 }
c5693f62 3995 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)&& fhMCE[kmcISR])
3d5d5078 3996 {
85c4406e 3997 mcParticleTag = kmcISR;
3d5d5078 3998 }
85c4406e 3999 else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
c5693f62 4000 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0Decay])
3d5d5078 4001 {
51a0ace5 4002 mcParticleTag = kmcPi0Decay;
3d5d5078 4003 }
85c4406e 4004 else if((( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) &&
4005 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) ||
4006 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[kmcOtherDecay])
3d5d5078 4007 {
51a0ace5 4008 mcParticleTag = kmcOtherDecay;
3d5d5078 4009 }
51a0ace5 4010 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0])
3d5d5078 4011 {
85c4406e 4012 mcParticleTag = kmcPi0;
4013 }
c5693f62 4014 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[kmcEta])
f66d95af 4015 {
51a0ace5 4016 mcParticleTag = kmcEta;
85c4406e 4017 }
3d5d5078 4018 }
c5693f62 4019 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[kmcAntiNeutron])
3d5d5078 4020 {
51a0ace5 4021 mcParticleTag = kmcAntiNeutron;
3d5d5078 4022 }
c5693f62 4023 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[kmcAntiProton])
3d5d5078 4024 {
85c4406e 4025 mcParticleTag = kmcAntiProton;
4026 }
c5693f62 4027 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[kmcElectron])
3d5d5078 4028 {
85c4406e 4029 mcParticleTag = kmcElectron;
4030 }
34c16486 4031 else if( fhMCE[kmcOther])
4032 {
51a0ace5 4033 mcParticleTag = kmcOther;
4c8f7c2e 4034
f8006433 4035 // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
4036 // ph->GetLabel(),ph->Pt());
4037 // for(Int_t i = 0; i < 20; i++) {
4038 // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
4039 // }
4040 // printf("\n");
4041
577d9801 4042 }
521636d2 4043
51a0ace5 4044 fhMCE [mcParticleTag] ->Fill(ecluster);
4045 fhMCPt [mcParticleTag] ->Fill(ptcluster);
4046 fhMCPhi[mcParticleTag] ->Fill(ecluster,phicluster);
4047 fhMCEta[mcParticleTag] ->Fill(ecluster,etacluster);
4048
4049 fhMC2E[mcParticleTag] ->Fill(ecluster, eprim);
85c4406e 4050 fhMC2Pt[mcParticleTag] ->Fill(ptcluster, ptprim);
51a0ace5 4051 fhMCDeltaE[mcParticleTag] ->Fill(ecluster,eprim-ecluster);
85c4406e 4052 fhMCDeltaPt[mcParticleTag]->Fill(ptcluster,ptprim-ptcluster);
51a0ace5 4053
577d9801 4054 }//Histograms with MC
521636d2 4055
577d9801 4056 }// aod loop
521636d2 4057
1c5acb87 4058}
4059
4060
4061//__________________________________________________________________
4062void AliAnaPhoton::Print(const Option_t * opt) const
4063{
477d6cee 4064 //Print some relevant parameters set for the analysis
4065
4066 if(! opt)
4067 return;
4068
4069 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
745913ae 4070 AliAnaCaloTrackCorrBaseClass::Print(" ");
85c4406e 4071
477d6cee 4072 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
4073 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
4074 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
4075 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
a3aebfff 4076 printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
4cf55759 4077 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2ac125bf 4078 printf("Number of cells in cluster is > %d \n", fNCellsCut);
477d6cee 4079 printf(" \n") ;
1c5acb87 4080
85c4406e 4081}