7 #include <Reve/RenderElement.h>
9 #include <TPolyMarker3D.h>
10 #include <TPolyLine3D.h>
17 class Track : public RenderElement,
20 friend class TrackList;
32 TrackRnrStyle* fRnrStyle;
39 Track(Reve::MCTrack* t, TrackRnrStyle* rs);
40 Track(Reve::RecTrack* t, TrackRnrStyle* rs);
41 std::vector<Reve::PathMark*> fPathMarks;
44 void Reset(Int_t n_points=0);
46 virtual void SetLineColor(Color_t col)
47 { SetMainColor(col); }
49 virtual void Paint(Option_t* option="")
50 { if(fRnrElement) TPolyLine3D::Paint(option); }
54 TrackRnrStyle* GetRnrStyle() const { return fRnrStyle; }
55 void SetRnrStyle(TrackRnrStyle* rs) { fRnrStyle = rs; }
57 virtual const Text_t* GetName() const { return fName; }
58 virtual void SetName(const Text_t* name) { fName = name; }
60 virtual const Text_t* GetTitle() const { return fTitle; }
61 virtual void SetTitle(const Text_t* title) { fTitle = title; }
63 Int_t GetLabel() const { return fLabel; }
65 //--------------------------------
67 void ImportHits(); // *MENU*
68 void ImportClusters(); // *MENU*
74 /**************************************************************************/
76 /**************************************************************************/
78 // This is decoupled from Track/TrackList to allow sharing of the
79 // RnrStyle among several instances. The interface is half cooked and
80 // there is no good way to set RnrStyle after the object has been
81 // created (shouldn't be too hard to fix).
83 // TrackList has Get/Set methods for RnrStlye and
84 // TrackListEditor provides editor access to them.
86 class TrackRnrStyle : public TObject
98 Float_t fMaxOrbs; // Maximal angular path of tracks' orbits (1 ~ 2Pi).
99 Float_t fMinAng; // Minimal angular step between two helix points.
100 Float_t fDelta; // Maximal error at the mid-point of the line connecting to helix points.
102 Bool_t fFitDaughters;
105 TrackRnrStyle() { Init(); }
107 void SetColor(Color_t c) { fColor = c; }
108 Color_t GetColor() const { return fColor; }
110 Float_t GetMagField() const { return fMagField; }
111 void SetMagField(Float_t mf) { fMagField = mf; }
113 static Float_t fgDefMagField;
114 static const Float_t fgkB2C;
115 static TrackRnrStyle fgDefStyle;
117 ClassDef(TrackRnrStyle, 1);
118 }; // endclass TrackRnrStyle
121 /**************************************************************************/
123 /**************************************************************************/
125 class TrackList : public RenderElementListBase,
134 TrackRnrStyle* mRnrStyle;
140 TrackList(Int_t n_tracks=0);
141 TrackList(const Text_t* name, Int_t n_tracks=0);
143 void Reset(Int_t n_tracks=0);
145 virtual const Text_t* GetTile() const { return fTitle; }
146 virtual void SetTitle(const Text_t* t) { fTitle = t; }
148 virtual Bool_t CanEditMainColor() { return kTRUE; }
150 virtual void Paint(Option_t* option="");
152 virtual void AddElement(RenderElement* el);
154 void SetRnrStyle(TrackRnrStyle* rst) { mRnrStyle= rst; }
155 TrackRnrStyle* GetRnrStyle() { return mRnrStyle; }
157 Bool_t GetRnrTracks() const { return fRnrTracks; }
158 void SetRnrTracks(Bool_t);
160 Bool_t GetRnrMarkers() const { return fRnrMarkers; }
161 void SetRnrMarkers(Bool_t);
166 Float_t GetMaxR() const { return mRnrStyle->fMaxZ; }
167 Float_t GetMaxZ() const { return mRnrStyle->fMaxR; }
168 Float_t GetMaxOrbs() const { return mRnrStyle->fMaxOrbs; }
169 Float_t GetMinAng() const { return mRnrStyle->fMinAng; }
170 Float_t GetDelta() const { return mRnrStyle->fDelta; }
171 Bool_t GetFitDaughters() const { return mRnrStyle->fFitDaughters; }
172 Bool_t GetFitDecay() const { return mRnrStyle->fFitDecay; }
174 void SetMaxR(Float_t x);
175 void SetMaxZ(Float_t x);
176 void SetMaxOrbs(Float_t x);
177 void SetMinAng(Float_t x);
178 void SetDelta(Float_t x);
179 void SetFitDaughters(Bool_t x);
180 void SetFitDecay(Bool_t x);
183 // void UpdateBounds();
184 Int_t GetNTracks() { return fN; }
186 void SelectByPt(Float_t min_pt=0.2, Float_t max_pt=10); // *MENU*
188 //--------------------------------
190 void ImportHits(); // *MENU*
191 void ImportClusters(); // *MENU*
193 ClassDef(TrackList, 1);