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