]>
Commit | Line | Data |
---|---|---|
76029adc | 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 | // --- Adapted to look for lambdas as well, using code from | |
24 | // AliAnalysisTaskCheckPerformanceStrange.cxx | |
25 | // | |
26 | // --- Algorithm Description | |
27 | // 1. Loop over primaries in stack to acquire generated charged Xi | |
9a8f3aee | 28 | // 2. Loop over stack to find Cascades, fill TH3Fs "PrimRawPt"s for Efficiency |
76029adc | 29 | // 3. Perform Physics Selection |
30 | // 4. Perform Primary Vertex |z|<10cm selection | |
31 | // 5. Perform Primary Vertex NoTPCOnly vertexing selection (>0 contrib.) | |
32 | // 6. Perform Pileup Rejection | |
33 | // 7. Analysis Loops: | |
34 | // 7a. Fill TH3Fs "PrimAnalysisPt" for control purposes only | |
76029adc | 35 | // |
36 | // Please Report Any Bugs! | |
37 | // | |
38 | // --- David Dobrigkeit Chinellato | |
39 | // (david.chinellato@gmail.com) | |
40 | // | |
41 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
42 | ||
43 | class TTree; | |
44 | class TParticle; | |
45 | class TVector3; | |
46 | ||
47 | //class AliMCEventHandler; | |
48 | //class AliMCEvent; | |
49 | //class AliStack; | |
50 | ||
51 | class AliESDVertex; | |
52 | class AliAODVertex; | |
53 | class AliESDv0; | |
54 | class AliAODv0; | |
55 | ||
56 | #include <Riostream.h> | |
57 | #include "TList.h" | |
58 | #include "TH1.h" | |
59 | #include "TH2.h" | |
60 | #include "TH3.h" | |
61 | #include "TFile.h" | |
62 | #include "THnSparse.h" | |
63 | #include "TVector3.h" | |
64 | #include "TCanvas.h" | |
65 | #include "TMath.h" | |
66 | #include "TLegend.h" | |
67 | #include "AliLog.h" | |
68 | ||
69 | #include "AliESDEvent.h" | |
70 | #include "AliAODEvent.h" | |
71 | #include "AliV0vertexer.h" | |
72 | #include "AliCascadeVertexer.h" | |
73 | #include "AliESDpid.h" | |
74 | #include "AliESDtrack.h" | |
75 | #include "AliESDtrackCuts.h" | |
76 | #include "AliInputEventHandler.h" | |
77 | #include "AliAnalysisManager.h" | |
78 | #include "AliMCEventHandler.h" | |
79 | #include "AliMCEvent.h" | |
80 | #include "AliStack.h" | |
81 | ||
82 | #include "AliCFContainer.h" | |
83 | #include "AliMultiplicity.h" | |
84 | #include "AliAODMCParticle.h" | |
85 | #include "AliESDcascade.h" | |
86 | #include "AliAODcascade.h" | |
87 | #include "AliESDUtils.h" | |
88 | #include "AliGenEventHeader.h" | |
89 | ||
90 | #include "AliAnalysisTaskExtractPerformanceCascade.h" | |
91 | ||
92 | using std::cout; | |
93 | using std::endl; | |
94 | ||
95 | ClassImp(AliAnalysisTaskExtractPerformanceCascade) | |
96 | ||
97 | AliAnalysisTaskExtractPerformanceCascade::AliAnalysisTaskExtractPerformanceCascade() | |
98 | : AliAnalysisTaskSE(), fListHist(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), | |
99 | fkIsNuclear ( kFALSE ), | |
2213f6fc | 100 | fkSwitchINT7 ( kFALSE ), |
da3539d8 | 101 | fpArapidityShift ( 0.465 ), |
102 | fCentralityEstimator("V0M"), | |
2213f6fc | 103 | //------------------------------------------------ |
104 | // Tree Variables | |
105 | //------------------------------------------------ | |
106 | ||
107 | fTreeCascVarCharge(0), | |
108 | fTreeCascVarMassAsXi(0), | |
109 | fTreeCascVarMassAsOmega(0), | |
110 | fTreeCascVarPt(0), | |
111 | fTreeCascVarPtMC(0), | |
112 | fTreeCascVarRapMC(0), | |
113 | fTreeCascVarRapXi(0), | |
114 | fTreeCascVarRapOmega(0), | |
115 | fTreeCascVarNegEta(0), | |
116 | fTreeCascVarPosEta(0), | |
117 | fTreeCascVarBachEta(0), | |
118 | fTreeCascVarDCACascDaughters(0), | |
119 | fTreeCascVarDCABachToPrimVtx(0), | |
120 | fTreeCascVarDCAV0Daughters(0), | |
121 | fTreeCascVarDCAV0ToPrimVtx(0), | |
122 | fTreeCascVarDCAPosToPrimVtx(0), | |
123 | fTreeCascVarDCANegToPrimVtx(0), | |
124 | fTreeCascVarCascCosPointingAngle(0), | |
125 | fTreeCascVarCascRadius(0), | |
126 | fTreeCascVarV0Mass(0), | |
127 | fTreeCascVarV0CosPointingAngle(0), | |
128 | fTreeCascVarV0Radius(0), | |
129 | fTreeCascVarLeastNbrClusters(0), | |
130 | fTreeCascVarMultiplicity(0), | |
aa06bcc8 | 131 | fTreeCascVarMultiplicityV0A(0), |
132 | fTreeCascVarMultiplicityZNA(0), | |
133 | fTreeCascVarMultiplicityTRK(0), | |
134 | fTreeCascVarMultiplicitySPD(0), | |
2213f6fc | 135 | fTreeCascVarDistOverTotMom(0), |
136 | fTreeCascVarPID(0), | |
137 | fTreeCascVarPIDBachelor(0), | |
138 | fTreeCascVarPIDNegative(0), | |
139 | fTreeCascVarPIDPositive(0), | |
140 | fTreeCascVarPosTransMom(0), | |
141 | fTreeCascVarNegTransMom(0), | |
142 | fTreeCascVarPosTransMomMC(0), | |
143 | fTreeCascVarNegTransMomMC(0), | |
144 | fTreeCascVarNegNSigmaPion(0), | |
145 | fTreeCascVarNegNSigmaProton(0), | |
146 | fTreeCascVarPosNSigmaPion(0), | |
147 | fTreeCascVarPosNSigmaProton(0), | |
148 | fTreeCascVarBachNSigmaPion(0), | |
149 | fTreeCascVarBachNSigmaKaon(0), | |
76029adc | 150 | |
151 | //------------------------------------------------ | |
152 | // HISTOGRAMS | |
153 | // --- Filled on an Event-by-event basis | |
154 | //------------------------------------------------ | |
155 | fHistV0MultiplicityBeforeTrigSel(0), | |
156 | fHistV0MultiplicityForTrigEvt(0), | |
157 | fHistV0MultiplicityForSelEvt(0), | |
158 | fHistV0MultiplicityForSelEvtNoTPCOnly(0), | |
159 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0), | |
160 | fHistMultiplicityBeforeTrigSel(0), | |
161 | fHistMultiplicityForTrigEvt(0), | |
162 | fHistMultiplicity(0), | |
163 | fHistMultiplicityNoTPCOnly(0), | |
164 | fHistMultiplicityNoTPCOnlyNoPileup(0), | |
165 | ||
aa06bcc8 | 166 | //V0A Centrality |
167 | fHistMultiplicityV0ABeforeTrigSel(0), | |
168 | fHistMultiplicityV0AForTrigEvt(0), | |
169 | fHistMultiplicityV0A(0), | |
170 | fHistMultiplicityV0ANoTPCOnly(0), | |
171 | fHistMultiplicityV0ANoTPCOnlyNoPileup(0), | |
172 | ||
173 | //ZNA Centrality | |
174 | fHistMultiplicityZNABeforeTrigSel(0), | |
175 | fHistMultiplicityZNAForTrigEvt(0), | |
176 | fHistMultiplicityZNA(0), | |
177 | fHistMultiplicityZNANoTPCOnly(0), | |
178 | fHistMultiplicityZNANoTPCOnlyNoPileup(0), | |
179 | ||
180 | //TRK Centrality | |
181 | fHistMultiplicityTRKBeforeTrigSel(0), | |
182 | fHistMultiplicityTRKForTrigEvt(0), | |
183 | fHistMultiplicityTRK(0), | |
184 | fHistMultiplicityTRKNoTPCOnly(0), | |
185 | fHistMultiplicityTRKNoTPCOnlyNoPileup(0), | |
186 | ||
187 | //SPD Centrality | |
188 | fHistMultiplicitySPDBeforeTrigSel(0), | |
189 | fHistMultiplicitySPDForTrigEvt(0), | |
190 | fHistMultiplicitySPD(0), | |
191 | fHistMultiplicitySPDNoTPCOnly(0), | |
192 | fHistMultiplicitySPDNoTPCOnlyNoPileup(0), | |
193 | ||
194 | ||
76029adc | 195 | //------------------------------------------------ |
196 | // PARTICLE HISTOGRAMS | |
197 | // --- Filled on a Particle-by-Particle basis | |
198 | //------------------------------------------------ | |
199 | f3dHistGenPtVsYVsMultXiMinus(0), | |
200 | f3dHistGenPtVsYVsMultXiPlus(0), | |
201 | f3dHistGenPtVsYVsMultOmegaMinus(0), | |
202 | f3dHistGenPtVsYVsMultOmegaPlus(0), | |
203 | f3dHistGenSelectedPtVsYVsMultXiMinus(0), | |
204 | f3dHistGenSelectedPtVsYVsMultXiPlus(0), | |
205 | f3dHistGenSelectedPtVsYVsMultOmegaMinus(0), | |
206 | f3dHistGenSelectedPtVsYVsMultOmegaPlus(0), | |
da3539d8 | 207 | f3dHistGenPtVsYCMSVsMultXiMinus(0), |
208 | f3dHistGenPtVsYCMSVsMultXiPlus(0), | |
209 | f3dHistGenPtVsYCMSVsMultOmegaMinus(0), | |
210 | f3dHistGenPtVsYCMSVsMultOmegaPlus(0), | |
211 | f3dHistGenSelectedPtVsYCMSVsMultXiMinus(0), | |
212 | f3dHistGenSelectedPtVsYCMSVsMultXiPlus(0), | |
213 | f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus(0), | |
214 | f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus(0), | |
76029adc | 215 | fHistPVx(0), |
216 | fHistPVy(0), | |
217 | fHistPVz(0), | |
218 | fHistPVxAnalysis(0), | |
219 | fHistPVyAnalysis(0), | |
220 | fHistPVzAnalysis(0) | |
221 | { | |
222 | // Dummy Constructor | |
223 | } | |
224 | ||
225 | AliAnalysisTaskExtractPerformanceCascade::AliAnalysisTaskExtractPerformanceCascade(const char *name) | |
226 | : AliAnalysisTaskSE(name), fListHist(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), | |
227 | fkIsNuclear ( kFALSE ), | |
2213f6fc | 228 | fkSwitchINT7 ( kFALSE ), |
da3539d8 | 229 | fpArapidityShift ( 0.465 ), |
230 | fCentralityEstimator("V0M"), | |
2213f6fc | 231 | //------------------------------------------------ |
232 | // Tree Variables | |
233 | //------------------------------------------------ | |
234 | ||
235 | fTreeCascVarCharge(0), | |
236 | fTreeCascVarMassAsXi(0), | |
237 | fTreeCascVarMassAsOmega(0), | |
238 | fTreeCascVarPt(0), | |
239 | fTreeCascVarPtMC(0), | |
240 | fTreeCascVarRapMC(0), | |
241 | fTreeCascVarRapXi(0), | |
242 | fTreeCascVarRapOmega(0), | |
243 | fTreeCascVarNegEta(0), | |
244 | fTreeCascVarPosEta(0), | |
245 | fTreeCascVarBachEta(0), | |
246 | fTreeCascVarDCACascDaughters(0), | |
247 | fTreeCascVarDCABachToPrimVtx(0), | |
248 | fTreeCascVarDCAV0Daughters(0), | |
249 | fTreeCascVarDCAV0ToPrimVtx(0), | |
250 | fTreeCascVarDCAPosToPrimVtx(0), | |
251 | fTreeCascVarDCANegToPrimVtx(0), | |
252 | fTreeCascVarCascCosPointingAngle(0), | |
253 | fTreeCascVarCascRadius(0), | |
254 | fTreeCascVarV0Mass(0), | |
255 | fTreeCascVarV0CosPointingAngle(0), | |
256 | fTreeCascVarV0Radius(0), | |
257 | fTreeCascVarLeastNbrClusters(0), | |
258 | fTreeCascVarMultiplicity(0), | |
aa06bcc8 | 259 | fTreeCascVarMultiplicityV0A(0), |
260 | fTreeCascVarMultiplicityZNA(0), | |
261 | fTreeCascVarMultiplicityTRK(0), | |
262 | fTreeCascVarMultiplicitySPD(0), | |
2213f6fc | 263 | fTreeCascVarDistOverTotMom(0), |
264 | fTreeCascVarPID(0), | |
265 | fTreeCascVarPIDBachelor(0), | |
266 | fTreeCascVarPIDNegative(0), | |
267 | fTreeCascVarPIDPositive(0), | |
268 | fTreeCascVarPosTransMom(0), | |
269 | fTreeCascVarNegTransMom(0), | |
270 | fTreeCascVarPosTransMomMC(0), | |
271 | fTreeCascVarNegTransMomMC(0), | |
272 | fTreeCascVarNegNSigmaPion(0), | |
273 | fTreeCascVarNegNSigmaProton(0), | |
274 | fTreeCascVarPosNSigmaPion(0), | |
275 | fTreeCascVarPosNSigmaProton(0), | |
276 | fTreeCascVarBachNSigmaPion(0), | |
277 | fTreeCascVarBachNSigmaKaon(0), | |
278 | ||
76029adc | 279 | //------------------------------------------------ |
280 | // HISTOGRAMS | |
281 | // --- Filled on an Event-by-event basis | |
282 | //------------------------------------------------ | |
283 | fHistV0MultiplicityBeforeTrigSel(0), | |
284 | fHistV0MultiplicityForTrigEvt(0), | |
285 | fHistV0MultiplicityForSelEvt(0), | |
286 | fHistV0MultiplicityForSelEvtNoTPCOnly(0), | |
287 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0), | |
288 | fHistMultiplicityBeforeTrigSel(0), | |
289 | fHistMultiplicityForTrigEvt(0), | |
290 | fHistMultiplicity(0), | |
291 | fHistMultiplicityNoTPCOnly(0), | |
292 | fHistMultiplicityNoTPCOnlyNoPileup(0), | |
293 | ||
aa06bcc8 | 294 | //V0A Centrality |
295 | fHistMultiplicityV0ABeforeTrigSel(0), | |
296 | fHistMultiplicityV0AForTrigEvt(0), | |
297 | fHistMultiplicityV0A(0), | |
298 | fHistMultiplicityV0ANoTPCOnly(0), | |
299 | fHistMultiplicityV0ANoTPCOnlyNoPileup(0), | |
300 | ||
301 | //ZNA Centrality | |
302 | fHistMultiplicityZNABeforeTrigSel(0), | |
303 | fHistMultiplicityZNAForTrigEvt(0), | |
304 | fHistMultiplicityZNA(0), | |
305 | fHistMultiplicityZNANoTPCOnly(0), | |
306 | fHistMultiplicityZNANoTPCOnlyNoPileup(0), | |
307 | ||
308 | //TRK Centrality | |
309 | fHistMultiplicityTRKBeforeTrigSel(0), | |
310 | fHistMultiplicityTRKForTrigEvt(0), | |
311 | fHistMultiplicityTRK(0), | |
312 | fHistMultiplicityTRKNoTPCOnly(0), | |
313 | fHistMultiplicityTRKNoTPCOnlyNoPileup(0), | |
314 | ||
315 | //SPD Centrality | |
316 | fHistMultiplicitySPDBeforeTrigSel(0), | |
317 | fHistMultiplicitySPDForTrigEvt(0), | |
318 | fHistMultiplicitySPD(0), | |
319 | fHistMultiplicitySPDNoTPCOnly(0), | |
320 | fHistMultiplicitySPDNoTPCOnlyNoPileup(0), | |
76029adc | 321 | |
322 | //------------------------------------------------ | |
323 | // PARTICLE HISTOGRAMS | |
324 | // --- Filled on a Particle-by-Particle basis | |
325 | //------------------------------------------------ | |
326 | f3dHistGenPtVsYVsMultXiMinus(0), | |
327 | f3dHistGenPtVsYVsMultXiPlus(0), | |
328 | f3dHistGenPtVsYVsMultOmegaMinus(0), | |
329 | f3dHistGenPtVsYVsMultOmegaPlus(0), | |
330 | f3dHistGenSelectedPtVsYVsMultXiMinus(0), | |
331 | f3dHistGenSelectedPtVsYVsMultXiPlus(0), | |
332 | f3dHistGenSelectedPtVsYVsMultOmegaMinus(0), | |
333 | f3dHistGenSelectedPtVsYVsMultOmegaPlus(0), | |
da3539d8 | 334 | f3dHistGenPtVsYCMSVsMultXiMinus(0), |
335 | f3dHistGenPtVsYCMSVsMultXiPlus(0), | |
336 | f3dHistGenPtVsYCMSVsMultOmegaMinus(0), | |
337 | f3dHistGenPtVsYCMSVsMultOmegaPlus(0), | |
338 | f3dHistGenSelectedPtVsYCMSVsMultXiMinus(0), | |
339 | f3dHistGenSelectedPtVsYCMSVsMultXiPlus(0), | |
340 | f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus(0), | |
341 | f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus(0), | |
76029adc | 342 | fHistPVx(0), |
343 | fHistPVy(0), | |
344 | fHistPVz(0), | |
345 | fHistPVxAnalysis(0), | |
346 | fHistPVyAnalysis(0), | |
347 | fHistPVzAnalysis(0) | |
348 | { | |
349 | // Constructor | |
d8841e95 | 350 | |
351 | //Set Variables for re-running the cascade vertexers (as done for MS paper) | |
352 | ||
353 | // New Loose : 1st step for the 7 TeV pp analysis | |
354 | ||
355 | fV0Sels[0] = 33. ; // max allowed chi2 | |
356 | fV0Sels[1] = 0.02; // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05) | |
357 | fV0Sels[2] = 0.02; // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05) | |
358 | fV0Sels[3] = 2.0 ; // max allowed DCA between the daughter tracks (LHC09a4 : 0.5) | |
359 | fV0Sels[4] = 0.95; // min allowed cosine of V0's pointing angle (LHC09a4 : 0.99) | |
360 | fV0Sels[5] = 1.0 ; // min radius of the fiducial volume (LHC09a4 : 0.2) | |
361 | fV0Sels[6] = 100. ; // max radius of the fiducial volume (LHC09a4 : 100.0) | |
362 | ||
363 | fCascSels[0] = 33. ; // max allowed chi2 (same as PDC07) | |
364 | fCascSels[1] = 0.05 ; // min allowed V0 impact parameter (PDC07 : 0.05 / LHC09a4 : 0.025 ) | |
365 | fCascSels[2] = 0.010; // "window" around the Lambda mass (PDC07 : 0.008 / LHC09a4 : 0.010 ) | |
366 | fCascSels[3] = 0.03 ; // min allowed bachelor's impact parameter (PDC07 : 0.035 / LHC09a4 : 0.025 ) | |
367 | fCascSels[4] = 2.0 ; // max allowed DCA between the V0 and the bachelor (PDC07 : 0.1 / LHC09a4 : 0.2 ) | |
368 | fCascSels[5] = 0.95 ; // min allowed cosine of the cascade pointing angle (PDC07 : 0.9985 / LHC09a4 : 0.998 ) | |
369 | fCascSels[6] = 0.4 ; // min radius of the fiducial volume (PDC07 : 0.9 / LHC09a4 : 0.2 ) | |
370 | fCascSels[7] = 100. ; // max radius of the fiducial volume (PDC07 : 100 / LHC09a4 : 100 ) | |
371 | ||
76029adc | 372 | // Output slot #0 writes into a TList container (Cascade) |
373 | DefineOutput(1, TList::Class()); | |
374 | DefineOutput(2, TTree::Class()); | |
375 | } | |
376 | ||
377 | ||
378 | AliAnalysisTaskExtractPerformanceCascade::~AliAnalysisTaskExtractPerformanceCascade() | |
379 | { | |
380 | //------------------------------------------------ | |
381 | // DESTRUCTOR | |
382 | //------------------------------------------------ | |
383 | ||
384 | if (fListHist){ | |
385 | delete fListHist; | |
386 | fListHist = 0x0; | |
387 | } | |
388 | if (fTreeCascade){ | |
389 | delete fTreeCascade; | |
390 | fTreeCascade = 0x0; | |
391 | } | |
392 | //cleanup esd track cuts object too... | |
393 | if (fESDtrackCuts){ | |
394 | delete fESDtrackCuts; | |
395 | fESDtrackCuts = 0x0; | |
396 | } | |
397 | ||
398 | } | |
399 | ||
400 | //________________________________________________________________________ | |
401 | void AliAnalysisTaskExtractPerformanceCascade::UserCreateOutputObjects() | |
402 | { | |
403 | OpenFile(2); | |
404 | // Called once | |
405 | ||
406 | //------------------------------------------------ | |
407 | ||
408 | fTreeCascade = new TTree("fTreeCascade","CascadeCandidates"); | |
409 | ||
410 | //------------------------------------------------ | |
411 | // fTreeCascade Branch definitions - Cascade Tree | |
412 | //------------------------------------------------ | |
413 | ||
414 | //------------------------------------------------ | |
415 | // fTreeCascade Branch definitions | |
416 | //------------------------------------------------ | |
417 | ||
418 | //-----------BASIC-INFO--------------------------- | |
419 | /* 1*/ fTreeCascade->Branch("fTreeCascVarCharge",&fTreeCascVarCharge,"fTreeCascVarCharge/I"); | |
420 | /* 2*/ fTreeCascade->Branch("fTreeCascVarMassAsXi",&fTreeCascVarMassAsXi,"fTreeCascVarMassAsXi/F"); | |
421 | /* 3*/ fTreeCascade->Branch("fTreeCascVarMassAsOmega",&fTreeCascVarMassAsOmega,"fTreeCascVarMassAsOmega/F"); | |
422 | /* 4*/ fTreeCascade->Branch("fTreeCascVarPt",&fTreeCascVarPt,"fTreeCascVarPt/F"); | |
423 | /* 5*/ fTreeCascade->Branch("fTreeCascVarPtMC",&fTreeCascVarPtMC,"fTreeCascVarPtMC/F"); | |
424 | /* 6*/ fTreeCascade->Branch("fTreeCascVarRapXi",&fTreeCascVarRapXi,"fTreeCascVarRapXi/F"); | |
425 | /* 7*/ fTreeCascade->Branch("fTreeCascVarRapMC",&fTreeCascVarRapMC,"fTreeCascVarRapMC/F"); | |
426 | /* 8*/ fTreeCascade->Branch("fTreeCascVarRapOmega",&fTreeCascVarRapOmega,"fTreeCascVarRapOmega/F"); | |
427 | /* 9*/ fTreeCascade->Branch("fTreeCascVarNegEta",&fTreeCascVarNegEta,"fTreeCascVarNegEta/F"); | |
428 | /*10*/ fTreeCascade->Branch("fTreeCascVarPosEta",&fTreeCascVarPosEta,"fTreeCascVarPosEta/F"); | |
429 | /*11*/ fTreeCascade->Branch("fTreeCascVarBachEta",&fTreeCascVarBachEta,"fTreeCascVarBachEta/F"); | |
430 | //-----------INFO-FOR-CUTS------------------------ | |
431 | /*12*/ fTreeCascade->Branch("fTreeCascVarDCACascDaughters",&fTreeCascVarDCACascDaughters,"fTreeCascVarDCACascDaughters/F"); | |
432 | /*13*/ fTreeCascade->Branch("fTreeCascVarDCABachToPrimVtx",&fTreeCascVarDCABachToPrimVtx,"fTreeCascVarDCABachToPrimVtx/F"); | |
433 | /*14*/ fTreeCascade->Branch("fTreeCascVarDCAV0Daughters",&fTreeCascVarDCAV0Daughters,"fTreeCascVarDCAV0Daughters/F"); | |
434 | /*15*/ fTreeCascade->Branch("fTreeCascVarDCAV0ToPrimVtx",&fTreeCascVarDCAV0ToPrimVtx,"fTreeCascVarDCAV0ToPrimVtx/F"); | |
435 | /*16*/ fTreeCascade->Branch("fTreeCascVarDCAPosToPrimVtx",&fTreeCascVarDCAPosToPrimVtx,"fTreeCascVarDCAPosToPrimVtx/F"); | |
436 | /*17*/ fTreeCascade->Branch("fTreeCascVarDCANegToPrimVtx",&fTreeCascVarDCANegToPrimVtx,"fTreeCascVarDCANegToPrimVtx/F"); | |
437 | /*18*/ fTreeCascade->Branch("fTreeCascVarCascCosPointingAngle",&fTreeCascVarCascCosPointingAngle,"fTreeCascVarCascCosPointingAngle/F"); | |
438 | /*19*/ fTreeCascade->Branch("fTreeCascVarCascRadius",&fTreeCascVarCascRadius,"fTreeCascVarCascRadius/F"); | |
439 | /*20*/ fTreeCascade->Branch("fTreeCascVarV0Mass",&fTreeCascVarV0Mass,"fTreeCascVarV0Mass/F"); | |
440 | /*21*/ fTreeCascade->Branch("fTreeCascVarV0CosPointingAngle",&fTreeCascVarV0CosPointingAngle,"fTreeCascVarV0CosPointingAngle/F"); | |
441 | /*22*/ fTreeCascade->Branch("fTreeCascVarV0Radius",&fTreeCascVarV0Radius,"fTreeCascVarV0Radius/F"); | |
442 | /*23*/ fTreeCascade->Branch("fTreeCascVarLeastNbrClusters",&fTreeCascVarLeastNbrClusters,"fTreeCascVarLeastNbrClusters/I"); | |
443 | //-----------MULTIPLICITY-INFO-------------------- | |
444 | /*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicity",&fTreeCascVarMultiplicity,"fTreeCascVarMultiplicity/I"); | |
aa06bcc8 | 445 | /*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicityV0A",&fTreeCascVarMultiplicityV0A,"fTreeCascVarMultiplicityV0A/I"); |
446 | /*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicityZNA",&fTreeCascVarMultiplicityZNA,"fTreeCascVarMultiplicityZNA/I"); | |
447 | /*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicityTRK",&fTreeCascVarMultiplicityTRK,"fTreeCascVarMultiplicityTRK/I"); | |
448 | /*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicitySPD",&fTreeCascVarMultiplicitySPD,"fTreeCascVarMultiplicitySPD/I"); | |
76029adc | 449 | //-----------DECAY-LENGTH-INFO-------------------- |
450 | /*25*/ fTreeCascade->Branch("fTreeCascVarDistOverTotMom",&fTreeCascVarDistOverTotMom,"fTreeCascVarDistOverTotMom/F"); | |
451 | //-----------MC-PID------------------------------- | |
452 | /*26*/ fTreeCascade->Branch("fTreeCascVarPID",&fTreeCascVarPID,"fTreeCascVarPID/I"); | |
453 | /*27*/ fTreeCascade->Branch("fTreeCascVarPIDBachelor",&fTreeCascVarPIDBachelor,"fTreeCascVarPIDBachelor/I"); | |
454 | /*28*/ fTreeCascade->Branch("fTreeCascVarPIDNegative",&fTreeCascVarPIDNegative,"fTreeCascVarPIDNegative/I"); | |
455 | /*29*/ fTreeCascade->Branch("fTreeCascVarPIDPositive",&fTreeCascVarPIDPositive,"fTreeCascVarPIDPositive/I"); | |
456 | /*30*/ fTreeCascade->Branch("fTreeCascVarPosTransMom",&fTreeCascVarPosTransMom,"fTreeCascVarPosTransMom/F"); | |
457 | /*31*/ fTreeCascade->Branch("fTreeCascVarNegTransMom",&fTreeCascVarNegTransMom,"fTreeCascVarNegTransMom/F"); | |
458 | /*32*/ fTreeCascade->Branch("fTreeCascVarPosTransMomMC",&fTreeCascVarPosTransMomMC,"fTreeCascVarPosTransMomMC/F"); | |
459 | /*33*/ fTreeCascade->Branch("fTreeCascVarNegTransMomMC",&fTreeCascVarNegTransMomMC,"fTreeCascVarNegTransMomMC/F"); | |
460 | //------------------------------------------------ | |
461 | /*34*/ fTreeCascade->Branch("fTreeCascVarNegNSigmaPion",&fTreeCascVarNegNSigmaPion,"fTreeCascVarNegNSigmaPion/F"); | |
462 | /*35*/ fTreeCascade->Branch("fTreeCascVarNegNSigmaProton",&fTreeCascVarNegNSigmaProton,"fTreeCascVarNegNSigmaProton/F"); | |
463 | /*36*/ fTreeCascade->Branch("fTreeCascVarPosNSigmaPion",&fTreeCascVarPosNSigmaPion,"fTreeCascVarPosNSigmaPion/F"); | |
464 | /*37*/ fTreeCascade->Branch("fTreeCascVarPosNSigmaProton",&fTreeCascVarPosNSigmaProton,"fTreeCascVarPosNSigmaProton/F"); | |
465 | /*38*/ fTreeCascade->Branch("fTreeCascVarBachNSigmaPion",&fTreeCascVarBachNSigmaPion,"fTreeCascVarBachNSigmaPion/F"); | |
466 | /*39*/ fTreeCascade->Branch("fTreeCascVarBachNSigmaKaon",&fTreeCascVarBachNSigmaKaon,"fTreeCascVarBachNSigmaKaon/F"); | |
467 | ||
468 | //------------------------------------------------ | |
469 | // Particle Identification Setup | |
470 | //------------------------------------------------ | |
471 | ||
472 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); | |
473 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
474 | fPIDResponse = inputHandler->GetPIDResponse(); | |
475 | ||
476 | // Multiplicity | |
477 | ||
478 | if(! fESDtrackCuts ){ | |
479 | fESDtrackCuts = new AliESDtrackCuts(); | |
480 | } | |
481 | ||
482 | //------------------------------------------------ | |
483 | // V0 Multiplicity Histograms | |
484 | //------------------------------------------------ | |
485 | ||
486 | // Create histograms | |
487 | OpenFile(1); | |
488 | fListHist = new TList(); | |
489 | fListHist->SetOwner(); // See http://root.cern.ch/root/html/TCollection.html#TCollection:SetOwner | |
490 | ||
491 | ||
492 | if(! fHistV0MultiplicityBeforeTrigSel) { | |
493 | fHistV0MultiplicityBeforeTrigSel = new TH1F("fHistV0MultiplicityBeforeTrigSel", | |
494 | "V0s per event (before Trig. Sel.);Nbr of V0s/Evt;Events", | |
495 | 25, 0, 25); | |
496 | fListHist->Add(fHistV0MultiplicityBeforeTrigSel); | |
497 | } | |
498 | ||
499 | if(! fHistV0MultiplicityForTrigEvt) { | |
500 | fHistV0MultiplicityForTrigEvt = new TH1F("fHistV0MultiplicityForTrigEvt", | |
501 | "V0s per event (for triggered evt);Nbr of V0s/Evt;Events", | |
502 | 25, 0, 25); | |
503 | fListHist->Add(fHistV0MultiplicityForTrigEvt); | |
504 | } | |
505 | ||
506 | if(! fHistV0MultiplicityForSelEvt) { | |
507 | fHistV0MultiplicityForSelEvt = new TH1F("fHistV0MultiplicityForSelEvt", | |
508 | "V0s per event;Nbr of V0s/Evt;Events", | |
509 | 25, 0, 25); | |
510 | fListHist->Add(fHistV0MultiplicityForSelEvt); | |
511 | } | |
512 | ||
513 | if(! fHistV0MultiplicityForSelEvtNoTPCOnly) { | |
514 | fHistV0MultiplicityForSelEvtNoTPCOnly = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnly", | |
515 | "V0s per event;Nbr of V0s/Evt;Events", | |
516 | 25, 0, 25); | |
517 | fListHist->Add(fHistV0MultiplicityForSelEvtNoTPCOnly); | |
518 | } | |
519 | if(! fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup) { | |
520 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup", | |
521 | "V0s per event;Nbr of V0s/Evt;Events", | |
522 | 25, 0, 25); | |
523 | fListHist->Add(fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup); | |
524 | } | |
525 | ||
526 | //------------------------------------------------ | |
527 | // Track Multiplicity Histograms | |
528 | //------------------------------------------------ | |
529 | ||
530 | if(! fHistMultiplicityBeforeTrigSel) { | |
531 | fHistMultiplicityBeforeTrigSel = new TH1F("fHistMultiplicityBeforeTrigSel", | |
532 | "Tracks per event;Nbr of Tracks;Events", | |
533 | 200, 0, 200); | |
534 | fListHist->Add(fHistMultiplicityBeforeTrigSel); | |
535 | } | |
536 | if(! fHistMultiplicityForTrigEvt) { | |
537 | fHistMultiplicityForTrigEvt = new TH1F("fHistMultiplicityForTrigEvt", | |
538 | "Tracks per event;Nbr of Tracks;Events", | |
539 | 200, 0, 200); | |
540 | fListHist->Add(fHistMultiplicityForTrigEvt); | |
541 | } | |
542 | if(! fHistMultiplicity) { | |
543 | fHistMultiplicity = new TH1F("fHistMultiplicity", | |
544 | "Tracks per event;Nbr of Tracks;Events", | |
545 | 200, 0, 200); | |
546 | fListHist->Add(fHistMultiplicity); | |
547 | } | |
548 | if(! fHistMultiplicityNoTPCOnly) { | |
549 | fHistMultiplicityNoTPCOnly = new TH1F("fHistMultiplicityNoTPCOnly", | |
550 | "Tracks per event;Nbr of Tracks;Events", | |
551 | 200, 0, 200); | |
552 | fListHist->Add(fHistMultiplicityNoTPCOnly); | |
553 | } | |
554 | if(! fHistMultiplicityNoTPCOnlyNoPileup) { | |
555 | fHistMultiplicityNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityNoTPCOnlyNoPileup", | |
556 | "Tracks per event;Nbr of Tracks;Events", | |
557 | 200, 0, 200); | |
558 | fListHist->Add(fHistMultiplicityNoTPCOnlyNoPileup); | |
559 | } | |
aa06bcc8 | 560 | |
561 | ||
562 | //V0A Centrality (if PbPb / pPb) | |
563 | if(! fHistMultiplicityV0ABeforeTrigSel) { | |
564 | fHistMultiplicityV0ABeforeTrigSel = new TH1F("fHistMultiplicityV0ABeforeTrigSel", | |
565 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
566 | 200, 0, 200); | |
567 | fListHist->Add(fHistMultiplicityV0ABeforeTrigSel); | |
568 | } | |
569 | if(! fHistMultiplicityV0AForTrigEvt) { | |
570 | fHistMultiplicityV0AForTrigEvt = new TH1F("fHistMultiplicityV0AForTrigEvt", | |
571 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
572 | 200, 0, 200); | |
573 | fListHist->Add(fHistMultiplicityV0AForTrigEvt); | |
574 | } | |
575 | if(! fHistMultiplicityV0A) { | |
576 | fHistMultiplicityV0A = new TH1F("fHistMultiplicityV0A", | |
577 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
578 | 200, 0, 200); | |
579 | fListHist->Add(fHistMultiplicityV0A); | |
580 | } | |
581 | if(! fHistMultiplicityV0ANoTPCOnly) { | |
582 | fHistMultiplicityV0ANoTPCOnly = new TH1F("fHistMultiplicityV0ANoTPCOnly", | |
583 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
584 | 200, 0, 200); | |
585 | fListHist->Add(fHistMultiplicityV0ANoTPCOnly); | |
586 | } | |
587 | if(! fHistMultiplicityV0ANoTPCOnlyNoPileup) { | |
588 | fHistMultiplicityV0ANoTPCOnlyNoPileup = new TH1F("fHistMultiplicityV0ANoTPCOnlyNoPileup", | |
589 | "Centrality Distribution: V0A;V0A Centrality;Events", | |
590 | 200, 0, 200); | |
591 | fListHist->Add(fHistMultiplicityV0ANoTPCOnlyNoPileup); | |
592 | } | |
593 | ||
594 | //ZNA Centrality (if PbPb / pPb) | |
595 | if(! fHistMultiplicityZNABeforeTrigSel) { | |
596 | fHistMultiplicityZNABeforeTrigSel = new TH1F("fHistMultiplicityZNABeforeTrigSel", | |
597 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
598 | 200, 0, 200); | |
599 | fListHist->Add(fHistMultiplicityZNABeforeTrigSel); | |
600 | } | |
601 | if(! fHistMultiplicityZNAForTrigEvt) { | |
602 | fHistMultiplicityZNAForTrigEvt = new TH1F("fHistMultiplicityZNAForTrigEvt", | |
603 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
604 | 200, 0, 200); | |
605 | fListHist->Add(fHistMultiplicityZNAForTrigEvt); | |
606 | } | |
607 | if(! fHistMultiplicityZNA) { | |
608 | fHistMultiplicityZNA = new TH1F("fHistMultiplicityZNA", | |
609 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
610 | 200, 0, 200); | |
611 | fListHist->Add(fHistMultiplicityZNA); | |
612 | } | |
613 | if(! fHistMultiplicityZNANoTPCOnly) { | |
614 | fHistMultiplicityZNANoTPCOnly = new TH1F("fHistMultiplicityZNANoTPCOnly", | |
615 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
616 | 200, 0, 200); | |
617 | fListHist->Add(fHistMultiplicityZNANoTPCOnly); | |
618 | } | |
619 | if(! fHistMultiplicityZNANoTPCOnlyNoPileup) { | |
620 | fHistMultiplicityZNANoTPCOnlyNoPileup = new TH1F("fHistMultiplicityZNANoTPCOnlyNoPileup", | |
621 | "Centrality Distribution: ZNA;ZNA Centrality;Events", | |
622 | 200, 0, 200); | |
623 | fListHist->Add(fHistMultiplicityZNANoTPCOnlyNoPileup); | |
624 | } | |
625 | ||
626 | //TRK Centrality (if PbPb / pPb) | |
627 | if(! fHistMultiplicityTRKBeforeTrigSel) { | |
628 | fHistMultiplicityTRKBeforeTrigSel = new TH1F("fHistMultiplicityTRKBeforeTrigSel", | |
629 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
630 | 200, 0, 200); | |
631 | fListHist->Add(fHistMultiplicityTRKBeforeTrigSel); | |
632 | } | |
633 | if(! fHistMultiplicityTRKForTrigEvt) { | |
634 | fHistMultiplicityTRKForTrigEvt = new TH1F("fHistMultiplicityTRKForTrigEvt", | |
635 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
636 | 200, 0, 200); | |
637 | fListHist->Add(fHistMultiplicityTRKForTrigEvt); | |
638 | } | |
639 | if(! fHistMultiplicityTRK) { | |
640 | fHistMultiplicityTRK = new TH1F("fHistMultiplicityTRK", | |
641 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
642 | 200, 0, 200); | |
643 | fListHist->Add(fHistMultiplicityTRK); | |
644 | } | |
645 | if(! fHistMultiplicityTRKNoTPCOnly) { | |
646 | fHistMultiplicityTRKNoTPCOnly = new TH1F("fHistMultiplicityTRKNoTPCOnly", | |
647 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
648 | 200, 0, 200); | |
649 | fListHist->Add(fHistMultiplicityTRKNoTPCOnly); | |
650 | } | |
651 | if(! fHistMultiplicityTRKNoTPCOnlyNoPileup) { | |
652 | fHistMultiplicityTRKNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityTRKNoTPCOnlyNoPileup", | |
653 | "Centrality Distribution: TRK;TRK Centrality;Events", | |
654 | 200, 0, 200); | |
655 | fListHist->Add(fHistMultiplicityTRKNoTPCOnlyNoPileup); | |
656 | } | |
657 | ||
658 | //SPD Centrality (if PbPb / pPb) | |
659 | if(! fHistMultiplicitySPDBeforeTrigSel) { | |
660 | fHistMultiplicitySPDBeforeTrigSel = new TH1F("fHistMultiplicitySPDBeforeTrigSel", | |
661 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
662 | 200, 0, 200); | |
663 | fListHist->Add(fHistMultiplicitySPDBeforeTrigSel); | |
664 | } | |
665 | if(! fHistMultiplicitySPDForTrigEvt) { | |
666 | fHistMultiplicitySPDForTrigEvt = new TH1F("fHistMultiplicitySPDForTrigEvt", | |
667 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
668 | 200, 0, 200); | |
669 | fListHist->Add(fHistMultiplicitySPDForTrigEvt); | |
670 | } | |
671 | if(! fHistMultiplicitySPD) { | |
672 | fHistMultiplicitySPD = new TH1F("fHistMultiplicitySPD", | |
673 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
674 | 200, 0, 200); | |
675 | fListHist->Add(fHistMultiplicitySPD); | |
676 | } | |
677 | if(! fHistMultiplicitySPDNoTPCOnly) { | |
678 | fHistMultiplicitySPDNoTPCOnly = new TH1F("fHistMultiplicitySPDNoTPCOnly", | |
679 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
680 | 200, 0, 200); | |
681 | fListHist->Add(fHistMultiplicitySPDNoTPCOnly); | |
682 | } | |
683 | if(! fHistMultiplicitySPDNoTPCOnlyNoPileup) { | |
684 | fHistMultiplicitySPDNoTPCOnlyNoPileup = new TH1F("fHistMultiplicitySPDNoTPCOnlyNoPileup", | |
685 | "Centrality Distribution: SPD;SPD Centrality;Events", | |
686 | 200, 0, 200); | |
687 | fListHist->Add(fHistMultiplicitySPDNoTPCOnlyNoPileup); | |
688 | } | |
689 | ||
690 | ||
691 | ||
76029adc | 692 | |
693 | //------------------------------------------------ | |
694 | // Generated Particle Histograms | |
695 | //------------------------------------------------ | |
696 | ||
697 | Int_t lCustomNBins = 200; | |
698 | Double_t lCustomPtUpperLimit = 20; | |
699 | Int_t lCustomNBinsMultiplicity = 100; | |
700 | ||
701 | //---------------------------------- | |
702 | // Raw Generated (Pre-physics-selection) | |
703 | //---------------------------------- | |
704 | ||
705 | //-------------------------------------------------------------------------------------- | |
706 | //--- 3D Histo (Pt, Y, Multiplicity) for generated XiMinus/Plus, all generated | |
707 | ||
708 | if(! f3dHistGenPtVsYVsMultXiMinus) { | |
709 | f3dHistGenPtVsYVsMultXiMinus = new TH3F( "f3dHistGenPtVsYVsMultXiMinus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
710 | fListHist->Add(f3dHistGenPtVsYVsMultXiMinus); | |
711 | } | |
712 | if(! f3dHistGenPtVsYVsMultXiPlus) { | |
713 | f3dHistGenPtVsYVsMultXiPlus = new TH3F( "f3dHistGenPtVsYVsMultXiPlus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
714 | fListHist->Add(f3dHistGenPtVsYVsMultXiPlus); | |
715 | } | |
716 | //--- 3D Histo (Pt, Y, Multiplicity) for generated OmegaMinus/Plus | |
717 | ||
718 | if(! f3dHistGenPtVsYVsMultOmegaMinus) { | |
719 | f3dHistGenPtVsYVsMultOmegaMinus = new TH3F( "f3dHistGenPtVsYVsMultOmegaMinus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
720 | fListHist->Add(f3dHistGenPtVsYVsMultOmegaMinus); | |
721 | } | |
722 | if(! f3dHistGenPtVsYVsMultOmegaPlus) { | |
723 | f3dHistGenPtVsYVsMultOmegaPlus = new TH3F( "f3dHistGenPtVsYVsMultOmegaPlus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
724 | fListHist->Add(f3dHistGenPtVsYVsMultOmegaPlus); | |
725 | } | |
726 | ||
da3539d8 | 727 | //All generated cascades, YCMS |
728 | ||
729 | if(! f3dHistGenPtVsYCMSVsMultXiMinus) { | |
730 | f3dHistGenPtVsYCMSVsMultXiMinus = new TH3F( "f3dHistGenPtVsYCMSVsMultXiMinus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
731 | fListHist->Add(f3dHistGenPtVsYCMSVsMultXiMinus); | |
732 | } | |
733 | if(! f3dHistGenPtVsYCMSVsMultXiPlus) { | |
734 | f3dHistGenPtVsYCMSVsMultXiPlus = new TH3F( "f3dHistGenPtVsYCMSVsMultXiPlus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
735 | fListHist->Add(f3dHistGenPtVsYCMSVsMultXiPlus); | |
736 | } | |
737 | //--- 3D Histo (Pt, Y, Multiplicity) for generated OmegaMinus/Plus | |
738 | ||
739 | if(! f3dHistGenPtVsYCMSVsMultOmegaMinus) { | |
740 | f3dHistGenPtVsYCMSVsMultOmegaMinus = new TH3F( "f3dHistGenPtVsYCMSVsMultOmegaMinus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
741 | fListHist->Add(f3dHistGenPtVsYCMSVsMultOmegaMinus); | |
742 | } | |
743 | if(! f3dHistGenPtVsYCMSVsMultOmegaPlus) { | |
744 | f3dHistGenPtVsYCMSVsMultOmegaPlus = new TH3F( "f3dHistGenPtVsYCMSVsMultOmegaPlus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
745 | fListHist->Add(f3dHistGenPtVsYCMSVsMultOmegaPlus); | |
746 | } | |
747 | ||
748 | ||
76029adc | 749 | //-------------------------------------------------------------------------------------- |
750 | //--- 3D Histo (Pt, Y, Multiplicity) for generated XiMinus/Plus, at selected analysis evts | |
751 | ||
752 | if(! f3dHistGenSelectedPtVsYVsMultXiMinus) { | |
753 | f3dHistGenSelectedPtVsYVsMultXiMinus = new TH3F( "f3dHistGenSelectedPtVsYVsMultXiMinus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
754 | fListHist->Add(f3dHistGenSelectedPtVsYVsMultXiMinus); | |
755 | } | |
756 | if(! f3dHistGenSelectedPtVsYVsMultXiPlus) { | |
757 | f3dHistGenSelectedPtVsYVsMultXiPlus = new TH3F( "f3dHistGenSelectedPtVsYVsMultXiPlus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
758 | fListHist->Add(f3dHistGenSelectedPtVsYVsMultXiPlus); | |
759 | } | |
760 | //--- 3D Histo (Pt, Y, Multiplicity) for generated OmegaMinus/Plus | |
761 | ||
762 | if(! f3dHistGenSelectedPtVsYVsMultOmegaMinus) { | |
763 | f3dHistGenSelectedPtVsYVsMultOmegaMinus = new TH3F( "f3dHistGenSelectedPtVsYVsMultOmegaMinus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
764 | fListHist->Add(f3dHistGenSelectedPtVsYVsMultOmegaMinus); | |
765 | } | |
766 | if(! f3dHistGenSelectedPtVsYVsMultOmegaPlus) { | |
767 | f3dHistGenSelectedPtVsYVsMultOmegaPlus = new TH3F( "f3dHistGenSelectedPtVsYVsMultOmegaPlus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
768 | fListHist->Add(f3dHistGenSelectedPtVsYVsMultOmegaPlus); | |
769 | } | |
770 | ||
da3539d8 | 771 | //ANALYSIS level Cascades, YCMS |
772 | ||
773 | ||
774 | if(! f3dHistGenSelectedPtVsYCMSVsMultXiMinus) { | |
775 | f3dHistGenSelectedPtVsYCMSVsMultXiMinus = new TH3F( "f3dHistGenSelectedPtVsYCMSVsMultXiMinus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
776 | fListHist->Add(f3dHistGenSelectedPtVsYCMSVsMultXiMinus); | |
777 | } | |
778 | if(! f3dHistGenSelectedPtVsYCMSVsMultXiPlus) { | |
779 | f3dHistGenSelectedPtVsYCMSVsMultXiPlus = new TH3F( "f3dHistGenSelectedPtVsYCMSVsMultXiPlus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
780 | fListHist->Add(f3dHistGenSelectedPtVsYCMSVsMultXiPlus); | |
781 | } | |
782 | //--- 3D Histo (Pt, Y, Multiplicity) for generated OmegaMinus/Plus | |
783 | ||
784 | if(! f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus) { | |
785 | f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus = new TH3F( "f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
786 | fListHist->Add(f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus); | |
787 | } | |
788 | if(! f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus) { | |
789 | f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus = new TH3F( "f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity); | |
790 | fListHist->Add(f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus); | |
791 | } | |
792 | ||
76029adc | 793 | //---------------------------------- |
794 | // Primary Vertex Position Histos | |
795 | //---------------------------------- | |
796 | ||
797 | if(! fHistPVx) { | |
798 | fHistPVx = new TH1F("fHistPVx", | |
799 | "PV x position;Nbr of Evts;x", | |
800 | 2000, -0.5, 0.5); | |
801 | fListHist->Add(fHistPVx); | |
802 | } | |
803 | if(! fHistPVy) { | |
804 | fHistPVy = new TH1F("fHistPVy", | |
805 | "PV y position;Nbr of Evts;y", | |
806 | 2000, -0.5, 0.5); | |
807 | fListHist->Add(fHistPVy); | |
808 | } | |
809 | if(! fHistPVz) { | |
810 | fHistPVz = new TH1F("fHistPVz", | |
811 | "PV z position;Nbr of Evts;z", | |
812 | 400, -20, 20); | |
813 | fListHist->Add(fHistPVz); | |
814 | } | |
815 | ||
816 | if(! fHistPVxAnalysis) { | |
817 | fHistPVxAnalysis = new TH1F("fHistPVxAnalysis", | |
818 | "PV x position;Nbr of Evts;x", | |
819 | 2000, -0.5, 0.5); | |
820 | fListHist->Add(fHistPVxAnalysis); | |
821 | } | |
822 | if(! fHistPVyAnalysis) { | |
823 | fHistPVyAnalysis = new TH1F("fHistPVyAnalysis", | |
824 | "PV y position;Nbr of Evts;y", | |
825 | 2000, -0.5, 0.5); | |
826 | fListHist->Add(fHistPVyAnalysis); | |
827 | } | |
828 | if(! fHistPVzAnalysis) { | |
829 | fHistPVzAnalysis = new TH1F("fHistPVzAnalysis", | |
830 | "PV z position;Nbr of Evts;z", | |
831 | 400, -20, 20); | |
832 | fListHist->Add(fHistPVzAnalysis); | |
833 | } | |
834 | ||
835 | //List of Histograms: Normal | |
836 | PostData(1, fListHist); | |
837 | ||
838 | //TTree Object: Saved to base directory. Should cache to disk while saving. | |
839 | //(Important to avoid excessive memory usage, particularly when merging) | |
840 | PostData(2, fTreeCascade); | |
841 | ||
842 | }// end UserCreateOutputObjects | |
843 | ||
844 | ||
845 | //________________________________________________________________________ | |
846 | void AliAnalysisTaskExtractPerformanceCascade::UserExec(Option_t *) | |
847 | { | |
848 | // Main loop | |
849 | // Called for each event | |
850 | ||
851 | AliESDEvent *lESDevent = 0x0; | |
852 | AliMCEvent *lMCevent = 0x0; | |
853 | AliStack *lMCstack = 0x0; | |
854 | ||
855 | Int_t lNumberOfV0s = -1; | |
856 | Double_t lTrkgPrimaryVtxPos[3] = {-100.0, -100.0, -100.0}; | |
857 | Double_t lBestPrimaryVtxPos[3] = {-100.0, -100.0, -100.0}; | |
858 | Double_t lMagneticField = -10.; | |
859 | ||
860 | // Connect to the InputEvent | |
861 | // After these lines, we should have an ESD/AOD event + the number of V0s in it. | |
862 | ||
863 | // Appropriate for ESD analysis! | |
864 | ||
865 | lESDevent = dynamic_cast<AliESDEvent*>( InputEvent() ); | |
866 | if (!lESDevent) { | |
867 | AliWarning("ERROR: lESDevent not available \n"); | |
868 | return; | |
869 | } | |
870 | ||
871 | /* --- Acquisition of exact event ID | |
872 | fTreeVariableRunNumber = lESDevent->GetRunNumber(); | |
873 | fTreeVariableEventNumber = | |
874 | ( ( ((ULong64_t)lESDevent->GetPeriodNumber() ) << 36 ) | | |
875 | ( ((ULong64_t)lESDevent->GetOrbitNumber () ) << 12 ) | | |
876 | ((ULong64_t)lESDevent->GetBunchCrossNumber() ) ); | |
877 | */ | |
878 | lMCevent = MCEvent(); | |
879 | if (!lMCevent) { | |
880 | Printf("ERROR: Could not retrieve MC event \n"); | |
881 | cout << "Name of the file with pb :" << fInputHandler->GetTree()->GetCurrentFile()->GetName() << endl; | |
882 | return; | |
883 | } | |
884 | ||
885 | lMCstack = lMCevent->Stack(); | |
886 | if (!lMCstack) { | |
887 | Printf("ERROR: Could not retrieve MC stack \n"); | |
888 | cout << "Name of the file with pb :" << fInputHandler->GetTree()->GetCurrentFile()->GetName() << endl; | |
889 | return; | |
890 | } | |
891 | TArrayF mcPrimaryVtx; | |
892 | AliGenEventHeader* mcHeader=lMCevent->GenEventHeader(); | |
893 | if(!mcHeader) return; | |
894 | mcHeader->PrimaryVertex(mcPrimaryVtx); | |
895 | ||
896 | //------------------------------------------------ | |
897 | // Multiplicity Information Acquistion | |
898 | //------------------------------------------------ | |
899 | ||
900 | //REVISED multiplicity estimator after 'multiplicity day' (2011) | |
aa06bcc8 | 901 | Int_t lMultiplicity = -100; |
902 | Int_t lMultiplicityV0A = -100; | |
903 | Int_t lMultiplicityZNA = -100; | |
904 | Int_t lMultiplicityTRK = -100; | |
905 | Int_t lMultiplicitySPD = -100; | |
76029adc | 906 | |
907 | //testing purposes | |
908 | if(fkIsNuclear == kFALSE) lMultiplicity = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC,0.5); | |
909 | ||
910 | //---> If this is a nuclear collision, then go nuclear on "multiplicity" variable... | |
911 | //---> Warning: Experimental | |
912 | if(fkIsNuclear == kTRUE){ | |
913 | AliCentrality* centrality; | |
914 | centrality = lESDevent->GetCentrality(); | |
da3539d8 | 915 | lMultiplicity = ( ( Int_t ) ( centrality->GetCentralityPercentile( fCentralityEstimator.Data() ) ) ); |
aa06bcc8 | 916 | lMultiplicityV0A = ( ( Int_t ) ( centrality->GetCentralityPercentile( "V0A" ) ) ); |
917 | lMultiplicityZNA = ( ( Int_t ) ( centrality->GetCentralityPercentile( "ZNA" ) ) ); | |
918 | lMultiplicityTRK = ( ( Int_t ) ( centrality->GetCentralityPercentile( "TRK" ) ) ); | |
919 | lMultiplicitySPD = ( ( Int_t ) ( centrality->GetCentralityPercentile( "SPD" ) ) ); | |
76029adc | 920 | if (centrality->GetQuality()>1) { |
921 | PostData(1, fListHist); | |
922 | PostData(2, fTreeCascade); | |
923 | return; | |
924 | } | |
925 | } | |
926 | ||
927 | //Set variable for filling tree afterwards! | |
928 | //---> pp case......: GetReferenceMultiplicity | |
929 | //---> Pb-Pb case...: Centrality by V0M | |
930 | ||
931 | fTreeCascVarMultiplicity = lMultiplicity; | |
aa06bcc8 | 932 | fTreeCascVarMultiplicity = lMultiplicity; |
933 | fTreeCascVarMultiplicityV0A = lMultiplicityV0A; | |
934 | fTreeCascVarMultiplicityZNA = lMultiplicityZNA; | |
935 | fTreeCascVarMultiplicityTRK = lMultiplicityTRK; | |
936 | fTreeCascVarMultiplicitySPD = lMultiplicitySPD; | |
76029adc | 937 | |
938 | fHistV0MultiplicityBeforeTrigSel->Fill ( lESDevent->GetNumberOfV0s() ); | |
939 | fHistMultiplicityBeforeTrigSel->Fill ( lMultiplicity ); | |
aa06bcc8 | 940 | fHistMultiplicityV0ABeforeTrigSel->Fill ( lMultiplicityV0A ); |
941 | fHistMultiplicityZNABeforeTrigSel->Fill ( lMultiplicityZNA ); | |
942 | fHistMultiplicityTRKBeforeTrigSel->Fill ( lMultiplicityTRK ); | |
943 | fHistMultiplicitySPDBeforeTrigSel->Fill ( lMultiplicitySPD ); | |
944 | ||
76029adc | 945 | //------------------------------------------------ |
946 | // MC Information Acquistion | |
947 | //------------------------------------------------ | |
948 | ||
949 | Int_t iNumberOfPrimaries = -1; | |
950 | iNumberOfPrimaries = lMCstack->GetNprimary(); | |
951 | if(iNumberOfPrimaries < 1) return; | |
952 | ||
953 | //------------------------------------------------ | |
954 | // Variable Definition | |
955 | //------------------------------------------------ | |
956 | ||
957 | Int_t lNbMCPrimary = 0; | |
958 | ||
76029adc | 959 | Double_t lPtCurrentPart = 0; |
960 | ||
961 | //Int_t lComeFromSigma = 0; | |
962 | ||
963 | // current mc particle 's mother | |
964 | //Int_t iCurrentMother = 0; | |
965 | lNbMCPrimary = lMCstack->GetNprimary(); | |
966 | ||
967 | //------------------------------------------------ | |
968 | // Pre-Physics Selection | |
969 | //------------------------------------------------ | |
970 | ||
971 | //----- Loop on primary Xi, Omega -------------------------------------------------------------- | |
972 | for (Int_t iCurrentLabelStack = 0; iCurrentLabelStack < lNbMCPrimary; iCurrentLabelStack++) | |
973 | {// This is the begining of the loop on primaries | |
974 | ||
975 | TParticle* lCurrentParticlePrimary = 0x0; | |
976 | lCurrentParticlePrimary = lMCstack->Particle( iCurrentLabelStack ); | |
977 | if(!lCurrentParticlePrimary){ | |
978 | Printf("Cascade loop %d - MC TParticle pointer to current stack particle = 0x0 ! Skip ...\n", iCurrentLabelStack ); | |
979 | continue; | |
980 | } | |
981 | if ( TMath::Abs(lCurrentParticlePrimary->GetPdgCode()) == 3312 || TMath::Abs(lCurrentParticlePrimary->GetPdgCode()) == 3334 ) { | |
982 | Double_t lRapXiMCPrimary = -100; | |
983 | if( (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) != 0 ) { | |
984 | if ( (lCurrentParticlePrimary->Energy() + lCurrentParticlePrimary->Pz()) / (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) !=0 ){ | |
985 | lRapXiMCPrimary = 0.5*TMath::Log( (lCurrentParticlePrimary->Energy() + lCurrentParticlePrimary->Pz()) / (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) ); | |
986 | } | |
987 | } | |
988 | ||
989 | //================================================================================= | |
990 | // Xi Histograms | |
991 | if( lCurrentParticlePrimary->GetPdgCode() == 3312 ){ | |
992 | lPtCurrentPart = lCurrentParticlePrimary->Pt(); | |
993 | f3dHistGenPtVsYVsMultXiMinus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity); | |
da3539d8 | 994 | f3dHistGenPtVsYCMSVsMultXiMinus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity); |
76029adc | 995 | } |
996 | if( lCurrentParticlePrimary->GetPdgCode() == -3312 ){ | |
997 | lPtCurrentPart = lCurrentParticlePrimary->Pt(); | |
998 | f3dHistGenPtVsYVsMultXiPlus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity); | |
da3539d8 | 999 | f3dHistGenPtVsYCMSVsMultXiPlus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity); |
76029adc | 1000 | } |
1001 | // Omega Histograms | |
1002 | if( lCurrentParticlePrimary->GetPdgCode() == 3334 ){ | |
1003 | lPtCurrentPart = lCurrentParticlePrimary->Pt(); | |
1004 | f3dHistGenPtVsYVsMultOmegaMinus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity); | |
da3539d8 | 1005 | f3dHistGenPtVsYCMSVsMultOmegaMinus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity); |
76029adc | 1006 | } |
1007 | if( lCurrentParticlePrimary->GetPdgCode() == -3334 ){ | |
1008 | lPtCurrentPart = lCurrentParticlePrimary->Pt(); | |
1009 | f3dHistGenPtVsYVsMultOmegaPlus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity); | |
da3539d8 | 1010 | f3dHistGenPtVsYCMSVsMultOmegaPlus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity); |
76029adc | 1011 | } |
1012 | } | |
1013 | } | |
1014 | //----- End Loop on primary Xi, Omega ---------------------------------------------------------- | |
1015 | ||
1016 | // ---> Set Variables to Zero again | |
1017 | // ---> Variable Definition | |
1018 | ||
76029adc | 1019 | lPtCurrentPart = 0; |
1020 | ||
1021 | //------------------------------------------------ | |
1022 | // Physics Selection | |
1023 | //------------------------------------------------ | |
1024 | ||
1025 | UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected(); | |
1026 | Bool_t isSelected = 0; | |
1027 | isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB; | |
1028 | ||
2213f6fc | 1029 | //pA triggering: CINT7 |
1030 | if( fkSwitchINT7 ) isSelected = (maskIsSelected & AliVEvent::kINT7) == AliVEvent::kINT7; | |
1031 | ||
76029adc | 1032 | //Standard Min-Bias Selection |
1033 | if ( ! isSelected ) { | |
1034 | PostData(1, fListHist); | |
1035 | PostData(2, fTreeCascade); | |
1036 | return; | |
1037 | } | |
1038 | ||
d8841e95 | 1039 | //------------------------------------------------ |
1040 | // Rerun cascade vertexer! | |
1041 | //------------------------------------------------ | |
2213f6fc | 1042 | /* |
d8841e95 | 1043 | lESDevent->ResetCascades(); |
1044 | lESDevent->ResetV0s(); | |
1045 | ||
1046 | AliV0vertexer lV0vtxer; | |
1047 | AliCascadeVertexer lCascVtxer; | |
1048 | ||
1049 | lV0vtxer.SetDefaultCuts(fV0Sels); | |
1050 | lCascVtxer.SetDefaultCuts(fCascSels); | |
1051 | ||
1052 | lV0vtxer.Tracks2V0vertices(lESDevent); | |
1053 | lCascVtxer.V0sTracks2CascadeVertices(lESDevent); | |
2213f6fc | 1054 | */ |
76029adc | 1055 | //------------------------------------------------ |
1056 | // After Trigger Selection | |
1057 | //------------------------------------------------ | |
1058 | ||
1059 | lNumberOfV0s = lESDevent->GetNumberOfV0s(); | |
1060 | ||
1061 | //Set variable for filling tree afterwards! | |
1062 | fHistV0MultiplicityForTrigEvt->Fill(lNumberOfV0s); | |
1063 | fHistMultiplicityForTrigEvt->Fill ( lMultiplicity ); | |
aa06bcc8 | 1064 | fHistMultiplicityV0AForTrigEvt ->Fill( lMultiplicityV0A ); |
1065 | fHistMultiplicityZNAForTrigEvt ->Fill( lMultiplicityZNA ); | |
1066 | fHistMultiplicityTRKForTrigEvt ->Fill( lMultiplicityTRK ); | |
1067 | fHistMultiplicitySPDForTrigEvt ->Fill( lMultiplicitySPD ); | |
76029adc | 1068 | |
1069 | //------------------------------------------------ | |
1070 | // Getting: Primary Vertex + MagField Info | |
1071 | //------------------------------------------------ | |
1072 | ||
1073 | const AliESDVertex *lPrimaryTrackingESDVtx = lESDevent->GetPrimaryVertexTracks(); | |
1074 | // get the vtx stored in ESD found with tracks | |
1075 | lPrimaryTrackingESDVtx->GetXYZ( lTrkgPrimaryVtxPos ); | |
1076 | ||
1077 | const AliESDVertex *lPrimaryBestESDVtx = lESDevent->GetPrimaryVertex(); | |
1078 | // get the best primary vertex available for the event | |
1079 | // As done in AliCascadeVertexer, we keep the one which is the best one available. | |
1080 | // between : Tracking vertex > SPD vertex > TPC vertex > default SPD vertex | |
1081 | // This one will be used for next calculations (DCA essentially) | |
1082 | lPrimaryBestESDVtx->GetXYZ( lBestPrimaryVtxPos ); | |
1083 | ||
1084 | Double_t lPrimaryVtxPosition[3]; | |
1085 | const AliVVertex *primaryVtx = lESDevent->GetPrimaryVertex(); | |
1086 | lPrimaryVtxPosition[0] = primaryVtx->GetX(); | |
1087 | lPrimaryVtxPosition[1] = primaryVtx->GetY(); | |
1088 | lPrimaryVtxPosition[2] = primaryVtx->GetZ(); | |
1089 | fHistPVx->Fill( lPrimaryVtxPosition[0] ); | |
1090 | fHistPVy->Fill( lPrimaryVtxPosition[1] ); | |
1091 | fHistPVz->Fill( lPrimaryVtxPosition[2] ); | |
1092 | ||
1093 | //------------------------------------------------ | |
1094 | // Primary Vertex Z position: SKIP | |
1095 | //------------------------------------------------ | |
1096 | ||
1097 | if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0 ) { | |
1098 | AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !"); | |
1099 | PostData(1, fListHist); | |
1100 | PostData(2, fTreeCascade); | |
1101 | return; | |
1102 | } | |
1103 | ||
1104 | lMagneticField = lESDevent->GetMagneticField( ); | |
1105 | fHistV0MultiplicityForSelEvt ->Fill( lNumberOfV0s ); | |
1106 | fHistMultiplicity->Fill(lMultiplicity); | |
aa06bcc8 | 1107 | fHistMultiplicityV0A->Fill(lMultiplicityV0A); |
1108 | fHistMultiplicityZNA->Fill(lMultiplicityZNA); | |
1109 | fHistMultiplicityTRK->Fill(lMultiplicityTRK); | |
1110 | fHistMultiplicitySPD->Fill(lMultiplicitySPD); | |
76029adc | 1111 | |
1112 | //------------------------------------------------ | |
1113 | // SKIP: Events with well-established PVtx | |
1114 | //------------------------------------------------ | |
1115 | ||
1116 | const AliESDVertex *lPrimaryTrackingESDVtxCheck = lESDevent->GetPrimaryVertexTracks(); | |
1117 | const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD(); | |
1118 | if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtxCheck->GetStatus() ){ | |
1119 | AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !"); | |
1120 | PostData(1, fListHist); | |
1121 | PostData(2, fTreeCascade); | |
1122 | return; | |
1123 | } | |
1124 | fHistV0MultiplicityForSelEvtNoTPCOnly ->Fill( lNumberOfV0s ); | |
1125 | fHistMultiplicityNoTPCOnly->Fill(lMultiplicity); | |
aa06bcc8 | 1126 | fHistMultiplicityV0ANoTPCOnly->Fill(lMultiplicityV0A); |
1127 | fHistMultiplicityZNANoTPCOnly->Fill(lMultiplicityZNA); | |
1128 | fHistMultiplicityTRKNoTPCOnly->Fill(lMultiplicityTRK); | |
1129 | fHistMultiplicitySPDNoTPCOnly->Fill(lMultiplicitySPD); | |
76029adc | 1130 | |
1131 | //------------------------------------------------ | |
1132 | // Pileup Rejection Studies | |
1133 | //------------------------------------------------ | |
1134 | ||
1135 | // FIXME : quality selection regarding pile-up rejection | |
1136 | if(lESDevent->IsPileupFromSPD() && !fkIsNuclear ){// 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 | |
1137 | AliWarning("Pb / This is tagged as Pileup from SPD... return !"); | |
1138 | PostData(1, fListHist); | |
1139 | PostData(2, fTreeCascade); | |
1140 | return; | |
1141 | } | |
1142 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup ->Fill( lNumberOfV0s ); | |
1143 | fHistMultiplicityNoTPCOnlyNoPileup->Fill(lMultiplicity); | |
aa06bcc8 | 1144 | fHistMultiplicityV0ANoTPCOnlyNoPileup->Fill(lMultiplicityV0A); |
1145 | fHistMultiplicityZNANoTPCOnlyNoPileup->Fill(lMultiplicityZNA); | |
1146 | fHistMultiplicityTRKNoTPCOnlyNoPileup->Fill(lMultiplicityTRK); | |
1147 | fHistMultiplicitySPDNoTPCOnlyNoPileup->Fill(lMultiplicitySPD); | |
76029adc | 1148 | |
1149 | //Do control histograms without the IsFromVertexerZ events, but consider them in analysis... | |
1150 | if( ! (lESDevent->GetPrimaryVertex()->IsFromVertexerZ() ) ){ | |
1151 | fHistPVxAnalysis->Fill( lPrimaryVtxPosition[0] ); | |
1152 | fHistPVyAnalysis->Fill( lPrimaryVtxPosition[1] ); | |
1153 | fHistPVzAnalysis->Fill( lPrimaryVtxPosition[2] ); | |
1154 | } | |
1155 | ||
1156 | //------------------------------------------------ | |
1157 | // stack loop starts here | |
1158 | //------------------------------------------------ | |
1159 | ||
1160 | //----- Loop on primary Xi, Omega -------------------------------------------------------------- | |
1161 | for (Int_t iCurrentLabelStack = 0; iCurrentLabelStack < lNbMCPrimary; iCurrentLabelStack++) | |
1162 | {// This is the begining of the loop on primaries | |
1163 | ||
1164 | TParticle* lCurrentParticlePrimary = 0x0; | |
1165 | lCurrentParticlePrimary = lMCstack->Particle( iCurrentLabelStack ); | |
1166 | if(!lCurrentParticlePrimary){ | |
1167 | Printf("Cascade loop %d - MC TParticle pointer to current stack particle = 0x0 ! Skip ...\n", iCurrentLabelStack ); | |
1168 | continue; | |
1169 | } | |
1170 | if ( TMath::Abs(lCurrentParticlePrimary->GetPdgCode()) == 3312 || TMath::Abs(lCurrentParticlePrimary->GetPdgCode()) == 3334 ) { | |
1171 | Double_t lRapXiMCPrimary = -100; | |
1172 | if( (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) != 0 ) { | |
1173 | if ( (lCurrentParticlePrimary->Energy() + lCurrentParticlePrimary->Pz()) / (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) !=0 ){ | |
1174 | lRapXiMCPrimary = 0.5*TMath::Log( (lCurrentParticlePrimary->Energy() + lCurrentParticlePrimary->Pz()) / (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) ); | |
1175 | } | |
1176 | } | |
1177 | ||
1178 | //================================================================================= | |
1179 | // Xi Histograms | |
1180 | if( lCurrentParticlePrimary->GetPdgCode() == 3312 ){ | |
1181 | lPtCurrentPart = lCurrentParticlePrimary->Pt(); | |
1182 | f3dHistGenSelectedPtVsYVsMultXiMinus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity); | |
da3539d8 | 1183 | f3dHistGenSelectedPtVsYCMSVsMultXiMinus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity); |
76029adc | 1184 | } |
1185 | if( lCurrentParticlePrimary->GetPdgCode() == -3312 ){ | |
1186 | lPtCurrentPart = lCurrentParticlePrimary->Pt(); | |
1187 | f3dHistGenSelectedPtVsYVsMultXiPlus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity); | |
da3539d8 | 1188 | f3dHistGenSelectedPtVsYCMSVsMultXiPlus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity); |
76029adc | 1189 | } |
1190 | // Omega Histograms | |
1191 | if( lCurrentParticlePrimary->GetPdgCode() == 3334 ){ | |
1192 | lPtCurrentPart = lCurrentParticlePrimary->Pt(); | |
1193 | f3dHistGenSelectedPtVsYVsMultOmegaMinus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity); | |
da3539d8 | 1194 | f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity); |
76029adc | 1195 | } |
1196 | if( lCurrentParticlePrimary->GetPdgCode() == -3334 ){ | |
1197 | lPtCurrentPart = lCurrentParticlePrimary->Pt(); | |
1198 | f3dHistGenSelectedPtVsYVsMultOmegaPlus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity); | |
da3539d8 | 1199 | f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity); |
76029adc | 1200 | } |
1201 | } | |
1202 | } | |
1203 | //----- End Loop on primary Xi, Omega ---------------------------------------------------------- | |
1204 | ||
1205 | //------------------------------------------------ | |
1206 | // MAIN CASCADE LOOP STARTS HERE | |
1207 | //------------------------------------------------ | |
1208 | // Code Credit: Antonin Maire (thanks^100) | |
1209 | // ---> This is an adaptation | |
1210 | ||
1211 | Long_t ncascades = 0; | |
1212 | ncascades = lESDevent->GetNumberOfCascades(); | |
1213 | ||
1214 | ||
1215 | for (Int_t iXi = 0; iXi < ncascades; iXi++){ | |
1216 | //------------------------------------------------ | |
1217 | // Initializations | |
1218 | //------------------------------------------------ | |
1219 | //Double_t lTrkgPrimaryVtxRadius3D = -500.0; | |
1220 | //Double_t lBestPrimaryVtxRadius3D = -500.0; | |
1221 | ||
1222 | // - 1st part of initialisation : variables needed to store AliESDCascade data members | |
1223 | Double_t lEffMassXi = 0. ; | |
1224 | //Double_t lChi2Xi = -1. ; | |
1225 | Double_t lDcaXiDaughters = -1. ; | |
1226 | Double_t lXiCosineOfPointingAngle = -1. ; | |
1227 | Double_t lPosXi[3] = { -1000.0, -1000.0, -1000.0 }; | |
1228 | Double_t lXiRadius = -1000. ; | |
1229 | ||
1230 | // - 2nd part of initialisation : Nbr of clusters within TPC for the 3 daughter cascade tracks | |
1231 | Int_t lPosTPCClusters = -1; // For ESD only ...//FIXME : wait for availability in AOD | |
1232 | Int_t lNegTPCClusters = -1; // For ESD only ... | |
1233 | Int_t lBachTPCClusters = -1; // For ESD only ... | |
1234 | ||
1235 | // - 3rd part of initialisation : about V0 part in cascades | |
1236 | Double_t lInvMassLambdaAsCascDghter = 0.; | |
1237 | //Double_t lV0Chi2Xi = -1. ; | |
1238 | Double_t lDcaV0DaughtersXi = -1.; | |
1239 | ||
1240 | Double_t lDcaBachToPrimVertexXi = -1., lDcaV0ToPrimVertexXi = -1.; | |
1241 | Double_t lDcaPosToPrimVertexXi = -1.; | |
1242 | Double_t lDcaNegToPrimVertexXi = -1.; | |
1243 | Double_t lV0CosineOfPointingAngleXi = -1. ; | |
1244 | Double_t lPosV0Xi[3] = { -1000. , -1000., -1000. }; // Position of VO coming from cascade | |
1245 | Double_t lV0RadiusXi = -1000.0; | |
1246 | Double_t lV0quality = 0.; | |
1247 | ||
1248 | // - 4th part of initialisation : Effective masses | |
1249 | Double_t lInvMassXiMinus = 0.; | |
1250 | Double_t lInvMassXiPlus = 0.; | |
1251 | Double_t lInvMassOmegaMinus = 0.; | |
1252 | Double_t lInvMassOmegaPlus = 0.; | |
1253 | ||
1254 | // - 6th part of initialisation : extra info for QA | |
1255 | Double_t lXiMomX = 0. , lXiMomY = 0., lXiMomZ = 0.; | |
1256 | Double_t lXiTransvMom = 0. ; | |
1257 | Double_t lXiTransvMomMC= 0. ; | |
1258 | Double_t lXiTotMom = 0. ; | |
1259 | ||
1260 | Double_t lBachMomX = 0., lBachMomY = 0., lBachMomZ = 0.; | |
1261 | //Double_t lBachTransvMom = 0.; | |
1262 | //Double_t lBachTotMom = 0.; | |
1263 | ||
1264 | fTreeCascVarNegNSigmaPion = -100; | |
1265 | fTreeCascVarNegNSigmaProton = -100; | |
1266 | fTreeCascVarPosNSigmaPion = -100; | |
1267 | fTreeCascVarPosNSigmaProton = -100; | |
1268 | fTreeCascVarBachNSigmaPion = -100; | |
1269 | fTreeCascVarBachNSigmaKaon = -100; | |
1270 | ||
1271 | Short_t lChargeXi = -2; | |
1272 | //Double_t lV0toXiCosineOfPointingAngle = 0. ; | |
1273 | ||
1274 | Double_t lRapXi = -20.0, lRapOmega = -20.0, lRapMC = -20.0; // lEta = -20.0, lTheta = 360., lPhi = 720. ; | |
1275 | //Double_t lAlphaXi = -200., lPtArmXi = -200.0; | |
1276 | ||
1277 | // ------------------------------------- | |
1278 | // II.ESD - Calculation Part dedicated to Xi vertices (ESD) | |
1279 | ||
1280 | AliESDcascade *xi = lESDevent->GetCascade(iXi); | |
1281 | if (!xi) continue; | |
1282 | ||
1283 | ||
1284 | // - II.Step 1 : around primary vertex | |
1285 | //------------- | |
1286 | //lTrkgPrimaryVtxRadius3D = TMath::Sqrt( lTrkgPrimaryVtxPos[0] * lTrkgPrimaryVtxPos[0] + | |
1287 | // lTrkgPrimaryVtxPos[1] * lTrkgPrimaryVtxPos[1] + | |
1288 | // lTrkgPrimaryVtxPos[2] * lTrkgPrimaryVtxPos[2] ); | |
1289 | ||
1290 | //lBestPrimaryVtxRadius3D = TMath::Sqrt( lBestPrimaryVtxPos[0] * lBestPrimaryVtxPos[0] + | |
1291 | // lBestPrimaryVtxPos[1] * lBestPrimaryVtxPos[1] + | |
1292 | // lBestPrimaryVtxPos[2] * lBestPrimaryVtxPos[2] ); | |
1293 | ||
1294 | // - II.Step 2 : Assigning the necessary variables for specific AliESDcascade data members (ESD) | |
1295 | //------------- | |
1296 | lV0quality = 0.; | |
1297 | xi->ChangeMassHypothesis(lV0quality , 3312); // default working hypothesis : cascade = Xi- decay | |
1298 | ||
1299 | lEffMassXi = xi->GetEffMassXi(); | |
1300 | //lChi2Xi = xi->GetChi2Xi(); | |
1301 | lDcaXiDaughters = xi->GetDcaXiDaughters(); | |
1302 | lXiCosineOfPointingAngle = xi->GetCascadeCosineOfPointingAngle( lBestPrimaryVtxPos[0], | |
1303 | lBestPrimaryVtxPos[1], | |
1304 | lBestPrimaryVtxPos[2] ); | |
1305 | // Take care : the best available vertex should be used (like in AliCascadeVertexer) | |
1306 | ||
1307 | xi->GetXYZcascade( lPosXi[0], lPosXi[1], lPosXi[2] ); | |
1308 | lXiRadius = TMath::Sqrt( lPosXi[0]*lPosXi[0] + lPosXi[1]*lPosXi[1] ); | |
1309 | ||
1310 | // - II.Step 3 : around the tracks : Bach + V0 (ESD) | |
1311 | // ~ Necessary variables for ESDcascade data members coming from the ESDv0 part (inheritance) | |
1312 | //------------- | |
1313 | ||
1314 | UInt_t lIdxPosXi = (UInt_t) TMath::Abs( xi->GetPindex() ); | |
1315 | UInt_t lIdxNegXi = (UInt_t) TMath::Abs( xi->GetNindex() ); | |
1316 | UInt_t lBachIdx = (UInt_t) TMath::Abs( xi->GetBindex() ); | |
1317 | // Care track label can be negative in MC production (linked with the track quality) | |
1318 | // However = normally, not the case for track index ... | |
1319 | ||
1320 | // FIXME : rejection of a double use of a daughter track (nothing but just a crosscheck of what is done in the cascade vertexer) | |
1321 | if(lBachIdx == lIdxNegXi) { | |
1322 | AliWarning("Pb / Idx(Bach. track) = Idx(Neg. track) ... continue!"); continue; | |
1323 | } | |
1324 | if(lBachIdx == lIdxPosXi) { | |
1325 | AliWarning("Pb / Idx(Bach. track) = Idx(Pos. track) ... continue!"); continue; | |
1326 | } | |
1327 | ||
1328 | AliESDtrack *pTrackXi = lESDevent->GetTrack( lIdxPosXi ); | |
1329 | AliESDtrack *nTrackXi = lESDevent->GetTrack( lIdxNegXi ); | |
1330 | AliESDtrack *bachTrackXi = lESDevent->GetTrack( lBachIdx ); | |
1331 | ||
1332 | if (!pTrackXi || !nTrackXi || !bachTrackXi ) { | |
1333 | AliWarning("ERROR: Could not retrieve one of the 3 ESD daughter tracks of the cascade ..."); | |
1334 | continue; | |
1335 | } | |
1336 | ||
1337 | fTreeCascVarPosEta = pTrackXi->Eta(); | |
1338 | fTreeCascVarNegEta = nTrackXi->Eta(); | |
1339 | fTreeCascVarBachEta = bachTrackXi->Eta(); | |
1340 | ||
1341 | //------------------------------------------------ | |
1342 | // TPC dEdx information | |
1343 | //------------------------------------------------ | |
1344 | fTreeCascVarNegNSigmaPion = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kPion ); | |
1345 | fTreeCascVarNegNSigmaProton = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kProton ); | |
1346 | fTreeCascVarPosNSigmaPion = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kPion ); | |
1347 | fTreeCascVarPosNSigmaProton = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kProton ); | |
1348 | fTreeCascVarBachNSigmaPion = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kPion ); | |
1349 | fTreeCascVarBachNSigmaKaon = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kKaon ); | |
1350 | ||
1351 | //------------------------------------------------ | |
1352 | // TPC Number of clusters info | |
1353 | // --- modified to save the smallest number | |
1354 | // --- of TPC clusters for the 3 tracks | |
1355 | //------------------------------------------------ | |
1356 | ||
1357 | lPosTPCClusters = pTrackXi->GetTPCNcls(); | |
1358 | lNegTPCClusters = nTrackXi->GetTPCNcls(); | |
1359 | lBachTPCClusters = bachTrackXi->GetTPCNcls(); | |
1360 | ||
1361 | // 1 - Poor quality related to TPCrefit | |
1362 | ULong_t pStatus = pTrackXi->GetStatus(); | |
1363 | ULong_t nStatus = nTrackXi->GetStatus(); | |
1364 | ULong_t bachStatus = bachTrackXi->GetStatus(); | |
1365 | if ((pStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / V0 Pos. track has no TPCrefit ... continue!"); continue; } | |
1366 | if ((nStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / V0 Neg. track has no TPCrefit ... continue!"); continue; } | |
1367 | if ((bachStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / Bach. track has no TPCrefit ... continue!"); continue; } | |
1368 | // 2 - Poor quality related to TPC clusters: lowest cut of 70 clusters | |
1369 | if(lPosTPCClusters < 70) { AliWarning("Pb / V0 Pos. track has less than 70 TPC clusters ... continue!"); continue; } | |
1370 | if(lNegTPCClusters < 70) { AliWarning("Pb / V0 Neg. track has less than 70 TPC clusters ... continue!"); continue; } | |
1371 | if(lBachTPCClusters < 70) { AliWarning("Pb / Bach. track has less than 70 TPC clusters ... continue!"); continue; } | |
1372 | Int_t leastnumberofclusters = 1000; | |
1373 | if( lPosTPCClusters < leastnumberofclusters ) leastnumberofclusters = lPosTPCClusters; | |
1374 | if( lNegTPCClusters < leastnumberofclusters ) leastnumberofclusters = lNegTPCClusters; | |
1375 | if( lBachTPCClusters < leastnumberofclusters ) leastnumberofclusters = lBachTPCClusters; | |
1376 | ||
1377 | lInvMassLambdaAsCascDghter = xi->GetEffMass(); | |
1378 | // This value shouldn't change, whatever the working hyp. is : Xi-, Xi+, Omega-, Omega+ | |
1379 | lDcaV0DaughtersXi = xi->GetDcaV0Daughters(); | |
1380 | //lV0Chi2Xi = xi->GetChi2V0(); | |
1381 | ||
1382 | lV0CosineOfPointingAngleXi = xi->GetV0CosineOfPointingAngle( lBestPrimaryVtxPos[0], | |
1383 | lBestPrimaryVtxPos[1], | |
1384 | lBestPrimaryVtxPos[2] ); | |
1385 | ||
1386 | lDcaV0ToPrimVertexXi = xi->GetD( lBestPrimaryVtxPos[0], | |
1387 | lBestPrimaryVtxPos[1], | |
1388 | lBestPrimaryVtxPos[2] ); | |
1389 | ||
1390 | lDcaBachToPrimVertexXi = TMath::Abs( bachTrackXi->GetD( lBestPrimaryVtxPos[0], | |
1391 | lBestPrimaryVtxPos[1], | |
1392 | lMagneticField ) ); | |
1393 | // Note : AliExternalTrackParam::GetD returns an algebraic value ... | |
1394 | ||
1395 | xi->GetXYZ( lPosV0Xi[0], lPosV0Xi[1], lPosV0Xi[2] ); | |
1396 | lV0RadiusXi = TMath::Sqrt( lPosV0Xi[0]*lPosV0Xi[0] + lPosV0Xi[1]*lPosV0Xi[1] ); | |
1397 | ||
1398 | lDcaPosToPrimVertexXi = TMath::Abs( pTrackXi ->GetD( lBestPrimaryVtxPos[0], | |
1399 | lBestPrimaryVtxPos[1], | |
1400 | lMagneticField ) ); | |
1401 | ||
1402 | lDcaNegToPrimVertexXi = TMath::Abs( nTrackXi ->GetD( lBestPrimaryVtxPos[0], | |
1403 | lBestPrimaryVtxPos[1], | |
1404 | lMagneticField ) ); | |
1405 | ||
1406 | // - II.Step 4 : around effective masses (ESD) | |
1407 | // ~ change mass hypotheses to cover all the possibilities : Xi-/+, Omega -/+ | |
1408 | ||
1409 | if( bachTrackXi->Charge() < 0 ) { | |
1410 | lV0quality = 0.; | |
1411 | xi->ChangeMassHypothesis(lV0quality , 3312); | |
1412 | // Calculate the effective mass of the Xi- candidate. | |
1413 | // pdg code 3312 = Xi- | |
1414 | lInvMassXiMinus = xi->GetEffMassXi(); | |
1415 | ||
1416 | lV0quality = 0.; | |
1417 | xi->ChangeMassHypothesis(lV0quality , 3334); | |
1418 | // Calculate the effective mass of the Xi- candidate. | |
1419 | // pdg code 3334 = Omega- | |
1420 | lInvMassOmegaMinus = xi->GetEffMassXi(); | |
1421 | ||
1422 | lV0quality = 0.; | |
1423 | xi->ChangeMassHypothesis(lV0quality , 3312); // Back to default hyp. | |
1424 | }// end if negative bachelor | |
1425 | ||
1426 | ||
1427 | if( bachTrackXi->Charge() > 0 ){ | |
1428 | lV0quality = 0.; | |
1429 | xi->ChangeMassHypothesis(lV0quality , -3312); | |
1430 | // Calculate the effective mass of the Xi+ candidate. | |
1431 | // pdg code -3312 = Xi+ | |
1432 | lInvMassXiPlus = xi->GetEffMassXi(); | |
1433 | ||
1434 | lV0quality = 0.; | |
1435 | xi->ChangeMassHypothesis(lV0quality , -3334); | |
1436 | // Calculate the effective mass of the Xi+ candidate. | |
1437 | // pdg code -3334 = Omega+ | |
1438 | lInvMassOmegaPlus = xi->GetEffMassXi(); | |
1439 | ||
1440 | lV0quality = 0.; | |
1441 | xi->ChangeMassHypothesis(lV0quality , -3312); // Back to "default" hyp. | |
1442 | }// end if positive bachelor | |
1443 | // - II.Step 6 : extra info for QA (ESD) | |
1444 | // miscellaneous pieces of info that may help regarding data quality assessment. | |
1445 | //------------- | |
1446 | ||
1447 | xi->GetPxPyPz( lXiMomX, lXiMomY, lXiMomZ ); | |
1448 | lXiTransvMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY ); | |
1449 | lXiTotMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY + lXiMomZ*lXiMomZ ); | |
1450 | ||
1451 | xi->GetBPxPyPz( lBachMomX, lBachMomY, lBachMomZ ); | |
1452 | //lBachTransvMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY ); | |
1453 | //lBachTotMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY + lBachMomZ*lBachMomZ ); | |
1454 | ||
1455 | lChargeXi = xi->Charge(); | |
1456 | ||
1457 | //lV0toXiCosineOfPointingAngle = xi->GetV0CosineOfPointingAngle( lPosXi[0], lPosXi[1], lPosXi[2] ); | |
1458 | ||
1459 | lRapXi = xi->RapXi(); | |
1460 | lRapOmega = xi->RapOmega(); | |
1461 | //lEta = xi->Eta(); | |
1462 | //lTheta = xi->Theta() *180.0/TMath::Pi(); | |
1463 | //lPhi = xi->Phi() *180.0/TMath::Pi(); | |
1464 | //lAlphaXi = xi->AlphaXi(); | |
1465 | //lPtArmXi = xi->PtArmXi(); | |
1466 | ||
1467 | //------------------------------------------------ | |
1468 | // Associate Cascade Candidates to Monte Carlo! | |
1469 | //------------------------------------------------ | |
1470 | ||
1471 | //Warning: Not using Continues... Need to fill tree later! | |
1472 | ||
1473 | Int_t lPDGCodeCascade = 0; | |
1474 | ||
1475 | Int_t lPID_BachMother = 0; | |
1476 | Int_t lPID_NegMother = 0; | |
1477 | Int_t lPID_PosMother = 0; | |
1478 | ||
1479 | ||
1480 | fTreeCascVarPIDPositive = 0; | |
1481 | fTreeCascVarPIDNegative = 0; | |
1482 | fTreeCascVarPIDBachelor = 0; | |
1483 | ||
1484 | ||
1485 | if(fDebug > 5) | |
1486 | cout << "MC EventNumber : " << lMCevent->Header()->GetEvent() | |
1487 | << " / MC event Number in Run : " << lMCevent->Header()->GetEventNrInRun() << endl; | |
1488 | ||
1489 | // - Step 4.1 : level of the V0 daughters | |
1490 | ||
1491 | //---------------------------------------- | |
1492 | // Regular MC ASSOCIATION STARTS HERE | |
1493 | //---------------------------------------- | |
1494 | ||
1495 | Int_t lblPosV0Dghter = (Int_t) TMath::Abs( pTrackXi->GetLabel() ); | |
1496 | // Abs value = needed ! question of quality track association ... | |
1497 | Int_t lblNegV0Dghter = (Int_t) TMath::Abs( nTrackXi->GetLabel() ); | |
1498 | Int_t lblBach = (Int_t) TMath::Abs( bachTrackXi->GetLabel() ); | |
1499 | ||
1500 | TParticle* mcPosV0Dghter = lMCstack->Particle( lblPosV0Dghter ); | |
1501 | TParticle* mcNegV0Dghter = lMCstack->Particle( lblNegV0Dghter ); | |
1502 | TParticle* mcBach = lMCstack->Particle( lblBach ); | |
1503 | ||
1504 | fTreeCascVarPosTransMomMC = mcPosV0Dghter->Pt(); | |
1505 | fTreeCascVarNegTransMomMC = mcNegV0Dghter->Pt(); | |
1506 | ||
1507 | fTreeCascVarPIDPositive = mcPosV0Dghter -> GetPdgCode(); | |
1508 | fTreeCascVarPIDNegative = mcNegV0Dghter -> GetPdgCode(); | |
1509 | fTreeCascVarPIDBachelor = mcBach->GetPdgCode(); | |
1510 | ||
1511 | // - Step 4.2 : level of the Xi daughters | |
1512 | ||
1513 | Int_t lblMotherPosV0Dghter = mcPosV0Dghter->GetFirstMother() ; | |
1514 | Int_t lblMotherNegV0Dghter = mcNegV0Dghter->GetFirstMother(); | |
1515 | ||
1516 | //Rather uncivilized: Open brackets for each 'continue' | |
1517 | if(! (lblMotherPosV0Dghter != lblMotherNegV0Dghter) ) { // same mother | |
1518 | if(! (lblMotherPosV0Dghter < 0) ) { // mother != primary (!= -1) | |
1519 | if(! (lblMotherNegV0Dghter < 0) ) { | |
1520 | ||
1521 | // mothers = Lambda candidate ... a priori | |
1522 | ||
1523 | TParticle* mcMotherPosV0Dghter = lMCstack->Particle( lblMotherPosV0Dghter ); | |
1524 | TParticle* mcMotherNegV0Dghter = lMCstack->Particle( lblMotherNegV0Dghter ); | |
1525 | ||
1526 | // - Step 4.3 : level of Xi candidate | |
1527 | ||
1528 | Int_t lblGdMotherPosV0Dghter = mcMotherPosV0Dghter->GetFirstMother() ; | |
1529 | Int_t lblGdMotherNegV0Dghter = mcMotherNegV0Dghter->GetFirstMother() ; | |
1530 | ||
1531 | if(! (lblGdMotherPosV0Dghter != lblGdMotherNegV0Dghter) ) { | |
1532 | if(! (lblGdMotherPosV0Dghter < 0) ) { // primary lambda ... | |
1533 | if(! (lblGdMotherNegV0Dghter < 0) ) { // primary lambda ... | |
1534 | ||
1535 | // Gd mothers = Xi candidate ... a priori | |
1536 | ||
1537 | TParticle* mcGdMotherPosV0Dghter = lMCstack->Particle( lblGdMotherPosV0Dghter ); | |
1538 | TParticle* mcGdMotherNegV0Dghter = lMCstack->Particle( lblGdMotherNegV0Dghter ); | |
1539 | ||
1540 | Int_t lblMotherBach = (Int_t) TMath::Abs( mcBach->GetFirstMother() ); | |
1541 | ||
1542 | // if( lblMotherBach != lblGdMotherPosV0Dghter ) continue; //same mother for bach and V0 daughters | |
1543 | if(!(lblMotherBach != lblGdMotherPosV0Dghter)) { //same mother for bach and V0 daughters | |
1544 | ||
1545 | TParticle* mcMotherBach = lMCstack->Particle( lblMotherBach ); | |
1546 | ||
1547 | lPID_BachMother = mcMotherBach->GetPdgCode(); | |
1548 | lPID_NegMother = mcGdMotherPosV0Dghter->GetPdgCode(); | |
1549 | lPID_PosMother = mcGdMotherNegV0Dghter->GetPdgCode(); | |
1550 | ||
1551 | if(lPID_BachMother==lPID_NegMother && lPID_BachMother==lPID_PosMother){ | |
1552 | lPDGCodeCascade = lPID_BachMother; | |
1553 | lXiTransvMomMC = mcMotherBach->Pt(); | |
1554 | if ( (mcMotherBach->Energy() + mcMotherBach->Pz()) / (mcMotherBach->Energy() - mcMotherBach->Pz() +1.e-13) !=0 ){ | |
1555 | lRapMC = 0.5*TMath::Log( (mcMotherBach->Energy() + mcMotherBach->Pz()) / (mcMotherBach->Energy() - mcMotherBach->Pz() +1.e-13) ); | |
1556 | } | |
1557 | } | |
1558 | ||
1559 | }}}}}}} //Ends all conditionals above... | |
1560 | ||
1561 | //---------------------------------------- | |
1562 | // Regular MC ASSOCIATION ENDS HERE | |
1563 | //---------------------------------------- | |
1564 | ||
1565 | //------------------------------------------------ | |
1566 | // Set Variables for adding to tree | |
1567 | //------------------------------------------------ | |
1568 | ||
1569 | /* 1*/ fTreeCascVarCharge = lChargeXi; | |
1570 | /* 2*/ if(lInvMassXiMinus!=0) fTreeCascVarMassAsXi = lInvMassXiMinus; | |
1571 | /* 2*/ if(lInvMassXiPlus!=0) fTreeCascVarMassAsXi = lInvMassXiPlus; | |
1572 | /* 3*/ if(lInvMassOmegaMinus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaMinus; | |
1573 | /* 3*/ if(lInvMassOmegaPlus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaPlus; | |
1574 | /* 4*/ fTreeCascVarPt = lXiTransvMom; | |
1575 | /* 4*/ fTreeCascVarPtMC = lXiTransvMomMC; | |
1576 | /* 5*/ fTreeCascVarRapXi = lRapXi ; | |
1577 | /* 5*/ fTreeCascVarRapMC = lRapMC ; | |
1578 | /* 6*/ fTreeCascVarRapOmega = lRapOmega ; | |
1579 | /* 7*/ fTreeCascVarDCACascDaughters = lDcaXiDaughters; | |
1580 | /* 8*/ fTreeCascVarDCABachToPrimVtx = lDcaBachToPrimVertexXi; | |
1581 | /* 9*/ fTreeCascVarDCAV0Daughters = lDcaV0DaughtersXi; | |
1582 | /*10*/ fTreeCascVarDCAV0ToPrimVtx = lDcaV0ToPrimVertexXi; | |
1583 | /*11*/ fTreeCascVarDCAPosToPrimVtx = lDcaPosToPrimVertexXi; | |
1584 | /*12*/ fTreeCascVarDCANegToPrimVtx = lDcaNegToPrimVertexXi; | |
1585 | /*13*/ fTreeCascVarCascCosPointingAngle = lXiCosineOfPointingAngle; | |
1586 | /*14*/ fTreeCascVarCascRadius = lXiRadius; | |
1587 | /*15*/ fTreeCascVarV0Mass = lInvMassLambdaAsCascDghter; | |
1588 | /*16*/ fTreeCascVarV0CosPointingAngle = lV0CosineOfPointingAngleXi; | |
1589 | /*17*/ fTreeCascVarV0Radius = lV0RadiusXi; | |
1590 | /*20*/ fTreeCascVarLeastNbrClusters = leastnumberofclusters; | |
1591 | /*21*/ fTreeCascVarMultiplicity = lMultiplicity; //multiplicity, whatever that may be | |
1592 | ||
1593 | /*23*/ fTreeCascVarDistOverTotMom = TMath::Sqrt( | |
1594 | TMath::Power( lPosXi[0] - lBestPrimaryVtxPos[0] , 2) + | |
1595 | TMath::Power( lPosXi[1] - lBestPrimaryVtxPos[1] , 2) + | |
1596 | TMath::Power( lPosXi[2] - lBestPrimaryVtxPos[2] , 2) | |
1597 | ); | |
1598 | /*23*/ fTreeCascVarDistOverTotMom /= (lXiTotMom+1e-13); | |
1599 | /*24*/ //Not specified here, it has been set already (TRunNumber) | |
1600 | /*25*/ fTreeCascVarPID = lPDGCodeCascade; | |
1601 | ||
1602 | //------------------------------------------------ | |
1603 | // Fill Tree! | |
1604 | //------------------------------------------------ | |
1605 | ||
1606 | // The conditional is meant to decrease excessive | |
1607 | // memory usage! Be careful when loosening the | |
1608 | // cut! | |
1609 | ||
1610 | //Xi Mass window: 150MeV wide | |
1611 | //Omega mass window: 150MeV wide | |
1612 | ||
1613 | if( (fTreeCascVarMassAsXi<1.32+0.075&&fTreeCascVarMassAsXi>1.32-0.075) || | |
1614 | (fTreeCascVarMassAsOmega<1.68+0.075&&fTreeCascVarMassAsOmega>1.68-0.075) ){ | |
1615 | fTreeCascade->Fill(); | |
1616 | } | |
1617 | ||
1618 | //------------------------------------------------ | |
1619 | // Fill tree over. | |
1620 | //------------------------------------------------ | |
1621 | ||
1622 | }// end of the Cascade loop (ESD or AOD) | |
1623 | ||
1624 | // Post output data. | |
1625 | PostData(1, fListHist); | |
1626 | PostData(2, fTreeCascade); | |
1627 | } | |
1628 | ||
1629 | //________________________________________________________________________ | |
1630 | void AliAnalysisTaskExtractPerformanceCascade::Terminate(Option_t *) | |
1631 | { | |
1632 | // Draw result to the screen | |
1633 | // Called once at the end of the query | |
1634 | ||
1635 | TList *cRetrievedList = 0x0; | |
1636 | cRetrievedList = (TList*)GetOutputData(1); | |
1637 | if(!cRetrievedList){ | |
1638 | Printf("ERROR - AliAnalysisTaskExtractCascade : ouput data container list not available\n"); | |
1639 | return; | |
1640 | } | |
1641 | ||
1642 | fHistV0MultiplicityForTrigEvt = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0MultiplicityForTrigEvt") ); | |
1643 | if (!fHistV0MultiplicityForTrigEvt) { | |
1644 | Printf("ERROR - AliAnalysisTaskExtractCascade : fHistV0MultiplicityForTrigEvt not available"); | |
1645 | return; | |
1646 | } | |
1647 | ||
1648 | TCanvas *canCheck = new TCanvas("AliAnalysisTaskExtractCascade","V0 Multiplicity",10,10,510,510); | |
1649 | canCheck->cd(1)->SetLogy(); | |
1650 | ||
1651 | fHistV0MultiplicityForTrigEvt->SetMarkerStyle(22); | |
1652 | fHistV0MultiplicityForTrigEvt->DrawCopy("E"); | |
1653 | } | |
1654 | ||
1655 | //---------------------------------------------------------------------------- | |
1656 | ||
1657 | Double_t AliAnalysisTaskExtractPerformanceCascade::MyRapidity(Double_t rE, Double_t rPz) const | |
1658 | { | |
1659 | // Local calculation for rapidity | |
1660 | Double_t ReturnValue = -100; | |
1661 | if( (rE-rPz+1.e-13) != 0 && (rE+rPz) != 0 ){ | |
1662 | ReturnValue = 0.5*TMath::Log((rE+rPz)/(rE-rPz+1.e-13)); | |
1663 | } | |
1664 | return ReturnValue; | |
1665 | } |