LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 
14 // LArSoft libraries
16 
17 // C/C++ libraries
18 #include <limits> // std::numeric_limits<>
19 #include <iosfwd> // std::ostream
20 
21 namespace recob
22 {
23 
61  class Edge
62  {
63  public:
64 
66  using ID_t = unsigned int;
67 
70 
73 
74 
76  Edge() = default;
77 
86  Edge(
87  const double length,
88  SpacePointID_t firstPointID, SpacePointID_t secondPointID,
89  ID_t id = InvalidID
90  );
91 
99  Edge(
100  SpacePoint const& firstPoint, SpacePoint const& secondPoint,
101  ID_t id = InvalidID
102  );
103 
106 
108  double Length() const
109  { return fLength; }
110 
113  { return fFirstPointID; }
114 
117  { return fSecondPointID; }
118 
120  ID_t ID() const
121  { return fID; }
122 
124 
125  private:
126 
128  double fLength = 0.0;
135 
136  }; // class Edge
137 
138 
140  std::ostream& operator << (std::ostream & o, const Edge& a);
141 
142 
144  inline bool operator< (const Edge& a, const Edge& b)
145  { return a.ID() < b.ID(); }
147  inline bool operator< (const Edge& e, Edge::ID_t id)
148  { return e.ID() < id; }
150  inline bool operator< (Edge::ID_t id, const Edge& e)
151  { return id < e.ID(); }
152 
153 } // namespace recob
154 
155 
156 
157 #endif // LARDATAOBJ_RECOBASE_EDGE_H
Reconstruction base classes.
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
int ID_t
type of spacepoint ID
Definition: SpacePoint.h:24
static constexpr ID_t InvalidID
Special value for an invalid edge ID.
Definition: Edge.h:72
double Length() const
Returns the length of this edge [cm].
Definition: Edge.h:108
SpacePointID_t FirstPointID() const
Returns the ID of the SpacePoint this edge emanates from.
Definition: Edge.h:112
Int_t max
Definition: plot.C:27
unsigned int ID_t
Type to represent recob::Edge IDs.
Definition: Edge.h:66
static constexpr ID_t InvalidID
Special value for an invalid ID.
Definition: SpacePoint.h:27
double fLength
Length of this Edge [cm].
Definition: Edge.h:128
SpacePointID_t fSecondPointID
ID of the SpacePoint edge ends on.
Definition: Edge.h:132
SpacePointID_t fFirstPointID
ID of the SpacePoint edge emanates from.
Definition: Edge.h:130
ID_t fID
Edge ID.
Definition: Edge.h:134
Edge()=default
Default constructor (all invalid IDs).
ID_t ID() const
Returns the ID of this edge.
Definition: Edge.h:120
Float_t e
Definition: plot.C:34
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:173
Edge is an object containing the results of a Principal Components Analysis of a group of space point...
Definition: Edge.h:61
recob::SpacePoint::ID_t SpacePointID_t
Type to represent recob::SpacePoint IDs.
Definition: Edge.h:69
SpacePointID_t SecondPointID() const
Returns the ID of the SpacePoint this edge ends on.
Definition: Edge.h:116