00001 #ifndef RKCylindricalDistance_H 00002 #define RKCylindricalDistance_H 00003 00004 #include "TrackPropagation/RungeKutta/interface/RKDistance.h" 00005 #include "TrackPropagation/RungeKutta/interface/RKSmallVector.h" 00006 #include "TrackPropagation/RungeKutta/interface/CylindricalState.h" 00007 00008 template <typename T, int N> 00009 class RKCylindricalDistance : public RKDistance<T,N> { 00010 public: 00011 00012 typedef T Scalar; 00013 typedef RKSmallVector<T,N> Vector; 00014 00015 virtual ~RKCylindricalDistance() {} 00016 00017 virtual Scalar operator()( const Vector& a, const Vector& b, const Scalar& rho) const { 00018 CylindricalState astate(rho,a,1.); 00019 CylindricalState bstate(rho,b,1.); 00020 return (astate.position()-bstate.position()).mag() + 00021 (astate.momentum()-bstate.momentum()).mag() / bstate.momentum().mag(); 00022 } 00023 00024 }; 00025 00026 #endif