CMS 3D CMS Logo

RKCartesianDistance.h
Go to the documentation of this file.
1 #ifndef RKCartesianDistance_H
2 #define RKCartesianDistance_H
3 
6 #include "RKDistance.h"
7 #include "RKSmallVector.h"
9 
10 #include <cmath>
11 
13 
14 class dso_internal RKCartesianDistance final : public RKDistance<double,6> {
15 public:
16 
17  typedef double Scalar;
19 
20  ~RKCartesianDistance() override {}
21 
22  Scalar operator()( const Vector& rka, const Vector& rkb, const Scalar& s) const override {
23  CartesianStateAdaptor a(rka), b(rkb);
24 
25  return (a.position()-b.position()).mag() +
26  (a.momentum() - b.momentum()).mag() / b.momentum().mag();
27  }
28 
29 };
30 
31 #endif
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
ROOT::Math::SVector< T, N > RKSmallVector
Definition: RKSmallVector.h:13
Estimator of the distance between two state vectors, e.g. for convergence test.
const Vector3D & momentum() const
#define dso_internal
Definition: Visibility.h:13
Scalar operator()(const Vector &rka, const Vector &rkb, const Scalar &s) const override
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
const Vector3D & position() const
RKSmallVector< double, 6 > Vector