00001
00002
00003
00004
00005 #include "Kernel/ParabolaTraj.h"
00006 #include "GaudiKernel/SystemOfUnits.h"
00007 using namespace LHCb;
00008 using namespace ROOT::Math;
00009
00010 std::auto_ptr<Trajectory> ParabolaTraj::clone() const
00011 {
00012 return std::auto_ptr<Trajectory>(new ParabolaTraj(*this));
00013 }
00014
00016 ParabolaTraj::ParabolaTraj( const Point& point,
00017 const Vector& dir,
00018 const Vector& curv,
00019 const Range& range)
00020 : Trajectory(range),
00021 m_pos(point),
00022 m_dir(dir.unit()),
00023 m_curv(curv)
00024 {
00025 };
00026
00028 Trajectory::Point ParabolaTraj::position( double arclength ) const
00029 {
00030 return m_pos + arclength * (m_dir + 0.5 * arclength * m_curv);
00031 };
00032
00034 Trajectory::Vector ParabolaTraj::direction( double arclength ) const
00035 {
00036 return m_dir + arclength * m_curv;
00037 };
00038
00040 Trajectory::Vector ParabolaTraj::curvature( double ) const
00041 {
00042 return m_curv;
00043 };
00044
00047 void ParabolaTraj::expansion( double arclength,
00048 Point& p,
00049 Vector& dp,
00050 Vector& ddp ) const
00051 {
00052 ddp = m_curv;
00053 dp = m_dir + arclength*m_curv;
00054 p = m_pos + arclength* (m_dir + 0.5 * arclength * m_curv);
00055 };
00056
00059 double ParabolaTraj::muEstimate( const Point& point ) const
00060 {
00061 Vector r = point - m_pos;
00062 if (m_curv.R()<0.01*m_dir.R()) {
00063 return r.Dot(m_dir);
00064 }
00065
00066 Vector normal = m_dir.Cross(m_curv).unit();
00067 r -= normal.Dot(r)*normal;
00068
00069
00070
00071 double x = r.Dot(m_dir);
00072 double y = r.Dot(m_curv);
00073
00074
00075
00076
00077
00078 return x/(1-y);
00079 };
00080
00083 double ParabolaTraj::distTo1stError( double , double tolerance , int ) const
00084 {
00085 return std::sqrt(2*tolerance/m_curv.R());
00086 };
00087
00089 double ParabolaTraj::distTo2ndError( double , double , int ) const
00090 {
00091 return 10*Gaudi::Units::km;
00092 };