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 
11  typedef double Scalar;
14 
16  CartesianState( const Vector& v, Scalar s) : par_(v), charge_(s) {}
17  CartesianState( const Vector3D& pos, const Vector3D& mom, Scalar s) :
18  par_(pos,mom), charge_(s) {}
19 
20  const Vector3D& position() const { return par_.first();}
21  const Vector3D& momentum() const { return par_.second();}
22 
23  const Vector& parameters() const { return par_;}
24 
25  Scalar charge() const { return charge_;}
26 
27 private:
28 
29  Vector par_;
30  Scalar charge_;
31 
32 };
33 
34 inline CartesianState
36  return CartesianState(a.parameters()+b.parameters(), a.charge());
37 }
38 
39 inline CartesianState
41  return CartesianState(a.parameters()-b.parameters(), a.charge());
42 }
43 
45  return CartesianState( v.parameters()*s, v.charge());
46 }
48  return CartesianState( v.parameters()*s, v.charge());
49 }
50 
52  return CartesianState( v.parameters()/s, v.charge());
53 }
54 
55 
56 #endif
CartesianState operator+(const CartesianState &a, const CartesianState &b)
CartesianState operator-(const CartesianState &a, const CartesianState &b)
Basic3DVector< Scalar > Vector3D
const Vector & parameters() const
Scalar charge() const
#define dso_internal
Definition: Visibility.h:13
double b
Definition: hdecay.h:120
const Vector3D & momentum() const
VectorDoublet< Vector3D, Vector3D > Vector
double a
Definition: hdecay.h:121
CartesianState(const Vector &v, Scalar s)
CartesianState(const Vector3D &pos, const Vector3D &mom, Scalar s)
const Vector3D & position() const
CartesianState operator/(const CartesianState &v, const CartesianState::Scalar &s)
CartesianState operator*(const CartesianState &v, const CartesianState::Scalar &s)