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