Logo ROOT  
Reference Guide
REveTrack.hxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT7_REveTrack
13#define ROOT7_REveTrack
14
15#include <vector>
16
17#include <ROOT/REveVector.hxx>
18#include <ROOT/REvePathMark.hxx>
19#include <ROOT/REveElement.hxx>
20#include <ROOT/REveLine.hxx>
22
23#include "TPolyMarker3D.h"
24#include "TMarker.h"
25
26class TParticle;
27
28namespace ROOT {
29namespace Experimental {
30
32class REveTrackList;
33
34////////////////////////////////////////////////////////////////////////////////
35/// REveTrack
36/// Track with given vertex, momentum and optional referece-points (path-marks) along its path.
37////////////////////////////////////////////////////////////////////////////////
38
39class REveTrack : public REveLine
40{
41 friend class REveTrackPropagator;
42 friend class REveTrackList;
43
44private:
45 REveTrack &operator=(const REveTrack &) = delete;
46
47public:
48 typedef std::vector<REvePathMarkD> vPathMark_t;
49
50 // Deprecated -- to be removed.
52
53protected:
54 REveVectorD fV; // Starting vertex
55 REveVectorD fP; // Starting momentum
56 REveVectorD fPEnd; // Momentum at the last point of extrapolation
57 Double_t fBeta; // Relativistic beta factor
58 Double_t fDpDs; // Momentum loss over distance
59 Int_t fPdg; // PDG code
60 Int_t fCharge; // Charge in units of e0
61 Int_t fLabel; // Simulation label
62 Int_t fIndex; // Reconstruction index
63 Int_t fStatus; // Status-word, user-defined.
64 Bool_t fLockPoints; // Lock points that are currently in - do nothing in MakeTrack().
65 vPathMark_t fPathMarks; // REveVector of known points along the track
66 Int_t fLastPMIdx; //! Last path-mark index tried in track-propagation.
67
68 REveTrackPropagator *fPropagator{nullptr}; // Pointer to shared render-style
69
70public:
71 REveTrack();
72 REveTrack(TParticle *t, Int_t label, REveTrackPropagator *prop = nullptr);
73 // VSD inputs
77 REveTrack(const REveTrack &t);
78 virtual ~REveTrack();
79
80 void ComputeBBox() override;
81
82 virtual void SetStdTitle();
83
84 virtual void SetTrackParams(const REveTrack &t);
85 virtual void SetPathMarks(const REveTrack &t);
86
87 virtual void MakeTrack(Bool_t recurse = kTRUE);
88
90 Int_t GetLastPMIdx() const { return fLastPMIdx; }
93
94 const REveVectorD &GetVertex() const { return fV; }
95 const REveVectorD &GetMomentum() const { return fP; }
96 const REveVectorD &GetEndMomentum() const { return fPEnd; }
97
98 Double_t GetDpDs() const { return fDpDs; }
99 void SetDpDs(Double_t dpds) { fDpDs = dpds; }
100
101 Int_t GetPdg() const { return fPdg; }
102 void SetPdg(Int_t pdg) { fPdg = pdg; }
103 Int_t GetCharge() const { return fCharge; }
104 void SetCharge(Int_t chg) { fCharge = chg; }
105 Int_t GetLabel() const { return fLabel; }
106 void SetLabel(Int_t lbl) { fLabel = lbl; }
107 Int_t GetIndex() const { return fIndex; }
108 void SetIndex(Int_t idx) { fIndex = idx; }
109 Int_t GetStatus() const { return fStatus; }
110 void SetStatus(Int_t idx) { fStatus = idx; }
111
112 void AddPathMark(const REvePathMarkD &pm) { fPathMarks.push_back(pm); }
113 void AddPathMark(const REvePathMark &pm) { fPathMarks.push_back(pm); }
114
115 void SortPathMarksByTime();
117 const vPathMark_t &RefPathMarks() const { return fPathMarks; }
118
119 void PrintPathMarks(); // *MENU*
120
122 Bool_t GetLockPoints() const { return fLockPoints; }
123
124 //-------------------------------------------------------------------
125
126 virtual void SecSelected(REveTrack *); // *SIGNAL*
127
128 void CopyVizParams(const REveElement *el) override;
129 void WriteVizParams(std::ostream &out, const TString &var) override;
130
131 TClass *ProjectedClass(const REveProjection *p) const override;
132
133 Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
134 void BuildRenderData() override;
135};
136
137////////////////////////////////////////////////////////////////////////////////
138/// REveTrackList
139/// A list of tracks supporting change of common attributes and selection based on track parameters.
140////////////////////////////////////////////////////////////////////////////////
141
143 public REveProjectable,
144 public TAttMarker,
145 public TAttLine
146{
147private:
148 REveTrackList(const REveTrackList &) = delete;
150
151protected:
152 REveTrackPropagator *fPropagator{nullptr}; // Basic track rendering parameters, not enforced to elements.
153
154 Bool_t fRecurse; // Recurse when propagating marker/line/etc attributes to tracks.
155
156 Bool_t fRnrLine; // Render track as line.
157 Bool_t fRnrPoints; // Render track as points.
158
159 Double_t fMinPt; // Minimum track pTfor display selection.
160 Double_t fMaxPt; // Maximum track pTfor display selection.
161 Double_t fLimPt; // Highest track pT in the container.
162 Double_t fMinP; // Minimum track pfor display selection.
163 Double_t fMaxP; // Maximum track pfor display selection.
164 Double_t fLimP; // Highest track p in the container.
165
166 void FindMomentumLimits(REveElement *el, Bool_t recurse = kTRUE);
168 void SanitizeMinMaxCuts();
169
170public:
172 REveTrackList(const std::string &name, REveTrackPropagator *prop = nullptr);
173 virtual ~REveTrackList();
174
175 void MakeTracks(Bool_t recurse = kTRUE);
176 void FindMomentumLimits(Bool_t recurse = kTRUE);
177
180
181 Bool_t GetRecurse() const { return fRecurse; }
183
184 //--------------------------------
185
186 void SetMainColor(Color_t c) override;
187 void SetLineColor(Color_t c) override { SetMainColor(c); }
188 virtual void SetLineColor(Color_t c, REveElement *el);
189 void SetLineWidth(Width_t w) override;
190 virtual void SetLineWidth(Width_t w, REveElement *el);
191 void SetLineStyle(Style_t s) override;
192 virtual void SetLineStyle(Style_t s, REveElement *el);
193
194 void SetMarkerColor(Color_t c) override;
195 virtual void SetMarkerColor(Color_t c, REveElement *el);
196 void SetMarkerSize(Size_t s) override;
197 virtual void SetMarkerSize(Size_t s, REveElement *el);
198 void SetMarkerStyle(Style_t s) override;
199 virtual void SetMarkerStyle(Style_t s, REveElement *el);
200
201 void SetRnrLine(Bool_t rnr);
202 void SetRnrLine(Bool_t rnr, REveElement *el);
203 Bool_t GetRnrLine() const { return fRnrLine; }
204
205 void SetRnrPoints(Bool_t r);
206 void SetRnrPoints(Bool_t r, REveElement *el);
207 Bool_t GetRnrPoints() const { return fRnrPoints; }
208
209 void SelectByPt(Double_t min_pt, Double_t max_pt);
210 void SelectByPt(Double_t min_pt, Double_t max_pt, REveElement *el);
211 void SelectByP(Double_t min_p, Double_t max_p);
212 void SelectByP(Double_t min_p, Double_t max_p, REveElement *el);
213
214 Double_t GetMinPt() const { return fMinPt; }
215 Double_t GetMaxPt() const { return fMaxPt; }
216 Double_t GetLimPt() const { return fLimPt; }
217 Double_t GetMinP() const { return fMinP; }
218 Double_t GetMaxP() const { return fMaxP; }
219 Double_t GetLimP() const { return fLimP; }
220
221 //-------------------------------------------------------------------
222
223 REveTrack *FindTrackByLabel(Int_t label); // *MENU*
225
226 void CopyVizParams(const REveElement *el) override;
227 void WriteVizParams(std::ostream &out, const TString &var) override;
228
229 TClass *ProjectedClass(const REveProjection *p) const override;
230};
231
232} // namespace Experimental
233} // namespace ROOT
234
235#endif
#define c(i)
Definition: RSha256.hxx:101
short Style_t
Definition: RtypesCore.h:89
bool Bool_t
Definition: RtypesCore.h:63
short Color_t
Definition: RtypesCore.h:92
float Size_t
Definition: RtypesCore.h:96
short Width_t
Definition: RtypesCore.h:91
const Bool_t kTRUE
Definition: RtypesCore.h:100
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
char name[80]
Definition: TGX11.cxx:110
A list of tracks supporting change of common attributes and selection based on track parameters.
Holding structure for a number of track rendering parameters.
REveLine An arbitrary polyline with fixed line and marker attributes.
Definition: REveLine.hxx:30
Special-point on track:
REveProjection Base for specific classes that implement non-linear projections.
REveTrackList A list of tracks supporting change of common attributes and selection based on track pa...
Definition: REveTrack.hxx:146
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
Definition: REveTrack.cxx:1090
void SetRnrLine(Bool_t rnr)
Set rendering of track as line for the list and the elements.
Definition: REveTrack.cxx:730
REveTrackList & operator=(const REveTrackList &)=delete
void SetRnrPoints(Bool_t r)
Set rendering of track as points for the list and the elements.
Definition: REveTrack.cxx:759
void MakeTracks(Bool_t recurse=kTRUE)
Regenerate the visual representations of tracks.
Definition: REveTrack.cxx:635
REveTrackPropagator * fPropagator
Definition: REveTrack.hxx:152
void SetMarkerSize(Size_t s) override
Set marker size for the list and the elements.
Definition: REveTrack.cxx:934
REveTrackList(const REveTrackList &)=delete
TClass * ProjectedClass(const REveProjection *p) const override
Virtual from REveProjectable, returns REveTrackListProjected class.
Definition: REveTrack.cxx:1136
REveTrack * FindTrackByLabel(Int_t label)
Find track by label, select it and display it in the editor.
Definition: REveTrack.cxx:1047
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
Definition: REveTrack.cxx:1114
Double_t RoundMomentumLimit(Double_t x)
Round the momentum limit up to a nice value.
Definition: REveTrack.cxx:706
void SelectByP(Double_t min_p, Double_t max_p)
Select visibility of tracks by momentum.
Definition: REveTrack.cxx:1007
void SelectByPt(Double_t min_pt, Double_t max_pt)
Select visibility of tracks by transverse momentum.
Definition: REveTrack.cxx:965
void SetLineWidth(Width_t w) override
Set line width for the list and the elements.
Definition: REveTrack.cxx:818
void SanitizeMinMaxCuts()
Set Min/Max cuts so that they are within detected limits.
Definition: REveTrack.cxx:719
REveTrack * FindTrackByIndex(Int_t index)
Find track by index, select it and display it in the editor.
Definition: REveTrack.cxx:1069
void SetMainColor(Color_t c) override
Set main (line) color for the list and the elements.
Definition: REveTrack.cxx:789
virtual ~REveTrackList()
Destructor.
Definition: REveTrack.cxx:613
void SetPropagator(REveTrackPropagator *prop)
Set default propagator for tracks.
Definition: REveTrack.cxx:623
void SetLineStyle(Style_t s) override
Set line style for the list and the elements.
Definition: REveTrack.cxx:847
void SetMarkerColor(Color_t c) override
Set marker color for the list and the elements.
Definition: REveTrack.cxx:905
void SetLineColor(Color_t c) override
Set the line color.
Definition: REveTrack.hxx:187
REveTrackPropagator * GetPropagator()
Definition: REveTrack.hxx:179
void FindMomentumLimits(REveElement *el, Bool_t recurse=kTRUE)
Loop over track elements of argument el and find highest pT and p.
Definition: REveTrack.cxx:690
void SetMarkerStyle(Style_t s) override
Set marker style for the list and the elements.
Definition: REveTrack.cxx:876
REveTrackPropagator Calculates path of a particle taking into account special path-marks and imposed ...
REveTrack Track with given vertex, momentum and optional referece-points (path-marks) along its path.
Definition: REveTrack.hxx:40
Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition: REveTrack.cxx:526
virtual ~REveTrack()
Destructor.
Definition: REveTrack.cxx:215
virtual void SecSelected(REveTrack *)
Emits "SecSelected(REveTrack*)" signal.
Definition: REveTrack.cxx:544
void AddPathMark(const REvePathMarkD &pm)
Definition: REveTrack.hxx:112
REveTrackPropagator * fPropagator
Last path-mark index tried in track-propagation.
Definition: REveTrack.hxx:68
void SetAttLineAttMarker(REveTrackList *tl)
Set line and marker attributes from REveTrackList.
Definition: REveTrack.cxx:302
virtual void SetTrackParams(const REveTrack &t)
Copy track parameters from t.
Definition: REveTrack.cxx:264
vPathMark_t & RefPathMarks()
Definition: REveTrack.hxx:116
void SetDpDs(Double_t dpds)
Definition: REveTrack.hxx:99
virtual void MakeTrack(Bool_t recurse=kTRUE)
Calculate track representation based on track data and current settings of the propagator.
Definition: REveTrack.cxx:320
const REveVectorD & GetVertex() const
Definition: REveTrack.hxx:94
const vPathMark_t & RefPathMarks() const
Definition: REveTrack.hxx:117
const REveVectorD & GetEndMomentum() const
Definition: REveTrack.hxx:96
REveTrack()
Default constructor.
Definition: REveTrack.cxx:42
TClass * ProjectedClass(const REveProjection *p) const override
Virtual from REveProjectable, return REveTrackProjected class.
Definition: REveTrack.cxx:480
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
Definition: REveTrack.cxx:470
virtual void SetPathMarks(const REveTrack &t)
Copy path-marks from t.
Definition: REveTrack.cxx:281
void SetPropagator(REveTrackPropagator *prop)
Set track's propagator.
Definition: REveTrack.cxx:291
void AddPathMark(const REvePathMark &pm)
Definition: REveTrack.hxx:113
void PrintPathMarks()
Print registered path-marks.
Definition: REveTrack.cxx:505
const REveVectorD & GetMomentum() const
Definition: REveTrack.hxx:95
REveTrack & operator=(const REveTrack &)=delete
void BuildRenderData() override
Crates 3D point array for rendering.
Definition: REveTrack.cxx:535
void ComputeBBox() override
Compute the bounding box of the track.
Definition: REveTrack.cxx:223
virtual void SetStdTitle()
Set standard track title based on most data-member values.
Definition: REveTrack.cxx:248
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
Definition: REveTrack.cxx:456
void SortPathMarksByTime()
Sort registered pat-marks by time.
Definition: REveTrack.cxx:497
REveTrackPropagator * GetPropagator() const
Definition: REveTrack.hxx:89
Double_t GetDpDs() const
Definition: REveTrack.hxx:98
std::vector< REvePathMarkD > vPathMark_t
Definition: REveTrack.hxx:48
Line Attributes class.
Definition: TAttLine.h:18
Marker Attributes class.
Definition: TAttMarker.h:19
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:81
Description of the dynamic properties of a particle.
Definition: TParticle.h:26
Basic string class.
Definition: TString.h:136
Double_t x[n]
Definition: legend1.C:17
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
static constexpr double s
basic_json<> json
Definition: REveElement.hxx:62
TLine l
Definition: textangle.C:4