CMS 3D CMS Logo

CurvilinearTrajectoryError.h
Go to the documentation of this file.
1 #ifndef _TRACKER_CURVILINEARTRAJECTORYERROR_H_
2 #define _TRACKER_CURVILINEARTRAJECTORYERROR_H_
3 
7 
28 public:
30  enum { dimension = 5 };
33 
34  // construct
36 
38  theCovarianceMatrix(0, 0) = -99999.e10;
39  }
40 
44  CurvilinearTrajectoryError(const AlgebraicSymMatrix55 &aCovarianceMatrix) : theCovarianceMatrix(aCovarianceMatrix) {}
45  template <typename M55>
46  CurvilinearTrajectoryError(const M55 &aCovarianceMatrix) : theCovarianceMatrix(aCovarianceMatrix) {}
47 
48  bool invalid() const { return theCovarianceMatrix(0, 0) < -1.e10; }
49  bool valid() const { return !invalid(); }
50 
51  // not really full check of posdef
52  bool posDef() const {
53  return (theCovarianceMatrix(0, 0) >= 0) && (theCovarianceMatrix(1, 1) >= 0) && (theCovarianceMatrix(2, 2) >= 0) &&
54  (theCovarianceMatrix(3, 3) >= 0) && (theCovarianceMatrix(4, 4) >= 0);
55  }
56 
57  // access
58 
61  const AlgebraicSymMatrix55 &matrix() const { return theCovarianceMatrix; }
62 
64 
69 
70  void zeroFieldScaling(double factor) {
71  double root_of_factor = sqrt(factor);
72  //scale the 0 indexed covariance by the factor
73  for (unsigned int i = 1; i != 5; ++i)
74  theCovarianceMatrix(i, 0) *= root_of_factor;
75 
76  //scale all others by the scared factor
77  for (unsigned int i = 1; i != 5; ++i)
78  for (unsigned int j = i; j != 5; ++j)
80  //term 0,0 is not scaled at all
81  }
82 
83  operator MathCovarianceMatrix &() { return theCovarianceMatrix; }
84  operator const MathCovarianceMatrix &() const { return theCovarianceMatrix; }
85 
86 private:
88 };
89 
90 #endif
CurvilinearTrajectoryError(const M55 &aCovarianceMatrix)
ErrorD< N >::type type
Definition: Error.h:32
T sqrt(T t)
Definition: SSEVec.h:23
const AlgebraicSymMatrix55 & matrix() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
CurvilinearTrajectoryError(const AlgebraicSymMatrix55 &aCovarianceMatrix)
AlgebraicSymMatrix55 theCovarianceMatrix
math::Error< dimension >::type MathCovarianceMatrix
5 parameter covariance matrix