15 #ifndef LARDATAOBJ_RECOBASE_TRAJECTORY_H 16 #define LARDATAOBJ_RECOBASE_TRAJECTORY_H 18 #include "TMatrixDfwd.h" 254 template<
typename T> std::pair<T,T>
Extent()
const {
return {
Vertex<T>(),End<T>() }; }
272 std::pair<Point_t, Point_t>
Extent()
const 292 double Length (
size_t startAt = 0)
const;
343 double Phi(
size_t p = 0)
const 478 template<
typename T> std::pair<T,T>
Direction()
const {
return { VertexDirection<T>(),EndDirection<T>() }; }
549 template<
typename T>
inline T
Start()
const {
auto& loc =
Start();
return T(loc.X(),loc.Y(),loc.Z()); }
552 template<
typename T>
inline T
Vertex()
const {
auto& loc =
Vertex();
return T(loc.X(),loc.Y(),loc.Z()); }
555 template<
typename T>
inline T
End()
const {
auto& loc =
End();
return T(loc.X(),loc.Y(),loc.Z()); }
632 template <
typename Stream>
635 unsigned int verbosity,
636 std::string
indent, std::string indentFirst
649 template <
typename Stream>
651 (Stream&& out,
unsigned int verbosity = 1, std::string indent = {})
653 {
Dump(std::forward<Stream>(out), verbosity, indent, indent); }
662 template <
typename Stream>
664 (Stream&& out, std::string indent, std::string indentFirst)
const;
703 template <
typename Vect>
704 void FillVector(Vect
const& source, std::vector<double>& dest);
707 template <
typename Vect>
708 void FillVector(Vect
const& source,
double* dest);
711 template <
typename SrcVect,
typename DestVect>
713 SrcVect
const& firstSource, SrcVect
const& secondSource,
714 DestVect&& firstDest, DestVect&& secondDest
737 #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.
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 ...
Index representing the end of the trajectory.
size_t LastPoint() const
Returns the index of the last point in the trajectory.
std::pair< T, T > Extent() const
Fills the first and 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:
T EndMomentumVector() const
Momentum vector at end point. Use e.g. as:
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.
std::pair< T, T > Direction() const
Fills the starting and ending direction of the trajectory.
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.
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.