]>
Commit | Line | Data |
---|---|---|
b594a020 | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
7 | * full copyright notice. * | |
8 | **************************************************************************/ | |
9 | ||
b594a020 | 10 | #include "AliEveV0.h" |
11 | ||
12 | #include <TEveTrack.h> | |
13 | #include <TEveTrackPropagator.h> | |
14 | #include <TEveManager.h> | |
15 | ||
16 | #include <TPolyLine3D.h> | |
17 | #include <TPolyMarker3D.h> | |
18 | #include <TColor.h> | |
19 | ||
d4dbbb43 | 20 | #include <TDatabasePDG.h> |
21 | #include <TParticlePDG.h> | |
22 | ||
b594a020 | 23 | #include <vector> |
24 | ||
25 | ||
26 | /*********************************************************************** | |
27 | * | |
28 | * AliEveV0 class | |
29 | * | |
30 | ************************************************************************/ | |
31 | ||
32 | ClassImp(AliEveV0) | |
33 | ||
e6e8b28b | 34 | //______________________________________________________________________________ |
b594a020 | 35 | AliEveV0::AliEveV0() : |
36 | TEvePointSet(), | |
37 | ||
38 | fRecBirthV(), | |
39 | fRecDecayV(), | |
40 | fRecDecayP(), | |
41 | fNegTrack(0), | |
42 | fPosTrack(0), | |
43 | fRnrStyle(0), | |
e6e8b28b | 44 | fPointingLine(0), |
b594a020 | 45 | fESDIndex(-1), |
ca8a6926 | 46 | fOnFlyStatus(kFALSE), |
b594a020 | 47 | fDaughterDCA(999), |
2c7d7ac0 | 48 | fChi2V0(-1), |
49 | fNegMaxProbPdg(0), | |
50 | fPosMaxProbPdg(0), | |
51 | fNegMaxProbPid(0), | |
52 | fPosMaxProbPid(0) | |
ca8a6926 | 53 | { |
54 | // Default constructor. | |
b594a020 | 55 | |
ca8a6926 | 56 | // Override from TEveElement. |
57 | fPickable = kTRUE; | |
e6e8b28b | 58 | fMainColorPtr = &fMarkerColor; |
ca8a6926 | 59 | } |
b594a020 | 60 | |
e6e8b28b | 61 | //______________________________________________________________________________ |
b594a020 | 62 | AliEveV0::AliEveV0(TEveRecTrack* tNeg, TEveRecTrack* tPos, |
63 | TEveRecV0* v0, TEveTrackPropagator* rs) : | |
64 | TEvePointSet(), | |
65 | ||
66 | fRecBirthV(v0->fV0Birth), | |
67 | fRecDecayV(v0->fVCa), | |
68 | fRecDecayP(v0->fPNeg + v0->fPPos), | |
69 | ||
70 | fNegTrack(new TEveTrack(tNeg, rs)), | |
71 | fPosTrack(new TEveTrack(tPos, rs)), | |
72 | ||
73 | fRnrStyle(rs), | |
e6e8b28b | 74 | fPointingLine(new TEveLine("Pointing line")), |
b594a020 | 75 | fESDIndex(-1), |
ca8a6926 | 76 | fOnFlyStatus(kFALSE), |
b594a020 | 77 | fDaughterDCA(999), |
2c7d7ac0 | 78 | fChi2V0(-1), |
79 | fNegMaxProbPdg(0), | |
80 | fPosMaxProbPdg(0), | |
81 | fNegMaxProbPid(0), | |
82 | fPosMaxProbPid(0) | |
b594a020 | 83 | { |
e6e8b28b | 84 | // Constructor with full V0 specification. |
85 | ||
ca8a6926 | 86 | // Override from TEveElement. |
87 | fPickable = kTRUE; | |
e6e8b28b | 88 | fMainColorPtr = &fMarkerColor; |
89 | ||
90 | fMarkerStyle = 2; | |
91 | fMarkerColor = kSpring + 6; | |
92 | fMarkerSize = 1; | |
93 | ||
94 | fPointingLine->SetLineColor(fMarkerColor); | |
95 | fPointingLine->SetLineWidth(2); | |
96 | fPointingLine->IncDenyDestroy(); | |
97 | AddElement(fPointingLine); | |
ca8a6926 | 98 | |
b594a020 | 99 | fPosTrack->SetLineColor(2); // red |
e6e8b28b | 100 | fPosTrack->SetStdTitle(); |
b594a020 | 101 | fNegTrack->SetLineColor(7); // light blue |
e6e8b28b | 102 | fNegTrack->SetStdTitle(); |
b594a020 | 103 | |
e6e8b28b | 104 | fNegTrack->IncDenyDestroy(); |
b594a020 | 105 | AddElement(fNegTrack); |
e6e8b28b | 106 | fPosTrack->IncDenyDestroy(); |
b594a020 | 107 | AddElement(fPosTrack); |
108 | } | |
109 | ||
e6e8b28b | 110 | //______________________________________________________________________________ |
b594a020 | 111 | AliEveV0::~AliEveV0() |
b594a020 | 112 | { |
e6e8b28b | 113 | // Destructor. Dereferences pos/neg tracks and pointing-line objects. |
b594a020 | 114 | |
e6e8b28b | 115 | fNegTrack->DecDenyDestroy(); |
116 | fPosTrack->DecDenyDestroy(); | |
117 | fPointingLine->DecDenyDestroy(); | |
b594a020 | 118 | } |
119 | ||
d4dbbb43 | 120 | //______________________________________________________________________________ |
2c7d7ac0 | 121 | void AliEveV0::SetMaxProbPdgPid(Int_t iDaughter, Int_t rPdg, Float_t rPid) |
122 | { | |
123 | // Sets the maximum probability Pdg value and Pid for one daughter | |
124 | // Should be moved to TEveTrack property eventually (or AliEveTrack creation) | |
125 | ||
126 | if(iDaughter==0){ | |
127 | fNegMaxProbPdg = rPdg; | |
128 | fNegMaxProbPid = rPid; | |
129 | } | |
130 | else if (iDaughter==1){ | |
131 | fPosMaxProbPdg = rPdg; | |
132 | fPosMaxProbPid = rPid; | |
133 | } | |
134 | ||
135 | } | |
136 | //______________________________________________________________________________ | |
137 | Float_t AliEveV0::GetInvMass(Int_t nPdgCode, Int_t pPdgCode) const | |
d4dbbb43 | 138 | { |
139 | // Returns Invariant Mass assuming the masses of the daughter particles | |
140 | TEveVector lNegMomentum = fNegTrack->GetMomentum(); | |
141 | // Does not work properly because momenta at the primary vertex !!!!!!! | |
142 | TEveVector lPosMomentum = fPosTrack->GetMomentum(); | |
143 | Double_t nMass=TDatabasePDG::Instance()->GetParticle(nPdgCode)->Mass(); | |
144 | Double_t pMass=TDatabasePDG::Instance()->GetParticle(pPdgCode)->Mass(); | |
145 | ||
146 | printf("\n check the mass of the particle negative %.5f positive %.5f \n",nMass,pMass); | |
147 | ||
148 | Double_t eNeg = TMath::Sqrt(nMass*nMass + lNegMomentum.Mag2()); | |
149 | Double_t ePos = TMath::Sqrt(pMass*pMass + lPosMomentum.Mag2()); | |
150 | ||
151 | return TMath::Sqrt( (eNeg+ePos)*(eNeg+ePos) - fRecDecayP.Mag2() ); | |
152 | } | |
153 | ||
b594a020 | 154 | //______________________________________________________________________________ |
155 | void AliEveV0::MakeV0() | |
156 | { | |
e6e8b28b | 157 | // Set all dependant components for drawing. |
158 | ||
b594a020 | 159 | SetPoint(0, fRecDecayV.fX, fRecDecayV.fY, fRecDecayV.fZ); |
160 | ||
161 | fNegTrack->MakeTrack(); | |
162 | fPosTrack->MakeTrack(); | |
e6e8b28b | 163 | |
164 | fPointingLine->SetPoint(0, fRecBirthV.fX, fRecBirthV.fY, fRecBirthV.fZ); | |
165 | fPointingLine->SetPoint(1, fRecDecayV.fX, fRecDecayV.fY, fRecDecayV.fZ); | |
b594a020 | 166 | } |
167 | ||
168 | ||
169 | /*********************************************************************** | |
170 | * | |
171 | * AliEveV0List class | |
172 | * | |
173 | ************************************************************************/ | |
174 | ||
175 | ClassImp(AliEveV0List) | |
176 | ||
177 | //______________________________________________________________________________ | |
178 | AliEveV0List::AliEveV0List() : | |
179 | TEveElementList(), | |
180 | fTitle(), | |
181 | fRnrStyle(0), | |
182 | fRnrDaughters(kTRUE), | |
183 | fRnrV0vtx(kTRUE), | |
184 | fRnrV0path(kTRUE), | |
185 | fNegColor(0), | |
ca8a6926 | 186 | fPosColor(0), |
187 | fMinRCut(0), | |
e1bb28b4 | 188 | fMaxRCut(250), |
189 | fMinDaughterDCA(0), | |
190 | fMaxDaughterDCA(1), | |
191 | fMinPt(0), | |
2c7d7ac0 | 192 | fMaxPt(20), |
193 | fNegCheckedPid(211), | |
194 | fPosCheckedPid(211), | |
195 | fNegCheckedProb(0.5), | |
196 | fPosCheckedProb(0.5), | |
197 | fMinInvariantMass(0), | |
198 | fMaxInvariantMass(1.2) | |
b594a020 | 199 | { |
e6e8b28b | 200 | // Default constructor. |
201 | ||
b594a020 | 202 | fChildClass = AliEveV0::Class(); // override member from base TEveElementList |
203 | } | |
204 | ||
205 | //______________________________________________________________________________ | |
206 | AliEveV0List::AliEveV0List(TEveTrackPropagator* rs) : | |
207 | TEveElementList(), | |
208 | fTitle(), | |
209 | fRnrStyle(rs), | |
210 | fRnrDaughters(kTRUE), | |
211 | fRnrV0vtx(kTRUE), | |
212 | fRnrV0path(kTRUE), | |
213 | fNegColor(0), | |
ca8a6926 | 214 | fPosColor(0), |
215 | fMinRCut(0), | |
e1bb28b4 | 216 | fMaxRCut(250), |
217 | fMinDaughterDCA(0), | |
218 | fMaxDaughterDCA(1), | |
219 | fMinPt(0), | |
2c7d7ac0 | 220 | fMaxPt(20), |
221 | fNegCheckedPid(211), | |
222 | fPosCheckedPid(211), | |
223 | fNegCheckedProb(0.5), | |
224 | fPosCheckedProb(0.5), | |
225 | fMinInvariantMass(0), | |
226 | fMaxInvariantMass(1.2) | |
b594a020 | 227 | { |
e6e8b28b | 228 | // Constructor with given track-propagator.. |
229 | ||
b594a020 | 230 | fChildClass = AliEveV0::Class(); // override member from base TEveElementList |
231 | ||
232 | Init(); | |
233 | } | |
234 | ||
235 | //______________________________________________________________________________ | |
236 | AliEveV0List::AliEveV0List(const Text_t* name, TEveTrackPropagator* rs) : | |
237 | TEveElementList(), | |
238 | fTitle(), | |
239 | fRnrStyle(rs), | |
240 | fRnrDaughters(kTRUE), | |
241 | fRnrV0vtx(kTRUE), | |
242 | fRnrV0path(kTRUE), | |
243 | fNegColor(0), | |
ca8a6926 | 244 | fPosColor(0), |
245 | fMinRCut(0), | |
e1bb28b4 | 246 | fMaxRCut(100), |
247 | fMinDaughterDCA(0), | |
248 | fMaxDaughterDCA(1), | |
249 | fMinPt(0), | |
2c7d7ac0 | 250 | fMaxPt(20), |
251 | fNegCheckedPid(211), | |
252 | fPosCheckedPid(211), | |
253 | fNegCheckedProb(0.5), | |
254 | fPosCheckedProb(0.5), | |
255 | fMinInvariantMass(0), | |
256 | fMaxInvariantMass(1.2) | |
b594a020 | 257 | { |
e6e8b28b | 258 | // Standard constructor. |
259 | ||
b594a020 | 260 | fChildClass = AliEveV0::Class(); // override member from base TEveElementList |
261 | ||
262 | Init(); | |
263 | SetName(name); | |
264 | } | |
265 | ||
266 | //______________________________________________________________________________ | |
267 | void AliEveV0List::Init() | |
268 | { | |
e6e8b28b | 269 | // Initialize members needed for drawing operations. |
b594a020 | 270 | |
e6e8b28b | 271 | if (fRnrStyle== 0) fRnrStyle = new TEveTrackPropagator; |
b594a020 | 272 | } |
273 | ||
ca8a6926 | 274 | /******************************************************************************/ |
b594a020 | 275 | |
e6e8b28b | 276 | //______________________________________________________________________________ |
b594a020 | 277 | void AliEveV0List::MakeV0s() |
278 | { | |
e6e8b28b | 279 | // Call MakeV0() for all elements. |
280 | ||
b594a020 | 281 | for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) { |
282 | ((AliEveV0*)(*i))->MakeV0(); | |
283 | } | |
284 | gEve->Redraw3D(); | |
285 | } | |
286 | ||
ca8a6926 | 287 | /******************************************************************************/ |
288 | ||
e6e8b28b | 289 | //______________________________________________________________________________ |
ca8a6926 | 290 | void AliEveV0List::FilterByRadius(Float_t minR, Float_t maxR) |
291 | { | |
e6e8b28b | 292 | // Select visibility of elements based on their axial radius. |
293 | ||
ca8a6926 | 294 | fMinRCut = minR; |
295 | fMaxRCut = maxR; | |
296 | ||
297 | for(List_i i = fChildren.begin(); i != fChildren.end(); ++i) | |
298 | { | |
299 | AliEveV0* v0 = (AliEveV0*) *i; | |
300 | Float_t rad = v0->GetRadius(); | |
301 | Bool_t show = rad >= fMinRCut && rad <= fMaxRCut; | |
302 | v0->SetRnrState(show); | |
303 | } | |
304 | ElementChanged(); | |
305 | gEve->Redraw3D(); | |
306 | } | |
e1bb28b4 | 307 | |
308 | /******************************************************************************/ | |
309 | ||
310 | //______________________________________________________________________________ | |
311 | void AliEveV0List::FilterByDaughterDCA(Float_t minDaughterDCA, Float_t maxDaughterDCA) | |
312 | { | |
313 | // Select visibility of elements based on the DCA between daughters. | |
314 | ||
315 | fMinDaughterDCA = minDaughterDCA; | |
316 | fMaxDaughterDCA = maxDaughterDCA; | |
317 | ||
318 | for(List_i i = fChildren.begin(); i != fChildren.end(); ++i) | |
319 | { | |
320 | AliEveV0* v0 = (AliEveV0*) *i; | |
321 | Float_t dca = v0->GetDaughterDCA(); | |
322 | Bool_t show = dca >= fMinDaughterDCA && dca <= fMaxDaughterDCA; | |
323 | v0->SetRnrState(show); | |
324 | } | |
325 | ElementChanged(); | |
326 | gEve->Redraw3D(); | |
327 | } | |
328 | ||
329 | /******************************************************************************/ | |
330 | ||
331 | //______________________________________________________________________________ | |
332 | void AliEveV0List::FilterByPt(Float_t minPt, Float_t maxPt) | |
333 | { | |
334 | // Select visibility of elements based on the V0 pt. | |
335 | ||
336 | fMinPt = minPt; | |
337 | fMaxPt = maxPt; | |
338 | ||
339 | for(List_i i = fChildren.begin(); i != fChildren.end(); ++i) | |
340 | { | |
341 | AliEveV0* v0 = (AliEveV0*) *i; | |
342 | Float_t pt = v0->GetPt(); | |
343 | Bool_t show = pt >= fMinPt && pt <= fMaxPt; | |
344 | v0->SetRnrState(show); | |
345 | } | |
346 | ElementChanged(); | |
347 | gEve->Redraw3D(); | |
348 | } | |
2c7d7ac0 | 349 | |
350 | //______________________________________________________________________________ | |
351 | void AliEveV0List::FilterByCheckedPidMinProb(Int_t rFlag,Int_t rDaughter, Int_t rPid, Float_t rProb) | |
352 | { | |
353 | ||
354 | if (!rDaughter){ | |
355 | fNegCheckedPid = rPid; | |
356 | fNegCheckedProb = rProb; | |
357 | } | |
358 | else { | |
359 | fPosCheckedPid = rPid; | |
360 | fPosCheckedProb = rProb; | |
361 | } | |
362 | ||
363 | // Select visibility of elements based on one of the V0 daughters PID | |
364 | for(List_i i = fChildren.begin(); i != fChildren.end(); ++i) | |
365 | { | |
366 | AliEveV0* v0 = (AliEveV0*) *i; | |
367 | Int_t pid = 0; | |
368 | Float_t prob = 0.0; | |
369 | Bool_t show = 0; | |
370 | if (!rDaughter) {// Negative daughter checked | |
371 | pid = v0->GetNegMaxProbPdg(); | |
372 | prob = v0->GetNegMaxProbPid(); | |
373 | show = (pid == fNegCheckedPid && prob > fNegCheckedProb) || !rFlag ; | |
374 | } | |
375 | else if (rDaughter) {// Positive daughter checked | |
376 | pid = v0->GetPosMaxProbPdg(); | |
377 | prob = v0->GetPosMaxProbPid(); | |
378 | show = (pid == fPosCheckedPid && prob > fPosCheckedProb) || !rFlag ; | |
379 | } | |
380 | v0->SetRnrState(show); | |
381 | } | |
382 | ElementChanged(); | |
383 | gEve->Redraw3D(); | |
384 | } | |
385 | ||
386 | //______________________________________________________________________________ | |
387 | void AliEveV0List::FilterByInvariantMass(Float_t minInvariantMass, Float_t maxInvariantMass, Int_t nPdgCode, Int_t pPdgCode) | |
388 | { | |
389 | // Select visibility of elements based on the V0 invariant mass. | |
390 | ||
391 | fMinInvariantMass = minInvariantMass; | |
392 | fMaxInvariantMass = maxInvariantMass; | |
393 | ||
394 | for(List_i i = fChildren.begin(); i != fChildren.end(); ++i) | |
395 | { | |
396 | AliEveV0* v0 = (AliEveV0*) *i; | |
397 | Float_t invMass = v0->GetInvMass(nPdgCode, pPdgCode); | |
398 | Bool_t show = invMass >= fMinInvariantMass && invMass <= fMaxInvariantMass; | |
399 | v0->SetRnrState(show); | |
400 | } | |
401 | ElementChanged(); | |
402 | gEve->Redraw3D(); | |
403 | } |