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