Added parameter 'Width_t fWidth' to TrackRnrStyle and a method to change width of...
[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
7d42b6c2 17class Track : public RenderElement,
18 public TPolyLine3D
5a5a1232 19{
20 friend class TrackList;
21
265ecb21 22 Track(const Track&); // Not implemented
23 Track& operator=(const Track&); // Not implemented
5a5a1232 24
25protected:
265ecb21 26 typedef std::vector<Reve::PathMark*> vpPathMark_t;
27 typedef std::vector<Reve::PathMark*>::iterator vpPathMark_i;
28
29 Reve::Vector fV;
30 Reve::Vector fP;
31 Double_t fBeta;
32 Int_t fCharge;
33 Int_t fLabel;
34 vpPathMark_t fPathMarks;
5a5a1232 35
265ecb21 36 TrackRnrStyle* fRnrStyle;
5a5a1232 37
265ecb21 38 TString fName;
39 TString fTitle;
5a5a1232 40
41public:
42 Track();
3d75306d 43 Track(TParticle* t, Int_t label, TrackRnrStyle* rs);
5a5a1232 44 Track(Reve::MCTrack* t, TrackRnrStyle* rs);
45 Track(Reve::RecTrack* t, TrackRnrStyle* rs);
5a5a1232 46 virtual ~Track();
47
48 void Reset(Int_t n_points=0);
49
50 virtual void SetLineColor(Color_t col)
51 { SetMainColor(col); }
52
53 virtual void Paint(Option_t* option="")
54 { if(fRnrElement) TPolyLine3D::Paint(option); }
55
56 void MakeTrack();
57
48dc973d 58 TrackRnrStyle* GetRnrStyle() const { return fRnrStyle; }
59 void SetRnrStyle(TrackRnrStyle* rs) { fRnrStyle = rs; }
5a5a1232 60
61 virtual const Text_t* GetName() const { return fName; }
62 virtual void SetName(const Text_t* name) { fName = name; }
63
64 virtual const Text_t* GetTitle() const { return fTitle; }
65 virtual void SetTitle(const Text_t* title) { fTitle = title; }
66
67 Int_t GetLabel() const { return fLabel; }
265ecb21 68 void AddPathMark(Reve::PathMark* pm) { fPathMarks.push_back(pm); }
5a5a1232 69
48dc973d 70 //--------------------------------
71
72 void ImportHits(); // *MENU*
73 void ImportClusters(); // *MENU*
74
5a5a1232 75 ClassDef(Track, 1);
76}; // endclass Track
77
78
79/**************************************************************************/
80// TrackRnrStyle
81/**************************************************************************/
82
83// This is decoupled from Track/TrackList to allow sharing of the
84// RnrStyle among several instances. The interface is half cooked and
85// there is no good way to set RnrStyle after the object has been
86// created (shouldn't be too hard to fix).
87//
88// TrackList has Get/Set methods for RnrStlye and
89// TrackListEditor provides editor access to them.
90
91class TrackRnrStyle : public TObject
92{
5a5a1232 93public:
94 Color_t fColor;
2074deef 95 Width_t fWidth;
5a5a1232 96 Float_t fMagField;
97 // track limits
98 Float_t fMaxR;
99 Float_t fMaxZ;
100 // helix limits
101 Float_t fMaxOrbs; // Maximal angular path of tracks' orbits (1 ~ 2Pi).
102 Float_t fMinAng; // Minimal angular step between two helix points.
103 Float_t fDelta; // Maximal error at the mid-point of the line connecting to helix points.
104
105 Bool_t fFitDaughters;
106 Bool_t fFitDecay;
107
265ecb21 108 TrackRnrStyle();
5a5a1232 109
110 void SetColor(Color_t c) { fColor = c; }
111 Color_t GetColor() const { return fColor; }
112
48dc973d 113 Float_t GetMagField() const { return fMagField; }
114 void SetMagField(Float_t mf) { fMagField = mf; }
115
116 static Float_t fgDefMagField;
117 static const Float_t fgkB2C;
5a5a1232 118 static TrackRnrStyle fgDefStyle;
119
120 ClassDef(TrackRnrStyle, 1);
121}; // endclass TrackRnrStyle
122
123
124/**************************************************************************/
125// TrackList
126/**************************************************************************/
127
7d42b6c2 128class TrackList : public RenderElementListBase,
129 public TPolyMarker3D
5a5a1232 130{
265ecb21 131 TrackList(const TrackList&); // Not implemented
132 TrackList& operator=(const TrackList&); // Not implemented
133
5a5a1232 134private:
135 void Init();
136
137protected:
48dc973d 138 TString fTitle;
5a5a1232 139
a8600b56 140 TrackRnrStyle* fRnrStyle;
5a5a1232 141
48dc973d 142 Bool_t fRnrMarkers;
143 Bool_t fRnrTracks;
5a5a1232 144
145public:
a8600b56 146 TrackList(Int_t n_tracks=0, TrackRnrStyle* rs=0);
147 TrackList(const Text_t* name, Int_t n_tracks=0, TrackRnrStyle* rs=0);
5a5a1232 148
149 void Reset(Int_t n_tracks=0);
150
a8600b56 151 virtual const Text_t* GetTitle() const { return fTitle; }
5a5a1232 152 virtual void SetTitle(const Text_t* t) { fTitle = t; }
153
48dc973d 154 virtual Bool_t CanEditMainColor() { return kTRUE; }
5a5a1232 155
156 virtual void Paint(Option_t* option="");
157
158 virtual void AddElement(RenderElement* el);
159
a8600b56 160 void SetRnrStyle(TrackRnrStyle* rst) { fRnrStyle= rst; }
161 TrackRnrStyle* GetRnrStyle() { return fRnrStyle; }
5a5a1232 162
163 Bool_t GetRnrTracks() const { return fRnrTracks; }
164 void SetRnrTracks(Bool_t);
165
166 Bool_t GetRnrMarkers() const { return fRnrMarkers; }
167 void SetRnrMarkers(Bool_t);
168
169 void MakeTracks();
170 void MakeMarkers();
171
2074deef 172 Width_t GetWidth() const { return fRnrStyle->fWidth; }
173 void SetWidth(Width_t w);
174
a8600b56 175 Float_t GetMaxR() const { return fRnrStyle->fMaxZ; }
176 Float_t GetMaxZ() const { return fRnrStyle->fMaxR; }
177 Float_t GetMaxOrbs() const { return fRnrStyle->fMaxOrbs; }
178 Float_t GetMinAng() const { return fRnrStyle->fMinAng; }
179 Float_t GetDelta() const { return fRnrStyle->fDelta; }
180 Bool_t GetFitDaughters() const { return fRnrStyle->fFitDaughters; }
181 Bool_t GetFitDecay() const { return fRnrStyle->fFitDecay; }
5a5a1232 182
183 void SetMaxR(Float_t x);
184 void SetMaxZ(Float_t x);
185 void SetMaxOrbs(Float_t x);
186 void SetMinAng(Float_t x);
187 void SetDelta(Float_t x);
188 void SetFitDaughters(Bool_t x);
189 void SetFitDecay(Bool_t x);
190
191
192 // void UpdateBounds();
193 Int_t GetNTracks() { return fN; }
194
195 void SelectByPt(Float_t min_pt=0.2, Float_t max_pt=10); // *MENU*
196
b99aed53 197 //--------------------------------
198
199 void ImportHits(); // *MENU*
200 void ImportClusters(); // *MENU*
5a5a1232 201
202 ClassDef(TrackList, 1);
203};
204
205
206} // namespace Reve
207
208#endif