StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Line.hh
1 
7 #ifndef Line_hh
8 #define Line_hh
9 
12 #include <utility>
13 using std::pair;
14 
18 #include "StThreeVectorD.hh"
19 
23 class Line {
24 public:
25  Line() {}
26  Line(const StThreeVectorD& o, const StThreeVectorD& d);
27 
31  StThreeVectorD origin() const;
32 
36  StThreeVectorD direction() const;
37 
43  StThreeVectorD at(double pathlength) const;
44 
50  StThreeVectorD perigee(const StThreeVectorD& point) const;
51 
57  StThreeVectorD dca(const Line& line) const;
58 
64  double pathlength(const StThreeVectorD& point) const;
65 
74  pair<double, double> pathlengths(const Line& line) const;
75 
80  void setOrigin(const StThreeVectorD& o);
81 
87  void setDirection(const StThreeVectorD& d);
88 
89 private:
90  StThreeVectorD mOrigin;
91  StThreeVectorD mDirection;
92 };
93 
94 inline StThreeVectorD Line::origin() const { return mOrigin; }
95 inline StThreeVectorD Line::direction() const { return mDirection; }
96 inline void Line::setOrigin(const StThreeVectorD& o) { mOrigin = o; }
97 inline void Line::setDirection(const StThreeVectorD& d) { mDirection = d.unit(); }
98 
99 #endif
StThreeVectorD at(double pathlength) const
Point at a given path length along the line.
Definition: Line.cc:16
STAR includes.
Definition: Line.hh:23
void setDirection(const StThreeVectorD &d)
Set the direction of the line to a given vector. The direction is normalized to the unit vector...
Definition: Line.hh:97
StThreeVectorD perigee(const StThreeVectorD &point) const
Perigee, i.e. Closest point on the line to a given point.
Definition: Line.cc:26
StThreeVectorD dca(const Line &line) const
DCA = Distance of Closest Approach to a given line.
Definition: Line.cc:31
double pathlength(const StThreeVectorD &point) const
Pathlength of a given point from the origin of the line.
Definition: Line.cc:21
StThreeVectorD direction() const
Direction vector of the line (normalized to the unit vector)
Definition: Line.hh:95
StThreeVectorD origin() const
Origin of the line.
Definition: Line.hh:94
pair< double, double > pathlengths(const Line &line) const
Pathlengths of the points of closest approach between the lines.
Definition: Line.cc:41
void setOrigin(const StThreeVectorD &o)
Set the origin of the line to a given point.
Definition: Line.hh:96