File indexing completed on 2024-04-06 12:31:30
0001 #ifndef SingleGaussianState_H
0002 #define SingleGaussianState_H
0003
0004 #define SMATRIX_USE_CONSTEXPR
0005
0006 #include "Math/SVector.h"
0007 #include "Math/SMatrix.h"
0008
0009
0010
0011
0012
0013 template <unsigned int N>
0014 class SingleGaussianState {
0015 public:
0016 using Vector = ROOT::Math::SVector<double, N>;
0017 using Matrix = ROOT::Math::SMatrix<double, N, N, ROOT::Math::MatRepSym<double, N>>;
0018
0019 public:
0020 SingleGaussianState() {}
0021
0022 SingleGaussianState(const Vector& aMean, const Matrix& aCovariance, double aWeight = 1.)
0023 : theCovariance(aCovariance), theMean(aMean), theWeight(aWeight) {}
0024
0025
0026 inline double weight() const { return theWeight; }
0027
0028 inline const Vector& mean() const { return theMean; }
0029
0030 inline const Matrix& covariance() const { return theCovariance; }
0031
0032 const Matrix& weightMatrix() const;
0033
0034 inline unsigned int dimension() const { return N; }
0035
0036 void rescaleWeight(double scale) { theWeight *= scale; }
0037
0038 private:
0039 Matrix theCovariance;
0040 Vector theMean;
0041 double theWeight;
0042
0043 mutable Matrix theWeightMatrix = ROOT::Math::SMatrixNoInit();
0044 mutable bool theHasWeightMatrix = false;
0045 };
0046
0047 #include "TrackingTools/GsfTools/interface/SingleGaussianState.icc"
0048
0049 #endif