forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TEveTrack.h
230 lines (173 loc) · 8.78 KB
/
TEveTrack.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// @(#)root/eve:$Id$
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TEveTrack
#define ROOT_TEveTrack
#include <vector>
#include "TEveVector.h"
#include "TEvePathMark.h"
#include "TEveVSDStructs.h"
#include "TEveElement.h"
#include "TEveLine.h"
#include "TPolyMarker3D.h"
#include "TMarker.h"
class TEveTrackPropagator;
class TEveTrackList;
class TEveMCTrack;
class TParticle;
class TEveTrack : public TEveLine
{
friend class TEveTrackPropagator;
friend class TEveTrackList;
friend class TEveTrackGL;
private:
TEveTrack& operator=(const TEveTrack&); // Not implemented
public:
typedef std::vector<TEvePathMarkD> vPathMark_t;
typedef vPathMark_t::iterator vPathMark_i;
typedef vPathMark_t::const_iterator vPathMark_ci;
// Deprecated -- to be removed.
enum EBreakProjectedTracks_e { kBPTDefault, kBPTAlways, kBPTNever };
protected:
TEveVectorD fV; // Starting vertex
TEveVectorD fP; // Starting momentum
TEveVectorD fPEnd; // Momentum at the last point of extrapolation
Double_t fBeta; // Relativistic beta factor
Double_t fDpDs; // Momentum loss over distance
Int_t fPdg; // PDG code
Int_t fCharge; // Charge in units of e0
Int_t fLabel; // Simulation label
Int_t fIndex; // Reconstruction index
Int_t fStatus; // Status-word, user-defined.
Bool_t fLockPoints; // Lock points that are currently in - do nothing in MakeTrack().
vPathMark_t fPathMarks; // TEveVector of known points along the track
Int_t fLastPMIdx; //!Last path-mark index tried in track-propagation.
TEveTrackPropagator *fPropagator; // Pointer to shared render-style
public:
TEveTrack();
TEveTrack(TParticle* t, Int_t label, TEveTrackPropagator* prop=nullptr);
TEveTrack(TEveMCTrack* t, TEveTrackPropagator* prop=nullptr);
TEveTrack(TEveRecTrack* t, TEveTrackPropagator* prop=nullptr);
TEveTrack(TEveRecTrackD* t, TEveTrackPropagator* prop=nullptr);
TEveTrack(const TEveTrack& t);
~TEveTrack() override;
void ComputeBBox() override;
virtual void SetStdTitle();
virtual void SetTrackParams(const TEveTrack& t);
virtual void SetPathMarks (const TEveTrack& t);
virtual void MakeTrack(Bool_t recurse=kTRUE);
TEveTrackPropagator* GetPropagator() const { return fPropagator; }
Int_t GetLastPMIdx() const { return fLastPMIdx; }
void SetPropagator(TEveTrackPropagator* prop);
void SetAttLineAttMarker(TEveTrackList* tl);
const TEveVectorD& GetVertex() const { return fV; }
const TEveVectorD& GetMomentum() const { return fP; }
const TEveVectorD& GetEndMomentum() const { return fPEnd; }
Double_t GetDpDs() const { return fDpDs; }
void SetDpDs(Double_t dpds) { fDpDs = dpds; }
Int_t GetPdg() const { return fPdg; }
void SetPdg(Int_t pdg) { fPdg = pdg; }
Int_t GetCharge() const { return fCharge; }
void SetCharge(Int_t chg) { fCharge = chg; }
Int_t GetLabel() const { return fLabel; }
void SetLabel(Int_t lbl) { fLabel = lbl; }
Int_t GetIndex() const { return fIndex; }
void SetIndex(Int_t idx) { fIndex = idx; }
Int_t GetStatus() const { return fStatus; }
void SetStatus(Int_t idx) { fStatus = idx; }
void AddPathMark(const TEvePathMarkD& pm) { fPathMarks.push_back(pm); }
void AddPathMark(const TEvePathMark& pm) { fPathMarks.push_back(pm); }
void SortPathMarksByTime();
vPathMark_t& RefPathMarks() { return fPathMarks; }
const vPathMark_t& RefPathMarks() const { return fPathMarks; }
void PrintPathMarks(); // *MENU*
void SetLockPoints(Bool_t l) { fLockPoints = l; }
Bool_t GetLockPoints() const { return fLockPoints; }
//-------------------------------------------------------------------
virtual void SecSelected(TEveTrack*); // *SIGNAL*
const TGPicture* GetListTreeIcon(Bool_t open=kFALSE) override;
void CopyVizParams(const TEveElement* el) override;
void WriteVizParams(std::ostream& out, const TString& var) override;
TClass* ProjectedClass(const TEveProjection* p) const override;
ClassDefOverride(TEveTrack, 0); // Track with given vertex, momentum and optional referece-points (path-marks) along its path.
};
/******************************************************************************/
// TEveTrackList
/******************************************************************************/
class TEveTrackList : public TEveElementList,
public TAttMarker,
public TAttLine
{
friend class TEveTrackListEditor;
private:
TEveTrackList(const TEveTrackList&); // Not implemented
TEveTrackList& operator=(const TEveTrackList&); // Not implemented
protected:
TEveTrackPropagator* fPropagator; // Basic track rendering parameters, not enforced to elements.
Bool_t fRecurse; // Recurse when propagating marker/line/etc attributes to tracks.
Bool_t fRnrLine; // Render track as line.
Bool_t fRnrPoints; // Render track as points.
Double_t fMinPt; // Minimum track pTfor display selection.
Double_t fMaxPt; // Maximum track pTfor display selection.
Double_t fLimPt; // Highest track pT in the container.
Double_t fMinP; // Minimum track pfor display selection.
Double_t fMaxP; // Maximum track pfor display selection.
Double_t fLimP; // Highest track p in the container.
void FindMomentumLimits(TEveElement* el, Bool_t recurse=kTRUE);
Double_t RoundMomentumLimit(Double_t x);
void SanitizeMinMaxCuts();
public:
TEveTrackList(TEveTrackPropagator* prop=nullptr);
TEveTrackList(const char* name, TEveTrackPropagator* prop=nullptr);
~TEveTrackList() override;
void MakeTracks(Bool_t recurse=kTRUE);
void FindMomentumLimits(Bool_t recurse=kTRUE);
void SetPropagator(TEveTrackPropagator* prop);
TEveTrackPropagator* GetPropagator() { return fPropagator; }
Bool_t GetRecurse() const { return fRecurse; }
void SetRecurse(Bool_t x) { fRecurse = x; }
//--------------------------------
void SetMainColor(Color_t c) override;
void SetLineColor(Color_t c) override { SetMainColor(c); }
virtual void SetLineColor(Color_t c, TEveElement* el);
void SetLineWidth(Width_t w) override;
virtual void SetLineWidth(Width_t w, TEveElement* el);
void SetLineStyle(Style_t s) override;
virtual void SetLineStyle(Style_t s, TEveElement* el);
void SetMarkerColor(Color_t c) override;
virtual void SetMarkerColor(Color_t c, TEveElement* el);
void SetMarkerSize(Size_t s) override;
virtual void SetMarkerSize(Size_t s, TEveElement* el);
void SetMarkerStyle(Style_t s) override;
virtual void SetMarkerStyle(Style_t s, TEveElement* el);
void SetRnrLine(Bool_t rnr);
void SetRnrLine(Bool_t rnr, TEveElement* el);
Bool_t GetRnrLine() const { return fRnrLine; }
void SetRnrPoints(Bool_t r);
void SetRnrPoints(Bool_t r, TEveElement* el);
Bool_t GetRnrPoints() const { return fRnrPoints; }
void SelectByPt(Double_t min_pt, Double_t max_pt);
void SelectByPt(Double_t min_pt, Double_t max_pt, TEveElement* el);
void SelectByP (Double_t min_p, Double_t max_p);
void SelectByP (Double_t min_p, Double_t max_p, TEveElement* el);
Double_t GetMinPt() const { return fMinPt; }
Double_t GetMaxPt() const { return fMaxPt; }
Double_t GetLimPt() const { return fLimPt; }
Double_t GetMinP() const { return fMinP; }
Double_t GetMaxP() const { return fMaxP; }
Double_t GetLimP() const { return fLimP; }
//-------------------------------------------------------------------
TEveTrack* FindTrackByLabel(Int_t label); // *MENU*
TEveTrack* FindTrackByIndex(Int_t index); // *MENU*
void CopyVizParams(const TEveElement* el) override;
void WriteVizParams(std::ostream& out, const TString& var) override;
TClass* ProjectedClass(const TEveProjection* p) const override;
ClassDefOverride(TEveTrackList, 0); // A list of tracks supporting change of common attributes and selection based on track parameters.
};
#endif