CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CartesianStateAdaptor.h
Go to the documentation of this file.
1 #ifndef CartesianStateAdaptor_H
2 #define CartesianStateAdaptor_H
4 
5 #include "RKSmallVector.h"
7 
9 public:
10  typedef float Scalar;
12 
13  CartesianStateAdaptor(const RKSmallVector<double, 6>& rk) : pos_(rk[0], rk[1], rk[2]), mom_(rk[3], rk[4], rk[5]) {}
14 
15  const Vector3D& position() const { return pos_; }
16  const Vector3D& momentum() const { return mom_; }
17 
18  static Vector3D position(const RKSmallVector<double, 6>& rk) { return Vector3D(rk[0], rk[1], rk[2]); }
19 
20  static Vector3D momentum(const RKSmallVector<double, 6>& rk) { return Vector3D(rk[3], rk[4], rk[5]); }
21 
22  static RKSmallVector<double, 6> rkstate(const Vector3D& pos, const Vector3D& mom) {
24  res[0] = pos.x();
25  res[1] = pos.y();
26  res[2] = pos.z();
27  res[3] = mom.x();
28  res[4] = mom.y();
29  res[5] = mom.z();
30  return res;
31  }
32 
33 private:
36 };
37 
38 #endif
static Vector3D momentum(const RKSmallVector< double, 6 > &rk)
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
ROOT::Math::SVector< T, N > RKSmallVector
Definition: RKSmallVector.h:13
static Vector3D position(const RKSmallVector< double, 6 > &rk)
T z() const
Cartesian z coordinate.
const Vector3D & momentum() const
#define dso_internal
Definition: Visibility.h:13
Basic3DVector< Scalar > Vector3D
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
const Vector3D & position() const
CartesianStateAdaptor(const RKSmallVector< double, 6 > &rk)