CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Chi2MeasurementEstimator.cc
Go to the documentation of this file.
7 
8 std::pair<bool,double>
10  const TrackingRecHit& aRecHit) const {
11  switch (aRecHit.dimension()) {
12  case 1: return estimate<1>(tsos,aRecHit);
13  case 2: return estimate<2>(tsos,aRecHit);
14  case 3: return estimate<3>(tsos,aRecHit);
15  case 4: return estimate<4>(tsos,aRecHit);
16  case 5: return estimate<5>(tsos,aRecHit);
17  }
18  throw cms::Exception("RecHit of invalid size (not 1,2,3,4,5)");
19 }
20 
21 template <unsigned int D> std::pair<bool,double>
23  const TrackingRecHit& aRecHit) const {
24  typedef typename AlgebraicROOTObject<D,5>::Matrix MatD5;
25  typedef typename AlgebraicROOTObject<5,D>::Matrix Mat5D;
26  typedef typename AlgebraicROOTObject<D,D>::SymMatrix SMatDD;
27  typedef typename AlgebraicROOTObject<D>::Vector VecD;
28 
29  VecD r, rMeas; SMatDD R, RMeas;
30  MatD5 dummyProjMatrix;
31  ProjectMatrix<double,5,D> dummyProjFunc;
32  auto && v = tsos.localParameters().vector();
33  auto && m = tsos.localError().matrix();
34  KfComponentsHolder holder;
35  holder.template setup<D>(&r, &R, &dummyProjMatrix, &dummyProjFunc, &rMeas, &RMeas, v, m);
36  aRecHit.getKfComponents(holder);
37 
38  R += RMeas;
40  double est = ROOT::Math::Similarity(r - rMeas, R);
41  return returnIt(est);
42 }
virtual int dimension() const =0
virtual void getKfComponents(KfComponentsHolder &holder) const
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
std::pair< bool, double > returnIt(double est) const
const LocalTrajectoryParameters & localParameters() const
AlgebraicVector5 vector() const
ROOT::Math::SMatrix< double, D1, D2, ROOT::Math::MatRepStd< double, D1, D2 > > Matrix
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
ROOT::Math::SVector< double, D1 > Vector
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const