CMS 3D CMS Logo

RKCurvilinearDistance.h
Go to the documentation of this file.
1 #ifndef RKCurvilinearDistance_H
2 #define RKCurvilinearDistance_H
3 
6 #include "RKDistance.h"
7 #include "RKSmallVector.h"
8 
9 template <typename T, int N>
11 public:
12  typedef T Scalar;
14 
15  ~RKCurvilinearDistance() override {}
16 
17  Scalar operator()(const Vector& a, const Vector& b, const Scalar& s) const override {
18  Basic3DVector<Scalar> amom = momentum(a);
19  Basic3DVector<Scalar> bmom = momentum(b);
20 
21  return sqrt(sqr(a(0) - b(0)) + sqr(a(1) - b(1))) + (amom - bmom).mag() / bmom.mag();
22  }
23 
25  Scalar k = sqrt(1 + sqr(v(2)) + sqr(v(3)));
26  Scalar p = std::abs(1 / v(4));
27  Scalar pz = p / k;
28  return Basic3DVector<Scalar>(v(2) * pz, v(3) * pz, pz);
29  }
30 
31  T sqr(const T& t) const { return t * t; }
32 };
33 
34 #endif
RKCurvilinearDistance::operator()
Scalar operator()(const Vector &a, const Vector &b, const Scalar &s) const override
Definition: RKCurvilinearDistance.h:17
Visibility.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Basic3DVector.h
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
findQualityFiles.v
v
Definition: findQualityFiles.py:179
Basic3DVector::mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: extBasic3DVector.h:116
RKCurvilinearDistance::Scalar
T Scalar
Definition: RKCurvilinearDistance.h:12
alignCSCRings.s
s
Definition: alignCSCRings.py:92
RKCurvilinearDistance::sqr
T sqr(const T &t) const
Definition: RKCurvilinearDistance.h:31
RKSmallVector
ROOT::Math::SVector< T, N > RKSmallVector
Definition: RKSmallVector.h:13
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqmdumpme.k
k
Definition: dqmdumpme.py:60
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
dso_internal
#define dso_internal
Definition: Visibility.h:13
RKCurvilinearDistance::~RKCurvilinearDistance
~RKCurvilinearDistance() override
Definition: RKCurvilinearDistance.h:15
RKCurvilinearDistance::momentum
Basic3DVector< Scalar > momentum(const Vector &v) const
Definition: RKCurvilinearDistance.h:24
RKDistance.h
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
T
long double T
Definition: Basic3DVectorLD.h:48
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
RKSmallVector.h
RKCurvilinearDistance
Definition: RKCurvilinearDistance.h:10
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
RKCurvilinearDistance::Vector
RKSmallVector< T, N > Vector
Definition: RKCurvilinearDistance.h:13
Basic3DVector< Scalar >
RKDistance
Definition: RKDistance.h:8