HerdSoftware  0.3.2
Segment.h
Go to the documentation of this file.
1 /*
2  * Segment.h
3  *
4  * Created on: 4 Mar 2022
5  * Author: Valerio Formato
6  */
7 
8 #ifndef HERD_SEGMENT_H
9 #define HERD_SEGMENT_H
10 
11 // HerdSoftware headers
12 #include "common/DefaultValues.h"
13 #include "dataobjects/Point.h"
14 
15 namespace Herd {
16 
17 class Segment {
18 public:
20  Segment(Point start, Point end) : m_start(std::move(start)), m_end(std::move(end)) {}
21 
22  Point Start() { return m_start; }
23  Point End() { return m_end; }
24 
25  float Length() { return (m_end - m_start).Mag(); }
26 
27  bool operator==(const Segment &rhs) const { return m_start == rhs.m_start && m_end == rhs.m_end; }
28 
29 private:
32 };
33 
34 } // namespace Herd
35 
36 #endif
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
Segment(Point start, Point end)
Definition: Segment.h:20
#define DEFAULT_INIT(x)
Definition: DefaultValues.h:23
Point m_end
Definition: Segment.h:31
bool operator==(const Segment &rhs) const
Definition: Segment.h:27
A class describing a vector in 3D space.
Definition: Vec3D.h:33
Point m_start
Definition: Segment.h:30
float Length()
Definition: Segment.h:25
Point Start()
Definition: Segment.h:22
Segment()
Definition: Segment.h:19
Point End()
Definition: Segment.h:23
Definition: Segment.h:17