15 #ifndef LARDATAOBJ_RECOBASE_TRAJECTORY_H 16 #define LARDATAOBJ_RECOBASE_TRAJECTORY_H 226 template <
typename T>
266 double Length(
size_t startAt = 0)
const;
430 template <
typename T>
433 return {VertexDirection<T>(), EndDirection<T>()};
501 template <
typename T>
505 return T(loc.X(), loc.Y(), loc.Z());
509 template <
typename T>
513 return T(loc.X(), loc.Y(), loc.Z());
517 template <
typename T>
521 return T(loc.X(), loc.Y(), loc.Z());
525 template <
typename T>
529 return T(loc.X(), loc.Y(), loc.Z());
533 template <
typename T>
541 template <
typename T>
549 template <
typename T>
557 template <
typename T>
565 template <
typename T>
569 return T(mom.X(), mom.Y(), mom.Z());
573 template <
typename T>
577 return T(mom.X(), mom.Y(), mom.Z());
581 template <
typename T>
585 return T(mom.X(), mom.Y(), mom.Z());
589 template <
typename T>
593 return T(mom.X(), mom.Y(), mom.Z());
597 template <
typename T>
606 template <
typename T>
648 template <
typename Stream>
649 void Dump(Stream&& out,
650 unsigned int verbosity,
652 std::string indentFirst)
const;
664 template <
typename Stream>
665 void Dump(Stream&& out,
unsigned int verbosity = 1, std::string indent = {})
const 667 Dump(std::forward<Stream>(out), verbosity, indent, indent);
677 template <
typename Stream>
678 void LowLevelDump(Stream&& out, std::string indent, std::string indentFirst)
const;
710 template <
typename Vect>
711 void FillVector(Vect
const& source, std::vector<double>& dest);
714 template <
typename Vect>
715 void FillVector(Vect
const& source,
double* dest);
718 template <
typename SrcVect,
typename DestVect>
720 SrcVect
const& secondSource,
721 DestVect&& firstDest,
722 DestVect&& secondDest);
740 #endif // LARDATAOBJ_RECOBASE_TRAJECTORY_H
Trajectory(Positions_t const &positions, Momenta_t const &momenta, bool hasMomenta)
Constructor: copies positions and momenta.
Point_t const & Vertex() const
Returns the position of the first point of the trajectory [cm].
double Phi(size_t p=0) const
Azimuthal angle at a point on the trajectory, with respect to z.
Trajectory()=default
Default constructor; do not use it! it's needed by ROOT I/O.
double EndMomentum() const
Computes and returns the modulus of momentum at the last point [GeV/c].
bool HasPoint(size_t i) const
Returns whether the specified trajectory point is available.
A point in the trajectory, with position and momentum.
std::pair< Vector_t, Vector_t > Direction() const
Returns the trajectory directions at first and last point.
Reconstruction base classes.
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
T End() const
End position. Use e.g. as:
Ends_t
Mnemonics for the access to begin and end of trajectory.
Vector_t const & StartMomentumVector() const
Returns the momentum of the trajectory at the first point [GeV/c].
tracking::Coord_t Coord_t
Type used for coordinates and values in general.
Point_t const & End() const
Returns the position of the last point of the trajectory [cm].
double AzimuthAngle(size_t p=0) const
"Azimuth" angle of trajectory, with respect to the sky.
void LowLevelDump(Stream &&out, std::string indent, std::string indentFirst) const
Prints low-level trajectory content into a stream.
double ZenithAngle(size_t p=0) const
"Zenith" angle of trajectory, with respect to the vertical axis.
double Length(size_t startAt=0) const
Returns the approximate length of the trajectory.
Rotation_t LocalToGlobalRotationAtPoint(size_t p) const
Returns a rotation matrix bringing relative directions to global.
std::pair< Point_t, Point_t > Extent() const
Returns a copy of the first and last point in the trajectory.
double VertexMomentum() const
Computes and returns the modulus of momentum at the first point [GeV/c].
Definition of vertex object for LArSoft.
double StartMomentum() const
Computes and returns the modulus of momentum at the first point [GeV/c].
Momenta_t fMomenta
Momentum 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.
tracking::Vector_t Vector_t
Type for representation of momenta in 3D space.
T Start() const
Start position. Use e.g. as:
Positions_t fPositions
List of points the trajectory goes through.
Index representing the end of the trajectory.
size_t LastPoint() const
Returns the index of the last 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.
size_t NPoints() const
Returns the number of stored trajectory points.
Index representing the start of the trajectory.
T DirectionAtPoint(unsigned int p) const
Direction at point p. Use e.g. as:
void Dump(Stream &&out, unsigned int verbosity=1, std::string indent={}) const
Prints trajectory content into a stream.
T EndMomentumVector() const
Momentum vector at end point. Use e.g. as:
std::pair< T, T > Extent() const
Fills the first and last point in the trajectory.
Index representing the start of the trajectory.
std::string indent(std::size_t const i)
T MomentumVectorAtPoint(unsigned int p) const
Momentum vector 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 fHasMomentum
Whether we have momentum modulus information.
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 ...
Point_t const & LocationAtPoint(size_t i) const
Returns the position at the specified trajectory point.
std::vector< Vector_t > Momenta_t
Type of momentum list.
std::pair< T, T > Direction() const
Fills the starting and ending direction of the trajectory.
Vector_t VertexDirection() const
Returns the direction of the trajectory at the first point.
T Vertex() const
Start position. Use e.g. as:
tracking::Positions_t Positions_t
Type of trajectory point list.
static constexpr unsigned int MaxDumpVerbosity
Largest verbosity level supported by Dump().
size_t FirstPoint() const
Returns the index of the first point in the trajectory (yep, it's 0).
T StartDirection() const
Start direction. Use e.g. as:
size_t NumberTrajectoryPoints() const
Returns the number of stored trajectory points.
tracking::Momenta_t Momenta_t
Type of momentum list.
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.
T GlobalToLocalRotationAtPoint(unsigned int p) const
Returns a rotation matrix that brings trajectory direction along z. Use e.g. as:
Vector_t StartDirection() const
Returns the direction of the trajectory at the first point.
A trajectory in space reconstructed from hits.
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
T StartMomentumVector() const
Momentum vector at start point. Use e.g. as:
std::vector< Point_t > Positions_t
Type of trajectory point list.
bool HasMomentum() const
Returns whether information about the momentum is available.
T VertexDirection() const
Start direction. Use e.g. as:
tracking::Point_t Point_t
Type for representation of position in physical 3D space.
const Momenta_t & Momenta() const
Returns reference to stored vector of momenta.
Vector_t const & VertexMomentumVector() const
Returns the momentum of the trajectory at the first point [GeV/c].
double Theta(size_t p=0) const
Trajectory angle at point, with respect to positive z direction.
void Dump(Stream &&out, unsigned int verbosity, std::string indent, std::string indentFirst) const
Prints trajectory content into a stream.
void FillVector(Vect const &source, double *dest)
Converts a vector into a C array.
Point_t const & Start() const
Returns the position of the first 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...
T LocalToGlobalRotationAtPoint(unsigned int p) const
Returns a rotation matrix bringing relative directions to global. Use e.g. as:
T VertexMomentumVector() const
Momentum vector at start point. Use e.g. as:
tracking::Rotation_t Rotation_t
Type for representation of space rotations.
T EndDirection() const
End direction. Use e.g. as:
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Vector_t const & EndMomentumVector() const
Returns the momentum of the trajectory at the last point [GeV/c].
void FillTwoVectors(SrcVect const &firstSource, SrcVect const &secondSource, DestVect &&firstDest, DestVect &&secondDest)
Converts two vectors into another type of vector using FillVector.