]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/Reve/Track.h
This commit was generated by cvs2svn to compensate for changes in r13732,
[u/mrichter/AliRoot.git] / EVE / Reve / Track.h
CommitLineData
5a5a1232 1// $Header$
2
3#ifndef REVE_Track_H
4#define REVE_Track_H
5
6#include <Reve/PODs.h>
7#include <Reve/RenderElement.h>
8
9#include <TPolyMarker3D.h>
10#include <TPolyLine3D.h>
11
12namespace Reve {
13
14class TrackRnrStyle;
15class TrackList;
16
17class Track : public TPolyLine3D, public RenderElement
18{
19 friend class TrackList;
20
21private:
22 void Init();
23
24protected:
25 Reve::Vector fV;
26 Reve::Vector fP;
27 Double_t fBeta;
28 Int_t fCharge;
29 Int_t fLabel;
30
31 TrackRnrStyle* fRnrStyle;
32
33 TString fName;
34 TString fTitle;
35
36public:
37 Track();
38 Track(Reve::MCTrack* t, TrackRnrStyle* rs);
39 Track(Reve::RecTrack* t, TrackRnrStyle* rs);
40 std::vector<Reve::PathMark*> fPathMarks;
41 virtual ~Track();
42
43 void Reset(Int_t n_points=0);
44
45 virtual void SetLineColor(Color_t col)
46 { SetMainColor(col); }
47
48 virtual void Paint(Option_t* option="")
49 { if(fRnrElement) TPolyLine3D::Paint(option); }
50
51 void MakeTrack();
52
53 TrackRnrStyle* GetRnrStyle() const { return fRnrStyle; }
54
55 virtual const Text_t* GetName() const { return fName; }
56 virtual void SetName(const Text_t* name) { fName = name; }
57
58 virtual const Text_t* GetTitle() const { return fTitle; }
59 virtual void SetTitle(const Text_t* title) { fTitle = title; }
60
61 Int_t GetLabel() const { return fLabel; }
62
63 ClassDef(Track, 1);
64}; // endclass Track
65
66
67/**************************************************************************/
68// TrackRnrStyle
69/**************************************************************************/
70
71// This is decoupled from Track/TrackList to allow sharing of the
72// RnrStyle among several instances. The interface is half cooked and
73// there is no good way to set RnrStyle after the object has been
74// created (shouldn't be too hard to fix).
75//
76// TrackList has Get/Set methods for RnrStlye and
77// TrackListEditor provides editor access to them.
78
79class TrackRnrStyle : public TObject
80{
81private:
82 void Init();
83
84public:
85 Color_t fColor;
86 Float_t fMagField;
87 // track limits
88 Float_t fMaxR;
89 Float_t fMaxZ;
90 // helix limits
91 Float_t fMaxOrbs; // Maximal angular path of tracks' orbits (1 ~ 2Pi).
92 Float_t fMinAng; // Minimal angular step between two helix points.
93 Float_t fDelta; // Maximal error at the mid-point of the line connecting to helix points.
94
95 Bool_t fFitDaughters;
96 Bool_t fFitDecay;
97
98 TrackRnrStyle() { Init(); }
99
100 void SetColor(Color_t c) { fColor = c; }
101 Color_t GetColor() const { return fColor; }
102
103 static Float_t fgDefMagField;
104 static TrackRnrStyle fgDefStyle;
105
106 ClassDef(TrackRnrStyle, 1);
107}; // endclass TrackRnrStyle
108
109
110/**************************************************************************/
111// TrackList
112/**************************************************************************/
113
114class TrackList : public TPolyMarker3D, public RenderElementListBase
115{
116private:
117 void Init();
118
119protected:
120 TString fTitle;
121
122 TrackRnrStyle* mRnrStyle;
123
124 Bool_t fRnrMarkers;
125 Bool_t fRnrTracks;
126
127public:
128 TrackList(Int_t n_tracks=0);
129 TrackList(const Text_t* name, Int_t n_tracks=0);
130
131 void Reset(Int_t n_tracks=0);
132
133 virtual const Text_t* GetTile() const { return fTitle; }
134 virtual void SetTitle(const Text_t* t) { fTitle = t; }
135
136 virtual Bool_t CanEditMainColor() { return true; }
137
138 virtual void Paint(Option_t* option="");
139
140 virtual void AddElement(RenderElement* el);
141
142 void SetRnrStyle(TrackRnrStyle* rst) { mRnrStyle= rst; }
143 TrackRnrStyle* GetRnrStyle() { return mRnrStyle; }
144
145 Bool_t GetRnrTracks() const { return fRnrTracks; }
146 void SetRnrTracks(Bool_t);
147
148 Bool_t GetRnrMarkers() const { return fRnrMarkers; }
149 void SetRnrMarkers(Bool_t);
150
151 void MakeTracks();
152 void MakeMarkers();
153
154 Float_t GetMaxR() const { return mRnrStyle->fMaxZ; }
155 Float_t GetMaxZ() const { return mRnrStyle->fMaxR; }
156 Float_t GetMaxOrbs() const { return mRnrStyle->fMaxOrbs; }
157 Float_t GetMinAng() const { return mRnrStyle->fMinAng; }
158 Float_t GetDelta() const { return mRnrStyle->fDelta; }
159 Bool_t GetFitDaughters() const { return mRnrStyle->fFitDaughters; }
160 Bool_t GetFitDecay() const { return mRnrStyle->fFitDecay; }
161
162 void SetMaxR(Float_t x);
163 void SetMaxZ(Float_t x);
164 void SetMaxOrbs(Float_t x);
165 void SetMinAng(Float_t x);
166 void SetDelta(Float_t x);
167 void SetFitDaughters(Bool_t x);
168 void SetFitDecay(Bool_t x);
169
170
171 // void UpdateBounds();
172 Int_t GetNTracks() { return fN; }
173
174 void SelectByPt(Float_t min_pt=0.2, Float_t max_pt=10); // *MENU*
175
176 void MakePtScrollbar(); // *MENU*
177 void HandlePtScrollEvent();
178
179 ClassDef(TrackList, 1);
180};
181
182
183} // namespace Reve
184
185#endif