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.
6 
7 std::pair<bool,double>
8 Chi2MeasurementEstimator::estimate(const TrajectoryStateOnSurface& tsos,
9  const TransientTrackingRecHit& aRecHit) const {
10  switch (aRecHit.dimension()) {
11  case 1: return estimate<1>(tsos,aRecHit);
12  case 2: return estimate<2>(tsos,aRecHit);
13  case 3: return estimate<3>(tsos,aRecHit);
14  case 4: return estimate<4>(tsos,aRecHit);
15  case 5: return estimate<5>(tsos,aRecHit);
16  }
17  throw cms::Exception("RecHit of invalid size (not 1,2,3,4,5)");
18 }
19 
20 template <unsigned int D> std::pair<bool,double>
21 Chi2MeasurementEstimator::estimate(const TrajectoryStateOnSurface& tsos,
22  const TransientTrackingRecHit& aRecHit) const {
23  typedef typename AlgebraicROOTObject<D,5>::Matrix MatD5;
24  typedef typename AlgebraicROOTObject<5,D>::Matrix Mat5D;
25  typedef typename AlgebraicROOTObject<D,D>::SymMatrix SMatDD;
26  typedef typename AlgebraicROOTObject<D>::Vector VecD;
27 
28  VecD r, rMeas; SMatDD R, RMeas;
29  MatD5 dummyProjMatrix;
30 
31  KfComponentsHolder holder;
32  holder.template setup<D>(&r, &R, &dummyProjMatrix, &rMeas, &RMeas, tsos.localParameters().vector(), tsos.localError().matrix());
33  aRecHit.getKfComponents(holder);
34 
35  R += RMeas;
37  double est = ROOT::Math::Similarity(r - rMeas, R);
38  return returnIt(est);
39 }
virtual int dimension() const =0
virtual void getKfComponents(KfComponentsHolder &holder) const
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
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