Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:44

0001 #ifndef RKCylindricalDistance_H
0002 #define RKCylindricalDistance_H
0003 #include "FWCore/Utilities/interface/Visibility.h"
0004 
0005 #include "RKDistance.h"
0006 #include "RKSmallVector.h"
0007 #include "CylindricalState.h"
0008 
0009 template <typename T, int N>
0010 class dso_internal RKCylindricalDistance final : public RKDistance<T, N> {
0011 public:
0012   typedef T Scalar;
0013   typedef RKSmallVector<T, N> Vector;
0014 
0015   ~RKCylindricalDistance() override {}
0016 
0017   Scalar operator()(const Vector& a, const Vector& b, const Scalar& rho) const override {
0018     CylindricalState astate(rho, a, 1.);
0019     CylindricalState bstate(rho, b, 1.);
0020     return (astate.position() - bstate.position()).mag() +
0021            (astate.momentum() - bstate.momentum()).mag() / bstate.momentum().mag();
0022   }
0023 };
0024 
0025 #endif