CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MRHChi2MeasurementEstimator.cc
Go to the documentation of this file.
8 
9 std::pair<bool,double>
11  const TransientTrackingRecHit& aRecHit) const {
12  if (!aRecHit.isValid()) {
13  throw cms::Exception("MRHChi2MeasurementEstimator") << "Invalid RecHit passed to the MRHChi2MeasurementEstimator ";
14  }
15 
18 
19  //better be a multihit...
20  TSiTrackerMultiRecHit const & mHit = dynamic_cast<TSiTrackerMultiRecHit const &>(aRecHit);
21  MeasurementExtractor me(tsos);
22  double est=0;
23  double annealing = mHit.getAnnealingFactor();
24  LogDebug("MRHChi2MeasurementEstimator") << "Current annealing factor is " << annealing;
26  LogDebug("MRHChi2MeasurementEstimator") << "this hit has " << components.size() << " components";
27  for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator iter = components.begin(); iter != components.end(); iter++){
28  Vec r = asSVector<2>((*iter)->parameters()) - me.measuredParameters<2>(**iter);
29  Mat R = asSMatrix<2>((*iter)->parametersError())*annealing + me.measuredError<2>(**iter);
30  //int ierr = ! R.Invert(); // if (ierr != 0) throw exception; //
32  LogDebug("MRHChi2MeasurementEstimator") << "Hit with weight " << (*iter)->weight();
33  est += ROOT::Math::Similarity(r, R)*((*iter)->weight());
34  }
35  return returnIt(est);
36 }
#define LogDebug(id)
AlgebraicSymMatrix measuredError(const TransientTrackingRecHit &)
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
std::pair< bool, double > returnIt(double est) const
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
float getAnnealingFactor() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
ROOT::Math::SVector< double, D1 > Vector
AlgebraicVector measuredParameters(const TransientTrackingRecHit &)
bool isValid() const
virtual ConstRecHitContainer transientHits() const
Composite interface: returns the component hits, if any.