22 , fFlags(
std::move(flags))
26 throw std::runtime_error(
"recob::TrackTrajectory constructed with "
29 +
" point flags! it requires the same number for both."
33 throw std::runtime_error(
"recob::TrackTrajectory constructed with only "
35 +
" valid positions! at least 2 are required."
44 unsigned int count = 0;
45 for (
size_t index = 0; index < NPoints(); ++index) {
46 if (HasValidPoint(index)) ++count;
73 if (startAt >= LastPoint())
return 0.;
76 size_t iCurr = ToValidPoint<+1>(startAt);
78 size_t iLast = LastValidPoint();
79 Point_t const* curr = &(LocationAtPoint(iCurr));
81 while ((iNext = ToValidPoint<+1>(++iNext)) <= iLast) {
82 Point_t const* next = &LocationAtPoint(iNext);
83 length += (*next - *curr).R();
92 (
unsigned int min)
const
94 if (min == 0)
return true;
95 unsigned int left = min;
96 for (
size_t i = 0; i < NPoints(); ++i) {
97 if (!HasValidPoint(i))
continue;
98 if (--left == 0)
return true;
105 std::ostream& recob::operator<<
107 { traj.Dump(out);
return out; }
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
TrackTrajectory()=default
Default constructor; do not use it! it's needed by ROOT I/O.
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 NPoints() const
Returns the number of stored trajectory points.
A trajectory in space reconstructed from hits.
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.
std::string to_string(WindowPattern const &pattern)
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::size_t count(Cont const &cont)