15 #ifndef LARDATAOBJ_RECOBASE_TRACKTRAJECTORY_H
16 #define LARDATAOBJ_RECOBASE_TRACKTRAJECTORY_H
88 using Flags_t = std::vector<PointFlags_t>;
212 {
return ToValidPoint<+1>(index); }
270 template<
typename T> std::pair<T,T>
Extent( )
const {
return {
Vertex<T>(), End<T>() }; }
289 std::pair<Point_t, Point_t>
Extent()
const
310 double Length (
size_t startAt = 0)
const;
506 template<
typename T> std::pair<T,T>
Direction()
const {
return { VertexDirection<T>(), EndDirection<T>() }; }
622 template <
typename Stream>
625 unsigned int verbosity,
626 std::string indent, std::string indentFirst
639 template <
typename Stream>
641 (
Stream&& out,
unsigned int verbosity = 1, std::string indent = {})
643 {
Dump(std::forward<Stream>(out), verbosity, indent, indent); }
652 template <
typename Stream>
654 (
Stream&& out, std::string indent, std::string indentFirst)
const;
661 static constexpr
size_t InvalidIndex = std::numeric_limits<size_t>::max();
718 #include "TrackTrajectory.tcc"
723 #endif // LARDATAOBJ_RECOBASE_TRACKTRAJECTORY_H
void Dump(Stream &&out, unsigned int verbosity, std::string indent, std::string indentFirst) const
Prints trajectory content into a stream.
double Phi(size_t p=0) const
Azimuthal angle at a point on the trajectory, with respect to z.
Data product for reconstructed trajectory in space.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
T VertexDirection() const
Start direction. Use e.g. as:
bool HasPoint(size_t i) const
Returns whether the specified trajectory point is available.
A point in the trajectory, with position and momentum.
Trajectory_t const & Trajectory() const
Returns the plain trajectory of this object.
T Vertex() const
Start position. Use e.g. as:
TrajectoryPointFlagTraits flag
Type of flag traits (indices and meaning of flags).
TrackTrajectory()=default
Default constructor; do not use it! it's needed by ROOT I/O.
Flags_t const & Flags() const
Returns all flags.
static constexpr Flag_t NoPoint
The trajectory point is not defined.
T DirectionAtPoint(unsigned int p) const
Direction at point p. Use e.g. as:
T EndDirection() const
End direction. Use e.g. as:
bool isSet(Flag_t flag) const
Returns true if the flag exists and is set.
size_t LastValidPoint() const
Returns the index of the last valid point in the trajectory.
Ends_t
Mnemonics for the access to begin and end of trajectory.
T GlobalToLocalRotationAtPoint(unsigned int p) const
Returns a rotation matrix that brings trajectory direction along z. Use e.g. as:
T Start() const
Start position. Use e.g. as:
tracking::Positions_t Positions_t
Type of trajectory point list.
double ZenithAngle(size_t p) const
"Zenith" angle of trajectory, with respect to the vertical axis.
Vector_t const & StartMomentumVector() const
Returns the momentum of the trajectory at the first valid point [GeV/c].
T VertexMomentumVector() const
Momentum vector at start point. Use e.g. as:
Vector_t const & VertexMomentumVector() const
Returns the momentum of the trajectory at the first valid point [GeV/c].
T StartDirection() const
Start direction. Use e.g. as:
Namespace for the trajectory point flags.
double AzimuthAngle(size_t p=0) const
"Azimuth" angle of trajectory, with respect to the sky.
T LocalToGlobalRotationAtPoint(unsigned int p) const
Returns a rotation matrix bringing relative directions to global. Use e.g. as:
double ZenithAngle(size_t p=0) const
"Zenith" angle of trajectory, with respect to the vertical axis.
double EndMomentum() const
T StartMomentumVector() const
Momentum vector at start point. Use e.g. as:
Rotation_t LocalToGlobalRotationAtPoint(size_t p) const
Returns a rotation matrix bringing relative directions to global.
unsigned int CountValidPoints() const
Computes and returns the number of points with valid location.
tracking::Momenta_t Momenta_t
Type of momentum list.
Definition of vertex object for LArSoft.
std::pair< T, T > Extent() const
Fills the first and last valid point in the trajectory.
Flags_t fFlags
Flags of each of the points in trajectory.
Vector_t DirectionAtPoint(size_t i) const
Computes and returns the direction of the trajectory at a point.
Rotation_t GlobalToLocalRotationAtPoint(size_t p) const
Returns a rotation matrix that brings trajectory direction along z.
double AzimuthAngle() const
"Azimuth" angle of trajectory, with respect to the sky.
T EndMomentumVector() const
Momentum vector at end point. Use e.g. as:
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 ...
double Length(size_t startAt=0) const
Returns the approximate length of the trajectory.
size_t LastPoint() const
Returns the index of the last point in the trajectory.
size_t PreviousValidPoint(size_t index) const
Returns the index of the previous valid point in the trajectory.
const Positions_t & Positions() const
Returns reference to stored vector of positions.
TrajectoryPoint_t TrajectoryPoint(size_t i) const
Returns position and momentum at the specified trajectory point.
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.
A trajectory in space reconstructed from hits.
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
double MomentumAtPoint(size_t i) const
Computes and returns the modulus of the momentum at a point.
bool HasValidPoint(size_t i) const
Returns whether the specified point has NoPoint flag unset.
std::pair< Vector_t, Vector_t > Direction() const
Returns the trajectory directions at first and last valid points.
double StartMomentum() const
Point_t const & LocationAtPoint(size_t i) const
Returns the position at the specified trajectory point.
tracking::Rotation_t Rotation_t
Type for representation of space rotations.
std::vector< Vector_t > Momenta_t
Type of momentum list.
double ZenithAngle() const
"Zenith" angle of trajectory, with respect to the vertical axis.
tracking::Vector_t Vector_t
Type for representation of momenta in 3D space.
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's 0).
size_t NumberTrajectoryPoints() const
Returns the number of stored trajectory points.
Set of flags pertaining a point of the track.
double Phi(size_t p) const
Azimuthal angle at a point on the trajectory, with respect to z.
Point_t const & Vertex() const
Returns the position of the first valid point of the trajectory [cm].
ROOT::Math::Rotation3D Rotation_t
Type for representation of space rotations.
Vector_t const & MomentumVectorAtPoint(size_t i) const
Returns the momentum vector at a point.
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
tracking::Coord_t Coord_t
Type used for coordinates and values in general.
A trajectory in space reconstructed from hits.
double Theta(size_t p) const
Trajectory angle at point, with respect to positive z direction.
size_t ToValidPoint(size_t index) const
Returns the index of the first valid point from index on.
std::vector< Point_t > Positions_t
Type of trajectory point list.
size_t FirstValidPoint() const
Returns the index of the first valid point in the trajectory.
static constexpr size_t InvalidIndex
Value returned on failed index queries.
bool HasMomentum() const
Returns whether information about the momentum is available.
Vector_t const & EndMomentumVector() const
Returns the momentum of the trajectory at the last valid point [GeV/c].
static constexpr unsigned int MaxDumpVerbosity
Largest verbosity level supported by Dump().
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
TrackTrajectory(const Trajectory &traj, Flags_t &&flags)
Constructor: copies positions and momenta from an existing Trajectory, adds the flags.
const Momenta_t & Momenta() const
Returns reference to stored vector of momenta.
size_t NextValidPoint(size_t index) const
Returns the index of the next valid point in the trajectory.
double Phi() const
Azimuthal angle at a first valid point, with respect to z.
double AzimuthAngle(size_t p) const
"Azimuth" angle of trajectory, with respect to the sky.
bool AtLeastValidTrajectoryPoints(unsigned int left) const
Returns whether there are at least min valid points in the trajectory.
double Theta(size_t p=0) const
Trajectory angle at point, with respect to positive z direction.
tracking::Point_t Point_t
Type for representation of position in physical 3D space.
double VertexMomentum() const
T MomentumVectorAtPoint(unsigned int p) const
Momentum vector at point p. Use e.g. as:
Vector_t StartDirection() const
Returns the direction of the trajectory at the first point.
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...
std::pair< Point_t, Point_t > Extent() const
Returns a copy of the first and last valid point in the trajectory.
double Theta() const
Trajectory angle at start, with respect to positive z direction.
Set of flags pertaining a point of the track.
T End() const
End position. Use e.g. as:
void LowLevelDump(Stream &&out, std::string indent, std::string indentFirst) const
Prints low-level trajectory content into a stream.
std::ostream & operator<<(std::ostream &o, Cluster const &c)