]>
Commit | Line | Data |
---|---|---|
7976039f | 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 * | |
51346b82 | 7 | * full copyright notice. * |
7976039f | 8 | **************************************************************************/ |
ed412809 | 9 | #ifndef ALIEVE_V0_H |
10 | #define ALIEVE_V0_H | |
11 | ||
12 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
13 | * See cxx source for full Copyright notice */ | |
14 | ||
15 | ||
16 | /*********************************************************************** | |
17 | * This code defines the reconstructed v0 visualized with EVE | |
18 | * | |
19 | * Ludovic Gaudichet (gaudichet@to.infn.it) | |
20 | ************************************************************************/ | |
21 | ||
7976039f | 22 | #include <TEveVSDStructs.h> |
23 | #include <TEveElement.h> | |
24 | #include <TEveTrack.h> | |
ed412809 | 25 | |
26 | #include <TPolyMarker3D.h> | |
27 | #include <TPolyLine3D.h> | |
28 | ||
29 | class TH1F; | |
30 | class TH2F; | |
31 | ||
32 | ||
ed412809 | 33 | class V0List; |
34 | ||
7976039f | 35 | class AliEveV0 : public TEveElement, |
ed412809 | 36 | public TPolyMarker3D |
37 | { | |
38 | friend class V0List; | |
39 | ||
7976039f | 40 | AliEveV0(const AliEveV0&); // Not implemented |
41 | AliEveV0& operator=(const AliEveV0&); // Not implemented | |
ed412809 | 42 | |
51346b82 | 43 | public: |
7976039f | 44 | AliEveV0(); |
45 | AliEveV0(TEveRecTrack* tNeg, TEveRecTrack* tPos, TEveRecV0* v0, | |
46 | TEveTrackPropagator* rs); | |
47 | virtual ~AliEveV0(); | |
ed412809 | 48 | |
7976039f | 49 | typedef std::vector<TEvePathMark*> vpPathMark_t; |
50 | typedef std::vector<TEvePathMark*>::iterator vpPathMark_i; | |
51 | void AddPathMarkPos(TEvePathMark* pm) { fPathMarksPos.push_back(pm); } | |
52 | void AddPathMarkNeg(TEvePathMark* pm) { fPathMarksNeg.push_back(pm); } | |
ed412809 | 53 | |
54 | void Reset(TPolyLine3D* polyLine); | |
55 | ||
7976039f | 56 | void MakeTrack(vpPathMark_t& pathMark, TEveVector& vtx, TEveVector& p, |
ed412809 | 57 | Int_t charge, Float_t beta, TPolyLine3D& polyLine); |
58 | ||
59 | void MakeV0path(); | |
60 | void MakeV0(); | |
61 | ||
62 | virtual void PaintDaughters(Option_t* option="") { | |
63 | if(fRnrSelf) {fPolyLineNeg.Paint(option);fPolyLinePos.Paint(option);} } | |
64 | virtual void Paint(Option_t* option="") { | |
65 | if(fRnrSelf) TPolyMarker3D::Paint(option);} | |
66 | virtual void PaintPath(Option_t* option="") { | |
67 | if(fRnrSelf) fPolyLineV0.Paint(option);} | |
68 | ||
69 | virtual void SetMainColor(Color_t col) { | |
70 | fMarkerColor = col; fMainColorPtr = &fMarkerColor; | |
71 | fPolyLineV0.SetLineColor(fMarkerColor);} | |
72 | virtual void SetTracksColor(Color_t cNeg, Color_t cPos) { | |
73 | fPolyLineNeg.SetLineColor(cNeg); fPolyLinePos.SetLineColor(cPos); } | |
7976039f | 74 | void SetRnrStyle(TEveTrackPropagator* rs) { fRnrStyle = rs; } |
ed412809 | 75 | void SetESDIndex(Int_t ind) { fESDIndex = ind;} |
76 | void SetDaughterDCA(Float_t dca); | |
77 | void SetCosPointingAngle(Float_t cos); | |
78 | void SetDecayLength(Float_t len); | |
79 | void SetDecayLength(Float_t primx, Float_t primy, Float_t primz); | |
80 | ||
81 | Float_t GetDaughterDCA() const; | |
82 | Float_t GetCosPointingAngle() const; | |
83 | Float_t GetRadius() const; | |
84 | Float_t GetDecayLength() const; | |
85 | ||
86 | Float_t GetP2() const; | |
87 | Float_t GetMomentum() const; | |
88 | Float_t GetPt() const; | |
89 | Float_t GetPt2() const; | |
90 | Float_t GetPx() const; | |
91 | Float_t GetPy() const; | |
92 | Float_t GetPz() const; | |
93 | Float_t GetPseudoRapidity() const; | |
94 | Float_t GetAlphaArmenteros() const; | |
95 | Float_t GetPtArmenteros() const; | |
96 | ||
97 | Float_t GetK0sE() const {return 0;}; | |
98 | Float_t GetLamE() const {return 0;}; | |
99 | Float_t GetAntiLamE() const {return 0;}; | |
100 | Float_t GetK0mass() const; | |
101 | Float_t GetLamMass() const; | |
102 | Float_t GetAntiLamMass() const; | |
103 | ||
104 | Float_t GetPionMinusE() const; | |
105 | Float_t GetPionPlusE() const; | |
106 | Float_t GetProtonE() const; | |
107 | Float_t GetPBarE() const; | |
108 | ||
109 | Float_t GetPosDCAtoPrim() const; | |
110 | Float_t GetPosP2() const; | |
111 | Float_t GetPosP() const; | |
112 | Float_t GetPosPt() const; | |
113 | Float_t GetPosPseudoRapidity() const; | |
114 | ||
115 | Float_t GetNegDCAtoPrim() const; | |
116 | Float_t GetNegP2() const; | |
117 | Float_t GetNegP() const; | |
118 | Float_t GetNegPt() const; | |
119 | Float_t GetNegPseudoRapidity() const; | |
120 | Int_t GetESDIndex() const {return fESDIndex;}; | |
121 | ||
122 | virtual const Text_t* GetName() const { return Form("ESDv0_%i",fESDIndex); } | |
123 | virtual const Text_t* GetTitle() const { return Form("ESDv0_%i",fESDIndex); } | |
124 | Int_t GetLabelPos() const { return fLabel_pos; } | |
125 | Int_t GetLabelNeg() const { return fLabel_neg; } | |
7976039f | 126 | TEveTrackPropagator* GetPropagator() const { return fRnrStyle; } |
ed412809 | 127 | TPolyLine3D* GetPolyLineNeg() {return &fPolyLineNeg;} |
128 | TPolyLine3D* GetPolyLinePos() {return &fPolyLinePos;} | |
129 | TPolyLine3D* GetPolyLineV0() {return &fPolyLineV0;} | |
130 | ||
131 | protected: | |
132 | ||
7976039f | 133 | TEveVector fV_neg; // Vertex of negative track |
134 | TEveVector fP_neg; // Momentum of negative track | |
135 | TEveVector fV_pos; // Vertex of positive track | |
136 | TEveVector fP_pos; // Momentum of positive track | |
ed412809 | 137 | |
7976039f | 138 | TEveVector fV_v0; // Point of closest approach |
139 | TEveVector fV0_birth; // Reconstucted birth point of neutral particle | |
ed412809 | 140 | |
141 | Float_t fBeta_neg; | |
142 | Float_t fBeta_pos; | |
143 | ||
144 | Int_t fLabel_neg; | |
145 | Int_t fLabel_pos; | |
146 | ||
147 | vpPathMark_t fPathMarksNeg; | |
148 | vpPathMark_t fPathMarksPos; | |
7976039f | 149 | TEveTrackPropagator *fRnrStyle; |
ed412809 | 150 | |
151 | TPolyLine3D fPolyLineNeg; | |
152 | TPolyLine3D fPolyLinePos; | |
153 | TPolyLine3D fPolyLineV0; | |
154 | ||
155 | Int_t fESDIndex; | |
156 | Float_t fDaughterDCA; | |
157 | Float_t fCosPointingAngle; | |
158 | Float_t fDecayLength; | |
159 | ||
160 | static const Float_t fgkMassPion2; | |
161 | static const Float_t fgkMassProton2; | |
162 | ||
7976039f | 163 | ClassDef(AliEveV0, 1); // Visual representation of a AliEveV0. |
164 | }; // endclass AliEveV0 | |
ed412809 | 165 | |
166 | ||
57ffa5fb | 167 | //______________________________________________________________________________ |
51346b82 | 168 | inline void AliEveV0::SetDaughterDCA(Float_t dca) { |
169 | fDaughterDCA = dca; | |
ed412809 | 170 | } |
171 | ||
51346b82 | 172 | inline void AliEveV0::SetCosPointingAngle(Float_t cos) { |
173 | fCosPointingAngle = cos; | |
ed412809 | 174 | } |
175 | ||
7976039f | 176 | inline void AliEveV0::SetDecayLength(Float_t len) { |
ed412809 | 177 | fDecayLength = len; |
178 | } | |
179 | ||
180 | ||
57ffa5fb | 181 | //______________________________________________________________________________ |
7976039f | 182 | inline Float_t AliEveV0::GetPt2() const { |
ed412809 | 183 | Float_t px = fP_neg.x+fP_pos.x, py = fP_neg.y+fP_pos.y; |
184 | return (px*px+py*py); | |
185 | } | |
186 | ||
7976039f | 187 | inline Float_t AliEveV0::GetP2() const { |
ed412809 | 188 | |
189 | Float_t px = fP_neg.x+fP_pos.x, py = fP_neg.y+fP_pos.y, pz = fP_neg.z+fP_pos.z; | |
190 | return (px*px+py*py+pz*pz); | |
191 | } | |
192 | ||
7976039f | 193 | inline Float_t AliEveV0::GetPt() const { |
ed412809 | 194 | return sqrt(GetPt2()); |
195 | } | |
196 | ||
7976039f | 197 | inline Float_t AliEveV0::GetMomentum() const { |
ed412809 | 198 | return sqrt(GetP2()); |
199 | } | |
200 | ||
7976039f | 201 | inline Float_t AliEveV0::GetPx() const { |
ed412809 | 202 | return (fP_neg.x+fP_pos.x); |
203 | } | |
204 | ||
7976039f | 205 | inline Float_t AliEveV0::GetPy() const { |
ed412809 | 206 | return (fP_neg.y+fP_pos.y); |
207 | } | |
208 | ||
7976039f | 209 | inline Float_t AliEveV0::GetPz() const { |
ed412809 | 210 | return (fP_neg.z+fP_pos.z); |
211 | } | |
212 | ||
57ffa5fb | 213 | //______________________________________________________________________________ |
ed412809 | 214 | |
7976039f | 215 | inline Float_t AliEveV0::GetDaughterDCA() const { |
ed412809 | 216 | return fDaughterDCA; |
217 | } | |
218 | ||
7976039f | 219 | inline Float_t AliEveV0::GetCosPointingAngle() const { |
ed412809 | 220 | return fCosPointingAngle; |
221 | } | |
222 | ||
7976039f | 223 | inline Float_t AliEveV0::GetRadius() const { |
ed412809 | 224 | return sqrt(fV_v0.x*fV_v0.x + fV_v0.y*fV_v0.y); |
225 | } | |
226 | ||
7976039f | 227 | inline Float_t AliEveV0::GetDecayLength() const { |
ed412809 | 228 | return fDecayLength; |
229 | } | |
230 | ||
7976039f | 231 | inline Float_t AliEveV0::GetPseudoRapidity() const { |
ed412809 | 232 | Float_t theta = acos( GetPz()/GetMomentum() ); |
233 | return ( -log(tan(theta/2.)) ); | |
234 | } | |
235 | ||
57ffa5fb | 236 | //______________________________________________________________________________ |
ed412809 | 237 | |
7976039f | 238 | inline Float_t AliEveV0::GetPionMinusE() const { |
ed412809 | 239 | return sqrt(fgkMassPion2+GetNegP2()); |
240 | } | |
241 | ||
7976039f | 242 | inline Float_t AliEveV0::GetPionPlusE() const { |
ed412809 | 243 | return sqrt(fgkMassPion2+GetPosP2()); |
244 | } | |
7976039f | 245 | inline Float_t AliEveV0::GetProtonE() const { |
ed412809 | 246 | return sqrt(fgkMassProton2+GetPosP2()); |
247 | ||
248 | } | |
7976039f | 249 | inline Float_t AliEveV0::GetPBarE() const { |
ed412809 | 250 | return sqrt(fgkMassProton2+GetNegP2()); |
251 | } | |
252 | ||
57ffa5fb | 253 | //______________________________________________________________________________ |
ed412809 | 254 | |
7976039f | 255 | inline Float_t AliEveV0::GetPosP2() const { |
ed412809 | 256 | return (fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y + fP_pos.z*fP_pos.z); |
257 | } | |
258 | ||
7976039f | 259 | inline Float_t AliEveV0::GetPosP() const { |
ed412809 | 260 | return sqrt(GetPosP2()); |
261 | } | |
262 | ||
7976039f | 263 | inline Float_t AliEveV0::GetPosPt() const { |
ed412809 | 264 | return sqrt(fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y); |
265 | } | |
266 | ||
7976039f | 267 | inline Float_t AliEveV0::GetPosPseudoRapidity() const { |
ed412809 | 268 | Float_t theta = acos( fP_pos.z/GetPosP() ); |
269 | return ( -log(tan(theta/2.)) ); | |
270 | } | |
271 | ||
7976039f | 272 | inline Float_t AliEveV0::GetPosDCAtoPrim() const { |
ed412809 | 273 | return 0; |
274 | } | |
275 | ||
57ffa5fb | 276 | //______________________________________________________________________________ |
7976039f | 277 | inline Float_t AliEveV0::GetNegP2() const { |
ed412809 | 278 | return (fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y + fP_neg.z*fP_neg.z); |
279 | } | |
280 | ||
7976039f | 281 | inline Float_t AliEveV0::GetNegP() const { |
ed412809 | 282 | return sqrt(GetNegP2()); |
283 | } | |
284 | ||
7976039f | 285 | inline Float_t AliEveV0::GetNegPt() const { |
ed412809 | 286 | return sqrt(fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y); |
287 | } | |
288 | ||
7976039f | 289 | inline Float_t AliEveV0::GetNegPseudoRapidity() const { |
ed412809 | 290 | Float_t theta = acos( fP_neg.z/GetNegP() ); |
291 | return ( -log(tan(theta/2.)) ); | |
292 | } | |
293 | ||
7976039f | 294 | inline Float_t AliEveV0::GetNegDCAtoPrim() const { |
ed412809 | 295 | return 0; |
296 | } | |
297 | ||
57ffa5fb | 298 | //______________________________________________________________________________ |
ed412809 | 299 | |
7976039f | 300 | inline Float_t AliEveV0::GetK0mass() const { |
ed412809 | 301 | Float_t energy = GetPionMinusE() + GetPionPlusE(); |
302 | return sqrt( energy*energy - GetP2() ); | |
303 | } | |
304 | ||
7976039f | 305 | inline Float_t AliEveV0::GetLamMass() const { |
ed412809 | 306 | Float_t energy = GetPionMinusE() + GetProtonE(); |
307 | return sqrt( energy*energy - GetP2() ); | |
308 | } | |
309 | ||
7976039f | 310 | inline Float_t AliEveV0::GetAntiLamMass() const { |
ed412809 | 311 | Float_t energy = GetPionPlusE() + GetPBarE(); |
312 | return sqrt( energy*energy - GetP2() ); | |
313 | } | |
314 | ||
315 | ||
316 | ||
57ffa5fb | 317 | /******************************************************************************/ |
ed412809 | 318 | // V0List |
57ffa5fb | 319 | /******************************************************************************/ |
ed412809 | 320 | |
7976039f | 321 | class V0List : public TEveElementList |
ed412809 | 322 | { |
323 | V0List(const V0List&); // Not implemented | |
324 | V0List& operator=(const V0List&); // Not implemented | |
325 | ||
326 | public: | |
327 | V0List(); | |
7976039f | 328 | V0List(TEveTrackPropagator* rs); |
329 | V0List(const Text_t* name, TEveTrackPropagator* rs=0); | |
ed412809 | 330 | virtual ~V0List(); |
331 | ||
332 | virtual const Text_t* GetTitle() const { return fTitle; } | |
333 | virtual void SetTitle(const Text_t* t) { fTitle = t; } | |
334 | virtual void SetTracksColor(Color_t cNeg, Color_t cPos) { | |
335 | fNegColor = cNeg; fPosColor = cPos;} | |
336 | ||
337 | virtual Bool_t CanEditMainColor() { return kTRUE; } | |
338 | ||
339 | virtual void Paint(Option_t* option=""); | |
340 | ||
7976039f | 341 | void SetRnrStyle(TEveTrackPropagator* rst) { fRnrStyle= rst; } |
51346b82 | 342 | TEveTrackPropagator* GetPropagator() { return fRnrStyle; } |
ed412809 | 343 | |
344 | Bool_t GetRnrV0vtx() const { return fRnrV0vtx; } | |
345 | Bool_t GetRnrV0path() const { return fRnrV0path; } | |
346 | Bool_t GetRnrDaughters() const { return fRnrDaughters; } | |
347 | ||
348 | void SetRnrV0vtx(Bool_t); | |
349 | void SetRnrV0path(Bool_t); | |
350 | void SetRnrDaughters(Bool_t); | |
351 | void SetMin(Int_t i, Float_t val) { | |
352 | if ((i>=0)&&(i<fgkNcutVar)) fMin[i]=val;} | |
353 | void SetMax(Int_t i, Float_t val) { | |
354 | if ((i>=0)&&(i<fgkNcutVar)) fMax[i]=val;} | |
355 | ||
356 | void MakeV0s(); | |
357 | void MakeMarkers(); | |
358 | ||
359 | TH1F* GetHist(Int_t i) { | |
360 | if ((i>=0)&&(i<fgkNcutVar)) return fHist[i]; else return 0;} | |
361 | TH2F* GetHist2D(Int_t i) { | |
362 | if ((i>=0)&&(i<fgkNcutVar2D)) return fHist2D[i]; else return 0;} | |
363 | Float_t GetMin(Int_t i) { | |
364 | if ((i>=0)&&(i<fgkNcutVar)) return fMin[i]; else return 0;} | |
365 | Float_t GetMax(Int_t i) { | |
366 | if ((i>=0)&&(i<fgkNcutVar)) return fMax[i]; else return 0;} | |
367 | void GetV0IndexRange(Int_t &imin, Int_t &imax); | |
368 | ||
369 | Float_t GetMaxR() const { return fRnrStyle->fMaxZ; } | |
370 | Float_t GetMaxZ() const { return fRnrStyle->fMaxR; } | |
371 | Float_t GetMaxOrbs() const { return fRnrStyle->fMaxOrbs; } | |
372 | Float_t GetMinAng() const { return fRnrStyle->fMinAng; } | |
373 | Float_t GetDelta() const { return fRnrStyle->fDelta; } | |
374 | Bool_t GetFitDaughters() const { return fRnrStyle->fFitDaughters; } | |
375 | Bool_t GetFitDecay() const { return fRnrStyle->fFitDecay; } | |
376 | ||
377 | void AdjustHist(Int_t iHist); | |
7976039f | 378 | void UnFill(AliEveV0* v0); |
379 | void Filter(AliEveV0* v0); | |
ed412809 | 380 | void FilterAll(); |
381 | void PtFilter(Float_t min, Float_t max); | |
382 | ||
383 | void K0sMFilter(Float_t min, Float_t max); | |
384 | void LamMFilter(Float_t min, Float_t max); | |
385 | void ALamMFilter(Float_t min, Float_t max); | |
386 | void CosPointingFilter(Float_t min, Float_t max); | |
387 | void DaughterDCAFilter(Float_t min, Float_t max); | |
388 | void RadiusFilter(Float_t min, Float_t max); | |
389 | void EtaFilter(Float_t min, Float_t max); | |
390 | void NegPtFilter(Float_t min, Float_t max); | |
391 | void NegEtaFilter(Float_t min, Float_t max); | |
392 | void PosPtFilter(Float_t min, Float_t max); | |
393 | void PosEtaFilter(Float_t min, Float_t max); | |
394 | void IndexFilter(Float_t min, Float_t max); | |
395 | ||
396 | ||
397 | private: | |
398 | void Init(); | |
399 | ||
400 | protected: | |
401 | TString fTitle; | |
402 | ||
7976039f | 403 | TEveTrackPropagator *fRnrStyle; |
ed412809 | 404 | |
405 | Bool_t fRnrDaughters; | |
406 | Bool_t fRnrV0vtx; | |
407 | Bool_t fRnrV0path; | |
408 | ||
409 | Color_t fNegColor; | |
410 | Color_t fPosColor; | |
411 | ||
412 | static const Int_t fgkNcutVar = 13; | |
413 | TH1F *fHist[fgkNcutVar]; | |
414 | Float_t fMin[fgkNcutVar]; | |
415 | Float_t fMax[fgkNcutVar]; | |
416 | ||
417 | static const Int_t fgkNcutVar2D = 1; | |
418 | TH2F *fHist2D[fgkNcutVar2D]; | |
419 | Float_t fMinX[fgkNcutVar2D]; | |
420 | Float_t fMinY[fgkNcutVar2D]; | |
421 | Float_t fMaxX[fgkNcutVar2D]; | |
422 | Float_t fMaxY[fgkNcutVar2D]; | |
423 | ||
7976039f | 424 | ClassDef(V0List, 1); // A list of AliEveV0 objecs. |
ed412809 | 425 | }; |
426 | ||
427 | ||
ed412809 | 428 | #endif |