]>
Commit | Line | Data |
---|---|---|
c852fdae | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //////////////////////////////////////////////////////////////////////// | |
17 | // // | |
18 | // Task for Heavy-flavour electron analysis in pPb collisions // | |
19 | // (+ Electron-Hadron Jetlike Azimuthal Correlation) // | |
20 | // // | |
21 | // v1.0 // | |
22 | // // | |
23 | // Authors // | |
24 | // Elienos Pereira de Oliveira Filho (epereira@cern.ch) // | |
25 | // Cristiane Jahnke (cristiane.jahnke@cern.ch) // | |
26 | // // | |
27 | //////////////////////////////////////////////////////////////////////// | |
28 | ||
29 | #include "TChain.h" | |
30 | #include "TTree.h" | |
31 | #include "TNtuple.h" | |
32 | #include "TH1F.h" | |
33 | #include "TH2F.h" | |
34 | #include "TCanvas.h" | |
35 | #include "AliAnalysisTask.h" | |
36 | #include "AliAnalysisManager.h" | |
37 | #include "AliESDEvent.h" | |
38 | #include "AliAODEvent.h" | |
39 | #include "AliVEvent.h" | |
40 | #include "AliESDInputHandler.h" | |
41 | #include "AliESDtrackCuts.h" | |
42 | #include "AliESDCaloCluster.h" | |
43 | #include "AliESDCaloCells.h" | |
44 | #include "AliEMCALTrack.h" | |
45 | #include "AliExternalTrackParam.h" | |
46 | #include "AliPhysicsSelection.h" | |
47 | #include "TGeoGlobalMagField.h" | |
48 | #include "AliMagF.h" | |
49 | #include "AliLog.h" | |
50 | #include "AliStack.h" | |
51 | #include "AliCentrality.h" | |
52 | #include "AliAODMCParticle.h" | |
53 | #include "AliAODMCHeader.h" | |
54 | #include "AliPID.h" | |
55 | #include "AliPIDResponse.h" | |
56 | #include "AliHFEcontainer.h" | |
57 | #include "AliHFEcuts.h" | |
58 | #include "AliHFEpid.h" | |
59 | #include "AliHFEpidBase.h" | |
60 | #include "AliHFEpidQAmanager.h" | |
61 | #include "AliHFEtools.h" | |
62 | #include "AliCFContainer.h" | |
63 | #include "AliCFManager.h" | |
64 | #include "AliSelectNonHFE.h" | |
65 | #include "AliHFEpidTPC.h" | |
66 | #include "AliAnalysisTaskEMCalHFEpA.h" | |
67 | #include "TMath.h" | |
68 | #include "THnSparse.h" | |
69 | #include "TLorentzVector.h" | |
70 | #include "TString.h" | |
71 | #include "TFile.h" | |
72 | #include "AliESDHandler.h" | |
73 | #include "AliMCEventHandler.h" | |
74 | #include "AliMCEvent.h" | |
75 | #include "AliStack.h" | |
76 | #include "TParticle.h" | |
77 | #include "AliLog.h" | |
78 | #include "AliAnalysisTaskSE.h" | |
79 | #include "TRefArray.h" | |
80 | #include "TVector.h" | |
81 | #include "stdio.h" | |
82 | #include "TGeoManager.h" | |
83 | #include "iostream" | |
84 | #include "fstream" | |
85 | #include "AliKFParticle.h" | |
86 | #include "AliKFVertex.h" | |
87 | #include "AliVParticle.h" | |
88 | #include "AliVTrack.h" | |
89 | #include "AliEventPoolManager.h" | |
90 | #include "TObjArray.h" | |
91 | //______________________________________________________________________ | |
92 | ||
93 | //______________________________________________________________________ | |
94 | ClassImp(AliAnalysisTaskEMCalHFEpA) | |
95 | ||
96 | //______________________________________________________________________ | |
97 | AliAnalysisTaskEMCalHFEpA::AliAnalysisTaskEMCalHFEpA(const char *name) | |
98 | : AliAnalysisTaskSE(name) | |
99 | ,fCorrelationFlag(0) | |
100 | ,fIsMC(0) | |
101 | ,fUseEMCal(kFALSE) | |
102 | ,fEMCEG1(kFALSE) | |
103 | ,fEMCEG2(kFALSE) | |
104 | ,fIsHFE1(kFALSE) | |
105 | ,fIsHFE2(kFALSE) | |
106 | ,fIsNonHFE(kFALSE) | |
107 | ,fIsFromD(kFALSE) | |
108 | ,fIsFromB(kFALSE) | |
109 | ,fIsFromPi0(kFALSE) | |
110 | ,fIsFromEta(kFALSE) | |
111 | ,fIsFromGamma(kFALSE) | |
112 | ,fESD(0) | |
113 | ,fAOD(0) | |
114 | ,fVevent(0) | |
115 | ,fPartnerCuts(new AliESDtrackCuts()) | |
116 | ,fOutputList(0) | |
117 | ,fPidResponse(0) | |
118 | ,fNonHFE(new AliSelectNonHFE()) | |
119 | ,fIsAOD(kFALSE) | |
120 | ,fCentrality(0) | |
121 | ,fCentralityMin(0) | |
122 | ,fCentralityMax(100) | |
123 | ,fHasCentralitySelection(kFALSE) | |
124 | ,fCentralityHist(0) | |
125 | ,fCentralityHistPass(0) | |
126 | ,fZvtx(0) | |
127 | ,fEstimator(0) | |
128 | ,fClus(0) | |
129 | ,fNevent(0) | |
130 | ,fPtElec_Inc(0) | |
131 | ,fPtElec_ULS(0) | |
132 | ,fPtElec_LS(0) | |
133 | ,fpid(0) | |
134 | ,fEoverP_pt(0) | |
135 | ,fEoverP_tpc(0) | |
136 | ,fTPC_pt(0) | |
137 | ,fTPC_p(0) | |
138 | ,fTPCnsigma_pt(0) | |
139 | ,fTPCnsigma_p(0) | |
140 | ,fTPCnsigma_pt_2D(0) | |
141 | ,fTPCnsigma_eta(0) | |
142 | ,fTPCnsigma_phi(0) | |
143 | ,fECluster(0) | |
144 | ,fEtaPhi(0) | |
145 | ,fVtxZ(0) | |
146 | ,fNTracks(0) | |
147 | ,fNClusters(0) | |
148 | ,fTPCNcls_EoverP(0) | |
149 | ,fEta(0) | |
150 | ,fPhi(0) | |
151 | ,fR(0) | |
152 | ,fR_EoverP(0) | |
153 | ,fNcells(0) | |
154 | ,fNcells_EoverP(0) | |
155 | ,fNcells_electrons(0) | |
156 | ,fNcells_hadrons(0) | |
157 | ,fECluster_ptbins(0) | |
158 | ,fEoverP_ptbins(0) | |
159 | ,fEoverP_wSSCut(0) | |
160 | ,fM02_EoverP(0) | |
161 | ,fM20_EoverP(0) | |
162 | ,fTPCnsigma_eta_electrons(0) | |
163 | ,fTPCnsigma_eta_hadrons(0) | |
164 | ,fEoverP_pt_pions(0) | |
165 | ,ftpc_p_EoverPcut(0) | |
166 | ,fnsigma_p_EoverPcut(0) | |
167 | ,fEoverP_pt_pions2(0) | |
168 | ,fNcells_pt(0) | |
169 | ,fEoverP_pt_hadrons(0) | |
170 | ,fCEtaPhi_Inc(0) | |
171 | ,fCEtaPhi_ULS(0) | |
172 | ,fCEtaPhi_LS(0) | |
173 | ,fCEtaPhi_ULS_NoP(0) | |
174 | ,fCEtaPhi_LS_NoP(0) | |
175 | ,fCEtaPhi_ULS_Weight(0) | |
176 | ,fCEtaPhi_LS_Weight(0) | |
177 | ,fCEtaPhi_ULS_NoP_Weight(0) | |
178 | ,fCEtaPhi_LS_NoP_Weight(0) | |
179 | ,fInvMass(0) | |
180 | ,fInvMassBack(0) | |
181 | ,fDCA(0) | |
182 | ,fDCABack(0) | |
183 | ,fOpAngle(0) | |
184 | ,fOpAngleBack(0) | |
185 | ,fMassCut(0.1) | |
186 | ,fEtaCutMin(-0.9) | |
187 | ,fEtaCutMax(0.9) | |
188 | ,fEoverPCutMin(0.8) | |
189 | ,fEoverPCutMax(1.2) | |
190 | ,fAngleCut(999) | |
191 | ,fChi2Cut(3.5) | |
192 | ,fDCAcut(999) | |
193 | ,fMassCutFlag(kTRUE) | |
194 | ,fAngleCutFlag(kFALSE) | |
195 | ,fChi2CutFlag(kFALSE) | |
196 | ,fDCAcutFlag(kFALSE) | |
197 | ,fPtBackgroundBeforeReco(0) | |
198 | ,fPtBackgroundAfterReco(0) | |
199 | ,fPtMCparticleAll(0) | |
200 | ,fPtMCparticleReco(0) | |
201 | ,fPtMCparticleAllHfe1(0) | |
202 | ,fPtMCparticleRecoHfe1(0) | |
203 | ,fPtMCparticleAllHfe2(0) | |
204 | ,fPtMCparticleRecoHfe2(0) | |
205 | ,fPtMCelectronAfterAll(0) | |
206 | ,fPtMCpi0(0) | |
207 | ,fPtMC_EMCal_All(0) | |
208 | ,fPtMC_EMCal_Selected(0) | |
209 | ,fPtMC_TPC_All(0) | |
210 | ,fPtMC_TPC_Selected(0) | |
211 | ,fPtMCWithLabel(0) | |
212 | ,fPtMCWithoutLabel(0) | |
213 | ,fPtIsPhysicaPrimary(0) | |
214 | ,fCuts(0) | |
215 | ,fCFM(0) | |
216 | ,fPID(new AliHFEpid("hfePid")) | |
217 | ,fPIDqa(0) | |
218 | ,fMCstack(0) | |
219 | ,fRejectKinkMother(kFALSE) | |
220 | ,fMCtrack(0) | |
221 | ,fMCtrackMother(0) | |
222 | ,fMCtrackGMother(0) | |
223 | ,fMCtrackGGMother(0) | |
224 | ,fMCtrackGGGMother(0) | |
225 | ,fMCarray(0) | |
226 | ,fMCheader(0) | |
227 | ,fMCparticle(0) | |
228 | ,fMCparticleMother(0) | |
229 | ,fMCparticleGMother(0) | |
230 | ,fMCparticleGGMother(0) | |
231 | ,fMCparticleGGGMother(0) | |
232 | ,fEventHandler(0) | |
233 | ,fMCevent(0) | |
234 | ,fPoolMgr(0) | |
235 | ,fPool(0) | |
236 | ,fTracksClone(0) | |
237 | ,fTracks(0) | |
238 | ,fCEtaPhi_Inc_EM(0) | |
239 | ,fCEtaPhi_ULS_EM(0) | |
240 | ,fCEtaPhi_LS_EM(0) | |
241 | ,fCEtaPhi_ULS_Weight_EM(0) | |
242 | ,fCEtaPhi_LS_Weight_EM(0) | |
243 | ,fPoolNevents(0) | |
244 | ,fEventMixingFlag(0) | |
245 | ,fCEtaPhi_Inc_DiHadron(0) | |
246 | ,fPtTrigger_Inc(0) | |
247 | { | |
248 | //Named constructor | |
249 | // Define input and output slots here | |
250 | // Input slot #0 works with a TChain | |
251 | DefineInput(0, TChain::Class()); | |
252 | // Output slot #0 id reserved by the base class for AOD | |
253 | // Output slot #1 writes into a TH1 container | |
254 | // DefineOutput(1, TH1I::Class()); | |
255 | DefineOutput(1, TList::Class()); | |
256 | // DefineOutput(3, TTree::Class()); | |
257 | } | |
258 | ||
259 | //________________________________________________________________________ | |
260 | AliAnalysisTaskEMCalHFEpA::AliAnalysisTaskEMCalHFEpA() | |
261 | : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisTaskEMCalHFEpA") | |
262 | ,fCorrelationFlag(0) | |
263 | ,fIsMC(0) | |
264 | ,fUseEMCal(kFALSE) | |
265 | ,fEMCEG1(kFALSE) | |
266 | ,fEMCEG2(kFALSE) | |
267 | ,fIsHFE1(kFALSE) | |
268 | ,fIsHFE2(kFALSE) | |
269 | ,fIsNonHFE(kFALSE) | |
270 | ,fIsFromD(kFALSE) | |
271 | ,fIsFromB(kFALSE) | |
272 | ,fIsFromPi0(kFALSE) | |
273 | ,fIsFromEta(kFALSE) | |
274 | ,fIsFromGamma(kFALSE) | |
275 | ,fESD(0) | |
276 | ,fAOD(0) | |
277 | ,fVevent(0) | |
278 | ,fPartnerCuts(new AliESDtrackCuts()) | |
279 | ,fOutputList(0) | |
280 | ,fPidResponse(0) | |
281 | ,fNonHFE(new AliSelectNonHFE()) | |
282 | ,fIsAOD(kFALSE) | |
283 | ,fCentrality(0) | |
284 | ,fCentralityMin(0) | |
285 | ,fCentralityMax(100) | |
286 | ,fHasCentralitySelection(kFALSE) | |
287 | ,fCentralityHist(0) | |
288 | ,fCentralityHistPass(0) | |
289 | ,fZvtx(0) | |
290 | ,fEstimator(0) | |
291 | ,fClus(0) | |
292 | ,fNevent(0) | |
293 | ,fPtElec_Inc(0) | |
294 | ,fPtElec_ULS(0) | |
295 | ,fPtElec_LS(0) | |
296 | ,fpid(0) | |
297 | ,fEoverP_pt(0) | |
298 | ,fEoverP_tpc(0) | |
299 | ,fTPC_pt(0) | |
300 | ,fTPC_p(0) | |
301 | ,fTPCnsigma_pt(0) | |
302 | ,fTPCnsigma_p(0) | |
303 | ,fTPCnsigma_pt_2D(0) | |
304 | ,fTPCnsigma_eta(0) | |
305 | ,fTPCnsigma_phi(0) | |
306 | ,fECluster(0) | |
307 | ,fEtaPhi(0) | |
308 | ,fVtxZ(0) | |
309 | ,fNTracks(0) | |
310 | ,fNClusters(0) | |
311 | ,fTPCNcls_EoverP(0) | |
312 | ,fEta(0) | |
313 | ,fPhi(0) | |
314 | ,fR(0) | |
315 | ,fR_EoverP(0) | |
316 | ,fNcells(0) | |
317 | ,fNcells_EoverP(0) | |
318 | ,fNcells_electrons(0) | |
319 | ,fNcells_hadrons(0) | |
320 | ,fECluster_ptbins(0) | |
321 | ,fEoverP_ptbins(0) | |
322 | ,fEoverP_wSSCut(0) | |
323 | ,fM02_EoverP(0) | |
324 | ,fM20_EoverP(0) | |
325 | ,fTPCnsigma_eta_electrons(0) | |
326 | ,fTPCnsigma_eta_hadrons(0) | |
327 | ,fEoverP_pt_pions(0) | |
328 | ,ftpc_p_EoverPcut(0) | |
329 | ,fnsigma_p_EoverPcut(0) | |
330 | ,fEoverP_pt_pions2(0) | |
331 | ,fNcells_pt(0) | |
332 | ,fEoverP_pt_hadrons(0) | |
333 | ,fCEtaPhi_Inc(0) | |
334 | ,fCEtaPhi_ULS(0) | |
335 | ,fCEtaPhi_LS(0) | |
336 | ,fCEtaPhi_ULS_NoP(0) | |
337 | ,fCEtaPhi_LS_NoP(0) | |
338 | ,fCEtaPhi_ULS_Weight(0) | |
339 | ,fCEtaPhi_LS_Weight(0) | |
340 | ,fCEtaPhi_ULS_NoP_Weight(0) | |
341 | ,fCEtaPhi_LS_NoP_Weight(0) | |
342 | ,fInvMass(0) | |
343 | ,fInvMassBack(0) | |
344 | ,fDCA(0) | |
345 | ,fDCABack(0) | |
346 | ,fOpAngle(0) | |
347 | ,fOpAngleBack(0) | |
348 | ,fMassCut(0.1) | |
349 | ,fEtaCutMin(-0.9) | |
350 | ,fEtaCutMax(0.9) | |
351 | ,fEoverPCutMin(0.8) | |
352 | ,fEoverPCutMax(1.2) | |
353 | ,fAngleCut(999) | |
354 | ,fChi2Cut(3.5) | |
355 | ,fDCAcut(999) | |
356 | ,fMassCutFlag(kTRUE) | |
357 | ,fAngleCutFlag(kFALSE) | |
358 | ,fChi2CutFlag(kFALSE) | |
359 | ,fDCAcutFlag(kFALSE) | |
360 | ,fPtBackgroundBeforeReco(0) | |
361 | ,fPtBackgroundAfterReco(0) | |
362 | ,fPtMCparticleAll(0) | |
363 | ,fPtMCparticleReco(0) | |
364 | ,fPtMCparticleAllHfe1(0) | |
365 | ,fPtMCparticleRecoHfe1(0) | |
366 | ,fPtMCparticleAllHfe2(0) | |
367 | ,fPtMCparticleRecoHfe2(0) | |
368 | ,fPtMCelectronAfterAll(0) | |
369 | ,fPtMCpi0(0) | |
370 | ,fPtMC_EMCal_All(0) | |
371 | ,fPtMC_EMCal_Selected(0) | |
372 | ,fPtMC_TPC_All(0) | |
373 | ,fPtMC_TPC_Selected(0) | |
374 | ,fPtMCWithLabel(0) | |
375 | ,fPtMCWithoutLabel(0) | |
376 | ,fPtIsPhysicaPrimary(0) | |
377 | ,fCuts(0) | |
378 | ,fCFM(0) | |
379 | ,fPID(new AliHFEpid("hfePid")) | |
380 | ,fPIDqa(0) | |
381 | ,fMCstack(0) | |
382 | ,fRejectKinkMother(kFALSE) | |
383 | ,fMCtrack(0) | |
384 | ,fMCtrackMother(0) | |
385 | ,fMCtrackGMother(0) | |
386 | ,fMCtrackGGMother(0) | |
387 | ,fMCtrackGGGMother(0) | |
388 | ,fMCarray(0) | |
389 | ,fMCheader(0) | |
390 | ,fMCparticle(0) | |
391 | ,fMCparticleMother(0) | |
392 | ,fMCparticleGMother(0) | |
393 | ,fMCparticleGGMother(0) | |
394 | ,fMCparticleGGGMother(0) | |
395 | ,fEventHandler(0) | |
396 | ,fMCevent(0) | |
397 | ,fPoolMgr(0) | |
398 | ,fPool(0) | |
399 | ,fTracksClone(0) | |
400 | ,fTracks(0) | |
401 | ,fCEtaPhi_Inc_EM(0) | |
402 | ,fCEtaPhi_ULS_EM(0) | |
403 | ,fCEtaPhi_LS_EM(0) | |
404 | ,fCEtaPhi_ULS_Weight_EM(0) | |
405 | ,fCEtaPhi_LS_Weight_EM(0) | |
406 | ,fPoolNevents(0) | |
407 | ,fEventMixingFlag(0) | |
408 | ,fCEtaPhi_Inc_DiHadron(0) | |
409 | ,fPtTrigger_Inc(0) | |
410 | { | |
411 | // Constructor | |
412 | // Define input and output slots here | |
413 | // Input slot #0 works with a TChain | |
414 | DefineInput(0, TChain::Class()); | |
415 | // Output slot #0 id reserved by the base class for AOD | |
416 | // Output slot #1 writes into a TH1 container | |
417 | // DefineOutput(1, TH1I::Class()); | |
418 | DefineOutput(1, TList::Class()); | |
419 | //DefineOutput(3, TTree::Class()); | |
420 | } | |
421 | ||
422 | //______________________________________________________________________ | |
423 | AliAnalysisTaskEMCalHFEpA::~AliAnalysisTaskEMCalHFEpA() | |
424 | { | |
425 | //Destructor | |
426 | delete fOutputList; | |
427 | delete fPID; | |
428 | delete fCFM; | |
429 | delete fPIDqa; | |
430 | } | |
431 | ||
432 | //______________________________________________________________________ | |
433 | //Create Output Objects | |
434 | //Here we can define the histograms and others output files | |
435 | //Called once | |
436 | void AliAnalysisTaskEMCalHFEpA::UserCreateOutputObjects() | |
437 | { | |
438 | //______________________________________________________________________ | |
439 | //Initialize PID | |
440 | if(!fPID->GetNumberOfPIDdetectors()) | |
441 | { | |
442 | fPID->AddDetector("TPC", 0); | |
443 | } | |
444 | ||
445 | fPID->SortDetectors(); | |
446 | ||
447 | fPIDqa = new AliHFEpidQAmanager(); | |
448 | fPIDqa->Initialize(fPID); | |
449 | //______________________________________________________________________ | |
450 | ||
451 | //______________________________________________________________________ | |
452 | //Initialize correction Framework and Cuts | |
453 | fCFM = new AliCFManager; | |
454 | const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack; | |
455 | fCFM->SetNStepParticle(kNcutSteps); | |
456 | for(Int_t istep = 0; istep < kNcutSteps; istep++) fCFM->SetParticleCutsList(istep, NULL); | |
457 | ||
458 | if(!fCuts) | |
459 | { | |
460 | AliWarning("Cuts not available. Default cuts will be used"); | |
461 | fCuts = new AliHFEcuts; | |
462 | fCuts->CreateStandardCuts(); | |
463 | } | |
464 | ||
465 | fCuts->Initialize(fCFM); | |
466 | //______________________________________________________________________ | |
467 | ||
468 | ///______________________________________________________________________ | |
469 | ///Output Tlist | |
470 | //Create TList | |
471 | fOutputList = new TList(); | |
472 | fOutputList->SetOwner(); | |
473 | ||
474 | //PIDqa | |
475 | fOutputList->Add(fPIDqa->MakeList("PIDQA")); | |
476 | ||
477 | //Store the number of events | |
478 | //Define the histo | |
479 | fNevent = new TH1F("fNevent","Number of Events",5,-0.5,4.5); | |
480 | //And then, add to the output list | |
481 | fOutputList->Add(fNevent); | |
482 | ||
483 | fpid = new TH1F("fpid","PID flag",5,0,5); | |
484 | fOutputList->Add(fpid); | |
485 | ||
486 | //pt Distribution | |
487 | fPtElec_Inc = new TH1F("fPtElec_Inc","Inclusive Electrons; p_{t} (GeV/c); Count",200,0,20); | |
488 | fPtElec_ULS = new TH1F("fPtElec_ULS","Inclusive Electrons; p_{t} (GeV/c); Count",200,0,20); | |
489 | fPtElec_LS = new TH1F("fPtElec_LS","Inclusive Electrons; p_{t} (GeV/c); Count",200,0,20); | |
490 | fPtTrigger_Inc = new TH1F("fPtTrigger_Inc","pT dist for Hadron Contamination; p_{t} (GeV/c); Count",200,0,20); | |
491 | fTPCnsigma_pt_2D = new TH2F("fTPCnsigma_pt_2D",";pt (GeV/c);TPC Electron N#sigma",1000,0.3,30,1000,-15,10); | |
492 | ||
493 | ||
494 | fOutputList->Add(fPtElec_Inc); | |
495 | fOutputList->Add(fPtElec_ULS); | |
496 | fOutputList->Add(fPtElec_LS); | |
497 | fOutputList->Add(fPtTrigger_Inc); | |
498 | fOutputList->Add(fTPCnsigma_pt_2D); | |
499 | ||
500 | //General Histograms | |
501 | ||
502 | //Steps | |
503 | //Step 1: Before Track cuts | |
504 | //Step 2: Before PID | |
505 | //Step 3: After PID | |
506 | ||
507 | fEoverP_pt = new TH2F *[3]; | |
508 | fTPC_p = new TH2F *[3]; | |
509 | fTPCnsigma_p = new TH2F *[3]; | |
510 | ||
511 | fECluster= new TH1F *[3]; | |
512 | fEtaPhi= new TH2F *[3]; | |
513 | fVtxZ= new TH1F *[3]; | |
514 | fNTracks= new TH1F *[3]; | |
515 | fNClusters= new TH1F *[3]; | |
516 | fTPCNcls_EoverP= new TH2F *[3]; | |
517 | ||
518 | for(Int_t i = 0; i < 3; i++) | |
519 | { | |
520 | fEoverP_pt[i] = new TH2F(Form("fEoverP_pt%d",i),";p_{t} (GeV/c);E / p ",1000,0,30,500,0,2); | |
521 | 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); | |
522 | fTPCnsigma_p[i] = new TH2F(Form("fTPCnsigma_p%d",i),";p (GeV/c);TPC Electron N#sigma",1000,0.3,15,1000,-15,10); | |
523 | ||
524 | ||
525 | fECluster[i]= new TH1F(Form("fECluster%d",i), ";ECluster",2000, 0,100); | |
526 | fEtaPhi[i]= new TH2F(Form("fEtaPhi%d",i),"#eta x #phi Clusters;#phi;#eta",200,0.,TMath::Pi(),50,-1.,1.); | |
527 | fVtxZ[i]= new TH1F(Form("fVtxZ%d",i),"VtxZ",1000, -50,50); | |
528 | fNTracks[i]= new TH1F(Form("fNTracks%d",i),"NTracks",1000, 0,1000); | |
529 | fNClusters[i]= new TH1F(Form("fNClusters%d",i),"fNClusters0",200, 0,100); | |
530 | fTPCNcls_EoverP[i]= new TH2F(Form("fTPCNcls_EoverP%d",i),"TPCNcls_EoverP",1000,0,200,200,0,2); | |
531 | ||
532 | ||
533 | fOutputList->Add(fEoverP_pt[i]); | |
534 | fOutputList->Add(fTPC_p[i]); | |
535 | fOutputList->Add(fTPCnsigma_p[i]); | |
536 | ||
537 | ||
538 | fOutputList->Add(fECluster[i]); | |
539 | fOutputList->Add(fEtaPhi[i]); | |
540 | fOutputList->Add(fVtxZ[i]); | |
541 | fOutputList->Add(fNTracks[i]); | |
542 | fOutputList->Add(fNClusters[i]); | |
543 | fOutputList->Add(fTPCNcls_EoverP[i]); | |
544 | } | |
545 | ||
546 | //pt bin | |
547 | Int_t fPtBin[6] = {2,4,6,8,10,15}; | |
548 | ||
549 | fEoverP_tpc = new TH2F *[5]; | |
550 | fTPC_pt = new TH1F *[5]; | |
551 | fTPCnsigma_pt = new TH1F *[5]; | |
552 | ||
553 | fEta=new TH1F *[5]; | |
554 | fPhi=new TH1F *[5]; | |
555 | fR=new TH1F *[5]; | |
556 | fR_EoverP=new TH2F *[5]; | |
557 | fNcells=new TH1F *[5]; | |
558 | fNcells_EoverP=new TH2F *[5]; | |
559 | fM02_EoverP= new TH2F *[5]; | |
560 | fM20_EoverP= new TH2F *[5]; | |
561 | fEoverP_ptbins=new TH1F *[5]; | |
562 | fECluster_ptbins=new TH1F *[5]; | |
563 | fEoverP_wSSCut=new TH1F *[5]; | |
564 | fNcells_electrons=new TH1F *[5]; | |
565 | fNcells_hadrons=new TH1F *[5]; | |
566 | fTPCnsigma_eta_electrons=new TH2F *[5]; | |
567 | fTPCnsigma_eta_hadrons=new TH2F *[5]; | |
568 | ||
569 | if(fCorrelationFlag) | |
570 | { | |
571 | fCEtaPhi_Inc = new TH2F *[5]; | |
572 | fCEtaPhi_Inc_DiHadron = new TH2F *[5]; | |
573 | ||
574 | fCEtaPhi_ULS = new TH2F *[5]; | |
575 | fCEtaPhi_LS = new TH2F *[5]; | |
576 | fCEtaPhi_ULS_NoP = new TH2F *[5]; | |
577 | fCEtaPhi_LS_NoP = new TH2F *[5]; | |
578 | ||
579 | fCEtaPhi_ULS_Weight = new TH2F *[5]; | |
580 | fCEtaPhi_LS_Weight = new TH2F *[5]; | |
581 | fCEtaPhi_ULS_NoP_Weight = new TH2F *[5]; | |
582 | fCEtaPhi_LS_NoP_Weight = new TH2F *[5]; | |
583 | ||
584 | fCEtaPhi_Inc_EM = new TH2F *[5]; | |
585 | ||
586 | fCEtaPhi_ULS_EM = new TH2F *[5]; | |
587 | fCEtaPhi_LS_EM = new TH2F *[5]; | |
588 | ||
589 | fCEtaPhi_ULS_Weight_EM = new TH2F *[5]; | |
590 | fCEtaPhi_LS_Weight_EM = new TH2F *[5]; | |
591 | ||
592 | fInvMass = new TH1F("fInvMass","",200,0,0.3); | |
593 | fInvMassBack = new TH1F("fInvMassBack","",200,0,0.3); | |
594 | fDCA = new TH1F("fDCA","",200,0,1); | |
595 | fDCABack = new TH1F("fDCABack","",200,0,1); | |
596 | fOpAngle = new TH1F("fOpAngle","",200,0,0.5); | |
597 | fOpAngleBack = new TH1F("fOpAngleBack","",200,0,0.5); | |
598 | ||
599 | fOutputList->Add(fInvMass); | |
600 | fOutputList->Add(fInvMassBack); | |
601 | fOutputList->Add(fDCA); | |
602 | fOutputList->Add(fDCABack); | |
603 | fOutputList->Add(fOpAngle); | |
604 | fOutputList->Add(fOpAngleBack); | |
605 | } | |
606 | ||
607 | for(Int_t i = 0; i < 5; i++) | |
608 | { | |
609 | 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); | |
610 | 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); | |
611 | 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); | |
612 | ||
613 | fEta[i]=new TH1F(Form("fEta%d",i), Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma; dEta )",fPtBin[i],fPtBin[i+1]),100, -0.1,0.1); | |
614 | fPhi[i]=new TH1F(Form("fPhi%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma; dPhi )",fPtBin[i],fPtBin[i+1]), 100, -0.1,0.1); | |
615 | fR[i]=new TH1F(Form("fR%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma; dR )",fPtBin[i],fPtBin[i+1]), 100, -0.1,0.1); | |
616 | fR_EoverP[i]=new TH2F(Form("fR_EoverP%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;E / p )",fPtBin[i],fPtBin[i+1]),100, 0,0.1,1000,0,10); | |
617 | fNcells[i]=new TH1F(Form("fNcells%d",i), Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;E / p )",fPtBin[i],fPtBin[i+1]),100, 0, 30); | |
618 | fNcells_electrons[i]=new TH1F(Form("fNcells_electrons%d",i), Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma )",fPtBin[i],fPtBin[i+1]),100, 0, 30); | |
619 | fNcells_hadrons[i]=new TH1F(Form("fNcells_hadrons%d",i), Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma; Ncells; E / p )",fPtBin[i],fPtBin[i+1]),100, 0, 30); | |
620 | fNcells_EoverP[i]=new TH2F(Form("fNcells_EoverP%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma; Ncells; E / p )",fPtBin[i],fPtBin[i+1]),1000, 0,20,100,0,30); | |
621 | fM02_EoverP[i]= new TH2F(Form("fM02_EoverP%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma; M02; E / p )",fPtBin[i],fPtBin[i+1]),1000,0,1,100,0,2); | |
622 | fM20_EoverP[i]= new TH2F(Form("fM20_EoverP%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma; M20; E / p )",fPtBin[i],fPtBin[i+1]),1000,0,1,100,0,2); | |
623 | fEoverP_ptbins[i] = new TH1F(Form("fEoverP_ptbins%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;E / p )",fPtBin[i],fPtBin[i+1]),500,0,2); | |
624 | fECluster_ptbins[i]= new TH1F(Form("fECluster_ptbins%d",i), Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;E / p )",fPtBin[i],fPtBin[i+1]),2000, 0,100); | |
625 | fEoverP_wSSCut[i]=new TH1F(Form("fEoverP_wSSCut%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;E / p )",fPtBin[i],fPtBin[i+1]),500,0,2); | |
626 | 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); | |
627 | 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); | |
628 | ||
629 | fOutputList->Add(fEoverP_tpc[i]); | |
630 | fOutputList->Add(fTPC_pt[i]); | |
631 | fOutputList->Add(fTPCnsigma_pt[i]); | |
632 | ||
633 | fOutputList->Add(fEta[i]); | |
634 | fOutputList->Add(fPhi[i]); | |
635 | fOutputList->Add(fR[i]); | |
636 | fOutputList->Add(fR_EoverP[i]); | |
637 | fOutputList->Add(fNcells[i]); | |
638 | fOutputList->Add(fNcells_electrons[i]); | |
639 | fOutputList->Add(fNcells_hadrons[i]); | |
640 | fOutputList->Add(fNcells_EoverP[i]); | |
641 | fOutputList->Add(fECluster_ptbins[i]); | |
642 | fOutputList->Add(fEoverP_ptbins[i]); | |
643 | fOutputList->Add(fEoverP_wSSCut[i]); | |
644 | fOutputList->Add(fM02_EoverP[i]); | |
645 | fOutputList->Add(fM20_EoverP[i]); | |
646 | fOutputList->Add(fTPCnsigma_eta_electrons[i]); | |
647 | fOutputList->Add(fTPCnsigma_eta_hadrons[i]); | |
648 | ||
649 | ||
650 | if(fCorrelationFlag) | |
651 | { | |
652 | 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); | |
653 | 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); | |
654 | ||
655 | 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); | |
656 | 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); | |
657 | 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); | |
658 | 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); | |
659 | ||
660 | 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); | |
661 | 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); | |
662 | 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); | |
663 | 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); | |
664 | ||
665 | fOutputList->Add(fCEtaPhi_Inc[i]); | |
666 | fOutputList->Add(fCEtaPhi_Inc_DiHadron[i]); | |
667 | ||
668 | fOutputList->Add(fCEtaPhi_ULS[i]); | |
669 | fOutputList->Add(fCEtaPhi_LS[i]); | |
670 | fOutputList->Add(fCEtaPhi_ULS_NoP[i]); | |
671 | fOutputList->Add(fCEtaPhi_LS_NoP[i]); | |
672 | ||
673 | fOutputList->Add(fCEtaPhi_ULS_Weight[i]); | |
674 | fOutputList->Add(fCEtaPhi_LS_Weight[i]); | |
675 | fOutputList->Add(fCEtaPhi_ULS_NoP_Weight[i]); | |
676 | fOutputList->Add(fCEtaPhi_LS_NoP_Weight[i]); | |
677 | ||
678 | if(fEventMixingFlag) | |
679 | { | |
680 | 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); | |
681 | ||
682 | 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); | |
683 | 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); | |
684 | ||
685 | 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); | |
686 | 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); | |
687 | ||
688 | fOutputList->Add(fCEtaPhi_Inc_EM[i]); | |
689 | ||
690 | fOutputList->Add(fCEtaPhi_ULS_EM[i]); | |
691 | fOutputList->Add(fCEtaPhi_LS_EM[i]); | |
692 | ||
693 | fOutputList->Add(fCEtaPhi_ULS_Weight_EM[i]); | |
694 | fOutputList->Add(fCEtaPhi_LS_Weight_EM[i]); | |
695 | } | |
696 | } | |
697 | } | |
698 | ||
699 | //pt integrated | |
700 | fTPCnsigma_eta = new TH2F("fTPCnsigma_eta",";Pseudorapidity #eta; TPC signal - <TPC signal>_{elec} (#sigma)",200,-0.9,0.9,200,-15,15); | |
701 | fTPCnsigma_phi = new TH2F("fTPCnsigma_phi",";Azimuthal Angle #phi; TPC signal - <TPC signal>_{elec} (#sigma)",200,0,2*TMath::Pi(),200,-15,15); | |
702 | ||
703 | ||
704 | fNcells_pt=new TH2F("fNcells_pt","fNcells_pt",1000, 0,20,100,0,30); | |
705 | fEoverP_pt_pions= new TH2F("fEoverP_pt_pions","fEoverP_pt_pions",1000,0,30,500,0,2); | |
706 | ||
707 | ftpc_p_EoverPcut= new TH2F("ftpc_p_EoverPcut","ftpc_p_EoverPcut",1000,0,30,200,20,200); | |
708 | fnsigma_p_EoverPcut= new TH2F("fnsigma_p_EoverPcut","fnsigma_p_EoverPcut",1000,0,30,500,-15,15); | |
709 | ||
710 | fEoverP_pt_pions2= new TH2F("fEoverP_pt_pions2","fEoverP_pt_pions2",1000,0,30,500,0,2); | |
711 | fEoverP_pt_hadrons= new TH2F("fEoverP_pt_hadrons","fEoverP_pt_hadrons",1000,0,30,500,0,2); | |
712 | ||
713 | ||
714 | fOutputList->Add(fTPCnsigma_eta); | |
715 | fOutputList->Add(fTPCnsigma_phi); | |
716 | ||
717 | fOutputList->Add(fNcells_pt); | |
718 | fOutputList->Add(fEoverP_pt_pions); | |
719 | ||
720 | fOutputList->Add(ftpc_p_EoverPcut); | |
721 | fOutputList->Add(fnsigma_p_EoverPcut); | |
722 | ||
723 | fOutputList->Add(fEoverP_pt_pions2); | |
724 | fOutputList->Add(fEoverP_pt_hadrons); | |
725 | ||
726 | //__________________________________________________________________ | |
727 | //Efficiency studies | |
728 | if(fIsMC) | |
729 | { | |
730 | fPtBackgroundBeforeReco = new TH1F("fPtBackgroundBeforeReco",";p_{t} (GeV/c);Count",30,0,15); | |
731 | fPtBackgroundAfterReco = new TH1F("fPtBackgroundAfterReco",";p_{t} (GeV/c);Count",30,0,15); | |
732 | fPtMCparticleAll = new TH1F("fPtMCparticleAll",";p_{t} (GeV/c);Count",200,0,40); | |
733 | fPtMCparticleReco = new TH1F("fPtMCparticleReco",";p_{t} (GeV/c);Count",200,0,40); | |
734 | fPtMCparticleAllHfe1 = new TH1F("fPtMCparticleAllHfe1",";p_{t} (GeV/c);Count",200,0,40); | |
735 | fPtMCparticleRecoHfe1 = new TH1F("fPtMCparticleRecoHfe1",";p_{t} (GeV/c);Count",200,0,40); | |
736 | fPtMCparticleAllHfe2 = new TH1F("fPtMCparticleAllHfe2",";p_{t} (GeV/c);Count",200,0,40); | |
737 | fPtMCparticleRecoHfe2 = new TH1F("fPtMCparticleRecoHfe2",";p_{t} (GeV/c);Count",200,0,40); | |
738 | fPtMCelectronAfterAll = new TH1F("fPtMCelectronAfterAll",";p_{t} (GeV/c);Count",200,0,40); | |
739 | fPtMCpi0 = new TH1F("fPtMCpi0",";p_{t} (GeV/c);Count",200,0,40); | |
740 | fPtMC_EMCal_All= new TH1F("fPtMC_EMCal_All",";p_{t} (GeV/c);Count",200,0,40); | |
741 | fPtMC_EMCal_Selected= new TH1F("fPtMC_EMCal_Selected",";p_{t} (GeV/c);Count",200,0,40); | |
742 | fPtMC_TPC_All= new TH1F("fPtMC_TPC_All",";p_{t} (GeV/c);Count",200,0,40); | |
743 | fPtMC_TPC_Selected = new TH1F("fPtMC_TPC_Selected",";p_{t} (GeV/c);Count",200,0,40); | |
744 | fPtMCWithLabel = new TH1F("fPtMCWithLabel",";p_{t} (GeV/c);Count",200,0,40); | |
745 | fPtMCWithoutLabel = new TH1F("fPtMCWithoutLabel",";p_{t} (GeV/c);Count",200,0,40); | |
746 | fPtIsPhysicaPrimary = new TH1F("fPtIsPhysicaPrimary",";p_{t} (GeV/c);Count",200,0,40); | |
747 | ||
748 | fOutputList->Add(fPtBackgroundBeforeReco); | |
749 | fOutputList->Add(fPtBackgroundAfterReco); | |
750 | fOutputList->Add(fPtMCparticleAll); | |
751 | fOutputList->Add(fPtMCparticleReco); | |
752 | fOutputList->Add(fPtMCparticleAllHfe1); | |
753 | fOutputList->Add(fPtMCparticleRecoHfe1); | |
754 | fOutputList->Add(fPtMCparticleAllHfe2); | |
755 | fOutputList->Add(fPtMCparticleRecoHfe2); | |
756 | fOutputList->Add(fPtMCelectronAfterAll); | |
757 | fOutputList->Add(fPtMCpi0); | |
758 | fOutputList->Add(fPtMC_EMCal_All); | |
759 | fOutputList->Add(fPtMC_EMCal_Selected); | |
760 | fOutputList->Add(fPtMC_TPC_All); | |
761 | fOutputList->Add(fPtMC_TPC_Selected); | |
762 | fOutputList->Add(fPtMCWithLabel); | |
763 | fOutputList->Add(fPtMCWithoutLabel); | |
764 | fOutputList->Add(fPtIsPhysicaPrimary); | |
765 | } | |
766 | ||
767 | fCentralityHist = new TH1F("fCentralityHist",";Centrality (%); Count",1000000,0,100); | |
768 | fCentralityHistPass = new TH1F("fCentralityHistPass",";Centrality (%); Count",1000000,0,100); | |
769 | fOutputList->Add(fCentralityHist); | |
770 | fOutputList->Add(fCentralityHistPass); | |
771 | ||
772 | //______________________________________________________________________ | |
773 | //Mixed event analysis | |
774 | if(fEventMixingFlag) | |
775 | { | |
776 | fPoolNevents = new TH1F("fPoolNevents","Event Mixing Statistics; Number of events; Count",1000,0,1000); | |
777 | fOutputList->Add(fPoolNevents); | |
778 | ||
779 | 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. | |
780 | Int_t poolsize = 1000; // Maximum number of events, ignored in the present implemented of AliEventPoolManager | |
781 | ||
782 | Int_t nCentralityBins = 15; | |
783 | Double_t centralityBins[] = { 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1 }; | |
784 | ||
785 | Int_t nZvtxBins = 9; | |
786 | Double_t vertexBins[] = {-10, -7, -5, -3, -1, 1, 3, 5, 7, 10}; | |
787 | ||
788 | fPoolMgr = new AliEventPoolManager(poolsize, trackDepth, nCentralityBins, (Double_t*) centralityBins, nZvtxBins, (Double_t*) vertexBins); | |
789 | } | |
790 | //______________________________________________________________________ | |
791 | ||
792 | PostData(1, fOutputList); | |
793 | ||
794 | ///______________________________________________________________________ | |
795 | } | |
796 | ||
797 | //______________________________________________________________________ | |
798 | //Main loop | |
799 | //Called for each event | |
800 | void AliAnalysisTaskEMCalHFEpA::UserExec(Option_t *) | |
801 | { | |
802 | //Check Event | |
803 | fESD = dynamic_cast<AliESDEvent*>(InputEvent()); | |
804 | fAOD = dynamic_cast<AliAODEvent*>(InputEvent()); | |
805 | ||
806 | if(!(fESD || fAOD)) | |
807 | { | |
808 | printf("ERROR: fESD & fAOD not available\n"); | |
809 | return; | |
810 | } | |
811 | ||
812 | fVevent = dynamic_cast<AliVEvent*>(InputEvent()); | |
813 | ||
814 | if(!fVevent) | |
815 | { | |
816 | printf("ERROR: fVEvent not available\n"); | |
817 | return; | |
818 | } | |
819 | ||
820 | //Check Cuts | |
821 | if(!fCuts) | |
822 | { | |
823 | AliError("HFE cuts not available"); | |
824 | return; | |
825 | } | |
826 | //Check PID | |
827 | if(!fPID->IsInitialized()) | |
828 | { | |
829 | // Initialize PID with the given run number | |
830 | AliWarning("PID not initialised, get from Run no"); | |
831 | ||
832 | if(fIsAOD) | |
833 | { | |
834 | fPID->InitializePID(fAOD->GetRunNumber()); | |
835 | } | |
836 | else | |
837 | { | |
838 | fPID->InitializePID(fESD->GetRunNumber()); | |
839 | } | |
840 | } | |
841 | ||
842 | //PID response | |
843 | fPidResponse = fInputHandler->GetPIDResponse(); | |
844 | ||
845 | ||
846 | //Check PID response | |
847 | if(!fPidResponse) | |
848 | { | |
849 | AliDebug(1, "Using default PID Response"); | |
850 | fPidResponse = AliHFEtools::GetDefaultPID(kFALSE, fInputEvent->IsA() == AliAODEvent::Class()); | |
851 | } | |
852 | ||
853 | fPID->SetPIDResponse(fPidResponse); | |
854 | ||
855 | fCFM->SetRecEventInfo(fVevent); | |
856 | ||
857 | Double_t *fListOfmotherkink = 0; | |
858 | Int_t fNumberOfVertices = 0; | |
859 | Int_t fNumberOfMotherkink = 0; | |
860 | ||
861 | //______________________________________________________________________ | |
862 | //Vertex Selection | |
863 | if(fIsAOD) | |
864 | { | |
865 | const AliAODVertex* trkVtx = fAOD->GetPrimaryVertex(); | |
866 | if(!trkVtx || trkVtx->GetNContributors()<=0) return; | |
867 | TString vtxTtl = trkVtx->GetTitle(); | |
868 | if(!vtxTtl.Contains("VertexerTracks")) return; | |
869 | Float_t zvtx = trkVtx->GetZ(); | |
870 | fZvtx = zvtx; | |
871 | const AliAODVertex* spdVtx = fAOD->GetPrimaryVertexSPD(); | |
872 | if(spdVtx->GetNContributors()<=0) return; | |
873 | TString vtxTyp = spdVtx->GetTitle(); | |
874 | Double_t cov[6]={0}; | |
875 | spdVtx->GetCovarianceMatrix(cov); | |
876 | Double_t zRes = TMath::Sqrt(cov[5]); | |
877 | if(vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) return; | |
878 | if(TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return; | |
879 | if(TMath::Abs(zvtx) > 10) return; | |
880 | ||
881 | //Look for kink mother for AOD | |
882 | ||
883 | fNumberOfVertices = 0; | |
884 | fNumberOfMotherkink = 0; | |
885 | ||
886 | if(fIsAOD) | |
887 | { | |
888 | fNumberOfVertices = fAOD->GetNumberOfVertices(); | |
889 | ||
890 | fListOfmotherkink = new Double_t[fNumberOfVertices]; | |
891 | ||
892 | for(Int_t ivertex=0; ivertex < fNumberOfVertices; ivertex++) | |
893 | { | |
894 | AliAODVertex *aodvertex = fAOD->GetVertex(ivertex); | |
895 | if(!aodvertex) continue; | |
896 | if(aodvertex->GetType()==AliAODVertex::kKink) | |
897 | { | |
898 | AliAODTrack *mother1 = (AliAODTrack *) aodvertex->GetParent(); | |
899 | if(!mother1) continue; | |
900 | Int_t idmother = mother1->GetID(); | |
901 | fListOfmotherkink[fNumberOfMotherkink] = idmother; | |
902 | fNumberOfMotherkink++; | |
903 | } | |
904 | } | |
905 | } | |
906 | } | |
907 | else | |
908 | { | |
c852fdae | 909 | |
c852fdae | 910 | |
8079a103 | 911 | |
912 | /// ESD | |
913 | const AliESDVertex* trkVtx = fESD->GetPrimaryVertex(); | |
c852fdae | 914 | if(!trkVtx || trkVtx->GetNContributors()<=0) return; |
915 | TString vtxTtl = trkVtx->GetTitle(); | |
916 | if(!vtxTtl.Contains("VertexerTracks")) return; | |
917 | Float_t zvtx = trkVtx->GetZ(); | |
8079a103 | 918 | |
919 | const AliESDVertex* spdVtx = fESD->GetPrimaryVertexSPD(); | |
c852fdae | 920 | if(spdVtx->GetNContributors()<=0) return; |
921 | TString vtxTyp = spdVtx->GetTitle(); | |
922 | Double_t cov[6]={0}; | |
923 | spdVtx->GetCovarianceMatrix(cov); | |
924 | Double_t zRes = TMath::Sqrt(cov[5]); | |
925 | if(vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) return; | |
926 | if(TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return; | |
8079a103 | 927 | if(TMath::Abs(zvtx) > 10) return; |
c852fdae | 928 | } |
929 | ||
930 | //______________________________________________________________________ | |
931 | ||
932 | //Only events with at least 2 tracks are accepted | |
933 | Int_t fNOtrks = fVevent->GetNumberOfTracks(); | |
934 | if(fNOtrks<2) return; | |
935 | ||
936 | //______________________________________________________________________ | |
937 | //Centrality Selection | |
938 | if(fHasCentralitySelection) | |
939 | { | |
940 | Float_t centrality = -1; | |
941 | ||
942 | if(fIsAOD) | |
943 | { | |
944 | fCentrality = fAOD->GetHeader()->GetCentralityP(); | |
945 | } | |
946 | else | |
947 | { | |
948 | fCentrality = fESD->GetCentrality(); | |
949 | } | |
950 | ||
951 | if(fEstimator==1) centrality = fCentrality->GetCentralityPercentile("ZDC"); | |
952 | else centrality = fCentrality->GetCentralityPercentile("V0A"); | |
953 | ||
954 | //cout << "Centrality = " << centrality << " %" << endl; | |
955 | ||
956 | fCentralityHist->Fill(centrality); | |
957 | ||
958 | if(centrality<fCentralityMin || centrality>fCentralityMax) return; | |
959 | ||
960 | fCentralityHistPass->Fill(centrality); | |
961 | } | |
962 | //______________________________________________________________________ | |
963 | ||
964 | //______________________________________________________________________ | |
965 | ||
966 | if(fIsMC) | |
967 | { | |
968 | if(fIsAOD) | |
969 | { | |
970 | fMCarray = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName())); | |
971 | ||
972 | if(!fMCarray) | |
973 | { | |
974 | AliError("Array of MC particles not found"); | |
975 | return; | |
976 | } | |
977 | ||
978 | fMCheader = dynamic_cast<AliAODMCHeader*>(fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName())); | |
979 | ||
980 | if(!fMCheader) | |
981 | { | |
982 | AliError("Could not find MC Header in AOD"); | |
983 | return; | |
984 | } | |
985 | ||
986 | for(Int_t iMC = 0; iMC < fMCarray->GetEntries(); iMC++) | |
987 | { | |
988 | fMCparticle = (AliAODMCParticle*) fMCarray->At(iMC); | |
989 | ||
990 | Int_t pdg = fMCparticle->GetPdgCode(); | |
991 | if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax && fMCparticle->Charge()!=0) | |
992 | { | |
993 | if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 ) | |
994 | { | |
995 | if(fMCparticle->IsPhysicalPrimary()) | |
996 | { | |
997 | fPtMCparticleAll->Fill(fMCparticle->Pt()); | |
998 | ||
999 | Bool_t MotherFound = FindMother(iMC); | |
1000 | if(MotherFound) | |
1001 | { | |
1002 | if(fIsHFE1) fPtMCparticleAllHfe1->Fill(fMCparticle->Pt()); //denominator for total efficiency | |
1003 | if(fIsHFE2) fPtMCparticleAllHfe2->Fill(fMCparticle->Pt()); | |
1004 | } | |
1005 | } | |
1006 | } | |
1007 | } | |
1008 | if(TMath::Abs(pdg)==111) fPtMCpi0->Fill(fMCparticle->Pt()); | |
1009 | } | |
1010 | } | |
1011 | else | |
1012 | { | |
1013 | fEventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
1014 | if (!fEventHandler) { | |
1015 | Printf("ERROR: Could not retrieve MC event handler"); | |
1016 | return; | |
1017 | } | |
1018 | ||
1019 | fMCevent = fEventHandler->MCEvent(); | |
1020 | if (!fMCevent) { | |
1021 | Printf("ERROR: Could not retrieve MC event"); | |
1022 | return; | |
1023 | } | |
1024 | ||
1025 | fMCstack = fMCevent->Stack(); | |
1026 | ||
1027 | for(Int_t iMC = 0; iMC < fMCstack->GetNtrack(); iMC++) | |
1028 | { | |
1029 | ||
1030 | fMCtrack = fMCstack->Particle(iMC); | |
1031 | Int_t pdg = fMCtrack->GetPdgCode(); | |
1032 | if(TMath::Abs(pdg)==111) fPtMCpi0->Fill(fMCtrack->Pt()); | |
1033 | ||
1034 | if(!fMCstack->IsPhysicalPrimary(iMC)) continue; | |
1035 | ||
1036 | ||
1037 | if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax) | |
1038 | { | |
1039 | if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 ) | |
1040 | { | |
1041 | fPtMCparticleAll->Fill(fMCtrack->Pt()); | |
1042 | ||
1043 | Bool_t MotherFound = FindMother(iMC); | |
1044 | if(MotherFound) | |
1045 | { | |
1046 | if(fIsHFE1) fPtMCparticleAllHfe1->Fill(fMCtrack->Pt());//denominator for total efficiency | |
1047 | if(fIsHFE2) fPtMCparticleAllHfe2->Fill(fMCtrack->Pt()); | |
1048 | } | |
1049 | } | |
1050 | } | |
1051 | } | |
1052 | } | |
1053 | } | |
1054 | ||
1055 | //______________________________________________________________________ | |
1056 | //EMCal Trigger Selection (Threshould selection) | |
1057 | TString firedTrigger; | |
1058 | TString TriggerEG1("EG1"); | |
1059 | TString TriggerEG2("EG2"); | |
1060 | ||
1061 | if(fAOD) firedTrigger = fAOD->GetFiredTriggerClasses(); | |
1062 | else if(fESD) firedTrigger = fESD->GetFiredTriggerClasses(); | |
1063 | ||
1064 | fNevent->Fill(0); | |
1065 | if(firedTrigger.Contains(TriggerEG1)) fNevent->Fill(1); | |
1066 | if(firedTrigger.Contains(TriggerEG2)) fNevent->Fill(2); | |
1067 | ||
1068 | //EG1 | |
1069 | if(firedTrigger.Contains(TriggerEG1)) | |
1070 | { | |
1071 | fNevent->Fill(3); | |
1072 | } | |
1073 | else | |
1074 | { | |
1075 | if(fEMCEG1) return; | |
1076 | } | |
1077 | ||
1078 | //EG2 | |
1079 | if(firedTrigger.Contains(TriggerEG2)) | |
1080 | { | |
1081 | fNevent->Fill(4); | |
1082 | } | |
1083 | else | |
1084 | { | |
1085 | if(fEMCEG2) return; | |
1086 | } | |
1087 | ||
1088 | //______________________________________________________________________ | |
1089 | ||
1090 | Int_t ClsNo = -999; | |
1091 | if(!fIsAOD) ClsNo = fESD->GetNumberOfCaloClusters(); | |
1092 | else ClsNo = fAOD->GetNumberOfCaloClusters(); | |
1093 | ||
1094 | //______________________________________________________________________ | |
1095 | ||
1096 | ///______________________________________________________________________ | |
1097 | ///Track loop | |
1098 | for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++) | |
1099 | { | |
1100 | AliVParticle* Vtrack = fVevent->GetTrack(iTracks); | |
1101 | if (!Vtrack) | |
1102 | { | |
1103 | printf("ERROR: Could not receive track %d\n", iTracks); | |
1104 | continue; | |
1105 | } | |
1106 | ||
1107 | AliVTrack *track = dynamic_cast<AliVTrack*>(Vtrack); | |
1108 | AliESDtrack *etrack = dynamic_cast<AliESDtrack*>(Vtrack); | |
1109 | AliAODTrack *atrack = dynamic_cast<AliAODTrack*>(Vtrack); | |
1110 | ||
1111 | Double_t fTPCnSigma = -999; | |
1112 | Double_t fTPCnSigma_pion = -999; | |
1113 | Double_t fTPCnSigma_proton = -999; | |
1114 | Double_t fTPCnSigma_kaon = -999; | |
1115 | Double_t fTPCsignal = -999; | |
1116 | Double_t fPt = -999; | |
1117 | Double_t fP = -999; | |
1118 | ||
1119 | ///_____________________________________________________________________________ | |
1120 | ///Fill QA plots without track selection | |
1121 | fPt = track->Pt(); | |
1122 | fP = TMath::Sqrt((track->Pt())*(track->Pt()) + (track->Pz())*(track->Pz())); | |
1123 | ||
1124 | fTPCsignal = track->GetTPCsignal(); | |
1125 | fTPCnSigma = fPidResponse->NumberOfSigmasTPC(track, AliPID::kElectron); | |
1126 | fTPCnSigma_pion = fPidResponse->NumberOfSigmasTPC(track, AliPID::kPion); | |
1127 | fTPCnSigma_proton = fPidResponse->NumberOfSigmasTPC(track, AliPID::kProton); | |
1128 | fTPCnSigma_kaon = fPidResponse->NumberOfSigmasTPC(track, AliPID::kKaon); | |
1129 | ||
1130 | fTPC_p[0]->Fill(fPt,fTPCsignal); | |
1131 | fTPCnsigma_p[0]->Fill(fP,fTPCnSigma); | |
1132 | ||
1133 | ||
1134 | Float_t TPCNcls = track->GetTPCNcls(); | |
1135 | Float_t pos[3]={0,0,0}; | |
1136 | ||
1137 | Double_t fEMCflag = kFALSE; | |
1138 | if(track->GetEMCALcluster()>0) | |
1139 | { | |
1140 | fClus = fVevent->GetCaloCluster(track->GetEMCALcluster()); | |
1141 | if(fClus->IsEMCAL()) | |
1142 | { | |
1143 | if(TMath::Abs(fClus->GetTrackDx())<=0.05 && TMath::Abs(fClus->GetTrackDz())<=0.05) | |
1144 | { | |
1145 | fEMCflag = kTRUE; | |
1146 | fEoverP_pt[0]->Fill(fPt,(fClus->E() / fP)); | |
1147 | ||
1148 | ||
1149 | Float_t Energy = fClus->E(); | |
1150 | Float_t EoverP = Energy/track->P(); | |
1151 | //Float_t M02 = fClus->GetM02(); | |
1152 | //Float_t M20 = fClus->GetM20(); | |
1153 | ||
1154 | /////////////// for Eta Phi distribution | |
1155 | fClus->GetPosition(pos); | |
1156 | TVector3 vpos(pos[0],pos[1],pos[2]); | |
1157 | Double_t cphi = vpos.Phi(); | |
1158 | Double_t ceta = vpos.Eta(); | |
1159 | fEtaPhi[0]->Fill(cphi,ceta); | |
1160 | ||
1161 | fECluster[0]->Fill(Energy); | |
1162 | fTPCNcls_EoverP[0]->Fill(TPCNcls, EoverP); | |
1163 | } | |
1164 | } | |
1165 | } | |
1166 | ||
1167 | //______________________________________________________________ | |
1168 | // Vertex | |
1169 | ||
1170 | fVtxZ[0]->Fill(fZvtx); | |
1171 | fNTracks[0]->Fill(fNOtrks); | |
1172 | fNClusters[0]->Fill(ClsNo); | |
1173 | ||
1174 | //______________________________________________________________ | |
1175 | ||
1176 | ///Fill QA plots without track selection | |
1177 | ///_____________________________________________________________________________ | |
1178 | //______________________________________________________________________________________ | |
1179 | //Track Selection Cuts | |
1180 | ||
1181 | //AOD (Test Filter Bit) | |
1182 | if(fIsAOD) | |
1183 | { | |
1184 | // standard cuts with very loose DCA - BIT(4) | |
1185 | // Description: | |
1186 | /* | |
1187 | GetStandardITSTPCTrackCuts2011(kFALSE) | |
1188 | SetMaxChi2PerClusterTPC(4); | |
1189 | SetAcceptKinkDaughters(kFALSE); | |
1190 | SetRequireTPCRefit(kTRUE); | |
1191 | SetRequireITSRefit(kTRUE); | |
1192 | SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny); | |
1193 | SetMaxDCAToVertexZ(2); | |
1194 | SetMaxDCAToVertex2D(kFALSE); | |
1195 | SetRequireSigmaToVertex(kFALSE); | |
1196 | SetMaxChi2PerClusterITS(36); | |
1197 | SetMaxDCAToVertexXY(2.4) | |
1198 | SetMaxDCAToVertexZ(3.2) | |
1199 | SetDCaToVertex2D(kTRUE) | |
1200 | */ | |
1201 | ||
1202 | if(!atrack->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)) continue; | |
1203 | } | |
1204 | ||
1205 | //RecKine: ITSTPC cuts | |
1206 | if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue; | |
1207 | //RecKink | |
1208 | if(fRejectKinkMother) | |
1209 | { | |
1210 | if(fIsAOD) | |
1211 | { | |
1212 | Bool_t kinkmotherpass = kTRUE; | |
1213 | for(Int_t kinkmother = 0; kinkmother < fNumberOfMotherkink; kinkmother++) | |
1214 | { | |
1215 | if(track->GetID() == fListOfmotherkink[kinkmother]) | |
1216 | { | |
1217 | kinkmotherpass = kFALSE; | |
1218 | continue; | |
1219 | } | |
1220 | } | |
1221 | if(!kinkmotherpass) continue; | |
1222 | } | |
1223 | else | |
1224 | { | |
1225 | if(etrack->GetKinkIndex(0) != 0) continue; | |
1226 | } | |
1227 | } | |
1228 | ||
1229 | //RecPrim | |
1230 | if(!fIsAOD) | |
1231 | { | |
1232 | if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue; | |
1233 | } | |
1234 | ||
1235 | //HFEcuts: ITS layers cuts | |
1236 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue; | |
1237 | ||
1238 | //HFE cuts: TPC PID cleanup | |
1239 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue; | |
1240 | //______________________________________________________________________________________ | |
1241 | ||
1242 | ///_____________________________________________________________ | |
1243 | ///QA plots after track selection | |
1244 | if(fIsMC) | |
1245 | { | |
1246 | if(track->GetLabel()>=0) fPtMCWithLabel->Fill(fPt); | |
1247 | else fPtMCWithoutLabel->Fill(fPt); | |
1248 | } | |
1249 | ||
1250 | if(fIsMC && fIsAOD && track->GetLabel()>=0) | |
1251 | { | |
1252 | fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel()); | |
1253 | ||
1254 | if(fMCparticle->IsPhysicalPrimary()) fPtIsPhysicaPrimary->Fill(fPt); | |
1255 | ||
1256 | Int_t pdg = fMCparticle->GetPdgCode(); | |
1257 | if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax && fMCparticle->Charge()!=0) | |
1258 | { | |
1259 | if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 ) | |
1260 | { | |
1261 | if(fMCparticle->IsPhysicalPrimary()) | |
1262 | { | |
1263 | fPtMCparticleReco->Fill(fMCparticle->Pt()); | |
1264 | ||
1265 | Bool_t MotherFound = FindMother(track->GetLabel()); | |
1266 | if(MotherFound) | |
1267 | { | |
1268 | if(fIsHFE1) fPtMCparticleRecoHfe1->Fill(fMCparticle->Pt()); | |
1269 | if(fIsHFE2) fPtMCparticleRecoHfe2->Fill(fMCparticle->Pt()); | |
1270 | } | |
1271 | } | |
1272 | } | |
1273 | } | |
1274 | } | |
1275 | else if(fIsMC && track->GetLabel()>=0) | |
1276 | { | |
1277 | if(fMCstack->IsPhysicalPrimary(track->GetLabel())) | |
1278 | { | |
1279 | fPtIsPhysicaPrimary->Fill(fPt); | |
1280 | fMCtrack = fMCstack->Particle(track->GetLabel()); | |
1281 | ||
1282 | Int_t pdg = fMCtrack->GetPdgCode(); | |
1283 | if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax) | |
1284 | { | |
1285 | if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 ) | |
1286 | { | |
1287 | fPtMCparticleReco->Fill(fMCtrack->Pt()); | |
1288 | ||
1289 | Bool_t MotherFound = FindMother(track->GetLabel()); | |
1290 | if(MotherFound) | |
1291 | { | |
1292 | if(fIsHFE1) fPtMCparticleRecoHfe1->Fill(fMCtrack->Pt()); | |
1293 | if(fIsHFE2) fPtMCparticleRecoHfe2->Fill(fMCtrack->Pt()); | |
1294 | } | |
1295 | } | |
1296 | } | |
1297 | } | |
1298 | } | |
1299 | ||
1300 | fTPC_p[1]->Fill(fPt,fTPCsignal); | |
1301 | fTPCnsigma_p[1]->Fill(fP,fTPCnSigma); | |
1302 | Double_t fPtBin[6] = {2,4,6,8,10,15}; | |
1303 | ||
1304 | TPCNcls = track->GetTPCNcls(); | |
1305 | Float_t pos2[3]={0,0,0}; | |
1306 | ||
1307 | if(track->GetEMCALcluster()>0) | |
1308 | { | |
1309 | fClus = fVevent->GetCaloCluster(track->GetEMCALcluster()); | |
1310 | if(fClus->IsEMCAL()) | |
1311 | { | |
1312 | if(TMath::Abs(fClus->GetTrackDx())<=0.05 && TMath::Abs(fClus->GetTrackDz())<=0.05) | |
1313 | { | |
1314 | fEoverP_pt[1]->Fill(fPt,(fClus->E() / fP)); | |
1315 | ||
1316 | Float_t Energy = fClus->E(); | |
1317 | Float_t EoverP = Energy/track->P(); | |
1318 | //Float_t M02 = fClus->GetM02(); | |
1319 | //Float_t M20 = fClus->GetM20(); | |
1320 | Float_t ncells = fClus->GetNCells(); | |
1321 | ||
1322 | /////////////// for Eta Phi distribution | |
1323 | fClus->GetPosition(pos2); | |
1324 | TVector3 vpos(pos2[0],pos2[1],pos2[2]); | |
1325 | Double_t cphi = vpos.Phi(); | |
1326 | Double_t ceta = vpos.Eta(); | |
1327 | fEtaPhi[1]->Fill(cphi,ceta); | |
1328 | ||
1329 | fECluster[1]->Fill(Energy); | |
1330 | fTPCNcls_EoverP[1]->Fill(TPCNcls, EoverP); | |
1331 | ||
1332 | // 31/05/2103 | |
1333 | //for EMCal triggger performance | |
1334 | if(EoverP > 0.9){ | |
1335 | ftpc_p_EoverPcut->Fill(track->P(), fTPCsignal); | |
1336 | fnsigma_p_EoverPcut->Fill(track->P(), fTPCnSigma); | |
1337 | ||
1338 | } | |
1339 | ||
1340 | ||
1341 | //for hadron contamination calculations | |
1342 | ||
1343 | // 31/05/2103 | |
1344 | // EtaCut -> dados | |
1345 | if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){ | |
1346 | //main | |
1347 | if(TMath::Abs(fTPCnSigma_pion)<3 || TMath::Abs(fTPCnSigma_proton)<3 || TMath::Abs(fTPCnSigma_kaon)<3 ){ | |
1348 | ||
1349 | if(fTPCnSigma<-3.5){ | |
1350 | fEoverP_pt_hadrons->Fill(fPt,EoverP); | |
1351 | } | |
1352 | } | |
1353 | ||
1354 | if(fTPCnSigma < -3.5){ | |
1355 | fEoverP_pt_pions->Fill(fPt, EoverP); | |
1356 | ||
1357 | } | |
1358 | ||
1359 | if(fTPCnSigma < -3.5 && fTPCnSigma > -10){ | |
1360 | fEoverP_pt_pions2->Fill(fPt, EoverP); | |
1361 | ||
1362 | } | |
1363 | } | |
1364 | ||
1365 | for(Int_t i = 0; i < 5; i++) | |
1366 | { | |
1367 | if(fPt>=fPtBin[i] && fPt<fPtBin[i+1]) | |
1368 | { | |
1369 | ||
1370 | if(fTPCnSigma < -5 && fTPCnSigma > -10){ | |
1371 | fNcells_hadrons[i]->Fill(ncells); | |
1372 | } | |
1373 | //hadrons selection using E/p | |
1374 | if((fClus->E() / fP) >= 0.2 && (fClus->E() / fP) <= 0.7){ | |
1375 | fTPCnsigma_eta_hadrons[i]->Fill(fTPCnSigma, ceta); | |
1376 | } | |
1377 | //electrons selection using E/p | |
1378 | if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax) { | |
1379 | fTPCnsigma_eta_electrons[i]->Fill(fTPCnSigma, ceta); | |
1380 | } | |
1381 | } | |
1382 | } | |
1383 | ||
1384 | if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax) | |
1385 | { | |
1386 | fTPCnsigma_eta->Fill(track->Eta(),fTPCnSigma); | |
1387 | fTPCnsigma_phi->Fill(track->Phi(),fTPCnSigma); | |
1388 | ||
1389 | if(fUseEMCal) | |
1390 | { | |
1391 | if(fTPCnSigma < 3.5 && fCorrelationFlag) | |
1392 | { | |
1393 | fPtTrigger_Inc->Fill(fPt); | |
1394 | DiHadronCorrelation(track, iTracks); | |
1395 | } | |
1396 | } | |
1397 | } | |
1398 | ||
1399 | } | |
1400 | } | |
1401 | } | |
1402 | ||
1403 | //______________________________________________________________ | |
1404 | // Vertex | |
1405 | ||
1406 | fVtxZ[1]->Fill(fZvtx); | |
1407 | fNTracks[1]->Fill(fNOtrks); | |
1408 | fNClusters[1]->Fill(ClsNo); | |
1409 | //______________________________________________________________ | |
1410 | ||
1411 | ///______________________________________________________________________ | |
1412 | ///Histograms for PID Studies | |
1413 | //Double_t fPtBin[6] = {2,4,6,8,10,15}; | |
1414 | ||
1415 | for(Int_t i = 0; i < 5; i++) | |
1416 | { | |
1417 | if(fPt>=fPtBin[i] && fPt<fPtBin[i+1]) | |
1418 | { | |
1419 | if(fEMCflag) fEoverP_tpc[i]->Fill(fTPCnSigma,(fClus->E() / fP)); | |
1420 | ||
1421 | ||
1422 | fTPC_pt[i]->Fill(fTPCsignal); | |
1423 | fTPCnsigma_pt[i]->Fill(fTPCnSigma); | |
1424 | ||
1425 | } | |
1426 | } | |
1427 | ||
1428 | ///QA plots after track selection | |
1429 | ///_____________________________________________________________ | |
1430 | ||
1431 | //_______________________________________________________ | |
1432 | //Correlation Analysis - DiHadron | |
1433 | if(!fUseEMCal) | |
1434 | { | |
1435 | if(fTPCnSigma < 3.5 && fCorrelationFlag) | |
1436 | { | |
1437 | fPtTrigger_Inc->Fill(fPt); | |
1438 | DiHadronCorrelation(track, iTracks); | |
1439 | } | |
1440 | } | |
1441 | //_______________________________________________________ | |
1442 | ||
1443 | ||
1444 | //!////////////////////////////////////////////////////////////////// | |
1445 | ///TPC - efficiency calculation // | |
1446 | ||
1447 | /// changing start here | |
1448 | if(fIsMC && fIsAOD && track->GetLabel()>=0) | |
1449 | { | |
1450 | fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel()); | |
1451 | Int_t pdg = fMCparticle->GetPdgCode(); | |
1452 | ||
1453 | // | |
1454 | if(fMCparticle->IsPhysicalPrimary()){ | |
1455 | ||
1456 | ||
1457 | if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){ | |
1458 | ||
1459 | Bool_t MotherFound = FindMother(track->GetLabel()); | |
1460 | if(MotherFound){ | |
1461 | fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother()); | |
1462 | if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){ | |
1463 | if(fIsHFE1) fPtMC_TPC_All->Fill(fMCparticle->Pt()); | |
1464 | } | |
1465 | } | |
1466 | } | |
1467 | } | |
1468 | }///until here | |
1469 | ||
1470 | else if(fIsMC && track->GetLabel()>=0)//ESD | |
1471 | { | |
1472 | ||
1473 | if(fMCstack->IsPhysicalPrimary(track->GetLabel())){ | |
1474 | fMCtrack = fMCstack->Particle(track->GetLabel()); | |
1475 | ||
1476 | Int_t pdg = fMCtrack->GetPdgCode(); | |
1477 | if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax ){ | |
1478 | ||
1479 | if(fMCtrack->GetFirstMother()>0){ | |
1480 | fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother()); | |
1481 | if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){ | |
1482 | if(fIsHFE1) fPtMC_TPC_All->Fill(fMCtrack->Pt()); | |
1483 | } | |
1484 | } | |
1485 | } | |
1486 | } | |
1487 | } | |
1488 | ||
1489 | ||
1490 | ///________________________________________________________________________ | |
1491 | ///PID | |
1492 | ///Here the PID cuts defined in the file "ConfigEMCalHFEpA.C" is applied | |
1493 | Int_t pidpassed = 1; | |
1494 | AliHFEpidObject hfetrack; | |
1495 | hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis); | |
1496 | hfetrack.SetRecTrack(track); | |
1497 | hfetrack.SetPP(); //proton-proton analysis | |
1498 | if(!fPID->IsSelected(&hfetrack, NULL, "", fPIDqa)) pidpassed = 0; | |
1499 | fpid->Fill(pidpassed); | |
1500 | ||
1501 | if(pidpassed==0) continue; | |
1502 | ///________________________________________________________________________ | |
1503 | ||
1504 | ||
1505 | //!////////////////////////////////////////////////////////////////// | |
1506 | ///TPC efficiency calculations | |
1507 | ||
1508 | /// changing start here | |
1509 | if(fIsMC && fIsAOD && track->GetLabel()>=0) | |
1510 | { | |
1511 | fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel()); | |
1512 | Int_t pdg = fMCparticle->GetPdgCode(); | |
1513 | ||
1514 | // | |
1515 | if(fMCparticle->IsPhysicalPrimary()){ | |
1516 | ||
1517 | ||
1518 | if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){ | |
1519 | ||
1520 | Bool_t MotherFound = FindMother(track->GetLabel()); | |
1521 | if(MotherFound){ | |
1522 | fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother()); | |
1523 | if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){ | |
1524 | if(fIsHFE1) fPtMC_TPC_Selected->Fill(fMCparticle->Pt()); | |
1525 | } | |
1526 | } | |
1527 | } | |
1528 | } | |
1529 | }///until here | |
1530 | ||
1531 | else if(fIsMC && track->GetLabel()>=0)//ESD | |
1532 | { | |
1533 | ||
1534 | if(fMCstack->IsPhysicalPrimary(track->GetLabel())){ | |
1535 | fMCtrack = fMCstack->Particle(track->GetLabel()); | |
1536 | ||
1537 | Int_t pdg = fMCtrack->GetPdgCode(); | |
1538 | if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax ){ | |
1539 | ||
1540 | if(fMCtrack->GetFirstMother()>0){ | |
1541 | fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother()); | |
1542 | if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){ | |
1543 | if(fIsHFE1) fPtMC_TPC_Selected->Fill(fMCtrack->Pt()); | |
1544 | } | |
1545 | } | |
1546 | } | |
1547 | } | |
1548 | } | |
1549 | ||
1550 | //Eta Cut for TPC only | |
1551 | if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){ | |
1552 | fTPCnsigma_pt_2D->Fill(fPt,fTPCnSigma); | |
1553 | } | |
1554 | ||
1555 | fTPCnsigma_p[2]->Fill(fP,fTPCnSigma); | |
1556 | fTPC_p[2]->Fill(fP,fTPCsignal); | |
1557 | TPCNcls = track->GetTPCNcls(); | |
1558 | Float_t pos3[3]={0,0,0}; | |
1559 | ||
1560 | if(track->GetEMCALcluster()>0) | |
1561 | { | |
1562 | fClus = fVevent->GetCaloCluster(track->GetEMCALcluster()); | |
1563 | if(fClus->IsEMCAL()) | |
1564 | { | |
1565 | ||
1566 | ||
1567 | /////////////// Residuals | |
1568 | Double_t Dx = fClus->GetTrackDx(); | |
1569 | Double_t Dz = fClus->GetTrackDz(); | |
1570 | Double_t R=TMath::Sqrt(Dx*Dx+Dz*Dz); | |
1571 | for(Int_t i = 0; i < 5; i++) | |
1572 | { | |
1573 | if(fPt>=fPtBin[i] && fPt<fPtBin[i+1]) | |
1574 | { | |
1575 | ||
1576 | fEta[i]->Fill(Dz); | |
1577 | fPhi[i]->Fill(Dx); | |
1578 | fR[i]->Fill(R); | |
1579 | } | |
1580 | } | |
1581 | ||
1582 | if(TMath::Abs(fClus->GetTrackDx())<=0.05 && TMath::Abs(fClus->GetTrackDz())<=0.05) | |
1583 | { | |
1584 | ||
1585 | // EtaCut | |
1586 | if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){ | |
1587 | fEoverP_pt[2]->Fill(fPt,(fClus->E() / fP)); | |
1588 | } | |
1589 | ||
1590 | Float_t Energy = fClus->E(); | |
1591 | Float_t EoverP = Energy/track->P(); | |
1592 | Float_t M02 = fClus->GetM02(); | |
1593 | Float_t M20 = fClus->GetM20(); | |
1594 | Float_t ncells = fClus->GetNCells(); | |
1595 | ||
1596 | ||
1597 | /////////////// for Eta Phi distribution | |
1598 | fClus->GetPosition(pos3); | |
1599 | TVector3 vpos(pos3[0],pos3[1],pos3[2]); | |
1600 | Double_t cphi = vpos.Phi(); | |
1601 | Double_t ceta = vpos.Eta(); | |
1602 | fEtaPhi[2]->Fill(cphi,ceta); | |
1603 | ||
1604 | ||
1605 | ||
1606 | fTPCNcls_EoverP[2]->Fill(TPCNcls, EoverP); | |
1607 | ||
1608 | for(Int_t i = 0; i < 5; i++) | |
1609 | { | |
1610 | if(fPt>=fPtBin[i] && fPt<fPtBin[i+1]) | |
1611 | { | |
1612 | ||
1613 | fR_EoverP[i]->Fill(R, EoverP); | |
1614 | fNcells[i]->Fill(ncells); | |
1615 | fNcells_EoverP[i]->Fill(EoverP, ncells); | |
1616 | fM02_EoverP[i]->Fill(M02,EoverP); | |
1617 | fM20_EoverP[i]->Fill(M20,EoverP); | |
1618 | fECluster_ptbins[i]->Fill(Energy); | |
1619 | fEoverP_ptbins[i]->Fill(EoverP); | |
1620 | ||
1621 | if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax) { | |
1622 | fNcells_electrons[i]->Fill(ncells); | |
1623 | } | |
1624 | ||
1625 | if(M02<0.5 && M20<0.3) { | |
1626 | fEoverP_wSSCut[i]->Fill(EoverP); | |
1627 | } | |
1628 | } | |
1629 | } | |
1630 | ||
1631 | fNcells_pt->Fill(fPt, ncells); | |
1632 | ||
1633 | ||
1634 | //!////////////////////////////////////////////////////////////////// | |
1635 | ///EMCal - Efficiency calculations | |
1636 | ||
1637 | /// changing start here | |
1638 | if(fIsMC && fIsAOD && track->GetLabel()>=0) | |
1639 | { | |
1640 | fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel()); | |
1641 | Int_t pdg = fMCparticle->GetPdgCode(); | |
1642 | ||
1643 | // | |
1644 | if(fMCparticle->IsPhysicalPrimary()){ | |
1645 | ||
1646 | ||
1647 | if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){ | |
1648 | ||
1649 | Bool_t MotherFound = FindMother(track->GetLabel()); | |
1650 | if(MotherFound){ | |
1651 | fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother()); | |
1652 | if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){ | |
1653 | fPtMC_EMCal_All->Fill(fMCparticle->Pt()); | |
1654 | } | |
1655 | } | |
1656 | } | |
1657 | } | |
1658 | }///until here | |
1659 | ||
1660 | else if(fIsMC && track->GetLabel()>=0)//ESD | |
1661 | { | |
1662 | ||
1663 | if(fMCstack->IsPhysicalPrimary(track->GetLabel())) | |
1664 | { | |
1665 | ||
1666 | fMCtrack = fMCstack->Particle(track->GetLabel()); | |
1667 | ||
1668 | Int_t pdg = fMCtrack->GetPdgCode(); | |
1669 | if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax && fMCtrack->Phi()>=(TMath::Pi()*80/180) && fMCtrack->Phi()<=TMath::Pi()) | |
1670 | { | |
1671 | if(fMCtrack->GetFirstMother()>0){ | |
1672 | fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother()); | |
1673 | if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){ | |
1674 | ||
1675 | fPtMC_EMCal_All->Fill(fMCtrack->Pt()); | |
1676 | } | |
1677 | } | |
1678 | } | |
1679 | } | |
1680 | } | |
1681 | ||
1682 | ||
1683 | if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax) | |
1684 | { | |
1685 | ||
1686 | fECluster[2]->Fill(Energy); | |
1687 | //_______________________________________________________ | |
1688 | //Correlation Analysis | |
1689 | if(fUseEMCal) | |
1690 | { | |
1691 | fPtElec_Inc->Fill(fPt); | |
1692 | ||
1693 | if(fCorrelationFlag) | |
1694 | { | |
1695 | ElectronHadronCorrelation(track, iTracks, Vtrack); | |
1696 | } | |
1697 | } | |
1698 | //_______________________________________________________ | |
1699 | ||
1700 | //////////////////////////////////////////////////////////////////// | |
1701 | ///EMCal - efficiency calculations | |
1702 | ||
1703 | /// changing start here | |
1704 | if(fIsMC && fIsAOD && track->GetLabel()>=0) | |
1705 | { | |
1706 | fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel()); | |
1707 | Int_t pdg = fMCparticle->GetPdgCode(); | |
1708 | ||
1709 | // | |
1710 | if(fMCparticle->IsPhysicalPrimary()){ | |
1711 | ||
1712 | ||
1713 | if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){ | |
1714 | //check | |
1715 | if(fIsHFE1) fPtMCelectronAfterAll->Fill(fMCparticle->Pt()); //numerator for the total efficiency | |
1716 | ||
1717 | ||
1718 | Bool_t MotherFound = FindMother(track->GetLabel()); | |
1719 | if(MotherFound){ | |
1720 | fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother()); | |
1721 | if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){ | |
1722 | fPtMC_EMCal_Selected->Fill(fMCparticle->Pt()); | |
1723 | } | |
1724 | } | |
1725 | } | |
1726 | } | |
1727 | }///until here | |
1728 | ||
1729 | else if(fIsMC && track->GetLabel()>=0)//ESD | |
1730 | { | |
1731 | if(fMCstack->IsPhysicalPrimary(track->GetLabel())) | |
1732 | { | |
1733 | Bool_t MotherFound = FindMother(track->GetLabel()); | |
1734 | fMCtrack = fMCstack->Particle(track->GetLabel()); | |
1735 | if(MotherFound) | |
1736 | { | |
1737 | if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax){ | |
1738 | if(fIsHFE1) fPtMCelectronAfterAll->Fill(fMCtrack->Pt()); //numerator for the total efficiency | |
1739 | } | |
1740 | } | |
1741 | ||
1742 | ||
1743 | ||
1744 | Int_t pdg = fMCtrack->GetPdgCode(); | |
1745 | if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax && fMCtrack->Phi()>=(TMath::Pi()*80/180) && fMCtrack->Phi()<=TMath::Pi()) | |
1746 | { | |
1747 | if(fMCtrack->GetFirstMother()>0){ | |
1748 | fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother()); | |
1749 | if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){ | |
1750 | ||
1751 | fPtMC_EMCal_Selected->Fill(fMCtrack->Pt()); | |
1752 | } | |
1753 | } | |
1754 | } | |
1755 | } | |
1756 | } | |
1757 | /////////////////////////////////////////////////////////////////// | |
1758 | ||
1759 | ||
1760 | } | |
1761 | } | |
1762 | } | |
1763 | } | |
1764 | ||
1765 | //______________________________________________________________ | |
1766 | // Vertex | |
1767 | ||
1768 | fVtxZ[2]->Fill(fZvtx); | |
1769 | fNTracks[2]->Fill(fNOtrks); | |
1770 | fNClusters[2]->Fill(ClsNo); | |
1771 | ||
1772 | //______________________________________________________________ | |
1773 | ||
1774 | //_______________________________________________________ | |
1775 | //Correlation Analysis | |
1776 | if(!fUseEMCal) | |
1777 | { | |
1778 | fPtElec_Inc->Fill(fPt); | |
1779 | ||
1780 | if(fCorrelationFlag) | |
1781 | { | |
1782 | ElectronHadronCorrelation(track, iTracks, Vtrack); | |
1783 | } | |
1784 | } | |
1785 | //_______________________________________________________ | |
1786 | ||
1787 | ///________________________________________________________________________ | |
1788 | } | |
1789 | ||
1790 | //__________________________________________________________________ | |
1791 | //Event Mixing Analysis | |
1792 | //Filling pool | |
1793 | if(fEventMixingFlag) | |
1794 | { | |
1795 | fPool = fPoolMgr->GetEventPool(fCentrality->GetCentralityPercentile("V0A"), fZvtx); // Get the buffer associated with the current centrality and z-vtx | |
1796 | ||
1797 | if(!fPool) AliFatal(Form("No pool found for centrality = %f, zVtx = %f", fCentrality->GetCentralityPercentile("V0A"), fZvtx)); | |
1798 | ||
1799 | 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! | |
1800 | ||
1801 | ||
1802 | } | |
1803 | ||
1804 | //__________________________________________________________________ | |
1805 | ||
1806 | delete fListOfmotherkink; | |
1807 | PostData(1, fOutputList); | |
1808 | } | |
1809 | ||
1810 | //______________________________________________________________________ | |
1811 | void AliAnalysisTaskEMCalHFEpA::Terminate(Option_t *) | |
1812 | { | |
1813 | //Draw result to the screen | |
1814 | //Called once at the end of the query | |
1815 | ||
1816 | fOutputList = dynamic_cast<TList*> (GetOutputData(1)); | |
1817 | ||
1818 | if(!fOutputList) | |
1819 | { | |
1820 | printf("ERROR: Output list not available\n"); | |
1821 | return; | |
1822 | } | |
1823 | } | |
1824 | ||
1825 | //______________________________________________________________________ | |
1826 | Bool_t AliAnalysisTaskEMCalHFEpA::ProcessCutStep(Int_t cutStep, AliVParticle *track) | |
1827 | { | |
1828 | //Check single track cuts for a given cut step | |
1829 | //Note this function is called inside the UserExec function | |
1830 | const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack; | |
1831 | if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE; | |
1832 | return kTRUE; | |
1833 | } | |
1834 | ||
1835 | //______________________________________________________________________ | |
1836 | void AliAnalysisTaskEMCalHFEpA::ElectronHadronCorrelation(AliVTrack *track, Int_t trackIndex, AliVParticle *vtrack) | |
1837 | { | |
1838 | ///_________________________________________________________________ | |
1839 | ///MC analysis | |
1840 | if(fIsMC) | |
1841 | { | |
1842 | if(track->GetLabel() < 0) | |
1843 | { | |
1844 | AliWarning(Form("The track %d does not have a valid MC label",trackIndex)); | |
1845 | return; | |
1846 | } | |
1847 | ||
1848 | if(fIsAOD) | |
1849 | { | |
1850 | fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel()); | |
1851 | ||
1852 | if(fMCparticle->GetMother()<0) return; | |
1853 | ||
1854 | fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother()); | |
1855 | ||
1856 | if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221)) | |
1857 | { | |
1858 | //Is Background | |
1859 | fPtBackgroundBeforeReco->Fill(track->Pt()); | |
1860 | } | |
1861 | } | |
1862 | else | |
1863 | { | |
1864 | fMCtrack = fMCstack->Particle(track->GetLabel()); | |
1865 | ||
1866 | if(fMCtrack->GetFirstMother()<0) return; | |
1867 | ||
1868 | fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother()); | |
1869 | ||
1870 | if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221)) | |
1871 | { | |
1872 | //Is Background | |
1873 | fPtBackgroundBeforeReco->Fill(track->Pt()); | |
1874 | } | |
1875 | } | |
1876 | } | |
1877 | ///_________________________________________________________________ | |
1878 | ||
1879 | //________________________________________________ | |
1880 | //Associated particle cut | |
1881 | fPartnerCuts->SetAcceptKinkDaughters(kFALSE); | |
1882 | fPartnerCuts->SetRequireITSRefit(kTRUE); | |
1883 | fPartnerCuts->SetRequireTPCRefit(kTRUE); | |
1884 | fPartnerCuts->SetEtaRange(-0.9,0.9); | |
1885 | fPartnerCuts->SetMaxChi2PerClusterTPC(4.0); | |
1886 | fPartnerCuts->SetMinNClustersTPC(80); | |
1887 | fPartnerCuts->SetPtRange(0.3,1e10); | |
1888 | //fPartnerCuts->SetRequireSigmaToVertex(kTRUE); | |
1889 | //fPartnerCuts->SetMaxDCAToVertexXY(1); | |
1890 | //fPartnerCuts->SetMaxDCAToVertexZ(3); | |
1891 | //_________________________________________________ | |
1892 | ||
1893 | ///################################################################# | |
1894 | //Non-HFE reconstruction | |
1895 | fNonHFE = new AliSelectNonHFE(); | |
1896 | fNonHFE->SetAODanalysis(fIsAOD); | |
1897 | if(fMassCutFlag) fNonHFE->SetInvariantMassCut(fMassCut); | |
1898 | if(fAngleCutFlag) fNonHFE->SetOpeningAngleCut(fAngleCut); | |
1899 | if(fChi2CutFlag) fNonHFE->SetChi2OverNDFCut(fChi2Cut); | |
1900 | if(fDCAcutFlag) fNonHFE->SetDCACut(fDCAcut); | |
1901 | fNonHFE->SetAlgorithm("DCA"); //KF | |
1902 | fNonHFE->SetPIDresponse(fPidResponse); | |
1903 | fNonHFE->SetTrackCuts(-3.5,3.5,fPartnerCuts); | |
1904 | ||
1905 | fNonHFE->SetHistAngleBack(fOpAngleBack); | |
1906 | fNonHFE->SetHistAngle(fOpAngle); | |
1907 | fNonHFE->SetHistDCABack(fDCABack); | |
1908 | fNonHFE->SetHistDCA(fDCA); | |
1909 | fNonHFE->SetHistMassBack(fInvMassBack); | |
1910 | fNonHFE->SetHistMass(fInvMass); | |
1911 | ||
1912 | fNonHFE->FindNonHFE(trackIndex,vtrack,fVevent); | |
1913 | ||
1914 | Int_t *fUlsPartner = fNonHFE->GetPartnersULS(); | |
1915 | Int_t *fLsPartner = fNonHFE->GetPartnersLS(); | |
1916 | Bool_t fUlsIsPartner = kFALSE; | |
1917 | Bool_t fLsIsPartner = kFALSE; | |
1918 | ///################################################################# | |
1919 | ||
1920 | //Electron Information | |
1921 | Double_t fPhiE = -999; | |
1922 | Double_t fEtaE = -999; | |
1923 | Double_t fPhiH = -999; | |
1924 | Double_t fEtaH = -999; | |
1925 | Double_t fDphi = -999; | |
1926 | Double_t fDeta = -999; | |
1927 | Double_t fPtE = -999; | |
1928 | Double_t fPtH = -999; | |
1929 | ||
1930 | Double_t pi = TMath::Pi(); | |
1931 | ||
1932 | fPhiE = track->Phi(); | |
1933 | fEtaE = track->Eta(); | |
1934 | fPtE = track->Pt(); | |
1935 | ||
1936 | ///_________________________________________________________________ | |
1937 | ///MC analysis | |
1938 | if(fIsMC) | |
1939 | { | |
1940 | if(fIsAOD) | |
1941 | { | |
1942 | if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221)) | |
1943 | { | |
1944 | if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS()); | |
1945 | if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS()); | |
1946 | } | |
1947 | } | |
1948 | else | |
1949 | { | |
1950 | if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221)) | |
1951 | { | |
1952 | if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS()); | |
1953 | if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS()); | |
1954 | } | |
1955 | } | |
1956 | } | |
1957 | ///_________________________________________________________________ | |
1958 | else | |
1959 | { | |
1960 | if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS()); | |
1961 | if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS()); | |
1962 | } | |
1963 | ||
1964 | //__________________________________________________________________ | |
1965 | //Event Mixing Analysis - Hadron Loop | |
1966 | //Retrieve | |
1967 | if(fEventMixingFlag) | |
1968 | { | |
1969 | fPool = fPoolMgr->GetEventPool(fCentrality->GetCentralityPercentile("V0A"), fZvtx); // Get the buffer associated with the current centrality and z-vtx | |
1970 | ||
1971 | if(!fPool) AliFatal(Form("No pool found for centrality = %f, zVtx = %f",fCentrality->GetCentralityPercentile("V0A"), fZvtx)); | |
1972 | ||
1973 | if(fPool->GetCurrentNEvents() >= 5) // start mixing when 5 events are in the buffer | |
1974 | { | |
1975 | fPoolNevents->Fill(fPool->GetCurrentNEvents()); | |
1976 | ||
1977 | for (Int_t jMix = 0; jMix < fPool->GetCurrentNEvents(); jMix++) // mix with each event in the buffer | |
1978 | { | |
1979 | TObjArray* bgTracks = fPool->GetEvent(jMix); | |
1980 | ||
1981 | for (Int_t kMix = 0; kMix < bgTracks->GetEntriesFast(); kMix++) // mix with each track in the event | |
1982 | { | |
1983 | const AliEHCParticle* MixedTrack(dynamic_cast<AliEHCParticle*>(bgTracks->At(kMix))); | |
1984 | if (NULL == MixedTrack) continue; | |
1985 | ||
1986 | fPhiH = MixedTrack->Phi(); | |
1987 | fEtaH = MixedTrack->Eta(); | |
1988 | fPtH = MixedTrack->Pt(); | |
1989 | ||
1990 | if(fPtH>fPtE || fPtH<1) continue; | |
1991 | ||
1992 | fDphi = fPhiE - fPhiH; | |
1993 | ||
1994 | if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi; | |
1995 | if (fDphi < -pi/2) fDphi = fDphi + 2*pi; | |
1996 | ||
1997 | fDeta = fEtaE - fEtaH; | |
1998 | ||
1999 | Double_t fPtBin[6] = {2,4,6,8,10,15}; | |
2000 | ||
2001 | for(Int_t i = 0; i < 5; i++) | |
2002 | { | |
2003 | if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1]) | |
2004 | { | |
2005 | fCEtaPhi_Inc_EM[i]->Fill(fDphi,fDeta); | |
2006 | ||
2007 | if(fNonHFE->IsULS()) fCEtaPhi_ULS_EM[i]->Fill(fDphi,fDeta); | |
2008 | if(fNonHFE->IsLS()) fCEtaPhi_LS_EM[i]->Fill(fDphi,fDeta); | |
2009 | ||
2010 | if(fNonHFE->IsULS()) fCEtaPhi_ULS_Weight_EM[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS()); | |
2011 | if(fNonHFE->IsLS()) fCEtaPhi_LS_Weight_EM[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS()); | |
2012 | } | |
2013 | } | |
2014 | ||
2015 | // TODO your code: do event mixing with current event and bgTracks | |
2016 | // note that usually the content filled now is weighted by 1 / pool->GetCurrentNEvents() | |
2017 | } | |
2018 | } | |
2019 | } | |
2020 | } | |
2021 | //__________________________________________________________________ | |
2022 | ||
2023 | //__________________________________________________________________ | |
2024 | //Same Event Analysis - Hadron Loop | |
2025 | for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++) | |
2026 | { | |
2027 | if(trackIndex==iTracks) continue; | |
2028 | ||
2029 | AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks); | |
2030 | if (!Vtrack2) | |
2031 | { | |
2032 | printf("ERROR: Could not receive track %d\n", iTracks); | |
2033 | continue; | |
2034 | } | |
2035 | ||
2036 | AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2); | |
2037 | ||
2038 | if(fIsAOD) | |
2039 | { | |
2040 | AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2); | |
2041 | if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue; | |
2042 | if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue; | |
2043 | if(atrack2->GetTPCNcls() < 80) continue; | |
2044 | } | |
2045 | else | |
2046 | { | |
2047 | AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2); | |
2048 | if(!fPartnerCuts->AcceptTrack(etrack2)) continue; | |
2049 | } | |
2050 | ||
2051 | fPhiH = track2->Phi(); | |
2052 | fEtaH = track2->Eta(); | |
2053 | fPtH = track2->Pt(); | |
2054 | ||
2055 | if(fPtH>fPtE || fPtH<1) continue; | |
2056 | ||
2057 | fDphi = fPhiE - fPhiH; | |
2058 | ||
2059 | if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi; | |
2060 | if (fDphi < -pi/2) fDphi = fDphi + 2*pi; | |
2061 | ||
2062 | fDeta = fEtaE - fEtaH; | |
2063 | ||
2064 | Double_t fPtBin[6] = {2,4,6,8,10,15}; | |
2065 | ||
2066 | //______________________________________________________________ | |
2067 | //Check if this track is a Non-HFE partner | |
2068 | for(Int_t i = 0; i < fNonHFE->GetNULS(); i++) | |
2069 | { | |
2070 | if(fUlsPartner[i]==iTracks) fUlsIsPartner=kTRUE; | |
2071 | } | |
2072 | for(Int_t i = 0; i < fNonHFE->GetNLS(); i++) | |
2073 | { | |
2074 | if(fLsPartner[i]==iTracks) fLsIsPartner=kTRUE; | |
2075 | } | |
2076 | //______________________________________________________________ | |
2077 | ||
2078 | for(Int_t i = 0; i < 5; i++) | |
2079 | { | |
2080 | if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1]) | |
2081 | { | |
2082 | fCEtaPhi_Inc[i]->Fill(fDphi,fDeta); | |
2083 | ||
2084 | if(fNonHFE->IsULS()) fCEtaPhi_ULS[i]->Fill(fDphi,fDeta); | |
2085 | if(fNonHFE->IsLS()) fCEtaPhi_LS[i]->Fill(fDphi,fDeta); | |
2086 | if(fNonHFE->IsULS() && !fUlsIsPartner) fCEtaPhi_ULS_NoP[i]->Fill(fDphi,fDeta); | |
2087 | if(fNonHFE->IsLS() && !fLsIsPartner) fCEtaPhi_LS_NoP[i]->Fill(fDphi,fDeta); | |
2088 | ||
2089 | if(fNonHFE->IsULS()) fCEtaPhi_ULS_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS()); | |
2090 | if(fNonHFE->IsLS()) fCEtaPhi_LS_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS()); | |
2091 | if(fNonHFE->IsULS() && !fUlsIsPartner) fCEtaPhi_ULS_NoP_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS()); | |
2092 | if(fNonHFE->IsLS() && !fLsIsPartner) fCEtaPhi_LS_NoP_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS()); | |
2093 | } | |
2094 | } | |
2095 | } | |
2096 | } | |
2097 | ||
2098 | //____________________________________________________________________________________________________________ | |
2099 | //Create a TObjArray with selected hadrons, for the mixed event analysis | |
2100 | TObjArray* AliAnalysisTaskEMCalHFEpA::SelectedHadrons() | |
2101 | { | |
2102 | fTracksClone = new TObjArray; | |
2103 | fTracksClone->SetOwner(kTRUE); | |
2104 | ||
2105 | for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++) | |
2106 | { | |
2107 | AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks); | |
2108 | if (!Vtrack2) | |
2109 | { | |
2110 | printf("ERROR: Could not receive track %d\n", iTracks); | |
2111 | continue; | |
2112 | } | |
2113 | ||
2114 | AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2); | |
2115 | ||
2116 | if(fIsAOD) | |
2117 | { | |
2118 | AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2); | |
2119 | if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue; | |
2120 | if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue; | |
2121 | if(atrack2->GetTPCNcls() < 80) continue; | |
2122 | } | |
2123 | else | |
2124 | { | |
2125 | AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2); | |
2126 | if(!fPartnerCuts->AcceptTrack(etrack2)) continue; | |
2127 | } | |
2128 | ||
2129 | fTracksClone->Add(new AliEHCParticle(track2->Eta(), track2->Phi(), track2->Pt())); | |
2130 | } | |
2131 | return fTracksClone; | |
2132 | } | |
2133 | //____________________________________________________________________________________________________________ | |
2134 | ||
2135 | //______________________________________________________________________ | |
2136 | void AliAnalysisTaskEMCalHFEpA::DiHadronCorrelation(AliVTrack *track, Int_t trackIndex) | |
2137 | { | |
2138 | //________________________________________________ | |
2139 | //Associated particle cut | |
2140 | fPartnerCuts->SetAcceptKinkDaughters(kFALSE); | |
2141 | fPartnerCuts->SetRequireITSRefit(kTRUE); | |
2142 | fPartnerCuts->SetRequireTPCRefit(kTRUE); | |
2143 | fPartnerCuts->SetEtaRange(-0.9,0.9); | |
2144 | fPartnerCuts->SetMaxChi2PerClusterTPC(4.0); | |
2145 | fPartnerCuts->SetMinNClustersTPC(80); | |
2146 | fPartnerCuts->SetPtRange(0.3,1e10); | |
2147 | //fPartnerCuts->SetRequireSigmaToVertex(kTRUE); | |
2148 | //fPartnerCuts->SetMaxDCAToVertexXY(1); | |
2149 | //fPartnerCuts->SetMaxDCAToVertexZ(3); | |
2150 | //_________________________________________________ | |
2151 | ||
2152 | //Electron Information | |
2153 | Double_t fPhiE = -999; | |
2154 | Double_t fEtaE = -999; | |
2155 | Double_t fPhiH = -999; | |
2156 | Double_t fEtaH = -999; | |
2157 | Double_t fDphi = -999; | |
2158 | Double_t fDeta = -999; | |
2159 | Double_t fPtE = -999; | |
2160 | Double_t fPtH = -999; | |
2161 | ||
2162 | Double_t pi = TMath::Pi(); | |
2163 | ||
2164 | fPhiE = track->Phi(); | |
2165 | fEtaE = track->Eta(); | |
2166 | fPtE = track->Pt(); | |
2167 | ||
2168 | //__________________________________________________________________ | |
2169 | //Same Event Analysis - Hadron Loop | |
2170 | for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++) | |
2171 | { | |
2172 | if(trackIndex==iTracks) continue; | |
2173 | ||
2174 | AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks); | |
2175 | if (!Vtrack2) | |
2176 | { | |
2177 | printf("ERROR: Could not receive track %d\n", iTracks); | |
2178 | continue; | |
2179 | } | |
2180 | ||
2181 | AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2); | |
2182 | ||
2183 | if(fIsAOD) | |
2184 | { | |
2185 | AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2); | |
2186 | if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue; | |
2187 | if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue; | |
2188 | if(atrack2->GetTPCNcls() < 80) continue; | |
2189 | } | |
2190 | else | |
2191 | { | |
2192 | AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2); | |
2193 | if(!fPartnerCuts->AcceptTrack(etrack2)) continue; | |
2194 | } | |
2195 | ||
2196 | fPhiH = track2->Phi(); | |
2197 | fEtaH = track2->Eta(); | |
2198 | fPtH = track2->Pt(); | |
2199 | ||
2200 | if(fPtH>fPtE || fPtH<1) continue; | |
2201 | ||
2202 | fDphi = fPhiE - fPhiH; | |
2203 | ||
2204 | if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi; | |
2205 | if (fDphi < -pi/2) fDphi = fDphi + 2*pi; | |
2206 | ||
2207 | fDeta = fEtaE - fEtaH; | |
2208 | ||
2209 | Double_t fPtBin[6] = {2,4,6,8,10,15}; | |
2210 | ||
2211 | for(Int_t i = 0; i < 5; i++) | |
2212 | { | |
2213 | if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1]) | |
2214 | { | |
2215 | fCEtaPhi_Inc_DiHadron[i]->Fill(fDphi,fDeta); | |
2216 | } | |
2217 | } | |
2218 | } | |
2219 | } | |
2220 | //____________________________________________________________________________________________________________ | |
2221 | ||
2222 | //______________________________________________________________________ | |
2223 | Bool_t AliAnalysisTaskEMCalHFEpA::FindMother(Int_t mcIndex) | |
2224 | { | |
2225 | fIsHFE1 = kFALSE; | |
2226 | fIsHFE2 = kFALSE; | |
2227 | fIsNonHFE = kFALSE; | |
2228 | fIsFromD = kFALSE; | |
2229 | fIsFromB = kFALSE; | |
2230 | fIsFromPi0 = kFALSE; | |
2231 | fIsFromEta = kFALSE; | |
2232 | fIsFromGamma = kFALSE; | |
2233 | ||
2234 | if(mcIndex < 0 || !fIsMC) | |
2235 | { | |
2236 | return kFALSE; | |
2237 | } | |
2238 | ||
2239 | Int_t pdg = -99999; | |
2240 | Int_t mpdg = -99999; | |
2241 | Int_t gmpdg = -99999; | |
2242 | Int_t ggmpdg = -99999; | |
2243 | Int_t gggmpdg = -99999; | |
2244 | ||
2245 | if(fIsAOD) | |
2246 | { | |
2247 | fMCparticle = (AliAODMCParticle*) fMCarray->At(mcIndex); | |
2248 | ||
2249 | pdg = TMath::Abs(fMCparticle->GetPdgCode()); | |
2250 | ||
2251 | ||
2252 | if(pdg!=11) | |
2253 | { | |
2254 | fIsHFE1 = kFALSE; | |
2255 | fIsHFE2 = kFALSE; | |
2256 | fIsNonHFE = kFALSE; | |
2257 | fIsFromD = kFALSE; | |
2258 | fIsFromB = kFALSE; | |
2259 | fIsFromPi0 = kFALSE; | |
2260 | fIsFromEta = kFALSE; | |
2261 | fIsFromGamma = kFALSE; | |
2262 | return kFALSE; | |
2263 | } | |
2264 | ||
2265 | if(fMCparticle->GetMother()<0) | |
2266 | { | |
2267 | fIsHFE1 = kFALSE; | |
2268 | fIsHFE2 = kFALSE; | |
2269 | fIsNonHFE = kFALSE; | |
2270 | fIsFromD = kFALSE; | |
2271 | fIsFromB = kFALSE; | |
2272 | fIsFromPi0 = kFALSE; | |
2273 | fIsFromEta = kFALSE; | |
2274 | fIsFromGamma = kFALSE; | |
2275 | return kFALSE; | |
2276 | } | |
2277 | ||
2278 | fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother()); | |
2279 | mpdg = TMath::Abs(fMCparticleMother->GetPdgCode()); | |
2280 | ||
2281 | if(fMCparticleMother->GetMother()<0) | |
2282 | { | |
2283 | gmpdg = 0; | |
2284 | ggmpdg = 0; | |
2285 | gggmpdg = 0; | |
2286 | } | |
2287 | else | |
2288 | { | |
2289 | fMCparticleGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleMother->GetMother()); | |
2290 | gmpdg = TMath::Abs(fMCparticleGMother->GetPdgCode()); | |
2291 | if(fMCparticleGMother->GetMother()<0) | |
2292 | { | |
2293 | ggmpdg = 0; | |
2294 | gggmpdg = 0; | |
2295 | } | |
2296 | else | |
2297 | { | |
2298 | fMCparticleGGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleGMother->GetMother()); | |
2299 | ggmpdg = TMath::Abs(fMCparticleGGMother->GetPdgCode()); | |
2300 | if(fMCparticleGGMother->GetMother()<0) | |
2301 | { | |
2302 | gggmpdg = 0; | |
2303 | } | |
2304 | else | |
2305 | { | |
2306 | fMCparticleGGGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleGGMother->GetMother()); | |
2307 | gggmpdg = TMath::Abs(fMCparticleGGGMother->GetPdgCode()); | |
2308 | } | |
2309 | } | |
2310 | } | |
2311 | } | |
2312 | else | |
2313 | { | |
2314 | fMCtrack = fMCstack->Particle(mcIndex); | |
2315 | ||
2316 | pdg = TMath::Abs(fMCtrack->GetPdgCode()); | |
2317 | ||
2318 | if(pdg!=11) | |
2319 | { | |
2320 | fIsHFE1 = kFALSE; | |
2321 | fIsHFE2 = kFALSE; | |
2322 | fIsNonHFE = kFALSE; | |
2323 | fIsFromD = kFALSE; | |
2324 | fIsFromB = kFALSE; | |
2325 | fIsFromPi0 = kFALSE; | |
2326 | fIsFromEta = kFALSE; | |
2327 | fIsFromGamma = kFALSE; | |
2328 | return kFALSE; | |
2329 | } | |
2330 | ||
2331 | if(fMCtrack->GetFirstMother()<0) | |
2332 | { | |
2333 | fIsHFE1 = kFALSE; | |
2334 | fIsHFE2 = kFALSE; | |
2335 | fIsNonHFE = kFALSE; | |
2336 | fIsFromD = kFALSE; | |
2337 | fIsFromB = kFALSE; | |
2338 | fIsFromPi0 = kFALSE; | |
2339 | fIsFromEta = kFALSE; | |
2340 | fIsFromGamma = kFALSE; | |
2341 | return kFALSE; | |
2342 | } | |
2343 | ||
2344 | fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother()); | |
2345 | mpdg = TMath::Abs(fMCtrackMother->GetPdgCode()); | |
2346 | ||
2347 | if(fMCtrackMother->GetFirstMother()<0) | |
2348 | { | |
2349 | gmpdg = 0; | |
2350 | ggmpdg = 0; | |
2351 | gggmpdg = 0; | |
2352 | } | |
2353 | else | |
2354 | { | |
2355 | fMCtrackGMother = fMCstack->Particle(fMCtrackMother->GetFirstMother()); | |
2356 | gmpdg = TMath::Abs(fMCtrackGMother->GetPdgCode()); | |
2357 | ||
2358 | if(fMCtrackGMother->GetFirstMother()<0) | |
2359 | { | |
2360 | ggmpdg = 0; | |
2361 | gggmpdg = 0; | |
2362 | } | |
2363 | else | |
2364 | { | |
2365 | fMCtrackGGMother = fMCstack->Particle(fMCtrackGMother->GetFirstMother()); | |
2366 | ggmpdg = TMath::Abs(fMCtrackGGMother->GetPdgCode()); | |
2367 | ||
2368 | if(fMCtrackGGMother->GetFirstMother()<0) | |
2369 | { | |
2370 | gggmpdg = 0; | |
2371 | } | |
2372 | else | |
2373 | { | |
2374 | fMCtrackGGGMother = fMCstack->Particle(fMCtrackGGMother->GetFirstMother()); | |
2375 | gggmpdg = TMath::Abs(fMCtrackGGGMother->GetPdgCode()); | |
2376 | } | |
2377 | } | |
2378 | } | |
2379 | } | |
2380 | ||
2381 | //Tag Electron Source | |
2382 | if(mpdg==111 || mpdg==221 || mpdg==22) | |
2383 | { | |
2384 | fIsHFE1 = kFALSE; | |
2385 | fIsHFE2 = kFALSE; | |
2386 | fIsNonHFE = kTRUE; | |
2387 | fIsFromD = kFALSE; | |
2388 | fIsFromB = kFALSE; | |
2389 | ||
2390 | fIsFromPi0 = kFALSE; | |
2391 | fIsFromEta = kFALSE; | |
2392 | fIsFromGamma = kFALSE; | |
2393 | ||
2394 | if(mpdg==111) fIsFromPi0 = kFALSE; | |
2395 | if(mpdg==221)fIsFromEta = kFALSE; | |
2396 | if(mpdg==22) fIsFromGamma = kFALSE; | |
2397 | ||
2398 | return kTRUE; | |
2399 | } | |
2400 | else | |
2401 | { | |
2402 | fIsHFE1 = kFALSE; | |
2403 | fIsHFE2 = kTRUE; | |
2404 | ||
2405 | fIsFromPi0 = kFALSE; | |
2406 | fIsFromEta = kFALSE; | |
2407 | fIsFromGamma = kFALSE; | |
2408 | ||
2409 | fIsNonHFE = kFALSE; | |
2410 | ||
2411 | fIsFromD = kFALSE; | |
2412 | fIsFromB = kFALSE; | |
2413 | ||
2414 | if(mpdg>400 && mpdg<500) | |
2415 | { | |
2416 | if((gmpdg>500 && gmpdg<600) || (ggmpdg>500 && ggmpdg<600) || (gggmpdg>500 && gggmpdg<600)) | |
2417 | { | |
2418 | fIsHFE1 = kTRUE; | |
2419 | fIsFromD = kFALSE; | |
2420 | fIsFromB = kTRUE; | |
2421 | return kTRUE; | |
2422 | } | |
2423 | else | |
2424 | { | |
2425 | fIsHFE1 = kTRUE; | |
2426 | fIsFromD = kTRUE; | |
2427 | fIsFromB = kFALSE; | |
2428 | return kTRUE; | |
2429 | } | |
2430 | } | |
2431 | else if(mpdg>500 && mpdg<600) | |
2432 | { | |
2433 | fIsHFE1 = kTRUE; | |
2434 | fIsFromD = kFALSE; | |
2435 | fIsFromB = kTRUE; | |
2436 | return kTRUE; | |
2437 | } | |
2438 | else | |
2439 | { | |
2440 | fIsHFE1 = kFALSE; | |
2441 | fIsFromD = kFALSE; | |
2442 | fIsFromB = kFALSE; | |
2443 | return kFALSE; | |
2444 | } | |
2445 | } | |
2446 | } |