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 
46  bool invalid() const { return theCovarianceMatrix(0,0)<-1.e10;}
47  bool valid() const { return !invalid();}
48 
49  // not really full check of posdef
50  bool posDef() const {
51  return (theCovarianceMatrix(0,0)>=0) && (theCovarianceMatrix(1,1)>=0) &&
52  (theCovarianceMatrix(2,2)>=0) && (theCovarianceMatrix(3,3)>=0) && (theCovarianceMatrix(4,4)>=0);
53  }
54 
55 
56 // access
57 
60  const AlgebraicSymMatrix55 &matrix() const {
61  return theCovarianceMatrix;
62  }
63 
67  void operator *= (double factor) {
68  theCovarianceMatrix *= factor;
69  }
70 
71  void zeroFieldScaling(double factor){
72  double root_of_factor = sqrt(factor);
73  //scale the 0 indexed covariance by the factor
74  for (unsigned int i=1;i!=5;++i) theCovarianceMatrix(i,0)*=root_of_factor;
75 
76  //scale all others by the scared factor
77  for (unsigned int i=1;i!=5;++i) for (unsigned int j=i;j!=5;++j) theCovarianceMatrix(i,j)*=factor;
78  //term 0,0 is not scaled at all
79  }
80 
82  operator const MathCovarianceMatrix &() const { return theCovarianceMatrix; }
83 
84 private:
86 };
87 
88 #endif
int i
Definition: DBlmapReader.cc:9
ErrorD< N >::type type
Definition: Error.h:29
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
T sqrt(T t)
Definition: SSEVec.h:48
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