CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CurvilinearTrajectoryError.h
Go to the documentation of this file.
1 #ifndef _TRACKER_CURVILINEARTRAJECTORYERROR_H_
2 #define _TRACKER_CURVILINEARTRAJECTORYERROR_H_
3 
7 
28 public:
29 
31  enum { dimension = 5 };
34 
35 // construct
37 
39 
44  theCovarianceMatrix(aCovarianceMatrix) { }
45  template<typename M55>
46  CurvilinearTrajectoryError(const M55& aCovarianceMatrix) :
47  theCovarianceMatrix(aCovarianceMatrix) { }
48 
49 
50  bool invalid() const { return theCovarianceMatrix(0,0)<-1.e10;}
51  bool valid() const { return !invalid();}
52 
53  // not really full check of posdef
54  bool posDef() const {
55  return (theCovarianceMatrix(0,0)>=0) && (theCovarianceMatrix(1,1)>=0) &&
56  (theCovarianceMatrix(2,2)>=0) && (theCovarianceMatrix(3,3)>=0) && (theCovarianceMatrix(4,4)>=0);
57  }
58 
59 
60 // access
61 
64  const AlgebraicSymMatrix55 &matrix() const {
65  return theCovarianceMatrix;
66  }
67 
69  return theCovarianceMatrix;
70  }
71 
72 
76  void operator *= (double factor) {
78  }
79 
80  void zeroFieldScaling(double factor){
81  double root_of_factor = sqrt(factor);
82  //scale the 0 indexed covariance by the factor
83  for (unsigned int i=1;i!=5;++i) theCovarianceMatrix(i,0)*=root_of_factor;
84 
85  //scale all others by the scared factor
86  for (unsigned int i=1;i!=5;++i) for (unsigned int j=i;j!=5;++j) theCovarianceMatrix(i,j)*=factor;
87  //term 0,0 is not scaled at all
88  }
89 
90  operator MathCovarianceMatrix & () { return theCovarianceMatrix; }
91  operator const MathCovarianceMatrix &() const { return theCovarianceMatrix; }
92 
93 private:
95 };
96 
97 #endif
int i
Definition: DBlmapReader.cc:9
CurvilinearTrajectoryError(const M55 &aCovarianceMatrix)
ErrorD< N >::type type
Definition: Error.h:33
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
T sqrt(T t)
Definition: SSEVec.h:18
int j
Definition: DBlmapReader.cc:9
const AlgebraicSymMatrix55 & matrix() const
CurvilinearTrajectoryError(const AlgebraicSymMatrix55 &aCovarianceMatrix)
AlgebraicSymMatrix55 theCovarianceMatrix
math::Error< dimension >::type MathCovarianceMatrix
5 parameter covariance matrix