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