]>
Commit | Line | Data |
---|---|---|
e131b05f | 1 | // ************************************************************************* |
2 | // * * | |
3 | // * Task for ID Fragmentation Function Analysis * | |
4 | // * * | |
5 | // ************************************************************************* | |
6 | ||
7 | ||
8 | /************************************************************************** | |
9 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
10 | * * | |
11 | * Author: The ALICE Off-line Project. * | |
12 | * Contributors are mentioned in the code where appropriate. * | |
13 | * * | |
14 | * Permission to use, copy, modify and distribute this software and its * | |
15 | * documentation strictly for non-commercial purposes is hereby granted * | |
16 | * without fee, provided that the above copyright notice appears in all * | |
17 | * copies and that both the copyright notice and this permission notice * | |
18 | * appear in the supporting documentation. The authors make no claims * | |
19 | * about the suitability of this software for any purpose. It is * | |
20 | * provided "as is" without express or implied warranty. * | |
21 | **************************************************************************/ | |
22 | ||
23 | /* $Id: */ | |
24 | ||
25 | #include "TList.h" | |
26 | #include "TH1F.h" | |
27 | #include "TH2F.h" | |
28 | #include "TH3F.h" | |
29 | #include "TString.h" | |
30 | #include "THnSparse.h" | |
31 | #include "TProfile.h" | |
32 | #include "TFile.h" | |
33 | #include "TKey.h" | |
34 | #include "TRandom3.h" | |
35 | #include "TAxis.h" | |
36 | ||
37 | #include "AliAODInputHandler.h" | |
38 | #include "AliAODHandler.h" | |
39 | #include "AliESDEvent.h" | |
40 | #include "AliAODMCParticle.h" | |
41 | #include "AliAODJet.h" | |
42 | #include "AliAODJetEventBackground.h" | |
43 | #include "AliGenPythiaEventHeader.h" | |
44 | #include "AliGenHijingEventHeader.h" | |
45 | #include "AliInputEventHandler.h" | |
46 | ||
47 | #include "AliAnalysisHelperJetTasks.h" | |
48 | #include "AliAnalysisManager.h" | |
49 | #include "AliAnalysisTaskSE.h" | |
a2a9d6d2 | 50 | #include "AliAnalysisUtils.h" |
e131b05f | 51 | #include "AliVParticle.h" |
52 | #include "AliVEvent.h" | |
53 | ||
54 | #include "AliAnalysisTaskPID.h" | |
55 | #include "AliPIDResponse.h" | |
56 | ||
57 | #include "AliAnalysisTaskIDFragmentationFunction.h" | |
58 | using std::cout; | |
59 | using std::endl; | |
60 | using std::cerr; | |
61 | ||
62 | ClassImp(AliAnalysisTaskIDFragmentationFunction) | |
63 | ||
64 | //____________________________________________________________________________ | |
65 | AliAnalysisTaskIDFragmentationFunction::AliAnalysisTaskIDFragmentationFunction() | |
66 | : AliAnalysisTaskSE() | |
67 | ,fESD(0) | |
68 | ,fAOD(0) | |
69 | ,fAODJets(0) | |
70 | ,fAODExtension(0) | |
71 | ,fNonStdFile("") | |
72 | ,fBranchRecJets("jets") | |
73 | ,fBranchRecBckgClusters("") | |
74 | ,fBranchGenJets("") | |
75 | ,fBranchEmbeddedJets("") | |
76 | ,fTrackTypeGen(0) | |
77 | ,fJetTypeGen(0) | |
78 | ,fJetTypeRecEff(0) | |
79 | ,fUseAODInputJets(kTRUE) | |
80 | ,fFilterMask(0) | |
81 | ,fUsePhysicsSelection(kTRUE) | |
82 | ,fEvtSelectionMask(0) | |
83 | ,fEventClass(0) | |
84 | ,fMaxVertexZ(10) | |
85 | ,fTrackPtCut(0) | |
86 | ,fTrackEtaMin(0) | |
87 | ,fTrackEtaMax(0) | |
88 | ,fTrackPhiMin(0) | |
89 | ,fTrackPhiMax(0) | |
90 | ,fUseExtraTracks(0) | |
91 | ,fUseExtraTracksBgr(0) | |
92 | ,fCutFractionPtEmbedded(0) | |
93 | ,fUseEmbeddedJetAxis(0) | |
94 | ,fUseEmbeddedJetPt(0) | |
95 | ,fJetPtCut(0) | |
96 | ,fJetEtaMin(0) | |
97 | ,fJetEtaMax(0) | |
98 | ,fJetPhiMin(0) | |
99 | ,fJetPhiMax(0) | |
100 | ,fFFRadius(0) | |
101 | ,fFFMinLTrackPt(-1) | |
102 | ,fFFMaxTrackPt(-1) | |
103 | ,fFFMinnTracks(0) | |
104 | ,fFFBckgRadius(0) | |
105 | ,fBckgMode(0) | |
106 | ,fQAMode(0) | |
107 | ,fFFMode(0) | |
108 | ,fIDFFMode(0) | |
109 | ,fEffMode(0) | |
110 | ,fJSMode(0) | |
111 | ,fAvgTrials(0) | |
112 | ,fTracksRecCuts(0) | |
113 | ,fTracksRecCutsEfficiency(0) | |
114 | ,fTracksGen(0) | |
115 | ,fTracksAODMCCharged(0) | |
116 | ,fTracksAODMCChargedSecNS(0) | |
117 | ,fTracksAODMCChargedSecS(0) | |
118 | ,fTracksRecQualityCuts(0) | |
119 | ,fJetsRec(0) | |
120 | ,fJetsRecCuts(0) | |
121 | ,fJetsGen(0) | |
122 | ,fJetsRecEff(0) | |
123 | ,fJetsEmbedded(0) | |
124 | ,fBckgJetsRec(0) | |
125 | ,fBckgJetsRecCuts(0) | |
126 | ,fBckgJetsGen(0) | |
127 | ,fQATrackHistosRecCuts(0) | |
128 | ,fQATrackHistosGen(0) | |
129 | ,fQAJetHistosRec(0) | |
130 | ,fQAJetHistosRecCuts(0) | |
131 | ,fQAJetHistosRecCutsLeading(0) | |
132 | ,fQAJetHistosGen(0) | |
133 | ,fQAJetHistosGenLeading(0) | |
134 | ,fQAJetHistosRecEffLeading(0) | |
135 | ,fFFHistosRecCuts(0) | |
136 | ,fFFHistosRecCutsInc(0) | |
137 | ,fFFHistosRecLeadingTrack(0) | |
138 | ,fFFHistosGen(0) | |
139 | ,fFFHistosGenInc(0) | |
140 | ,fFFHistosGenLeadingTrack(0) | |
141 | ,fQATrackHighPtThreshold(0) | |
142 | ,fFFNBinsJetPt(0) | |
143 | ,fFFJetPtMin(0) | |
144 | ,fFFJetPtMax(0) | |
145 | ,fFFNBinsPt(0) | |
146 | ,fFFPtMin(0) | |
147 | ,fFFPtMax(0) | |
148 | ,fFFNBinsXi(0) | |
149 | ,fFFXiMin(0) | |
150 | ,fFFXiMax(0) | |
151 | ,fFFNBinsZ(0) | |
152 | ,fFFZMin(0) | |
153 | ,fFFZMax(0) | |
154 | ,fQAJetNBinsPt(0) | |
155 | ,fQAJetPtMin(0) | |
156 | ,fQAJetPtMax(0) | |
157 | ,fQAJetNBinsEta(0) | |
158 | ,fQAJetEtaMin(0) | |
159 | ,fQAJetEtaMax(0) | |
160 | ,fQAJetNBinsPhi(0) | |
161 | ,fQAJetPhiMin(0) | |
162 | ,fQAJetPhiMax(0) | |
163 | ,fQATrackNBinsPt(0) | |
164 | ,fQATrackPtMin(0) | |
165 | ,fQATrackPtMax(0) | |
166 | ,fQATrackNBinsEta(0) | |
167 | ,fQATrackEtaMin(0) | |
168 | ,fQATrackEtaMax(0) | |
169 | ,fQATrackNBinsPhi(0) | |
170 | ,fQATrackPhiMin(0) | |
171 | ,fQATrackPhiMax(0) | |
172 | ,fCommonHistList(0) | |
173 | ,fh1EvtSelection(0) | |
2b81de61 | 174 | ,fh1VtxSelection(0) |
e131b05f | 175 | ,fh1VertexNContributors(0) |
176 | ,fh1VertexZ(0) | |
177 | ,fh1EvtMult(0) | |
178 | ,fh1EvtCent(0) | |
179 | ,fh1Xsec(0) | |
180 | ,fh1Trials(0) | |
181 | ,fh1PtHard(0) | |
182 | ,fh1PtHardTrials(0) | |
183 | ,fh1nRecJetsCuts(0) | |
184 | ,fh1nGenJets(0) | |
185 | ,fh1nRecEffJets(0) | |
186 | ,fh1nEmbeddedJets(0) | |
187 | ,fh1nRecBckgJetsCuts(0) | |
188 | ,fh1nGenBckgJets(0) | |
189 | ,fh2PtRecVsGenPrim(0) | |
190 | ,fh2PtRecVsGenSec(0) | |
265e4931 | 191 | ,fhDCA_XY(0) |
192 | ,fhDCA_Z(0) | |
630a4bcd | 193 | ,fhJetPtRefMultEta5(0) |
194 | ,fhJetPtRefMultEta8(0) | |
a2a9d6d2 | 195 | ,fhJetPtMultPercent(0) |
e131b05f | 196 | ,fQATrackHistosRecEffGen(0) |
197 | ,fQATrackHistosRecEffRec(0) | |
198 | ,fQATrackHistosSecRecNS(0) | |
199 | ,fQATrackHistosSecRecS(0) | |
200 | ,fQATrackHistosSecRecSsc(0) | |
201 | ,fFFHistosRecEffRec(0) | |
202 | ,fFFHistosSecRecNS(0) | |
203 | ,fFFHistosSecRecS(0) | |
204 | ,fFFHistosSecRecSsc(0) | |
205 | // Background | |
206 | ,fh1BckgMult0(0) | |
207 | ,fh1BckgMult1(0) | |
208 | ,fh1BckgMult2(0) | |
209 | ,fh1BckgMult3(0) | |
210 | ,fh1BckgMult4(0) | |
211 | ,fh1FractionPtEmbedded(0) | |
212 | ,fh1IndexEmbedded(0) | |
213 | ,fh2DeltaPtVsJetPtEmbedded(0) | |
214 | ,fh2DeltaPtVsRecJetPtEmbedded(0) | |
215 | ,fh1DeltaREmbedded(0) | |
216 | ,fQABckgHisto0RecCuts(0) | |
217 | ,fQABckgHisto0Gen(0) | |
218 | ,fQABckgHisto1RecCuts(0) | |
219 | ,fQABckgHisto1Gen(0) | |
220 | ,fQABckgHisto2RecCuts(0) | |
221 | ,fQABckgHisto2Gen(0) | |
222 | ,fQABckgHisto3RecCuts(0) | |
223 | ,fQABckgHisto3Gen(0) | |
224 | ,fQABckgHisto4RecCuts(0) | |
225 | ,fQABckgHisto4Gen(0) | |
226 | ,fFFBckgHisto0RecCuts(0) | |
227 | ,fFFBckgHisto0Gen(0) | |
228 | ,fFFBckgHisto1RecCuts(0) | |
229 | ,fFFBckgHisto1Gen(0) | |
230 | ,fFFBckgHisto2RecCuts(0) | |
231 | ,fFFBckgHisto2Gen(0) | |
232 | ,fFFBckgHisto3RecCuts(0) | |
233 | ,fFFBckgHisto3Gen(0) | |
234 | ,fFFBckgHisto4RecCuts(0) | |
235 | ,fFFBckgHisto4Gen(0) | |
236 | ,fFFBckgHisto0RecEffRec(0) | |
237 | ,fFFBckgHisto0SecRecNS(0) | |
238 | ,fFFBckgHisto0SecRecS(0) | |
239 | ,fFFBckgHisto0SecRecSsc(0) | |
240 | // jet shape | |
241 | ,fProNtracksLeadingJet(0) | |
242 | ,fProDelR80pcPt(0) | |
243 | ,fProNtracksLeadingJetGen(0) | |
244 | ,fProDelR80pcPtGen(0) | |
245 | ,fProNtracksLeadingJetBgrPerp2(0) | |
246 | ,fProNtracksLeadingJetRecPrim(0) | |
247 | ,fProDelR80pcPtRecPrim(0) | |
248 | ,fProNtracksLeadingJetRecSecNS(0) | |
249 | ,fProNtracksLeadingJetRecSecS(0) | |
250 | ,fProNtracksLeadingJetRecSecSsc(0) | |
251 | ||
252 | ,fRandom(0) | |
253 | ||
c4856fb1 | 254 | ,fOnlyLeadingJets(kFALSE) |
255 | ||
a2a9d6d2 | 256 | ,fAnaUtils(0) |
257 | ||
e131b05f | 258 | // PID framework |
259 | ,fNumInclusivePIDtasks(0) | |
260 | ,fNumJetPIDtasks(0) | |
261 | ,fNameInclusivePIDtask(0x0) | |
262 | ,fNameJetPIDtask(0x0) | |
263 | ,fInclusivePIDtask(0x0) | |
264 | ,fJetPIDtask(0x0) | |
265 | ,fUseInclusivePIDtask(kFALSE) | |
266 | ,fUseJetPIDtask(kFALSE) | |
267 | ,fIsPP(kFALSE) | |
268 | { | |
269 | // default constructor | |
270 | fBckgType[0] = 0; | |
271 | fBckgType[1] = 0; | |
272 | fBckgType[2] = 0; | |
273 | fBckgType[3] = 0; | |
274 | fBckgType[4] = 0; | |
275 | ||
276 | for(Int_t ii=0; ii<5; ii++){ | |
277 | fProDelRPtSum[ii] = 0; | |
278 | fProDelRPtSumGen[ii] = 0; | |
279 | fProDelRPtSumBgrPerp2[ii] = 0; | |
280 | fProDelRPtSumRecPrim[ii] = 0; | |
281 | fProDelRPtSumRecSecNS[ii] = 0; | |
282 | fProDelRPtSumRecSecS[ii] = 0; | |
283 | fProDelRPtSumRecSecSsc[ii] = 0; | |
284 | } | |
285 | ||
286 | for (Int_t i = 0; i < AliPID::kSPECIES; i++) { | |
287 | fIDFFHistosRecCuts[i] = 0x0; | |
288 | fIDFFHistosGen[i] = 0x0; | |
265e4931 | 289 | |
290 | fhDCA_XY_prim_MCID[i] = 0x0; | |
291 | fhDCA_Z_prim_MCID[i] = 0x0; | |
292 | ||
293 | fhDCA_XY_sec_MCID[i] = 0x0; | |
294 | fhDCA_Z_sec_MCID[i] = 0x0; | |
e131b05f | 295 | } |
296 | } | |
297 | ||
298 | //_______________________________________________________________________________________________ | |
299 | AliAnalysisTaskIDFragmentationFunction::AliAnalysisTaskIDFragmentationFunction(const char *name) | |
300 | : AliAnalysisTaskSE(name) | |
301 | ,fESD(0) | |
302 | ,fAOD(0) | |
303 | ,fAODJets(0) | |
304 | ,fAODExtension(0) | |
305 | ,fNonStdFile("") | |
306 | ,fBranchRecJets("jets") | |
307 | ,fBranchRecBckgClusters("") | |
308 | ,fBranchGenJets("") | |
309 | ,fBranchEmbeddedJets("") | |
310 | ,fTrackTypeGen(0) | |
311 | ,fJetTypeGen(0) | |
312 | ,fJetTypeRecEff(0) | |
313 | ,fUseAODInputJets(kTRUE) | |
314 | ,fFilterMask(0) | |
315 | ,fUsePhysicsSelection(kTRUE) | |
316 | ,fEvtSelectionMask(0) | |
317 | ,fEventClass(0) | |
318 | ,fMaxVertexZ(10) | |
319 | ,fTrackPtCut(0) | |
320 | ,fTrackEtaMin(0) | |
321 | ,fTrackEtaMax(0) | |
322 | ,fTrackPhiMin(0) | |
323 | ,fTrackPhiMax(0) | |
324 | ,fUseExtraTracks(0) | |
325 | ,fUseExtraTracksBgr(0) | |
326 | ,fCutFractionPtEmbedded(0) | |
327 | ,fUseEmbeddedJetAxis(0) | |
328 | ,fUseEmbeddedJetPt(0) | |
329 | ,fJetPtCut(0) | |
330 | ,fJetEtaMin(0) | |
331 | ,fJetEtaMax(0) | |
332 | ,fJetPhiMin(0) | |
333 | ,fJetPhiMax(0) | |
334 | ,fFFRadius(0) | |
335 | ,fFFMinLTrackPt(-1) | |
336 | ,fFFMaxTrackPt(-1) | |
337 | ,fFFMinnTracks(0) | |
338 | ,fFFBckgRadius(0) | |
339 | ,fBckgMode(0) | |
340 | ,fQAMode(0) | |
341 | ,fFFMode(0) | |
342 | ,fIDFFMode(0) | |
343 | ,fEffMode(0) | |
344 | ,fJSMode(0) | |
345 | ,fAvgTrials(0) | |
346 | ,fTracksRecCuts(0) | |
347 | ,fTracksRecCutsEfficiency(0) | |
348 | ,fTracksGen(0) | |
349 | ,fTracksAODMCCharged(0) | |
350 | ,fTracksAODMCChargedSecNS(0) | |
351 | ,fTracksAODMCChargedSecS(0) | |
352 | ,fTracksRecQualityCuts(0) | |
353 | ,fJetsRec(0) | |
354 | ,fJetsRecCuts(0) | |
355 | ,fJetsGen(0) | |
356 | ,fJetsRecEff(0) | |
357 | ,fJetsEmbedded(0) | |
358 | ,fBckgJetsRec(0) | |
359 | ,fBckgJetsRecCuts(0) | |
360 | ,fBckgJetsGen(0) | |
361 | ,fQATrackHistosRecCuts(0) | |
362 | ,fQATrackHistosGen(0) | |
363 | ,fQAJetHistosRec(0) | |
364 | ,fQAJetHistosRecCuts(0) | |
365 | ,fQAJetHistosRecCutsLeading(0) | |
366 | ,fQAJetHistosGen(0) | |
367 | ,fQAJetHistosGenLeading(0) | |
368 | ,fQAJetHistosRecEffLeading(0) | |
369 | ,fFFHistosRecCuts(0) | |
370 | ,fFFHistosRecCutsInc(0) | |
371 | ,fFFHistosRecLeadingTrack(0) | |
372 | ,fFFHistosGen(0) | |
373 | ,fFFHistosGenInc(0) | |
374 | ,fFFHistosGenLeadingTrack(0) | |
375 | ,fQATrackHighPtThreshold(0) | |
376 | ,fFFNBinsJetPt(0) | |
377 | ,fFFJetPtMin(0) | |
378 | ,fFFJetPtMax(0) | |
379 | ,fFFNBinsPt(0) | |
380 | ,fFFPtMin(0) | |
381 | ,fFFPtMax(0) | |
382 | ,fFFNBinsXi(0) | |
383 | ,fFFXiMin(0) | |
384 | ,fFFXiMax(0) | |
385 | ,fFFNBinsZ(0) | |
386 | ,fFFZMin(0) | |
387 | ,fFFZMax(0) | |
388 | ,fQAJetNBinsPt(0) | |
389 | ,fQAJetPtMin(0) | |
390 | ,fQAJetPtMax(0) | |
391 | ,fQAJetNBinsEta(0) | |
392 | ,fQAJetEtaMin(0) | |
393 | ,fQAJetEtaMax(0) | |
394 | ,fQAJetNBinsPhi(0) | |
395 | ,fQAJetPhiMin(0) | |
396 | ,fQAJetPhiMax(0) | |
397 | ,fQATrackNBinsPt(0) | |
398 | ,fQATrackPtMin(0) | |
399 | ,fQATrackPtMax(0) | |
400 | ,fQATrackNBinsEta(0) | |
401 | ,fQATrackEtaMin(0) | |
402 | ,fQATrackEtaMax(0) | |
403 | ,fQATrackNBinsPhi(0) | |
404 | ,fQATrackPhiMin(0) | |
405 | ,fQATrackPhiMax(0) | |
406 | ,fCommonHistList(0) | |
407 | ,fh1EvtSelection(0) | |
2b81de61 | 408 | ,fh1VtxSelection(0) |
e131b05f | 409 | ,fh1VertexNContributors(0) |
410 | ,fh1VertexZ(0) | |
411 | ,fh1EvtMult(0) | |
412 | ,fh1EvtCent(0) | |
413 | ,fh1Xsec(0) | |
414 | ,fh1Trials(0) | |
415 | ,fh1PtHard(0) | |
416 | ,fh1PtHardTrials(0) | |
417 | ,fh1nRecJetsCuts(0) | |
418 | ,fh1nGenJets(0) | |
419 | ,fh1nRecEffJets(0) | |
420 | ,fh1nEmbeddedJets(0) | |
421 | ,fh1nRecBckgJetsCuts(0) | |
422 | ,fh1nGenBckgJets(0) | |
423 | ,fh2PtRecVsGenPrim(0) | |
424 | ,fh2PtRecVsGenSec(0) | |
265e4931 | 425 | ,fhDCA_XY(0) |
426 | ,fhDCA_Z(0) | |
630a4bcd | 427 | ,fhJetPtRefMultEta5(0) |
428 | ,fhJetPtRefMultEta8(0) | |
a2a9d6d2 | 429 | ,fhJetPtMultPercent(0) |
e131b05f | 430 | ,fQATrackHistosRecEffGen(0) |
431 | ,fQATrackHistosRecEffRec(0) | |
432 | ,fQATrackHistosSecRecNS(0) | |
433 | ,fQATrackHistosSecRecS(0) | |
434 | ,fQATrackHistosSecRecSsc(0) | |
435 | ,fFFHistosRecEffRec(0) | |
436 | ,fFFHistosSecRecNS(0) | |
437 | ,fFFHistosSecRecS(0) | |
438 | ,fFFHistosSecRecSsc(0) | |
439 | // Background | |
440 | ,fh1BckgMult0(0) | |
441 | ,fh1BckgMult1(0) | |
442 | ,fh1BckgMult2(0) | |
443 | ,fh1BckgMult3(0) | |
444 | ,fh1BckgMult4(0) | |
445 | ,fh1FractionPtEmbedded(0) | |
446 | ,fh1IndexEmbedded(0) | |
447 | ,fh2DeltaPtVsJetPtEmbedded(0) | |
448 | ,fh2DeltaPtVsRecJetPtEmbedded(0) | |
449 | ,fh1DeltaREmbedded(0) | |
450 | ,fQABckgHisto0RecCuts(0) | |
451 | ,fQABckgHisto0Gen(0) | |
452 | ,fQABckgHisto1RecCuts(0) | |
453 | ,fQABckgHisto1Gen(0) | |
454 | ,fQABckgHisto2RecCuts(0) | |
455 | ,fQABckgHisto2Gen(0) | |
456 | ,fQABckgHisto3RecCuts(0) | |
457 | ,fQABckgHisto3Gen(0) | |
458 | ,fQABckgHisto4RecCuts(0) | |
459 | ,fQABckgHisto4Gen(0) | |
460 | ,fFFBckgHisto0RecCuts(0) | |
461 | ,fFFBckgHisto0Gen(0) | |
462 | ,fFFBckgHisto1RecCuts(0) | |
463 | ,fFFBckgHisto1Gen(0) | |
464 | ,fFFBckgHisto2RecCuts(0) | |
465 | ,fFFBckgHisto2Gen(0) | |
466 | ,fFFBckgHisto3RecCuts(0) | |
467 | ,fFFBckgHisto3Gen(0) | |
468 | ,fFFBckgHisto4RecCuts(0) | |
469 | ,fFFBckgHisto4Gen(0) | |
470 | ,fFFBckgHisto0RecEffRec(0) | |
471 | ,fFFBckgHisto0SecRecNS(0) | |
472 | ,fFFBckgHisto0SecRecS(0) | |
473 | ,fFFBckgHisto0SecRecSsc(0) | |
474 | // jet shape | |
475 | ,fProNtracksLeadingJet(0) | |
476 | ,fProDelR80pcPt(0) | |
477 | ,fProNtracksLeadingJetGen(0) | |
478 | ,fProDelR80pcPtGen(0) | |
479 | ,fProNtracksLeadingJetBgrPerp2(0) | |
480 | ,fProNtracksLeadingJetRecPrim(0) | |
481 | ,fProDelR80pcPtRecPrim(0) | |
482 | ,fProNtracksLeadingJetRecSecNS(0) | |
483 | ,fProNtracksLeadingJetRecSecS(0) | |
484 | ,fProNtracksLeadingJetRecSecSsc(0) | |
485 | ,fRandom(0) | |
c4856fb1 | 486 | ,fOnlyLeadingJets(kFALSE) |
a2a9d6d2 | 487 | ,fAnaUtils(0) |
e131b05f | 488 | // PID framework |
489 | ,fNumInclusivePIDtasks(0) | |
490 | ,fNumJetPIDtasks(0) | |
491 | ,fNameInclusivePIDtask(0x0) | |
492 | ,fNameJetPIDtask(0x0) | |
493 | ,fInclusivePIDtask(0x0) | |
494 | ,fJetPIDtask(0x0) | |
495 | ,fUseInclusivePIDtask(kFALSE) | |
496 | ,fUseJetPIDtask(kFALSE) | |
497 | ,fIsPP(kFALSE) | |
498 | { | |
499 | // constructor | |
500 | fBckgType[0] = 0; | |
501 | fBckgType[1] = 0; | |
502 | fBckgType[2] = 0; | |
503 | fBckgType[3] = 0; | |
504 | fBckgType[4] = 0; | |
505 | ||
506 | for(Int_t ii=0; ii<5; ii++){ | |
507 | fProDelRPtSum[ii] = 0; | |
508 | fProDelRPtSumGen[ii] = 0; | |
509 | fProDelRPtSumBgrPerp2[ii] = 0; | |
510 | fProDelRPtSumRecPrim[ii] = 0; | |
511 | fProDelRPtSumRecSecNS[ii] = 0; | |
512 | fProDelRPtSumRecSecS[ii] = 0; | |
513 | fProDelRPtSumRecSecSsc[ii] = 0; | |
514 | } | |
515 | ||
516 | for (Int_t i = 0; i < AliPID::kSPECIES; i++) { | |
517 | fIDFFHistosRecCuts[i] = 0x0; | |
518 | fIDFFHistosGen[i] = 0x0; | |
265e4931 | 519 | |
520 | fhDCA_XY_prim_MCID[i] = 0x0; | |
521 | fhDCA_Z_prim_MCID[i] = 0x0; | |
522 | ||
523 | fhDCA_XY_sec_MCID[i] = 0x0; | |
524 | fhDCA_Z_sec_MCID[i] = 0x0; | |
e131b05f | 525 | } |
526 | ||
527 | DefineOutput(1,TList::Class()); | |
528 | } | |
529 | ||
530 | //__________________________________________________________________________________________________________________________ | |
531 | AliAnalysisTaskIDFragmentationFunction::AliAnalysisTaskIDFragmentationFunction(const AliAnalysisTaskIDFragmentationFunction ©) | |
532 | : AliAnalysisTaskSE() | |
533 | ,fESD(copy.fESD) | |
534 | ,fAOD(copy.fAOD) | |
535 | ,fAODJets(copy.fAODJets) | |
536 | ,fAODExtension(copy.fAODExtension) | |
537 | ,fNonStdFile(copy.fNonStdFile) | |
538 | ,fBranchRecJets(copy.fBranchRecJets) | |
539 | ,fBranchRecBckgClusters(copy.fBranchRecBckgClusters) | |
540 | ,fBranchGenJets(copy.fBranchGenJets) | |
541 | ,fBranchEmbeddedJets(copy.fBranchEmbeddedJets) | |
542 | ,fTrackTypeGen(copy.fTrackTypeGen) | |
543 | ,fJetTypeGen(copy.fJetTypeGen) | |
544 | ,fJetTypeRecEff(copy.fJetTypeRecEff) | |
545 | ,fUseAODInputJets(copy.fUseAODInputJets) | |
546 | ,fFilterMask(copy.fFilterMask) | |
547 | ,fUsePhysicsSelection(copy.fUsePhysicsSelection) | |
548 | ,fEvtSelectionMask(copy.fEvtSelectionMask) | |
549 | ,fEventClass(copy.fEventClass) | |
550 | ,fMaxVertexZ(copy.fMaxVertexZ) | |
551 | ,fTrackPtCut(copy.fTrackPtCut) | |
552 | ,fTrackEtaMin(copy.fTrackEtaMin) | |
553 | ,fTrackEtaMax(copy.fTrackEtaMax) | |
554 | ,fTrackPhiMin(copy.fTrackPhiMin) | |
555 | ,fTrackPhiMax(copy.fTrackPhiMax) | |
556 | ,fUseExtraTracks(copy.fUseExtraTracks) | |
557 | ,fUseExtraTracksBgr(copy.fUseExtraTracksBgr) | |
558 | ,fCutFractionPtEmbedded(copy.fCutFractionPtEmbedded) | |
559 | ,fUseEmbeddedJetAxis(copy.fUseEmbeddedJetAxis) | |
560 | ,fUseEmbeddedJetPt(copy.fUseEmbeddedJetPt) | |
561 | ,fJetPtCut(copy.fJetPtCut) | |
562 | ,fJetEtaMin(copy.fJetEtaMin) | |
563 | ,fJetEtaMax(copy.fJetEtaMax) | |
564 | ,fJetPhiMin(copy.fJetPhiMin) | |
565 | ,fJetPhiMax(copy.fJetPhiMax) | |
566 | ,fFFRadius(copy.fFFRadius) | |
567 | ,fFFMinLTrackPt(copy.fFFMinLTrackPt) | |
568 | ,fFFMaxTrackPt(copy.fFFMaxTrackPt) | |
569 | ,fFFMinnTracks(copy.fFFMinnTracks) | |
570 | ,fFFBckgRadius(copy.fFFBckgRadius) | |
571 | ,fBckgMode(copy.fBckgMode) | |
572 | ,fQAMode(copy.fQAMode) | |
573 | ,fFFMode(copy.fFFMode) | |
574 | ,fIDFFMode(copy.fIDFFMode) | |
575 | ,fEffMode(copy.fEffMode) | |
576 | ,fJSMode(copy.fJSMode) | |
577 | ,fAvgTrials(copy.fAvgTrials) | |
578 | ,fTracksRecCuts(copy.fTracksRecCuts) | |
579 | ,fTracksRecCutsEfficiency(copy.fTracksRecCutsEfficiency) | |
580 | ,fTracksGen(copy.fTracksGen) | |
581 | ,fTracksAODMCCharged(copy.fTracksAODMCCharged) | |
582 | ,fTracksAODMCChargedSecNS(copy.fTracksAODMCChargedSecNS) | |
583 | ,fTracksAODMCChargedSecS(copy.fTracksAODMCChargedSecS) | |
584 | ,fTracksRecQualityCuts(copy.fTracksRecQualityCuts) | |
585 | ,fJetsRec(copy.fJetsRec) | |
586 | ,fJetsRecCuts(copy.fJetsRecCuts) | |
587 | ,fJetsGen(copy.fJetsGen) | |
588 | ,fJetsRecEff(copy.fJetsRecEff) | |
589 | ,fJetsEmbedded(copy.fJetsEmbedded) | |
590 | ,fBckgJetsRec(copy.fBckgJetsRec) | |
591 | ,fBckgJetsRecCuts(copy.fBckgJetsRecCuts) | |
592 | ,fBckgJetsGen(copy.fBckgJetsGen) | |
593 | ,fQATrackHistosRecCuts(copy.fQATrackHistosRecCuts) | |
594 | ,fQATrackHistosGen(copy.fQATrackHistosGen) | |
595 | ,fQAJetHistosRec(copy.fQAJetHistosRec) | |
596 | ,fQAJetHistosRecCuts(copy.fQAJetHistosRecCuts) | |
597 | ,fQAJetHistosRecCutsLeading(copy.fQAJetHistosRecCutsLeading) | |
598 | ,fQAJetHistosGen(copy.fQAJetHistosGen) | |
599 | ,fQAJetHistosGenLeading(copy.fQAJetHistosGenLeading) | |
600 | ,fQAJetHistosRecEffLeading(copy.fQAJetHistosRecEffLeading) | |
601 | ,fFFHistosRecCuts(copy.fFFHistosRecCuts) | |
602 | ,fFFHistosRecCutsInc(copy.fFFHistosRecCutsInc) | |
603 | ,fFFHistosRecLeadingTrack(copy.fFFHistosRecLeadingTrack) | |
604 | ,fFFHistosGen(copy.fFFHistosGen) | |
605 | ,fFFHistosGenInc(copy.fFFHistosGenInc) | |
606 | ,fFFHistosGenLeadingTrack(copy.fFFHistosGenLeadingTrack) | |
607 | ,fQATrackHighPtThreshold(copy.fQATrackHighPtThreshold) | |
608 | ,fFFNBinsJetPt(copy.fFFNBinsJetPt) | |
609 | ,fFFJetPtMin(copy.fFFJetPtMin) | |
610 | ,fFFJetPtMax(copy.fFFJetPtMax) | |
611 | ,fFFNBinsPt(copy.fFFNBinsPt) | |
612 | ,fFFPtMin(copy.fFFPtMin) | |
613 | ,fFFPtMax(copy.fFFPtMax) | |
614 | ,fFFNBinsXi(copy.fFFNBinsXi) | |
615 | ,fFFXiMin(copy.fFFXiMin) | |
616 | ,fFFXiMax(copy.fFFXiMax) | |
617 | ,fFFNBinsZ(copy.fFFNBinsZ) | |
618 | ,fFFZMin(copy.fFFZMin) | |
619 | ,fFFZMax(copy.fFFZMax) | |
620 | ,fQAJetNBinsPt(copy.fQAJetNBinsPt) | |
621 | ,fQAJetPtMin(copy.fQAJetPtMin) | |
622 | ,fQAJetPtMax(copy.fQAJetPtMax) | |
623 | ,fQAJetNBinsEta(copy.fQAJetNBinsEta) | |
624 | ,fQAJetEtaMin(copy.fQAJetEtaMin) | |
625 | ,fQAJetEtaMax(copy.fQAJetEtaMax) | |
626 | ,fQAJetNBinsPhi(copy.fQAJetNBinsPhi) | |
627 | ,fQAJetPhiMin(copy.fQAJetPhiMin) | |
628 | ,fQAJetPhiMax(copy.fQAJetPhiMax) | |
629 | ,fQATrackNBinsPt(copy.fQATrackNBinsPt) | |
630 | ,fQATrackPtMin(copy.fQATrackPtMin) | |
631 | ,fQATrackPtMax(copy.fQATrackPtMax) | |
632 | ,fQATrackNBinsEta(copy.fQATrackNBinsEta) | |
633 | ,fQATrackEtaMin(copy.fQATrackEtaMin) | |
634 | ,fQATrackEtaMax(copy.fQATrackEtaMax) | |
635 | ,fQATrackNBinsPhi(copy.fQATrackNBinsPhi) | |
636 | ,fQATrackPhiMin(copy.fQATrackPhiMin) | |
637 | ,fQATrackPhiMax(copy.fQATrackPhiMax) | |
638 | ,fCommonHistList(copy.fCommonHistList) | |
639 | ,fh1EvtSelection(copy.fh1EvtSelection) | |
2b81de61 | 640 | ,fh1VtxSelection(copy.fh1VtxSelection) |
e131b05f | 641 | ,fh1VertexNContributors(copy.fh1VertexNContributors) |
642 | ,fh1VertexZ(copy.fh1VertexZ) | |
643 | ,fh1EvtMult(copy.fh1EvtMult) | |
644 | ,fh1EvtCent(copy.fh1EvtCent) | |
645 | ,fh1Xsec(copy.fh1Xsec) | |
646 | ,fh1Trials(copy.fh1Trials) | |
647 | ,fh1PtHard(copy.fh1PtHard) | |
648 | ,fh1PtHardTrials(copy.fh1PtHardTrials) | |
649 | ,fh1nRecJetsCuts(copy.fh1nRecJetsCuts) | |
650 | ,fh1nGenJets(copy.fh1nGenJets) | |
651 | ,fh1nRecEffJets(copy.fh1nRecEffJets) | |
652 | ,fh1nEmbeddedJets(copy.fh1nEmbeddedJets) | |
653 | ,fh1nRecBckgJetsCuts(copy.fh1nRecBckgJetsCuts) | |
654 | ,fh1nGenBckgJets(copy.fh1nGenBckgJets) | |
655 | ,fh2PtRecVsGenPrim(copy.fh2PtRecVsGenPrim) | |
656 | ,fh2PtRecVsGenSec(copy.fh2PtRecVsGenSec) | |
265e4931 | 657 | ,fhDCA_XY(copy.fhDCA_XY) |
658 | ,fhDCA_Z(copy.fhDCA_Z) | |
630a4bcd | 659 | ,fhJetPtRefMultEta5(copy.fhJetPtRefMultEta5) |
660 | ,fhJetPtRefMultEta8(copy.fhJetPtRefMultEta8) | |
a2a9d6d2 | 661 | ,fhJetPtMultPercent(copy.fhJetPtMultPercent) |
e131b05f | 662 | ,fQATrackHistosRecEffGen(copy.fQATrackHistosRecEffGen) |
663 | ,fQATrackHistosRecEffRec(copy.fQATrackHistosRecEffRec) | |
664 | ,fQATrackHistosSecRecNS(copy.fQATrackHistosSecRecNS) | |
665 | ,fQATrackHistosSecRecS(copy.fQATrackHistosSecRecS) | |
666 | ,fQATrackHistosSecRecSsc(copy.fQATrackHistosSecRecSsc) | |
667 | ,fFFHistosRecEffRec(copy.fFFHistosRecEffRec) | |
668 | ,fFFHistosSecRecNS(copy.fFFHistosSecRecNS) | |
669 | ,fFFHistosSecRecS(copy.fFFHistosSecRecS) | |
670 | ,fFFHistosSecRecSsc(copy.fFFHistosSecRecSsc) | |
671 | // Background | |
672 | ,fh1BckgMult0(copy.fh1BckgMult0) | |
673 | ,fh1BckgMult1(copy.fh1BckgMult1) | |
674 | ,fh1BckgMult2(copy.fh1BckgMult2) | |
675 | ,fh1BckgMult3(copy.fh1BckgMult3) | |
676 | ,fh1BckgMult4(copy.fh1BckgMult4) | |
677 | ,fh1FractionPtEmbedded(copy.fh1FractionPtEmbedded) | |
678 | ,fh1IndexEmbedded(copy.fh1IndexEmbedded) | |
679 | ,fh2DeltaPtVsJetPtEmbedded(copy.fh2DeltaPtVsJetPtEmbedded) | |
680 | ,fh2DeltaPtVsRecJetPtEmbedded(copy.fh2DeltaPtVsRecJetPtEmbedded) | |
681 | ,fh1DeltaREmbedded(copy.fh1DeltaREmbedded) | |
682 | ,fQABckgHisto0RecCuts(copy.fQABckgHisto0RecCuts) | |
683 | ,fQABckgHisto0Gen(copy.fQABckgHisto0Gen) | |
684 | ,fQABckgHisto1RecCuts(copy.fQABckgHisto1RecCuts) | |
685 | ,fQABckgHisto1Gen(copy.fQABckgHisto1Gen) | |
686 | ,fQABckgHisto2RecCuts(copy.fQABckgHisto2RecCuts) | |
687 | ,fQABckgHisto2Gen(copy.fQABckgHisto2Gen) | |
688 | ,fQABckgHisto3RecCuts(copy.fQABckgHisto3RecCuts) | |
689 | ,fQABckgHisto3Gen(copy.fQABckgHisto3Gen) | |
690 | ,fQABckgHisto4RecCuts(copy.fQABckgHisto4RecCuts) | |
691 | ,fQABckgHisto4Gen(copy.fQABckgHisto4Gen) | |
692 | ,fFFBckgHisto0RecCuts(copy.fFFBckgHisto0RecCuts) | |
693 | ,fFFBckgHisto0Gen(copy.fFFBckgHisto0Gen) | |
694 | ,fFFBckgHisto1RecCuts(copy.fFFBckgHisto1RecCuts) | |
695 | ,fFFBckgHisto1Gen(copy.fFFBckgHisto1Gen) | |
696 | ,fFFBckgHisto2RecCuts(copy.fFFBckgHisto2RecCuts) | |
697 | ,fFFBckgHisto2Gen(copy.fFFBckgHisto2Gen) | |
698 | ,fFFBckgHisto3RecCuts(copy.fFFBckgHisto3RecCuts) | |
699 | ,fFFBckgHisto3Gen(copy.fFFBckgHisto3Gen) | |
700 | ,fFFBckgHisto4RecCuts(copy.fFFBckgHisto4RecCuts) | |
701 | ,fFFBckgHisto4Gen(copy.fFFBckgHisto4Gen) | |
702 | ,fFFBckgHisto0RecEffRec(copy.fFFBckgHisto0RecEffRec) | |
703 | ,fFFBckgHisto0SecRecNS(copy.fFFBckgHisto0SecRecNS) | |
704 | ,fFFBckgHisto0SecRecS(copy.fFFBckgHisto0SecRecS) | |
705 | ,fFFBckgHisto0SecRecSsc(copy.fFFBckgHisto0SecRecSsc) | |
706 | // jet shape | |
707 | ,fProNtracksLeadingJet(copy.fProNtracksLeadingJet) | |
708 | ,fProDelR80pcPt(copy.fProDelR80pcPt) | |
709 | ,fProNtracksLeadingJetGen(copy.fProNtracksLeadingJetGen) | |
710 | ,fProDelR80pcPtGen(copy.fProDelR80pcPtGen) | |
711 | ,fProNtracksLeadingJetBgrPerp2(copy.fProNtracksLeadingJetBgrPerp2) | |
712 | ,fProNtracksLeadingJetRecPrim(copy.fProNtracksLeadingJetRecPrim) | |
713 | ,fProDelR80pcPtRecPrim(copy.fProDelR80pcPtRecPrim) | |
714 | ,fProNtracksLeadingJetRecSecNS(copy.fProNtracksLeadingJetRecSecNS) | |
715 | ,fProNtracksLeadingJetRecSecS(copy.fProNtracksLeadingJetRecSecS) | |
716 | ,fProNtracksLeadingJetRecSecSsc(copy.fProNtracksLeadingJetRecSecSsc) | |
717 | ,fRandom(copy.fRandom) | |
c4856fb1 | 718 | ,fOnlyLeadingJets(copy.fOnlyLeadingJets) |
a2a9d6d2 | 719 | ,fAnaUtils(copy.fAnaUtils) |
e131b05f | 720 | // PID framework |
721 | ,fNumInclusivePIDtasks(copy.fNumInclusivePIDtasks) | |
722 | ,fNumJetPIDtasks(copy.fNumJetPIDtasks) | |
723 | ,fNameInclusivePIDtask(0x0) | |
724 | ,fNameJetPIDtask(0x0) | |
725 | ,fInclusivePIDtask(0x0) | |
726 | ,fJetPIDtask(0x0) | |
727 | ,fUseInclusivePIDtask(copy.fUseInclusivePIDtask) | |
728 | ,fUseJetPIDtask(copy.fUseJetPIDtask) | |
729 | ,fIsPP(copy.fIsPP) | |
730 | { | |
731 | // copy constructor | |
732 | fBckgType[0] = copy.fBckgType[0]; | |
733 | fBckgType[1] = copy.fBckgType[1]; | |
734 | fBckgType[2] = copy.fBckgType[2]; | |
735 | fBckgType[3] = copy.fBckgType[3]; | |
736 | fBckgType[4] = copy.fBckgType[4]; | |
737 | ||
738 | ||
739 | for(Int_t ii=0; ii<5; ii++){ | |
740 | fProDelRPtSum[ii] = copy.fProDelRPtSum[ii]; | |
741 | fProDelRPtSumGen[ii] = copy.fProDelRPtSumGen[ii]; | |
742 | fProDelRPtSumBgrPerp2[ii] = copy.fProDelRPtSumBgrPerp2[ii]; | |
743 | fProDelRPtSumRecPrim[ii] = copy.fProDelRPtSumRecPrim[ii]; | |
744 | fProDelRPtSumRecSecNS[ii] = copy.fProDelRPtSumRecSecNS[ii]; | |
745 | fProDelRPtSumRecSecS[ii] = copy.fProDelRPtSumRecSecS[ii]; | |
746 | fProDelRPtSumRecSecSsc[ii] = copy.fProDelRPtSumRecSecSsc[ii]; | |
747 | } | |
748 | ||
749 | for (Int_t i = 0; i < AliPID::kSPECIES; i++) { | |
750 | fIDFFHistosRecCuts[i] = 0x0; | |
751 | if (copy.fIDFFHistosRecCuts[i]) | |
752 | fIDFFHistosRecCuts[i] = copy.fIDFFHistosRecCuts[i]; | |
753 | ||
754 | fIDFFHistosGen[i] = 0x0; | |
755 | if (copy.fIDFFHistosGen[i]) | |
756 | fIDFFHistosGen[i] = copy.fIDFFHistosGen[i]; | |
265e4931 | 757 | |
758 | ||
759 | fhDCA_XY_prim_MCID[i] = 0x0; | |
760 | if (copy.fhDCA_XY_prim_MCID[i]) | |
761 | fhDCA_XY_prim_MCID[i] = copy.fhDCA_XY_prim_MCID[i]; | |
762 | ||
763 | fhDCA_Z_prim_MCID[i] = 0x0; | |
764 | if (copy.fhDCA_Z_prim_MCID[i]) | |
765 | fhDCA_Z_prim_MCID[i] = copy.fhDCA_Z_prim_MCID[i]; | |
766 | ||
767 | fhDCA_XY_sec_MCID[i] = 0x0; | |
768 | if (copy.fhDCA_XY_sec_MCID[i]) | |
769 | fhDCA_XY_sec_MCID[i] = copy.fhDCA_XY_sec_MCID[i]; | |
770 | ||
771 | fhDCA_Z_sec_MCID[i] = 0x0; | |
772 | if (copy.fhDCA_Z_sec_MCID[i]) | |
773 | fhDCA_Z_sec_MCID[i] = copy.fhDCA_Z_sec_MCID[i]; | |
e131b05f | 774 | } |
775 | ||
776 | if (fNumInclusivePIDtasks > 0) { | |
777 | fNameInclusivePIDtask = new TString[fNumInclusivePIDtasks]; | |
778 | fInclusivePIDtask = new AliAnalysisTaskPID*[fNumInclusivePIDtasks]; | |
779 | ||
780 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
781 | fNameInclusivePIDtask[i] = ""; | |
782 | fInclusivePIDtask[i] = 0x0; | |
783 | ||
784 | if (copy.fNameInclusivePIDtask[i]) | |
785 | fNameInclusivePIDtask[i] = copy.fNameInclusivePIDtask[i]; | |
786 | ||
787 | if (copy.fInclusivePIDtask[i]) | |
788 | fInclusivePIDtask[i] = copy.fInclusivePIDtask[i]; | |
789 | } | |
790 | } | |
791 | ||
792 | if (fNumJetPIDtasks > 0) { | |
793 | fNameJetPIDtask = new TString[fNumJetPIDtasks]; | |
794 | fJetPIDtask = new AliAnalysisTaskPID*[fNumJetPIDtasks]; | |
795 | ||
796 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
797 | fNameJetPIDtask[i] = ""; | |
798 | fJetPIDtask[i] = 0x0; | |
799 | ||
800 | if (copy.fNameJetPIDtask[i]) | |
801 | fNameJetPIDtask[i] = copy.fNameJetPIDtask[i]; | |
802 | ||
803 | if (copy.fJetPIDtask[i]) | |
804 | fJetPIDtask[i] = copy.fJetPIDtask[i]; | |
805 | } | |
806 | } | |
807 | } | |
808 | ||
809 | // _________________________________________________________________________________________________________________________________ | |
810 | AliAnalysisTaskIDFragmentationFunction& AliAnalysisTaskIDFragmentationFunction::operator=(const AliAnalysisTaskIDFragmentationFunction& o) | |
811 | { | |
812 | // assignment | |
813 | ||
814 | if(this!=&o){ | |
815 | ||
816 | AliAnalysisTaskSE::operator=(o); | |
817 | fESD = o.fESD; | |
818 | fAOD = o.fAOD; | |
819 | fAODJets = o.fAODJets; | |
820 | fAODExtension = o.fAODExtension; | |
821 | fNonStdFile = o.fNonStdFile; | |
822 | fBranchRecJets = o.fBranchRecJets; | |
823 | fBranchRecBckgClusters = o.fBranchRecBckgClusters; | |
824 | fBranchGenJets = o.fBranchGenJets; | |
825 | fBranchEmbeddedJets = o.fBranchEmbeddedJets; | |
826 | fTrackTypeGen = o.fTrackTypeGen; | |
827 | fJetTypeGen = o.fJetTypeGen; | |
828 | fJetTypeRecEff = o.fJetTypeRecEff; | |
829 | fUseAODInputJets = o.fUseAODInputJets; | |
830 | fFilterMask = o.fFilterMask; | |
831 | fUsePhysicsSelection = o.fUsePhysicsSelection; | |
832 | fEvtSelectionMask = o.fEvtSelectionMask; | |
833 | fEventClass = o.fEventClass; | |
834 | fMaxVertexZ = o.fMaxVertexZ; | |
835 | fTrackPtCut = o.fTrackPtCut; | |
836 | fTrackEtaMin = o.fTrackEtaMin; | |
837 | fTrackEtaMax = o.fTrackEtaMax; | |
838 | fTrackPhiMin = o.fTrackPhiMin; | |
839 | fTrackPhiMax = o.fTrackPhiMax; | |
840 | fUseExtraTracks = o.fUseExtraTracks; | |
841 | fUseExtraTracksBgr = o.fUseExtraTracksBgr; | |
842 | fCutFractionPtEmbedded = o.fCutFractionPtEmbedded; | |
843 | fUseEmbeddedJetAxis = o.fUseEmbeddedJetAxis; | |
844 | fUseEmbeddedJetPt = o.fUseEmbeddedJetPt; | |
845 | fJetPtCut = o.fJetPtCut; | |
846 | fJetEtaMin = o.fJetEtaMin; | |
847 | fJetEtaMax = o.fJetEtaMax; | |
848 | fJetPhiMin = o.fJetPhiMin; | |
849 | fJetPhiMax = o.fJetPhiMin; | |
850 | fFFRadius = o.fFFRadius; | |
851 | fFFMinLTrackPt = o.fFFMinLTrackPt; | |
852 | fFFMaxTrackPt = o.fFFMaxTrackPt; | |
853 | fFFMinnTracks = o.fFFMinnTracks; | |
854 | fFFBckgRadius = o.fFFBckgRadius; | |
855 | fBckgMode = o.fBckgMode; | |
856 | fQAMode = o.fQAMode; | |
857 | fFFMode = o.fFFMode; | |
858 | fIDFFMode = o.fIDFFMode; | |
859 | fEffMode = o.fEffMode; | |
860 | fJSMode = o.fJSMode; | |
861 | fBckgType[0] = o.fBckgType[0]; | |
862 | fBckgType[1] = o.fBckgType[1]; | |
863 | fBckgType[2] = o.fBckgType[2]; | |
864 | fBckgType[3] = o.fBckgType[3]; | |
865 | fBckgType[4] = o.fBckgType[4]; | |
866 | fAvgTrials = o.fAvgTrials; | |
867 | fTracksRecCuts = o.fTracksRecCuts; | |
868 | fTracksRecCutsEfficiency = o.fTracksRecCutsEfficiency; | |
869 | fTracksGen = o.fTracksGen; | |
870 | fTracksAODMCCharged = o.fTracksAODMCCharged; | |
871 | fTracksAODMCChargedSecNS = o.fTracksAODMCChargedSecNS; | |
872 | fTracksAODMCChargedSecS = o.fTracksAODMCChargedSecS; | |
873 | fTracksRecQualityCuts = o.fTracksRecQualityCuts; | |
874 | fJetsRec = o.fJetsRec; | |
875 | fJetsRecCuts = o.fJetsRecCuts; | |
876 | fJetsGen = o.fJetsGen; | |
877 | fJetsRecEff = o.fJetsRecEff; | |
878 | fJetsEmbedded = o.fJetsEmbedded; | |
879 | fBckgJetsRec = o.fBckgJetsRec; | |
880 | fBckgJetsRecCuts = o.fBckgJetsRecCuts; | |
881 | fBckgJetsGen = o.fBckgJetsGen; | |
882 | fQATrackHistosRecCuts = o.fQATrackHistosRecCuts; | |
883 | fQATrackHistosGen = o.fQATrackHistosGen; | |
884 | fQAJetHistosRec = o.fQAJetHistosRec; | |
885 | fQAJetHistosRecCuts = o.fQAJetHistosRecCuts; | |
886 | fQAJetHistosRecCutsLeading = o.fQAJetHistosRecCutsLeading; | |
887 | fQAJetHistosGen = o.fQAJetHistosGen; | |
888 | fQAJetHistosGenLeading = o.fQAJetHistosGenLeading; | |
889 | fQAJetHistosRecEffLeading = o.fQAJetHistosRecEffLeading; | |
890 | fFFHistosRecCuts = o.fFFHistosRecCuts; | |
891 | fFFHistosRecCutsInc = o.fFFHistosRecCutsInc; | |
892 | fFFHistosRecLeadingTrack = o.fFFHistosRecLeadingTrack; | |
893 | fFFHistosGen = o.fFFHistosGen; | |
894 | fFFHistosGenInc = o.fFFHistosGenInc; | |
895 | fFFHistosGenLeadingTrack = o.fFFHistosGenLeadingTrack; | |
896 | fQATrackHighPtThreshold = o.fQATrackHighPtThreshold; | |
897 | fFFNBinsJetPt = o.fFFNBinsJetPt; | |
898 | fFFJetPtMin = o.fFFJetPtMin; | |
899 | fFFJetPtMax = o.fFFJetPtMax; | |
900 | fFFNBinsPt = o.fFFNBinsPt; | |
901 | fFFPtMin = o.fFFPtMin; | |
902 | fFFPtMax = o.fFFPtMax; | |
903 | fFFNBinsXi = o.fFFNBinsXi; | |
904 | fFFXiMin = o.fFFXiMin; | |
905 | fFFXiMax = o.fFFXiMax; | |
906 | fFFNBinsZ = o.fFFNBinsZ; | |
907 | fFFZMin = o.fFFZMin; | |
908 | fFFZMax = o.fFFZMax; | |
909 | fQAJetNBinsPt = o.fQAJetNBinsPt; | |
910 | fQAJetPtMin = o.fQAJetPtMin; | |
911 | fQAJetPtMax = o.fQAJetPtMax; | |
912 | fQAJetNBinsEta = o.fQAJetNBinsEta; | |
913 | fQAJetEtaMin = o.fQAJetEtaMin; | |
914 | fQAJetEtaMax = o.fQAJetEtaMax; | |
915 | fQAJetNBinsPhi = o.fQAJetNBinsPhi; | |
916 | fQAJetPhiMin = o.fQAJetPhiMin; | |
917 | fQAJetPhiMax = o.fQAJetPhiMax; | |
918 | fQATrackNBinsPt = o.fQATrackNBinsPt; | |
919 | fQATrackPtMin = o.fQATrackPtMin; | |
920 | fQATrackPtMax = o.fQATrackPtMax; | |
921 | fQATrackNBinsEta = o.fQATrackNBinsEta; | |
922 | fQATrackEtaMin = o.fQATrackEtaMin; | |
923 | fQATrackEtaMax = o.fQATrackEtaMax; | |
924 | fQATrackNBinsPhi = o.fQATrackNBinsPhi; | |
925 | fQATrackPhiMin = o.fQATrackPhiMin; | |
926 | fQATrackPhiMax = o.fQATrackPhiMax; | |
927 | fCommonHistList = o.fCommonHistList; | |
928 | fh1EvtSelection = o.fh1EvtSelection; | |
2b81de61 | 929 | fh1VtxSelection = o.fh1VtxSelection; |
e131b05f | 930 | fh1VertexNContributors = o.fh1VertexNContributors; |
931 | fh1VertexZ = o.fh1VertexZ; | |
932 | fh1EvtMult = o.fh1EvtMult; | |
933 | fh1EvtCent = o.fh1EvtCent; | |
934 | fh1Xsec = o.fh1Xsec; | |
935 | fh1Trials = o.fh1Trials; | |
936 | fh1PtHard = o.fh1PtHard; | |
937 | fh1PtHardTrials = o.fh1PtHardTrials; | |
938 | fh1nRecJetsCuts = o.fh1nRecJetsCuts; | |
939 | fh1nGenJets = o.fh1nGenJets; | |
940 | fh1nRecEffJets = o.fh1nRecEffJets; | |
941 | fh1nEmbeddedJets = o.fh1nEmbeddedJets; | |
942 | fh2PtRecVsGenPrim = o.fh2PtRecVsGenPrim; | |
943 | fh2PtRecVsGenSec = o.fh2PtRecVsGenSec; | |
944 | fQATrackHistosRecEffGen = o.fQATrackHistosRecEffGen; | |
945 | fQATrackHistosRecEffRec = o.fQATrackHistosRecEffRec; | |
946 | fQATrackHistosSecRecNS = o.fQATrackHistosSecRecNS; | |
947 | fQATrackHistosSecRecS = o.fQATrackHistosSecRecS; | |
948 | fQATrackHistosSecRecSsc = o.fQATrackHistosSecRecSsc; | |
949 | fFFHistosRecEffRec = o.fFFHistosRecEffRec; | |
950 | fFFHistosSecRecNS = o.fFFHistosSecRecNS; | |
951 | fFFHistosSecRecS = o.fFFHistosSecRecS; | |
952 | fFFHistosSecRecSsc = o.fFFHistosSecRecSsc; | |
953 | // Background | |
954 | fh1BckgMult0 = o.fh1BckgMult0; | |
955 | fh1BckgMult1 = o.fh1BckgMult1; | |
956 | fh1BckgMult2 = o.fh1BckgMult2; | |
957 | fh1BckgMult3 = o.fh1BckgMult3; | |
958 | fh1BckgMult4 = o.fh1BckgMult4; | |
959 | fh1FractionPtEmbedded = o.fh1FractionPtEmbedded; | |
960 | fh1IndexEmbedded = o.fh1IndexEmbedded; | |
961 | fh2DeltaPtVsJetPtEmbedded = o.fh2DeltaPtVsJetPtEmbedded; | |
962 | fh2DeltaPtVsRecJetPtEmbedded = o.fh2DeltaPtVsRecJetPtEmbedded; | |
963 | fh1DeltaREmbedded = o.fh1DeltaREmbedded; | |
265e4931 | 964 | fhDCA_XY = o.fhDCA_XY; |
965 | fhDCA_Z = o.fhDCA_Z; | |
630a4bcd | 966 | fhJetPtRefMultEta5 = o.fhJetPtRefMultEta5; |
967 | fhJetPtRefMultEta8 = o.fhJetPtRefMultEta8; | |
a2a9d6d2 | 968 | fhJetPtMultPercent = o.fhJetPtMultPercent; |
e131b05f | 969 | fQABckgHisto0RecCuts = o.fQABckgHisto0RecCuts; |
970 | fQABckgHisto0Gen = o.fQABckgHisto0Gen; | |
971 | fQABckgHisto1RecCuts = o.fQABckgHisto1RecCuts; | |
972 | fQABckgHisto1Gen = o.fQABckgHisto1Gen; | |
973 | fQABckgHisto2RecCuts = o.fQABckgHisto2RecCuts; | |
974 | fQABckgHisto2Gen = o.fQABckgHisto2Gen; | |
975 | fQABckgHisto3RecCuts = o.fQABckgHisto3RecCuts; | |
976 | fQABckgHisto3Gen = o.fQABckgHisto3Gen; | |
977 | fQABckgHisto4RecCuts = o.fQABckgHisto4RecCuts; | |
978 | fQABckgHisto4Gen = o.fQABckgHisto4Gen; | |
979 | fFFBckgHisto0RecCuts = o.fFFBckgHisto0RecCuts; | |
980 | fFFBckgHisto0Gen = o.fFFBckgHisto0Gen; | |
981 | fFFBckgHisto1RecCuts = o.fFFBckgHisto1RecCuts; | |
982 | fFFBckgHisto1Gen = o.fFFBckgHisto1Gen; | |
983 | fFFBckgHisto2RecCuts = o.fFFBckgHisto2RecCuts; | |
984 | fFFBckgHisto2Gen = o.fFFBckgHisto2Gen; | |
985 | fFFBckgHisto3RecCuts = o.fFFBckgHisto3RecCuts; | |
986 | fFFBckgHisto3Gen = o.fFFBckgHisto3Gen; | |
987 | fFFBckgHisto4RecCuts = o.fFFBckgHisto4RecCuts; | |
988 | fFFBckgHisto4Gen = o.fFFBckgHisto4Gen; | |
989 | fFFBckgHisto0RecEffRec = o.fFFBckgHisto0RecEffRec; | |
990 | fFFBckgHisto0SecRecNS = o.fFFBckgHisto0SecRecNS; | |
991 | fFFBckgHisto0SecRecS = o.fFFBckgHisto0SecRecS; | |
992 | fFFBckgHisto0SecRecSsc = o.fFFBckgHisto0SecRecSsc; | |
993 | fProNtracksLeadingJet = o.fProNtracksLeadingJet; | |
994 | fProDelR80pcPt = o.fProDelR80pcPt; | |
995 | fProNtracksLeadingJetGen = o.fProNtracksLeadingJetGen; | |
996 | fProDelR80pcPtGen = o.fProDelR80pcPtGen; | |
997 | fProNtracksLeadingJetBgrPerp2 = o.fProNtracksLeadingJetBgrPerp2; | |
998 | fProNtracksLeadingJetRecPrim = o.fProNtracksLeadingJetRecPrim; | |
999 | fProDelR80pcPtRecPrim = o.fProDelR80pcPtRecPrim; | |
1000 | fProNtracksLeadingJetRecSecNS = o.fProNtracksLeadingJetRecSecNS; | |
1001 | fProNtracksLeadingJetRecSecS = o.fProNtracksLeadingJetRecSecS; | |
1002 | fProNtracksLeadingJetRecSecSsc = o.fProNtracksLeadingJetRecSecSsc; | |
1003 | fRandom = o.fRandom; | |
c4856fb1 | 1004 | fOnlyLeadingJets = o.fOnlyLeadingJets; |
a2a9d6d2 | 1005 | fAnaUtils = o.fAnaUtils; |
e131b05f | 1006 | |
1007 | // PID framework | |
1008 | fUseInclusivePIDtask = o.fUseInclusivePIDtask; | |
1009 | fUseJetPIDtask = o.fUseJetPIDtask; | |
1010 | ||
1011 | fIsPP = o.fIsPP; | |
1012 | ||
1013 | for(Int_t ii=0; ii<5; ii++){ | |
1014 | fProDelRPtSum[ii] = o.fProDelRPtSum[ii]; | |
1015 | fProDelRPtSumGen[ii] = o.fProDelRPtSumGen[ii]; | |
1016 | fProDelRPtSumBgrPerp2[ii] = o.fProDelRPtSumBgrPerp2[ii]; | |
1017 | fProDelRPtSumRecPrim[ii] = o.fProDelRPtSumRecPrim[ii]; | |
1018 | fProDelRPtSumRecSecNS[ii] = o.fProDelRPtSumRecSecNS[ii]; | |
1019 | fProDelRPtSumRecSecS[ii] = o.fProDelRPtSumRecSecS[ii]; | |
1020 | fProDelRPtSumRecSecSsc[ii] = o.fProDelRPtSumRecSecSsc[ii]; | |
1021 | } | |
1022 | ||
1023 | for (Int_t i = 0; i < AliPID::kSPECIES; i++) { | |
1024 | fIDFFHistosRecCuts[i] = 0x0; | |
1025 | if (o.fIDFFHistosRecCuts[i]) | |
1026 | fIDFFHistosRecCuts[i] = o.fIDFFHistosRecCuts[i]; | |
1027 | ||
1028 | fIDFFHistosGen[i] = 0x0; | |
1029 | if (o.fIDFFHistosGen[i]) | |
1030 | fIDFFHistosGen[i] = o.fIDFFHistosGen[i]; | |
265e4931 | 1031 | |
1032 | fhDCA_XY_prim_MCID[i] = 0x0; | |
1033 | if (o.fhDCA_XY_prim_MCID[i]) | |
1034 | fhDCA_XY_prim_MCID[i] = o.fhDCA_XY_prim_MCID[i]; | |
1035 | ||
1036 | fhDCA_Z_prim_MCID[i] = 0x0; | |
1037 | if (o.fhDCA_Z_prim_MCID[i]) | |
1038 | fhDCA_Z_prim_MCID[i] = o.fhDCA_Z_prim_MCID[i]; | |
1039 | ||
1040 | fhDCA_XY_sec_MCID[i] = 0x0; | |
1041 | if (o.fhDCA_XY_sec_MCID[i]) | |
1042 | fhDCA_XY_sec_MCID[i] = o.fhDCA_XY_sec_MCID[i]; | |
1043 | ||
1044 | fhDCA_Z_sec_MCID[i] = 0x0; | |
1045 | if (o.fhDCA_Z_sec_MCID[i]) | |
1046 | fhDCA_Z_sec_MCID[i] = o.fhDCA_Z_sec_MCID[i]; | |
e131b05f | 1047 | } |
1048 | } | |
1049 | ||
1050 | ||
1051 | if (fNumJetPIDtasks > 0) { | |
1052 | delete [] fNameJetPIDtask; | |
1053 | fNameJetPIDtask = 0x0; | |
1054 | ||
1055 | delete [] fJetPIDtask; | |
1056 | fJetPIDtask = 0x0; | |
1057 | } | |
1058 | ||
1059 | fNumJetPIDtasks = o.fNumJetPIDtasks; | |
1060 | ||
1061 | ||
1062 | if (fNumInclusivePIDtasks > 0) { | |
1063 | delete [] fNameInclusivePIDtask; | |
1064 | fNameInclusivePIDtask = 0x0; | |
1065 | ||
1066 | delete [] fInclusivePIDtask; | |
1067 | fInclusivePIDtask = 0x0; | |
1068 | } | |
1069 | ||
1070 | fNumInclusivePIDtasks = o.fNumInclusivePIDtasks; | |
1071 | ||
1072 | ||
1073 | if (fNumInclusivePIDtasks > 0) { | |
1074 | fNameInclusivePIDtask = new TString[fNumInclusivePIDtasks]; | |
1075 | fInclusivePIDtask = new AliAnalysisTaskPID*[fNumInclusivePIDtasks]; | |
1076 | ||
1077 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
1078 | fNameInclusivePIDtask[i] = ""; | |
1079 | fInclusivePIDtask[i] = 0x0; | |
1080 | ||
1081 | if (o.fNameInclusivePIDtask[i]) | |
1082 | fNameInclusivePIDtask[i] = o.fNameInclusivePIDtask[i]; | |
1083 | ||
1084 | if (o.fInclusivePIDtask[i]) | |
1085 | fInclusivePIDtask[i] = o.fInclusivePIDtask[i]; | |
1086 | } | |
1087 | } | |
1088 | ||
1089 | if (fNumJetPIDtasks > 0) { | |
1090 | fNameJetPIDtask = new TString[fNumJetPIDtasks]; | |
1091 | fJetPIDtask = new AliAnalysisTaskPID*[fNumJetPIDtasks]; | |
1092 | ||
1093 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
1094 | fNameJetPIDtask[i] = ""; | |
1095 | fJetPIDtask[i] = 0x0; | |
1096 | ||
1097 | if (o.fNameJetPIDtask[i]) | |
1098 | fNameJetPIDtask[i] = o.fNameJetPIDtask[i]; | |
1099 | ||
1100 | if (o.fJetPIDtask[i]) | |
1101 | fJetPIDtask[i] = o.fJetPIDtask[i]; | |
1102 | } | |
1103 | } | |
1104 | ||
1105 | return *this; | |
1106 | } | |
1107 | ||
1108 | //___________________________________________________________________________ | |
1109 | AliAnalysisTaskIDFragmentationFunction::~AliAnalysisTaskIDFragmentationFunction() | |
1110 | { | |
1111 | // destructor | |
1112 | ||
1113 | if(fTracksRecCuts) delete fTracksRecCuts; | |
1114 | if(fTracksRecCutsEfficiency) delete fTracksRecCutsEfficiency; | |
1115 | if(fTracksGen) delete fTracksGen; | |
1116 | if(fTracksAODMCCharged) delete fTracksAODMCCharged; | |
1117 | if(fTracksAODMCChargedSecNS) delete fTracksAODMCChargedSecNS; | |
1118 | if(fTracksAODMCChargedSecS) delete fTracksAODMCChargedSecS; | |
1119 | if(fTracksRecQualityCuts) delete fTracksRecQualityCuts; | |
1120 | if(fJetsRec) delete fJetsRec; | |
1121 | if(fJetsRecCuts) delete fJetsRecCuts; | |
1122 | if(fJetsGen) delete fJetsGen; | |
1123 | if(fJetsRecEff) delete fJetsRecEff; | |
1124 | if(fJetsEmbedded) delete fJetsEmbedded; | |
1125 | ||
1126 | if(fBckgMode && | |
1127 | (fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters || | |
1128 | fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || | |
1129 | fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading)){ | |
1130 | ||
1131 | if(fBckgJetsRec) delete fBckgJetsRec; | |
1132 | if(fBckgJetsRecCuts) delete fBckgJetsRecCuts; | |
1133 | if(fBckgJetsGen) delete fBckgJetsGen; | |
1134 | } | |
1135 | if(fRandom) delete fRandom; | |
1136 | ||
1137 | delete [] fNameInclusivePIDtask; | |
1138 | fNameInclusivePIDtask = 0x0; | |
1139 | ||
1140 | delete [] fInclusivePIDtask; | |
1141 | fInclusivePIDtask = 0x0; | |
1142 | ||
1143 | delete [] fNameJetPIDtask; | |
1144 | fNameJetPIDtask = 0x0; | |
1145 | ||
1146 | delete [] fJetPIDtask; | |
1147 | fJetPIDtask = 0x0; | |
a2a9d6d2 | 1148 | |
1149 | delete fAnaUtils; | |
1150 | fAnaUtils = 0x0; | |
e131b05f | 1151 | } |
1152 | ||
1153 | //______________________________________________________________________________________________________ | |
1154 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos::AliFragFuncHistos(const char* name, | |
1155 | Int_t nJetPt, Float_t jetPtMin, Float_t jetPtMax, | |
1156 | Int_t nPt, Float_t ptMin, Float_t ptMax, | |
1157 | Int_t nXi, Float_t xiMin, Float_t xiMax, | |
1158 | Int_t nZ , Float_t zMin , Float_t zMax) | |
1159 | : TObject() | |
1160 | ,fNBinsJetPt(nJetPt) | |
1161 | ,fJetPtMin(jetPtMin) | |
1162 | ,fJetPtMax(jetPtMax) | |
1163 | ,fNBinsPt(nPt) | |
1164 | ,fPtMin(ptMin) | |
1165 | ,fPtMax(ptMax) | |
1166 | ,fNBinsXi(nXi) | |
1167 | ,fXiMin(xiMin) | |
1168 | ,fXiMax(xiMax) | |
1169 | ,fNBinsZ(nZ) | |
1170 | ,fZMin(zMin) | |
1171 | ,fZMax(zMax) | |
1172 | ,fh2TrackPt(0) | |
1173 | ,fh2Xi(0) | |
1174 | ,fh2Z(0) | |
1175 | ,fh1JetPt(0) | |
1176 | ,fNameFF(name) | |
1177 | { | |
1178 | // default constructor | |
1179 | ||
1180 | } | |
1181 | ||
1182 | //___________________________________________________________________________ | |
1183 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos::AliFragFuncHistos(const AliFragFuncHistos& copy) | |
1184 | : TObject() | |
1185 | ,fNBinsJetPt(copy.fNBinsJetPt) | |
1186 | ,fJetPtMin(copy.fJetPtMin) | |
1187 | ,fJetPtMax(copy.fJetPtMax) | |
1188 | ,fNBinsPt(copy.fNBinsPt) | |
1189 | ,fPtMin(copy.fPtMin) | |
1190 | ,fPtMax(copy.fPtMax) | |
1191 | ,fNBinsXi(copy.fNBinsXi) | |
1192 | ,fXiMin(copy.fXiMin) | |
1193 | ,fXiMax(copy.fXiMax) | |
1194 | ,fNBinsZ(copy.fNBinsZ) | |
1195 | ,fZMin(copy.fZMin) | |
1196 | ,fZMax(copy.fZMax) | |
1197 | ,fh2TrackPt(copy.fh2TrackPt) | |
1198 | ,fh2Xi(copy.fh2Xi) | |
1199 | ,fh2Z(copy.fh2Z) | |
1200 | ,fh1JetPt(copy.fh1JetPt) | |
1201 | ,fNameFF(copy.fNameFF) | |
1202 | { | |
1203 | // copy constructor | |
1204 | } | |
1205 | ||
1206 | //_______________________________________________________________________________________________________________________________________________________________ | |
1207 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos& AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos::operator=(const AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos& o) | |
1208 | { | |
1209 | // assignment | |
1210 | ||
1211 | if(this!=&o){ | |
1212 | TObject::operator=(o); | |
1213 | fNBinsJetPt = o.fNBinsJetPt; | |
1214 | fJetPtMin = o.fJetPtMin; | |
1215 | fJetPtMax = o.fJetPtMax; | |
1216 | fNBinsPt = o.fNBinsPt; | |
1217 | fPtMin = o.fPtMin; | |
1218 | fPtMax = o.fPtMax; | |
1219 | fNBinsXi = o.fNBinsXi; | |
1220 | fXiMin = o.fXiMin; | |
1221 | fXiMax = o.fXiMax; | |
1222 | fNBinsZ = o.fNBinsZ; | |
1223 | fZMin = o.fZMin; | |
1224 | fZMax = o.fZMax; | |
1225 | fh2TrackPt = o.fh2TrackPt; | |
1226 | fh2Xi = o.fh2Xi; | |
1227 | fh2Z = o.fh2Z; | |
1228 | fh1JetPt = o.fh1JetPt; | |
1229 | fNameFF = o.fNameFF; | |
1230 | } | |
1231 | ||
1232 | return *this; | |
1233 | } | |
1234 | ||
1235 | //_________________________________________________________ | |
1236 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos::~AliFragFuncHistos() | |
1237 | { | |
1238 | // destructor | |
1239 | ||
1240 | if(fh1JetPt) delete fh1JetPt; | |
1241 | if(fh2TrackPt) delete fh2TrackPt; | |
1242 | if(fh2Xi) delete fh2Xi; | |
1243 | if(fh2Z) delete fh2Z; | |
1244 | } | |
1245 | ||
1246 | //_________________________________________________________________ | |
1247 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos::DefineHistos() | |
1248 | { | |
1249 | // book FF histos | |
1250 | ||
1251 | fh1JetPt = new TH1F(Form("fh1FFJetPt%s", fNameFF.Data()),"",fNBinsJetPt,fJetPtMin,fJetPtMax); | |
1252 | fh2TrackPt = new TH2F(Form("fh2FFTrackPt%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax,fNBinsPt, fPtMin, fPtMax); | |
1253 | fh2Z = new TH2F(Form("fh2FFZ%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsZ, fZMin, fZMax); | |
1254 | fh2Xi = new TH2F(Form("fh2FFXi%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsXi, fXiMin, fXiMax); | |
1255 | ||
1256 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh1JetPt, "p_{T} [GeV/c]", "entries"); | |
1257 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh2TrackPt,"jet p_{T} [GeV/c]","p_{T} [GeV/c]","entries"); | |
1258 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh2Xi,"jet p_{T} [GeV/c]","#xi", "entries"); | |
1259 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh2Z,"jet p_{T} [GeV/c]","z","entries"); | |
1260 | } | |
1261 | ||
1262 | //_______________________________________________________________________________________________________________ | |
1263 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos::FillFF(Float_t trackPt, Float_t jetPt, Bool_t incrementJetPt, Float_t norm, | |
1264 | Bool_t scaleStrangeness, Float_t scaleFacStrangeness) | |
1265 | { | |
1266 | // fill FF | |
1267 | ||
1268 | if(incrementJetPt && norm) fh1JetPt->Fill(jetPt,1/norm); | |
1269 | else if(incrementJetPt) fh1JetPt->Fill(jetPt); | |
1270 | ||
1271 | // Added for proper normalization of FF background estimation | |
1272 | // when zero track are found in the background region | |
1273 | if((int)trackPt==-1) return; | |
1274 | ||
1275 | if(norm)fh2TrackPt->Fill(jetPt,trackPt,1/norm); | |
1276 | else if(scaleStrangeness) fh2TrackPt->Fill(jetPt,trackPt,scaleFacStrangeness); | |
1277 | else fh2TrackPt->Fill(jetPt,trackPt); | |
1278 | ||
1279 | Double_t z = -1., xi = -1.; | |
1280 | AliAnalysisTaskPID::GetJetTrackObservables(trackPt, jetPt, z, xi); | |
1281 | ||
1282 | ||
1283 | if(norm){ | |
1284 | fh2Xi->Fill(jetPt,xi,1/norm); | |
1285 | fh2Z->Fill(jetPt,z,1/norm); | |
1286 | } | |
1287 | else if(scaleStrangeness){ | |
1288 | fh2Xi->Fill(jetPt,xi,scaleFacStrangeness); | |
1289 | fh2Z->Fill(jetPt,z,scaleFacStrangeness); | |
1290 | } | |
1291 | else { | |
1292 | fh2Xi->Fill(jetPt,xi); | |
1293 | fh2Z->Fill(jetPt,z); | |
1294 | } | |
1295 | } | |
1296 | ||
1297 | //_________________________________________________________________________________ | |
1298 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncHistos::AddToOutput(TList* list) const | |
1299 | { | |
1300 | // add histos to list | |
1301 | ||
1302 | list->Add(fh1JetPt); | |
1303 | ||
1304 | list->Add(fh2TrackPt); | |
1305 | list->Add(fh2Xi); | |
1306 | list->Add(fh2Z); | |
1307 | } | |
1308 | ||
1309 | //_________________________________________________________________________________________________________ | |
1310 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos::AliFragFuncQAJetHistos(const char* name, | |
1311 | Int_t nPt, Float_t ptMin, Float_t ptMax, | |
1312 | Int_t nEta, Float_t etaMin, Float_t etaMax, | |
1313 | Int_t nPhi, Float_t phiMin, Float_t phiMax) | |
1314 | : TObject() | |
1315 | ,fNBinsPt(nPt) | |
1316 | ,fPtMin(ptMin) | |
1317 | ,fPtMax(ptMax) | |
1318 | ,fNBinsEta(nEta) | |
1319 | ,fEtaMin(etaMin) | |
1320 | ,fEtaMax(etaMax) | |
1321 | ,fNBinsPhi(nPhi) | |
1322 | ,fPhiMin(phiMin) | |
1323 | ,fPhiMax(phiMax) | |
1324 | ,fh2EtaPhi(0) | |
1325 | ,fh1Pt(0) | |
1326 | ,fNameQAJ(name) | |
1327 | { | |
1328 | // default constructor | |
1329 | } | |
1330 | ||
1331 | //____________________________________________________________________________________ | |
1332 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos::AliFragFuncQAJetHistos(const AliFragFuncQAJetHistos& copy) | |
1333 | : TObject() | |
1334 | ,fNBinsPt(copy.fNBinsPt) | |
1335 | ,fPtMin(copy.fPtMin) | |
1336 | ,fPtMax(copy.fPtMax) | |
1337 | ,fNBinsEta(copy.fNBinsEta) | |
1338 | ,fEtaMin(copy.fEtaMin) | |
1339 | ,fEtaMax(copy.fEtaMax) | |
1340 | ,fNBinsPhi(copy.fNBinsPhi) | |
1341 | ,fPhiMin(copy.fPhiMin) | |
1342 | ,fPhiMax(copy.fPhiMax) | |
1343 | ,fh2EtaPhi(copy.fh2EtaPhi) | |
1344 | ,fh1Pt(copy.fh1Pt) | |
1345 | ,fNameQAJ(copy.fNameQAJ) | |
1346 | { | |
1347 | // copy constructor | |
1348 | } | |
1349 | ||
1350 | //________________________________________________________________________________________________________________________________________________________________________ | |
1351 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos& AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos::operator=(const AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos& o) | |
1352 | { | |
1353 | // assignment | |
1354 | ||
1355 | if(this!=&o){ | |
1356 | TObject::operator=(o); | |
1357 | fNBinsPt = o.fNBinsPt; | |
1358 | fPtMin = o.fPtMin; | |
1359 | fPtMax = o.fPtMax; | |
1360 | fNBinsEta = o.fNBinsEta; | |
1361 | fEtaMin = o.fEtaMin; | |
1362 | fEtaMax = o.fEtaMax; | |
1363 | fNBinsPhi = o.fNBinsPhi; | |
1364 | fPhiMin = o.fPhiMin; | |
1365 | fPhiMax = o.fPhiMax; | |
1366 | fh2EtaPhi = o.fh2EtaPhi; | |
1367 | fh1Pt = o.fh1Pt; | |
1368 | fNameQAJ = o.fNameQAJ; | |
1369 | } | |
1370 | ||
1371 | return *this; | |
1372 | } | |
1373 | ||
1374 | //______________________________________________________________ | |
1375 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos::~AliFragFuncQAJetHistos() | |
1376 | { | |
1377 | // destructor | |
1378 | ||
1379 | if(fh2EtaPhi) delete fh2EtaPhi; | |
1380 | if(fh1Pt) delete fh1Pt; | |
1381 | } | |
1382 | ||
1383 | //____________________________________________________________________ | |
1384 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos::DefineHistos() | |
1385 | { | |
1386 | // book jet QA histos | |
1387 | ||
1388 | fh2EtaPhi = new TH2F(Form("fh2JetQAEtaPhi%s", fNameQAJ.Data()), Form("%s: #eta - #phi distribution", fNameQAJ.Data()), fNBinsEta, fEtaMin, fEtaMax, fNBinsPhi, fPhiMin, fPhiMax); | |
1389 | fh1Pt = new TH1F(Form("fh1JetQAPt%s", fNameQAJ.Data()), Form("%s: p_{T} distribution", fNameQAJ.Data()), fNBinsPt, fPtMin, fPtMax); | |
1390 | ||
1391 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh2EtaPhi, "#eta", "#phi"); | |
1392 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh1Pt, "p_{T} [GeV/c]", "entries"); | |
1393 | } | |
1394 | ||
1395 | //____________________________________________________________________________________________________ | |
1396 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos::FillJetQA(Float_t eta, Float_t phi, Float_t pt) | |
1397 | { | |
1398 | // fill jet QA histos | |
1399 | ||
1400 | fh2EtaPhi->Fill( eta, phi); | |
1401 | fh1Pt->Fill( pt ); | |
1402 | } | |
1403 | ||
1404 | //____________________________________________________________________________________ | |
1405 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncQAJetHistos::AddToOutput(TList* list) const | |
1406 | { | |
1407 | // add histos to list | |
1408 | ||
1409 | list->Add(fh2EtaPhi); | |
1410 | list->Add(fh1Pt); | |
1411 | } | |
1412 | ||
1413 | //___________________________________________________________________________________________________________ | |
1414 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos::AliFragFuncQATrackHistos(const char* name, | |
1415 | Int_t nPt, Float_t ptMin, Float_t ptMax, | |
1416 | Int_t nEta, Float_t etaMin, Float_t etaMax, | |
1417 | Int_t nPhi, Float_t phiMin, Float_t phiMax, | |
1418 | Float_t ptThresh) | |
1419 | : TObject() | |
1420 | ,fNBinsPt(nPt) | |
1421 | ,fPtMin(ptMin) | |
1422 | ,fPtMax(ptMax) | |
1423 | ,fNBinsEta(nEta) | |
1424 | ,fEtaMin(etaMin) | |
1425 | ,fEtaMax(etaMax) | |
1426 | ,fNBinsPhi(nPhi) | |
1427 | ,fPhiMin(phiMin) | |
1428 | ,fPhiMax(phiMax) | |
1429 | ,fHighPtThreshold(ptThresh) | |
1430 | ,fh2EtaPhi(0) | |
1431 | ,fh1Pt(0) | |
1432 | ,fh2HighPtEtaPhi(0) | |
1433 | ,fh2PhiPt(0) | |
1434 | ,fNameQAT(name) | |
1435 | { | |
1436 | // default constructor | |
1437 | } | |
1438 | ||
1439 | //__________________________________________________________________________________________ | |
1440 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos::AliFragFuncQATrackHistos(const AliFragFuncQATrackHistos& copy) | |
1441 | : TObject() | |
1442 | ,fNBinsPt(copy.fNBinsPt) | |
1443 | ,fPtMin(copy.fPtMin) | |
1444 | ,fPtMax(copy.fPtMax) | |
1445 | ,fNBinsEta(copy.fNBinsEta) | |
1446 | ,fEtaMin(copy.fEtaMin) | |
1447 | ,fEtaMax(copy.fEtaMax) | |
1448 | ,fNBinsPhi(copy.fNBinsPhi) | |
1449 | ,fPhiMin(copy.fPhiMin) | |
1450 | ,fPhiMax(copy.fPhiMax) | |
1451 | ,fHighPtThreshold(copy.fHighPtThreshold) | |
1452 | ,fh2EtaPhi(copy.fh2EtaPhi) | |
1453 | ,fh1Pt(copy.fh1Pt) | |
1454 | ,fh2HighPtEtaPhi(copy.fh2HighPtEtaPhi) | |
1455 | ,fh2PhiPt(copy.fh2PhiPt) | |
1456 | ,fNameQAT(copy.fNameQAT) | |
1457 | { | |
1458 | // copy constructor | |
1459 | } | |
1460 | ||
1461 | // _____________________________________________________________________________________________________________________________________________________________________________ | |
1462 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos& AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos::operator=(const AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos& o) | |
1463 | { | |
1464 | // assignment | |
1465 | ||
1466 | if(this!=&o){ | |
1467 | TObject::operator=(o); | |
1468 | fNBinsPt = o.fNBinsPt; | |
1469 | fPtMin = o.fPtMin; | |
1470 | fPtMax = o.fPtMax; | |
1471 | fNBinsEta = o.fNBinsEta; | |
1472 | fEtaMin = o.fEtaMin; | |
1473 | fEtaMax = o.fEtaMax; | |
1474 | fNBinsPhi = o.fNBinsPhi; | |
1475 | fPhiMin = o.fPhiMin; | |
1476 | fPhiMax = o.fPhiMax; | |
1477 | fHighPtThreshold = o.fHighPtThreshold; | |
1478 | fh2EtaPhi = o.fh2EtaPhi; | |
1479 | fh1Pt = o.fh1Pt; | |
1480 | fh2HighPtEtaPhi = o.fh2HighPtEtaPhi; | |
1481 | fh2PhiPt = o.fh2PhiPt; | |
1482 | fNameQAT = o.fNameQAT; | |
1483 | } | |
1484 | ||
1485 | return *this; | |
1486 | } | |
1487 | ||
1488 | //___________________________________________________________________ | |
1489 | AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos::~AliFragFuncQATrackHistos() | |
1490 | { | |
1491 | // destructor | |
1492 | ||
1493 | if(fh2EtaPhi) delete fh2EtaPhi; | |
1494 | if(fh2HighPtEtaPhi) delete fh2HighPtEtaPhi; | |
1495 | if(fh1Pt) delete fh1Pt; | |
1496 | if(fh2PhiPt) delete fh2PhiPt; | |
1497 | } | |
1498 | ||
1499 | //______________________________________________________________________ | |
1500 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos::DefineHistos() | |
1501 | { | |
1502 | // book track QA histos | |
1503 | ||
1504 | fh2EtaPhi = new TH2F(Form("fh2TrackQAEtaPhi%s", fNameQAT.Data()), Form("%s: #eta - #phi distribution", fNameQAT.Data()), fNBinsEta, fEtaMin, fEtaMax, fNBinsPhi, fPhiMin, fPhiMax); | |
1505 | fh2HighPtEtaPhi = new TH2F(Form("fh2TrackQAHighPtEtaPhi%s", fNameQAT.Data()), Form("%s: #eta - #phi distribution for high-p_{T}", fNameQAT.Data()), fNBinsEta, fEtaMin, fEtaMax, fNBinsPhi, fPhiMin, fPhiMax); | |
1506 | fh1Pt = new TH1F(Form("fh1TrackQAPt%s", fNameQAT.Data()), Form("%s: p_{T} distribution", fNameQAT.Data()), fNBinsPt, fPtMin, fPtMax); | |
1507 | fh2PhiPt = new TH2F(Form("fh2TrackQAPhiPt%s", fNameQAT.Data()), Form("%s: #phi - p_{T} distribution", fNameQAT.Data()), fNBinsPhi, fPhiMin, fPhiMax, fNBinsPt, fPtMin, fPtMax); | |
1508 | ||
1509 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh2EtaPhi, "#eta", "#phi"); | |
1510 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh2HighPtEtaPhi, "#eta", "#phi"); | |
1511 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh1Pt, "p_{T} [GeV/c]", "entries"); | |
1512 | AliAnalysisTaskIDFragmentationFunction::SetProperties(fh2PhiPt, "#phi", "p_{T} [GeV/c]"); | |
1513 | } | |
1514 | ||
1515 | //________________________________________________________________________________________________________ | |
1516 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos::FillTrackQA(Float_t eta, Float_t phi, Float_t pt, Bool_t weightPt, Float_t norm, | |
1517 | Bool_t scaleStrangeness, Float_t scaleFacStrangeness) | |
1518 | { | |
1519 | // fill track QA histos | |
1520 | Float_t weight = 1.; | |
1521 | if(weightPt) weight = pt; | |
1522 | fh2EtaPhi->Fill( eta, phi, weight); | |
1523 | if(scaleStrangeness) fh2EtaPhi->Fill( eta, phi, scaleFacStrangeness); | |
1524 | if(pt > fHighPtThreshold) fh2HighPtEtaPhi->Fill( eta, phi, weight); | |
1525 | if(pt > fHighPtThreshold && scaleStrangeness) fh2HighPtEtaPhi->Fill( eta, phi, weight); | |
1526 | if(norm) fh1Pt->Fill( pt, 1/norm ); | |
1527 | else if(scaleStrangeness) fh1Pt->Fill(pt,scaleFacStrangeness); | |
1528 | else fh1Pt->Fill( pt ); | |
1529 | ||
1530 | if(scaleFacStrangeness) fh2PhiPt->Fill(phi, pt, scaleFacStrangeness); | |
1531 | else fh2PhiPt->Fill(phi, pt); | |
1532 | } | |
1533 | ||
1534 | //______________________________________________________________________________________ | |
1535 | void AliAnalysisTaskIDFragmentationFunction::AliFragFuncQATrackHistos::AddToOutput(TList* list) const | |
1536 | { | |
1537 | // add histos to list | |
1538 | ||
1539 | list->Add(fh2EtaPhi); | |
1540 | list->Add(fh2HighPtEtaPhi); | |
1541 | list->Add(fh1Pt); | |
1542 | list->Add(fh2PhiPt); | |
1543 | } | |
1544 | ||
1545 | //_________________________________________________________________________________ | |
1546 | Bool_t AliAnalysisTaskIDFragmentationFunction::Notify() | |
1547 | { | |
1548 | // | |
1549 | // Implemented Notify() to read the cross sections | |
1550 | // and number of trials from pyxsec.root | |
1551 | // (taken from AliAnalysisTaskJetSpectrum2) | |
1552 | // | |
1553 | TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree(); | |
1554 | Float_t xsection = 0; | |
1555 | Float_t ftrials = 1; | |
1556 | ||
1557 | fAvgTrials = 1; | |
1558 | if(tree){ | |
1559 | TFile *curfile = tree->GetCurrentFile(); | |
1560 | if (!curfile) { | |
1561 | Error("Notify","No current file"); | |
1562 | return kFALSE; | |
1563 | } | |
1564 | ||
1565 | AliAnalysisHelperJetTasks::PythiaInfoFromFile(curfile->GetName(),xsection,ftrials); | |
1566 | ||
1567 | if (fUseInclusivePIDtask) { | |
1568 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) | |
1569 | fInclusivePIDtask[i]->FillXsec(xsection); | |
1570 | } | |
1571 | ||
1572 | if (fUseJetPIDtask) { | |
1573 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) | |
1574 | fJetPIDtask[i]->FillXsec(xsection); | |
1575 | } | |
1576 | ||
1577 | if(!fh1Xsec||!fh1Trials){ | |
9e95a906 | 1578 | Printf("%s:%d No Histogram fh1Xsec",(char*)__FILE__,__LINE__); |
e131b05f | 1579 | return kFALSE; |
1580 | } | |
1581 | ||
1582 | fh1Xsec->Fill("<#sigma>",xsection); | |
1583 | // construct a poor man average trials | |
1584 | Float_t nEntries = (Float_t)tree->GetTree()->GetEntries(); | |
1585 | if(ftrials>=nEntries && nEntries>0.)fAvgTrials = ftrials/nEntries; | |
1586 | } | |
1587 | ||
1588 | // Set seed for backg study | |
9d7ad2e4 | 1589 | delete fRandom; |
e131b05f | 1590 | fRandom = new TRandom3(); |
1591 | fRandom->SetSeed(0); | |
1592 | ||
1593 | return kTRUE; | |
1594 | } | |
1595 | ||
1596 | //__________________________________________________________________ | |
1597 | void AliAnalysisTaskIDFragmentationFunction::UserCreateOutputObjects() | |
1598 | { | |
1599 | // create output objects | |
1600 | ||
1601 | if(fDebug > 1) Printf("AliAnalysisTaskIDFragmentationFunction::UserCreateOutputObjects()"); | |
1602 | ||
1603 | // create list of tracks and jets | |
1604 | ||
1605 | fTracksRecCuts = new TList(); | |
1606 | fTracksRecCuts->SetOwner(kFALSE); | |
1607 | ||
1608 | fTracksRecCutsEfficiency = new TList(); | |
1609 | fTracksRecCutsEfficiency->SetOwner(kFALSE); | |
1610 | ||
1611 | fTracksGen = new TList(); | |
1612 | fTracksGen->SetOwner(kFALSE); | |
1613 | ||
1614 | fTracksAODMCCharged = new TList(); | |
1615 | fTracksAODMCCharged->SetOwner(kFALSE); | |
1616 | ||
1617 | fTracksAODMCChargedSecNS = new TList(); | |
1618 | fTracksAODMCChargedSecNS->SetOwner(kFALSE); | |
1619 | ||
1620 | fTracksAODMCChargedSecS = new TList(); | |
1621 | fTracksAODMCChargedSecS->SetOwner(kFALSE); | |
1622 | ||
1623 | fTracksRecQualityCuts = new TList(); | |
1624 | fTracksRecQualityCuts->SetOwner(kFALSE); | |
1625 | ||
1626 | fJetsRec = new TList(); | |
1627 | fJetsRec->SetOwner(kFALSE); | |
1628 | ||
1629 | fJetsRecCuts = new TList(); | |
1630 | fJetsRecCuts->SetOwner(kFALSE); | |
1631 | ||
1632 | fJetsGen = new TList(); | |
1633 | fJetsGen->SetOwner(kFALSE); | |
1634 | ||
1635 | fJetsRecEff = new TList(); | |
1636 | fJetsRecEff->SetOwner(kFALSE); | |
1637 | ||
1638 | fJetsEmbedded = new TList(); | |
1639 | fJetsEmbedded->SetOwner(kFALSE); | |
1640 | ||
1641 | ||
1642 | if(fBckgMode && | |
1643 | (fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters || | |
1644 | fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || | |
1645 | fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading)){ | |
1646 | ||
1647 | fBckgJetsRec = new TList(); | |
1648 | fBckgJetsRec->SetOwner(kFALSE); | |
1649 | ||
1650 | fBckgJetsRecCuts = new TList(); | |
1651 | fBckgJetsRecCuts->SetOwner(kFALSE); | |
1652 | ||
1653 | fBckgJetsGen = new TList(); | |
1654 | fBckgJetsGen->SetOwner(kFALSE); | |
1655 | } | |
1656 | ||
1657 | // | |
1658 | // Create histograms / output container | |
1659 | // | |
1660 | ||
1661 | OpenFile(1); | |
1662 | fCommonHistList = new TList(); | |
1663 | fCommonHistList->SetOwner(kTRUE); | |
1664 | ||
1665 | Bool_t oldStatus = TH1::AddDirectoryStatus(); | |
1666 | TH1::AddDirectory(kFALSE); | |
1667 | ||
1668 | ||
1669 | // Histograms | |
1670 | fh1EvtSelection = new TH1F("fh1EvtSelection", "Event Selection", 6, -0.5, 5.5); | |
1671 | fh1EvtSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED"); | |
1672 | fh1EvtSelection->GetXaxis()->SetBinLabel(2,"event selection: rejected"); | |
1673 | fh1EvtSelection->GetXaxis()->SetBinLabel(3,"event class: rejected"); | |
1674 | fh1EvtSelection->GetXaxis()->SetBinLabel(4,"vertex Ncontr: rejected"); | |
1675 | fh1EvtSelection->GetXaxis()->SetBinLabel(5,"vertex z: rejected"); | |
1676 | fh1EvtSelection->GetXaxis()->SetBinLabel(6,"vertex type: rejected"); | |
1677 | ||
2b81de61 | 1678 | fh1VtxSelection = new TH1F("fh1VtxSelection", "Vertex Selection", 10, -1, 9); |
1679 | fh1VtxSelection->GetXaxis()->SetBinLabel(1,"Undef"); | |
1680 | fh1VtxSelection->GetXaxis()->SetBinLabel(2,"Primary"); | |
1681 | fh1VtxSelection->GetXaxis()->SetBinLabel(3,"Kink"); | |
1682 | fh1VtxSelection->GetXaxis()->SetBinLabel(4,"V0"); | |
1683 | fh1VtxSelection->GetXaxis()->SetBinLabel(5,"Cascade"); | |
1684 | fh1VtxSelection->GetXaxis()->SetBinLabel(6,"Multi"); | |
1685 | fh1VtxSelection->GetXaxis()->SetBinLabel(7,"SPD"); | |
1686 | fh1VtxSelection->GetXaxis()->SetBinLabel(8,"PileUpSPD"); | |
1687 | fh1VtxSelection->GetXaxis()->SetBinLabel(9,"PileUpTracks"); | |
1688 | fh1VtxSelection->GetXaxis()->SetBinLabel(10,"TPC"); | |
1689 | ||
e131b05f | 1690 | fh1VertexNContributors = new TH1F("fh1VertexNContributors", "Vertex N contributors", 2500,-.5, 2499.5); |
1691 | fh1VertexZ = new TH1F("fh1VertexZ", "Vertex z distribution", 30, -15., 15.); | |
1692 | fh1EvtMult = new TH1F("fh1EvtMult","Event multiplicity, track pT cut > 150 MeV/c, |#eta| < 0.9",120,0.,12000.); | |
1693 | fh1EvtCent = new TH1F("fh1EvtCent","centrality",100,0.,100.); | |
1694 | ||
1695 | fh1Xsec = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1); | |
1696 | fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>"); | |
1697 | fh1Trials = new TH1F("fh1Trials","trials from pyxsec.root",1,0,1); | |
1698 | fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}"); | |
1699 | fh1PtHard = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",350,-.5,349.5); | |
1700 | fh1PtHardTrials = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",350,-.5,349.5); | |
1701 | ||
1702 | fh1nRecJetsCuts = new TH1F("fh1nRecJetsCuts","reconstructed jets per event",10,-0.5,9.5); | |
1703 | fh1nGenJets = new TH1F("fh1nGenJets","generated jets per event",10,-0.5,9.5); | |
1704 | fh1nRecEffJets = new TH1F("fh1nRecEffJets","reconstruction effiency: jets per event",10,-0.5,9.5); | |
1705 | fh1nEmbeddedJets = new TH1F("fh1nEmbeddedJets","embedded jets per event",10,-0.5,9.5); | |
1706 | ||
1707 | fh2PtRecVsGenPrim = new TH2F("fh2PtRecVsGenPrim","rec vs gen pt",fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax,fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax); | |
1708 | fh2PtRecVsGenSec = new TH2F("fh2PtRecVsGenSec","rec vs gen pt",fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax,fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax); | |
1709 | ||
1710 | // embedding | |
1711 | if(fBranchEmbeddedJets.Length()){ | |
1712 | fh1FractionPtEmbedded = new TH1F("fh1FractionPtEmbedded","",200,0,2); | |
1713 | fh1IndexEmbedded = new TH1F("fh1IndexEmbedded","",11,-1,10); | |
1714 | fh2DeltaPtVsJetPtEmbedded = new TH2F("fh2DeltaPtVsJetPtEmbedded","",250,0,250,200,-100,100); | |
1715 | fh2DeltaPtVsRecJetPtEmbedded = new TH2F("fh2DeltaPtVsRecJetPtEmbedded","",250,0,250,200,-100,100); | |
1716 | fh1DeltaREmbedded = new TH1F("fh1DeltaREmbedded","",50,0,0.5); | |
1717 | fh1nEmbeddedJets = new TH1F("fh1nEmbeddedJets","embedded jets per event",10,-0.5,9.5); | |
1718 | } | |
1719 | ||
1720 | ||
1721 | if(fQAMode){ | |
1722 | if(fQAMode&1){ // track QA | |
1723 | fQATrackHistosRecCuts = new AliFragFuncQATrackHistos("RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1724 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1725 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1726 | fQATrackHighPtThreshold); | |
1727 | fQATrackHistosGen = new AliFragFuncQATrackHistos("Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1728 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1729 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1730 | fQATrackHighPtThreshold); | |
1731 | } | |
1732 | ||
1733 | if(fQAMode&2){ // jet QA | |
1734 | fQAJetHistosRec = new AliFragFuncQAJetHistos("Rec", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, | |
1735 | fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax, | |
1736 | fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax); | |
1737 | fQAJetHistosRecCuts = new AliFragFuncQAJetHistos("RecCuts", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, | |
1738 | fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax, | |
1739 | fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax); | |
1740 | fQAJetHistosRecCutsLeading = new AliFragFuncQAJetHistos("RecCutsLeading", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, | |
1741 | fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax, | |
1742 | fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax); | |
1743 | fQAJetHistosGen = new AliFragFuncQAJetHistos("Gen", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, | |
1744 | fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax, | |
1745 | fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax); | |
1746 | fQAJetHistosGenLeading = new AliFragFuncQAJetHistos("GenLeading", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, | |
1747 | fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax, | |
1748 | fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax); | |
1749 | if(fEffMode) fQAJetHistosRecEffLeading = new AliFragFuncQAJetHistos("RecEffLeading", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, | |
1750 | fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax,fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax); | |
1751 | } | |
1752 | } // end: QA | |
1753 | ||
1754 | if(fFFMode || fIDFFMode){ | |
1755 | ||
1756 | fFFHistosRecCuts = new AliFragFuncHistos("RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1757 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1758 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1759 | fFFNBinsZ , fFFZMin , fFFZMax ); | |
1760 | ||
1761 | ||
1762 | fFFHistosRecCutsInc = new AliFragFuncHistos("RecCutsInc", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1763 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1764 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1765 | fFFNBinsZ , fFFZMin , fFFZMax ); | |
1766 | ||
1767 | ||
1768 | fFFHistosRecLeadingTrack = new AliFragFuncHistos("RecLeadingTrack", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1769 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1770 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1771 | fFFNBinsZ , fFFZMin , fFFZMax ); | |
1772 | ||
1773 | fFFHistosGen = new AliFragFuncHistos("Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1774 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1775 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1776 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1777 | ||
1778 | fFFHistosGenInc = new AliFragFuncHistos("GenInc", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1779 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1780 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1781 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1782 | ||
1783 | fFFHistosGenLeadingTrack = new AliFragFuncHistos("GenLeadingTrack", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1784 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1785 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1786 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1787 | ||
1788 | if (fIDFFMode) { | |
1789 | for (Int_t i = 0; i < AliPID::kSPECIES; i++) { | |
1790 | fIDFFHistosRecCuts[i] = new AliFragFuncHistos(Form("RecCuts_%s", AliPID::ParticleName(i)), fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1791 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1792 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1793 | fFFNBinsZ , fFFZMin , fFFZMax ); | |
1794 | fIDFFHistosGen[i] = new AliFragFuncHistos(Form("Gen_%s", AliPID::ParticleName(i)), fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1795 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1796 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1797 | fFFNBinsZ , fFFZMin , fFFZMax ); | |
1798 | } | |
1799 | } | |
1800 | } // end: FF | |
1801 | ||
1802 | // efficiency | |
1803 | ||
1804 | if(fEffMode){ | |
1805 | if(fQAMode&1){ | |
1806 | fQATrackHistosRecEffGen = new AliFragFuncQATrackHistos("RecEffGen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1807 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1808 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1809 | fQATrackHighPtThreshold); | |
1810 | ||
1811 | fQATrackHistosRecEffRec = new AliFragFuncQATrackHistos("RecEffRec", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1812 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1813 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1814 | fQATrackHighPtThreshold); | |
1815 | ||
1816 | fQATrackHistosSecRecNS = new AliFragFuncQATrackHistos("SecRecNS", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1817 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1818 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1819 | fQATrackHighPtThreshold); | |
1820 | ||
1821 | fQATrackHistosSecRecS = new AliFragFuncQATrackHistos("SecRecS", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1822 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1823 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1824 | fQATrackHighPtThreshold); | |
1825 | ||
1826 | fQATrackHistosSecRecSsc = new AliFragFuncQATrackHistos("SecRecSsc", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1827 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1828 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1829 | fQATrackHighPtThreshold); | |
1830 | ||
1831 | } | |
1832 | if(fFFMode){ | |
1833 | fFFHistosRecEffRec = new AliFragFuncHistos("RecEffRec", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1834 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1835 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1836 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1837 | ||
1838 | fFFHistosSecRecNS = new AliFragFuncHistos("SecRecNS", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1839 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1840 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1841 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1842 | ||
1843 | fFFHistosSecRecS = new AliFragFuncHistos("SecRecS", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1844 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1845 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1846 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1847 | ||
1848 | fFFHistosSecRecSsc = new AliFragFuncHistos("SecRecSsc", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1849 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1850 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1851 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1852 | ||
1853 | } | |
1854 | } // end: efficiency | |
1855 | ||
1856 | // Background | |
1857 | if(fBckgMode){ | |
1858 | if(fBckgType[0]==kBckgNone){ | |
1859 | AliError("no bgr method selected !"); | |
1860 | } | |
1861 | ||
1862 | TString title[5]; | |
1863 | for(Int_t i=0; i<5; i++){ | |
1864 | if(fBckgType[i]==kBckgPerp) title[i]="Perp"; | |
1865 | else if(fBckgType[i]==kBckgPerp2) title[i]="Perp2"; | |
1866 | else if(fBckgType[i]==kBckgPerp2Area) title[i]="Perp2Area"; | |
1867 | else if(fBckgType[i]==kBckgPerpWindow) title[i]="PerpW"; | |
1868 | else if(fBckgType[i]==kBckgASide) title[i]="ASide"; | |
1869 | else if(fBckgType[i]==kBckgASideWindow) title[i]="ASideW"; | |
1870 | else if(fBckgType[i]==kBckgOutLJ) title[i]="OutLeadingJet"; | |
1871 | else if(fBckgType[i]==kBckgOut2J) title[i]="Out2Jets"; | |
1872 | else if(fBckgType[i]==kBckgOut3J) title[i]="Out3Jets"; | |
1873 | else if(fBckgType[i]==kBckgOutAJ) title[i]="AllJets"; | |
1874 | else if(fBckgType[i]==kBckgOutLJStat) title[i]="OutLeadingJetStat"; | |
1875 | else if(fBckgType[i]==kBckgOut2JStat) title[i]="Out2JetsStat"; | |
1876 | else if(fBckgType[i]==kBckgOut3JStat) title[i]="Out3JetsStat"; | |
1877 | else if(fBckgType[i]==kBckgOutAJStat) title[i]="AllJetsStat"; | |
1878 | else if(fBckgType[i]==kBckgClustersOutLeading) title[i]="OutClusters"; | |
1879 | else if(fBckgType[i]==kBckgClusters) title[i]="MedianClusters"; | |
1880 | else if(fBckgType[i]==kBckgNone) title[i]=""; | |
1881 | else printf("Please chose background method number %d!",i); | |
1882 | } | |
1883 | ||
1884 | ||
1885 | if(fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters || | |
1886 | fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || | |
1887 | fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading){ | |
1888 | ||
1889 | fh1nRecBckgJetsCuts = new TH1F("fh1nRecBckgJetsCuts","reconstructed background jets per event",10,-0.5,9.5); | |
1890 | fh1nGenBckgJets = new TH1F("fh1nGenBckgJets","generated background jets per event",10,-0.5,9.5); | |
1891 | } | |
1892 | ||
1893 | ||
1894 | fh1BckgMult0 = new TH1F("fh1BckgMult0","bckg mult "+title[0],500,0,500); | |
1895 | if(fBckgType[1] != kBckgNone) fh1BckgMult1 = new TH1F("fh1BckgMult1","bckg mult "+title[1],500,0,500); | |
1896 | if(fBckgType[2] != kBckgNone) fh1BckgMult2 = new TH1F("fh1BckgMult2","bckg mult "+title[2],500,0,500); | |
1897 | if(fBckgType[3] != kBckgNone) fh1BckgMult3 = new TH1F("fh1BckgMult3","bckg mult "+title[3],500,0,500); | |
1898 | if(fBckgType[4] != kBckgNone) fh1BckgMult4 = new TH1F("fh1BckgMult4","bckg mult "+title[4],500,0,500); | |
1899 | ||
1900 | ||
1901 | if(fQAMode&1){ | |
1902 | fQABckgHisto0RecCuts = new AliFragFuncQATrackHistos("Bckg"+title[0]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1903 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1904 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1905 | fQATrackHighPtThreshold); | |
1906 | fQABckgHisto0Gen = new AliFragFuncQATrackHistos("Bckg"+title[0]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1907 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1908 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1909 | fQATrackHighPtThreshold); | |
1910 | ||
1911 | if(fBckgType[1] != kBckgNone){ | |
1912 | fQABckgHisto1RecCuts = new AliFragFuncQATrackHistos("Bckg"+title[1]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1913 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1914 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1915 | fQATrackHighPtThreshold); | |
1916 | fQABckgHisto1Gen = new AliFragFuncQATrackHistos("Bckg"+title[1]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1917 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1918 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1919 | fQATrackHighPtThreshold); | |
1920 | } | |
1921 | if(fBckgType[2] != kBckgNone){ | |
1922 | fQABckgHisto2RecCuts = new AliFragFuncQATrackHistos("Bckg"+title[2]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1923 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1924 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1925 | fQATrackHighPtThreshold); | |
1926 | fQABckgHisto2Gen = new AliFragFuncQATrackHistos("Bckg"+title[2]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1927 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1928 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1929 | fQATrackHighPtThreshold); | |
1930 | } | |
1931 | if(fBckgType[3] != kBckgNone){ | |
1932 | fQABckgHisto3RecCuts = new AliFragFuncQATrackHistos("Bckg"+title[3]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1933 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1934 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1935 | fQATrackHighPtThreshold); | |
1936 | fQABckgHisto3Gen = new AliFragFuncQATrackHistos("Bckg"+title[3]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1937 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1938 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1939 | fQATrackHighPtThreshold); | |
1940 | } | |
1941 | if(fBckgType[4] != kBckgNone){ | |
1942 | fQABckgHisto4RecCuts = new AliFragFuncQATrackHistos("Bckg"+title[4]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1943 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1944 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1945 | fQATrackHighPtThreshold); | |
1946 | fQABckgHisto4Gen = new AliFragFuncQATrackHistos("Bckg"+title[4]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, | |
1947 | fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax, | |
1948 | fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, | |
1949 | fQATrackHighPtThreshold); | |
1950 | } | |
1951 | } // end: background QA | |
1952 | ||
1953 | if(fFFMode){ | |
1954 | fFFBckgHisto0RecCuts = new AliFragFuncHistos("Bckg"+title[0]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1955 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1956 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1957 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1958 | ||
1959 | fFFBckgHisto0Gen = new AliFragFuncHistos("Bckg"+title[0]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1960 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1961 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1962 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1963 | ||
1964 | if(fBckgType[1] != kBckgNone){ | |
1965 | fFFBckgHisto1RecCuts = new AliFragFuncHistos("Bckg"+title[1]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1966 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1967 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1968 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1969 | fFFBckgHisto1Gen = new AliFragFuncHistos("Bckg"+title[1]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1970 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1971 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1972 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1973 | } | |
1974 | if(fBckgType[2] != kBckgNone){ | |
1975 | fFFBckgHisto2RecCuts = new AliFragFuncHistos("Bckg"+title[2]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1976 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1977 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1978 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1979 | ||
1980 | fFFBckgHisto2Gen = new AliFragFuncHistos("Bckg"+title[2]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1981 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1982 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1983 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1984 | } | |
1985 | if(fBckgType[3] != kBckgNone){ | |
1986 | fFFBckgHisto3RecCuts = new AliFragFuncHistos("Bckg"+title[3]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1987 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1988 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1989 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1990 | ||
1991 | fFFBckgHisto3Gen = new AliFragFuncHistos("Bckg"+title[3]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1992 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1993 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
1994 | fFFNBinsZ , fFFZMin , fFFZMax); | |
1995 | } | |
1996 | if(fBckgType[4] != kBckgNone){ | |
1997 | fFFBckgHisto4RecCuts = new AliFragFuncHistos("Bckg"+title[4]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
1998 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
1999 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
2000 | fFFNBinsZ , fFFZMin , fFFZMax); | |
2001 | ||
2002 | fFFBckgHisto4Gen = new AliFragFuncHistos("Bckg"+title[4]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
2003 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
2004 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
2005 | fFFNBinsZ , fFFZMin , fFFZMax); | |
2006 | } | |
2007 | if(fEffMode){ | |
2008 | fFFBckgHisto0RecEffRec = new AliFragFuncHistos("Bckg"+title[0]+"RecEffRec", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
2009 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
2010 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
2011 | fFFNBinsZ , fFFZMin , fFFZMax); | |
2012 | ||
2013 | fFFBckgHisto0SecRecNS = new AliFragFuncHistos("Bckg"+title[0]+"SecRecNS", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
2014 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
2015 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
2016 | fFFNBinsZ , fFFZMin , fFFZMax); | |
2017 | ||
2018 | fFFBckgHisto0SecRecS = new AliFragFuncHistos("Bckg"+title[0]+"SecRecS", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
2019 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
2020 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
2021 | fFFNBinsZ , fFFZMin , fFFZMax); | |
2022 | ||
2023 | fFFBckgHisto0SecRecSsc = new AliFragFuncHistos("Bckg"+title[0]+"SecRecSsc", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, | |
2024 | fFFNBinsPt, fFFPtMin, fFFPtMax, | |
2025 | fFFNBinsXi, fFFXiMin, fFFXiMax, | |
2026 | fFFNBinsZ , fFFZMin , fFFZMax); | |
2027 | ||
2028 | } | |
2029 | } // end: background FF | |
2030 | ||
2031 | ||
2032 | } // end: background | |
2033 | ||
2034 | ||
2035 | // ____________ define histograms ____________________ | |
2036 | ||
2037 | if(fQAMode){ | |
2038 | if(fQAMode&1){ // track QA | |
2039 | fQATrackHistosRecCuts->DefineHistos(); | |
2040 | fQATrackHistosGen->DefineHistos(); | |
2041 | } | |
2042 | ||
2043 | if(fQAMode&2){ // jet QA | |
2044 | fQAJetHistosRec->DefineHistos(); | |
2045 | fQAJetHistosRecCuts->DefineHistos(); | |
2046 | fQAJetHistosRecCutsLeading->DefineHistos(); | |
2047 | fQAJetHistosGen->DefineHistos(); | |
2048 | fQAJetHistosGenLeading->DefineHistos(); | |
2049 | if(fEffMode) fQAJetHistosRecEffLeading->DefineHistos(); | |
2050 | } | |
2051 | } | |
2052 | ||
2053 | if(fFFMode || fIDFFMode){ | |
2054 | fFFHistosRecCuts->DefineHistos(); | |
2055 | fFFHistosRecCutsInc->DefineHistos(); | |
2056 | fFFHistosRecLeadingTrack->DefineHistos(); | |
2057 | fFFHistosGen->DefineHistos(); | |
2058 | fFFHistosGenInc->DefineHistos(); | |
2059 | fFFHistosGenLeadingTrack->DefineHistos(); | |
2060 | ||
2061 | if (fIDFFMode) { | |
2062 | for (Int_t i = 0; i < AliPID::kSPECIES; i++) { | |
2063 | fIDFFHistosRecCuts[i]->DefineHistos(); | |
2064 | fIDFFHistosGen[i]->DefineHistos(); | |
2065 | } | |
2066 | } | |
2067 | } | |
2068 | ||
2069 | if(fEffMode){ | |
2070 | if(fQAMode&1){ | |
2071 | fQATrackHistosRecEffGen->DefineHistos(); | |
2072 | fQATrackHistosRecEffRec->DefineHistos(); | |
2073 | fQATrackHistosSecRecNS->DefineHistos(); | |
2074 | fQATrackHistosSecRecS->DefineHistos(); | |
2075 | fQATrackHistosSecRecSsc->DefineHistos(); | |
2076 | } | |
2077 | if(fFFMode){ | |
2078 | fFFHistosRecEffRec->DefineHistos(); | |
2079 | fFFHistosSecRecNS->DefineHistos(); | |
2080 | fFFHistosSecRecS->DefineHistos(); | |
2081 | fFFHistosSecRecSsc->DefineHistos(); | |
2082 | } | |
2083 | } // end: efficiency | |
2084 | ||
2085 | // Background | |
2086 | if(fBckgMode){ | |
2087 | if(fFFMode){ | |
2088 | fFFBckgHisto0RecCuts->DefineHistos(); | |
2089 | fFFBckgHisto0Gen->DefineHistos(); | |
2090 | if(fBckgType[1] != kBckgNone) fFFBckgHisto1RecCuts->DefineHistos(); | |
2091 | if(fBckgType[1] != kBckgNone) fFFBckgHisto1Gen->DefineHistos(); | |
2092 | if(fBckgType[2] != kBckgNone) fFFBckgHisto2RecCuts->DefineHistos(); | |
2093 | if(fBckgType[2] != kBckgNone) fFFBckgHisto2Gen->DefineHistos(); | |
2094 | if(fBckgType[3] != kBckgNone) fFFBckgHisto3RecCuts->DefineHistos(); | |
2095 | if(fBckgType[3] != kBckgNone) fFFBckgHisto3Gen->DefineHistos(); | |
2096 | if(fBckgType[4] != kBckgNone) fFFBckgHisto4RecCuts->DefineHistos(); | |
2097 | if(fBckgType[4] != kBckgNone) fFFBckgHisto4Gen->DefineHistos(); | |
2098 | ||
2099 | if(fEffMode){ | |
2100 | fFFBckgHisto0RecEffRec->DefineHistos(); | |
2101 | fFFBckgHisto0SecRecNS->DefineHistos(); | |
2102 | fFFBckgHisto0SecRecS->DefineHistos(); | |
2103 | fFFBckgHisto0SecRecSsc->DefineHistos(); | |
2104 | } | |
2105 | } | |
2106 | ||
2107 | if(fQAMode&1){ | |
2108 | fQABckgHisto0RecCuts->DefineHistos(); | |
2109 | fQABckgHisto0Gen->DefineHistos(); | |
2110 | if(fBckgType[1] != kBckgNone) fQABckgHisto1RecCuts->DefineHistos(); | |
2111 | if(fBckgType[1] != kBckgNone) fQABckgHisto1Gen->DefineHistos(); | |
2112 | if(fBckgType[2] != kBckgNone) fQABckgHisto2RecCuts->DefineHistos(); | |
2113 | if(fBckgType[2] != kBckgNone) fQABckgHisto2Gen->DefineHistos(); | |
2114 | if(fBckgType[3] != kBckgNone) fQABckgHisto3RecCuts->DefineHistos(); | |
2115 | if(fBckgType[3] != kBckgNone) fQABckgHisto3Gen->DefineHistos(); | |
2116 | if(fBckgType[4] != kBckgNone) fQABckgHisto4RecCuts->DefineHistos(); | |
2117 | if(fBckgType[4] != kBckgNone) fQABckgHisto4Gen->DefineHistos(); | |
2118 | } | |
2119 | } // end: background | |
2120 | ||
2121 | ||
2122 | Bool_t genJets = (fJetTypeGen != kJetsUndef) ? kTRUE : kFALSE; | |
2123 | Bool_t genTracks = (fTrackTypeGen != kTrackUndef) ? kTRUE : kFALSE; | |
2124 | Bool_t recJetsEff = (fJetTypeRecEff != kJetsUndef) ? kTRUE : kFALSE; | |
2125 | ||
2126 | fCommonHistList->Add(fh1EvtSelection); | |
2b81de61 | 2127 | fCommonHistList->Add(fh1VtxSelection); |
e131b05f | 2128 | fCommonHistList->Add(fh1EvtMult); |
2129 | fCommonHistList->Add(fh1EvtCent); | |
2130 | fCommonHistList->Add(fh1VertexNContributors); | |
2131 | fCommonHistList->Add(fh1VertexZ); | |
2132 | fCommonHistList->Add(fh1nRecJetsCuts); | |
2133 | fCommonHistList->Add(fh1Xsec); | |
2134 | fCommonHistList->Add(fh1Trials); | |
2135 | fCommonHistList->Add(fh1PtHard); | |
2136 | fCommonHistList->Add(fh1PtHardTrials); | |
2137 | ||
2138 | if(genJets) fCommonHistList->Add(fh1nGenJets); | |
2139 | ||
2140 | // FF histograms | |
2141 | if(fFFMode){ | |
2142 | fFFHistosRecCuts->AddToOutput(fCommonHistList); | |
2143 | fFFHistosRecCutsInc->AddToOutput(fCommonHistList); | |
2144 | fFFHistosRecLeadingTrack->AddToOutput(fCommonHistList); | |
2145 | ||
2146 | if(genJets && genTracks){ | |
2147 | fFFHistosGen->AddToOutput(fCommonHistList); | |
2148 | fFFHistosGenInc->AddToOutput(fCommonHistList); | |
2149 | fFFHistosGenLeadingTrack->AddToOutput(fCommonHistList); | |
2150 | } | |
2151 | ||
2152 | if (fIDFFMode) { | |
2153 | for (Int_t i = 0; i < AliPID::kSPECIES; i++) { | |
2154 | if(genJets && genTracks) | |
2155 | fIDFFHistosGen[i]->AddToOutput(fCommonHistList); | |
2156 | fIDFFHistosRecCuts[i]->AddToOutput(fCommonHistList); | |
2157 | } | |
2158 | } | |
2159 | } | |
2160 | ||
2161 | // Background | |
2162 | if(fBckgMode){ | |
2163 | if(fFFMode){ | |
2164 | fFFBckgHisto0RecCuts->AddToOutput(fCommonHistList); | |
2165 | if(fBckgType[1] != kBckgNone) fFFBckgHisto1RecCuts->AddToOutput(fCommonHistList); | |
2166 | if(fBckgType[2] != kBckgNone) fFFBckgHisto2RecCuts->AddToOutput(fCommonHistList); | |
2167 | if(fBckgType[3] != kBckgNone) fFFBckgHisto3RecCuts->AddToOutput(fCommonHistList); | |
2168 | if(fBckgType[4] != kBckgNone) fFFBckgHisto4RecCuts->AddToOutput(fCommonHistList); | |
2169 | ||
2170 | if(genJets && genTracks){ | |
2171 | fFFBckgHisto0Gen->AddToOutput(fCommonHistList); | |
2172 | if(fBckgType[1] != kBckgNone) fFFBckgHisto1Gen->AddToOutput(fCommonHistList); | |
2173 | if(fBckgType[2] != kBckgNone) fFFBckgHisto2Gen->AddToOutput(fCommonHistList); | |
2174 | if(fBckgType[3] != kBckgNone) fFFBckgHisto3Gen->AddToOutput(fCommonHistList); | |
2175 | if(fBckgType[4] != kBckgNone) fFFBckgHisto4Gen->AddToOutput(fCommonHistList); | |
2176 | } | |
2177 | ||
2178 | if(fEffMode){ | |
2179 | fFFBckgHisto0RecEffRec->AddToOutput(fCommonHistList); | |
2180 | fFFBckgHisto0SecRecNS->AddToOutput(fCommonHistList); | |
2181 | fFFBckgHisto0SecRecS->AddToOutput(fCommonHistList); | |
2182 | fFFBckgHisto0SecRecSsc->AddToOutput(fCommonHistList); | |
2183 | } | |
2184 | } | |
2185 | ||
2186 | if(fQAMode&1){ | |
2187 | fQABckgHisto0RecCuts->AddToOutput(fCommonHistList); | |
2188 | if(fBckgType[1] != kBckgNone) fQABckgHisto1RecCuts->AddToOutput(fCommonHistList); | |
2189 | if(fBckgType[2] != kBckgNone) fQABckgHisto2RecCuts->AddToOutput(fCommonHistList); | |
2190 | if(fBckgType[3] != kBckgNone) fQABckgHisto3RecCuts->AddToOutput(fCommonHistList); | |
2191 | if(fBckgType[4] != kBckgNone) fQABckgHisto4RecCuts->AddToOutput(fCommonHistList); | |
2192 | if(genJets && genTracks){ | |
2193 | fQABckgHisto0Gen->AddToOutput(fCommonHistList); | |
2194 | if(fBckgType[1] != kBckgNone) fQABckgHisto1Gen->AddToOutput(fCommonHistList); | |
2195 | if(fBckgType[2] != kBckgNone) fQABckgHisto2Gen->AddToOutput(fCommonHistList); | |
2196 | if(fBckgType[3] != kBckgNone) fQABckgHisto3Gen->AddToOutput(fCommonHistList); | |
2197 | if(fBckgType[4] != kBckgNone) fQABckgHisto4Gen->AddToOutput(fCommonHistList); | |
2198 | } | |
2199 | } | |
2200 | ||
2201 | if(fh1BckgMult0) fCommonHistList->Add(fh1BckgMult0); | |
2202 | if(fBckgType[1] != kBckgNone) fCommonHistList->Add(fh1BckgMult1); | |
2203 | if(fBckgType[2] != kBckgNone) fCommonHistList->Add(fh1BckgMult2); | |
2204 | if(fBckgType[3] != kBckgNone) fCommonHistList->Add(fh1BckgMult3); | |
2205 | if(fBckgType[4] != kBckgNone) fCommonHistList->Add(fh1BckgMult4); | |
2206 | } | |
2207 | ||
2208 | ||
2209 | if(fBranchEmbeddedJets.Length()){ | |
2210 | fCommonHistList->Add(fh1FractionPtEmbedded); | |
2211 | fCommonHistList->Add(fh1IndexEmbedded); | |
2212 | fCommonHistList->Add(fh2DeltaPtVsJetPtEmbedded); | |
2213 | fCommonHistList->Add(fh2DeltaPtVsRecJetPtEmbedded); | |
2214 | fCommonHistList->Add(fh1DeltaREmbedded); | |
2215 | fCommonHistList->Add(fh1nEmbeddedJets); | |
2216 | } | |
2217 | ||
2218 | ||
2219 | // QA | |
2220 | if(fQAMode){ | |
2221 | if(fQAMode&1){ // track QA | |
2222 | fQATrackHistosRecCuts->AddToOutput(fCommonHistList); | |
2223 | if(genTracks) fQATrackHistosGen->AddToOutput(fCommonHistList); | |
2224 | } | |
2225 | ||
2226 | if(fQAMode&2){ // jet QA | |
2227 | fQAJetHistosRec->AddToOutput(fCommonHistList); | |
2228 | fQAJetHistosRecCuts->AddToOutput(fCommonHistList); | |
2229 | fQAJetHistosRecCutsLeading->AddToOutput(fCommonHistList); | |
2230 | if(recJetsEff && fEffMode) fQAJetHistosRecEffLeading->AddToOutput(fCommonHistList); | |
2231 | if(genJets){ | |
2232 | fQAJetHistosGen->AddToOutput(fCommonHistList); | |
2233 | fQAJetHistosGenLeading->AddToOutput(fCommonHistList); | |
2234 | } | |
2235 | } | |
2236 | } | |
2237 | ||
2238 | if(fBckgMode && | |
2239 | (fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters || | |
2240 | fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || | |
2241 | fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading)) { | |
2242 | fCommonHistList->Add(fh1nRecBckgJetsCuts); | |
2243 | if(genJets) fCommonHistList->Add(fh1nGenBckgJets); | |
2244 | } | |
2245 | ||
2246 | ||
2247 | if(fEffMode && recJetsEff && genTracks){ | |
2248 | if(fQAMode&1){ | |
2249 | fQATrackHistosRecEffGen->AddToOutput(fCommonHistList); | |
2250 | fQATrackHistosRecEffRec->AddToOutput(fCommonHistList); | |
2251 | fQATrackHistosSecRecNS->AddToOutput(fCommonHistList); | |
2252 | fQATrackHistosSecRecS->AddToOutput(fCommonHistList); | |
2253 | fQATrackHistosSecRecSsc->AddToOutput(fCommonHistList); | |
2254 | } | |
2255 | if(fFFMode){ | |
2256 | fFFHistosRecEffRec->AddToOutput(fCommonHistList); | |
2257 | fFFHistosSecRecNS->AddToOutput(fCommonHistList); | |
2258 | fFFHistosSecRecS->AddToOutput(fCommonHistList); | |
2259 | fFFHistosSecRecSsc->AddToOutput(fCommonHistList); | |
2260 | } | |
2261 | fCommonHistList->Add(fh1nRecEffJets); | |
2262 | fCommonHistList->Add(fh2PtRecVsGenPrim); | |
2263 | fCommonHistList->Add(fh2PtRecVsGenSec); | |
2264 | } | |
2265 | ||
2266 | // jet shape | |
2267 | if(fJSMode){ | |
2268 | ||
2269 | fProNtracksLeadingJet = new TProfile("AvgNoOfTracksLeadingJet","AvgNoOfTracksLeadingJet",100,0,250,0,50); | |
2270 | fProDelR80pcPt = new TProfile("AvgdelR80pcPt","AvgdelR80pcPt",100,0,250,0,1); | |
2271 | ||
2272 | if(genJets && genTracks){ | |
2273 | fProNtracksLeadingJetGen = new TProfile("AvgNoOfTracksLeadingJetGen","AvgNoOfTracksLeadingJetGen",100,0,250,0,50); | |
2274 | fProDelR80pcPtGen = new TProfile("AvgdelR80pcPtGen","AvgdelR80pcPtGen",100,0,250,0,1); | |
2275 | } | |
2276 | ||
2277 | if(fBckgMode) | |
2278 | fProNtracksLeadingJetBgrPerp2 = new TProfile("AvgNoOfTracksLeadingJetBgrPerp2","AvgNoOfTracksLeadingJetBgrPerp2",100,0,250,0,50); | |
2279 | ||
2280 | if(fEffMode){ | |
2281 | fProNtracksLeadingJetRecPrim = new TProfile("AvgNoOfTracksLeadingJetRecPrim","AvgNoOfTracksLeadingJetRecPrim",100,0,250,0,50); | |
2282 | fProDelR80pcPtRecPrim = new TProfile("AvgdelR80pcPtRecPrim","AvgdelR80pcPtRecPrim",100,0,250,0,1); | |
2283 | fProNtracksLeadingJetRecSecNS = new TProfile("AvgNoOfTracksLeadingJetRecSecNS","AvgNoOfTracksLeadingJetRecSecNS",100,0,250,0,50); | |
2284 | fProNtracksLeadingJetRecSecS = new TProfile("AvgNoOfTracksLeadingJetRecSecS","AvgNoOfTracksLeadingJetRecSecS",100,0,250,0,50); | |
2285 | fProNtracksLeadingJetRecSecSsc = new TProfile("AvgNoOfTracksLeadingJetRecSecSsc","AvgNoOfTracksLeadingJetRecSecSsc",100,0,250,0,50); | |
2286 | } | |
2287 | ||
2288 | TString strTitJS; | |
2289 | for(Int_t ii=0; ii<5; ii++){ | |
2290 | if(ii==0)strTitJS = "_JetPt20to30"; | |
2291 | if(ii==1)strTitJS = "_JetPt30to40"; | |
2292 | if(ii==2)strTitJS = "_JetPt40to60"; | |
2293 | if(ii==3)strTitJS = "_JetPt60to80"; | |
2294 | if(ii==4)strTitJS = "_JetPt80to100"; | |
2295 | ||
2296 | fProDelRPtSum[ii] = new TProfile(Form("AvgPtSumDelR%s",strTitJS.Data()),Form("AvgPtSumDelR%s",strTitJS.Data()),50,0,1,0,250); | |
2297 | if(genJets && genTracks) | |
2298 | fProDelRPtSumGen[ii] = new TProfile(Form("AvgPtSumDelRGen%s",strTitJS.Data()),Form("AvgPtSumDelRGen%s",strTitJS.Data()),50,0,1,0,250); | |
2299 | if(fBckgMode) | |
2300 | fProDelRPtSumBgrPerp2[ii] = new TProfile(Form("AvgPtSumDelRBgrPerp2%s",strTitJS.Data()),Form("AvgPtSumDelRBgrPerp2%s",strTitJS.Data()),50,0,1,0,250); | |
2301 | if(fEffMode){ | |
2302 | fProDelRPtSumRecPrim[ii] = new TProfile(Form("AvgPtSumDelRRecPrim%s",strTitJS.Data()),Form("AvgPtSumDelRRecPrim%s",strTitJS.Data()),50,0,1,0,250); | |
2303 | fProDelRPtSumRecSecNS[ii] = new TProfile(Form("AvgPtSumDelRRecSecNS%s",strTitJS.Data()),Form("AvgPtSumDelRRecSecNS%s",strTitJS.Data()),50,0,1,0,250); | |
2304 | fProDelRPtSumRecSecS[ii] = new TProfile(Form("AvgPtSumDelRRecSecS%s",strTitJS.Data()),Form("AvgPtSumDelRRecSecS%s",strTitJS.Data()),50,0,1,0,250); | |
2305 | fProDelRPtSumRecSecSsc[ii] = new TProfile(Form("AvgPtSumDelRRecSecSsc%s",strTitJS.Data()),Form("AvgPtSumDelRRecSecSsc%s",strTitJS.Data()),50,0,1,0,250); | |
2306 | } | |
2307 | } | |
2308 | ||
2309 | fCommonHistList->Add(fProNtracksLeadingJet); | |
2310 | fCommonHistList->Add(fProDelR80pcPt); | |
2311 | for(int ii=0; ii<5; ii++) fCommonHistList->Add(fProDelRPtSum[ii]); | |
2312 | ||
2313 | if(genJets && genTracks){ | |
2314 | fCommonHistList->Add(fProNtracksLeadingJetGen); | |
2315 | fCommonHistList->Add(fProDelR80pcPtGen); | |
2316 | for(Int_t ii=0; ii<5; ii++) fCommonHistList->Add(fProDelRPtSumGen[ii]); | |
2317 | } | |
2318 | ||
2319 | if(fBckgMode){ | |
2320 | fCommonHistList->Add(fProNtracksLeadingJetBgrPerp2); | |
2321 | for(Int_t ii=0; ii<5; ii++) fCommonHistList->Add(fProDelRPtSumBgrPerp2[ii]); | |
2322 | } | |
2323 | ||
2324 | if(fEffMode){ | |
2325 | fCommonHistList->Add(fProNtracksLeadingJetRecPrim); | |
2326 | fCommonHistList->Add(fProDelR80pcPtRecPrim); | |
2327 | for(Int_t ii=0; ii<5; ii++) fCommonHistList->Add(fProDelRPtSumRecPrim[ii]); | |
2328 | ||
2329 | fCommonHistList->Add(fProNtracksLeadingJetRecSecNS); | |
2330 | for(Int_t ii=0; ii<5; ii++) fCommonHistList->Add(fProDelRPtSumRecSecNS[ii]); | |
2331 | ||
2332 | fCommonHistList->Add(fProNtracksLeadingJetRecSecS); | |
2333 | for(Int_t ii=0; ii<5; ii++) fCommonHistList->Add(fProDelRPtSumRecSecS[ii]); | |
2334 | ||
2335 | fCommonHistList->Add(fProNtracksLeadingJetRecSecSsc); | |
2336 | for(Int_t ii=0; ii<5; ii++) fCommonHistList->Add(fProDelRPtSumRecSecSsc[ii]); | |
2337 | } | |
2338 | } | |
a2a9d6d2 | 2339 | |
2340 | // Default analysis utils | |
2341 | fAnaUtils = new AliAnalysisUtils(); | |
2342 | ||
2343 | // Not used yet, but to be save, forward vertex z cut to analysis utils object | |
2344 | fAnaUtils->SetMaxVtxZ(fMaxVertexZ); | |
e131b05f | 2345 | |
e131b05f | 2346 | // Load PID framework if desired |
9e95a906 | 2347 | if(fDebug > 1) Printf("AliAnalysisTaskIDFragmentationFunction::UserCreateOutputObjects() -> Loading PID framework"); |
e131b05f | 2348 | |
2349 | fUseJetPIDtask = fIDFFMode || fFFMode; | |
2350 | fUseInclusivePIDtask = fQAMode && (fQAMode&1); | |
2351 | ||
2352 | if (fUseJetPIDtask || fUseInclusivePIDtask) { | |
2353 | TObjArray* tasks = AliAnalysisManager::GetAnalysisManager()->GetTasks(); | |
2354 | if (!tasks) { | |
2355 | Printf("ERROR loading PID tasks: Failed to retrieve tasks from analysis manager!\n"); | |
2356 | ||
2357 | fUseJetPIDtask = kFALSE; | |
2358 | fUseInclusivePIDtask = kFALSE; | |
2359 | } | |
2360 | ||
2361 | if (fUseJetPIDtask) { | |
93fb15f0 ML |
2362 | delete [] fJetPIDtask; |
2363 | fJetPIDtask = 0x0; | |
2364 | ||
e131b05f | 2365 | if (fNumJetPIDtasks > 0) { |
93fb15f0 ML |
2366 | fJetPIDtask = new AliAnalysisTaskPID*[fNumJetPIDtasks]; |
2367 | ||
e131b05f | 2368 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
2369 | fJetPIDtask[i] = (AliAnalysisTaskPID*)tasks->FindObject(fNameJetPIDtask[i].Data()); | |
2370 | ||
2371 | if (!fJetPIDtask[i]) { | |
2372 | Printf("ERROR: Failed to load jet pid task!\n"); | |
2373 | fUseJetPIDtask = kFALSE; | |
2374 | } | |
2375 | } | |
2376 | } | |
2377 | else { | |
77324970 | 2378 | Printf("WARNING: zero jet pid tasks!\n"); |
e131b05f | 2379 | fUseJetPIDtask = kFALSE; |
2380 | } | |
2381 | } | |
2382 | ||
2383 | if (fUseInclusivePIDtask) { | |
93fb15f0 ML |
2384 | delete [] fInclusivePIDtask; |
2385 | fInclusivePIDtask = 0x0; | |
2386 | ||
e131b05f | 2387 | if (fNumInclusivePIDtasks > 0) { |
93fb15f0 ML |
2388 | fInclusivePIDtask = new AliAnalysisTaskPID*[fNumInclusivePIDtasks]; |
2389 | ||
e131b05f | 2390 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { |
2391 | fInclusivePIDtask[i] = (AliAnalysisTaskPID*)tasks->FindObject(fNameInclusivePIDtask[i].Data()); | |
2392 | ||
2393 | if (!fInclusivePIDtask[i]) { | |
2394 | Printf("ERROR: Failed to load inclusive pid task!\n"); | |
2395 | fUseInclusivePIDtask = kFALSE; | |
2396 | } | |
2397 | } | |
2398 | } | |
2399 | else { | |
77324970 CKB |
2400 | Printf("WARNING: zero inclusive pid tasks!\n"); |
2401 | fUseInclusivePIDtask = kFALSE; | |
e131b05f | 2402 | } |
2403 | } | |
2404 | } | |
265e4931 | 2405 | |
630a4bcd | 2406 | const Int_t nRefMultBins = 100; |
2407 | const Double_t refMultUp = 100.; | |
2408 | const Double_t refMultDown = 0.; | |
2409 | ||
2410 | const Int_t nJetPtBins = 20; | |
2411 | const Double_t jetPtUp = 100.; | |
2412 | const Double_t jetPtDown = 0.; | |
2413 | ||
a2a9d6d2 | 2414 | const Int_t nCentBins = 12; |
2415 | const Double_t binsCentpp[nCentBins+1] = { 0, 0.01, 0.1, 1, 5, 10, 15, 20, 30, 40, 50, 70, 100}; | |
2416 | ||
630a4bcd | 2417 | fhJetPtRefMultEta5 = new TH2F("fhJetPtRefMultEta5", |
2418 | "Correlation between jet energy and event multiplicity (|#eta| < 0.5);Ref. mult. (|#eta| < 0.5);#it{p}_{T, jet}^{ch} (GeV/#it{c})", | |
2419 | nRefMultBins, refMultDown, refMultUp, nJetPtBins, jetPtDown, jetPtUp); | |
2420 | fhJetPtRefMultEta8 = new TH2F("fhJetPtRefMultEta8", | |
2421 | "Correlation between jet energy and event multiplicity (|#eta| < 0.8);Ref. mult. (|#eta| < 0.8);#it{p}_{T, jet}^{ch} (GeV/#it{c})", | |
2422 | nRefMultBins, refMultDown, refMultUp, nJetPtBins, jetPtDown, jetPtUp); | |
a2a9d6d2 | 2423 | fhJetPtMultPercent = new TH2F("fhJetPtMultPercent", |
2424 | "Correlation between jet energy and event multiplicity percentile (V0M);Multiplicity Percentile (V0M);#it{p}_{T, jet}^{ch} (GeV/#it{c})", | |
2425 | nCentBins, binsCentpp, nJetPtBins, jetPtDown, jetPtUp); | |
630a4bcd | 2426 | fCommonHistList->Add(fhJetPtRefMultEta5); |
2427 | fCommonHistList->Add(fhJetPtRefMultEta8); | |
a2a9d6d2 | 2428 | fCommonHistList->Add(fhJetPtMultPercent); |
630a4bcd | 2429 | |
265e4931 | 2430 | if (fUseJetPIDtask) { |
2431 | const Int_t nPtBins = 68; | |
2432 | Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, | |
2433 | 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, | |
2434 | 1.0, 1.1 , 1.2, 1.3 , 1.4, 1.5 , 1.6, 1.7 , 1.8, 1.9 , | |
2435 | 2.0, 2.2 , 2.4, 2.6 , 2.8, 3.0 , 3.2, 3.4 , 3.6, 3.8 , | |
2436 | 4.0, 4.5 , 5.0, 5.5 , 6.0, 6.5 , 7.0, 8.0 , 9.0, 10.0, | |
2437 | 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0, 22.0, 24.0, | |
2438 | 26.0, 28.0, 30.0, 32.0, 34.0, 36.0, 40.0, 45.0, 50.0 }; | |
2439 | ||
2440 | const Int_t DCAbins = 320; | |
2441 | const Double_t DCA_Z_max = 3.5; | |
2442 | const Double_t DCA_XY_max = 2.5; | |
2443 | ||
2444 | fhDCA_XY = new TH2F("fhDCA_XY", "All rec. tracks;#it{p}_{T} (GeV/#it{c});DCA_{XY}", nPtBins, binsPt, DCAbins, -DCA_XY_max, DCA_XY_max); | |
2445 | fhDCA_Z = new TH2F("fhDCA_Z", "All rec. tracks;#it{p}_{T} (GeV/#it{c});DCA_{Z}", nPtBins, binsPt, DCAbins, -DCA_Z_max, DCA_Z_max); | |
2446 | fCommonHistList->Add(fhDCA_XY); | |
2447 | fCommonHistList->Add(fhDCA_Z); | |
2448 | ||
2449 | for (Int_t i = 0; i < AliPID::kSPECIES; i++) { | |
2450 | fhDCA_XY_prim_MCID[i] = new TH2F(Form("fhDCA_XY_prim_MCID_%s", AliPID::ParticleShortName(i)), | |
2451 | Form("Rec. %s (prim.);#it{p}_{T} (GeV/#it{c});DCA_{XY}", AliPID::ParticleLatexName(i)), | |
2452 | nPtBins, binsPt, DCAbins, -DCA_XY_max, DCA_XY_max); | |
2453 | fhDCA_Z_prim_MCID[i] = new TH2F(Form("fhDCA_Z_prim_MCID_%s", AliPID::ParticleShortName(i)), | |
2454 | Form("Rec. %s (prim.);#it{p}_{T} (GeV/#it{c});DCA_{Z}", AliPID::ParticleLatexName(i)), | |
2455 | nPtBins, binsPt, DCAbins, -DCA_Z_max, DCA_Z_max); | |
2456 | fCommonHistList->Add(fhDCA_XY_prim_MCID[i]); | |
2457 | fCommonHistList->Add(fhDCA_Z_prim_MCID[i]); | |
2458 | ||
2459 | fhDCA_XY_sec_MCID[i] = new TH2F(Form("fhDCA_XY_sec_MCID_%s", AliPID::ParticleShortName(i)), | |
2460 | Form("Rec. %s (sec.);#it{p}_{T} (GeV/#it{c});DCA_{XY}", AliPID::ParticleLatexName(i)), | |
2461 | nPtBins, binsPt, DCAbins, -DCA_XY_max, DCA_XY_max); | |
2462 | fhDCA_Z_sec_MCID[i] = new TH2F(Form("fhDCA_Z_sec_MCID_%s", AliPID::ParticleShortName(i)), | |
2463 | Form("Rec. %s (sec.);#it{p}_{T} (GeV/#it{c});DCA_{Z}", AliPID::ParticleLatexName(i)), | |
2464 | nPtBins, binsPt, DCAbins, -DCA_Z_max, DCA_Z_max); | |
2465 | fCommonHistList->Add(fhDCA_XY_sec_MCID[i]); | |
2466 | fCommonHistList->Add(fhDCA_Z_sec_MCID[i]); | |
2467 | } | |
2468 | } | |
2469 | ||
2470 | ||
2471 | // =========== Switch on Sumw2 for all histos =========== | |
2472 | for (Int_t i=0; i<fCommonHistList->GetEntries(); ++i){ | |
2473 | TH1 *h1 = dynamic_cast<TH1*>(fCommonHistList->At(i)); | |
2474 | if (h1) h1->Sumw2(); | |
2475 | else{ | |
2476 | THnSparse *hnSparse = dynamic_cast<THnSparse*>(fCommonHistList->At(i)); | |
2477 | if(hnSparse) hnSparse->Sumw2(); | |
2478 | } | |
2479 | } | |
2480 | ||
2481 | TH1::AddDirectory(oldStatus); | |
e131b05f | 2482 | |
9e95a906 | 2483 | if(fDebug > 2) Printf("AliAnalysisTaskIDFragmentationFunction::UserCreateOutputObjects() -> Posting Output"); |
2484 | ||
e131b05f | 2485 | PostData(1, fCommonHistList); |
9e95a906 | 2486 | |
2487 | if(fDebug > 2) Printf("AliAnalysisTaskIDFragmentationFunction::UserCreateOutputObjects() -> Done"); | |
e131b05f | 2488 | } |
2489 | ||
2490 | //_______________________________________________ | |
2491 | void AliAnalysisTaskIDFragmentationFunction::Init() | |
2492 | { | |
2493 | // Initialization | |
2494 | if(fDebug > 1) Printf("AliAnalysisTaskIDFragmentationFunction::Init()"); | |
2495 | ||
2496 | } | |
2497 | ||
2498 | //_____________________________________________________________ | |
2499 | void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *) | |
2500 | { | |
2501 | // Main loop | |
2502 | // Called for each event | |
2503 | ||
2504 | if(fDebug > 1) Printf("AliAnalysisTaskIDFragmentationFunction::UserExec()"); | |
2505 | ||
2506 | ||
2507 | if(fDebug > 1) Printf("Analysis event #%5d", (Int_t) fEntry); | |
2508 | ||
2509 | // Trigger selection | |
2510 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) | |
2511 | ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()); | |
2512 | ||
2513 | if(!(inputHandler->IsEventSelected() & fEvtSelectionMask)){ | |
2514 | fh1EvtSelection->Fill(1.); | |
2515 | if (fDebug > 1 ) Printf(" Trigger Selection: event REJECTED ... "); | |
2516 | PostData(1, fCommonHistList); | |
2517 | return; | |
2518 | } | |
2519 | ||
2520 | fESD = dynamic_cast<AliESDEvent*>(InputEvent()); | |
2521 | if(!fESD){ | |
2522 | if(fDebug>3) Printf("%s:%d ESDEvent not found in the input", (char*)__FILE__,__LINE__); | |
2523 | } | |
2524 | ||
2525 | fMCEvent = MCEvent(); | |
2526 | if(!fMCEvent){ | |
2527 | if(fDebug>3) Printf("%s:%d MCEvent not found in the input", (char*)__FILE__,__LINE__); | |
2528 | } | |
2529 | ||
2530 | // get AOD event from input/ouput | |
2531 | TObject* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler(); | |
2532 | if( handler && handler->InheritsFrom("AliAODInputHandler") ) { | |
2533 | fAOD = ((AliAODInputHandler*)handler)->GetEvent(); | |
2534 | if(fUseAODInputJets) fAODJets = fAOD; | |
2535 | if (fDebug > 1) Printf("%s:%d AOD event from input", (char*)__FILE__,__LINE__); | |
2536 | } | |
2537 | else { | |
2538 | handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler(); | |
2539 | if( handler && handler->InheritsFrom("AliAODHandler") ) { | |
2540 | fAOD = ((AliAODHandler*)handler)->GetAOD(); | |
2541 | fAODJets = fAOD; | |
2542 | if (fDebug > 1) Printf("%s:%d AOD event from output", (char*)__FILE__,__LINE__); | |
2543 | } | |
2544 | } | |
2545 | ||
2546 | if(!fAODJets && !fUseAODInputJets){ // case we have AOD in input & output and want jets from output | |
2547 | TObject* outHandler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler(); | |
2548 | if( outHandler && outHandler->InheritsFrom("AliAODHandler") ) { | |
2549 | fAODJets = ((AliAODHandler*)outHandler)->GetAOD(); | |
2550 | if (fDebug > 1) Printf("%s:%d jets from output AOD", (char*)__FILE__,__LINE__); | |
2551 | } | |
2552 | } | |
2553 | ||
2554 | if(fNonStdFile.Length()!=0){ | |
2555 | // case we have an AOD extension - fetch the jets from the extended output | |
2556 | ||
2557 | AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()); | |
2558 | fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0); | |
2559 | if(!fAODExtension){ | |
2560 | if(fDebug>1)Printf("AODExtension not found for %s",fNonStdFile.Data()); | |
2561 | } | |
2562 | } | |
2563 | ||
2564 | if(!fAOD){ | |
2565 | Printf("%s:%d AODEvent not found", (char*)__FILE__,__LINE__); | |
2566 | return; | |
2567 | } | |
2568 | if(!fAODJets){ | |
2569 | Printf("%s:%d AODEvent with jet branch not found", (char*)__FILE__,__LINE__); | |
2570 | return; | |
2571 | } | |
2572 | ||
2573 | ||
2574 | // event selection ************************************************** | |
2575 | // *** event class *** | |
2576 | AliVEvent* evtForCentDetermination = handler->InheritsFrom("AliAODInputHandler") ? fAOD : InputEvent(); | |
2577 | ||
2578 | Double_t centPercent = -1; | |
2579 | if(fEventClass>0){ | |
2580 | Int_t cl = 0; | |
2581 | if(handler->InheritsFrom("AliAODInputHandler")){ | |
2582 | // since it is not supported by the helper task define own classes | |
0a918d8d | 2583 | centPercent = ((AliVAODHeader*)fAOD->GetHeader())->GetCentrality(); |
e131b05f | 2584 | cl = 1; |
2585 | if(centPercent>10) cl = 2; | |
2586 | if(centPercent>30) cl = 3; | |
2587 | if(centPercent>50) cl = 4; | |
2588 | } | |
2589 | else { | |
2590 | cl = AliAnalysisHelperJetTasks::EventClass(); | |
2591 | if(fESD) centPercent = fESD->GetCentrality()->GetCentralityPercentile("V0M"); // retrieve value 'by hand' | |
2592 | } | |
2593 | ||
2594 | if(cl!=fEventClass){ | |
2595 | // event not in selected event class, reject event | |
2596 | if (fDebug > 1) Printf("%s:%d event not in selected event class: event REJECTED ...",(char*)__FILE__,__LINE__); | |
2597 | fh1EvtSelection->Fill(2.); | |
2598 | PostData(1, fCommonHistList); | |
2599 | return; | |
2600 | } | |
2601 | } | |
4b4d71d4 | 2602 | |
630a4bcd | 2603 | // Retrieve reference multiplicities in |eta|<0.8 and <0.5 |
0a918d8d | 2604 | |
2605 | AliAODHeader * header = dynamic_cast<AliAODHeader*>(fAOD->GetHeader()); | |
2606 | if(!header) AliFatal("Not a standard AOD"); | |
2607 | ||
2608 | const Int_t refMult5 = header->GetRefMultiplicityComb05(); | |
2609 | const Int_t refMult8 = header->GetRefMultiplicityComb08(); | |
a2a9d6d2 | 2610 | const Double_t centPercentPP = fAnaUtils->GetMultiplicityPercentile(fAOD, "V0M"); |
630a4bcd | 2611 | |
4b4d71d4 | 2612 | |
2613 | // Count events with trigger selection, note: Set centrality percentile fix to -1 for pp for PID framework | |
2614 | if (fUseJetPIDtask) { | |
2615 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
2616 | fJetPIDtask[i]->IncrementEventCounter(fIsPP ? -1. : centPercent, AliAnalysisTaskPID::kTriggerSel); | |
2617 | } | |
2618 | } | |
2619 | ||
2620 | if (fUseInclusivePIDtask) { | |
2621 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
2622 | fInclusivePIDtask[i]->IncrementEventCounter(fIsPP ? -1. : centPercent, AliAnalysisTaskPID::kTriggerSel); | |
2623 | } | |
2624 | } | |
e131b05f | 2625 | |
2626 | // *** vertex cut *** | |
2627 | AliAODVertex* primVtx = fAOD->GetPrimaryVertex(); | |
2628 | if (!primVtx) { | |
2629 | Printf("%s:%d Primary vertex not found", (char*)__FILE__,__LINE__); | |
2630 | return; | |
2631 | } | |
2632 | ||
2633 | Int_t nTracksPrim = primVtx->GetNContributors(); | |
2634 | fh1VertexNContributors->Fill(nTracksPrim); | |
2635 | ||
2636 | ||
2637 | if (fDebug > 1) Printf("%s:%d primary vertex selection: %d", (char*)__FILE__,__LINE__,nTracksPrim); | |
4b4d71d4 | 2638 | if(nTracksPrim <= 0) { |
e131b05f | 2639 | if (fDebug > 1) Printf("%s:%d primary vertex selection: event REJECTED...",(char*)__FILE__,__LINE__); |
2640 | fh1EvtSelection->Fill(3.); | |
2641 | PostData(1, fCommonHistList); | |
2642 | return; | |
2643 | } | |
2644 | ||
4b4d71d4 | 2645 | TString primVtxName(primVtx->GetName()); |
2646 | ||
2647 | if(primVtxName.CompareTo("TPCVertex",TString::kIgnoreCase) == 1){ | |
2648 | if (fDebug > 1) Printf("%s:%d primary vertex selection: TPC vertex, event REJECTED...",(char*)__FILE__,__LINE__); | |
2649 | fh1EvtSelection->Fill(5.); | |
2650 | PostData(1, fCommonHistList); | |
2651 | return; | |
2652 | } | |
2653 | ||
2654 | // Count events with trigger selection and vtx cut, note: Set centrality percentile fix to -1 for pp for PID framework | |
2655 | if (fUseJetPIDtask) { | |
2656 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
2657 | fJetPIDtask[i]->IncrementEventCounter(fIsPP ? -1. : centPercent, AliAnalysisTaskPID::kTriggerSelAndVtxCut); | |
2658 | } | |
2659 | } | |
2660 | ||
2661 | if (fUseInclusivePIDtask) { | |
2662 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
2663 | fInclusivePIDtask[i]->IncrementEventCounter(fIsPP ? -1. : centPercent, AliAnalysisTaskPID::kTriggerSelAndVtxCut); | |
2664 | } | |
2665 | } | |
2666 | ||
e131b05f | 2667 | fh1VertexZ->Fill(primVtx->GetZ()); |
2668 | ||
2669 | if(TMath::Abs(primVtx->GetZ())>fMaxVertexZ){ | |
2670 | if (fDebug > 1) Printf("%s:%d primary vertex z = %f: event REJECTED...",(char*)__FILE__,__LINE__,primVtx->GetZ()); | |
2671 | fh1EvtSelection->Fill(4.); | |
2672 | PostData(1, fCommonHistList); | |
2673 | return; | |
2674 | } | |
2675 | ||
ec994e6a | 2676 | // Count events with trigger selection, vtx cut and z vtx cut, note: Set centrality percentile fix to -1 for pp for PID framework |
4b4d71d4 | 2677 | if (fUseJetPIDtask) { |
2678 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
ec994e6a | 2679 | fJetPIDtask[i]->IncrementEventCounter(fIsPP ? -1. : centPercent, AliAnalysisTaskPID::kTriggerSelAndVtxCutAndZvtxCutNoPileUpRejection); |
4b4d71d4 | 2680 | } |
e131b05f | 2681 | } |
4b4d71d4 | 2682 | |
2683 | if (fUseInclusivePIDtask) { | |
2684 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
ec994e6a | 2685 | fInclusivePIDtask[i]->IncrementEventCounter(fIsPP ? -1. : centPercent, AliAnalysisTaskPID::kTriggerSelAndVtxCutAndZvtxCutNoPileUpRejection); |
4b4d71d4 | 2686 | } |
2687 | } | |
2688 | ||
ec994e6a | 2689 | |
2690 | // Store for each task, whether this task would tag this event as pile-up or not | |
2691 | const Int_t arrSizeJet = TMath::Max(1, fNumJetPIDtasks); | |
2692 | const Int_t arrSizeInclusive = TMath::Max(1, fNumInclusivePIDtasks); | |
2693 | Bool_t isPileUpJetPIDtask[arrSizeJet]; | |
2694 | Bool_t isPileUpInclusivePIDtask[arrSizeInclusive]; | |
2695 | ||
2696 | for (Int_t i = 0; i < arrSizeJet; i++) | |
2697 | isPileUpJetPIDtask[i] = kFALSE; | |
2698 | ||
2699 | for (Int_t i = 0; i < arrSizeInclusive; i++) | |
2700 | isPileUpInclusivePIDtask[i] = kFALSE; | |
2701 | ||
2702 | // Check whether there is at least one task that does not reject the event (saves processing time in the following code) | |
2703 | Bool_t isPileUpForAllJetPIDTasks = kTRUE; | |
2704 | Bool_t isPileUpForAllInclusivePIDTasks = kTRUE; | |
2705 | ||
2706 | // Count events with trigger selection, vtx cut, z vtx cut and after pile-up rejection (if enabled in that task) | |
2707 | // Note: Set centrality percentile fix to -1 for pp for PID framework | |
2708 | if (fUseJetPIDtask) { | |
2709 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
2710 | isPileUpJetPIDtask[i] = fJetPIDtask[i]->GetIsPileUp(fAOD, fJetPIDtask[i]->GetPileUpRejectionType()); | |
2711 | if (!isPileUpJetPIDtask[i]) | |
2712 | fJetPIDtask[i]->IncrementEventCounter(fIsPP ? -1. : centPercent, AliAnalysisTaskPID::kTriggerSelAndVtxCutAndZvtxCut); | |
2713 | ||
2714 | isPileUpForAllJetPIDTasks = isPileUpForAllJetPIDTasks && isPileUpJetPIDtask[i]; | |
2715 | } | |
2716 | } | |
2717 | ||
2718 | if (fUseInclusivePIDtask) { | |
2719 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
2720 | isPileUpInclusivePIDtask[i] = fInclusivePIDtask[i]->GetIsPileUp(fAOD, fInclusivePIDtask[i]->GetPileUpRejectionType()); | |
2721 | if (!isPileUpInclusivePIDtask[i]) | |
2722 | fInclusivePIDtask[i]->IncrementEventCounter(fIsPP ? -1. : centPercent, AliAnalysisTaskPID::kTriggerSelAndVtxCutAndZvtxCut); | |
2723 | ||
2724 | isPileUpForAllInclusivePIDTasks = isPileUpForAllInclusivePIDTasks && isPileUpInclusivePIDtask[i]; | |
2725 | } | |
2726 | } | |
2727 | ||
2728 | ||
e131b05f | 2729 | if (fDebug > 1) Printf("%s:%d event ACCEPTED ...",(char*)__FILE__,__LINE__); |
2730 | fh1EvtSelection->Fill(0.); | |
2b81de61 | 2731 | fh1VtxSelection->Fill(primVtx->GetType()); |
e131b05f | 2732 | fh1EvtCent->Fill(centPercent); |
2733 | ||
2734 | // Set centrality percentile fix to -1 for pp to be used for the PID framework | |
2735 | if (fIsPP) | |
2736 | centPercent = -1; | |
2737 | ||
1a8d4484 | 2738 | |
2739 | ||
2740 | // Call ConfigureTaskForCurrentEvent of PID tasks to ensure that everything is set up properly for the current event | |
2741 | // (e.g. run/period dependence of max eta variation map) | |
2742 | if (fUseInclusivePIDtask) { | |
2743 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) | |
ec994e6a | 2744 | if (!isPileUpInclusivePIDtask[i]) |
2745 | fInclusivePIDtask[i]->ConfigureTaskForCurrentEvent(fAOD); | |
1a8d4484 | 2746 | } |
2747 | ||
2748 | if (fUseJetPIDtask) { | |
2749 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) | |
ec994e6a | 2750 | if (!isPileUpJetPIDtask[i]) |
2751 | fJetPIDtask[i]->ConfigureTaskForCurrentEvent(fAOD); | |
1a8d4484 | 2752 | } |
2753 | ||
2754 | ||
2755 | ||
e131b05f | 2756 | //___ get MC information __________________________________________________________________ |
2757 | ||
2758 | fh1Trials->Fill("#sum{ntrials}",fAvgTrials); | |
2759 | ||
2760 | if (fUseInclusivePIDtask) { | |
ec994e6a | 2761 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { |
2762 | if (!isPileUpInclusivePIDtask[i]) | |
2763 | fInclusivePIDtask[i]->FillPythiaTrials(fAvgTrials); | |
2764 | } | |
e131b05f | 2765 | } |
2766 | ||
2767 | if (fUseJetPIDtask) { | |
ec994e6a | 2768 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
2769 | if (!isPileUpJetPIDtask[i]) | |
2770 | fJetPIDtask[i]->FillPythiaTrials(fAvgTrials); | |
2771 | } | |
e131b05f | 2772 | } |
2773 | ||
2774 | Double_t ptHard = 0.; | |
2775 | Double_t nTrials = 1; // trials for MC trigger weight for real data | |
2776 | ||
2777 | if(fMCEvent){ | |
2778 | AliGenEventHeader* genHeader = fMCEvent->GenEventHeader(); | |
2779 | ||
2780 | if(genHeader){ | |
2781 | ||
2782 | AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader); | |
2783 | AliGenHijingEventHeader* hijingGenHeader = 0x0; | |
2784 | ||
2785 | if(pythiaGenHeader){ | |
2786 | if(fDebug>3) Printf("%s:%d pythiaGenHeader found", (char*)__FILE__,__LINE__); | |
2787 | nTrials = pythiaGenHeader->Trials(); | |
2788 | ptHard = pythiaGenHeader->GetPtHard(); | |
2789 | ||
2790 | fh1PtHard->Fill(ptHard); | |
2791 | fh1PtHardTrials->Fill(ptHard,nTrials); | |
2792 | ||
2793 | } else { // no pythia, hijing? | |
2794 | ||
2795 | if(fDebug>3) Printf("%s:%d no pythiaGenHeader found", (char*)__FILE__,__LINE__); | |
2796 | ||
2797 | hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader); | |
2798 | if(!hijingGenHeader){ | |
2799 | Printf("%s:%d no pythiaGenHeader or hjingGenHeader found", (char*)__FILE__,__LINE__); | |
2800 | } else { | |
2801 | if(fDebug>3) Printf("%s:%d hijingGenHeader found", (char*)__FILE__,__LINE__); | |
2802 | } | |
2803 | } | |
2804 | ||
2805 | //fh1Trials->Fill("#sum{ntrials}",fAvgTrials); | |
2806 | } | |
2807 | } | |
2808 | ||
2809 | //___ fetch jets __________________________________________________________________________ | |
2810 | ||
2811 | Int_t nJ = GetListOfJets(fJetsRec, kJetsRec); | |
2812 | Int_t nRecJets = 0; | |
2813 | if(nJ>=0) nRecJets = fJetsRec->GetEntries(); | |
2814 | if(fDebug>2)Printf("%s:%d Selected Rec jets: %d %d",(char*)__FILE__,__LINE__,nJ,nRecJets); | |
2815 | if(nJ != nRecJets) Printf("%s:%d Mismatch Selected Rec Jets: %d %d",(char*)__FILE__,__LINE__,nJ,nRecJets); | |
2816 | ||
2817 | Int_t nJCuts = GetListOfJets(fJetsRecCuts, kJetsRecAcceptance); | |
2818 | Int_t nRecJetsCuts = 0; | |
2819 | if(nJCuts>=0) nRecJetsCuts = fJetsRecCuts->GetEntries(); | |
2820 | if(fDebug>2)Printf("%s:%d Selected Rec jets after cuts: %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts); | |
2821 | if(nRecJetsCuts != nJCuts) Printf("%s:%d Mismatch selected Rec jets after cuts: %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts); | |
2822 | fh1nRecJetsCuts->Fill(nRecJetsCuts); | |
2823 | ||
2824 | if(fJetTypeGen==kJetsKine || fJetTypeGen == kJetsKineAcceptance) fJetsGen->SetOwner(kTRUE); // kine aod jets allocated on heap, delete them with TList::Clear() | |
2825 | ||
2826 | Int_t nJGen = GetListOfJets(fJetsGen, fJetTypeGen); | |
2827 | Int_t nGenJets = 0; | |
2828 | if(nJGen>=0) nGenJets = fJetsGen->GetEntries(); | |
2829 | if(fDebug>2)Printf("%s:%d Selected Gen jets: %d %d",(char*)__FILE__,__LINE__,nJGen,nGenJets); | |
2830 | ||
2831 | if(nJGen != nGenJets) Printf("%s:%d Mismatch selected Gen jets: %d %d",(char*)__FILE__,__LINE__,nJGen,nGenJets); | |
2832 | fh1nGenJets->Fill(nGenJets); | |
2833 | ||
2834 | ||
2835 | if(fJetTypeRecEff==kJetsKine || fJetTypeRecEff == kJetsKineAcceptance) fJetsRecEff->SetOwner(kTRUE); // kine aod jets allocated on heap, delete them with TList::Clear() | |
2836 | Int_t nJRecEff = GetListOfJets(fJetsRecEff, fJetTypeRecEff); | |
2837 | Int_t nRecEffJets = 0; | |
2838 | if(nJRecEff>=0) nRecEffJets = fJetsRecEff->GetEntries(); | |
2839 | if(fDebug>2)Printf("%s:%d Selected RecEff jets: %d %d",(char*)__FILE__,__LINE__,nJRecEff,nRecEffJets); | |
2840 | if(nJRecEff != nRecEffJets) Printf("%s:%d Mismatch selected RecEff jets: %d %d",(char*)__FILE__,__LINE__,nJRecEff,nRecEffJets); | |
2841 | fh1nRecEffJets->Fill(nRecEffJets); | |
2842 | ||
2843 | ||
2844 | Int_t nEmbeddedJets = 0; | |
2845 | TArrayI iEmbeddedMatchIndex; | |
2846 | TArrayF fEmbeddedPtFraction; | |
2847 | ||
2848 | ||
2849 | if(fBranchEmbeddedJets.Length()){ | |
2850 | Int_t nJEmbedded = GetListOfJets(fJetsEmbedded, kJetsEmbedded); | |
2851 | if(nJEmbedded>=0) nEmbeddedJets = fJetsEmbedded->GetEntries(); | |
2852 | if(fDebug>2)Printf("%s:%d Selected Embedded jets: %d %d",(char*)__FILE__,__LINE__,nJEmbedded,nEmbeddedJets); | |
2853 | if(nJEmbedded != nEmbeddedJets) Printf("%s:%d Mismatch Selected Embedded Jets: %d %d",(char*)__FILE__,__LINE__,nJEmbedded,nEmbeddedJets); | |
2854 | fh1nEmbeddedJets->Fill(nEmbeddedJets); | |
2855 | ||
2856 | Float_t maxDist = 0.3; | |
2857 | ||
2858 | iEmbeddedMatchIndex.Set(nEmbeddedJets); | |
2859 | fEmbeddedPtFraction.Set(nEmbeddedJets); | |
2860 | ||
2861 | iEmbeddedMatchIndex.Reset(-1); | |
2862 | fEmbeddedPtFraction.Reset(0); | |
2863 | ||
2864 | AliAnalysisHelperJetTasks::GetJetMatching(fJetsEmbedded, nEmbeddedJets, | |
2865 | fJetsRecCuts, nRecJetsCuts, | |
2866 | iEmbeddedMatchIndex, fEmbeddedPtFraction, | |
2867 | fDebug, maxDist); | |
2868 | ||
2869 | } | |
2870 | ||
2871 | //____ fetch background clusters ___________________________________________________ | |
2872 | if(fBckgMode && | |
2873 | (fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters || | |
2874 | fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || | |
2875 | fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading)){ | |
2876 | ||
2877 | Int_t nBJ = GetListOfBckgJets(fBckgJetsRec, kJetsRec); | |
2878 | Int_t nRecBckgJets = 0; | |
2879 | if(nBJ>=0) nRecBckgJets = fBckgJetsRec->GetEntries(); | |
2880 | if(fDebug>2)Printf("%s:%d Selected Rec background jets: %d %d",(char*)__FILE__,__LINE__,nBJ,nRecBckgJets); | |
2881 | if(nBJ != nRecBckgJets) Printf("%s:%d Mismatch Selected Rec background jets: %d %d",(char*)__FILE__,__LINE__,nBJ,nRecBckgJets); | |
2882 | ||
2883 | Int_t nBJCuts = GetListOfBckgJets(fBckgJetsRecCuts, kJetsRecAcceptance); | |
2884 | Int_t nRecBckgJetsCuts = 0; | |
2885 | if(nBJCuts>=0) nRecBckgJetsCuts = fBckgJetsRecCuts->GetEntries(); | |
2886 | if(fDebug>2)Printf("%s:%d Selected Rec background jets after cuts: %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts); | |
2887 | if(nRecBckgJetsCuts != nBJCuts) Printf("%s:%d Mismatch selected Rec background jets after cuts: %d %d",(char*)__FILE__,__LINE__,nBJCuts,nRecBckgJetsCuts); | |
2888 | fh1nRecBckgJetsCuts->Fill(nRecBckgJetsCuts); | |
2889 | ||
2890 | if(0){ // protection OB - not yet implemented | |
2891 | if(fJetTypeGen==kJetsKine || fJetTypeGen == kJetsKineAcceptance) fBckgJetsGen->SetOwner(kTRUE); // kine aod jets allocated on heap, delete them with TList::Clear() | |
2892 | Int_t nBJGen = GetListOfBckgJets(fBckgJetsGen, fJetTypeGen); | |
2893 | Int_t nGenBckgJets = 0; | |
2894 | if(nBJGen>=0) nGenBckgJets = fBckgJetsGen->GetEntries(); | |
2895 | if(fDebug>2)Printf("%s:%d Selected Gen background jets: %d %d",(char*)__FILE__,__LINE__,nBJGen,nGenBckgJets); | |
2896 | if(nBJGen != nGenBckgJets) Printf("%s:%d Mismatch selected Gen background jets: %d %d",(char*)__FILE__,__LINE__,nBJGen,nGenBckgJets); | |
2897 | fh1nGenBckgJets->Fill(nGenBckgJets); | |
2898 | } | |
2899 | } | |
2900 | ||
2901 | ||
2902 | //____ fetch particles __________________________________________________________ | |
2903 | ||
2904 | Int_t nTCuts; | |
2905 | if(fUseExtraTracks == 1) nTCuts = GetListOfTracks(fTracksRecCuts, kTrackAODExtraCuts); | |
2906 | else if(fUseExtraTracks == -1) nTCuts = GetListOfTracks(fTracksRecCuts, kTrackAODExtraonlyCuts); | |
2907 | else nTCuts = GetListOfTracks(fTracksRecCuts, kTrackAODCuts); | |
2908 | ||
2909 | Int_t nRecPartCuts = 0; | |
2910 | if(nTCuts>=0) nRecPartCuts = fTracksRecCuts->GetEntries(); | |
2911 | if(fDebug>2)Printf("%s:%d Selected Rec tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nTCuts,nRecPartCuts); | |
2912 | if(nRecPartCuts != nTCuts) Printf("%s:%d Mismatch selected Rec tracks after cuts: %d %d", | |
2913 | (char*)__FILE__,__LINE__,nTCuts,nRecPartCuts); | |
2914 | fh1EvtMult->Fill(nRecPartCuts); | |
2915 | ||
2916 | ||
2917 | Int_t nTGen = GetListOfTracks(fTracksGen,fTrackTypeGen); | |
2918 | Int_t nGenPart = 0; | |
2919 | if(nTGen>=0) nGenPart = fTracksGen->GetEntries(); | |
2920 | if(fDebug>2)Printf("%s:%d Selected Gen tracks: %d %d",(char*)__FILE__,__LINE__,nTGen,nGenPart); | |
2921 | if(nGenPart != nTGen) Printf("%s:%d Mismatch selected Gen tracks: %d %d",(char*)__FILE__,__LINE__,nTGen,nGenPart); | |
2922 | ||
2923 | // Just cut on filterBit, but take the full acceptance | |
2924 | Int_t nTCutsEfficiency = GetListOfTracks(fTracksRecCutsEfficiency, kTrackAODQualityCuts); | |
2925 | Int_t nRecPartCutsEfficiency = 0; | |
2926 | if(nTCutsEfficiency>=0) nRecPartCutsEfficiency = fTracksRecCutsEfficiency->GetEntries(); | |
2927 | if(fDebug>2)Printf("%s:%d Selected Rec tracks efficiency after cuts: %d %d",(char*)__FILE__,__LINE__, | |
2928 | nTCutsEfficiency,nRecPartCutsEfficiency); | |
2929 | if(nRecPartCutsEfficiency != nTCutsEfficiency) Printf("%s:%d Mismatch selected Rec tracks after cuts: %d %d", | |
2930 | (char*)__FILE__,__LINE__,nTCutsEfficiency,nRecPartCutsEfficiency); | |
2931 | ||
2932 | AliPIDResponse* pidResponse = 0x0; | |
856f1166 | 2933 | Bool_t tuneOnDataTPC = kFALSE; |
e131b05f | 2934 | if (fUseJetPIDtask || fUseInclusivePIDtask) { |
c4856fb1 | 2935 | if (!inputHandler) { |
e131b05f | 2936 | AliFatal("Input handler needed"); |
c4856fb1 | 2937 | return; |
2938 | } | |
e131b05f | 2939 | else { |
2940 | // PID response object | |
2941 | pidResponse = inputHandler->GetPIDResponse(); | |
c4856fb1 | 2942 | if (!pidResponse) { |
e131b05f | 2943 | AliFatal("PIDResponse object was not created"); |
c4856fb1 | 2944 | return; |
2945 | } | |
856f1166 | 2946 | else { |
2947 | tuneOnDataTPC = pidResponse->IsTunedOnData() && | |
2948 | ((pidResponse->GetTunedOnDataMask() & AliPIDResponse::kDetTPC) == AliPIDResponse::kDetTPC); | |
2949 | } | |
e131b05f | 2950 | } |
2951 | } | |
2952 | ||
9e95a906 | 2953 | if(fDebug>2)Printf("%s:%d Starting processing...",(char*)__FILE__,__LINE__); |
2954 | ||
e131b05f | 2955 | //____ analysis, fill histos ___________________________________________________ |
2956 | ||
2957 | if(fQAMode){ | |
2958 | // loop over tracks | |
2959 | if(fQAMode&1){ | |
2960 | TClonesArray *tca = fUseInclusivePIDtask ? dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName())) : 0x0; | |
2961 | ||
2962 | // Fill efficiency for generated primaries and also fill histos for generated yields (primaries + all) | |
2963 | // Efficiency, inclusive - particle level | |
ec994e6a | 2964 | if (fUseInclusivePIDtask && tca && !isPileUpForAllInclusivePIDTasks) { |
e131b05f | 2965 | for (Int_t it = 0; it < tca->GetEntriesFast(); it++) { |
2966 | AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(tca->At(it)); | |
2967 | if (!part) | |
2968 | continue; | |
2969 | ||
2970 | // Define clean MC sample with corresponding particle level track cuts: | |
2971 | // - MC-track must be in desired eta range | |
2972 | // - MC-track must be physical primary | |
2973 | // - Species must be one of those in question | |
2974 | ||
2975 | if (part->Eta() > fTrackEtaMax || part->Eta() < fTrackEtaMin) | |
2976 | continue; | |
2977 | ||
2978 | Int_t mcID = AliAnalysisTaskPID::PDGtoMCID(part->GetPdgCode()); | |
2979 | ||
2980 | // Following lines are not needed - just keep other species (like casecades) - will end up in overflow bin | |
2981 | // and only affect the efficiencies for all (i.e. not identified) what is desired! | |
2982 | //if (mcID == AliPID::kUnknown) | |
2983 | // continue; | |
2984 | ||
2985 | if (!part->IsPhysicalPrimary()) | |
2986 | continue; | |
2987 | /* | |
2988 | Int_t iMother = part->GetMother(); | |
2989 | if (iMother >= 0) | |
2990 | continue; // Not a physical primary | |
2991 | */ | |
2992 | ||
2993 | Double_t pT = part->Pt(); | |
2994 | ||
2995 | // AliAODMCParticle->Charge() calls TParticlePDG->Charge(), which returns the charge in units of e0 / 3 | |
2996 | Double_t chargeMC = part->Charge() / 3.; | |
2997 | ||
2998 | if (TMath::Abs(chargeMC) < 0.01) | |
2999 | continue; // Reject neutral particles (only relevant, if mcID is not used) | |
3000 | ||
2942f542 | 3001 | Double_t valuesGenYield[AliAnalysisTaskPID::kGenYieldNumAxes] = { static_cast<Double_t>(mcID), pT, centPercent, -1, -1, -1, -1 }; |
e131b05f | 3002 | |
3003 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
ec994e6a | 3004 | if (!isPileUpInclusivePIDtask[i] && fInclusivePIDtask[i]->IsInAcceptedEtaRange(TMath::Abs(part->Eta()))) { |
77324970 CKB |
3005 | valuesGenYield[fInclusivePIDtask[i]->GetIndexOfChargeAxisGenYield()] = chargeMC; |
3006 | fInclusivePIDtask[i]->FillGeneratedYield(valuesGenYield); | |
3007 | } | |
e131b05f | 3008 | } |
3009 | ||
2942f542 | 3010 | Double_t valuesEff[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), pT, part->Eta(), chargeMC, |
e131b05f | 3011 | centPercent, -1, -1, -1 };// no jet pT etc since inclusive spectrum |
ec994e6a | 3012 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { |
3013 | if (!isPileUpInclusivePIDtask[i]) | |
3014 | fInclusivePIDtask[i]->FillEfficiencyContainer(valuesEff, AliAnalysisTaskPID::kStepGenWithGenCuts); | |
3015 | } | |
e131b05f | 3016 | } |
3017 | } | |
3018 | ||
ec994e6a | 3019 | if (fUseInclusivePIDtask && !isPileUpForAllInclusivePIDTasks) { |
e131b05f | 3020 | //Efficiency, inclusive - detector level |
3021 | for(Int_t it=0; it<nRecPartCutsEfficiency; ++it){ | |
3022 | // fill inclusive tracks XXX, they have the same track cuts! | |
3023 | AliAODTrack * inclusiveaod = dynamic_cast<AliAODTrack*>(fTracksRecCutsEfficiency->At(it)); | |
3024 | if(inclusiveaod){ | |
856f1166 | 3025 | Double_t dEdxTPC = tuneOnDataTPC ? pidResponse->GetTPCsignalTunedOnData(inclusiveaod) |
3026 | : inclusiveaod->GetTPCsignal(); | |
e131b05f | 3027 | |
3028 | if (dEdxTPC <= 0) | |
3029 | continue; | |
3030 | ||
a6852ea8 | 3031 | Bool_t survivedTPCCutMIGeo = AliAnalysisTaskPID::TPCCutMIGeo(inclusiveaod, InputEvent()); |
493982d9 | 3032 | Bool_t survivedTPCnclCut = AliAnalysisTaskPID::TPCnclCut(inclusiveaod); |
a6852ea8 | 3033 | |
e131b05f | 3034 | Int_t label = TMath::Abs(inclusiveaod->GetLabel()); |
3035 | ||
3036 | // find MC track in our list, if available | |
3037 | AliAODMCParticle* gentrack = tca ? dynamic_cast<AliAODMCParticle*>(tca->At(label)) : 0x0; | |
3038 | Int_t pdg = 0; | |
3039 | ||
3040 | if (gentrack) | |
3041 | pdg = gentrack->GetPdgCode(); | |
3042 | ||
3043 | // For efficiency: Reconstructed track has survived all cuts on the detector level (no cut on eta acceptance) | |
3044 | // and has an associated MC track | |
3045 | // -> Check whether associated MC track belongs to the clean MC sample defined above, | |
3046 | // i.e. survives the particle level track cuts | |
3047 | if (gentrack) { | |
3048 | Int_t mcID = AliAnalysisTaskPID::PDGtoMCID(pdg); | |
3049 | ||
3050 | // Following lines are not needed - just keep other species (like casecades) - will end up in overflow bin | |
3051 | // and only affect the efficiencies for all (i.e. not identified) what is desired! | |
3052 | //if (mcID == AliPID::kUnknown) | |
3053 | // continue; | |
3054 | ||
3055 | // Fill efficiency for reconstructed primaries | |
3056 | if (!gentrack->IsPhysicalPrimary()) | |
3057 | continue; | |
3058 | /* | |
3059 | * Int_t iMother = gentrack->GetMother(); | |
3060 | * if (iMother >= 0) | |
3061 | * continue; // Not a physical primary | |
3062 | */ | |
3063 | ||
3064 | if (gentrack->Eta() > fTrackEtaMax || gentrack->Eta() < fTrackEtaMin) | |
3065 | continue; | |
3066 | ||
3067 | // AliAODMCParticle->Charge() calls TParticlePDG->Charge(), which returns the charge in units of e0 / 3 | |
2942f542 | 3068 | Double_t value[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), gentrack->Pt(), gentrack->Eta(), gentrack->Charge() / 3., |
e131b05f | 3069 | centPercent, |
3070 | -1, -1, -1 };// no jet pT etc since inclusive spectrum | |
a6852ea8 | 3071 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { |
ec994e6a | 3072 | if (!isPileUpInclusivePIDtask[i] && |
3073 | ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3074 | (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3075 | (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))) |
a6852ea8 | 3076 | fInclusivePIDtask[i]->FillEfficiencyContainer(value, AliAnalysisTaskPID::kStepRecWithGenCuts); |
3077 | } | |
e131b05f | 3078 | |
2942f542 | 3079 | Double_t valueMeas[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), inclusiveaod->Pt(), inclusiveaod->Eta(), |
3080 | static_cast<Double_t>(inclusiveaod->Charge()), centPercent, | |
e131b05f | 3081 | -1, -1, -1 };// no jet pT etc since inclusive spectrum |
a6852ea8 | 3082 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { |
ec994e6a | 3083 | if (!isPileUpInclusivePIDtask[i] && |
3084 | ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3085 | (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3086 | (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))) |
a6852ea8 | 3087 | fInclusivePIDtask[i]->FillEfficiencyContainer(valueMeas, AliAnalysisTaskPID::kStepRecWithGenCutsMeasuredObs); |
3088 | } | |
e131b05f | 3089 | } |
3090 | } | |
3091 | } | |
3092 | } | |
3093 | ||
3094 | ||
3095 | for(Int_t it=0; it<nRecPartCuts; ++it){ | |
3096 | AliVParticle *part = dynamic_cast<AliVParticle*>(fTracksRecCuts->At(it)); | |
3097 | if(part)fQATrackHistosRecCuts->FillTrackQA( part->Eta(), TVector2::Phi_0_2pi(part->Phi()), part->Pt() ); | |
3098 | ||
3099 | // fill inclusive tracks XXX, they have the same track cuts! | |
3100 | AliAODTrack * inclusiveaod = dynamic_cast<AliAODTrack*>(fTracksRecCuts->At(it)); | |
3101 | if(inclusiveaod){ | |
ec994e6a | 3102 | if (fUseInclusivePIDtask && !isPileUpForAllInclusivePIDTasks) { |
856f1166 | 3103 | Double_t dEdxTPC = tuneOnDataTPC ? pidResponse->GetTPCsignalTunedOnData(inclusiveaod) |
3104 | : inclusiveaod->GetTPCsignal(); | |
e131b05f | 3105 | |
3106 | if (dEdxTPC <= 0) | |
3107 | continue; | |
3108 | ||
a6852ea8 | 3109 | Bool_t survivedTPCCutMIGeo = AliAnalysisTaskPID::TPCCutMIGeo(inclusiveaod, InputEvent()); |
493982d9 | 3110 | Bool_t survivedTPCnclCut = AliAnalysisTaskPID::TPCnclCut(inclusiveaod); |
a6852ea8 | 3111 | |
e131b05f | 3112 | Int_t label = TMath::Abs(inclusiveaod->GetLabel()); |
3113 | ||
3114 | // find MC track in our list, if available | |
3115 | AliAODMCParticle* gentrack = tca ? dynamic_cast<AliAODMCParticle*>(tca->At(label)) : 0x0; | |
3116 | Int_t pdg = 0; | |
3117 | ||
3118 | if (gentrack) | |
3119 | pdg = gentrack->GetPdgCode(); | |
3120 | ||
a6852ea8 | 3121 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { |
ec994e6a | 3122 | if (!isPileUpInclusivePIDtask[i] && |
3123 | ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3124 | (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3125 | (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))) { |
77324970 CKB |
3126 | if (fInclusivePIDtask[i]->IsInAcceptedEtaRange(TMath::Abs(inclusiveaod->Eta()))) |
3127 | fInclusivePIDtask[i]->ProcessTrack(inclusiveaod, pdg, centPercent, -1); // no jet pT since inclusive spectrum | |
3128 | } | |
a6852ea8 | 3129 | } |
e131b05f | 3130 | |
3131 | if (gentrack) { | |
3132 | Int_t mcID = AliAnalysisTaskPID::PDGtoMCID(pdg); | |
2942f542 | 3133 | Double_t valueRecAllCuts[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), inclusiveaod->Pt(), inclusiveaod->Eta(), |
3134 | static_cast<Double_t>(inclusiveaod->Charge()), centPercent, | |
e131b05f | 3135 | -1, -1, -1 }; |
a6852ea8 | 3136 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { |
ec994e6a | 3137 | if (!isPileUpInclusivePIDtask[i] && |
3138 | ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3139 | (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3140 | (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))) |
a6852ea8 | 3141 | fInclusivePIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObs); |
3142 | } | |
e131b05f | 3143 | |
3144 | Double_t weight = IsSecondaryWithStrangeMotherMC(gentrack) ? GetMCStrangenessFactorCMS(gentrack) : 1.0; | |
a6852ea8 | 3145 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { |
ec994e6a | 3146 | if (!isPileUpInclusivePIDtask[i] && |
3147 | ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3148 | (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3149 | (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))) |
a6852ea8 | 3150 | fInclusivePIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, |
3151 | AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObsStrangenessScaled, | |
3152 | weight); | |
3153 | } | |
9e95a906 | 3154 | |
e131b05f | 3155 | if (gentrack->IsPhysicalPrimary()) { |
9e95a906 | 3156 | // AliAODMCParticle->Charge() calls TParticlePDG->Charge(), which returns the charge in units of e0 / 3 |
2942f542 | 3157 | Double_t valueGenAllCuts[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), gentrack->Pt(), gentrack->Eta(), |
9e95a906 | 3158 | gentrack->Charge() / 3., centPercent, -1, -1, |
3159 | -1 }; | |
3160 | ||
e4351829 | 3161 | Double_t valuePtResolution[AliAnalysisTaskPID::kPtResNumAxes] = { -1, gentrack->Pt(), inclusiveaod->Pt(), |
3162 | gentrack->Charge() / 3., centPercent }; | |
9e95a906 | 3163 | |
3164 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
ec994e6a | 3165 | if (!isPileUpInclusivePIDtask[i] && |
3166 | ((!fInclusivePIDtask[i]->GetUseTPCCutMIGeo() && !fInclusivePIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3167 | (survivedTPCCutMIGeo && fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3168 | (survivedTPCnclCut && fInclusivePIDtask[i]->GetUseTPCnclCut()))) { |
a6852ea8 | 3169 | fInclusivePIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, |
3170 | AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObsPrimaries); | |
3171 | fInclusivePIDtask[i]->FillEfficiencyContainer(valueGenAllCuts, | |
3172 | AliAnalysisTaskPID::kStepRecWithRecCutsPrimaries); | |
3173 | ||
3174 | fInclusivePIDtask[i]->FillPtResolution(mcID, valuePtResolution); | |
3175 | } | |
9e95a906 | 3176 | } |
e131b05f | 3177 | } |
3178 | } | |
3179 | } | |
3180 | } | |
3181 | } | |
3182 | for(Int_t it=0; it<nGenPart; ++it){ | |
3183 | AliVParticle *part = dynamic_cast<AliVParticle*>(fTracksGen->At(it)); | |
3184 | if(part)fQATrackHistosGen->FillTrackQA( part->Eta(), TVector2::Phi_0_2pi(part->Phi()), part->Pt()); | |
3185 | } | |
3186 | } | |
3187 | ||
3188 | // loop over jets | |
3189 | if(fQAMode&2){ | |
3190 | for(Int_t ij=0; ij<nRecJets; ++ij){ | |
3191 | AliAODJet* jet = dynamic_cast<AliAODJet*>(fJetsRec->At(ij)); | |
3192 | if(jet)fQAJetHistosRec->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt()); | |
3193 | } | |
3194 | } | |
3195 | } | |
3196 | ||
3197 | if(fQAMode || fFFMode){ | |
3198 | // generated jets | |
3199 | for(Int_t ij=0; ij<nGenJets; ++ij){ | |
3200 | AliAODJet* jet = dynamic_cast<AliAODJet*>(fJetsGen->At(ij)); | |
3201 | ||
3202 | if(!jet)continue; | |
3203 | ||
3204 | if(fQAMode&2) fQAJetHistosGen->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt()); | |
3205 | ||
3206 | if(fQAMode&2 && (ij==0)) fQAJetHistosGenLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() ); | |
3207 | ||
c4856fb1 | 3208 | if((ij==0) || !fOnlyLeadingJets){ // leading jets or all jets |
e131b05f | 3209 | TList* jettracklist = new TList(); |
3210 | Double_t sumPt = 0.; | |
3211 | Bool_t isBadJet = kFALSE; | |
3212 | ||
3213 | if(GetFFRadius()<=0){ | |
3214 | GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); | |
3215 | } else { | |
3216 | GetJetTracksPointing(fTracksGen, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); | |
3217 | } | |
3218 | ||
3219 | if(GetFFMinNTracks()>0 && jettracklist->GetSize()<=GetFFMinNTracks()) isBadJet = kTRUE; | |
3220 | if(isBadJet) continue; | |
3221 | ||
3222 | for(Int_t it=0; it<jettracklist->GetSize(); ++it){ | |
3223 | ||
3224 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it)); | |
3225 | if(!trackVP)continue; | |
3226 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
3227 | ||
3228 | Float_t jetPt = jet->Pt(); | |
3229 | Float_t trackPt = trackV->Pt(); | |
3230 | ||
3231 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
3232 | ||
3233 | if(fFFMode && (ij==0)) fFFHistosGen->FillFF( trackPt, jetPt, incrementJetPt ); | |
3234 | if(fFFMode) fFFHistosGenInc->FillFF( trackPt, jetPt, incrementJetPt ); | |
3235 | if(it==0){ // leading track | |
3236 | if(fFFMode) fFFHistosGenLeadingTrack->FillFF( trackPt, jetPt, kTRUE ); | |
3237 | } | |
3238 | ||
3239 | if (fUseJetPIDtask && incrementJetPt) { | |
ec994e6a | 3240 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
3241 | if (!isPileUpJetPIDtask[i]) | |
3242 | fJetPIDtask[i]->FillGenJets(fJetPIDtask[i]->GetCentralityPercentile(evtForCentDetermination), jetPt); | |
3243 | } | |
e131b05f | 3244 | } |
3245 | ||
3246 | if (fIDFFMode) { | |
3247 | Int_t mcID = AliAnalysisTaskPID::PDGtoMCID(trackVP->PdgCode()); | |
3248 | if (mcID != AliPID::kUnknown) { | |
3249 | // WARNING: The number of jets for the different species does not make sense -> One has to take | |
3250 | // the number of jets for ALL particles. Thus, just do not fill the num of jet histos in order | |
3251 | // not to get confused | |
3252 | fIDFFHistosGen[mcID]->FillFF(trackPt, jetPt, kFALSE); | |
3253 | } | |
3254 | /* | |
3255 | Int_t pidWeightedSpecies = fJetPIDtask->GetRandomParticleTypeAccordingToParticleFractions(trackPt, jetPt, centPercent, kTRUE); | |
3256 | if (pidWeightedSpecies < 0 || pidWeightedSpecies >= AliPID::kSPECIES) { | |
3257 | Printf("Failed to determine particle ID for track in jet (gen) -> ID FF histos not filled with this track!"); | |
3258 | Printf("Track details: trackPt %f, jetPt %f, centrality %f!", trackPt, jetPt, centPercent); | |
3259 | } | |
3260 | else { | |
3261 | // WARNING: The number of jets for the different species does not make sense -> One has to take | |
3262 | // the number of jets for ALL particles. Thus, just do not fill the num of jet histos in order | |
3263 | // not to get confused | |
3264 | fIDFFHistosGen[pidWeightedSpecies]->FillFF(trackPt, jetPt, kFALSE); | |
3265 | } | |
3266 | */ | |
3267 | } | |
3268 | ||
3269 | delete trackV; | |
3270 | ||
3271 | // Efficiency, jets - particle level | |
ec994e6a | 3272 | if (fUseJetPIDtask && !isPileUpForAllJetPIDTasks) { |
e131b05f | 3273 | AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(jettracklist->At(it)); |
3274 | if (!part) { | |
3275 | AliError("expected ref track not found "); | |
3276 | continue; | |
3277 | } | |
3278 | // Fill efficiency for generated primaries and also fill histos for generated yields (primaries + all) | |
3279 | if (part->Eta() > fTrackEtaMax || part->Eta() < fTrackEtaMin) | |
3280 | continue; | |
3281 | ||
3282 | Int_t mcID = AliAnalysisTaskPID::PDGtoMCID(part->GetPdgCode()); | |
3283 | ||
3284 | // Following lines are not needed - just keep other species (like casecades) - will end up in overflow bin | |
3285 | // and only affect the efficiencies for all (i.e. not identified) what is desired! | |
3286 | //if (mcID == AliPID::kUnknown) | |
3287 | // continue; | |
3288 | ||
3289 | if (!part->IsPhysicalPrimary()) | |
3290 | continue; | |
3291 | // | |
3292 | // Int_t iMother = part->GetMother(); | |
3293 | // if (iMother >= 0) | |
3294 | // continue; // Not a physical primary | |
3295 | // | |
3296 | ||
3297 | Double_t z = -1., xi = -1.; | |
3298 | AliAnalysisTaskPID::GetJetTrackObservables(trackPt, jetPt, z, xi); | |
3299 | ||
3300 | // AliAODMCParticle->Charge() calls TParticlePDG->Charge(), which returns the charge in units of e0 / 3 | |
3301 | Double_t chargeMC = part->Charge() / 3.; | |
3302 | ||
3303 | if (TMath::Abs(chargeMC) < 0.01) | |
3304 | continue; // Reject neutral particles (only relevant, if mcID is not used) | |
3305 | ||
2942f542 | 3306 | Double_t valuesGenYield[AliAnalysisTaskPID::kGenYieldNumAxes] = { static_cast<Double_t>(mcID), trackPt, centPercent, jetPt, z, xi, chargeMC }; |
e131b05f | 3307 | |
3308 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
ec994e6a | 3309 | if (!isPileUpJetPIDtask[i] && fJetPIDtask[i]->IsInAcceptedEtaRange(TMath::Abs(part->Eta()))) { |
77324970 CKB |
3310 | valuesGenYield[fJetPIDtask[i]->GetIndexOfChargeAxisGenYield()] = chargeMC; |
3311 | fJetPIDtask[i]->FillGeneratedYield(valuesGenYield); | |
3312 | } | |
e131b05f | 3313 | } |
3314 | ||
3315 | ||
2942f542 | 3316 | Double_t valuesEff[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), trackPt, part->Eta(), chargeMC, |
e131b05f | 3317 | centPercent, jetPt, z, xi }; |
ec994e6a | 3318 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
3319 | if (!isPileUpJetPIDtask[i]) | |
3320 | fJetPIDtask[i]->FillEfficiencyContainer(valuesEff, AliAnalysisTaskPID::kStepGenWithGenCuts); | |
3321 | } | |
e131b05f | 3322 | } |
3323 | } | |
3324 | ||
3325 | if(fBckgMode){ | |
3326 | if(fBckgType[0]!=kBckgNone) | |
3327 | FillBckgHistos(fBckgType[0], fTracksGen, fJetsGen, jet, | |
3328 | fFFBckgHisto0Gen, fQABckgHisto0Gen); | |
3329 | if(fBckgType[1]!=kBckgNone) | |
3330 | FillBckgHistos(fBckgType[1], fTracksGen, fJetsGen, jet, | |
3331 | fFFBckgHisto1Gen, fQABckgHisto1Gen); | |
3332 | if(fBckgType[2]!=kBckgNone) | |
3333 | FillBckgHistos(fBckgType[2], fTracksGen, fJetsGen, jet, | |
3334 | fFFBckgHisto2Gen, fQABckgHisto2Gen); | |
3335 | if(fBckgType[3]!=kBckgNone) | |
3336 | FillBckgHistos(fBckgType[3], fTracksGen, fJetsGen, jet, | |
3337 | fFFBckgHisto3Gen, fQABckgHisto3Gen); | |
3338 | if(fBckgType[4]!=kBckgNone) | |
3339 | FillBckgHistos(fBckgType[4], fTracksGen, fJetsGen, jet, | |
3340 | fFFBckgHisto4Gen, fQABckgHisto4Gen); | |
3341 | } // end if(fBckgMode) | |
3342 | ||
3343 | ||
3344 | if(fJSMode) FillJetShape(jet, jettracklist, fProNtracksLeadingJetGen, fProDelRPtSumGen, fProDelR80pcPtGen); | |
3345 | ||
3346 | delete jettracklist; | |
3347 | } | |
3348 | } | |
3349 | ||
e131b05f | 3350 | for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ |
3351 | ||
3352 | AliAODJet* jet = (AliAODJet*)(fJetsRecCuts->At(ij)); | |
3353 | if(fQAMode&2) fQAJetHistosRecCuts->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt()); | |
3354 | if(fQAMode&2 && (ij==0)) fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() ); | |
3355 | ||
c4856fb1 | 3356 | if((ij==0) || !fOnlyLeadingJets){ // leading jets or all jets |
630a4bcd | 3357 | |
3358 | fhJetPtRefMultEta5->Fill(refMult5, jet->Pt()); | |
3359 | fhJetPtRefMultEta8->Fill(refMult8, jet->Pt()); | |
a2a9d6d2 | 3360 | fhJetPtMultPercent->Fill(centPercentPP, jet->Pt()); |
630a4bcd | 3361 | |
e131b05f | 3362 | Double_t ptFractionEmbedded = 0; |
3363 | AliAODJet* embeddedJet = 0; | |
3364 | ||
3365 | if(fBranchEmbeddedJets.Length()){ // find embedded jet | |
3366 | ||
3367 | Int_t indexEmbedded = -1; | |
3368 | for(Int_t i=0; i<nEmbeddedJets; i++){ | |
3369 | if(iEmbeddedMatchIndex[i] == ij){ | |
3370 | indexEmbedded = i; | |
3371 | ptFractionEmbedded = fEmbeddedPtFraction[i]; | |
3372 | } | |
3373 | } | |
3374 | ||
3375 | fh1IndexEmbedded->Fill(indexEmbedded); | |
3376 | fh1FractionPtEmbedded->Fill(ptFractionEmbedded); | |
3377 | ||
3378 | if(indexEmbedded>-1){ | |
3379 | ||
3380 | embeddedJet = dynamic_cast<AliAODJet*>(fJetsEmbedded->At(indexEmbedded)); | |
3381 | if(!embeddedJet) continue; | |
3382 | ||
3383 | Double_t deltaPt = jet->Pt() - embeddedJet->Pt(); | |
3384 | Double_t deltaR = jet->DeltaR((AliVParticle*) (embeddedJet)); | |
3385 | ||
3386 | fh2DeltaPtVsJetPtEmbedded->Fill(embeddedJet->Pt(),deltaPt); | |
3387 | fh2DeltaPtVsRecJetPtEmbedded->Fill(jet->Pt(),deltaPt); | |
3388 | fh1DeltaREmbedded->Fill(deltaR); | |
3389 | } | |
3390 | } | |
3391 | ||
3392 | // get tracks in jet | |
3393 | TList* jettracklist = new TList(); | |
3394 | Double_t sumPt = 0.; | |
3395 | Bool_t isBadJet = kFALSE; | |
3396 | ||
3397 | if(GetFFRadius()<=0){ | |
3398 | GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); | |
3399 | } else { | |
3400 | if(fUseEmbeddedJetAxis){ | |
3401 | if(embeddedJet) GetJetTracksPointing(fTracksRecCuts, jettracklist, embeddedJet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); | |
3402 | } | |
3403 | else GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); | |
3404 | } | |
3405 | ||
3406 | if(GetFFMinNTracks()>0 && jettracklist->GetSize()<=GetFFMinNTracks()) isBadJet = kTRUE; | |
3407 | ||
3408 | if(isBadJet) continue; | |
3409 | ||
3410 | if(ptFractionEmbedded>=fCutFractionPtEmbedded){ // if no embedding: ptFraction = cutFraction = 0 | |
3411 | ||
3412 | TClonesArray *tca = fUseJetPIDtask ? dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName())) : 0x0; | |
3413 | ||
3414 | for(Int_t it=0; it<jettracklist->GetSize(); ++it){ | |
3415 | AliAODTrack * aodtrack = dynamic_cast<AliAODTrack*>(jettracklist->At(it)); | |
3416 | if(!aodtrack) continue; | |
3417 | ||
3418 | Double_t pT = aodtrack->Pt(); | |
3419 | Float_t jetPt = jet->Pt(); | |
3420 | if(fUseEmbeddedJetPt){ | |
3421 | if(embeddedJet) jetPt = embeddedJet->Pt(); | |
3422 | else jetPt = 0; | |
3423 | } | |
3424 | ||
3425 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
3426 | ||
3427 | if(fFFMode && (ij==0)) fFFHistosRecCuts->FillFF(pT, jetPt, incrementJetPt); | |
3428 | if(fFFMode) fFFHistosRecCutsInc->FillFF(pT, jetPt, incrementJetPt); | |
3429 | ||
3430 | if(it==0){ // leading track | |
3431 | if(fFFMode) fFFHistosRecLeadingTrack->FillFF(pT, jetPt, kTRUE); | |
3432 | } | |
3433 | ||
3434 | if (fUseJetPIDtask && incrementJetPt) { | |
ec994e6a | 3435 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
3436 | if (!isPileUpJetPIDtask[i]) | |
3437 | fJetPIDtask[i]->FillRecJets(fJetPIDtask[i]->GetCentralityPercentile(evtForCentDetermination), jetPt); | |
3438 | } | |
e131b05f | 3439 | } |
3440 | ||
ec994e6a | 3441 | if (fUseJetPIDtask && (!isPileUpForAllJetPIDTasks || fIDFFMode)) { |
856f1166 | 3442 | Double_t dEdxTPC = tuneOnDataTPC ? pidResponse->GetTPCsignalTunedOnData(aodtrack) |
3443 | : aodtrack->GetTPCsignal(); | |
e131b05f | 3444 | |
3445 | if (dEdxTPC <= 0) | |
3446 | continue; | |
3447 | ||
a6852ea8 | 3448 | Bool_t survivedTPCCutMIGeo = AliAnalysisTaskPID::TPCCutMIGeo(aodtrack, InputEvent()); |
493982d9 | 3449 | Bool_t survivedTPCnclCut = AliAnalysisTaskPID::TPCnclCut(aodtrack); |
a6852ea8 | 3450 | |
e131b05f | 3451 | Int_t label = TMath::Abs(aodtrack->GetLabel()); |
3452 | ||
3453 | // Find MC track in our list, if available | |
3454 | AliAODMCParticle* gentrack = tca ? dynamic_cast<AliAODMCParticle*>(tca->At(label)) : 0x0; | |
3455 | Int_t pdg = 0; | |
3456 | Int_t mcID = AliPID::kUnknown; | |
3457 | ||
3458 | if (gentrack) { | |
3459 | pdg = gentrack->GetPdgCode(); | |
3460 | ||
3461 | // Secondaries, jets | |
3462 | mcID = AliAnalysisTaskPID::PDGtoMCID(pdg); | |
3463 | ||
3464 | Double_t z = -1., xi = -1.; | |
3465 | AliAnalysisTaskPID::GetJetTrackObservables(pT, jetPt, z, xi); | |
3466 | ||
2942f542 | 3467 | Double_t valueRecAllCuts[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), pT, aodtrack->Eta(), static_cast<Double_t>(aodtrack->Charge()), |
e131b05f | 3468 | centPercent, jetPt, z, xi }; |
a6852ea8 | 3469 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
ec994e6a | 3470 | if (!isPileUpJetPIDtask[i] && |
3471 | ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3472 | (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3473 | (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))) |
a6852ea8 | 3474 | fJetPIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObs); |
3475 | } | |
e131b05f | 3476 | |
3477 | Double_t weight = IsSecondaryWithStrangeMotherMC(gentrack) ? GetMCStrangenessFactorCMS(gentrack) : 1.0; | |
a6852ea8 | 3478 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
ec994e6a | 3479 | if (!isPileUpJetPIDtask[i] && |
3480 | ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3481 | (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3482 | (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))) |
a6852ea8 | 3483 | fJetPIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, |
3484 | AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObsStrangenessScaled, | |
3485 | weight); | |
3486 | } | |
9e95a906 | 3487 | |
e131b05f | 3488 | if (gentrack->IsPhysicalPrimary()) { |
9e95a906 | 3489 | // AliAODMCParticle->Charge() calls TParticlePDG->Charge(), which returns the charge in units of e0 / 3 |
3490 | Double_t genPt = gentrack->Pt(); | |
3491 | Double_t genZ = -1., genXi = -1.; | |
3492 | AliAnalysisTaskPID::GetJetTrackObservables(genPt, jetPt, genZ, genXi); | |
2942f542 | 3493 | Double_t valueGenAllCuts[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), genPt, gentrack->Eta(), |
9e95a906 | 3494 | gentrack->Charge() / 3., centPercent, jetPt, genZ, |
3495 | genXi }; | |
3496 | ||
e4351829 | 3497 | Double_t valuePtResolution[AliAnalysisTaskPID::kPtResNumAxes] = { jetPt, genPt, pT, gentrack->Charge() / 3., centPercent }; |
9e95a906 | 3498 | |
3499 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
ec994e6a | 3500 | if (!isPileUpJetPIDtask[i] && |
3501 | ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3502 | (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3503 | (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))) { |
a6852ea8 | 3504 | fJetPIDtask[i]->FillEfficiencyContainer(valueRecAllCuts, |
3505 | AliAnalysisTaskPID::kStepRecWithRecCutsMeasuredObsPrimaries); | |
3506 | fJetPIDtask[i]->FillEfficiencyContainer(valueGenAllCuts, | |
3507 | AliAnalysisTaskPID::kStepRecWithRecCutsPrimaries); | |
3508 | ||
3509 | fJetPIDtask[i]->FillPtResolution(mcID, valuePtResolution); | |
3510 | } | |
9e95a906 | 3511 | } |
e131b05f | 3512 | } |
3513 | } | |
3514 | ||
265e4931 | 3515 | Bool_t filledDCA = kFALSE; |
3516 | ||
a6852ea8 | 3517 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
ec994e6a | 3518 | if (!isPileUpJetPIDtask[i] && |
3519 | ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3520 | (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3521 | (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))) { |
265e4931 | 3522 | if (fJetPIDtask[i]->IsInAcceptedEtaRange(TMath::Abs(aodtrack->Eta()))) { |
3523 | fJetPIDtask[i]->ProcessTrack(aodtrack, pdg, centPercent, jetPt); | |
3524 | ||
3525 | // Fill DCA histo (once) if at least one of the PID tasks accecpts the track | |
3526 | if (!filledDCA) { | |
3527 | filledDCA = kTRUE; | |
3528 | ||
3529 | Double_t dca[2] = {0., 0.}; // 0: xy; 1: z | |
3530 | if (aodtrack->IsGlobalConstrained()) { | |
3531 | dca[0] = aodtrack->DCA(); | |
3532 | dca[1] = aodtrack->ZAtDCA(); | |
3533 | } | |
3534 | else { | |
3535 | Double_t v[3] = {0, }; | |
3536 | Double_t pos[3] = {0, }; | |
3537 | primVtx->GetXYZ(v); | |
3538 | aodtrack->GetXYZ(pos); | |
3539 | dca[0] = pos[0] - v[0]; | |
3540 | dca[1] = pos[1] - v[1]; | |
3541 | } | |
3542 | ||
3543 | // "Unidentified" for data and MC | |
3544 | fhDCA_XY->Fill(pT, dca[0]); | |
3545 | fhDCA_Z->Fill(pT, dca[1]); | |
3546 | ||
3547 | // "Identified" for MC | |
3548 | if (gentrack && mcID != AliPID::kUnknown) { | |
3549 | // MC | |
3550 | if (gentrack->IsPhysicalPrimary()) { | |
3551 | fhDCA_XY_prim_MCID[mcID]->Fill(pT, dca[0]); | |
3552 | fhDCA_Z_prim_MCID[mcID]->Fill(pT, dca[1]); | |
3553 | } | |
3554 | else { | |
3555 | fhDCA_XY_sec_MCID[mcID]->Fill(pT, dca[0]); | |
3556 | fhDCA_Z_sec_MCID[mcID]->Fill(pT, dca[1]); | |
3557 | } | |
3558 | } | |
3559 | } | |
3560 | } | |
77324970 | 3561 | } |
a6852ea8 | 3562 | } |
e131b05f | 3563 | |
493982d9 ML |
3564 | if (fIDFFMode && ((!fJetPIDtask[0]->GetUseTPCCutMIGeo() && !fJetPIDtask[0]->GetUseTPCnclCut()) || |
3565 | (survivedTPCCutMIGeo && fJetPIDtask[0]->GetUseTPCCutMIGeo()) || | |
3566 | (survivedTPCnclCut && fJetPIDtask[0]->GetUseTPCnclCut()))) { | |
e131b05f | 3567 | // NOTE: Just take particle fraction from first task (should anyway be the same for all tasks) |
3568 | Int_t pidWeightedSpecies = fJetPIDtask[0]->GetRandomParticleTypeAccordingToParticleFractions(pT, jetPt, | |
3569 | centPercent, kTRUE); | |
3570 | if (pidWeightedSpecies < 0 || pidWeightedSpecies >= AliPID::kSPECIES) { | |
3571 | Printf("Failed to determine particle ID for track in jet (recCuts) -> ID FF histos not filled with this track!"); | |
3572 | Printf("Track details: trackPt %f, jetPt %f, centrality %f!", pT, jetPt, centPercent); | |
3573 | } | |
3574 | else { | |
3575 | // WARNING: The number of jets for the different species does not make sense -> One has to take | |
3576 | // the number of jets for ALL particles. Thus, just do not fill the num of jet histos in order | |
3577 | // not to get confused | |
3578 | fIDFFHistosRecCuts[pidWeightedSpecies]->FillFF(aodtrack->Pt(), jetPt, kFALSE); | |
3579 | } | |
3580 | } | |
3581 | ||
3582 | // Efficiency, jets - detector level | |
3583 | if (gentrack) { | |
3584 | // Following lines are not needed - just keep other species (like casecades) - will end up in overflow bin | |
3585 | // and only affect the efficiencies for all (i.e. not identified) what is desired! | |
3586 | //if (mcID == AliPID::kUnknown) | |
3587 | // continue; | |
3588 | ||
3589 | // Fill efficiency for reconstructed primaries | |
3590 | if (!gentrack->IsPhysicalPrimary()) | |
3591 | continue; | |
3592 | /* | |
3593 | Int_t iMother = gentrack->GetMother(); | |
3594 | if (iMother >= 0) | |
3595 | continue; // Not a physical primary | |
3596 | */ | |
3597 | ||
3598 | if (gentrack->Eta() > fTrackEtaMax || gentrack->Eta() < fTrackEtaMin) | |
3599 | continue; | |
3600 | ||
3601 | Double_t genZ = -1., genXi = -1.; | |
3602 | Double_t genPt = gentrack->Pt(); | |
3603 | AliAnalysisTaskPID::GetJetTrackObservables(genPt, jetPt, genZ, genXi); | |
3604 | ||
3605 | Double_t measZ = -1., measXi = -1.; | |
3606 | Double_t measPt = aodtrack->Pt(); | |
3607 | AliAnalysisTaskPID::GetJetTrackObservables(measPt, jetPt, measZ, measXi); | |
3608 | ||
3609 | ||
3610 | // AliAODMCParticle->Charge() calls TParticlePDG->Charge(), which returns the charge in units of e0 / 3 | |
2942f542 | 3611 | Double_t value[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), genPt, gentrack->Eta(), gentrack->Charge() / 3., |
e131b05f | 3612 | centPercent, jetPt, genZ, genXi }; |
a6852ea8 | 3613 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
ec994e6a | 3614 | if (!isPileUpJetPIDtask[i] && |
3615 | ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3616 | (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3617 | (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))) |
a6852ea8 | 3618 | fJetPIDtask[i]->FillEfficiencyContainer(value, AliAnalysisTaskPID::kStepRecWithGenCuts); |
3619 | } | |
e131b05f | 3620 | |
2942f542 | 3621 | Double_t valueMeas[AliAnalysisTaskPID::kEffNumAxes] = { static_cast<Double_t>(mcID), measPt, aodtrack->Eta(), static_cast<Double_t>(aodtrack->Charge()), |
e131b05f | 3622 | centPercent, jetPt, measZ, measXi }; |
a6852ea8 | 3623 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { |
ec994e6a | 3624 | if (!isPileUpJetPIDtask[i] && |
3625 | ((!fJetPIDtask[i]->GetUseTPCCutMIGeo() && !fJetPIDtask[i]->GetUseTPCnclCut()) || | |
493982d9 | 3626 | (survivedTPCCutMIGeo && fJetPIDtask[i]->GetUseTPCCutMIGeo()) || |
ec994e6a | 3627 | (survivedTPCnclCut && fJetPIDtask[i]->GetUseTPCnclCut()))) |
a6852ea8 | 3628 | fJetPIDtask[i]->FillEfficiencyContainer(valueMeas, AliAnalysisTaskPID::kStepRecWithGenCutsMeasuredObs); |
3629 | } | |
e131b05f | 3630 | } |
3631 | } | |
3632 | } | |
3633 | ||
3634 | // background ff | |
3635 | if(fBckgMode && (ij==0)){ | |
3636 | if(fBckgType[0]!=kBckgNone) | |
3637 | FillBckgHistos(fBckgType[0], fTracksRecCuts, fJetsRecCuts, jet, | |
3638 | fFFBckgHisto0RecCuts,fQABckgHisto0RecCuts, fh1BckgMult0); | |
3639 | if(fBckgType[1]!=kBckgNone) | |
3640 | FillBckgHistos(fBckgType[1], fTracksRecCuts, fJetsRecCuts, jet, | |
3641 | fFFBckgHisto1RecCuts,fQABckgHisto1RecCuts, fh1BckgMult1); | |
3642 | if(fBckgType[2]!=kBckgNone) | |
3643 | FillBckgHistos(fBckgType[2], fTracksRecCuts, fJetsRecCuts, jet, | |
3644 | fFFBckgHisto2RecCuts,fQABckgHisto2RecCuts, fh1BckgMult1); | |
3645 | if(fBckgType[3]!=kBckgNone) | |
3646 | FillBckgHistos(fBckgType[3], fTracksRecCuts, fJetsRecCuts, jet, | |
3647 | fFFBckgHisto3RecCuts,fQABckgHisto3RecCuts, fh1BckgMult2); | |
3648 | if(fBckgType[4]!=kBckgNone) | |
3649 | FillBckgHistos(fBckgType[4], fTracksRecCuts, fJetsRecCuts, jet, | |
3650 | fFFBckgHisto4RecCuts,fQABckgHisto4RecCuts, fh1BckgMult3); | |
3651 | } // end if(fBckgMode) | |
3652 | ||
3653 | ||
3654 | if(fJSMode && (ij==0)) FillJetShape(jet, jettracklist, fProNtracksLeadingJet, fProDelRPtSum, fProDelR80pcPt); | |
3655 | ||
3656 | delete jettracklist; | |
3657 | ||
3658 | } // end: cut embedded ratio | |
c4856fb1 | 3659 | } // end: leading jet or all jets |
e131b05f | 3660 | } // end: rec. jets after cuts |
3661 | } // end: QA, FF and intra-jet | |
3662 | ||
3663 | ||
3664 | // ____ efficiency _______________________________ | |
3665 | ||
3666 | if(fEffMode && (fJetTypeRecEff != kJetsUndef)){ | |
3667 | ||
3668 | // arrays holding for each generated particle the reconstructed AOD track index & isPrimary flag, are initialized in AssociateGenRec(...) function | |
3669 | TArrayI indexAODTr; | |
3670 | TArrayS isGenPrim; | |
3671 | ||
3672 | // array holding for each reconstructed AOD track generated particle index, initialized in AssociateGenRec(...) function | |
3673 | TArrayI indexMCTr; | |
3674 | ||
3675 | // ... and another set for secondaries from strange/non strange mothers (secondary MC tracks are stored in different lists) | |
3676 | TArrayI indexAODTrSecNS; | |
3677 | TArrayS isGenSecNS; | |
3678 | TArrayI indexMCTrSecNS; | |
3679 | ||
3680 | TArrayI indexAODTrSecS; | |
3681 | TArrayS isGenSecS; | |
3682 | TArrayI indexMCTrSecS; | |
3683 | ||
3684 | Int_t nTracksAODMCCharged = GetListOfTracks(fTracksAODMCCharged, kTrackAODMCCharged); | |
3685 | if(fDebug>2)Printf("%s:%d selected AODMC tracks: %d ",(char*)__FILE__,__LINE__,nTracksAODMCCharged); | |
3686 | ||
3687 | Int_t nTracksAODMCChargedSecNS = GetListOfTracks(fTracksAODMCChargedSecNS, kTrackAODMCChargedSecNS); | |
3688 | if(fDebug>2)Printf("%s:%d selected AODMC secondary tracks NS: %d ",(char*)__FILE__,__LINE__,nTracksAODMCChargedSecNS); | |
3689 | ||
3690 | Int_t nTracksAODMCChargedSecS = GetListOfTracks(fTracksAODMCChargedSecS, kTrackAODMCChargedSecS); | |
3691 | if(fDebug>2)Printf("%s:%d selected AODMC secondary tracks S: %d ",(char*)__FILE__,__LINE__,nTracksAODMCChargedSecS); | |
3692 | ||
3693 | Int_t nTracksRecQualityCuts = GetListOfTracks(fTracksRecQualityCuts, kTrackAODQualityCuts); | |
3694 | if(fDebug>2)Printf("%s:%d selected rec tracks quality after cuts, full acceptance/pt : %d ",(char*)__FILE__,__LINE__,nTracksRecQualityCuts); | |
3695 | ||
3696 | // associate gen and rec tracks, store indices in TArrays | |
3697 | AssociateGenRec(fTracksAODMCCharged,fTracksRecQualityCuts,indexAODTr,indexMCTr,isGenPrim,fh2PtRecVsGenPrim); | |
3698 | AssociateGenRec(fTracksAODMCChargedSecNS,fTracksRecQualityCuts,indexAODTrSecNS,indexMCTrSecNS,isGenSecNS,fh2PtRecVsGenSec); | |
3699 | AssociateGenRec(fTracksAODMCChargedSecS,fTracksRecQualityCuts,indexAODTrSecS,indexMCTrSecS,isGenSecS,fh2PtRecVsGenSec); | |
3700 | ||
3701 | // single track eff | |
3702 | if(fQAMode&1) FillSingleTrackHistosRecGen(fQATrackHistosRecEffGen,fQATrackHistosRecEffRec,fTracksAODMCCharged,indexAODTr,isGenPrim); | |
3703 | ||
3704 | // secondaries | |
3705 | if(fQAMode&1) FillSingleTrackHistosRecGen(0x0,fQATrackHistosSecRecNS,fTracksAODMCChargedSecNS,indexAODTrSecNS,isGenSecNS); | |
3706 | if(fQAMode&1) FillSingleTrackHistosRecGen(0x0,fQATrackHistosSecRecS,fTracksAODMCChargedSecS,indexAODTrSecS,isGenSecS); | |
3707 | if(fQAMode&1) FillSingleTrackHistosRecGen(0x0,fQATrackHistosSecRecSsc,fTracksAODMCChargedSecS,indexAODTrSecS,isGenSecS,kTRUE); | |
3708 | ||
3709 | ||
3710 | // jet track eff | |
3711 | Double_t sumPtGenLeadingJetRecEff = 0; | |
3712 | Double_t sumPtGenLeadingJetSec = 0; | |
3713 | Double_t sumPtRecLeadingJetRecEff = 0; | |
3714 | ||
3715 | for(Int_t ij=0; ij<nRecEffJets; ++ij){ // jet loop | |
3716 | ||
3717 | AliAODJet* jet = (AliAODJet*)(fJetsRecEff->At(ij)); | |
3718 | ||
3719 | Bool_t isBadJetGenPrim = kFALSE; | |
3720 | Bool_t isBadJetGenSec = kFALSE; | |
3721 | Bool_t isBadJetRec = kFALSE; | |
3722 | ||
3723 | ||
c4856fb1 | 3724 | if((ij==0) || !fOnlyLeadingJets){ // leading jets or all jets |
e131b05f | 3725 | |
3726 | // for efficiency: gen tracks from pointing with gen/rec jet | |
3727 | TList* jettracklistGenPrim = new TList(); | |
3728 | ||
3729 | // if radius<0 -> trackRefs: collect gen tracks in wide radius + fill FF recEff rec histos with tracks contained in track refs | |
3730 | // note : FF recEff gen histos will be somewhat useless in this approach | |
3731 | ||
3732 | if(GetFFRadius() >0) | |
3733 | GetJetTracksPointing(fTracksAODMCCharged, jettracklistGenPrim, jet, GetFFRadius(), sumPtGenLeadingJetRecEff, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetGenPrim); | |
3734 | else | |
3735 | GetJetTracksPointing(fTracksAODMCCharged, jettracklistGenPrim, jet, TMath::Abs(GetFFRadius())+0.2, sumPtGenLeadingJetRecEff, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetGenPrim); | |
3736 | ||
3737 | TList* jettracklistGenSecNS = new TList(); | |
3738 | if(GetFFRadius() >0) | |
3739 | GetJetTracksPointing(fTracksAODMCChargedSecNS, jettracklistGenSecNS, jet, GetFFRadius(), sumPtGenLeadingJetSec, GetFFMinLTrackPt() , GetFFMaxTrackPt(), isBadJetGenSec); | |
3740 | else | |
3741 | GetJetTracksPointing(fTracksAODMCChargedSecNS, jettracklistGenSecNS, jet, TMath::Abs(GetFFRadius())+0.2, sumPtGenLeadingJetSec, GetFFMinLTrackPt() , GetFFMaxTrackPt(), isBadJetGenSec); | |
3742 | ||
3743 | TList* jettracklistGenSecS = new TList(); | |
3744 | if(GetFFRadius() >0) | |
3745 | GetJetTracksPointing(fTracksAODMCChargedSecS, jettracklistGenSecS, jet, GetFFRadius(), sumPtGenLeadingJetSec, GetFFMinLTrackPt() , GetFFMaxTrackPt(), isBadJetGenSec); | |
3746 | else | |
3747 | GetJetTracksPointing(fTracksAODMCChargedSecS, jettracklistGenSecS, jet, TMath::Abs(GetFFRadius())+0.2, sumPtGenLeadingJetSec, GetFFMinLTrackPt() , GetFFMaxTrackPt(), isBadJetGenSec); | |
3748 | ||
3749 | ||
3750 | // bin efficiency in jet pt bins using rec tracks | |
3751 | TList* jettracklistRec = new TList(); | |
3752 | if(GetFFRadius() >0) GetJetTracksPointing(fTracksRecCuts,jettracklistRec, jet, GetFFRadius(), sumPtRecLeadingJetRecEff, GetFFMinLTrackPt() , GetFFMaxTrackPt(), isBadJetRec); | |
3753 | else GetJetTracksTrackrefs(jettracklistRec, jet, GetFFMinLTrackPt() , GetFFMaxTrackPt(), isBadJetRec); | |
3754 | ||
3755 | ||
3756 | Double_t jetEta = jet->Eta(); | |
3757 | Double_t jetPhi = TVector2::Phi_0_2pi(jet->Phi()); | |
3758 | ||
3759 | if(GetFFMinNTracks()>0 && jettracklistGenPrim->GetSize()<=GetFFMinNTracks()) isBadJetGenPrim = kTRUE; | |
3760 | if(GetFFMinNTracks()>0 && jettracklistGenSecNS->GetSize()<=GetFFMinNTracks()) isBadJetGenSec = kTRUE; | |
3761 | if(GetFFMinNTracks()>0 && jettracklistRec->GetSize()<=GetFFMinNTracks()) isBadJetRec = kTRUE; | |
3762 | ||
3763 | if(isBadJetRec) continue; | |
3764 | ||
3765 | if(fQAMode&2) fQAJetHistosRecEffLeading->FillJetQA( jetEta, jetPhi, sumPtGenLeadingJetRecEff ); | |
3766 | ||
3767 | if(fFFMode){ | |
3768 | ||
3769 | if(GetFFRadius()>0) FillJetTrackHistosRec(fFFHistosRecEffRec,jet, | |
3770 | jettracklistGenPrim,fTracksAODMCCharged,fTracksRecQualityCuts,indexAODTr,isGenPrim, | |
3771 | 0,kFALSE,fJSMode,fProNtracksLeadingJetRecPrim,fProDelRPtSumRecPrim,fProDelR80pcPtRecPrim); | |
3772 | ||
3773 | else FillJetTrackHistosRec(fFFHistosRecEffRec,jet, | |
3774 | jettracklistGenPrim,fTracksAODMCCharged,fTracksRecQualityCuts,indexAODTr,isGenPrim, | |
3775 | jettracklistRec,kFALSE,fJSMode,fProNtracksLeadingJetRecPrim,fProDelRPtSumRecPrim,fProDelR80pcPtRecPrim); | |
3776 | ||
3777 | ||
3778 | // secondaries: use jet pt from primaries | |
3779 | if(GetFFRadius()>0) FillJetTrackHistosRec(fFFHistosSecRecNS,jet, | |
3780 | jettracklistGenSecNS,fTracksAODMCChargedSecNS,fTracksRecQualityCuts, indexAODTrSecNS,isGenSecNS, | |
3781 | 0,kFALSE,fJSMode,fProNtracksLeadingJetRecSecNS,fProDelRPtSumRecSecNS); | |
3782 | ||
3783 | else FillJetTrackHistosRec(fFFHistosSecRecNS,jet, | |
3784 | jettracklistGenSecNS,fTracksAODMCChargedSecNS,fTracksRecQualityCuts,indexAODTrSecNS,isGenSecNS, | |
3785 | jettracklistRec,kFALSE,fJSMode,fProNtracksLeadingJetRecSecNS,fProDelRPtSumRecSecNS); | |
3786 | ||
3787 | if(GetFFRadius()>0) FillJetTrackHistosRec(fFFHistosSecRecS,jet, | |
3788 | jettracklistGenSecS,fTracksAODMCChargedSecS,fTracksRecQualityCuts,indexAODTrSecS,isGenSecS, | |
3789 | 0,kFALSE,fJSMode,fProNtracksLeadingJetRecSecS,fProDelRPtSumRecSecS); | |
3790 | ||
3791 | else FillJetTrackHistosRec(fFFHistosSecRecS,jet, | |
3792 | jettracklistGenSecS,fTracksAODMCChargedSecS,fTracksRecQualityCuts,indexAODTrSecS,isGenSecS, | |
3793 | jettracklistRec,kFALSE,fJSMode,fProNtracksLeadingJetRecSecS,fProDelRPtSumRecSecS); | |
3794 | ||
3795 | if(GetFFRadius()>0) FillJetTrackHistosRec(fFFHistosSecRecSsc,jet, | |
3796 | jettracklistGenSecS,fTracksAODMCChargedSecS,fTracksRecQualityCuts,indexAODTrSecS,isGenSecS, | |
3797 | 0,kTRUE,fJSMode,fProNtracksLeadingJetRecSecSsc,fProDelRPtSumRecSecSsc); | |
3798 | ||
3799 | else FillJetTrackHistosRec(fFFHistosSecRecSsc,jet, | |
3800 | jettracklistGenSecS,fTracksAODMCChargedSecS,fTracksRecQualityCuts,indexAODTrSecS,isGenSecS, | |
3801 | jettracklistRec,kTRUE,fJSMode,fProNtracksLeadingJetRecSecSsc,fProDelRPtSumRecSecSsc); | |
3802 | } | |
3803 | ||
3804 | delete jettracklistGenPrim; | |
3805 | delete jettracklistGenSecNS; | |
3806 | delete jettracklistGenSecS; | |
3807 | delete jettracklistRec; | |
3808 | ||
3809 | ||
3810 | if(fBckgMode && fFFMode){ | |
3811 | ||
3812 | TList* perpjettracklistGen = new TList(); | |
3813 | TList* perpjettracklistGen1 = new TList(); | |
3814 | TList* perpjettracklistGen2 = new TList(); | |
3815 | ||
3816 | //Double_t sumPtGenPerp = 0.; | |
3817 | Double_t sumPtGenPerp1 = 0.; | |
3818 | Double_t sumPtGenPerp2 = 0.; | |
3819 | GetTracksTiltedwrpJetAxis(TMath::Pi()/2.,fTracksAODMCCharged, perpjettracklistGen1, jet, TMath::Abs(GetFFRadius()) , sumPtGenPerp1); | |
3820 | GetTracksTiltedwrpJetAxis(-1*TMath::Pi()/2.,fTracksAODMCCharged, perpjettracklistGen2, jet, TMath::Abs(GetFFRadius()) , | |
3821 | sumPtGenPerp2); | |
3822 | ||
3823 | perpjettracklistGen->AddAll(perpjettracklistGen1); | |
3824 | perpjettracklistGen->AddAll(perpjettracklistGen2); | |
3825 | //sumPtGenPerp = 0.5*(sumPtGenPerp1+sumPtGenPerp2); | |
3826 | ||
3827 | TList* perpjettracklistGenSecNS = new TList(); | |
3828 | TList* perpjettracklistGenSecNS1 = new TList(); | |
3829 | TList* perpjettracklistGenSecNS2 = new TList(); | |
3830 | ||
3831 | //Double_t sumPtGenPerpNS = 0.; | |
3832 | Double_t sumPtGenPerpNS1 = 0.; | |
3833 | Double_t sumPtGenPerpNS2 = 0.; | |
3834 | GetTracksTiltedwrpJetAxis(TMath::Pi()/2.,fTracksAODMCChargedSecNS, perpjettracklistGenSecNS1, jet, TMath::Abs(GetFFRadius()) , | |
3835 | sumPtGenPerpNS1); | |
3836 | GetTracksTiltedwrpJetAxis(-1*TMath::Pi()/2.,fTracksAODMCChargedSecNS, perpjettracklistGenSecNS2, jet, TMath::Abs(GetFFRadius()) , | |
3837 | sumPtGenPerpNS2); | |
3838 | ||
3839 | perpjettracklistGenSecNS->AddAll(perpjettracklistGenSecNS1); | |
3840 | perpjettracklistGenSecNS->AddAll(perpjettracklistGenSecNS2); | |
3841 | //sumPtGenPerpNS = 0.5*(sumPtGenPerpNS1+sumPtGenPerpNS2); | |
3842 | ||
3843 | ||
3844 | TList* perpjettracklistGenSecS = new TList(); | |
3845 | TList* perpjettracklistGenSecS1 = new TList(); | |
3846 | TList* perpjettracklistGenSecS2 = new TList(); | |
3847 | ||
3848 | //Double_t sumPtGenPerpS = 0.; | |
3849 | Double_t sumPtGenPerpS1 = 0.; | |
3850 | Double_t sumPtGenPerpS2 = 0.; | |
3851 | GetTracksTiltedwrpJetAxis(TMath::Pi()/2.,fTracksAODMCChargedSecS, perpjettracklistGenSecS1, jet, TMath::Abs(GetFFRadius()) , | |
3852 | sumPtGenPerpS1); | |
3853 | GetTracksTiltedwrpJetAxis(-1*TMath::Pi()/2.,fTracksAODMCChargedSecS, perpjettracklistGenSecS2, jet, TMath::Abs(GetFFRadius()) , | |
3854 | sumPtGenPerpS2); | |
3855 | ||
3856 | perpjettracklistGenSecS->AddAll(perpjettracklistGenSecS1); | |
3857 | perpjettracklistGenSecS->AddAll(perpjettracklistGenSecS2); | |
3858 | //sumPtGenPerpS = 0.5*(sumPtGenPerpS1+sumPtGenPerpS2); | |
3859 | ||
3860 | ||
3861 | if(perpjettracklistGen->GetSize() != perpjettracklistGen1->GetSize() + perpjettracklistGen2->GetSize()){ | |
3862 | cout<<" ERROR: perpjettracklistGen size "<<perpjettracklistGen->GetSize()<<" perp1 "<<perpjettracklistGen1->GetSize() | |
3863 | <<" perp2 "<<perpjettracklistGen2->GetSize()<<endl; | |
3864 | exit(0); | |
3865 | } | |
3866 | ||
3867 | if(perpjettracklistGenSecNS->GetSize() != perpjettracklistGenSecNS1->GetSize() + perpjettracklistGenSecNS2->GetSize()){ | |
3868 | cout<<" ERROR: perpjettracklistGenSecNS size "<<perpjettracklistGenSecNS->GetSize()<<" perp1 "<<perpjettracklistGenSecNS1->GetSize() | |
3869 | <<" perp2 "<<perpjettracklistGenSecNS2->GetSize()<<endl; | |
3870 | exit(0); | |
3871 | } | |
3872 | ||
3873 | if(perpjettracklistGenSecS->GetSize() != perpjettracklistGenSecS1->GetSize() + perpjettracklistGenSecS2->GetSize()){ | |
3874 | cout<<" ERROR: perpjettracklistGenSecS size "<<perpjettracklistGenSecS->GetSize()<<" perp1 "<<perpjettracklistGenSecS1->GetSize() | |
3875 | <<" perp2 "<<perpjettracklistGenSecS2->GetSize()<<endl; | |
3876 | exit(0); | |
3877 | } | |
3878 | ||
3879 | ||
3880 | FillJetTrackHistosRec(fFFBckgHisto0RecEffRec,jet, | |
3881 | perpjettracklistGen,fTracksAODMCCharged,fTracksRecQualityCuts,indexAODTr,isGenPrim); | |
3882 | ||
3883 | FillJetTrackHistosRec(fFFBckgHisto0SecRecNS,jet, | |
3884 | perpjettracklistGenSecNS,fTracksAODMCChargedSecNS,fTracksRecQualityCuts,indexAODTrSecNS,isGenSecNS); | |
3885 | ||
3886 | FillJetTrackHistosRec(fFFBckgHisto0SecRecS,jet, | |
3887 | perpjettracklistGenSecS,fTracksAODMCChargedSecS,fTracksRecQualityCuts,indexAODTrSecS,isGenSecS); | |
3888 | ||
3889 | FillJetTrackHistosRec(fFFBckgHisto0SecRecSsc,jet, | |
3890 | perpjettracklistGenSecS,fTracksAODMCChargedSecS,fTracksRecQualityCuts,indexAODTrSecS,isGenSecS,0,kTRUE); | |
3891 | ||
3892 | ||
3893 | delete perpjettracklistGen; | |
3894 | delete perpjettracklistGen1; | |
3895 | delete perpjettracklistGen2; | |
3896 | ||
3897 | delete perpjettracklistGenSecNS; | |
3898 | delete perpjettracklistGenSecNS1; | |
3899 | delete perpjettracklistGenSecNS2; | |
3900 | ||
3901 | delete perpjettracklistGenSecS; | |
3902 | delete perpjettracklistGenSecS1; | |
3903 | delete perpjettracklistGenSecS2; | |
3904 | ||
3905 | } | |
3906 | } | |
3907 | } | |
3908 | } | |
3909 | ||
3910 | //___________________ | |
3911 | ||
3912 | fTracksRecCuts->Clear(); | |
3913 | fTracksRecCutsEfficiency->Clear(); | |
3914 | fTracksGen->Clear(); | |
3915 | fTracksAODMCCharged->Clear(); | |
3916 | fTracksAODMCChargedSecNS->Clear(); | |
3917 | fTracksAODMCChargedSecS->Clear(); | |
3918 | fTracksRecQualityCuts->Clear(); | |
3919 | ||
3920 | fJetsRec->Clear(); | |
3921 | fJetsRecCuts->Clear(); | |
3922 | fJetsGen->Clear(); | |
3923 | fJetsRecEff->Clear(); | |
3924 | fJetsEmbedded->Clear(); | |
3925 | ||
3926 | ||
3927 | if(fBckgMode && | |
3928 | (fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters || | |
3929 | fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || | |
3930 | fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading)){ | |
3931 | ||
3932 | fBckgJetsRec->Clear(); | |
3933 | fBckgJetsRecCuts->Clear(); | |
3934 | fBckgJetsGen->Clear(); | |
3935 | } | |
3936 | ||
3937 | ||
3938 | //Post output data. | |
3939 | PostData(1, fCommonHistList); | |
3940 | ||
3941 | if (fUseJetPIDtask) { | |
3942 | for (Int_t i = 0; i < fNumJetPIDtasks; i++) { | |
3943 | fJetPIDtask[i]->PostOutputData(); | |
e131b05f | 3944 | } |
3945 | } | |
3946 | ||
3947 | if (fUseInclusivePIDtask) { | |
3948 | for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) { | |
3949 | fInclusivePIDtask[i]->PostOutputData(); | |
e131b05f | 3950 | } |
3951 | } | |
3952 | } | |
3953 | ||
3954 | //______________________________________________________________ | |
3955 | void AliAnalysisTaskIDFragmentationFunction::Terminate(Option_t *) | |
3956 | { | |
3957 | // terminated | |
3958 | ||
3959 | if(fDebug > 1) printf("AliAnalysisTaskIDFragmentationFunction::Terminate() \n"); | |
3960 | } | |
3961 | ||
3962 | //_________________________________________________________________________________ | |
3963 | Int_t AliAnalysisTaskIDFragmentationFunction::GetListOfTracks(TList *list, Int_t type) | |
3964 | { | |
3965 | // fill list of tracks selected according to type | |
3966 | ||
3967 | if(fDebug > 2) Printf("%s:%d Selecting tracks with %d", (char*)__FILE__,__LINE__,type); | |
3968 | ||
3969 | if(!list){ | |
3970 | if(fDebug>1) Printf("%s:%d no input list", (char*)__FILE__,__LINE__); | |
3971 | return -1; | |
3972 | } | |
3973 | ||
3974 | if(!fAOD) return -1; | |
3975 | ||
3976 | if(!fAOD->GetTracks()) return 0; | |
3977 | ||
3978 | if(type==kTrackUndef) return 0; | |
3979 | ||
3980 | Int_t iCount = 0; | |
3981 | ||
3982 | if(type==kTrackAODExtraCuts || type==kTrackAODExtraonlyCuts || type==kTrackAODExtra || type==kTrackAODExtraonly){ | |
3983 | ||
3984 | TClonesArray *aodExtraTracks = dynamic_cast<TClonesArray*>(fAOD->FindListObject("aodExtraTracks")); | |
3985 | if(!aodExtraTracks)return iCount; | |
3986 | for(int it =0; it<aodExtraTracks->GetEntries(); it++) { | |
3987 | AliVParticle *track = dynamic_cast<AliVParticle*> ((*aodExtraTracks)[it]); | |
3988 | if (!track) continue; | |
3989 | ||
3990 | AliAODTrack *tr = dynamic_cast<AliAODTrack*> (track); | |
3991 | if(!tr)continue; | |
3992 | ||
3993 | if(type==kTrackAODExtraCuts || type==kTrackAODExtraonlyCuts){ | |
3994 | ||
3995 | if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask))) continue; | |
3996 | ||
3997 | if(tr->Eta() < fTrackEtaMin || tr->Eta() > fTrackEtaMax) continue; | |
3998 | if(tr->Phi() < fTrackPhiMin || tr->Phi() > fTrackPhiMax) continue; | |
3999 | if(tr->Pt() < fTrackPtCut) continue; | |
4000 | } | |
4001 | ||
4002 | list->Add(tr); | |
4003 | iCount++; | |
4004 | } | |
4005 | } | |
4006 | ||
4007 | if(type==kTrackAODCuts || type==kTrackAODQualityCuts || type==kTrackAOD || type==kTrackAODExtraCuts || type==kTrackAODExtra){ | |
4008 | ||
4009 | // all rec. tracks, esd filter mask, eta range | |
4010 | ||
4011 | for(Int_t it=0; it<fAOD->GetNumberOfTracks(); ++it){ | |
0a918d8d | 4012 | AliAODTrack *tr = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(it)); |
4013 | if(!tr) AliFatal("Not a standard AOD"); | |
e131b05f | 4014 | |
4015 | if(type == kTrackAODCuts || type==kTrackAODQualityCuts || type==kTrackAODExtraCuts){ | |
4016 | ||
4017 | if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask))) continue; | |
4018 | if(type == kTrackAODCuts){ | |
4019 | if(tr->Eta() < fTrackEtaMin || tr->Eta() > fTrackEtaMax) continue; | |
4020 | if(tr->Phi() < fTrackPhiMin || tr->Phi() > fTrackPhiMax) continue; | |
4021 | if(tr->Pt() < fTrackPtCut) continue; | |
4022 | } | |
4023 | } | |
4024 | list->Add(tr); | |
4025 | iCount++; | |
4026 | } | |
4027 | } | |
4028 | else if (type==kTrackKineAll || type==kTrackKineCharged || type==kTrackKineChargedAcceptance){ | |
4029 | // kine particles, all or rather charged | |
4030 | if(!fMCEvent) return iCount; | |
4031 | ||
4032 | for(Int_t it=0; it<fMCEvent->GetNumberOfTracks(); ++it){ | |
4033 | AliMCParticle* part = (AliMCParticle*) fMCEvent->GetTrack(it); | |
4034 | ||
4035 | if(type == kTrackKineCharged || type == kTrackKineChargedAcceptance){ | |
4036 | if(part->Charge()==0) continue; | |
4037 | ||
4038 | if(type == kTrackKineChargedAcceptance && | |
4039 | ( part->Eta() < fTrackEtaMin | |
4040 | || part->Eta() > fTrackEtaMax | |
4041 | || part->Phi() < fTrackPhiMin | |
4042 | || part->Phi() > fTrackPhiMax | |
4043 | || part->Pt() < fTrackPtCut)) continue; | |
4044 | } | |
4045 | ||
4046 | list->Add(part); | |
4047 | iCount++; | |
4048 | } | |
4049 | } | |
4050 | else if (type==kTrackAODMCCharged || type==kTrackAODMCAll || type==kTrackAODMCChargedAcceptance || type==kTrackAODMCChargedSecNS || type==kTrackAODMCChargedSecS) { | |
4051 | // MC particles (from AOD), physical primaries, all or rather charged or rather charged within acceptance | |
4052 | if(!fAOD) return -1; | |
4053 | ||
4054 | TClonesArray *tca = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName())); | |
4055 | if(!tca)return iCount; | |
4056 | ||
4057 | for(int it=0; it<tca->GetEntriesFast(); ++it){ | |
4058 | AliAODMCParticle *part = dynamic_cast<AliAODMCParticle*>(tca->At(it)); | |
4059 | if(!part)continue; | |
4060 | if(type != kTrackAODMCChargedSecNS && type != kTrackAODMCChargedSecS && !part->IsPhysicalPrimary())continue; | |
4061 | if((type == kTrackAODMCChargedSecNS || type == kTrackAODMCChargedSecS) && part->IsPhysicalPrimary())continue; | |
4062 | ||
4063 | if (type==kTrackAODMCCharged || type==kTrackAODMCChargedAcceptance || type==kTrackAODMCChargedSecNS || type==kTrackAODMCChargedSecS){ | |
4064 | if(part->Charge()==0) continue; | |
4065 | ||
4066 | if(type==kTrackAODMCChargedSecNS || type==kTrackAODMCChargedSecS){ | |
4067 | Bool_t isFromStrange = kFALSE; | |
4068 | Int_t iMother = part->GetMother(); | |
4069 | if(iMother >= 0){ | |
4070 | AliAODMCParticle *partM = dynamic_cast<AliAODMCParticle*>(tca->At(iMother)); | |
4071 | if(!partM) continue; | |
4072 | ||
4073 | Int_t codeM = TMath::Abs(partM->GetPdgCode()); | |
4074 | Int_t mfl = Int_t (codeM/ TMath::Power(10, Int_t(TMath::Log10(codeM)))); | |
4075 | ||
4076 | if (mfl == 3 && codeM != 3) isFromStrange = kTRUE; | |
4077 | if(codeM == 130) isFromStrange = kTRUE; // K0 long | |
4078 | if(part->IsSecondaryFromMaterial()) isFromStrange = kFALSE; // strange resonances from hadronic showers ? | |
4079 | ||
4080 | // if(mfl ==3){ | |
4081 | // cout<<" mfl "<<mfl<<" codeM "<<partM->GetPdgCode()<<" code this track "<<part->GetPdgCode()<<endl; | |
4082 | // cout<<" index this track "<<it<<" index daughter 0 "<<partM->GetDaughter(0)<<" 1 "<<partM->GetDaughter(1)<<endl; | |
4083 | // } | |
4084 | ||
4085 | if(type==kTrackAODMCChargedSecNS && isFromStrange) continue; | |
4086 | if(type==kTrackAODMCChargedSecS && !isFromStrange) continue; | |
4087 | } | |
4088 | } | |
4089 | ||
4090 | if(type==kTrackAODMCChargedAcceptance && | |
4091 | ( part->Eta() > fTrackEtaMax | |
4092 | || part->Eta() < fTrackEtaMin | |
4093 | || part->Phi() > fTrackPhiMax | |
4094 | || part->Phi() < fTrackPhiMin | |
4095 | || part->Pt() < fTrackPtCut)) continue; | |
4096 | } | |
4097 | ||
4098 | list->Add(part); | |
4099 | iCount++; | |
4100 | } | |
4101 | } | |
4102 | ||
4103 | list->Sort(); | |
4104 | return iCount; | |
4105 | ||
4106 | } | |
4107 | // _______________________________________________________________________________ | |
4108 | Int_t AliAnalysisTaskIDFragmentationFunction::GetListOfJets(TList *list, Int_t type) | |
4109 | { | |
4110 | // fill list of jets selected according to type | |
4111 | ||
4112 | if(!list){ | |
4113 | if(fDebug>1) Printf("%s:%d no input list", (char*)__FILE__,__LINE__); | |
4114 | return -1; | |
4115 | } | |
4116 | ||
4117 | if(type == kJetsRec || type == kJetsRecAcceptance){ // reconstructed jets | |
4118 | ||
4119 | if(fBranchRecJets.Length()==0){ | |
4120 | Printf("%s:%d no rec jet branch specified", (char*)__FILE__,__LINE__); | |
4121 | if(fDebug>1)fAOD->Print(); | |
4122 | return 0; | |
4123 | } | |
4124 | ||
4125 | TClonesArray *aodRecJets = 0; | |
4126 | if(fBranchRecJets.Length()) aodRecJets = dynamic_cast<TClonesArray*>(fAODJets->FindListObject(fBranchRecJets.Data())); | |
4127 | if(!aodRecJets) aodRecJets = dynamic_cast<TClonesArray*>(fAODJets->GetList()->FindObject(fBranchRecJets.Data())); | |
4128 | if(fAODExtension&&!aodRecJets) aodRecJets = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fBranchRecJets.Data())); | |
4129 | ||
4130 | if(!aodRecJets){ | |
4131 | if(fBranchRecJets.Length()) Printf("%s:%d no reconstructed jet array with name %s in AOD", (char*)__FILE__,__LINE__,fBranchRecJets.Data()); | |
4132 | if(fDebug>1)fAOD->Print(); | |
4133 | return 0; | |
4134 | } | |
4135 | ||
4136 | // Reorder jet pt and fill new temporary AliAODJet objects | |
4137 | Int_t nRecJets = 0; | |
4138 | ||
4139 | for(Int_t ij=0; ij<aodRecJets->GetEntries(); ++ij){ | |
4140 | ||
4141 | AliAODJet *tmp = dynamic_cast<AliAODJet*>(aodRecJets->At(ij)); | |
4142 | if(!tmp) continue; | |
4143 | ||
4144 | if( tmp->Pt() < fJetPtCut ) continue; | |
4145 | if( type == kJetsRecAcceptance && | |
4146 | ( tmp->Eta() < fJetEtaMin | |
4147 | || tmp->Eta() > fJetEtaMax | |
4148 | || tmp->Phi() < fJetPhiMin | |
4149 | || tmp->Phi() > fJetPhiMax )) continue; | |
4150 | ||
4151 | ||
4152 | list->Add(tmp); | |
4153 | nRecJets++; | |
4154 | } | |
4155 | ||
4156 | list->Sort(); | |
4157 | ||
4158 | return nRecJets; | |
4159 | } | |
4160 | else if(type == kJetsKine || type == kJetsKineAcceptance){ | |
4161 | ||
4162 | // generated jets | |
4163 | Int_t nGenJets = 0; | |
4164 | ||
4165 | if(!fMCEvent){ | |
4166 | if(fDebug>1) Printf("%s:%d no mcEvent",(char*)__FILE__,__LINE__); | |
4167 | return 0; | |
4168 | } | |
4169 | ||
4170 | AliGenEventHeader* genHeader = fMCEvent->GenEventHeader(); | |
4171 | AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader); | |
4172 | AliGenHijingEventHeader* hijingGenHeader = 0x0; | |
4173 | ||
4174 | if(!pythiaGenHeader){ | |
4175 | hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader); | |
4176 | ||
4177 | if(!hijingGenHeader){ | |
4178 | Printf("%s:%d no pythiaGenHeader or hijingGenHeader found", (char*)__FILE__,__LINE__); | |
4179 | return 0; | |
4180 | }else{ | |
4181 | TLorentzVector mom[4]; | |
4182 | AliAODJet* jet[4]; | |
4183 | hijingGenHeader->GetJets(mom[0], mom[1], mom[2], mom[3]); | |
4184 | ||
4185 | for(Int_t i=0; i<2; ++i){ | |
4186 | if(!mom[i].Pt()) continue; | |
4187 | jet[i] = new AliAODJet(mom[i]); | |
4188 | ||
4189 | if( type == kJetsKineAcceptance && | |
4190 | ( jet[i]->Eta() < fJetEtaMin | |
4191 | || jet[i]->Eta() > fJetEtaMax | |
4192 | || jet[i]->Phi() < fJetPhiMin | |
4193 | || jet[i]->Phi() > fJetPhiMax )) continue; | |
4194 | ||
4195 | list->Add(jet[i]); | |
4196 | nGenJets++; | |
4197 | } | |
4198 | list->Sort(); | |
4199 | return nGenJets; | |
4200 | } | |
4201 | } | |
4202 | ||
4203 | // fetch the pythia generated jets | |
4204 | for(int ip=0; ip<pythiaGenHeader->NTriggerJets(); ++ip){ | |
4205 | ||
4206 | Float_t p[4]; | |
4207 | AliAODJet *jet = new AliAODJet(); | |
4208 | pythiaGenHeader->TriggerJet(ip, p); | |
4209 | jet->SetPxPyPzE(p[0], p[1], p[2], p[3]); | |
4210 | ||
4211 | if( type == kJetsKineAcceptance && | |
4212 | ( jet->Eta() < fJetEtaMin | |
4213 | || jet->Eta() > fJetEtaMax | |
4214 | || jet->Phi() < fJetPhiMin | |
4215 | || jet->Phi() > fJetPhiMax )) continue; | |
4216 | ||
4217 | list->Add(jet); | |
4218 | nGenJets++; | |
4219 | } | |
4220 | list->Sort(); | |
4221 | return nGenJets; | |
4222 | } | |
4223 | else if(type == kJetsGen || type == kJetsGenAcceptance ){ | |
4224 | ||
4225 | if(fBranchGenJets.Length()==0){ | |
4226 | if(fDebug>1) Printf("%s:%d no gen jet branch specified", (char*)__FILE__,__LINE__); | |
4227 | return 0; | |
4228 | } | |
4229 | ||
4230 | TClonesArray *aodGenJets = 0; | |
4231 | if(fBranchGenJets.Length()) aodGenJets = dynamic_cast<TClonesArray*>(fAODJets->FindListObject(fBranchGenJets.Data())); | |
4232 | if(!aodGenJets) aodGenJets = dynamic_cast<TClonesArray*>(fAODJets->GetList()->FindObject(fBranchGenJets.Data())); | |
4233 | if(fAODExtension&&!aodGenJets) aodGenJets = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fBranchGenJets.Data())); | |
4234 | ||
4235 | if(!aodGenJets){ | |
4236 | if(fDebug>0){ | |
4237 | if(fBranchGenJets.Length()) Printf("%s:%d Generated jet branch %s not found",(char*)__FILE__,__LINE__,fBranchGenJets.Data()); | |
4238 | } | |
4239 | if(fDebug>1)fAOD->Print(); | |
4240 | return 0; | |
4241 | } | |
4242 | ||
4243 | Int_t nGenJets = 0; | |
4244 | ||
4245 | for(Int_t ig=0; ig<aodGenJets->GetEntries(); ++ig){ | |
4246 | ||
4247 | AliAODJet *tmp = dynamic_cast<AliAODJet*>(aodGenJets->At(ig)); | |
4248 | if(!tmp) continue; | |
4249 | ||
4250 | if( tmp->Pt() < fJetPtCut ) continue; | |
4251 | if( type == kJetsGenAcceptance && | |
4252 | ( tmp->Eta() < fJetEtaMin | |
4253 | || tmp->Eta() > fJetEtaMax | |
4254 | || tmp->Phi() < fJetPhiMin | |
4255 | || tmp->Phi() > fJetPhiMax )) continue; | |
4256 | ||
4257 | list->Add(tmp); | |
4258 | nGenJets++; | |
4259 | } | |
4260 | list->Sort(); | |
4261 | return nGenJets; | |
4262 | } | |
4263 | else if(type == kJetsEmbedded){ // embedded jets | |
4264 | ||
4265 | if(fBranchEmbeddedJets.Length()==0){ | |
4266 | Printf("%s:%d no embedded jet branch specified", (char*)__FILE__,__LINE__); | |
4267 | if(fDebug>1)fAOD->Print(); | |
4268 | return 0; | |
4269 | } | |
4270 | ||
4271 | TClonesArray *aodEmbeddedJets = 0; | |
4272 | if(fBranchEmbeddedJets.Length()) aodEmbeddedJets = dynamic_cast<TClonesArray*>(fAODJets->FindListObject(fBranchEmbeddedJets.Data())); | |
4273 | if(!aodEmbeddedJets) aodEmbeddedJets = dynamic_cast<TClonesArray*>(fAODJets->GetList()->FindObject(fBranchEmbeddedJets.Data())); | |
4274 | if(fAODExtension&&!aodEmbeddedJets) aodEmbeddedJets = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fBranchEmbeddedJets.Data())); | |
4275 | ||
4276 | if(!aodEmbeddedJets){ | |
4277 | if(fBranchEmbeddedJets.Length()) Printf("%s:%d no reconstructed jet array with name %s in AOD", (char*)__FILE__,__LINE__,fBranchEmbeddedJets.Data()); | |
4278 | if(fDebug>1)fAOD->Print(); | |
4279 | return 0; | |
4280 | } | |
4281 | ||
4282 | // Reorder jet pt and fill new temporary AliAODJet objects | |
4283 | Int_t nEmbeddedJets = 0; | |
4284 | ||
4285 | for(Int_t ij=0; ij<aodEmbeddedJets->GetEntries(); ++ij){ | |
4286 | ||
4287 | AliAODJet *tmp = dynamic_cast<AliAODJet*>(aodEmbeddedJets->At(ij)); | |
4288 | if(!tmp) continue; | |
4289 | ||
4290 | if( tmp->Pt() < fJetPtCut ) continue; | |
4291 | if( tmp->Eta() < fJetEtaMin | |
4292 | || tmp->Eta() > fJetEtaMax | |
4293 | || tmp->Phi() < fJetPhiMin | |
4294 | || tmp->Phi() > fJetPhiMax ) continue; | |
4295 | ||
4296 | list->Add(tmp); | |
4297 | nEmbeddedJets++; | |
4298 | } | |
4299 | ||
4300 | list->Sort(); | |
4301 | ||
4302 | return nEmbeddedJets; | |
4303 | } | |
4304 | else{ | |
4305 | if(fDebug>0)Printf("%s:%d no such type %d",(char*)__FILE__,__LINE__,type); | |
4306 | return 0; | |
4307 | } | |
4308 | } | |
4309 | ||
4310 | // ___________________________________________________________________________________ | |
4311 | Int_t AliAnalysisTaskIDFragmentationFunction::GetListOfBckgJets(TList *list, Int_t type) | |
4312 | { | |
4313 | // fill list of bgr clusters selected according to type | |
4314 | ||
4315 | if(type == kJetsRec || type == kJetsRecAcceptance){ // reconstructed jets | |
4316 | ||
4317 | if(fBranchRecBckgClusters.Length()==0){ | |
4318 | Printf("%s:%d no rec jet branch specified", (char*)__FILE__,__LINE__); | |
4319 | if(fDebug>1)fAOD->Print(); | |
4320 | return 0; | |
4321 | } | |
4322 | ||
4323 | TClonesArray *aodRecJets = 0; | |
4324 | if(fBranchRecBckgClusters.Length()) aodRecJets = dynamic_cast<TClonesArray*>(fAODJets->FindListObject(fBranchRecBckgClusters.Data())); | |
4325 | if(!aodRecJets) aodRecJets = dynamic_cast<TClonesArray*>(fAODJets->GetList()->FindObject(fBranchRecBckgClusters.Data())); | |
4326 | if(fAODExtension&&!aodRecJets) aodRecJets = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fBranchRecBckgClusters.Data())); | |
4327 | ||
4328 | if(!aodRecJets){ | |
4329 | if(fBranchRecBckgClusters.Length()) Printf("%s:%d no reconstructed jet array with name %s in AOD", (char*)__FILE__,__LINE__,fBranchRecBckgClusters.Data()); | |
4330 | if(fDebug>1)fAOD->Print(); | |
4331 | return 0; | |
4332 | } | |
4333 | ||
4334 | // Reorder jet pt and fill new temporary AliAODJet objects | |
4335 | Int_t nRecJets = 0; | |
4336 | ||
4337 | for(Int_t ij=0; ij<aodRecJets->GetEntries(); ++ij){ | |
4338 | ||
4339 | AliAODJet *tmp = dynamic_cast<AliAODJet*>(aodRecJets->At(ij)); | |
4340 | if(!tmp) continue; | |
4341 | ||
4342 | // if( tmp->Pt() < fJetPtCut ) continue; // no pt cut on bckg clusters ! | |
4343 | if( type == kJetsRecAcceptance && | |
4344 | ( tmp->Eta() < fJetEtaMin | |
4345 | || tmp->Eta() > fJetEtaMax | |
4346 | || tmp->Phi() < fJetPhiMin | |
4347 | || tmp->Phi() > fJetPhiMax )) continue; | |
4348 | ||
4349 | list->Add(tmp); | |
4350 | ||
4351 | nRecJets++; | |
4352 | ||
4353 | } | |
4354 | ||
4355 | list->Sort(); | |
4356 | ||
4357 | return nRecJets; | |
4358 | } | |
4359 | ||
4360 | // /* | |
4361 | // MC clusters still Under construction | |
4362 | // */ | |
4363 | ||
4364 | return 0; | |
4365 | } | |
4366 | ||
4367 | // _________________________________________________________________________________________________________ | |
9d7ad2e4 | 4368 | void AliAnalysisTaskIDFragmentationFunction::SetProperties(THnSparse* h, Int_t dim, const char** labels) |
e131b05f | 4369 | { |
4370 | // Set properties of THnSparse | |
4371 | ||
4372 | for(Int_t i=0; i<dim; i++){ | |
4373 | h->GetAxis(i)->SetTitle(labels[i]); | |
4374 | h->GetAxis(i)->SetTitleColor(1); | |
4375 | } | |
4376 | } | |
4377 | ||
4378 | // __________________________________________________________________________________________ | |
4379 | void AliAnalysisTaskIDFragmentationFunction::SetProperties(TH1* h,const char* x, const char* y) | |
4380 | { | |
4381 | //Set properties of histos (x and y title) | |
4382 | ||
4383 | h->SetXTitle(x); | |
4384 | h->SetYTitle(y); | |
4385 | h->GetXaxis()->SetTitleColor(1); | |
4386 | h->GetYaxis()->SetTitleColor(1); | |
4387 | } | |
4388 | ||
4389 | // _________________________________________________________________________________________________________ | |
4390 | void AliAnalysisTaskIDFragmentationFunction::SetProperties(TH1* h,const char* x, const char* y, const char* z) | |
4391 | { | |
4392 | //Set properties of histos (x,y and z title) | |
4393 | ||
4394 | h->SetXTitle(x); | |
4395 | h->SetYTitle(y); | |
4396 | h->SetZTitle(z); | |
4397 | h->GetXaxis()->SetTitleColor(1); | |
4398 | h->GetYaxis()->SetTitleColor(1); | |
4399 | h->GetZaxis()->SetTitleColor(1); | |
4400 | } | |
4401 | ||
4402 | // ________________________________________________________________________________________________________________________________________________________ | |
4403 | void AliAnalysisTaskIDFragmentationFunction::GetJetTracksPointing(TList* inputlist, TList* outputlist, const AliAODJet* jet, | |
9d7ad2e4 | 4404 | Double_t radius, Double_t& sumPt, Double_t minPtL, Double_t maxPt, Bool_t& isBadPt) |
e131b05f | 4405 | { |
4406 | // fill list of tracks in cone around jet axis | |
4407 | ||
4408 | sumPt = 0; | |
4409 | Bool_t isBadMaxPt = kFALSE; | |
4410 | Bool_t isBadMinPt = kTRUE; | |
4411 | ||
4412 | Double_t jetMom[3]; | |
4413 | jet->PxPyPz(jetMom); | |
4414 | TVector3 jet3mom(jetMom); | |
4415 | ||
4416 | for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){ | |
4417 | ||
4418 | AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); | |
4419 | if(!track)continue; | |
4420 | Double_t trackMom[3]; | |
4421 | track->PxPyPz(trackMom); | |
4422 | TVector3 track3mom(trackMom); | |
4423 | ||
4424 | Double_t dR = jet3mom.DeltaR(track3mom); | |
4425 | ||
4426 | if(dR<radius){ | |
4427 | ||
4428 | outputlist->Add(track); | |
4429 | ||
4430 | sumPt += track->Pt(); | |
4431 | ||
4432 | if(maxPt>0 && track->Pt()>maxPt) isBadMaxPt = kTRUE; | |
4433 | if(minPtL>0 && track->Pt()>minPtL) isBadMinPt = kFALSE; | |
4434 | } | |
4435 | } | |
4436 | ||
4437 | isBadPt = kFALSE; | |
4438 | if(minPtL>0 && isBadMinPt) isBadPt = kTRUE; | |
4439 | if(maxPt>0 && isBadMaxPt) isBadPt = kTRUE; | |
4440 | ||
4441 | outputlist->Sort(); | |
4442 | } | |
4443 | ||
4444 | // _________________________________________________________________________________________________________________________________________________________________ | |
9d7ad2e4 | 4445 | void AliAnalysisTaskIDFragmentationFunction::GetJetTracksTrackrefs(TList* list, const AliAODJet* jet, Double_t minPtL, Double_t maxPt, Bool_t& isBadPt) |
e131b05f | 4446 | { |
4447 | // list of jet tracks from trackrefs | |
4448 | ||
4449 | Int_t nTracks = jet->GetRefTracks()->GetEntriesFast(); | |
4450 | ||
4451 | Bool_t isBadMaxPt = kFALSE; | |
4452 | Bool_t isBadMinPt = kTRUE; | |
4453 | ||
4454 | for(Int_t itrack=0; itrack<nTracks; itrack++) { | |
4455 | ||
4456 | AliVParticle* track = dynamic_cast<AliVParticle*>(jet->GetRefTracks()->At(itrack)); | |
4457 | if(!track){ | |
4458 | AliError("expected ref track not found "); | |
4459 | continue; | |
4460 | } | |
4461 | ||
4462 | if(track->Pt() < fTrackPtCut) continue; // track refs may contain low pt cut (bug in AliFastJetInput) | |
4463 | if(maxPt>0 && track->Pt()>maxPt) isBadMaxPt = kTRUE; | |
4464 | if(minPtL>0 && track->Pt()>minPtL) isBadMinPt = kFALSE; | |
4465 | ||
4466 | list->Add(track); | |
4467 | } | |
4468 | ||
4469 | isBadPt = kFALSE; | |
4470 | if(minPtL>0 && isBadMinPt) isBadPt = kTRUE; | |
4471 | if(maxPt>0 && isBadMaxPt) isBadPt = kTRUE; | |
4472 | ||
4473 | list->Sort(); | |
4474 | } | |
4475 | ||
4476 | // _ ________________________________________________________________________________________________________________________________ | |
4477 | void AliAnalysisTaskIDFragmentationFunction::AssociateGenRec(TList* tracksAODMCCharged,TList* tracksRec, TArrayI& indexAODTr,TArrayI& indexMCTr, | |
4478 | TArrayS& isRefGen,TH2F* fh2PtRecVsGen) | |
4479 | { | |
4480 | // associate generated and reconstructed tracks, fill TArrays of list indices | |
4481 | ||
4482 | Int_t nTracksRec = tracksRec->GetSize(); | |
4483 | Int_t nTracksGen = tracksAODMCCharged->GetSize(); | |
4484 | TClonesArray *tca = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName())); | |
4485 | ||
4486 | ||
4487 | if(!nTracksGen) return; | |
4488 | if(!tca) return; | |
4489 | ||
4490 | // set size | |
4491 | indexAODTr.Set(nTracksGen); | |
4492 | indexMCTr.Set(nTracksRec); | |
4493 | isRefGen.Set(nTracksGen); | |
4494 | ||
4495 | indexAODTr.Reset(-1); | |
4496 | indexMCTr.Reset(-1); | |
4497 | isRefGen.Reset(0); | |
4498 | ||
4499 | // loop over reconstructed tracks, get generated track | |
4500 | ||
4501 | for(Int_t iRec=0; iRec<nTracksRec; iRec++){ | |
4502 | ||
4503 | AliAODTrack* rectrack = dynamic_cast<AliAODTrack*>(tracksRec->At(iRec)); | |
4504 | if(!rectrack)continue; | |
4505 | Int_t label = TMath::Abs(rectrack->GetLabel()); | |
4506 | ||
4507 | // find MC track in our list | |
4508 | AliAODMCParticle* gentrack = dynamic_cast<AliAODMCParticle*> (tca->At(label)); | |
4509 | ||
4510 | Int_t listIndex = -1; | |
4511 | if(gentrack) listIndex = tracksAODMCCharged->IndexOf(gentrack); | |
4512 | ||
4513 | if(listIndex>=0){ | |
4514 | ||
4515 | indexAODTr[listIndex] = iRec; | |
4516 | indexMCTr[iRec] = listIndex; | |
4517 | } | |
4518 | } | |
4519 | ||
4520 | ||
4521 | // define reference sample of primaries/secondaries (for reconstruction efficiency / contamination) | |
4522 | ||
4523 | for(Int_t iGen=0; iGen<nTracksGen; iGen++){ | |
4524 | ||
4525 | AliAODMCParticle* gentrack = dynamic_cast<AliAODMCParticle*> (tracksAODMCCharged->At(iGen)); | |
4526 | if(!gentrack)continue; | |
4527 | Int_t pdg = gentrack->GetPdgCode(); | |
4528 | ||
4529 | // 211 - pi, 2212 - proton, 321 - Kaon, 11 - electron, 13 - muon | |
4530 | if(TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || | |
4531 | TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13){ | |
4532 | ||
4533 | isRefGen[iGen] = kTRUE; | |
4534 | ||
4535 | Int_t iRec = indexAODTr[iGen]; // can be -1 if no good reconstructed track | |
4536 | ||
4537 | if(iRec>=0){ | |
4538 | Float_t genPt = gentrack->Pt(); | |
4539 | AliAODTrack* vt = dynamic_cast<AliAODTrack*>(tracksRec->At(iRec)); | |
4540 | if(vt){ | |
4541 | Float_t recPt = vt->Pt(); | |
4542 | fh2PtRecVsGen->Fill(genPt,recPt); | |
4543 | } | |
4544 | } | |
4545 | } | |
4546 | } | |
4547 | } | |
4548 | ||
4549 | // _____________________________________________________________________________________________________________________________________________ | |
4550 | void AliAnalysisTaskIDFragmentationFunction::FillSingleTrackHistosRecGen(AliFragFuncQATrackHistos* trackQAGen, AliFragFuncQATrackHistos* trackQARec, TList* tracksGen, | |
9d7ad2e4 | 4551 | const TArrayI& indexAODTr, const TArrayS& isRefGen, Bool_t scaleStrangeness){ |
e131b05f | 4552 | |
4553 | // fill QA for single track reconstruction efficiency | |
4554 | ||
4555 | Int_t nTracksGen = tracksGen->GetSize(); | |
4556 | ||
4557 | if(!nTracksGen) return; | |
4558 | ||
4559 | for(Int_t iGen=0; iGen<nTracksGen; iGen++){ | |
4560 | ||
4561 | if(isRefGen[iGen] != 1) continue; // select primaries | |
4562 | ||
4563 | AliAODMCParticle* gentrack = dynamic_cast<AliAODMCParticle*> (tracksGen->At(iGen)); | |
4564 | if(!gentrack) continue; | |
4565 | Double_t ptGen = gentrack->Pt(); | |
4566 | Double_t etaGen = gentrack->Eta(); | |
4567 | Double_t phiGen = TVector2::Phi_0_2pi(gentrack->Phi()); | |
4568 | ||
4569 | // apply same acc & pt cuts as for FF GetMCStrangenessFactorCMS | |
4570 | ||
4571 | if(etaGen < fTrackEtaMin || etaGen > fTrackEtaMax) continue; | |
4572 | if(phiGen < fTrackPhiMin || phiGen > fTrackPhiMax) continue; | |
4573 | if(ptGen < fTrackPtCut) continue; | |
4574 | ||
4575 | if(trackQAGen) trackQAGen->FillTrackQA(etaGen, phiGen, ptGen); | |
4576 | ||
4577 | Int_t iRec = indexAODTr[iGen]; // can be -1 if no good reconstructed track | |
4578 | ||
4579 | if(iRec>=0 && trackQARec){ | |
4580 | if(scaleStrangeness){ | |
4581 | //Double_t weight = GetMCStrangenessFactor(ptGen); | |
4582 | Double_t weight = GetMCStrangenessFactorCMS(gentrack); | |
4583 | trackQARec->FillTrackQA(etaGen, phiGen, ptGen, kFALSE, 0, kTRUE, weight); | |
4584 | } | |
4585 | else trackQARec->FillTrackQA(etaGen, phiGen, ptGen); | |
4586 | } | |
4587 | } | |
4588 | } | |
4589 | ||
4590 | // ______________________________________________________________________________________________________________________________________________________ | |
4591 | ||
4592 | void AliAnalysisTaskIDFragmentationFunction::FillJetTrackHistosRec(AliFragFuncHistos* ffhistRec, AliAODJet* jet, | |
4593 | TList* jetTrackList, const TList* tracksGen, const TList* tracksRec, const TArrayI& indexAODTr, | |
9d7ad2e4 | 4594 | const TArrayS& isRefGen, TList* jetTrackListTR, Bool_t scaleStrangeness, |
e131b05f | 4595 | Bool_t fillJS, TProfile* hProNtracksLeadingJet, TProfile** hProDelRPtSum, TProfile* hProDelR80pcPt) |
4596 | { | |
4597 | // fill objects for jet track reconstruction efficiency or secondaries contamination | |
4598 | // arguments histGen/histRec can be of different type: AliFragFuncHistos*, AliFragFuncIntraJetHistos*, ... | |
4599 | // jetTrackListTR pointer: track refs if not NULL | |
4600 | ||
4601 | ||
4602 | // ensure proper normalization, even for secondaries | |
4603 | Double_t jetPtRec = jet->Pt(); | |
4604 | ffhistRec->FillFF(-1, jetPtRec, kTRUE); | |
4605 | ||
4606 | Int_t nTracksJet = jetTrackList->GetSize(); // list with AODMC tracks | |
4607 | if(nTracksJet == 0) return; | |
4608 | ||
4609 | TList* listRecTracks = new TList(); | |
4610 | listRecTracks->Clear(); | |
4611 | ||
4612 | for(Int_t iTr=0; iTr<nTracksJet; iTr++){ // jet tracks loop | |
4613 | ||
4614 | AliAODMCParticle* gentrack = dynamic_cast<AliAODMCParticle*> (jetTrackList->At(iTr)); | |
4615 | if(!gentrack)continue; | |
4616 | // find jet track in gen tracks list | |
4617 | Int_t iGen = tracksGen->IndexOf(gentrack); | |
4618 | ||
4619 | if(iGen<0){ | |
4620 | if(fDebug>0) Printf("%s:%d gen jet track not found ",(char*)__FILE__,__LINE__); | |
4621 | continue; | |
4622 | } | |
4623 | ||
4624 | if(isRefGen[iGen] != 1) continue; // select primaries | |
4625 | ||
4626 | Double_t ptGen = gentrack->Pt(); | |
4627 | Double_t etaGen = gentrack->Eta(); | |
4628 | Double_t phiGen = TVector2::Phi_0_2pi(gentrack->Phi()); | |
4629 | ||
4630 | // gen level acc & pt cuts - skip in case of track refs | |
4631 | if(!jetTrackListTR && (etaGen < fTrackEtaMin || etaGen > fTrackEtaMax)) continue; | |
4632 | if(!jetTrackListTR && (phiGen < fTrackPhiMin || phiGen > fTrackPhiMax)) continue; | |
4633 | if(!jetTrackListTR && ptGen < fTrackPtCut) continue; | |
4634 | ||
4635 | ||
4636 | Double_t ptRec = -1; | |
4637 | ||
4638 | Int_t iRec = indexAODTr[iGen]; // can be -1 if no good reconstructed track | |
4639 | Bool_t isRec = (iRec>=0) ? kTRUE : kFALSE; | |
4640 | ||
4641 | Bool_t isJetTrack = kFALSE; | |
4642 | if(!jetTrackListTR) isJetTrack = kTRUE; // skip trackRefs check for tracks in ideal cone | |
4643 | ||
4644 | if(isRec){ | |
4645 | ||
4646 | AliAODTrack* rectrack = dynamic_cast<AliAODTrack*> (tracksRec->At(iRec)); | |
4647 | if(!rectrack) continue; | |
4648 | ||
4649 | ptRec = rectrack->Pt(); | |
4650 | ||
4651 | if(jetTrackListTR){ | |
4652 | Int_t iRecTR = jetTrackListTR->IndexOf(rectrack); | |
4653 | if(iRecTR >=0 ) isJetTrack = kTRUE; // rec tracks assigned to jet | |
4654 | } | |
4655 | ||
4656 | if(isJetTrack){ | |
4657 | ||
4658 | Double_t trackPt = ptRec; | |
4659 | Bool_t incrementJetPt = kFALSE; | |
4660 | ||
4661 | if(scaleStrangeness){ | |
4662 | //Double_t weight = GetMCStrangenessFactor(ptGen); | |
4663 | Double_t weight = GetMCStrangenessFactorCMS(gentrack); | |
4664 | ||
4665 | ffhistRec->FillFF( trackPt, jetPtRec, incrementJetPt, 0, kTRUE, weight ); | |
4666 | } | |
4667 | else{ | |
4668 | ffhistRec->FillFF( trackPt, jetPtRec, incrementJetPt ); | |
4669 | } | |
4670 | ||
4671 | listRecTracks->Add(rectrack); | |
4672 | ||
4673 | } | |
4674 | } | |
4675 | } | |
4676 | ||
4677 | ||
4678 | if(fillJS) FillJetShape(jet,listRecTracks,hProNtracksLeadingJet, hProDelRPtSum, hProDelR80pcPt,0,0,scaleStrangeness); | |
4679 | ||
4680 | delete listRecTracks; | |
4681 | ||
4682 | } | |
4683 | ||
4684 | // _____________________________________________________________________________________________________________________________________________________________________ | |
4685 | void AliAnalysisTaskIDFragmentationFunction::GetTracksTiltedwrpJetAxis(Float_t alpha, TList* inputlist, TList* outputlist, const AliAODJet* jet, Double_t radius,Double_t& sumPt) | |
4686 | { | |
4687 | // List of tracks in cone perpendicular to the jet azimuthal direction | |
4688 | ||
4689 | Double_t jetMom[3]; | |
4690 | jet->PxPyPz(jetMom); | |
4691 | ||
4692 | TVector3 jet3mom(jetMom); | |
4693 | // Rotate phi and keep eta unchanged | |
4694 | Double_t etaTilted = jet3mom.Eta(); | |
4695 | Double_t phiTilted = TVector2::Phi_0_2pi(jet3mom.Phi()) + alpha; | |
4696 | if(phiTilted > 2*TMath::Pi()) phiTilted = phiTilted - 2*TMath::Pi(); | |
4697 | ||
4698 | for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){ | |
4699 | ||
4700 | // embedded tracks | |
4701 | if( fUseExtraTracksBgr != 1){ | |
4702 | if(AliAODTrack* trackAOD = dynamic_cast<AliAODTrack*> (inputlist->At(itrack))){ | |
4703 | if(fUseExtraTracksBgr == 0 && ((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
4704 | if(fUseExtraTracksBgr == -1 && !((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
4705 | } | |
4706 | } | |
4707 | ||
4708 | AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); | |
4709 | if(!track)continue; | |
4710 | Double_t trackMom[3]; | |
4711 | track->PxPyPz(trackMom); | |
4712 | TVector3 track3mom(trackMom); | |
4713 | ||
4714 | Double_t deta = track3mom.Eta() - etaTilted; | |
4715 | Double_t dphi = TMath::Abs(track3mom.Phi() - phiTilted); | |
4716 | if (dphi > TMath::Pi()) dphi = 2. * TMath::Pi() - dphi; | |
4717 | Double_t dR = TMath::Sqrt(deta * deta + dphi * dphi); | |
4718 | ||
4719 | ||
4720 | if(dR<=radius){ | |
4721 | outputlist->Add(track); | |
4722 | sumPt += track->Pt(); | |
4723 | } | |
4724 | } | |
4725 | ||
4726 | } | |
4727 | ||
4728 | // ________________________________________________________________________________________________________________________________________________________ | |
4729 | void AliAnalysisTaskIDFragmentationFunction::GetTracksTiltedwrpJetAxisWindow(Float_t alpha, TList* inputlist, TList* outputlist, const AliAODJet* jet, Double_t radius,Double_t& sumPt,Double_t &normFactor) | |
4730 | { | |
4731 | // List of tracks in cone perpendicular to the jet azimuthal direction | |
4732 | ||
4733 | Double_t jetMom[3]; | |
4734 | jet->PxPyPz(jetMom); | |
4735 | ||
4736 | TVector3 jet3mom(jetMom); | |
4737 | // Rotate phi and keep eta unchanged | |
4738 | Double_t etaTilted = jet3mom.Eta(); | |
4739 | Double_t phiTilted = TVector2::Phi_0_2pi(jet3mom.Phi()) + alpha; | |
4740 | if(phiTilted > 2*TMath::Pi()) phiTilted = phiTilted - 2*TMath::Pi(); | |
4741 | ||
4742 | for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++) | |
4743 | { | |
4744 | ||
4745 | // embedded tracks | |
4746 | if( fUseExtraTracksBgr != 1){ | |
4747 | if(AliAODTrack* trackAOD = dynamic_cast<AliAODTrack*> (inputlist->At(itrack))){ | |
4748 | if(fUseExtraTracksBgr == 0 && ((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
4749 | if(fUseExtraTracksBgr == -1 && !((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
4750 | } | |
4751 | } | |
4752 | ||
4753 | AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); | |
4754 | if(!track)continue; | |
4755 | Float_t trackEta = track->Eta(); | |
4756 | Float_t trackPhi = track->Phi(); | |
4757 | ||
4758 | if( ( phiTilted-radius >= 0 ) && ( phiTilted+radius <= 2*TMath::Pi())) | |
4759 | { | |
4760 | if((trackPhi<=phiTilted+radius) && | |
4761 | (trackPhi>=phiTilted-radius) && | |
4762 | (trackEta<=fTrackEtaMax)&&(trackEta>=fTrackEtaMin)) // 0.9 and - 0.9 | |
4763 | { | |
4764 | outputlist->Add(track); | |
4765 | sumPt += track->Pt(); | |
4766 | } | |
4767 | } | |
4768 | else if( phiTilted-radius < 0 ) | |
4769 | { | |
4770 | if((( trackPhi < phiTilted+radius ) || | |
4771 | ( trackPhi > 2*TMath::Pi()-(radius-phiTilted) )) && | |
4772 | (( trackEta <= fTrackEtaMax ) && ( trackEta >= fTrackEtaMin ))) | |
4773 | { | |
4774 | outputlist->Add(track); | |
4775 | sumPt += track->Pt(); | |
4776 | } | |
4777 | } | |
4778 | else if( phiTilted+radius > 2*TMath::Pi() ) | |
4779 | { | |
4780 | if((( trackPhi > phiTilted-radius ) || | |
4781 | ( trackPhi < phiTilted+radius-2*TMath::Pi() )) && | |
4782 | (( trackEta <= fTrackEtaMax ) && ( trackEta >= fTrackEtaMin ))) | |
4783 | { | |
4784 | outputlist->Add(track); | |
4785 | sumPt += track->Pt(); | |
4786 | } | |
4787 | } | |
4788 | } | |
4789 | ||
4790 | // Jet area - Temporarily added should be modified with the proper jet area value | |
4791 | Float_t areaJet = CalcJetArea(etaTilted,radius); | |
4792 | Float_t areaTilted = 2*radius*(fTrackEtaMax-fTrackEtaMin); | |
4793 | ||
4794 | normFactor = (Float_t) 1. / (areaJet / areaTilted); | |
4795 | ||
4796 | } | |
4797 | ||
4798 | ||
4799 | // ________________________________________________________________________________________________________________________________________________________ | |
4800 | void AliAnalysisTaskIDFragmentationFunction::GetTracksOutOfNJets(Int_t nCases, TList* inputlist, TList* outputlist, const TList* jetlist, | |
4801 | Double_t& sumPt) | |
4802 | { | |
4803 | // List of tracks outside cone around N jet axis | |
4804 | // Particles taken randomly | |
4805 | ||
4806 | sumPt = 0; | |
4807 | // Int_t nj = jetlist->GetSize(); | |
4808 | Float_t rc = TMath::Abs(GetFFRadius()); | |
4809 | Float_t rcl = GetFFBckgRadius(); | |
4810 | ||
4811 | // Estimate jet and background areas | |
4812 | Float_t* areaJet = new Float_t[nCases]; | |
4813 | memset(areaJet, 0, sizeof(Float_t) * nCases); | |
4814 | Float_t* areaJetLarge = new Float_t[nCases]; | |
4815 | memset(areaJetLarge, 0, sizeof(Float_t) * nCases); | |
4816 | Float_t areaFull = (fTrackEtaMax-fTrackEtaMin)*(fTrackPhiMax-fTrackPhiMin); | |
4817 | Float_t areaOut = areaFull; | |
4818 | ||
4819 | //estimate jets and background areas | |
4820 | Int_t nOut = 0; | |
4821 | Int_t ijet = 0; | |
4822 | TList* templist = new TList(); | |
4823 | TClonesArray *vect3Jet = new TClonesArray("TVector3",nCases); | |
4824 | ||
4825 | for(Int_t ij=0; ij<nCases; ++ij) | |
4826 | { | |
4827 | // Get jet information | |
4828 | AliAODJet* jet = dynamic_cast<AliAODJet*>(jetlist->At(ij)); | |
4829 | if(!jet)continue; | |
4830 | TVector3 jet3mom; | |
4831 | jet3mom.SetPtEtaPhi(jet->Pt(),jet->Eta(),jet->Phi()); | |
4832 | new((*vect3Jet)[ijet]) TVector3((TVector3)jet3mom); | |
4833 | Float_t etaJet = (Float_t)((TVector3*) vect3Jet->At(ij))->Eta(); | |
4834 | ||
4835 | // Jet area | |
4836 | areaJet[ij] = CalcJetArea(etaJet,rc); | |
4837 | ||
4838 | // Area jet larger angle | |
4839 | areaJetLarge[ij] = CalcJetArea(etaJet,rcl); | |
4840 | ||
4841 | // Outside jet area | |
4842 | areaOut = areaOut - areaJetLarge[ij]; | |
4843 | ijet++; | |
4844 | } | |
4845 | ||
4846 | // List of all tracks outside jet areas | |
4847 | for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){ | |
4848 | ||
4849 | // embedded tracks | |
4850 | if( fUseExtraTracksBgr != 1){ | |
4851 | if(AliAODTrack* trackAOD = dynamic_cast<AliAODTrack*> (inputlist->At(itrack))){ | |
4852 | if(fUseExtraTracksBgr == 0 && ((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
4853 | if(fUseExtraTracksBgr == -1 && !((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
4854 | } | |
4855 | } | |
4856 | ||
4857 | AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); | |
4858 | ||
4859 | if(!track)continue; | |
4860 | Double_t trackMom[3]; | |
4861 | track->PxPyPz(trackMom); | |
4862 | TVector3 track3mom(trackMom); | |
4863 | ||
4864 | Double_t *dR = new Double_t[nCases]; | |
4865 | for(Int_t ij=0; ij<nCases; ij++) | |
4866 | dR[ij] = (Double_t)((TVector3*) vect3Jet->At(ij))->DeltaR(track3mom); | |
4867 | ||
4868 | if((nCases==1 && (dR[0]>rcl)) || | |
4869 | (nCases==2 && (dR[0]>rcl && dR[1]>rcl)) || | |
4870 | (nCases==3 && (dR[0]>rcl && dR[1]>rcl && dR[2]>rcl))) | |
4871 | { | |
4872 | templist->Add(track); | |
4873 | nOut++; | |
4874 | } | |
4875 | delete [] dR; | |
4876 | } | |
4877 | ||
4878 | // Take tracks randomly | |
4879 | Int_t nScaled = (Int_t) (nOut * areaJet[0] / areaOut + 0.5); | |
4880 | TArrayI* ar = new TArrayI(nOut); | |
4881 | ||
4882 | for(Int_t init=0; init<nOut; init++) | |
4883 | (*ar)[init] = init; | |
4884 | ||
4885 | Int_t *randIndex = new Int_t[nScaled]; | |
4886 | for(Int_t init2=0; init2<nScaled; init2++) | |
4887 | randIndex[init2] = -1; | |
4888 | ||
4889 | // Select nScaled different random numbers in nOut | |
4890 | for(Int_t i=0; i<nScaled; i++) | |
4891 | { | |
4892 | Int_t* tmpArr = new Int_t[nOut-i]; | |
4893 | Int_t temp = fRandom->Integer(nOut-i); | |
4894 | for(Int_t ind = 0; ind< ar->GetSize()-1; ind++) | |
4895 | { | |
4896 | if(ind<temp) tmpArr[ind] = (*ar)[ind]; | |
4897 | else tmpArr[ind] = (*ar)[ind+1]; | |
4898 | } | |
4899 | randIndex[i] = (*ar)[temp]; | |
4900 | ||
4901 | ar->Set(nOut-i-1,tmpArr); | |
4902 | ||
4903 | delete [] tmpArr; | |
4904 | ||
4905 | } | |
4906 | ||
4907 | for(Int_t ipart=0; ipart<nScaled; ipart++) | |
4908 | { | |
4909 | AliVParticle* track = (AliVParticle*)(templist->At(randIndex[ipart])); | |
4910 | outputlist->Add(track); | |
4911 | sumPt += track->Pt(); | |
4912 | } | |
4913 | ||
4914 | outputlist->Sort(); | |
4915 | ||
4916 | delete vect3Jet; | |
4917 | delete templist; | |
4918 | delete [] areaJetLarge; | |
4919 | delete [] areaJet; | |
4920 | delete ar; | |
4921 | delete [] randIndex; | |
4922 | ||
4923 | } | |
4924 | ||
4925 | // ________________________________________________________________________________________________________________________________________________________ | |
4926 | void AliAnalysisTaskIDFragmentationFunction::GetTracksOutOfNJetsStat(Int_t nCases, TList* inputlist, TList* outputlist, | |
4927 | const TList* jetlist, Double_t& sumPt, Double_t &normFactor) | |
4928 | { | |
4929 | // List of tracks outside cone around N jet axis | |
4930 | // All particles taken + final scaling factor | |
4931 | ||
4932 | sumPt = 0; | |
4933 | Float_t rc = TMath::Abs(GetFFRadius()); | |
4934 | Float_t rcl = GetFFBckgRadius(); | |
4935 | ||
4936 | // Estimate jet and background areas | |
4937 | Float_t* areaJet = new Float_t[nCases]; | |
4938 | memset(areaJet, 0, sizeof(Float_t) * nCases); | |
4939 | Float_t* areaJetLarge = new Float_t[nCases]; | |
4940 | memset(areaJetLarge, 0, sizeof(Float_t) * nCases); | |
4941 | Float_t areaFull = (fTrackEtaMax-fTrackEtaMin)*(fTrackPhiMax-fTrackPhiMin); | |
4942 | Float_t areaOut = areaFull; | |
4943 | ||
4944 | //estimate jets and background areas | |
4945 | Int_t nOut = 0; | |
4946 | Int_t ijet = 0; | |
4947 | TClonesArray *vect3Jet = new TClonesArray("TVector3",nCases); | |
4948 | ||
4949 | for(Int_t ij=0; ij<nCases; ++ij) | |
4950 | { | |
4951 | // Get jet information | |
4952 | AliAODJet* jet = dynamic_cast<AliAODJet*>(jetlist->At(ij)); | |
4953 | if(!jet)continue; | |
4954 | TVector3 jet3mom; | |
4955 | jet3mom.SetPtEtaPhi(jet->Pt(),jet->Eta(),jet->Phi()); | |
4956 | new((*vect3Jet)[ijet]) TVector3((TVector3)jet3mom); | |
4957 | Float_t etaJet = (Float_t)((TVector3*) vect3Jet->At(ij))->Eta(); | |
4958 | ||
4959 | // Jet area | |
4960 | areaJet[ij] = CalcJetArea(etaJet,rc); | |
4961 | ||
4962 | // Area jet larger angle | |
4963 | areaJetLarge[ij] = CalcJetArea(etaJet,rcl); | |
4964 | ||
4965 | // Outside jets area | |
4966 | areaOut = areaOut - areaJetLarge[ij]; | |
4967 | ijet++; | |
4968 | } | |
4969 | ||
4970 | for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){ | |
4971 | ||
4972 | // embedded tracks | |
4973 | if( fUseExtraTracksBgr != 1){ | |
4974 | if(AliAODTrack* trackAOD = dynamic_cast<AliAODTrack*> (inputlist->At(itrack))){ | |
4975 | if(fUseExtraTracksBgr == 0 && ((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
4976 | if(fUseExtraTracksBgr == -1 && !((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
4977 | } | |
4978 | } | |
4979 | ||
4980 | AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); | |
4981 | if(!track)continue; | |
4982 | Double_t trackMom[3]; | |
4983 | track->PxPyPz(trackMom); | |
4984 | TVector3 track3mom(trackMom); | |
4985 | ||
4986 | Double_t *dR = new Double_t[nCases]; | |
4987 | for(Int_t ij=0; ij<nCases; ij++) | |
4988 | dR[ij] = (Double_t)((TVector3*) vect3Jet->At(ij))->DeltaR(track3mom); | |
4989 | ||
4990 | if((nCases==0) || | |
4991 | (nCases==1 && (dR[0]>rcl)) || | |
4992 | (nCases==2 && (dR[0]>rcl && dR[1]>rcl)) || | |
4993 | (nCases==3 && (dR[0]>rcl && dR[1]>rcl && dR[2]>rcl))) | |
4994 | { | |
4995 | outputlist->Add(track); | |
4996 | sumPt += track->Pt(); | |
4997 | nOut++; | |
4998 | } | |
4999 | delete [] dR; | |
5000 | } | |
5001 | ||
5002 | if(nCases==0) areaJet[0] = TMath::Pi()*rc*rc; | |
5003 | normFactor = (Float_t) 1./(areaJet[0] / areaOut); | |
5004 | ||
5005 | outputlist->Sort(); | |
5006 | ||
5007 | delete vect3Jet; | |
5008 | delete [] areaJetLarge; | |
5009 | delete [] areaJet; | |
5010 | ||
5011 | } | |
5012 | ||
5013 | // ______________________________________________________________________________________________________________________________________________________ | |
9d7ad2e4 | 5014 | Float_t AliAnalysisTaskIDFragmentationFunction::CalcJetArea(Float_t etaJet, Float_t rc) const |
e131b05f | 5015 | { |
5016 | // calculate area of jet with eta etaJet and radius rc | |
5017 | ||
5018 | Float_t detamax = etaJet + rc; | |
5019 | Float_t detamin = etaJet - rc; | |
5020 | Float_t accmax = 0.0; Float_t accmin = 0.0; | |
5021 | if(detamax > fTrackEtaMax){ // sector outside etamax | |
5022 | Float_t h = fTrackEtaMax - etaJet; | |
5023 | accmax = rc*rc*TMath::ACos(h/rc) - h*TMath::Sqrt(rc*rc - h*h); | |
5024 | } | |
5025 | if(detamin < fTrackEtaMin){ // sector outside etamin | |
5026 | Float_t h = fTrackEtaMax + etaJet; | |
5027 | accmin = rc*rc*TMath::ACos(h/rc) - h*TMath::Sqrt(rc*rc - h*h); | |
5028 | } | |
5029 | Float_t areaJet = rc*rc*TMath::Pi() - accmax - accmin; | |
5030 | ||
5031 | return areaJet; | |
5032 | ||
5033 | } | |
5034 | ||
5035 | // ___________________________________________________________________________________________________________________________ | |
5036 | void AliAnalysisTaskIDFragmentationFunction::GetClusterTracksOutOf1Jet(AliAODJet* jet, TList* outputlist, Double_t &normFactor) | |
5037 | { | |
5038 | // fill tracks from bckgCluster branch in list, | |
5039 | // for all clusters outside jet cone | |
5040 | // sum up total area of clusters | |
5041 | ||
5042 | Double_t rc = GetFFRadius(); | |
5043 | Double_t rcl = GetFFBckgRadius(); | |
5044 | ||
5045 | Double_t areaTotal = 0; | |
5046 | Double_t sumPtTotal = 0; | |
5047 | ||
5048 | for(Int_t ij=0; ij<fBckgJetsRec->GetEntries(); ++ij){ | |
5049 | ||
5050 | AliAODJet* bgrCluster = (AliAODJet*)(fBckgJetsRec->At(ij)); // not 'recCuts': use all clusters in full eta range | |
5051 | ||
5052 | Double_t dR = jet->DeltaR(bgrCluster); | |
5053 | ||
5054 | if(dR<rcl) continue; | |
5055 | ||
5056 | Double_t clusterPt = bgrCluster->Pt(); | |
5057 | Double_t area = bgrCluster->EffectiveAreaCharged(); | |
5058 | areaTotal += area; | |
5059 | sumPtTotal += clusterPt; | |
5060 | ||
5061 | Int_t nTracksJet = bgrCluster->GetRefTracks()->GetEntries(); | |
5062 | ||
5063 | for(Int_t it = 0; it<nTracksJet; it++){ | |
5064 | ||
5065 | // embedded tracks - note: using ref tracks here, fBranchRecBckgClusters has to be consistent | |
5066 | if( fUseExtraTracksBgr != 1){ | |
5067 | if(AliAODTrack* trackAOD = dynamic_cast<AliAODTrack*> (bgrCluster->GetTrack(it))){ | |
5068 | if(fUseExtraTracksBgr == 0 && ((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
5069 | if(fUseExtraTracksBgr == -1 && !((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
5070 | } | |
5071 | } | |
5072 | ||
5073 | AliVParticle* track = dynamic_cast<AliVParticle*>(bgrCluster->GetTrack(it)); | |
5074 | if(!track) continue; | |
5075 | ||
5076 | Float_t trackPt = track->Pt(); | |
5077 | Float_t trackEta = track->Eta(); | |
5078 | Float_t trackPhi = TVector2::Phi_0_2pi(track->Phi()); | |
5079 | ||
5080 | if(trackEta < fTrackEtaMin || trackEta > fTrackEtaMax) continue; | |
5081 | if(trackPhi < fTrackPhiMin || trackPhi > fTrackPhiMax) continue; | |
5082 | if(trackPt < fTrackPtCut) continue; | |
5083 | ||
5084 | outputlist->Add(track); | |
5085 | } | |
5086 | } | |
5087 | ||
5088 | Double_t areaJet = TMath::Pi()*rc*rc; | |
5089 | if(areaTotal) normFactor = (Float_t) 1./(areaJet / areaTotal); | |
5090 | ||
5091 | outputlist->Sort(); | |
5092 | } | |
5093 | ||
5094 | // _______________________________________________________________________________________________________________________ | |
5095 | void AliAnalysisTaskIDFragmentationFunction::GetClusterTracksMedian(TList* outputlist, Double_t &normFactor) | |
5096 | { | |
5097 | // fill tracks from bckgCluster branch, | |
5098 | // using cluster with median density (odd number of clusters) | |
5099 | // or picking randomly one of the two closest to median (even number) | |
5100 | ||
5101 | normFactor = 0; | |
5102 | ||
c4856fb1 | 5103 | const Int_t nBckgClusters = fBckgJetsRec->GetEntries(); // not 'recCuts': use all clusters in full eta range |
e131b05f | 5104 | |
5105 | if(nBckgClusters<3) return; // need at least 3 clusters (skipping 2 highest) | |
5106 | ||
5107 | Double_t* bgrDensity = new Double_t[nBckgClusters]; | |
5108 | Int_t* indices = new Int_t[nBckgClusters]; | |
5109 | ||
5110 | for(Int_t ij=0; ij<nBckgClusters; ++ij){ | |
5111 | ||
5112 | AliAODJet* bgrCluster = (AliAODJet*)(fBckgJetsRec->At(ij)); | |
5113 | Double_t clusterPt = bgrCluster->Pt(); | |
5114 | Double_t area = bgrCluster->EffectiveAreaCharged(); | |
5115 | ||
5116 | Double_t density = 0; | |
5117 | if(area>0) density = clusterPt/area; | |
5118 | ||
5119 | bgrDensity[ij] = density; | |
5120 | indices[ij] = ij; | |
5121 | } | |
5122 | ||
5123 | TMath::Sort(nBckgClusters, bgrDensity, indices); | |
5124 | ||
5125 | // get median cluster | |
5126 | ||
5127 | AliAODJet* medianCluster = 0; | |
5128 | //Double_t medianDensity = 0; | |
5129 | ||
5130 | if(TMath::Odd(nBckgClusters)){ | |
5131 | ||
5132 | Int_t medianIndex = indices[(Int_t) (0.5*(nBckgClusters-1))]; | |
5133 | medianCluster = (AliAODJet*)(fBckgJetsRec->At(medianIndex)); | |
5134 | ||
5135 | //Double_t clusterPt = medianCluster->Pt(); | |
5136 | //Double_t area = medianCluster->EffectiveAreaCharged(); | |
5137 | ||
5138 | //if(area>0) medianDensity = clusterPt/area; | |
5139 | } | |
5140 | else{ | |
5141 | ||
5142 | Int_t medianIndex1 = indices[(Int_t) (0.5*nBckgClusters-1)]; | |
5143 | Int_t medianIndex2 = indices[(Int_t) (0.5*nBckgClusters)]; | |
5144 | ||
5145 | AliAODJet* medianCluster1 = (AliAODJet*)(fBckgJetsRec->At(medianIndex1)); | |
5146 | AliAODJet* medianCluster2 = (AliAODJet*)(fBckgJetsRec->At(medianIndex2)); | |
5147 | ||
5148 | //Double_t density1 = 0; | |
5149 | //Double_t clusterPt1 = medianCluster1->Pt(); | |
5150 | //Double_t area1 = medianCluster1->EffectiveAreaCharged(); | |
5151 | //if(area1>0) density1 = clusterPt1/area1; | |
5152 | ||
5153 | //Double_t density2 = 0; | |
5154 | //Double_t clusterPt2 = medianCluster2->Pt(); | |
5155 | //Double_t area2 = medianCluster2->EffectiveAreaCharged(); | |
5156 | //if(area2>0) density2 = clusterPt2/area2; | |
5157 | ||
5158 | //medianDensity = 0.5*(density1+density2); | |
5159 | ||
5160 | medianCluster = ( (fRandom->Rndm()>0.5) ? medianCluster1 : medianCluster2 ); // select one randomly to avoid adding areas | |
5161 | } | |
5162 | ||
5163 | Int_t nTracksJet = medianCluster->GetRefTracks()->GetEntries(); | |
5164 | ||
5165 | for(Int_t it = 0; it<nTracksJet; it++){ | |
5166 | ||
5167 | // embedded tracks - note: using ref tracks here, fBranchRecBckgClusters has to be consistent | |
5168 | if( fUseExtraTracksBgr != 1){ | |
5169 | if(AliAODTrack* trackAOD = dynamic_cast<AliAODTrack*> (medianCluster->GetTrack(it))){ | |
5170 | if(fUseExtraTracksBgr == 0 && ((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
5171 | if(fUseExtraTracksBgr == -1 && !((trackAOD->GetFlags() & AliESDtrack::kEmbedded)>0)) continue; | |
5172 | } | |
5173 | } | |
5174 | ||
5175 | AliVParticle* track = dynamic_cast<AliVParticle*>(medianCluster->GetTrack(it)); | |
5176 | if(!track) continue; | |
5177 | ||
5178 | Float_t trackPt = track->Pt(); | |
5179 | Float_t trackEta = track->Eta(); | |
5180 | Float_t trackPhi = TVector2::Phi_0_2pi(track->Phi()); | |
5181 | ||
5182 | if(trackEta < fTrackEtaMin || trackEta > fTrackEtaMax) continue; | |
5183 | if(trackPhi < fTrackPhiMin || trackPhi > fTrackPhiMax) continue; | |
5184 | if(trackPt < fTrackPtCut) continue; | |
5185 | ||
5186 | outputlist->Add(track); | |
5187 | } | |
5188 | ||
5189 | Double_t areaMedian = medianCluster->EffectiveAreaCharged(); | |
5190 | Double_t areaJet = TMath::Pi()*GetFFRadius()*GetFFRadius(); | |
5191 | ||
5192 | if(areaMedian) normFactor = (Float_t) 1./(areaJet / areaMedian); | |
5193 | ||
5194 | outputlist->Sort(); | |
5195 | ||
5196 | delete[] bgrDensity; | |
5197 | delete[] indices; | |
5198 | } | |
5199 | ||
5200 | // ______________________________________________________________________________________________________________________________________________________ | |
5201 | void AliAnalysisTaskIDFragmentationFunction::FillBckgHistos(Int_t type, TList* inputtracklist, TList* inputjetlist, AliAODJet* jet, | |
5202 | AliFragFuncHistos* ffbckghistocuts, AliFragFuncQATrackHistos* qabckghistocuts, TH1F* fh1Mult){ | |
5203 | ||
5204 | // List of tracks outside jets for background study | |
5205 | TList* tracklistout2jets = new TList(); | |
5206 | TList* tracklistout3jets = new TList(); | |
5207 | TList* tracklistout2jetsStat = new TList(); | |
5208 | TList* tracklistout3jetsStat = new TList(); | |
5209 | Double_t sumPtOut2Jets = 0.; | |
5210 | Double_t sumPtOut3Jets = 0.; | |
5211 | Double_t sumPtOut2JetsStat = 0.; | |
5212 | Double_t sumPtOut3JetsStat = 0.; | |
5213 | Double_t normFactor2Jets = 0.; | |
5214 | Double_t normFactor3Jets = 0.; | |
5215 | ||
5216 | Int_t nRecJetsCuts = inputjetlist->GetEntries(); | |
5217 | ||
5218 | if(nRecJetsCuts>1) { | |
5219 | GetTracksOutOfNJets(2,inputtracklist, tracklistout2jets, inputjetlist, sumPtOut2Jets); | |
5220 | GetTracksOutOfNJetsStat(2,inputtracklist, tracklistout2jetsStat, inputjetlist,sumPtOut2JetsStat, normFactor2Jets); | |
5221 | ||
5222 | } | |
5223 | if(nRecJetsCuts>2) { | |
5224 | GetTracksOutOfNJets(3,inputtracklist, tracklistout3jets, inputjetlist, sumPtOut3Jets); | |
5225 | GetTracksOutOfNJetsStat(3,inputtracklist, tracklistout3jetsStat, inputjetlist, sumPtOut3JetsStat, normFactor3Jets); | |
5226 | } | |
5227 | ||
5228 | if(type==kBckgOutLJ || type==kBckgOutAJ) | |
5229 | { | |
5230 | TList* tracklistoutleading = new TList(); | |
5231 | Double_t sumPtOutLeading = 0.; | |
5232 | GetTracksOutOfNJets(1,inputtracklist, tracklistoutleading, inputjetlist, sumPtOutLeading); | |
5233 | if(type==kBckgOutLJ && fh1Mult) fh1Mult->Fill(tracklistoutleading->GetSize()); | |
5234 | ||
5235 | for(Int_t it=0; it<tracklistoutleading->GetSize(); ++it){ | |
5236 | ||
5237 | AliVParticle* trackVP = (AliVParticle*)(tracklistoutleading->At(it)); | |
5238 | if(!trackVP) continue; | |
5239 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5240 | ||
5241 | Float_t jetPt = jet->Pt(); | |
5242 | Float_t trackPt = trackV->Pt(); | |
5243 | ||
5244 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5245 | ||
5246 | if(type==kBckgOutLJ) | |
5247 | { | |
5248 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt); | |
5249 | ||
5250 | // Fill track QA for background | |
5251 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt); | |
5252 | } | |
5253 | ||
5254 | // All cases included | |
5255 | if(nRecJetsCuts==1 && type==kBckgOutAJ) | |
5256 | { | |
5257 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt ); | |
5258 | } | |
5259 | delete trackV; | |
5260 | } | |
5261 | // Increment jet pt with one entry in case #tracks outside jets = 0 | |
5262 | if(tracklistoutleading->GetSize()==0) { | |
5263 | Float_t jetPt = jet->Pt(); | |
5264 | Bool_t incrementJetPt = kTRUE; | |
5265 | if(type==kBckgOutLJ) | |
5266 | { | |
5267 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt ); | |
5268 | } | |
5269 | // All cases included | |
5270 | if(nRecJetsCuts==1 && type==kBckgOutAJ) | |
5271 | { | |
5272 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt ); | |
5273 | } | |
5274 | } | |
5275 | delete tracklistoutleading; | |
5276 | } | |
5277 | if(type==kBckgOutLJStat || type==kBckgOutAJStat) | |
5278 | { | |
5279 | TList* tracklistoutleadingStat = new TList(); | |
5280 | Double_t sumPtOutLeadingStat = 0.; | |
5281 | Double_t normFactorLeading = 0.; | |
5282 | ||
5283 | GetTracksOutOfNJetsStat(1,inputtracklist, tracklistoutleadingStat, inputjetlist, sumPtOutLeadingStat, normFactorLeading); | |
5284 | if(type==kBckgOutLJStat && fh1Mult) fh1Mult->Fill(tracklistoutleadingStat->GetSize()); | |
5285 | ||
5286 | for(Int_t it=0; it<tracklistoutleadingStat->GetSize(); ++it){ | |
5287 | ||
5288 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistoutleadingStat->At(it)); | |
5289 | if(!trackVP) continue; | |
5290 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5291 | ||
5292 | Float_t jetPt = jet->Pt(); | |
5293 | Float_t trackPt = trackV->Pt(); | |
5294 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5295 | ||
5296 | // Stat plots | |
5297 | if(type==kBckgOutLJStat) | |
5298 | { | |
5299 | if(fFFMode)ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactorLeading); | |
5300 | ||
5301 | // Fill track QA for background | |
5302 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt); // OB added bgr QA | |
5303 | } | |
5304 | ||
5305 | // All cases included | |
5306 | if(nRecJetsCuts==1 && type==kBckgOutAJStat) | |
5307 | { | |
5308 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactorLeading); | |
5309 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt ); // OB added bgr QA | |
5310 | ||
5311 | } | |
5312 | delete trackV; | |
5313 | } | |
5314 | // Increment jet pt with one entry in case #tracks outside jets = 0 | |
5315 | if(tracklistoutleadingStat->GetSize()==0) { | |
5316 | Float_t jetPt = jet->Pt(); | |
5317 | Bool_t incrementJetPt = kTRUE; | |
5318 | if(type==kBckgOutLJStat) | |
5319 | { | |
5320 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt, normFactorLeading); | |
5321 | } | |
5322 | // All cases included | |
5323 | if(nRecJetsCuts==1 && type==kBckgOutLJStat) | |
5324 | { | |
5325 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt, normFactorLeading); | |
5326 | } | |
5327 | } | |
5328 | ||
5329 | delete tracklistoutleadingStat; | |
5330 | } | |
5331 | ||
5332 | if(type==kBckgPerp || type==kBckgPerp2 || type==kBckgPerp2Area) | |
5333 | { | |
5334 | Double_t sumPtPerp1 = 0.; | |
5335 | Double_t sumPtPerp2 = 0.; | |
5336 | TList* tracklistperp = new TList(); | |
5337 | TList* tracklistperp1 = new TList(); | |
5338 | TList* tracklistperp2 = new TList(); | |
5339 | ||
5340 | Double_t norm = 1; | |
5341 | if(type == kBckgPerp2) norm = 2; // in FillFF() scaleFac = 1/norm = 0.5 - account for double area; | |
5342 | if(type == kBckgPerp2Area) norm = 2*TMath::Pi()*TMath::Abs(GetFFRadius())*TMath::Abs(GetFFRadius()) / jet->EffectiveAreaCharged(); // in FillFF() scaleFac = 1/norm; | |
5343 | ||
5344 | GetTracksTiltedwrpJetAxis(TMath::Pi()/2., inputtracklist,tracklistperp1,jet,TMath::Abs(GetFFRadius()),sumPtPerp1); | |
5345 | if(type==kBckgPerp2 || type==kBckgPerp2Area) GetTracksTiltedwrpJetAxis(-1*TMath::Pi()/2., inputtracklist,tracklistperp2,jet,TMath::Abs(GetFFRadius()),sumPtPerp2); | |
5346 | ||
5347 | tracklistperp->AddAll(tracklistperp1); | |
5348 | tracklistperp->AddAll(tracklistperp2); | |
5349 | ||
5350 | if(tracklistperp->GetSize() != tracklistperp1->GetSize() + tracklistperp2->GetSize()){ | |
5351 | cout<<" ERROR: tracklistperp size "<<tracklistperp->GetSize()<<" perp1 "<<tracklistperp1->GetSize()<<" perp2 "<<tracklistperp2->GetSize()<<endl; | |
5352 | exit(0); | |
5353 | } | |
5354 | ||
5355 | if(fh1Mult) fh1Mult->Fill(tracklistperp->GetSize()); | |
5356 | ||
5357 | for(Int_t it=0; it<tracklistperp->GetSize(); ++it){ | |
5358 | ||
5359 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistperp->At(it)); | |
5360 | if(!trackVP)continue; | |
5361 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5362 | ||
5363 | Float_t jetPt = jet->Pt(); | |
5364 | Float_t trackPt = trackV->Pt(); | |
5365 | ||
5366 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5367 | ||
5368 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, norm ); | |
5369 | ||
5370 | // Fill track QA for background | |
5371 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt); | |
5372 | ||
5373 | delete trackV; | |
5374 | } | |
5375 | // Increment jet pt with one entry in case #tracks outside jets = 0 | |
5376 | if(tracklistperp->GetSize()==0) { | |
5377 | Float_t jetPt = jet->Pt(); | |
5378 | Bool_t incrementJetPt = kTRUE; | |
5379 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt ); | |
5380 | } | |
5381 | ||
5382 | ||
5383 | if(fJSMode){ | |
5384 | // fill for tracklistperp1/2 separately, divide norm by 2 | |
5385 | if(type==kBckgPerp){ | |
5386 | FillJetShape(jet, tracklistperp, fProNtracksLeadingJetBgrPerp2, fProDelRPtSumBgrPerp2, 0, TMath::Pi()/2., 0., kFALSE); | |
5387 | } | |
5388 | if(type==kBckgPerp2){ | |
5389 | FillJetShape(jet, tracklistperp1, fProNtracksLeadingJetBgrPerp2, fProDelRPtSumBgrPerp2, 0, TMath::Pi()/2., 0., kFALSE); | |
5390 | FillJetShape(jet, tracklistperp2, fProNtracksLeadingJetBgrPerp2, fProDelRPtSumBgrPerp2, 0, -1*TMath::Pi()/2., 0., kFALSE); | |
5391 | } | |
5392 | if(type==kBckgPerp2Area){ // divide norm by 2: listperp1/2 filled separately | |
5393 | FillJetShape(jet, tracklistperp1, fProNtracksLeadingJetBgrPerp2, fProDelRPtSumBgrPerp2, 0, TMath::Pi()/2., 0.5*norm, kFALSE); | |
5394 | FillJetShape(jet, tracklistperp2, fProNtracksLeadingJetBgrPerp2, fProDelRPtSumBgrPerp2, 0, -1*TMath::Pi()/2., 0.5*norm, kFALSE); | |
5395 | } | |
5396 | } | |
5397 | ||
5398 | delete tracklistperp; | |
5399 | delete tracklistperp1; | |
5400 | delete tracklistperp2; | |
5401 | } | |
5402 | ||
5403 | if(type==kBckgASide) | |
5404 | { | |
5405 | Double_t sumPtASide = 0.; | |
5406 | TList* tracklistaside = new TList(); | |
5407 | GetTracksTiltedwrpJetAxis(TMath::Pi(),inputtracklist,tracklistaside,jet,TMath::Abs(GetFFRadius()),sumPtASide); | |
5408 | if(fh1Mult) fh1Mult->Fill(tracklistaside->GetSize()); | |
5409 | ||
5410 | for(Int_t it=0; it<tracklistaside->GetSize(); ++it){ | |
5411 | ||
5412 | AliVParticle* trackVP = (AliVParticle*)(tracklistaside->At(it)); | |
5413 | if(!trackVP) continue; | |
5414 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5415 | ||
5416 | Float_t jetPt = jet->Pt(); | |
5417 | Float_t trackPt = trackV->Pt(); | |
5418 | ||
5419 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5420 | ||
5421 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt ); | |
5422 | ||
5423 | // Fill track QA for background | |
5424 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt); | |
5425 | ||
5426 | delete trackV; | |
5427 | } | |
5428 | if(tracklistaside->GetSize()==0) { | |
5429 | Float_t jetPt = jet->Pt(); | |
5430 | Bool_t incrementJetPt = kTRUE; | |
5431 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt ); | |
5432 | } | |
5433 | ||
5434 | delete tracklistaside; | |
5435 | } | |
5436 | ||
5437 | if(type==kBckgASideWindow) | |
5438 | { | |
5439 | Double_t normFactorASide = 0.; | |
5440 | Double_t sumPtASideW = 0.; | |
5441 | TList* tracklistasidew = new TList(); | |
5442 | GetTracksTiltedwrpJetAxisWindow(TMath::Pi(),inputtracklist,tracklistasidew,jet,TMath::Abs(GetFFRadius()),sumPtASideW,normFactorASide); | |
5443 | if(fh1Mult) fh1Mult->Fill(tracklistasidew->GetSize()); | |
5444 | ||
5445 | for(Int_t it=0; it<tracklistasidew->GetSize(); ++it){ | |
5446 | ||
5447 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistasidew->At(it)); | |
5448 | if(!trackVP) continue; | |
5449 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5450 | ||
5451 | Float_t jetPt = jet->Pt(); | |
5452 | Float_t trackPt = trackV->Pt(); | |
5453 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5454 | ||
5455 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactorASide); | |
5456 | ||
5457 | // Fill track QA for background | |
5458 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt, kFALSE, normFactorASide); | |
5459 | ||
5460 | delete trackV; | |
5461 | } | |
5462 | if(tracklistasidew->GetSize()==0) { | |
5463 | Float_t jetPt = jet->Pt(); | |
5464 | Bool_t incrementJetPt = kTRUE; | |
5465 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt, normFactorASide); | |
5466 | } | |
5467 | ||
5468 | delete tracklistasidew; | |
5469 | } | |
5470 | ||
5471 | if(type==kBckgPerpWindow) | |
5472 | { | |
5473 | Double_t normFactorPerp = 0.; | |
5474 | Double_t sumPtPerpW = 0.; | |
5475 | TList* tracklistperpw = new TList(); | |
5476 | GetTracksTiltedwrpJetAxisWindow(TMath::Pi()/2.,inputtracklist,tracklistperpw,jet,TMath::Abs(GetFFRadius()),sumPtPerpW,normFactorPerp); | |
5477 | if(fh1Mult) fh1Mult->Fill(tracklistperpw->GetSize()); | |
5478 | ||
5479 | for(Int_t it=0; it<tracklistperpw->GetSize(); ++it){ | |
5480 | ||
5481 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistperpw->At(it)); | |
5482 | if(!trackVP) continue; | |
5483 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5484 | ||
5485 | Float_t jetPt = jet->Pt(); | |
5486 | Float_t trackPt = trackV->Pt(); | |
5487 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5488 | ||
5489 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactorPerp); | |
5490 | ||
5491 | // Fill track QA for background | |
5492 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt, kFALSE, normFactorPerp); | |
5493 | ||
5494 | delete trackV; | |
5495 | } | |
5496 | if(tracklistperpw->GetSize()==0) { | |
5497 | Float_t jetPt = jet->Pt(); | |
5498 | Bool_t incrementJetPt = kTRUE; | |
5499 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt, normFactorPerp); | |
5500 | } | |
5501 | ||
5502 | delete tracklistperpw; | |
5503 | } | |
5504 | ||
5505 | ||
5506 | if(type==kBckgOut2J || type==kBckgOutAJ) | |
5507 | { | |
5508 | if(type==kBckgOut2J && fh1Mult) fh1Mult->Fill(tracklistout2jets->GetSize()); | |
5509 | for(Int_t it=0; it<tracklistout2jets->GetSize(); ++it){ | |
5510 | ||
5511 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistout2jets->At(it)); | |
5512 | if(!trackVP) continue; | |
5513 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5514 | ||
5515 | Float_t jetPt = jet->Pt(); | |
5516 | Float_t trackPt = trackV->Pt(); | |
5517 | ||
5518 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5519 | ||
5520 | if(type==kBckgOut2J) | |
5521 | { | |
5522 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt ); | |
5523 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt); | |
5524 | } | |
5525 | ||
5526 | // All cases included | |
5527 | if(nRecJetsCuts==2 && type==kBckgOutAJ) | |
5528 | { | |
5529 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt ); | |
5530 | ||
5531 | } | |
5532 | delete trackV; | |
5533 | } | |
5534 | // Increment jet pt with one entry in case #tracks outside jets = 0 | |
5535 | if(tracklistout2jets->GetSize()==0) { | |
5536 | Float_t jetPt = jet->Pt(); | |
5537 | Bool_t incrementJetPt = kTRUE; | |
5538 | if(type==kBckgOut2J) | |
5539 | { | |
5540 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt ); | |
5541 | } | |
5542 | // All cases included | |
5543 | if(nRecJetsCuts==2 && type==kBckgOutAJ) | |
5544 | { | |
5545 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt ); | |
5546 | } | |
5547 | } | |
5548 | } | |
5549 | ||
5550 | if(type==kBckgOut2JStat || type==kBckgOutAJStat) | |
5551 | { | |
5552 | for(Int_t it=0; it<tracklistout2jetsStat->GetSize(); ++it){ | |
5553 | ||
5554 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistout2jetsStat->At(it)); | |
5555 | if(!trackVP) continue; | |
5556 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5557 | ||
5558 | Float_t jetPt = jet->Pt(); | |
5559 | Float_t trackPt = trackV->Pt(); | |
5560 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5561 | ||
5562 | if(type==kBckgOut2JStat) | |
5563 | { | |
5564 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactor2Jets); | |
5565 | ||
5566 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt ); // OB added bgr QA | |
5567 | } | |
5568 | ||
5569 | // All cases included | |
5570 | if(nRecJetsCuts==2 && type==kBckgOutAJStat) | |
5571 | { | |
5572 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactor2Jets); | |
5573 | ||
5574 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt ); // OB added bgr QA | |
5575 | } | |
5576 | delete trackV; | |
5577 | } | |
5578 | // Increment jet pt with one entry in case #tracks outside jets = 0 | |
5579 | if(tracklistout2jetsStat->GetSize()==0) { | |
5580 | Float_t jetPt = jet->Pt(); | |
5581 | Bool_t incrementJetPt = kTRUE; | |
5582 | if(type==kBckgOut2JStat) | |
5583 | { | |
5584 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt, normFactor2Jets); | |
5585 | } | |
5586 | // All cases included | |
5587 | if(nRecJetsCuts==2 && type==kBckgOutAJStat) | |
5588 | { | |
5589 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt, normFactor2Jets); | |
5590 | } | |
5591 | } | |
5592 | ||
5593 | } | |
5594 | ||
5595 | if(type==kBckgOut3J || type==kBckgOutAJ) | |
5596 | { | |
5597 | if(type==kBckgOut3J && fh1Mult) fh1Mult->Fill(tracklistout3jets->GetSize()); | |
5598 | ||
5599 | for(Int_t it=0; it<tracklistout3jets->GetSize(); ++it){ | |
5600 | ||
5601 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistout3jets->At(it)); | |
5602 | if(!trackVP) continue; | |
5603 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5604 | ||
5605 | Float_t jetPt = jet->Pt(); | |
5606 | Float_t trackPt = trackV->Pt(); | |
5607 | ||
5608 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5609 | ||
5610 | if(type==kBckgOut3J) | |
5611 | { | |
5612 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt ); | |
5613 | ||
5614 | qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt); | |
5615 | } | |
5616 | ||
5617 | // All cases included | |
5618 | if(nRecJetsCuts==3 && type==kBckgOutAJ) | |
5619 | { | |
5620 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt ); | |
5621 | ||
5622 | } | |
5623 | delete trackV; | |
5624 | } | |
5625 | // Increment jet pt with one entry in case #tracks outside jets = 0 | |
5626 | if(tracklistout3jets->GetSize()==0) { | |
5627 | Float_t jetPt = jet->Pt(); | |
5628 | Bool_t incrementJetPt = kTRUE; | |
5629 | if(type==kBckgOut3J) | |
5630 | { | |
5631 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt ); | |
5632 | } | |
5633 | // All cases included | |
5634 | if(nRecJetsCuts==3 && type==kBckgOutAJ) | |
5635 | { | |
5636 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt ); | |
5637 | } | |
5638 | } | |
5639 | } | |
5640 | ||
5641 | if(type==kBckgOut3JStat || type==kBckgOutAJStat) | |
5642 | { | |
5643 | for(Int_t it=0; it<tracklistout3jetsStat->GetSize(); ++it){ | |
5644 | ||
5645 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistout3jetsStat->At(it)); | |
5646 | if(!trackVP) continue; | |
5647 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5648 | ||
5649 | Float_t jetPt = jet->Pt(); | |
5650 | Float_t trackPt = trackV->Pt(); | |
5651 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5652 | ||
5653 | if(type==kBckgOut3JStat) | |
5654 | { | |
5655 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactor3Jets); | |
5656 | ||
5657 | //if(fQAMode&1) qabckghistocuts->FillTrackQA( trackEta, TVector2::Phi_0_2pi(trackPhi), trackPt); | |
5658 | } | |
5659 | ||
5660 | // All cases included | |
5661 | if(nRecJetsCuts==3 && type==kBckgOutAJStat) | |
5662 | { | |
5663 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactor3Jets ); | |
5664 | ||
5665 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt ); | |
5666 | ||
5667 | } | |
5668 | delete trackV; | |
5669 | } | |
5670 | // Increment jet pt with one entry in case #tracks outside jets = 0 | |
5671 | if(tracklistout3jetsStat->GetSize()==0) { | |
5672 | Float_t jetPt = jet->Pt(); | |
5673 | Bool_t incrementJetPt = kTRUE; | |
5674 | if(type==kBckgOut3JStat) | |
5675 | { | |
5676 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt, normFactor3Jets); | |
5677 | } | |
5678 | // All cases included | |
5679 | if(nRecJetsCuts==3 && type==kBckgOutAJStat) | |
5680 | { | |
5681 | if(fFFMode) ffbckghistocuts->FillFF( -1., jetPt, incrementJetPt, normFactor3Jets); | |
5682 | } | |
5683 | } | |
5684 | ||
5685 | } | |
5686 | ||
5687 | if(type==kBckgClustersOutLeading){ // clusters bgr: all tracks in clusters out of leading jet | |
5688 | ||
5689 | TList* tracklistClustersOutLeading = new TList(); | |
5690 | Double_t normFactorClusters = 0; | |
5691 | Float_t jetPt = jet->Pt(); | |
5692 | ||
5693 | GetClusterTracksOutOf1Jet(jet, tracklistClustersOutLeading, normFactorClusters); | |
5694 | if(fh1Mult) fh1Mult->Fill(tracklistClustersOutLeading->GetSize()); | |
5695 | ||
5696 | for(Int_t it=0; it<tracklistClustersOutLeading->GetSize(); ++it){ | |
5697 | ||
5698 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistClustersOutLeading->At(it)); | |
5699 | if(!trackVP) continue; | |
5700 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5701 | ||
5702 | Float_t trackPt = trackVP->Pt(); | |
5703 | ||
5704 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5705 | ||
5706 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactorClusters ); | |
5707 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt ); | |
5708 | ||
5709 | delete trackV; | |
5710 | } | |
5711 | ||
5712 | delete tracklistClustersOutLeading; | |
5713 | ||
5714 | } | |
5715 | ||
5716 | if(type == kBckgClusters){ // clusters bgr: all tracks in 'median cluster' | |
5717 | ||
5718 | TList* tracklistClustersMedian = new TList(); | |
5719 | Double_t normFactorClusters = 0; | |
5720 | Float_t jetPt = jet->Pt(); | |
5721 | ||
5722 | GetClusterTracksMedian(tracklistClustersMedian, normFactorClusters); | |
5723 | if(fh1Mult) fh1Mult->Fill(tracklistClustersMedian->GetSize()); | |
5724 | ||
5725 | for(Int_t it=0; it<tracklistClustersMedian->GetSize(); ++it){ | |
5726 | ||
5727 | AliVParticle* trackVP = dynamic_cast<AliVParticle*>(tracklistClustersMedian->At(it)); | |
5728 | if(!trackVP) continue; | |
5729 | TLorentzVector* trackV = new TLorentzVector(trackVP->Px(),trackVP->Py(),trackVP->Pz(),trackVP->P()); | |
5730 | ||
5731 | Float_t trackPt = trackVP->Pt(); | |
5732 | ||
5733 | Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE; | |
5734 | ||
5735 | if(fFFMode) ffbckghistocuts->FillFF( trackPt, jetPt, incrementJetPt, normFactorClusters ); | |
5736 | if(fQAMode&1) qabckghistocuts->FillTrackQA( trackV->Eta(), TVector2::Phi_0_2pi(trackV->Phi()), trackPt ); | |
5737 | ||
5738 | delete trackV; | |
5739 | } | |
5740 | ||
5741 | delete tracklistClustersMedian; | |
5742 | } | |
5743 | ||
5744 | delete tracklistout2jets; | |
5745 | delete tracklistout3jets; | |
5746 | delete tracklistout2jetsStat; | |
5747 | delete tracklistout3jetsStat; | |
5748 | } | |
5749 | ||
5750 | //_____________________________________________________________________________________ | |
9d7ad2e4 | 5751 | Double_t AliAnalysisTaskIDFragmentationFunction::GetMCStrangenessFactor(Double_t pt) const |
e131b05f | 5752 | { |
5753 | // factor strangeness data/MC as function of pt from UE analysis (Sara Vallero) | |
5754 | ||
5755 | Double_t alpha = 1; | |
5756 | ||
5757 | if(0.150<pt && pt<0.200) alpha = 3.639; | |
5758 | if(0.200<pt && pt<0.250) alpha = 2.097; | |
5759 | if(0.250<pt && pt<0.300) alpha = 1.930; | |
5760 | if(0.300<pt && pt<0.350) alpha = 1.932; | |
5761 | if(0.350<pt && pt<0.400) alpha = 1.943; | |
5762 | if(0.400<pt && pt<0.450) alpha = 1.993; | |
5763 | if(0.450<pt && pt<0.500) alpha = 1.989; | |
5764 | if(0.500<pt && pt<0.600) alpha = 1.963; | |
5765 | if(0.600<pt && pt<0.700) alpha = 1.917; | |
5766 | if(0.700<pt && pt<0.800) alpha = 1.861; | |
5767 | if(0.800<pt && pt<0.900) alpha = 1.820; | |
5768 | if(0.900<pt && pt<1.000) alpha = 1.741; | |
5769 | if(1.000<pt && pt<1.500) alpha = 0.878; | |
5770 | ||
5771 | return alpha; | |
5772 | } | |
5773 | ||
5774 | //__________________________________________________________________________________________________ | |
5775 | Double_t AliAnalysisTaskIDFragmentationFunction::GetMCStrangenessFactorCMS(AliAODMCParticle* daughter) const | |
5776 | { | |
5777 | // strangeness ratio MC/data as function of mother pt from CMS data in |eta|<2.0 | |
5778 | ||
5779 | TClonesArray *tca = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName())); | |
5780 | if(!tca) return 1; | |
5781 | ||
5782 | AliAODMCParticle* currentMother = daughter; | |
5783 | AliAODMCParticle* currentDaughter = daughter; | |
5784 | ||
5785 | ||
5786 | // find first primary mother K0s, Lambda or Xi | |
5787 | while(1){ | |
5788 | ||
5789 | Int_t daughterPDG = currentDaughter->GetPdgCode(); | |
5790 | ||
5791 | Int_t motherLabel = currentDaughter->GetMother(); | |
5792 | if(motherLabel >= tca->GetEntriesFast()){ // protection | |
5793 | currentMother = currentDaughter; | |
5794 | break; | |
5795 | } | |
5796 | ||
5797 | currentMother = (AliAODMCParticle*) tca->At(motherLabel); | |
5798 | ||
5799 | if(!currentMother){ | |
5800 | currentMother = currentDaughter; | |
5801 | break; | |
5802 | } | |
5803 | ||
5804 | Int_t motherPDG = currentMother->GetPdgCode(); | |
5805 | ||
5806 | // phys. primary found ? | |
5807 | if(currentMother->IsPhysicalPrimary()) break; | |
5808 | ||
5809 | if(TMath::Abs(daughterPDG) == 321){ // K+/K- e.g. from phi (ref data not feeddown corrected) | |
5810 | currentMother = currentDaughter; break; | |
5811 | } | |
5812 | if(TMath::Abs(motherPDG) == 310 ){ // K0s e.g. from phi (ref data not feeddown corrected) | |
5813 | break; | |
5814 | } | |
5815 | if(TMath::Abs(motherPDG) == 3212 && TMath::Abs(daughterPDG) == 3122){ // mother Sigma0, daughter Lambda (this case not included in feeddown corr.) | |
5816 | currentMother = currentDaughter; break; | |
5817 | } | |
5818 | ||
5819 | currentDaughter = currentMother; | |
5820 | } | |
5821 | ||
5822 | ||
5823 | Int_t motherPDG = currentMother->GetPdgCode(); | |
5824 | Double_t motherGenPt = currentMother->Pt(); | |
5825 | ||
5826 | return AliAnalysisTaskPID::GetMCStrangenessFactorCMS(motherPDG, motherGenPt); | |
5827 | } | |
5828 | ||
5829 | // _________________________________________________________________________________ | |
5830 | void AliAnalysisTaskIDFragmentationFunction::FillJetShape(AliAODJet* jet, TList* list, | |
5831 | TProfile* hProNtracksLeadingJet, TProfile** hProDelRPtSum, TProfile* hProDelR80pcPt, | |
5832 | Double_t dPhiUE, Double_t normUE, Bool_t scaleStrangeness) | |
5833 | { | |
5834 | // Fill jet shape histos | |
5835 | ||
5836 | const Int_t kNbinsR = 50; | |
5837 | const Float_t kBinWidthR = 0.02; | |
5838 | ||
5839 | Int_t nJetTracks = list->GetEntries(); | |
5840 | ||
5841 | Float_t pTsumA[kNbinsR] = {0.0}; | |
5842 | ||
5843 | Float_t *delRA = new Float_t[nJetTracks]; | |
5844 | Float_t *trackPtA = new Float_t[nJetTracks]; | |
5845 | Int_t *index = new Int_t[nJetTracks]; | |
5846 | ||
5847 | for(Int_t i=0; i<nJetTracks; i++){ | |
5848 | delRA[i] = 0; | |
5849 | trackPtA[i] = 0; | |
5850 | index[i] = 0; | |
5851 | } | |
5852 | ||
5853 | Double_t jetMom[3]; | |
5854 | jet->PxPyPz(jetMom); | |
5855 | TVector3 jet3mom(jetMom); | |
5856 | ||
5857 | if(TMath::Abs(dPhiUE)>0){ | |
5858 | Double_t phiTilted = jet3mom.Phi(); | |
5859 | phiTilted += dPhiUE; | |
5860 | phiTilted = TVector2::Phi_0_2pi(phiTilted); | |
5861 | jet3mom.SetPhi(phiTilted); | |
5862 | } | |
5863 | ||
5864 | Double_t jetPt = jet->Pt(); | |
5865 | Double_t sumWeights = 0; | |
5866 | ||
5867 | for (Int_t j =0; j<nJetTracks; j++){ | |
5868 | ||
5869 | AliVParticle* track = dynamic_cast<AliVParticle*>(list->At(j)); | |
5870 | if(!track)continue; | |
5871 | ||
5872 | Double_t trackMom[3]; | |
5873 | track->PxPyPz(trackMom); | |
5874 | TVector3 track3mom(trackMom); | |
5875 | ||
5876 | Double_t dR = jet3mom.DeltaR(track3mom); | |
5877 | ||
5878 | delRA[j] = dR; | |
5879 | trackPtA[j] = track->Pt(); | |
5880 | ||
5881 | Double_t weight = GetMCStrangenessFactor(track->Pt()); // more correctly should be gen pt | |
5882 | sumWeights += weight; | |
5883 | ||
5884 | for(Int_t ibin=1; ibin<=kNbinsR; ibin++){ | |
5885 | Float_t xlow = kBinWidthR*(ibin-1); | |
5886 | Float_t xup = kBinWidthR*ibin; | |
5887 | if(xlow <= dR && dR < xup){ | |
5888 | ||
5889 | if(scaleStrangeness) pTsumA[ibin-1] += track->Pt()*weight; | |
5890 | else pTsumA[ibin-1] += track->Pt(); | |
5891 | } | |
5892 | } | |
5893 | } // track loop | |
5894 | ||
5895 | Float_t jetPtMin=0; | |
5896 | Float_t jetPtMax=0; | |
5897 | ||
5898 | for(Int_t ibin=0; ibin<kNbinsR; ibin++){ | |
5899 | Float_t fR = kBinWidthR*(ibin+0.5); | |
5900 | ||
5901 | for(Int_t k=0; k<5; k++){ | |
5902 | if(k==0){jetPtMin=20.0;jetPtMax=30.0;} | |
5903 | if(k==1){jetPtMin=30.0;jetPtMax=40.0;} | |
5904 | if(k==2){jetPtMin=40.0;jetPtMax=60.0;} | |
5905 | if(k==3){jetPtMin=60.0;jetPtMax=80.0;} | |
5906 | if(k==4){jetPtMin=80.0;jetPtMax=100.0;} | |
5907 | if(jetPt>jetPtMin && jetPt<jetPtMax){ | |
5908 | ||
5909 | hProDelRPtSum[k]->Fill(fR,pTsumA[ibin]); | |
5910 | ||
5911 | } | |
5912 | } | |
5913 | } | |
5914 | ||
5915 | if(scaleStrangeness) hProNtracksLeadingJet->Fill(jetPt,sumWeights); | |
5916 | else hProNtracksLeadingJet->Fill(jetPt,nJetTracks); | |
5917 | ||
5918 | if(normUE) hProNtracksLeadingJet->Fill(jetPt,nJetTracks/normUE); | |
5919 | ||
5920 | if(hProDelR80pcPt){ | |
5921 | ||
5922 | Float_t pTsum = 0; | |
5923 | Float_t delRPtSum80pc = 0; | |
5924 | ||
5925 | TMath::Sort(nJetTracks,delRA,index,0); | |
5926 | ||
5927 | for(Int_t ii=0; ii<nJetTracks; ii++){ | |
5928 | ||
5929 | if(scaleStrangeness){ | |
5930 | Double_t weight = GetMCStrangenessFactor(trackPtA[index[ii]]); // more correctly should be gen pt | |
5931 | pTsum += weight*trackPtA[index[ii]]; | |
5932 | } | |
5933 | else pTsum += trackPtA[index[ii]]; | |
5934 | ||
5935 | ||
5936 | if(pTsum/jetPt >= 0.8000){ | |
5937 | delRPtSum80pc = delRA[index[ii]]; | |
5938 | break; | |
5939 | } | |
5940 | } | |
5941 | hProDelR80pcPt->Fill(jetPt,delRPtSum80pc); | |
5942 | } | |
5943 | ||
5944 | delete[] delRA; | |
5945 | delete[] trackPtA; | |
5946 | delete[] index; | |
5947 | } | |
5948 | ||
5949 | ||
5950 | // _________________________________________________________________________________ | |
5951 | Bool_t AliAnalysisTaskIDFragmentationFunction::IsSecondaryWithStrangeMotherMC(AliAODMCParticle* part) | |
5952 | { | |
5953 | // Check whether particle is a secondary with strange mother, i.e. returns kTRUE if a strange mother is found | |
5954 | // and the particle is NOT a physical primary. In all other cases kFALSE is returned | |
5955 | ||
5956 | TClonesArray *tca = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName())); | |
5957 | if (!tca || !part) | |
5958 | return kFALSE; | |
5959 | ||
5960 | if (part->IsPhysicalPrimary()) | |
5961 | return kFALSE; | |
5962 | ||
5963 | Int_t iMother = part->GetMother(); | |
5964 | if (iMother < 0) | |
5965 | return kFALSE; | |
5966 | ||
5967 | ||
5968 | AliAODMCParticle* partM = dynamic_cast<AliAODMCParticle*>(tca->At(iMother)); | |
5969 | if (!partM) | |
5970 | return kFALSE; | |
5971 | ||
5972 | Int_t codeM = TMath::Abs(partM->GetPdgCode()); | |
5973 | Int_t mfl = Int_t(codeM / TMath::Power(10, Int_t(TMath::Log10(codeM)))); | |
5974 | if (mfl == 3 && codeM != 3) // codeM = 3 is for s quark | |
5975 | return kTRUE; | |
5976 | ||
5977 | return kFALSE; | |
5978 | } |