CMS 3D CMS Logo

CartesianStateAdaptor.h
Go to the documentation of this file.
1 #ifndef CartesianStateAdaptor_H
2 #define CartesianStateAdaptor_H
3 
4 #include "RKSmallVector.h"
6 
8 public:
9 
10  typedef float Scalar;
12 
14  pos_(rk[0], rk[1], rk[2]), mom_(rk[3], rk[4], rk[5]) {}
15 
16  const Vector3D& position() const { return pos_;}
17  const Vector3D& momentum() const { return mom_;}
18 
19  static Vector3D position(const RKSmallVector<double,6>& rk) {
20  return Vector3D(rk[0], rk[1], rk[2]);
21  }
22 
23  static Vector3D momentum(const RKSmallVector<double,6>& rk) {
24  return Vector3D(rk[3], rk[4], rk[5]);
25  }
26 
27  static RKSmallVector<double,6> rkstate( const Vector3D& pos, const Vector3D& mom) {
29  res[0] = pos.x();
30  res[1] = pos.y();
31  res[2] = pos.z();
32  res[3] = mom.x();
33  res[4] = mom.y();
34  res[5] = mom.z();
35  return res;
36  }
37 
38 private:
39 
40  Vector3D pos_;
41  Vector3D mom_;
42 
43 };
44 
45 #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
Definition: Electron.h:6
static Vector3D position(const RKSmallVector< double, 6 > &rk)
T z() const
Cartesian z coordinate.
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
const Vector3D & momentum() const
Basic3DVector< Scalar > Vector3D
#define dso_internal
const Vector3D & position() const
CartesianStateAdaptor(const RKSmallVector< double, 6 > &rk)