00001
00007 #ifndef Line_hh
00008 #define Line_hh
00009
00012 #include <utility>
00013 using std::pair;
00014
00018 #include "StThreeVectorD.hh"
00019
00023 class Line {
00024 public:
00025 Line() {}
00026 Line(const StThreeVectorD& o, const StThreeVectorD& d);
00027
00031 StThreeVectorD origin() const;
00032
00036 StThreeVectorD direction() const;
00037
00043 StThreeVectorD at(double pathlength) const;
00044
00050 StThreeVectorD perigee(const StThreeVectorD& point) const;
00051
00057 StThreeVectorD dca(const Line& line) const;
00058
00064 double pathlength(const StThreeVectorD& point) const;
00065
00074 pair<double, double> pathlengths(const Line& line) const;
00075
00080 void setOrigin(const StThreeVectorD& o);
00081
00087 void setDirection(const StThreeVectorD& d);
00088
00089 private:
00090 StThreeVectorD mOrigin;
00091 StThreeVectorD mDirection;
00092 };
00093
00094 inline StThreeVectorD Line::origin() const { return mOrigin; }
00095 inline StThreeVectorD Line::direction() const { return mDirection; }
00096 inline void Line::setOrigin(const StThreeVectorD& o) { mOrigin = o; }
00097 inline void Line::setDirection(const StThreeVectorD& d) { mDirection = d.unit(); }
00098
00099 #endif