19 double sqr(
double v) {
return v*v; }
21 double spacePointDistance
24 double const* aXYZ = a.
XYZ();
25 double const* bXYZ = b.
XYZ();
27 (
sqr(aXYZ[0] - bXYZ[0]) +
sqr(aXYZ[1] - bXYZ[1]) +
sqr(aXYZ[2] - bXYZ[2]))
40 fFirstPointID(firstPointID),
41 fSecondPointID(secondPointID),
49 fLength(::spacePointDistance(firstPoint, secondPoint)),
61 o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
62 o <<
" Edge ID " << a.
ID() <<
" has length " << std::setw(6) << a.
Length() <<
" cm" << std::endl;
An object to define a "edge" which is used to connect space points in a triangulation algorithm...
Reconstruction base classes.
double Length() const
Returns the length of this edge [cm].
SpacePointID_t FirstPointID() const
Returns the ID of the SpacePoint this edge emanates from.
unsigned int ID_t
Type to represent recob::Edge IDs.
double fLength
Length of this Edge [cm].
SpacePointID_t fSecondPointID
ID of the SpacePoint edge ends on.
SpacePointID_t fFirstPointID
ID of the SpacePoint edge emanates from.
const double * XYZ() const
Edge()=default
Default constructor (all invalid IDs).
ID_t ID() const
Returns the ID of this edge.
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Edge is an object containing the results of a Principal Components Analysis of a group of space point...
recob::SpacePoint::ID_t SpacePointID_t
Type to represent recob::SpacePoint IDs.
SpacePointID_t SecondPointID() const
Returns the ID of the SpacePoint this edge ends on.