CMS 3D CMS Logo

KinematicParameters.h
Go to the documentation of this file.
1 #ifndef KinematicParameters_H
2 #define KinematicParameters_H
3 
7 
16 public:
17  typedef ROOT::Math::SVector<double, 7> AlgebraicVector7;
18 
20 
21  template <typename... Args>
22  KinematicParameters(Args... args) : par(args...), vl(true) {}
23 
25 
31  AlgebraicVector7 const& vector() const { return par; }
32 
38  double operator()(const int i) const { return par(i); }
39 
43  GlobalVector momentum() const { return GlobalVector(par[3], par[4], par[5]); }
44 
48  GlobalPoint position() const { return GlobalPoint(par[0], par[1], par[2]); }
49 
53  double mass() const { return par(6); }
54 
58  double energy() const { return sqrt(par(3) * par(3) + par(4) * par(4) + par(5) * par(5) + par(6) * par(6)); }
59 
60  bool isValid() const { return vl; }
61 
62 private:
64  bool vl;
65 };
66 
67 #endif
AlgebraicVector7 const & vector() const
The full vector (7 elements)
AlgebraicVector7 par
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T sqrt(T t)
Definition: SSEVec.h:19
GlobalVector momentum() const
KinematicParameters(Args... args)
GlobalPoint position() const
double operator()(const int i) const
Allows to access directly one component of the vector (index between 0 and 6)
Global3DVector GlobalVector
Definition: GlobalVector.h:10
KinematicParameters(const AlgebraicVector7 &pr)