26 : fPositions(std::move(positions))
27 , fMomenta(std::move(momenta))
28 , fHasMomentum(hasMomenta)
31 if (fPositions.size() != fMomenta.size()) {
32 throw std::runtime_error(
"recob::Trajectory constructed with " 35 +
" momenta! it requires the same number for both." 38 if (fPositions.size() < 2) {
39 throw std::runtime_error(
"recob::Trajectory constructed with " 41 +
" trajectory points! it requires at least 2." 74 while (next++ != last) {
75 length += (*next - *curr).
R();
104 return std::atan2(startDir.X(), startDir.Z());
144 std::ostream& recob::operator <<
146 { traj.Dump(out);
return out; }
Trajectory()=default
Default constructor; do not use it! it's needed by ROOT I/O.
Data product for reconstructed trajectory in space.
Rotation_t Global3DToLocal3DRotation() const
Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates.
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.
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.
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.
size_t LastPoint() const
Returns the index of the last point in the trajectory.
Point_t const & LocationAtPoint(size_t i) const
Returns the position at the specified trajectory point.
tracking::Positions_t Positions_t
Type of trajectory point list.
tracking::Momenta_t Momenta_t
Type of momentum list.
Vector_t const & MomentumVectorAtPoint(size_t i) const
Returns the momentum vector at a point.
A trajectory in space reconstructed from hits.
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
bool HasMomentum() const
Returns whether information about the momentum is available.
tracking::Point_t Point_t
Type for representation of position in physical 3D space.
Rotation_t Local3DToGlobal3DRotation() const
Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates.
tracking::Rotation_t Rotation_t
Type for representation of space rotations.