]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliAnalysisTaskEMCalHFEpA.cxx
Jet task updated in readme for QA AOD plot macro's
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliAnalysisTaskEMCalHFEpA.cxx
CommitLineData
8e2d649d 1
c852fdae 2/**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
16
9a1f999b 17 ////////////////////////////////////////////////////////////////////////
18 // //
19 // Task for Heavy-flavour electron analysis in pPb collisions //
20 // (+ Electron-Hadron Jetlike Azimuthal Correlation) //
21 // //
1dd85087 22 // version: May 28, 2014. //
9a1f999b 23 // //
24 // Authors //
25 // Elienos Pereira de Oliveira Filho (epereira@cern.ch) //
26 // Cristiane Jahnke (cristiane.jahnke@cern.ch) //
27 // //
28 ////////////////////////////////////////////////////////////////////////
c852fdae 29
30#include "TChain.h"
31#include "TTree.h"
32#include "TNtuple.h"
33#include "TH1F.h"
34#include "TH2F.h"
35#include "TCanvas.h"
36#include "AliAnalysisTask.h"
37#include "AliAnalysisManager.h"
38#include "AliESDEvent.h"
39#include "AliAODEvent.h"
40#include "AliVEvent.h"
41#include "AliESDInputHandler.h"
42#include "AliESDtrackCuts.h"
43#include "AliESDCaloCluster.h"
44#include "AliESDCaloCells.h"
45#include "AliEMCALTrack.h"
46#include "AliExternalTrackParam.h"
47#include "AliPhysicsSelection.h"
48#include "TGeoGlobalMagField.h"
49#include "AliMagF.h"
50#include "AliLog.h"
51#include "AliStack.h"
52#include "AliCentrality.h"
53#include "AliAODMCParticle.h"
54#include "AliAODMCHeader.h"
55#include "AliPID.h"
56#include "AliPIDResponse.h"
57#include "AliHFEcontainer.h"
58#include "AliHFEcuts.h"
59#include "AliHFEpid.h"
60#include "AliHFEpidBase.h"
61#include "AliHFEpidQAmanager.h"
62#include "AliHFEtools.h"
63#include "AliCFContainer.h"
64#include "AliCFManager.h"
65#include "AliSelectNonHFE.h"
66#include "AliHFEpidTPC.h"
67#include "AliAnalysisTaskEMCalHFEpA.h"
68#include "TMath.h"
69#include "THnSparse.h"
70#include "TLorentzVector.h"
71#include "TString.h"
72#include "TFile.h"
73#include "AliESDHandler.h"
74#include "AliMCEventHandler.h"
75#include "AliMCEvent.h"
76#include "AliStack.h"
77#include "TParticle.h"
78#include "AliLog.h"
79#include "AliAnalysisTaskSE.h"
80#include "TRefArray.h"
81#include "TVector.h"
82#include "stdio.h"
83#include "TGeoManager.h"
84#include "iostream"
85#include "fstream"
86#include "AliKFParticle.h"
87#include "AliKFVertex.h"
88#include "AliVParticle.h"
89#include "AliVTrack.h"
90#include "AliEventPoolManager.h"
91#include "TObjArray.h"
8e2d649d 92 //include to use reader as Lucile does
93#include "AliCaloTrackAODReader.h"
94#include "AliCaloTrackReader.h"
1dd85087 95#include "AliEMCALRecoUtils.h" //to remove exotics
96#include "AliAODHeader.h"
97#include "AliEMCALGeometry.h"
98
99
100
101 // --- ANALYSIS system ---
102#include "AliCalorimeterUtils.h"
103#include "AliESDEvent.h"
104#include "AliMCEvent.h"
105#include "AliStack.h"
106#include "AliAODPWG4Particle.h"
107#include "AliVCluster.h"
108#include "AliVCaloCells.h"
109#include "AliMixedEvent.h"
110#include "AliAODCaloCluster.h"
111#include "AliOADBContainer.h"
112#include "AliAnalysisManager.h"
113
114 // --- Detector ---
115#include "AliEMCALGeometry.h"
116#include "AliPHOSGeoUtils.h"
8e2d649d 117
9a1f999b 118 //______________________________________________________________________
c852fdae 119
9a1f999b 120 //______________________________________________________________________
c852fdae 121ClassImp(AliAnalysisTaskEMCalHFEpA)
122
9a1f999b 123 //______________________________________________________________________
c852fdae 124AliAnalysisTaskEMCalHFEpA::AliAnalysisTaskEMCalHFEpA(const char *name)
9a1f999b 125: AliAnalysisTaskSE(name)
126,fCorrelationFlag(0)
127,fIsMC(0)
128,fUseEMCal(kFALSE)
1dd85087 129
8e2d649d 130,fUseTrigger(kFALSE)
9a1f999b 131,fUseShowerShapeCut(kFALSE)
132,fFillBackground(kFALSE)
2c8e1f6c 133,fAssocWithSPD(kFALSE)
9a1f999b 134
135,fEMCEG1(kFALSE)
136,fEMCEG2(kFALSE)
137,fIsHFE1(kFALSE)
138,fIsHFE2(kFALSE)
139,fIsNonHFE(kFALSE)
140,fIsFromD(kFALSE)
141,fIsFromB(kFALSE)
142,fIsFromPi0(kFALSE)
143,fIsFromEta(kFALSE)
144,fIsFromGamma(kFALSE)
145,fESD(0)
146,fAOD(0)
147,fVevent(0)
148,fPartnerCuts(new AliESDtrackCuts())
149,fOutputList(0)
150,fPidResponse(0)
151,fNonHFE(new AliSelectNonHFE())
152,fIsAOD(kFALSE)
153,fCentrality(0)
154,fCentralityMin(0)
155,fCentralityMax(100)
156,fHasCentralitySelection(kFALSE)
157,fCentralityHist(0)
158,fCentralityHistPass(0)
159,fZvtx(0)
160,fEstimator(0)
161,fClus(0)
1dd85087 162//,fClusESD(0)
9a1f999b 163,fNevent(0)
1dd85087 164,fNevent2(0)
9a1f999b 165,fPtElec_Inc(0)
8e2d649d 166,fPtPrim(0)
167,fPtSec(0)
168,fPtPrim2(0)
169,fPtSec2(0)
9a1f999b 170,fCharge_n(0)
171,fCharge_p(0)
9a1f999b 172,fTime(0)
173,fTime2(0)
174,ftimingEle(0)
175,ftimingEle2(0)
9a1f999b 176,fPtElec_ULS(0)
177,fPtElec_LS(0)
8e2d649d 178,fPtElec_ULS_NoPid(0)
179,fPtElec_LS_NoPid(0)
180,fPtElec_ULS_MC(0)
181,fPtElec_ULS_MC_weight(0)
9a1f999b 182,fPtElec_ULS2(0)
183,fPtElec_LS2(0)
2c8e1f6c 184,fPtElec_ULS_weight(0)
185,fPtElec_LS_weight(0)
186,fPtElec_ULS2_weight(0)
187,fPtElec_LS2_weight(0)
2c8e1f6c 188,fTOF01(0)
189,fTOF02(0)
190,fTOF03(0)
9a1f999b 191,fpid(0)
192,fEoverP_pt(0)
193,fEoverP_tpc(0)
194,fTPC_pt(0)
195,fTPC_p(0)
196,fTPCnsigma_pt(0)
197,fTPCnsigma_p(0)
198,fTPCnsigma_pt_2D(0)
199,fShowerShapeCut(0)
9a4682da 200,fShowerShapeM02_EoverP(0)
201,fShowerShapeM20_EoverP(0)
9a1f999b 202,fShowerShape_ha(0)
203,fShowerShape_ele(0)
9a1f999b 204,fTPCnsigma_eta(0)
205,fTPCnsigma_phi(0)
206,fECluster(0)
8e2d649d 207,fECluster_pure(0)
1dd85087 208,fECluster_not_exotic(0)
209,fECluster_not_exotic1(0)
210,fECluster_not_exotic2(0)
211,fECluster_exotic(0)
212,fNCluster_pure(0)
213,fNCluster_pure_aod(0)
214,fNCluster_ECluster(0)
215,fNcells_energy(0)
216,fNcells_energy_elec_selected(0)
217,fNcells_energy_not_exotic(0)
218
9a1f999b 219,fEtaPhi(0)
0131ce6c 220,fEtaPhi_num(0)
221,fEtaPhi_den(0)
1dd85087 222,fEtaPhi_data(0)
8e2d649d 223,fpt_reco_pt_MC_num(0)
224,fpt_reco_pt_MC_den(0)
9a1f999b 225,fVtxZ(0)
0131ce6c 226
8e2d649d 227,fVtxZ_new1(0)
228,fVtxZ_new2(0)
229,fVtxZ_new3(0)
230,fVtxZ_new4(0)
231
1dd85087 232,fzRes1(0)
233,fzRes2(0)
234,fSPD_track_vtx1(0)
235,fSPD_track_vtx2(0)
236
237
8e2d649d 238,fEtad(0)
9a1f999b 239,fNTracks(0)
1dd85087 240,fTrack_Multi(0)
8e2d649d 241,fNTracks_pt(0)
242,fNTracks_eta(0)
243,fNTracks_phi(0)
9a1f999b 244,fNClusters(0)
245,fTPCNcls_EoverP(0)
31185d97 246,fTPCNcls_pid(0)
9a1f999b 247,fEta(0)
248,fPhi(0)
249,fR(0)
250,fR_EoverP(0)
251,fNcells(0)
252,fNcells_EoverP(0)
253,fNcells_electrons(0)
254,fNcells_hadrons(0)
255,fECluster_ptbins(0)
256,fEoverP_ptbins(0)
257,fEoverP_wSSCut(0)
258,fM02_EoverP(0)
259,fM20_EoverP(0)
260,fTPCnsigma_eta_electrons(0)
261,fTPCnsigma_eta_hadrons(0)
262,fEoverP_pt_pions(0)
263,ftpc_p_EoverPcut(0)
264,fnsigma_p_EoverPcut(0)
265,fEoverP_pt_pions2(0)
266,fNcells_pt(0)
267,fEoverP_pt_hadrons(0)
268,fCEtaPhi_Inc(0)
269,fCEtaPhi_ULS(0)
270,fCEtaPhi_LS(0)
271,fCEtaPhi_ULS_NoP(0)
272,fCEtaPhi_LS_NoP(0)
273,fCEtaPhi_ULS_Weight(0)
274,fCEtaPhi_LS_Weight(0)
275,fCEtaPhi_ULS_NoP_Weight(0)
276,fCEtaPhi_LS_NoP_Weight(0)
9a1f999b 277,fInvMass(0)
278,fInvMassBack(0)
279,fDCA(0)
280,fDCABack(0)
281,fOpAngle(0)
282,fOpAngleBack(0)
9a1f999b 283,fInvMass2(0)
284,fInvMassBack2(0)
285,fDCA2(0)
286,fDCABack2(0)
287,fOpAngle2(0)
288,fOpAngleBack2(0)
9a1f999b 289,fMassCut(0.1)
290,fEtaCutMin(-0.9)
291,fEtaCutMax(0.9)
9a1f999b 292,fdPhiCut(0.05)
293,fdEtaCut(0.05)
9a1f999b 294,fEoverPCutMin(0.8)
295,fEoverPCutMax(1.2)
9a1f999b 296,fM20CutMin(0.0)
297,fM20CutMax(10)
298,fM02CutMin(0.0)
299,fM02CutMax(10)
9a1f999b 300,fAngleCut(999)
301,fChi2Cut(3.5)
302,fDCAcut(999)
303,fMassCutFlag(kTRUE)
304,fAngleCutFlag(kFALSE)
305,fChi2CutFlag(kFALSE)
306,fDCAcutFlag(kFALSE)
0131ce6c 307,fAssHadronPtMin(0.5)
308,fAssHadronPtMax(2.0)
9a1f999b 309,fPtBackgroundBeforeReco(0)
310,fPtBackgroundBeforeReco2(0)
2c8e1f6c 311,fPtBackgroundBeforeReco_weight(0)
312,fPtBackgroundBeforeReco2_weight(0)
2235208e 313,fpT_m_electron(0)
314,fpT_gm_electron(0)
9a1f999b 315,fPtBackgroundAfterReco(0)
9a1f999b 316,fPtMinAsso(0.3)
317,fTpcNclsAsso(80)
9a1f999b 318,fPtMCparticleAll(0)
319,fPtMCparticleAll_nonPrimary(0)
320,fPtMCparticleAlle_nonPrimary(0)
2c8e1f6c 321,fPtMCparticleAlle_Primary(0)
9a1f999b 322,fPtMCparticleReco(0)
323,fPtMCparticleReco_nonPrimary(0)
324,fPtMCparticleAllHfe1(0)
325,fPtMCparticleRecoHfe1(0)
326,fPtMCparticleAllHfe2(0)
327,fPtMCparticleRecoHfe2(0)
328,fPtMCelectronAfterAll(0)
8e2d649d 329,fPtMCelectronAfterAll_unfolding(0)
9a1f999b 330,fPtMCelectronAfterAll_nonPrimary(0)
2c8e1f6c 331,fPtMCelectronAfterAll_Primary(0)
9a1f999b 332,fPtMCpi0(0)
333,fPtMCeta(0)
8e2d649d 334,fPtMCpi02(0)
335,fPtMCeta2(0)
1dd85087 336,fPtMCpi03(0)
337,fPtMCeta3(0)
9a1f999b 338,fPtMC_EMCal_All(0)
339,fPtMC_EMCal_Selected(0)
340,fPtMC_TPC_All(0)
341,fPtMC_TPC_Selected(0)
8e2d649d 342,fPt_track_match_den(0)
343,fPt_track_match_num(0)
9a1f999b 344,fPtMCWithLabel(0)
345,fPtMCWithoutLabel(0)
346,fPtIsPhysicaPrimary(0)
347,fCuts(0)
8e2d649d 348 //,reader(0)
9a1f999b 349,fCFM(0)
350,fPID(new AliHFEpid("hfePid"))
8e2d649d 351 //Lucile
9a1f999b 352,fPIDqa(0)
353,fMCstack(0)
354,fRejectKinkMother(kFALSE)
355,fMCtrack(0)
356,fMCtrackMother(0)
357,fMCtrackGMother(0)
358,fMCtrackGGMother(0)
359,fMCtrackGGGMother(0)
360,fMCarray(0)
361,fMCheader(0)
362,fMCparticle(0)
8e2d649d 363,fMCparticle2(0)
9a1f999b 364,fMCparticleMother(0)
365,fMCparticleGMother(0)
366,fMCparticleGGMother(0)
367,fMCparticleGGGMother(0)
368,fEventHandler(0)
369,fMCevent(0)
370,fPoolMgr(0)
371,fPool(0)
372,fTracksClone(0)
373,fTracks(0)
374,fCEtaPhi_Inc_EM(0)
375,fCEtaPhi_ULS_EM(0)
376,fCEtaPhi_LS_EM(0)
377,fCEtaPhi_ULS_Weight_EM(0)
378,fCEtaPhi_LS_Weight_EM(0)
379,fPoolNevents(0)
380,fEventMixingFlag(0)
381,fCEtaPhi_Inc_DiHadron(0)
382,fPtTrigger_Inc(0)
1dd85087 383 //,fEMCALRecoUtils(new AliEMCALRecoUtils)
384 //,fEMCALGeo(0x0)
385 //,fCaloUtils(0x0)
386
387,fBitEGA(0)
388//,fEMCALRecoUtils(0)//exotic
389
c852fdae 390{
9a1f999b 391 //Named constructor
392 // Define input and output slots here
393 // Input slot #0 works with a TChain
1dd85087 394
395 //exotic
396 //fEMCALRecoUtils = new AliEMCALRecoUtils();
397
9a1f999b 398 DefineInput(0, TChain::Class());
399 // Output slot #0 id reserved by the base class for AOD
400 // Output slot #1 writes into a TH1 container
401 // DefineOutput(1, TH1I::Class());
402 DefineOutput(1, TList::Class());
403 // DefineOutput(3, TTree::Class());
c852fdae 404}
405
9a1f999b 406 //________________________________________________________________________
c852fdae 407AliAnalysisTaskEMCalHFEpA::AliAnalysisTaskEMCalHFEpA()
9a1f999b 408: AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisTaskEMCalHFEpA")
409,fCorrelationFlag(0)
410,fIsMC(0)
411,fUseEMCal(kFALSE)
8e2d649d 412,fUseTrigger(kFALSE)
9a1f999b 413,fUseShowerShapeCut(kFALSE)
414,fFillBackground(kFALSE)
2c8e1f6c 415,fAssocWithSPD(kFALSE)
9a1f999b 416,fEMCEG1(kFALSE)
417,fEMCEG2(kFALSE)
418,fIsHFE1(kFALSE)
419,fIsHFE2(kFALSE)
420,fIsNonHFE(kFALSE)
421,fIsFromD(kFALSE)
422,fIsFromB(kFALSE)
423,fIsFromPi0(kFALSE)
424,fIsFromEta(kFALSE)
425,fIsFromGamma(kFALSE)
426,fESD(0)
427,fAOD(0)
428,fVevent(0)
429,fPartnerCuts(new AliESDtrackCuts())
430,fOutputList(0)
431,fPidResponse(0)
432,fNonHFE(new AliSelectNonHFE())
433,fIsAOD(kFALSE)
434,fCentrality(0)
435,fCentralityMin(0)
436,fCentralityMax(100)
437,fHasCentralitySelection(kFALSE)
438,fCentralityHist(0)
439,fCentralityHistPass(0)
440,fZvtx(0)
441,fEstimator(0)
442,fClus(0)
a89620c8 443 //,fClusESD(0)
9a1f999b 444,fNevent(0)
1dd85087 445,fNevent2(0)
9a1f999b 446,fPtElec_Inc(0)
8e2d649d 447,fPtPrim(0)
448,fPtSec(0)
449,fPtPrim2(0)
450,fPtSec2(0)
9a1f999b 451,fCharge_n(0)
452,fCharge_p(0)
9a1f999b 453,fTime(0)
454,fTime2(0)
455,ftimingEle(0)
456,ftimingEle2(0)
9a1f999b 457,fPtElec_ULS(0)
458,fPtElec_LS(0)
8e2d649d 459,fPtElec_ULS_NoPid(0)
460,fPtElec_LS_NoPid(0)
461,fPtElec_ULS_MC(0)
462,fPtElec_ULS_MC_weight(0)
9a1f999b 463,fPtElec_ULS2(0)
464,fPtElec_LS2(0)
2c8e1f6c 465,fPtElec_ULS_weight(0)
466,fPtElec_LS_weight(0)
467,fPtElec_ULS2_weight(0)
468,fPtElec_LS2_weight(0)
2c8e1f6c 469,fTOF01(0)
470,fTOF02(0)
471,fTOF03(0)
9a1f999b 472,fpid(0)
473,fEoverP_pt(0)
474,fEoverP_tpc(0)
475,fTPC_pt(0)
476,fTPC_p(0)
477,fTPCnsigma_pt(0)
478,fTPCnsigma_p(0)
479,fTPCnsigma_pt_2D(0)
480,fShowerShapeCut(0)
9a4682da 481,fShowerShapeM02_EoverP(0)
482,fShowerShapeM20_EoverP(0)
9a4682da 483,fShowerShape_ha(0)
484,fShowerShape_ele(0)
9a1f999b 485,fTPCnsigma_eta(0)
486,fTPCnsigma_phi(0)
487,fECluster(0)
8e2d649d 488,fECluster_pure(0)
1dd85087 489,fECluster_not_exotic(0)
490,fECluster_not_exotic1(0)
491,fECluster_not_exotic2(0)
492,fECluster_exotic(0)
493,fNCluster_pure(0)
494,fNCluster_pure_aod(0)
495,fNCluster_ECluster(0)
496,fNcells_energy(0)
497,fNcells_energy_elec_selected(0)
498,fNcells_energy_not_exotic(0)
9a1f999b 499,fEtaPhi(0)
0131ce6c 500,fEtaPhi_num(0)
501,fEtaPhi_den(0)
1dd85087 502,fEtaPhi_data(0)
8e2d649d 503,fpt_reco_pt_MC_num(0)
504,fpt_reco_pt_MC_den(0)
9a1f999b 505,fVtxZ(0)
0131ce6c 506
8e2d649d 507,fVtxZ_new1(0)
508,fVtxZ_new2(0)
509,fVtxZ_new3(0)
510,fVtxZ_new4(0)
511
1dd85087 512,fzRes1(0)
513,fzRes2(0)
514,fSPD_track_vtx1(0)
515,fSPD_track_vtx2(0)
516
517
518
8e2d649d 519,fEtad(0)
9a1f999b 520,fNTracks(0)
1dd85087 521,fTrack_Multi(0)
8e2d649d 522,fNTracks_pt(0)
523,fNTracks_eta(0)
524,fNTracks_phi(0)
9a1f999b 525,fNClusters(0)
526,fTPCNcls_EoverP(0)
31185d97 527,fTPCNcls_pid(0)
9a1f999b 528,fEta(0)
529,fPhi(0)
530,fR(0)
531,fR_EoverP(0)
532,fNcells(0)
533,fNcells_EoverP(0)
534,fNcells_electrons(0)
535,fNcells_hadrons(0)
536,fECluster_ptbins(0)
537,fEoverP_ptbins(0)
538,fEoverP_wSSCut(0)
539,fM02_EoverP(0)
540,fM20_EoverP(0)
541,fTPCnsigma_eta_electrons(0)
542,fTPCnsigma_eta_hadrons(0)
543,fEoverP_pt_pions(0)
544,ftpc_p_EoverPcut(0)
545,fnsigma_p_EoverPcut(0)
546,fEoverP_pt_pions2(0)
547,fNcells_pt(0)
548,fEoverP_pt_hadrons(0)
549,fCEtaPhi_Inc(0)
550,fCEtaPhi_ULS(0)
551,fCEtaPhi_LS(0)
552,fCEtaPhi_ULS_NoP(0)
553,fCEtaPhi_LS_NoP(0)
554,fCEtaPhi_ULS_Weight(0)
555,fCEtaPhi_LS_Weight(0)
556,fCEtaPhi_ULS_NoP_Weight(0)
557,fCEtaPhi_LS_NoP_Weight(0)
9a1f999b 558,fInvMass(0)
559,fInvMassBack(0)
560,fDCA(0)
561,fDCABack(0)
562,fOpAngle(0)
563,fOpAngleBack(0)
9a1f999b 564,fInvMass2(0)
565,fInvMassBack2(0)
566,fDCA2(0)
567,fDCABack2(0)
568,fOpAngle2(0)
569,fOpAngleBack2(0)
9a1f999b 570,fMassCut(0.1)
571,fEtaCutMin(-0.9)
572,fEtaCutMax(0.9)
9a1f999b 573,fdPhiCut(0.05)
574,fdEtaCut(0.05)
9a1f999b 575,fEoverPCutMin(0.8)
576,fEoverPCutMax(1.2)
9a1f999b 577,fM20CutMin(0)
578,fM20CutMax(10)
579,fM02CutMin(0)
580,fM02CutMax(10)
9a1f999b 581,fAngleCut(999)
582,fChi2Cut(3.5)
583,fDCAcut(999)
584,fMassCutFlag(kTRUE)
585,fAngleCutFlag(kFALSE)
586,fChi2CutFlag(kFALSE)
587,fDCAcutFlag(kFALSE)
0131ce6c 588,fAssHadronPtMin(0.5)
589,fAssHadronPtMax(2.0)
9a1f999b 590,fPtBackgroundBeforeReco(0)
591,fPtBackgroundBeforeReco2(0)
2c8e1f6c 592,fPtBackgroundBeforeReco_weight(0)
593,fPtBackgroundBeforeReco2_weight(0)
2235208e 594,fpT_m_electron(0)
595,fpT_gm_electron(0)
9a1f999b 596,fPtBackgroundAfterReco(0)
9a1f999b 597,fPtMinAsso(0.3)
598,fTpcNclsAsso(80)
9a1f999b 599,fPtMCparticleAll(0)
600,fPtMCparticleAll_nonPrimary(0)
601,fPtMCparticleAlle_nonPrimary(0)
2c8e1f6c 602,fPtMCparticleAlle_Primary(0)
9a1f999b 603,fPtMCparticleReco(0)
604,fPtMCparticleReco_nonPrimary(0)
9a1f999b 605,fPtMCparticleAllHfe1(0)
606,fPtMCparticleRecoHfe1(0)
607,fPtMCparticleAllHfe2(0)
608,fPtMCparticleRecoHfe2(0)
609,fPtMCelectronAfterAll(0)
8e2d649d 610,fPtMCelectronAfterAll_unfolding(0)
9a1f999b 611,fPtMCelectronAfterAll_nonPrimary(0)
2c8e1f6c 612,fPtMCelectronAfterAll_Primary(0)
9a1f999b 613,fPtMCpi0(0)
614,fPtMCeta(0)
8e2d649d 615,fPtMCpi02(0)
616,fPtMCeta2(0)
1dd85087 617,fPtMCpi03(0)
618,fPtMCeta3(0)
9a1f999b 619,fPtMC_EMCal_All(0)
620,fPtMC_EMCal_Selected(0)
621,fPtMC_TPC_All(0)
622,fPtMC_TPC_Selected(0)
8e2d649d 623,fPt_track_match_den(0)
624,fPt_track_match_num(0)
9a1f999b 625,fPtMCWithLabel(0)
626,fPtMCWithoutLabel(0)
627,fPtIsPhysicaPrimary(0)
628,fCuts(0)
8e2d649d 629 //Lucile
630 //,reader(0)
9a1f999b 631,fCFM(0)
632,fPID(new AliHFEpid("hfePid"))
633,fPIDqa(0)
634,fMCstack(0)
635,fRejectKinkMother(kFALSE)
636,fMCtrack(0)
637,fMCtrackMother(0)
638,fMCtrackGMother(0)
639,fMCtrackGGMother(0)
640,fMCtrackGGGMother(0)
641,fMCarray(0)
642,fMCheader(0)
643,fMCparticle(0)
8e2d649d 644,fMCparticle2(0)
9a1f999b 645,fMCparticleMother(0)
646,fMCparticleGMother(0)
647,fMCparticleGGMother(0)
648,fMCparticleGGGMother(0)
649,fEventHandler(0)
650,fMCevent(0)
651,fPoolMgr(0)
652,fPool(0)
653,fTracksClone(0)
654,fTracks(0)
655,fCEtaPhi_Inc_EM(0)
656,fCEtaPhi_ULS_EM(0)
657,fCEtaPhi_LS_EM(0)
658,fCEtaPhi_ULS_Weight_EM(0)
659,fCEtaPhi_LS_Weight_EM(0)
660,fPoolNevents(0)
661,fEventMixingFlag(0)
662,fCEtaPhi_Inc_DiHadron(0)
663,fPtTrigger_Inc(0)
1dd85087 664 //,fEMCALRecoUtils(new AliEMCALRecoUtils)
665 //,fEMCALGeo(0x0)
666 //,fCaloUtils(0x0)
667,fBitEGA(0)
668 //,fEMCALRecoUtils(0)//exotic
c852fdae 669{
9a1f999b 670 // Constructor
671 // Define input and output slots here
672 // Input slot #0 works with a TChain
1dd85087 673
674 //exotic
675 // fEMCALRecoUtils = new AliEMCALRecoUtils();
676
c852fdae 677 DefineInput(0, TChain::Class());
9a1f999b 678 // Output slot #0 id reserved by the base class for AOD
679 // Output slot #1 writes into a TH1 container
680 // DefineOutput(1, TH1I::Class());
c852fdae 681 DefineOutput(1, TList::Class());
9a1f999b 682 //DefineOutput(3, TTree::Class());
c852fdae 683}
684
9a1f999b 685 //______________________________________________________________________
c852fdae 686AliAnalysisTaskEMCalHFEpA::~AliAnalysisTaskEMCalHFEpA()
687{
8e2d649d 688 //Destructor
c852fdae 689 delete fOutputList;
690 delete fPID;
691 delete fCFM;
692 delete fPIDqa;
8e2d649d 693 //Lucile
694 //delete reader;
1dd85087 695 //if(fEMCALRecoUtils) delete fEMCALRecoUtils ;
c852fdae 696}
697
9a1f999b 698 //______________________________________________________________________
699 //Create Output Objects
700 //Here we can define the histograms and others output files
701 //Called once
c852fdae 702void AliAnalysisTaskEMCalHFEpA::UserCreateOutputObjects()
703{
9a1f999b 704 //______________________________________________________________________
705 //Initialize PID
c852fdae 706 if(!fPID->GetNumberOfPIDdetectors())
707 {
708 fPID->AddDetector("TPC", 0);
709 }
9a1f999b 710
c852fdae 711 fPID->SortDetectors();
712
713 fPIDqa = new AliHFEpidQAmanager();
714 fPIDqa->Initialize(fPID);
9a1f999b 715 //______________________________________________________________________
716
717 //______________________________________________________________________
718 //Initialize correction Framework and Cuts
c852fdae 719 fCFM = new AliCFManager;
720 const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack;
721 fCFM->SetNStepParticle(kNcutSteps);
722 for(Int_t istep = 0; istep < kNcutSteps; istep++) fCFM->SetParticleCutsList(istep, NULL);
9a1f999b 723
c852fdae 724 if(!fCuts)
725 {
726 AliWarning("Cuts not available. Default cuts will be used");
727 fCuts = new AliHFEcuts;
728 fCuts->CreateStandardCuts();
729 }
730
731 fCuts->Initialize(fCFM);
9a1f999b 732 //______________________________________________________________________
733
8e2d649d 734 ///___________________//Lucile
735
736 //if(fIsAOD) {
737 // reader = new AliCaloTrackAODReader();
738 //}
739 //___________________________________________________
9a1f999b 740 ///Output Tlist
741 //Create TList
c852fdae 742 fOutputList = new TList();
743 fOutputList->SetOwner();
9a1f999b 744
745 //PIDqa
c852fdae 746 fOutputList->Add(fPIDqa->MakeList("PIDQA"));
9a1f999b 747
748 //Store the number of events
749 //Define the histo
1dd85087 750 fNevent = new TH1F("fNevent","Number of Events",30,0,30);
751 fNevent2 = new TH1F("fNevent2","Number of Events 2",30,0,30);
9a1f999b 752 //And then, add to the output list
c852fdae 753 fOutputList->Add(fNevent);
1dd85087 754 fOutputList->Add(fNevent2);
c852fdae 755
756 fpid = new TH1F("fpid","PID flag",5,0,5);
757 fOutputList->Add(fpid);
758
8e2d649d 759 //pt Distribution
760 fPtElec_Inc = new TH1F("fPtElec_Inc","Inclusive Electrons; p_{T} (GeV/c); Count",300,0,30);
761
762 fPtPrim = new TH1F("fPtPrim","Primary Electrons aod track; p_{T} (GeV/c); Count",300,0,30);
763 fPtSec = new TH1F("fPtSec","Secundary Electrons aod track; p_{T} (GeV/c); Count",300,0,30);
764 fPtPrim2 = new TH1F("fPtPrim2","Primary Electrons vtrack; p_{T} (GeV/c); Count",300,0,30);
765 fPtSec2 = new TH1F("fPtSec2","Secundary Electrons vtrack; p_{T} (GeV/c); Count",300,0,30);
766
767
768 fPtElec_ULS = new TH1F("fPtElec_ULS","ULS; p_{T} (GeV/c); Count",300,0,30);
769 fPtElec_LS = new TH1F("fPtElec_LS","LS; p_{T} (GeV/c); Count",300,0,30);
770
771 fPtElec_ULS_NoPid = new TH1F("fPtElec_ULS_NoPid","ULS; p_{T} (GeV/c); Count",300,0,30);
772 fPtElec_LS_NoPid = new TH1F("fPtElec_LS_NoPid","LS; p_{T} (GeV/c); Count",300,0,30);
9a4682da 773
8e2d649d 774 fPtElec_ULS_MC = new TH1F("fPtElec_ULS_MC","ULS; p_{T} (GeV/c); Count",300,0,30);
775 fPtElec_ULS_MC_weight = new TH1F("fPtElec_ULS_MC_weight","ULS; p_{T} (GeV/c); Count",300,0,30);
9a4682da 776
8e2d649d 777 fPtElec_ULS_weight = new TH1F("fPtElec_ULS_weight","ULS; p_{T} (GeV/c); Count",300,0,30);
778 fPtElec_LS_weight = new TH1F("fPtElec_LS_weight","LS; p_{T} (GeV/c); Count",300,0,30);
2c8e1f6c 779
780 fTOF01 = new TH2F("fTOF01","",200,-20,20,200,-20,20);
781 fTOF02 = new TH2F("fTOF02","",200,-20,20,200,-20,20);
67eb14b9 782 fTOF03 = new TH2F("fTOF03","",200,-20,20,200,-20,20);
2c8e1f6c 783
9a4682da 784 if(fFillBackground){
8e2d649d 785 fPtElec_ULS2 = new TH1F("fPtElec_ULS2","ULS; p_{T} (GeV/c); Count",300,0,30);
786 fPtElec_LS2 = new TH1F("fPtElec_LS2","LS; p_{T} (GeV/c); Count",300,0,30);
2c8e1f6c 787
8e2d649d 788 fPtElec_ULS2_weight = new TH1F("fPtElec_ULS2_weight","ULS; p_{T} (GeV/c); Count",300,0,30);
789 fPtElec_LS2_weight = new TH1F("fPtElec_LS2_weight","LS; p_{T} (GeV/c); Count",300,0,30);
2c8e1f6c 790
9a4682da 791 }
792
793 fPtTrigger_Inc = new TH1F("fPtTrigger_Inc","pT dist for Hadron Contamination; p_{t} (GeV/c); Count",300,0,30);
c852fdae 794 fTPCnsigma_pt_2D = new TH2F("fTPCnsigma_pt_2D",";pt (GeV/c);TPC Electron N#sigma",1000,0.3,30,1000,-15,10);
9a4682da 795 fShowerShapeCut = new TH2F("fShowerShapeCut","Shower Shape;M02;M20",500,0,1.8,500,0,1.8);
0131ce6c 796 fEtaPhi_num=new TH2F("fEtaPhi_num","#eta x #phi track;#phi;#eta",200,0.,5,50,-1.,1.);
797 fEtaPhi_den=new TH2F("fEtaPhi_den","#eta x #phi track;#phi;#eta",200,0.,5,50,-1.,1.);
1dd85087 798 fEtaPhi_data=new TH2F("fEtaPhi_data","#eta x #phi track;#phi;#eta",200,0.,5,50,-1.,1.);
8e2d649d 799
800 fpt_reco_pt_MC_num=new TH2F("fpt_reco_pt_MC_num","pt reco x pt MC;pt reco; pt MC",300,0.,30,300,0.,30);
801 fpt_reco_pt_MC_den=new TH2F("fpt_reco_pt_MC_den","pt reco x pt MC;pt reco; pt MC",300,0.,30,300,0.,30);
9a4682da 802
a6f21076 803
804 fCharge_n = new TH1F("fCharge_n","Inclusive Electrons (Negative Charge); p_{t} (GeV/c); Count",200,0,30);
805 fCharge_p = new TH1F("fCharge_p","Inclusive Positrons (Positive Charge); p_{t} (GeV/c); Count",200,0,30);
a89620c8 806
8e2d649d 807 fECluster_pure= new TH1F("fECluster_pure", ";ECluster pure",2000,0,100);
1dd85087 808 fECluster_not_exotic= new TH1F("fECluster_not_exotic", ";ECluster not exotic - function ",2000,0,100);
809
810 fECluster_not_exotic1= new TH1F("fECluster_not_exotic1", ";ECluster not exotic Ncells > E/3+1",2000,0,100);
811
812 fECluster_not_exotic2= new TH1F("fECluster_not_exotic2", ";ECluster not exotic 2",2000,0,100);
813 fECluster_exotic= new TH1F("fECluster_exotic", ";ECluster exotic",2000,0,100);
814
815 //not associated with tracks
816 fNCluster_pure= new TH1F("fNCluster_pure", ";Number of clusters - pure",2000,-1,1999);
817 fNCluster_pure_aod= new TH1F("fNCluster_pure_aod", ";Number of clusters - pure -aod",2000,-1,1999);
818 fNCluster_ECluster= new TH2F("fNCluster_ECluster", ";Number of clusters vs. Energy of Cluster",2000,-1,1999, 4000, -1, 1999);
819
820 fNcells_energy= new TH2F("fNcells_energy", "all clusters;Number of cells;Energy of Cluster",100,0,100, 2000, 0, 100);
821 fNcells_energy_elec_selected= new TH2F("fNcells_energy_elec_selected", "clusters for electrons on TPC;Number of cells;Energy of Cluster",100,0,100, 2000, 0, 100);
822 fNcells_energy_not_exotic= new TH2F("fNcells_energy_not_exotic", "not exotic cluster;Number of cells;Energy of Cluster ",100,0,100, 2000, 0, 100);
8e2d649d 823
a89620c8 824 if(fUseEMCal){
9a4682da 825
9a1f999b 826 if(!fIsAOD){
9a4682da 827 fTime = new TH2D("fTime","Cells Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
828 fTime2 = new TH2D("fTime2","Cells Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
9a1f999b 829 }
9a4682da 830
a89620c8 831 ftimingEle = new TH2D("ftimingEle","Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
832 ftimingEle2 = new TH2D("ftimingEle2","Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
833
9a4682da 834 fShowerShape_ha = new TH2F("fShowerShape_ha","Shower Shape hadrons;M02;M20",500,0,1.8,500,0,1.8);
835 fShowerShape_ele = new TH2F("fShowerShape_ele","Shower Shape electrons;M02;M20",500,0,1.8,500,0,1.8);
a89620c8 836
9a4682da 837 fShowerShapeM02_EoverP = new TH2F("fShowerShapeM02_EoverP","Shower Shape;M02;E/p",500,0,1.8,500,0,1.8);
838 fShowerShapeM20_EoverP = new TH2F("fShowerShapeM20_EoverP","Shower Shape;M20;E/p",500,0,1.8,500,0,1.8);
9a1f999b 839
a89620c8 840 }
c852fdae 841
2c8e1f6c 842 fOutputList->Add(fTOF01);
843 fOutputList->Add(fTOF02);
844 fOutputList->Add(fTOF03);
845
0131ce6c 846 fOutputList->Add(fEtaPhi_num);
847 fOutputList->Add(fEtaPhi_den);
1dd85087 848 fOutputList->Add(fEtaPhi_data);
0131ce6c 849
8e2d649d 850 fOutputList->Add(fpt_reco_pt_MC_num);
851 fOutputList->Add(fpt_reco_pt_MC_den);
852
853
c852fdae 854 fOutputList->Add(fPtElec_Inc);
855 fOutputList->Add(fPtElec_ULS);
856 fOutputList->Add(fPtElec_LS);
8e2d649d 857 fOutputList->Add(fPtElec_ULS_NoPid);
858 fOutputList->Add(fPtElec_LS_NoPid);
859 fOutputList->Add(fPtElec_ULS_MC);
860 fOutputList->Add(fPtElec_ULS_MC_weight);
861
862 fOutputList->Add(fPtPrim);
863 fOutputList->Add(fPtSec);
864 fOutputList->Add(fPtPrim2);
865 fOutputList->Add(fPtSec2);
866
867
868
2c8e1f6c 869 fOutputList->Add(fPtElec_ULS_weight);
870 fOutputList->Add(fPtElec_LS_weight);
9a4682da 871
872 if(fFillBackground){
873 fOutputList->Add(fPtElec_ULS2);
874 fOutputList->Add(fPtElec_LS2);
2c8e1f6c 875 fOutputList->Add(fPtElec_ULS2_weight);
876 fOutputList->Add(fPtElec_LS2_weight);
9a4682da 877 }
878
879
c852fdae 880 fOutputList->Add(fPtTrigger_Inc);
881 fOutputList->Add(fTPCnsigma_pt_2D);
a89620c8 882 fOutputList->Add(fShowerShapeCut);
c852fdae 883
a6f21076 884 fOutputList->Add(fCharge_n);
885 fOutputList->Add(fCharge_p);
886
8e2d649d 887 fOutputList->Add(fECluster_pure);
1dd85087 888 fOutputList->Add(fECluster_not_exotic);
889 fOutputList->Add(fECluster_not_exotic1);
890 fOutputList->Add(fECluster_not_exotic2);
891 fOutputList->Add(fECluster_exotic);
892
893 fOutputList->Add(fNCluster_pure);
894 fOutputList->Add(fNCluster_pure_aod);
895
896 fOutputList->Add(fNCluster_ECluster);
897 fOutputList->Add(fNcells_energy);
898 fOutputList->Add(fNcells_energy_elec_selected);
899 fOutputList->Add(fNcells_energy_not_exotic);
900
8e2d649d 901
a89620c8 902 if(fUseEMCal){
9a4682da 903
9a1f999b 904 if(!fIsAOD){
9a4682da 905 fOutputList->Add(fTime);
906 fOutputList->Add(fTime2);
907
9a1f999b 908 }
9a4682da 909
a89620c8 910 fOutputList->Add(ftimingEle);
911 fOutputList->Add(ftimingEle2);
9a4682da 912
913 fOutputList->Add(fShowerShape_ha);
914 fOutputList->Add(fShowerShape_ele);
915
916 fOutputList->Add(fShowerShapeM02_EoverP);
917 fOutputList->Add(fShowerShapeM20_EoverP);
9a4682da 918
9a1f999b 919
920
a89620c8 921 }
922
1dd85087 923 fVtxZ_new1= new TH1F("fVtxZ_new1","fVtxZ_new1",4000, -50,50);
924 fVtxZ_new2= new TH1F("fVtxZ_new2","fVtxZ_new2",4000, -50,50);
925 fVtxZ_new3= new TH1F("fVtxZ_new3","fVtxZ_new3",4000, -50,50);
926 fVtxZ_new4= new TH1F("fVtxZ_new4","fVtxZ_new4",4000, -50,50);
927
928 fzRes1= new TH1F("fzRes1","fzRes1",4000, 0,1);
929 fzRes2= new TH1F("fzRes2","fzRes2",4000, 0,1);
930 fSPD_track_vtx1= new TH1F("fSPD_track_vtx1","fSPD_track_vtx1",4000, -5,5);
931 fSPD_track_vtx2= new TH1F("fSPD_track_vtx2","fSPD_track_vtx2",4000, -5,5);
8e2d649d 932
1dd85087 933
9a1f999b 934 //General Histograms
c852fdae 935
9a1f999b 936 //Steps
937 //Step 1: Before Track cuts
938 //Step 2: Before PID
939 //Step 3: After PID
c852fdae 940
941 fEoverP_pt = new TH2F *[3];
942 fTPC_p = new TH2F *[3];
943 fTPCnsigma_p = new TH2F *[3];
944
945 fECluster= new TH1F *[3];
946 fEtaPhi= new TH2F *[3];
947 fVtxZ= new TH1F *[3];
0131ce6c 948 fEtad= new TH1F *[3];
c852fdae 949 fNTracks= new TH1F *[3];
8e2d649d 950
951 fNTracks_pt= new TH2F *[3];
952 fNTracks_eta= new TH2F *[3];
953 fNTracks_phi= new TH2F *[3];
954
c852fdae 955 fNClusters= new TH1F *[3];
956 fTPCNcls_EoverP= new TH2F *[3];
aaec953d 957 fTPCNcls_pid=new TH2F *[4];
c852fdae 958
8e2d649d 959
960
c852fdae 961 for(Int_t i = 0; i < 3; i++)
962 {
9a1f999b 963 fEoverP_pt[i] = new TH2F(Form("fEoverP_pt%d",i),";p_{t} (GeV/c);E / p ",1000,0,30,500,0,2);
964 fTPC_p[i] = new TH2F(Form("fTPC_p%d",i),";pt (GeV/c);TPC dE/dx (a. u.)",1000,0.3,15,1000,-20,200);
965 fTPCnsigma_p[i] = new TH2F(Form("fTPCnsigma_p%d",i),";p (GeV/c);TPC Electron N#sigma",1000,0.3,15,1000,-15,10);
966
967
968 fECluster[i]= new TH1F(Form("fECluster%d",i), ";ECluster",2000, 0,100);
969 fEtaPhi[i]= new TH2F(Form("fEtaPhi%d",i),"#eta x #phi Clusters;#phi;#eta",200,0.,5,50,-1.,1.);
970 fVtxZ[i]= new TH1F(Form("fVtxZ%d",i),"VtxZ",1000, -50,50);
0131ce6c 971 fEtad[i]= new TH1F(Form("fEtad%d",i),"Eta distribution",200, -1.2,1.2);
972 fNTracks[i]= new TH1F(Form("fNTracks%d",i),"NTracks",1000, 0,5000);
8e2d649d 973
974 fNTracks_pt[i]= new TH2F(Form("fNTracks_pt%d",i),"NTracks vs. pt",1000, 0,5000, 1000, 0, 100);
975 fNTracks_eta[i]= new TH2F(Form("fNTracks_eta%d",i),"NTracks vs. pt",1000, 0,5000, 500, -1.0, 1.0);
976 fNTracks_phi[i]= new TH2F(Form("fNTracks_phi%d",i),"NTracks vs. pt",1000, 0,5000, 500, 0, 5.0);
977
978
979
9a1f999b 980 fNClusters[i]= new TH1F(Form("fNClusters%d",i),"fNClusters0",200, 0,100);
981 fTPCNcls_EoverP[i]= new TH2F(Form("fTPCNcls_EoverP%d",i),"TPCNcls_EoverP",1000,0,200,200,0,2);
aaec953d 982
9a1f999b 983
984
985 fOutputList->Add(fEoverP_pt[i]);
986 fOutputList->Add(fTPC_p[i]);
987 fOutputList->Add(fTPCnsigma_p[i]);
988
989
990 fOutputList->Add(fECluster[i]);
991 fOutputList->Add(fEtaPhi[i]);
992 fOutputList->Add(fVtxZ[i]);
0131ce6c 993 fOutputList->Add(fEtad[i]);
9a1f999b 994 fOutputList->Add(fNTracks[i]);
8e2d649d 995
996 fOutputList->Add(fNTracks_pt[i]);
997 fOutputList->Add(fNTracks_eta[i]);
998 fOutputList->Add(fNTracks_phi[i]);
999
9a1f999b 1000 fOutputList->Add(fNClusters[i]);
1001 fOutputList->Add(fTPCNcls_EoverP[i]);
c852fdae 1002 }
1003
1dd85087 1004 fTrack_Multi= new TH1F("fTrack_Multi","fTrack_Multi",1000, 0,1000);
1005
aaec953d 1006 for(Int_t i = 0; i < 4; i++)
1007 {
1008 fTPCNcls_pid[i]= new TH2F(Form("fTPCNcls_pid%d",i),"fTPCNcls_pid;NCls;NCls for PID",200,0,200,200,0,200);
1009 fOutputList->Add(fTPCNcls_pid[i]);
1010 }
1011
9a1f999b 1012 //pt bin
2c8e1f6c 1013 Int_t fPtBin[7] = {1,2,4,6,8,10,15};
1014
1015 fEoverP_tpc = new TH2F *[6];
1016 fTPC_pt = new TH1F *[6];
1017 fTPCnsigma_pt = new TH1F *[6];
1018
1019 fEta=new TH1F *[6];
1020 fPhi=new TH1F *[6];
1021 fR=new TH1F *[6];
1022 fR_EoverP=new TH2F *[6];
1023 fNcells=new TH1F *[6];
1024 fNcells_EoverP=new TH2F *[6];
1025 fM02_EoverP= new TH2F *[6];
1026 fM20_EoverP= new TH2F *[6];
1027 fEoverP_ptbins=new TH1F *[6];
1028 fECluster_ptbins=new TH1F *[6];
1029 fEoverP_wSSCut=new TH1F *[6];
1030 fNcells_electrons=new TH1F *[6];
1031 fNcells_hadrons=new TH1F *[6];
1032 fTPCnsigma_eta_electrons=new TH2F *[6];
1033 fTPCnsigma_eta_hadrons=new TH2F *[6];
c852fdae 1034
1035 if(fCorrelationFlag)
1036 {
2c8e1f6c 1037 fCEtaPhi_Inc = new TH2F *[6];
1038 fCEtaPhi_Inc_DiHadron = new TH2F *[6];
c852fdae 1039
2c8e1f6c 1040 fCEtaPhi_ULS = new TH2F *[6];
1041 fCEtaPhi_LS = new TH2F *[6];
1042 fCEtaPhi_ULS_NoP = new TH2F *[6];
1043 fCEtaPhi_LS_NoP = new TH2F *[6];
c852fdae 1044
2c8e1f6c 1045 fCEtaPhi_ULS_Weight = new TH2F *[6];
1046 fCEtaPhi_LS_Weight = new TH2F *[6];
1047 fCEtaPhi_ULS_NoP_Weight = new TH2F *[6];
1048 fCEtaPhi_LS_NoP_Weight = new TH2F *[6];
c852fdae 1049
2c8e1f6c 1050 fCEtaPhi_Inc_EM = new TH2F *[6];
c852fdae 1051
2c8e1f6c 1052 fCEtaPhi_ULS_EM = new TH2F *[6];
1053 fCEtaPhi_LS_EM = new TH2F *[6];
c852fdae 1054
2c8e1f6c 1055 fCEtaPhi_ULS_Weight_EM = new TH2F *[6];
1056 fCEtaPhi_LS_Weight_EM = new TH2F *[6];
c852fdae 1057
1058 fInvMass = new TH1F("fInvMass","",200,0,0.3);
1059 fInvMassBack = new TH1F("fInvMassBack","",200,0,0.3);
1060 fDCA = new TH1F("fDCA","",200,0,1);
1061 fDCABack = new TH1F("fDCABack","",200,0,1);
1062 fOpAngle = new TH1F("fOpAngle","",200,0,0.5);
1063 fOpAngleBack = new TH1F("fOpAngleBack","",200,0,0.5);
1064
1065 fOutputList->Add(fInvMass);
1066 fOutputList->Add(fInvMassBack);
1067 fOutputList->Add(fDCA);
1068 fOutputList->Add(fDCABack);
1069 fOutputList->Add(fOpAngle);
1070 fOutputList->Add(fOpAngleBack);
1071 }
1072
9a4682da 1073 if(fFillBackground){
1074
1075 fInvMass = new TH1F("fInvMass","",200,0,0.3);
1076 fInvMassBack = new TH1F("fInvMassBack","",200,0,0.3);
1077 fDCA = new TH1F("fDCA","",200,0,1);
1078 fDCABack = new TH1F("fDCABack","",200,0,1);
1079 fOpAngle = new TH1F("fOpAngle","",200,0,0.5);
1080 fOpAngleBack = new TH1F("fOpAngleBack","",200,0,0.5);
9a1f999b 1081
9a4682da 1082 fOutputList->Add(fInvMass);
1083 fOutputList->Add(fInvMassBack);
1084 fOutputList->Add(fDCA);
1085 fOutputList->Add(fDCABack);
1086 fOutputList->Add(fOpAngle);
1087 fOutputList->Add(fOpAngleBack);
1088
9a1f999b 1089 //histos for TPC-only
9a4682da 1090 fInvMass2 = new TH1F("fInvMass2","",200,0,0.3);
1091 fInvMassBack2 = new TH1F("fInvMassBack2","",200,0,0.3);
1092 fDCA2 = new TH1F("fDCA2","",200,0,1);
1093 fDCABack2 = new TH1F("fDCABack2","",200,0,1);
1094 fOpAngle2 = new TH1F("fOpAngle2","",200,0,0.5);
1095 fOpAngleBack2 = new TH1F("fOpAngleBack2","",200,0,0.5);
1096
1097 fOutputList->Add(fInvMass2);
1098 fOutputList->Add(fInvMassBack2);
1099 fOutputList->Add(fDCA2);
1100 fOutputList->Add(fDCABack2);
1101 fOutputList->Add(fOpAngle2);
1102 fOutputList->Add(fOpAngleBack2);
1103
1104 }
1105
2c8e1f6c 1106 for(Int_t i = 0; i < 6; i++)
c852fdae 1107 {
9a1f999b 1108 fEoverP_tpc[i] = new TH2F(Form("fEoverP_tpc%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;E / p ",fPtBin[i],fPtBin[i+1]),1000,-15,15,100,0,2);
1109 fTPC_pt[i] = new TH1F(Form("fTPC_pt%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;Count",fPtBin[i],fPtBin[i+1]),200,20,200);
1110 fTPCnsigma_pt[i] = new TH1F(Form("fTPCnsigma_pt%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;Count",fPtBin[i],fPtBin[i+1]),200,-15,10);
1111
1112 fEta[i]=new TH1F(Form("fEta%d",i), Form("%d < p_{t} < %d GeV/c;#eta; counts",fPtBin[i],fPtBin[i+1]),100, -0.1,0.1);
1113 fPhi[i]=new TH1F(Form("fPhi%d",i),Form("%d < p_{t} < %d GeV/c;#phi; counts )",fPtBin[i],fPtBin[i+1]), 100, -0.1,0.1);
1114 fR[i]=new TH1F(Form("fR%d",i),Form("%d < p_{t} < %d GeV/c;R;counts )",fPtBin[i],fPtBin[i+1]), 100, -0.1,0.1);
1115 fR_EoverP[i]=new TH2F(Form("fR_EoverP%d",i),Form("%d < p_{t} < %d GeV/c;R;E / p ",fPtBin[i],fPtBin[i+1]),100, 0,0.1,1000,0,10);
1116 fNcells[i]=new TH1F(Form("fNcells%d",i), Form("%d < p_{t} < %d GeV/c;ncells;counts ",fPtBin[i],fPtBin[i+1]),100, 0, 30);
1117 fNcells_electrons[i]=new TH1F(Form("fNcells_electrons%d",i), Form("%d < p_{t} < %d GeV/c;ncells;counts ",fPtBin[i],fPtBin[i+1]),100, 0, 30);
1118 fNcells_hadrons[i]=new TH1F(Form("fNcells_hadrons%d",i), Form("%d < p_{t} < %d GeV/c;ncells;counts ",fPtBin[i],fPtBin[i+1]),100, 0, 30);
1119 fNcells_EoverP[i]=new TH2F(Form("fNcells_EoverP%d",i),Form("%d < p_{t} < %d GeV/c; Ncells; E / p ",fPtBin[i],fPtBin[i+1]),1000, 0,20,100,0,30);
1120 fM02_EoverP[i]= new TH2F(Form("fM02_EoverP%d",i),Form("%d < p_{t} < %d GeV/c; M02; E / p ",fPtBin[i],fPtBin[i+1]),1000,0,100,100,0,2);
1121 fM20_EoverP[i]= new TH2F(Form("fM20_EoverP%d",i),Form("%d < p_{t} < %d GeV/c; M20; E / p ",fPtBin[i],fPtBin[i+1]),1000,0,100,100,0,2);
1122 fEoverP_ptbins[i] = new TH1F(Form("fEoverP_ptbins%d",i),Form("%d < p_{t} < %d GeV/c;E / p ",fPtBin[i],fPtBin[i+1]),500,0,2);
1123 fECluster_ptbins[i]= new TH1F(Form("fECluster_ptbins%d",i), Form("%d < p_{t} < %d GeV/c;ECluster; Counts ",fPtBin[i],fPtBin[i+1]),2000, 0,100);
1124 fEoverP_wSSCut[i]=new TH1F(Form("fEoverP_wSSCut%d",i),Form("%d < p_{t} < %d GeV/c;E / p ; Counts",fPtBin[i],fPtBin[i+1]),500,0,2);
1125 fTPCnsigma_eta_electrons[i]=new TH2F(Form("fTPCnsigma_eta_electrons%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;Eta ",fPtBin[i],fPtBin[i+1]),1000,-15,15,100,-1,1);
1126 fTPCnsigma_eta_hadrons[i]=new TH2F(Form("fTPCnsigma_eta_hadrons%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;Eta ",fPtBin[i],fPtBin[i+1]),1000,-15,15,100,-1,1);
1127
1128 fOutputList->Add(fEoverP_tpc[i]);
1129 fOutputList->Add(fTPC_pt[i]);
1130 fOutputList->Add(fTPCnsigma_pt[i]);
1131
1132 fOutputList->Add(fEta[i]);
1133 fOutputList->Add(fPhi[i]);
1134 fOutputList->Add(fR[i]);
1135 fOutputList->Add(fR_EoverP[i]);
1136 fOutputList->Add(fNcells[i]);
1137 fOutputList->Add(fNcells_electrons[i]);
1138 fOutputList->Add(fNcells_hadrons[i]);
1139 fOutputList->Add(fNcells_EoverP[i]);
1140 fOutputList->Add(fECluster_ptbins[i]);
1141 fOutputList->Add(fEoverP_ptbins[i]);
1142 fOutputList->Add(fEoverP_wSSCut[i]);
1143 fOutputList->Add(fM02_EoverP[i]);
1144 fOutputList->Add(fM20_EoverP[i]);
1145 fOutputList->Add(fTPCnsigma_eta_electrons[i]);
1146 fOutputList->Add(fTPCnsigma_eta_hadrons[i]);
1147
1148
c852fdae 1149 if(fCorrelationFlag)
1150 {
1151 fCEtaPhi_Inc[i] = new TH2F(Form("fCEtaPhi_Inc%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1152 fCEtaPhi_Inc_DiHadron[i] = new TH2F(Form("fCEtaPhi_Inc_DiHadron%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1153
1154 fCEtaPhi_ULS[i] = new TH2F(Form("fCEtaPhi_ULS%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1155 fCEtaPhi_LS[i] = new TH2F(Form("fCEtaPhi_LS%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1156 fCEtaPhi_ULS_NoP[i] = new TH2F(Form("fCEtaPhi_ULS_NoP%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1157 fCEtaPhi_LS_NoP[i] = new TH2F(Form("fCEtaPhi_LS_NoP%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1158
1159 fCEtaPhi_ULS_Weight[i] = new TH2F(Form("fCEtaPhi_ULS_Weight%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1160 fCEtaPhi_LS_Weight[i] = new TH2F(Form("fCEtaPhi_LS_Weight%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1161 fCEtaPhi_ULS_NoP_Weight[i] = new TH2F(Form("fCEtaPhi_ULS_NoP_Weight%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1162 fCEtaPhi_LS_NoP_Weight[i] = new TH2F(Form("fCEtaPhi_LS_NoP_Weight%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1163
1164 fOutputList->Add(fCEtaPhi_Inc[i]);
1165 fOutputList->Add(fCEtaPhi_Inc_DiHadron[i]);
1166
1167 fOutputList->Add(fCEtaPhi_ULS[i]);
1168 fOutputList->Add(fCEtaPhi_LS[i]);
1169 fOutputList->Add(fCEtaPhi_ULS_NoP[i]);
1170 fOutputList->Add(fCEtaPhi_LS_NoP[i]);
1171
1172 fOutputList->Add(fCEtaPhi_ULS_Weight[i]);
1173 fOutputList->Add(fCEtaPhi_LS_Weight[i]);
1174 fOutputList->Add(fCEtaPhi_ULS_NoP_Weight[i]);
1175 fOutputList->Add(fCEtaPhi_LS_NoP_Weight[i]);
1176
1177 if(fEventMixingFlag)
1178 {
1179 fCEtaPhi_Inc_EM[i] = new TH2F(Form("fCEtaPhi_Inc_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1180
1181 fCEtaPhi_ULS_EM[i] = new TH2F(Form("fCEtaPhi_ULS_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1182 fCEtaPhi_LS_EM[i] = new TH2F(Form("fCEtaPhi_LS_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1183
1184 fCEtaPhi_ULS_Weight_EM[i] = new TH2F(Form("fCEtaPhi_ULS_Weight_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1185 fCEtaPhi_LS_Weight_EM[i] = new TH2F(Form("fCEtaPhi_LS_Weight_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1186
1187 fOutputList->Add(fCEtaPhi_Inc_EM[i]);
1188
1189 fOutputList->Add(fCEtaPhi_ULS_EM[i]);
1190 fOutputList->Add(fCEtaPhi_LS_EM[i]);
1191
1192 fOutputList->Add(fCEtaPhi_ULS_Weight_EM[i]);
1193 fOutputList->Add(fCEtaPhi_LS_Weight_EM[i]);
1194 }
1195 }
1196 }
1197
9a1f999b 1198 //pt integrated
c852fdae 1199 fTPCnsigma_eta = new TH2F("fTPCnsigma_eta",";Pseudorapidity #eta; TPC signal - <TPC signal>_{elec} (#sigma)",200,-0.9,0.9,200,-15,15);
1200 fTPCnsigma_phi = new TH2F("fTPCnsigma_phi",";Azimuthal Angle #phi; TPC signal - <TPC signal>_{elec} (#sigma)",200,0,2*TMath::Pi(),200,-15,15);
1201
aaec953d 1202
c852fdae 1203
1204 fNcells_pt=new TH2F("fNcells_pt","fNcells_pt",1000, 0,20,100,0,30);
1205 fEoverP_pt_pions= new TH2F("fEoverP_pt_pions","fEoverP_pt_pions",1000,0,30,500,0,2);
1206
1207 ftpc_p_EoverPcut= new TH2F("ftpc_p_EoverPcut","ftpc_p_EoverPcut",1000,0,30,200,20,200);
1208 fnsigma_p_EoverPcut= new TH2F("fnsigma_p_EoverPcut","fnsigma_p_EoverPcut",1000,0,30,500,-15,15);
1209
1210 fEoverP_pt_pions2= new TH2F("fEoverP_pt_pions2","fEoverP_pt_pions2",1000,0,30,500,0,2);
1211 fEoverP_pt_hadrons= new TH2F("fEoverP_pt_hadrons","fEoverP_pt_hadrons",1000,0,30,500,0,2);
1212
1213
1214 fOutputList->Add(fTPCnsigma_eta);
1215 fOutputList->Add(fTPCnsigma_phi);
1216
1217 fOutputList->Add(fNcells_pt);
1218 fOutputList->Add(fEoverP_pt_pions);
1219
1220 fOutputList->Add(ftpc_p_EoverPcut);
1221 fOutputList->Add(fnsigma_p_EoverPcut);
1222
1223 fOutputList->Add(fEoverP_pt_pions2);
1224 fOutputList->Add(fEoverP_pt_hadrons);
1225
8e2d649d 1226 fOutputList->Add(fVtxZ_new1);
1227 fOutputList->Add(fVtxZ_new2);
1228 fOutputList->Add(fVtxZ_new3);
1229 fOutputList->Add(fVtxZ_new4);
1230
1dd85087 1231 fOutputList->Add(fzRes1);
1232 fOutputList->Add(fzRes2);
1233 fOutputList->Add(fSPD_track_vtx1);
1234 fOutputList->Add(fSPD_track_vtx2);
aaec953d 1235
31185d97 1236
1237
9a1f999b 1238 //__________________________________________________________________
1239 //Efficiency studies
c852fdae 1240 if(fIsMC)
1241 {
9a4682da 1242 fPtBackgroundBeforeReco = new TH1F("fPtBackgroundBeforeReco",";p_{T} (GeV/c);Count",300,0,30);
2c8e1f6c 1243 fPtBackgroundBeforeReco_weight = new TH1F("fPtBackgroundBeforeReco_weight",";p_{T} (GeV/c);Count",300,0,30);
9a4682da 1244 if(fFillBackground)fPtBackgroundBeforeReco2 = new TH1F("fPtBackgroundBeforeReco2",";p_{T} (GeV/c);Count",300,0,30);
2c8e1f6c 1245 if(fFillBackground)fPtBackgroundBeforeReco2_weight = new TH1F("fPtBackgroundBeforeReco2_weight",";p_{T} (GeV/c);Count",300,0,30);
2235208e 1246 fpT_m_electron= new TH2F("fpT_m_electron","fpT_m_electron",300,0,30,300,0,30);
1247 fpT_gm_electron= new TH2F("fpT_gm_electron","fpT_gm_electron",300,0,30,300,0,30);
2c8e1f6c 1248
9a4682da 1249 fPtBackgroundAfterReco = new TH1F("fPtBackgroundAfterReco",";p_{T} (GeV/c);Count",300,0,30);
9a1f999b 1250 fPtMCparticleAll = new TH1F("fPtMCparticleAll",";p_{T} (GeV/c);Count",200,0,40);
1251 fPtMCparticleReco = new TH1F("fPtMCparticleReco",";p_{T} (GeV/c);Count",200,0,40);
1252
1253 fPtMCparticleAll_nonPrimary = new TH1F("fPtMCparticleAll_nonPrimary",";p_{T} (GeV/c);Count",200,0,40);
2c8e1f6c 1254 fPtMCparticleAlle_nonPrimary = new TH1F("fPtMCparticleAlle_nonPrimary",";p_{T} (GeV/c);Count",200,0,40);
1255 fPtMCparticleAlle_Primary = new TH1F("fPtMCparticleAlle_Primary",";p_{T} (GeV/c);Count",200,0,40);
1256
9a1f999b 1257 fPtMCparticleReco_nonPrimary = new TH1F("fPtMCparticleReco_nonPrimary",";p_{T} (GeV/c);Count",200,0,40);
1258
c852fdae 1259 fPtMCparticleAllHfe1 = new TH1F("fPtMCparticleAllHfe1",";p_{t} (GeV/c);Count",200,0,40);
1260 fPtMCparticleRecoHfe1 = new TH1F("fPtMCparticleRecoHfe1",";p_{t} (GeV/c);Count",200,0,40);
1261 fPtMCparticleAllHfe2 = new TH1F("fPtMCparticleAllHfe2",";p_{t} (GeV/c);Count",200,0,40);
1262 fPtMCparticleRecoHfe2 = new TH1F("fPtMCparticleRecoHfe2",";p_{t} (GeV/c);Count",200,0,40);
9a1f999b 1263
1264 fPtMCelectronAfterAll = new TH1F("fPtMCelectronAfterAll",";p_{T} (GeV/c);Count",200,0,40);
8e2d649d 1265 fPtMCelectronAfterAll_unfolding = new TH1F("fPtMCelectronAfterAll_unfolding",";p_{T} (GeV/c);Count",200,0,40);
9a1f999b 1266 fPtMCelectronAfterAll_nonPrimary = new TH1F("fPtMCelectronAfterAll_nonPrimary",";p_{T} (GeV/c);Count",200,0,40);
2c8e1f6c 1267 fPtMCelectronAfterAll_Primary = new TH1F("fPtMCelectronAfterAll_Primary",";p_{T} (GeV/c);Count",200,0,40);
1268
9a1f999b 1269
1270
1271 fPtMCpi0 = new TH1F("fPtMCpi0",";p_{t} (GeV/c);Count",200,0,30);
1272 fPtMCeta = new TH1F("fPtMCeta",";p_{T} (GeV/c);Count",200,0,30);
8e2d649d 1273 fPtMCpi02 = new TH1F("fPtMCpi02",";p_{t} (GeV/c);Count",200,0,30);
1274 fPtMCeta2 = new TH1F("fPtMCeta2",";p_{T} (GeV/c);Count",200,0,30);
1dd85087 1275 fPtMCpi03 = new TH1F("fPtMCpi03",";p_{t} (GeV/c);Count",200,0,30);
1276 fPtMCeta3 = new TH1F("fPtMCeta3",";p_{T} (GeV/c);Count",200,0,30);
1277
c852fdae 1278 fPtMC_EMCal_All= new TH1F("fPtMC_EMCal_All",";p_{t} (GeV/c);Count",200,0,40);
1279 fPtMC_EMCal_Selected= new TH1F("fPtMC_EMCal_Selected",";p_{t} (GeV/c);Count",200,0,40);
8e2d649d 1280 fPtMC_TPC_All= new TH1F("fPtMC_TPC_All",";p_{T} (GeV/c);Count",200,0,40);
1281 fPtMC_TPC_Selected = new TH1F("fPtMC_TPC_Selected",";p_{T} (GeV/c);Count",200,0,40);
1282
1283 fPt_track_match_den = new TH1F("fPt_track_match_den",";p_{T} (GeV/c);Count",200,0,40);
1284 fPt_track_match_num = new TH1F("fPt_track_match_num",";p_{T} (GeV/c);Count",200,0,40);
1285
c852fdae 1286 fPtMCWithLabel = new TH1F("fPtMCWithLabel",";p_{t} (GeV/c);Count",200,0,40);
1287 fPtMCWithoutLabel = new TH1F("fPtMCWithoutLabel",";p_{t} (GeV/c);Count",200,0,40);
1288 fPtIsPhysicaPrimary = new TH1F("fPtIsPhysicaPrimary",";p_{t} (GeV/c);Count",200,0,40);
1289
1290 fOutputList->Add(fPtBackgroundBeforeReco);
2c8e1f6c 1291 fOutputList->Add(fPtBackgroundBeforeReco_weight);
1292
9a4682da 1293 if(fFillBackground) fOutputList->Add(fPtBackgroundBeforeReco2);
2c8e1f6c 1294 if(fFillBackground) fOutputList->Add(fPtBackgroundBeforeReco2_weight);
2235208e 1295
1296 fOutputList->Add(fpT_m_electron);
1297 fOutputList->Add(fpT_gm_electron);
1298
c852fdae 1299 fOutputList->Add(fPtBackgroundAfterReco);
1300 fOutputList->Add(fPtMCparticleAll);
1301 fOutputList->Add(fPtMCparticleReco);
9a1f999b 1302
1303 fOutputList->Add(fPtMCparticleAll_nonPrimary);
1304 fOutputList->Add(fPtMCparticleAlle_nonPrimary);
2c8e1f6c 1305
1306 fOutputList->Add(fPtMCparticleAlle_Primary);
9a1f999b 1307 fOutputList->Add(fPtMCparticleReco_nonPrimary);
1308
c852fdae 1309 fOutputList->Add(fPtMCparticleAllHfe1);
1310 fOutputList->Add(fPtMCparticleRecoHfe1);
1311 fOutputList->Add(fPtMCparticleAllHfe2);
1312 fOutputList->Add(fPtMCparticleRecoHfe2);
1313 fOutputList->Add(fPtMCelectronAfterAll);
8e2d649d 1314 fOutputList->Add(fPtMCelectronAfterAll_unfolding);
9a1f999b 1315
1316 fOutputList->Add(fPtMCelectronAfterAll_nonPrimary);
2c8e1f6c 1317 fOutputList->Add(fPtMCelectronAfterAll_Primary);
1318
9a1f999b 1319
1320
c852fdae 1321 fOutputList->Add(fPtMCpi0);
9a1f999b 1322 fOutputList->Add(fPtMCeta);
8e2d649d 1323 fOutputList->Add(fPtMCpi02);
1324 fOutputList->Add(fPtMCeta2);
1dd85087 1325 fOutputList->Add(fPtMCpi03);
1326 fOutputList->Add(fPtMCeta3);
c852fdae 1327 fOutputList->Add(fPtMC_EMCal_All);
1328 fOutputList->Add(fPtMC_EMCal_Selected);
1329 fOutputList->Add(fPtMC_TPC_All);
1330 fOutputList->Add(fPtMC_TPC_Selected);
8e2d649d 1331
1332 fOutputList->Add(fPt_track_match_den);
1333 fOutputList->Add(fPt_track_match_num);
1334
c852fdae 1335 fOutputList->Add(fPtMCWithLabel);
1336 fOutputList->Add(fPtMCWithoutLabel);
1337 fOutputList->Add(fPtIsPhysicaPrimary);
1338 }
1339
1340 fCentralityHist = new TH1F("fCentralityHist",";Centrality (%); Count",1000000,0,100);
1341 fCentralityHistPass = new TH1F("fCentralityHistPass",";Centrality (%); Count",1000000,0,100);
1342 fOutputList->Add(fCentralityHist);
1343 fOutputList->Add(fCentralityHistPass);
1344
1dd85087 1345 //______________________________________________________________________
1346 //Mixed event analysis
c852fdae 1347 if(fEventMixingFlag)
1348 {
1349 fPoolNevents = new TH1F("fPoolNevents","Event Mixing Statistics; Number of events; Count",1000,0,1000);
1350 fOutputList->Add(fPoolNevents);
1351
1352 Int_t trackDepth = 2000; // number of objects (tracks) kept per event buffer bin. Once the number of stored objects (tracks) is above that limit, the oldest ones are removed.
1353 Int_t poolsize = 1000; // Maximum number of events, ignored in the present implemented of AliEventPoolManager
1354
1355 Int_t nCentralityBins = 15;
1356 Double_t centralityBins[] = { 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1 };
1357
1358 Int_t nZvtxBins = 9;
1359 Double_t vertexBins[] = {-10, -7, -5, -3, -1, 1, 3, 5, 7, 10};
1360
1361 fPoolMgr = new AliEventPoolManager(poolsize, trackDepth, nCentralityBins, (Double_t*) centralityBins, nZvtxBins, (Double_t*) vertexBins);
1362 }
9a1f999b 1363 //______________________________________________________________________
c852fdae 1364
1365 PostData(1, fOutputList);
1366
9a1f999b 1367 ///______________________________________________________________________
c852fdae 1368}
1369
8e2d649d 1370//______________________________________________________________________
1371//Main loop
1372//Called for each event
c852fdae 1373void AliAnalysisTaskEMCalHFEpA::UserExec(Option_t *)
1374{
9a1f999b 1375 //Check Event
c852fdae 1376 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
1377 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
1378
1379 if(!(fESD || fAOD))
1380 {
1381 printf("ERROR: fESD & fAOD not available\n");
1382 return;
1383 }
1384
1385 fVevent = dynamic_cast<AliVEvent*>(InputEvent());
1386
1387 if(!fVevent)
1388 {
1389 printf("ERROR: fVEvent not available\n");
1390 return;
1391 }
9a1f999b 1392
1393 //Check Cuts
c852fdae 1394 if(!fCuts)
1395 {
1396 AliError("HFE cuts not available");
1397 return;
1398 }
9a1f999b 1399 //Check PID
c852fdae 1400 if(!fPID->IsInitialized())
1401 {
9a1f999b 1402 // Initialize PID with the given run number
c852fdae 1403 AliWarning("PID not initialised, get from Run no");
1404
1405 if(fIsAOD)
1406 {
1407 fPID->InitializePID(fAOD->GetRunNumber());
1408 }
1409 else
1410 {
1411 fPID->InitializePID(fESD->GetRunNumber());
1412 }
1413 }
1414
9a1f999b 1415 //PID response
c852fdae 1416 fPidResponse = fInputHandler->GetPIDResponse();
1417
9a1f999b 1418
1419 //Check PID response
c852fdae 1420 if(!fPidResponse)
1421 {
1422 AliDebug(1, "Using default PID Response");
1423 fPidResponse = AliHFEtools::GetDefaultPID(kFALSE, fInputEvent->IsA() == AliAODEvent::Class());
1424 }
9a1f999b 1425
c852fdae 1426 fPID->SetPIDResponse(fPidResponse);
9a1f999b 1427
c852fdae 1428 fCFM->SetRecEventInfo(fVevent);
9a1f999b 1429
c852fdae 1430 Double_t *fListOfmotherkink = 0;
1431 Int_t fNumberOfVertices = 0;
1432 Int_t fNumberOfMotherkink = 0;
9a1f999b 1433
1dd85087 1434
1435 //total event before event selection
1436 fNevent->Fill(1);
1437
1438 //______________________________________________________________________
1439 //Vertex Selection
c852fdae 1440 if(fIsAOD)
1441 {
1442 const AliAODVertex* trkVtx = fAOD->GetPrimaryVertex();
1443 if(!trkVtx || trkVtx->GetNContributors()<=0) return;
1444 TString vtxTtl = trkVtx->GetTitle();
1445 if(!vtxTtl.Contains("VertexerTracks")) return;
1dd85087 1446 //Float_t zvtx = trkVtx->GetZ();
1447 Float_t zvtx = -100;
1448 zvtx=trkVtx->GetZ();
c852fdae 1449 fZvtx = zvtx;
8e2d649d 1450
1451 fVtxZ_new1->Fill(fZvtx);
1452
c852fdae 1453 const AliAODVertex* spdVtx = fAOD->GetPrimaryVertexSPD();
1454 if(spdVtx->GetNContributors()<=0) return;
1455 TString vtxTyp = spdVtx->GetTitle();
1456 Double_t cov[6]={0};
1457 spdVtx->GetCovarianceMatrix(cov);
1458 Double_t zRes = TMath::Sqrt(cov[5]);
1dd85087 1459
1460 fzRes1->Fill(zRes);
c852fdae 1461 if(vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) return;
1dd85087 1462 fzRes2->Fill(zRes);
1463
1464 fSPD_track_vtx1->Fill(spdVtx->GetZ() - trkVtx->GetZ());
c852fdae 1465 if(TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return;
1dd85087 1466 fSPD_track_vtx2->Fill(spdVtx->GetZ() - trkVtx->GetZ());
1467
c852fdae 1468
1dd85087 1469 if(TMath::Abs(zvtx) > 10) return;
8e2d649d 1470 fVtxZ_new2->Fill(fZvtx);
1471
1dd85087 1472 if(fabs(zvtx>10.0))return;
1473 fVtxZ_new3->Fill(fZvtx);
1474
1475
1476 //Look for kink mother for AOD
c852fdae 1477
1478 fNumberOfVertices = 0;
1479 fNumberOfMotherkink = 0;
1480
1481 if(fIsAOD)
1482 {
1483 fNumberOfVertices = fAOD->GetNumberOfVertices();
1484
1485 fListOfmotherkink = new Double_t[fNumberOfVertices];
1486
1487 for(Int_t ivertex=0; ivertex < fNumberOfVertices; ivertex++)
1488 {
1489 AliAODVertex *aodvertex = fAOD->GetVertex(ivertex);
1490 if(!aodvertex) continue;
1491 if(aodvertex->GetType()==AliAODVertex::kKink)
1492 {
1493 AliAODTrack *mother1 = (AliAODTrack *) aodvertex->GetParent();
1494 if(!mother1) continue;
1495 Int_t idmother = mother1->GetID();
1496 fListOfmotherkink[fNumberOfMotherkink] = idmother;
1497 fNumberOfMotherkink++;
1498 }
1499 }
1500 }
1501 }
1502 else
1503 {
c852fdae 1504
c852fdae 1505
9a1f999b 1506
0131ce6c 1507 /// ESD
8079a103 1508 const AliESDVertex* trkVtx = fESD->GetPrimaryVertex();
c852fdae 1509 if(!trkVtx || trkVtx->GetNContributors()<=0) return;
1510 TString vtxTtl = trkVtx->GetTitle();
1511 if(!vtxTtl.Contains("VertexerTracks")) return;
1dd85087 1512 Float_t zvtx = -100;
1513 zvtx=trkVtx->GetZ();
1514
8079a103 1515
1516 const AliESDVertex* spdVtx = fESD->GetPrimaryVertexSPD();
c852fdae 1517 if(spdVtx->GetNContributors()<=0) return;
1518 TString vtxTyp = spdVtx->GetTitle();
1519 Double_t cov[6]={0};
1520 spdVtx->GetCovarianceMatrix(cov);
1521 Double_t zRes = TMath::Sqrt(cov[5]);
1522 if(vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) return;
1523 if(TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return;
8079a103 1524 if(TMath::Abs(zvtx) > 10) return;
c852fdae 1525 }
c852fdae 1526
1dd85087 1527 //______________________________________________________________________
1528 //after vertex selection
1529 fNevent->Fill(10);
1530
1531 //______________________________________________________________________
1532 //EMCal Trigger Selection (Threshold selection)
1533
1534 TString firedTrigger;
1535 TString TriggerEG1("EG1"); //takes trigger with name with EG1, ex: CEMC7EG1-B-NOPF-CENTNOTRD
1536 TString TriggerEG2("EG2");
1537 //Jan 17, 2014
1538 //TString TriggerEJE("EJE");
8e2d649d 1539
1dd85087 1540 if(fAOD) firedTrigger = fAOD->GetFiredTriggerClasses();
1541 else if(fESD) firedTrigger = fESD->GetFiredTriggerClasses();
1542
1543 //Bool_t IsEventEMCALL0=kTRUE;
1544 Bool_t IsEventEMCALL1=kFALSE;
1545
1546 if(firedTrigger.Contains(TriggerEG1)){
1547 fNevent->Fill(2);
1548 IsEventEMCALL1=kTRUE;
1549 }
1550 if(firedTrigger.Contains(TriggerEG2)){
1551 fNevent->Fill(3);
1552 IsEventEMCALL1=kTRUE;
1553 }
1554
1555 //if the flag is for a given threshold and it was not fired, return.
1556
1557 if(fEMCEG1){
1558 if(!firedTrigger.Contains(TriggerEG1))return;
1559 if(firedTrigger.Contains(TriggerEG2)){
1560 fNevent->Fill(4);
1561
1562 }
1563
1564 }
1565
1566
1567 if(fEMCEG2){
1568 if(!firedTrigger.Contains(TriggerEG2))return;
1569 if(firedTrigger.Contains(TriggerEG1)){
1570 fNevent->Fill(5);
1571 }
1572
1573 }
1574
9a1f999b 1575
8e2d649d 1576
1dd85087 1577 //______________________________________________________________________
1578 //Testing if there is an overlap EGA and EJE
1579 //none
1580 /*
1581 if(!(firedTrigger.Contains(TriggerEG1) && firedTrigger.Contains(TriggerEG2) ) && !firedTrigger.Contains(TriggerEJE))
1582 {
1583 fNevent->Fill(6);
1584 }
1585 //only GA
1586 if((firedTrigger.Contains(TriggerEG1) || firedTrigger.Contains(TriggerEG2)) && !firedTrigger.Contains(TriggerEJE))
1587 {
1588 fNevent->Fill(7);
1589 }
1590 //only JE
1591 if(!(firedTrigger.Contains(TriggerEG1) && firedTrigger.Contains(TriggerEG2)) && firedTrigger.Contains(TriggerEJE))
1592 {
1593 fNevent->Fill(8);
1594 }
1595 //both
1596 if((firedTrigger.Contains(TriggerEG1) || firedTrigger.Contains(TriggerEG2)) && firedTrigger.Contains(TriggerEJE))
1597 {
1598 fNevent->Fill(9);
1599 }
1600 */
0131ce6c 1601
8e2d649d 1602
1dd85087 1603
1604
1605 //Only events with at least 2 tracks are accepted
1606 Int_t fNOtrks = fVevent->GetNumberOfTracks();
c852fdae 1607 if(fNOtrks<2) return;
8e2d649d 1608
1dd85087 1609 fNevent->Fill(11);
1610
1611 if(fIsAOD){
1612 Int_t fNOtrks2 = fAOD->GetNumberOfTracks();
1613 if(fNOtrks2<2) return;
1614 }
1615 fNevent->Fill(12);
8e2d649d 1616
1dd85087 1617 //______________________________________________________________________
1618 //new track loop to select events
1619 //track pt cut (at least 2)
8e2d649d 1620 /*
1621 if(fUseTrigger){
1622 if(fIsAOD){
1623 double fTrackMulti=0;
1624 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
1625 {
1626 AliVParticle* Vtrack = fVevent->GetTrack(iTracks);
1dd85087 1627 if (!Vtrack) continue;
1628
8e2d649d 1629 AliVTrack *track = dynamic_cast<AliVTrack*>(Vtrack);
1dd85087 1630 //AliAODTrack *atrack = dynamic_cast<AliAODTrack*>(Vtrack);
8e2d649d 1631
1632 if((track->Pt())<0.2 || (track->Pt())>1000.0) continue;
1dd85087 1633 else fTrackMulti=fTrackMulti+1;
8e2d649d 1634
1635 }
1636 //Only take event if track multiplicity is bigger than 2.
1637 if(fTrackMulti<2) return;
1638 }
1639 }
1dd85087 1640 fNevent->Fill(13);
1641 //______________________________________________________________________
1642 //Using more cuts than I have beeing using
1643 //eta cut and primary (at least 2)
1644 if(fUseTrigger){
1645 if(fIsAOD){
1646 double fTrackMulti2=0;
1647 for(Int_t i = 0; i < fVevent->GetNumberOfTracks(); i++)
1648 {
1649 AliVParticle* Vtrack2 = fVevent->GetTrack(i);
1650 if (!Vtrack2) continue;
1651
1652
1653 AliVTrack *track_new = dynamic_cast<AliVTrack*>(Vtrack2);
1654 AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(Vtrack2);
1655
1656
1657 if(aodtrack)
1658 {
1659
1660
1661 if(TMath::Abs(track_new->Eta())> 0.9) continue;
1662 if (aodtrack->GetType()!= AliAODTrack::kPrimary) continue ;
1663 else fTrackMulti2=fTrackMulti2+1;
1664 }
1665 }
1666 //Only take event if track multiplicity is bigger than 2.
1667 if(fTrackMulti2<2) return;
1668
1669
1670 }
1671 }
1672 fNevent->Fill(14);
1673//______________________________________________________________________
1674//Using more cuts than I have beeing using
1675//hybrid (at least2)
1676 if(fUseTrigger){
1677 if(fIsAOD){
1678 double fTrackMulti3=0;
1679 for(Int_t i = 0; i < fVevent->GetNumberOfTracks(); i++)
1680 {
1681 AliVParticle* Vtrack3 = fVevent->GetTrack(i);
1682 if (!Vtrack3) continue;
1683
1684 //AliVTrack *track_new = dynamic_cast<AliVTrack*>(Vtrack3);
1685 AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(Vtrack3);
1686
1687
1688 if(aodtrack)
1689 {
1690
1691 if (!aodtrack->IsHybridGlobalConstrainedGlobal()) continue ;
1692 //another option if I don't want to use hybrid
1693 //if ( aodtrack->TestFilterBit(128)==kFALSE) continue ;
1694 else fTrackMulti3=fTrackMulti3+1;
1695 }
1696 }
1697 //Only take event if track multiplicity is bigger than 2.
1698 if(fTrackMulti3<2) return;
1699
1700 }
1701 }
1702 fNevent->Fill(15);
1703//______________________________________________________________________
8e2d649d 1704
8e2d649d 1705
1dd85087 1706 if(fUseTrigger){
1707 if(fIsAOD){
1708 double fTrackMulti4=0;
1709 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
1710 {
1711 AliVParticle* Vtrack4 = fVevent->GetTrack(iTracks);
1712 if (!Vtrack4) continue;
1713
1714
1715 //AliVTrack *track = dynamic_cast<AliVTrack*>(Vtrack4);
1716 AliAODTrack *atrack = dynamic_cast<AliAODTrack*>(Vtrack4);
1717
1718 if(!atrack->TestFilterBit(768)) continue;
1719 if(!atrack->IsHybridGlobalConstrainedGlobal()) continue ;
1720
1721
1722 else fTrackMulti4=fTrackMulti4+1;
1723
1724 }
1725 //Only take event if track multiplicity is bigger than 2.
1726 if(fTrackMulti4<2) return;
1727 fTrack_Multi->Fill(fTrackMulti4);
1728 }
1729 }
1730 fNevent->Fill(16);
1731//______________________________________________________________________
1732 */
c852fdae 1733
1dd85087 1734//______________________________________________________________________
1735//Centrality Selection
c852fdae 1736 if(fHasCentralitySelection)
1737 {
1738 Float_t centrality = -1;
1739
1740 if(fIsAOD)
1741 {
1742 fCentrality = fAOD->GetHeader()->GetCentralityP();
1743 }
1744 else
1745 {
1746 fCentrality = fESD->GetCentrality();
1747 }
1748
1749 if(fEstimator==1) centrality = fCentrality->GetCentralityPercentile("ZDC");
1750 else centrality = fCentrality->GetCentralityPercentile("V0A");
1751
9a1f999b 1752 //cout << "Centrality = " << centrality << " %" << endl;
c852fdae 1753
1754 fCentralityHist->Fill(centrality);
1755
1756 if(centrality<fCentralityMin || centrality>fCentralityMax) return;
1757
1758 fCentralityHistPass->Fill(centrality);
1759 }
1dd85087 1760 //______________________________________________________________________
c852fdae 1761
1dd85087 1762
1763 fNevent->Fill(17);
1764
1765 //______________________________________________________________________
c852fdae 1766
1767 if(fIsMC)
1768 {
1769 if(fIsAOD)
1770 {
1771 fMCarray = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
1772
1773 if(!fMCarray)
1774 {
1775 AliError("Array of MC particles not found");
1776 return;
1777 }
1778
1779 fMCheader = dynamic_cast<AliAODMCHeader*>(fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
1780
1781 if(!fMCheader)
1782 {
1783 AliError("Could not find MC Header in AOD");
1784 return;
1785 }
1786
1787 for(Int_t iMC = 0; iMC < fMCarray->GetEntries(); iMC++)
1788 {
1789 fMCparticle = (AliAODMCParticle*) fMCarray->At(iMC);
89f41a30 1790 if(fMCparticle->GetMother()>0) fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
67eb14b9 1791
c852fdae 1792 Int_t pdg = fMCparticle->GetPdgCode();
67eb14b9 1793
89f41a30 1794
67eb14b9 1795 double proX = fMCparticle->Xv();
1796 double proY = fMCparticle->Yv();
1797 double proR = sqrt(pow(proX,2)+pow(proY,2));
1798
1799
c852fdae 1800 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax && fMCparticle->Charge()!=0)
1801 {
67eb14b9 1802 //to correct background
89f41a30 1803 if (TMath::Abs(pdg) == 11 && fMCparticle->GetMother()>0){
1804 Int_t mpdg = fMCparticleMother->GetPdgCode();
1805
67eb14b9 1806 if(TMath::Abs(mpdg) == 221 || TMath::Abs(mpdg) == 22 || TMath::Abs(mpdg) == 111){
1807
1808 if(proR<7){
1809 fPtMCparticleAlle_nonPrimary->Fill(fMCparticle->Pt()); //denominator for total efficiency for all electrons, and not primary
1810
1811 }
1812 }
1813 }
1814
2c8e1f6c 1815 if (TMath::Abs(pdg) == 11 && fMCparticle->IsPhysicalPrimary()) fPtMCparticleAlle_Primary->Fill(fMCparticle->Pt()); //denominator for total efficiency for all electrons primary
9a1f999b 1816
c852fdae 1817 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
1818 {
9a1f999b 1819
1820 fPtMCparticleAll_nonPrimary->Fill(fMCparticle->Pt()); //denominator for total efficiency for all particles, and not primary
c852fdae 1821 if(fMCparticle->IsPhysicalPrimary())
1822 {
1823 fPtMCparticleAll->Fill(fMCparticle->Pt());
1824
1825 Bool_t MotherFound = FindMother(iMC);
0131ce6c 1826 //Bool_t MotherFound = FindMother(track->GetLabel());
c852fdae 1827 if(MotherFound)
1828 {
0131ce6c 1829 if(fIsHFE1){
8e2d649d 1830 //denominator for total efficiency and tracking
1831 //unfolding: denominator is pt_MC and numerator is pt_reco
0131ce6c 1832 fPtMCparticleAllHfe1->Fill(fMCparticle->Pt());
1833 fEtaPhi_den->Fill(fMCparticle->Phi(),fMCparticle->Eta());
8e2d649d 1834
0131ce6c 1835
1836 } //denominator for total efficiency and tracking
9a1f999b 1837 if(fIsHFE2) fPtMCparticleAllHfe2->Fill(fMCparticle->Pt());
c852fdae 1838 }
1839 }
1840 }
67eb14b9 1841 }//eta cut
1842
1dd85087 1843 //trying take pions spectra 27/may/2014
1844
8e2d649d 1845 if(fMCparticle->IsPhysicalPrimary()){
1dd85087 1846
8e2d649d 1847 if(TMath::Abs(pdg)==111) fPtMCpi0->Fill(fMCparticle->Pt());
1848 if(TMath::Abs(pdg)==221) fPtMCeta->Fill(fMCparticle->Pt());
1dd85087 1849 //eta cut same as MinJung
1850 if(fMCparticle->Eta()>=-0.8 && fMCparticle->Eta()<=0.8)
8e2d649d 1851 {
1dd85087 1852
8e2d649d 1853 if(TMath::Abs(pdg)==111) fPtMCpi02->Fill(fMCparticle->Pt());
1854 if(TMath::Abs(pdg)==221) fPtMCeta2->Fill(fMCparticle->Pt());
8e2d649d 1855
1dd85087 1856 }
1857 }
1858 //eta cut same as MinJung
1859 if(fMCparticle->Eta()>=-0.8 && fMCparticle->Eta()<=0.8)
1860 {
1861 if(TMath::Abs(pdg)==111) fPtMCpi03->Fill(fMCparticle->Pt());
1862 if(TMath::Abs(pdg)==221) fPtMCeta3->Fill(fMCparticle->Pt());
8e2d649d 1863 }
1864
1dd85087 1865
67eb14b9 1866 }//loop tracks
1dd85087 1867
1868 //second loop over track, but only the primaries ones
1869 //only primary pions --> how to take the primaries ones in AOD?
1870 /*
1871 for(Int_t iMC = 0; iMC < fMCarray->GetNPrimary(); iMC++){
1872 fMCparticle = (AliAODMCParticle*) fMCarray->At(iMC);
1873 pdg = fMCparticle->GetPdgCode();
1874
1875 if(TMath::Abs(pdg)==111) fPtMCpi0->Fill(fMCparticle->Pt());
1876 if(TMath::Abs(pdg)==221) fPtMCeta->Fill(fMCparticle->Pt());
1877
1878 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax)
1879 {
1880
1881 if(TMath::Abs(pdg)==111) fPtMCpi02->Fill(fMCparticle->Pt());
1882 if(TMath::Abs(pdg)==221) fPtMCeta2->Fill(fMCparticle->Pt());
1883
1884 }
1885 }
1886 */
1887
1888
67eb14b9 1889 }//AOD
c852fdae 1890 else
1891 {
1892 fEventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
1893 if (!fEventHandler) {
9a1f999b 1894 Printf("ERROR: Could not retrieve MC event handler");
1895 return;
c852fdae 1896 }
9a1f999b 1897
c852fdae 1898 fMCevent = fEventHandler->MCEvent();
1899 if (!fMCevent) {
9a1f999b 1900 Printf("ERROR: Could not retrieve MC event");
1901 return;
c852fdae 1902 }
9a1f999b 1903
c852fdae 1904 fMCstack = fMCevent->Stack();
1905
1dd85087 1906 //pion and eta spectrum
1907 //MinJung code
1908
1909 //----------------------------------------------------------------------------------------------------
1910 AliVParticle *mctrack2 = NULL;
1911 AliMCParticle *mctrack0 = NULL;
1912
1913
1914 for(Int_t imc = 0; imc <fMCEvent->GetNumberOfPrimaries(); imc++){
1915 if(!(mctrack2 = fMCEvent->GetTrack(imc))) continue;
1916 TParticle* mcpart0 = fMCEvent->Stack()->Particle(imc);
1917 if(!mcpart0) continue;
1918 mctrack0 = dynamic_cast<AliMCParticle *>(mctrack2);
1919 if(!mctrack0) continue;
1920
1921 if(TMath::Abs(AliHFEtools::GetRapidity(mcpart0))<0.8){
1922
1923 if(TMath::Abs(mctrack0->PdgCode()) == 111) // pi0
1924 {
1925 fPtMCpi0->Fill(mctrack0->Pt());
1926 }
1927
1928 if(TMath::Abs(mctrack0->PdgCode()) == 221) // eta
1929 {
1930 fPtMCeta->Fill(mctrack0->Pt());
1931 }
1932
1933 }
1934
1935 }
1936 // end of MinJung
1937 //----------------------------------------------------------------------------------------------------
1938
1939
c852fdae 1940 for(Int_t iMC = 0; iMC < fMCstack->GetNtrack(); iMC++)
1941 {
1942
1943 fMCtrack = fMCstack->Particle(iMC);
89f41a30 1944 if(fMCtrack->GetFirstMother()>0) fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
67eb14b9 1945 TParticle *particle=fMCstack->Particle(iMC);
1946
c852fdae 1947 Int_t pdg = fMCtrack->GetPdgCode();
89f41a30 1948
c852fdae 1949
9a1f999b 1950 if(TMath::Abs(pdg)==111) fPtMCpi0->Fill(fMCtrack->Pt());
2c8e1f6c 1951 if(TMath::Abs(pdg)==221) fPtMCeta->Fill(fMCtrack->Pt());
67eb14b9 1952
c852fdae 1953
1954 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax)
1955 {
9a1f999b 1956
67eb14b9 1957 //to correct background
89f41a30 1958 if (TMath::Abs(pdg) == 11 && fMCtrack->GetFirstMother()>0){
1959 Int_t mpdg = fMCtrackMother->GetPdgCode();
67eb14b9 1960 if(TMath::Abs(mpdg) == 221 || TMath::Abs(mpdg) == 22 || TMath::Abs(mpdg) == 111){
2235208e 1961 Double_t proR=particle->R();
1962 if(proR<7){
0131ce6c 1963 fPtMCparticleAlle_nonPrimary->Fill(fMCtrack->Pt()); //denominator for total efficiency for all electrons, and not primary
2235208e 1964 }
67eb14b9 1965 }
1966 }
1967
0131ce6c 1968 if(TMath::Abs(pdg) == 11 && fMCstack->IsPhysicalPrimary(iMC)){
1969
1970 fPtMCparticleAlle_Primary->Fill(fMCtrack->Pt());
1971 }
9a1f999b 1972
c852fdae 1973 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
1974 {
9a1f999b 1975 fPtMCparticleAll_nonPrimary->Fill(fMCtrack->Pt());//denominator for total efficiency for all particle, non Primary track
1976
0131ce6c 1977 if(fMCstack->IsPhysicalPrimary(iMC))
c852fdae 1978 {
0131ce6c 1979 fPtMCparticleAll->Fill(fMCtrack->Pt());
1980
1981 Bool_t MotherFound = FindMother(iMC);
1982 //Bool_t MotherFound = FindMother(track->GetLabel());
1983 if(MotherFound)
1984 {
1985 if(fIsHFE1){
1986 fPtMCparticleAllHfe1->Fill(fMCtrack->Pt());//denominator for total efficiency and tracking
1987 fEtaPhi_den->Fill(fMCtrack->Phi(),fMCtrack->Eta());
1988 }
1989 if(fIsHFE2) fPtMCparticleAllHfe2->Fill(fMCtrack->Pt());
1990 }
1991 }//Is Physical primary
c852fdae 1992 }
0131ce6c 1993 }//eta cut
67eb14b9 1994 }//loop tracks
1995 }//ESD
1996 }//Is MC
9a1f999b 1997
1dd85087 1998//______________________________________________________________________
1999//threshold selection was here
2000//______________________________________________________________________
2001//all events selected
c852fdae 2002
2003 fNevent->Fill(0);
c852fdae 2004
1dd85087 2005
2006//______________________________________________________________________
2007//events in the threshold
2008
c852fdae 2009 if(firedTrigger.Contains(TriggerEG1))
2010 {
1dd85087 2011 if(fEMCEG1){
2012 fNevent->Fill(18);
2013 if(!firedTrigger.Contains(TriggerEG2)) fNevent->Fill(19);
2014 //if(firedTrigger.Contains(TriggerEG2)) return;
2015 }
c852fdae 2016 }
2017
1dd85087 2018
0131ce6c 2019 //EG2
c852fdae 2020 if(firedTrigger.Contains(TriggerEG2))
2021 {
1dd85087 2022 if(fEMCEG2){
2023 fNevent->Fill(20);
2024 if(!firedTrigger.Contains(TriggerEG1)) fNevent->Fill(21);
2025 //if(firedTrigger.Contains(TriggerEG1)) return;
2026 }
c852fdae 2027 }
2028
0131ce6c 2029
1dd85087 2030
8e2d649d 2031 //New cluster information
2032 //after trigger threshold selection
1dd85087 2033 Int_t ClsNo2 = -999;
2034 ClsNo2 = fVevent->GetNumberOfCaloClusters();
2035 fNCluster_pure->Fill(ClsNo2);
2036
2037
0131ce6c 2038
8e2d649d 2039 if(ClsNo2<=0){
1dd85087 2040 fNevent->Fill(22); //events with no cluster
8e2d649d 2041 return;
2042 }
1dd85087 2043
2044 //in order to include time cut
2045 //fEMCALCells = fAOD->GetEMCALCells();
2046 //Double_t tof = clus->GetTOF();
2047 //clus->GetNCells()
2048 //if ( clus->E() < minE ) continue ;
2049
8e2d649d 2050
1dd85087 2051 /*
2052 if(fUseTrigger && fIsAOD){
2053
2054 AliAODHeader * aodh = fAOD->GetHeader();
2055 Int_t bc= aodh->GetBunchCrossNumber();
2056
2057
2058 Int_t ClsNo_aod = -999;
2059 ClsNo_aod = fAOD->GetNumberOfCaloClusters();
2060 fNCluster_pure_aod->Fill(ClsNo_aod);
2061 Bool_t exotic=kTRUE;
2062
2063 for (Int_t i=0; i< ClsNo_aod; i++ ){
2064
2065 //fClus = fVevent->GetCaloCluster(i);
2066 //to be compatible with Shingo
2067 AliVCluster *clust = 0x0;
2068 clust = (AliVCluster*) fAOD->GetCaloCluster(i);
2069
2070 if(clust && clust->IsEMCAL())
2071 {
2072 //pure cluster information
2073 fECluster_pure->Fill(clust->E());
2074
2075 fNcells_energy->Fill(clust->GetNCells(),clust->E());
2076 fNCluster_ECluster->Fill(ClsNo_aod,clust->E());
2077
2078 if(clust->E()>1000) fNevent->Fill(23);
2079
2080 //exotic
2081 exotic = fEMCALRecoUtils->IsExoticCluster(clust, (AliVCaloCells*)fAOD->GetEMCALCells(), bc);
2082 if(exotic == kFALSE){
2083 fECluster_not_exotic->Fill(clust->E());
2084 fNcells_energy_not_exotic->Fill(clust->GetNCells(),clust->E());
2085 }
2086
2087 if(clust->GetNCells()<5 && clust->E()>15.0){
2088 fECluster_exotic->Fill(clust->E());
2089 }
2090 //Marcel cut
2091 else if((clust->GetNCells())> ((clust->E())/3+1)){
2092 fECluster_not_exotic1->Fill(clust->E());
2093 }
2094 else{
2095 fECluster_not_exotic2->Fill(clust->E());
2096 }
2097
2098
2099 }
2100
2101 //______________________________________________________________________
2102 //Trying to remove events with bad cells and find patches
2103 //First, I will try to count them
2104 //______________________________________________________________________
2105
2106 if(clust && clust->IsEMCAL())
2107 {
2108 Bool_t badchannel = ContainsBadChannel("EMCAL", clust->GetCellsAbsId(),clust->GetNCells() );
2109 printf("Contém bad channel? %d ", badchannel);
2110 if(badchannel)fNevent2->Fill(0);
2111
2112 //trying to find patches
2113 TArrayI patches_found=GetTriggerPatches(IsEventEMCALL0, IsEventEMCALL1);
2114 printf("N patches %d, first %d, last %d\n",patches_found.GetSize(), patches_found.At(0), patches_found.At(patches_found.GetSize()-1));
2115
2116 }
2117
2118 //end of bad cells
2119 //______________________________________________________________________
2120
2121
8e2d649d 2122 }
2123 }
1dd85087 2124
2125 */
0131ce6c 2126
1dd85087 2127 fNevent->Fill(24); //events with cluster
2128
0131ce6c 2129
8e2d649d 2130 fVtxZ_new4->Fill(fZvtx);
2131
1dd85087 2132
c852fdae 2133 Int_t ClsNo = -999;
2134 if(!fIsAOD) ClsNo = fESD->GetNumberOfCaloClusters();
2135 else ClsNo = fAOD->GetNumberOfCaloClusters();
2136
0131ce6c 2137 //______________________________________________________________________
9a1f999b 2138
0131ce6c 2139 ///_____________________________________________________________________
2140 ///Track loop
c852fdae 2141 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
2142 {
2143 AliVParticle* Vtrack = fVevent->GetTrack(iTracks);
2144 if (!Vtrack)
2145 {
2146 printf("ERROR: Could not receive track %d\n", iTracks);
2147 continue;
2148 }
9a1f999b 2149
c852fdae 2150 AliVTrack *track = dynamic_cast<AliVTrack*>(Vtrack);
2151 AliESDtrack *etrack = dynamic_cast<AliESDtrack*>(Vtrack);
2152 AliAODTrack *atrack = dynamic_cast<AliAODTrack*>(Vtrack);
2153
1dd85087 2154
c852fdae 2155 Double_t fTPCnSigma = -999;
2c8e1f6c 2156 Double_t fTOFnSigma = -999;
c852fdae 2157 Double_t fTPCnSigma_pion = -999;
2158 Double_t fTPCnSigma_proton = -999;
2159 Double_t fTPCnSigma_kaon = -999;
2160 Double_t fTPCsignal = -999;
2161 Double_t fPt = -999;
2162 Double_t fP = -999;
2163
0131ce6c 2164 //December 9th 2013
2165 //Etacut test on the begging
2166 fEtad[0]->Fill(track->Eta());
2167 //if(track->Eta()<fEtaCutMin || track->Eta()>fEtaCutMax) continue;
2168 fEtad[1]->Fill(track->Eta());
8e2d649d 2169
2170
2171
2172
0131ce6c 2173 ///_____________________________________________________________________________
2174 ///Fill QA plots without track selection
c852fdae 2175 fPt = track->Pt();
2176 fP = TMath::Sqrt((track->Pt())*(track->Pt()) + (track->Pz())*(track->Pz()));
2177
2178 fTPCsignal = track->GetTPCsignal();
2179 fTPCnSigma = fPidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
2c8e1f6c 2180 fTOFnSigma = fPidResponse->NumberOfSigmasTOF(track, AliPID::kElectron);
c852fdae 2181 fTPCnSigma_pion = fPidResponse->NumberOfSigmasTPC(track, AliPID::kPion);
2182 fTPCnSigma_proton = fPidResponse->NumberOfSigmasTPC(track, AliPID::kProton);
2183 fTPCnSigma_kaon = fPidResponse->NumberOfSigmasTPC(track, AliPID::kKaon);
9a1f999b 2184
c852fdae 2185 fTPC_p[0]->Fill(fPt,fTPCsignal);
2186 fTPCnsigma_p[0]->Fill(fP,fTPCnSigma);
2187
9a1f999b 2188
c852fdae 2189 Float_t TPCNcls = track->GetTPCNcls();
31185d97 2190 //TPC Ncls for pid
2191 Float_t TPCNcls_pid = track->GetTPCsignalN();
aaec953d 2192
31185d97 2193
2194
c852fdae 2195 Float_t pos[3]={0,0,0};
9a1f999b 2196
c852fdae 2197 Double_t fEMCflag = kFALSE;
2198 if(track->GetEMCALcluster()>0)
2199 {
2200 fClus = fVevent->GetCaloCluster(track->GetEMCALcluster());
2201 if(fClus->IsEMCAL())
2202 {
8e2d649d 2203
2204 //only for charged tracks
2205 fECluster[0]->Fill(fClus->E());
2206
2207
9a1f999b 2208 if(TMath::Abs(fClus->GetTrackDx())<=fdPhiCut && TMath::Abs(fClus->GetTrackDz())<=fdEtaCut)
2209 {
2210 fEMCflag = kTRUE;
2211 fEoverP_pt[0]->Fill(fPt,(fClus->E() / fP));
2212
2213
2214 Float_t Energy = fClus->E();
2215 Float_t EoverP = Energy/track->P();
2216 //Float_t M02 = fClus->GetM02();
2217 //Float_t M20 = fClus->GetM20();
2218
2219 /////////////// for Eta Phi distribution
2220 fClus->GetPosition(pos);
2221 TVector3 vpos(pos[0],pos[1],pos[2]);
2222 Double_t cphi = vpos.Phi();
2223 Double_t ceta = vpos.Eta();
2224 fEtaPhi[0]->Fill(cphi,ceta);
2225
8e2d649d 2226
9a1f999b 2227 fTPCNcls_EoverP[0]->Fill(TPCNcls, EoverP);
2228 }
c852fdae 2229 }
2230 }
2231
9a1f999b 2232 //______________________________________________________________
2233 // Vertex
c852fdae 2234
2235 fVtxZ[0]->Fill(fZvtx);
8e2d649d 2236 if(iTracks == 0)fNTracks[0]->Fill(fNOtrks);
2237 fNTracks_pt[0]->Fill(fNOtrks, fPt);
2238 fNTracks_eta[0]->Fill(fNOtrks, track->Eta());
2239 fNTracks_phi[0]->Fill(fNOtrks, track->Phi());
2240
2241
c852fdae 2242 fNClusters[0]->Fill(ClsNo);
aaec953d 2243 fTPCNcls_pid[0]->Fill(TPCNcls, TPCNcls_pid);
9a1f999b 2244 //______________________________________________________________
c852fdae 2245
8e2d649d 2246///Fill QA plots without track selection
2247///_____________________________________________________________________________
2248//______________________________________________________________________________________
2249//Track Selection Cuts
9a1f999b 2250
8e2d649d 2251//AOD (Test Filter Bit)
c852fdae 2252 if(fIsAOD)
2253 {
9a1f999b 2254 // standard cuts with very loose DCA - BIT(4)
2255 // Description:
c852fdae 2256 /*
9a1f999b 2257 GetStandardITSTPCTrackCuts2011(kFALSE)
2258 SetMaxChi2PerClusterTPC(4);
2259 SetAcceptKinkDaughters(kFALSE);
2260 SetRequireTPCRefit(kTRUE);
2261 SetRequireITSRefit(kTRUE);
2262 SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
2263 SetMaxDCAToVertexZ(2);
2264 SetMaxDCAToVertex2D(kFALSE);
2265 SetRequireSigmaToVertex(kFALSE);
2266 SetMaxChi2PerClusterITS(36);
2267 SetMaxDCAToVertexXY(2.4)
2268 SetMaxDCAToVertexZ(3.2)
2269 SetDCaToVertex2D(kTRUE)
2270 */
c852fdae 2271
2272 if(!atrack->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)) continue;
2273 }
2274
8e2d649d 2275//RecKine: ITSTPC cuts
c852fdae 2276 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue;
8e2d649d 2277//RecKink
c852fdae 2278 if(fRejectKinkMother)
2279 {
2280 if(fIsAOD)
2281 {
2282 Bool_t kinkmotherpass = kTRUE;
2283 for(Int_t kinkmother = 0; kinkmother < fNumberOfMotherkink; kinkmother++)
2284 {
2285 if(track->GetID() == fListOfmotherkink[kinkmother])
2286 {
2287 kinkmotherpass = kFALSE;
2288 continue;
2289 }
2290 }
2291 if(!kinkmotherpass) continue;
2292 }
2293 else
2294 {
2295 if(etrack->GetKinkIndex(0) != 0) continue;
2296 }
2297 }
9a1f999b 2298
8e2d649d 2299//RecPrim
c852fdae 2300 if(!fIsAOD)
2301 {
2302 if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue;
2303 }
9a1f999b 2304
8e2d649d 2305//HFEcuts: ITS layers cuts
c852fdae 2306 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue;
9a1f999b 2307
8e2d649d 2308//HFE cuts: TPC PID cleanup
c852fdae 2309 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue;
8e2d649d 2310//______________________________________________________________________________________
c852fdae 2311
8e2d649d 2312 if(fIsAOD){
2313 //AOD test -- Fancesco suggestion
1dd85087 2314 //aod test -- Francesco suggestion
2315 AliAODTrack *aod_track=fAOD->GetTrack(iTracks);
2316
8e2d649d 2317 Int_t type=aod_track->GetType();
2318 if(type==AliAODTrack::kPrimary) fPtPrim->Fill(aod_track->Pt());
2319 if(type==AliAODTrack::kSecondary) fPtSec->Fill(aod_track->Pt());
2320
2321 //Int_t type2=track->GetType();
2322 if(type==AliAODTrack::kPrimary) fPtPrim2->Fill(track->Pt());
2323 if(type==AliAODTrack::kSecondary) fPtSec2->Fill(track->Pt());
2324 }
2325
2326
2327///_____________________________________________________________
2328///QA plots after track selection
c852fdae 2329 if(fIsMC)
2330 {
2331 if(track->GetLabel()>=0) fPtMCWithLabel->Fill(fPt);
2332 else fPtMCWithoutLabel->Fill(fPt);
2333 }
2334
0131ce6c 2335 if(fIsMC && track->GetLabel()>=0)
c852fdae 2336 {
0131ce6c 2337 if(fIsAOD){
2338 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
c852fdae 2339
8e2d649d 2340
0131ce6c 2341 if(fMCparticle->IsPhysicalPrimary()) fPtIsPhysicaPrimary->Fill(fPt);
2342
2343 Int_t pdg = fMCparticle->GetPdgCode();
2344 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax && fMCparticle->Charge()!=0)
2345 {
9a1f999b 2346
2c8e1f6c 2347
0131ce6c 2348 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
2349 {
2350 fPtMCparticleReco_nonPrimary->Fill(fMCparticle->Pt()); //not Primary track
9a1f999b 2351
0131ce6c 2352 if(fMCparticle->IsPhysicalPrimary())
c852fdae 2353 {
0131ce6c 2354 fPtMCparticleReco->Fill(fMCparticle->Pt());
2355
2356 Bool_t MotherFound = FindMother(track->GetLabel());
2357 if(MotherFound)
2358 {
8e2d649d 2359 if(fIsHFE1){
2360 fPtMCparticleRecoHfe1->Fill(fMCparticle->Pt());//numerator tracking
2361 //unfolding
2362 fpt_reco_pt_MC_den->Fill(track->Pt(),fMCparticle->Pt());
2363
2364 }
0131ce6c 2365 if(fIsHFE2) fPtMCparticleRecoHfe2->Fill(fMCparticle->Pt());
2366 }
c852fdae 2367 }
2368 }
2369 }
8e2d649d 2370
2371
2372
0131ce6c 2373 }//close AOD
2374 //ESD
2375 else
2376 {
2377
2378
2379 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax)
2380 {
9a1f999b 2381
0131ce6c 2382 fMCtrack = fMCstack->Particle(track->GetLabel());
2383 Int_t pdg = fMCtrack->GetPdgCode();
9a1f999b 2384
0131ce6c 2385 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
2386 {
2387 fPtMCparticleReco_nonPrimary->Fill(fMCtrack->Pt());//not Primary track
2388 }
9a1f999b 2389
2390
0131ce6c 2391 if(fMCstack->IsPhysicalPrimary(track->GetLabel()))
2392 {
9a1f999b 2393 fPtIsPhysicaPrimary->Fill(fPt);
2394
2395
9a1f999b 2396 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
c852fdae 2397 {
9a1f999b 2398 fPtMCparticleReco->Fill(fMCtrack->Pt());
2399
2400 Bool_t MotherFound = FindMother(track->GetLabel());
2401 if(MotherFound)
2402 {
0131ce6c 2403 if(fIsHFE1) fPtMCparticleRecoHfe1->Fill(fMCtrack->Pt());//numerator tracking
9a1f999b 2404 if(fIsHFE2) fPtMCparticleRecoHfe2->Fill(fMCtrack->Pt());
2405 }
c852fdae 2406 }
0131ce6c 2407 }
c852fdae 2408 }
0131ce6c 2409 }//close ESD
2410 }//close IsMC
c852fdae 2411
2412 fTPC_p[1]->Fill(fPt,fTPCsignal);
2413 fTPCnsigma_p[1]->Fill(fP,fTPCnSigma);
2c8e1f6c 2414 Double_t fPtBin[7] = {1,2,4,6,8,10,15};
9a1f999b 2415
c852fdae 2416 TPCNcls = track->GetTPCNcls();
2417 Float_t pos2[3]={0,0,0};
2418
2419 if(track->GetEMCALcluster()>0)
2420 {
2421 fClus = fVevent->GetCaloCluster(track->GetEMCALcluster());
2422 if(fClus->IsEMCAL())
2423 {
9a1f999b 2424 if(TMath::Abs(fClus->GetTrackDx())<=fdPhiCut && TMath::Abs(fClus->GetTrackDz())<=fdEtaCut)
2425 {
2426 fEoverP_pt[1]->Fill(fPt,(fClus->E() / fP));
2427
2428 Float_t Energy = fClus->E();
2429 Float_t EoverP = Energy/track->P();
2430 Float_t M02 = fClus->GetM02();
2431 Float_t M20 = fClus->GetM20();
2432 Float_t ncells = fClus->GetNCells();
2433
2434 /////////////// for Eta Phi distribution
2435 fClus->GetPosition(pos2);
2436 TVector3 vpos(pos2[0],pos2[1],pos2[2]);
2437 Double_t cphi = vpos.Phi();
2438 Double_t ceta = vpos.Eta();
2439 fEtaPhi[1]->Fill(cphi,ceta);
2440
2441 fECluster[1]->Fill(Energy);
2442 fTPCNcls_EoverP[1]->Fill(TPCNcls, EoverP);
2443
2444
0131ce6c 2445 //for EMCal trigger performance
9a1f999b 2446 if(EoverP > 0.9){
2447 ftpc_p_EoverPcut->Fill(track->P(), fTPCsignal);
2448 fnsigma_p_EoverPcut->Fill(track->P(), fTPCnSigma);
2449
2450 }
2451
2452
8e2d649d 2453 //for hadron contamination calculations
9a1f999b 2454
2455
8e2d649d 2456 // EtaCut -> dados
9a1f999b 2457 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){
2458 //main
2459 if(TMath::Abs(fTPCnSigma_pion)<3 || TMath::Abs(fTPCnSigma_proton)<3 || TMath::Abs(fTPCnSigma_kaon)<3 ){
2460
2461 if(fTPCnSigma<-3.5){
2462 fEoverP_pt_hadrons->Fill(fPt,EoverP);
2463 if(fUseEMCal) fShowerShape_ha->Fill(M02,M20);
2464 }
2465 }
8e2d649d 2466 //for systematic studies of hadron contamination
2467 if(fTPCnSigma < -4){
9a1f999b 2468 fEoverP_pt_pions->Fill(fPt, EoverP);
2469
2470 }
2471
8e2d649d 2472 if(fTPCnSigma < -5){
9a1f999b 2473 fEoverP_pt_pions2->Fill(fPt, EoverP);
2474
2475 }
2476
2477
2478 }
2479
2480
2481
2482
2c8e1f6c 2483 for(Int_t i = 0; i < 6; i++)
9a1f999b 2484 {
2485 if(fPt>=fPtBin[i] && fPt<fPtBin[i+1])
2486 {
2487
2488 if(fTPCnSigma < -5 && fTPCnSigma > -10){
2489 fNcells_hadrons[i]->Fill(ncells);
2490 }
2491 //hadrons selection using E/p
2492 if((fClus->E() / fP) >= 0.2 && (fClus->E() / fP) <= 0.7){
2493 fTPCnsigma_eta_hadrons[i]->Fill(fTPCnSigma, ceta);
2494 }
2495 //electrons selection using E/p
2496 if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax) {
2497 fTPCnsigma_eta_electrons[i]->Fill(fTPCnSigma, ceta);
2498 }
2499 }
2500 }
2501
2502 if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax)
2503 {
c852fdae 2504 fTPCnsigma_eta->Fill(track->Eta(),fTPCnSigma);
2505 fTPCnsigma_phi->Fill(track->Phi(),fTPCnSigma);
2506
2507 if(fUseEMCal)
2508 {
2509 if(fTPCnSigma < 3.5 && fCorrelationFlag)
2510 {
2511 fPtTrigger_Inc->Fill(fPt);
2512 DiHadronCorrelation(track, iTracks);
2513 }
2514 }
9a1f999b 2515 }
2516
2517 }
c852fdae 2518 }
2519 }
2520
0131ce6c 2521 //______________________________________________________________
2522 // Vertex
c852fdae 2523
2524 fVtxZ[1]->Fill(fZvtx);
8e2d649d 2525 if(iTracks == 0)fNTracks[1]->Fill(fNOtrks);
2526 fNTracks_pt[1]->Fill(fNOtrks, fPt);
2527 fNTracks_eta[1]->Fill(fNOtrks, track->Eta());
2528 fNTracks_phi[1]->Fill(fNOtrks, track->Phi());
c852fdae 2529 fNClusters[1]->Fill(ClsNo);
aaec953d 2530 fTPCNcls_pid[1]->Fill(TPCNcls, TPCNcls_pid);
c852fdae 2531
0131ce6c 2532 //______________________________________________________________
2533
2534 ///______________________________________________________________________
2535 ///Histograms for PID Studies
2536 //Double_t fPtBin[6] = {2,4,6,8,10,15};
c852fdae 2537
2c8e1f6c 2538 for(Int_t i = 0; i < 6; i++)
c852fdae 2539 {
9a1f999b 2540 if(fPt>=fPtBin[i] && fPt<fPtBin[i+1])
2541 {
2542 if(fEMCflag) fEoverP_tpc[i]->Fill(fTPCnSigma,(fClus->E() / fP));
2543
2544
2545 fTPC_pt[i]->Fill(fTPCsignal);
2546 fTPCnsigma_pt[i]->Fill(fTPCnSigma);
2547
2548 }
c852fdae 2549 }
2550
9a1f999b 2551 ///QA plots after track selection
2552 ///_____________________________________________________________
c852fdae 2553
9a1f999b 2554 //_______________________________________________________
2555 //Correlation Analysis - DiHadron
c852fdae 2556 if(!fUseEMCal)
2557 {
2558 if(fTPCnSigma < 3.5 && fCorrelationFlag)
2559 {
2560 fPtTrigger_Inc->Fill(fPt);
2561 DiHadronCorrelation(track, iTracks);
2562 }
2563 }
9a1f999b 2564 //_______________________________________________________
c852fdae 2565
2566
9a1f999b 2567 ///////////////////////////////////////////////////////////////////
2568 ///TPC - efficiency calculation //
c852fdae 2569
9a1f999b 2570 /// changing start here
c852fdae 2571 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2572 {
2573 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2574 Int_t pdg = fMCparticle->GetPdgCode();
2575
9a1f999b 2576 //
c852fdae 2577 if(fMCparticle->IsPhysicalPrimary()){
c852fdae 2578
9a1f999b 2579
2580 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2581
c852fdae 2582 Bool_t MotherFound = FindMother(track->GetLabel());
2583 if(MotherFound){
2584 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2585 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
9a1f999b 2586 if(fIsHFE1) fPtMC_TPC_All->Fill(fMCparticle->Pt());
c852fdae 2587 }
2588 }
9a1f999b 2589 }
c852fdae 2590 }
2591 }///until here
2592
2593 else if(fIsMC && track->GetLabel()>=0)//ESD
2594 {
2595
2596 if(fMCstack->IsPhysicalPrimary(track->GetLabel())){
2597 fMCtrack = fMCstack->Particle(track->GetLabel());
2598
2599 Int_t pdg = fMCtrack->GetPdgCode();
2600 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax ){
2601
2602 if(fMCtrack->GetFirstMother()>0){
2603 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
0131ce6c 2604 Bool_t MotherFound = FindMother(track->GetLabel());
2605 if(MotherFound){
2606 if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){
2607 if(fIsHFE1) fPtMC_TPC_All->Fill(fMCtrack->Pt());
2608 }
2609 }
c852fdae 2610 }
2611 }
2612 }
2613 }
2614
2615
2c8e1f6c 2616 if(fPt>1 && fPt<2) fTOF01->Fill(fTOFnSigma,fTPCnSigma);
2617 if(fPt>2 && fPt<4) fTOF02->Fill(fTOFnSigma,fTPCnSigma);
2618 if(fPt>4 && fPt<6) fTOF03->Fill(fTOFnSigma,fTPCnSigma);
2619
8e2d649d 2620///________________________________________________________________________
2621///PID
2622///Here the PID cuts defined in the file "ConfigEMCalHFEpA.C" is applied
c852fdae 2623 Int_t pidpassed = 1;
2624 AliHFEpidObject hfetrack;
9a4682da 2625 hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);
c852fdae 2626 hfetrack.SetRecTrack(track);
a89620c8 2627 hfetrack.SetPP(); //proton-proton analysis
c852fdae 2628 if(!fPID->IsSelected(&hfetrack, NULL, "", fPIDqa)) pidpassed = 0;
2629 fpid->Fill(pidpassed);
2630
2631 if(pidpassed==0) continue;
8e2d649d 2632///________________________________________________________________________
c852fdae 2633
c852fdae 2634
8e2d649d 2635////////////////////////////////////////////////////////////////////
2636///TPC efficiency calculations
9a1f999b 2637
0131ce6c 2638
c852fdae 2639 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2640 {
2641 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2642 Int_t pdg = fMCparticle->GetPdgCode();
2643
9a1f999b 2644 //
c852fdae 2645 if(fMCparticle->IsPhysicalPrimary()){
2646
2647
2648 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2649
2650 Bool_t MotherFound = FindMother(track->GetLabel());
2651 if(MotherFound){
2652 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2653 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2654 if(fIsHFE1) fPtMC_TPC_Selected->Fill(fMCparticle->Pt());
2655 }
2656 }
2657 }
2658 }
2659 }///until here
2660
2661 else if(fIsMC && track->GetLabel()>=0)//ESD
2662 {
2663
2664 if(fMCstack->IsPhysicalPrimary(track->GetLabel())){
2665 fMCtrack = fMCstack->Particle(track->GetLabel());
2666
2667 Int_t pdg = fMCtrack->GetPdgCode();
2668 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax ){
2669
2670 if(fMCtrack->GetFirstMother()>0){
2671 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
0131ce6c 2672 Bool_t MotherFound = FindMother(track->GetLabel());
2673 if(MotherFound){
2674 if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){
2675 if(fIsHFE1) fPtMC_TPC_Selected->Fill(fMCtrack->Pt());
2676 }
2677 }
c852fdae 2678 }
2679 }
2680 }
2681 }
2682
8e2d649d 2683 //Eta Cut for TPC only
c852fdae 2684 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){
2685 fTPCnsigma_pt_2D->Fill(fPt,fTPCnSigma);
2686 }
2687
8e2d649d 2688 //Background for TPC only
9a4682da 2689 if(fFillBackground){
0131ce6c 2690
2691 //efficiency without SS cut for TPC only
2692 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax){
2693 Background(track, iTracks, Vtrack, kTRUE); //IsTPConly=kTRUE
2694 } //Eta cut to be consistent with other efficiency
9a4682da 2695 }
2696
2697
c852fdae 2698 fTPCnsigma_p[2]->Fill(fP,fTPCnSigma);
2699 fTPC_p[2]->Fill(fP,fTPCsignal);
2700 TPCNcls = track->GetTPCNcls();
2701 Float_t pos3[3]={0,0,0};
2702
8e2d649d 2703
2704 //here denominator for track-matching efficiency
2705 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2706 {
2707 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2708 Int_t pdg = fMCparticle->GetPdgCode();
2709
2710 //
2711 if(fMCparticle->IsPhysicalPrimary()){
2712
2713
2714 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2715
2716 Bool_t MotherFound = FindMother(track->GetLabel());
2717 if(MotherFound){
2718 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2719 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2720 if(fIsHFE1) fPt_track_match_den->Fill(fMCparticle->Pt());
2721 }
2722 }
2723 }
2724 }
2725 }///until here
2726
2727
c852fdae 2728 if(track->GetEMCALcluster()>0)
2729 {
2730 fClus = fVevent->GetCaloCluster(track->GetEMCALcluster());
2731 if(fClus->IsEMCAL())
2732 {
2733
0131ce6c 2734 //________________________________________________________________________
a89620c8 2735
2736
0131ce6c 2737 //Cluster timing distribution -- for ESD
2738 if(fUseEMCal && !fIsAOD){
2739
2740 AliESDCaloCells &cells_esd=*(fESD->GetEMCALCells());
2741 TRefArray* caloClusters_esd = new TRefArray();
2742 fESD->GetEMCALClusters(caloClusters_esd);
2743 Int_t nclus_esd = caloClusters_esd->GetEntries();
2744
2745
2746 for (Int_t icl = 0; icl < nclus_esd; icl++) {
2747
2748 AliESDCaloCluster* clus_esd = (AliESDCaloCluster*)caloClusters_esd->At(icl);
2749
2750 if(clus_esd->IsEMCAL()){
2751 Float_t ncells_esd = fClus->GetNCells();
2752 UShort_t * index_esd = clus_esd->GetCellsAbsId() ;
2753 UShort_t * index2_esd = fClus->GetCellsAbsId() ;
2754
2755
2756 for(Int_t i = 0; i < ncells_esd ; i++){
2757
2758 Int_t absId_esd = index_esd[i];
2759 fTime->Fill(fPt,cells_esd.GetCellTime(absId_esd));
2760
2761 Int_t absId2_esd = index2_esd[i];
2762 fTime2->Fill(fPt,cells_esd.GetCellTime(absId2_esd));
2763 }
2764
2765 }
2766 }
2767
2768 }
2769 /* not working!
2770 //Cluster timing distribution -- for AOD
2771 if(fUseEMCal && fIsAOD){
a89620c8 2772
0131ce6c 2773 AliAODCaloCells &cells_aod=*(fAOD->GetEMCALCells());
a89620c8 2774
0131ce6c 2775 TRefArray* caloClusters_aod = new TRefArray();
2776 fAOD->GetEMCALClusters(caloClusters_aod);
a89620c8 2777
0131ce6c 2778 Int_t nclus_aod = caloClusters_aod->GetEntries();
a89620c8 2779
0131ce6c 2780 for (Int_t icl = 0; icl < nclus_aod; icl++) {
2781
2782 AliAODCaloCluster* clus_aod = (AliAODCaloCluster*)caloClusters_aod->At(icl);
a89620c8 2783
a89620c8 2784
0131ce6c 2785 if(clus_aod->IsEMCAL()){
2786 Float_t ncells_aod = fClus->GetNCells();
2787 UShort_t * index_aod = clus_aod->GetCellsAbsId() ;
2788 UShort_t * index2_aod = fClus->GetCellsAbsId() ;
a89620c8 2789
2790
0131ce6c 2791 for(Int_t i = 0; i < ncells_aod ; i++){
a89620c8 2792
0131ce6c 2793 Int_t absId_aod = index_aod[i];
2794 fTime->Fill(fPt,cells_aod.GetCellTime(absId_aod));
a89620c8 2795
0131ce6c 2796 Int_t absId2_aod = index2_aod[i];
2797 fTime2->Fill(fPt,cells_aod.GetCellTime(absId2_aod));
a89620c8 2798 }
2799
2800 }
2801 }
2802
9a4682da 2803 }
0131ce6c 2804 */
2805
2806
9a4682da 2807 if(fUseEMCal){
2808 double emctof = fClus->GetTOF();
2809 ftimingEle->Fill(fPt,emctof);
a89620c8 2810 }
9a1f999b 2811 //________________________________________________________________________
a89620c8 2812
2813
2814
9a1f999b 2815
0131ce6c 2816 // Residuals
9a1f999b 2817 Double_t Dx = fClus->GetTrackDx();
2818 Double_t Dz = fClus->GetTrackDz();
2819 Double_t R=TMath::Sqrt(Dx*Dx+Dz*Dz);
0131ce6c 2820
2c8e1f6c 2821 for(Int_t i = 0; i < 6; i++)
c852fdae 2822 {
2823 if(fPt>=fPtBin[i] && fPt<fPtBin[i+1])
2824 {
2825
2826 fEta[i]->Fill(Dz);
2827 fPhi[i]->Fill(Dx);
2828 fR[i]->Fill(R);
2829 }
9a1f999b 2830 }
c852fdae 2831
9a1f999b 2832 if(TMath::Abs(fClus->GetTrackDx())<=fdPhiCut && TMath::Abs(fClus->GetTrackDz())<=fdEtaCut)
2833 {
2834 Float_t Energy = fClus->E();
2835 Float_t EoverP = Energy/track->P();
2836 Float_t M02 = fClus->GetM02();
2837 Float_t M20 = fClus->GetM20();
2838 Float_t ncells = fClus->GetNCells();
8e2d649d 2839
2840 //here numerator for track-matching efficiency
2841 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2842 {
2843 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2844 Int_t pdg = fMCparticle->GetPdgCode();
2845
2846 //
2847 if(fMCparticle->IsPhysicalPrimary()){
2848
2849
2850 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2851
2852 Bool_t MotherFound = FindMother(track->GetLabel());
2853 if(MotherFound){
2854 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2855 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2856 if(fIsHFE1) fPt_track_match_num->Fill(fMCparticle->Pt());
2857 }
2858 }
2859 }
2860 }
2861 }///until here
2862
2863
2864
0131ce6c 2865 //----------------------------------------------------------------------------------------
1dd85087 2866 //
2867 //EtaCut electrons histogram
0131ce6c 2868 //Shower Shape Cut
9a1f999b 2869 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){
2870
2871 if(fUseShowerShapeCut){
2872 if(M02 >= fM02CutMin && M02<=fM02CutMax && M20>=fM20CutMin && M20<=fM20CutMax){
2873 fEoverP_pt[2]->Fill(fPt,(fClus->E() / fP));
2874 fShowerShapeCut->Fill(M02,M20);
1dd85087 2875 //in order to check if there are exotic cluster in this selected cluster (27 may 2014)
2876 fNcells_energy_elec_selected->Fill(ncells,Energy);
9a1f999b 2877
2878 }
2879
2880 }
2881 if(!fUseShowerShapeCut){
2882 fEoverP_pt[2]->Fill(fPt,(fClus->E() / fP));
2883 fShowerShapeCut->Fill(M02,M20);
1dd85087 2884 fNcells_energy_elec_selected->Fill(ncells,Energy);
2885
9a1f999b 2886
2887 }
2888 if(fUseEMCal) fShowerShape_ele->Fill(M02,M20);
2889
8e2d649d 2890 //for shower shape cut studies - now with TPC PID Cut
9a1f999b 2891 if(fUseEMCal){
2892 fShowerShapeM02_EoverP->Fill(M02,EoverP);
2893 fShowerShapeM20_EoverP->Fill(M20,EoverP);
2894 }
2895
2896 }
2897
0131ce6c 2898 //----------------------------------------------------------------------------------------
9a1f999b 2899
2900
2901
0131ce6c 2902 // for Eta Phi distribution
9a1f999b 2903 fClus->GetPosition(pos3);
2904 TVector3 vpos(pos3[0],pos3[1],pos3[2]);
2905 Double_t cphi = vpos.Phi();
2906 Double_t ceta = vpos.Eta();
2907 fEtaPhi[2]->Fill(cphi,ceta);
2908
2909
2910
2911 fTPCNcls_EoverP[2]->Fill(TPCNcls, EoverP);
2912
2c8e1f6c 2913 for(Int_t i = 0; i < 6; i++)
9a1f999b 2914 {
2915 if(fPt>=fPtBin[i] && fPt<fPtBin[i+1])
2916 {
2917
2918 fR_EoverP[i]->Fill(R, EoverP);
2919 fNcells[i]->Fill(ncells);
2920 fNcells_EoverP[i]->Fill(EoverP, ncells);
2921 fM02_EoverP[i]->Fill(M02,EoverP);
2922 fM20_EoverP[i]->Fill(M20,EoverP);
2923 fECluster_ptbins[i]->Fill(Energy);
2924 fEoverP_ptbins[i]->Fill(EoverP);
2925
2926 if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax) {
2927 fNcells_electrons[i]->Fill(ncells);
2928 }
2929
2930 if(M02<0.5 && M20<0.3) {
2931 fEoverP_wSSCut[i]->Fill(EoverP);
2932 }
2933 }
2934 }
2935
2936 fNcells_pt->Fill(fPt, ncells);
2937
2938
0131ce6c 2939 ////////////////////////////////////////////////////////////////////
2940 ///EMCal - Efficiency calculations
9a1f999b 2941
0131ce6c 2942
9a1f999b 2943 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2944 {
2945 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2946 Int_t pdg = fMCparticle->GetPdgCode();
2947
0131ce6c 2948 //
9a1f999b 2949 if(fMCparticle->IsPhysicalPrimary()){
2950
0131ce6c 2951 //Phi cut && fMCparticle->Phi()>=(TMath::Pi()*80/180) && fMCparticle->Phi()<=TMath::Pi()
2952 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
9a1f999b 2953
2954 Bool_t MotherFound = FindMother(track->GetLabel());
2955 if(MotherFound){
2956 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2957 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
0131ce6c 2958 if(fIsHFE1)fPtMC_EMCal_All->Fill(fMCparticle->Pt());
9a1f999b 2959 }
2960 }
2961 }
2962 }
0131ce6c 2963 }
9a1f999b 2964
2965 else if(fIsMC && track->GetLabel()>=0)//ESD
2966 {
2967
2968 if(fMCstack->IsPhysicalPrimary(track->GetLabel()))
2969 {
2970
2971 fMCtrack = fMCstack->Particle(track->GetLabel());
2972
2973 Int_t pdg = fMCtrack->GetPdgCode();
0131ce6c 2974 //Phi cut && fMCtrack->Phi()>=(TMath::Pi()*80/180) && fMCtrack->Phi()<=TMath::Pi()
2975 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax )
9a1f999b 2976 {
0131ce6c 2977 Bool_t MotherFound = FindMother(track->GetLabel());
2978 //MotherFound included
2979 if(MotherFound){
2980 if(fMCtrack->GetFirstMother()>0){
2981 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
2982 if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){
2983 if(fIsHFE1)fPtMC_EMCal_All->Fill(fMCtrack->Pt());
2984 }
9a1f999b 2985 }
2986 }
2987 }
2988 }
2989 }
2990
aaec953d 2991 //_______________________________________________________
2992 //PID using EMCal
9a1f999b 2993 if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax)
2994 {
2995
1dd85087 2996
2997 fECluster[2]->Fill(Energy);
2998 fTPCNcls_pid[3]->Fill(TPCNcls, TPCNcls_pid);
2999
0131ce6c 3000
c852fdae 3001 if(fUseEMCal)
3002 {
1dd85087 3003 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){
3004 fPtElec_Inc->Fill(fPt);
3005 //eta phi distribution for data
3006 fEtaPhi_data->Fill(track->Phi(),track->Eta());
3007 }
3008
aaec953d 3009 //Eta cut for background
a89620c8 3010 if(fFillBackground){
0131ce6c 3011 fEtad[2]->Fill(track->Eta());
3012
3013 //background for triggered data: trigger electron must have same cuts on shower shape 06/Jan/2014
3014 if(fUseShowerShapeCut){
3015 if(M02 >= fM02CutMin && M02<=fM02CutMax && M20>=fM20CutMin && M20<=fM20CutMax){
3016 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax){
3017 Background(track, iTracks, Vtrack, kFALSE);
3018 }
3019 }
3020 }
3021 else{
3022 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax){
3023 Background(track, iTracks, Vtrack, kFALSE);
3024 }
aaec953d 3025 }
0131ce6c 3026
a89620c8 3027 }
3028
3029 double emctof2 = fClus->GetTOF();
3030 ftimingEle2->Fill(fPt,emctof2);
0131ce6c 3031 //Correlation Analysis
c852fdae 3032 if(fCorrelationFlag)
3033 {
3034 ElectronHadronCorrelation(track, iTracks, Vtrack);
3035 }
3036 }
aaec953d 3037 //_______________________________________________________
9a1f999b 3038
aaec953d 3039 ////////////////////////////////////////////////////////////////////
3040 ///EMCal - efficiency calculations
9a1f999b 3041
3042 if(track->Charge()<0) fCharge_n->Fill(fPt);
3043 if(track->Charge()>0) fCharge_p->Fill(fPt);
3044
3045
aaec953d 3046
3047 if(fIsMC && fIsAOD && track->GetLabel()>=0)//AOD
9a1f999b 3048 {
3049 if(track->Charge()<0) fCharge_n->Fill(fPt);
3050 if(track->Charge()>0) fCharge_p->Fill(fPt);
3051
3052 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
89f41a30 3053 if(fMCparticle->GetMother()>0) fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
9a1f999b 3054 Int_t pdg = fMCparticle->GetPdgCode();
89f41a30 3055
2235208e 3056 double proX = fMCparticle->Xv();
3057 double proY = fMCparticle->Yv();
3058 double proR = sqrt(pow(proX,2)+pow(proY,2));
3059
9a1f999b 3060
0131ce6c 3061 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax && fMCparticle->Phi()>=(TMath::Pi()*80/180) && fMCparticle->Phi()<=TMath::Pi() ){
9a1f999b 3062
89f41a30 3063 if( TMath::Abs(pdg) == 11 && fMCparticle->GetMother()>0 ){
3064 Int_t mpdg = fMCparticleMother->GetPdgCode();
67eb14b9 3065 if(TMath::Abs(mpdg) == 221 || TMath::Abs(mpdg) == 22 || TMath::Abs(mpdg) == 111){
2235208e 3066 if(proR<7)fPtMCelectronAfterAll_nonPrimary->Fill(fMCparticle->Pt()); //numerator for the total efficiency, non Primary track
67eb14b9 3067 }
3068 }
2c8e1f6c 3069 if( TMath::Abs(pdg) == 11 && fMCparticle->IsPhysicalPrimary()) fPtMCelectronAfterAll_Primary->Fill(fMCparticle->Pt());
9a1f999b 3070 }
3071
3072
3073 //
3074 if(fMCparticle->IsPhysicalPrimary()){
3075
3076
3077 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
31185d97 3078
9a1f999b 3079 Bool_t MotherFound = FindMother(track->GetLabel());
3080 if(MotherFound){
0131ce6c 3081
3082 if(!fUseShowerShapeCut){
3083 if(fIsHFE1){
8e2d649d 3084 //Unfolding pt_reco/pt_MC in the efficiency
0131ce6c 3085 fPtMCelectronAfterAll->Fill(fMCparticle->Pt());
8e2d649d 3086 fPtMCelectronAfterAll_unfolding->Fill(track->Pt());
0131ce6c 3087 fEtaPhi_num->Fill(fMCparticle->Phi(),fMCparticle->Eta());
8e2d649d 3088
3089 //new histo to estimate how different is pt reco from pt MC
3090 fpt_reco_pt_MC_num->Fill(track->Pt(),fMCparticle->Pt());
0131ce6c 3091 }//numerator for the total efficiency AOD
9a1f999b 3092 }
0131ce6c 3093 //November 11 for efficiency of triggered data
3094 if(fUseShowerShapeCut){
3095 if(M02 >= fM02CutMin && M02<=fM02CutMax && M20>=fM20CutMin && M20<=fM20CutMax){
3096 if(fIsHFE1){
8e2d649d 3097 //Unfolding pt_reco/pt_MC in the efficiency
0131ce6c 3098 fPtMCelectronAfterAll->Fill(fMCparticle->Pt());
8e2d649d 3099 fPtMCelectronAfterAll_unfolding->Fill(track->Pt());
0131ce6c 3100 fEtaPhi_num->Fill(fMCparticle->Phi(),fMCparticle->Eta());
8e2d649d 3101
3102 //new histo to estimate how different is pt reco from pt MC
3103 fpt_reco_pt_MC_num->Fill(track->Pt(),fMCparticle->Pt());
0131ce6c 3104 }//numerator for the total efficiency AOD
3105 }
3106 }
3107
3108
3109
3110 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
3111 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
3112 if(fIsHFE1)fPtMC_EMCal_Selected->Fill(fMCparticle->Pt());
3113 }
3114 }//if MotherFound
3115 }//eta cut
9a1f999b 3116 }
0131ce6c 3117 }///close AOD
9a1f999b 3118
3119 else if(fIsMC && track->GetLabel()>=0)//ESD
3120 {
3121 if(track->Charge()<0) fCharge_n->Fill(fPt);
3122 if(track->Charge()>0) fCharge_p->Fill(fPt);
3123
3124 fMCtrack = fMCstack->Particle(track->GetLabel());
89f41a30 3125 if(fMCtrack->GetFirstMother()>0) fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
2235208e 3126 TParticle *particle=fMCstack->Particle(track->GetLabel());
89f41a30 3127
9a1f999b 3128 Int_t pdg = fMCtrack->GetPdgCode();
3129
89f41a30 3130
9a1f999b 3131 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax){
89f41a30 3132 if( TMath::Abs(pdg) == 11 && fMCtrack->GetFirstMother()>0 ){
3133 Int_t mpdg = fMCtrackMother->GetPdgCode();
3134 if(TMath::Abs(mpdg) == 221 || TMath::Abs(mpdg) == 22 || TMath::Abs(mpdg) == 111){
2235208e 3135 Double_t proR=particle->R();
3136 if(proR<7){
89f41a30 3137 fPtMCelectronAfterAll_nonPrimary->Fill(fMCtrack->Pt()); //numerator for the total efficiency, non Primary track
2235208e 3138 }
89f41a30 3139 }
3140 }
2c8e1f6c 3141 if( TMath::Abs(pdg) == 11 && fMCstack->IsPhysicalPrimary(track->GetLabel())) fPtMCelectronAfterAll_Primary->Fill(fMCtrack->Pt());
9a1f999b 3142 }
3143
3144 if(fMCstack->IsPhysicalPrimary(track->GetLabel()))
3145 {
c852fdae 3146 Bool_t MotherFound = FindMother(track->GetLabel());
9a1f999b 3147
c852fdae 3148 if(MotherFound)
3149 {
3150 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax){
31185d97 3151
3152
3153 if(!fUseShowerShapeCut){
0131ce6c 3154 if(fIsHFE1){
3155 fPtMCelectronAfterAll->Fill(fMCtrack->Pt()); //numerator for the total efficiency ESD
3156 fEtaPhi_num->Fill(fMCtrack->Phi(),fMCtrack->Eta());
3157 }
31185d97 3158 }
3159 //November 11 for efficiency of triggered data
3160 if(fUseShowerShapeCut){
3161 if(M02 >= fM02CutMin && M02<=fM02CutMax && M20>=fM20CutMin && M20<=fM20CutMax){
0131ce6c 3162 if(fIsHFE1){
3163 fPtMCelectronAfterAll->Fill(fMCtrack->Pt()); //numerator for the total efficiency ESD
3164 fEtaPhi_num->Fill(fMCtrack->Phi(),fMCtrack->Eta());
3165 }
31185d97 3166 }
3167 }
3168
3169
3170
c852fdae 3171 }
3172 }
9a1f999b 3173
3174
3175
0131ce6c 3176 // Phi cut && fMCtrack->Phi()>=(TMath::Pi()*80/180) && fMCtrack->Phi()<=TMath::Pi()
3177 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax)
9a1f999b 3178 {
0131ce6c 3179 //included MotherFound
3180
3181 if(MotherFound)
3182 {
3183 if(fMCtrack->GetFirstMother()>0){
3184 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
3185 if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){
9a1f999b 3186
0131ce6c 3187 if(fIsHFE1)fPtMC_EMCal_Selected->Fill(fMCtrack->Pt());
3188 }
9a1f999b 3189 }
3190 }
3191 }
3192 }
0131ce6c 3193 }//close ESD
3194 ///////////////////////////////////////////////////////////////////
9a1f999b 3195
3196
3197 }
3198 }
c852fdae 3199 }
3200 }
3201
9a1f999b 3202 //______________________________________________________________
3203 // Vertex
c852fdae 3204
3205 fVtxZ[2]->Fill(fZvtx);
8e2d649d 3206 if(iTracks == 0)fNTracks[2]->Fill(fNOtrks);
3207 fNTracks_pt[2]->Fill(fNOtrks, fPt);
3208 fNTracks_eta[2]->Fill(fNOtrks, track->Eta());
3209 fNTracks_phi[2]->Fill(fNOtrks, track->Phi());
c852fdae 3210 fNClusters[2]->Fill(ClsNo);
aaec953d 3211 fTPCNcls_pid[2]->Fill(TPCNcls, TPCNcls_pid);
c852fdae 3212
9a1f999b 3213 //______________________________________________________________
c852fdae 3214
9a1f999b 3215 //_______________________________________________________
3216 //Correlation Analysis
c852fdae 3217 if(!fUseEMCal)
3218 {
3219 fPtElec_Inc->Fill(fPt);
9a1f999b 3220
c852fdae 3221 if(fCorrelationFlag)
3222 {
3223 ElectronHadronCorrelation(track, iTracks, Vtrack);
3224 }
3225 }
9a1f999b 3226 //_______________________________________________________
3227
3228 ///________________________________________________________________________
c852fdae 3229 }
3230
9a1f999b 3231 //__________________________________________________________________
3232 //Event Mixing Analysis
3233 //Filling pool
c852fdae 3234 if(fEventMixingFlag)
3235 {
3236 fPool = fPoolMgr->GetEventPool(fCentrality->GetCentralityPercentile("V0A"), fZvtx); // Get the buffer associated with the current centrality and z-vtx
3237
3238 if(!fPool) AliFatal(Form("No pool found for centrality = %f, zVtx = %f", fCentrality->GetCentralityPercentile("V0A"), fZvtx));
9a1f999b 3239
c852fdae 3240 fPool->UpdatePool(SelectedHadrons()); // fill the tracks in the event buffer. The ownership is handed over to the event mixing class. We are not allowed to delete tracksClone anymore!
9a1f999b 3241
c852fdae 3242
3243 }
3244
9a1f999b 3245 //__________________________________________________________________
c852fdae 3246
3247 delete fListOfmotherkink;
3248 PostData(1, fOutputList);
3249}
3250
9a1f999b 3251 //______________________________________________________________________
c852fdae 3252void AliAnalysisTaskEMCalHFEpA::Terminate(Option_t *)
3253{
9a1f999b 3254 //Draw result to the screen
3255 //Called once at the end of the query
3256
c852fdae 3257 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
3258
3259 if(!fOutputList)
3260 {
3261 printf("ERROR: Output list not available\n");
3262 return;
3263 }
3264}
3265
9a1f999b 3266 //______________________________________________________________________
c852fdae 3267Bool_t AliAnalysisTaskEMCalHFEpA::ProcessCutStep(Int_t cutStep, AliVParticle *track)
3268{
9a1f999b 3269 //Check single track cuts for a given cut step
3270 //Note this function is called inside the UserExec function
c852fdae 3271 const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack;
3272 if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE;
3273 return kTRUE;
3274}
3275
a89620c8 3276
9a1f999b 3277 //______________________________________________________________________
a89620c8 3278
9a4682da 3279
3280void AliAnalysisTaskEMCalHFEpA::Background(AliVTrack *track, Int_t trackIndex, AliVParticle *vtrack, Bool_t IsTPConly)
a89620c8 3281{
8e2d649d 3282 ///_________________________________________________________________
3283 ///MC analysis
1dd85087 3284 //Bool_t IsMCefix=kFALSE; //to make correction on efix, use kTRUE (do not change the efficiency, so I will keep the correction only for d3)
a89620c8 3285
8e2d649d 3286 if(fIsMC)
a89620c8 3287 {
8e2d649d 3288 if(track->GetLabel() < 0)
3289 {
3290 AliWarning(Form("The track %d does not have a valid MC label",trackIndex));
3291 return;
3292 }
a89620c8 3293
8e2d649d 3294 if(fIsAOD)
3295 {
3296 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2c8e1f6c 3297
8e2d649d 3298 if(fMCparticle->GetMother()<0) return;
67eb14b9 3299
8e2d649d 3300 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
3301 if(fMCparticleMother->GetMother()>0)fMCparticleGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleMother->GetMother());
67eb14b9 3302
8e2d649d 3303 if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221))
3304 {
3305 //Is Background
3306 if(!IsTPConly)fPtBackgroundBeforeReco->Fill(track->Pt());
3307 if(IsTPConly)fPtBackgroundBeforeReco2->Fill(track->Pt());
67eb14b9 3308
3309
8e2d649d 3310 //October 08th weighted histos
3311 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221 ){
3312
2c8e1f6c 3313 Double_t mPt=fMCparticleMother->Pt();
8e2d649d 3314 Double_t mweight=1;
3315
8e2d649d 3316
1dd85087 3317 //________________________________________________________________
3318 //correction for d3 based on data //from Jan
67eb14b9 3319
8e2d649d 3320 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3321 Double_t x=mPt;
8e2d649d 3322
1dd85087 3323 mweight=CalculateWeight(111, x);
3324
8e2d649d 3325 }
2c8e1f6c 3326
1dd85087 3327 //________________________________________________________________
3328
3329 //Histo pT mother versus pT electron
8e2d649d 3330 fpT_m_electron->Fill(mPt, track->Pt());
2c8e1f6c 3331
8e2d649d 3332 if(!IsTPConly)fPtBackgroundBeforeReco_weight->Fill(track->Pt(), 1./mweight);
3333 if(IsTPConly)fPtBackgroundBeforeReco2_weight->Fill(track->Pt(), 1./mweight);
2c8e1f6c 3334 }
2235208e 3335 else if(fMCparticleMother->GetMother()>0 && (TMath::Abs(fMCparticleGMother->GetPdgCode())==111 || TMath::Abs(fMCparticleGMother->GetPdgCode())==221 )){
8e2d649d 3336
2c8e1f6c 3337 Double_t gmPt=fMCparticleGMother->Pt();
8e2d649d 3338 Double_t gmweight=1;
67eb14b9 3339
1dd85087 3340 //________________________________________________________________
3341 //correction for d3 based on data
2235208e 3342
8e2d649d 3343 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3344 Double_t x=gmPt;
1dd85087 3345 gmweight=CalculateWeight(111, x);
8e2d649d 3346 }
2c8e1f6c 3347
8e2d649d 3348
1dd85087 3349 //________________________________________________________________
3350 //Histo pT gmother versus pT electron
8e2d649d 3351
8e2d649d 3352 fpT_gm_electron->Fill(gmPt, track->Pt());
2235208e 3353
8e2d649d 3354 if(!IsTPConly)fPtBackgroundBeforeReco_weight->Fill(track->Pt(), 1./gmweight);
3355 if(IsTPConly)fPtBackgroundBeforeReco2_weight->Fill(track->Pt(), 1./gmweight);
2c8e1f6c 3356 }
3357 else{
8e2d649d 3358 if(!IsTPConly)fPtBackgroundBeforeReco_weight->Fill(track->Pt());
3359 if(IsTPConly)fPtBackgroundBeforeReco2_weight->Fill(track->Pt());
2c8e1f6c 3360 }
8e2d649d 3361 }//particle kind
3362 }//IsAOD
3363 //ESD
3364 else
3365 {
3366 fMCtrack = fMCstack->Particle(track->GetLabel());
9a4682da 3367
8e2d649d 3368 if(fMCtrack->GetFirstMother()<0) return;
3369
3370 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
3371
3372 if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221))
3373 {
3374 //Is Background
3375 if(!IsTPConly)fPtBackgroundBeforeReco->Fill(track->Pt());
3376 if(IsTPConly)fPtBackgroundBeforeReco2->Fill(track->Pt());
3377 }
3378 }
3379 }//IsMC
3380
1dd85087 3381 ///_________________________________________________________________
8e2d649d 3382
1dd85087 3383 //________________________________________________
3384 //Associated particle cut
8e2d649d 3385 fPartnerCuts->SetAcceptKinkDaughters(kFALSE);
3386 fPartnerCuts->SetRequireITSRefit(kTRUE);
3387 fPartnerCuts->SetRequireTPCRefit(kTRUE);
3388 fPartnerCuts->SetEtaRange(-0.9,0.9);
3389 fPartnerCuts->SetMaxChi2PerClusterTPC(4.0);
3390 fPartnerCuts->SetMinNClustersTPC(80);
1dd85087 3391 fPartnerCuts->SetPtRange(0,1e10);
3392 //fPartnerCuts->SetRequireSigmaToVertex(kTRUE);
3393 //fPartnerCuts->SetMaxDCAToVertexXY(1);
3394 //fPartnerCuts->SetMaxDCAToVertexZ(3);
3395 //_________________________________________________
3396
3397 ///#################################################################
3398 //Non-HFE reconstruction
8e2d649d 3399 fNonHFE = new AliSelectNonHFE();
3400 fNonHFE->SetAODanalysis(fIsAOD);
3401 if(fMassCutFlag) fNonHFE->SetInvariantMassCut(fMassCut);
3402 if(fAngleCutFlag) fNonHFE->SetOpeningAngleCut(fAngleCut);
3403 if(fChi2CutFlag) fNonHFE->SetChi2OverNDFCut(fChi2Cut);
3404 if(fDCAcutFlag) fNonHFE->SetDCACut(fDCAcut);
3405 fNonHFE->SetAlgorithm("DCA"); //KF
3406 fNonHFE->SetPIDresponse(fPidResponse);
3407 fNonHFE->SetTrackCuts(-3.5,3.5,fPartnerCuts);
3408 fNonHFE->SetAdditionalCuts(fPtMinAsso,fTpcNclsAsso);
3409
3410 if(!IsTPConly){
3411 fNonHFE->SetHistAngleBack(fOpAngleBack);
3412 fNonHFE->SetHistAngle(fOpAngle);
3413 fNonHFE->SetHistDCABack(fDCABack);
3414 fNonHFE->SetHistDCA(fDCA);
3415 fNonHFE->SetHistMassBack(fInvMassBack);
3416 fNonHFE->SetHistMass(fInvMass);
3417 }
3418 if(IsTPConly){
3419 fNonHFE->SetHistAngleBack(fOpAngleBack2);
3420 fNonHFE->SetHistAngle(fOpAngle2);
3421 fNonHFE->SetHistDCABack(fDCABack2);
3422 fNonHFE->SetHistDCA(fDCA2);
3423 fNonHFE->SetHistMassBack(fInvMassBack2);
3424 fNonHFE->SetHistMass(fInvMass2);
3425 }
3426
3427 fNonHFE->FindNonHFE(trackIndex,vtrack,fVevent);
3428
3429 //index of track selected as partner
3430 Int_t *fUlsPartner = fNonHFE->GetPartnersULS();
3431
3432 //Electron Information
3433 Double_t fPhiE = -999;
3434 Double_t fEtaE = -999;
3435 Double_t fPtE = -999;
3436 fPhiE = track->Phi();
3437 fEtaE = track->Eta();
3438 fPtE = track->Pt();
3439
3440 ///_________________________________________________________________
3441 ///MC analysis
3442 if(fIsMC)
3443 {
3444 if(fIsAOD)
3445 {
3446 if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221))
3447 {
67eb14b9 3448
8e2d649d 3449 Double_t weight=1;
67eb14b9 3450
8e2d649d 3451 if(!IsTPConly){
3452 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
3453 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
3454
2c8e1f6c 3455
67eb14b9 3456
8e2d649d 3457
3458 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221){
3459 Double_t mPt=fMCparticleMother->Pt();
1dd85087 3460 Double_t mweight1=1;
3461 Double_t mweight2=1;
8e2d649d 3462 //Double_t weight=1;
3463
8e2d649d 3464
8e2d649d 3465 //----------------------------------------------------------------------------
3466 //correction based on data only for pi0
8e2d649d 3467 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3468 Double_t x=mPt;
1dd85087 3469 weight=CalculateWeight(111, x);
8e2d649d 3470 }
3471
1dd85087 3472
8e2d649d 3473 //----------------------------------------------------------------------------
3474
3475 //check this
3476 if(fNonHFE->IsULS()) mweight1=(fNonHFE->GetNULS())/weight;
3477 if(fNonHFE->IsLS()) mweight2=(fNonHFE->GetNLS())/weight;
3478
3479 //fill histos
3480 if(fNonHFE->IsULS())fPtElec_ULS_weight->Fill(fPtE, mweight1);
3481 if(fNonHFE->IsLS())fPtElec_LS_weight->Fill(fPtE, mweight2);
3482 }
3483 else if(fMCparticleMother->GetMother()>0 && (TMath::Abs(fMCparticleGMother->GetPdgCode())==111 || TMath::Abs(fMCparticleGMother->GetPdgCode())==221 )){
3484 Double_t gmPt=fMCparticleGMother->Pt();
1dd85087 3485 Double_t gmweight1=1;
3486 Double_t gmweight2=1;
8e2d649d 3487 //Double_t weight=1;
3488
1dd85087 3489 //----------------------------------------------------------------------------
3490
3491 //----------------------------------------------------------------------------
3492
3493 //correction based on data only for pi0
8e2d649d 3494
8e2d649d 3495 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3496 Double_t x=gmPt;
1dd85087 3497 weight=CalculateWeight(111, x);
8e2d649d 3498 }
1dd85087 3499
8e2d649d 3500
3501
3502
3503
3504 //check this
3505 if(fNonHFE->IsULS()) gmweight1=(fNonHFE->GetNULS())/weight;
3506 if(fNonHFE->IsLS()) gmweight2=(fNonHFE->GetNLS())/weight;
3507
3508 //fill histos
3509 if(fNonHFE->IsULS())fPtElec_ULS_weight->Fill(fPtE, gmweight1);
3510 if(fNonHFE->IsLS())fPtElec_LS_weight->Fill(fPtE, gmweight2);
3511 }
3512 else{
3513 if(fNonHFE->IsULS()) fPtElec_ULS_weight->Fill(fPtE,fNonHFE->GetNULS());
3514 if(fNonHFE->IsLS()) fPtElec_LS_weight->Fill(fPtE,fNonHFE->GetNLS());
67eb14b9 3515 }
2235208e 3516
67eb14b9 3517
8e2d649d 3518 }//!IsTPConly
3519
3520 if(IsTPConly){
3521 if(fNonHFE->IsULS()) fPtElec_ULS2->Fill(fPtE,fNonHFE->GetNULS());
3522 if(fNonHFE->IsLS()) fPtElec_LS2->Fill(fPtE,fNonHFE->GetNLS());
67eb14b9 3523
8e2d649d 3524 //new 08 October //weighted histograms
3525 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221){
3526 Double_t mPt=fMCparticleMother->Pt();
3527
1dd85087 3528 Double_t mweight1=1;
3529 Double_t mweight2=1;
8e2d649d 3530 //Double_t weight=1;
3531
8e2d649d 3532
8e2d649d 3533 //----------------------------------------------------------------------------
3534
1dd85087 3535 //correction based on data only for pi0 for d3
3536
8e2d649d 3537 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3538 Double_t x=mPt;
1dd85087 3539 weight=CalculateWeight(111, x);
3540
8e2d649d 3541 }
1dd85087 3542
8e2d649d 3543
3544 //check this
3545 if(fNonHFE->IsULS()) mweight1=(fNonHFE->GetNULS())/weight;
3546 if(fNonHFE->IsLS()) mweight2=(fNonHFE->GetNLS())/weight;
3547
3548 //fill histos
3549 if(fNonHFE->IsULS())fPtElec_ULS2_weight->Fill(fPtE, mweight1);
3550 if(fNonHFE->IsLS())fPtElec_LS2_weight->Fill(fPtE, mweight2);
3551 }
3552 else if(fMCparticleMother->GetMother()>0 && (TMath::Abs(fMCparticleGMother->GetPdgCode())==111 || TMath::Abs(fMCparticleGMother->GetPdgCode())==221 )){
3553 Double_t gmPt=fMCparticleGMother->Pt();
3554 Double_t gmweight1=1;
3555 Double_t gmweight2=1;
3556 //Double_t weight=1;
3557
3558
1dd85087 3559 //----------------------------------------------------------------------------
8e2d649d 3560 //correction based on data only for pi0
1dd85087 3561
8e2d649d 3562 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3563 Double_t x=gmPt;
8e2d649d 3564
1dd85087 3565 weight=CalculateWeight(111, x);
8e2d649d 3566
3567 }
1dd85087 3568
8e2d649d 3569 //----------------------------------------------------------------------------
3570
3571
3572
3573 //check this
3574 if(fNonHFE->IsULS()) gmweight1=(fNonHFE->GetNULS())/weight;
3575 if(fNonHFE->IsLS()) gmweight2=(fNonHFE->GetNLS())/weight;
3576
3577 //fill histos
3578 if(fNonHFE->IsULS())fPtElec_ULS2_weight->Fill(fPtE, gmweight1);
3579 if(fNonHFE->IsLS())fPtElec_LS2_weight->Fill(fPtE, gmweight2);
3580 }
3581 else{
3582 if(fNonHFE->IsULS()) fPtElec_ULS2_weight->Fill(fPtE,fNonHFE->GetNULS());
3583 if(fNonHFE->IsLS()) fPtElec_LS2_weight->Fill(fPtE,fNonHFE->GetNLS());
67eb14b9 3584 }
67eb14b9 3585
1dd85087 3586
3587 //----------------------------------------------------------------------------
3588 //to check other way to calculate efficiency
3589 //ULS with no weight from ULS-LS original
3590 //we have to know if track2 comes from same mother!!!
3591 //----------------------------------------------------------------------------
8e2d649d 3592 if(fNonHFE->IsULS()){
3593
3594 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
3595 {
3596
3597 AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks);
3598 if (!Vtrack2)
3599 {
3600 printf("ERROR: Could not receive track %d\n", iTracks);
3601 continue;
3602 }
3603 AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2);
3604 if(track2->GetLabel()<0) continue;
3605 fMCparticle2 = (AliAODMCParticle*) fMCarray->At(track2->GetLabel());
3606 if(fMCparticle2->GetMother()<0) continue;
3607
3608 for(Int_t i = 0; i < fNonHFE->GetNULS(); i++)
3609 {
3610 if(fUlsPartner[i]==iTracks){
3611 //only fill if it has same mother
1dd85087 3612 //with weight to take into account the number of partners
3613 if(fMCparticle2->GetMother()==fMCparticle->GetMother()) fPtElec_ULS_MC->Fill(fPtE, fNonHFE->GetNULS());
8e2d649d 3614
3615 //-----------------------------------------------------------------------------------------------------------
3616 //weight for mother
1dd85087 3617 //Double_t weight2=1;
8e2d649d 3618 Double_t mPt=fMCparticleMother->Pt();
3619
3620
3621 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3622 Double_t x=mPt;
1dd85087 3623 weight=CalculateWeight(111, x);
3624
8e2d649d 3625
3626 }
1dd85087 3627
3628 //weight for grandmother
8e2d649d 3629 Double_t gmPt=fMCparticleGMother->Pt();
3630 if(TMath::Abs((fMCparticleMother->GetMother()>0) && ((fMCparticleGMother->GetPdgCode())==111))){
3631 Double_t x=gmPt;
1dd85087 3632 weight=CalculateWeight(111, x);
3633
8e2d649d 3634 }
3635
8e2d649d 3636
1dd85087 3637 if(fMCparticle2->GetMother()==fMCparticle->GetMother()) fPtElec_ULS_MC_weight->Fill(fPtE, (fNonHFE->GetNULS())*1./weight);
3638
3639 //-----------------------------------------------------------------------------------------------------------
3640 //end of weight
8e2d649d 3641
3642 }//partner found same as track
3643 }//loop in all partner
3644
3645 }//track
3646 }//is ULS
1dd85087 3647 //----------------------------------------------------------------------------
3648 //end of part to check other way to calculate efficiency
3649 //----------------------------------------------------------------------------
2c8e1f6c 3650
8e2d649d 3651 }//IsTPConly
2c8e1f6c 3652
8e2d649d 3653 }//particle kind
2235208e 3654
8e2d649d 3655 if(IsTPConly){
3656 //ULS-LS with no pid AOD
3657 if(fNonHFE->IsULS()) fPtElec_ULS_NoPid->Fill(fPtE,fNonHFE->GetNULS());
3658 if(fNonHFE->IsLS()) fPtElec_LS_NoPid->Fill(fPtE,fNonHFE->GetNLS());
9a4682da 3659 }
3660
8e2d649d 3661 }//close IsAOD
3662 //It is ESD
3663 else
3664 {
3665 if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221))
3666 {
3667 if(!IsTPConly){
3668 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
3669 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
3670 }
3671
3672 if(IsTPConly){
3673 if(fNonHFE->IsULS()) fPtElec_ULS2->Fill(fPtE,fNonHFE->GetNULS());
3674 if(fNonHFE->IsLS()) fPtElec_LS2->Fill(fPtE,fNonHFE->GetNLS());
3675 }
9a4682da 3676 }
8e2d649d 3677
3678
3679 }
3680 }//close IsMC
3681 ///_________________________________________________________________
3682 //not MC
3683 else
3684 {
3685 if(!IsTPConly){
3686 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
3687 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
3688 }
3689
3690 if(IsTPConly){
3691 if(fNonHFE->IsULS()) fPtElec_ULS2->Fill(fPtE,fNonHFE->GetNULS());
3692 if(fNonHFE->IsLS()) fPtElec_LS2->Fill(fPtE,fNonHFE->GetNLS());
a89620c8 3693 }
9a4682da 3694 }
3695
8e2d649d 3696
3697
3698}//end of Background function
a89620c8 3699
9a1f999b 3700 //______________________________________________________________________
c852fdae 3701void AliAnalysisTaskEMCalHFEpA::ElectronHadronCorrelation(AliVTrack *track, Int_t trackIndex, AliVParticle *vtrack)
3702{
a89620c8 3703
8e2d649d 3704 ///_________________________________________________________________
3705 ///MC analysis
c852fdae 3706 if(fIsMC)
3707 {
9a1f999b 3708 if(track->GetLabel() < 0)
c852fdae 3709 {
9a1f999b 3710 AliWarning(Form("The track %d does not have a valid MC label",trackIndex));
3711 return;
c852fdae 3712 }
9a1f999b 3713
c852fdae 3714 if(fIsAOD)
3715 {
3716 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
3717
3718 if(fMCparticle->GetMother()<0) return;
3719
3720 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
3721
3722 if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221))
3723 {
9a1f999b 3724 //Is Background
c852fdae 3725 fPtBackgroundBeforeReco->Fill(track->Pt());
3726 }
3727 }
3728 else
3729 {
3730 fMCtrack = fMCstack->Particle(track->GetLabel());
3731
3732 if(fMCtrack->GetFirstMother()<0) return;
3733
3734 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
3735
3736 if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221))
3737 {
9a1f999b 3738 //Is Background
c852fdae 3739 fPtBackgroundBeforeReco->Fill(track->Pt());
3740 }
3741 }
3742 }
9a1f999b 3743 ///_________________________________________________________________
c852fdae 3744
9a1f999b 3745 //________________________________________________
3746 //Associated particle cut
c852fdae 3747 fPartnerCuts->SetAcceptKinkDaughters(kFALSE);
3748 fPartnerCuts->SetRequireITSRefit(kTRUE);
3749 fPartnerCuts->SetRequireTPCRefit(kTRUE);
3750 fPartnerCuts->SetEtaRange(-0.9,0.9);
3751 fPartnerCuts->SetMaxChi2PerClusterTPC(4.0);
3752 fPartnerCuts->SetMinNClustersTPC(80);
3753 fPartnerCuts->SetPtRange(0.3,1e10);
9a1f999b 3754 //fPartnerCuts->SetRequireSigmaToVertex(kTRUE);
3755 //fPartnerCuts->SetMaxDCAToVertexXY(1);
3756 //fPartnerCuts->SetMaxDCAToVertexZ(3);
3757 //_________________________________________________
c852fdae 3758
9a1f999b 3759 ///#################################################################
3760 //Non-HFE reconstruction
c852fdae 3761 fNonHFE = new AliSelectNonHFE();
3762 fNonHFE->SetAODanalysis(fIsAOD);
3763 if(fMassCutFlag) fNonHFE->SetInvariantMassCut(fMassCut);
3764 if(fAngleCutFlag) fNonHFE->SetOpeningAngleCut(fAngleCut);
3765 if(fChi2CutFlag) fNonHFE->SetChi2OverNDFCut(fChi2Cut);
3766 if(fDCAcutFlag) fNonHFE->SetDCACut(fDCAcut);
3767 fNonHFE->SetAlgorithm("DCA"); //KF
3768 fNonHFE->SetPIDresponse(fPidResponse);
3769 fNonHFE->SetTrackCuts(-3.5,3.5,fPartnerCuts);
9a1f999b 3770 fNonHFE->SetAdditionalCuts(fPtMinAsso,fTpcNclsAsso);
9a4682da 3771
c852fdae 3772
3773 fNonHFE->SetHistAngleBack(fOpAngleBack);
3774 fNonHFE->SetHistAngle(fOpAngle);
3775 fNonHFE->SetHistDCABack(fDCABack);
3776 fNonHFE->SetHistDCA(fDCA);
3777 fNonHFE->SetHistMassBack(fInvMassBack);
3778 fNonHFE->SetHistMass(fInvMass);
3779
3780 fNonHFE->FindNonHFE(trackIndex,vtrack,fVevent);
3781
3782 Int_t *fUlsPartner = fNonHFE->GetPartnersULS();
3783 Int_t *fLsPartner = fNonHFE->GetPartnersLS();
3784 Bool_t fUlsIsPartner = kFALSE;
3785 Bool_t fLsIsPartner = kFALSE;
9a1f999b 3786 ///#################################################################
c852fdae 3787
a89620c8 3788
9a1f999b 3789 //Electron Information
c852fdae 3790 Double_t fPhiE = -999;
3791 Double_t fEtaE = -999;
3792 Double_t fPhiH = -999;
3793 Double_t fEtaH = -999;
3794 Double_t fDphi = -999;
3795 Double_t fDeta = -999;
3796 Double_t fPtE = -999;
3797 Double_t fPtH = -999;
3798
3799 Double_t pi = TMath::Pi();
3800
3801 fPhiE = track->Phi();
3802 fEtaE = track->Eta();
3803 fPtE = track->Pt();
3804
a89620c8 3805
9a1f999b 3806 ///_________________________________________________________________
3807 ///MC analysis
c852fdae 3808 if(fIsMC)
3809 {
3810 if(fIsAOD)
3811 {
3812 if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221))
3813 {
3814 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
3815 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
8e2d649d 3816
3817
c852fdae 3818 }
8e2d649d 3819
3820 if(fNonHFE->IsULS()) fPtElec_ULS_NoPid->Fill(fPtE,fNonHFE->GetNULS());
3821 if(fNonHFE->IsLS()) fPtElec_LS_NoPid->Fill(fPtE,fNonHFE->GetNLS());
c852fdae 3822 }
3823 else
3824 {
3825 if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221))
3826 {
3827 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
3828 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
8e2d649d 3829
c852fdae 3830 }
8e2d649d 3831
3832
c852fdae 3833 }
3834 }
9a1f999b 3835 ///_________________________________________________________________
c852fdae 3836 else
3837 {
3838 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
3839 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
3840 }
a89620c8 3841
3842
3843
9a1f999b 3844
3845 //__________________________________________________________________
3846 //Event Mixing Analysis - Hadron Loop
3847 //Retrieve
c852fdae 3848 if(fEventMixingFlag)
3849 {
3850 fPool = fPoolMgr->GetEventPool(fCentrality->GetCentralityPercentile("V0A"), fZvtx); // Get the buffer associated with the current centrality and z-vtx
3851
3852 if(!fPool) AliFatal(Form("No pool found for centrality = %f, zVtx = %f",fCentrality->GetCentralityPercentile("V0A"), fZvtx));
3853
3854 if(fPool->GetCurrentNEvents() >= 5) // start mixing when 5 events are in the buffer
3855 {
3856 fPoolNevents->Fill(fPool->GetCurrentNEvents());
3857
3858 for (Int_t jMix = 0; jMix < fPool->GetCurrentNEvents(); jMix++) // mix with each event in the buffer
3859 {
3860 TObjArray* bgTracks = fPool->GetEvent(jMix);
3861
3862 for (Int_t kMix = 0; kMix < bgTracks->GetEntriesFast(); kMix++) // mix with each track in the event
3863 {
3864 const AliEHCParticle* MixedTrack(dynamic_cast<AliEHCParticle*>(bgTracks->At(kMix)));
3865 if (NULL == MixedTrack) continue;
3866
3867 fPhiH = MixedTrack->Phi();
3868 fEtaH = MixedTrack->Eta();
3869 fPtH = MixedTrack->Pt();
3870
0131ce6c 3871 if(fPtH<fAssHadronPtMin || fPtH>fAssHadronPtMax) continue;
9a1f999b 3872
c852fdae 3873 fDphi = fPhiE - fPhiH;
9a1f999b 3874
c852fdae 3875 if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi;
3876 if (fDphi < -pi/2) fDphi = fDphi + 2*pi;
9a1f999b 3877
c852fdae 3878 fDeta = fEtaE - fEtaH;
9a1f999b 3879
2c8e1f6c 3880 Double_t fPtBin[7] = {1,2,4,6,8,10,15};
c852fdae 3881
2c8e1f6c 3882 for(Int_t i = 0; i < 6; i++)
c852fdae 3883 {
3884 if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1])
3885 {
3886 fCEtaPhi_Inc_EM[i]->Fill(fDphi,fDeta);
3887
3888 if(fNonHFE->IsULS()) fCEtaPhi_ULS_EM[i]->Fill(fDphi,fDeta);
3889 if(fNonHFE->IsLS()) fCEtaPhi_LS_EM[i]->Fill(fDphi,fDeta);
3890
3891 if(fNonHFE->IsULS()) fCEtaPhi_ULS_Weight_EM[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS());
3892 if(fNonHFE->IsLS()) fCEtaPhi_LS_Weight_EM[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS());
3893 }
3894 }
3895
9a1f999b 3896 // TODO your code: do event mixing with current event and bgTracks
3897 // note that usually the content filled now is weighted by 1 / pool->GetCurrentNEvents()
c852fdae 3898 }
3899 }
3900 }
3901 }
9a1f999b 3902 //__________________________________________________________________
c852fdae 3903
9a1f999b 3904 //__________________________________________________________________
3905 //Same Event Analysis - Hadron Loop
c852fdae 3906 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
3907 {
3908 if(trackIndex==iTracks) continue;
3909
3910 AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks);
3911 if (!Vtrack2)
3912 {
3913 printf("ERROR: Could not receive track %d\n", iTracks);
3914 continue;
3915 }
9a1f999b 3916
c852fdae 3917 AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2);
3918
0131ce6c 3919 if(track2->Eta()<fEtaCutMin || track2->Eta()>fEtaCutMax ) continue;
3920
9a1f999b 3921 if(fIsAOD)
3922 {
c852fdae 3923 AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2);
3924 if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
3925 if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
3926 if(atrack2->GetTPCNcls() < 80) continue;
2c8e1f6c 3927 if(fAssocWithSPD && ((!(atrack2->HasPointOnITSLayer(0))) && (!(atrack2->HasPointOnITSLayer(1))))) continue;
c852fdae 3928 }
3929 else
3930 {
3931 AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2);
3932 if(!fPartnerCuts->AcceptTrack(etrack2)) continue;
3933 }
3934
3935 fPhiH = track2->Phi();
3936 fEtaH = track2->Eta();
3937 fPtH = track2->Pt();
3938
0131ce6c 3939 if(fPtH<fAssHadronPtMin || fPtH>fAssHadronPtMax) continue;
c852fdae 3940
3941 fDphi = fPhiE - fPhiH;
9a1f999b 3942
c852fdae 3943 if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi;
3944 if (fDphi < -pi/2) fDphi = fDphi + 2*pi;
9a1f999b 3945
c852fdae 3946 fDeta = fEtaE - fEtaH;
9a1f999b 3947
2c8e1f6c 3948 Double_t fPtBin[7] = {1,2,4,6,8,10,15};
c852fdae 3949
8e2d649d 3950 //______________________________________________________________
3951 //Check if this track is a Non-HFE partner
9a1f999b 3952 for(Int_t i = 0; i < fNonHFE->GetNULS(); i++)
3953 {
3954 if(fUlsPartner[i]==iTracks) fUlsIsPartner=kTRUE;
3955 }
3956 for(Int_t i = 0; i < fNonHFE->GetNLS(); i++)
3957 {
3958 if(fLsPartner[i]==iTracks) fLsIsPartner=kTRUE;
3959 }
8e2d649d 3960 //______________________________________________________________
c852fdae 3961
2c8e1f6c 3962 for(Int_t i = 0; i < 6; i++)
9a1f999b 3963 {
c852fdae 3964 if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1])
3965 {
3966 fCEtaPhi_Inc[i]->Fill(fDphi,fDeta);
3967
3968 if(fNonHFE->IsULS()) fCEtaPhi_ULS[i]->Fill(fDphi,fDeta);
3969 if(fNonHFE->IsLS()) fCEtaPhi_LS[i]->Fill(fDphi,fDeta);
3970 if(fNonHFE->IsULS() && !fUlsIsPartner) fCEtaPhi_ULS_NoP[i]->Fill(fDphi,fDeta);
3971 if(fNonHFE->IsLS() && !fLsIsPartner) fCEtaPhi_LS_NoP[i]->Fill(fDphi,fDeta);
3972
3973 if(fNonHFE->IsULS()) fCEtaPhi_ULS_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS());
3974 if(fNonHFE->IsLS()) fCEtaPhi_LS_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS());
3975 if(fNonHFE->IsULS() && !fUlsIsPartner) fCEtaPhi_ULS_NoP_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS());
3976 if(fNonHFE->IsLS() && !fLsIsPartner) fCEtaPhi_LS_NoP_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS());
3977 }
9a1f999b 3978 }
c852fdae 3979 }
3980}
3981
9a1f999b 3982 //____________________________________________________________________________________________________________
3983 //Create a TObjArray with selected hadrons, for the mixed event analysis
c852fdae 3984TObjArray* AliAnalysisTaskEMCalHFEpA::SelectedHadrons()
3985{
3986 fTracksClone = new TObjArray;
3987 fTracksClone->SetOwner(kTRUE);
3988
3989 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
3990 {
3991 AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks);
3992 if (!Vtrack2)
3993 {
3994 printf("ERROR: Could not receive track %d\n", iTracks);
3995 continue;
3996 }
9a1f999b 3997
c852fdae 3998 AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2);
3999
0131ce6c 4000 if(track2->Eta()<fEtaCutMin || track2->Eta()>fEtaCutMax ) continue;
4001
9a1f999b 4002 if(fIsAOD)
4003 {
c852fdae 4004 AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2);
4005 if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
4006 if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
4007 if(atrack2->GetTPCNcls() < 80) continue;
2c8e1f6c 4008 if(fAssocWithSPD && ((!(atrack2->HasPointOnITSLayer(0))) && (!(atrack2->HasPointOnITSLayer(1))))) continue;
c852fdae 4009 }
4010 else
4011 {
4012 AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2);
4013 if(!fPartnerCuts->AcceptTrack(etrack2)) continue;
4014 }
9a1f999b 4015
c852fdae 4016 fTracksClone->Add(new AliEHCParticle(track2->Eta(), track2->Phi(), track2->Pt()));
4017 }
4018 return fTracksClone;
4019}
9a1f999b 4020 //____________________________________________________________________________________________________________
c852fdae 4021
9a1f999b 4022 //______________________________________________________________________
c852fdae 4023void AliAnalysisTaskEMCalHFEpA::DiHadronCorrelation(AliVTrack *track, Int_t trackIndex)
4024{
9a1f999b 4025 //________________________________________________
4026 //Associated particle cut
c852fdae 4027 fPartnerCuts->SetAcceptKinkDaughters(kFALSE);
4028 fPartnerCuts->SetRequireITSRefit(kTRUE);
4029 fPartnerCuts->SetRequireTPCRefit(kTRUE);
4030 fPartnerCuts->SetEtaRange(-0.9,0.9);
4031 fPartnerCuts->SetMaxChi2PerClusterTPC(4.0);
4032 fPartnerCuts->SetMinNClustersTPC(80);
4033 fPartnerCuts->SetPtRange(0.3,1e10);
9a1f999b 4034 //fPartnerCuts->SetRequireSigmaToVertex(kTRUE);
4035 //fPartnerCuts->SetMaxDCAToVertexXY(1);
4036 //fPartnerCuts->SetMaxDCAToVertexZ(3);
4037 //_________________________________________________
c852fdae 4038
9a1f999b 4039 //Electron Information
c852fdae 4040 Double_t fPhiE = -999;
4041 Double_t fEtaE = -999;
4042 Double_t fPhiH = -999;
4043 Double_t fEtaH = -999;
4044 Double_t fDphi = -999;
4045 Double_t fDeta = -999;
4046 Double_t fPtE = -999;
4047 Double_t fPtH = -999;
4048
4049 Double_t pi = TMath::Pi();
4050
4051 fPhiE = track->Phi();
4052 fEtaE = track->Eta();
4053 fPtE = track->Pt();
4054
9a1f999b 4055 //__________________________________________________________________
4056 //Same Event Analysis - Hadron Loop
c852fdae 4057 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
4058 {
4059 if(trackIndex==iTracks) continue;
4060
4061 AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks);
4062 if (!Vtrack2)
4063 {
4064 printf("ERROR: Could not receive track %d\n", iTracks);
4065 continue;
4066 }
9a1f999b 4067
c852fdae 4068 AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2);
0131ce6c 4069 if(track2->Eta()<fEtaCutMin || track2->Eta()>fEtaCutMax ) continue;
c852fdae 4070
9a1f999b 4071 if(fIsAOD)
4072 {
c852fdae 4073 AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2);
4074 if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
4075 if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
4076 if(atrack2->GetTPCNcls() < 80) continue;
2c8e1f6c 4077 if(fAssocWithSPD && ((!(atrack2->HasPointOnITSLayer(0))) && (!(atrack2->HasPointOnITSLayer(1))))) continue;
c852fdae 4078 }
4079 else
4080 {
4081 AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2);
4082 if(!fPartnerCuts->AcceptTrack(etrack2)) continue;
4083 }
4084
4085 fPhiH = track2->Phi();
4086 fEtaH = track2->Eta();
4087 fPtH = track2->Pt();
4088
0131ce6c 4089 if(fPtH<fAssHadronPtMin || fPtH>fAssHadronPtMax) continue;
c852fdae 4090
4091 fDphi = fPhiE - fPhiH;
9a1f999b 4092
c852fdae 4093 if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi;
4094 if (fDphi < -pi/2) fDphi = fDphi + 2*pi;
9a1f999b 4095
c852fdae 4096 fDeta = fEtaE - fEtaH;
9a1f999b 4097
2c8e1f6c 4098 Double_t fPtBin[7] = {1,2,4,6,8,10,15};
c852fdae 4099
2c8e1f6c 4100 for(Int_t i = 0; i < 6; i++)
9a1f999b 4101 {
c852fdae 4102 if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1])
4103 {
4104 fCEtaPhi_Inc_DiHadron[i]->Fill(fDphi,fDeta);
4105 }
9a1f999b 4106 }
c852fdae 4107 }
4108}
9a1f999b 4109 //____________________________________________________________________________________________________________
c852fdae 4110
9a1f999b 4111 //______________________________________________________________________
c852fdae 4112Bool_t AliAnalysisTaskEMCalHFEpA::FindMother(Int_t mcIndex)
4113{
4114 fIsHFE1 = kFALSE;
4115 fIsHFE2 = kFALSE;
4116 fIsNonHFE = kFALSE;
4117 fIsFromD = kFALSE;
4118 fIsFromB = kFALSE;
4119 fIsFromPi0 = kFALSE;
4120 fIsFromEta = kFALSE;
4121 fIsFromGamma = kFALSE;
4122
4123 if(mcIndex < 0 || !fIsMC)
4124 {
4125 return kFALSE;
4126 }
4127
4128 Int_t pdg = -99999;
4129 Int_t mpdg = -99999;
4130 Int_t gmpdg = -99999;
4131 Int_t ggmpdg = -99999;
4132 Int_t gggmpdg = -99999;
4133
4134 if(fIsAOD)
4135 {
4136 fMCparticle = (AliAODMCParticle*) fMCarray->At(mcIndex);
9a1f999b 4137
c852fdae 4138 pdg = TMath::Abs(fMCparticle->GetPdgCode());
4139
4140
4141 if(pdg!=11)
4142 {
4143 fIsHFE1 = kFALSE;
4144 fIsHFE2 = kFALSE;
4145 fIsNonHFE = kFALSE;
4146 fIsFromD = kFALSE;
4147 fIsFromB = kFALSE;
4148 fIsFromPi0 = kFALSE;
4149 fIsFromEta = kFALSE;
4150 fIsFromGamma = kFALSE;
4151 return kFALSE;
4152 }
4153
4154 if(fMCparticle->GetMother()<0)
4155 {
4156 fIsHFE1 = kFALSE;
4157 fIsHFE2 = kFALSE;
4158 fIsNonHFE = kFALSE;
4159 fIsFromD = kFALSE;
4160 fIsFromB = kFALSE;
4161 fIsFromPi0 = kFALSE;
4162 fIsFromEta = kFALSE;
4163 fIsFromGamma = kFALSE;
4164 return kFALSE;
4165 }
4166
4167 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
4168 mpdg = TMath::Abs(fMCparticleMother->GetPdgCode());
4169
4170 if(fMCparticleMother->GetMother()<0)
4171 {
4172 gmpdg = 0;
4173 ggmpdg = 0;
4174 gggmpdg = 0;
4175 }
4176 else
4177 {
4178 fMCparticleGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleMother->GetMother());
4179 gmpdg = TMath::Abs(fMCparticleGMother->GetPdgCode());
4180 if(fMCparticleGMother->GetMother()<0)
4181 {
4182 ggmpdg = 0;
4183 gggmpdg = 0;
4184 }
4185 else
4186 {
4187 fMCparticleGGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleGMother->GetMother());
4188 ggmpdg = TMath::Abs(fMCparticleGGMother->GetPdgCode());
4189 if(fMCparticleGGMother->GetMother()<0)
4190 {
4191 gggmpdg = 0;
4192 }
4193 else
4194 {
4195 fMCparticleGGGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleGGMother->GetMother());
4196 gggmpdg = TMath::Abs(fMCparticleGGGMother->GetPdgCode());
4197 }
4198 }
4199 }
4200 }
4201 else
4202 {
4203 fMCtrack = fMCstack->Particle(mcIndex);
9a1f999b 4204
c852fdae 4205 pdg = TMath::Abs(fMCtrack->GetPdgCode());
4206
4207 if(pdg!=11)
4208 {
4209 fIsHFE1 = kFALSE;
4210 fIsHFE2 = kFALSE;
4211 fIsNonHFE = kFALSE;
4212 fIsFromD = kFALSE;
4213 fIsFromB = kFALSE;
4214 fIsFromPi0 = kFALSE;
4215 fIsFromEta = kFALSE;
4216 fIsFromGamma = kFALSE;
4217 return kFALSE;
4218 }
4219
4220 if(fMCtrack->GetFirstMother()<0)
4221 {
4222 fIsHFE1 = kFALSE;
4223 fIsHFE2 = kFALSE;
4224 fIsNonHFE = kFALSE;
4225 fIsFromD = kFALSE;
4226 fIsFromB = kFALSE;
4227 fIsFromPi0 = kFALSE;
4228 fIsFromEta = kFALSE;
4229 fIsFromGamma = kFALSE;
4230 return kFALSE;
4231 }
4232
4233 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
4234 mpdg = TMath::Abs(fMCtrackMother->GetPdgCode());
4235
4236 if(fMCtrackMother->GetFirstMother()<0)
4237 {
4238 gmpdg = 0;
4239 ggmpdg = 0;
4240 gggmpdg = 0;
4241 }
4242 else
4243 {
4244 fMCtrackGMother = fMCstack->Particle(fMCtrackMother->GetFirstMother());
4245 gmpdg = TMath::Abs(fMCtrackGMother->GetPdgCode());
4246
4247 if(fMCtrackGMother->GetFirstMother()<0)
4248 {
4249 ggmpdg = 0;
4250 gggmpdg = 0;
4251 }
4252 else
4253 {
4254 fMCtrackGGMother = fMCstack->Particle(fMCtrackGMother->GetFirstMother());
4255 ggmpdg = TMath::Abs(fMCtrackGGMother->GetPdgCode());
9a1f999b 4256
c852fdae 4257 if(fMCtrackGGMother->GetFirstMother()<0)
4258 {
4259 gggmpdg = 0;
4260 }
4261 else
4262 {
4263 fMCtrackGGGMother = fMCstack->Particle(fMCtrackGGMother->GetFirstMother());
4264 gggmpdg = TMath::Abs(fMCtrackGGGMother->GetPdgCode());
4265 }
4266 }
4267 }
4268 }
4269
4270 //Tag Electron Source
4271 if(mpdg==111 || mpdg==221 || mpdg==22)
4272 {
4273 fIsHFE1 = kFALSE;
4274 fIsHFE2 = kFALSE;
4275 fIsNonHFE = kTRUE;
4276 fIsFromD = kFALSE;
4277 fIsFromB = kFALSE;
4278
4279 fIsFromPi0 = kFALSE;
4280 fIsFromEta = kFALSE;
4281 fIsFromGamma = kFALSE;
4282
4283 if(mpdg==111) fIsFromPi0 = kFALSE;
4284 if(mpdg==221)fIsFromEta = kFALSE;
4285 if(mpdg==22) fIsFromGamma = kFALSE;
4286
4287 return kTRUE;
4288 }
4289 else
4290 {
4291 fIsHFE1 = kFALSE;
4292 fIsHFE2 = kTRUE;
4293
4294 fIsFromPi0 = kFALSE;
4295 fIsFromEta = kFALSE;
4296 fIsFromGamma = kFALSE;
4297
4298 fIsNonHFE = kFALSE;
4299
4300 fIsFromD = kFALSE;
4301 fIsFromB = kFALSE;
4302
4303 if(mpdg>400 && mpdg<500)
4304 {
4305 if((gmpdg>500 && gmpdg<600) || (ggmpdg>500 && ggmpdg<600) || (gggmpdg>500 && gggmpdg<600))
4306 {
4307 fIsHFE1 = kTRUE;
4308 fIsFromD = kFALSE;
4309 fIsFromB = kTRUE;
4310 return kTRUE;
4311 }
4312 else
4313 {
4314 fIsHFE1 = kTRUE;
4315 fIsFromD = kTRUE;
4316 fIsFromB = kFALSE;
4317 return kTRUE;
4318 }
4319 }
4320 else if(mpdg>500 && mpdg<600)
4321 {
4322 fIsHFE1 = kTRUE;
4323 fIsFromD = kFALSE;
4324 fIsFromB = kTRUE;
4325 return kTRUE;
4326 }
4327 else
4328 {
4329 fIsHFE1 = kFALSE;
4330 fIsFromD = kFALSE;
4331 fIsFromB = kFALSE;
4332 return kFALSE;
4333 }
4334 }
4335}
1dd85087 4336/*
4337Bool_t AliAnalysisTaskEMCalHFEpA::ContainsBadChannel(TString calorimeter,UShort_t* cellList, Int_t nCells)
4338{
4339 // Check that in the cluster cells, there is no bad channel of those stored
4340 // in fEMCALBadChannelMap
4341 // adapted from AliCalorimeterUtils
4342
4343 //if (!fRemoveBadChannels) return kFALSE;
4344 //printf("fEMCALBadChannelMap %p, fPHOSBadChannelMap %p \n",fEMCALBadChannelMap,fPHOSBadChannelMap);
4345 if( !fEMCALRecoUtils->GetEMCALChannelStatusMap(0)) return kFALSE;
4346
4347 //Int_t icol = -1;
4348 //Int_t irow = -1;
4349 //Int_t imod = -1;
4350 for(Int_t iCell = 0; iCell<nCells; iCell++){
4351
4352 //Get the column and row
4353 if(calorimeter == "EMCAL"){
4354 return fEMCALRecoUtils->ClusterContainsBadChannel((AliEMCALGeometry*)fEMCALGeo,cellList,nCells);
4355 }
4356 else return kFALSE;
4357
4358 }// cell cluster loop
4359
4360 return kFALSE;
4361
4362}
4363*/
4364/*
4365
4366//________________________________________________________________________________
4367TArrayI AliAnalysisTaskEMCalHFEpA::GetTriggerPatches(Bool_t IsEventEMCALL0, Bool_t IsEventEMCALL1)
4368{
4369 // Select the patches that triggered
4370 // Depend on L0 or L1
4371
4372 // some variables
4373 //Int_t trigtimes[30], globCol, globRow,ntimes, i;
4374 Int_t globCol, globRow;
4375
4376 Int_t absId = -1; //[100];
4377 Int_t nPatch = 0;
4378
4379 TArrayI patches(0);
4380
4381 // get object pointer
4382 AliVCaloTrigger *caloTrigger = InputEvent()->GetCaloTrigger( "EMCAL" );
4383
4384 // class is not empty
4385 if( caloTrigger->GetEntries() > 0 )
4386 {
4387 // must reset before usage, or the class will fail
4388 caloTrigger->Reset();
4389
4390 // go throuth the trigger channels
4391 while( caloTrigger->Next() )
4392 {
4393 // get position in global 2x2 tower coordinates
4394 caloTrigger->GetPosition( globCol, globRow );
4395
4396 //L0
4397 if(IsEventEMCALL0)
4398 {
4399 //not implemented
4400 }
4401
4402
4403 else if(IsEventEMCALL1) // L1
4404 {
4405 Int_t bit = 0;
4406 caloTrigger->GetTriggerBits(bit);
4407
4408 Bool_t isEGA = ((bit >> fBitEGA) & 0x1);
4409 //Bool_t isEJE = ((bit >> fBitEJE) & 0x1) && IsEventEMCALL1Jet () ;
4410
4411 if(!isEGA) continue;
4412
4413 Int_t patchsize = -1;
4414 if(isEGA) patchsize = 2;
4415 //else if (isEJE) patchsize = 16;
4416
4417 // add 2x2 (EGA) or 16x16 (EJE) patches
4418 for(Int_t irow=0; irow < patchsize; irow++)
4419 {
4420 for(Int_t icol=0; icol < patchsize; icol++)
4421 {
4422 GetCaloUtils()->GetEMCALGeometry()->GetAbsFastORIndexFromPositionInEMCAL(globCol+icol,globRow+irow, absId);
4423 //printf("pass the time cut globCol %d, globRow %d absId %d\n",globCol,globRow, absIDTrig[nTrig]);
4424 patches.Set(nPatch+1); // Set size of this array to nPatch+1 ints.
4425 patches.AddAt(absId,nPatch++); //Add Int_t absId at position nPatch++
4426 }
4427 }
4428
4429 } // L1
4430
4431 } // trigger iterator
4432 } // go thorough triggers
4433
4434 printf("N patches %d, test %d,first %d, last %d\n",patches.GetSize(), nPatch, patches.At(0), patches.At(patches.GetSize()-1));
4435
4436 return patches;
4437}
4438 */
4439Double_t AliAnalysisTaskEMCalHFEpA::CalculateWeight(Int_t pdg_particle, Double_t x)
4440{
4441 //weight for d3 based on MinJung parametrization //sent by Jan
4442 Double_t weight=1;
4443 if(pdg_particle==111){
4444 if(0.100000 <= x < 0.112797 ) weight=1.262120;
4445 if(0.112797 <= x < 0.127231 ) weight=1.277765;
4446 if(0.127231 <= x < 0.143512 ) weight=1.295605;
4447 if(0.143512 <= x < 0.161877 ) weight=1.318155;
4448 if(0.161877 <= x < 0.182592 ) weight=1.348693;
4449 if(0.182592 <= x < 0.205957 ) weight=1.388636;
4450 if(0.205957 <= x < 0.232313 ) weight=1.439122;
4451 if(0.232313 <= x < 0.262041 ) weight=1.497452;
4452 if(0.262041 <= x < 0.295573 ) weight=1.559409;
4453 if(0.295573 <= x < 0.333397 ) weight=1.615169;
4454 if(0.333397 <= x < 0.376060 ) weight=1.654954;
4455 if(0.376060 <= x < 0.424183 ) weight=1.668753;
4456 if(0.424183 <= x < 0.478465 ) weight=1.652225;
4457 if(0.478465 <= x < 0.539692 ) weight=1.603119;
4458 if(0.539692 <= x < 0.608754 ) weight=1.526049;
4459 if(0.608754 <= x < 0.686654 ) weight=1.426724;
4460 if(0.686654 <= x < 0.774523 ) weight=1.312684;
4461 if(0.774523 <= x < 0.873636 ) weight=1.195395;
4462 if(0.873636 <= x < 0.985432 ) weight=1.086264;
4463 if(0.985432 <= x < 1.111534 ) weight=0.993666;
4464 if(1.111534 <= x < 1.253773 ) weight=0.922587;
4465 if(1.253773 <= x < 1.414214 ) weight=0.875739;
4466 if(1.414214 <= x < 1.595185 ) weight=0.852181;
4467 if(1.595185 <= x < 1.799315 ) weight=0.847828;
4468 if(1.799315 <= x < 2.029567 ) weight=0.863875;
4469 if(2.029567 <= x < 2.289283 ) weight=0.899112;
4470 if(2.289283 <= x < 2.582235 ) weight=0.955194;
4471 if(2.582235 <= x < 2.912674 ) weight=1.033824;
4472 if(2.912674 <= x < 3.285398 ) weight=1.133714;
4473 if(3.285398 <= x < 3.705818 ) weight=1.259471;
4474 if(3.705818 <= x < 4.180038 ) weight=1.406883;
4475 if(4.180038 <= x < 4.714942 ) weight=1.578923;
4476 if(4.714942 <= x < 5.318296 ) weight=1.778513;
4477 if(5.318296 <= x < 5.998859 ) weight=2.001171;
4478 if(5.998859 <= x < 6.766511 ) weight=2.223161;
4479 if(6.766511 <= x < 7.632396 ) weight=2.449445;
4480 if(7.632396 <= x < 8.609086 ) weight=2.661734;
4481 if(8.609086 <= x < 9.710759 ) weight=2.851935;
4482 if(9.710759 <= x < 10.953409 ) weight=2.974319;
4483 if(10.953409 <= x < 12.355077 ) weight=3.106314;
4484 if(12.355077 <= x < 13.936111 ) weight=3.126815;
4485 if(13.936111 <= x < 15.719464 ) weight=3.150053;
4486 if(15.719464 <= x < 17.731026 ) weight=3.218509;
4487 if(17.731026 <= x < 20.000000 ) weight=3.252141;
4488
4489
4490 }
4491 else if(pdg_particle==221){
4492 weight=1;
4493 }
4494 else weight=1;
4495
4496 return weight;
4497
4498}
4499
4500
4501
4502