]>
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> | |
32e219c2 | 16 | #include <TMarker.h> |
3010c308 | 17 | #include <TQObject.h> |
5a5a1232 | 18 | |
19 | namespace Reve { | |
20 | ||
21 | class TrackRnrStyle; | |
22 | class TrackList; | |
23 | ||
32e219c2 | 24 | class Track : public Line, |
25 | public TQObject | |
5a5a1232 | 26 | { |
32e219c2 | 27 | friend class TrackRnrStyle; |
5a5a1232 | 28 | friend class TrackList; |
9c39ede9 | 29 | friend class TrackCounter; |
915b2ab7 | 30 | friend class TrackGL; |
5a5a1232 | 31 | |
a525aa60 | 32 | public: |
265ecb21 | 33 | typedef std::vector<Reve::PathMark*> vpPathMark_t; |
34 | typedef std::vector<Reve::PathMark*>::iterator vpPathMark_i; | |
32e219c2 | 35 | |
a525aa60 | 36 | protected: |
17038a14 | 37 | Reve::Vector fV; // Starting vertex |
38 | Reve::Vector fP; // Starting momentum | |
39 | Double_t fBeta; // Relativistic beta factor | |
b343c0ea | 40 | Int_t fPdg; // PDG code |
17038a14 | 41 | Int_t fCharge; // Charge in units of e0 |
42 | Int_t fLabel; // Simulation label | |
43 | Int_t fIndex; // Reconstruction index | |
44 | vpPathMark_t fPathMarks; // Vector of known points along the track | |
5a5a1232 | 45 | |
17038a14 | 46 | TrackRnrStyle* fRnrStyle; // Pointer to shared render-style |
5a5a1232 | 47 | |
dd2b04ce | 48 | public: |
5a5a1232 | 49 | Track(); |
3d75306d | 50 | Track(TParticle* t, Int_t label, TrackRnrStyle* rs); |
5a5a1232 | 51 | Track(Reve::MCTrack* t, TrackRnrStyle* rs); |
52 | Track(Reve::RecTrack* t, TrackRnrStyle* rs); | |
b343c0ea | 53 | Track(const Track& t); |
5a5a1232 | 54 | virtual ~Track(); |
55 | ||
b343c0ea | 56 | virtual void SetStdTitle(); |
57 | ||
32e219c2 | 58 | virtual void SetTrackParams(const Track& t); |
2b801b28 | 59 | virtual void SetPathMarks (const Track& t); |
32e219c2 | 60 | |
61 | virtual void MakeTrack(Bool_t recurse=kTRUE); | |
5a5a1232 | 62 | |
48dc973d | 63 | TrackRnrStyle* GetRnrStyle() const { return fRnrStyle; } |
32e219c2 | 64 | void SetRnrStyle(TrackRnrStyle* rs); |
65 | void SetAttLineAttMarker(TrackList* tl); | |
5a5a1232 | 66 | |
b343c0ea | 67 | Int_t GetPdg() const { return fPdg; } |
68 | void SetPdg(Int_t pdg) { fPdg = pdg; } | |
69 | Int_t GetCharge() const { return fCharge; } | |
70 | void SetCharge(Int_t chg) { fCharge = chg; } | |
71 | Int_t GetLabel() const { return fLabel; } | |
fa446a68 | 72 | void SetLabel(Int_t lbl) { fLabel = lbl; } |
b343c0ea | 73 | Int_t GetIndex() const { return fIndex; } |
fa446a68 | 74 | void SetIndex(Int_t idx) { fIndex = idx; } |
75 | ||
2b801b28 | 76 | void AddPathMark(Reve::PathMark* pm) { fPathMarks.push_back(pm); } |
77 | vpPathMark_t& GetPathMarksRef() { return fPathMarks; } | |
78 | const vpPathMark_t& GetPathMarksRef() const { return fPathMarks; } | |
79 | void SortPathMarksByTime(); | |
dd2b04ce | 80 | |
48dc973d | 81 | //-------------------------------- |
82 | ||
fa446a68 | 83 | void ImportHits(); // *MENU* |
84 | void ImportClusters(); // *MENU* | |
dd2b04ce | 85 | void ImportClustersFromIndex(); // *MENU* |
b8879e69 | 86 | void ImportKine(); // *MENU* |
b343c0ea | 87 | void ImportKineWithArgs(Bool_t importMother=kTRUE, Bool_t impDaugters=kTRUE, |
88 | Bool_t colorPdg =kTRUE, Bool_t recurse =kTRUE); // *MENU* | |
b1f08706 | 89 | void PrintKineStack(); // *MENU* |
a525aa60 | 90 | void PrintPathMarks(); // *MENU* |
48dc973d | 91 | |
9c39ede9 | 92 | //-------------------------------- |
93 | ||
32e219c2 | 94 | virtual void CtrlClicked(Reve::Track*); // *SIGNAL* |
95 | virtual void SetLineStyle(Style_t lstyle); | |
96 | ||
97 | virtual const TGPicture* GetListTreeIcon() { return fgListTreeIcons[4]; }; | |
98 | ||
99 | virtual TClass* ProjectedClass() const; | |
9c39ede9 | 100 | |
17038a14 | 101 | ClassDef(Track, 1); // Visual representation of a track. |
5a5a1232 | 102 | }; // endclass Track |
103 | ||
104 | ||
105 | /**************************************************************************/ | |
106 | // TrackRnrStyle | |
107 | /**************************************************************************/ | |
108 | ||
32e219c2 | 109 | class TrackRnrStyle : public TObject, |
110 | public ReferenceBackPtr | |
5a5a1232 | 111 | { |
32e219c2 | 112 | private: |
113 | void RebuildTracks(); | |
114 | ||
5a5a1232 | 115 | public: |
17038a14 | 116 | Float_t fMagField; // Constant magnetic field along z. |
117 | ||
118 | // Track limits | |
119 | Float_t fMaxR; // Max radius for track extrapolation | |
120 | Float_t fMaxZ; // Max z-coordinate for track extrapolation. | |
121 | // Helix limits | |
122 | Float_t fMaxOrbs; // Maximal angular path of tracks' orbits (1 ~ 2Pi). | |
123 | Float_t fMinAng; // Minimal angular step between two helix points. | |
124 | Float_t fDelta; // Maximal error at the mid-point of the line connecting to helix points. | |
125 | ||
126 | // Path-mark control | |
127 | Bool_t fEditPathMarks; // Show widgets for path-mark control in GUI editor. | |
128 | TMarker fPMAtt; // Marker attributes for rendering of path-marks. | |
129 | ||
130 | Bool_t fFitDaughters; // Pass through daughter creation points when extrapolating a track. | |
131 | Bool_t fFitReferences; // Pass through given track-references when extrapolating a track. | |
132 | Bool_t fFitDecay; // Pass through decay point when extrapolating a track. | |
133 | ||
134 | Bool_t fRnrDaughters; // Render daughter path-marks. | |
135 | Bool_t fRnrReferences; // Render track-reference path-marks. | |
136 | Bool_t fRnrDecay; // Render decay path-marks. | |
137 | ||
138 | // First vertex control | |
139 | Bool_t fRnrFV; // Render first vertex. | |
140 | TMarker fFVAtt; // Marker attributes for fits vertex. | |
915b2ab7 | 141 | |
265ecb21 | 142 | TrackRnrStyle(); |
5a5a1232 | 143 | |
32e219c2 | 144 | // callbacks |
145 | void SetEditPathMarks(Bool_t x) { fEditPathMarks = x; } | |
146 | void SetRnrDaughters(Bool_t x); | |
147 | void SetRnrReferences(Bool_t x); | |
148 | void SetRnrDecay(Bool_t x); | |
149 | ||
150 | void SetRnrFV(Bool_t x){ fRnrFV = x;} | |
151 | ||
152 | void SetFitDaughters(Bool_t x); | |
153 | void SetFitReferences(Bool_t x); | |
154 | void SetFitDecay(Bool_t x); | |
155 | ||
156 | void SetMaxR(Float_t x); | |
157 | void SetMaxZ(Float_t x); | |
158 | void SetMaxOrbs(Float_t x); | |
159 | void SetMinAng(Float_t x); | |
160 | void SetDelta(Float_t x); | |
5a5a1232 | 161 | |
48dc973d | 162 | Float_t GetMagField() const { return fMagField; } |
163 | void SetMagField(Float_t mf) { fMagField = mf; } | |
164 | ||
17038a14 | 165 | static Float_t fgDefMagField; // Default value for constant solenoid magnetic field. |
166 | static const Float_t fgkB2C; // Constant for conversion of momentum to curvature. | |
167 | static TrackRnrStyle fgDefStyle; // Default track render-style. | |
5a5a1232 | 168 | |
17038a14 | 169 | ClassDef(TrackRnrStyle, 1); // Rendering parameters for tracks. |
5a5a1232 | 170 | }; // endclass TrackRnrStyle |
171 | ||
172 | ||
173 | /**************************************************************************/ | |
174 | // TrackList | |
175 | /**************************************************************************/ | |
176 | ||
32e219c2 | 177 | class TrackList : public RenderElementList, |
178 | public NLTProjectable, | |
179 | public TAttMarker, | |
180 | public TAttLine | |
5a5a1232 | 181 | { |
32e219c2 | 182 | friend class TrackListEditor; |
265ecb21 | 183 | |
5a5a1232 | 184 | private: |
32e219c2 | 185 | TrackList(const TrackList&); // Not implemented |
186 | TrackList& operator=(const TrackList&); // Not implemented | |
17038a14 | 187 | |
188 | Bool_t fRecurse; // Recurse when propagating marker/line attributes to tracks. | |
5a5a1232 | 189 | |
190 | protected: | |
17038a14 | 191 | TrackRnrStyle* fRnrStyle; // Basic track rendering parameters, not enforced to elements. |
5a5a1232 | 192 | |
17038a14 | 193 | Bool_t fRnrLine; // Render track as line. |
194 | Bool_t fRnrPoints; // Render track as points. | |
915b2ab7 | 195 | |
17038a14 | 196 | Float_t fMinPt; // Minimum track pT for display selection. |
197 | Float_t fMaxPt; // Maximum track pT for display selection. | |
198 | Float_t fLimPt; // Highest track pT in the container. | |
199 | Float_t fMinP; // Minimum track p for display selection. | |
200 | Float_t fMaxP; // Maximum track p for display selection. | |
201 | Float_t fLimP; // Highest track p in the container. | |
915b2ab7 | 202 | |
32e219c2 | 203 | Float_t RoundMomentumLimit(Float_t x); |
915b2ab7 | 204 | |
32e219c2 | 205 | public: |
206 | TrackList(TrackRnrStyle* rs=0); | |
207 | TrackList(const Text_t* name, TrackRnrStyle* rs=0); | |
208 | virtual ~TrackList(); | |
915b2ab7 | 209 | |
32e219c2 | 210 | void MakeTracks(Bool_t recurse=kTRUE); |
211 | void FindMomentumLimits(RenderElement* el, Bool_t recurse); | |
5a5a1232 | 212 | |
32e219c2 | 213 | void SetRnrStyle(TrackRnrStyle* rs); |
214 | TrackRnrStyle* GetRnrStyle(){return fRnrStyle;} | |
5a5a1232 | 215 | |
32e219c2 | 216 | //-------------------------------- |
5a5a1232 | 217 | |
32e219c2 | 218 | virtual void SetMainColor(Color_t c); |
219 | virtual void SetLineColor(Color_t c){SetMainColor(c);} | |
220 | virtual void SetLineColor(Color_t c, RenderElement* el); | |
221 | virtual void SetLineWidth(Width_t w); | |
222 | virtual void SetLineWidth(Width_t w, RenderElement* el); | |
223 | virtual void SetLineStyle(Style_t s); | |
224 | virtual void SetLineStyle(Style_t s, RenderElement* el); | |
225 | ||
226 | virtual void SetMarkerColor(Color_t c); | |
227 | virtual void SetMarkerColor(Color_t c, RenderElement* el); | |
228 | virtual void SetMarkerSize(Size_t s); | |
229 | virtual void SetMarkerSize(Size_t s, RenderElement* el); | |
230 | virtual void SetMarkerStyle(Style_t s); | |
231 | virtual void SetMarkerStyle(Style_t s, RenderElement* el); | |
232 | ||
233 | void SetRnrLine(Bool_t rnr); | |
234 | void SetRnrLine(Bool_t rnr, RenderElement* el); | |
235 | Bool_t GetRnrLine(){return fRnrLine;} | |
236 | ||
237 | void SetRnrPoints(Bool_t r); | |
238 | void SetRnrPoints(Bool_t r, RenderElement* el); | |
239 | Bool_t GetRnrPoints(){return fRnrPoints;} | |
240 | ||
241 | void SelectByPt(Float_t min_pt, Float_t max_pt); | |
242 | void SelectByPt(Float_t min_pt, Float_t max_pt, RenderElement* el); | |
243 | void SelectByP (Float_t min_p, Float_t max_p); | |
244 | void SelectByP (Float_t min_p, Float_t max_p, RenderElement* el); | |
5a5a1232 | 245 | |
b99aed53 | 246 | //-------------------------------- |
247 | ||
17038a14 | 248 | Track* FindTrackByLabel(Int_t label); // *MENU* |
249 | Track* FindTrackByIndex(Int_t index); // *MENU* | |
250 | ||
b99aed53 | 251 | void ImportHits(); // *MENU* |
252 | void ImportClusters(); // *MENU* | |
5a5a1232 | 253 | |
32e219c2 | 254 | virtual TClass* ProjectedClass() const; |
255 | ||
17038a14 | 256 | ClassDef(TrackList, 1); // A list of tracks. |
5a5a1232 | 257 | }; |
258 | ||
17038a14 | 259 | |
9c39ede9 | 260 | /**************************************************************************/ |
261 | // TrackCounter | |
262 | /**************************************************************************/ | |
263 | ||
264 | class TrackCounter : public RenderElement, public TNamed | |
265 | { | |
266 | friend class TrackCounterEditor; | |
267 | ||
268 | public: | |
269 | enum ClickAction_e { CA_PrintTrackInfo, CA_ToggleTrack }; | |
270 | ||
271 | private: | |
272 | TrackCounter(const TrackCounter&); // Not implemented | |
273 | TrackCounter& operator=(const TrackCounter&); // Not implemented | |
274 | ||
275 | protected: | |
e9ef1a49 | 276 | Int_t fBadLineStyle; // Line-style used for secondary/bad tracks. |
277 | Int_t fClickAction; // Action to take when a track is ctrl-clicked. | |
9c39ede9 | 278 | |
e9ef1a49 | 279 | Int_t fEventId; // Current event-id. |
7af62191 | 280 | |
e9ef1a49 | 281 | Int_t fAllTracks; // Counter of all tracks. |
282 | Int_t fGoodTracks; // Counter of good tracks. | |
9c39ede9 | 283 | |
e9ef1a49 | 284 | TList fTrackLists; // List of TrackLists registered for management. |
9c39ede9 | 285 | |
286 | public: | |
287 | TrackCounter(const Text_t* name="TrackCounter", const Text_t* title=""); | |
288 | virtual ~TrackCounter(); | |
289 | ||
7af62191 | 290 | Int_t GetEventId() const { return fEventId; } |
291 | void SetEventId(Int_t id) { fEventId = id; } | |
292 | ||
9c39ede9 | 293 | void Reset(); |
294 | ||
295 | void RegisterTracks(TrackList* tlist, Bool_t goodTracks); | |
296 | ||
297 | void DoTrackAction(Track* track); | |
298 | ||
299 | Int_t GetClickAction() const { return fClickAction; } | |
300 | void SetClickAction(Int_t a) { fClickAction = a; } | |
301 | ||
7af62191 | 302 | void OutputEventTracks(FILE* out=0); |
303 | ||
b1f08706 | 304 | static TrackCounter* fgInstance; |
305 | ||
9c39ede9 | 306 | ClassDef(TrackCounter, 1); |
307 | }; // endclass TrackCounter | |
308 | ||
5a5a1232 | 309 | |
310 | } // namespace Reve | |
311 | ||
312 | #endif |