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