File indexing completed on 2024-04-06 12:29:12
0001 #ifndef KinematicParameters_H
0002 #define KinematicParameters_H
0003
0004 #include "RecoVertex/KinematicFitPrimitives/interface/Matrices.h"
0005 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0006 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0007
0008
0009
0010
0011
0012
0013
0014
0015 class KinematicParameters {
0016 public:
0017 typedef ROOT::Math::SVector<double, 7> AlgebraicVector7;
0018
0019 KinematicParameters() : vl(false) {}
0020
0021 template <typename... Args>
0022 KinematicParameters(Args... args) : par(args...), vl(true) {}
0023
0024 KinematicParameters(const AlgebraicVector7& pr) : par(pr), vl(true) {}
0025
0026
0027
0028
0029
0030
0031 AlgebraicVector7 const& vector() const { return par; }
0032
0033
0034
0035
0036
0037
0038 double operator()(const int i) const { return par(i); }
0039
0040
0041
0042
0043 GlobalVector momentum() const { return GlobalVector(par[3], par[4], par[5]); }
0044
0045
0046
0047
0048 GlobalPoint position() const { return GlobalPoint(par[0], par[1], par[2]); }
0049
0050
0051
0052
0053 double mass() const { return par(6); }
0054
0055
0056
0057
0058 double energy() const { return sqrt(par(3) * par(3) + par(4) * par(4) + par(5) * par(5) + par(6) * par(6)); }
0059
0060 bool isValid() const { return vl; }
0061
0062 private:
0063 AlgebraicVector7 par;
0064 bool vl;
0065 };
0066
0067 #endif