LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Edge.h
Go to the documentation of this file.
1 
10 #ifndef LARDATAOBJ_RECOBASE_EDGE_H
11 #define LARDATAOBJ_RECOBASE_EDGE_H
12 
13 // LArSoft libraries
15 
16 // C/C++ libraries
17 #include <iosfwd> // std::ostream
18 #include <limits> // std::numeric_limits<>
19 
20 namespace recob {
21 
59  class Edge {
60  public:
62  using ID_t = unsigned int;
63 
66 
68  static constexpr ID_t InvalidID = std::numeric_limits<ID_t>::max();
69 
71  Edge() = default;
72 
81  Edge(const double length,
82  SpacePointID_t firstPointID,
83  SpacePointID_t secondPointID,
84  ID_t id = InvalidID);
85 
93  Edge(SpacePoint const& firstPoint, SpacePoint const& secondPoint, ID_t id = InvalidID);
94 
97 
99  double Length() const { return fLength; }
100 
103 
106 
108  ID_t ID() const { return fID; }
109 
111 
112  private:
114  double fLength = 0.0;
121 
122  }; // class Edge
123 
125  std::ostream& operator<<(std::ostream& o, const Edge& a);
126 
128  inline bool operator<(const Edge& a, const Edge& b)
129  {
130  return a.ID() < b.ID();
131  }
133  inline bool operator<(const Edge& e, Edge::ID_t id)
134  {
135  return e.ID() < id;
136  }
138  inline bool operator<(Edge::ID_t id, const Edge& e)
139  {
140  return id < e.ID();
141  }
142 
143 } // namespace recob
144 
145 #endif // LARDATAOBJ_RECOBASE_EDGE_H
Reconstruction base classes.
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:188
int ID_t
type of spacepoint ID
Definition: SpacePoint.h:26
static constexpr ID_t InvalidID
Special value for an invalid edge ID.
Definition: Edge.h:68
double Length() const
Returns the length of this edge [cm].
Definition: Edge.h:99
SpacePointID_t FirstPointID() const
Returns the ID of the SpacePoint this edge emanates from.
Definition: Edge.h:102
unsigned int ID_t
Type to represent recob::Edge IDs.
Definition: Edge.h:62
static constexpr ID_t InvalidID
Special value for an invalid ID.
Definition: SpacePoint.h:29
double fLength
Length of this Edge [cm].
Definition: Edge.h:114
SpacePointID_t fSecondPointID
ID of the SpacePoint edge ends on.
Definition: Edge.h:118
SpacePointID_t fFirstPointID
ID of the SpacePoint edge emanates from.
Definition: Edge.h:116
ID_t fID
Edge ID.
Definition: Edge.h:120
Edge()=default
Default constructor (all invalid IDs).
ID_t ID() const
Returns the ID of this edge.
Definition: Edge.h:108
Float_t e
Definition: plot.C:35
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:168
Edge is an object containing the results of a Principal Components Analysis of a group of space point...
Definition: Edge.h:59
recob::SpacePoint::ID_t SpacePointID_t
Type to represent recob::SpacePoint IDs.
Definition: Edge.h:65
SpacePointID_t SecondPointID() const
Returns the ID of the SpacePoint this edge ends on.
Definition: Edge.h:105