]>
Commit | Line | Data |
---|---|---|
5a5a1232 | 1 | #ifndef REVE_Track_H |
2 | #define REVE_Track_H | |
3 | ||
37b09b91 | 4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id$ */ | |
8 | ||
9 | #include <vector> | |
10 | ||
5a5a1232 | 11 | #include <Reve/PODs.h> |
12 | #include <Reve/RenderElement.h> | |
eadaa89b | 13 | #include <Reve/Line.h> |
5a5a1232 | 14 | |
15 | #include <TPolyMarker3D.h> | |
3010c308 | 16 | #include <TQObject.h> |
5a5a1232 | 17 | |
18 | namespace Reve { | |
19 | ||
20 | class TrackRnrStyle; | |
21 | class TrackList; | |
22 | ||
9c39ede9 | 23 | class Track : public Line, public TQObject |
5a5a1232 | 24 | { |
25 | friend class TrackList; | |
9c39ede9 | 26 | friend class TrackCounter; |
915b2ab7 | 27 | friend class TrackGL; |
5a5a1232 | 28 | |
265ecb21 | 29 | Track(const Track&); // Not implemented |
30 | Track& operator=(const Track&); // Not implemented | |
5a5a1232 | 31 | |
a525aa60 | 32 | public: |
265ecb21 | 33 | typedef std::vector<Reve::PathMark*> vpPathMark_t; |
34 | typedef std::vector<Reve::PathMark*>::iterator vpPathMark_i; | |
a525aa60 | 35 | protected: |
265ecb21 | 36 | Reve::Vector fV; |
37 | Reve::Vector fP; | |
38 | Double_t fBeta; | |
39 | Int_t fCharge; | |
40 | Int_t fLabel; | |
fa446a68 | 41 | Int_t fIndex; |
265ecb21 | 42 | vpPathMark_t fPathMarks; |
5a5a1232 | 43 | |
265ecb21 | 44 | TrackRnrStyle* fRnrStyle; |
5a5a1232 | 45 | |
46 | public: | |
47 | Track(); | |
3d75306d | 48 | Track(TParticle* t, Int_t label, TrackRnrStyle* rs); |
5a5a1232 | 49 | Track(Reve::MCTrack* t, TrackRnrStyle* rs); |
50 | Track(Reve::RecTrack* t, TrackRnrStyle* rs); | |
5a5a1232 | 51 | virtual ~Track(); |
52 | ||
2fbbf445 | 53 | void MakeTrack(Bool_t recurse = kTRUE); |
5a5a1232 | 54 | |
48dc973d | 55 | TrackRnrStyle* GetRnrStyle() const { return fRnrStyle; } |
56 | void SetRnrStyle(TrackRnrStyle* rs) { fRnrStyle = rs; } | |
5a5a1232 | 57 | |
fa446a68 | 58 | Int_t GetLabel() const { return fLabel; } |
59 | void SetLabel(Int_t lbl) { fLabel = lbl; } | |
60 | Int_t GetIndex() const { return fIndex; } | |
61 | void SetIndex(Int_t idx) { fIndex = idx; } | |
62 | ||
265ecb21 | 63 | void AddPathMark(Reve::PathMark* pm) { fPathMarks.push_back(pm); } |
5a5a1232 | 64 | |
48dc973d | 65 | //-------------------------------- |
66 | ||
fa446a68 | 67 | void ImportHits(); // *MENU* |
68 | void ImportClusters(); // *MENU* | |
a525aa60 | 69 | void ImportClustersFromIndex(); // *MENU* |
b8879e69 | 70 | void ImportKine(); // *MENU* |
71 | void ImportKineWithArgs(Bool_t importMother=kTRUE, | |
72 | Bool_t impDaugters =kTRUE); // *MENU* | |
b1f08706 | 73 | void PrintKineStack(); // *MENU* |
a525aa60 | 74 | void PrintPathMarks(); // *MENU* |
48dc973d | 75 | |
9c39ede9 | 76 | //-------------------------------- |
77 | ||
78 | void CtrlClicked(Reve::Track*); // *SIGNAL* | |
79 | ||
5a5a1232 | 80 | ClassDef(Track, 1); |
81 | }; // endclass Track | |
82 | ||
83 | ||
84 | /**************************************************************************/ | |
85 | // TrackRnrStyle | |
86 | /**************************************************************************/ | |
87 | ||
88 | // This is decoupled from Track/TrackList to allow sharing of the | |
89 | // RnrStyle among several instances. The interface is half cooked and | |
90 | // there is no good way to set RnrStyle after the object has been | |
91 | // created (shouldn't be too hard to fix). | |
92 | // | |
93 | // TrackList has Get/Set methods for RnrStlye and | |
94 | // TrackListEditor provides editor access to them. | |
95 | ||
9c39ede9 | 96 | class TrackRnrStyle : public TObject |
5a5a1232 | 97 | { |
5a5a1232 | 98 | public: |
99 | Color_t fColor; | |
2074deef | 100 | Width_t fWidth; |
5a5a1232 | 101 | Float_t fMagField; |
102 | // track limits | |
103 | Float_t fMaxR; | |
104 | Float_t fMaxZ; | |
105 | // helix limits | |
106 | Float_t fMaxOrbs; // Maximal angular path of tracks' orbits (1 ~ 2Pi). | |
107 | Float_t fMinAng; // Minimal angular step between two helix points. | |
108 | Float_t fDelta; // Maximal error at the mid-point of the line connecting to helix points. | |
109 | ||
22df2a83 | 110 | Float_t fMinPt; |
111 | Float_t fMaxPt; | |
112 | ||
915b2ab7 | 113 | Color_t fPMColor; |
114 | Style_t fPMStyle; | |
115 | Size_t fPMSize; | |
116 | ||
5a5a1232 | 117 | Bool_t fFitDaughters; |
915b2ab7 | 118 | Bool_t fFitReferences; |
5a5a1232 | 119 | Bool_t fFitDecay; |
120 | ||
915b2ab7 | 121 | Bool_t fRnrDaughters; |
122 | Bool_t fRnrReferences; | |
123 | Bool_t fRnrDecay; | |
124 | ||
265ecb21 | 125 | TrackRnrStyle(); |
5a5a1232 | 126 | |
127 | void SetColor(Color_t c) { fColor = c; } | |
128 | Color_t GetColor() const { return fColor; } | |
129 | ||
48dc973d | 130 | Float_t GetMagField() const { return fMagField; } |
131 | void SetMagField(Float_t mf) { fMagField = mf; } | |
132 | ||
133 | static Float_t fgDefMagField; | |
134 | static const Float_t fgkB2C; | |
5a5a1232 | 135 | static TrackRnrStyle fgDefStyle; |
136 | ||
137 | ClassDef(TrackRnrStyle, 1); | |
138 | }; // endclass TrackRnrStyle | |
139 | ||
140 | ||
141 | /**************************************************************************/ | |
142 | // TrackList | |
143 | /**************************************************************************/ | |
144 | ||
2fbbf445 | 145 | class TrackList : public RenderElement, |
7d42b6c2 | 146 | public TPolyMarker3D |
5a5a1232 | 147 | { |
265ecb21 | 148 | TrackList(const TrackList&); // Not implemented |
149 | TrackList& operator=(const TrackList&); // Not implemented | |
150 | ||
5a5a1232 | 151 | private: |
152 | void Init(); | |
153 | ||
154 | protected: | |
48dc973d | 155 | TString fTitle; |
5a5a1232 | 156 | |
a8600b56 | 157 | TrackRnrStyle* fRnrStyle; |
5a5a1232 | 158 | |
48dc973d | 159 | Bool_t fRnrMarkers; |
160 | Bool_t fRnrTracks; | |
915b2ab7 | 161 | Bool_t fEditPathMarks; |
5a5a1232 | 162 | |
163 | public: | |
a8600b56 | 164 | TrackList(Int_t n_tracks=0, TrackRnrStyle* rs=0); |
165 | TrackList(const Text_t* name, Int_t n_tracks=0, TrackRnrStyle* rs=0); | |
5a5a1232 | 166 | |
167 | void Reset(Int_t n_tracks=0); | |
168 | ||
915b2ab7 | 169 | virtual const Text_t* GetTitle() const { return fTitle; } |
170 | virtual void SetTitle(const Text_t* t) { fTitle = t; } | |
5a5a1232 | 171 | |
48dc973d | 172 | virtual Bool_t CanEditMainColor() { return kTRUE; } |
5a5a1232 | 173 | |
174 | virtual void Paint(Option_t* option=""); | |
175 | ||
176 | virtual void AddElement(RenderElement* el); | |
177 | ||
915b2ab7 | 178 | virtual void SetMarkerColor(Color_t c) {TAttMarker::SetMarkerColor(c); if(fRnrStyle) fRnrStyle->fPMColor =c;} |
179 | virtual void SetMarkerStyle(Style_t s){TAttMarker::SetMarkerStyle(s); if(fRnrStyle) fRnrStyle->fPMStyle = s;} | |
180 | virtual void SetMarkerSize(Size_t s){TAttMarker::SetMarkerSize(s); if(fRnrStyle) fRnrStyle->fPMSize = s;} | |
181 | ||
182 | TrackRnrStyle* GetRnrStyle() { fRnrStyle->fPMColor = GetMarkerColor();fRnrStyle->fPMStyle = GetMarkerStyle();fRnrStyle->fPMSize = GetMarkerSize(); return fRnrStyle; } | |
183 | void SetRnrStyle(TrackRnrStyle* rst) { fRnrStyle= rst; } | |
184 | ||
185 | Bool_t GetEditPathMarks() const { return fEditPathMarks; } | |
186 | void SetEditPathMarks(Bool_t x) { fEditPathMarks = x; } | |
5a5a1232 | 187 | |
188 | Bool_t GetRnrTracks() const { return fRnrTracks; } | |
189 | void SetRnrTracks(Bool_t); | |
190 | ||
22df2a83 | 191 | Bool_t GetRnrDaughters() const { return fRnrStyle->fRnrDaughters; } |
915b2ab7 | 192 | Bool_t GetRnrReferences() const { return fRnrStyle->fRnrReferences; } |
22df2a83 | 193 | Bool_t GetRnrDecay() const { return fRnrStyle->fRnrDecay; } |
915b2ab7 | 194 | |
195 | void SetRnrDaughters(Bool_t x); | |
196 | void SetRnrReferences(Bool_t x); | |
197 | void SetRnrDecay(Bool_t x); | |
198 | ||
5a5a1232 | 199 | Bool_t GetRnrMarkers() const { return fRnrMarkers; } |
200 | void SetRnrMarkers(Bool_t); | |
201 | ||
202 | void MakeTracks(); | |
203 | void MakeMarkers(); | |
204 | ||
2074deef | 205 | Width_t GetWidth() const { return fRnrStyle->fWidth; } |
915b2ab7 | 206 | void SetWidth(Width_t w); |
2074deef | 207 | |
a8600b56 | 208 | Float_t GetMaxR() const { return fRnrStyle->fMaxZ; } |
209 | Float_t GetMaxZ() const { return fRnrStyle->fMaxR; } | |
210 | Float_t GetMaxOrbs() const { return fRnrStyle->fMaxOrbs; } | |
211 | Float_t GetMinAng() const { return fRnrStyle->fMinAng; } | |
212 | Float_t GetDelta() const { return fRnrStyle->fDelta; } | |
22df2a83 | 213 | |
214 | Float_t GetMinPt() const { return fRnrStyle->fMinPt; } | |
215 | Float_t GetMaxPt() const { return fRnrStyle->fMaxPt; } | |
915b2ab7 | 216 | |
217 | Bool_t GetFitDaughters() const { return fRnrStyle->fFitDaughters; } | |
218 | Bool_t GetFitReferences() const { return fRnrStyle->fFitReferences; } | |
219 | Bool_t GetFitDecay() const { return fRnrStyle->fFitDecay; } | |
220 | ||
221 | void SetFitDaughters(Bool_t x); | |
222 | void SetFitReferences(Bool_t x); | |
223 | void SetFitDecay(Bool_t x); | |
5a5a1232 | 224 | |
225 | void SetMaxR(Float_t x); | |
226 | void SetMaxZ(Float_t x); | |
227 | void SetMaxOrbs(Float_t x); | |
228 | void SetMinAng(Float_t x); | |
229 | void SetDelta(Float_t x); | |
5a5a1232 | 230 | |
231 | // void UpdateBounds(); | |
232 | Int_t GetNTracks() { return fN; } | |
233 | ||
234 | void SelectByPt(Float_t min_pt=0.2, Float_t max_pt=10); // *MENU* | |
235 | ||
b99aed53 | 236 | //-------------------------------- |
237 | ||
238 | void ImportHits(); // *MENU* | |
239 | void ImportClusters(); // *MENU* | |
5a5a1232 | 240 | |
241 | ClassDef(TrackList, 1); | |
242 | }; | |
243 | ||
9c39ede9 | 244 | /**************************************************************************/ |
245 | // TrackCounter | |
246 | /**************************************************************************/ | |
247 | ||
248 | class TrackCounter : public RenderElement, public TNamed | |
249 | { | |
250 | friend class TrackCounterEditor; | |
251 | ||
252 | public: | |
253 | enum ClickAction_e { CA_PrintTrackInfo, CA_ToggleTrack }; | |
254 | ||
255 | private: | |
256 | TrackCounter(const TrackCounter&); // Not implemented | |
257 | TrackCounter& operator=(const TrackCounter&); // Not implemented | |
258 | ||
259 | protected: | |
260 | Int_t fBadLineStyle; | |
261 | Int_t fClickAction; | |
262 | ||
7af62191 | 263 | Int_t fEventId; |
264 | ||
9c39ede9 | 265 | Int_t fAllTracks; |
266 | Int_t fGoodTracks; | |
267 | ||
268 | TList fTrackLists; | |
269 | ||
270 | public: | |
271 | TrackCounter(const Text_t* name="TrackCounter", const Text_t* title=""); | |
272 | virtual ~TrackCounter(); | |
273 | ||
7af62191 | 274 | Int_t GetEventId() const { return fEventId; } |
275 | void SetEventId(Int_t id) { fEventId = id; } | |
276 | ||
9c39ede9 | 277 | void Reset(); |
278 | ||
279 | void RegisterTracks(TrackList* tlist, Bool_t goodTracks); | |
280 | ||
281 | void DoTrackAction(Track* track); | |
282 | ||
283 | Int_t GetClickAction() const { return fClickAction; } | |
284 | void SetClickAction(Int_t a) { fClickAction = a; } | |
285 | ||
7af62191 | 286 | void OutputEventTracks(FILE* out=0); |
287 | ||
b1f08706 | 288 | static TrackCounter* fgInstance; |
289 | ||
9c39ede9 | 290 | ClassDef(TrackCounter, 1); |
291 | }; // endclass TrackCounter | |
292 | ||
5a5a1232 | 293 | |
294 | } // namespace Reve | |
295 | ||
296 | #endif |