]>
Commit | Line | Data |
---|---|---|
bcb6ffdb | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
17 | // | |
18 | // Modified version of AliAnalysisTaskCheckCascade.cxx. | |
19 | // This is a 'hybrid' output version, in that it uses a classic TTree | |
20 | // ROOT object to store the candidates, plus a couple of histograms filled on | |
21 | // a per-event basis for storing variables too numerous to put in a tree. | |
22 | // | |
23 | // --- Added bits of code for checking V0s | |
24 | // (from AliAnalysisTaskCheckStrange.cxx) | |
25 | // | |
26 | // --- Algorithm Description | |
27 | // 1. Perform Physics Selection | |
28 | // 2. Perform Primary Vertex |z|<10cm selection | |
29 | // 3. Perform Primary Vertex NoTPCOnly vertexing selection (>0 contrib.) | |
30 | // 4. Perform Pileup Rejection | |
31 | // 5. Analysis Loops: | |
32 | // 5a. Fill TTree object with V0 information, candidates | |
33 | // | |
34 | // Please Report Any Bugs! | |
35 | // | |
36 | // --- David Dobrigkeit Chinellato | |
37 | // (david.chinellato@gmail.com) | |
38 | // | |
39 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
40 | ||
41 | class TTree; | |
42 | class TParticle; | |
43 | class TVector3; | |
44 | ||
45 | //class AliMCEventHandler; | |
46 | //class AliMCEvent; | |
47 | //class AliStack; | |
48 | ||
49 | class AliESDVertex; | |
50 | class AliAODVertex; | |
51 | class AliESDv0; | |
52 | class AliAODv0; | |
53 | ||
54 | #include <Riostream.h> | |
55 | #include "TList.h" | |
56 | #include "TH1.h" | |
57 | #include "TH2.h" | |
58 | #include "TH3.h" | |
59 | #include "THnSparse.h" | |
60 | #include "TVector3.h" | |
61 | #include "TCanvas.h" | |
62 | #include "TMath.h" | |
63 | #include "TLegend.h" | |
64 | #include "AliLog.h" | |
548bd092 | 65 | #include "AliCentrality.h" |
bcb6ffdb | 66 | #include "AliESDEvent.h" |
67 | #include "AliAODEvent.h" | |
68 | #include "AliV0vertexer.h" | |
69 | #include "AliCascadeVertexer.h" | |
70 | #include "AliESDpid.h" | |
71 | #include "AliESDtrack.h" | |
72 | #include "AliESDtrackCuts.h" | |
73 | #include "AliInputEventHandler.h" | |
74 | #include "AliAnalysisManager.h" | |
75 | #include "AliMCEventHandler.h" | |
76 | ||
77 | #include "AliCFContainer.h" | |
78 | #include "AliMultiplicity.h" | |
79 | ||
80 | #include "AliESDcascade.h" | |
81 | #include "AliAODcascade.h" | |
82 | #include "AliESDUtils.h" | |
0eebce93 | 83 | #include "AliESDHeader.h" |
bcb6ffdb | 84 | |
23518aa7 | 85 | #include "AliAnalysisUtils.h" |
bcb6ffdb | 86 | #include "AliAnalysisTaskExtractV0.h" |
87 | ||
4f8ed367 | 88 | //debugging purposes |
89 | #include "TObjectTable.h" | |
90 | ||
bcb6ffdb | 91 | ClassImp(AliAnalysisTaskExtractV0) |
92 | ||
93 | AliAnalysisTaskExtractV0::AliAnalysisTaskExtractV0() | |
23518aa7 | 94 | : AliAnalysisTaskSE(), fListHistV0(0), fTree(0), fPIDResponse(0),fESDtrackCuts(0), fUtils(0), |
95 | fkIsNuclear ( kFALSE ), | |
96 | fkSwitchINT7 ( kFALSE ), | |
97 | fkUseOnTheFly ( kFALSE ), | |
98 | fkTakeAllTracks ( kFALSE ), | |
99 | fCentralityEstimator("V0M"), | |
100 | fkLightWeight ( kFALSE ), | |
101 | fkFastOnly ( "" ), | |
102 | fkpAVertexSelection( kFALSE ), | |
f0813b85 | 103 | fkRunV0Vertexer ( kFALSE ), |
fb0d435a | 104 | fkRejectPileup ( kTRUE ), |
f897dd0e | 105 | fkSpecialExecution( kFALSE ), |
b89ea5c6 | 106 | fkSkipTrigger ( kFALSE ), |
cf8bc95e | 107 | fTPCdEdxSelection ( kTRUE ), |
61d295ec | 108 | fEtaRefMult ( 0.5 ), |
85b81f83 | 109 | //------------------------------------------------ |
110 | // Initialize | |
111 | fTreeVariableChi2V0(0), | |
112 | fTreeVariableDcaV0Daughters(0), | |
113 | fTreeVariableDcaV0ToPrimVertex(0), | |
114 | fTreeVariableDcaPosToPrimVertex(0), | |
115 | fTreeVariableDcaNegToPrimVertex(0), | |
116 | fTreeVariableV0CosineOfPointingAngle(0), | |
117 | fTreeVariableV0Radius(0), | |
118 | fTreeVariablePt(0), | |
119 | fTreeVariableRapK0Short(0), | |
120 | fTreeVariableRapLambda(0), | |
121 | fTreeVariableInvMassK0s(0), | |
122 | fTreeVariableInvMassLambda(0), | |
123 | fTreeVariableInvMassAntiLambda(0), | |
124 | fTreeVariableAlphaV0(0), | |
125 | fTreeVariablePtArmV0(0), | |
126 | fTreeVariableNegTotMomentum(0), | |
127 | fTreeVariablePosTotMomentum(0), | |
128 | fTreeVariableNegdEdxSig(0), | |
129 | fTreeVariablePosdEdxSig(0), | |
130 | fTreeVariableNegEta(0), | |
131 | fTreeVariablePosEta(0), | |
132 | ||
133 | fTreeVariableNSigmasPosProton(0), | |
134 | fTreeVariableNSigmasPosPion(0), | |
135 | fTreeVariableNSigmasNegProton(0), | |
136 | fTreeVariableNSigmasNegPion(0), | |
137 | ||
138 | fTreeVariableDistOverTotMom(0), | |
139 | fTreeVariableLeastNbrCrossedRows(0), | |
140 | fTreeVariableLeastRatioCrossedRowsOverFindable(0), | |
141 | fTreeVariableMultiplicity(0), | |
5d43de53 | 142 | fTreeVariableMultiplicityV0A(0), |
143 | fTreeVariableMultiplicityZNA(0), | |
144 | fTreeVariableMultiplicityTRK(0), | |
145 | fTreeVariableMultiplicitySPD(0), | |
85b81f83 | 146 | |
147 | fTreeVariableRunNumber(0), | |
148 | fTreeVariableEventNumber(0), | |
149 | ||
150 | fTreeVariableV0x(0), | |
151 | fTreeVariableV0y(0), | |
152 | fTreeVariableV0z(0), | |
153 | ||
154 | fTreeVariableV0Px(0), | |
155 | fTreeVariableV0Py(0), | |
156 | fTreeVariableV0Pz(0), | |
157 | ||
158 | fTreeVariablePVx(0), | |
159 | fTreeVariablePVy(0), | |
160 | fTreeVariablePVz(0), | |
bcb6ffdb | 161 | |
3db9b379 | 162 | fTreeVariableNegTrackStatus(0), |
163 | fTreeVariablePosTrackStatus(0), | |
164 | ||
f897dd0e | 165 | fTreeVariableNegTPCSignal(0), |
166 | fTreeVariablePosTPCSignal(0), | |
167 | fTreeVariableNegInnerP(0), | |
168 | fTreeVariablePosInnerP(0), | |
169 | ||
170 | fTreeVariableNegPx(0), | |
171 | fTreeVariableNegPy(0), | |
172 | fTreeVariableNegPz(0), | |
173 | fTreeVariablePosPx(0), | |
174 | fTreeVariablePosPy(0), | |
175 | fTreeVariablePosPz(0), | |
176 | ||
177 | ||
bcb6ffdb | 178 | //------------------------------------------------ |
179 | // HISTOGRAMS | |
180 | // --- Filled on an Event-by-event basis | |
181 | //------------------------------------------------ | |
182 | fHistV0MultiplicityBeforeTrigSel(0), | |
183 | fHistV0MultiplicityForTrigEvt(0), | |
184 | fHistV0MultiplicityForSelEvt(0), | |
185 | fHistV0MultiplicityForSelEvtNoTPCOnly(0), | |
186 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0), | |
187 | fHistMultiplicityBeforeTrigSel(0), | |
188 | fHistMultiplicityForTrigEvt(0), | |
189 | fHistMultiplicity(0), | |
190 | fHistMultiplicityNoTPCOnly(0), | |
191 | fHistMultiplicityNoTPCOnlyNoPileup(0), | |
1d94e33b | 192 | |
d0e77a8c | 193 | //V0A Centrality |
194 | fHistMultiplicityV0ABeforeTrigSel(0), | |
195 | fHistMultiplicityV0AForTrigEvt(0), | |
196 | fHistMultiplicityV0A(0), | |
197 | fHistMultiplicityV0ANoTPCOnly(0), | |
198 | fHistMultiplicityV0ANoTPCOnlyNoPileup(0), | |
199 | ||
200 | //ZNA Centrality | |
201 | fHistMultiplicityZNABeforeTrigSel(0), | |
202 | fHistMultiplicityZNAForTrigEvt(0), | |
203 | fHistMultiplicityZNA(0), | |
204 | fHistMultiplicityZNANoTPCOnly(0), | |
205 | fHistMultiplicityZNANoTPCOnlyNoPileup(0), | |
206 | ||
207 | //TRK Centrality | |
208 | fHistMultiplicityTRKBeforeTrigSel(0), | |
209 | fHistMultiplicityTRKForTrigEvt(0), | |
210 | fHistMultiplicityTRK(0), | |
211 | fHistMultiplicityTRKNoTPCOnly(0), | |
212 | fHistMultiplicityTRKNoTPCOnlyNoPileup(0), | |
213 | ||
214 | //SPD Centrality | |
215 | fHistMultiplicitySPDBeforeTrigSel(0), | |
216 | fHistMultiplicitySPDForTrigEvt(0), | |
217 | fHistMultiplicitySPD(0), | |
218 | fHistMultiplicitySPDNoTPCOnly(0), | |
219 | fHistMultiplicitySPDNoTPCOnlyNoPileup(0), | |
220 | ||
1d94e33b | 221 | //Raw Data for Vertex Z position estimator change |
222 | f2dHistMultiplicityVsVertexZBeforeTrigSel(0), | |
223 | f2dHistMultiplicityVsVertexZForTrigEvt(0), | |
224 | f2dHistMultiplicityVsVertexZ(0), | |
225 | f2dHistMultiplicityVsVertexZNoTPCOnly(0), | |
226 | f2dHistMultiplicityVsVertexZNoTPCOnlyNoPileup(0), | |
227 | ||
bcb6ffdb | 228 | fHistPVx(0), |
229 | fHistPVy(0), | |
230 | fHistPVz(0), | |
231 | fHistPVxAnalysis(0), | |
232 | fHistPVyAnalysis(0), | |
4f8ed367 | 233 | fHistPVzAnalysis(0), |
cf8bc95e | 234 | fHistSwappedV0Counter(0) |
bcb6ffdb | 235 | { |
236 | // Dummy Constructor | |
f0813b85 | 237 | for(Int_t iV0selIdx = 0; iV0selIdx < 7; iV0selIdx++ ) { fV0Sels [iV0selIdx ] = -1.; } |
bcb6ffdb | 238 | } |
239 | ||
240 | AliAnalysisTaskExtractV0::AliAnalysisTaskExtractV0(const char *name) | |
23518aa7 | 241 | : AliAnalysisTaskSE(name), fListHistV0(0), fTree(0), fPIDResponse(0),fESDtrackCuts(0), fUtils(0), |
242 | fkIsNuclear ( kFALSE ), | |
243 | fkSwitchINT7 ( kFALSE ), | |
244 | fkUseOnTheFly ( kFALSE ), | |
245 | fkTakeAllTracks ( kFALSE ), | |
246 | fCentralityEstimator("V0M"), | |
247 | fkLightWeight ( kFALSE ), | |
248 | fkFastOnly ( "" ), | |
249 | fkpAVertexSelection( kFALSE ), | |
f0813b85 | 250 | fkRunV0Vertexer ( kFALSE ), |
fb0d435a | 251 | fkRejectPileup ( kTRUE ), |
f897dd0e | 252 | fkSpecialExecution( kFALSE ), |
b89ea5c6 | 253 | fkSkipTrigger ( kFALSE ), |
cf8bc95e | 254 | fTPCdEdxSelection ( kTRUE ), |
61d295ec | 255 | fEtaRefMult ( 0.5 ), |
85b81f83 | 256 | //------------------------------------------------ |
257 | // Initialize | |
258 | fTreeVariableChi2V0(0), | |
259 | fTreeVariableDcaV0Daughters(0), | |
260 | fTreeVariableDcaV0ToPrimVertex(0), | |
261 | fTreeVariableDcaPosToPrimVertex(0), | |
262 | fTreeVariableDcaNegToPrimVertex(0), | |
263 | fTreeVariableV0CosineOfPointingAngle(0), | |
264 | fTreeVariableV0Radius(0), | |
265 | fTreeVariablePt(0), | |
266 | fTreeVariableRapK0Short(0), | |
267 | fTreeVariableRapLambda(0), | |
268 | fTreeVariableInvMassK0s(0), | |
269 | fTreeVariableInvMassLambda(0), | |
270 | fTreeVariableInvMassAntiLambda(0), | |
271 | fTreeVariableAlphaV0(0), | |
272 | fTreeVariablePtArmV0(0), | |
273 | fTreeVariableNegTotMomentum(0), | |
274 | fTreeVariablePosTotMomentum(0), | |
275 | fTreeVariableNegdEdxSig(0), | |
276 | fTreeVariablePosdEdxSig(0), | |
277 | fTreeVariableNegEta(0), | |
278 | fTreeVariablePosEta(0), | |
279 | ||
280 | fTreeVariableNSigmasPosProton(0), | |
281 | fTreeVariableNSigmasPosPion(0), | |
282 | fTreeVariableNSigmasNegProton(0), | |
283 | fTreeVariableNSigmasNegPion(0), | |
284 | ||
285 | fTreeVariableDistOverTotMom(0), | |
286 | fTreeVariableLeastNbrCrossedRows(0), | |
287 | fTreeVariableLeastRatioCrossedRowsOverFindable(0), | |
288 | fTreeVariableMultiplicity(0), | |
5d43de53 | 289 | fTreeVariableMultiplicityV0A(0), |
290 | fTreeVariableMultiplicityZNA(0), | |
291 | fTreeVariableMultiplicityTRK(0), | |
292 | fTreeVariableMultiplicitySPD(0), | |
293 | ||
85b81f83 | 294 | fTreeVariableRunNumber(0), |
295 | fTreeVariableEventNumber(0), | |
296 | ||
297 | fTreeVariableV0x(0), | |
298 | fTreeVariableV0y(0), | |
299 | fTreeVariableV0z(0), | |
300 | ||
301 | fTreeVariableV0Px(0), | |
302 | fTreeVariableV0Py(0), | |
303 | fTreeVariableV0Pz(0), | |
304 | ||
305 | fTreeVariablePVx(0), | |
306 | fTreeVariablePVy(0), | |
307 | fTreeVariablePVz(0), | |
308 | ||
3db9b379 | 309 | fTreeVariableNegTrackStatus(0), |
310 | fTreeVariablePosTrackStatus(0), | |
311 | ||
f897dd0e | 312 | fTreeVariableNegTPCSignal(0), |
313 | fTreeVariablePosTPCSignal(0), | |
314 | fTreeVariableNegInnerP(0), | |
315 | fTreeVariablePosInnerP(0), | |
316 | ||
317 | fTreeVariableNegPx(0), | |
318 | fTreeVariableNegPy(0), | |
319 | fTreeVariableNegPz(0), | |
320 | fTreeVariablePosPx(0), | |
321 | fTreeVariablePosPy(0), | |
322 | fTreeVariablePosPz(0), | |
323 | ||
bcb6ffdb | 324 | //------------------------------------------------ |
325 | // HISTOGRAMS | |
326 | // --- Filled on an Event-by-event basis | |
327 | //------------------------------------------------ | |
328 | fHistV0MultiplicityBeforeTrigSel(0), | |
329 | fHistV0MultiplicityForTrigEvt(0), | |
330 | fHistV0MultiplicityForSelEvt(0), | |
331 | fHistV0MultiplicityForSelEvtNoTPCOnly(0), | |
332 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0), | |
333 | fHistMultiplicityBeforeTrigSel(0), | |
334 | fHistMultiplicityForTrigEvt(0), | |
335 | fHistMultiplicity(0), | |
336 | fHistMultiplicityNoTPCOnly(0), | |
337 | fHistMultiplicityNoTPCOnlyNoPileup(0), | |
1d94e33b | 338 | |
d0e77a8c | 339 | |
340 | //V0A Centrality | |
341 | fHistMultiplicityV0ABeforeTrigSel(0), | |
342 | fHistMultiplicityV0AForTrigEvt(0), | |
343 | fHistMultiplicityV0A(0), | |
344 | fHistMultiplicityV0ANoTPCOnly(0), | |
345 | fHistMultiplicityV0ANoTPCOnlyNoPileup(0), | |
346 | ||
347 | //ZNA Centrality | |
348 | fHistMultiplicityZNABeforeTrigSel(0), | |
349 | fHistMultiplicityZNAForTrigEvt(0), | |
350 | fHistMultiplicityZNA(0), | |
351 | fHistMultiplicityZNANoTPCOnly(0), | |
352 | fHistMultiplicityZNANoTPCOnlyNoPileup(0), | |
353 | ||
354 | //TRK Centrality | |
355 | fHistMultiplicityTRKBeforeTrigSel(0), | |
356 | fHistMultiplicityTRKForTrigEvt(0), | |
357 | fHistMultiplicityTRK(0), | |
358 | fHistMultiplicityTRKNoTPCOnly(0), | |
359 | fHistMultiplicityTRKNoTPCOnlyNoPileup(0), | |
360 | ||
361 | //SPD Centrality | |
362 | fHistMultiplicitySPDBeforeTrigSel(0), | |
363 | fHistMultiplicitySPDForTrigEvt(0), | |
364 | fHistMultiplicitySPD(0), | |
365 | fHistMultiplicitySPDNoTPCOnly(0), | |
366 | fHistMultiplicitySPDNoTPCOnlyNoPileup(0), | |
367 | ||
1d94e33b | 368 | //Raw Data for Vertex Z position estimator change |
369 | f2dHistMultiplicityVsVertexZBeforeTrigSel(0), | |
370 | f2dHistMultiplicityVsVertexZForTrigEvt(0), | |
371 | f2dHistMultiplicityVsVertexZ(0), | |
372 | f2dHistMultiplicityVsVertexZNoTPCOnly(0), | |
373 | f2dHistMultiplicityVsVertexZNoTPCOnlyNoPileup(0), | |
374 | ||
bcb6ffdb | 375 | fHistPVx(0), |
376 | fHistPVy(0), | |
377 | fHistPVz(0), | |
378 | fHistPVxAnalysis(0), | |
379 | fHistPVyAnalysis(0), | |
4f8ed367 | 380 | fHistPVzAnalysis(0), |
cf8bc95e | 381 | fHistSwappedV0Counter(0) |
bcb6ffdb | 382 | { |
383 | // Constructor | |
f0813b85 | 384 | // Set Loose cuts or not here... |
385 | // REALLY LOOSE? Be careful when attempting to run over PbPb if fkRunV0Vertexer is set! | |
386 | fV0Sels[0] = 33. ; // max allowed chi2 | |
387 | fV0Sels[1] = 0.02; // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05) | |
388 | fV0Sels[2] = 0.02; // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05) | |
389 | fV0Sels[3] = 2.0 ; // max allowed DCA between the daughter tracks (LHC09a4 : 0.5) | |
390 | fV0Sels[4] = 0.95; // min allowed cosine of V0's pointing angle (LHC09a4 : 0.99) | |
391 | fV0Sels[5] = 0.5 ; // min radius of the fiducial volume (LHC09a4 : 0.2) | |
392 | fV0Sels[6] = 200. ; // max radius of the fiducial volume (LHC09a4 : 100.0) | |
393 | ||
bcb6ffdb | 394 | // Output slot #0 writes into a TList container (Lambda Histos and fTree) |
395 | DefineOutput(1, TList::Class()); | |
396 | DefineOutput(2, TTree::Class()); | |
397 | } | |
398 | ||
399 | ||
400 | AliAnalysisTaskExtractV0::~AliAnalysisTaskExtractV0() | |
401 | { | |
402 | //------------------------------------------------ | |
403 | // DESTRUCTOR | |
404 | //------------------------------------------------ | |
405 | ||
406 | if (fListHistV0){ | |
407 | delete fListHistV0; | |
408 | fListHistV0 = 0x0; | |
409 | } | |
410 | if (fTree){ | |
411 | delete fTree; | |
412 | fTree = 0x0; | |
413 | } | |
76029adc | 414 | //cleanup esd track cuts object too... |
415 | if (fESDtrackCuts){ | |
416 | delete fESDtrackCuts; | |
417 | fESDtrackCuts = 0x0; | |
418 | } | |
23518aa7 | 419 | if (fUtils){ |
420 | delete fUtils; | |
421 | fUtils = 0x0; | |
422 | } | |
76029adc | 423 | |
bcb6ffdb | 424 | } |
425 | ||
426 | ||
427 | ||
428 | //________________________________________________________________________ | |
429 | void AliAnalysisTaskExtractV0::UserCreateOutputObjects() | |
430 | { | |
bcb6ffdb | 431 | |
eff0b6fc | 432 | //Create File-resident Tree, please. |
433 | OpenFile(2); | |
bcb6ffdb | 434 | // Called once |
eff0b6fc | 435 | fTree = new TTree("fTree","V0Candidates"); |
bcb6ffdb | 436 | |
437 | //------------------------------------------------ | |
438 | // fTree Branch definitions | |
439 | //------------------------------------------------ | |
440 | ||
441 | //-----------BASIC-INFO--------------------------- | |
eff0b6fc | 442 | /* 1*/ fTree->Branch("fTreeVariableChi2V0",&fTreeVariableChi2V0,"fTreeVariableChi2V0/F"); |
443 | /* 2*/ fTree->Branch("fTreeVariableDcaV0Daughters",&fTreeVariableDcaV0Daughters,"fTreeVariableDcaV0Daughters/F"); | |
3ac8fa44 | 444 | /* 2*/ fTree->Branch("fTreeVariableDcaV0ToPrimVertex",&fTreeVariableDcaV0ToPrimVertex,"fTreeVariableDcaV0ToPrimVertex/F"); |
bcb6ffdb | 445 | /* 3*/ fTree->Branch("fTreeVariableDcaPosToPrimVertex",&fTreeVariableDcaPosToPrimVertex,"fTreeVariableDcaPosToPrimVertex/F"); |
446 | /* 4*/ fTree->Branch("fTreeVariableDcaNegToPrimVertex",&fTreeVariableDcaNegToPrimVertex,"fTreeVariableDcaNegToPrimVertex/F"); | |
447 | /* 5*/ fTree->Branch("fTreeVariableV0Radius",&fTreeVariableV0Radius,"fTreeVariableV0Radius/F"); | |
448 | /* 6*/ fTree->Branch("fTreeVariablePt",&fTreeVariablePt,"fTreeVariablePt/F"); | |
449 | /* 7*/ fTree->Branch("fTreeVariableRapK0Short",&fTreeVariableRapK0Short,"fTreeVariableRapK0Short/F"); | |
450 | /* 8*/ fTree->Branch("fTreeVariableRapLambda",&fTreeVariableRapLambda,"fTreeVariableRapLambda/F"); | |
451 | /* 9*/ fTree->Branch("fTreeVariableInvMassK0s",&fTreeVariableInvMassK0s,"fTreeVariableInvMassK0s/F"); | |
452 | /*10*/ fTree->Branch("fTreeVariableInvMassLambda",&fTreeVariableInvMassLambda,"fTreeVariableInvMassLambda/F"); | |
453 | /*11*/ fTree->Branch("fTreeVariableInvMassAntiLambda",&fTreeVariableInvMassAntiLambda,"fTreeVariableInvMassAntiLambda/F"); | |
454 | /*12*/ fTree->Branch("fTreeVariableV0CosineOfPointingAngle",&fTreeVariableV0CosineOfPointingAngle,"fTreeVariableV0CosineOfPointingAngle/F"); | |
455 | /*13*/ fTree->Branch("fTreeVariableAlphaV0",&fTreeVariableAlphaV0,"fTreeVariableAlphaV0/F"); | |
456 | /*14*/ fTree->Branch("fTreeVariablePtArmV0",&fTreeVariablePtArmV0,"fTreeVariablePtArmV0/F"); | |
457 | /*15*/ fTree->Branch("fTreeVariableLeastNbrCrossedRows",&fTreeVariableLeastNbrCrossedRows,"fTreeVariableLeastNbrCrossedRows/I"); | |
458 | /*16*/ fTree->Branch("fTreeVariableLeastRatioCrossedRowsOverFindable",&fTreeVariableLeastRatioCrossedRowsOverFindable,"fTreeVariableLeastRatioCrossedRowsOverFindable/F"); | |
459 | //-----------MULTIPLICITY-INFO-------------------- | |
460 | /*17*/ fTree->Branch("fTreeVariableMultiplicity",&fTreeVariableMultiplicity,"fTreeVariableMultiplicity/I"); | |
5d43de53 | 461 | /*17*/ fTree->Branch("fTreeVariableMultiplicityV0A",&fTreeVariableMultiplicityV0A,"fTreeVariableMultiplicityV0A/I"); |
462 | /*17*/ fTree->Branch("fTreeVariableMultiplicityZNA",&fTreeVariableMultiplicityZNA,"fTreeVariableMultiplicityZNA/I"); | |
463 | /*17*/ fTree->Branch("fTreeVariableMultiplicityTRK",&fTreeVariableMultiplicityTRK,"fTreeVariableMultiplicityTRK/I"); | |
464 | /*17*/ fTree->Branch("fTreeVariableMultiplicitySPD",&fTreeVariableMultiplicitySPD,"fTreeVariableMultiplicitySPD/I"); | |
bcb6ffdb | 465 | //------------------------------------------------ |
466 | /*18*/ fTree->Branch("fTreeVariableDistOverTotMom",&fTreeVariableDistOverTotMom,"fTreeVariableDistOverTotMom/F"); | |
467 | /*19*/ fTree->Branch("fTreeVariableNSigmasPosProton",&fTreeVariableNSigmasPosProton,"fTreeVariableNSigmasPosProton/F"); | |
468 | /*20*/ fTree->Branch("fTreeVariableNSigmasPosPion",&fTreeVariableNSigmasPosPion,"fTreeVariableNSigmasPosPion/F"); | |
469 | /*21*/ fTree->Branch("fTreeVariableNSigmasNegProton",&fTreeVariableNSigmasNegProton,"fTreeVariableNSigmasNegProton/F"); | |
470 | /*22*/ fTree->Branch("fTreeVariableNSigmasNegPion",&fTreeVariableNSigmasNegPion,"fTreeVariableNSigmasNegPion/F"); | |
471 | /*23*/ fTree->Branch("fTreeVariableNegEta",&fTreeVariableNegEta,"fTreeVariableNegEta/F"); | |
472 | /*24*/ fTree->Branch("fTreeVariablePosEta",&fTreeVariablePosEta,"fTreeVariablePosEta/F"); | |
0eebce93 | 473 | /*25*/ fTree->Branch("fTreeVariableRunNumber",&fTreeVariableRunNumber,"fTreeVariableRunNumber/I"); |
474 | /*26*/ fTree->Branch("fTreeVariableEventNumber",&fTreeVariableEventNumber,"fTreeVariableEventNumber/l"); | |
df0fac9b | 475 | |
476 | if( fkLightWeight == kFALSE ){ | |
57d075b9 | 477 | //-----------FOR CTAU DEBUGGING: Full Phase Space + Decay Position Info |
653265df | 478 | fTree->Branch("fTreeVariablePVx",&fTreeVariablePVx,"fTreeVariablePVx/F"); |
479 | fTree->Branch("fTreeVariablePVy",&fTreeVariablePVy,"fTreeVariablePVy/F"); | |
480 | fTree->Branch("fTreeVariablePVz",&fTreeVariablePVz,"fTreeVariablePVz/F"); | |
481 | ||
57d075b9 | 482 | fTree->Branch("fTreeVariableV0x",&fTreeVariableV0x,"fTreeVariableV0x/F"); |
483 | fTree->Branch("fTreeVariableV0y",&fTreeVariableV0y,"fTreeVariableV0y/F"); | |
484 | fTree->Branch("fTreeVariableV0z",&fTreeVariableV0z,"fTreeVariableV0z/F"); | |
485 | ||
486 | fTree->Branch("fTreeVariableV0Px",&fTreeVariableV0Px,"fTreeVariableV0Px/F"); | |
487 | fTree->Branch("fTreeVariableV0Py",&fTreeVariableV0Py,"fTreeVariableV0Py/F"); | |
488 | fTree->Branch("fTreeVariableV0Pz",&fTreeVariableV0Pz,"fTreeVariableV0Pz/F"); | |
3db9b379 | 489 | |
490 | fTree->Branch("fTreeVariableNegTrackStatus",&fTreeVariableNegTrackStatus,"fTreeVariableNegTrackStatus/l"); | |
491 | fTree->Branch("fTreeVariablePosTrackStatus",&fTreeVariablePosTrackStatus,"fTreeVariablePosTrackStatus/l"); | |
df0fac9b | 492 | } |
cf8bc95e | 493 | |
bcb6ffdb | 494 | //------------------------------------------------ |
495 | // Particle Identification Setup | |
496 | //------------------------------------------------ | |
497 | ||
23518aa7 | 498 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); |
499 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
500 | fPIDResponse = inputHandler->GetPIDResponse(); | |
501 | ||
502 | // Multiplicity | |
503 | ||
504 | if(! fESDtrackCuts ){ | |
505 | fESDtrackCuts = new AliESDtrackCuts(); | |
506 | } | |
507 | if(! fUtils ){ | |
508 | fUtils = new AliAnalysisUtils(); | |
509 | } | |
bcb6ffdb | 510 | |
511 | //------------------------------------------------ | |
512 | // V0 Multiplicity Histograms | |
513 | //------------------------------------------------ | |
514 | ||
eff0b6fc | 515 | // Create histograms |
516 | //Create File-resident Tree, please. | |
517 | OpenFile(1); | |
518 | ||
519 | fListHistV0 = new TList(); | |
520 | fListHistV0->SetOwner(); // See http://root.cern.ch/root/html/TCollection.html#TCollection:SetOwner | |
521 | ||
bcb6ffdb | 522 | if(! fHistV0MultiplicityBeforeTrigSel) { |
523 | fHistV0MultiplicityBeforeTrigSel = new TH1F("fHistV0MultiplicityBeforeTrigSel", | |
524 | "V0s per event (before Trig. Sel.);Nbr of V0s/Evt;Events", | |
525 | 25, 0, 25); | |
526 | fListHistV0->Add(fHistV0MultiplicityBeforeTrigSel); | |
527 | } | |
528 | ||
529 | if(! fHistV0MultiplicityForTrigEvt) { | |
530 | fHistV0MultiplicityForTrigEvt = new TH1F("fHistV0MultiplicityForTrigEvt", | |
531 | "V0s per event (for triggered evt);Nbr of V0s/Evt;Events", | |
532 | 25, 0, 25); | |
533 | fListHistV0->Add(fHistV0MultiplicityForTrigEvt); | |
534 | } | |
535 | ||
536 | if(! fHistV0MultiplicityForSelEvt) { | |
537 | fHistV0MultiplicityForSelEvt = new TH1F("fHistV0MultiplicityForSelEvt", | |
538 | "V0s per event;Nbr of V0s/Evt;Events", | |
539 | 25, 0, 25); | |
540 | fListHistV0->Add(fHistV0MultiplicityForSelEvt); | |
541 | } | |
542 | ||
543 | if(! fHistV0MultiplicityForSelEvtNoTPCOnly) { | |
544 | fHistV0MultiplicityForSelEvtNoTPCOnly = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnly", | |
545 | "V0s per event;Nbr of V0s/Evt;Events", | |
546 | 25, 0, 25); | |
547 | fListHistV0->Add(fHistV0MultiplicityForSelEvtNoTPCOnly); | |
548 | } | |
549 | ||
550 | if(! fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup) { | |
551 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup", | |
552 | "V0s per event;Nbr of V0s/Evt;Events", | |
553 | 25, 0, 25); | |
554 | fListHistV0->Add(fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup); | |
555 | } | |
556 | ||
557 | //------------------------------------------------ | |
558 | // Track Multiplicity Histograms | |
559 | //------------------------------------------------ | |
560 | ||
d0e77a8c | 561 | //Default V0M Centrality (if PbPb) |
bcb6ffdb | 562 | if(! fHistMultiplicityBeforeTrigSel) { |
563 | fHistMultiplicityBeforeTrigSel = new TH1F("fHistMultiplicityBeforeTrigSel", | |
564 | "Tracks per event;Nbr of Tracks;Events", | |
565 | 200, 0, 200); | |
566 | fListHistV0->Add(fHistMultiplicityBeforeTrigSel); | |
567 | } | |
568 | if(! fHistMultiplicityForTrigEvt) { | |
569 | fHistMultiplicityForTrigEvt = new TH1F("fHistMultiplicityForTrigEvt", | |
570 | "Tracks per event;Nbr of Tracks;Events", | |
571 | 200, 0, 200); | |
572 | fListHistV0->Add(fHistMultiplicityForTrigEvt); | |
573 | } | |
574 | if(! fHistMultiplicity) { | |
575 | fHistMultiplicity = new TH1F("fHistMultiplicity", | |
576 | "Tracks per event;Nbr of Tracks;Events", | |
577 | 200, 0, 200); | |
578 | fListHistV0->Add(fHistMultiplicity); | |
579 | } | |
580 | if(! fHistMultiplicityNoTPCOnly) { | |
581 | fHistMultiplicityNoTPCOnly = new TH1F("fHistMultiplicityNoTPCOnly", | |
582 | "Tracks per event;Nbr of Tracks;Events", | |
583 | 200, 0, 200); | |
584 | fListHistV0->Add(fHistMultiplicityNoTPCOnly); | |
585 | } | |
586 | if(! fHistMultiplicityNoTPCOnlyNoPileup) { | |
587 | fHistMultiplicityNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityNoTPCOnlyNoPileup", | |
588 | "Tracks per event;Nbr of Tracks;Events", | |
589 | 200, 0, 200); | |
590 | fListHistV0->Add(fHistMultiplicityNoTPCOnlyNoPileup); | |
591 | } | |
d0e77a8c | 592 | |
593 | //V0A Centrality (if PbPb / pPb) | |
594 | if(! fHistMultiplicityV0ABeforeTrigSel) { | |
595 | fHistMultiplicityV0ABeforeTrigSel = new TH1F("fHistMultiplicityV0ABeforeTrigSel", | |
596 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
597 | 200, 0, 200); | |
598 | fListHistV0->Add(fHistMultiplicityV0ABeforeTrigSel); | |
599 | } | |
600 | if(! fHistMultiplicityV0AForTrigEvt) { | |
601 | fHistMultiplicityV0AForTrigEvt = new TH1F("fHistMultiplicityV0AForTrigEvt", | |
602 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
603 | 200, 0, 200); | |
604 | fListHistV0->Add(fHistMultiplicityV0AForTrigEvt); | |
605 | } | |
606 | if(! fHistMultiplicityV0A) { | |
607 | fHistMultiplicityV0A = new TH1F("fHistMultiplicityV0A", | |
608 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
609 | 200, 0, 200); | |
610 | fListHistV0->Add(fHistMultiplicityV0A); | |
611 | } | |
612 | if(! fHistMultiplicityV0ANoTPCOnly) { | |
613 | fHistMultiplicityV0ANoTPCOnly = new TH1F("fHistMultiplicityV0ANoTPCOnly", | |
614 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
615 | 200, 0, 200); | |
616 | fListHistV0->Add(fHistMultiplicityV0ANoTPCOnly); | |
617 | } | |
618 | if(! fHistMultiplicityV0ANoTPCOnlyNoPileup) { | |
619 | fHistMultiplicityV0ANoTPCOnlyNoPileup = new TH1F("fHistMultiplicityV0ANoTPCOnlyNoPileup", | |
620 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
621 | 200, 0, 200); | |
622 | fListHistV0->Add(fHistMultiplicityV0ANoTPCOnlyNoPileup); | |
623 | } | |
624 | ||
625 | //ZNA Centrality (if PbPb / pPb) | |
626 | if(! fHistMultiplicityZNABeforeTrigSel) { | |
627 | fHistMultiplicityZNABeforeTrigSel = new TH1F("fHistMultiplicityZNABeforeTrigSel", | |
628 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
629 | 200, 0, 200); | |
630 | fListHistV0->Add(fHistMultiplicityZNABeforeTrigSel); | |
631 | } | |
632 | if(! fHistMultiplicityZNAForTrigEvt) { | |
633 | fHistMultiplicityZNAForTrigEvt = new TH1F("fHistMultiplicityZNAForTrigEvt", | |
634 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
635 | 200, 0, 200); | |
636 | fListHistV0->Add(fHistMultiplicityZNAForTrigEvt); | |
637 | } | |
638 | if(! fHistMultiplicityZNA) { | |
639 | fHistMultiplicityZNA = new TH1F("fHistMultiplicityZNA", | |
640 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
641 | 200, 0, 200); | |
642 | fListHistV0->Add(fHistMultiplicityZNA); | |
643 | } | |
644 | if(! fHistMultiplicityZNANoTPCOnly) { | |
645 | fHistMultiplicityZNANoTPCOnly = new TH1F("fHistMultiplicityZNANoTPCOnly", | |
646 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
647 | 200, 0, 200); | |
648 | fListHistV0->Add(fHistMultiplicityZNANoTPCOnly); | |
649 | } | |
650 | if(! fHistMultiplicityZNANoTPCOnlyNoPileup) { | |
651 | fHistMultiplicityZNANoTPCOnlyNoPileup = new TH1F("fHistMultiplicityZNANoTPCOnlyNoPileup", | |
652 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
653 | 200, 0, 200); | |
654 | fListHistV0->Add(fHistMultiplicityZNANoTPCOnlyNoPileup); | |
655 | } | |
656 | ||
657 | //TRK Centrality (if PbPb / pPb) | |
658 | if(! fHistMultiplicityTRKBeforeTrigSel) { | |
659 | fHistMultiplicityTRKBeforeTrigSel = new TH1F("fHistMultiplicityTRKBeforeTrigSel", | |
660 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
661 | 200, 0, 200); | |
662 | fListHistV0->Add(fHistMultiplicityTRKBeforeTrigSel); | |
663 | } | |
664 | if(! fHistMultiplicityTRKForTrigEvt) { | |
665 | fHistMultiplicityTRKForTrigEvt = new TH1F("fHistMultiplicityTRKForTrigEvt", | |
666 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
667 | 200, 0, 200); | |
668 | fListHistV0->Add(fHistMultiplicityTRKForTrigEvt); | |
669 | } | |
670 | if(! fHistMultiplicityTRK) { | |
671 | fHistMultiplicityTRK = new TH1F("fHistMultiplicityTRK", | |
672 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
673 | 200, 0, 200); | |
674 | fListHistV0->Add(fHistMultiplicityTRK); | |
675 | } | |
676 | if(! fHistMultiplicityTRKNoTPCOnly) { | |
677 | fHistMultiplicityTRKNoTPCOnly = new TH1F("fHistMultiplicityTRKNoTPCOnly", | |
678 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
679 | 200, 0, 200); | |
680 | fListHistV0->Add(fHistMultiplicityTRKNoTPCOnly); | |
681 | } | |
682 | if(! fHistMultiplicityTRKNoTPCOnlyNoPileup) { | |
683 | fHistMultiplicityTRKNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityTRKNoTPCOnlyNoPileup", | |
684 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
685 | 200, 0, 200); | |
686 | fListHistV0->Add(fHistMultiplicityTRKNoTPCOnlyNoPileup); | |
687 | } | |
688 | ||
689 | //SPD Centrality (if PbPb / pPb) | |
690 | if(! fHistMultiplicitySPDBeforeTrigSel) { | |
691 | fHistMultiplicitySPDBeforeTrigSel = new TH1F("fHistMultiplicitySPDBeforeTrigSel", | |
692 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
693 | 200, 0, 200); | |
694 | fListHistV0->Add(fHistMultiplicitySPDBeforeTrigSel); | |
695 | } | |
696 | if(! fHistMultiplicitySPDForTrigEvt) { | |
697 | fHistMultiplicitySPDForTrigEvt = new TH1F("fHistMultiplicitySPDForTrigEvt", | |
698 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
699 | 200, 0, 200); | |
700 | fListHistV0->Add(fHistMultiplicitySPDForTrigEvt); | |
701 | } | |
702 | if(! fHistMultiplicitySPD) { | |
703 | fHistMultiplicitySPD = new TH1F("fHistMultiplicitySPD", | |
704 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
705 | 200, 0, 200); | |
706 | fListHistV0->Add(fHistMultiplicitySPD); | |
707 | } | |
708 | if(! fHistMultiplicitySPDNoTPCOnly) { | |
709 | fHistMultiplicitySPDNoTPCOnly = new TH1F("fHistMultiplicitySPDNoTPCOnly", | |
710 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
711 | 200, 0, 200); | |
712 | fListHistV0->Add(fHistMultiplicitySPDNoTPCOnly); | |
713 | } | |
714 | if(! fHistMultiplicitySPDNoTPCOnlyNoPileup) { | |
715 | fHistMultiplicitySPDNoTPCOnlyNoPileup = new TH1F("fHistMultiplicitySPDNoTPCOnlyNoPileup", | |
716 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
717 | 200, 0, 200); | |
718 | fListHistV0->Add(fHistMultiplicitySPDNoTPCOnlyNoPileup); | |
719 | } | |
720 | ||
1d94e33b | 721 | //Raw Data for Vertex Z position estimator change |
722 | //TH2F *f2dHistMultiplicityVsVertexZBeforeTrigSel; //! multiplicity distribution | |
723 | //TH2F *f2dHistMultiplicityVsVertexZForTrigEvt; //! multiplicity distribution | |
724 | //TH2F *f2dHistMultiplicityVsVertexZ; //! multiplicity distribution | |
725 | //TH2F *f2dHistMultiplicityVsVertexZNoTPCOnly; //! multiplicity distribution | |
726 | //TH2F *f2dHistMultiplicityVsVertexZNoTPCOnlyNoPileup; //! multiplicity distribution | |
727 | ||
728 | if(! f2dHistMultiplicityVsVertexZBeforeTrigSel) { | |
729 | f2dHistMultiplicityVsVertexZBeforeTrigSel = new TH2F("f2dHistMultiplicityVsVertexZBeforeTrigSel", | |
730 | "Tracks per event", 200, 0, 200,400, -20, 20); | |
731 | fListHistV0->Add(f2dHistMultiplicityVsVertexZBeforeTrigSel); | |
732 | } | |
733 | if(! f2dHistMultiplicityVsVertexZForTrigEvt) { | |
734 | f2dHistMultiplicityVsVertexZForTrigEvt = new TH2F("f2dHistMultiplicityVsVertexZForTrigEvt", | |
735 | "Tracks per event", 200, 0, 200, 400, -20, 20); | |
736 | fListHistV0->Add(f2dHistMultiplicityVsVertexZForTrigEvt); | |
737 | } | |
738 | if(! f2dHistMultiplicityVsVertexZ) { | |
739 | f2dHistMultiplicityVsVertexZ = new TH2F("f2dHistMultiplicityVsVertexZ", | |
740 | "Tracks per event", 200, 0, 200, 400, -20, 20); | |
741 | fListHistV0->Add(f2dHistMultiplicityVsVertexZ); | |
742 | } | |
743 | if(! f2dHistMultiplicityVsVertexZNoTPCOnly) { | |
744 | f2dHistMultiplicityVsVertexZNoTPCOnly = new TH2F("f2dHistMultiplicityVsVertexZNoTPCOnly", | |
745 | "Tracks per event", 200, 0, 200, 400, -20, 20); | |
746 | fListHistV0->Add(f2dHistMultiplicityVsVertexZNoTPCOnly); | |
747 | } | |
748 | if(! f2dHistMultiplicityVsVertexZNoTPCOnlyNoPileup) { | |
749 | f2dHistMultiplicityVsVertexZNoTPCOnlyNoPileup = new TH2F("f2dHistMultiplicityVsVertexZNoTPCOnlyNoPileup", | |
750 | "Tracks per event", 200, 0, 200, 400, -20, 20); | |
751 | fListHistV0->Add(f2dHistMultiplicityVsVertexZNoTPCOnlyNoPileup); | |
752 | } | |
753 | ||
754 | //----------------------------------------------------- | |
755 | ||
bcb6ffdb | 756 | if(! fHistPVx) { |
757 | fHistPVx = new TH1F("fHistPVx", | |
758 | "PV x position;Nbr of Evts;x", | |
759 | 2000, -0.5, 0.5); | |
760 | fListHistV0->Add(fHistPVx); | |
761 | } | |
762 | if(! fHistPVy) { | |
763 | fHistPVy = new TH1F("fHistPVy", | |
764 | "PV y position;Nbr of Evts;y", | |
765 | 2000, -0.5, 0.5); | |
766 | fListHistV0->Add(fHistPVy); | |
767 | } | |
768 | if(! fHistPVz) { | |
769 | fHistPVz = new TH1F("fHistPVz", | |
770 | "PV z position;Nbr of Evts;z", | |
771 | 400, -20, 20); | |
772 | fListHistV0->Add(fHistPVz); | |
773 | } | |
774 | if(! fHistPVxAnalysis) { | |
775 | fHistPVxAnalysis = new TH1F("fHistPVxAnalysis", | |
776 | "PV x position;Nbr of Evts;x", | |
777 | 2000, -0.5, 0.5); | |
778 | fListHistV0->Add(fHistPVxAnalysis); | |
779 | } | |
780 | if(! fHistPVyAnalysis) { | |
781 | fHistPVyAnalysis = new TH1F("fHistPVyAnalysis", | |
782 | "PV y position;Nbr of Evts;y", | |
783 | 2000, -0.5, 0.5); | |
784 | fListHistV0->Add(fHistPVyAnalysis); | |
785 | } | |
786 | if(! fHistPVzAnalysis) { | |
787 | fHistPVzAnalysis = new TH1F("fHistPVzAnalysis", | |
788 | "PV z position;Nbr of Evts;z", | |
789 | 400, -20, 20); | |
790 | fListHistV0->Add(fHistPVzAnalysis); | |
791 | } | |
4f8ed367 | 792 | if(! fHistSwappedV0Counter) { |
793 | fHistSwappedV0Counter = new TH1F("fHistSwappedV0Counter", | |
794 | "Swap or not histo;Swapped (1) or not (0); count", | |
795 | 2, 0, 2); | |
796 | fListHistV0->Add(fHistSwappedV0Counter); | |
797 | } | |
74e2345a | 798 | |
bcb6ffdb | 799 | //Regular output: Histograms |
800 | PostData(1, fListHistV0); | |
801 | //TTree Object: Saved to base directory. Should cache to disk while saving. | |
802 | //(Important to avoid excessive memory usage, particularly when merging) | |
803 | PostData(2, fTree); | |
804 | ||
805 | }// end UserCreateOutputObjects | |
806 | ||
807 | ||
808 | //________________________________________________________________________ | |
809 | void AliAnalysisTaskExtractV0::UserExec(Option_t *) | |
810 | { | |
811 | // Main loop | |
812 | // Called for each event | |
4f8ed367 | 813 | //gObjectTable->Print(); |
bcb6ffdb | 814 | AliESDEvent *lESDevent = 0x0; |
0eebce93 | 815 | |
bcb6ffdb | 816 | //AliAODEvent *lAODevent = 0x0; |
817 | Int_t nV0s = -1; | |
818 | ||
819 | Double_t lTrkgPrimaryVtxPos[3] = {-100.0, -100.0, -100.0}; | |
820 | Double_t lBestPrimaryVtxPos[3] = {-100.0, -100.0, -100.0}; | |
821 | Double_t lMagneticField = -10.; | |
822 | ||
823 | // Connect to the InputEvent | |
824 | // After these lines, we should have an ESD/AOD event + the number of cascades in it. | |
825 | ||
826 | // Appropriate for ESD analysis! | |
827 | ||
828 | lESDevent = dynamic_cast<AliESDEvent*>( InputEvent() ); | |
829 | if (!lESDevent) { | |
830 | AliWarning("ERROR: lESDevent not available \n"); | |
831 | return; | |
832 | } | |
f0813b85 | 833 | |
834 | //------------------------------------------------ | |
835 | // Rerun V0 vertexer, if asked for | |
836 | // --- WARNING: Be careful when using in PbPb | |
837 | //------------------------------------------------ | |
838 | if( fkRunV0Vertexer ){ | |
839 | lESDevent->ResetV0s(); | |
840 | AliV0vertexer lV0vtxer; | |
841 | lV0vtxer.SetDefaultCuts(fV0Sels); | |
842 | lV0vtxer.Tracks2V0vertices(lESDevent); | |
843 | } | |
844 | ||
af819bba | 845 | fTreeVariableRunNumber = lESDevent->GetRunNumber(); |
846 | fTreeVariableEventNumber = | |
847 | ( ( ((ULong64_t)lESDevent->GetPeriodNumber() ) << 36 ) | | |
848 | ( ((ULong64_t)lESDevent->GetOrbitNumber () ) << 12 ) | | |
849 | ((ULong64_t)lESDevent->GetBunchCrossNumber() ) ); | |
850 | ||
851 | //REVISED multiplicity estimator after 'multiplicity day' (2011) | |
852 | Int_t lMultiplicity = -100; | |
853 | Int_t lMultiplicityV0A = -100; | |
854 | Int_t lMultiplicityZNA = -100; | |
855 | Int_t lMultiplicityTRK = -100; | |
856 | Int_t lMultiplicitySPD = -100; | |
4f8ed367 | 857 | |
61d295ec | 858 | if(fkIsNuclear == kFALSE) lMultiplicity = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC,fEtaRefMult); |
548bd092 | 859 | |
860 | //---> If this is a nuclear collision, then go nuclear on "multiplicity" variable... | |
861 | //---> Warning: Experimental | |
862 | if(fkIsNuclear == kTRUE){ | |
863 | AliCentrality* centrality; | |
864 | centrality = lESDevent->GetCentrality(); | |
e039e6b3 | 865 | lMultiplicity = ( ( Int_t ) ( centrality->GetCentralityPercentile( fCentralityEstimator.Data() ) ) ); |
d0e77a8c | 866 | lMultiplicityV0A = ( ( Int_t ) ( centrality->GetCentralityPercentile( "V0A" ) ) ); |
867 | lMultiplicityZNA = ( ( Int_t ) ( centrality->GetCentralityPercentile( "ZNA" ) ) ); | |
868 | lMultiplicityTRK = ( ( Int_t ) ( centrality->GetCentralityPercentile( "TRK" ) ) ); | |
f8bc074c | 869 | lMultiplicitySPD = ( ( Int_t ) ( centrality->GetCentralityPercentile( "CL1" ) ) ); |
548bd092 | 870 | if (centrality->GetQuality()>1) { |
871 | PostData(1, fListHistV0); | |
872 | PostData(2, fTree); | |
873 | return; | |
874 | } | |
875 | } | |
4f8ed367 | 876 | |
bcb6ffdb | 877 | //Set variable for filling tree afterwards! |
548bd092 | 878 | //---> pp case......: GetReferenceMultiplicity |
879 | //---> Pb-Pb case...: Centrality by V0M | |
d0e77a8c | 880 | fTreeVariableMultiplicity = lMultiplicity; |
881 | fTreeVariableMultiplicityV0A = lMultiplicityV0A; | |
882 | fTreeVariableMultiplicityZNA = lMultiplicityZNA; | |
883 | fTreeVariableMultiplicityTRK = lMultiplicityTRK; | |
884 | fTreeVariableMultiplicitySPD = lMultiplicitySPD; | |
885 | ||
886 | fHistMultiplicityBeforeTrigSel->Fill ( lMultiplicity ); | |
887 | fHistMultiplicityV0ABeforeTrigSel->Fill ( lMultiplicityV0A ); | |
888 | fHistMultiplicityZNABeforeTrigSel->Fill ( lMultiplicityZNA ); | |
889 | fHistMultiplicityTRKBeforeTrigSel->Fill ( lMultiplicityTRK ); | |
890 | fHistMultiplicitySPDBeforeTrigSel->Fill ( lMultiplicitySPD ); | |
891 | ||
892 | fHistV0MultiplicityBeforeTrigSel->Fill ( lESDevent->GetNumberOfV0s() ); | |
4f8ed367 | 893 | |
bcb6ffdb | 894 | //------------------------------------------------ |
895 | // Physics Selection | |
896 | //------------------------------------------------ | |
c8d4cd4f | 897 | |
898 | // new method | |
899 | UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected(); | |
900 | Bool_t isSelected = 0; | |
901 | Bool_t isSelectedExtra = kTRUE; //extra sel, default YES | |
902 | isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB; | |
903 | ||
b89ea5c6 | 904 | if( fkSkipTrigger == kFALSE ){ |
905 | //pA triggering: CINT7 | |
906 | if( fkSwitchINT7 ) isSelected = (maskIsSelected & AliVEvent::kINT7) == AliVEvent::kINT7; | |
907 | ||
908 | //Extra selection applies if with/without SDD is to be dealth with | |
909 | if( fkFastOnly == "kFastOnly"){ | |
910 | //If not kFastOnly, isSelectedExtra will be kFALSE; procedure will reject it | |
911 | isSelectedExtra = (maskIsSelected & AliVEvent::kFastOnly) == AliVEvent::kFastOnly; | |
912 | } | |
913 | if( fkFastOnly == "NotkFastOnly"){ | |
914 | //If not kFastOnly, isSelectedExtra will be kTRUE; procedure will accept it | |
915 | isSelectedExtra = !( (maskIsSelected & AliVEvent::kFastOnly) == AliVEvent::kFastOnly ); | |
916 | } | |
917 | ||
918 | //Standard Min-Bias Selection | |
919 | if ( !isSelected ) { | |
920 | PostData(1, fListHistV0); | |
921 | PostData(2, fTree); | |
922 | return; | |
923 | } | |
924 | //Check if goes through extra selections | |
925 | //isSelectedExtra will be true in case -> fkFastOnly=="" | |
926 | //isSelectedExtra will be true in case -> fkFastOnly=="kFastOnly" && bit kFastOnly ON | |
927 | //isSelectedExtra will be true in case -> fkFastOnly=="NotkFastOnly" && bit kFastOnly OFF | |
928 | if ( !isSelectedExtra ) { | |
929 | PostData(1, fListHistV0); | |
930 | PostData(2, fTree); | |
931 | return; | |
932 | } | |
c8d4cd4f | 933 | } |
934 | ||
bcb6ffdb | 935 | //------------------------------------------------ |
936 | // After Trigger Selection | |
937 | //------------------------------------------------ | |
938 | ||
939 | nV0s = lESDevent->GetNumberOfV0s(); | |
940 | ||
941 | fHistV0MultiplicityForTrigEvt ->Fill( nV0s ); | |
548bd092 | 942 | fHistMultiplicityForTrigEvt ->Fill( lMultiplicity ); |
d0e77a8c | 943 | fHistMultiplicityV0AForTrigEvt ->Fill( lMultiplicityV0A ); |
944 | fHistMultiplicityZNAForTrigEvt ->Fill( lMultiplicityZNA ); | |
945 | fHistMultiplicityTRKForTrigEvt ->Fill( lMultiplicityTRK ); | |
946 | fHistMultiplicitySPDForTrigEvt ->Fill( lMultiplicitySPD ); | |
947 | ||
bcb6ffdb | 948 | //------------------------------------------------ |
949 | // Getting: Primary Vertex + MagField Info | |
950 | //------------------------------------------------ | |
951 | ||
952 | const AliESDVertex *lPrimaryTrackingESDVtx = lESDevent->GetPrimaryVertexTracks(); | |
953 | // get the vtx stored in ESD found with tracks | |
954 | lPrimaryTrackingESDVtx->GetXYZ( lTrkgPrimaryVtxPos ); | |
955 | ||
956 | const AliESDVertex *lPrimaryBestESDVtx = lESDevent->GetPrimaryVertex(); | |
957 | // get the best primary vertex available for the event | |
958 | // As done in AliCascadeVertexer, we keep the one which is the best one available. | |
959 | // between : Tracking vertex > SPD vertex > TPC vertex > default SPD vertex | |
960 | // This one will be used for next calculations (DCA essentially) | |
961 | lPrimaryBestESDVtx->GetXYZ( lBestPrimaryVtxPos ); | |
962 | ||
963 | Double_t tPrimaryVtxPosition[3]; | |
964 | const AliVVertex *primaryVtx = lESDevent->GetPrimaryVertex(); | |
965 | tPrimaryVtxPosition[0] = primaryVtx->GetX(); | |
966 | tPrimaryVtxPosition[1] = primaryVtx->GetY(); | |
967 | tPrimaryVtxPosition[2] = primaryVtx->GetZ(); | |
968 | fHistPVx->Fill( tPrimaryVtxPosition[0] ); | |
969 | fHistPVy->Fill( tPrimaryVtxPosition[1] ); | |
970 | fHistPVz->Fill( tPrimaryVtxPosition[2] ); | |
971 | ||
1d94e33b | 972 | f2dHistMultiplicityVsVertexZForTrigEvt->Fill( lMultiplicity, tPrimaryVtxPosition[2] ); |
973 | ||
d693307a | 974 | //------------------------------------------------ |
975 | // Primary Vertex Requirements Section: | |
976 | // ---> pp and PbPb: Only requires |z|<10cm | |
977 | // ---> pPb: all requirements checked at this stage | |
978 | //------------------------------------------------ | |
979 | ||
980 | //Roberto's PV selection criteria, implemented 17th April 2013 | |
981 | ||
982 | /* vertex selection */ | |
983 | Bool_t fHasVertex = kFALSE; | |
984 | ||
985 | const AliESDVertex *vertex = lESDevent->GetPrimaryVertexTracks(); | |
986 | if (vertex->GetNContributors() < 1) { | |
987 | vertex = lESDevent->GetPrimaryVertexSPD(); | |
988 | if (vertex->GetNContributors() < 1) fHasVertex = kFALSE; | |
989 | else fHasVertex = kTRUE; | |
990 | TString vtxTyp = vertex->GetTitle(); | |
991 | Double_t cov[6]={0}; | |
992 | vertex->GetCovarianceMatrix(cov); | |
993 | Double_t zRes = TMath::Sqrt(cov[5]); | |
994 | if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE; | |
995 | } | |
996 | else fHasVertex = kTRUE; | |
997 | ||
998 | //Is First event in chunk rejection: Still present! | |
999 | if(fkpAVertexSelection==kTRUE && fHasVertex == kFALSE) { | |
1000 | AliWarning("Pb / | PV does not satisfy selection criteria!"); | |
23518aa7 | 1001 | PostData(1, fListHistV0); |
1002 | PostData(2, fTree); | |
1003 | return; | |
1004 | } | |
d693307a | 1005 | |
1006 | //Is First event in chunk rejection: Still present! | |
23518aa7 | 1007 | if(fkpAVertexSelection==kTRUE && fUtils->IsFirstEventInChunk(lESDevent)) { |
1008 | AliWarning("Pb / | This is the first event in the chunk!"); | |
1009 | PostData(1, fListHistV0); | |
1010 | PostData(2, fTree); | |
1011 | return; | |
1012 | } | |
d693307a | 1013 | |
1014 | //17 April Fix: Always do primary vertex Z selection, after pA vertex selection from Roberto | |
1015 | if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0) { | |
1016 | if( !fkpAVertexSelection ) AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !"); | |
1017 | if( fkpAVertexSelection ) AliWarning("Pb / | pPb case | Z position of Best Prim Vtx | > 10.0 cm ... return !"); | |
23518aa7 | 1018 | PostData(1, fListHistV0); |
1019 | PostData(2, fTree); | |
1020 | return; | |
1021 | } | |
1022 | ||
1023 | f2dHistMultiplicityVsVertexZ->Fill( lMultiplicity, tPrimaryVtxPosition[2] ); | |
1024 | ||
d0e77a8c | 1025 | lMagneticField = lESDevent->GetMagneticField( ); |
1026 | fHistV0MultiplicityForSelEvt ->Fill( nV0s ); | |
1027 | fHistMultiplicity->Fill(lMultiplicity); | |
1028 | fHistMultiplicityV0A->Fill(lMultiplicityV0A); | |
1029 | fHistMultiplicityZNA->Fill(lMultiplicityZNA); | |
1030 | fHistMultiplicityTRK->Fill(lMultiplicityTRK); | |
1031 | fHistMultiplicitySPD->Fill(lMultiplicitySPD); | |
bcb6ffdb | 1032 | |
1033 | //------------------------------------------------ | |
1034 | // Only look at events with well-established PV | |
1035 | //------------------------------------------------ | |
1036 | ||
1037 | const AliESDVertex *lPrimaryTrackingESDVtxCheck = lESDevent->GetPrimaryVertexTracks(); | |
1038 | const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD(); | |
23518aa7 | 1039 | if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtxCheck->GetStatus() && fkpAVertexSelection==kFALSE ){ |
bcb6ffdb | 1040 | AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !"); |
1041 | PostData(1, fListHistV0); | |
1042 | PostData(2, fTree); | |
1043 | return; | |
1044 | } | |
1045 | ||
1d94e33b | 1046 | |
1047 | f2dHistMultiplicityVsVertexZNoTPCOnly->Fill( lMultiplicity, tPrimaryVtxPosition[2] ); | |
d0e77a8c | 1048 | fHistV0MultiplicityForSelEvtNoTPCOnly ->Fill( nV0s ); |
1049 | fHistMultiplicityNoTPCOnly->Fill(lMultiplicity); | |
1050 | fHistMultiplicityV0ANoTPCOnly->Fill(lMultiplicityV0A); | |
1051 | fHistMultiplicityZNANoTPCOnly->Fill(lMultiplicityZNA); | |
1052 | fHistMultiplicityTRKNoTPCOnly->Fill(lMultiplicityTRK); | |
1053 | fHistMultiplicitySPDNoTPCOnly->Fill(lMultiplicitySPD); | |
bcb6ffdb | 1054 | |
1055 | //------------------------------------------------ | |
1056 | // Pileup Rejection | |
1057 | //------------------------------------------------ | |
1058 | ||
1059 | // FIXME : quality selection regarding pile-up rejection | |
fb0d435a | 1060 | if(lESDevent->IsPileupFromSPD() && !fkIsNuclear && fkRejectPileup){// minContributors=3, minZdist=0.8, nSigmaZdist=3., nSigmaDiamXY=2., nSigmaDiamZ=5. -> see http://alisoft.cern.ch/viewvc/trunk/STEER/AliESDEvent.h?root=AliRoot&r1=41914&r2=42199&pathrev=42199 |
bcb6ffdb | 1061 | PostData(1, fListHistV0); |
1062 | PostData(2, fTree); | |
1063 | return; | |
1064 | } | |
1d94e33b | 1065 | |
d0e77a8c | 1066 | f2dHistMultiplicityVsVertexZNoTPCOnlyNoPileup->Fill( lMultiplicity, tPrimaryVtxPosition[2] ); |
1067 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup ->Fill( nV0s ); | |
1068 | fHistMultiplicityNoTPCOnlyNoPileup->Fill(lMultiplicity); | |
1069 | fHistMultiplicityV0ANoTPCOnlyNoPileup->Fill(lMultiplicityV0A); | |
1070 | fHistMultiplicityZNANoTPCOnlyNoPileup->Fill(lMultiplicityZNA); | |
1071 | fHistMultiplicityTRKNoTPCOnlyNoPileup->Fill(lMultiplicityTRK); | |
1072 | fHistMultiplicitySPDNoTPCOnlyNoPileup->Fill(lMultiplicitySPD); | |
bcb6ffdb | 1073 | |
1074 | //------------------------------------------------ | |
1075 | // MAIN LAMBDA LOOP STARTS HERE | |
1076 | //------------------------------------------------ | |
1077 | ||
1078 | if( ! (lESDevent->GetPrimaryVertex()->IsFromVertexerZ() ) ){ | |
1079 | fHistPVxAnalysis->Fill( tPrimaryVtxPosition[0] ); | |
1080 | fHistPVyAnalysis->Fill( tPrimaryVtxPosition[1] ); | |
1081 | fHistPVzAnalysis->Fill( tPrimaryVtxPosition[2] ); | |
1082 | } | |
1083 | ||
653265df | 1084 | fTreeVariablePVx = tPrimaryVtxPosition[0]; |
1085 | fTreeVariablePVy = tPrimaryVtxPosition[1]; | |
1086 | fTreeVariablePVz = tPrimaryVtxPosition[2]; | |
1087 | ||
bcb6ffdb | 1088 | //Variable definition |
1089 | Int_t lOnFlyStatus = 0;// nv0sOn = 0, nv0sOff = 0; | |
1090 | Double_t lChi2V0 = 0; | |
1091 | Double_t lDcaV0Daughters = 0, lDcaV0ToPrimVertex = 0; | |
1092 | Double_t lDcaPosToPrimVertex = 0, lDcaNegToPrimVertex = 0; | |
1093 | Double_t lV0CosineOfPointingAngle = 0; | |
1094 | Double_t lV0Radius = 0, lPt = 0; | |
1095 | Double_t lRapK0Short = 0, lRapLambda = 0; | |
1096 | Double_t lInvMassK0s = 0, lInvMassLambda = 0, lInvMassAntiLambda = 0; | |
1097 | Double_t lAlphaV0 = 0, lPtArmV0 = 0; | |
1098 | ||
1099 | Double_t fMinV0Pt = 0; | |
1100 | Double_t fMaxV0Pt = 100; | |
1101 | ||
1102 | Int_t nv0s = 0; | |
1103 | nv0s = lESDevent->GetNumberOfV0s(); | |
1104 | ||
4f8ed367 | 1105 | //for (Int_t iV0 = 0; iV0 < nv0s; iV0++) |
1106 | for (Int_t iV0 = 0; iV0 < nv0s; iV0++) //extra-crazy test | |
bcb6ffdb | 1107 | {// This is the begining of the V0 loop |
1108 | AliESDv0 *v0 = ((AliESDEvent*)lESDevent)->GetV0(iV0); | |
1109 | if (!v0) continue; | |
4f8ed367 | 1110 | |
1111 | //---> Fix On-the-Fly candidates, count how many swapped | |
1112 | if( v0->GetParamN()->Charge() > 0 && v0->GetParamP()->Charge() < 0 ){ | |
1113 | fHistSwappedV0Counter -> Fill( 1 ); | |
1114 | }else{ | |
1115 | fHistSwappedV0Counter -> Fill( 0 ); | |
1116 | } | |
1117 | if ( fkUseOnTheFly ) CheckChargeV0(v0); | |
1118 | ||
bcb6ffdb | 1119 | Double_t tDecayVertexV0[3]; v0->GetXYZ(tDecayVertexV0[0],tDecayVertexV0[1],tDecayVertexV0[2]); |
57d075b9 | 1120 | |
bcb6ffdb | 1121 | Double_t tV0mom[3]; |
1122 | v0->GetPxPyPz( tV0mom[0],tV0mom[1],tV0mom[2] ); | |
1123 | Double_t lV0TotalMomentum = TMath::Sqrt( | |
1124 | tV0mom[0]*tV0mom[0]+tV0mom[1]*tV0mom[1]+tV0mom[2]*tV0mom[2] ); | |
1125 | ||
1126 | lV0Radius = TMath::Sqrt(tDecayVertexV0[0]*tDecayVertexV0[0]+tDecayVertexV0[1]*tDecayVertexV0[1]); | |
57d075b9 | 1127 | |
1128 | //Set Variables for later filling | |
1129 | fTreeVariableV0x = tDecayVertexV0[0]; | |
1130 | fTreeVariableV0y = tDecayVertexV0[1]; | |
1131 | fTreeVariableV0z = tDecayVertexV0[2]; | |
1132 | ||
1133 | //Set Variables for later filling | |
1134 | fTreeVariableV0Px = tV0mom[0]; | |
1135 | fTreeVariableV0Py = tV0mom[1]; | |
1136 | fTreeVariableV0Pz = tV0mom[2]; | |
1137 | ||
bcb6ffdb | 1138 | lPt = v0->Pt(); |
1139 | lRapK0Short = v0->RapK0Short(); | |
1140 | lRapLambda = v0->RapLambda(); | |
1141 | if ((lPt<fMinV0Pt)||(fMaxV0Pt<lPt)) continue; | |
1142 | ||
1143 | UInt_t lKeyPos = (UInt_t)TMath::Abs(v0->GetPindex()); | |
1144 | UInt_t lKeyNeg = (UInt_t)TMath::Abs(v0->GetNindex()); | |
1145 | ||
1146 | Double_t lMomPos[3]; v0->GetPPxPyPz(lMomPos[0],lMomPos[1],lMomPos[2]); | |
1147 | Double_t lMomNeg[3]; v0->GetNPxPyPz(lMomNeg[0],lMomNeg[1],lMomNeg[2]); | |
1148 | ||
1149 | AliESDtrack *pTrack=((AliESDEvent*)lESDevent)->GetTrack(lKeyPos); | |
1150 | AliESDtrack *nTrack=((AliESDEvent*)lESDevent)->GetTrack(lKeyNeg); | |
1151 | if (!pTrack || !nTrack) { | |
1152 | Printf("ERROR: Could not retreive one of the daughter track"); | |
1153 | continue; | |
1154 | } | |
1155 | ||
1156 | //Daughter Eta for Eta selection, afterwards | |
1157 | fTreeVariableNegEta = nTrack->Eta(); | |
1158 | fTreeVariablePosEta = pTrack->Eta(); | |
1159 | ||
1160 | // Filter like-sign V0 (next: add counter and distribution) | |
1161 | if ( pTrack->GetSign() == nTrack->GetSign()){ | |
1162 | continue; | |
1163 | } | |
1164 | ||
1165 | //________________________________________________________________________ | |
1166 | // Track quality cuts | |
1167 | Float_t lPosTrackCrossedRows = pTrack->GetTPCClusterInfo(2,1); | |
1168 | Float_t lNegTrackCrossedRows = nTrack->GetTPCClusterInfo(2,1); | |
4f8ed367 | 1169 | fTreeVariableLeastNbrCrossedRows = (Int_t) lPosTrackCrossedRows; |
bcb6ffdb | 1170 | if( lNegTrackCrossedRows < fTreeVariableLeastNbrCrossedRows ) |
4f8ed367 | 1171 | fTreeVariableLeastNbrCrossedRows = (Int_t) lNegTrackCrossedRows; |
bcb6ffdb | 1172 | |
1173 | // TPC refit condition (done during reconstruction for Offline but not for On-the-fly) | |
1174 | if( !(pTrack->GetStatus() & AliESDtrack::kTPCrefit)) continue; | |
1175 | if( !(nTrack->GetStatus() & AliESDtrack::kTPCrefit)) continue; | |
3db9b379 | 1176 | |
1177 | //Get status flags | |
1178 | fTreeVariablePosTrackStatus = pTrack->GetStatus(); | |
1179 | fTreeVariableNegTrackStatus = nTrack->GetStatus(); | |
1180 | ||
85b81f83 | 1181 | if ( ( ( ( pTrack->GetTPCClusterInfo(2,1) ) < 70 ) || ( ( nTrack->GetTPCClusterInfo(2,1) ) < 70 ) )&&(fkTakeAllTracks==kFALSE) ) continue; |
bcb6ffdb | 1182 | |
1183 | //GetKinkIndex condition | |
1184 | if( pTrack->GetKinkIndex(0)>0 || nTrack->GetKinkIndex(0)>0 ) continue; | |
1185 | ||
1186 | //Findable clusters > 0 condition | |
1187 | if( pTrack->GetTPCNclsF()<=0 || nTrack->GetTPCNclsF()<=0 ) continue; | |
1188 | ||
1189 | //Compute ratio Crossed Rows / Findable clusters | |
1190 | //Note: above test avoids division by zero! | |
1191 | Float_t lPosTrackCrossedRowsOverFindable = lPosTrackCrossedRows / ((double)(pTrack->GetTPCNclsF())); | |
1192 | Float_t lNegTrackCrossedRowsOverFindable = lNegTrackCrossedRows / ((double)(nTrack->GetTPCNclsF())); | |
1193 | ||
1194 | fTreeVariableLeastRatioCrossedRowsOverFindable = lPosTrackCrossedRowsOverFindable; | |
1195 | if( lNegTrackCrossedRowsOverFindable < fTreeVariableLeastRatioCrossedRowsOverFindable ) | |
1196 | fTreeVariableLeastRatioCrossedRowsOverFindable = lNegTrackCrossedRowsOverFindable; | |
1197 | ||
1198 | //Lowest Cut Level for Ratio Crossed Rows / Findable = 0.8, set here | |
85b81f83 | 1199 | if ( (fTreeVariableLeastRatioCrossedRowsOverFindable < 0.8)&&(fkTakeAllTracks==kFALSE) ) continue; |
bcb6ffdb | 1200 | |
1201 | //End track Quality Cuts | |
1202 | //________________________________________________________________________ | |
1203 | ||
1204 | lDcaPosToPrimVertex = TMath::Abs(pTrack->GetD(tPrimaryVtxPosition[0], | |
1205 | tPrimaryVtxPosition[1], | |
1206 | lMagneticField) ); | |
1207 | ||
1208 | lDcaNegToPrimVertex = TMath::Abs(nTrack->GetD(tPrimaryVtxPosition[0], | |
1209 | tPrimaryVtxPosition[1], | |
1210 | lMagneticField) ); | |
1211 | ||
1212 | lOnFlyStatus = v0->GetOnFlyStatus(); | |
1213 | lChi2V0 = v0->GetChi2V0(); | |
1214 | lDcaV0Daughters = v0->GetDcaV0Daughters(); | |
1215 | lDcaV0ToPrimVertex = v0->GetD(tPrimaryVtxPosition[0],tPrimaryVtxPosition[1],tPrimaryVtxPosition[2]); | |
1216 | lV0CosineOfPointingAngle = v0->GetV0CosineOfPointingAngle(tPrimaryVtxPosition[0],tPrimaryVtxPosition[1],tPrimaryVtxPosition[2]); | |
1217 | fTreeVariableV0CosineOfPointingAngle=lV0CosineOfPointingAngle; | |
1218 | ||
1219 | // Getting invariant mass infos directly from ESD | |
1220 | v0->ChangeMassHypothesis(310); | |
1221 | lInvMassK0s = v0->GetEffMass(); | |
1222 | v0->ChangeMassHypothesis(3122); | |
1223 | lInvMassLambda = v0->GetEffMass(); | |
1224 | v0->ChangeMassHypothesis(-3122); | |
1225 | lInvMassAntiLambda = v0->GetEffMass(); | |
1226 | lAlphaV0 = v0->AlphaV0(); | |
1227 | lPtArmV0 = v0->PtArmV0(); | |
1228 | ||
1229 | fTreeVariablePt = v0->Pt(); | |
1230 | fTreeVariableChi2V0 = lChi2V0; | |
1231 | fTreeVariableDcaV0ToPrimVertex = lDcaV0ToPrimVertex; | |
1232 | fTreeVariableDcaV0Daughters = lDcaV0Daughters; | |
1233 | fTreeVariableV0CosineOfPointingAngle = lV0CosineOfPointingAngle; | |
1234 | fTreeVariableV0Radius = lV0Radius; | |
1235 | fTreeVariableDcaPosToPrimVertex = lDcaPosToPrimVertex; | |
1236 | fTreeVariableDcaNegToPrimVertex = lDcaNegToPrimVertex; | |
1237 | fTreeVariableInvMassK0s = lInvMassK0s; | |
1238 | fTreeVariableInvMassLambda = lInvMassLambda; | |
1239 | fTreeVariableInvMassAntiLambda = lInvMassAntiLambda; | |
1240 | fTreeVariableRapK0Short = lRapK0Short; | |
1241 | fTreeVariableRapLambda = lRapLambda; | |
1242 | fTreeVariableAlphaV0 = lAlphaV0; | |
1243 | fTreeVariablePtArmV0 = lPtArmV0; | |
1244 | ||
1245 | //Official means of acquiring N-sigmas | |
1246 | fTreeVariableNSigmasPosProton = fPIDResponse->NumberOfSigmasTPC( pTrack, AliPID::kProton ); | |
1247 | fTreeVariableNSigmasPosPion = fPIDResponse->NumberOfSigmasTPC( pTrack, AliPID::kPion ); | |
1248 | fTreeVariableNSigmasNegProton = fPIDResponse->NumberOfSigmasTPC( nTrack, AliPID::kProton ); | |
1249 | fTreeVariableNSigmasNegPion = fPIDResponse->NumberOfSigmasTPC( nTrack, AliPID::kPion ); | |
1250 | ||
1251 | //This requires an Invariant Mass Hypothesis afterwards | |
1252 | fTreeVariableDistOverTotMom = TMath::Sqrt( | |
1253 | TMath::Power( tDecayVertexV0[0] - lBestPrimaryVtxPos[0] , 2) + | |
1254 | TMath::Power( tDecayVertexV0[1] - lBestPrimaryVtxPos[1] , 2) + | |
1255 | TMath::Power( tDecayVertexV0[2] - lBestPrimaryVtxPos[2] , 2) | |
1256 | ); | |
1257 | fTreeVariableDistOverTotMom /= (lV0TotalMomentum+1e-10); //avoid division by zero, to be sure | |
1258 | ||
1259 | //------------------------------------------------ | |
1260 | // Fill Tree! | |
1261 | //------------------------------------------------ | |
f897dd0e | 1262 | |
1263 | // The conditionals are meant to decrease excessive | |
1264 | // memory usage! | |
1265 | ||
1266 | //First Selection: Reject OnFly | |
1267 | if( (lOnFlyStatus == 0 && fkUseOnTheFly == kFALSE) || (lOnFlyStatus != 0 && fkUseOnTheFly == kTRUE ) ){ | |
1268 | //Second Selection: rough 20-sigma band, parametric. | |
1269 | //K0Short: Enough to parametrize peak broadening with linear function. | |
1270 | Double_t lUpperLimitK0Short = (5.63707e-01) + (1.14979e-02)*fTreeVariablePt; | |
1271 | Double_t lLowerLimitK0Short = (4.30006e-01) - (1.10029e-02)*fTreeVariablePt; | |
1272 | //Lambda: Linear (for higher pt) plus exponential (for low-pt broadening) | |
1273 | //[0]+[1]*x+[2]*TMath::Exp(-[3]*x) | |
1274 | Double_t lUpperLimitLambda = (1.13688e+00) + (5.27838e-03)*fTreeVariablePt + (8.42220e-02)*TMath::Exp(-(3.80595e+00)*fTreeVariablePt); | |
1275 | Double_t lLowerLimitLambda = (1.09501e+00) - (5.23272e-03)*fTreeVariablePt - (7.52690e-02)*TMath::Exp(-(3.46339e+00)*fTreeVariablePt); | |
1276 | //Do Selection | |
1277 | if( (fTreeVariableInvMassLambda < lUpperLimitLambda && fTreeVariableInvMassLambda > lLowerLimitLambda ) || | |
1278 | (fTreeVariableInvMassAntiLambda < lUpperLimitLambda && fTreeVariableInvMassAntiLambda > lLowerLimitLambda ) || | |
1279 | (fTreeVariableInvMassK0s < lUpperLimitK0Short && fTreeVariableInvMassK0s > lLowerLimitK0Short ) ){ | |
1280 | //Pre-selection in case this is AA... | |
1281 | if( fkIsNuclear == kFALSE ) fTree->Fill(); | |
1282 | if( fkIsNuclear == kTRUE){ | |
1283 | //If this is a nuclear collision___________________ | |
1284 | // ... pre-filter with TPC, daughter eta selection | |
1285 | if( (fTreeVariableInvMassLambda < lUpperLimitLambda && fTreeVariableInvMassLambda > lLowerLimitLambda | |
cf8bc95e | 1286 | && ( fTPCdEdxSelection==kFALSE ||( fTPCdEdxSelection==kTRUE && TMath::Abs(fTreeVariableNSigmasPosProton) < 6.0 && TMath::Abs(fTreeVariableNSigmasNegPion) < 6.0 ) ) ) || |
f897dd0e | 1287 | (fTreeVariableInvMassAntiLambda < lUpperLimitLambda && fTreeVariableInvMassAntiLambda > lLowerLimitLambda |
cf8bc95e | 1288 | && ( fTPCdEdxSelection==kFALSE ||( fTPCdEdxSelection==kTRUE && TMath::Abs(fTreeVariableNSigmasNegProton) < 6.0 && TMath::Abs(fTreeVariableNSigmasPosPion) < 6.0 ) ) ) || |
f897dd0e | 1289 | (fTreeVariableInvMassK0s < lUpperLimitK0Short && fTreeVariableInvMassK0s > lLowerLimitK0Short |
cf8bc95e | 1290 | && ( fTPCdEdxSelection==kFALSE ||( fTPCdEdxSelection==kTRUE && TMath::Abs(fTreeVariableNSigmasNegPion) < 6.0 && TMath::Abs(fTreeVariableNSigmasPosPion) < 6.0 ) ) ) ){ |
f897dd0e | 1291 | //insane test |
cf8bc95e | 1292 | if ( TMath::Abs(fTreeVariableNegEta)<0.8 && TMath::Abs(fTreeVariablePosEta)<0.8) fTree->Fill(); |
f897dd0e | 1293 | } |
1294 | }//end nuclear_____________________________________ | |
1295 | } | |
1296 | } | |
bcb6ffdb | 1297 | |
1298 | //------------------------------------------------ | |
1299 | // Fill tree over. | |
1300 | //------------------------------------------------ | |
1301 | ||
1302 | }// This is the end of the V0 loop | |
1303 | ||
1304 | // Post output data. | |
1305 | PostData(1, fListHistV0); | |
1306 | PostData(2, fTree); | |
4f8ed367 | 1307 | |
1308 | ||
bcb6ffdb | 1309 | } |
1310 | ||
1311 | //________________________________________________________________________ | |
1312 | void AliAnalysisTaskExtractV0::Terminate(Option_t *) | |
1313 | { | |
1314 | // Draw result to the screen | |
1315 | // Called once at the end of the query | |
1316 | // This will draw the V0 candidate multiplicity, whose | |
1317 | // number of entries corresponds to the number of triggered events. | |
1318 | TList *cRetrievedList = 0x0; | |
1319 | cRetrievedList = (TList*)GetOutputData(1); | |
1320 | if(!cRetrievedList){ | |
1321 | Printf("ERROR - AliAnalysisTaskExtractV0 : ouput data container list not available\n"); | |
1322 | return; | |
1323 | } | |
1324 | fHistV0MultiplicityForTrigEvt = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0MultiplicityForTrigEvt") ); | |
1325 | if (!fHistV0MultiplicityForTrigEvt) { | |
1326 | Printf("ERROR - AliAnalysisTaskExtractV0 : fHistV0MultiplicityForTrigEvt not available"); | |
1327 | return; | |
1328 | } | |
1329 | TCanvas *canCheck = new TCanvas("AliAnalysisTaskExtractV0","V0 Multiplicity",10,10,510,510); | |
1330 | canCheck->cd(1)->SetLogy(); | |
1331 | fHistV0MultiplicityForTrigEvt->SetMarkerStyle(22); | |
1332 | fHistV0MultiplicityForTrigEvt->DrawCopy("E"); | |
1333 | } | |
1334 | ||
4f8ed367 | 1335 | //________________________________________________________________________ |
1336 | void AliAnalysisTaskExtractV0::CheckChargeV0(AliESDv0 *v0) | |
1337 | { | |
1338 | // This function checks charge of negative and positive daughter tracks. | |
1339 | // If incorrectly defined (onfly vertexer), swaps out. | |
1340 | if( v0->GetParamN()->Charge() > 0 && v0->GetParamP()->Charge() < 0 ){ | |
1341 | //V0 daughter track swapping is required! Note: everything is swapped here... P->N, N->P | |
1342 | Long_t lCorrectNidx = v0->GetPindex(); | |
1343 | Long_t lCorrectPidx = v0->GetNindex(); | |
1344 | Double32_t lCorrectNmom[3]; | |
1345 | Double32_t lCorrectPmom[3]; | |
1346 | v0->GetPPxPyPz( lCorrectNmom[0], lCorrectNmom[1], lCorrectNmom[2] ); | |
1347 | v0->GetNPxPyPz( lCorrectPmom[0], lCorrectPmom[1], lCorrectPmom[2] ); | |
1348 | ||
1349 | AliExternalTrackParam lCorrectParamN( | |
1350 | v0->GetParamP()->GetX() , | |
1351 | v0->GetParamP()->GetAlpha() , | |
1352 | v0->GetParamP()->GetParameter() , | |
1353 | v0->GetParamP()->GetCovariance() | |
1354 | ); | |
1355 | AliExternalTrackParam lCorrectParamP( | |
1356 | v0->GetParamN()->GetX() , | |
1357 | v0->GetParamN()->GetAlpha() , | |
1358 | v0->GetParamN()->GetParameter() , | |
1359 | v0->GetParamN()->GetCovariance() | |
1360 | ); | |
1361 | lCorrectParamN.SetMostProbablePt( v0->GetParamP()->GetMostProbablePt() ); | |
1362 | lCorrectParamP.SetMostProbablePt( v0->GetParamN()->GetMostProbablePt() ); | |
1363 | ||
1364 | //Get Variables___________________________________________________ | |
1365 | Double_t lDcaV0Daughters = v0 -> GetDcaV0Daughters(); | |
1366 | Double_t lCosPALocal = v0 -> GetV0CosineOfPointingAngle(); | |
1367 | Bool_t lOnFlyStatusLocal = v0 -> GetOnFlyStatus(); | |
1368 | ||
1369 | //Create Replacement Object_______________________________________ | |
1370 | AliESDv0 *v0correct = new AliESDv0(lCorrectParamN,lCorrectNidx,lCorrectParamP,lCorrectPidx); | |
1371 | v0correct->SetDcaV0Daughters ( lDcaV0Daughters ); | |
1372 | v0correct->SetV0CosineOfPointingAngle ( lCosPALocal ); | |
1373 | v0correct->ChangeMassHypothesis ( kK0Short ); | |
1374 | v0correct->SetOnFlyStatus ( lOnFlyStatusLocal ); | |
1375 | ||
1376 | //Reverse Cluster info..._________________________________________ | |
1377 | v0correct->SetClusters( v0->GetClusters( 1 ), v0->GetClusters ( 0 ) ); | |
1378 | ||
1379 | *v0 = *v0correct; | |
1380 | //Proper cleanup..._______________________________________________ | |
1381 | v0correct->Delete(); | |
1382 | v0correct = 0x0; | |
1383 | ||
1384 | //Just another cross-check and output_____________________________ | |
1385 | if( v0->GetParamN()->Charge() > 0 && v0->GetParamP()->Charge() < 0 ) { | |
1386 | AliWarning("Found Swapped Charges, tried to correct but something FAILED!"); | |
1387 | }else{ | |
1388 | //AliWarning("Found Swapped Charges and fixed."); | |
1389 | } | |
1390 | //________________________________________________________________ | |
1391 | }else{ | |
1392 | //Don't touch it! --- | |
1393 | //Printf("Ah, nice. Charges are already ordered..."); | |
1394 | } | |
1395 | return; | |
1396 | } |