CMS 3D CMS Logo

CartesianState.h
Go to the documentation of this file.
1 #ifndef CartesianState_H
2 #define CartesianState_H
3 
6 #include "VectorDoublet.h"
7 
9 public:
10  typedef double Scalar;
13 
15  CartesianState(const Vector& v, Scalar s) : par_(v), charge_(s) {}
16  CartesianState(const Vector3D& pos, const Vector3D& mom, Scalar s) : par_(pos, mom), charge_(s) {}
17 
18  const Vector3D& position() const { return par_.first(); }
19  const Vector3D& momentum() const { return par_.second(); }
20 
21  const Vector& parameters() const { return par_; }
22 
23  Scalar charge() const { return charge_; }
24 
25 private:
28 };
29 
31  return CartesianState(a.parameters() + b.parameters(), a.charge());
32 }
33 
35  return CartesianState(a.parameters() - b.parameters(), a.charge());
36 }
37 
39  return CartesianState(v.parameters() * s, v.charge());
40 }
42  return CartesianState(v.parameters() * s, v.charge());
43 }
44 
46  return CartesianState(v.parameters() / s, v.charge());
47 }
48 
49 #endif
const Vector & parameters() const
const Vector3D & momentum() const
CartesianState operator+(const CartesianState &a, const CartesianState &b)
CartesianState operator-(const CartesianState &a, const CartesianState &b)
Basic3DVector< Scalar > Vector3D
#define dso_internal
Definition: Visibility.h:13
const Vector3D & position() const
double b
Definition: hdecay.h:118
Scalar charge() const
double a
Definition: hdecay.h:119
CartesianState(const Vector &v, Scalar s)
CartesianState(const Vector3D &pos, const Vector3D &mom, Scalar s)
VectorDoublet< Vector3D, Vector3D > Vector
CartesianState operator/(const CartesianState &v, const CartesianState::Scalar &s)
CartesianState operator*(const CartesianState &v, const CartesianState::Scalar &s)