00001
00002
00003
00004
00005 #include "Kernel/LineTraj.h"
00006 #include "GaudiKernel/SystemOfUnits.h"
00007 using namespace LHCb;
00008 using namespace ROOT::Math;
00009
00010 std::auto_ptr<Trajectory> LineTraj::clone() const
00011 {
00012 return std::auto_ptr<Trajectory>(new LineTraj(*this));
00013 }
00014
00015
00017 LineTraj::LineTraj( const Point& begPoint,
00018 const Point& endPoint )
00019 : Trajectory(-(XYZVector(endPoint-begPoint)).r()/2.,(XYZVector(endPoint-begPoint)).r()/2.),
00020 m_dir(endPoint-begPoint),
00021 m_pos(begPoint+0.5*m_dir)
00022 {
00023 m_dir = m_dir.Unit();
00024 };
00025
00027 Trajectory::Point LineTraj::position( double arclength ) const
00028 {
00029 return m_pos + arclength * m_dir;
00030 };
00031
00033 Trajectory::Vector LineTraj::direction( double ) const
00034 {
00035 return m_dir;
00036 };
00037
00039 Trajectory::Vector LineTraj::curvature( double ) const
00040 {
00041 return Vector(0,0,0);
00042 };
00043
00046 void LineTraj::expansion( double arclength,
00047 Point& p,
00048 Vector& dp,
00049 Vector& ddp ) const
00050 {
00051 ddp = Vector(0,0,0);
00052 dp = m_dir;
00053 p = m_pos + arclength * m_dir;
00054 };
00055
00058 double LineTraj::muEstimate( const Point& point ) const
00059 {
00060 return m_dir.Dot(point-m_pos);
00061 };
00062
00063
00064 double LineTraj::distTo1stError( double , double , int ) const
00065 {
00066 return 10*Gaudi::Units::km;
00067 };
00068
00069
00070 double LineTraj::distTo2ndError( double , double , int ) const
00071 {
00072 return 10*Gaudi::Units::km;
00073 };