File indexing completed on 2023-03-17 11:23:25
0001 #ifndef ExtendedPerigeeTrajectoryError_H
0002 #define ExtendedPerigeeTrajectoryError_H
0003
0004 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006
0007 class ExtendedPerigeeTrajectoryError {
0008 public:
0009 ExtendedPerigeeTrajectoryError() : weightAvailable(false), vl(false) {}
0010
0011 ExtendedPerigeeTrajectoryError(const AlgebraicSymMatrix66& covariance)
0012 : cov(covariance), weightAvailable(false), vl(true) {}
0013
0014
0015
0016
0017
0018 bool isValid() const { return vl; }
0019
0020 bool weightIsAvailable() const { return weightAvailable; }
0021
0022 const AlgebraicSymMatrix66& covarianceMatrix() const { return cov; }
0023
0024 const AlgebraicSymMatrix66& weightMatrix(int& error) const {
0025 error = 0;
0026 if (!weightIsAvailable()) {
0027 weight = cov.Inverse(error);
0028 if (error != 0)
0029 LogDebug("RecoVertex/ExtendedPerigeeTrajectoryError") << "unable to invert covariance matrix\n";
0030 weightAvailable = true;
0031 }
0032 return weight;
0033 }
0034
0035 private:
0036 AlgebraicSymMatrix66 cov;
0037 mutable AlgebraicSymMatrix66 weight;
0038 mutable bool weightAvailable;
0039 mutable bool vl;
0040 };
0041 #endif