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