00001 #ifndef RKCartesianDistance_H 00002 #define RKCartesianDistance_H 00003 00004 #include "TrackPropagation/RungeKutta/interface/RKDistance.h" 00005 #include "TrackPropagation/RungeKutta/interface/RKSmallVector.h" 00006 #include "TrackPropagation/RungeKutta/interface/CartesianStateAdaptor.h" 00007 00008 #include <cmath> 00009 00011 00012 class RKCartesianDistance : public RKDistance<double,6> { 00013 public: 00014 00015 typedef double Scalar; 00016 typedef RKSmallVector<double,6> Vector; 00017 00018 virtual ~RKCartesianDistance() {} 00019 00020 virtual Scalar operator()( const Vector& rka, const Vector& rkb, const Scalar& s) const { 00021 CartesianStateAdaptor a(rka), b(rkb); 00022 00023 return (a.position()-b.position()).mag() + 00024 (a.momentum() - b.momentum()).mag() / b.momentum().mag(); 00025 } 00026 00027 }; 00028 00029 #endif