update passing of settings
[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),
6df33fcb 155fhPtPhotonNPileUpSPDVtxTimeCut2(0), fhPtPhotonNPileUpTrkVtxTimeCut2(0),
156fhEClusterSM(0), fhEPhotonSM(0),
157fhPtClusterSM(0), fhPtPhotonSM(0)
85c4406e 158{
1c5acb87 159 //default ctor
160
4bfeae64 161 for(Int_t i = 0; i < 14; i++)
162 {
4c8f7c2e 163 fhMCPt [i] = 0;
164 fhMCE [i] = 0;
165 fhMCPhi [i] = 0;
166 fhMCEta [i] = 0;
85c4406e 167 fhMCDeltaE [i] = 0;
4c8f7c2e 168 fhMCDeltaPt[i] = 0;
85c4406e 169 fhMC2E [i] = 0;
4c8f7c2e 170 fhMC2Pt [i] = 0;
521636d2 171 }
172
4bfeae64 173 for(Int_t i = 0; i < 7; i++)
174 {
3d5d5078 175 fhPtPrimMC [i] = 0;
176 fhEPrimMC [i] = 0;
177 fhPhiPrimMC[i] = 0;
4cf13296 178 fhEtaPrimMC[i] = 0;
3d5d5078 179 fhYPrimMC [i] = 0;
180
181 fhPtPrimMCAcc [i] = 0;
182 fhEPrimMCAcc [i] = 0;
183 fhPhiPrimMCAcc[i] = 0;
4cf13296 184 fhEtaPrimMCAcc[i] = 0;
3d5d5078 185 fhYPrimMCAcc [i] = 0;
d2655d46 186
187 fhDispEtaDispPhi[i] = 0;
188 fhLambda0DispPhi[i] = 0;
189 fhLambda0DispEta[i] = 0;
5e5e056f 190
fad96885 191 fhPtPileUp [i] = 0;
192 fhPtChargedPileUp[i] = 0;
193 fhPtPhotonPileUp [i] = 0;
85c4406e 194
fad96885 195 fhLambda0PileUp [i] = 0;
196 fhLambda0ChargedPileUp[i] = 0;
5e5e056f 197
650d1938 198 fhClusterEFracLongTimePileUp [i] = 0;
199
126b8c62 200 fhClusterCellTimePileUp [i] = 0;
fad96885 201 fhClusterTimeDiffPileUp [i] = 0;
202 fhClusterTimeDiffChargedPileUp[i] = 0;
203 fhClusterTimeDiffPhotonPileUp [i] = 0;
85c4406e 204
d2655d46 205 for(Int_t j = 0; j < 6; j++)
206 {
207 fhMCDispEtaDispPhi[i][j] = 0;
208 fhMCLambda0DispEta[i][j] = 0;
209 fhMCLambda0DispPhi[i][j] = 0;
210 }
85c4406e 211 }
3d5d5078 212
4bfeae64 213 for(Int_t i = 0; i < 6; i++)
214 {
f66d95af 215 fhMCELambda0 [i] = 0;
216 fhMCELambda1 [i] = 0;
217 fhMCEDispersion [i] = 0;
85c4406e 218 fhMCNCellsE [i] = 0;
219 fhMCMaxCellDiffClusterE[i] = 0;
bfdcf7fb 220 fhLambda0DispEta[i] = 0;
221 fhLambda0DispPhi[i] = 0;
85c4406e 222
f66d95af 223 fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
224 fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
225 fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
226 fhMCNCellsvsClusterMaxCellDiffE0 [i] = 0;
227 fhMCNCellsvsClusterMaxCellDiffE2 [i] = 0;
228 fhMCNCellsvsClusterMaxCellDiffE6 [i] = 0;
34c16486 229
230 fhMCEDispEta [i] = 0;
231 fhMCEDispPhi [i] = 0;
232 fhMCESumEtaPhi [i] = 0;
233 fhMCEDispEtaPhiDiff[i] = 0;
234 fhMCESphericity [i] = 0;
521636d2 235 }
236
85c4406e 237 for(Int_t i = 0; i < 5; i++)
238 {
239 fhClusterCuts[i] = 0;
240 }
241
242 // Track matching residuals
243 for(Int_t i = 0; i < 2; i++)
244 {
126b8c62 245 fhTrackMatchedDEta [i] = 0; fhTrackMatchedDPhi [i] = 0; fhTrackMatchedDEtaDPhi [i] = 0;
246 fhTrackMatchedDEtaNeg[i] = 0; fhTrackMatchedDPhiNeg[i] = 0; fhTrackMatchedDEtaDPhiNeg[i] = 0;
247 fhTrackMatchedDEtaPos[i] = 0; fhTrackMatchedDPhiPos[i] = 0; fhTrackMatchedDEtaDPhiPos[i] = 0;
85c4406e 248 fhTrackMatchedDEtaTRD[i] = 0; fhTrackMatchedDPhiTRD[i] = 0;
249 fhTrackMatchedDEtaMCOverlap[i] = 0; fhTrackMatchedDPhiMCOverlap[i] = 0;
250 fhTrackMatchedDEtaMCNoOverlap[i] = 0; fhTrackMatchedDPhiMCNoOverlap[i] = 0;
251 fhTrackMatchedDEtaMCConversion[i] = 0; fhTrackMatchedDPhiMCConversion[i] = 0;
252 fhTrackMatchedMCParticle[i] = 0; fhTrackMatchedMCParticle[i] = 0;
253 fhdEdx[i] = 0; fhEOverP[i] = 0;
254 fhEOverPTRD[i] = 0;
255 }
256
257 for(Int_t i = 0; i < 4; i++)
258 {
259 fhClusterMultSPDPileUp[i] = 0;
260 fhClusterMultNoPileUp [i] = 0;
261 }
262
263 for(Int_t i = 0; i < 11; i++)
264 {
265 fhEtaPhiTriggerEMCALBC [i] = 0 ;
266 fhTimeTriggerEMCALBC [i] = 0 ;
267 fhEtaPhiTriggerEMCALBCUM [i] = 0 ;
268 fhTimeTriggerEMCALBCUM [i] = 0 ;
269
270 fhEtaPhiPhotonTriggerEMCALBC [i] = 0 ;
271 fhTimePhotonTriggerEMCALBC [i] = 0 ;
272 fhEtaPhiPhotonTriggerEMCALBCUM [i] = 0 ;
273 fhTimePhotonTriggerEMCALBCUM [i] = 0 ;
274
275 fhTimePhotonTriggerEMCALBCPileUpSPD[i] = 0 ;
276 fhTimeTriggerEMCALBCPileUpSPD [i] = 0 ;
277
278 fhEtaPhiTriggerEMCALBCCluster [i] = 0 ;
126b8c62 279 fhEtaPhiTriggerEMCALBCUMCluster [i] = 0 ;
85c4406e 280 }
281
1c5acb87 282 //Initialize parameters
283 InitParameters();
85c4406e 284
1c5acb87 285}
286
b2e375c7 287//_________________________________________________________________________________________
85c4406e 288Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int_t nMaxima)
c4a7d28a 289{
290 //Select clusters if they pass different cuts
fad96885 291
c2a62a94 292 Float_t ptcluster = mom.Pt();
293 Float_t ecluster = mom.E();
294 Float_t l0cluster = calo->GetM02();
295 Float_t etacluster = mom.Eta();
296 Float_t phicluster = mom.Phi();
6df33fcb 297 if(phicluster < 0) phicluster+=TMath::TwoPi();
c2a62a94 298 Float_t tofcluster = calo->GetTOF()*1.e9;
c2a62a94 299
b2e375c7 300 Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
fad96885 301
302 if(GetDebug() > 2)
afb3af8a 303 printf("AliAnaPhoton::ClusterSelected() - Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
c4a7d28a 304 GetReader()->GetEventNumber(),
c2a62a94 305 ecluster,ptcluster, phicluster*TMath::RadToDeg(),etacluster);
fad96885 306
307 fhClusterCuts[1]->Fill(ecluster);
c4a7d28a 308
c2a62a94 309 if(ecluster > 0.5) fhEtaPhi->Fill(etacluster, phicluster);
310
6df33fcb 311 Int_t nSM = GetModuleNumber(calo);
312 if(nSM < GetCaloUtils()->GetNumberOfSuperModulesUsed() && nSM >=0)
313 {
314 fhEClusterSM ->Fill(ecluster ,nSM);
315 fhPtClusterSM->Fill(ptcluster,nSM);
316 }
317
b2e375c7 318 FillEMCALTriggerClusterBCHistograms(calo->GetID(),ecluster,tofcluster,etacluster,phicluster);
c2a62a94 319
c4a7d28a 320 //.......................................
321 //If too small or big energy, skip it
afb3af8a 322 if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ;
09273901 323
c4a7d28a 324 if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
09273901 325
fad96885 326 fhClusterCuts[2]->Fill(ecluster);
85c4406e 327
126b8c62 328 FillClusterPileUpHistograms(calo,matched,ptcluster,etacluster,phicluster,l0cluster);
fad96885 329
c4a7d28a 330 //.......................................
331 // TOF cut, BE CAREFUL WITH THIS CUT
332 Double_t tof = calo->GetTOF()*1e9;
333 if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
09273901 334
c4a7d28a 335 if(GetDebug() > 2) printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
09273901 336
fad96885 337 fhClusterCuts[3]->Fill(ecluster);
85c4406e 338
c4a7d28a 339 //.......................................
340 if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
09273901 341
c4a7d28a 342 if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
09273901 343
fad96885 344 fhClusterCuts[4]->Fill(ecluster);
85c4406e 345
9e51e29a 346 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
347 if(GetDebug() > 2) printf(" \t Cluster %d pass NLM %d of out of range \n",calo->GetID(), nMaxima);
85c4406e 348
fad96885 349 fhClusterCuts[5]->Fill(ecluster);
85c4406e 350
c4a7d28a 351 //.......................................
352 //Check acceptance selection
34c16486 353 if(IsFiducialCutOn())
354 {
c4a7d28a 355 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
356 if(! in ) return kFALSE ;
357 }
09273901 358
6df33fcb 359 if(GetDebug() > 2) printf("\t Fiducial cut passed \n");
09273901 360
fad96885 361 fhClusterCuts[6]->Fill(ecluster);
85c4406e 362
c4a7d28a 363 //.......................................
364 //Skip matched clusters with tracks
09273901 365
4bfeae64 366 // Fill matching residual histograms before PID cuts
367 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,0);
09273901 368
34c16486 369 if(fRejectTrackMatch)
370 {
b2e375c7 371 if(matched)
34c16486 372 {
c4a7d28a 373 if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
374 return kFALSE ;
375 }
85c4406e 376 else
c4a7d28a 377 if(GetDebug() > 2) printf(" Track-matching cut passed \n");
378 }// reject matched clusters
09273901 379
fad96885 380 fhClusterCuts[7]->Fill(ecluster);
85c4406e 381
fad96885 382 if(fFillPileUpHistograms)
383 {
384 if(GetReader()->IsPileUpFromSPD()) {fhPtChargedPileUp[0]->Fill(ptcluster); fhLambda0ChargedPileUp[0]->Fill(ecluster,l0cluster); }
385 if(GetReader()->IsPileUpFromEMCal()) {fhPtChargedPileUp[1]->Fill(ptcluster); fhLambda0ChargedPileUp[1]->Fill(ecluster,l0cluster); }
386 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtChargedPileUp[2]->Fill(ptcluster); fhLambda0ChargedPileUp[2]->Fill(ecluster,l0cluster); }
387 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtChargedPileUp[3]->Fill(ptcluster); fhLambda0ChargedPileUp[3]->Fill(ecluster,l0cluster); }
388 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtChargedPileUp[4]->Fill(ptcluster); fhLambda0ChargedPileUp[4]->Fill(ecluster,l0cluster); }
389 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtChargedPileUp[5]->Fill(ptcluster); fhLambda0ChargedPileUp[5]->Fill(ecluster,l0cluster); }
390 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtChargedPileUp[6]->Fill(ptcluster); fhLambda0ChargedPileUp[6]->Fill(ecluster,l0cluster); }
391 }
392
c4a7d28a 393 //.......................................
394 //Check Distance to Bad channel, set bit.
395 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
396 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
85c4406e 397 if(distBad < fMinDist)
34c16486 398 {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
c4a7d28a 399 return kFALSE ;
400 }
401 else if(GetDebug() > 2) printf("\t Bad channel cut passed %4.2f > %2.2f \n",distBad, fMinDist);
fc195fd0 402
fad96885 403 fhClusterCuts[8]->Fill(ecluster);
09273901 404
85c4406e 405 if(GetDebug() > 0)
fad96885 406 printf("AliAnaPhoton::ClusterSelected() Current Event %d; After selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
85c4406e 407 GetReader()->GetEventNumber(),
fad96885 408 ecluster, ptcluster,mom.Phi()*TMath::RadToDeg(),mom.Eta());
c4a7d28a 409
410 //All checks passed, cluster selected
411 return kTRUE;
85c4406e 412
c4a7d28a 413}
414
34c16486 415//___________________________________________
416void AliAnaPhoton::FillAcceptanceHistograms()
417{
3d5d5078 418 //Fill acceptance histograms if MC data is available
419
34c16486 420 Double_t photonY = -100 ;
421 Double_t photonE = -1 ;
422 Double_t photonPt = -1 ;
423 Double_t photonPhi = 100 ;
424 Double_t photonEta = -1 ;
85c4406e 425
34c16486 426 Int_t pdg = 0 ;
427 Int_t tag = 0 ;
428 Int_t mcIndex = 0 ;
429 Bool_t inacceptance = kFALSE;
85c4406e 430
34c16486 431 if(GetReader()->ReadStack())
85c4406e 432 {
3d5d5078 433 AliStack * stack = GetMCStack();
34c16486 434 if(stack)
435 {
436 for(Int_t i=0 ; i<stack->GetNtrack(); i++)
437 {
667a3592 438 if(GetReader()->AcceptOnlyHIJINGLabels() && !GetReader()->IsHIJINGLabel(i)) continue ;
439
3d5d5078 440 TParticle * prim = stack->Particle(i) ;
34c16486 441 pdg = prim->GetPdgCode();
3d5d5078 442 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
443 // prim->GetName(), prim->GetPdgCode());
444
34c16486 445 if(pdg == 22)
446 {
3d5d5078 447 // Get tag of this particle photon from fragmentation, decay, prompt ...
2644ead9 448 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader());
34c16486 449 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
450 {
3d5d5078 451 //A conversion photon from a hadron, skip this kind of photon
34c16486 452 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
453 // GetMCAnalysisUtils()->PrintMCTag(tag);
3d5d5078 454
455 return;
456 }
457
458 //Get photon kinematics
85c4406e 459 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
3d5d5078 460
34c16486 461 photonY = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
462 photonE = prim->Energy() ;
463 photonPt = prim->Pt() ;
464 photonPhi = TMath::RadToDeg()*prim->Phi() ;
3d5d5078 465 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
34c16486 466 photonEta = prim->Eta() ;
3d5d5078 467
468 //Check if photons hit the Calorimeter
469 TLorentzVector lv;
470 prim->Momentum(lv);
34c16486 471 inacceptance = kFALSE;
472 if (fCalorimeter == "PHOS")
473 {
474 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
475 {
3d5d5078 476 Int_t mod ;
477 Double_t x,z ;
85c4406e 478 if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
3d5d5078 479 inacceptance = kTRUE;
480 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
481 }
34c16486 482 else
483 {
85c4406e 484 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
3d5d5078 485 inacceptance = kTRUE ;
486 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
487 }
85c4406e 488 }
34c16486 489 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
490 {
491 if(GetEMCALGeometry())
492 {
3d5d5078 493 Int_t absID=0;
494
495 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
496
85c4406e 497 if( absID >= 0)
3d5d5078 498 inacceptance = kTRUE;
499
85c4406e 500 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
3d5d5078 501 // inacceptance = kTRUE;
502 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
503 }
34c16486 504 else
505 {
85c4406e 506 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
3d5d5078 507 inacceptance = kTRUE ;
508 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
509 }
510 } //In EMCAL
511
512 //Fill histograms
c5693f62 513 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
3d5d5078 514 if(TMath::Abs(photonY) < 1.0)
515 {
c5693f62 516 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
517 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
518 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
4cf13296 519 fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
3d5d5078 520 }
34c16486 521 if(inacceptance)
522 {
523 fhEPrimMCAcc [kmcPPhoton]->Fill(photonE ) ;
524 fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt) ;
c5693f62 525 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
4cf13296 526 fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta) ;
34c16486 527 fhYPrimMCAcc [kmcPPhoton]->Fill(photonE , photonY) ;
3d5d5078 528 }//Accepted
529
530 //Origin of photon
c5693f62 531 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
3d5d5078 532 {
34c16486 533 mcIndex = kmcPPrompt;
3d5d5078 534 }
c5693f62 535 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
3d5d5078 536 {
34c16486 537 mcIndex = kmcPFragmentation ;
3d5d5078 538 }
c5693f62 539 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
3d5d5078 540 {
34c16486 541 mcIndex = kmcPISR;
3d5d5078 542 }
c5693f62 543 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
3d5d5078 544 {
34c16486 545 mcIndex = kmcPPi0Decay;
3d5d5078 546 }
85c4406e 547 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
c5693f62 548 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
3d5d5078 549 {
34c16486 550 mcIndex = kmcPOtherDecay;
3d5d5078 551 }
c5693f62 552 else if(fhEPrimMC[kmcPOther])
3d5d5078 553 {
34c16486 554 mcIndex = kmcPOther;
3d5d5078 555 }//Other origin
34c16486 556
557 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
558 if(TMath::Abs(photonY) < 1.0)
559 {
560 fhEPrimMC [mcIndex]->Fill(photonE ) ;
561 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
562 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
4cf13296 563 fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta) ;
34c16486 564 }
4cf13296 565
34c16486 566 if(inacceptance)
567 {
568 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
569 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
570 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
4cf13296 571 fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta) ;
34c16486 572 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
573 }//Accepted
574
85c4406e 575 }// Primary photon
576 }//loop on primaries
3d5d5078 577 }//stack exists and data is MC
578 }//read stack
34c16486 579 else if(GetReader()->ReadAODMCParticles())
580 {
2644ead9 581 TClonesArray * mcparticles = GetReader()->GetAODMCParticles();
34c16486 582 if(mcparticles)
583 {
3d5d5078 584 Int_t nprim = mcparticles->GetEntriesFast();
585
586 for(Int_t i=0; i < nprim; i++)
587 {
667a3592 588 if(GetReader()->AcceptOnlyHIJINGLabels() && !GetReader()->IsHIJINGLabel(i)) continue ;
589
85c4406e 590 AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
3d5d5078 591
34c16486 592 pdg = prim->GetPdgCode();
3d5d5078 593
34c16486 594 if(pdg == 22)
595 {
3d5d5078 596 // Get tag of this particle photon from fragmentation, decay, prompt ...
2644ead9 597 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader());
34c16486 598 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
599 {
3d5d5078 600 //A conversion photon from a hadron, skip this kind of photon
34c16486 601 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
602 // GetMCAnalysisUtils()->PrintMCTag(tag);
3d5d5078 603
604 return;
605 }
606
607 //Get photon kinematics
85c4406e 608 if(prim->E() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
3d5d5078 609
34c16486 610 photonY = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
611 photonE = prim->E() ;
612 photonPt = prim->Pt() ;
03734799 613 photonPhi = prim->Phi() ;
3d5d5078 614 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
34c16486 615 photonEta = prim->Eta() ;
3d5d5078 616
617 //Check if photons hit the Calorimeter
618 TLorentzVector lv;
619 lv.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E());
34c16486 620 inacceptance = kFALSE;
621 if (fCalorimeter == "PHOS")
622 {
623 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
624 {
3d5d5078 625 Int_t mod ;
626 Double_t x,z ;
627 Double_t vtx[]={prim->Xv(),prim->Yv(),prim->Zv()};
628 if(GetPHOSGeometry()->ImpactOnEmc(vtx, prim->Theta(),prim->Phi(),mod,z,x))
629 inacceptance = kTRUE;
630 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
631 }
34c16486 632 else
633 {
85c4406e 634 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
3d5d5078 635 inacceptance = kTRUE ;
636 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
637 }
85c4406e 638 }
34c16486 639 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
640 {
641 if(GetEMCALGeometry())
642 {
3d5d5078 643 Int_t absID=0;
644
645 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
646
85c4406e 647 if( absID >= 0)
3d5d5078 648 inacceptance = kTRUE;
649
650 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
651 }
34c16486 652 else
653 {
85c4406e 654 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
3d5d5078 655 inacceptance = kTRUE ;
656 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
657 }
658 } //In EMCAL
659
660 //Fill histograms
661
c5693f62 662 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
3d5d5078 663 if(TMath::Abs(photonY) < 1.0)
664 {
c5693f62 665 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
666 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
667 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
4cf13296 668 fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
3d5d5078 669 }
34c16486 670
671 if(inacceptance)
672 {
c5693f62 673 fhEPrimMCAcc[kmcPPhoton] ->Fill(photonE ) ;
674 fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
675 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
4cf13296 676 fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta) ;
c5693f62 677 fhYPrimMCAcc[kmcPPhoton] ->Fill(photonE , photonY) ;
3d5d5078 678 }//Accepted
679
3d5d5078 680 //Origin of photon
c5693f62 681 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
3d5d5078 682 {
34c16486 683 mcIndex = kmcPPrompt;
3d5d5078 684 }
34c16486 685 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
3d5d5078 686 {
34c16486 687 mcIndex = kmcPFragmentation ;
3d5d5078 688 }
c5693f62 689 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
3d5d5078 690 {
34c16486 691 mcIndex = kmcPISR;
3d5d5078 692 }
c5693f62 693 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
3d5d5078 694 {
34c16486 695 mcIndex = kmcPPi0Decay;
3d5d5078 696 }
85c4406e 697 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
34c16486 698 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
3d5d5078 699 {
34c16486 700 mcIndex = kmcPOtherDecay;
3d5d5078 701 }
c5693f62 702 else if(fhEPrimMC[kmcPOther])
3d5d5078 703 {
34c16486 704 mcIndex = kmcPOther;
3d5d5078 705 }//Other origin
34c16486 706
707 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
708 if(TMath::Abs(photonY) < 1.0)
709 {
710 fhEPrimMC [mcIndex]->Fill(photonE ) ;
711 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
712 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
4cf13296 713 fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta) ;
34c16486 714 }
715 if(inacceptance)
716 {
717 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
718 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
719 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
4cf13296 720 fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta) ;
34c16486 721 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
722 }//Accepted
85c4406e 723
724 }// Primary photon
725 }//loop on primaries
3d5d5078 726
c5693f62 727 }//kmc array exists and data is MC
3d5d5078 728 } // read AOD MC
729}
521636d2 730
b94e038e 731//________________________________________________________________________________________________________________
732void AliAnaPhoton::FillEMCALTriggerClusterBCHistograms(Int_t idcalo, Float_t ecluster, Float_t tofcluster,
733 Float_t etacluster, Float_t phicluster)
b2e375c7 734
735{
736 // Fill trigger related histograms
737
738 if(!fFillEMCALBCHistograms || fCalorimeter!="EMCAL") return ;
739
740 Float_t tofclusterUS = TMath::Abs(tofcluster);
741
742 if(ecluster > 2)
743 {
744 if (tofclusterUS < 25) fhEtaPhiEMCALBC0->Fill(etacluster, phicluster);
745 else if (tofclusterUS < 75) fhEtaPhiEMCALBC1->Fill(etacluster, phicluster);
746 else fhEtaPhiEMCALBCN->Fill(etacluster, phicluster);
747 }
748
749 Int_t bc = GetReader()->GetTriggerClusterBC();
750 Int_t id = GetReader()->GetTriggerClusterId();
751 Bool_t badMax = GetReader()->IsBadMaxCellTriggerEvent();
752
eb86112d 753 Int_t histoBC = bc+5;
754 if(GetReader()->AreBadTriggerEventsRemoved()) histoBC=0; // histograms created only for one BC since the others where rejected
755
b2e375c7 756 if(id==-2)
757 {
758 //printf("AliAnaPhoton::ClusterSelected() - No trigger found bc=%d\n",bc);
759 fhEtaPhiNoTrigger->Fill(etacluster, phicluster);
760 fhTimeNoTrigger ->Fill(ecluster, tofcluster);
761 }
762 else if(TMath::Abs(bc) < 6)
763 {
764 if(!GetReader()->IsBadCellTriggerEvent() && !GetReader()->IsExoticEvent() )
765 {
766 if(GetReader()->IsTriggerMatched())
767 {
eb86112d 768 if(ecluster > 2) fhEtaPhiTriggerEMCALBC[histoBC]->Fill(etacluster, phicluster);
769 fhTimeTriggerEMCALBC[histoBC]->Fill(ecluster, tofcluster);
770 if(GetReader()->IsPileUpFromSPD()) fhTimeTriggerEMCALBCPileUpSPD[histoBC]->Fill(ecluster, tofcluster);
b2e375c7 771
772 if(idcalo == GetReader()->GetTriggerClusterId())
773 {
eb86112d 774 fhEtaPhiTriggerEMCALBCCluster[histoBC]->Fill(etacluster, phicluster);
126b8c62 775 fhTimeTriggerEMCALBCCluster ->Fill(ecluster, tofcluster);
b2e375c7 776
777 if(bc==0)
778 {
93c2e459 779 Float_t threshold = GetReader()->GetEventTriggerL1Threshold() ;
780 if(GetReader()->IsEventEMCALL0()) threshold = GetReader()->GetEventTriggerL0Threshold() ;
781
b2e375c7 782 if(ecluster > threshold)
783 fhEtaPhiTriggerEMCALBCClusterOverTh->Fill(etacluster, phicluster);
784 else if(ecluster > threshold-1)
785 fhEtaPhiTriggerEMCALBCClusterBelowTh1->Fill(etacluster, phicluster);
786 else
787 fhEtaPhiTriggerEMCALBCClusterBelowTh2->Fill(etacluster, phicluster);
788 }
789 }
790 }
791 else
792 {
eb86112d 793 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUM[histoBC]->Fill(etacluster, phicluster);
794 fhTimeTriggerEMCALBCUM[histoBC]->Fill(ecluster, tofcluster);
b2e375c7 795
126b8c62 796 if(bc==0)
797 {
798 if(GetReader()->IsTriggerMatchedOpenCuts(0)) fhTimeTriggerEMCALBC0UMReMatchOpenTime ->Fill(ecluster, tofcluster);
799 if(GetReader()->IsTriggerMatchedOpenCuts(1)) fhTimeTriggerEMCALBC0UMReMatchCheckNeigh ->Fill(ecluster, tofcluster);
800 if(GetReader()->IsTriggerMatchedOpenCuts(2)) fhTimeTriggerEMCALBC0UMReMatchBoth ->Fill(ecluster, tofcluster);
801 }
802
b2e375c7 803 if(idcalo == GetReader()->GetTriggerClusterId())
804 {
eb86112d 805 fhEtaPhiTriggerEMCALBCUMCluster[histoBC]->Fill(etacluster, phicluster);
126b8c62 806 fhTimeTriggerEMCALBCUMCluster->Fill(ecluster, tofcluster);
b2e375c7 807 if(bc==0)
808 {
93c2e459 809 Float_t threshold = GetReader()->GetEventTriggerL1Threshold() ;
810 if(GetReader()->IsEventEMCALL0()) threshold = GetReader()->GetEventTriggerL0Threshold() ;
811
b2e375c7 812 if(ecluster > threshold)
813 fhEtaPhiTriggerEMCALBCUMClusterOverTh->Fill(etacluster, phicluster);
814 else if(ecluster > threshold-1)
815 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->Fill(etacluster, phicluster);
816 else
817 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->Fill(etacluster, phicluster);
818
819 if(GetReader()->IsTriggerMatchedOpenCuts(0))
820 {
126b8c62 821 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->Fill(etacluster, phicluster);
822 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster ->Fill(ecluster, tofcluster);
b2e375c7 823 }
824 if(GetReader()->IsTriggerMatchedOpenCuts(1))
825 {
126b8c62 826 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->Fill(etacluster, phicluster);
827 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster ->Fill(ecluster, tofcluster);
b2e375c7 828 }
829 if(GetReader()->IsTriggerMatchedOpenCuts(2))
830 {
126b8c62 831 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->Fill(etacluster, phicluster);
832 fhTimeTriggerEMCALBCUMReMatchBothCluster ->Fill(ecluster, tofcluster);
b2e375c7 833 }
834
835 }
836 }
837 }
838 }// neither bad nor exotic
839 else if(GetReader()->IsBadCellTriggerEvent() && GetReader()->IsExoticEvent())
840 {
841 if(GetReader()->IsTriggerMatched())
842 {
843 if(ecluster > 2) fhEtaPhiTriggerEMCALBCBadExotic->Fill(etacluster, phicluster);
844 fhTimeTriggerEMCALBCBadExotic->Fill(ecluster, tofcluster);
845 if(badMax) fhTimeTriggerEMCALBCBadMaxCellExotic->Fill(ecluster, tofcluster);
846 }
847 else
848 {
849 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBadExotic->Fill(etacluster, phicluster);
850 fhTimeTriggerEMCALBCUMBadExotic->Fill(ecluster, tofcluster);
851 if(badMax) fhTimeTriggerEMCALBCUMBadMaxCellExotic->Fill(ecluster, tofcluster);
852
853 }
854 }// Bad and exotic cluster trigger
855 else if(GetReader()->IsBadCellTriggerEvent() )
856 {
857 if(GetReader()->IsTriggerMatched())
858 {
859 if(ecluster > 2) fhEtaPhiTriggerEMCALBCBad->Fill(etacluster, phicluster);
860 fhTimeTriggerEMCALBCBad->Fill(ecluster, tofcluster);
861 if(badMax) fhTimeTriggerEMCALBCBadMaxCell->Fill(ecluster, tofcluster);
862 }
863 else
864 {
865 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBad->Fill(etacluster, phicluster);
866 fhTimeTriggerEMCALBCUMBad->Fill(ecluster, tofcluster);
867 if(badMax) fhTimeTriggerEMCALBCUMBadMaxCell->Fill(ecluster, tofcluster);
868 }
869 }// Bad cluster trigger
870 else if(GetReader()->IsExoticEvent() )
871 {
872 if(GetReader()->IsTriggerMatched())
873 {
874 if(ecluster > 2) fhEtaPhiTriggerEMCALBCExotic->Fill(etacluster, phicluster);
875 fhTimeTriggerEMCALBCExotic->Fill(ecluster, tofcluster);
876 }
877 else
878 {
879 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMExotic->Fill(etacluster, phicluster);
880 fhTimeTriggerEMCALBCUMExotic->Fill(ecluster, tofcluster);
881 }
882 }
883 }
884 else if(TMath::Abs(bc) >= 6)
885 printf("AliAnaPhoton::ClusterSelected() - Trigger BC not expected = %d\n",bc);
886
887}
888
b94e038e 889//_________________________________________________________________________________________________________
890void AliAnaPhoton::FillClusterPileUpHistograms(AliVCluster * calo, Bool_t matched, Float_t ptcluster,
891 Float_t etacluster, Float_t phicluster, Float_t l0cluster)
b2e375c7 892{
893 // Fill some histograms related to pile up before any cluster cut is applied
894
895 if(!fFillPileUpHistograms) return ;
896
897 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
898 AliVCaloCells* cells = 0;
899 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
900 else cells = GetPHOSCells();
901
902 Float_t maxCellFraction = 0.;
903 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
904
905 Double_t tmax = cells->GetCellTime(absIdMax);
906 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
907 tmax*=1.e9;
908
909 Bool_t okPhoton = kFALSE;
910 if( GetCaloPID()->GetIdentifiedParticleType(calo)== AliCaloPID::kPhoton) okPhoton = kTRUE;
911
912 Float_t clusterLongTimePt = 0;
913 Float_t clusterOKTimePt = 0;
126b8c62 914
915 //Loop on cells inside cluster, max cell must be over 100 MeV and time in BC=0
916 if(cells->GetCellAmplitude(absIdMax) > 0.1 && TMath::Abs(tmax) < 30)
b2e375c7 917 {
126b8c62 918 for (Int_t ipos = 0; ipos < calo->GetNCells(); ipos++)
b2e375c7 919 {
126b8c62 920 Int_t absId = calo->GetCellsAbsId()[ipos];
921
922 if( absId == absIdMax ) continue ;
923
b2e375c7 924 Double_t time = cells->GetCellTime(absId);
925 Float_t amp = cells->GetCellAmplitude(absId);
926 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
927 GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,time,cells);
928 time*=1e9;
929
930 Float_t diff = (tmax-time);
931
932 if(GetReader()->IsInTimeWindow(time,amp)) clusterOKTimePt += amp;
933 else clusterLongTimePt += amp;
934
36769d30 935 if( cells->GetCellAmplitude(absIdMax) < 0.1 ) continue ;
126b8c62 936
b2e375c7 937 if(GetReader()->IsPileUpFromSPD())
938 {
126b8c62 939 fhClusterCellTimePileUp[0]->Fill(ptcluster, time);
940 fhClusterTimeDiffPileUp[0]->Fill(ptcluster, diff);
b2e375c7 941 if(!matched)
942 {
126b8c62 943 fhClusterTimeDiffChargedPileUp[0]->Fill(ptcluster, diff);
944 if(okPhoton) fhClusterTimeDiffPhotonPileUp[0]->Fill(ptcluster, diff);
b2e375c7 945 }
946 }
947
948 if(GetReader()->IsPileUpFromEMCal())
949 {
126b8c62 950 fhClusterCellTimePileUp[1]->Fill(ptcluster, time);
951 fhClusterTimeDiffPileUp[1]->Fill(ptcluster, diff);
b2e375c7 952 if(!matched)
953 {
126b8c62 954 fhClusterTimeDiffChargedPileUp[1]->Fill(ptcluster, diff);
955 if(okPhoton) fhClusterTimeDiffPhotonPileUp[1]->Fill(ptcluster, diff);
b2e375c7 956 }
957 }
958
959 if(GetReader()->IsPileUpFromSPDOrEMCal())
960 {
126b8c62 961 fhClusterCellTimePileUp[2]->Fill(ptcluster, time);
962 fhClusterTimeDiffPileUp[2]->Fill(ptcluster, diff);
b2e375c7 963 if(!matched)
964 {
126b8c62 965 fhClusterTimeDiffChargedPileUp[2]->Fill(ptcluster, diff);
966 if(okPhoton) fhClusterTimeDiffPhotonPileUp[2]->Fill(ptcluster, diff);
b2e375c7 967 }
968 }
969
970 if(GetReader()->IsPileUpFromSPDAndEMCal())
971 {
126b8c62 972 fhClusterCellTimePileUp[3]->Fill(ptcluster, time);
973 fhClusterTimeDiffPileUp[3]->Fill(ptcluster, diff);
b2e375c7 974 if(!matched)
975 {
126b8c62 976 fhClusterTimeDiffChargedPileUp[3]->Fill(ptcluster, diff);
977 if(okPhoton) fhClusterTimeDiffPhotonPileUp[3]->Fill(ptcluster, diff);
b2e375c7 978 }
979 }
980
981 if(GetReader()->IsPileUpFromSPDAndNotEMCal())
982 {
126b8c62 983 fhClusterCellTimePileUp[4]->Fill(ptcluster, time);
984 fhClusterTimeDiffPileUp[4]->Fill(ptcluster, diff);
b2e375c7 985 if(!matched)
986 {
126b8c62 987 fhClusterTimeDiffChargedPileUp[4]->Fill(ptcluster, diff);
988 if(okPhoton) fhClusterTimeDiffPhotonPileUp[4]->Fill(ptcluster, diff);
b2e375c7 989 }
990 }
991
992 if(GetReader()->IsPileUpFromEMCalAndNotSPD())
993 {
126b8c62 994 fhClusterCellTimePileUp[5]->Fill(ptcluster, time);
995 fhClusterTimeDiffPileUp[5]->Fill(ptcluster, diff);
b2e375c7 996 if(!matched)
997 {
126b8c62 998 fhClusterTimeDiffChargedPileUp[5]->Fill(ptcluster, diff);
999 if(okPhoton) fhClusterTimeDiffPhotonPileUp[5]->Fill(ptcluster, diff);
b2e375c7 1000 }
1001 }
1002
1003 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
1004 {
126b8c62 1005 fhClusterCellTimePileUp[6]->Fill(ptcluster, time);
1006 fhClusterTimeDiffPileUp[6]->Fill(ptcluster, diff);
b2e375c7 1007 if(!matched)
1008 {
126b8c62 1009 fhClusterTimeDiffChargedPileUp[6]->Fill(ptcluster, diff);
1010 if(okPhoton) fhClusterTimeDiffPhotonPileUp[6]->Fill(ptcluster, diff);
b2e375c7 1011 }
1012 }
126b8c62 1013 }//loop
1014
1015
1016 Float_t frac = 0;
1017 if(clusterLongTimePt+clusterOKTimePt > 0.001)
1018 frac = clusterLongTimePt/(clusterLongTimePt+clusterOKTimePt);
1019 //printf("E long %f, E OK %f, Fraction large time %f, E %f\n",clusterLongTimePt,clusterOKTimePt,frac,ptcluster);
1020
1021 if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(ptcluster); fhLambda0PileUp[0]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[0]->Fill(ptcluster,frac);}
1022 if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(ptcluster); fhLambda0PileUp[1]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[1]->Fill(ptcluster,frac);}
1023 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(ptcluster); fhLambda0PileUp[2]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[2]->Fill(ptcluster,frac);}
1024 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(ptcluster); fhLambda0PileUp[3]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[3]->Fill(ptcluster,frac);}
1025 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ptcluster,frac);}
1026 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ptcluster,frac);}
1027 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ptcluster,frac);}
1028
1029 fhEtaPhiBC0->Fill(etacluster,phicluster);
1030 if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD ->Fill(etacluster,phicluster);
1031 }
b2e375c7 1032
b2e375c7 1033 else if (tmax > 25) {fhEtaPhiBCPlus ->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(etacluster,phicluster); }
1034 else if (tmax <-25) {fhEtaPhiBCMinus->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(etacluster,phicluster); }
1035}
1036
1037//_______________________________________________
85c4406e 1038void AliAnaPhoton::FillPileUpHistogramsPerEvent()
acd56ca4 1039{
1040 // Fill some histograms per event to understand pile-up
6227a9fd 1041 // Open the time cut in the reader to be more meaningful
1042
acd56ca4 1043 if(!fFillPileUpHistograms) return;
85c4406e 1044
0f7e7205 1045 AliVEvent * event = GetReader()->GetInputEvent();
1046
1047 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1048 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1049
1050 // N pile up vertices
1051 Int_t nVtxSPD = -1;
1052 Int_t nVtxTrk = -1;
1053 TLorentzVector mom;
1054
1055 if (esdEv)
1056 {
1057 nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
1058 nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
1059 }//ESD
1060 else if (aodEv)
1061 {
1062 nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
1063 nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
85c4406e 1064 }//AOD
0f7e7205 1065
1066
85c4406e 1067 // Get the appropriate list of clusters
0f7e7205 1068 TClonesArray * clusterList = 0;
1069 TString clusterListName = GetReader()->GetEMCALClusterListName();
1070 if (event->FindListObject(clusterListName))
1071 clusterList = dynamic_cast<TClonesArray*> (event->FindListObject(clusterListName));
1072 else if(GetReader()->GetOutputEvent())
1073 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(clusterListName));
1074
1075 // Loop on clusters, get the maximum energy cluster as reference
85c4406e 1076 Int_t nclusters = 0;
0f7e7205 1077 if(clusterList) nclusters = clusterList->GetEntriesFast();
1078 else nclusters = event->GetNumberOfCaloClusters();
1079
85c4406e 1080 Int_t idMax = 0;
acd56ca4 1081 Float_t eMax = 0;
85c4406e 1082 Float_t tMax = 0;
acd56ca4 1083 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
1084 {
0f7e7205 1085 AliVCluster * clus = 0;
85c4406e 1086 if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
0f7e7205 1087 else clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1088
1089 if(!clus) continue;
1090
1091 if(!clus->IsEMCAL()) continue;
1092
1093 Float_t tof = clus->GetTOF()*1e9;
b2e375c7 1094 if(clus->E() > eMax && TMath::Abs(tof) < 30)
acd56ca4 1095 {
1096 eMax = clus->E();
0f7e7205 1097 tMax = tof;
acd56ca4 1098 idMax = iclus;
1099 }
0f7e7205 1100
1101 clus->GetMomentum(mom,GetVertex(0));
1102 Float_t pt = mom.Pt();
1103
85c4406e 1104 fhPtNPileUpSPDVtx->Fill(pt,nVtxSPD);
0f7e7205 1105 fhPtNPileUpTrkVtx->Fill(pt,nVtxTrk);
85c4406e 1106
b2e375c7 1107 if(TMath::Abs(tof) < 30)
85c4406e 1108 {
1109 fhPtNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
1110 fhPtNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
0f7e7205 1111 }
85c4406e 1112
b2e375c7 1113 if(tof < 75 && tof > -30)
85c4406e 1114 {
1115 fhPtNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
1116 fhPtNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
1117 }
1118
b2e375c7 1119 fhTimePtNoCut->Fill(pt,tof);
1120 if(GetReader()->IsPileUpFromSPD()) fhTimePtSPD->Fill(pt,tof);
1121
acd56ca4 1122 }
0f7e7205 1123
6227a9fd 1124 if(eMax < 5) return;
acd56ca4 1125
1126 // Loop again on clusters to compare this max cluster t and the rest of the clusters, if E > 0.3
1127 Int_t n20 = 0;
1128 Int_t n40 = 0;
1129 Int_t n = 0;
1130 Int_t nOK = 0;
85c4406e 1131
acd56ca4 1132 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
1133 {
0f7e7205 1134 AliVCluster * clus = 0;
85c4406e 1135 if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
0f7e7205 1136 else clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1137
1138 if(!clus) continue;
1139
1140 if(!clus->IsEMCAL()) continue;
acd56ca4 1141
1142 if(clus->E() < 0.3 || iclus==idMax) continue;
1143
1144 Float_t tdiff = TMath::Abs(tMax-clus->GetTOF()*1e9);
1145 n++;
0f7e7205 1146 if(tdiff < 25) nOK++;
acd56ca4 1147 else
1148 {
1149 n20++;
1150 if(tdiff > 40 ) n40++;
1151 }
1152 }
1153
1154 // Check pile-up and fill histograms depending on the different cluster multiplicities
1155 if(GetReader()->IsPileUpFromSPD())
85c4406e 1156 {
acd56ca4 1157 fhClusterMultSPDPileUp[0]->Fill(eMax,n );
1158 fhClusterMultSPDPileUp[1]->Fill(eMax,nOK);
1159 fhClusterMultSPDPileUp[2]->Fill(eMax,n20);
1160 fhClusterMultSPDPileUp[3]->Fill(eMax,n40);
1161 }
85c4406e 1162 else
acd56ca4 1163 {
1164 fhClusterMultNoPileUp[0]->Fill(eMax,n );
1165 fhClusterMultNoPileUp[1]->Fill(eMax,nOK);
1166 fhClusterMultNoPileUp[2]->Fill(eMax,n20);
85c4406e 1167 fhClusterMultNoPileUp[3]->Fill(eMax,n40);
1168 }
acd56ca4 1169
1170}
1171
1172
fad96885 1173//_________________________________________________________________________________________________
22ad7981 1174void AliAnaPhoton::FillPileUpHistograms(Float_t energy, Float_t pt, Float_t time)
2ad19c3d 1175{
1176 // Fill some histograms to understand pile-up
1177 if(!fFillPileUpHistograms) return;
1178
1179 //printf("E %f, time %f\n",energy,time);
1180 AliVEvent * event = GetReader()->GetInputEvent();
1181
fad96885 1182 if(GetReader()->IsPileUpFromSPD()) fhPtPhotonPileUp[0]->Fill(pt);
1183 if(GetReader()->IsPileUpFromEMCal()) fhPtPhotonPileUp[1]->Fill(pt);
1184 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPhotonPileUp[2]->Fill(pt);
1185 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPhotonPileUp[3]->Fill(pt);
1186 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPhotonPileUp[4]->Fill(pt);
1187 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPhotonPileUp[5]->Fill(pt);
1188 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt);
1189
b2e375c7 1190 fhTimePtPhotonNoCut->Fill(pt,time);
1191 if(GetReader()->IsPileUpFromSPD()) fhTimePtPhotonSPD->Fill(pt,time);
2ad19c3d 1192
de101942 1193 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
2ad19c3d 1194
1195 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1196 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1197
1198 // N pile up vertices
0f7e7205 1199 Int_t nVtxSPD = -1;
1200 Int_t nVtxTrk = -1;
2ad19c3d 1201
1202 if (esdEv)
1203 {
0f7e7205 1204 nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
1205 nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
85c4406e 1206
2ad19c3d 1207 }//ESD
1208 else if (aodEv)
1209 {
0f7e7205 1210 nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
1211 nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
2ad19c3d 1212 }//AOD
1213
0f7e7205 1214 fhTimeNPileUpVertSPD ->Fill(time,nVtxSPD);
1215 fhTimeNPileUpVertTrack->Fill(time,nVtxTrk);
2ad19c3d 1216
85c4406e 1217 fhPtPhotonNPileUpSPDVtx->Fill(pt,nVtxSPD);
0f7e7205 1218 fhPtPhotonNPileUpTrkVtx->Fill(pt,nVtxTrk);
1219
1220 if(TMath::Abs(time) < 25)
85c4406e 1221 {
1222 fhPtPhotonNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
1223 fhPtPhotonNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
0f7e7205 1224 }
1225
85c4406e 1226 if(time < 75 && time > -25)
1227 {
1228 fhPtPhotonNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
1229 fhPtPhotonNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
1230 }
1231
1232 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
0f7e7205 1233 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVtxSPD,nVtxTrk);
2ad19c3d 1234
1235 Int_t ncont = -1;
5559f30a 1236 Float_t z1 = -1, z2 = -1;
2ad19c3d 1237 Float_t diamZ = -1;
0f7e7205 1238 for(Int_t iVert=0; iVert<nVtxSPD;iVert++)
2ad19c3d 1239 {
1240 if (esdEv)
1241 {
1242 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
1243 ncont=pv->GetNContributors();
1244 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
1245 z2 = pv->GetZ();
1246 diamZ = esdEv->GetDiamondZ();
1247 }//ESD
1248 else if (aodEv)
1249 {
1250 AliAODVertex *pv=aodEv->GetVertex(iVert);
1251 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
1252 ncont=pv->GetNContributors();
1253 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
1254 z2=pv->GetZ();
1255 diamZ = aodEv->GetDiamondZ();
1256 }// AOD
1257
1258 Double_t distZ = TMath::Abs(z2-z1);
1259 diamZ = TMath::Abs(z2-diamZ);
85c4406e 1260
2ad19c3d 1261 fhTimeNPileUpVertContributors ->Fill(time,ncont);
1262 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
1263 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
85c4406e 1264
2ad19c3d 1265 }// loop
1266}
1267
34c16486 1268//____________________________________________________________________________________
22ad7981 1269void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
34c16486 1270{
85c4406e 1271 //Fill cluster Shower Shape histograms
521636d2 1272
1273 if(!fFillSSHistograms || GetMixedEvent()) return;
85c4406e 1274
521636d2 1275 Float_t energy = cluster->E();
1276 Int_t ncells = cluster->GetNCells();
521636d2 1277 Float_t lambda0 = cluster->GetM02();
1278 Float_t lambda1 = cluster->GetM20();
1279 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
1280
1281 TLorentzVector mom;
34c16486 1282 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1283 {
1284 cluster->GetMomentum(mom,GetVertex(0)) ;
1285 }//Assume that come from vertex in straight line
1286 else
1287 {
521636d2 1288 Double_t vertex[]={0,0,0};
1289 cluster->GetMomentum(mom,vertex) ;
1290 }
1291
1292 Float_t eta = mom.Eta();
1293 Float_t phi = mom.Phi();
1294 if(phi < 0) phi+=TMath::TwoPi();
1295
1296 fhLam0E ->Fill(energy,lambda0);
1297 fhLam1E ->Fill(energy,lambda1);
1298 fhDispE ->Fill(energy,disp);
85c4406e 1299
34c16486 1300 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1301 {
521636d2 1302 fhLam0ETRD->Fill(energy,lambda0);
1303 fhLam1ETRD->Fill(energy,lambda1);
1304 fhDispETRD->Fill(energy,disp);
521636d2 1305 }
1306
34c16486 1307 Float_t l0 = 0., l1 = 0.;
85c4406e 1308 Float_t dispp= 0., dEta = 0., dPhi = 0.;
1309 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
764ab1f4 1310 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
34c16486 1311 {
1312 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
1313 l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
1314 //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",
1315 // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
1316 //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
1317 // disp, dPhi+dEta );
1318 fhDispEtaE -> Fill(energy,dEta);
1319 fhDispPhiE -> Fill(energy,dPhi);
1320 fhSumEtaE -> Fill(energy,sEta);
1321 fhSumPhiE -> Fill(energy,sPhi);
1322 fhSumEtaPhiE -> Fill(energy,sEtaPhi);
1323 fhDispEtaPhiDiffE -> Fill(energy,dPhi-dEta);
1324 if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
1325 if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.));
85c4406e 1326 if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));
34c16486 1327
bfdcf7fb 1328 Int_t ebin = -1;
1329 if (energy < 2 ) ebin = 0;
1330 else if (energy < 4 ) ebin = 1;
1331 else if (energy < 6 ) ebin = 2;
1332 else if (energy < 10) ebin = 3;
85c4406e 1333 else if (energy < 15) ebin = 4;
1334 else if (energy < 20) ebin = 5;
1335 else ebin = 6;
bfdcf7fb 1336
1337 fhDispEtaDispPhi[ebin]->Fill(dEta ,dPhi);
1338 fhLambda0DispEta[ebin]->Fill(lambda0,dEta);
1339 fhLambda0DispPhi[ebin]->Fill(lambda0,dPhi);
1340
34c16486 1341 }
1342
85c4406e 1343 // if track-matching was of, check effect of track-matching residual cut
b5dbb99b 1344
1345 if(!fRejectTrackMatch)
1346 {
1347 Float_t dZ = cluster->GetTrackDz();
1348 Float_t dR = cluster->GetTrackDx();
34c16486 1349 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1350 {
b5dbb99b 1351 dR = 2000., dZ = 2000.;
1352 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
85c4406e 1353 }
b5dbb99b 1354
1355 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1356 {
1357 fhLam0ETM ->Fill(energy,lambda0);
1358 fhLam1ETM ->Fill(energy,lambda1);
1359 fhDispETM ->Fill(energy,disp);
1360
34c16486 1361 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1362 {
b5dbb99b 1363 fhLam0ETMTRD->Fill(energy,lambda0);
1364 fhLam1ETMTRD->Fill(energy,lambda1);
1365 fhDispETMTRD->Fill(energy,disp);
1366 }
1367 }
85c4406e 1368 }// if track-matching was of, check effect of matching residual cut
b5dbb99b 1369
764ab1f4 1370
1371 if(!fFillOnlySimpleSSHisto){
1372 if(energy < 2)
1373 {
1374 fhNCellsLam0LowE ->Fill(ncells,lambda0);
1375 fhNCellsLam1LowE ->Fill(ncells,lambda1);
1376 fhNCellsDispLowE ->Fill(ncells,disp);
1377
1378 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
1379 fhLam0DispLowE ->Fill(lambda0,disp);
1380 fhDispLam1LowE ->Fill(disp,lambda1);
1381 fhEtaLam0LowE ->Fill(eta,lambda0);
85c4406e 1382 fhPhiLam0LowE ->Fill(phi,lambda0);
764ab1f4 1383 }
85c4406e 1384 else
764ab1f4 1385 {
1386 fhNCellsLam0HighE ->Fill(ncells,lambda0);
1387 fhNCellsLam1HighE ->Fill(ncells,lambda1);
1388 fhNCellsDispHighE ->Fill(ncells,disp);
1389
1390 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
1391 fhLam0DispHighE ->Fill(lambda0,disp);
1392 fhDispLam1HighE ->Fill(disp,lambda1);
1393 fhEtaLam0HighE ->Fill(eta, lambda0);
1394 fhPhiLam0HighE ->Fill(phi, lambda0);
1395 }
521636d2 1396 }
34c16486 1397 if(IsDataMC())
1398 {
f66d95af 1399 AliVCaloCells* cells = 0;
1400 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
1401 else cells = GetPHOSCells();
3d5d5078 1402
1403 //Fill histograms to check shape of embedded clusters
1404 Float_t fraction = 0;
85c4406e 1405 // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
1406
34c16486 1407 if(GetReader()->IsEmbeddedClusterSelectionOn())
1408 {//Only working for EMCAL
85c4406e 1409 // printf("embedded\n");
3d5d5078 1410 Float_t clusterE = 0; // recalculate in case corrections applied.
1411 Float_t cellE = 0;
34c16486 1412 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
1413 {
3d5d5078 1414 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
85c4406e 1415 clusterE+=cellE;
3d5d5078 1416 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
1417 }
1418
1419 //Fraction of total energy due to the embedded signal
1420 fraction/=clusterE;
1421
85c4406e 1422 if(GetDebug() > 1 )
8d6b7f60 1423 printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
3d5d5078 1424
1425 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
1426
85c4406e 1427 } // embedded fraction
3d5d5078 1428
f66d95af 1429 // Get the fraction of the cluster energy that carries the cell with highest energy
34c16486 1430 Int_t absID =-1 ;
f66d95af 1431 Float_t maxCellFraction = 0.;
1432
1433 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
1434
1435 // Check the origin and fill histograms
34c16486 1436
1437 Int_t mcIndex = -1;
1438
85c4406e 1439 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
3d5d5078 1440 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
34c16486 1441 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1442 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1443 {
1444 mcIndex = kmcssPhoton ;
85c4406e 1445
34c16486 1446 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1447 {
3d5d5078 1448 //Check particle overlaps in cluster
1449
85c4406e 1450 // Compare the primary depositing more energy with the rest,
8d6b7f60 1451 // if no photon/electron as comon ancestor (conversions), count as other particle
4914e781 1452 const UInt_t nlabels = cluster->GetNLabels();
1453 Int_t overpdg[nlabels];
1454 Int_t noverlaps = GetMCAnalysisUtils()->GetNOverlaps(cluster->GetLabels(), nlabels,mcTag,-1,GetReader(),overpdg);
1455
8d6b7f60 1456 //printf("N overlaps %d \n",noverlaps);
3d5d5078 1457
f27fe026 1458 if(noverlaps == 0)
34c16486 1459 {
3d5d5078 1460 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
3d5d5078 1461 }
f27fe026 1462 else if(noverlaps == 1)
85c4406e 1463 {
3d5d5078 1464 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
3d5d5078 1465 }
f27fe026 1466 else if(noverlaps > 1)
85c4406e 1467 {
3d5d5078 1468 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
3d5d5078 1469 }
85c4406e 1470 else
34c16486 1471 {
f27fe026 1472 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!\n", noverlaps);
3d5d5078 1473 }
1474 }//No embedding
1475
1476 //Fill histograms to check shape of embedded clusters
34c16486 1477 if(GetReader()->IsEmbeddedClusterSelectionOn())
1478 {
85c4406e 1479 if (fraction > 0.9)
3d5d5078 1480 {
1481 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
3d5d5078 1482 }
1483 else if(fraction > 0.5)
1484 {
1485 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
3d5d5078 1486 }
1487 else if(fraction > 0.1)
85c4406e 1488 {
3d5d5078 1489 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
3d5d5078 1490 }
1491 else
1492 {
1493 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
3d5d5078 1494 }
1495 } // embedded
1496
521636d2 1497 }//photon no conversion
4431f13a 1498 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1499 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
1500 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1501 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1502 {
1503 mcIndex = kmcssConversion ;
1504 }//conversion photon
1505
34c16486 1506 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
1507 {
1508 mcIndex = kmcssElectron ;
521636d2 1509 }//electron
34c16486 1510 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
1511 {
1512 mcIndex = kmcssPi0 ;
3d5d5078 1513
1514 //Fill histograms to check shape of embedded clusters
34c16486 1515 if(GetReader()->IsEmbeddedClusterSelectionOn())
1516 {
85c4406e 1517 if (fraction > 0.9)
3d5d5078 1518 {
1519 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
3d5d5078 1520 }
1521 else if(fraction > 0.5)
1522 {
1523 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
3d5d5078 1524 }
1525 else if(fraction > 0.1)
85c4406e 1526 {
3d5d5078 1527 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
3d5d5078 1528 }
1529 else
1530 {
1531 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
3d5d5078 1532 }
85c4406e 1533 } // embedded
3d5d5078 1534
521636d2 1535 }//pi0
34c16486 1536 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
1537 {
1538 mcIndex = kmcssEta ;
85c4406e 1539 }//eta
1540 else
34c16486 1541 {
85c4406e 1542 mcIndex = kmcssOther ;
1543 }//other particles
521636d2 1544
34c16486 1545 fhMCELambda0 [mcIndex]->Fill(energy, lambda0);
1546 fhMCELambda1 [mcIndex]->Fill(energy, lambda1);
1547 fhMCEDispersion [mcIndex]->Fill(energy, disp);
1548 fhMCNCellsE [mcIndex]->Fill(energy, ncells);
1549 fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction);
1550
764ab1f4 1551 if(!fFillOnlySimpleSSHisto)
34c16486 1552 {
764ab1f4 1553 if (energy < 2.)
1554 {
1555 fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction);
1556 fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction);
1557 }
1558 else if(energy < 6.)
1559 {
1560 fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction);
1561 fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction);
1562 }
1563 else
1564 {
1565 fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction);
1566 fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction);
1567 }
1568
1569 if(fCalorimeter == "EMCAL")
1570 {
1571 fhMCEDispEta [mcIndex]-> Fill(energy,dEta);
1572 fhMCEDispPhi [mcIndex]-> Fill(energy,dPhi);
1573 fhMCESumEtaPhi [mcIndex]-> Fill(energy,sEtaPhi);
1574 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy,dPhi-dEta);
85c4406e 1575 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
764ab1f4 1576
1577 Int_t ebin = -1;
1578 if (energy < 2 ) ebin = 0;
1579 else if (energy < 4 ) ebin = 1;
1580 else if (energy < 6 ) ebin = 2;
1581 else if (energy < 10) ebin = 3;
85c4406e 1582 else if (energy < 15) ebin = 4;
1583 else if (energy < 20) ebin = 5;
1584 else ebin = 6;
764ab1f4 1585
1586 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta ,dPhi);
1587 fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0,dEta);
85c4406e 1588 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);
764ab1f4 1589 }
34c16486 1590 }
521636d2 1591 }//MC data
1592
1593}
1594
4bfeae64 1595//__________________________________________________________________________
85c4406e 1596void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
22ad7981 1597 Int_t cut)
4bfeae64 1598{
1599 // If selected, fill histograms with residuals of matched clusters, help to define track matching cut
1600 // Residual filled for different cuts 0 (No cut), after 1 PID cut
85c4406e 1601
4bfeae64 1602 Float_t dZ = cluster->GetTrackDz();
1603 Float_t dR = cluster->GetTrackDx();
1604
1605 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1606 {
1607 dR = 2000., dZ = 2000.;
1608 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
85c4406e 1609 }
1610
b2e375c7 1611 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
1612
1613 Bool_t positive = kFALSE;
1614 if(track) positive = (track->Charge()>0);
1615
4bfeae64 1616 if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
1617 {
1618 fhTrackMatchedDEta[cut]->Fill(cluster->E(),dZ);
1619 fhTrackMatchedDPhi[cut]->Fill(cluster->E(),dR);
4bfeae64 1620 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ,dR);
b2e375c7 1621
1622 if(track)
1623 {
1624 if(positive)
1625 {
1626 fhTrackMatchedDEtaPos[cut]->Fill(cluster->E(),dZ);
1627 fhTrackMatchedDPhiPos[cut]->Fill(cluster->E(),dR);
1628 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiPos[cut]->Fill(dZ,dR);
1629 }
1630 else
1631 {
1632 fhTrackMatchedDEtaNeg[cut]->Fill(cluster->E(),dZ);
1633 fhTrackMatchedDPhiNeg[cut]->Fill(cluster->E(),dR);
1634 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiNeg[cut]->Fill(dZ,dR);
1635 }
1636 }
4bfeae64 1637
1638 Int_t nSMod = GetModuleNumber(cluster);
1639
1640 if(fCalorimeter=="EMCAL" && nSMod > 5)
1641 {
1642 fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(),dZ);
1643 fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(),dR);
1644 }
1645
1646 // Check dEdx and E/p of matched clusters
b2e375c7 1647
4bfeae64 1648 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
85c4406e 1649 {
85c4406e 1650 if(track)
4bfeae64 1651 {
4bfeae64 1652 Float_t dEdx = track->GetTPCsignal();
1653 Float_t eOverp = cluster->E()/track->P();
1654
1655 fhdEdx[cut] ->Fill(cluster->E(), dEdx);
1656 fhEOverP[cut]->Fill(cluster->E(), eOverp);
1657
1658 if(fCalorimeter=="EMCAL" && nSMod > 5)
1659 fhEOverPTRD[cut]->Fill(cluster->E(), eOverp);
1660
1661
1662 }
1663 else
85c4406e 1664 printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
4bfeae64 1665
1666
1667
1668 if(IsDataMC())
1669 {
1670
2644ead9 1671 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader());
4bfeae64 1672
1673 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1674 {
1675 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
85c4406e 1676 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
4bfeae64 1677 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5 );
1678 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5 );
1679 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5 );
1680
1681 // Check if several particles contributed to cluster and discard overlapped mesons
85c4406e 1682 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
34c16486 1683 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1684 {
4bfeae64 1685 if(cluster->GetNLabels()==1)
1686 {
1687 fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(),dZ);
1688 fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(),dR);
1689 }
85c4406e 1690 else
4bfeae64 1691 {
1692 fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(),dZ);
1693 fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(),dR);
1694 }
1695
1696 }// Check overlaps
1697
1698 }
1699 else
1700 {
1701 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
85c4406e 1702 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
4bfeae64 1703 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5 );
1704 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5 );
1705 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5 );
1706
1707 // Check if several particles contributed to cluster
85c4406e 1708 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
34c16486 1709 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1710 {
4bfeae64 1711 fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(),dZ);
1712 fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(),dR);
1713
85c4406e 1714 }// Check overlaps
4bfeae64 1715
1716 }
1717
85c4406e 1718 } // MC
4bfeae64 1719
1720 } // residuals window
1721
1722 } // Small residual
1723
1724}
1725
1726//___________________________________________
0c1383b5 1727TObjString * AliAnaPhoton::GetAnalysisCuts()
85c4406e 1728{
0c1383b5 1729 //Save parameters used for analysis
1730 TString parList ; //this will be list of parameters used for this analysis.
5ae09196 1731 const Int_t buffersize = 255;
1732 char onePar[buffersize] ;
0c1383b5 1733
5ae09196 1734 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
85c4406e 1735 parList+=onePar ;
5ae09196 1736 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
0c1383b5 1737 parList+=onePar ;
5ae09196 1738 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
0c1383b5 1739 parList+=onePar ;
5ae09196 1740 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
0c1383b5 1741 parList+=onePar ;
5ae09196 1742 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
0c1383b5 1743 parList+=onePar ;
5ae09196 1744 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
85c4406e 1745 parList+=onePar ;
0c1383b5 1746
1747 //Get parameters set in base class.
1748 parList += GetBaseParametersList() ;
1749
1750 //Get parameters set in PID class.
1751 parList += GetCaloPID()->GetPIDParametersList() ;
1752
1753 //Get parameters set in FiducialCut class (not available yet)
85c4406e 1754 //parlist += GetFidCut()->GetFidCutParametersList()
0c1383b5 1755
1756 return new TObjString(parList) ;
1757}
1758
1c5acb87 1759//________________________________________________________________________
1760TList * AliAnaPhoton::GetCreateOutputObjects()
c2a62a94 1761{
85c4406e 1762 // Create histograms to be saved in output file and
477d6cee 1763 // store them in outputContainer
85c4406e 1764 TList * outputContainer = new TList() ;
1765 outputContainer->SetName("PhotonHistos") ;
4a745797 1766
85c4406e 1767 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1768 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1769 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
745913ae 1770 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
85c4406e 1771 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1772 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1773
1774 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1775 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
09273901 1776 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
85c4406e 1777 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1778 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
09273901 1779 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1780
85c4406e 1781 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1782 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
31ae6d59 1783 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
85c4406e 1784 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1785 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
31ae6d59 1786 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
09273901 1787
d2655d46 1788 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1789
eb86112d 1790 Int_t nTrigBC = 1;
1791 Int_t iBCShift = 0;
1792 if(!GetReader()->AreBadTriggerEventsRemoved())
1793 {
1794 nTrigBC = 11;
1795 iBCShift = 5;
1796 }
1797
9e51e29a 1798 TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
85c4406e 1799 for (Int_t i = 0; i < 10 ; i++)
fc195fd0 1800 {
1801 fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
1802 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
85c4406e 1803 nptbins,ptmin,ptmax);
fc195fd0 1804 fhClusterCuts[i]->SetYTitle("dN/dE ");
1805 fhClusterCuts[i]->SetXTitle("E (GeV)");
85c4406e 1806 outputContainer->Add(fhClusterCuts[i]) ;
fc195fd0 1807 }
1808
6df33fcb 1809 fhEClusterSM = new TH2F("hEClusterSM","Raw clusters E and super-module number",
1810 nptbins,ptmin,ptmax,
1811 GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1812 fhEClusterSM->SetYTitle("SuperModule ");
1813 fhEClusterSM->SetXTitle("E (GeV)");
1814 outputContainer->Add(fhEClusterSM) ;
1815
1816 fhPtClusterSM = new TH2F("hPtClusterSM","Raw clusters p_{T} and super-module number",
1817 nptbins,ptmin,ptmax,
1818 GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1819 fhPtClusterSM->SetYTitle("SuperModule ");
1820 fhPtClusterSM->SetXTitle("E (GeV)");
1821 outputContainer->Add(fhPtClusterSM) ;
1822
1823 fhEPhotonSM = new TH2F("hEPhotonSM","Selected clusters E and super-module number",
1824 nptbins,ptmin,ptmax,
1825 GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1826 fhEPhotonSM->SetYTitle("SuperModule ");
1827 fhEPhotonSM->SetXTitle("E (GeV)");
1828 outputContainer->Add(fhEPhotonSM) ;
1829
1830 fhPtPhotonSM = new TH2F("hPtPhotonSM","Selected clusters p_{T} and super-module number",
1831 nptbins,ptmin,ptmax,
1832 GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
1833 fhPtPhotonSM->SetYTitle("SuperModule ");
1834 fhPtPhotonSM->SetXTitle("E (GeV)");
1835 outputContainer->Add(fhPtPhotonSM) ;
1836
85c4406e 1837 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
c4a7d28a 1838 fhNCellsE->SetXTitle("E (GeV)");
1839 fhNCellsE->SetYTitle("# of cells in cluster");
85c4406e 1840 outputContainer->Add(fhNCellsE);
f15c25da 1841
85c4406e 1842 fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
5c46c992 1843 fhCellsE->SetXTitle("E_{cluster} (GeV)");
1844 fhCellsE->SetYTitle("E_{cell} (GeV)");
85c4406e 1845 outputContainer->Add(fhCellsE);
5c46c992 1846
b2e375c7 1847 fhTimePt = new TH2F ("hTimePt","time of cluster vs pT of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1848 fhTimePt->SetXTitle("p_{T} (GeV/c)");
1849 fhTimePt->SetYTitle("time (ns)");
1850 outputContainer->Add(fhTimePt);
6175da48 1851
f66d95af 1852 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
85c4406e 1853 nptbins,ptmin,ptmax, 500,0,1.);
f66d95af 1854 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1855 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
85c4406e 1856 outputContainer->Add(fhMaxCellDiffClusterE);
f66d95af 1857
85c4406e 1858 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
20218aea 1859 fhEPhoton->SetYTitle("N");
1860 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
85c4406e 1861 outputContainer->Add(fhEPhoton) ;
20218aea 1862
85c4406e 1863 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
477d6cee 1864 fhPtPhoton->SetYTitle("N");
1865 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
85c4406e 1866 outputContainer->Add(fhPtPhoton) ;
1867
c8710850 1868 fhPtCentralityPhoton = new TH2F("hPtCentralityPhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
1869 fhPtCentralityPhoton->SetYTitle("Centrality");
1870 fhPtCentralityPhoton->SetXTitle("p_{T}(GeV/c)");
1871 outputContainer->Add(fhPtCentralityPhoton) ;
1872
1873 fhPtEventPlanePhoton = new TH2F("hPtEventPlanePhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1874 fhPtEventPlanePhoton->SetYTitle("Event plane angle (rad)");
1875 fhPtEventPlanePhoton->SetXTitle("p_{T} (GeV/c)");
1876 outputContainer->Add(fhPtEventPlanePhoton) ;
85c4406e 1877
c2a62a94 1878 fhEtaPhi = new TH2F
1879 ("hEtaPhi","cluster,E > 0.5 GeV, #eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1880 fhEtaPhi->SetYTitle("#phi (rad)");
1881 fhEtaPhi->SetXTitle("#eta");
1882 outputContainer->Add(fhEtaPhi) ;
85c4406e 1883
c2a62a94 1884 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
1885 {
1886 fhEtaPhiEMCALBC0 = new TH2F
1887 ("hEtaPhiEMCALBC0","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
1888 fhEtaPhiEMCALBC0->SetYTitle("#phi (rad)");
1889 fhEtaPhiEMCALBC0->SetXTitle("#eta");
1890 outputContainer->Add(fhEtaPhiEMCALBC0) ;
1891
1892 fhEtaPhiEMCALBC1 = new TH2F
1893 ("hEtaPhiEMCALBC1","cluster,E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
1894 fhEtaPhiEMCALBC1->SetYTitle("#phi (rad)");
1895 fhEtaPhiEMCALBC1->SetXTitle("#eta");
1896 outputContainer->Add(fhEtaPhiEMCALBC1) ;
1897
1898 fhEtaPhiEMCALBCN = new TH2F
1899 ("hEtaPhiEMCALBCN","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
1900 fhEtaPhiEMCALBCN->SetYTitle("#phi (rad)");
1901 fhEtaPhiEMCALBCN->SetXTitle("#eta");
1902 outputContainer->Add(fhEtaPhiEMCALBCN) ;
1903
eb86112d 1904 for(Int_t i = 0; i < nTrigBC; i++)
c2a62a94 1905 {
1906 fhEtaPhiTriggerEMCALBC[i] = new TH2F
eb86112d 1907 (Form("hEtaPhiTriggerEMCALBC%d",i-iBCShift),
1908 Form("cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 1909 netabins,etamin,etamax,nphibins,phimin,phimax);
1910 fhEtaPhiTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
1911 fhEtaPhiTriggerEMCALBC[i]->SetXTitle("#eta");
1912 outputContainer->Add(fhEtaPhiTriggerEMCALBC[i]) ;
1913
1914 fhTimeTriggerEMCALBC[i] = new TH2F
eb86112d 1915 (Form("hTimeTriggerEMCALBC%d",i-iBCShift),
1916 Form("cluster time vs E of clusters, Trigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 1917 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1918 fhTimeTriggerEMCALBC[i]->SetXTitle("E (GeV)");
1919 fhTimeTriggerEMCALBC[i]->SetYTitle("time (ns)");
1920 outputContainer->Add(fhTimeTriggerEMCALBC[i]);
1921
1922 fhTimeTriggerEMCALBCPileUpSPD[i] = new TH2F
eb86112d 1923 (Form("hTimeTriggerEMCALBC%dPileUpSPD",i-iBCShift),
1924 Form("cluster time vs E of clusters, Trigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 1925 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1926 fhTimeTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
1927 fhTimeTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
1928 outputContainer->Add(fhTimeTriggerEMCALBCPileUpSPD[i]);
afb3af8a 1929
1930 fhEtaPhiTriggerEMCALBCUM[i] = new TH2F
eb86112d 1931 (Form("hEtaPhiTriggerEMCALBC%d_UnMatch",i-iBCShift),
1932 Form("cluster E > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 1933 netabins,etamin,etamax,nphibins,phimin,phimax);
1934 fhEtaPhiTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
1935 fhEtaPhiTriggerEMCALBCUM[i]->SetXTitle("#eta");
1936 outputContainer->Add(fhEtaPhiTriggerEMCALBCUM[i]) ;
1937
1938 fhTimeTriggerEMCALBCUM[i] = new TH2F
eb86112d 1939 (Form("hTimeTriggerEMCALBC%d_UnMatch",i-iBCShift),
1940 Form("cluster time vs E of clusters, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 1941 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1942 fhTimeTriggerEMCALBCUM[i]->SetXTitle("E (GeV)");
1943 fhTimeTriggerEMCALBCUM[i]->SetYTitle("time (ns)");
1944 outputContainer->Add(fhTimeTriggerEMCALBCUM[i]);
1945
1946 fhEtaPhiTriggerEMCALBCCluster[i] = new TH2F
eb86112d 1947 (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger",i-iBCShift),
1948 Form("trigger cluster, #eta vs #phi, Trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 1949 netabins,etamin,etamax,nphibins,phimin,phimax);
1950 fhEtaPhiTriggerEMCALBCCluster[i]->SetYTitle("#phi (rad)");
1951 fhEtaPhiTriggerEMCALBCCluster[i]->SetXTitle("#eta");
1952 outputContainer->Add(fhEtaPhiTriggerEMCALBCCluster[i]) ;
126b8c62 1953
afb3af8a 1954 fhEtaPhiTriggerEMCALBCUMCluster[i] = new TH2F
eb86112d 1955 (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger_UnMatch",i-iBCShift),
1956 Form("trigger cluster, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 1957 netabins,etamin,etamax,nphibins,phimin,phimax);
1958 fhEtaPhiTriggerEMCALBCUMCluster[i]->SetYTitle("#phi (rad)");
1959 fhEtaPhiTriggerEMCALBCUMCluster[i]->SetXTitle("#eta");
1960 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMCluster[i]) ;
c2a62a94 1961 }
afb3af8a 1962
126b8c62 1963 fhTimeTriggerEMCALBCCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger",
1964 "trigger cluster time vs E of clusters",
1965 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1966 fhTimeTriggerEMCALBCCluster->SetXTitle("E (GeV)");
1967 fhTimeTriggerEMCALBCCluster->SetYTitle("time (ns)");
1968 outputContainer->Add(fhTimeTriggerEMCALBCCluster);
1969
1970 fhTimeTriggerEMCALBCUMCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger_UnMatch",
1971 "trigger cluster time vs E of clusters, unmatched trigger",
1972 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1973 fhTimeTriggerEMCALBCUMCluster->SetXTitle("E (GeV)");
1974 fhTimeTriggerEMCALBCUMCluster->SetYTitle("time (ns)");
1975 outputContainer->Add(fhTimeTriggerEMCALBCUMCluster);
1976
afb3af8a 1977 fhEtaPhiTriggerEMCALBCClusterOverTh = new TH2F
1978 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold",
1979 "trigger cluster E > trigger threshold, #eta vs #phi, Trigger EMCAL-BC=0",
1980 netabins,etamin,etamax,nphibins,phimin,phimax);
1981 fhEtaPhiTriggerEMCALBCClusterOverTh->SetYTitle("#phi (rad)");
1982 fhEtaPhiTriggerEMCALBCClusterOverTh->SetXTitle("#eta");
1983 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterOverTh) ;
85c4406e 1984
afb3af8a 1985 fhEtaPhiTriggerEMCALBCUMClusterOverTh = new TH2F
1986 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold_UnMatch",
1987 "trigger cluster E > trigger threshold, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1988 netabins,etamin,etamax,nphibins,phimin,phimax);
1989 fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetYTitle("#phi (rad)");
1990 fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetXTitle("#eta");
1991 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterOverTh) ;
85c4406e 1992
afb3af8a 1993 fhEtaPhiTriggerEMCALBCClusterBelowTh1 = new TH2F
1994 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1",
1995 "trigger cluster thresh-1 < E < thres, #eta vs #phi, Trigger EMCAL-BC=0",
1996 netabins,etamin,etamax,nphibins,phimin,phimax);
1997 fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetYTitle("#phi (rad)");
1998 fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetXTitle("#eta");
1999 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh1) ;
2000
2001 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1 = new TH2F
2002 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1_UnMatch",
2003 "trigger cluster thresh-1 < E < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
2004 netabins,etamin,etamax,nphibins,phimin,phimax);
2005 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetYTitle("#phi (rad)");
2006 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetXTitle("#eta");
2007 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh1) ;
85c4406e 2008
afb3af8a 2009 fhEtaPhiTriggerEMCALBCClusterBelowTh2 = new TH2F
2010 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2",
2011 "trigger cluster thresh-2 < E < thres, #eta vs #phi, Trigger EMCAL-BC=0",
2012 netabins,etamin,etamax,nphibins,phimin,phimax);
2013 fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetYTitle("#phi (rad)");
2014 fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetXTitle("#eta");
2015 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh2) ;
2016
2017 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2 = new TH2F
2018 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2_UnMatch",
2019 "trigger cluster thresh-2 < E < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
2020 netabins,etamin,etamax,nphibins,phimin,phimax);
2021 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetYTitle("#phi (rad)");
2022 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetXTitle("#eta");
2023 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh2) ;
85c4406e 2024
eb86112d 2025 if(!GetReader()->AreBadTriggerEventsRemoved())
2026 {
2027 fhEtaPhiTriggerEMCALBCExotic = new TH2F
2028 ("hEtaPhiTriggerExotic",
2029 "cluster E > 2 GeV, #eta vs #phi, Trigger Exotic",
2030 netabins,etamin,etamax,nphibins,phimin,phimax);
2031 fhEtaPhiTriggerEMCALBCExotic->SetYTitle("#phi (rad)");
2032 fhEtaPhiTriggerEMCALBCExotic->SetXTitle("#eta");
2033 outputContainer->Add(fhEtaPhiTriggerEMCALBCExotic) ;
2034
2035 fhTimeTriggerEMCALBCExotic = new TH2F
2036 ("hTimeTriggerExotic",
2037 "cluster time vs E of clusters, Trigger Exotic ",
2038 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2039 fhTimeTriggerEMCALBCExotic->SetXTitle("E (GeV)");
2040 fhTimeTriggerEMCALBCExotic->SetYTitle("time (ns)");
2041 outputContainer->Add(fhTimeTriggerEMCALBCExotic);
2042
2043 fhEtaPhiTriggerEMCALBCUMExotic = new TH2F
2044 ("hEtaPhiTriggerExotic_UnMatch",
2045 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
2046 netabins,etamin,etamax,nphibins,phimin,phimax);
2047 fhEtaPhiTriggerEMCALBCUMExotic->SetYTitle("#phi (rad)");
2048 fhEtaPhiTriggerEMCALBCUMExotic->SetXTitle("#eta");
2049 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExotic) ;
2050
2051 fhTimeTriggerEMCALBCUMExotic = new TH2F
2052 ("hTimeTriggerExotic_UnMatch",
2053 "cluster time vs E of clusters, unmatched trigger Exotic",
2054 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2055 fhTimeTriggerEMCALBCUMExotic->SetXTitle("E (GeV)");
2056 fhTimeTriggerEMCALBCUMExotic->SetYTitle("time (ns)");
2057 outputContainer->Add(fhTimeTriggerEMCALBCUMExotic);
2058
2059 fhEtaPhiTriggerEMCALBCExoticCluster = new TH2F
2060 ("hEtaPhiTriggerExotic_OnlyTrigger",
2061 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Exotic",
2062 netabins,etamin,etamax,nphibins,phimin,phimax);
2063 fhEtaPhiTriggerEMCALBCExoticCluster->SetYTitle("#phi (rad)");
2064 fhEtaPhiTriggerEMCALBCExoticCluster->SetXTitle("#eta");
2065 outputContainer->Add(fhEtaPhiTriggerEMCALBCExoticCluster) ;
2066
2067 fhTimeTriggerEMCALBCExoticCluster = new TH2F
2068 ("hTimeTriggerExotic_OnlyTrigger",
2069 "trigger cluster time vs E of clusters, Trigger Exotic",
2070 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2071 fhTimeTriggerEMCALBCExoticCluster->SetXTitle("E (GeV)");
2072 fhTimeTriggerEMCALBCExoticCluster->SetYTitle("time (ns)");
2073 outputContainer->Add(fhTimeTriggerEMCALBCExoticCluster);
2074
2075 fhEtaPhiTriggerEMCALBCUMExoticCluster = new TH2F
2076 ("hEtaPhiTriggerExotic_OnlyTrigger_UnMatch",
2077 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
2078 netabins,etamin,etamax,nphibins,phimin,phimax);
2079 fhEtaPhiTriggerEMCALBCUMExoticCluster->SetYTitle("#phi (rad)");
2080 fhEtaPhiTriggerEMCALBCUMExoticCluster->SetXTitle("#eta");
2081 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExoticCluster) ;
2082
2083 fhTimeTriggerEMCALBCUMExoticCluster = new TH2F
2084 ("hTimeTriggerExotic_OnlyTrigger_UnMatch",
2085 "trigger cluster time vs E of clusters, unmatched trigger Exotic",
2086 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2087 fhTimeTriggerEMCALBCUMExoticCluster->SetXTitle("E (GeV)");
2088 fhTimeTriggerEMCALBCUMExoticCluster->SetYTitle("time (ns)");
2089 outputContainer->Add(fhTimeTriggerEMCALBCUMExoticCluster);
2090
2091 fhEtaPhiTriggerEMCALBCBad = new TH2F
2092 ("hEtaPhiTriggerBad",
2093 "cluster E > 2 GeV, #eta vs #phi, Trigger Bad",
2094 netabins,etamin,etamax,nphibins,phimin,phimax);
2095 fhEtaPhiTriggerEMCALBCBad->SetYTitle("#phi (rad)");
2096 fhEtaPhiTriggerEMCALBCBad->SetXTitle("#eta");
2097 outputContainer->Add(fhEtaPhiTriggerEMCALBCBad) ;
2098
2099 fhTimeTriggerEMCALBCBad = new TH2F
2100 ("hTimeTriggerBad",
2101 "cluster time vs E of clusters, Trigger Bad ",
2102 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2103 fhTimeTriggerEMCALBCBad->SetXTitle("E (GeV)");
2104 fhTimeTriggerEMCALBCBad->SetYTitle("time (ns)");
2105 outputContainer->Add(fhTimeTriggerEMCALBCBad);
2106
2107 fhEtaPhiTriggerEMCALBCUMBad = new TH2F
2108 ("hEtaPhiTriggerBad_UnMatch",
2109 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad",
2110 netabins,etamin,etamax,nphibins,phimin,phimax);
2111 fhEtaPhiTriggerEMCALBCUMBad->SetYTitle("#phi (rad)");
2112 fhEtaPhiTriggerEMCALBCUMBad->SetXTitle("#eta");
2113 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBad) ;
2114
2115 fhTimeTriggerEMCALBCUMBad = new TH2F
2116 ("hTimeTriggerBad_UnMatch",
2117 "cluster time vs E of clusters, unmatched trigger Bad",
2118 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2119 fhTimeTriggerEMCALBCUMBad->SetXTitle("E (GeV)");
2120 fhTimeTriggerEMCALBCUMBad->SetYTitle("time (ns)");
2121 outputContainer->Add(fhTimeTriggerEMCALBCUMBad);
2122
2123 fhEtaPhiTriggerEMCALBCBadCluster = new TH2F
2124 ("hEtaPhiTriggerBad_OnlyTrigger",
2125 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Bad",
2126 netabins,etamin,etamax,nphibins,phimin,phimax);
2127 fhEtaPhiTriggerEMCALBCBadCluster->SetYTitle("#phi (rad)");
2128 fhEtaPhiTriggerEMCALBCBadCluster->SetXTitle("#eta");
2129 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadCluster) ;
2130
2131 fhTimeTriggerEMCALBCBadCluster = new TH2F
2132 ("hTimeTriggerBad_OnlyTrigger",
2133 "trigger cluster time vs E of clusters, Trigger Bad",
2134 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2135 fhTimeTriggerEMCALBCBadCluster->SetXTitle("E (GeV)");
2136 fhTimeTriggerEMCALBCBadCluster->SetYTitle("time (ns)");
2137 outputContainer->Add(fhTimeTriggerEMCALBCBadCluster);
2138
2139 fhEtaPhiTriggerEMCALBCUMBadCluster = new TH2F
2140 ("hEtaPhiTriggerBad_OnlyTrigger_UnMatch",
2141 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad",
2142 netabins,etamin,etamax,nphibins,phimin,phimax);
2143 fhEtaPhiTriggerEMCALBCUMBadCluster->SetYTitle("#phi (rad)");
2144 fhEtaPhiTriggerEMCALBCUMBadCluster->SetXTitle("#eta");
2145 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadCluster) ;
2146
2147 fhTimeTriggerEMCALBCUMBadCluster = new TH2F
2148 ("hTimeTriggerBad_OnlyTrigger_UnMatch",
2149 "trigger cluster time vs E of clusters, unmatched trigger Bad",
2150 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2151 fhTimeTriggerEMCALBCUMBadCluster->SetXTitle("E (GeV)");
2152 fhTimeTriggerEMCALBCUMBadCluster->SetYTitle("time (ns)");
2153 outputContainer->Add(fhTimeTriggerEMCALBCUMBadCluster);
2154
2155 fhEtaPhiTriggerEMCALBCBadExotic = new TH2F
2156 ("hEtaPhiTriggerBadExotic",
2157 "cluster E > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
2158 netabins,etamin,etamax,nphibins,phimin,phimax);
2159 fhEtaPhiTriggerEMCALBCBadExotic->SetYTitle("#phi (rad)");
2160 fhEtaPhiTriggerEMCALBCBadExotic->SetXTitle("#eta");
2161 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExotic) ;
2162
2163 fhTimeTriggerEMCALBCBadExotic = new TH2F
2164 ("hTimeTriggerBadExotic",
2165 "cluster time vs E of clusters, Trigger Bad&Exotic ",
2166 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2167 fhTimeTriggerEMCALBCBadExotic->SetXTitle("E (GeV)");
2168 fhTimeTriggerEMCALBCBadExotic->SetYTitle("time (ns)");
2169 outputContainer->Add(fhTimeTriggerEMCALBCBadExotic);
2170
2171 fhEtaPhiTriggerEMCALBCUMBadExotic = new TH2F
2172 ("hEtaPhiTriggerBadExotic_UnMatch",
2173 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
2174 netabins,etamin,etamax,nphibins,phimin,phimax);
2175 fhEtaPhiTriggerEMCALBCUMBadExotic->SetYTitle("#phi (rad)");
2176 fhEtaPhiTriggerEMCALBCUMBadExotic->SetXTitle("#eta");
2177 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExotic) ;
2178
2179 fhTimeTriggerEMCALBCUMBadExotic = new TH2F
2180 ("hTimeTriggerBadExotic_UnMatch",
2181 "cluster time vs E of clusters, unmatched trigger Bad&Exotic",
2182 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2183 fhTimeTriggerEMCALBCUMBadExotic->SetXTitle("E (GeV)");
2184 fhTimeTriggerEMCALBCUMBadExotic->SetYTitle("time (ns)");
2185 outputContainer->Add(fhTimeTriggerEMCALBCUMBadExotic);
2186
2187 fhEtaPhiTriggerEMCALBCBadExoticCluster = new TH2F
2188 ("hEtaPhiTriggerBadExotic_OnlyTrigger",
2189 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
2190 netabins,etamin,etamax,nphibins,phimin,phimax);
2191 fhEtaPhiTriggerEMCALBCBadExoticCluster->SetYTitle("#phi (rad)");
2192 fhEtaPhiTriggerEMCALBCBadExoticCluster->SetXTitle("#eta");
2193 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExoticCluster) ;
2194
2195 fhTimeTriggerEMCALBCBadExoticCluster = new TH2F
2196 ("hTimeTriggerBadExotic_OnlyTrigger",
2197 "trigger cluster time vs E of clusters, Trigger Bad&Exotic",
2198 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2199 fhTimeTriggerEMCALBCBadExoticCluster->SetXTitle("E (GeV)");
2200 fhTimeTriggerEMCALBCBadExoticCluster->SetYTitle("time (ns)");
2201 outputContainer->Add(fhTimeTriggerEMCALBCBadExoticCluster);
2202
2203 fhEtaPhiTriggerEMCALBCUMBadExoticCluster = new TH2F
2204 ("hEtaPhiTriggerBadExotic_OnlyTrigger_UnMatch",
2205 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
2206 netabins,etamin,etamax,nphibins,phimin,phimax);
2207 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetYTitle("#phi (rad)");
2208 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetXTitle("#eta");
2209 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExoticCluster) ;
2210
2211 fhTimeTriggerEMCALBCUMBadExoticCluster = new TH2F
2212 ("hTimeTriggerBadExotic_OnlyTrigger_UnMatch",
2213 "trigger cluster time vs E of clusters, unmatched trigger Bad&Exotic",
2214 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2215 fhTimeTriggerEMCALBCUMBadExoticCluster->SetXTitle("E (GeV)");
2216 fhTimeTriggerEMCALBCUMBadExoticCluster->SetYTitle("time (ns)");
2217 outputContainer->Add(fhTimeTriggerEMCALBCUMBadExoticCluster);
2218
2219 fhTimeTriggerEMCALBCBadMaxCell = new TH2F
2220 ("hTimeTriggerBadMaxCell",
2221 "cluster time vs E of clusters, Trigger BadMaxCell",
2222 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2223 fhTimeTriggerEMCALBCBadMaxCell->SetXTitle("E (GeV)");
2224 fhTimeTriggerEMCALBCBadMaxCell->SetYTitle("time (ns)");
2225 outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCell);
2226
2227 fhTimeTriggerEMCALBCUMBadMaxCell = new TH2F
2228 ("hTimeTriggerBadMaxCell_UnMatch",
2229 "cluster time vs E of clusters, unmatched trigger BadMaxCell",
2230 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2231 fhTimeTriggerEMCALBCUMBadMaxCell->SetXTitle("E (GeV)");
2232 fhTimeTriggerEMCALBCUMBadMaxCell->SetYTitle("time (ns)");
2233 outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCell);
2234
2235
2236 fhTimeTriggerEMCALBCBadMaxCellExotic = new TH2F
2237 ("hTimeTriggerBadMaxCellExotic",
2238 "cluster time vs E of clusters, Trigger BadMaxCell&Exotic",
2239 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2240 fhTimeTriggerEMCALBCBadMaxCellExotic->SetXTitle("E (GeV)");
2241 fhTimeTriggerEMCALBCBadMaxCellExotic->SetYTitle("time (ns)");
2242 outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCellExotic);
2243
2244 fhTimeTriggerEMCALBCUMBadMaxCellExotic = new TH2F
2245 ("hTimeTriggerBadMaxCellExotic_UnMatch",
2246 "cluster time vs E of clusters, unmatched trigger BadMaxCell&Exotic",
2247 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2248 fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetXTitle("E (GeV)");
2249 fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetYTitle("time (ns)");
2250 outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCellExotic);
2251
2252 fhTimeNoTrigger = new TH2F
2253 ("hTimeNoTrigger",
2254 "events with no foundable trigger, time vs e of clusters",
2255 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2256 fhTimeNoTrigger->SetXTitle("E (GeV)");
2257 fhTimeNoTrigger->SetYTitle("time (ns)");
2258 outputContainer->Add(fhTimeNoTrigger);
2259
2260 fhEtaPhiNoTrigger = new TH2F
2261 ("hEtaPhiNoTrigger",
2262 "events with no foundable trigger, eta vs phi of clusters",
2263 netabins,etamin,etamax,nphibins,phimin,phimax);
2264 fhEtaPhiNoTrigger->SetYTitle("#phi (rad)");
2265 fhEtaPhiNoTrigger->SetXTitle("#eta");
2266 outputContainer->Add(fhEtaPhiNoTrigger) ;
2267 }
85c4406e 2268
126b8c62 2269 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_OpenTime",
85c4406e 2270 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time",
2271 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2272 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("#phi (rad)");
2273 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("#eta");
2274 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster) ;
85c4406e 2275
126b8c62 2276 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_OpenTime",
85c4406e 2277 "cluster time vs E of clusters, no match, rematch open time",
2278 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2279 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("E (GeV)");
2280 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("time (ns)");
2281 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster);
85c4406e 2282
2283
126b8c62 2284 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
85c4406e 2285 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch with neighbour patches",
2286 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2287 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("#phi (rad)");
2288 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("#eta");
2289 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster) ;
85c4406e 2290
126b8c62 2291 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
85c4406e 2292 "cluster time vs E of clusters, no match, rematch with neigbour parches",
2293 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2294 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("E (GeV)");
2295 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("time (ns)");
2296 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster);
85c4406e 2297
126b8c62 2298 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_Both",
85c4406e 2299 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time and neighbour",
2300 netabins,etamin,etamax,nphibins,phimin,phimax);
126b8c62 2301 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetYTitle("#phi (rad)");
2302 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetXTitle("#eta");
2303 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchBothCluster) ;
85c4406e 2304
126b8c62 2305 fhTimeTriggerEMCALBCUMReMatchBothCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_Both",
85c4406e 2306 "cluster time vs E of clusters, no match, rematch open time and neigbour",
2307 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
126b8c62 2308 fhTimeTriggerEMCALBCUMReMatchBothCluster->SetXTitle("E (GeV)");
2309 fhTimeTriggerEMCALBCUMReMatchBothCluster->SetYTitle("time (ns)");
2310 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchBothCluster);
2311
2312 fhTimeTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_OpenTime",
2313 "cluster time vs E of clusters, no match, rematch open time",
2314 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2315 fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("E (GeV)");
2316 fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("time (ns)");
2317 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchOpenTime);
2318
2319
2320 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
2321 "cluster time vs E of clusters, no match, rematch with neigbour parches",
2322 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2323 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("E (GeV)");
2324 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("time (ns)");
2325 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchCheckNeigh);
2326
2327 fhTimeTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_Both",
2328 "cluster time vs E of clusters, no match, rematch open time and neigbour",
2329 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2330 fhTimeTriggerEMCALBC0UMReMatchBoth->SetXTitle("E (GeV)");
2331 fhTimeTriggerEMCALBC0UMReMatchBoth->SetYTitle("time (ns)");
2332 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchBoth);
85c4406e 2333
c2a62a94 2334 }
2335
477d6cee 2336 fhPhiPhoton = new TH2F
85c4406e 2337 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
6175da48 2338 fhPhiPhoton->SetYTitle("#phi (rad)");
477d6cee 2339 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
85c4406e 2340 outputContainer->Add(fhPhiPhoton) ;
477d6cee 2341
2342 fhEtaPhoton = new TH2F
85c4406e 2343 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
477d6cee 2344 fhEtaPhoton->SetYTitle("#eta");
2345 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
2346 outputContainer->Add(fhEtaPhoton) ;
2347
6175da48 2348 fhEtaPhiPhoton = new TH2F
85c4406e 2349 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
6175da48 2350 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
2351 fhEtaPhiPhoton->SetXTitle("#eta");
2352 outputContainer->Add(fhEtaPhiPhoton) ;
34c16486 2353 if(GetMinPt() < 0.5)
2354 {
20218aea 2355 fhEtaPhi05Photon = new TH2F
74e3eb22 2356 ("hEtaPhi05Photon","#eta vs #phi, E < 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
20218aea 2357 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
2358 fhEtaPhi05Photon->SetXTitle("#eta");
2359 outputContainer->Add(fhEtaPhi05Photon) ;
2360 }
85c4406e 2361
c2a62a94 2362 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
2363 {
2364 fhEtaPhiPhotonEMCALBC0 = new TH2F
ba490f85 2365 ("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 2366 fhEtaPhiPhotonEMCALBC0->SetYTitle("#phi (rad)");
2367 fhEtaPhiPhotonEMCALBC0->SetXTitle("#eta");
2368 outputContainer->Add(fhEtaPhiPhotonEMCALBC0) ;
2369
2370 fhEtaPhiPhotonEMCALBC1 = new TH2F
ba490f85 2371 ("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 2372 fhEtaPhiPhotonEMCALBC1->SetYTitle("#phi (rad)");
2373 fhEtaPhiPhotonEMCALBC1->SetXTitle("#eta");
2374 outputContainer->Add(fhEtaPhiPhotonEMCALBC1) ;
2375
2376 fhEtaPhiPhotonEMCALBCN = new TH2F
ba490f85 2377 ("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 2378 fhEtaPhiPhotonEMCALBCN->SetYTitle("#phi (rad)");
2379 fhEtaPhiPhotonEMCALBCN->SetXTitle("#eta");
2380 outputContainer->Add(fhEtaPhiPhotonEMCALBCN) ;
2381
eb86112d 2382 for(Int_t i = 0; i < nTrigBC; i++)
c2a62a94 2383 {
2384 fhEtaPhiPhotonTriggerEMCALBC[i] = new TH2F
eb86112d 2385 (Form("hEtaPhiPhotonTriggerEMCALBC%d",i-iBCShift),
2386 Form("photon E > 2 GeV, #eta vs #phi, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 2387 netabins,etamin,etamax,nphibins,phimin,phimax);
2388 fhEtaPhiPhotonTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
2389 fhEtaPhiPhotonTriggerEMCALBC[i]->SetXTitle("#eta");
2390 outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBC[i]) ;
2391
2392 fhTimePhotonTriggerEMCALBC[i] = new TH2F
eb86112d 2393 (Form("hTimePhotonTriggerEMCALBC%d",i-iBCShift),
2394 Form("photon time vs E of clusters, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 2395 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2396 fhTimePhotonTriggerEMCALBC[i]->SetXTitle("E (GeV)");
2397 fhTimePhotonTriggerEMCALBC[i]->SetYTitle("time (ns)");
2398 outputContainer->Add(fhTimePhotonTriggerEMCALBC[i]);
2399
2400 fhTimePhotonTriggerEMCALBCPileUpSPD[i] = new TH2F
eb86112d 2401 (Form("hTimePhotonTriggerEMCALBC%dPileUpSPD",i-iBCShift),
2402 Form("photon time vs E, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
c2a62a94 2403 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2404 fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
2405 fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
2406 outputContainer->Add(fhTimePhotonTriggerEMCALBCPileUpSPD[i]);
2407
afb3af8a 2408 fhEtaPhiPhotonTriggerEMCALBCUM[i] = new TH2F
eb86112d 2409 (Form("hEtaPhiPhotonTriggerEMCALBC%d_UnMatch",i-iBCShift),
2410 Form("photon E > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 2411 netabins,etamin,etamax,nphibins,phimin,phimax);
2412 fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
2413 fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetXTitle("#eta");
2414 outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBCUM[i]) ;
2415
2416 fhTimePhotonTriggerEMCALBCUM[i] = new TH2F
eb86112d 2417 (Form("hTimePhotonTriggerEMCALBC%d_UnMatch",i-iBCShift),
2418 Form("photon time vs E, unmatched trigger EMCAL-BC=%d",i-iBCShift),
afb3af8a 2419 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2420 fhTimePhotonTriggerEMCALBCUM[i]->SetXTitle("E (GeV)");
2421 fhTimePhotonTriggerEMCALBCUM[i]->SetYTitle("time (ns)");
2422 outputContainer->Add(fhTimePhotonTriggerEMCALBCUM[i]);
2423
c2a62a94 2424 }
126b8c62 2425
2426 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_OpenTime",
2427 "cluster time vs E of photons, no match, rematch open time",
2428 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2429 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("E (GeV)");
2430 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("time (ns)");
2431 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime);
2432
2433
2434 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
2435 "cluster time vs E of photons, no match, rematch with neigbour parches",
2436 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2437 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("E (GeV)");
2438 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("time (ns)");
2439 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh);
2440
2441 fhTimePhotonTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_Both",
2442 "cluster time vs E of photons, no match, rematch open time and neigbour",
2443 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2444 fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetXTitle("E (GeV)");
2445 fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetYTitle("time (ns)");
2446 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchBoth);
2447
c2a62a94 2448 }
6175da48 2449
9e51e29a 2450 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
85c4406e 2451 nptbins,ptmin,ptmax,10,0,10);
9e51e29a 2452 fhNLocMax ->SetYTitle("N maxima");
2453 fhNLocMax ->SetXTitle("E (GeV)");
85c4406e 2454 outputContainer->Add(fhNLocMax) ;
9e51e29a 2455
521636d2 2456 //Shower shape
34c16486 2457 if(fFillSSHistograms)
2458 {
85c4406e 2459 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2460 fhLam0E->SetYTitle("#lambda_{0}^{2}");
2461 fhLam0E->SetXTitle("E (GeV)");
85c4406e 2462 outputContainer->Add(fhLam0E);
521636d2 2463
85c4406e 2464 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2465 fhLam1E->SetYTitle("#lambda_{1}^{2}");
2466 fhLam1E->SetXTitle("E (GeV)");
85c4406e 2467 outputContainer->Add(fhLam1E);
521636d2 2468
85c4406e 2469 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2470 fhDispE->SetYTitle("D^{2}");
2471 fhDispE->SetXTitle("E (GeV) ");
2472 outputContainer->Add(fhDispE);
85c4406e 2473
b5dbb99b 2474 if(!fRejectTrackMatch)
2475 {
85c4406e 2476 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 2477 fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
2478 fhLam0ETM->SetXTitle("E (GeV)");
85c4406e 2479 outputContainer->Add(fhLam0ETM);
b5dbb99b 2480
85c4406e 2481 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 2482 fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
2483 fhLam1ETM->SetXTitle("E (GeV)");
85c4406e 2484 outputContainer->Add(fhLam1ETM);
b5dbb99b 2485
85c4406e 2486 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 2487 fhDispETM->SetYTitle("D^{2}");
2488 fhDispETM->SetXTitle("E (GeV) ");
2489 outputContainer->Add(fhDispETM);
2490 }
521636d2 2491
b5dbb99b 2492 if(fCalorimeter == "EMCAL")
2493 {
85c4406e 2494 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2495 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
2496 fhLam0ETRD->SetXTitle("E (GeV)");
85c4406e 2497 outputContainer->Add(fhLam0ETRD);
521636d2 2498
85c4406e 2499 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2500 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
2501 fhLam1ETRD->SetXTitle("E (GeV)");
85c4406e 2502 outputContainer->Add(fhLam1ETRD);
521636d2 2503
85c4406e 2504 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 2505 fhDispETRD->SetYTitle("Dispersion^{2}");
2506 fhDispETRD->SetXTitle("E (GeV) ");
b5dbb99b 2507 outputContainer->Add(fhDispETRD);
2508
2509 if(!fRejectTrackMatch)
2510 {
85c4406e 2511 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 2512 fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
2513 fhLam0ETMTRD->SetXTitle("E (GeV)");
85c4406e 2514 outputContainer->Add(fhLam0ETMTRD);
b5dbb99b 2515
85c4406e 2516 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 2517 fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
2518 fhLam1ETMTRD->SetXTitle("E (GeV)");
85c4406e 2519 outputContainer->Add(fhLam1ETMTRD);
b5dbb99b 2520
85c4406e 2521 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 2522 fhDispETMTRD->SetYTitle("Dispersion^{2}");
2523 fhDispETMTRD->SetXTitle("E (GeV) ");
85c4406e 2524 outputContainer->Add(fhDispETMTRD);
2525 }
2526 }
521636d2 2527
764ab1f4 2528 if(!fFillOnlySimpleSSHisto)
34c16486 2529 {
85c4406e 2530 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2531 fhNCellsLam0LowE->SetXTitle("N_{cells}");
2532 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2533 outputContainer->Add(fhNCellsLam0LowE);
764ab1f4 2534
85c4406e 2535 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2536 fhNCellsLam0HighE->SetXTitle("N_{cells}");
2537 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2538 outputContainer->Add(fhNCellsLam0HighE);
764ab1f4 2539
85c4406e 2540 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2541 fhNCellsLam1LowE->SetXTitle("N_{cells}");
2542 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2543 outputContainer->Add(fhNCellsLam1LowE);
764ab1f4 2544
85c4406e 2545 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2546 fhNCellsLam1HighE->SetXTitle("N_{cells}");
2547 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
85c4406e 2548 outputContainer->Add(fhNCellsLam1HighE);
764ab1f4 2549
85c4406e 2550 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2551 fhNCellsDispLowE->SetXTitle("N_{cells}");
2552 fhNCellsDispLowE->SetYTitle("D^{2}");
85c4406e 2553 outputContainer->Add(fhNCellsDispLowE);
764ab1f4 2554
85c4406e 2555 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
764ab1f4 2556 fhNCellsDispHighE->SetXTitle("N_{cells}");
2557 fhNCellsDispHighE->SetYTitle("D^{2}");
85c4406e 2558 outputContainer->Add(fhNCellsDispHighE);
764ab1f4 2559
85c4406e 2560 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
764ab1f4 2561 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
2562 fhEtaLam0LowE->SetXTitle("#eta");
85c4406e 2563 outputContainer->Add(fhEtaLam0LowE);
764ab1f4 2564
85c4406e 2565 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
764ab1f4 2566 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
2567 fhPhiLam0LowE->SetXTitle("#phi");
85c4406e 2568 outputContainer->Add(fhPhiLam0LowE);
764ab1f4 2569
85c4406e 2570 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
764ab1f4 2571 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
2572 fhEtaLam0HighE->SetXTitle("#eta");
85c4406e 2573 outputContainer->Add(fhEtaLam0HighE);
764ab1f4 2574
85c4406e 2575 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
764ab1f4 2576 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
2577 fhPhiLam0HighE->SetXTitle("#phi");
85c4406e 2578 outputContainer->Add(fhPhiLam0HighE);
764ab1f4 2579
85c4406e 2580 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2581 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
2582 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
85c4406e 2583 outputContainer->Add(fhLam1Lam0LowE);
764ab1f4 2584
85c4406e 2585 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2586 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
2587 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
85c4406e 2588 outputContainer->Add(fhLam1Lam0HighE);
764ab1f4 2589
85c4406e 2590 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2591 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
2592 fhLam0DispLowE->SetYTitle("D^{2}");
85c4406e 2593 outputContainer->Add(fhLam0DispLowE);
764ab1f4 2594
85c4406e 2595 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2596 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
2597 fhLam0DispHighE->SetYTitle("D^{2}");
85c4406e 2598 outputContainer->Add(fhLam0DispHighE);
764ab1f4 2599
85c4406e 2600 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2601 fhDispLam1LowE->SetXTitle("D^{2}");
2602 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
85c4406e 2603 outputContainer->Add(fhDispLam1LowE);
764ab1f4 2604
85c4406e 2605 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
764ab1f4 2606 fhDispLam1HighE->SetXTitle("D^{2}");
2607 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
85c4406e 2608 outputContainer->Add(fhDispLam1HighE);
764ab1f4 2609
2610 if(fCalorimeter == "EMCAL")
34c16486 2611 {
85c4406e 2612 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 2613 fhDispEtaE->SetXTitle("E (GeV)");
2614 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
85c4406e 2615 outputContainer->Add(fhDispEtaE);
764ab1f4 2616
85c4406e 2617 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 2618 fhDispPhiE->SetXTitle("E (GeV)");
2619 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2620 outputContainer->Add(fhDispPhiE);
764ab1f4 2621
85c4406e 2622 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 2623 fhSumEtaE->SetXTitle("E (GeV)");
2624 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
85c4406e 2625 outputContainer->Add(fhSumEtaE);
764ab1f4 2626
85c4406e 2627 fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
2628 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
764ab1f4 2629 fhSumPhiE->SetXTitle("E (GeV)");
2630 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
85c4406e 2631 outputContainer->Add(fhSumPhiE);
764ab1f4 2632
85c4406e 2633 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
2634 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
764ab1f4 2635 fhSumEtaPhiE->SetXTitle("E (GeV)");
2636 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
2637 outputContainer->Add(fhSumEtaPhiE);
2638
85c4406e 2639 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
2640 nptbins,ptmin,ptmax,200, -10,10);
764ab1f4 2641 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
2642 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
85c4406e 2643 outputContainer->Add(fhDispEtaPhiDiffE);
bfdcf7fb 2644
85c4406e 2645 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
2646 nptbins,ptmin,ptmax, 200, -1,1);
764ab1f4 2647 fhSphericityE->SetXTitle("E (GeV)");
2648 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
2649 outputContainer->Add(fhSphericityE);
bfdcf7fb 2650
85c4406e 2651 fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
764ab1f4 2652 fhDispSumEtaDiffE->SetXTitle("E (GeV)");
2653 fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
85c4406e 2654 outputContainer->Add(fhDispSumEtaDiffE);
764ab1f4 2655
85c4406e 2656 fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
764ab1f4 2657 fhDispSumPhiDiffE->SetXTitle("E (GeV)");
2658 fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
85c4406e 2659 outputContainer->Add(fhDispSumPhiDiffE);
764ab1f4 2660
2661 for(Int_t i = 0; i < 7; i++)
2662 {
85c4406e 2663 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]),
2664 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2665 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
2666 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2667 outputContainer->Add(fhDispEtaDispPhi[i]);
764ab1f4 2668
85c4406e 2669 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]),
2670 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2671 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
2672 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
85c4406e 2673 outputContainer->Add(fhLambda0DispEta[i]);
764ab1f4 2674
85c4406e 2675 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]),
2676 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
764ab1f4 2677 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
2678 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
85c4406e 2679 outputContainer->Add(fhLambda0DispPhi[i]);
764ab1f4 2680 }
34c16486 2681 }
2682 }
521636d2 2683 } // Shower shape
2684
09273901 2685 // Track Matching
2686
b5dbb99b 2687 if(fFillTMHisto)
2688 {
b2e375c7 2689 TString cutTM [] = {"NoCut",""};
b5dbb99b 2690
b2e375c7 2691 for(Int_t i = 0; i < 2; i++)
31ae6d59 2692 {
b2e375c7 2693 fhTrackMatchedDEta[i] = new TH2F
2694 (Form("hTrackMatchedDEta%s",cutTM[i].Data()),
2695 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2696 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2697 fhTrackMatchedDEta[i]->SetYTitle("d#eta");
2698 fhTrackMatchedDEta[i]->SetXTitle("E_{cluster} (GeV)");
4bfeae64 2699
b2e375c7 2700 fhTrackMatchedDPhi[i] = new TH2F
2701 (Form("hTrackMatchedDPhi%s",cutTM[i].Data()),
2702 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2703 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2704 fhTrackMatchedDPhi[i]->SetYTitle("d#phi (rad)");
2705 fhTrackMatchedDPhi[i]->SetXTitle("E_{cluster} (GeV)");
2706
2707 fhTrackMatchedDEtaDPhi[i] = new TH2F
2708 (Form("hTrackMatchedDEtaDPhi%s",cutTM[i].Data()),
2709 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2710 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2711 fhTrackMatchedDEtaDPhi[i]->SetYTitle("d#phi (rad)");
2712 fhTrackMatchedDEtaDPhi[i]->SetXTitle("d#eta");
2713
2714 fhTrackMatchedDEtaPos[i] = new TH2F
2715 (Form("hTrackMatchedDEtaPos%s",cutTM[i].Data()),
2716 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2717 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2718 fhTrackMatchedDEtaPos[i]->SetYTitle("d#eta");
2719 fhTrackMatchedDEtaPos[i]->SetXTitle("E_{cluster} (GeV)");
8d6b7f60 2720
b2e375c7 2721 fhTrackMatchedDPhiPos[i] = new TH2F
2722 (Form("hTrackMatchedDPhiPos%s",cutTM[i].Data()),
2723 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2724 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2725 fhTrackMatchedDPhiPos[i]->SetYTitle("d#phi (rad)");
2726 fhTrackMatchedDPhiPos[i]->SetXTitle("E_{cluster} (GeV)");
2727
2728 fhTrackMatchedDEtaDPhiPos[i] = new TH2F
2729 (Form("hTrackMatchedDEtaDPhiPos%s",cutTM[i].Data()),
2730 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2731 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2732 fhTrackMatchedDEtaDPhiPos[i]->SetYTitle("d#phi (rad)");
2733 fhTrackMatchedDEtaDPhiPos[i]->SetXTitle("d#eta");
2734
2735 fhTrackMatchedDEtaNeg[i] = new TH2F
2736 (Form("hTrackMatchedDEtaNeg%s",cutTM[i].Data()),
2737 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2738 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
b2e375c7 2739 fhTrackMatchedDEtaNeg[i]->SetYTitle("d#eta");
2740 fhTrackMatchedDEtaNeg[i]->SetXTitle("E_{cluster} (GeV)");
4bfeae64 2741
b2e375c7 2742 fhTrackMatchedDPhiNeg[i] = new TH2F
2743 (Form("hTrackMatchedDPhiNeg%s",cutTM[i].Data()),
2744 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
85c4406e 2745 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
b2e375c7 2746 fhTrackMatchedDPhiNeg[i]->SetYTitle("d#phi (rad)");
2747 fhTrackMatchedDPhiNeg[i]->SetXTitle("E_{cluster} (GeV)");
2748
2749 fhTrackMatchedDEtaDPhiNeg[i] = new TH2F
2750 (Form("hTrackMatchedDEtaDPhiNeg%s",cutTM[i].Data()),
2751 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2752 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2753 fhTrackMatchedDEtaDPhiNeg[i]->SetYTitle("d#phi (rad)");
2754 fhTrackMatchedDEtaDPhiNeg[i]->SetXTitle("d#eta");
2755
2756 fhdEdx[i] = new TH2F (Form("hdEdx%s",cutTM[i].Data()),Form("matched track <dE/dx> vs cluster E, %s",cutTM[i].Data()),
2757 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
2758 fhdEdx[i]->SetXTitle("E (GeV)");
2759 fhdEdx[i]->SetYTitle("<dE/dx>");
2760
2761