Track.h
Go to the documentation of this file.
1 /**
2  * @file lardataobj/RecoBase/Track.h
3  * @brief Provides `recob::Track` data product.
4  * @author Brian Rebel (brebel@fnal.gov)
5  * @ingroup DataProductRecoBase
6  * @see lardataobj/RecoBase/Track.cxx
7  */
8 
9 #ifndef LARDATAOBJ_RECOBASE_TRACK_H
10 #define LARDATAOBJ_RECOBASE_TRACK_H
11 
15 
16 #include <iosfwd>
17 #include <stddef.h>
18 
19 namespace recob {
20 
21  /**
22  * @brief Track from a non-cascading particle.
23  * @ingroup DataProductRecoBase
24  *
25  * A `recob::Track` consists of a `recob::TrackTrajectory`, plus additional members relevant for a "fitted" track:
26  *
27  * * fit &chi;&sup2;
28  * * number of degrees of freedom
29  * * particle ID hypothesis used in the fit (if any)
30  * * covariance matrices at start (vertex) and end positions.
31  *
32  * Please refer to the `recob::TrackTrajectory` documentation for more information about it;
33  * for a discussion on the object type for coordinates see recob::tracking::Coord_t.
34  *
35  * In terms of interface, `recob::Track` extends `recob::TrackTrajectory`, so that methods of the stored `recob::TrackTrajectory` can be called directly from the `recob::Track interface`,
36  * e.g.:
37  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
38  * size_t NumberTrajectoryPoints() const { return fTraj.NumberTrajectoryPoints(); }
39  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40  *
41  * Two different parameter conventions are used in a `recob::Track`, and functions to convert from one to the other are provided:
42  *
43  * 1. Trajectory points and momenta (or directions) are in form of 3-vectors, corresponding to a global Cartesian 6D representation
44  * 2. Covariance matrices are stored in a Local 5D representation (so that the covariance matrix is invertible),
45  * where the parameters are defined on the plane orthogonal to the track direction at a given track point.
46  * By construction the local parameters of the track itself are (0,0,0,0,1/p).
47  * See `lardataobj/RecoBase/TrackingPlane.h` for more information.
48  */
49  class Track {
50 
51  public:
52 
59 
66 
69 
70  protected:
71 
72  TrackTrajectory fTraj; ///< Stored trajectory data member
73  int fPId = 0; ///< Particle ID hypothesis used in the fit (if any)
74  float fChi2 = -1.; ///< Fit chi2
75  int fNdof = 0.; ///< Number of degrees of freedom of the fit
76  SMatrixSym55 fCovVertex; ///< Covariance matrix (local 5D representation) at start point (vertex)
77  SMatrixSym55 fCovEnd; ///< Covariance matrix (local 5D representation) at end point
78  int fID = -1; ///< track's ID
79 
80  public:
81 
82  //Default constructor
83  Track() = default;
84 
85  Track(TrackTrajectory const& Traj,
86  int PId, float Chi2, int Ndof, SMatrixSym55 const& CovVertex, SMatrixSym55 const& CovEnd, int tkID)
87  : fTraj(Traj), fPId(PId), fChi2(Chi2), fNdof(Ndof), fCovVertex(CovVertex), fCovEnd(CovEnd),fID(tkID) { };
88 
90  int PId, float Chi2, int Ndof, SMatrixSym55&& CovVertex, SMatrixSym55&& CovEnd, int tkID)
91  : fTraj(std::move(Traj)), fPId(PId), fChi2(Chi2), fNdof(Ndof), fCovVertex(std::move(CovVertex)), fCovEnd(std::move(CovEnd)),fID(tkID) { };
92 
93  Track(Positions_t&& positions, Momenta_t&& momenta, Flags_t&& flags, bool hasMomenta,
94  int PId, float Chi2, int Ndof, SMatrixSym55&& CovVertex, SMatrixSym55&& CovEnd, int tkID)
95  : fTraj(std::move(positions),std::move(momenta),std::move(flags),hasMomenta), fPId(PId), fChi2(Chi2), fNdof(Ndof), fCovVertex(std::move(CovVertex)), fCovEnd(std::move(CovEnd)),fID(tkID) { };
96 
97  /// Access to the stored recob::TrackTrajectory
98  inline const recob::TrackTrajectory& Trajectory() const { return fTraj; }
99 
100  //@{
101  /// Various functions related to the presence and the number of (valid) points
102  inline size_t NumberTrajectoryPoints() const { return fTraj.NumberTrajectoryPoints(); }
103  inline size_t NPoints() const { return fTraj.NPoints(); }
104  inline size_t FirstPoint() const { return fTraj.FirstPoint(); }
105  inline size_t LastPoint() const { return fTraj.LastPoint(); }
106  inline size_t FirstValidPoint() const { return fTraj.FirstValidPoint(); }
107  inline size_t NextValidPoint(size_t index) const { return fTraj.NextValidPoint(index); }
108  inline size_t PreviousValidPoint(size_t index) const { return fTraj.PreviousValidPoint(index); }
109  inline size_t LastValidPoint() const { return fTraj.LastValidPoint(); }
110  inline bool HasPoint(size_t i) const { return fTraj.HasPoint(i); }
111  inline bool HasValidPoint(size_t i) const { return fTraj.HasValidPoint(i); }
112  inline unsigned int CountValidPoints() const { return fTraj.CountValidPoints(); }
113  //@}
114 
115  //@{
116  /// Access to i-th TrajectoryPoint or its Flags
117  inline TrajectoryPoint_t TrajectoryPoint(size_t i) const { return fTraj.TrajectoryPoint(i); }
118  inline PointFlags_t const& FlagsAtPoint(size_t i) const { return fTraj.FlagsAtPoint(i); }
119  //@}
120 
121  //@{
122  /// Access to track position at different points
123  inline Point_t const& Start() const { return fTraj.Start(); }
124  inline Point_t const& Vertex() const { return fTraj.Vertex(); }
125  inline Point_t const& End() const { return fTraj.End(); }
126  inline Point_t const& LocationAtPoint(size_t i) const { return fTraj.LocationAtPoint(i); }
127  //@}
128 
129  //@{
130  /// Access to track direction at different points
131  inline Vector_t StartDirection() const { return fTraj.StartDirection(); }
132  inline Vector_t VertexDirection() const { return fTraj.VertexDirection(); }
133  inline Vector_t EndDirection() const { return fTraj.EndDirection(); }
134  inline Vector_t DirectionAtPoint(size_t i) const { return fTraj.DirectionAtPoint(i); }
135  //@}
136 
137  //@{
138  /// Access to track momentum at different points.
139  /// The user must check that HasMomentum() returns true to ensure the validity of the result of these functions.
140  inline bool HasMomentum() const { return fTraj.HasMomentum(); }
141  inline double MomentumAtPoint(unsigned int p) const { return fTraj.MomentumAtPoint(p); }
142  inline double VertexMomentum() const { return fTraj.VertexMomentum(); }
143  inline double StartMomentum() const { return fTraj.StartMomentum(); }
144  inline double EndMomentum() const { return fTraj.EndMomentum(); }
145  inline Vector_t const& VertexMomentumVector() const { return fTraj.VertexMomentumVector() ; }
146  inline Vector_t const& StartMomentumVector() const { return fTraj.StartMomentumVector(); }
147  inline Vector_t const& EndMomentumVector() const { return fTraj.EndMomentumVector(); }
148  inline Vector_t const& MomentumVectorAtPoint(size_t i) const { return fTraj.MomentumVectorAtPoint(i); }
149  //@}
150 
151  //@{
152  /// Access to covariance matrices
153  const SMatrixSym55& StartCovariance() const { return fCovVertex; }
154  const SMatrixSym55& VertexCovariance() const { return fCovVertex; }
155  const SMatrixSym55& EndCovariance() const { return fCovEnd; }
156  //@}
157 
158  //@{
159  /// Access to position, momentum or covariance at the start and end of the track
160  inline std::pair<Point_t, Point_t> Extent() const { return fTraj.Extent(); }
161  inline std::pair<Vector_t, Vector_t> Direction() const { return fTraj.Direction(); }
162  inline std::pair<SMatrixSym55, SMatrixSym55> Covariances() const { return std::pair<SMatrixSym55, SMatrixSym55>(fCovVertex,fCovEnd); }
163  //@}
164 
165  //@{
166  /// Access to various track properties
167  inline double Length(size_t p=0) const { return fTraj.Length(p); }
168  inline float Chi2() const { return fChi2; }
169  inline float Chi2PerNdof() const { return fNdof>0 ? fChi2/float(fNdof) : util::kBogusF; }
170  inline int Ndof() const { return fNdof; }
171  inline int ParticleId() const { return fPId; }
172  //@}
173 
174  //@{
175  /// Access to spherical or geographical angles at vertex or at any point
176  inline double Theta() const { return fTraj.Theta(); }
177  inline double Theta(size_t p) const { return fTraj.Theta(p); }
178  inline double Phi() const { return fTraj.Phi(); }
179  inline double Phi(size_t p) const { return fTraj.Phi(p); }
180  inline double ZenithAngle() const { return fTraj.ZenithAngle(); }
181  inline double ZenithAngle(size_t p) const { return fTraj.ZenithAngle(p); }
182  inline double AzimuthAngle() const { return fTraj.AzimuthAngle(); }
183  inline double AzimuthAngle(size_t p) const { return fTraj.AzimuthAngle(p); }
184  //@}
185 
186  //@{
187  // Calculate rotation matrices between global (x,y,z) and local (u,v,w)
188  // coordinate systems based on track direction (fDir).
189  // The local w-axis points along the track direction.
190  inline Rotation_t GlobalToLocalRotationAtPoint(size_t p) const { return fTraj.GlobalToLocalRotationAtPoint(p); }
191  inline Rotation_t LocalToGlobalRotationAtPoint(size_t p) const { return fTraj.LocalToGlobalRotationAtPoint(p); }
192  //@}
193 
194  //@{
195  /// Track ID number, needed to relate a track to its possible track parent (e.g. in case of a refit).
196  /// Note that art Assns to the same object are not currently supported.
197  /// The < operator is based on the track ID.
198  inline int ID() const { return fID; }
199  friend bool operator < (const Track & a, const Track & b);
200  //@}
201 
202  //@{
203  /// Accessors to track parameters and covariance matrices in Local5D and Global6D coordinates
207  const SMatrixSym55& EndCovarianceLocal5D() const { return fCovEnd; }
212  //@}
213 
214  /// @{
215  /// @name Templated version of homonymous functions to access to position, direction, momentum information, and covariances.
216 
217  /// Start position. Use e.g. as: @code{.cpp} TVector3 start = track.Start<TVector3>(); @endcode.
218  template<typename T> inline T Start() const { return fTraj.Start<T>(); }
219 
220  /// Start position. Use e.g. as: @code{.cpp} TVector3 vertex = track.Vertex<TVector3>(); @endcode.
221  template<typename T> inline T Vertex() const { return fTraj.Vertex<T>(); }
222 
223  /// End position. Use e.g. as: @code{.cpp} TVector3 end = track.End<TVector3>(); @endcode.
224  template<typename T> inline T End() const { return fTraj.End<T>(); }
225 
226  /// Position at point p. Use e.g. as: @code{.cpp} TVector3 pos = track.LocationAtPoint<TVector3>(p); @endcode.
227  template<typename T> inline T LocationAtPoint(unsigned int p) const { return fTraj.LocationAtPoint<T>(p); }
228 
229  /// Start direction. Use e.g. as: @code{.cpp} TVector3 startdir = track.StartDirection<TVector3>(); @endcode.
230  template<typename T> inline T StartDirection() const { return fTraj.StartDirection<T>(); }
231 
232  /// Start direction. Use e.g. as: @code{.cpp} TVector3 vertexdir = track.VertexDirection<TVector3>(); @endcode.
233  template<typename T> inline T VertexDirection() const { return fTraj.VertexDirection<T>(); }
234 
235  /// End direction. Use e.g. as: @code{.cpp} TVector3 enddir = track.EndDirection<TVector3>(); @endcode.
236  template<typename T> inline T EndDirection() const { return fTraj.EndDirection<T>(); }
237 
238  /// Direction at point p. Use e.g. as: @code{.cpp} TVector3 dir = track.DirectionAtPoint<TVector3>(p); @endcode.
239  template<typename T> inline T DirectionAtPoint(unsigned int p) const { return fTraj.DirectionAtPoint<T>(p); }
240 
241  /// Momentum vector at start point. Use e.g. as: @code{.cpp} TVector3 startmom = track.StartMomentumVector<TVector3>(); @endcode.
242  template<typename T> inline T StartMomentumVector() const { return fTraj.StartMomentumVector<T>(); }
243 
244  /// Momentum vector at start point. Use e.g. as: @code{.cpp} TVector3 vertexmom = track.VertexMomentumVector<TVector3>(); @endcode.
245  template<typename T> inline T VertexMomentumVector() const { return fTraj.VertexMomentumVector<T>(); }
246 
247  /// Momentum vector at end point. Use e.g. as: @code{.cpp} TVector3 endmom = track.EndMomentumVector<TVector3>(); @endcode.
248  template<typename T> inline T EndMomentumVector() const { return fTraj.EndMomentumVector<T>(); }
249 
250  /// Momentum vector at point p. Use e.g. as: @code{.cpp} TVector3 mom = track.MomentumVectorAtPoint<TVector3>(p); @endcode.
251  template<typename T> inline T MomentumVectorAtPoint(unsigned int p) const { return fTraj.MomentumVectorAtPoint<T>(p); }
252 
253  /// Covariance matrix at start point. Use e.g. as: @code{.cpp} TMatrixD startcov = track.StartCovariance<TMatrixD>(); @endcode.
254  template<typename T> inline T StartCovariance() const;
255 
256  /// Covariance matrix at start point. Use e.g. as: @code{.cpp} TMatrixD vertexcov = track.VertexCovariance<TMatrixD>(); @endcode.
257  template<typename T> inline T VertexCovariance() const { return StartCovariance<T>(); }
258 
259  /// Covariance matrix at end point. Use e.g. as: @code{.cpp} TMatrixD endcov = track.EndCovariance<TMatrixD>(); @endcode.
260  template<typename T> inline T EndCovariance() const;
261 
262  /// Position at start and end points. Use e.g. as: @code{.cpp} TVector3 start, end; std::tie(start, end) = track.Extent<TVector3>(); @endcode.
263  template<typename T> inline std::pair<T, T> Extent() const { return fTraj.Extent<T>(); }
264 
265  /// Direction at start and end points. Use e.g. as: @code{.cpp} TVector3 startdir, enddir; std::tie(startdir, enddir) = track.Direction<TVector3>(); @endcode.
266  template<typename T> inline std::pair<T, T> Direction() const { return fTraj.Direction<T>(); }
267 
268  /// Returns a rotation matrix that brings trajectory direction along _z_. Use e.g. as: @code{.cpp} TMatrixD rot = track.GlobalToLocalRotationAtPoint<TMatrixD>(p); @endcode.
269  template<typename T> inline T GlobalToLocalRotationAtPoint(unsigned int p) const { return fTraj.GlobalToLocalRotationAtPoint<T>(p); }
270 
271  /// Returns a rotation matrix bringing relative directions to global. Use e.g. as: @code{.cpp} TMatrixD rot = track.LocalToGlobalRotationAtPoint<TMatrixD>(p); @endcode.
272  template<typename T> inline T LocalToGlobalRotationAtPoint(unsigned int p) const { return fTraj.LocalToGlobalRotationAtPoint<T>(p); }
273  /// @}
274 
275 
276  protected:
277 
278  friend std::ostream& operator << (std::ostream& stream, Track const& a);
279 
280  };
281 }
282 
283 template<typename T> inline T recob::Track::StartCovariance() const {
284  T result = T(5,5);
285  for (unsigned int i=0; i<5; i++) {
286  for (unsigned int j=0; j<5; j++) {
287  result(i,j) = fCovVertex.At(i,j);
288  }
289  }
290  return result;
291 }
292 
293 template<typename T> inline T recob::Track::EndCovariance() const {
294  T result = T(5,5);
295  for (unsigned int i=0; i<5; i++) {
296  for (unsigned int j=0; j<5; j++) {
297  result(i,j) = fCovEnd.At(i,j);
298  }
299  }
300  return result;
301 }
302 
303 #endif // LARDATAOBJ_RECOBASE_TRACK_H
recob::TrajectoryPointFlags PointFlags_t
Type for flags of a point/hit.
SMatrixSym66 EndCovarianceGlobal6D() const
Definition: Track.cxx:85
TrackTrajectory fTraj
Stored trajectory data member.
Definition: Track.h:72
T VertexCovariance() const
Covariance matrix at start point. Use e.g. as:
Definition: Track.h:257
double EndMomentum() const
Definition: Track.h:144
bool HasPoint(size_t i) const
Returns whether the specified trajectory point is available.
Definition: Trajectory.h:183
double VertexMomentum() const
Definition: Track.h:142
A point in the trajectory, with position and momentum.
Definition: TrackingTypes.h:63
tracking::SVector5 SVector5
Definition: Track.h:65
tracking::Momenta_t Momenta_t
Definition: Track.h:56
SMatrixSym55 fCovVertex
Covariance matrix (local 5D representation) at start point (vertex)
Definition: Track.h:76
SVector6 EndParametersGlobal6D() const
Definition: Track.cxx:60
Reconstruction base classes.
static QCString result
SMatrixSym55 fCovEnd
Covariance matrix (local 5D representation) at end point.
Definition: Track.h:77
Track(Positions_t &&positions, Momenta_t &&momenta, Flags_t &&flags, bool hasMomenta, int PId, float Chi2, int Ndof, SMatrixSym55 &&CovVertex, SMatrixSym55 &&CovEnd, int tkID)
Definition: Track.h:93
T Start() const
Start position. Use e.g. as:
Definition: Track.h:218
T DirectionAtPoint(unsigned int p) const
Direction at point p. Use e.g. as:
int ParticleId() const
Definition: Track.h:171
ROOT::Math::SMatrix< Double32_t, 5, 5, ROOT::Math::MatRepSym< Double32_t, 5 > > SMatrixSym55
Definition: TrackingTypes.h:85
Vector_t const & MomentumVectorAtPoint(size_t i) const
Definition: Track.h:148
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:98
const SMatrixSym55 & StartCovariance() const
Access to covariance matrices.
Definition: Track.h:153
size_t LastValidPoint() const
Returns the index of the last valid point in the trajectory.
size_t PreviousValidPoint(size_t index) const
Definition: Track.h:108
T GlobalToLocalRotationAtPoint(unsigned int p) const
Returns a rotation matrix that brings trajectory direction along z. Use e.g. as:
Point_t const & LocationAtPoint(size_t i) const
Definition: Track.h:126
T MomentumVectorAtPoint(unsigned int p) const
Momentum vector at point p. Use e.g. as:
Definition: Track.h:251
double ZenithAngle(size_t p) const
"Zenith" angle of trajectory, with respect to the vertical axis.
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
Definition: Track.h:227
bool HasMomentum() const
Definition: Track.h:140
TrackTrajectory::Flags_t Flags_t
Definition: Track.h:68
SVector5 VertexParametersLocal5D() const
Accessors to track parameters and covariance matrices in Local5D and Global6D coordinates.
Definition: Track.cxx:71
bool HasValidPoint(size_t i) const
Definition: Track.h:111
Vector_t const & StartMomentumVector() const
Returns the momentum of the trajectory at the first valid point [GeV/c].
float Chi2() const
Definition: Track.h:168
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:102
Vector_t const & VertexMomentumVector() const
Returns the momentum of the trajectory at the first valid point [GeV/c].
Vector_t VertexDirection() const
Definition: Track.h:132
tracking::SMatrixSym66 SMatrixSym66
Definition: Track.h:61
const SMatrixSym55 & VertexCovariance() const
Definition: Track.h:154
double ZenithAngle(size_t p) const
Definition: Track.h:181
T LocalToGlobalRotationAtPoint(unsigned int p) const
Returns a rotation matrix bringing relative directions to global. Use e.g. as:
T EndDirection() const
End direction. Use e.g. as:
Definition: Track.h:236
STL namespace.
double ZenithAngle() const
Definition: Track.h:180
T LocalToGlobalRotationAtPoint(unsigned int p) const
Returns a rotation matrix bringing relative directions to global. Use e.g. as:
Definition: Track.h:272
double EndMomentum() const
ROOT::Math::SMatrix< Double32_t, 5, 6 > SMatrix56
Definition: TrackingTypes.h:88
std::pair< SMatrixSym55, SMatrixSym55 > Covariances() const
Definition: Track.h:162
tracking::Rotation_t Rotation_t
Definition: Track.h:57
T StartMomentumVector() const
Momentum vector at start point. Use e.g. as:
Definition: Track.h:242
tracking::SVector6 SVector6
Definition: Track.h:64
unsigned int CountValidPoints() const
Computes and returns the number of points with valid location.
std::pair< T, T > Extent() const
Fills the first and last valid point in the trajectory.
double MomentumAtPoint(unsigned int p) const
Definition: Track.h:141
size_t FirstPoint() const
Definition: Track.h:104
bool HasPoint(size_t i) const
Definition: Track.h:110
ROOT::Math::SVector< Double32_t, 5 > SVector5
Definition: TrackingTypes.h:92
tracking::SMatrix56 SMatrix56
Definition: Track.h:63
friend bool operator<(const Track &a, const Track &b)
Definition: Track.cxx:40
SMatrixSym66 VertexCovarianceGlobal6D() const
Definition: Track.cxx:81
std::pair< Vector_t, Vector_t > Direction() const
Definition: Track.h:161
Rotation_t GlobalToLocalRotationAtPoint(size_t p) const
Definition: Track.h:190
tracking::Vector_t Vector_t
Definition: Track.h:54
unsigned int CountValidPoints() const
Definition: Track.h:112
Vector_t VertexDirection() const
Returns the direction of the trajectory at the first point.
std::pair< T, T > Direction() const
Fills the starting and ending direction of the trajectory.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space. See recob::tracking::Coord_t for more details on the ...
Definition: TrackingTypes.h:29
Vector_t const & EndMomentumVector() const
Definition: Track.h:147
double Phi() const
Definition: Track.h:178
Vector_t StartDirection() const
Access to track direction at different points.
Definition: Track.h:131
double Length(size_t startAt=0) const
Returns the approximate length of the trajectory.
tracking::Positions_t Positions_t
Definition: Track.h:55
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
size_t LastPoint() const
Returns the index of the last point in the trajectory.
Definition: Trajectory.h:175
size_t PreviousValidPoint(size_t index) const
Returns the index of the previous valid point in the trajectory.
TrajectoryPoint_t TrajectoryPoint(size_t i) const
Returns position and momentum at the specified trajectory point.
Definition: Trajectory.h:213
int fID
track&#39;s ID
Definition: Track.h:78
PointFlags_t const & FlagsAtPoint(size_t i) const
Returns the flags for the specified trajectory point.
size_t NPoints() const
Returns the number of stored trajectory points.
Definition: Trajectory.h:167
Point_t const & Start() const
Access to track position at different points.
Definition: Track.h:123
size_t LastValidPoint() const
Definition: Track.h:109
float fChi2
Fit chi2.
Definition: Track.h:74
std::pair< T, T > Direction() const
Direction at start and end points. Use e.g. as:
Definition: Track.h:266
A trajectory in space reconstructed from hits.
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
Definition: Track.h:176
const double a
def move(depos, offset)
Definition: depos.py:107
Track(TrackTrajectory const &Traj, int PId, float Chi2, int Ndof, SMatrixSym55 const &CovVertex, SMatrixSym55 const &CovEnd, int tkID)
Definition: Track.h:85
float Chi2PerNdof() const
Definition: Track.h:169
double MomentumAtPoint(size_t i) const
Computes and returns the modulus of the momentum at a point.
Definition: Trajectory.h:442
Point_t const & Vertex() const
Definition: Track.h:124
bool HasValidPoint(size_t i) const
Returns whether the specified point has NoPoint flag unset.
Vector_t const & StartMomentumVector() const
Definition: Track.h:146
double StartMomentum() const
TrajectoryPoint_t TrajectoryPoint(size_t i) const
Access to i-th TrajectoryPoint or its Flags.
Definition: Track.h:117
const SMatrixSym55 & EndCovariance() const
Definition: Track.h:155
size_t NPoints() const
Definition: Track.h:103
std::vector< Vector_t > Momenta_t
Type of momentum list.
Definition: TrackingTypes.h:35
T StartDirection() const
Start direction. Use e.g. as:
Definition: Track.h:230
tracking::SMatrix65 SMatrix65
Definition: Track.h:62
Data product for reconstructed trajectory in space.
Track()=default
T VertexMomentumVector() const
Momentum vector at start point. Use e.g. as:
Definition: Track.h:245
friend std::ostream & operator<<(std::ostream &stream, Track const &a)
Definition: Track.cxx:21
std::vector< PointFlags_t > Flags_t
Type of point flag list.
size_t FirstPoint() const
Returns the index of the first point in the trajectory (yep, it&#39;s 0).
Definition: Trajectory.h:171
size_t NumberTrajectoryPoints() const
Returns the number of stored trajectory points.
Definition: Trajectory.h:156
std::pair< T, T > Extent() const
Position at start and end points. Use e.g. as:
Definition: Track.h:263
double AzimuthAngle(size_t p) const
Definition: Track.h:183
T EndMomentumVector() const
Momentum vector at end point. Use e.g. as:
Definition: Track.h:248
Track(TrackTrajectory &&Traj, int PId, float Chi2, int Ndof, SMatrixSym55 &&CovVertex, SMatrixSym55 &&CovEnd, int tkID)
Definition: Track.h:89
double Phi(size_t p) const
Azimuthal angle at a point on the trajectory, with respect to z.
int Ndof() const
Definition: Track.h:170
Point_t const & Vertex() const
Returns the position of the first valid point of the trajectory [cm].
SVector5 EndParametersLocal5D() const
Definition: Track.cxx:76
int fNdof
Number of degrees of freedom of the fit.
Definition: Track.h:75
ROOT::Math::Rotation3D Rotation_t
Type for representation of space rotations.
Definition: TrackingTypes.h:38
tracking::SMatrixSym55 SMatrixSym55
Definition: Track.h:60
size_t FirstValidPoint() const
Definition: Track.h:106
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
p
Definition: test.py:223
T VertexDirection() const
Start direction. Use e.g. as:
Definition: Track.h:233
double Theta(size_t p) const
Trajectory angle at point, with respect to positive z direction.
int ID() const
Definition: Track.h:198
ROOT::Math::SMatrix< Double32_t, 6, 6, ROOT::Math::MatRepSym< Double32_t, 6 > > SMatrixSym66
Definition: TrackingTypes.h:86
double StartMomentum() const
Definition: Track.h:143
std::vector< Point_t > Positions_t
Type of trajectory point list.
Definition: TrackingTypes.h:32
size_t NextValidPoint(size_t index) const
Definition: Track.h:107
size_t FirstValidPoint() const
Returns the index of the first valid point in the trajectory.
Rotation_t LocalToGlobalRotationAtPoint(size_t p) const
Definition: Track.h:191
constexpr float kBogusF
obviously bogus float value
const SMatrixSym55 & EndCovarianceLocal5D() const
Definition: Track.h:207
bool HasMomentum() const
Returns whether information about the momentum is available.
Definition: Trajectory.h:425
double AzimuthAngle() const
Definition: Track.h:182
Vector_t const & VertexMomentumVector() const
Definition: Track.h:145
Vector_t const & EndMomentumVector() const
Returns the momentum of the trajectory at the last valid point [GeV/c].
Vector_t EndDirection() const
Definition: Track.h:133
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
tracking::Point_t Point_t
Definition: Track.h:53
size_t NextValidPoint(size_t index) const
Returns the index of the next valid point in the trajectory.
double AzimuthAngle(size_t p) const
"Azimuth" angle of trajectory, with respect to the sky.
static bool * b
Definition: config.cpp:1043
PointFlags_t const & FlagsAtPoint(size_t i) const
Definition: Track.h:118
Point_t const & End() const
Definition: Track.h:125
double Phi(size_t p) const
Definition: Track.h:179
T End() const
End position. Use e.g. as:
Definition: Track.h:224
Vector_t DirectionAtPoint(size_t i) const
Definition: Track.h:134
ROOT::Math::SVector< Double32_t, 6 > SVector6
Definition: TrackingTypes.h:91
T DirectionAtPoint(unsigned int p) const
Direction at point p. Use e.g. as:
Definition: Track.h:239
SVector6 VertexParametersGlobal6D() const
Definition: Track.cxx:49
double VertexMomentum() const
T MomentumVectorAtPoint(unsigned int p) const
Momentum vector at point p. Use e.g. as:
Collection of Physical constants used in LArSoft.
Vector_t StartDirection() const
Returns the direction of the trajectory at the first point.
double Theta(size_t p) const
Definition: Track.h:177
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space. See recob::tracking::Coord_t for more detai...
Definition: TrackingTypes.h:26
size_t LastPoint() const
Definition: Track.h:105
const SMatrixSym55 & VertexCovarianceLocal5D() const
Definition: Track.h:206
T GlobalToLocalRotationAtPoint(unsigned int p) const
Returns a rotation matrix that brings trajectory direction along z. Use e.g. as:
Definition: Track.h:269
Set of flags pertaining a point of the track.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
std::pair< Point_t, Point_t > Extent() const
Access to position, momentum or covariance at the start and end of the track.
Definition: Track.h:160
int fPId
Particle ID hypothesis used in the fit (if any)
Definition: Track.h:73
ROOT::Math::SMatrix< Double32_t, 6, 5 > SMatrix65
Definition: TrackingTypes.h:87
T Vertex() const
Start position. Use e.g. as:
Definition: Track.h:221