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