Adding CORRFW to EINCLUDE
[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
eb86112d 744 Int_t histoBC = bc+5;
745 if(GetReader()->AreBadTriggerEventsRemoved()) histoBC=0; // histograms created only for one BC since the others where rejected
746
b2e375c7 747 if(id==-2)
748 {
749 //printf("AliAnaPhoton::ClusterSelected() - No trigger found bc=%d\n",bc);
750 fhEtaPhiNoTrigger->Fill(etacluster, phicluster);
751 fhTimeNoTrigger ->Fill(ecluster, tofcluster);
752 }
753 else if(TMath::Abs(bc) < 6)
754 {
755 if(!GetReader()->IsBadCellTriggerEvent() && !GetReader()->IsExoticEvent() )
756 {
757 if(GetReader()->IsTriggerMatched())
758 {
eb86112d 759 if(ecluster > 2) fhEtaPhiTriggerEMCALBC[histoBC]->Fill(etacluster, phicluster);
760 fhTimeTriggerEMCALBC[histoBC]->Fill(ecluster, tofcluster);
761 if(GetReader()->IsPileUpFromSPD()) fhTimeTriggerEMCALBCPileUpSPD[histoBC]->Fill(ecluster, tofcluster);
b2e375c7 762
763 if(idcalo == GetReader()->GetTriggerClusterId())
764 {
eb86112d 765 fhEtaPhiTriggerEMCALBCCluster[histoBC]->Fill(etacluster, phicluster);
126b8c62 766 fhTimeTriggerEMCALBCCluster ->Fill(ecluster, tofcluster);
b2e375c7 767
768 if(bc==0)
769 {
770 Float_t threshold = GetReader()->GetEventTriggerThreshold() ;
771 if(ecluster > threshold)
772 fhEtaPhiTriggerEMCALBCClusterOverTh->Fill(etacluster, phicluster);
773 else if(ecluster > threshold-1)
774 fhEtaPhiTriggerEMCALBCClusterBelowTh1->Fill(etacluster, phicluster);
775 else
776 fhEtaPhiTriggerEMCALBCClusterBelowTh2->Fill(etacluster, phicluster);
777 }
778 }
779 }
780 else
781 {
eb86112d 782 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUM[histoBC]->Fill(etacluster, phicluster);
783 fhTimeTriggerEMCALBCUM[histoBC]->Fill(ecluster, tofcluster);
b2e375c7 784
126b8c62 785 if(bc==0)
786 {
787 if(GetReader()->IsTriggerMatchedOpenCuts(0)) fhTimeTriggerEMCALBC0UMReMatchOpenTime ->Fill(ecluster, tofcluster);
788 if(GetReader()->IsTriggerMatchedOpenCuts(1)) fhTimeTriggerEMCALBC0UMReMatchCheckNeigh ->Fill(ecluster, tofcluster);
789 if(GetReader()->IsTriggerMatchedOpenCuts(2)) fhTimeTriggerEMCALBC0UMReMatchBoth ->Fill(ecluster, tofcluster);
790 }
791
b2e375c7 792 if(idcalo == GetReader()->GetTriggerClusterId())
793 {
eb86112d 794 fhEtaPhiTriggerEMCALBCUMCluster[histoBC]->Fill(etacluster, phicluster);
126b8c62 795 fhTimeTriggerEMCALBCUMCluster->Fill(ecluster, tofcluster);
b2e375c7 796 if(bc==0)
797 {
798 Float_t threshold = GetReader()->GetEventTriggerThreshold() ;
799 if(ecluster > threshold)
800 fhEtaPhiTriggerEMCALBCUMClusterOverTh->Fill(etacluster, phicluster);
801 else if(ecluster > threshold-1)
802 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->Fill(etacluster, phicluster);
803 else
804 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->Fill(etacluster, phicluster);
805
806 if(GetReader()->IsTriggerMatchedOpenCuts(0))
807 {
126b8c62 808 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->Fill(etacluster, phicluster);
809 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster ->Fill(ecluster, tofcluster);
b2e375c7 810 }
811 if(GetReader()->IsTriggerMatchedOpenCuts(1))
812 {
126b8c62 813 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->Fill(etacluster, phicluster);
814 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster ->Fill(ecluster, tofcluster);
b2e375c7 815 }
816 if(GetReader()->IsTriggerMatchedOpenCuts(2))
817 {
126b8c62 818 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->Fill(etacluster, phicluster);
819 fhTimeTriggerEMCALBCUMReMatchBothCluster ->Fill(ecluster, tofcluster);
b2e375c7 820 }
821
822 }
823 }
824 }
825 }// neither bad nor exotic
826 else if(GetReader()->IsBadCellTriggerEvent() && GetReader()->IsExoticEvent())
827 {
828 if(GetReader()->IsTriggerMatched())
829 {
830 if(ecluster > 2) fhEtaPhiTriggerEMCALBCBadExotic->Fill(etacluster, phicluster);
831 fhTimeTriggerEMCALBCBadExotic->Fill(ecluster, tofcluster);
832 if(badMax) fhTimeTriggerEMCALBCBadMaxCellExotic->Fill(ecluster, tofcluster);
833 }
834 else
835 {
836 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBadExotic->Fill(etacluster, phicluster);
837 fhTimeTriggerEMCALBCUMBadExotic->Fill(ecluster, tofcluster);
838 if(badMax) fhTimeTriggerEMCALBCUMBadMaxCellExotic->Fill(ecluster, tofcluster);
839
840 }
841 }// Bad and exotic cluster trigger
842 else if(GetReader()->IsBadCellTriggerEvent() )
843 {
844 if(GetReader()->IsTriggerMatched())
845 {
846 if(ecluster > 2) fhEtaPhiTriggerEMCALBCBad->Fill(etacluster, phicluster);
847 fhTimeTriggerEMCALBCBad->Fill(ecluster, tofcluster);
848 if(badMax) fhTimeTriggerEMCALBCBadMaxCell->Fill(ecluster, tofcluster);
849 }
850 else
851 {
852 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBad->Fill(etacluster, phicluster);
853 fhTimeTriggerEMCALBCUMBad->Fill(ecluster, tofcluster);
854 if(badMax) fhTimeTriggerEMCALBCUMBadMaxCell->Fill(ecluster, tofcluster);
855 }
856 }// Bad cluster trigger
857 else if(GetReader()->IsExoticEvent() )
858 {
859 if(GetReader()->IsTriggerMatched())
860 {
861 if(ecluster > 2) fhEtaPhiTriggerEMCALBCExotic->Fill(etacluster, phicluster);
862 fhTimeTriggerEMCALBCExotic->Fill(ecluster, tofcluster);
863 }
864 else
865 {
866 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMExotic->Fill(etacluster, phicluster);
867 fhTimeTriggerEMCALBCUMExotic->Fill(ecluster, tofcluster);
868 }
869 }
870 }
871 else if(TMath::Abs(bc) >= 6)
872 printf("AliAnaPhoton::ClusterSelected() - Trigger BC not expected = %d\n",bc);
873
874}
875
b94e038e 876//_________________________________________________________________________________________________________
877void AliAnaPhoton::FillClusterPileUpHistograms(AliVCluster * calo, Bool_t matched, Float_t ptcluster,
878 Float_t etacluster, Float_t phicluster, Float_t l0cluster)
b2e375c7 879{
880 // Fill some histograms related to pile up before any cluster cut is applied
881
882 if(!fFillPileUpHistograms) return ;
883
884 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
885 AliVCaloCells* cells = 0;
886 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
887 else cells = GetPHOSCells();
888
889 Float_t maxCellFraction = 0.;
890 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
891
892 Double_t tmax = cells->GetCellTime(absIdMax);
893 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
894 tmax*=1.e9;
895
896 Bool_t okPhoton = kFALSE;
897 if( GetCaloPID()->GetIdentifiedParticleType(calo)== AliCaloPID::kPhoton) okPhoton = kTRUE;
898
899 Float_t clusterLongTimePt = 0;
900 Float_t clusterOKTimePt = 0;
126b8c62 901
902 //Loop on cells inside cluster, max cell must be over 100 MeV and time in BC=0
903 if(cells->GetCellAmplitude(absIdMax) > 0.1 && TMath::Abs(tmax) < 30)
b2e375c7 904 {
126b8c62 905 for (Int_t ipos = 0; ipos < calo->GetNCells(); ipos++)
b2e375c7 906 {
126b8c62 907 Int_t absId = calo->GetCellsAbsId()[ipos];
908
909 if( absId == absIdMax ) continue ;
910
b2e375c7 911 Double_t time = cells->GetCellTime(absId);
912 Float_t amp = cells->GetCellAmplitude(absId);
913 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
914 GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,time,cells);
915 time*=1e9;
916
917 Float_t diff = (tmax-time);
918
919 if(GetReader()->IsInTimeWindow(time,amp)) clusterOKTimePt += amp;
920 else clusterLongTimePt += amp;
921
36769d30 922 if( cells->GetCellAmplitude(absIdMax) < 0.1 ) continue ;
126b8c62 923
b2e375c7 924 if(GetReader()->IsPileUpFromSPD())
925 {
126b8c62 926 fhClusterCellTimePileUp[0]->Fill(ptcluster, time);
927 fhClusterTimeDiffPileUp[0]->Fill(ptcluster, diff);
b2e375c7 928 if(!matched)
929 {
126b8c62 930 fhClusterTimeDiffChargedPileUp[0]->Fill(ptcluster, diff);
931 if(okPhoton) fhClusterTimeDiffPhotonPileUp[0]->Fill(ptcluster, diff);
b2e375c7 932 }
933 }
934
935 if(GetReader()->IsPileUpFromEMCal())
936 {
126b8c62 937 fhClusterCellTimePileUp[1]->Fill(ptcluster, time);
938 fhClusterTimeDiffPileUp[1]->Fill(ptcluster, diff);
b2e375c7 939 if(!matched)
940 {
126b8c62 941 fhClusterTimeDiffChargedPileUp[1]->Fill(ptcluster, diff);
942 if(okPhoton) fhClusterTimeDiffPhotonPileUp[1]->Fill(ptcluster, diff);
b2e375c7 943 }
944 }
945
946 if(GetReader()->IsPileUpFromSPDOrEMCal())
947 {
126b8c62 948 fhClusterCellTimePileUp[2]->Fill(ptcluster, time);
949 fhClusterTimeDiffPileUp[2]->Fill(ptcluster, diff);
b2e375c7 950 if(!matched)
951 {
126b8c62 952 fhClusterTimeDiffChargedPileUp[2]->Fill(ptcluster, diff);
953 if(okPhoton) fhClusterTimeDiffPhotonPileUp[2]->Fill(ptcluster, diff);
b2e375c7 954 }
955 }
956
957 if(GetReader()->IsPileUpFromSPDAndEMCal())
958 {
126b8c62 959 fhClusterCellTimePileUp[3]->Fill(ptcluster, time);
960 fhClusterTimeDiffPileUp[3]->Fill(ptcluster, diff);
b2e375c7 961 if(!matched)
962 {
126b8c62 963 fhClusterTimeDiffChargedPileUp[3]->Fill(ptcluster, diff);
964 if(okPhoton) fhClusterTimeDiffPhotonPileUp[3]->Fill(ptcluster, diff);
b2e375c7 965 }
966 }
967
968 if(GetReader()->IsPileUpFromSPDAndNotEMCal())
969 {
126b8c62 970 fhClusterCellTimePileUp[4]->Fill(ptcluster, time);
971 fhClusterTimeDiffPileUp[4]->Fill(ptcluster, diff);
b2e375c7 972 if(!matched)
973 {
126b8c62 974 fhClusterTimeDiffChargedPileUp[4]->Fill(ptcluster, diff);
975 if(okPhoton) fhClusterTimeDiffPhotonPileUp[4]->Fill(ptcluster, diff);
b2e375c7 976 }
977 }
978
979 if(GetReader()->IsPileUpFromEMCalAndNotSPD())
980 {
126b8c62 981 fhClusterCellTimePileUp[5]->Fill(ptcluster, time);
982 fhClusterTimeDiffPileUp[5]->Fill(ptcluster, diff);
b2e375c7 983 if(!matched)
984 {
126b8c62 985 fhClusterTimeDiffChargedPileUp[5]->Fill(ptcluster, diff);
986 if(okPhoton) fhClusterTimeDiffPhotonPileUp[5]->Fill(ptcluster, diff);
b2e375c7 987 }
988 }
989
990 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
991 {
126b8c62 992 fhClusterCellTimePileUp[6]->Fill(ptcluster, time);
993 fhClusterTimeDiffPileUp[6]->Fill(ptcluster, diff);
b2e375c7 994 if(!matched)
995 {
126b8c62 996 fhClusterTimeDiffChargedPileUp[6]->Fill(ptcluster, diff);
997 if(okPhoton) fhClusterTimeDiffPhotonPileUp[6]->Fill(ptcluster, diff);
b2e375c7 998 }
999 }
126b8c62 1000 }//loop
1001
1002
1003 Float_t frac = 0;
1004 if(clusterLongTimePt+clusterOKTimePt > 0.001)
1005 frac = clusterLongTimePt/(clusterLongTimePt+clusterOKTimePt);
1006 //printf("E long %f, E OK %f, Fraction large time %f, E %f\n",clusterLongTimePt,clusterOKTimePt,frac,ptcluster);
1007
1008 if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(ptcluster); fhLambda0PileUp[0]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[0]->Fill(ptcluster,frac);}
1009 if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(ptcluster); fhLambda0PileUp[1]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[1]->Fill(ptcluster,frac);}
1010 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(ptcluster); fhLambda0PileUp[2]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[2]->Fill(ptcluster,frac);}
1011 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(ptcluster); fhLambda0PileUp[3]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[3]->Fill(ptcluster,frac);}
1012 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ptcluster,frac);}
1013 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ptcluster,frac);}
1014 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ptcluster,frac);}
1015
1016 fhEtaPhiBC0->Fill(etacluster,phicluster);
1017 if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD ->Fill(etacluster,phicluster);
1018 }
b2e375c7 1019
b2e375c7 1020 else if (tmax > 25) {fhEtaPhiBCPlus ->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(etacluster,phicluster); }
1021 else if (tmax <-25) {fhEtaPhiBCMinus->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(etacluster,phicluster); }
1022}
1023
1024//_______________________________________________
85c4406e 1025void AliAnaPhoton::FillPileUpHistogramsPerEvent()
acd56ca4 1026{
1027 // Fill some histograms per event to understand pile-up
6227a9fd 1028 // Open the time cut in the reader to be more meaningful
1029
acd56ca4 1030 if(!fFillPileUpHistograms) return;
85c4406e 1031
0f7e7205 1032 AliVEvent * event = GetReader()->GetInputEvent();
1033
1034 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1035 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1036
1037 // N pile up vertices
1038 Int_t nVtxSPD = -1;
1039 Int_t nVtxTrk = -1;
1040 TLorentzVector mom;
1041
1042 if (esdEv)
1043 {
1044 nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
1045 nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
1046 }//ESD
1047 else if (aodEv)
1048 {
1049 nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
1050 nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
85c4406e 1051 }//AOD
0f7e7205 1052
1053
85c4406e 1054 // Get the appropriate list of clusters
0f7e7205 1055 TClonesArray * clusterList = 0;
1056 TString clusterListName = GetReader()->GetEMCALClusterListName();
1057 if (event->FindListObject(clusterListName))
1058 clusterList = dynamic_cast<TClonesArray*> (event->FindListObject(clusterListName));
1059 else if(GetReader()->GetOutputEvent())
1060 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(clusterListName));
1061
1062 // Loop on clusters, get the maximum energy cluster as reference
85c4406e 1063 Int_t nclusters = 0;
0f7e7205 1064 if(clusterList) nclusters = clusterList->GetEntriesFast();
1065 else nclusters = event->GetNumberOfCaloClusters();
1066
85c4406e 1067 Int_t idMax = 0;
acd56ca4 1068 Float_t eMax = 0;
85c4406e 1069 Float_t tMax = 0;
acd56ca4 1070 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
1071 {
0f7e7205 1072 AliVCluster * clus = 0;
85c4406e 1073 if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
0f7e7205 1074 else clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1075
1076 if(!clus) continue;
1077
1078 if(!clus->IsEMCAL()) continue;
1079
1080 Float_t tof = clus->GetTOF()*1e9;
b2e375c7 1081 if(clus->E() > eMax && TMath::Abs(tof) < 30)
acd56ca4 1082 {
1083 eMax = clus->E();
0f7e7205 1084 tMax = tof;
acd56ca4 1085 idMax = iclus;
1086 }
0f7e7205 1087
1088 clus->GetMomentum(mom,GetVertex(0));
1089 Float_t pt = mom.Pt();
1090
85c4406e 1091 fhPtNPileUpSPDVtx->Fill(pt,nVtxSPD);
0f7e7205 1092 fhPtNPileUpTrkVtx->Fill(pt,nVtxTrk);
85c4406e 1093
b2e375c7 1094 if(TMath::Abs(tof) < 30)
85c4406e 1095 {
1096 fhPtNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
1097 fhPtNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
0f7e7205 1098 }
85c4406e 1099
b2e375c7 1100 if(tof < 75 && tof > -30)
85c4406e 1101 {
1102 fhPtNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
1103 fhPtNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
1104 }
1105
b2e375c7 1106 fhTimePtNoCut->Fill(pt,tof);
1107 if(GetReader()->IsPileUpFromSPD()) fhTimePtSPD->Fill(pt,tof);
1108
acd56ca4 1109 }
0f7e7205 1110
6227a9fd 1111 if(eMax < 5) return;
acd56ca4 1112
1113 // Loop again on clusters to compare this max cluster t and the rest of the clusters, if E > 0.3
1114 Int_t n20 = 0;
1115 Int_t n40 = 0;
1116 Int_t n = 0;
1117 Int_t nOK = 0;
85c4406e 1118
acd56ca4 1119 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
1120 {
0f7e7205 1121 AliVCluster * clus = 0;
85c4406e 1122 if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
0f7e7205 1123 else clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1124
1125 if(!clus) continue;
1126
1127 if(!clus->IsEMCAL()) continue;
acd56ca4 1128
1129 if(clus->E() < 0.3 || iclus==idMax) continue;
1130
1131 Float_t tdiff = TMath::Abs(tMax-clus->GetTOF()*1e9);
1132 n++;
0f7e7205 1133 if(tdiff < 25) nOK++;
acd56ca4 1134 else
1135 {
1136 n20++;
1137 if(tdiff > 40 ) n40++;
1138 }
1139 }
1140
1141 // Check pile-up and fill histograms depending on the different cluster multiplicities
1142 if(GetReader()->IsPileUpFromSPD())
85c4406e 1143 {
acd56ca4 1144 fhClusterMultSPDPileUp[0]->Fill(eMax,n );
1145 fhClusterMultSPDPileUp[1]->Fill(eMax,nOK);
1146 fhClusterMultSPDPileUp[2]->Fill(eMax,n20);
1147 fhClusterMultSPDPileUp[3]->Fill(eMax,n40);
1148 }
85c4406e 1149 else
acd56ca4 1150 {
1151 fhClusterMultNoPileUp[0]->Fill(eMax,n );
1152 fhClusterMultNoPileUp[1]->Fill(eMax,nOK);
1153 fhClusterMultNoPileUp[2]->Fill(eMax,n20);
85c4406e 1154 fhClusterMultNoPileUp[3]->Fill(eMax,n40);
1155 }
acd56ca4 1156
1157}
1158
1159
fad96885 1160//_________________________________________________________________________________________________
22ad7981 1161void AliAnaPhoton::FillPileUpHistograms(Float_t energy, Float_t pt, Float_t time)
2ad19c3d 1162{
1163 // Fill some histograms to understand pile-up
1164 if(!fFillPileUpHistograms) return;
1165
1166 //printf("E %f, time %f\n",energy,time);
1167 AliVEvent * event = GetReader()->GetInputEvent();
1168
fad96885 1169 if(GetReader()->IsPileUpFromSPD()) fhPtPhotonPileUp[0]->Fill(pt);
1170 if(GetReader()->IsPileUpFromEMCal()) fhPtPhotonPileUp[1]->Fill(pt);
1171 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPhotonPileUp[2]->Fill(pt);
1172 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPhotonPileUp[3]->Fill(pt);
1173 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPhotonPileUp[4]->Fill(pt);
1174 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPhotonPileUp[5]->Fill(pt);
1175 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt);
1176
b2e375c7 1177 fhTimePtPhotonNoCut->Fill(pt,time);
1178 if(GetReader()->IsPileUpFromSPD()) fhTimePtPhotonSPD->Fill(pt,time);
2ad19c3d 1179
de101942 1180 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
2ad19c3d 1181
1182 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1183 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1184
1185 // N pile up vertices
0f7e7205 1186 Int_t nVtxSPD = -1;
1187 Int_t nVtxTrk = -1;
2ad19c3d 1188
1189 if (esdEv)
1190 {
0f7e7205 1191 nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
1192 nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
85c4406e 1193
2ad19c3d 1194 }//ESD
1195 else if (aodEv)
1196 {
0f7e7205 1197 nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
1198 nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
2ad19c3d 1199 }//AOD
1200
0f7e7205 1201 fhTimeNPileUpVertSPD ->Fill(time,nVtxSPD);
1202 fhTimeNPileUpVertTrack->Fill(time,nVtxTrk);
2ad19c3d 1203
85c4406e 1204 fhPtPhotonNPileUpSPDVtx->Fill(pt,nVtxSPD);
0f7e7205 1205 fhPtPhotonNPileUpTrkVtx->Fill(pt,nVtxTrk);
1206
1207 if(TMath::Abs(time) < 25)
85c4406e 1208 {
1209 fhPtPhotonNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
1210 fhPtPhotonNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
0f7e7205 1211 }
1212
85c4406e 1213 if(time < 75 && time > -25)
1214 {
1215 fhPtPhotonNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
1216 fhPtPhotonNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
1217 }
1218
1219 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
0f7e7205 1220 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVtxSPD,nVtxTrk);
2ad19c3d 1221
1222 Int_t ncont = -1;
5559f30a 1223 Float_t z1 = -1, z2 = -1;
2ad19c3d 1224 Float_t diamZ = -1;
0f7e7205 1225 for(Int_t iVert=0; iVert<nVtxSPD;iVert++)
2ad19c3d 1226 {
1227 if (esdEv)
1228 {
1229 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
1230 ncont=pv->GetNContributors();
1231 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
1232 z2 = pv->GetZ();
1233 diamZ = esdEv->GetDiamondZ();
1234 }//ESD
1235 else if (aodEv)
1236 {
1237 AliAODVertex *pv=aodEv->GetVertex(iVert);
1238 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
1239 ncont=pv->GetNContributors();
1240 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
1241 z2=pv->GetZ();
1242 diamZ = aodEv->GetDiamondZ();
1243 }// AOD
1244
1245 Double_t distZ = TMath::Abs(z2-z1);
1246 diamZ = TMath::Abs(z2-diamZ);
85c4406e 1247
2ad19c3d 1248 fhTimeNPileUpVertContributors ->Fill(time,ncont);
1249 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
1250 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
85c4406e 1251
2ad19c3d 1252 }// loop
1253}
1254
34c16486 1255//____________________________________________________________________________________
22ad7981 1256void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
34c16486 1257{
85c4406e 1258 //Fill cluster Shower Shape histograms
521636d2 1259
1260 if(!fFillSSHistograms || GetMixedEvent()) return;
85c4406e 1261
521636d2 1262 Float_t energy = cluster->E();
1263 Int_t ncells = cluster->GetNCells();
521636d2 1264 Float_t lambda0 = cluster->GetM02();
1265 Float_t lambda1 = cluster->GetM20();
1266 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
1267
1268 TLorentzVector mom;
34c16486 1269 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1270 {
1271 cluster->GetMomentum(mom,GetVertex(0)) ;
1272 }//Assume that come from vertex in straight line
1273 else
1274 {
521636d2 1275 Double_t vertex[]={0,0,0};
1276 cluster->GetMomentum(mom,vertex) ;
1277 }
1278
1279 Float_t eta = mom.Eta();
1280 Float_t phi = mom.Phi();
1281 if(phi < 0) phi+=TMath::TwoPi();
1282
1283 fhLam0E ->Fill(energy,lambda0);
1284 fhLam1E ->Fill(energy,lambda1);
1285 fhDispE ->Fill(energy,disp);
85c4406e 1286
34c16486 1287 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1288 {
521636d2 1289 fhLam0ETRD->Fill(energy,lambda0);
1290 fhLam1ETRD->Fill(energy,lambda1);
1291 fhDispETRD->Fill(energy,disp);
521636d2 1292 }
1293
34c16486 1294 Float_t l0 = 0., l1 = 0.;
85c4406e 1295 Float_t dispp= 0., dEta = 0., dPhi = 0.;
1296 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
764ab1f4 1297 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
34c16486 1298 {
1299 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
1300 l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
1301 //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",
1302 // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
1303 //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
1304 // disp, dPhi+dEta );
1305 fhDispEtaE -> Fill(energy,dEta);
1306 fhDispPhiE -> Fill(energy,dPhi);
1307 fhSumEtaE -> Fill(energy,sEta);
1308 fhSumPhiE -> Fill(energy,sPhi);
1309 fhSumEtaPhiE -> Fill(energy,sEtaPhi);
1310 fhDispEtaPhiDiffE -> Fill(energy,dPhi-dEta);
1311 if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
1312 if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.));
85c4406e 1313 if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));
34c16486 1314
bfdcf7fb 1315 Int_t ebin = -1;
1316 if (energy < 2 ) ebin = 0;
1317 else if (energy < 4 ) ebin = 1;
1318 else if (energy < 6 ) ebin = 2;
1319 else if (energy < 10) ebin = 3;
85c4406e 1320 else if (energy < 15) ebin = 4;
1321 else if (energy < 20) ebin = 5;
1322 else ebin = 6;
bfdcf7fb 1323
1324 fhDispEtaDispPhi[ebin]->Fill(dEta ,dPhi);
1325 fhLambda0DispEta[ebin]->Fill(lambda0,dEta);
1326 fhLambda0DispPhi[ebin]->Fill(lambda0,dPhi);
1327
34c16486 1328 }
1329
85c4406e 1330 // if track-matching was of, check effect of track-matching residual cut
b5dbb99b 1331
1332 if(!fRejectTrackMatch)
1333 {
1334 Float_t dZ = cluster->GetTrackDz();
1335 Float_t dR = cluster->GetTrackDx();
34c16486 1336 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1337 {
b5dbb99b 1338 dR = 2000., dZ = 2000.;
1339 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
85c4406e 1340 }
b5dbb99b 1341
1342 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1343 {
1344 fhLam0ETM ->Fill(energy,lambda0);
1345 fhLam1ETM ->Fill(energy,lambda1);
1346 fhDispETM ->Fill(energy,disp);
1347
34c16486 1348 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1349 {
b5dbb99b 1350 fhLam0ETMTRD->Fill(energy,lambda0);
1351 fhLam1ETMTRD->Fill(energy,lambda1);
1352 fhDispETMTRD->Fill(energy,disp);
1353 }
1354 }
85c4406e 1355 }// if track-matching was of, check effect of matching residual cut
b5dbb99b 1356
764ab1f4 1357
1358 if(!fFillOnlySimpleSSHisto){
1359 if(energy < 2)
1360 {
1361 fhNCellsLam0LowE ->Fill(ncells,lambda0);
1362 fhNCellsLam1LowE ->Fill(ncells,lambda1);
1363 fhNCellsDispLowE ->Fill(ncells,disp);
1364
1365 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
1366 fhLam0DispLowE ->Fill(lambda0,disp);
1367 fhDispLam1LowE ->Fill(disp,lambda1);
1368 fhEtaLam0LowE ->Fill(eta,lambda0);
85c4406e 1369 fhPhiLam0LowE ->Fill(phi,lambda0);
764ab1f4 1370 }
85c4406e 1371 else
764ab1f4 1372 {
1373 fhNCellsLam0HighE ->Fill(ncells,lambda0);
1374 fhNCellsLam1HighE ->Fill(ncells,lambda1);
1375 fhNCellsDispHighE ->Fill(ncells,disp);
1376
1377 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
1378 fhLam0DispHighE ->Fill(lambda0,disp);
1379 fhDispLam1HighE ->Fill(disp,lambda1);
1380 fhEtaLam0HighE ->Fill(eta, lambda0);
1381 fhPhiLam0HighE ->Fill(phi, lambda0);
1382 }
521636d2 1383 }
34c16486 1384 if(IsDataMC())
1385 {
f66d95af 1386 AliVCaloCells* cells = 0;
1387 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
1388 else cells = GetPHOSCells();
3d5d5078 1389
1390 //Fill histograms to check shape of embedded clusters
1391 Float_t fraction = 0;
85c4406e 1392 // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
1393
34c16486 1394 if(GetReader()->IsEmbeddedClusterSelectionOn())
1395 {//Only working for EMCAL
85c4406e 1396 // printf("embedded\n");
3d5d5078 1397 Float_t clusterE = 0; // recalculate in case corrections applied.
1398 Float_t cellE = 0;
34c16486 1399 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
1400 {
3d5d5078 1401 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
85c4406e 1402 clusterE+=cellE;
3d5d5078 1403 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
1404 }
1405
1406 //Fraction of total energy due to the embedded signal
1407 fraction/=clusterE;
1408
85c4406e 1409 if(GetDebug() > 1 )
8d6b7f60 1410 printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
3d5d5078 1411
1412 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
1413
85c4406e 1414 } // embedded fraction
3d5d5078 1415
f66d95af 1416 // Get the fraction of the cluster energy that carries the cell with highest energy
34c16486 1417 Int_t absID =-1 ;
f66d95af 1418 Float_t maxCellFraction = 0.;
1419
1420 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
1421
1422 // Check the origin and fill histograms
34c16486 1423
1424 Int_t mcIndex = -1;
1425
85c4406e 1426 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
3d5d5078 1427 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
34c16486 1428 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1429 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1430 {
1431 mcIndex = kmcssPhoton ;
85c4406e 1432
34c16486 1433 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1434 {
3d5d5078 1435 //Check particle overlaps in cluster
1436
85c4406e 1437 // Compare the primary depositing more energy with the rest,
8d6b7f60 1438 // if no photon/electron as comon ancestor (conversions), count as other particle
4914e781 1439 const UInt_t nlabels = cluster->GetNLabels();
1440 Int_t overpdg[nlabels];
1441 Int_t noverlaps = GetMCAnalysisUtils()->GetNOverlaps(cluster->GetLabels(), nlabels,mcTag,-1,GetReader(),overpdg);
1442
8d6b7f60 1443 //printf("N overlaps %d \n",noverlaps);
3d5d5078 1444
f27fe026 1445 if(noverlaps == 0)
34c16486 1446 {
3d5d5078 1447 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
3d5d5078 1448 }
f27fe026 1449 else if(noverlaps == 1)
85c4406e 1450 {
3d5d5078 1451 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
3d5d5078 1452 }
f27fe026 1453 else if(noverlaps > 1)
85c4406e 1454 {
3d5d5078 1455 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
3d5d5078 1456 }
85c4406e 1457 else
34c16486 1458 {
f27fe026 1459 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!\n", noverlaps);
3d5d5078 1460 }
1461 }//No embedding
1462
1463 //Fill histograms to check shape of embedded clusters
34c16486 1464 if(GetReader()->IsEmbeddedClusterSelectionOn())
1465 {
85c4406e 1466 if (fraction > 0.9)
3d5d5078 1467 {
1468 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
3d5d5078 1469 }
1470 else if(fraction > 0.5)
1471 {
1472 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
3d5d5078 1473 }
1474 else if(fraction > 0.1)
85c4406e 1475 {
3d5d5078 1476 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
3d5d5078 1477 }
1478 else
1479 {
1480 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
3d5d5078 1481 }
1482 } // embedded
1483
521636d2 1484 }//photon no conversion
4431f13a 1485 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1486 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
1487 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1488 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1489 {
1490 mcIndex = kmcssConversion ;
1491 }//conversion photon
1492
34c16486 1493 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
1494 {
1495 mcIndex = kmcssElectron ;
521636d2 1496 }//electron
34c16486 1497 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
1498 {
1499 mcIndex = kmcssPi0 ;
3d5d5078 1500
1501 //Fill histograms to check shape of embedded clusters
34c16486 1502 if(GetReader()->IsEmbeddedClusterSelectionOn())
1503 {
85c4406e 1504 if (fraction > 0.9)
3d5d5078 1505 {
1506 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
3d5d5078 1507 }
1508 else if(fraction > 0.5)
1509 {
1510 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
3d5d5078 1511 }
1512 else if(fraction > 0.1)
85c4406e 1513 {
3d5d5078 1514 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
3d5d5078 1515 }
1516 else
1517 {
1518 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
3d5d5078 1519 }
85c4406e 1520 } // embedded
3d5d5078 1521
521636d2 1522 }//pi0
34c16486 1523 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
1524 {
1525 mcIndex = kmcssEta ;
85c4406e 1526 }//eta
1527 else
34c16486 1528 {
85c4406e 1529 mcIndex = kmcssOther ;
1530 }//other particles
521636d2 1531
34c16486 1532 fhMCELambda0 [mcIndex]->Fill(energy, lambda0);
1533 fhMCELambda1 [mcIndex]->Fill(energy, lambda1);
1534 fhMCEDispersion [mcIndex]->Fill(energy, disp);
1535 fhMCNCellsE [mcIndex]->Fill(energy, ncells);
1536 fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction);
1537
764ab1f4 1538 if(!fFillOnlySimpleSSHisto)
34c16486 1539 {
764ab1f4 1540 if (energy < 2.)
1541 {
1542 fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction);
1543 fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction);
1544 }
1545 else if(energy < 6.)
1546 {
1547 fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction);
1548 fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction);
1549 }
1550 else
1551 {
1552 fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction);
1553 fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction);
1554 }
1555
1556 if(fCalorimeter == "EMCAL")
1557 {
1558 fhMCEDispEta [mcIndex]-> Fill(energy,dEta);
1559 fhMCEDispPhi [mcIndex]-> Fill(energy,dPhi);
1560 fhMCESumEtaPhi [mcIndex]-> Fill(energy,sEtaPhi);
1561 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy,dPhi-dEta);
85c4406e 1562 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
764ab1f4 1563
1564 Int_t ebin = -1;
1565 if (energy < 2 ) ebin = 0;
1566 else if (energy < 4 ) ebin = 1;
1567 else if (energy < 6 ) ebin = 2;
1568 else if (energy < 10) ebin = 3;
85c4406e 1569 else if (energy < 15) ebin = 4;
1570 else if (energy < 20) ebin = 5;
1571 else ebin = 6;
764ab1f4 1572
1573 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta ,dPhi);
1574 fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0,dEta);
85c4406e 1575 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);
764ab1f4 1576 }
34c16486 1577 }
521636d2 1578 }//MC data
1579
1580}
1581
4bfeae64 1582//__________________________________________________________________________
85c4406e 1583void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
22ad7981 1584 Int_t cut)
4bfeae64 1585{
1586 // If selected, fill histograms with residuals of matched clusters, help to define track matching cut
1587 // Residual filled for different cuts 0 (No cut), after 1 PID cut
85c4406e 1588
4bfeae64 1589 Float_t dZ = cluster->GetTrackDz();
1590 Float_t dR = cluster->GetTrackDx();
1591
1592 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1593 {
1594 dR = 2000., dZ = 2000.;
1595 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
85c4406e 1596 }
1597
b2e375c7 1598 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
1599
1600 Bool_t positive = kFALSE;
1601 if(track) positive = (track->Charge()>0);
1602
4bfeae64 1603 if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
1604 {
1605 fhTrackMatchedDEta[cut]->Fill(cluster->E(),dZ);
1606 fhTrackMatchedDPhi[cut]->Fill(cluster->E(),dR);
4bfeae64 1607 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ,dR);
b2e375c7 1608
1609 if(track)
1610 {
1611 if(positive)
1612 {
1613 fhTrackMatchedDEtaPos[cut]->Fill(cluster->E(),dZ);
1614 fhTrackMatchedDPhiPos[cut]->Fill(cluster->E(),dR);
1615 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiPos[cut]->Fill(dZ,dR);
1616 }
1617 else
1618 {
1619 fhTrackMatchedDEtaNeg[cut]->Fill(cluster->E(),dZ);
1620 fhTrackMatchedDPhiNeg[cut]->Fill(cluster->E(),dR);
1621 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiNeg[cut]->Fill(dZ,dR);
1622 }
1623 }
4bfeae64 1624
1625 Int_t nSMod = GetModuleNumber(cluster);
1626
1627 if(fCalorimeter=="EMCAL" && nSMod > 5)
1628 {
1629 fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(),dZ);
1630 fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(),dR);
1631 }
1632
1633 // Check dEdx and E/p of matched clusters
b2e375c7 1634
4bfeae64 1635 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
85c4406e 1636 {
85c4406e 1637 if(track)
4bfeae64 1638 {
4bfeae64 1639 Float_t dEdx = track->GetTPCsignal();
1640 Float_t eOverp = cluster->E()/track->P();
1641
1642 fhdEdx[cut] ->Fill(cluster->E(), dEdx);
1643 fhEOverP[cut]->Fill(cluster->E(), eOverp);
1644
1645 if(fCalorimeter=="EMCAL" && nSMod > 5)
1646 fhEOverPTRD[cut]->Fill(cluster->E(), eOverp);
1647
1648
1649 }
1650 else
85c4406e 1651 printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
4bfeae64 1652
1653
1654
1655 if(IsDataMC())
1656 {
1657
2644ead9 1658 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader());
4bfeae64 1659
1660 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1661 {
1662 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
85c4406e 1663 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
4bfeae64 1664 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5 );
1665 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5 );
1666 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5 );
1667
1668 // Check if several particles contributed to cluster and discard overlapped mesons
85c4406e 1669 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
34c16486 1670 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1671 {
4bfeae64 1672 if(cluster->GetNLabels()==1)
1673 {
1674 fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(),dZ);
1675 fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(),dR);
1676 }
85c4406e 1677 else
4bfeae64 1678 {
1679 fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(),dZ);
1680 fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(),dR);
1681 }
1682
1683 }// Check overlaps
1684
1685 }
1686 else
1687 {
1688 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
85c4406e 1689 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
4bfeae64 1690 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5 );
1691 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5 );
1692 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5 );
1693
1694 // Check if several particles contributed to cluster
85c4406e 1695 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
34c16486 1696 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1697 {
4bfeae64 1698 fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(),dZ);
1699 fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(),dR);
1700
85c4406e 1701 }// Check overlaps
4bfeae64 1702
1703 }
1704
85c4406e 1705 } // MC
4bfeae64 1706
1707 } // residuals window
1708
1709 } // Small residual
1710
1711}
1712
1713//___________________________________________
0c1383b5 1714TObjString * AliAnaPhoton::GetAnalysisCuts()
85c4406e 1715{
0c1383b5 1716 //Save parameters used for analysis
1717 TString parList ; //this will be list of parameters used for this analysis.
5ae09196 1718 const Int_t buffersize = 255;
1719 char onePar[buffersize] ;
0c1383b5 1720
5ae09196 1721 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
85c4406e 1722 parList+=onePar ;
5ae09196 1723 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
0c1383b5 1724 parList+=onePar ;
5ae09196 1725 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
0c1383b5 1726 parList+=onePar ;
5ae09196 1727 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
0c1383b5 1728 parList+=onePar ;
5ae09196 1729 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
0c1383b5 1730 parList+=onePar ;
5ae09196 1731 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
85c4406e 1732 parList+=onePar ;
0c1383b5 1733
1734 //Get parameters set in base class.
1735 parList += GetBaseParametersList() ;
1736
1737 //Get parameters set in PID class.
1738 parList += GetCaloPID()->GetPIDParametersList() ;
1739
1740 //Get parameters set in FiducialCut class (not available yet)
85c4406e 1741 //parlist += GetFidCut()->GetFidCutParametersList()
0c1383b5 1742
1743 return new TObjString(parList) ;
1744}
1745
1c5acb87 1746//________________________________________________________________________
1747TList * AliAnaPhoton::GetCreateOutputObjects()
c2a62a94 1748{
85c4406e 1749 // Create histograms to be saved in output file and
477d6cee 1750 // store them in outputContainer
85c4406e 1751 TList * outputContainer = new TList() ;
1752 outputContainer->SetName("PhotonHistos") ;
4a745797 1753
85c4406e 1754 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1755 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1756 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
745913ae 1757 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
85c4406e 1758 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1759 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1760
1761 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1762 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
09273901 1763 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
85c4406e 1764 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1765 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
09273901 1766 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1767
85c4406e 1768 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1769 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
31ae6d59 1770 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
85c4406e 1771 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1772 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
31ae6d59 1773 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
09273901 1774
d2655d46 1775 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1776
eb86112d 1777 Int_t nTrigBC = 1;
1778 Int_t iBCShift = 0;
1779 if(!GetReader()->AreBadTriggerEventsRemoved())
1780 {
1781 nTrigBC = 11;
1782 iBCShift = 5;
1783 }
1784
9e51e29a 1785 TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
85c4406e 1786 for (Int_t i = 0; i < 10 ; i++)
fc195fd0 1787 {
1788 fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
1789 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
85c4406e 1790 nptbins,ptmin,ptmax);
fc195fd0 1791 fhClusterCuts[i]->SetYTitle("dN/dE ");
1792 fhClusterCuts[i]->SetXTitle("E (GeV)");
85c4406e 1793 outputContainer->Add(fhClusterCuts[i]) ;
fc195fd0 1794 }
1795
85c4406e 1796 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
c4a7d28a 1797 fhNCellsE->SetXTitle("E (GeV)");
1798 fhNCellsE->SetYTitle("# of cells in cluster");
85c4406e 1799 outputContainer->Add(fhNCellsE);
f15c25da 1800
85c4406e 1801 fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
5c46c992 1802 fhCellsE->SetXTitle("E_{cluster} (GeV)");
1803 fhCellsE->SetYTitle("E_{cell} (GeV)");
85c4406e 1804 outputContainer->Add(fhCellsE);
5c46c992 1805
b2e375c7 1806 fhTimePt = new TH2F ("hTimePt","time of cluster vs pT of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1807 fhTimePt->SetXTitle("p_{T} (GeV/c)");
1808 fhTimePt->SetYTitle("time (ns)");
1809 outputContainer->Add(fhTimePt);
6175da48 1810
f66d95af 1811 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
85c4406e 1812 nptbins,ptmin,ptmax, 500,0,1.);
f66d95af 1813 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1814 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 1815 outputContainer->Add(fhMaxCellDiffClusterE);
f66d95af 1816
85c4406e 1817 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
20218aea 1818 fhEPhoton->SetYTitle("N");
1819 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
85c4406e 1820 outputContainer->Add(fhEPhoton) ;
20218aea 1821
85c4406e 1822 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
477d6cee 1823 fhPtPhoton->SetYTitle("N");
1824 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
85c4406e 1825 outputContainer->Add(fhPtPhoton) ;
1826
c8710850 1827 fhPtCentralityPhoton = new TH2F("hPtCentralityPhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
1828 fhPtCentralityPhoton->SetYTitle("Centrality");
1829 fhPtCentralityPhoton->SetXTitle("p_{T}(GeV/c)");
1830 outputContainer->Add(fhPtCentralityPhoton) ;
1831
1832 fhPtEventPlanePhoton = new TH2F("hPtEventPlanePhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1833 fhPtEventPlanePhoton->SetYTitle("Event plane angle (rad)");
1834 fhPtEventPlanePhoton->SetXTitle("p_{T} (GeV/c)");
1835 outputContainer->Add(fhPtEventPlanePhoton) ;
85c4406e 1836
c2a62a94 1837 fhEtaPhi = new TH2F
1838 ("hEtaPhi","cluster,E > 0.5 GeV, #eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1839 fhEtaPhi->SetYTitle("#phi (rad)");
1840 fhEtaPhi->SetXTitle("#eta");
1841 outputContainer->Add(fhEtaPhi) ;
85c4406e 1842
c2a62a94 1843 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
1844 {
1845 fhEtaPhiEMCALBC0 = new TH2F
1846 ("hEtaPhiEMCALBC0","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
1847 fhEtaPhiEMCALBC0->SetYTitle("#phi (rad)");
1848 fhEtaPhiEMCALBC0->SetXTitle("#eta");
1849 outputContainer->Add(fhEtaPhiEMCALBC0) ;
1850
1851 fhEtaPhiEMCALBC1 = new TH2F
1852 ("hEtaPhiEMCALBC1","cluster,E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
1853 fhEtaPhiEMCALBC1->SetYTitle("#phi (rad)");
1854 fhEtaPhiEMCALBC1->SetXTitle("#eta");
1855 outputContainer->Add(fhEtaPhiEMCALBC1) ;
1856
1857 fhEtaPhiEMCALBCN = new TH2F
1858 ("hEtaPhiEMCALBCN","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
1859 fhEtaPhiEMCALBCN->SetYTitle("#phi (rad)");
1860 fhEtaPhiEMCALBCN->SetXTitle("#eta");
1861 outputContainer->Add(fhEtaPhiEMCALBCN) ;
1862
eb86112d 1863 for(Int_t i = 0; i < nTrigBC; i++)
c2a62a94 1864 {
1865 fhEtaPhiTriggerEMCALBC[i] = new TH2F
eb86112d 1866 (Form("hEtaPhiTriggerEMCALBC%d",i-iBCShift),
1867 Form("cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 1868 netabins,etamin,etamax,nphibins,phimin,phimax);
1869 fhEtaPhiTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
1870 fhEtaPhiTriggerEMCALBC[i]->SetXTitle("#eta");
1871 outputContainer->Add(fhEtaPhiTriggerEMCALBC[i]) ;
1872
1873 fhTimeTriggerEMCALBC[i] = new TH2F
eb86112d 1874 (Form("hTimeTriggerEMCALBC%d",i-iBCShift),
1875 Form("cluster time vs E of clusters, Trigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 1876 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1877 fhTimeTriggerEMCALBC[i]->SetXTitle("E (GeV)");
1878 fhTimeTriggerEMCALBC[i]->SetYTitle("time (ns)");
1879 outputContainer->Add(fhTimeTriggerEMCALBC[i]);
1880
1881 fhTimeTriggerEMCALBCPileUpSPD[i] = new TH2F
eb86112d 1882 (Form("hTimeTriggerEMCALBC%dPileUpSPD",i-iBCShift),
1883 Form("cluster time vs E of clusters, Trigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 1884 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1885 fhTimeTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
1886 fhTimeTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
1887 outputContainer->Add(fhTimeTriggerEMCALBCPileUpSPD[i]);
afb3af8a 1888
1889 fhEtaPhiTriggerEMCALBCUM[i] = new TH2F
eb86112d 1890 (Form("hEtaPhiTriggerEMCALBC%d_UnMatch",i-iBCShift),
1891 Form("cluster E > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 1892 netabins,etamin,etamax,nphibins,phimin,phimax);
1893 fhEtaPhiTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
1894 fhEtaPhiTriggerEMCALBCUM[i]->SetXTitle("#eta");
1895 outputContainer->Add(fhEtaPhiTriggerEMCALBCUM[i]) ;
1896
1897 fhTimeTriggerEMCALBCUM[i] = new TH2F
eb86112d 1898 (Form("hTimeTriggerEMCALBC%d_UnMatch",i-iBCShift),
1899 Form("cluster time vs E of clusters, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 1900 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1901 fhTimeTriggerEMCALBCUM[i]->SetXTitle("E (GeV)");
1902 fhTimeTriggerEMCALBCUM[i]->SetYTitle("time (ns)");
1903 outputContainer->Add(fhTimeTriggerEMCALBCUM[i]);
1904
1905 fhEtaPhiTriggerEMCALBCCluster[i] = new TH2F
eb86112d 1906 (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger",i-iBCShift),
1907 Form("trigger cluster, #eta vs #phi, Trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 1908 netabins,etamin,etamax,nphibins,phimin,phimax);
1909 fhEtaPhiTriggerEMCALBCCluster[i]->SetYTitle("#phi (rad)");
1910 fhEtaPhiTriggerEMCALBCCluster[i]->SetXTitle("#eta");
1911 outputContainer->Add(fhEtaPhiTriggerEMCALBCCluster[i]) ;
126b8c62 1912
afb3af8a 1913 fhEtaPhiTriggerEMCALBCUMCluster[i] = new TH2F
eb86112d 1914 (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger_UnMatch",i-iBCShift),
1915 Form("trigger cluster, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 1916 netabins,etamin,etamax,nphibins,phimin,phimax);
1917 fhEtaPhiTriggerEMCALBCUMCluster[i]->SetYTitle("#phi (rad)");
1918 fhEtaPhiTriggerEMCALBCUMCluster[i]->SetXTitle("#eta");
1919 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMCluster[i]) ;
c2a62a94 1920 }
afb3af8a 1921
126b8c62 1922 fhTimeTriggerEMCALBCCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger",
1923 "trigger cluster time vs E of clusters",
1924 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1925 fhTimeTriggerEMCALBCCluster->SetXTitle("E (GeV)");
1926 fhTimeTriggerEMCALBCCluster->SetYTitle("time (ns)");
1927 outputContainer->Add(fhTimeTriggerEMCALBCCluster);
1928
1929 fhTimeTriggerEMCALBCUMCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger_UnMatch",
1930 "trigger cluster time vs E of clusters, unmatched trigger",
1931 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1932 fhTimeTriggerEMCALBCUMCluster->SetXTitle("E (GeV)");
1933 fhTimeTriggerEMCALBCUMCluster->SetYTitle("time (ns)");
1934 outputContainer->Add(fhTimeTriggerEMCALBCUMCluster);
1935
afb3af8a 1936 fhEtaPhiTriggerEMCALBCClusterOverTh = new TH2F
1937 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold",
1938 "trigger cluster E > trigger threshold, #eta vs #phi, Trigger EMCAL-BC=0",
1939 netabins,etamin,etamax,nphibins,phimin,phimax);
1940 fhEtaPhiTriggerEMCALBCClusterOverTh->SetYTitle("#phi (rad)");
1941 fhEtaPhiTriggerEMCALBCClusterOverTh->SetXTitle("#eta");
1942 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterOverTh) ;
85c4406e 1943
afb3af8a 1944 fhEtaPhiTriggerEMCALBCUMClusterOverTh = new TH2F
1945 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold_UnMatch",
1946 "trigger cluster E > trigger threshold, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1947 netabins,etamin,etamax,nphibins,phimin,phimax);
1948 fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetYTitle("#phi (rad)");
1949 fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetXTitle("#eta");
1950 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterOverTh) ;
85c4406e 1951
afb3af8a 1952 fhEtaPhiTriggerEMCALBCClusterBelowTh1 = new TH2F
1953 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1",
1954 "trigger cluster thresh-1 < E < thres, #eta vs #phi, Trigger EMCAL-BC=0",
1955 netabins,etamin,etamax,nphibins,phimin,phimax);
1956 fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetYTitle("#phi (rad)");
1957 fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetXTitle("#eta");
1958 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh1) ;
1959
1960 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1 = new TH2F
1961 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1_UnMatch",
1962 "trigger cluster thresh-1 < E < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1963 netabins,etamin,etamax,nphibins,phimin,phimax);
1964 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetYTitle("#phi (rad)");
1965 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetXTitle("#eta");
1966 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh1) ;
85c4406e 1967
afb3af8a 1968 fhEtaPhiTriggerEMCALBCClusterBelowTh2 = new TH2F
1969 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2",
1970 "trigger cluster thresh-2 < E < thres, #eta vs #phi, Trigger EMCAL-BC=0",
1971 netabins,etamin,etamax,nphibins,phimin,phimax);
1972 fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetYTitle("#phi (rad)");
1973 fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetXTitle("#eta");
1974 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh2) ;
1975
1976 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2 = new TH2F
1977 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2_UnMatch",
1978 "trigger cluster thresh-2 < E < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1979 netabins,etamin,etamax,nphibins,phimin,phimax);
1980 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetYTitle("#phi (rad)");
1981 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetXTitle("#eta");
1982 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh2) ;
85c4406e 1983
eb86112d 1984 if(!GetReader()->AreBadTriggerEventsRemoved())
1985 {
1986 fhEtaPhiTriggerEMCALBCExotic = new TH2F
1987 ("hEtaPhiTriggerExotic",
1988 "cluster E > 2 GeV, #eta vs #phi, Trigger Exotic",
1989 netabins,etamin,etamax,nphibins,phimin,phimax);
1990 fhEtaPhiTriggerEMCALBCExotic->SetYTitle("#phi (rad)");
1991 fhEtaPhiTriggerEMCALBCExotic->SetXTitle("#eta");
1992 outputContainer->Add(fhEtaPhiTriggerEMCALBCExotic) ;
1993
1994 fhTimeTriggerEMCALBCExotic = new TH2F
1995 ("hTimeTriggerExotic",
1996 "cluster time vs E of clusters, Trigger Exotic ",
1997 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1998 fhTimeTriggerEMCALBCExotic->SetXTitle("E (GeV)");
1999 fhTimeTriggerEMCALBCExotic->SetYTitle("time (ns)");
2000 outputContainer->Add(fhTimeTriggerEMCALBCExotic);
2001
2002 fhEtaPhiTriggerEMCALBCUMExotic = new TH2F
2003 ("hEtaPhiTriggerExotic_UnMatch",
2004 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
2005 netabins,etamin,etamax,nphibins,phimin,phimax);
2006 fhEtaPhiTriggerEMCALBCUMExotic->SetYTitle("#phi (rad)");
2007 fhEtaPhiTriggerEMCALBCUMExotic->SetXTitle("#eta");
2008 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExotic) ;
2009
2010 fhTimeTriggerEMCALBCUMExotic = new TH2F
2011 ("hTimeTriggerExotic_UnMatch",
2012 "cluster time vs E of clusters, unmatched trigger Exotic",
2013 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2014 fhTimeTriggerEMCALBCUMExotic->SetXTitle("E (GeV)");
2015 fhTimeTriggerEMCALBCUMExotic->SetYTitle("time (ns)");
2016 outputContainer->Add(fhTimeTriggerEMCALBCUMExotic);
2017
2018 fhEtaPhiTriggerEMCALBCExoticCluster = new TH2F
2019 ("hEtaPhiTriggerExotic_OnlyTrigger",
2020 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Exotic",
2021 netabins,etamin,etamax,nphibins,phimin,phimax);
2022 fhEtaPhiTriggerEMCALBCExoticCluster->SetYTitle("#phi (rad)");
2023 fhEtaPhiTriggerEMCALBCExoticCluster->SetXTitle("#eta");
2024 outputContainer->Add(fhEtaPhiTriggerEMCALBCExoticCluster) ;
2025
2026 fhTimeTriggerEMCALBCExoticCluster = new TH2F
2027 ("hTimeTriggerExotic_OnlyTrigger",
2028 "trigger cluster time vs E of clusters, Trigger Exotic",
2029 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2030 fhTimeTriggerEMCALBCExoticCluster->SetXTitle("E (GeV)");
2031 fhTimeTriggerEMCALBCExoticCluster->SetYTitle("time (ns)");
2032 outputContainer->Add(fhTimeTriggerEMCALBCExoticCluster);
2033
2034 fhEtaPhiTriggerEMCALBCUMExoticCluster = new TH2F
2035 ("hEtaPhiTriggerExotic_OnlyTrigger_UnMatch",
2036 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
2037 netabins,etamin,etamax,nphibins,phimin,phimax);
2038 fhEtaPhiTriggerEMCALBCUMExoticCluster->SetYTitle("#phi (rad)");
2039 fhEtaPhiTriggerEMCALBCUMExoticCluster->SetXTitle("#eta");
2040 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExoticCluster) ;
2041
2042 fhTimeTriggerEMCALBCUMExoticCluster = new TH2F
2043 ("hTimeTriggerExotic_OnlyTrigger_UnMatch",
2044 "trigger cluster time vs E of clusters, unmatched trigger Exotic",
2045 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2046 fhTimeTriggerEMCALBCUMExoticCluster->SetXTitle("E (GeV)");
2047 fhTimeTriggerEMCALBCUMExoticCluster->SetYTitle("time (ns)");
2048 outputContainer->Add(fhTimeTriggerEMCALBCUMExoticCluster);
2049
2050 fhEtaPhiTriggerEMCALBCBad = new TH2F
2051 ("hEtaPhiTriggerBad",
2052 "cluster E > 2 GeV, #eta vs #phi, Trigger Bad",
2053 netabins,etamin,etamax,nphibins,phimin,phimax);
2054 fhEtaPhiTriggerEMCALBCBad->SetYTitle("#phi (rad)");
2055 fhEtaPhiTriggerEMCALBCBad->SetXTitle("#eta");
2056 outputContainer->Add(fhEtaPhiTriggerEMCALBCBad) ;
2057
2058 fhTimeTriggerEMCALBCBad = new TH2F
2059 ("hTimeTriggerBad",
2060 "cluster time vs E of clusters, Trigger Bad ",
2061 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2062 fhTimeTriggerEMCALBCBad->SetXTitle("E (GeV)");
2063 fhTimeTriggerEMCALBCBad->SetYTitle("time (ns)");
2064 outputContainer->Add(fhTimeTriggerEMCALBCBad);
2065
2066 fhEtaPhiTriggerEMCALBCUMBad = new TH2F
2067 ("hEtaPhiTriggerBad_UnMatch",
2068 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad",
2069 netabins,etamin,etamax,nphibins,phimin,phimax);
2070 fhEtaPhiTriggerEMCALBCUMBad->SetYTitle("#phi (rad)");
2071 fhEtaPhiTriggerEMCALBCUMBad->SetXTitle("#eta");
2072 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBad) ;
2073
2074 fhTimeTriggerEMCALBCUMBad = new TH2F
2075 ("hTimeTriggerBad_UnMatch",
2076 "cluster time vs E of clusters, unmatched trigger Bad",
2077 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2078 fhTimeTriggerEMCALBCUMBad->SetXTitle("E (GeV)");
2079 fhTimeTriggerEMCALBCUMBad->SetYTitle("time (ns)");
2080 outputContainer->Add(fhTimeTriggerEMCALBCUMBad);
2081
2082 fhEtaPhiTriggerEMCALBCBadCluster = new TH2F
2083 ("hEtaPhiTriggerBad_OnlyTrigger",
2084 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Bad",
2085 netabins,etamin,etamax,nphibins,phimin,phimax);
2086 fhEtaPhiTriggerEMCALBCBadCluster->SetYTitle("#phi (rad)");
2087 fhEtaPhiTriggerEMCALBCBadCluster->SetXTitle("#eta");
2088 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadCluster) ;
2089
2090 fhTimeTriggerEMCALBCBadCluster = new TH2F
2091 ("hTimeTriggerBad_OnlyTrigger",
2092 "trigger cluster time vs E of clusters, Trigger Bad",
2093 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2094 fhTimeTriggerEMCALBCBadCluster->SetXTitle("E (GeV)");
2095 fhTimeTriggerEMCALBCBadCluster->SetYTitle("time (ns)");
2096 outputContainer->Add(fhTimeTriggerEMCALBCBadCluster);
2097
2098 fhEtaPhiTriggerEMCALBCUMBadCluster = new TH2F
2099 ("hEtaPhiTriggerBad_OnlyTrigger_UnMatch",
2100 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad",
2101 netabins,etamin,etamax,nphibins,phimin,phimax);
2102 fhEtaPhiTriggerEMCALBCUMBadCluster->SetYTitle("#phi (rad)");
2103 fhEtaPhiTriggerEMCALBCUMBadCluster->SetXTitle("#eta");
2104 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadCluster) ;
2105
2106 fhTimeTriggerEMCALBCUMBadCluster = new TH2F
2107 ("hTimeTriggerBad_OnlyTrigger_UnMatch",
2108 "trigger cluster time vs E of clusters, unmatched trigger Bad",
2109 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2110 fhTimeTriggerEMCALBCUMBadCluster->SetXTitle("E (GeV)");
2111 fhTimeTriggerEMCALBCUMBadCluster->SetYTitle("time (ns)");
2112 outputContainer->Add(fhTimeTriggerEMCALBCUMBadCluster);
2113
2114 fhEtaPhiTriggerEMCALBCBadExotic = new TH2F
2115 ("hEtaPhiTriggerBadExotic",
2116 "cluster E > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
2117 netabins,etamin,etamax,nphibins,phimin,phimax);
2118 fhEtaPhiTriggerEMCALBCBadExotic->SetYTitle("#phi (rad)");
2119 fhEtaPhiTriggerEMCALBCBadExotic->SetXTitle("#eta");
2120 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExotic) ;
2121
2122 fhTimeTriggerEMCALBCBadExotic = new TH2F
2123 ("hTimeTriggerBadExotic",
2124 "cluster time vs E of clusters, Trigger Bad&Exotic ",
2125 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2126 fhTimeTriggerEMCALBCBadExotic->SetXTitle("E (GeV)");
2127 fhTimeTriggerEMCALBCBadExotic->SetYTitle("time (ns)");
2128 outputContainer->Add(fhTimeTriggerEMCALBCBadExotic);
2129
2130 fhEtaPhiTriggerEMCALBCUMBadExotic = new TH2F
2131 ("hEtaPhiTriggerBadExotic_UnMatch",
2132 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
2133 netabins,etamin,etamax,nphibins,phimin,phimax);
2134 fhEtaPhiTriggerEMCALBCUMBadExotic->SetYTitle("#phi (rad)");
2135 fhEtaPhiTriggerEMCALBCUMBadExotic->SetXTitle("#eta");
2136 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExotic) ;
2137
2138 fhTimeTriggerEMCALBCUMBadExotic = new TH2F
2139 ("hTimeTriggerBadExotic_UnMatch",
2140 "cluster time vs E of clusters, unmatched trigger Bad&Exotic",
2141 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2142 fhTimeTriggerEMCALBCUMBadExotic->SetXTitle("E (GeV)");
2143 fhTimeTriggerEMCALBCUMBadExotic->SetYTitle("time (ns)");
2144 outputContainer->Add(fhTimeTriggerEMCALBCUMBadExotic);
2145
2146 fhEtaPhiTriggerEMCALBCBadExoticCluster = new TH2F
2147 ("hEtaPhiTriggerBadExotic_OnlyTrigger",
2148 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
2149 netabins,etamin,etamax,nphibins,phimin,phimax);
2150 fhEtaPhiTriggerEMCALBCBadExoticCluster->SetYTitle("#phi (rad)");
2151 fhEtaPhiTriggerEMCALBCBadExoticCluster->SetXTitle("#eta");
2152 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExoticCluster) ;
2153
2154 fhTimeTriggerEMCALBCBadExoticCluster = new TH2F
2155 ("hTimeTriggerBadExotic_OnlyTrigger",
2156 "trigger cluster time vs E of clusters, Trigger Bad&Exotic",
2157 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2158 fhTimeTriggerEMCALBCBadExoticCluster->SetXTitle("E (GeV)");
2159 fhTimeTriggerEMCALBCBadExoticCluster->SetYTitle("time (ns)");
2160 outputContainer->Add(fhTimeTriggerEMCALBCBadExoticCluster);
2161
2162 fhEtaPhiTriggerEMCALBCUMBadExoticCluster = new TH2F
2163 ("hEtaPhiTriggerBadExotic_OnlyTrigger_UnMatch",
2164 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
2165 netabins,etamin,etamax,nphibins,phimin,phimax);
2166 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetYTitle("#phi (rad)");
2167 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetXTitle("#eta");
2168 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExoticCluster) ;
2169
2170 fhTimeTriggerEMCALBCUMBadExoticCluster = new TH2F
2171 ("hTimeTriggerBadExotic_OnlyTrigger_UnMatch",
2172 "trigger cluster time vs E of clusters, unmatched trigger Bad&Exotic",
2173 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2174 fhTimeTriggerEMCALBCUMBadExoticCluster->SetXTitle("E (GeV)");
2175 fhTimeTriggerEMCALBCUMBadExoticCluster->SetYTitle("time (ns)");
2176 outputContainer->Add(fhTimeTriggerEMCALBCUMBadExoticCluster);
2177
2178 fhTimeTriggerEMCALBCBadMaxCell = new TH2F
2179 ("hTimeTriggerBadMaxCell",
2180 "cluster time vs E of clusters, Trigger BadMaxCell",
2181 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2182 fhTimeTriggerEMCALBCBadMaxCell->SetXTitle("E (GeV)");
2183 fhTimeTriggerEMCALBCBadMaxCell->SetYTitle("time (ns)");
2184 outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCell);
2185
2186 fhTimeTriggerEMCALBCUMBadMaxCell = new TH2F
2187 ("hTimeTriggerBadMaxCell_UnMatch",
2188 "cluster time vs E of clusters, unmatched trigger BadMaxCell",
2189 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2190 fhTimeTriggerEMCALBCUMBadMaxCell->SetXTitle("E (GeV)");
2191 fhTimeTriggerEMCALBCUMBadMaxCell->SetYTitle("time (ns)");
2192 outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCell);
2193
2194
2195 fhTimeTriggerEMCALBCBadMaxCellExotic = new TH2F
2196 ("hTimeTriggerBadMaxCellExotic",
2197 "cluster time vs E of clusters, Trigger BadMaxCell&Exotic",
2198 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2199 fhTimeTriggerEMCALBCBadMaxCellExotic->SetXTitle("E (GeV)");
2200 fhTimeTriggerEMCALBCBadMaxCellExotic->SetYTitle("time (ns)");
2201 outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCellExotic);
2202
2203 fhTimeTriggerEMCALBCUMBadMaxCellExotic = new TH2F
2204 ("hTimeTriggerBadMaxCellExotic_UnMatch",
2205 "cluster time vs E of clusters, unmatched trigger BadMaxCell&Exotic",
2206 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2207 fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetXTitle("E (GeV)");
2208 fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetYTitle("time (ns)");
2209 outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCellExotic);
2210
2211 fhTimeNoTrigger = new TH2F
2212 ("hTimeNoTrigger",
2213 "events with no foundable trigger, time vs e of clusters",
2214 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2215 fhTimeNoTrigger->SetXTitle("E (GeV)");
2216 fhTimeNoTrigger->SetYTitle("time (ns)");
2217 outputContainer->Add(fhTimeNoTrigger);
2218
2219 fhEtaPhiNoTrigger = new TH2F
2220 ("hEtaPhiNoTrigger",
2221 "events with no foundable trigger, eta vs phi of clusters",
2222 netabins,etamin,etamax,nphibins,phimin,phimax);
2223 fhEtaPhiNoTrigger->SetYTitle("#phi (rad)");
2224 fhEtaPhiNoTrigger->SetXTitle("#eta");
2225 outputContainer->Add(fhEtaPhiNoTrigger) ;
2226 }
85c4406e 2227
126b8c62 2228 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_OpenTime",
85c4406e 2229 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time",
2230 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2231 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("#phi (rad)");
2232 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("#eta");
2233 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster) ;
85c4406e 2234
126b8c62 2235 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_OpenTime",
85c4406e 2236 "cluster time vs E of clusters, no match, rematch open time",
2237 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2238 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("E (GeV)");
2239 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("time (ns)");
2240 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster);
85c4406e 2241
2242
126b8c62 2243 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
85c4406e 2244 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch with neighbour patches",
2245 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2246 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("#phi (rad)");
2247 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("#eta");
2248 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster) ;
85c4406e 2249
126b8c62 2250 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
85c4406e 2251 "cluster time vs E of clusters, no match, rematch with neigbour parches",
2252 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2253 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("E (GeV)");
2254 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("time (ns)");
2255 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster);
85c4406e 2256
126b8c62 2257 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_Both",
85c4406e 2258 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time and neighbour",
2259 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2260 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetYTitle("#phi (rad)");
2261 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetXTitle("#eta");
2262 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchBothCluster) ;
85c4406e 2263
126b8c62 2264 fhTimeTriggerEMCALBCUMReMatchBothCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_Both",
85c4406e 2265 "cluster time vs E of clusters, no match, rematch open time and neigbour",
2266 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2267 fhTimeTriggerEMCALBCUMReMatchBothCluster->SetXTitle("E (GeV)");
2268 fhTimeTriggerEMCALBCUMReMatchBothCluster->SetYTitle("time (ns)");
2269 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchBothCluster);
2270
2271 fhTimeTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_OpenTime",
2272 "cluster time vs E of clusters, no match, rematch open time",
2273 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2274 fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("E (GeV)");
2275 fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("time (ns)");
2276 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchOpenTime);
2277
2278
2279 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
2280 "cluster time vs E of clusters, no match, rematch with neigbour parches",
2281 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2282 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("E (GeV)");
2283 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("time (ns)");
2284 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchCheckNeigh);
2285
2286 fhTimeTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_Both",
2287 "cluster time vs E of clusters, no match, rematch open time and neigbour",
2288 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2289 fhTimeTriggerEMCALBC0UMReMatchBoth->SetXTitle("E (GeV)");
2290 fhTimeTriggerEMCALBC0UMReMatchBoth->SetYTitle("time (ns)");
2291 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchBoth);
85c4406e 2292
c2a62a94 2293 }
2294
477d6cee 2295 fhPhiPhoton = new TH2F
85c4406e 2296 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
6175da48 2297 fhPhiPhoton->SetYTitle("#phi (rad)");
477d6cee 2298 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
85c4406e 2299 outputContainer->Add(fhPhiPhoton) ;
477d6cee 2300
2301 fhEtaPhoton = new TH2F
85c4406e 2302 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
477d6cee 2303 fhEtaPhoton->SetYTitle("#eta");
2304 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
2305 outputContainer->Add(fhEtaPhoton) ;
2306
6175da48 2307 fhEtaPhiPhoton = new TH2F
85c4406e 2308 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
6175da48 2309 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
2310 fhEtaPhiPhoton->SetXTitle("#eta");
2311 outputContainer->Add(fhEtaPhiPhoton) ;
34c16486 2312 if(GetMinPt() < 0.5)
2313 {
20218aea 2314 fhEtaPhi05Photon = new TH2F
74e3eb22 2315 ("hEtaPhi05Photon","#eta vs #phi, E < 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
20218aea 2316 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
2317 fhEtaPhi05Photon->SetXTitle("#eta");
2318 outputContainer->Add(fhEtaPhi05Photon) ;
2319 }
85c4406e 2320
c2a62a94 2321 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
2322 {
2323 fhEtaPhiPhotonEMCALBC0 = new TH2F
ba490f85 2324 ("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 2325 fhEtaPhiPhotonEMCALBC0->SetYTitle("#phi (rad)");
2326 fhEtaPhiPhotonEMCALBC0->SetXTitle("#eta");
2327 outputContainer->Add(fhEtaPhiPhotonEMCALBC0) ;
2328
2329 fhEtaPhiPhotonEMCALBC1 = new TH2F
ba490f85 2330 ("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 2331 fhEtaPhiPhotonEMCALBC1->SetYTitle("#phi (rad)");
2332 fhEtaPhiPhotonEMCALBC1->SetXTitle("#eta");
2333 outputContainer->Add(fhEtaPhiPhotonEMCALBC1) ;
2334
2335 fhEtaPhiPhotonEMCALBCN = new TH2F
ba490f85 2336 ("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 2337 fhEtaPhiPhotonEMCALBCN->SetYTitle("#phi (rad)");
2338 fhEtaPhiPhotonEMCALBCN->SetXTitle("#eta");
2339 outputContainer->Add(fhEtaPhiPhotonEMCALBCN) ;
2340
eb86112d 2341 for(Int_t i = 0; i < nTrigBC; i++)
c2a62a94 2342 {
2343 fhEtaPhiPhotonTriggerEMCALBC[i] = new TH2F
eb86112d 2344 (Form("hEtaPhiPhotonTriggerEMCALBC%d",i-iBCShift),
2345 Form("photon E > 2 GeV, #eta vs #phi, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 2346 netabins,etamin,etamax,nphibins,phimin,phimax);
2347 fhEtaPhiPhotonTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
2348 fhEtaPhiPhotonTriggerEMCALBC[i]->SetXTitle("#eta");
2349 outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBC[i]) ;
2350
2351 fhTimePhotonTriggerEMCALBC[i] = new TH2F
eb86112d 2352 (Form("hTimePhotonTriggerEMCALBC%d",i-iBCShift),
2353 Form("photon time vs E of clusters, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 2354 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2355 fhTimePhotonTriggerEMCALBC[i]->SetXTitle("E (GeV)");
2356 fhTimePhotonTriggerEMCALBC[i]->SetYTitle("time (ns)");
2357 outputContainer->Add(fhTimePhotonTriggerEMCALBC[i]);
2358
2359 fhTimePhotonTriggerEMCALBCPileUpSPD[i] = new TH2F
eb86112d 2360 (Form("hTimePhotonTriggerEMCALBC%dPileUpSPD",i-iBCShift),
2361 Form("photon time vs E, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 2362 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2363 fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
2364 fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
2365 outputContainer->Add(fhTimePhotonTriggerEMCALBCPileUpSPD[i]);
2366
afb3af8a 2367 fhEtaPhiPhotonTriggerEMCALBCUM[i] = new TH2F
eb86112d 2368 (Form("hEtaPhiPhotonTriggerEMCALBC%d_UnMatch",i-iBCShift),
2369 Form("photon E > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 2370 netabins,etamin,etamax,nphibins,phimin,phimax);
2371 fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
2372 fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetXTitle("#eta");
2373 outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBCUM[i]) ;
2374
2375 fhTimePhotonTriggerEMCALBCUM[i] = new TH2F
eb86112d 2376 (Form("hTimePhotonTriggerEMCALBC%d_UnMatch",i-iBCShift),
2377 Form("photon time vs E, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 2378 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2379 fhTimePhotonTriggerEMCALBCUM[i]->SetXTitle("E (GeV)");
2380 fhTimePhotonTriggerEMCALBCUM[i]->SetYTitle("time (ns)");
2381 outputContainer->Add(fhTimePhotonTriggerEMCALBCUM[i]);
2382
c2a62a94 2383 }
126b8c62 2384
2385 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_OpenTime",
2386 "cluster time vs E of photons, no match, rematch open time",
2387 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2388 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("E (GeV)");
2389 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("time (ns)");
2390 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime);
2391
2392
2393 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
2394 "cluster time vs E of photons, no match, rematch with neigbour parches",
2395 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2396 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("E (GeV)");
2397 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("time (ns)");
2398 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh);
2399
2400 fhTimePhotonTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_Both",
2401 "cluster time vs E of photons, no match, rematch open time and neigbour",
2402 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2403 fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetXTitle("E (GeV)");
2404 fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetYTitle("time (ns)");
2405 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchBoth);
2406
c2a62a94 2407 }
6175da48 2408
9e51e29a 2409 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
85c4406e 2410 nptbins,ptmin,ptmax,10,0,10);
9e51e29a 2411 fhNLocMax ->SetYTitle("N maxima");
2412 fhNLocMax ->SetXTitle("E (GeV)");
85c4406e 2413 outputContainer->Add(fhNLocMax) ;
9e51e29a 2414
521636d2 2415 //Shower shape
34c16486 2416 if(fFillSSHistograms)
2417 {
85c4406e 2418 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2419 fhLam0E->SetYTitle("#lambda_{0}^{2}");
2420 fhLam0E->SetXTitle("E (GeV)");
85c4406e 2421 outputContainer->Add(fhLam0E);
521636d2 2422
85c4406e 2423 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2424 fhLam1E->SetYTitle("#lambda_{1}^{2}");
2425 fhLam1E->SetXTitle("E (GeV)");
85c4406e 2426 outputContainer->Add(fhLam1E);
521636d2 2427
85c4406e 2428 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2429 fhDispE->SetYTitle("D^{2}");
2430 fhDispE->SetXTitle("E (GeV) ");
2431 outputContainer->Add(fhDispE);
85c4406e 2432
b5dbb99b 2433 if(!fRejectTrackMatch)
2434 {
85c4406e 2435 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 2436 fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
2437 fhLam0ETM->SetXTitle("E (GeV)");
85c4406e 2438 outputContainer->Add(fhLam0ETM);
b5dbb99b 2439
85c4406e 2440 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 2441 fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
2442 fhLam1ETM->SetXTitle("E (GeV)");
85c4406e 2443 outputContainer->Add(fhLam1ETM);
b5dbb99b 2444
85c4406e 2445 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 2446 fhDispETM->SetYTitle("D^{2}");
2447 fhDispETM->SetXTitle("E (GeV) ");
2448 outputContainer->Add(fhDispETM);
2449 }
521636d2 2450
b5dbb99b 2451 if(fCalorimeter == "EMCAL")
2452 {
85c4406e 2453 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2454 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
2455 fhLam0ETRD->SetXTitle("E (GeV)");
85c4406e 2456 outputContainer->Add(fhLam0ETRD);
521636d2 2457
85c4406e 2458 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2459 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
2460 fhLam1ETRD->SetXTitle("E (GeV)");
85c4406e 2461 outputContainer->Add(fhLam1ETRD);
521636d2 2462
85c4406e 2463 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2464 fhDispETRD->SetYTitle("Dispersion^{2}");
2465 fhDispETRD->SetXTitle("E (GeV) ");
b5dbb99b 2466 outputContainer->Add(fhDispETRD);
2467
2468 if(!fRejectTrackMatch)
2469 {
85c4406e 2470 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 2471 fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
2472 fhLam0ETMTRD->SetXTitle("E (GeV)");
85c4406e 2473 outputContainer->Add(fhLam0ETMTRD);
b5dbb99b 2474
85c4406e 2475 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 2476 fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
2477 fhLam1ETMTRD->SetXTitle("E (GeV)");
85c4406e 2478 outputContainer->Add(fhLam1ETMTRD);
b5dbb99b 2479
85c4406e 2480 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 2481 fhDispETMTRD->SetYTitle("Dispersion^{2}");
2482 fhDispETMTRD->SetXTitle("E (GeV) ");
85c4406e 2483 outputContainer->Add(fhDispETMTRD);
2484 }
2485 }
521636d2 2486
764ab1f4 2487 if(!fFillOnlySimpleSSHisto)
34c16486 2488 {
85c4406e 2489 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2490 fhNCellsLam0LowE->SetXTitle("N_{cells}");
2491 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2492 outputContainer->Add(fhNCellsLam0LowE);
764ab1f4 2493
85c4406e 2494 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2495 fhNCellsLam0HighE->SetXTitle("N_{cells}");
2496 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2497 outputContainer->Add(fhNCellsLam0HighE);
764ab1f4 2498
85c4406e 2499 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2500 fhNCellsLam1LowE->SetXTitle("N_{cells}");
2501 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2502 outputContainer->Add(fhNCellsLam1LowE);
764ab1f4 2503
85c4406e 2504 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2505 fhNCellsLam1HighE->SetXTitle("N_{cells}");
2506 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2507 outputContainer->Add(fhNCellsLam1HighE);
764ab1f4 2508
85c4406e 2509 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2510 fhNCellsDispLowE->SetXTitle("N_{cells}");
2511 fhNCellsDispLowE->SetYTitle("D^{2}");
85c4406e 2512 outputContainer->Add(fhNCellsDispLowE);
764ab1f4 2513
85c4406e 2514 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2515 fhNCellsDispHighE->SetXTitle("N_{cells}");
2516 fhNCellsDispHighE->SetYTitle("D^{2}");
85c4406e 2517 outputContainer->Add(fhNCellsDispHighE);
764ab1f4 2518
85c4406e 2519 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
764ab1f4 2520 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
2521 fhEtaLam0LowE->SetXTitle("#eta");
85c4406e 2522 outputContainer->Add(fhEtaLam0LowE);
764ab1f4 2523
85c4406e 2524 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
764ab1f4 2525 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
2526 fhPhiLam0LowE->SetXTitle("#phi");
85c4406e 2527 outputContainer->Add(fhPhiLam0LowE);
764ab1f4 2528
85c4406e 2529 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
764ab1f4 2530 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
2531 fhEtaLam0HighE->SetXTitle("#eta");
85c4406e 2532 outputContainer->Add(fhEtaLam0HighE);
764ab1f4 2533
85c4406e 2534 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
764ab1f4 2535 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
2536 fhPhiLam0HighE->SetXTitle("#phi");
85c4406e 2537 outputContainer->Add(fhPhiLam0HighE);
764ab1f4 2538
85c4406e 2539 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2540 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
2541 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
85c4406e 2542 outputContainer->Add(fhLam1Lam0LowE);
764ab1f4 2543
85c4406e 2544 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2545 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
2546 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
85c4406e 2547 outputContainer->Add(fhLam1Lam0HighE);
764ab1f4 2548
85c4406e 2549 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2550 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
2551 fhLam0DispLowE->SetYTitle("D^{2}");
85c4406e 2552 outputContainer->Add(fhLam0DispLowE);
764ab1f4 2553
85c4406e 2554 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2555 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
2556 fhLam0DispHighE->SetYTitle("D^{2}");
85c4406e 2557 outputContainer->Add(fhLam0DispHighE);
764ab1f4 2558
85c4406e 2559 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2560 fhDispLam1LowE->SetXTitle("D^{2}");
2561 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
85c4406e 2562 outputContainer->Add(fhDispLam1LowE);
764ab1f4 2563
85c4406e 2564 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2565 fhDispLam1HighE->SetXTitle("D^{2}");
2566 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
85c4406e 2567 outputContainer->Add(fhDispLam1HighE);
764ab1f4 2568
2569 if(fCalorimeter == "EMCAL")
34c16486 2570 {
85c4406e 2571 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 2572 fhDispEtaE->SetXTitle("E (GeV)");
2573 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
85c4406e 2574 outputContainer->Add(fhDispEtaE);
764ab1f4 2575
85c4406e 2576 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 2577 fhDispPhiE->SetXTitle("E (GeV)");
2578 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2579 outputContainer->Add(fhDispPhiE);
764ab1f4 2580
85c4406e 2581 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 2582 fhSumEtaE->SetXTitle("E (GeV)");
2583 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
85c4406e 2584 outputContainer->Add(fhSumEtaE);
764ab1f4 2585
85c4406e 2586 fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
2587 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
764ab1f4 2588 fhSumPhiE->SetXTitle("E (GeV)");
2589 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
85c4406e 2590 outputContainer->Add(fhSumPhiE);
764ab1f4 2591
85c4406e 2592 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
2593 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
764ab1f4 2594 fhSumEtaPhiE->SetXTitle("E (GeV)");
2595 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
2596 outputContainer->Add(fhSumEtaPhiE);
2597
85c4406e 2598 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
2599 nptbins,ptmin,ptmax,200, -10,10);
764ab1f4 2600 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
2601 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
85c4406e 2602 outputContainer->Add(fhDispEtaPhiDiffE);
bfdcf7fb 2603
85c4406e 2604 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
2605 nptbins,ptmin,ptmax, 200, -1,1);
764ab1f4 2606 fhSphericityE->SetXTitle("E (GeV)");
2607 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
2608 outputContainer->Add(fhSphericityE);
bfdcf7fb 2609
85c4406e 2610 fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
764ab1f4 2611 fhDispSumEtaDiffE->SetXTitle("E (GeV)");
2612 fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
85c4406e 2613 outputContainer->Add(fhDispSumEtaDiffE);
764ab1f4 2614
85c4406e 2615 fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
764ab1f4 2616 fhDispSumPhiDiffE->SetXTitle("E (GeV)");
2617 fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
85c4406e 2618 outputContainer->Add(fhDispSumPhiDiffE);
764ab1f4 2619
2620 for(Int_t i = 0; i < 7; i++)
2621 {
85c4406e 2622 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]),
2623 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2624 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
2625 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2626 outputContainer->Add(fhDispEtaDispPhi[i]);
764ab1f4 2627
85c4406e 2628 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]),
2629 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2630 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
2631 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
85c4406e 2632 outputContainer->Add(fhLambda0DispEta[i]);
764ab1f4 2633
85c4406e 2634 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]),
2635 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2636 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
2637 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2638 outputContainer->Add(fhLambda0DispPhi[i]);
764ab1f4 2639 }
34c16486 2640 }
2641 }
521636d2 2642 } // Shower shape
2643
09273901 2644 // Track Matching
2645
b5dbb99b 2646 if(fFillTMHisto)
2647 {
b2e375c7 2648 TString cutTM [] = {"NoCut",""};
b5dbb99b 2649
b2e375c7 2650 for(Int_t i = 0; i < 2; i++)
31ae6d59 2651 {
b2e375c7 2652 fhTrackMatchedDEta[i] = new TH2F
2653 (Form("hTrackMatchedDEta%s",cutTM[i].Data()),
2654 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2655 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2656 fhTrackMatchedDEta[i]->SetYTitle("d#eta");
2657 fhTrackMatchedDEta[i]->SetXTitle("E_{cluster} (GeV)");
4bfeae64 2658
b2e375c7 2659 fhTrackMatchedDPhi[i] = new TH2F
2660 (Form("hTrackMatchedDPhi%s",cutTM[i].Data()),
2661 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2662 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2663 fhTrackMatchedDPhi[i]->SetYTitle("d#phi (rad)");
2664 fhTrackMatchedDPhi[i]->SetXTitle("E_{cluster} (GeV)");
2665
2666 fhTrackMatchedDEtaDPhi[i] = new TH2F
2667 (Form("hTrackMatchedDEtaDPhi%s",cutTM[i].Data()),
2668 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2669 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2670 fhTrackMatchedDEtaDPhi[i]->SetYTitle("d#phi (rad)");
2671 fhTrackMatchedDEtaDPhi[i]->SetXTitle("d#eta");
2672
2673 fhTrackMatchedDEtaPos[i] = new TH2F
2674 (Form("hTrackMatchedDEtaPos%s",cutTM[i].Data()),
2675 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2676 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2677 fhTrackMatchedDEtaPos[i]->SetYTitle("d#eta");
2678 fhTrackMatchedDEtaPos[i]->SetXTitle("E_{cluster} (GeV)");
8d6b7f60 2679
b2e375c7 2680 fhTrackMatchedDPhiPos[i] = new TH2F
2681 (Form("hTrackMatchedDPhiPos%s",cutTM[i].Data()),
2682 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2683 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2684 fhTrackMatchedDPhiPos[i]->SetYTitle("d#phi (rad)");
2685 fhTrackMatchedDPhiPos[i]->SetXTitle("E_{cluster} (GeV)");
2686
2687 fhTrackMatchedDEtaDPhiPos[i] = new TH2F
2688 (Form("hTrackMatchedDEtaDPhiPos%s",cutTM[i].Data()),
2689 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2690 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2691 fhTrackMatchedDEtaDPhiPos[i]->SetYTitle("d#phi (rad)");
2692 fhTrackMatchedDEtaDPhiPos[i]->SetXTitle("d#eta");
2693
2694 fhTrackMatchedDEtaNeg[i] = new TH2F
2695 (Form("hTrackMatchedDEtaNeg%s",cutTM[i].Data()),
2696 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2697 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2698 fhTrackMatchedDEtaNeg[i]->SetYTitle("d#eta");
2699 fhTrackMatchedDEtaNeg[i]->SetXTitle("E_{cluster} (GeV)");
4bfeae64 2700
b2e375c7 2701 fhTrackMatchedDPhiNeg[i] = new TH2F
2702 (Form("hTrackMatchedDPhiNeg%s",cutTM[i].Data()),
2703 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2704 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2705 fhTrackMatchedDPhiNeg[i]->SetYTitle("d#phi (rad)");
2706 fhTrackMatchedDPhiNeg[i]->SetXTitle("E_{cluster} (GeV)");
2707
2708 fhTrackMatchedDEtaDPhiNeg[i] = new TH2F
2709 (Form("hTrackMatchedDEtaDPhiNeg%s",cutTM[i].Data()),
2710 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2711 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2712 fhTrackMatchedDEtaDPhiNeg[i]->SetYTitle("d#phi (rad)");
2713 fhTrackMatchedDEtaDPhiNeg[i]->SetXTitle("d#eta");
2714
2715 fhdEdx[i] = new TH2F (Form("hdEdx%s",cutTM[i].Data()),Form("matched track <dE/dx> vs cluster E, %s",cutTM[i].Data()),
2716 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
2717 fhdEdx[i]->SetXTitle("E (GeV)");
2718 fhdEdx[i]->SetYTitle("<dE/dx>");
2719
2720 fhEOverP[i] = new TH2F (Form("hEOverP%s",cutTM[i].Data()),Form("matched track E/p vs cluster E, %s",cutTM[i].Data()),
2721 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2722 fhEOverP[i]->SetXTitle("E (GeV)");
2723 fhEOverP[i]->SetYTitle("E/p");
2724
2725 outputContainer->Add(fhTrackMatchedDEta[i]) ;
2726 outputContainer->Add(fhTrackMatchedDPhi[i]) ;
2727 outputContainer->Add(fhTrackMatchedDEtaDPhi[i]) ;
2728 outputContainer->Add(fhTrackMatchedDEtaPos[i]) ;
2729 outputContainer->Add(fhTrackMatchedDPhiPos[i]) ;
2730 outputContainer->Add(fhTrackMatchedDEtaDPhiPos[i]) ;
2731 outputContainer->Add(fhTrackMatchedDEtaNeg[i]) ;
2732 outputContainer->Add(fhTrackMatchedDPhiNeg[i]) ;
2733 outputContainer->Add(fhTrackMatchedDEtaDPhiNeg[i]) ;
2734 outputContainer->Add(fhdEdx[i]);
2735 outputContainer->Add(fhEOverP[i]);
2736
2737 if(fCalorimeter=="EMCAL")
2738 {
2739 fhTrackMatchedDEtaTRD[i] = new TH2F
2740 (Form("hTrackMatchedDEtaTRD%s",cutTM[i].Data()),
2741 Form("d#eta of cluster-track vs cluster energy, SM behind TRD, %s",cutTM[i].Data()),
2742 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2743 fhTrackMatchedDEtaTRD[i]->SetYTitle("d#eta");
2744 fhTrackMatchedDEtaTRD[i]->SetXTitle("E_{cluster} (GeV)");
2745
2746 fhTrackMatchedDPhiTRD[i] = new TH2F
2747 (Form("hTrackMatchedDPhiTRD%s",cutTM[i].Data()),
2748 Form("d#phi of cluster-track vs cluster energy, SM behing TRD, %s",cutTM[i].Data()),
2749 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2750 fhTrackMatchedDPhiTRD[i]->SetYTitle("d#phi (rad)");
2751 fhTrackMatchedDPhiTRD[i]->SetXTitle("E_{cluster} (GeV)");
2752
2753 fhEOverPTRD[i] = new TH2F
2754 (Form("hEOverPTRD%s",cutTM[i].Data()),
2755 Form("matched track E/p vs cluster E, behind TRD, %s",cutTM[i].Data()),
2756 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2757 fhEOverPTRD[i]->SetXTitle("E (GeV)");
2758 fhEOverPTRD[i]->SetYTitle("E/p");
2759
2760 outputContainer->Add(fhTrackMatchedDEtaTRD[i]) ;
2761 outputContainer->Add(fhTrackMatchedDPhiTRD[i]) ;
2762 outputContainer->Add(fhEOverPTRD[i]);
2763 }
8d6b7f60 2764
b2e375c7 2765 if(IsDataMC())
2766 {
2767