CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/TrackPropagation/RungeKutta/src/RKCartesianDistance.h

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