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