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