25 throw std::runtime_error(
30 throw std::runtime_error(
"recob::TrackTrajectory constructed with only " +
32 " valid positions! at least 2 are required.");
40 unsigned int count = 0;
41 for (
size_t index = 0; index <
NPoints(); ++index) {
72 size_t iCurr = ToValidPoint<+1>(startAt);
77 while ((iNext = ToValidPoint<+1>(++iNext)) <= iLast) {
79 length += (*next - *curr).R();
88 if (min == 0)
return true;
89 unsigned int left = min;
90 for (
size_t i = 0; i <
NPoints(); ++i) {
92 if (--left == 0)
return true;
void Dump(Stream &&out, unsigned int verbosity, std::string indent, std::string indentFirst) const
Prints trajectory content into a stream.
TrackTrajectory()=default
Default constructor; do not use it! it's needed by ROOT I/O.
size_t LastValidPoint() const
Returns the index of the last valid point in the trajectory.
tracking::Positions_t Positions_t
Type of trajectory point list.
unsigned int CountValidPoints() const
Computes and returns the number of points with valid location.
tracking::Momenta_t Momenta_t
Type of momentum list.
Flags_t fFlags
Flags of each of the points in trajectory.
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 NPoints() const
Returns the number of stored trajectory points.
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
A trajectory in space reconstructed from hits.
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
bool HasValidPoint(size_t i) const
Returns whether the specified point has NoPoint flag unset.
Data product for reconstructed trajectory in space.
std::vector< PointFlags_t > Flags_t
Type of point flag list.
tracking::Coord_t Coord_t
Type used for coordinates and values in general.
A trajectory in space reconstructed from hits.
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
bool AtLeastValidTrajectoryPoints(unsigned int left) const
Returns whether there are at least min valid points in the trajectory.
tracking::Point_t Point_t
Type for representation of position in physical 3D space.
std::ostream & operator<<(std::ostream &o, Cluster const &c)