]>
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 | **************************************************************************/ |
a15e6d7d | 9 | #ifndef AliEveCascade_H |
10 | #define AliEveCascade_H | |
ed412809 | 11 | |
12 | /*********************************************************************** | |
13 | * This code defines the reconstructed cascades visualized with EVE | |
14 | * | |
15 | * Ludovic Gaudichet (gaudichet@to.infn.it) | |
16 | ************************************************************************/ | |
17 | ||
7976039f | 18 | #include <TEveVSDStructs.h> |
19 | #include <TEveElement.h> | |
20 | #include <TEveTrack.h> | |
ed412809 | 21 | |
22 | #include <TPolyMarker3D.h> | |
23 | #include <TPolyLine3D.h> | |
24 | ||
25 | class TH1F; | |
26 | class TH2F; | |
27 | ||
28 | ||
ed412809 | 29 | class CascadeList; |
30 | ||
7976039f | 31 | class AliEveCascade : public TEveElement, |
4b456ebb | 32 | public TPolyMarker3D |
ed412809 | 33 | { |
ed412809 | 34 | friend class CascadeList; |
35 | ||
4b456ebb | 36 | public: |
37 | typedef std::vector<TEvePathMark*> vpPathMark_t; | |
ed412809 | 38 | |
ed412809 | 39 | |
7976039f | 40 | AliEveCascade(); |
41 | AliEveCascade(TEveTrackPropagator* rs); | |
42 | virtual ~AliEveCascade(); | |
ed412809 | 43 | |
44 | virtual void SetESDIndex(Int_t ind) { fESDIndex = ind;} | |
45 | virtual void SetMainColor(Color_t col) | |
46 | { | |
47 | fMarkerColor = col; fMainColorPtr = &fMarkerColor; | |
48 | fPolyLineV0.SetLineColor(fMarkerColor); | |
49 | } | |
50 | virtual void SetTracksColor(Color_t cNeg, Color_t cPos, Color_t cBach) | |
51 | { | |
52 | fPolyLineNeg.SetLineColor(cNeg); fPolyLinePos.SetLineColor(cPos); | |
53 | fPolyLineBach.SetLineColor(cBach); | |
54 | } | |
7976039f | 55 | void SetRnrStyle(TEveTrackPropagator* rs) { fRnrStyle = rs; } |
ed412809 | 56 | |
7976039f | 57 | void AddPathMarkPos(TEvePathMark* pm) { fPathMarksPos.push_back(pm); } |
58 | void AddPathMarkNeg(TEvePathMark* pm) { fPathMarksNeg.push_back(pm); } | |
59 | void AddPathMarkBach(TEvePathMark* pm) { fPathMarksBach.push_back(pm); } | |
ed412809 | 60 | |
61 | virtual void PaintV0Daughters(Option_t* option="") { | |
62 | if(fRnrSelf) {fPolyLineNeg.Paint(option);fPolyLinePos.Paint(option); } } | |
63 | virtual void PaintBachelor(Option_t* option="") { | |
64 | if(fRnrSelf) fPolyLineBach.Paint(option); } | |
65 | virtual void Paint(Option_t* option="") { | |
66 | if(fRnrSelf) TPolyMarker3D::Paint(option);} | |
67 | virtual void PaintV0Path(Option_t* option="") { | |
68 | if(fRnrSelf) fPolyLineV0.Paint(option);} | |
69 | virtual void PaintCasPath(Option_t* option="") { | |
70 | if(fRnrSelf) fPolyLineCas.Paint(option);} | |
71 | ||
72 | void Reset(TPolyLine3D* polyLine); | |
7976039f | 73 | void MakeTrack(vpPathMark_t& pathMark, TEveVector& vtx, TEveVector& p, |
ed412809 | 74 | Int_t charge, Float_t beta, TPolyLine3D& polyLine); |
75 | void MakeV0path(); | |
76 | void MakeCasPath(); | |
77 | void MakeCascade(); | |
78 | ||
79 | void SetBeta(Float_t betaNeg, Float_t betaPos, Float_t betaBach); | |
80 | void SetDCA_v0_Bach(Float_t dca) {fDCA_v0_Bach = dca;} | |
81 | void SetCasCosPointingAngle(Float_t cos) {fCasCosPointingAngle = cos;} | |
82 | void SetNegP(Float_t px, Float_t py, Float_t pz) {fP_neg.x = px; fP_neg.y = py; fP_neg.z = pz;} | |
83 | void SetPosP(Float_t px, Float_t py, Float_t pz) {fP_pos.x = px; fP_pos.y = py; fP_pos.z = pz;} | |
84 | void SetBachP(Float_t px, Float_t py, Float_t pz) {fP_bach.x = px; fP_bach.y = py; fP_bach.z = pz;} | |
85 | ||
86 | void SetV0vtx(Float_t vx, Float_t vy, Float_t vz) { | |
51346b82 | 87 | fV_neg.x = vx; fV_neg.y = vy; fV_neg.z = vz; |
88 | fV_pos.x = vx; fV_pos.y = vy; fV_pos.z = vz; | |
ed412809 | 89 | } |
90 | void SetCascadeVtx(Float_t vx, Float_t vy, Float_t vz) { | |
91 | fV_decay.x = vx; fV_decay.y = vy; fV_decay.z = vz; } | |
92 | ||
93 | void SetDecayLength(Float_t primx, Float_t primy, Float_t primz); | |
94 | ||
95 | Int_t GetESDIndex() const { return fESDIndex; } | |
96 | virtual const Text_t* GetName() const { return Form("ESDcascade_%i",fESDIndex); } | |
97 | virtual const Text_t* GetTitle() const { return Form("ESDcascade_%i",fESDIndex); } | |
98 | ||
99 | Float_t GetDCA_v0_Bach() const; | |
100 | Float_t GetCasCosPointingAngle() const; | |
101 | Float_t GetRadius() const; | |
102 | Float_t GetPseudoRapidity() const; | |
103 | Float_t GetPt2() const; | |
104 | Float_t GetPt() const; | |
105 | Float_t GetP2() const; | |
106 | Float_t GetMomentum() const; | |
107 | Float_t GetPx() const; | |
108 | Float_t GetPy() const; | |
109 | Float_t GetPz() const; | |
110 | Float_t GetCasAlphaArmenteros() const; | |
111 | Float_t GetCasPtArmenteros() const; | |
112 | Float_t GetPosP2() const; | |
113 | Float_t GetPosP() const; | |
114 | Float_t GetPosPt() const; | |
115 | Float_t GetPosPseudoRapidity() const; | |
116 | Float_t GetNegP2() const; | |
117 | Float_t GetNegP() const; | |
118 | Float_t GetNegPt() const; | |
119 | Float_t GetNegPseudoRapidity() const; | |
120 | Float_t GetBachP2() const; | |
121 | Float_t GetBachP() const; | |
122 | Float_t GetBachPt() const; | |
123 | Float_t GetBachPseudoRapidity() const; | |
124 | ||
125 | Float_t GetV0P2() const; | |
126 | Float_t GetLambdaE() const; | |
127 | Float_t GetXiE() const; | |
128 | Float_t GetOmegaE() const; | |
129 | Float_t GetXiMass() const; | |
130 | Float_t GetAntiXiMass() const; | |
131 | Float_t GetOmegaMass() const; | |
132 | Float_t GetAntiOmegaMass() const; | |
133 | ||
4b456ebb | 134 | |
135 | protected: | |
136 | typedef std::vector<TEvePathMark*>::iterator vpPathMark_i; | |
137 | ||
138 | TEveVector fV_neg; // Vertex of negative track | |
139 | TEveVector fP_neg; // Momentum of negative track | |
140 | TEveVector fV_pos; // Vertex of positive track | |
141 | TEveVector fP_pos; // Momentum of positive track | |
142 | TEveVector fV_bach; // Vertex of positive track | |
143 | TEveVector fP_bach; // Momentum of positive track | |
144 | ||
145 | TEveVector fV_decay; //decay point of the cascade | |
146 | TEveVector fV_birth; // Reconstructed birth point of neutral particle | |
147 | ||
148 | vpPathMark_t fPathMarksNeg; | |
149 | vpPathMark_t fPathMarksPos; | |
150 | vpPathMark_t fPathMarksBach; | |
151 | TEveTrackPropagator *fRnrStyle; | |
152 | ||
153 | TPolyLine3D fPolyLineNeg; | |
154 | TPolyLine3D fPolyLinePos; | |
155 | TPolyLine3D fPolyLineBach; | |
156 | TPolyLine3D fPolyLineV0; // line of AliEveV0 travel | |
157 | TPolyLine3D fPolyLineCas; // line of cascade travel | |
158 | ||
159 | Float_t fBeta_neg; | |
160 | Float_t fBeta_pos; | |
161 | Float_t fBeta_bach; | |
162 | ||
163 | Int_t fESDIndex; | |
164 | ||
165 | Float_t fDCA_v0_Bach; | |
166 | Float_t fCasCosPointingAngle; | |
167 | Float_t fCasDecayLength; | |
168 | ||
169 | static const Float_t fgkMassPion2; | |
170 | static const Float_t fgkMassKaon2; | |
171 | static const Float_t fgkMassProton2; | |
172 | static const Float_t fgkMassLambda2; | |
173 | ||
174 | private: | |
175 | AliEveCascade(const AliEveCascade&); // Not implemented | |
176 | AliEveCascade& operator=(const AliEveCascade&); // Not implemented | |
177 | ||
178 | ClassDef(AliEveCascade, 0); // Visual representation of a cascade. | |
179 | }; | |
ed412809 | 180 | |
181 | ||
182 | ||
57ffa5fb | 183 | //______________________________________________________________________________ |
ed412809 | 184 | |
7976039f | 185 | inline void AliEveCascade::SetBeta(Float_t betaNeg, Float_t betaPos, Float_t betaBach) { |
ed412809 | 186 | fBeta_neg = betaNeg; |
187 | fBeta_pos = betaPos; | |
188 | fBeta_bach = betaBach; | |
189 | } | |
190 | ||
191 | ||
57ffa5fb | 192 | //______________________________________________________________________________ |
ed412809 | 193 | |
7976039f | 194 | inline Float_t AliEveCascade::GetV0P2() const { |
ed412809 | 195 | Float_t px = fP_neg.x + fP_pos.x, py = fP_neg.y + fP_pos.y, |
196 | pz = fP_neg.z+fP_pos.z; | |
197 | return px*px + py*py + pz*pz; | |
198 | } | |
199 | ||
200 | ||
7976039f | 201 | inline Float_t AliEveCascade::GetLambdaE() const { |
ed412809 | 202 | return sqrt(fgkMassLambda2+GetV0P2()); |
203 | } | |
204 | ||
7976039f | 205 | inline Float_t AliEveCascade::GetXiE() const { |
ed412809 | 206 | Float_t e = GetLambdaE() + |
207 | sqrt(fgkMassPion2 + fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y + | |
208 | fP_bach.z*fP_bach.z); | |
209 | return e; | |
210 | } | |
211 | ||
7976039f | 212 | inline Float_t AliEveCascade::GetOmegaE() const { |
ed412809 | 213 | Float_t e = GetLambdaE() + |
214 | sqrt(fgkMassKaon2 + fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y + | |
215 | fP_bach.z*fP_bach.z); | |
216 | return e; | |
217 | } | |
218 | ||
7976039f | 219 | inline Float_t AliEveCascade::GetXiMass() const { |
ed412809 | 220 | Float_t e = GetXiE(); |
221 | return sqrt(e*e - GetP2()); | |
222 | } | |
223 | ||
7976039f | 224 | inline Float_t AliEveCascade::GetAntiXiMass() const { return GetXiMass();} |
ed412809 | 225 | |
7976039f | 226 | inline Float_t AliEveCascade::GetOmegaMass() const { |
ed412809 | 227 | Float_t e = GetOmegaE(); |
228 | return sqrt(e*e - GetP2()); | |
229 | } | |
230 | ||
7976039f | 231 | inline Float_t AliEveCascade::GetAntiOmegaMass() const { return GetOmegaMass();} |
ed412809 | 232 | |
233 | ||
57ffa5fb | 234 | //______________________________________________________________________________ |
ed412809 | 235 | |
7976039f | 236 | inline Float_t AliEveCascade::GetDCA_v0_Bach() const { |
ed412809 | 237 | return fDCA_v0_Bach; |
238 | } | |
239 | ||
7976039f | 240 | inline Float_t AliEveCascade::GetCasCosPointingAngle() const { |
ed412809 | 241 | return fCasCosPointingAngle; |
242 | } | |
243 | ||
7976039f | 244 | inline Float_t AliEveCascade::GetRadius() const { |
ed412809 | 245 | return sqrt(fV_birth.x*fV_birth.x + fV_birth.y*fV_birth.y); |
246 | } | |
247 | ||
7976039f | 248 | //inline Float_t AliEveCascade::GetDecayLength() const { |
ed412809 | 249 | //return fDecayLength; |
250 | //} | |
251 | ||
7976039f | 252 | inline Float_t AliEveCascade::GetPseudoRapidity() const { |
ed412809 | 253 | Float_t theta = acos( GetPz()/GetMomentum() ); |
254 | return ( -log(tan(theta/2.)) ); | |
255 | } | |
256 | ||
257 | ||
57ffa5fb | 258 | //______________________________________________________________________________ |
7976039f | 259 | inline Float_t AliEveCascade::GetPt2() const { |
ed412809 | 260 | Float_t px = GetPx(), py = GetPy(); |
261 | return (px*px+py*py); | |
262 | } | |
263 | ||
7976039f | 264 | inline Float_t AliEveCascade::GetP2() const { |
ed412809 | 265 | |
266 | Float_t px = GetPx(), py = GetPy(), pz = GetPz(); | |
267 | return (px*px+py*py+pz*pz); | |
268 | } | |
269 | ||
7976039f | 270 | inline Float_t AliEveCascade::GetPt() const { |
ed412809 | 271 | return sqrt(GetPt2()); |
272 | } | |
273 | ||
7976039f | 274 | inline Float_t AliEveCascade::GetMomentum() const { |
ed412809 | 275 | return sqrt(GetP2()); |
276 | } | |
277 | ||
7976039f | 278 | inline Float_t AliEveCascade::GetPx() const { |
ed412809 | 279 | return (fP_neg.x + fP_pos.x + fP_bach.x); |
280 | } | |
281 | ||
7976039f | 282 | inline Float_t AliEveCascade::GetPy() const { |
ed412809 | 283 | return (fP_neg.y + fP_pos.y + fP_bach.y); |
284 | } | |
285 | ||
7976039f | 286 | inline Float_t AliEveCascade::GetPz() const { |
ed412809 | 287 | return (fP_neg.z + fP_pos.z + fP_bach.z); |
288 | } | |
289 | ||
57ffa5fb | 290 | //______________________________________________________________________________ |
ed412809 | 291 | |
7976039f | 292 | inline Float_t AliEveCascade::GetPosP2() const { |
ed412809 | 293 | return (fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y + fP_pos.z*fP_pos.z); |
294 | } | |
295 | ||
7976039f | 296 | inline Float_t AliEveCascade::GetPosP() const { |
ed412809 | 297 | return sqrt(GetPosP2()); |
298 | } | |
299 | ||
7976039f | 300 | inline Float_t AliEveCascade::GetPosPt() const { |
ed412809 | 301 | return sqrt(fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y); |
302 | } | |
303 | ||
7976039f | 304 | inline Float_t AliEveCascade::GetPosPseudoRapidity() const { |
ed412809 | 305 | Float_t theta = acos( fP_pos.z/GetPosP() ); |
306 | return ( -log(tan(theta/2.)) ); | |
307 | } | |
308 | ||
57ffa5fb | 309 | //______________________________________________________________________________ |
7976039f | 310 | inline Float_t AliEveCascade::GetNegP2() const { |
ed412809 | 311 | return (fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y + fP_neg.z*fP_neg.z); |
312 | } | |
313 | ||
7976039f | 314 | inline Float_t AliEveCascade::GetNegP() const { |
ed412809 | 315 | return sqrt(GetNegP2()); |
316 | } | |
317 | ||
7976039f | 318 | inline Float_t AliEveCascade::GetNegPt() const { |
ed412809 | 319 | return sqrt(fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y); |
320 | } | |
321 | ||
7976039f | 322 | inline Float_t AliEveCascade::GetNegPseudoRapidity() const { |
ed412809 | 323 | Float_t theta = acos( fP_neg.z/GetNegP() ); |
324 | return ( -log(tan(theta/2.)) ); | |
325 | } | |
326 | ||
327 | ||
57ffa5fb | 328 | //______________________________________________________________________________ |
7976039f | 329 | inline Float_t AliEveCascade::GetBachP2() const { |
ed412809 | 330 | return (fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y + fP_bach.z*fP_bach.z); |
331 | } | |
332 | ||
7976039f | 333 | inline Float_t AliEveCascade::GetBachP() const { |
ed412809 | 334 | return sqrt(GetBachP2()); |
335 | } | |
336 | ||
7976039f | 337 | inline Float_t AliEveCascade::GetBachPt() const { |
ed412809 | 338 | return sqrt(fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y); |
339 | } | |
340 | ||
7976039f | 341 | inline Float_t AliEveCascade::GetBachPseudoRapidity() const { |
ed412809 | 342 | Float_t theta = acos( fP_bach.z/GetBachP() ); |
343 | return ( -log(tan(theta/2.)) ); | |
344 | } | |
345 | ||
346 | ||
347 | /*********************************************************************** | |
348 | * | |
349 | * CascadeList class | |
350 | * | |
351 | ************************************************************************/ | |
352 | ||
7976039f | 353 | class CascadeList : public TEveElementList |
ed412809 | 354 | { |
ed412809 | 355 | public: |
7976039f | 356 | CascadeList(TEveTrackPropagator* rs=0); |
357 | CascadeList(const Text_t* name, TEveTrackPropagator* rs=0); | |
ed412809 | 358 | |
359 | virtual const Text_t* GetTitle() const { return fTitle; } | |
360 | virtual void SetTitle(const Text_t* t) { fTitle = t; } | |
361 | virtual void SetTracksColor(Color_t cNeg, Color_t cPos, Color_t cBach) | |
362 | { fNegColor = cNeg; fPosColor = cPos; fBachColor = cBach; } | |
363 | ||
364 | virtual Bool_t CanEditMainColor() { return kTRUE; } | |
365 | ||
366 | virtual void Paint(Option_t* option=""); | |
367 | ||
7976039f | 368 | void SetRnrStyle(TEveTrackPropagator* rst) { fRnrStyle= rst; } |
51346b82 | 369 | TEveTrackPropagator* GetPropagator() { return fRnrStyle; } |
ed412809 | 370 | |
371 | Bool_t GetRnrCasVtx() const { return fRnrCasVtx; } | |
372 | Bool_t GetRnrCasPath() const { return fRnrCasPath; } | |
373 | Bool_t GetRnrV0vtx() const { return fRnrV0vtx; } | |
374 | Bool_t GetRnrV0path() const { return fRnrV0path; } | |
375 | Bool_t GetRnrV0Daughters() const { return fRnrV0Daughters; } | |
376 | Bool_t GetRnrBachelor() const { return fRnrBach; } | |
377 | ||
378 | void SetRnrV0vtx(Bool_t); | |
379 | void SetRnrV0path(Bool_t); | |
380 | void SetRnrV0Daughters(Bool_t); | |
381 | void SetRnrBachelor(Bool_t); | |
382 | void SetRnrCasPath(Bool_t); | |
383 | void SetRnrCasVtx(Bool_t); | |
384 | void SetMin(Int_t i, Float_t val) { | |
385 | if ((i>=0)&&(i<fgkNcutVar)) fMin[i]=val;} | |
386 | void SetMax(Int_t i, Float_t val) { | |
387 | if ((i>=0)&&(i<fgkNcutVar)) fMax[i]=val;} | |
388 | ||
389 | void MakeCascades(); | |
390 | ||
391 | TH1F* GetHist(Int_t i) { | |
392 | if ((i>=0)&&(i<fgkNcutVar)) return fHist[i]; else return 0;} | |
393 | TH2F* GetHist2D(Int_t i) { | |
394 | if ((i>=0)&&(i<fgkNcutVar2D)) return fHist2D[i]; else return 0;} | |
395 | Float_t GetMin(Int_t i) { | |
396 | if ((i>=0)&&(i<fgkNcutVar)) return fMin[i]; else return 0;} | |
397 | Float_t GetMax(Int_t i) { | |
398 | if ((i>=0)&&(i<fgkNcutVar)) return fMax[i]; else return 0;} | |
399 | void GetCasIndexRange(Int_t &imin, Int_t &imax); | |
400 | ||
401 | void AdjustHist(Int_t iHist); | |
7976039f | 402 | void UnFill(AliEveCascade* cas); |
403 | void Filter(AliEveCascade* cas); | |
ed412809 | 404 | void FilterAll(); |
405 | ||
406 | void XiMassFilter(Float_t min, Float_t max); | |
407 | void OmegaMassFilter(Float_t min, Float_t max); | |
408 | void IndexFilter(Float_t min, Float_t max); | |
409 | void CosPointingFilter(Float_t min, Float_t max); | |
410 | void BachV0DCAFilter(Float_t min, Float_t max); | |
411 | void RadiusFilter(Float_t min, Float_t max); | |
412 | void PtFilter(Float_t min, Float_t max); | |
413 | void PseudoRapFilter(Float_t min, Float_t max); | |
414 | void NegPtFilter(Float_t min, Float_t max); | |
415 | void NegEtaFilter(Float_t min, Float_t max); | |
416 | void PosPtFilter(Float_t min, Float_t max); | |
417 | void PosEtaFilter(Float_t min, Float_t max); | |
418 | void BachPtFilter(Float_t min, Float_t max); | |
419 | void BachEtaFilter(Float_t min, Float_t max); | |
420 | ||
4b456ebb | 421 | protected: |
422 | TString fTitle; | |
423 | ||
424 | TEveTrackPropagator *fRnrStyle; | |
425 | ||
426 | Bool_t fRnrBach; | |
427 | Bool_t fRnrV0Daughters; | |
428 | Bool_t fRnrV0vtx; | |
429 | Bool_t fRnrV0path; | |
430 | Bool_t fRnrCasVtx; | |
431 | Bool_t fRnrCasPath; | |
432 | ||
433 | Color_t fNegColor; | |
434 | Color_t fPosColor; | |
435 | Color_t fBachColor; | |
436 | ||
437 | static const Int_t fgkNcutVar = 14; | |
438 | TH1F *fHist[fgkNcutVar]; | |
439 | Float_t fMin[fgkNcutVar]; | |
440 | Float_t fMax[fgkNcutVar]; | |
441 | ||
442 | static const Int_t fgkNcutVar2D = 1; | |
443 | TH2F *fHist2D[fgkNcutVar2D]; | |
444 | Float_t fMinX[fgkNcutVar2D]; | |
445 | Float_t fMinY[fgkNcutVar2D]; | |
446 | Float_t fMaxX[fgkNcutVar2D]; | |
447 | Float_t fMaxY[fgkNcutVar2D]; | |
448 | ||
449 | private: | |
450 | void Init(); | |
451 | ||
452 | CascadeList(const CascadeList&); // Not implemented | |
453 | CascadeList& operator=(const CascadeList&); // Not implemented | |
ed412809 | 454 | |
4b456ebb | 455 | ClassDef(CascadeList, 0); // A list of AliEveCascade objects. |
ed412809 | 456 | }; |
457 | ||
ed412809 | 458 | #endif |