16 #ifndef TreeFitter_LineTool_h
17 #define TreeFitter_LineTool_h 1
31 Line (
const TVector3& p0 ,
const TVector3& v0 ) :
m_p0 ( p0 ) ,
m_v0 ( v0 ) {}
46 <<
m_v0.x()<<
" " <<
m_v0.y() <<
" " <<
m_v0.z() <<
")\n"
61 return rhs.fillStream(os);
77 const double a00 = line0.
direction().Mag2() ;
79 const double a01 = -a10 ;
80 const double a11 = -line1.
direction().Mag2() ;
83 const double det = ( a00 * a11 - a01 * a10 ) ;
91 const double detinv = 1.0 / det;
96 const double b0 = p1_p0.Dot ( line0.
direction() ) ;
101 mu0 = ( b0 * a11 - b1 * a01 ) * detinv ;
102 mu1 = ( a00 * b1 - a10 * b0 ) * detinv ;
TVector3 operator()(const double mu) const
const TVector3 & direction() const
Line(const TVector3 &p0, const TVector3 &v0)
friend F32vec4 fabs(const F32vec4 &a)
std::ostream & fillStream(std::ostream &os) const
TVector3 position(const double mu) const
bool closestPointParams(const Line &line0, const Line &line1, double &mu0, double &mu1)
const TVector3 & beginPoint() const