| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

ParabolaTraj.cpp

Go to the documentation of this file.
00001 // $Id: ParabolaTraj.cpp,v 1.12 2007/10/16 11:50:59 wouter Exp $
00002 // Include files
00003 
00004 // local
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 /* arclength */) 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()) { // small curvature limit: neglect curvature
00063      return r.Dot(m_dir);
00064   }
00065   // get vector from m_pos to point projected into plane of parabola
00066   Vector normal = m_dir.Cross(m_curv).unit();
00067   r -= normal.Dot(r)*normal;
00068   // get normalized 'x' and 'y' coordinates of this vector by projecting onto the
00069   // axis. In terms of these, the parabola is parameterized as (arclen, arclen^2/2)
00070   // (i.e. arclen is actually the distance along the 'x' coordinate!)
00071   double x = r.Dot(m_dir);
00072   double y = r.Dot(m_curv);
00073   //  now we need to minimize the distance between (x,y) and (s,s*s/2)
00074   //  where s is the arclen (well, not quite, but that is what we really
00075   //  use in 'point(arclen)' ;-)
00076   //  This requires solving a 3rd order polynomial, so we assume m_curve<<1
00077   //  and solve a linear equation instead.
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 };
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:03:13 2011 for LHCbKernel by doxygen 1.4.7