CMS 3D CMS Logo

KinematicParameters.h
Go to the documentation of this file.
1 #ifndef KinematicParameters_H
2 #define KinematicParameters_H
3 
7 
17 
18 public:
19 
20  typedef ROOT::Math::SVector<double,7> AlgebraicVector7;
21 
23 
24  template<typename... Args>
26 
27  KinematicParameters(const AlgebraicVector7& pr): par(pr),vl(true)
28  {}
29 
35  AlgebraicVector7 const & vector() const {return par;}
36 
42  double operator()(const int i) const {return par(i);}
43 
47  GlobalVector momentum() const {return GlobalVector(par[3], par[4], par[5]);}
48 
52  GlobalPoint position() const {return GlobalPoint(par[0], par[1], par[2]);}
53 
57  double mass() const {return par(6);}
58 
62  double energy() const {
63  return sqrt(par(3)*par(3)+par(4)*par(4)+par(5)*par(5)+par(6)*par(6));
64  }
65 
66 
67  bool isValid() const
68  {return vl;}
69 
70 private:
71  AlgebraicVector7 par;
72  bool vl;
73 };
74 
75 
76 #endif
int i
Definition: DBlmapReader.cc:9
KinematicParameters(Args...args)
AlgebraicVector7 const & vector() const
The full vector (7 elements)
AlgebraicVector7 par
double operator()(const int i) const
Allows to access directly one component of the vector (index between 0 and 6)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double energy() const
T sqrt(T t)
Definition: SSEVec.h:18
ROOT::Math::SVector< double, 7 > AlgebraicVector7
GlobalPoint position() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalVector momentum() const
KinematicParameters(const AlgebraicVector7 &pr)