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