16 #ifndef TreeFitter_LineTool_h 17 #define TreeFitter_LineTool_h 1 29 Line(
const TVector3 &p0,
const TVector3 &v0) : m_p0(p0), m_v0(v0) {}
40 os <<
"\np0 (" << m_p0.x() <<
" " << m_p0.y() <<
" " << m_p0.z() <<
") direction (" << m_v0.x() <<
" " << m_v0.y() <<
" " << m_v0.z() <<
")\n" << std::endl;
65 const double a00 = line0.
direction().Mag2();
67 const double a01 = -a10;
68 const double a11 = -line1.
direction().Mag2();
71 const double det = (a00 * a11 - a01 * a10);
76 const double detinv = 1.0 / det;
81 const double b0 = p1_p0.Dot(line0.
direction());
82 const double b1 = p1_p0.Dot(line1.
direction());
86 mu0 = (b0 * a11 - b1 * a01) * detinv;
87 mu1 = (a00 * b1 - a10 * b0) * detinv;
TVector3 position(const double mu) const
std::ostream & fillStream(std::ostream &os) const
std::ostream & operator<<(std::ostream &os, const Line &rhs)
const TVector3 & beginPoint() const
Line(const TVector3 &p0, const TVector3 &v0)
friend F32vec4 fabs(const F32vec4 &a)
const TVector3 & direction() const
TVector3 operator()(const double mu) const
bool closestPointParams(const Line &line0, const Line &line1, double &mu0, double &mu1)