]>
Commit | Line | Data |
---|---|---|
af0d4791 | 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 | // This task is meant to explore the possibility of using a VZERO amplitude | |
19 | // based multiplicity estimator for proton-proton collisions. For this, two | |
20 | // main operation methods for this task are foreseen: | |
21 | // | |
22 | // 1) (under development) it should act as an auxiliary task and provide a | |
23 | // calibrated estimator | |
24 | // | |
25 | // 2) "Debug mode" which will also create a ROOT TTree object with event | |
26 | // by event info potentially used for exploration / calibration. This | |
27 | // includes the following info: | |
28 | // | |
29 | // --- All VZERO Amplitudes (saved as Float_t) | |
30 | // --- (optional) time for each channel | |
31 | // --- (optional) time width for each channel | |
32 | // --- GetReferenceMultiplicity Estimator, |eta|<0.5 | |
33 | // --- GetReferenceMultiplicity Estimator, |eta|<0.8 | |
34 | // --- (if MC) True Multiplicity, |eta|<0.5 | |
35 | // --- (if MC) True Multiplicity, 2.8 < eta < 5.8 (VZEROA region) | |
36 | // --- (if MC) True Multiplicity, -3.7 < eta <-1.7 (VZEROC region) | |
37 | // --- Run Number | |
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 "TFile.h" | |
60 | #include "THnSparse.h" | |
61 | #include "TVector3.h" | |
62 | #include "TCanvas.h" | |
63 | #include "TMath.h" | |
64 | #include "TLegend.h" | |
65 | //#include "AliLog.h" | |
66 | ||
67 | #include "AliESDEvent.h" | |
68 | #include "AliAODEvent.h" | |
69 | #include "AliV0vertexer.h" | |
70 | #include "AliCascadeVertexer.h" | |
71 | #include "AliESDpid.h" | |
72 | #include "AliESDtrack.h" | |
73 | #include "AliESDtrackCuts.h" | |
74 | #include "AliInputEventHandler.h" | |
75 | #include "AliAnalysisManager.h" | |
76 | #include "AliMCEventHandler.h" | |
77 | #include "AliMCEvent.h" | |
78 | #include "AliStack.h" | |
79 | #include "AliCentrality.h" | |
80 | ||
81 | #include "AliCFContainer.h" | |
82 | #include "AliMultiplicity.h" | |
83 | #include "AliAODMCParticle.h" | |
84 | #include "AliESDcascade.h" | |
85 | #include "AliAODcascade.h" | |
86 | #include "AliESDUtils.h" | |
87 | #include "AliGenEventHeader.h" | |
88 | #include "AliAnalysisTaskSE.h" | |
89 | #include "AliAnalysisUtils.h" | |
90 | #include "AliAnalysisTaskStrangenessVsMultiplicity.h" | |
91 | ||
92 | using std::cout; | |
93 | using std::endl; | |
94 | ||
95 | ClassImp(AliAnalysisTaskStrangenessVsMultiplicity) | |
96 | ||
97 | AliAnalysisTaskStrangenessVsMultiplicity::AliAnalysisTaskStrangenessVsMultiplicity() | |
98 | : AliAnalysisTaskSE(), fListHist(0), fTreeEvent(0), fTreeV0(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), | |
99 | fkSaveV0Tree ( kFALSE ), | |
100 | fkSaveCascadeTree ( kTRUE ), | |
101 | fkRunVertexers ( kTRUE ), | |
758b26b0 | 102 | fkSkipEventSelection( kFALSE ), |
af0d4791 | 103 | //---> Variables for fTreeEvent |
104 | fAmplitude_V0A (0), | |
105 | fAmplitude_V0C (0), | |
106 | fAmplitude_V0AEq (0), | |
107 | fAmplitude_V0CEq (0), | |
108 | fCentrality_V0A(0), | |
109 | fCentrality_V0C(0), | |
110 | fCentrality_V0M(0), | |
111 | fCentrality_V0AEq(0), | |
112 | fCentrality_V0CEq(0), | |
113 | fCentrality_V0MEq(0), | |
114 | fRefMultEta5(0), | |
115 | fRefMultEta8(0), | |
116 | fRunNumber(0), | |
47529a6d | 117 | fEvSel_HasAtLeastSPDVertex(0), |
118 | fEvSel_VtxZCut(0), | |
119 | fEvSel_IsNotPileup(0), | |
120 | fEvSel_IsNotPileupInMultBins(0), | |
121 | fEvSel_HasVtxContributor(0), | |
122 | fEvSel_nTracklets(0), | |
123 | fEvSel_nSPDClusters(0), | |
124 | ||
161c57ac | 125 | //---> Variables for fTreeV0 |
126 | fTreeVariableChi2V0(0), | |
127 | fTreeVariableDcaV0Daughters(0), | |
128 | fTreeVariableDcaV0ToPrimVertex(0), | |
129 | fTreeVariableDcaPosToPrimVertex(0), | |
130 | fTreeVariableDcaNegToPrimVertex(0), | |
131 | fTreeVariableV0CosineOfPointingAngle(0), | |
132 | fTreeVariableV0Radius(0), | |
133 | fTreeVariablePt(0), | |
134 | fTreeVariableRapK0Short(0), | |
135 | fTreeVariableRapLambda(0), | |
136 | fTreeVariableInvMassK0s(0), | |
137 | fTreeVariableInvMassLambda(0), | |
138 | fTreeVariableInvMassAntiLambda(0), | |
139 | fTreeVariableAlphaV0(0), | |
140 | fTreeVariablePtArmV0(0), | |
141 | fTreeVariableNegEta(0), | |
142 | fTreeVariablePosEta(0), | |
143 | ||
144 | fTreeVariableNSigmasPosProton(0), | |
145 | fTreeVariableNSigmasPosPion(0), | |
146 | fTreeVariableNSigmasNegProton(0), | |
147 | fTreeVariableNSigmasNegPion(0), | |
148 | ||
149 | fTreeVariableDistOverTotMom(0), | |
150 | fTreeVariableLeastNbrCrossedRows(0), | |
151 | fTreeVariableLeastRatioCrossedRowsOverFindable(0), | |
152 | ||
153 | fTreeVariableCentV0A(0), | |
154 | fTreeVariableCentV0C(0), | |
155 | fTreeVariableCentV0M(0), | |
156 | fTreeVariableCentV0AEq(0), | |
157 | fTreeVariableCentV0CEq(0), | |
158 | fTreeVariableCentV0MEq(0), | |
159 | fTreeVariableAmpV0A(0), | |
160 | fTreeVariableAmpV0C(0), | |
161 | fTreeVariableAmpV0AEq(0), | |
162 | fTreeVariableAmpV0CEq(0), | |
163 | fTreeVariableRefMultEta8(0), | |
164 | fTreeVariableRefMultEta5(0), | |
165 | fTreeVariableRunNumber(0), | |
af0d4791 | 166 | //---> Variables for fTreeCascade |
167 | fTreeCascVarCharge(0), | |
168 | fTreeCascVarMassAsXi(0), | |
169 | fTreeCascVarMassAsOmega(0), | |
170 | fTreeCascVarPt(0), | |
171 | fTreeCascVarRapXi(0), | |
172 | fTreeCascVarRapOmega(0), | |
173 | fTreeCascVarNegEta(0), | |
174 | fTreeCascVarPosEta(0), | |
175 | fTreeCascVarBachEta(0), | |
176 | fTreeCascVarDCACascDaughters(0), | |
177 | fTreeCascVarDCABachToPrimVtx(0), | |
178 | fTreeCascVarDCAV0Daughters(0), | |
179 | fTreeCascVarDCAV0ToPrimVtx(0), | |
180 | fTreeCascVarDCAPosToPrimVtx(0), | |
181 | fTreeCascVarDCANegToPrimVtx(0), | |
182 | fTreeCascVarCascCosPointingAngle(0), | |
183 | fTreeCascVarCascRadius(0), | |
184 | fTreeCascVarV0Mass(0), | |
185 | fTreeCascVarV0CosPointingAngle(0), | |
186 | fTreeCascVarV0CosPointingAngleSpecial(0), | |
187 | fTreeCascVarV0Radius(0), | |
188 | fTreeCascVarLeastNbrClusters(0), | |
189 | fTreeCascVarDistOverTotMom(0), | |
190 | fTreeCascVarNegNSigmaPion(0), | |
191 | fTreeCascVarNegNSigmaProton(0), | |
192 | fTreeCascVarPosNSigmaPion(0), | |
193 | fTreeCascVarPosNSigmaProton(0), | |
194 | fTreeCascVarBachNSigmaPion(0), | |
195 | fTreeCascVarBachNSigmaKaon(0), | |
196 | fTreeCascVarCentV0A(0), | |
197 | fTreeCascVarCentV0C(0), | |
198 | fTreeCascVarCentV0M(0), | |
199 | fTreeCascVarCentV0AEq(0), | |
200 | fTreeCascVarCentV0CEq(0), | |
201 | fTreeCascVarCentV0MEq(0), | |
202 | fTreeCascVarAmpV0A(0), | |
203 | fTreeCascVarAmpV0C(0), | |
204 | fTreeCascVarAmpV0AEq(0), | |
205 | fTreeCascVarAmpV0CEq(0), | |
206 | fTreeCascVarRefMultEta8(0), | |
207 | fTreeCascVarRefMultEta5(0), | |
26d39641 | 208 | fTreeCascVarRunNumber(0), |
af0d4791 | 209 | //Histos |
210 | fHistEventCounter(0) | |
211 | //------------------------------------------------ | |
212 | // Tree Variables | |
213 | { | |
214 | ||
215 | } | |
216 | ||
217 | AliAnalysisTaskStrangenessVsMultiplicity::AliAnalysisTaskStrangenessVsMultiplicity(const char *name) | |
218 | : AliAnalysisTaskSE(name), fListHist(0), fTreeEvent(0), fTreeV0(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), | |
219 | fkSaveV0Tree ( kFALSE ), | |
220 | fkSaveCascadeTree ( kTRUE ), | |
221 | fkRunVertexers ( kTRUE ), | |
758b26b0 | 222 | fkSkipEventSelection( kFALSE ), |
af0d4791 | 223 | //---> Variables for fTreeEvent |
224 | fAmplitude_V0A (0), | |
225 | fAmplitude_V0C (0), | |
226 | fAmplitude_V0AEq (0), | |
227 | fAmplitude_V0CEq (0), | |
228 | fCentrality_V0A(0), | |
229 | fCentrality_V0C(0), | |
230 | fCentrality_V0M(0), | |
231 | fCentrality_V0AEq(0), | |
232 | fCentrality_V0CEq(0), | |
233 | fCentrality_V0MEq(0), | |
234 | fRefMultEta5(0), | |
235 | fRefMultEta8(0), | |
236 | fRunNumber(0), | |
47529a6d | 237 | fEvSel_HasAtLeastSPDVertex(0), |
238 | fEvSel_VtxZCut(0), | |
239 | fEvSel_IsNotPileup(0), | |
240 | fEvSel_IsNotPileupInMultBins(0), | |
241 | fEvSel_HasVtxContributor(0), | |
242 | fEvSel_nTracklets(0), | |
243 | fEvSel_nSPDClusters(0), | |
244 | ||
161c57ac | 245 | //---> Variables for fTreeV0 |
246 | fTreeVariableChi2V0(0), | |
247 | fTreeVariableDcaV0Daughters(0), | |
248 | fTreeVariableDcaV0ToPrimVertex(0), | |
249 | fTreeVariableDcaPosToPrimVertex(0), | |
250 | fTreeVariableDcaNegToPrimVertex(0), | |
251 | fTreeVariableV0CosineOfPointingAngle(0), | |
252 | fTreeVariableV0Radius(0), | |
253 | fTreeVariablePt(0), | |
254 | fTreeVariableRapK0Short(0), | |
255 | fTreeVariableRapLambda(0), | |
256 | fTreeVariableInvMassK0s(0), | |
257 | fTreeVariableInvMassLambda(0), | |
258 | fTreeVariableInvMassAntiLambda(0), | |
259 | fTreeVariableAlphaV0(0), | |
260 | fTreeVariablePtArmV0(0), | |
261 | fTreeVariableNegEta(0), | |
262 | fTreeVariablePosEta(0), | |
263 | ||
264 | fTreeVariableNSigmasPosProton(0), | |
265 | fTreeVariableNSigmasPosPion(0), | |
266 | fTreeVariableNSigmasNegProton(0), | |
267 | fTreeVariableNSigmasNegPion(0), | |
268 | ||
269 | fTreeVariableDistOverTotMom(0), | |
270 | fTreeVariableLeastNbrCrossedRows(0), | |
271 | fTreeVariableLeastRatioCrossedRowsOverFindable(0), | |
272 | ||
273 | fTreeVariableCentV0A(0), | |
274 | fTreeVariableCentV0C(0), | |
275 | fTreeVariableCentV0M(0), | |
276 | fTreeVariableCentV0AEq(0), | |
277 | fTreeVariableCentV0CEq(0), | |
278 | fTreeVariableCentV0MEq(0), | |
279 | fTreeVariableAmpV0A(0), | |
280 | fTreeVariableAmpV0C(0), | |
281 | fTreeVariableAmpV0AEq(0), | |
282 | fTreeVariableAmpV0CEq(0), | |
283 | fTreeVariableRefMultEta8(0), | |
284 | fTreeVariableRefMultEta5(0), | |
285 | fTreeVariableRunNumber(0), | |
af0d4791 | 286 | //---> Variables for fTreeCascade |
287 | fTreeCascVarCharge(0), | |
288 | fTreeCascVarMassAsXi(0), | |
289 | fTreeCascVarMassAsOmega(0), | |
290 | fTreeCascVarPt(0), | |
291 | fTreeCascVarRapXi(0), | |
292 | fTreeCascVarRapOmega(0), | |
293 | fTreeCascVarNegEta(0), | |
294 | fTreeCascVarPosEta(0), | |
295 | fTreeCascVarBachEta(0), | |
296 | fTreeCascVarDCACascDaughters(0), | |
297 | fTreeCascVarDCABachToPrimVtx(0), | |
298 | fTreeCascVarDCAV0Daughters(0), | |
299 | fTreeCascVarDCAV0ToPrimVtx(0), | |
300 | fTreeCascVarDCAPosToPrimVtx(0), | |
301 | fTreeCascVarDCANegToPrimVtx(0), | |
302 | fTreeCascVarCascCosPointingAngle(0), | |
303 | fTreeCascVarCascRadius(0), | |
304 | fTreeCascVarV0Mass(0), | |
305 | fTreeCascVarV0CosPointingAngle(0), | |
306 | fTreeCascVarV0CosPointingAngleSpecial(0), | |
307 | fTreeCascVarV0Radius(0), | |
308 | fTreeCascVarLeastNbrClusters(0), | |
309 | fTreeCascVarDistOverTotMom(0), | |
310 | fTreeCascVarNegNSigmaPion(0), | |
311 | fTreeCascVarNegNSigmaProton(0), | |
312 | fTreeCascVarPosNSigmaPion(0), | |
313 | fTreeCascVarPosNSigmaProton(0), | |
314 | fTreeCascVarBachNSigmaPion(0), | |
315 | fTreeCascVarBachNSigmaKaon(0), | |
316 | fTreeCascVarCentV0A(0), | |
317 | fTreeCascVarCentV0C(0), | |
318 | fTreeCascVarCentV0M(0), | |
319 | fTreeCascVarCentV0AEq(0), | |
320 | fTreeCascVarCentV0CEq(0), | |
321 | fTreeCascVarCentV0MEq(0), | |
322 | fTreeCascVarAmpV0A(0), | |
323 | fTreeCascVarAmpV0C(0), | |
324 | fTreeCascVarAmpV0AEq(0), | |
325 | fTreeCascVarAmpV0CEq(0), | |
326 | fTreeCascVarRefMultEta8(0), | |
327 | fTreeCascVarRefMultEta5(0), | |
26d39641 | 328 | fTreeCascVarRunNumber(0), |
af0d4791 | 329 | //Histos |
330 | fHistEventCounter(0) | |
331 | { | |
332 | ||
333 | //Re-vertex: Will only apply for cascade candidates | |
334 | ||
335 | fV0VertexerSels[0] = 33. ; // max allowed chi2 | |
336 | fV0VertexerSels[1] = 0.02; // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05) | |
337 | fV0VertexerSels[2] = 0.02; // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05) | |
338 | fV0VertexerSels[4] = 0.95; // min allowed cosine of V0's pointing angle (LHC09a4 : 0.99) | |
339 | fV0VertexerSels[5] = 1.0 ; // min radius of the fiducial volume (LHC09a4 : 0.2) | |
340 | fV0VertexerSels[6] = 200. ; // max radius of the fiducial volume (LHC09a4 : 100.0) | |
341 | ||
342 | fCascadeVertexerSels[0] = 33. ; // max allowed chi2 (same as PDC07) | |
343 | fCascadeVertexerSels[1] = 0.05 ; // min allowed V0 impact parameter (PDC07 : 0.05 / LHC09a4 : 0.025 ) | |
344 | fCascadeVertexerSels[2] = 0.010; // "window" around the Lambda mass (PDC07 : 0.008 / LHC09a4 : 0.010 ) | |
345 | fCascadeVertexerSels[3] = 0.03 ; // min allowed bachelor's impact parameter (PDC07 : 0.035 / LHC09a4 : 0.025 ) | |
346 | fCascadeVertexerSels[4] = 2.0 ; // max allowed DCA between the V0 and the bachelor (PDC07 : 0.1 / LHC09a4 : 0.2 ) | |
347 | fCascadeVertexerSels[5] = 0.95 ; // min allowed cosine of the cascade pointing angle (PDC07 : 0.9985 / LHC09a4 : 0.998 ) | |
348 | fCascadeVertexerSels[6] = 0.4 ; // min radius of the fiducial volume (PDC07 : 0.9 / LHC09a4 : 0.2 ) | |
349 | fCascadeVertexerSels[7] = 100. ; // max radius of the fiducial volume (PDC07 : 100 / LHC09a4 : 100 ) | |
350 | ||
351 | ||
352 | DefineOutput(1, TList::Class()); // Event Counter Histo | |
353 | DefineOutput(2, TTree::Class()); // Event Tree | |
354 | DefineOutput(3, TTree::Class()); // V0 Tree | |
355 | DefineOutput(4, TTree::Class()); // Cascade Tree | |
356 | } | |
357 | ||
358 | ||
359 | AliAnalysisTaskStrangenessVsMultiplicity::~AliAnalysisTaskStrangenessVsMultiplicity() | |
360 | { | |
361 | //------------------------------------------------ | |
362 | // DESTRUCTOR | |
363 | //------------------------------------------------ | |
364 | ||
365 | if (fListHist){ | |
366 | delete fListHist; | |
367 | fListHist = 0x0; | |
368 | } | |
369 | if (fTreeEvent){ | |
370 | delete fTreeEvent; | |
371 | fTreeEvent = 0x0; | |
372 | } | |
373 | if (fTreeV0){ | |
374 | delete fTreeV0; | |
375 | fTreeV0 = 0x0; | |
376 | } | |
377 | if (fTreeCascade){ | |
378 | delete fTreeCascade; | |
379 | fTreeCascade = 0x0; | |
380 | } | |
381 | } | |
382 | ||
383 | //________________________________________________________________________ | |
384 | void AliAnalysisTaskStrangenessVsMultiplicity::UserCreateOutputObjects() | |
385 | { | |
386 | ||
387 | OpenFile(2); | |
388 | // Called once | |
389 | ||
390 | //------------------------------------------------ | |
391 | ||
392 | fTreeEvent = new TTree("fTreeEvent","Event"); | |
393 | ||
394 | //------------------------------------------------ | |
395 | // fTree Branch definitions - Event by Event info | |
396 | //------------------------------------------------ | |
397 | ||
398 | //-----------BASIC-INFO--------------------------- | |
399 | ||
400 | //--- VZERO Data (Integrated) | |
401 | fTreeEvent->Branch("fAmplitude_V0A",&fAmplitude_V0A,"fAmplitude_V0A/F"); | |
402 | fTreeEvent->Branch("fAmplitude_V0C",&fAmplitude_V0C,"fAmplitude_V0C/F"); | |
403 | fTreeEvent->Branch("fAmplitude_V0AEq",&fAmplitude_V0AEq,"fAmplitude_V0AEq/F"); | |
404 | fTreeEvent->Branch("fAmplitude_V0CEq",&fAmplitude_V0CEq,"fAmplitude_V0CEq/F"); | |
405 | ||
406 | //Info from AliCentrality (not necessarily 'centrality' per se) | |
407 | fTreeEvent->Branch("fCentrality_V0A",&fCentrality_V0A,"fCentrality_V0A/F"); | |
408 | fTreeEvent->Branch("fCentrality_V0C",&fCentrality_V0C,"fCentrality_V0C/F"); | |
34442f2a | 409 | fTreeEvent->Branch("fCentrality_V0M",&fCentrality_V0M,"fCentrality_V0M/F"); |
af0d4791 | 410 | fTreeEvent->Branch("fCentrality_V0AEq",&fCentrality_V0AEq,"fCentrality_V0AEq/F"); |
411 | fTreeEvent->Branch("fCentrality_V0CEq",&fCentrality_V0CEq,"fCentrality_V0CEq/F"); | |
34442f2a | 412 | fTreeEvent->Branch("fCentrality_V0MEq",&fCentrality_V0MEq,"fCentrality_V0MEq/F"); |
af0d4791 | 413 | |
414 | //Official GetReferenceMultiplicity | |
415 | fTreeEvent->Branch("fRefMultEta5",&fRefMultEta5,"fRefMultEta5/I"); | |
416 | fTreeEvent->Branch("fRefMultEta8",&fRefMultEta8,"fRefMultEta8/I"); | |
417 | ||
418 | //Run Number | |
419 | fTreeEvent->Branch("fRunNumber", &fRunNumber, "fRunNumber/I"); | |
420 | ||
47529a6d | 421 | //Booleans for Event Selection |
422 | fTreeEvent->Branch("fEvSel_HasAtLeastSPDVertex", &fEvSel_HasAtLeastSPDVertex, "fEvSel_HasAtLeastSPDVertex/O"); | |
423 | fTreeEvent->Branch("fEvSel_VtxZCut", &fEvSel_VtxZCut, "fEvSel_VtxZCut/O"); | |
424 | fTreeEvent->Branch("fEvSel_IsNotPileup", &fEvSel_IsNotPileup, "fEvSel_IsNotPileup/O"); | |
425 | fTreeEvent->Branch("fEvSel_IsNotPileupInMultBins", &fEvSel_IsNotPileupInMultBins, "fEvSel_IsNotPileupInMultBins/O"); | |
426 | fTreeEvent->Branch("fEvSel_HasVtxContributor", &fEvSel_HasVtxContributor, "fEvSel_HasVtxContributor/O"); | |
427 | ||
428 | //Tracklets vs clusters test | |
429 | fTreeEvent->Branch("fEvSel_nTracklets", &fEvSel_nTracklets, "fEvSel_nTracklets/I"); | |
430 | fTreeEvent->Branch("fEvSel_nSPDClusters", &fEvSel_nSPDClusters, "fEvSel_nSPDClusters/I"); | |
431 | ||
af0d4791 | 432 | //Create Basic V0 Output Tree |
433 | fTreeV0 = new TTree( "fTreeV0", "V0 Candidates"); | |
434 | ||
161c57ac | 435 | //------------------------------------------------ |
436 | // fTreeV0 Branch definitions | |
437 | //------------------------------------------------ | |
438 | ||
439 | //-----------BASIC-INFO--------------------------- | |
440 | fTreeV0->Branch("fTreeVariableChi2V0",&fTreeVariableChi2V0,"fTreeVariableChi2V0/F"); | |
441 | fTreeV0->Branch("fTreeVariableDcaV0Daughters",&fTreeVariableDcaV0Daughters,"fTreeVariableDcaV0Daughters/F"); | |
442 | fTreeV0->Branch("fTreeVariableDcaV0ToPrimVertex",&fTreeVariableDcaV0ToPrimVertex,"fTreeVariableDcaV0ToPrimVertex/F"); | |
443 | fTreeV0->Branch("fTreeVariableDcaPosToPrimVertex",&fTreeVariableDcaPosToPrimVertex,"fTreeVariableDcaPosToPrimVertex/F"); | |
444 | fTreeV0->Branch("fTreeVariableDcaNegToPrimVertex",&fTreeVariableDcaNegToPrimVertex,"fTreeVariableDcaNegToPrimVertex/F"); | |
445 | fTreeV0->Branch("fTreeVariableV0Radius",&fTreeVariableV0Radius,"fTreeVariableV0Radius/F"); | |
446 | fTreeV0->Branch("fTreeVariablePt",&fTreeVariablePt,"fTreeVariablePt/F"); | |
447 | fTreeV0->Branch("fTreeVariableRapK0Short",&fTreeVariableRapK0Short,"fTreeVariableRapK0Short/F"); | |
448 | fTreeV0->Branch("fTreeVariableRapLambda",&fTreeVariableRapLambda,"fTreeVariableRapLambda/F"); | |
449 | fTreeV0->Branch("fTreeVariableInvMassK0s",&fTreeVariableInvMassK0s,"fTreeVariableInvMassK0s/F"); | |
450 | fTreeV0->Branch("fTreeVariableInvMassLambda",&fTreeVariableInvMassLambda,"fTreeVariableInvMassLambda/F"); | |
451 | fTreeV0->Branch("fTreeVariableInvMassAntiLambda",&fTreeVariableInvMassAntiLambda,"fTreeVariableInvMassAntiLambda/F"); | |
452 | fTreeV0->Branch("fTreeVariableV0CosineOfPointingAngle",&fTreeVariableV0CosineOfPointingAngle,"fTreeVariableV0CosineOfPointingAngle/F"); | |
453 | fTreeV0->Branch("fTreeVariableAlphaV0",&fTreeVariableAlphaV0,"fTreeVariableAlphaV0/F"); | |
454 | fTreeV0->Branch("fTreeVariablePtArmV0",&fTreeVariablePtArmV0,"fTreeVariablePtArmV0/F"); | |
455 | fTreeV0->Branch("fTreeVariableLeastNbrCrossedRows",&fTreeVariableLeastNbrCrossedRows,"fTreeVariableLeastNbrCrossedRows/I"); | |
456 | fTreeV0->Branch("fTreeVariableLeastRatioCrossedRowsOverFindable",&fTreeVariableLeastRatioCrossedRowsOverFindable,"fTreeVariableLeastRatioCrossedRowsOverFindable/F"); | |
457 | fTreeV0->Branch("fTreeVariableDistOverTotMom",&fTreeVariableDistOverTotMom,"fTreeVariableDistOverTotMom/F"); | |
458 | fTreeV0->Branch("fTreeVariableNSigmasPosProton",&fTreeVariableNSigmasPosProton,"fTreeVariableNSigmasPosProton/F"); | |
459 | fTreeV0->Branch("fTreeVariableNSigmasPosPion",&fTreeVariableNSigmasPosPion,"fTreeVariableNSigmasPosPion/F"); | |
460 | fTreeV0->Branch("fTreeVariableNSigmasNegProton",&fTreeVariableNSigmasNegProton,"fTreeVariableNSigmasNegProton/F"); | |
461 | fTreeV0->Branch("fTreeVariableNSigmasNegPion",&fTreeVariableNSigmasNegPion,"fTreeVariableNSigmasNegPion/F"); | |
462 | fTreeV0->Branch("fTreeVariableNegEta",&fTreeVariableNegEta,"fTreeVariableNegEta/F"); | |
463 | fTreeV0->Branch("fTreeVariablePosEta",&fTreeVariablePosEta,"fTreeVariablePosEta/F"); | |
464 | //-----------MULTIPLICITY-INFO-------------------- | |
465 | fTreeV0->Branch("fTreeVariableCentV0A",&fTreeVariableCentV0A,"fTreeVariableCentV0A/F"); | |
466 | fTreeV0->Branch("fTreeVariableCentV0C",&fTreeVariableCentV0C,"fTreeVariableCentV0C/F"); | |
467 | fTreeV0->Branch("fTreeVariableCentV0M",&fTreeVariableCentV0M,"fTreeVariableCentV0M/F"); | |
468 | fTreeV0->Branch("fTreeVariableCentV0AEq",&fTreeVariableCentV0AEq,"fTreeVariableCentV0AEq/F"); | |
469 | fTreeV0->Branch("fTreeVariableCentV0CEq",&fTreeVariableCentV0CEq,"fTreeVariableCentV0CEq/F"); | |
470 | fTreeV0->Branch("fTreeVariableCentV0MEq",&fTreeVariableCentV0MEq,"fTreeVariableCentV0MEq/F"); | |
471 | fTreeV0->Branch("fTreeVariableAmpV0A",&fTreeVariableAmpV0A,"fTreeVariableAmpV0A/F"); | |
472 | fTreeV0->Branch("fTreeVariableAmpV0C",&fTreeVariableAmpV0C,"fTreeVariableAmpV0C/F"); | |
473 | fTreeV0->Branch("fTreeVariableAmpV0AEq",&fTreeVariableAmpV0AEq,"fTreeVariableAmpV0AEq/F"); | |
474 | fTreeV0->Branch("fTreeVariableAmpV0CEq",&fTreeVariableAmpV0CEq,"fTreeVariableAmpV0CEq/F"); | |
475 | fTreeV0->Branch("fTreeVariableRefMultEta8",&fTreeVariableRefMultEta8,"fTreeVariableRefMultEta8/I"); | |
476 | fTreeV0->Branch("fTreeVariableRefMultEta5",&fTreeVariableRefMultEta5,"fTreeVariableRefMultEta5/I"); | |
477 | fTreeV0->Branch("fTreeVariableRunNumber",&fTreeVariableRunNumber,"fTreeVariableRunNumber/I"); | |
478 | //------------------------------------------------ | |
479 | ||
af0d4791 | 480 | //Create Cascade output tree |
481 | fTreeCascade = new TTree("fTreeCascade","CascadeCandidates"); | |
482 | ||
483 | //------------------------------------------------ | |
484 | // fTreeCascade Branch definitions - Cascade Tree | |
485 | //------------------------------------------------ | |
486 | ||
487 | //-----------BASIC-INFO--------------------------- | |
488 | fTreeCascade->Branch("fTreeCascVarCharge",&fTreeCascVarCharge,"fTreeCascVarCharge/I"); | |
489 | fTreeCascade->Branch("fTreeCascVarMassAsXi",&fTreeCascVarMassAsXi,"fTreeCascVarMassAsXi/F"); | |
490 | fTreeCascade->Branch("fTreeCascVarMassAsOmega",&fTreeCascVarMassAsOmega,"fTreeCascVarMassAsOmega/F"); | |
491 | fTreeCascade->Branch("fTreeCascVarPt",&fTreeCascVarPt,"fTreeCascVarPt/F"); | |
492 | fTreeCascade->Branch("fTreeCascVarRapXi",&fTreeCascVarRapXi,"fTreeCascVarRapXi/F"); | |
493 | fTreeCascade->Branch("fTreeCascVarRapOmega",&fTreeCascVarRapOmega,"fTreeCascVarRapOmega/F"); | |
494 | fTreeCascade->Branch("fTreeCascVarNegEta",&fTreeCascVarNegEta,"fTreeCascVarNegEta/F"); | |
495 | fTreeCascade->Branch("fTreeCascVarPosEta",&fTreeCascVarPosEta,"fTreeCascVarPosEta/F"); | |
496 | fTreeCascade->Branch("fTreeCascVarBachEta",&fTreeCascVarBachEta,"fTreeCascVarBachEta/F"); | |
497 | //-----------INFO-FOR-CUTS------------------------ | |
498 | fTreeCascade->Branch("fTreeCascVarDCACascDaughters",&fTreeCascVarDCACascDaughters,"fTreeCascVarDCACascDaughters/F"); | |
499 | fTreeCascade->Branch("fTreeCascVarDCABachToPrimVtx",&fTreeCascVarDCABachToPrimVtx,"fTreeCascVarDCABachToPrimVtx/F"); | |
500 | fTreeCascade->Branch("fTreeCascVarDCAV0Daughters",&fTreeCascVarDCAV0Daughters,"fTreeCascVarDCAV0Daughters/F"); | |
501 | fTreeCascade->Branch("fTreeCascVarDCAV0ToPrimVtx",&fTreeCascVarDCAV0ToPrimVtx,"fTreeCascVarDCAV0ToPrimVtx/F"); | |
502 | fTreeCascade->Branch("fTreeCascVarDCAPosToPrimVtx",&fTreeCascVarDCAPosToPrimVtx,"fTreeCascVarDCAPosToPrimVtx/F"); | |
503 | fTreeCascade->Branch("fTreeCascVarDCANegToPrimVtx",&fTreeCascVarDCANegToPrimVtx,"fTreeCascVarDCANegToPrimVtx/F"); | |
504 | fTreeCascade->Branch("fTreeCascVarCascCosPointingAngle",&fTreeCascVarCascCosPointingAngle,"fTreeCascVarCascCosPointingAngle/F"); | |
505 | fTreeCascade->Branch("fTreeCascVarCascRadius",&fTreeCascVarCascRadius,"fTreeCascVarCascRadius/F"); | |
506 | fTreeCascade->Branch("fTreeCascVarV0Mass",&fTreeCascVarV0Mass,"fTreeCascVarV0Mass/F"); | |
507 | fTreeCascade->Branch("fTreeCascVarV0CosPointingAngle",&fTreeCascVarV0CosPointingAngle,"fTreeCascVarV0CosPointingAngle/F"); | |
508 | fTreeCascade->Branch("fTreeCascVarV0CosPointingAngleSpecial",&fTreeCascVarV0CosPointingAngleSpecial,"fTreeCascVarV0CosPointingAngleSpecial/F"); | |
509 | fTreeCascade->Branch("fTreeCascVarV0Radius",&fTreeCascVarV0Radius,"fTreeCascVarV0Radius/F"); | |
510 | fTreeCascade->Branch("fTreeCascVarLeastNbrClusters",&fTreeCascVarLeastNbrClusters,"fTreeCascVarLeastNbrClusters/I"); | |
511 | //-----------MULTIPLICITY-INFO-------------------- | |
512 | fTreeCascade->Branch("fTreeCascVarCentV0A",&fTreeCascVarCentV0A,"fTreeCascVarCentV0A/F"); | |
513 | fTreeCascade->Branch("fTreeCascVarCentV0C",&fTreeCascVarCentV0C,"fTreeCascVarCentV0C/F"); | |
514 | fTreeCascade->Branch("fTreeCascVarCentV0M",&fTreeCascVarCentV0M,"fTreeCascVarCentV0M/F"); | |
515 | fTreeCascade->Branch("fTreeCascVarCentV0AEq",&fTreeCascVarCentV0AEq,"fTreeCascVarCentV0AEq/F"); | |
516 | fTreeCascade->Branch("fTreeCascVarCentV0CEq",&fTreeCascVarCentV0CEq,"fTreeCascVarCentV0CEq/F"); | |
517 | fTreeCascade->Branch("fTreeCascVarCentV0MEq",&fTreeCascVarCentV0MEq,"fTreeCascVarCentV0MEq/F"); | |
518 | fTreeCascade->Branch("fTreeCascVarAmpV0A",&fTreeCascVarAmpV0A,"fTreeCascVarAmpV0A/F"); | |
519 | fTreeCascade->Branch("fTreeCascVarAmpV0C",&fTreeCascVarAmpV0C,"fTreeCascVarAmpV0C/F"); | |
520 | fTreeCascade->Branch("fTreeCascVarAmpV0AEq",&fTreeCascVarAmpV0AEq,"fTreeCascVarAmpV0AEq/F"); | |
521 | fTreeCascade->Branch("fTreeCascVarAmpV0CEq",&fTreeCascVarAmpV0CEq,"fTreeCascVarAmpV0CEq/F"); | |
522 | fTreeCascade->Branch("fTreeCascVarRefMultEta8",&fTreeCascVarRefMultEta8,"fTreeCascVarRefMultEta8/I"); | |
523 | fTreeCascade->Branch("fTreeCascVarRefMultEta5",&fTreeCascVarRefMultEta5,"fTreeCascVarRefMultEta5/I"); | |
26d39641 | 524 | fTreeCascade->Branch("fTreeCascVarRunNumber",&fTreeCascVarRunNumber,"fTreeCascVarRunNumber/I"); |
af0d4791 | 525 | //-----------DECAY-LENGTH-INFO-------------------- |
526 | fTreeCascade->Branch("fTreeCascVarDistOverTotMom",&fTreeCascVarDistOverTotMom,"fTreeCascVarDistOverTotMom/F"); | |
527 | //------------------------------------------------ | |
528 | fTreeCascade->Branch("fTreeCascVarNegNSigmaPion",&fTreeCascVarNegNSigmaPion,"fTreeCascVarNegNSigmaPion/F"); | |
529 | fTreeCascade->Branch("fTreeCascVarNegNSigmaProton",&fTreeCascVarNegNSigmaProton,"fTreeCascVarNegNSigmaProton/F"); | |
530 | fTreeCascade->Branch("fTreeCascVarPosNSigmaPion",&fTreeCascVarPosNSigmaPion,"fTreeCascVarPosNSigmaPion/F"); | |
531 | fTreeCascade->Branch("fTreeCascVarPosNSigmaProton",&fTreeCascVarPosNSigmaProton,"fTreeCascVarPosNSigmaProton/F"); | |
532 | fTreeCascade->Branch("fTreeCascVarBachNSigmaPion",&fTreeCascVarBachNSigmaPion,"fTreeCascVarBachNSigmaPion/F"); | |
533 | fTreeCascade->Branch("fTreeCascVarBachNSigmaKaon",&fTreeCascVarBachNSigmaKaon,"fTreeCascVarBachNSigmaKaon/F"); | |
534 | ||
535 | //------------------------------------------------ | |
536 | // Particle Identification Setup | |
537 | //------------------------------------------------ | |
538 | ||
539 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); | |
540 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
541 | fPIDResponse = inputHandler->GetPIDResponse(); | |
542 | ||
543 | // Multiplicity | |
544 | if(! fESDtrackCuts ){ | |
545 | fESDtrackCuts = new AliESDtrackCuts(); | |
546 | } | |
547 | ||
548 | //------------------------------------------------ | |
549 | // V0 Multiplicity Histograms | |
550 | //------------------------------------------------ | |
551 | ||
552 | // Create histograms | |
553 | OpenFile(1); | |
554 | fListHist = new TList(); | |
555 | fListHist->SetOwner(); // See http://root.cern.ch/root/html/TCollection.html#TCollection:SetOwner | |
556 | ||
557 | if(! fHistEventCounter ) { | |
558 | //Histogram Output: Event-by-Event | |
559 | fHistEventCounter = new TH1D( "fHistEventCounter", ";Evt. Sel. Step;Count",5,0,5); | |
560 | fHistEventCounter->GetXaxis()->SetBinLabel(1, "Processed"); | |
561 | fHistEventCounter->GetXaxis()->SetBinLabel(2, "Phys-Sel"); | |
562 | fHistEventCounter->GetXaxis()->SetBinLabel(3, "Has Vtx"); | |
563 | fHistEventCounter->GetXaxis()->SetBinLabel(4, "Vtx |z|<10cm"); | |
564 | fHistEventCounter->GetXaxis()->SetBinLabel(5, "Isn't Pileup"); | |
565 | fListHist->Add(fHistEventCounter); | |
566 | } | |
567 | ||
568 | //List of Histograms: Normal | |
569 | PostData(1, fListHist); | |
570 | ||
571 | //TTree Object: Saved to base directory. Should cache to disk while saving. | |
572 | //(Important to avoid excessive memory usage, particularly when merging) | |
573 | PostData(2, fTreeEvent); | |
574 | PostData(3, fTreeV0); | |
575 | PostData(4, fTreeCascade); | |
576 | ||
577 | }// end UserCreateOutputObjects | |
578 | ||
579 | ||
580 | //________________________________________________________________________ | |
581 | void AliAnalysisTaskStrangenessVsMultiplicity::UserExec(Option_t *) | |
582 | { | |
583 | // Main loop | |
584 | // Called for each event | |
585 | ||
586 | AliESDEvent *lESDevent = 0x0; | |
47529a6d | 587 | |
588 | //Zero all booleans, etc | |
589 | fEvSel_HasAtLeastSPDVertex = kFALSE; | |
590 | fEvSel_VtxZCut = kFALSE; | |
591 | fEvSel_IsNotPileup = kFALSE; | |
592 | fEvSel_IsNotPileupInMultBins = kFALSE; | |
593 | fEvSel_HasVtxContributor = kFALSE; | |
594 | ||
595 | fEvSel_nTracklets = -1; | |
596 | fEvSel_nSPDClusters = -1; | |
af0d4791 | 597 | |
598 | // Connect to the InputEvent | |
599 | // After these lines, we should have an ESD/AOD event + the number of V0s in it. | |
600 | ||
601 | // Appropriate for ESD analysis! | |
602 | ||
603 | lESDevent = dynamic_cast<AliESDEvent*>( InputEvent() ); | |
604 | if (!lESDevent) { | |
605 | AliWarning("ERROR: lESDevent not available \n"); | |
606 | return; | |
607 | } | |
608 | ||
609 | //Get VZERO Information for multiplicity later | |
610 | AliVVZERO* esdV0 = lESDevent->GetVZEROData(); | |
611 | if (!esdV0) { | |
612 | AliError("AliVVZERO not available"); | |
613 | return; | |
614 | } | |
615 | ||
616 | fRunNumber = lESDevent->GetRunNumber(); | |
617 | ||
618 | Double_t lMagneticField = -10; | |
619 | lMagneticField = lESDevent->GetMagneticField( ); | |
620 | ||
621 | //------------------------------------------------ | |
622 | // Variable Definition | |
623 | //------------------------------------------------ | |
624 | ||
625 | //------------------------------------------------ | |
626 | // Physics Selection | |
627 | //------------------------------------------------ | |
628 | ||
629 | fHistEventCounter->Fill(0.5); | |
630 | ||
631 | UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected(); | |
632 | Bool_t isSelected = 0; | |
633 | isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB; | |
634 | ||
758b26b0 | 635 | //Standard Min-Bias Selection - always do this! |
af0d4791 | 636 | if ( ! isSelected ) { |
637 | PostData(1, fListHist); | |
638 | PostData(2, fTreeEvent); | |
639 | PostData(3, fTreeV0); | |
640 | PostData(4, fTreeCascade); | |
641 | return; | |
642 | } | |
643 | ||
644 | fHistEventCounter->Fill(1.5); | |
645 | ||
646 | //------------------------------------------------ | |
647 | // Primary Vertex Requirements Section: | |
648 | // ---> pp: has vertex, |z|<10cm | |
649 | //------------------------------------------------ | |
650 | ||
651 | //classical Proton-proton like selection | |
652 | const AliESDVertex *lPrimaryBestESDVtx = lESDevent->GetPrimaryVertex(); | |
653 | const AliESDVertex *lPrimaryTrackingESDVtx = lESDevent->GetPrimaryVertexTracks(); | |
654 | const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD(); | |
655 | ||
656 | Double_t lBestPrimaryVtxPos[3] = {-100.0, -100.0, -100.0}; | |
657 | lPrimaryBestESDVtx->GetXYZ( lBestPrimaryVtxPos ); | |
658 | ||
659 | //Only accept if Tracking or SPD vertex is fine | |
758b26b0 | 660 | if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtx->GetStatus() && !fkSkipEventSelection ){ |
af0d4791 | 661 | AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !"); |
662 | PostData(1, fListHist); | |
663 | PostData(2, fTreeEvent); | |
664 | PostData(3, fTreeV0); | |
665 | PostData(4, fTreeCascade); | |
666 | return; | |
667 | } | |
668 | ||
47529a6d | 669 | if(! (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtx->GetStatus()) ){ |
670 | //Passed selection! | |
671 | fEvSel_HasAtLeastSPDVertex = kTRUE; | |
672 | } | |
673 | ||
af0d4791 | 674 | //Has SPD or Tracking Vertex |
675 | fHistEventCounter -> Fill(2.5); | |
676 | ||
677 | //Always do Primary Vertex Selection | |
758b26b0 | 678 | if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0 && !fkSkipEventSelection ) { |
af0d4791 | 679 | AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !"); |
680 | PostData(1, fListHist); | |
681 | PostData(2, fTreeEvent); | |
682 | PostData(3, fTreeV0); | |
683 | PostData(4, fTreeCascade); | |
684 | return; | |
685 | } | |
686 | ||
47529a6d | 687 | if(TMath::Abs(lBestPrimaryVtxPos[2]) <= 10.0 ){ |
688 | //Passed selection! | |
689 | fEvSel_VtxZCut = kTRUE; | |
690 | } | |
691 | ||
af0d4791 | 692 | //Fill Event selected counter |
693 | fHistEventCounter -> Fill(3.5); | |
694 | ||
695 | //------------------------------------------------ | |
696 | // Check if this isn't pileup | |
697 | //------------------------------------------------ | |
698 | ||
758b26b0 | 699 | if(lESDevent->IsPileupFromSPDInMultBins() && !fkSkipEventSelection ){ |
af0d4791 | 700 | // minContributors=3, minZdist=0.8, nSigmaZdist=3., nSigmaDiamXY=2., nSigmaDiamZ=5. |
701 | //-> see http://alisoft.cern.ch/viewvc/trunk/STEER/AliESDEvent.h?root=AliRoot&r1=41914&r2=42199&pathrev=42199 | |
702 | AliWarning("Pb / Event tagged as pile-up by SPD... return !"); | |
703 | PostData(1, fListHist); | |
704 | PostData(2, fTreeEvent); | |
705 | PostData(3, fTreeV0); | |
706 | PostData(4, fTreeCascade); | |
707 | return; | |
708 | } | |
47529a6d | 709 | |
710 | if( !lESDevent->IsPileupFromSPD() ) fEvSel_IsNotPileup = kTRUE; | |
711 | if( !lESDevent->IsPileupFromSPDInMultBins() ) fEvSel_IsNotPileupInMultBins = kTRUE; | |
712 | ||
af0d4791 | 713 | //Fill Event isn't pileup counter |
714 | fHistEventCounter -> Fill(4.5); | |
715 | ||
716 | //------------------------------------------------ | |
717 | // Multiplicity Information Acquistion | |
718 | //------------------------------------------------ | |
719 | ||
720 | //Standard GetReferenceMultiplicity Estimator (0.5 and 0.8) | |
721 | fRefMultEta5 = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC,0.5); | |
722 | fRefMultEta8 = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC,0.8); | |
723 | ||
724 | // VZERO PART | |
725 | Float_t multV0A = 0; // multiplicity from V0 reco side A | |
726 | Float_t multV0C = 0; // multiplicity from V0 reco side C | |
727 | Float_t multV0AEq = 0; // multiplicity from V0 reco side A | |
728 | Float_t multV0CEq = 0; // multiplicity from V0 reco side C | |
729 | Float_t multV0ACorr = 0; // multiplicity from V0 reco side A | |
730 | Float_t multV0CCorr = 0; // multiplicity from V0 reco side C | |
731 | ||
732 | //Non-Equalized Signal: copy of multV0ACorr and multV0CCorr from AliCentralitySelectionTask | |
733 | //Getters for uncorrected multiplicity | |
734 | multV0A=esdV0->GetMTotV0A(); | |
735 | multV0C=esdV0->GetMTotV0C(); | |
736 | ||
737 | //Get Z vertex position of SPD vertex (why not Tracking if available?) | |
738 | Float_t zvtx = lPrimarySPDVtx->GetZ(); | |
739 | ||
740 | //Acquire Corrected multV0A | |
741 | multV0ACorr = AliESDUtils::GetCorrV0A(multV0A,zvtx); | |
742 | multV0CCorr = AliESDUtils::GetCorrV0C(multV0C,zvtx); | |
743 | ||
744 | //Copy to Event Tree for extra information | |
745 | fAmplitude_V0A = multV0ACorr; | |
746 | fAmplitude_V0C = multV0CCorr; | |
747 | ||
758b26b0 | 748 | // Equalized signals // From AliCentralitySelectionTask // Updated |
749 | for(Int_t iCh = 32; iCh < 64; ++iCh) { | |
af0d4791 | 750 | Double_t mult = lESDevent->GetVZEROEqMultiplicity(iCh); |
751 | multV0AEq += mult; | |
752 | } | |
758b26b0 | 753 | for(Int_t iCh = 0; iCh < 32; ++iCh) { |
af0d4791 | 754 | Double_t mult = lESDevent->GetVZEROEqMultiplicity(iCh); |
755 | multV0CEq += mult; | |
756 | } | |
757 | fAmplitude_V0AEq = multV0AEq; | |
758 | fAmplitude_V0CEq = multV0CEq; | |
759 | ||
760 | fCentrality_V0A = -100; | |
761 | fCentrality_V0C = -100; | |
762 | fCentrality_V0M = -100; | |
763 | fCentrality_V0AEq = -100; | |
764 | fCentrality_V0CEq = -100; | |
765 | fCentrality_V0MEq = -100; | |
766 | ||
767 | //AliCentrality... Check if working? | |
768 | AliCentrality* centrality; | |
769 | centrality = lESDevent->GetCentrality(); | |
770 | if ( !(centrality->GetQuality()>1) ){ | |
771 | fCentrality_V0A = centrality->GetCentralityPercentile( "V0A" ); | |
772 | fCentrality_V0C = centrality->GetCentralityPercentile( "V0C" ); | |
773 | fCentrality_V0M = centrality->GetCentralityPercentile( "V0M" ); | |
774 | fCentrality_V0AEq = centrality->GetCentralityPercentile( "V0AEq" ); | |
775 | fCentrality_V0CEq = centrality->GetCentralityPercentile( "V0CEq" ); | |
776 | fCentrality_V0MEq = centrality->GetCentralityPercentile( "V0MEq" ); | |
777 | } | |
778 | ||
47529a6d | 779 | //Tracklets vs Clusters Exploratory data |
780 | fEvSel_nTracklets = lESDevent->GetMultiplicity()->GetNumberOfTracklets(); | |
781 | fEvSel_nSPDClusters = lESDevent->GetNumberOfITSClusters(0) + lESDevent->GetNumberOfITSClusters(1); | |
782 | ||
af0d4791 | 783 | //Event-level fill |
784 | fTreeEvent->Fill() ; | |
785 | ||
758b26b0 | 786 | //STOP HERE if skipping event selections (no point in doing the rest...) |
787 | if( fkSkipEventSelection ){ | |
788 | PostData(1, fListHist); | |
789 | PostData(2, fTreeEvent); | |
790 | PostData(3, fTreeV0); | |
791 | PostData(4, fTreeCascade); | |
792 | return; | |
793 | } | |
794 | ||
af0d4791 | 795 | //------------------------------------------------ |
796 | ||
161c57ac | 797 | //------------------------------------------------ |
798 | // Fill V0 Tree as needed | |
799 | //------------------------------------------------ | |
800 | ||
801 | //Variable definition | |
802 | Int_t lOnFlyStatus = 0;// nv0sOn = 0, nv0sOff = 0; | |
803 | Double_t lChi2V0 = 0; | |
804 | Double_t lDcaV0Daughters = 0, lDcaV0ToPrimVertex = 0; | |
805 | Double_t lDcaPosToPrimVertex = 0, lDcaNegToPrimVertex = 0; | |
806 | Double_t lV0CosineOfPointingAngle = 0; | |
807 | Double_t lV0Radius = 0, lPt = 0; | |
808 | Double_t lRapK0Short = 0, lRapLambda = 0; | |
809 | Double_t lInvMassK0s = 0, lInvMassLambda = 0, lInvMassAntiLambda = 0; | |
810 | Double_t lAlphaV0 = 0, lPtArmV0 = 0; | |
811 | ||
812 | Double_t fMinV0Pt = 0; | |
813 | Double_t fMaxV0Pt = 100; | |
814 | ||
815 | Int_t nv0s = 0; | |
816 | nv0s = lESDevent->GetNumberOfV0s(); | |
817 | ||
818 | for (Int_t iV0 = 0; iV0 < nv0s; iV0++) //extra-crazy test | |
819 | {// This is the begining of the V0 loop | |
820 | AliESDv0 *v0 = ((AliESDEvent*)lESDevent)->GetV0(iV0); | |
821 | if (!v0) continue; | |
822 | ||
823 | Double_t tDecayVertexV0[3]; v0->GetXYZ(tDecayVertexV0[0],tDecayVertexV0[1],tDecayVertexV0[2]); | |
824 | ||
825 | Double_t tV0mom[3]; | |
826 | v0->GetPxPyPz( tV0mom[0],tV0mom[1],tV0mom[2] ); | |
827 | Double_t lV0TotalMomentum = TMath::Sqrt( | |
828 | tV0mom[0]*tV0mom[0]+tV0mom[1]*tV0mom[1]+tV0mom[2]*tV0mom[2] ); | |
829 | ||
830 | lV0Radius = TMath::Sqrt(tDecayVertexV0[0]*tDecayVertexV0[0]+tDecayVertexV0[1]*tDecayVertexV0[1]); | |
831 | ||
832 | lPt = v0->Pt(); | |
833 | lRapK0Short = v0->RapK0Short(); | |
834 | lRapLambda = v0->RapLambda(); | |
835 | if ((lPt<fMinV0Pt)||(fMaxV0Pt<lPt)) continue; | |
836 | ||
837 | UInt_t lKeyPos = (UInt_t)TMath::Abs(v0->GetPindex()); | |
838 | UInt_t lKeyNeg = (UInt_t)TMath::Abs(v0->GetNindex()); | |
839 | ||
840 | Double_t lMomPos[3]; v0->GetPPxPyPz(lMomPos[0],lMomPos[1],lMomPos[2]); | |
841 | Double_t lMomNeg[3]; v0->GetNPxPyPz(lMomNeg[0],lMomNeg[1],lMomNeg[2]); | |
842 | ||
843 | AliESDtrack *pTrack=((AliESDEvent*)lESDevent)->GetTrack(lKeyPos); | |
844 | AliESDtrack *nTrack=((AliESDEvent*)lESDevent)->GetTrack(lKeyNeg); | |
845 | if (!pTrack || !nTrack) { | |
846 | Printf("ERROR: Could not retreive one of the daughter track"); | |
847 | continue; | |
848 | } | |
849 | ||
850 | //Daughter Eta for Eta selection, afterwards | |
851 | fTreeVariableNegEta = nTrack->Eta(); | |
852 | fTreeVariablePosEta = pTrack->Eta(); | |
853 | ||
854 | // Filter like-sign V0 (next: add counter and distribution) | |
855 | if ( pTrack->GetSign() == nTrack->GetSign()){ | |
856 | continue; | |
857 | } | |
858 | ||
859 | //________________________________________________________________________ | |
860 | // Track quality cuts | |
861 | Float_t lPosTrackCrossedRows = pTrack->GetTPCClusterInfo(2,1); | |
862 | Float_t lNegTrackCrossedRows = nTrack->GetTPCClusterInfo(2,1); | |
863 | fTreeVariableLeastNbrCrossedRows = (Int_t) lPosTrackCrossedRows; | |
864 | if( lNegTrackCrossedRows < fTreeVariableLeastNbrCrossedRows ) | |
865 | fTreeVariableLeastNbrCrossedRows = (Int_t) lNegTrackCrossedRows; | |
866 | ||
867 | // TPC refit condition (done during reconstruction for Offline but not for On-the-fly) | |
868 | if( !(pTrack->GetStatus() & AliESDtrack::kTPCrefit)) continue; | |
869 | if( !(nTrack->GetStatus() & AliESDtrack::kTPCrefit)) continue; | |
870 | ||
871 | ||
872 | if ( ( ( pTrack->GetTPCClusterInfo(2,1) ) < 70 ) || ( ( nTrack->GetTPCClusterInfo(2,1) ) < 70 ) ) continue; | |
873 | ||
874 | //GetKinkIndex condition | |
875 | if( pTrack->GetKinkIndex(0)>0 || nTrack->GetKinkIndex(0)>0 ) continue; | |
876 | ||
877 | //Findable clusters > 0 condition | |
878 | if( pTrack->GetTPCNclsF()<=0 || nTrack->GetTPCNclsF()<=0 ) continue; | |
879 | ||
880 | //Compute ratio Crossed Rows / Findable clusters | |
881 | //Note: above test avoids division by zero! | |
882 | Float_t lPosTrackCrossedRowsOverFindable = lPosTrackCrossedRows / ((double)(pTrack->GetTPCNclsF())); | |
883 | Float_t lNegTrackCrossedRowsOverFindable = lNegTrackCrossedRows / ((double)(nTrack->GetTPCNclsF())); | |
884 | ||
885 | fTreeVariableLeastRatioCrossedRowsOverFindable = lPosTrackCrossedRowsOverFindable; | |
886 | if( lNegTrackCrossedRowsOverFindable < fTreeVariableLeastRatioCrossedRowsOverFindable ) | |
887 | fTreeVariableLeastRatioCrossedRowsOverFindable = lNegTrackCrossedRowsOverFindable; | |
888 | ||
889 | //Lowest Cut Level for Ratio Crossed Rows / Findable = 0.8, set here | |
890 | if ( fTreeVariableLeastRatioCrossedRowsOverFindable < 0.8 ) continue; | |
891 | ||
892 | //End track Quality Cuts | |
893 | //________________________________________________________________________ | |
894 | ||
895 | lDcaPosToPrimVertex = TMath::Abs(pTrack->GetD(lBestPrimaryVtxPos[0], | |
896 | lBestPrimaryVtxPos[1], | |
897 | lMagneticField) ); | |
898 | ||
899 | lDcaNegToPrimVertex = TMath::Abs(nTrack->GetD(lBestPrimaryVtxPos[0], | |
900 | lBestPrimaryVtxPos[1], | |
901 | lMagneticField) ); | |
902 | ||
903 | lOnFlyStatus = v0->GetOnFlyStatus(); | |
904 | lChi2V0 = v0->GetChi2V0(); | |
905 | lDcaV0Daughters = v0->GetDcaV0Daughters(); | |
906 | lDcaV0ToPrimVertex = v0->GetD(lBestPrimaryVtxPos[0],lBestPrimaryVtxPos[1],lBestPrimaryVtxPos[2]); | |
907 | lV0CosineOfPointingAngle = v0->GetV0CosineOfPointingAngle(lBestPrimaryVtxPos[0],lBestPrimaryVtxPos[1],lBestPrimaryVtxPos[2]); | |
908 | fTreeVariableV0CosineOfPointingAngle=lV0CosineOfPointingAngle; | |
909 | ||
910 | // Getting invariant mass infos directly from ESD | |
911 | v0->ChangeMassHypothesis(310); | |
912 | lInvMassK0s = v0->GetEffMass(); | |
913 | v0->ChangeMassHypothesis(3122); | |
914 | lInvMassLambda = v0->GetEffMass(); | |
915 | v0->ChangeMassHypothesis(-3122); | |
916 | lInvMassAntiLambda = v0->GetEffMass(); | |
917 | lAlphaV0 = v0->AlphaV0(); | |
918 | lPtArmV0 = v0->PtArmV0(); | |
919 | ||
920 | fTreeVariablePt = v0->Pt(); | |
921 | fTreeVariableChi2V0 = lChi2V0; | |
922 | fTreeVariableDcaV0ToPrimVertex = lDcaV0ToPrimVertex; | |
923 | fTreeVariableDcaV0Daughters = lDcaV0Daughters; | |
924 | fTreeVariableV0CosineOfPointingAngle = lV0CosineOfPointingAngle; | |
925 | fTreeVariableV0Radius = lV0Radius; | |
926 | fTreeVariableDcaPosToPrimVertex = lDcaPosToPrimVertex; | |
927 | fTreeVariableDcaNegToPrimVertex = lDcaNegToPrimVertex; | |
928 | fTreeVariableInvMassK0s = lInvMassK0s; | |
929 | fTreeVariableInvMassLambda = lInvMassLambda; | |
930 | fTreeVariableInvMassAntiLambda = lInvMassAntiLambda; | |
931 | fTreeVariableRapK0Short = lRapK0Short; | |
932 | fTreeVariableRapLambda = lRapLambda; | |
933 | fTreeVariableAlphaV0 = lAlphaV0; | |
934 | fTreeVariablePtArmV0 = lPtArmV0; | |
935 | ||
936 | //Official means of acquiring N-sigmas | |
937 | fTreeVariableNSigmasPosProton = fPIDResponse->NumberOfSigmasTPC( pTrack, AliPID::kProton ); | |
938 | fTreeVariableNSigmasPosPion = fPIDResponse->NumberOfSigmasTPC( pTrack, AliPID::kPion ); | |
939 | fTreeVariableNSigmasNegProton = fPIDResponse->NumberOfSigmasTPC( nTrack, AliPID::kProton ); | |
940 | fTreeVariableNSigmasNegPion = fPIDResponse->NumberOfSigmasTPC( nTrack, AliPID::kPion ); | |
941 | ||
942 | //This requires an Invariant Mass Hypothesis afterwards | |
943 | fTreeVariableDistOverTotMom = TMath::Sqrt( | |
944 | TMath::Power( tDecayVertexV0[0] - lBestPrimaryVtxPos[0] , 2) + | |
945 | TMath::Power( tDecayVertexV0[1] - lBestPrimaryVtxPos[1] , 2) + | |
946 | TMath::Power( tDecayVertexV0[2] - lBestPrimaryVtxPos[2] , 2) | |
947 | ); | |
948 | fTreeVariableDistOverTotMom /= (lV0TotalMomentum+1e-10); //avoid division by zero, to be sure | |
949 | ||
950 | //Copy Multiplicity information | |
951 | fTreeVariableCentV0A = fCentrality_V0A; | |
952 | fTreeVariableCentV0C = fCentrality_V0C; | |
953 | fTreeVariableCentV0M = fCentrality_V0M; | |
954 | fTreeVariableCentV0AEq = fCentrality_V0AEq; | |
955 | fTreeVariableCentV0CEq = fCentrality_V0CEq; | |
956 | fTreeVariableCentV0MEq = fCentrality_V0MEq; | |
957 | fTreeVariableAmpV0A = fAmplitude_V0A; | |
958 | fTreeVariableAmpV0C = fAmplitude_V0C; | |
959 | fTreeVariableAmpV0AEq = fAmplitude_V0AEq; | |
960 | fTreeVariableAmpV0CEq = fAmplitude_V0CEq; | |
961 | fTreeVariableRefMultEta8 = fRefMultEta8; | |
962 | fTreeVariableRefMultEta5 = fRefMultEta5; | |
963 | fTreeVariableRunNumber = fRunNumber; | |
964 | ||
965 | //------------------------------------------------ | |
966 | // Fill Tree! | |
967 | //------------------------------------------------ | |
968 | ||
969 | // The conditionals are meant to decrease excessive | |
970 | // memory usage! | |
971 | ||
972 | //First Selection: Reject OnFly | |
973 | if( lOnFlyStatus == 0 ){ | |
974 | //Second Selection: rough 20-sigma band, parametric. | |
975 | //K0Short: Enough to parametrize peak broadening with linear function. | |
976 | Double_t lUpperLimitK0Short = (5.63707e-01) + (1.14979e-02)*fTreeVariablePt; | |
977 | Double_t lLowerLimitK0Short = (4.30006e-01) - (1.10029e-02)*fTreeVariablePt; | |
978 | //Lambda: Linear (for higher pt) plus exponential (for low-pt broadening) | |
979 | //[0]+[1]*x+[2]*TMath::Exp(-[3]*x) | |
980 | Double_t lUpperLimitLambda = (1.13688e+00) + (5.27838e-03)*fTreeVariablePt + (8.42220e-02)*TMath::Exp(-(3.80595e+00)*fTreeVariablePt); | |
981 | Double_t lLowerLimitLambda = (1.09501e+00) - (5.23272e-03)*fTreeVariablePt - (7.52690e-02)*TMath::Exp(-(3.46339e+00)*fTreeVariablePt); | |
982 | //Do Selection | |
983 | if( (fTreeVariableInvMassLambda < lUpperLimitLambda && fTreeVariableInvMassLambda > lLowerLimitLambda ) || | |
984 | (fTreeVariableInvMassAntiLambda < lUpperLimitLambda && fTreeVariableInvMassAntiLambda > lLowerLimitLambda ) || | |
985 | (fTreeVariableInvMassK0s < lUpperLimitK0Short && fTreeVariableInvMassK0s > lLowerLimitK0Short ) ){ | |
986 | //Pre-selection in case this is AA... | |
987 | if ( TMath::Abs(fTreeVariableNegEta)<0.8 && TMath::Abs(fTreeVariablePosEta)<0.8 && fkSaveV0Tree ) fTreeV0->Fill(); | |
988 | } | |
989 | } | |
990 | }// This is the end of the V0 loop | |
991 | ||
992 | //------------------------------------------------ | |
993 | // Fill V0 tree over. | |
994 | //------------------------------------------------ | |
995 | ||
996 | ||
997 | ||
af0d4791 | 998 | //------------------------------------------------ |
999 | // Rerun cascade vertexer! | |
1000 | //------------------------------------------------ | |
1001 | ||
1002 | if( fkRunVertexers ){ | |
1003 | lESDevent->ResetCascades(); | |
1004 | lESDevent->ResetV0s(); | |
1005 | ||
1006 | AliV0vertexer lV0vtxer; | |
1007 | AliCascadeVertexer lCascVtxer; | |
1008 | ||
1009 | lV0vtxer.SetDefaultCuts(fV0VertexerSels); | |
1010 | lCascVtxer.SetDefaultCuts(fCascadeVertexerSels); | |
1011 | ||
1012 | lV0vtxer.Tracks2V0vertices(lESDevent); | |
1013 | lCascVtxer.V0sTracks2CascadeVertices(lESDevent); | |
1014 | } | |
1015 | ||
1016 | //------------------------------------------------ | |
1017 | // MAIN CASCADE LOOP STARTS HERE | |
1018 | //------------------------------------------------ | |
1019 | // Code Credit: Antonin Maire (thanks^100) | |
1020 | // ---> This is an adaptation | |
1021 | ||
1022 | Long_t ncascades = 0; | |
1023 | ncascades = lESDevent->GetNumberOfCascades(); | |
1024 | ||
1025 | for (Int_t iXi = 0; iXi < ncascades; iXi++){ | |
1026 | //------------------------------------------------ | |
1027 | // Initializations | |
1028 | //------------------------------------------------ | |
1029 | //Double_t lTrkgPrimaryVtxRadius3D = -500.0; | |
1030 | //Double_t lBestPrimaryVtxRadius3D = -500.0; | |
1031 | ||
1032 | // - 1st part of initialisation : variables needed to store AliESDCascade data members | |
1033 | Double_t lEffMassXi = 0. ; | |
1034 | //Double_t lChi2Xi = -1. ; | |
1035 | Double_t lDcaXiDaughters = -1. ; | |
1036 | Double_t lXiCosineOfPointingAngle = -1. ; | |
1037 | Double_t lPosXi[3] = { -1000.0, -1000.0, -1000.0 }; | |
1038 | Double_t lXiRadius = -1000. ; | |
1039 | ||
1040 | // - 2nd part of initialisation : Nbr of clusters within TPC for the 3 daughter cascade tracks | |
1041 | Int_t lPosTPCClusters = -1; // For ESD only ...//FIXME : wait for availability in AOD | |
1042 | Int_t lNegTPCClusters = -1; // For ESD only ... | |
1043 | Int_t lBachTPCClusters = -1; // For ESD only ... | |
1044 | ||
1045 | // - 3rd part of initialisation : about V0 part in cascades | |
1046 | Double_t lInvMassLambdaAsCascDghter = 0.; | |
1047 | //Double_t lV0Chi2Xi = -1. ; | |
1048 | Double_t lDcaV0DaughtersXi = -1.; | |
1049 | ||
1050 | Double_t lDcaBachToPrimVertexXi = -1., lDcaV0ToPrimVertexXi = -1.; | |
1051 | Double_t lDcaPosToPrimVertexXi = -1.; | |
1052 | Double_t lDcaNegToPrimVertexXi = -1.; | |
1053 | Double_t lV0CosineOfPointingAngleXi = -1. ; | |
1054 | Double_t lV0CosineOfPointingAngleXiSpecial = -1. ; | |
1055 | Double_t lPosV0Xi[3] = { -1000. , -1000., -1000. }; // Position of VO coming from cascade | |
1056 | Double_t lV0RadiusXi = -1000.0; | |
1057 | Double_t lV0quality = 0.; | |
1058 | ||
1059 | // - 4th part of initialisation : Effective masses | |
1060 | Double_t lInvMassXiMinus = 0.; | |
1061 | Double_t lInvMassXiPlus = 0.; | |
1062 | Double_t lInvMassOmegaMinus = 0.; | |
1063 | Double_t lInvMassOmegaPlus = 0.; | |
1064 | ||
1065 | // - 6th part of initialisation : extra info for QA | |
1066 | Double_t lXiMomX = 0. , lXiMomY = 0., lXiMomZ = 0.; | |
1067 | Double_t lXiTransvMom = 0. ; | |
1068 | //Double_t lXiTransvMomMC= 0. ; | |
1069 | Double_t lXiTotMom = 0. ; | |
1070 | ||
1071 | Double_t lBachMomX = 0., lBachMomY = 0., lBachMomZ = 0.; | |
1072 | //Double_t lBachTransvMom = 0.; | |
1073 | //Double_t lBachTotMom = 0.; | |
1074 | ||
1075 | fTreeCascVarNegNSigmaPion = -100; | |
1076 | fTreeCascVarNegNSigmaProton = -100; | |
1077 | fTreeCascVarPosNSigmaPion = -100; | |
1078 | fTreeCascVarPosNSigmaProton = -100; | |
1079 | fTreeCascVarBachNSigmaPion = -100; | |
1080 | fTreeCascVarBachNSigmaKaon = -100; | |
1081 | ||
1082 | Short_t lChargeXi = -2; | |
1083 | //Double_t lV0toXiCosineOfPointingAngle = 0. ; | |
1084 | ||
1085 | Double_t lRapXi = -20.0, lRapOmega = -20.0; // lEta = -20.0, lTheta = 360., lPhi = 720. ; | |
1086 | //Double_t lAlphaXi = -200., lPtArmXi = -200.0; | |
1087 | ||
1088 | // ------------------------------------- | |
1089 | // II.ESD - Calculation Part dedicated to Xi vertices (ESD) | |
1090 | ||
1091 | AliESDcascade *xi = lESDevent->GetCascade(iXi); | |
1092 | if (!xi) continue; | |
1093 | ||
1094 | // - II.Step 2 : Assigning the necessary variables for specific AliESDcascade data members (ESD) | |
1095 | //------------- | |
1096 | lV0quality = 0.; | |
1097 | xi->ChangeMassHypothesis(lV0quality , 3312); // default working hypothesis : cascade = Xi- decay | |
1098 | ||
1099 | lEffMassXi = xi->GetEffMassXi(); | |
1100 | //lChi2Xi = xi->GetChi2Xi(); | |
1101 | lDcaXiDaughters = xi->GetDcaXiDaughters(); | |
1102 | lXiCosineOfPointingAngle = xi->GetCascadeCosineOfPointingAngle( lBestPrimaryVtxPos[0], | |
1103 | lBestPrimaryVtxPos[1], | |
1104 | lBestPrimaryVtxPos[2] ); | |
1105 | // Take care : the best available vertex should be used (like in AliCascadeVertexer) | |
1106 | ||
1107 | xi->GetXYZcascade( lPosXi[0], lPosXi[1], lPosXi[2] ); | |
1108 | lXiRadius = TMath::Sqrt( lPosXi[0]*lPosXi[0] + lPosXi[1]*lPosXi[1] ); | |
1109 | ||
1110 | // - II.Step 3 : around the tracks : Bach + V0 (ESD) | |
1111 | // ~ Necessary variables for ESDcascade data members coming from the ESDv0 part (inheritance) | |
1112 | //------------- | |
1113 | ||
1114 | UInt_t lIdxPosXi = (UInt_t) TMath::Abs( xi->GetPindex() ); | |
1115 | UInt_t lIdxNegXi = (UInt_t) TMath::Abs( xi->GetNindex() ); | |
1116 | UInt_t lBachIdx = (UInt_t) TMath::Abs( xi->GetBindex() ); | |
1117 | // Care track label can be negative in MC production (linked with the track quality) | |
1118 | // However = normally, not the case for track index ... | |
1119 | ||
1120 | // FIXME : rejection of a double use of a daughter track (nothing but just a crosscheck of what is done in the cascade vertexer) | |
1121 | if(lBachIdx == lIdxNegXi) { | |
1122 | AliWarning("Pb / Idx(Bach. track) = Idx(Neg. track) ... continue!"); continue; | |
1123 | } | |
1124 | if(lBachIdx == lIdxPosXi) { | |
1125 | AliWarning("Pb / Idx(Bach. track) = Idx(Pos. track) ... continue!"); continue; | |
1126 | } | |
1127 | ||
1128 | AliESDtrack *pTrackXi = lESDevent->GetTrack( lIdxPosXi ); | |
1129 | AliESDtrack *nTrackXi = lESDevent->GetTrack( lIdxNegXi ); | |
1130 | AliESDtrack *bachTrackXi = lESDevent->GetTrack( lBachIdx ); | |
1131 | ||
1132 | if (!pTrackXi || !nTrackXi || !bachTrackXi ) { | |
1133 | AliWarning("ERROR: Could not retrieve one of the 3 ESD daughter tracks of the cascade ..."); | |
1134 | continue; | |
1135 | } | |
1136 | ||
1137 | fTreeCascVarPosEta = pTrackXi->Eta(); | |
1138 | fTreeCascVarNegEta = nTrackXi->Eta(); | |
1139 | fTreeCascVarBachEta = bachTrackXi->Eta(); | |
1140 | ||
1141 | Double_t lBMom[3], lNMom[3], lPMom[3]; | |
1142 | xi->GetBPxPyPz( lBMom[0], lBMom[1], lBMom[2] ); | |
1143 | xi->GetPPxPyPz( lPMom[0], lPMom[1], lPMom[2] ); | |
1144 | xi->GetNPxPyPz( lNMom[0], lNMom[1], lNMom[2] ); | |
1145 | ||
1146 | //fTreeCascVarBachTransMom = TMath::Sqrt( lBMom[0]*lBMom[0] + lBMom[1]*lBMom[1] ); | |
1147 | //fTreeCascVarPosTransMom = TMath::Sqrt( lPMom[0]*lPMom[0] + lPMom[1]*lPMom[1] ); | |
1148 | //fTreeCascVarNegTransMom = TMath::Sqrt( lNMom[0]*lNMom[0] + lNMom[1]*lNMom[1] ); | |
1149 | ||
1150 | //------------------------------------------------ | |
1151 | // TPC dEdx information | |
1152 | //------------------------------------------------ | |
1153 | fTreeCascVarNegNSigmaPion = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kPion ); | |
1154 | fTreeCascVarNegNSigmaProton = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kProton ); | |
1155 | fTreeCascVarPosNSigmaPion = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kPion ); | |
1156 | fTreeCascVarPosNSigmaProton = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kProton ); | |
1157 | fTreeCascVarBachNSigmaPion = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kPion ); | |
1158 | fTreeCascVarBachNSigmaKaon = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kKaon ); | |
1159 | ||
1160 | //------------------------------------------------ | |
1161 | // TPC Number of clusters info | |
1162 | // --- modified to save the smallest number | |
1163 | // --- of TPC clusters for the 3 tracks | |
1164 | //------------------------------------------------ | |
1165 | ||
1166 | lPosTPCClusters = pTrackXi->GetTPCNcls(); | |
1167 | lNegTPCClusters = nTrackXi->GetTPCNcls(); | |
1168 | lBachTPCClusters = bachTrackXi->GetTPCNcls(); | |
1169 | ||
1170 | // 1 - Poor quality related to TPCrefit | |
1171 | ULong_t pStatus = pTrackXi->GetStatus(); | |
1172 | ULong_t nStatus = nTrackXi->GetStatus(); | |
1173 | ULong_t bachStatus = bachTrackXi->GetStatus(); | |
1174 | ||
1175 | //fTreeCascVarkITSRefitBachelor = kTRUE; | |
1176 | //fTreeCascVarkITSRefitNegative = kTRUE; | |
1177 | //fTreeCascVarkITSRefitPositive = kTRUE; | |
1178 | ||
1179 | if ((pStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / V0 Pos. track has no TPCrefit ... continue!"); continue; } | |
1180 | if ((nStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / V0 Neg. track has no TPCrefit ... continue!"); continue; } | |
1181 | if ((bachStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / Bach. track has no TPCrefit ... continue!"); continue; } | |
1182 | ||
af0d4791 | 1183 | // 2 - Poor quality related to TPC clusters: lowest cut of 70 clusters |
1184 | if(lPosTPCClusters < 70) { AliWarning("Pb / V0 Pos. track has less than 70 TPC clusters ... continue!"); continue; } | |
1185 | if(lNegTPCClusters < 70) { AliWarning("Pb / V0 Neg. track has less than 70 TPC clusters ... continue!"); continue; } | |
1186 | if(lBachTPCClusters < 70) { AliWarning("Pb / Bach. track has less than 70 TPC clusters ... continue!"); continue; } | |
1187 | Int_t leastnumberofclusters = 1000; | |
1188 | if( lPosTPCClusters < leastnumberofclusters ) leastnumberofclusters = lPosTPCClusters; | |
1189 | if( lNegTPCClusters < leastnumberofclusters ) leastnumberofclusters = lNegTPCClusters; | |
1190 | if( lBachTPCClusters < leastnumberofclusters ) leastnumberofclusters = lBachTPCClusters; | |
1191 | ||
1192 | lInvMassLambdaAsCascDghter = xi->GetEffMass(); | |
1193 | // This value shouldn't change, whatever the working hyp. is : Xi-, Xi+, Omega-, Omega+ | |
1194 | lDcaV0DaughtersXi = xi->GetDcaV0Daughters(); | |
1195 | //lV0Chi2Xi = xi->GetChi2V0(); | |
1196 | ||
1197 | lV0CosineOfPointingAngleXi = xi->GetV0CosineOfPointingAngle( lBestPrimaryVtxPos[0], | |
1198 | lBestPrimaryVtxPos[1], | |
1199 | lBestPrimaryVtxPos[2] ); | |
1200 | //Modification: V0 CosPA wrt to Cascade decay vertex | |
1201 | lV0CosineOfPointingAngleXiSpecial = xi->GetV0CosineOfPointingAngle( lPosXi[0], | |
1202 | lPosXi[1], | |
1203 | lPosXi[2] ); | |
1204 | ||
1205 | lDcaV0ToPrimVertexXi = xi->GetD( lBestPrimaryVtxPos[0], | |
1206 | lBestPrimaryVtxPos[1], | |
1207 | lBestPrimaryVtxPos[2] ); | |
1208 | ||
1209 | lDcaBachToPrimVertexXi = TMath::Abs( bachTrackXi->GetD( lBestPrimaryVtxPos[0], | |
1210 | lBestPrimaryVtxPos[1], | |
1211 | lMagneticField ) ); | |
1212 | // Note : AliExternalTrackParam::GetD returns an algebraic value ... | |
1213 | ||
1214 | xi->GetXYZ( lPosV0Xi[0], lPosV0Xi[1], lPosV0Xi[2] ); | |
1215 | lV0RadiusXi = TMath::Sqrt( lPosV0Xi[0]*lPosV0Xi[0] + lPosV0Xi[1]*lPosV0Xi[1] ); | |
1216 | ||
1217 | lDcaPosToPrimVertexXi = TMath::Abs( pTrackXi ->GetD( lBestPrimaryVtxPos[0], | |
1218 | lBestPrimaryVtxPos[1], | |
1219 | lMagneticField ) ); | |
1220 | ||
1221 | lDcaNegToPrimVertexXi = TMath::Abs( nTrackXi ->GetD( lBestPrimaryVtxPos[0], | |
1222 | lBestPrimaryVtxPos[1], | |
1223 | lMagneticField ) ); | |
1224 | ||
1225 | // - II.Step 4 : around effective masses (ESD) | |
1226 | // ~ change mass hypotheses to cover all the possibilities : Xi-/+, Omega -/+ | |
1227 | ||
1228 | if( bachTrackXi->Charge() < 0 ) { | |
1229 | lV0quality = 0.; | |
1230 | xi->ChangeMassHypothesis(lV0quality , 3312); | |
1231 | // Calculate the effective mass of the Xi- candidate. | |
1232 | // pdg code 3312 = Xi- | |
1233 | lInvMassXiMinus = xi->GetEffMassXi(); | |
1234 | ||
1235 | lV0quality = 0.; | |
1236 | xi->ChangeMassHypothesis(lV0quality , 3334); | |
1237 | // Calculate the effective mass of the Xi- candidate. | |
1238 | // pdg code 3334 = Omega- | |
1239 | lInvMassOmegaMinus = xi->GetEffMassXi(); | |
1240 | ||
1241 | lV0quality = 0.; | |
1242 | xi->ChangeMassHypothesis(lV0quality , 3312); // Back to default hyp. | |
1243 | }// end if negative bachelor | |
1244 | ||
1245 | ||
1246 | if( bachTrackXi->Charge() > 0 ){ | |
1247 | lV0quality = 0.; | |
1248 | xi->ChangeMassHypothesis(lV0quality , -3312); | |
1249 | // Calculate the effective mass of the Xi+ candidate. | |
1250 | // pdg code -3312 = Xi+ | |
1251 | lInvMassXiPlus = xi->GetEffMassXi(); | |
1252 | ||
1253 | lV0quality = 0.; | |
1254 | xi->ChangeMassHypothesis(lV0quality , -3334); | |
1255 | // Calculate the effective mass of the Xi+ candidate. | |
1256 | // pdg code -3334 = Omega+ | |
1257 | lInvMassOmegaPlus = xi->GetEffMassXi(); | |
1258 | ||
1259 | lV0quality = 0.; | |
1260 | xi->ChangeMassHypothesis(lV0quality , -3312); // Back to "default" hyp. | |
1261 | }// end if positive bachelor | |
1262 | // - II.Step 6 : extra info for QA (ESD) | |
1263 | // miscellaneous pieces of info that may help regarding data quality assessment. | |
1264 | //------------- | |
1265 | ||
1266 | xi->GetPxPyPz( lXiMomX, lXiMomY, lXiMomZ ); | |
1267 | lXiTransvMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY ); | |
1268 | lXiTotMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY + lXiMomZ*lXiMomZ ); | |
1269 | ||
1270 | xi->GetBPxPyPz( lBachMomX, lBachMomY, lBachMomZ ); | |
1271 | //lBachTransvMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY ); | |
1272 | //lBachTotMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY + lBachMomZ*lBachMomZ ); | |
1273 | ||
1274 | lChargeXi = xi->Charge(); | |
1275 | ||
1276 | //lV0toXiCosineOfPointingAngle = xi->GetV0CosineOfPointingAngle( lPosXi[0], lPosXi[1], lPosXi[2] ); | |
1277 | ||
1278 | lRapXi = xi->RapXi(); | |
1279 | lRapOmega = xi->RapOmega(); | |
1280 | //lEta = xi->Eta(); | |
1281 | //lTheta = xi->Theta() *180.0/TMath::Pi(); | |
1282 | //lPhi = xi->Phi() *180.0/TMath::Pi(); | |
1283 | //lAlphaXi = xi->AlphaXi(); | |
1284 | //lPtArmXi = xi->PtArmXi(); | |
1285 | ||
1286 | //------------------------------------------------ | |
1287 | // Set Variables for adding to tree | |
1288 | //------------------------------------------------ | |
1289 | ||
1290 | fTreeCascVarCharge = lChargeXi; | |
1291 | if(lInvMassXiMinus!=0) fTreeCascVarMassAsXi = lInvMassXiMinus; | |
1292 | if(lInvMassXiPlus!=0) fTreeCascVarMassAsXi = lInvMassXiPlus; | |
1293 | if(lInvMassOmegaMinus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaMinus; | |
1294 | if(lInvMassOmegaPlus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaPlus; | |
1295 | fTreeCascVarPt = lXiTransvMom; | |
1296 | fTreeCascVarRapXi = lRapXi ; | |
1297 | fTreeCascVarRapOmega = lRapOmega ; | |
1298 | fTreeCascVarDCACascDaughters = lDcaXiDaughters; | |
1299 | fTreeCascVarDCABachToPrimVtx = lDcaBachToPrimVertexXi; | |
1300 | fTreeCascVarDCAV0Daughters = lDcaV0DaughtersXi; | |
1301 | fTreeCascVarDCAV0ToPrimVtx = lDcaV0ToPrimVertexXi; | |
1302 | fTreeCascVarDCAPosToPrimVtx = lDcaPosToPrimVertexXi; | |
1303 | fTreeCascVarDCANegToPrimVtx = lDcaNegToPrimVertexXi; | |
1304 | fTreeCascVarCascCosPointingAngle = lXiCosineOfPointingAngle; | |
1305 | fTreeCascVarCascRadius = lXiRadius; | |
1306 | fTreeCascVarV0Mass = lInvMassLambdaAsCascDghter; | |
1307 | fTreeCascVarV0CosPointingAngle = lV0CosineOfPointingAngleXi; | |
1308 | fTreeCascVarV0CosPointingAngleSpecial = lV0CosineOfPointingAngleXiSpecial; | |
1309 | fTreeCascVarV0Radius = lV0RadiusXi; | |
1310 | fTreeCascVarLeastNbrClusters = leastnumberofclusters; | |
1311 | ||
1312 | //Copy Multiplicity information | |
1313 | fTreeCascVarCentV0A = fCentrality_V0A; | |
1314 | fTreeCascVarCentV0C = fCentrality_V0C; | |
1315 | fTreeCascVarCentV0M = fCentrality_V0M; | |
1316 | fTreeCascVarCentV0AEq = fCentrality_V0AEq; | |
1317 | fTreeCascVarCentV0CEq = fCentrality_V0CEq; | |
1318 | fTreeCascVarCentV0MEq = fCentrality_V0MEq; | |
1319 | fTreeCascVarAmpV0A = fAmplitude_V0A; | |
1320 | fTreeCascVarAmpV0C = fAmplitude_V0C; | |
1321 | fTreeCascVarAmpV0AEq = fAmplitude_V0AEq; | |
1322 | fTreeCascVarAmpV0CEq = fAmplitude_V0CEq; | |
1323 | fTreeCascVarRefMultEta8 = fRefMultEta8; | |
1324 | fTreeCascVarRefMultEta5 = fRefMultEta5; | |
26d39641 | 1325 | fTreeCascVarRunNumber = fRunNumber; |
af0d4791 | 1326 | |
1327 | fTreeCascVarDistOverTotMom = TMath::Sqrt( | |
1328 | TMath::Power( lPosXi[0] - lBestPrimaryVtxPos[0] , 2) + | |
1329 | TMath::Power( lPosXi[1] - lBestPrimaryVtxPos[1] , 2) + | |
1330 | TMath::Power( lPosXi[2] - lBestPrimaryVtxPos[2] , 2) | |
1331 | ); | |
1332 | fTreeCascVarDistOverTotMom /= (lXiTotMom+1e-13); | |
1333 | ||
1334 | //All vars not specified here: specified elsewhere! | |
1335 | ||
1336 | //------------------------------------------------ | |
1337 | // Fill Tree! | |
1338 | //------------------------------------------------ | |
1339 | ||
1340 | // The conditional is meant to decrease excessive | |
1341 | // memory usage! Be careful when loosening the | |
1342 | // cut! | |
1343 | ||
1344 | //Xi Mass window: 150MeV wide | |
1345 | //Omega mass window: 150MeV wide | |
1346 | ||
1347 | if( fkSaveCascadeTree && ( (fTreeCascVarMassAsXi<1.32+0.075&&fTreeCascVarMassAsXi>1.32-0.075) || | |
1348 | (fTreeCascVarMassAsOmega<1.68+0.075&&fTreeCascVarMassAsOmega>1.68-0.075) ) ){ | |
1349 | fTreeCascade->Fill(); | |
1350 | } | |
1351 | ||
1352 | //------------------------------------------------ | |
1353 | // Fill tree over. | |
1354 | //------------------------------------------------ | |
1355 | ||
1356 | }// end of the Cascade loop (ESD or AOD) | |
1357 | ||
1358 | // Post output data. | |
1359 | PostData(1, fListHist); | |
1360 | PostData(2, fTreeEvent); | |
1361 | PostData(3, fTreeV0); | |
1362 | PostData(4, fTreeCascade); | |
1363 | } | |
1364 | ||
1365 | //________________________________________________________________________ | |
1366 | void AliAnalysisTaskStrangenessVsMultiplicity::Terminate(Option_t *) | |
1367 | { | |
1368 | // Draw result to the screen | |
1369 | // Called once at the end of the query | |
1370 | ||
1371 | TList *cRetrievedList = 0x0; | |
1372 | cRetrievedList = (TList*)GetOutputData(1); | |
1373 | if(!cRetrievedList){ | |
1374 | Printf("ERROR - AliAnalysisTaskStrangenessVsMultiplicity : ouput data container list not available\n"); | |
1375 | return; | |
1376 | } | |
1377 | ||
1378 | fHistEventCounter = dynamic_cast<TH1D*> ( cRetrievedList->FindObject("fHistEventCounter") ); | |
1379 | if (!fHistEventCounter) { | |
1380 | Printf("ERROR - AliAnalysisTaskStrangenessVsMultiplicity : fHistEventCounter not available"); | |
1381 | return; | |
1382 | } | |
1383 | ||
1384 | TCanvas *canCheck = new TCanvas("AliAnalysisTaskStrangenessVsMultiplicity","V0 Multiplicity",10,10,510,510); | |
1385 | canCheck->cd(1)->SetLogy(); | |
1386 | ||
1387 | fHistEventCounter->SetMarkerStyle(22); | |
1388 | fHistEventCounter->DrawCopy("E"); | |
1389 | } | |
1390 | ||
1391 | //---------------------------------------------------------------------------- | |
1392 | ||
1393 | Double_t AliAnalysisTaskStrangenessVsMultiplicity::MyRapidity(Double_t rE, Double_t rPz) const | |
1394 | { | |
1395 | // Local calculation for rapidity | |
1396 | Double_t ReturnValue = -100; | |
1397 | if( (rE-rPz+1.e-13) != 0 && (rE+rPz) != 0 ){ | |
1398 | ReturnValue = 0.5*TMath::Log((rE+rPz)/(rE-rPz+1.e-13)); | |
1399 | } | |
1400 | return ReturnValue; | |
1401 | } |