]>
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 | // | |
76029adc | 23 | // |
24 | // --- Algorithm Description | |
25 | // 1. Loop over primaries in stack to acquire generated charged Xi | |
9a8f3aee | 26 | // 2. Loop over stack to find Cascades, fill TH3Fs "PrimRawPt"s for Efficiency |
76029adc | 27 | // 3. Perform Physics Selection |
28 | // 4. Perform Primary Vertex |z|<10cm selection | |
9a8f3aee | 29 | // 5. Perform Primary Vertex NoTPCOnly vertexing selection |
76029adc | 30 | // 6. Perform Pileup Rejection |
31 | // 7. Analysis Loops: | |
32 | // 7a. Fill TH3Fs "PrimAnalysisPt" for control purposes only | |
76029adc | 33 | // |
34 | // Please Report Any Bugs! | |
35 | // | |
36 | // --- David Dobrigkeit Chinellato | |
37 | // (david.chinellato@gmail.com) | |
38 | // | |
39 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
40 | ||
41 | class TTree; | |
42 | class TParticle; | |
43 | class TVector3; | |
44 | ||
45 | //class AliMCEventHandler; | |
46 | //class AliMCEvent; | |
47 | //class AliStack; | |
48 | ||
49 | class AliESDVertex; | |
50 | class AliAODVertex; | |
51 | class AliESDv0; | |
52 | class AliAODv0; | |
53 | ||
54 | #include <Riostream.h> | |
55 | #include "TList.h" | |
56 | #include "TH1.h" | |
57 | #include "TH2.h" | |
58 | #include "TH3.h" | |
59 | #include "TFile.h" | |
60 | #include "THnSparse.h" | |
61 | #include "TVector3.h" | |
62 | #include "TCanvas.h" | |
63 | #include "TMath.h" | |
64 | #include "TLegend.h" | |
65 | #include "AliLog.h" | |
66 | ||
67 | #include "AliESDEvent.h" | |
68 | #include "AliAODEvent.h" | |
69 | #include "AliV0vertexer.h" | |
70 | #include "AliCascadeVertexer.h" | |
71 | #include "AliESDpid.h" | |
72 | #include "AliESDtrack.h" | |
73 | #include "AliESDtrackCuts.h" | |
74 | #include "AliInputEventHandler.h" | |
75 | #include "AliAnalysisManager.h" | |
76 | #include "AliMCEventHandler.h" | |
77 | #include "AliMCEvent.h" | |
78 | #include "AliStack.h" | |
79 | ||
d8841e95 | 80 | #include "AliV0vertexer.h" |
81 | #include "AliCascadeVertexer.h" | |
82 | ||
76029adc | 83 | #include "AliCFContainer.h" |
84 | #include "AliMultiplicity.h" | |
85 | #include "AliAODMCParticle.h" | |
86 | #include "AliESDcascade.h" | |
87 | #include "AliAODcascade.h" | |
88 | #include "AliESDUtils.h" | |
89 | #include "AliGenEventHeader.h" | |
90 | ||
91 | #include "AliAnalysisTaskExtractCascade.h" | |
92 | ||
93 | using std::cout; | |
94 | using std::endl; | |
95 | ||
96 | ClassImp(AliAnalysisTaskExtractCascade) | |
97 | ||
98 | AliAnalysisTaskExtractCascade::AliAnalysisTaskExtractCascade() | |
99 | : AliAnalysisTaskSE(), fListHist(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), | |
100 | fkIsNuclear ( kFALSE ), | |
101 | fkLowEnergyPP ( kFALSE ), | |
102 | ||
103 | //------------------------------------------------ | |
104 | // HISTOGRAMS | |
105 | // --- Filled on an Event-by-event basis | |
106 | //------------------------------------------------ | |
107 | fHistV0MultiplicityBeforeTrigSel(0), | |
108 | fHistV0MultiplicityForTrigEvt(0), | |
109 | fHistV0MultiplicityForSelEvt(0), | |
110 | fHistV0MultiplicityForSelEvtNoTPCOnly(0), | |
111 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0), | |
112 | fHistMultiplicityBeforeTrigSel(0), | |
113 | fHistMultiplicityForTrigEvt(0), | |
114 | fHistMultiplicity(0), | |
115 | fHistMultiplicityNoTPCOnly(0), | |
116 | fHistMultiplicityNoTPCOnlyNoPileup(0), | |
117 | fHistPVx(0), | |
118 | fHistPVy(0), | |
119 | fHistPVz(0), | |
120 | fHistPVxAnalysis(0), | |
121 | fHistPVyAnalysis(0), | |
122 | fHistPVzAnalysis(0) | |
123 | { | |
124 | // Dummy Constructor | |
125 | } | |
126 | ||
127 | AliAnalysisTaskExtractCascade::AliAnalysisTaskExtractCascade(const char *name) | |
128 | : AliAnalysisTaskSE(name), fListHist(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), | |
129 | fkIsNuclear ( kFALSE ), | |
130 | fkLowEnergyPP ( kFALSE ), | |
131 | ||
132 | //------------------------------------------------ | |
133 | // HISTOGRAMS | |
134 | // --- Filled on an Event-by-event basis | |
135 | //------------------------------------------------ | |
136 | fHistV0MultiplicityBeforeTrigSel(0), | |
137 | fHistV0MultiplicityForTrigEvt(0), | |
138 | fHistV0MultiplicityForSelEvt(0), | |
139 | fHistV0MultiplicityForSelEvtNoTPCOnly(0), | |
140 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0), | |
141 | fHistMultiplicityBeforeTrigSel(0), | |
142 | fHistMultiplicityForTrigEvt(0), | |
143 | fHistMultiplicity(0), | |
144 | fHistMultiplicityNoTPCOnly(0), | |
145 | fHistMultiplicityNoTPCOnlyNoPileup(0), | |
146 | fHistPVx(0), | |
147 | fHistPVy(0), | |
148 | fHistPVz(0), | |
149 | fHistPVxAnalysis(0), | |
150 | fHistPVyAnalysis(0), | |
151 | fHistPVzAnalysis(0) | |
152 | { | |
153 | // Constructor | |
d8841e95 | 154 | |
155 | //Set Variables for re-running the cascade vertexers (as done for MS paper) | |
156 | ||
157 | // New Loose : 1st step for the 7 TeV pp analysis | |
158 | ||
159 | fV0Sels[0] = 33. ; // max allowed chi2 | |
160 | fV0Sels[1] = 0.02; // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05) | |
161 | fV0Sels[2] = 0.02; // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05) | |
162 | fV0Sels[3] = 2.0 ; // max allowed DCA between the daughter tracks (LHC09a4 : 0.5) | |
163 | fV0Sels[4] = 0.95; // min allowed cosine of V0's pointing angle (LHC09a4 : 0.99) | |
164 | fV0Sels[5] = 1.0 ; // min radius of the fiducial volume (LHC09a4 : 0.2) | |
165 | fV0Sels[6] = 100. ; // max radius of the fiducial volume (LHC09a4 : 100.0) | |
166 | ||
167 | fCascSels[0] = 33. ; // max allowed chi2 (same as PDC07) | |
168 | fCascSels[1] = 0.05 ; // min allowed V0 impact parameter (PDC07 : 0.05 / LHC09a4 : 0.025 ) | |
169 | fCascSels[2] = 0.010; // "window" around the Lambda mass (PDC07 : 0.008 / LHC09a4 : 0.010 ) | |
170 | fCascSels[3] = 0.03 ; // min allowed bachelor's impact parameter (PDC07 : 0.035 / LHC09a4 : 0.025 ) | |
171 | fCascSels[4] = 2.0 ; // max allowed DCA between the V0 and the bachelor (PDC07 : 0.1 / LHC09a4 : 0.2 ) | |
172 | fCascSels[5] = 0.95 ; // min allowed cosine of the cascade pointing angle (PDC07 : 0.9985 / LHC09a4 : 0.998 ) | |
173 | fCascSels[6] = 0.4 ; // min radius of the fiducial volume (PDC07 : 0.9 / LHC09a4 : 0.2 ) | |
174 | fCascSels[7] = 100. ; // max radius of the fiducial volume (PDC07 : 100 / LHC09a4 : 100 ) | |
175 | ||
76029adc | 176 | // Output slot #0 writes into a TList container (Cascade) |
177 | DefineOutput(1, TList::Class()); | |
178 | DefineOutput(2, TTree::Class()); | |
179 | } | |
180 | ||
181 | ||
182 | AliAnalysisTaskExtractCascade::~AliAnalysisTaskExtractCascade() | |
183 | { | |
184 | //------------------------------------------------ | |
185 | // DESTRUCTOR | |
186 | //------------------------------------------------ | |
187 | ||
188 | if (fListHist){ | |
189 | delete fListHist; | |
190 | fListHist = 0x0; | |
191 | } | |
192 | if (fTreeCascade){ | |
193 | delete fTreeCascade; | |
194 | fTreeCascade = 0x0; | |
195 | } | |
196 | //cleanup esd track cuts object too... | |
197 | if (fESDtrackCuts){ | |
198 | delete fESDtrackCuts; | |
199 | fESDtrackCuts = 0x0; | |
200 | } | |
201 | ||
202 | } | |
203 | ||
204 | //________________________________________________________________________ | |
205 | void AliAnalysisTaskExtractCascade::UserCreateOutputObjects() | |
206 | { | |
207 | OpenFile(2); | |
208 | // Called once | |
209 | ||
210 | //------------------------------------------------ | |
211 | ||
212 | fTreeCascade = new TTree("fTreeCascade","CascadeCandidates"); | |
213 | ||
214 | //------------------------------------------------ | |
215 | // fTreeCascade Branch definitions - Cascade Tree | |
216 | //------------------------------------------------ | |
217 | ||
218 | //------------------------------------------------ | |
219 | // fTreeCascade Branch definitions | |
220 | //------------------------------------------------ | |
221 | ||
222 | //-----------BASIC-INFO--------------------------- | |
223 | /* 1*/ fTreeCascade->Branch("fTreeCascVarCharge",&fTreeCascVarCharge,"fTreeCascVarCharge/I"); | |
224 | /* 2*/ fTreeCascade->Branch("fTreeCascVarMassAsXi",&fTreeCascVarMassAsXi,"fTreeCascVarMassAsXi/F"); | |
225 | /* 3*/ fTreeCascade->Branch("fTreeCascVarMassAsOmega",&fTreeCascVarMassAsOmega,"fTreeCascVarMassAsOmega/F"); | |
226 | /* 4*/ fTreeCascade->Branch("fTreeCascVarPt",&fTreeCascVarPt,"fTreeCascVarPt/F"); | |
227 | /* 5*/ fTreeCascade->Branch("fTreeCascVarRapXi",&fTreeCascVarRapXi,"fTreeCascVarRapXi/F"); | |
228 | /* 6*/ fTreeCascade->Branch("fTreeCascVarRapOmega",&fTreeCascVarRapOmega,"fTreeCascVarRapOmega/F"); | |
229 | /* 7*/ fTreeCascade->Branch("fTreeCascVarNegEta",&fTreeCascVarNegEta,"fTreeCascVarNegEta/F"); | |
230 | /* 8*/ fTreeCascade->Branch("fTreeCascVarPosEta",&fTreeCascVarPosEta,"fTreeCascVarPosEta/F"); | |
231 | /* 9*/ fTreeCascade->Branch("fTreeCascVarBachEta",&fTreeCascVarBachEta,"fTreeCascVarBachEta/F"); | |
232 | //-----------INFO-FOR-CUTS------------------------ | |
233 | /*10*/ fTreeCascade->Branch("fTreeCascVarDCACascDaughters",&fTreeCascVarDCACascDaughters,"fTreeCascVarDCACascDaughters/F"); | |
234 | /*11*/ fTreeCascade->Branch("fTreeCascVarDCABachToPrimVtx",&fTreeCascVarDCABachToPrimVtx,"fTreeCascVarDCABachToPrimVtx/F"); | |
235 | /*12*/ fTreeCascade->Branch("fTreeCascVarDCAV0Daughters",&fTreeCascVarDCAV0Daughters,"fTreeCascVarDCAV0Daughters/F"); | |
236 | /*13*/ fTreeCascade->Branch("fTreeCascVarDCAV0ToPrimVtx",&fTreeCascVarDCAV0ToPrimVtx,"fTreeCascVarDCAV0ToPrimVtx/F"); | |
237 | /*14*/ fTreeCascade->Branch("fTreeCascVarDCAPosToPrimVtx",&fTreeCascVarDCAPosToPrimVtx,"fTreeCascVarDCAPosToPrimVtx/F"); | |
238 | /*15*/ fTreeCascade->Branch("fTreeCascVarDCANegToPrimVtx",&fTreeCascVarDCANegToPrimVtx,"fTreeCascVarDCANegToPrimVtx/F"); | |
239 | /*16*/ fTreeCascade->Branch("fTreeCascVarCascCosPointingAngle",&fTreeCascVarCascCosPointingAngle,"fTreeCascVarCascCosPointingAngle/F"); | |
240 | /*17*/ fTreeCascade->Branch("fTreeCascVarCascRadius",&fTreeCascVarCascRadius,"fTreeCascVarCascRadius/F"); | |
241 | /*18*/ fTreeCascade->Branch("fTreeCascVarV0Mass",&fTreeCascVarV0Mass,"fTreeCascVarV0Mass/F"); | |
242 | /*19*/ fTreeCascade->Branch("fTreeCascVarV0CosPointingAngle",&fTreeCascVarV0CosPointingAngle,"fTreeCascVarV0CosPointingAngle/F"); | |
243 | /*20*/ fTreeCascade->Branch("fTreeCascVarV0Radius",&fTreeCascVarV0Radius,"fTreeCascVarV0Radius/F"); | |
244 | /*21*/ fTreeCascade->Branch("fTreeCascVarLeastNbrClusters",&fTreeCascVarLeastNbrClusters,"fTreeCascVarLeastNbrClusters/I"); | |
245 | //-----------MULTIPLICITY-INFO-------------------- | |
246 | /*22*/ fTreeCascade->Branch("fTreeCascVarMultiplicity",&fTreeCascVarMultiplicity,"fTreeCascVarMultiplicity/I"); | |
247 | //-----------DECAY-LENGTH-INFO-------------------- | |
248 | /*23*/ fTreeCascade->Branch("fTreeCascVarDistOverTotMom",&fTreeCascVarDistOverTotMom,"fTreeCascVarDistOverTotMom/F"); | |
249 | //------------------------------------------------ | |
250 | /*24*/ fTreeCascade->Branch("fTreeCascVarNegNSigmaPion",&fTreeCascVarNegNSigmaPion,"fTreeCascVarNegNSigmaPion/F"); | |
251 | /*25*/ fTreeCascade->Branch("fTreeCascVarNegNSigmaProton",&fTreeCascVarNegNSigmaProton,"fTreeCascVarNegNSigmaProton/F"); | |
252 | /*26*/ fTreeCascade->Branch("fTreeCascVarPosNSigmaPion",&fTreeCascVarPosNSigmaPion,"fTreeCascVarPosNSigmaPion/F"); | |
253 | /*27*/ fTreeCascade->Branch("fTreeCascVarPosNSigmaProton",&fTreeCascVarPosNSigmaProton,"fTreeCascVarPosNSigmaProton/F"); | |
254 | /*28*/ fTreeCascade->Branch("fTreeCascVarBachNSigmaPion",&fTreeCascVarBachNSigmaPion,"fTreeCascVarBachNSigmaPion/F"); | |
255 | /*29*/ fTreeCascade->Branch("fTreeCascVarBachNSigmaKaon",&fTreeCascVarBachNSigmaKaon,"fTreeCascVarBachNSigmaKaon/F"); | |
256 | ||
257 | //------------------------------------------------ | |
258 | // Particle Identification Setup | |
259 | //------------------------------------------------ | |
260 | ||
261 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); | |
262 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
263 | fPIDResponse = inputHandler->GetPIDResponse(); | |
264 | ||
265 | // Multiplicity | |
266 | ||
267 | if(! fESDtrackCuts ){ | |
268 | fESDtrackCuts = new AliESDtrackCuts(); | |
269 | } | |
270 | ||
271 | //------------------------------------------------ | |
272 | // V0 Multiplicity Histograms | |
273 | //------------------------------------------------ | |
274 | ||
275 | // Create histograms | |
276 | OpenFile(1); | |
277 | fListHist = new TList(); | |
278 | fListHist->SetOwner(); // See http://root.cern.ch/root/html/TCollection.html#TCollection:SetOwner | |
279 | ||
280 | ||
281 | if(! fHistV0MultiplicityBeforeTrigSel) { | |
282 | fHistV0MultiplicityBeforeTrigSel = new TH1F("fHistV0MultiplicityBeforeTrigSel", | |
283 | "V0s per event (before Trig. Sel.);Nbr of V0s/Evt;Events", | |
284 | 25, 0, 25); | |
285 | fListHist->Add(fHistV0MultiplicityBeforeTrigSel); | |
286 | } | |
287 | ||
288 | if(! fHistV0MultiplicityForTrigEvt) { | |
289 | fHistV0MultiplicityForTrigEvt = new TH1F("fHistV0MultiplicityForTrigEvt", | |
290 | "V0s per event (for triggered evt);Nbr of V0s/Evt;Events", | |
291 | 25, 0, 25); | |
292 | fListHist->Add(fHistV0MultiplicityForTrigEvt); | |
293 | } | |
294 | ||
295 | if(! fHistV0MultiplicityForSelEvt) { | |
296 | fHistV0MultiplicityForSelEvt = new TH1F("fHistV0MultiplicityForSelEvt", | |
297 | "V0s per event;Nbr of V0s/Evt;Events", | |
298 | 25, 0, 25); | |
299 | fListHist->Add(fHistV0MultiplicityForSelEvt); | |
300 | } | |
301 | ||
302 | if(! fHistV0MultiplicityForSelEvtNoTPCOnly) { | |
303 | fHistV0MultiplicityForSelEvtNoTPCOnly = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnly", | |
304 | "V0s per event;Nbr of V0s/Evt;Events", | |
305 | 25, 0, 25); | |
306 | fListHist->Add(fHistV0MultiplicityForSelEvtNoTPCOnly); | |
307 | } | |
308 | if(! fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup) { | |
309 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup", | |
310 | "V0s per event;Nbr of V0s/Evt;Events", | |
311 | 25, 0, 25); | |
312 | fListHist->Add(fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup); | |
313 | } | |
314 | ||
315 | //------------------------------------------------ | |
316 | // Track Multiplicity Histograms | |
317 | //------------------------------------------------ | |
318 | ||
319 | if(! fHistMultiplicityBeforeTrigSel) { | |
320 | fHistMultiplicityBeforeTrigSel = new TH1F("fHistMultiplicityBeforeTrigSel", | |
321 | "Tracks per event;Nbr of Tracks;Events", | |
322 | 200, 0, 200); | |
323 | fListHist->Add(fHistMultiplicityBeforeTrigSel); | |
324 | } | |
325 | if(! fHistMultiplicityForTrigEvt) { | |
326 | fHistMultiplicityForTrigEvt = new TH1F("fHistMultiplicityForTrigEvt", | |
327 | "Tracks per event;Nbr of Tracks;Events", | |
328 | 200, 0, 200); | |
329 | fListHist->Add(fHistMultiplicityForTrigEvt); | |
330 | } | |
331 | if(! fHistMultiplicity) { | |
332 | fHistMultiplicity = new TH1F("fHistMultiplicity", | |
333 | "Tracks per event;Nbr of Tracks;Events", | |
334 | 200, 0, 200); | |
335 | fListHist->Add(fHistMultiplicity); | |
336 | } | |
337 | if(! fHistMultiplicityNoTPCOnly) { | |
338 | fHistMultiplicityNoTPCOnly = new TH1F("fHistMultiplicityNoTPCOnly", | |
339 | "Tracks per event;Nbr of Tracks;Events", | |
340 | 200, 0, 200); | |
341 | fListHist->Add(fHistMultiplicityNoTPCOnly); | |
342 | } | |
343 | if(! fHistMultiplicityNoTPCOnlyNoPileup) { | |
344 | fHistMultiplicityNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityNoTPCOnlyNoPileup", | |
345 | "Tracks per event;Nbr of Tracks;Events", | |
346 | 200, 0, 200); | |
347 | fListHist->Add(fHistMultiplicityNoTPCOnlyNoPileup); | |
348 | } | |
349 | ||
350 | //---------------------------------- | |
351 | // Primary Vertex Position Histos | |
352 | //---------------------------------- | |
353 | ||
354 | if(! fHistPVx) { | |
355 | fHistPVx = new TH1F("fHistPVx", | |
356 | "PV x position;Nbr of Evts;x", | |
357 | 2000, -0.5, 0.5); | |
358 | fListHist->Add(fHistPVx); | |
359 | } | |
360 | if(! fHistPVy) { | |
361 | fHistPVy = new TH1F("fHistPVy", | |
362 | "PV y position;Nbr of Evts;y", | |
363 | 2000, -0.5, 0.5); | |
364 | fListHist->Add(fHistPVy); | |
365 | } | |
366 | if(! fHistPVz) { | |
367 | fHistPVz = new TH1F("fHistPVz", | |
368 | "PV z position;Nbr of Evts;z", | |
369 | 400, -20, 20); | |
370 | fListHist->Add(fHistPVz); | |
371 | } | |
372 | ||
373 | if(! fHistPVxAnalysis) { | |
374 | fHistPVxAnalysis = new TH1F("fHistPVxAnalysis", | |
375 | "PV x position;Nbr of Evts;x", | |
376 | 2000, -0.5, 0.5); | |
377 | fListHist->Add(fHistPVxAnalysis); | |
378 | } | |
379 | if(! fHistPVyAnalysis) { | |
380 | fHistPVyAnalysis = new TH1F("fHistPVyAnalysis", | |
381 | "PV y position;Nbr of Evts;y", | |
382 | 2000, -0.5, 0.5); | |
383 | fListHist->Add(fHistPVyAnalysis); | |
384 | } | |
385 | if(! fHistPVzAnalysis) { | |
386 | fHistPVzAnalysis = new TH1F("fHistPVzAnalysis", | |
387 | "PV z position;Nbr of Evts;z", | |
388 | 400, -20, 20); | |
389 | fListHist->Add(fHistPVzAnalysis); | |
390 | } | |
391 | ||
392 | //List of Histograms: Normal | |
393 | PostData(1, fListHist); | |
394 | ||
395 | //TTree Object: Saved to base directory. Should cache to disk while saving. | |
396 | //(Important to avoid excessive memory usage, particularly when merging) | |
397 | PostData(2, fTreeCascade); | |
398 | ||
399 | }// end UserCreateOutputObjects | |
400 | ||
401 | ||
402 | //________________________________________________________________________ | |
403 | void AliAnalysisTaskExtractCascade::UserExec(Option_t *) | |
404 | { | |
405 | // Main loop | |
406 | // Called for each event | |
407 | ||
408 | AliESDEvent *lESDevent = 0x0; | |
409 | ||
410 | Int_t lNumberOfV0s = -1; | |
411 | Double_t lTrkgPrimaryVtxPos[3] = {-100.0, -100.0, -100.0}; | |
412 | Double_t lBestPrimaryVtxPos[3] = {-100.0, -100.0, -100.0}; | |
413 | Double_t lMagneticField = -10.; | |
414 | ||
415 | // Connect to the InputEvent | |
416 | // After these lines, we should have an ESD/AOD event + the number of V0s in it. | |
417 | ||
418 | // Appropriate for ESD analysis! | |
419 | ||
420 | lESDevent = dynamic_cast<AliESDEvent*>( InputEvent() ); | |
421 | if (!lESDevent) { | |
422 | AliWarning("ERROR: lESDevent not available \n"); | |
423 | return; | |
424 | } | |
425 | ||
426 | /* --- Acquisition of exact event ID | |
427 | fTreeVariableRunNumber = lESDevent->GetRunNumber(); | |
428 | fTreeVariableEventNumber = | |
429 | ( ( ((ULong64_t)lESDevent->GetPeriodNumber() ) << 36 ) | | |
430 | ( ((ULong64_t)lESDevent->GetOrbitNumber () ) << 12 ) | | |
431 | ((ULong64_t)lESDevent->GetBunchCrossNumber() ) ); | |
432 | */ | |
433 | ||
434 | //------------------------------------------------ | |
435 | // Multiplicity Information Acquistion | |
436 | //------------------------------------------------ | |
437 | ||
438 | //REVISED multiplicity estimator after 'multiplicity day' (2011) | |
439 | Int_t lMultiplicity = -100; | |
440 | ||
441 | //testing purposes | |
442 | if(fkIsNuclear == kFALSE) lMultiplicity = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC,0.5); | |
443 | ||
444 | //---> If this is a nuclear collision, then go nuclear on "multiplicity" variable... | |
445 | //---> Warning: Experimental | |
446 | if(fkIsNuclear == kTRUE){ | |
447 | AliCentrality* centrality; | |
448 | centrality = lESDevent->GetCentrality(); | |
449 | lMultiplicity = ( ( Int_t ) ( centrality->GetCentralityPercentile( "V0M" ) ) ); | |
450 | if (centrality->GetQuality()>1) { | |
451 | PostData(1, fListHist); | |
452 | PostData(2, fTreeCascade); | |
453 | return; | |
454 | } | |
455 | } | |
456 | ||
457 | //Set variable for filling tree afterwards! | |
458 | //---> pp case......: GetReferenceMultiplicity | |
459 | //---> Pb-Pb case...: Centrality by V0M | |
460 | ||
461 | fTreeCascVarMultiplicity = lMultiplicity; | |
462 | ||
463 | fHistV0MultiplicityBeforeTrigSel->Fill ( lESDevent->GetNumberOfV0s() ); | |
464 | fHistMultiplicityBeforeTrigSel->Fill ( lMultiplicity ); | |
465 | ||
466 | //------------------------------------------------ | |
467 | // Physics Selection | |
468 | //------------------------------------------------ | |
469 | ||
470 | UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected(); | |
471 | Bool_t isSelected = 0; | |
472 | isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB; | |
473 | ||
474 | //pp at 2.76TeV: special case, ignore FastOnly | |
475 | if ( (fkLowEnergyPP == kTRUE) && (maskIsSelected& AliVEvent::kFastOnly) ){ | |
476 | PostData(1, fListHist); | |
477 | PostData(2, fTreeCascade); | |
478 | return; | |
479 | } | |
480 | //Standard Min-Bias Selection | |
481 | if ( ! isSelected ) { | |
482 | PostData(1, fListHist); | |
483 | PostData(2, fTreeCascade); | |
484 | return; | |
485 | } | |
486 | ||
d8841e95 | 487 | //------------------------------------------------ |
488 | // Rerun cascade vertexer! | |
489 | //------------------------------------------------ | |
490 | ||
491 | lESDevent->ResetCascades(); | |
492 | lESDevent->ResetV0s(); | |
493 | ||
494 | AliV0vertexer lV0vtxer; | |
495 | AliCascadeVertexer lCascVtxer; | |
496 | ||
497 | lV0vtxer.SetDefaultCuts(fV0Sels); | |
498 | lCascVtxer.SetDefaultCuts(fCascSels); | |
499 | ||
500 | lV0vtxer.Tracks2V0vertices(lESDevent); | |
501 | lCascVtxer.V0sTracks2CascadeVertices(lESDevent); | |
502 | ||
76029adc | 503 | //------------------------------------------------ |
504 | // After Trigger Selection | |
505 | //------------------------------------------------ | |
506 | ||
507 | lNumberOfV0s = lESDevent->GetNumberOfV0s(); | |
508 | ||
509 | //Set variable for filling tree afterwards! | |
510 | fHistV0MultiplicityForTrigEvt->Fill(lNumberOfV0s); | |
511 | fHistMultiplicityForTrigEvt->Fill ( lMultiplicity ); | |
512 | ||
513 | //------------------------------------------------ | |
514 | // Getting: Primary Vertex + MagField Info | |
515 | //------------------------------------------------ | |
516 | ||
517 | const AliESDVertex *lPrimaryTrackingESDVtx = lESDevent->GetPrimaryVertexTracks(); | |
518 | // get the vtx stored in ESD found with tracks | |
519 | lPrimaryTrackingESDVtx->GetXYZ( lTrkgPrimaryVtxPos ); | |
520 | ||
521 | const AliESDVertex *lPrimaryBestESDVtx = lESDevent->GetPrimaryVertex(); | |
522 | // get the best primary vertex available for the event | |
523 | // As done in AliCascadeVertexer, we keep the one which is the best one available. | |
524 | // between : Tracking vertex > SPD vertex > TPC vertex > default SPD vertex | |
525 | // This one will be used for next calculations (DCA essentially) | |
526 | lPrimaryBestESDVtx->GetXYZ( lBestPrimaryVtxPos ); | |
527 | ||
528 | Double_t lPrimaryVtxPosition[3]; | |
529 | const AliVVertex *primaryVtx = lESDevent->GetPrimaryVertex(); | |
530 | lPrimaryVtxPosition[0] = primaryVtx->GetX(); | |
531 | lPrimaryVtxPosition[1] = primaryVtx->GetY(); | |
532 | lPrimaryVtxPosition[2] = primaryVtx->GetZ(); | |
533 | fHistPVx->Fill( lPrimaryVtxPosition[0] ); | |
534 | fHistPVy->Fill( lPrimaryVtxPosition[1] ); | |
535 | fHistPVz->Fill( lPrimaryVtxPosition[2] ); | |
536 | ||
537 | //------------------------------------------------ | |
538 | // Primary Vertex Z position: SKIP | |
539 | //------------------------------------------------ | |
540 | ||
541 | if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0 ) { | |
542 | AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !"); | |
543 | PostData(1, fListHist); | |
544 | PostData(2, fTreeCascade); | |
545 | return; | |
546 | } | |
547 | ||
548 | lMagneticField = lESDevent->GetMagneticField( ); | |
549 | fHistV0MultiplicityForSelEvt ->Fill( lNumberOfV0s ); | |
550 | fHistMultiplicity->Fill(lMultiplicity); | |
551 | ||
552 | //------------------------------------------------ | |
553 | // SKIP: Events with well-established PVtx | |
554 | //------------------------------------------------ | |
555 | ||
556 | const AliESDVertex *lPrimaryTrackingESDVtxCheck = lESDevent->GetPrimaryVertexTracks(); | |
557 | const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD(); | |
558 | if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtxCheck->GetStatus() ){ | |
559 | AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !"); | |
560 | PostData(1, fListHist); | |
561 | PostData(2, fTreeCascade); | |
562 | return; | |
563 | } | |
564 | fHistV0MultiplicityForSelEvtNoTPCOnly ->Fill( lNumberOfV0s ); | |
565 | fHistMultiplicityNoTPCOnly->Fill(lMultiplicity); | |
566 | ||
567 | //------------------------------------------------ | |
568 | // Pileup Rejection Studies | |
569 | //------------------------------------------------ | |
570 | ||
571 | // FIXME : quality selection regarding pile-up rejection | |
572 | 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 | |
573 | AliWarning("Pb / This is tagged as Pileup from SPD... return !"); | |
574 | PostData(1, fListHist); | |
575 | PostData(2, fTreeCascade); | |
576 | return; | |
577 | } | |
578 | fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup ->Fill( lNumberOfV0s ); | |
579 | fHistMultiplicityNoTPCOnlyNoPileup->Fill(lMultiplicity); | |
580 | ||
581 | //Do control histograms without the IsFromVertexerZ events, but consider them in analysis... | |
582 | if( ! (lESDevent->GetPrimaryVertex()->IsFromVertexerZ() ) ){ | |
583 | fHistPVxAnalysis->Fill( lPrimaryVtxPosition[0] ); | |
584 | fHistPVyAnalysis->Fill( lPrimaryVtxPosition[1] ); | |
585 | fHistPVzAnalysis->Fill( lPrimaryVtxPosition[2] ); | |
586 | } | |
587 | ||
588 | //------------------------------------------------ | |
589 | // MAIN CASCADE LOOP STARTS HERE | |
590 | //------------------------------------------------ | |
591 | // Code Credit: Antonin Maire (thanks^100) | |
592 | // ---> This is an adaptation | |
593 | ||
594 | Long_t ncascades = 0; | |
595 | ncascades = lESDevent->GetNumberOfCascades(); | |
596 | ||
597 | for (Int_t iXi = 0; iXi < ncascades; iXi++){ | |
598 | //------------------------------------------------ | |
599 | // Initializations | |
600 | //------------------------------------------------ | |
601 | //Double_t lTrkgPrimaryVtxRadius3D = -500.0; | |
602 | //Double_t lBestPrimaryVtxRadius3D = -500.0; | |
603 | ||
604 | // - 1st part of initialisation : variables needed to store AliESDCascade data members | |
605 | Double_t lEffMassXi = 0. ; | |
606 | //Double_t lChi2Xi = -1. ; | |
607 | Double_t lDcaXiDaughters = -1. ; | |
608 | Double_t lXiCosineOfPointingAngle = -1. ; | |
609 | Double_t lPosXi[3] = { -1000.0, -1000.0, -1000.0 }; | |
610 | Double_t lXiRadius = -1000. ; | |
611 | ||
612 | // - 2nd part of initialisation : Nbr of clusters within TPC for the 3 daughter cascade tracks | |
613 | Int_t lPosTPCClusters = -1; // For ESD only ...//FIXME : wait for availability in AOD | |
614 | Int_t lNegTPCClusters = -1; // For ESD only ... | |
615 | Int_t lBachTPCClusters = -1; // For ESD only ... | |
616 | ||
617 | // - 3rd part of initialisation : about V0 part in cascades | |
618 | Double_t lInvMassLambdaAsCascDghter = 0.; | |
619 | //Double_t lV0Chi2Xi = -1. ; | |
620 | Double_t lDcaV0DaughtersXi = -1.; | |
621 | ||
622 | Double_t lDcaBachToPrimVertexXi = -1., lDcaV0ToPrimVertexXi = -1.; | |
623 | Double_t lDcaPosToPrimVertexXi = -1.; | |
624 | Double_t lDcaNegToPrimVertexXi = -1.; | |
625 | Double_t lV0CosineOfPointingAngleXi = -1. ; | |
626 | Double_t lPosV0Xi[3] = { -1000. , -1000., -1000. }; // Position of VO coming from cascade | |
627 | Double_t lV0RadiusXi = -1000.0; | |
628 | Double_t lV0quality = 0.; | |
629 | ||
630 | // - 4th part of initialisation : Effective masses | |
631 | Double_t lInvMassXiMinus = 0.; | |
632 | Double_t lInvMassXiPlus = 0.; | |
633 | Double_t lInvMassOmegaMinus = 0.; | |
634 | Double_t lInvMassOmegaPlus = 0.; | |
635 | ||
636 | // - 6th part of initialisation : extra info for QA | |
637 | Double_t lXiMomX = 0. , lXiMomY = 0., lXiMomZ = 0.; | |
638 | Double_t lXiTransvMom = 0. ; | |
639 | Double_t lXiTransvMomMC= 0. ; | |
640 | Double_t lXiTotMom = 0. ; | |
641 | ||
642 | Double_t lBachMomX = 0., lBachMomY = 0., lBachMomZ = 0.; | |
643 | //Double_t lBachTransvMom = 0.; | |
644 | //Double_t lBachTotMom = 0.; | |
645 | ||
646 | fTreeCascVarNegNSigmaPion = -100; | |
647 | fTreeCascVarNegNSigmaProton = -100; | |
648 | fTreeCascVarPosNSigmaPion = -100; | |
649 | fTreeCascVarPosNSigmaProton = -100; | |
650 | fTreeCascVarBachNSigmaPion = -100; | |
651 | fTreeCascVarBachNSigmaKaon = -100; | |
652 | ||
653 | Short_t lChargeXi = -2; | |
654 | //Double_t lV0toXiCosineOfPointingAngle = 0. ; | |
655 | ||
656 | Double_t lRapXi = -20.0, lRapOmega = -20.0, lRapMC = -20.0; // lEta = -20.0, lTheta = 360., lPhi = 720. ; | |
657 | //Double_t lAlphaXi = -200., lPtArmXi = -200.0; | |
658 | ||
659 | // ------------------------------------- | |
660 | // II.ESD - Calculation Part dedicated to Xi vertices (ESD) | |
661 | ||
662 | AliESDcascade *xi = lESDevent->GetCascade(iXi); | |
663 | if (!xi) continue; | |
664 | ||
665 | ||
666 | // - II.Step 1 : around primary vertex | |
667 | //------------- | |
668 | //lTrkgPrimaryVtxRadius3D = TMath::Sqrt( lTrkgPrimaryVtxPos[0] * lTrkgPrimaryVtxPos[0] + | |
669 | // lTrkgPrimaryVtxPos[1] * lTrkgPrimaryVtxPos[1] + | |
670 | // lTrkgPrimaryVtxPos[2] * lTrkgPrimaryVtxPos[2] ); | |
671 | ||
672 | //lBestPrimaryVtxRadius3D = TMath::Sqrt( lBestPrimaryVtxPos[0] * lBestPrimaryVtxPos[0] + | |
673 | // lBestPrimaryVtxPos[1] * lBestPrimaryVtxPos[1] + | |
674 | // lBestPrimaryVtxPos[2] * lBestPrimaryVtxPos[2] ); | |
675 | ||
676 | // - II.Step 2 : Assigning the necessary variables for specific AliESDcascade data members (ESD) | |
677 | //------------- | |
678 | lV0quality = 0.; | |
679 | xi->ChangeMassHypothesis(lV0quality , 3312); // default working hypothesis : cascade = Xi- decay | |
680 | ||
681 | lEffMassXi = xi->GetEffMassXi(); | |
682 | //lChi2Xi = xi->GetChi2Xi(); | |
683 | lDcaXiDaughters = xi->GetDcaXiDaughters(); | |
684 | lXiCosineOfPointingAngle = xi->GetCascadeCosineOfPointingAngle( lBestPrimaryVtxPos[0], | |
685 | lBestPrimaryVtxPos[1], | |
686 | lBestPrimaryVtxPos[2] ); | |
687 | // Take care : the best available vertex should be used (like in AliCascadeVertexer) | |
688 | ||
689 | xi->GetXYZcascade( lPosXi[0], lPosXi[1], lPosXi[2] ); | |
690 | lXiRadius = TMath::Sqrt( lPosXi[0]*lPosXi[0] + lPosXi[1]*lPosXi[1] ); | |
691 | ||
692 | // - II.Step 3 : around the tracks : Bach + V0 (ESD) | |
693 | // ~ Necessary variables for ESDcascade data members coming from the ESDv0 part (inheritance) | |
694 | //------------- | |
695 | ||
696 | UInt_t lIdxPosXi = (UInt_t) TMath::Abs( xi->GetPindex() ); | |
697 | UInt_t lIdxNegXi = (UInt_t) TMath::Abs( xi->GetNindex() ); | |
698 | UInt_t lBachIdx = (UInt_t) TMath::Abs( xi->GetBindex() ); | |
699 | // Care track label can be negative in MC production (linked with the track quality) | |
700 | // However = normally, not the case for track index ... | |
701 | ||
702 | // FIXME : rejection of a double use of a daughter track (nothing but just a crosscheck of what is done in the cascade vertexer) | |
703 | if(lBachIdx == lIdxNegXi) { | |
704 | AliWarning("Pb / Idx(Bach. track) = Idx(Neg. track) ... continue!"); continue; | |
705 | } | |
706 | if(lBachIdx == lIdxPosXi) { | |
707 | AliWarning("Pb / Idx(Bach. track) = Idx(Pos. track) ... continue!"); continue; | |
708 | } | |
709 | ||
710 | AliESDtrack *pTrackXi = lESDevent->GetTrack( lIdxPosXi ); | |
711 | AliESDtrack *nTrackXi = lESDevent->GetTrack( lIdxNegXi ); | |
712 | AliESDtrack *bachTrackXi = lESDevent->GetTrack( lBachIdx ); | |
713 | ||
714 | if (!pTrackXi || !nTrackXi || !bachTrackXi ) { | |
715 | AliWarning("ERROR: Could not retrieve one of the 3 ESD daughter tracks of the cascade ..."); | |
716 | continue; | |
717 | } | |
718 | ||
719 | fTreeCascVarPosEta = pTrackXi->Eta(); | |
720 | fTreeCascVarNegEta = nTrackXi->Eta(); | |
721 | fTreeCascVarBachEta = bachTrackXi->Eta(); | |
722 | ||
723 | //------------------------------------------------ | |
724 | // TPC dEdx information | |
725 | //------------------------------------------------ | |
726 | fTreeCascVarNegNSigmaPion = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kPion ); | |
727 | fTreeCascVarNegNSigmaProton = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kProton ); | |
728 | fTreeCascVarPosNSigmaPion = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kPion ); | |
729 | fTreeCascVarPosNSigmaProton = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kProton ); | |
730 | fTreeCascVarBachNSigmaPion = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kPion ); | |
731 | fTreeCascVarBachNSigmaKaon = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kKaon ); | |
732 | ||
733 | //------------------------------------------------ | |
734 | // TPC Number of clusters info | |
735 | // --- modified to save the smallest number | |
736 | // --- of TPC clusters for the 3 tracks | |
737 | //------------------------------------------------ | |
738 | ||
739 | lPosTPCClusters = pTrackXi->GetTPCNcls(); | |
740 | lNegTPCClusters = nTrackXi->GetTPCNcls(); | |
741 | lBachTPCClusters = bachTrackXi->GetTPCNcls(); | |
742 | ||
743 | // 1 - Poor quality related to TPCrefit | |
744 | ULong_t pStatus = pTrackXi->GetStatus(); | |
745 | ULong_t nStatus = nTrackXi->GetStatus(); | |
746 | ULong_t bachStatus = bachTrackXi->GetStatus(); | |
747 | if ((pStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / V0 Pos. track has no TPCrefit ... continue!"); continue; } | |
748 | if ((nStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / V0 Neg. track has no TPCrefit ... continue!"); continue; } | |
749 | if ((bachStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / Bach. track has no TPCrefit ... continue!"); continue; } | |
750 | // 2 - Poor quality related to TPC clusters: lowest cut of 70 clusters | |
751 | if(lPosTPCClusters < 70) { AliWarning("Pb / V0 Pos. track has less than 70 TPC clusters ... continue!"); continue; } | |
752 | if(lNegTPCClusters < 70) { AliWarning("Pb / V0 Neg. track has less than 70 TPC clusters ... continue!"); continue; } | |
753 | if(lBachTPCClusters < 70) { AliWarning("Pb / Bach. track has less than 70 TPC clusters ... continue!"); continue; } | |
754 | Int_t leastnumberofclusters = 1000; | |
755 | if( lPosTPCClusters < leastnumberofclusters ) leastnumberofclusters = lPosTPCClusters; | |
756 | if( lNegTPCClusters < leastnumberofclusters ) leastnumberofclusters = lNegTPCClusters; | |
757 | if( lBachTPCClusters < leastnumberofclusters ) leastnumberofclusters = lBachTPCClusters; | |
758 | ||
759 | lInvMassLambdaAsCascDghter = xi->GetEffMass(); | |
760 | // This value shouldn't change, whatever the working hyp. is : Xi-, Xi+, Omega-, Omega+ | |
761 | lDcaV0DaughtersXi = xi->GetDcaV0Daughters(); | |
762 | //lV0Chi2Xi = xi->GetChi2V0(); | |
763 | ||
764 | lV0CosineOfPointingAngleXi = xi->GetV0CosineOfPointingAngle( lBestPrimaryVtxPos[0], | |
765 | lBestPrimaryVtxPos[1], | |
766 | lBestPrimaryVtxPos[2] ); | |
767 | ||
768 | lDcaV0ToPrimVertexXi = xi->GetD( lBestPrimaryVtxPos[0], | |
769 | lBestPrimaryVtxPos[1], | |
770 | lBestPrimaryVtxPos[2] ); | |
771 | ||
772 | lDcaBachToPrimVertexXi = TMath::Abs( bachTrackXi->GetD( lBestPrimaryVtxPos[0], | |
773 | lBestPrimaryVtxPos[1], | |
774 | lMagneticField ) ); | |
775 | // Note : AliExternalTrackParam::GetD returns an algebraic value ... | |
776 | ||
777 | xi->GetXYZ( lPosV0Xi[0], lPosV0Xi[1], lPosV0Xi[2] ); | |
778 | lV0RadiusXi = TMath::Sqrt( lPosV0Xi[0]*lPosV0Xi[0] + lPosV0Xi[1]*lPosV0Xi[1] ); | |
779 | ||
780 | lDcaPosToPrimVertexXi = TMath::Abs( pTrackXi ->GetD( lBestPrimaryVtxPos[0], | |
781 | lBestPrimaryVtxPos[1], | |
782 | lMagneticField ) ); | |
783 | ||
784 | lDcaNegToPrimVertexXi = TMath::Abs( nTrackXi ->GetD( lBestPrimaryVtxPos[0], | |
785 | lBestPrimaryVtxPos[1], | |
786 | lMagneticField ) ); | |
787 | ||
788 | // - II.Step 4 : around effective masses (ESD) | |
789 | // ~ change mass hypotheses to cover all the possibilities : Xi-/+, Omega -/+ | |
790 | ||
791 | if( bachTrackXi->Charge() < 0 ) { | |
792 | lV0quality = 0.; | |
793 | xi->ChangeMassHypothesis(lV0quality , 3312); | |
794 | // Calculate the effective mass of the Xi- candidate. | |
795 | // pdg code 3312 = Xi- | |
796 | lInvMassXiMinus = xi->GetEffMassXi(); | |
797 | ||
798 | lV0quality = 0.; | |
799 | xi->ChangeMassHypothesis(lV0quality , 3334); | |
800 | // Calculate the effective mass of the Xi- candidate. | |
801 | // pdg code 3334 = Omega- | |
802 | lInvMassOmegaMinus = xi->GetEffMassXi(); | |
803 | ||
804 | lV0quality = 0.; | |
805 | xi->ChangeMassHypothesis(lV0quality , 3312); // Back to default hyp. | |
806 | }// end if negative bachelor | |
807 | ||
808 | ||
809 | if( bachTrackXi->Charge() > 0 ){ | |
810 | lV0quality = 0.; | |
811 | xi->ChangeMassHypothesis(lV0quality , -3312); | |
812 | // Calculate the effective mass of the Xi+ candidate. | |
813 | // pdg code -3312 = Xi+ | |
814 | lInvMassXiPlus = xi->GetEffMassXi(); | |
815 | ||
816 | lV0quality = 0.; | |
817 | xi->ChangeMassHypothesis(lV0quality , -3334); | |
818 | // Calculate the effective mass of the Xi+ candidate. | |
819 | // pdg code -3334 = Omega+ | |
820 | lInvMassOmegaPlus = xi->GetEffMassXi(); | |
821 | ||
822 | lV0quality = 0.; | |
823 | xi->ChangeMassHypothesis(lV0quality , -3312); // Back to "default" hyp. | |
824 | }// end if positive bachelor | |
825 | // - II.Step 6 : extra info for QA (ESD) | |
826 | // miscellaneous pieces of info that may help regarding data quality assessment. | |
827 | //------------- | |
828 | ||
829 | xi->GetPxPyPz( lXiMomX, lXiMomY, lXiMomZ ); | |
830 | lXiTransvMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY ); | |
831 | lXiTotMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY + lXiMomZ*lXiMomZ ); | |
832 | ||
833 | xi->GetBPxPyPz( lBachMomX, lBachMomY, lBachMomZ ); | |
834 | //lBachTransvMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY ); | |
835 | //lBachTotMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY + lBachMomZ*lBachMomZ ); | |
836 | ||
837 | lChargeXi = xi->Charge(); | |
838 | ||
839 | //lV0toXiCosineOfPointingAngle = xi->GetV0CosineOfPointingAngle( lPosXi[0], lPosXi[1], lPosXi[2] ); | |
840 | ||
841 | lRapXi = xi->RapXi(); | |
842 | lRapOmega = xi->RapOmega(); | |
843 | //lEta = xi->Eta(); | |
844 | //lTheta = xi->Theta() *180.0/TMath::Pi(); | |
845 | //lPhi = xi->Phi() *180.0/TMath::Pi(); | |
846 | //lAlphaXi = xi->AlphaXi(); | |
847 | //lPtArmXi = xi->PtArmXi(); | |
848 | ||
849 | //------------------------------------------------ | |
850 | // Set Variables for adding to tree | |
851 | //------------------------------------------------ | |
852 | ||
853 | /* 1*/ fTreeCascVarCharge = lChargeXi; | |
854 | /* 2*/ if(lInvMassXiMinus!=0) fTreeCascVarMassAsXi = lInvMassXiMinus; | |
855 | /* 2*/ if(lInvMassXiPlus!=0) fTreeCascVarMassAsXi = lInvMassXiPlus; | |
856 | /* 3*/ if(lInvMassOmegaMinus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaMinus; | |
857 | /* 3*/ if(lInvMassOmegaPlus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaPlus; | |
858 | /* 4*/ fTreeCascVarPt = lXiTransvMom; | |
859 | /* 4*/ fTreeCascVarPtMC = lXiTransvMomMC; | |
860 | /* 5*/ fTreeCascVarRapXi = lRapXi ; | |
861 | /* 5*/ fTreeCascVarRapMC = lRapMC ; | |
862 | /* 6*/ fTreeCascVarRapOmega = lRapOmega ; | |
863 | /* 7*/ fTreeCascVarDCACascDaughters = lDcaXiDaughters; | |
864 | /* 8*/ fTreeCascVarDCABachToPrimVtx = lDcaBachToPrimVertexXi; | |
865 | /* 9*/ fTreeCascVarDCAV0Daughters = lDcaV0DaughtersXi; | |
866 | /*10*/ fTreeCascVarDCAV0ToPrimVtx = lDcaV0ToPrimVertexXi; | |
867 | /*11*/ fTreeCascVarDCAPosToPrimVtx = lDcaPosToPrimVertexXi; | |
868 | /*12*/ fTreeCascVarDCANegToPrimVtx = lDcaNegToPrimVertexXi; | |
869 | /*13*/ fTreeCascVarCascCosPointingAngle = lXiCosineOfPointingAngle; | |
870 | /*14*/ fTreeCascVarCascRadius = lXiRadius; | |
871 | /*15*/ fTreeCascVarV0Mass = lInvMassLambdaAsCascDghter; | |
872 | /*16*/ fTreeCascVarV0CosPointingAngle = lV0CosineOfPointingAngleXi; | |
873 | /*17*/ fTreeCascVarV0Radius = lV0RadiusXi; | |
874 | /*20*/ fTreeCascVarLeastNbrClusters = leastnumberofclusters; | |
875 | /*21*/ fTreeCascVarMultiplicity = lMultiplicity; //multiplicity, whatever that may be | |
876 | ||
877 | /*23*/ fTreeCascVarDistOverTotMom = TMath::Sqrt( | |
878 | TMath::Power( lPosXi[0] - lBestPrimaryVtxPos[0] , 2) + | |
879 | TMath::Power( lPosXi[1] - lBestPrimaryVtxPos[1] , 2) + | |
880 | TMath::Power( lPosXi[2] - lBestPrimaryVtxPos[2] , 2) | |
881 | ); | |
882 | /*23*/ fTreeCascVarDistOverTotMom /= (lXiTotMom+1e-13); | |
883 | ||
884 | //All vars not specified here: specified elsewhere! | |
885 | ||
886 | //------------------------------------------------ | |
887 | // Fill Tree! | |
888 | //------------------------------------------------ | |
889 | ||
890 | // The conditional is meant to decrease excessive | |
891 | // memory usage! Be careful when loosening the | |
892 | // cut! | |
893 | ||
894 | //Xi Mass window: 150MeV wide | |
895 | //Omega mass window: 150MeV wide | |
896 | ||
897 | if( (fTreeCascVarMassAsXi<1.32+0.075&&fTreeCascVarMassAsXi>1.32-0.075) || | |
898 | (fTreeCascVarMassAsOmega<1.68+0.075&&fTreeCascVarMassAsOmega>1.68-0.075) ){ | |
899 | fTreeCascade->Fill(); | |
900 | } | |
901 | ||
902 | //------------------------------------------------ | |
903 | // Fill tree over. | |
904 | //------------------------------------------------ | |
905 | ||
906 | }// end of the Cascade loop (ESD or AOD) | |
907 | ||
908 | // Post output data. | |
909 | PostData(1, fListHist); | |
910 | PostData(2, fTreeCascade); | |
911 | } | |
912 | ||
913 | //________________________________________________________________________ | |
914 | void AliAnalysisTaskExtractCascade::Terminate(Option_t *) | |
915 | { | |
916 | // Draw result to the screen | |
917 | // Called once at the end of the query | |
918 | ||
919 | TList *cRetrievedList = 0x0; | |
920 | cRetrievedList = (TList*)GetOutputData(1); | |
921 | if(!cRetrievedList){ | |
922 | Printf("ERROR - AliAnalysisTaskExtractCascade : ouput data container list not available\n"); | |
923 | return; | |
924 | } | |
925 | ||
926 | fHistV0MultiplicityForTrigEvt = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0MultiplicityForTrigEvt") ); | |
927 | if (!fHistV0MultiplicityForTrigEvt) { | |
928 | Printf("ERROR - AliAnalysisTaskExtractCascade : fHistV0MultiplicityForTrigEvt not available"); | |
929 | return; | |
930 | } | |
931 | ||
932 | TCanvas *canCheck = new TCanvas("AliAnalysisTaskExtractCascade","V0 Multiplicity",10,10,510,510); | |
933 | canCheck->cd(1)->SetLogy(); | |
934 | ||
935 | fHistV0MultiplicityForTrigEvt->SetMarkerStyle(22); | |
936 | fHistV0MultiplicityForTrigEvt->DrawCopy("E"); | |
937 | } | |
938 | ||
939 | //---------------------------------------------------------------------------- | |
940 | ||
941 | Double_t AliAnalysisTaskExtractCascade::MyRapidity(Double_t rE, Double_t rPz) const | |
942 | { | |
943 | // Local calculation for rapidity | |
944 | Double_t ReturnValue = -100; | |
945 | if( (rE-rPz+1.e-13) != 0 && (rE+rPz) != 0 ){ | |
946 | ReturnValue = 0.5*TMath::Log((rE+rPz)/(rE-rPz+1.e-13)); | |
947 | } | |
948 | return ReturnValue; | |
949 | } |