CMS 3D CMS Logo

GsfChi2MeasurementEstimator.cc
Go to the documentation of this file.
3 
7 
8 std::pair<bool,double>
10  const TrackingRecHit& hit) const {
11 
12  GetComponents comps(tsos);
13  auto const & tsvec = comps();
14  if (tsvec.empty()) {
15  edm::LogError("GsfChi2MeasurementEstimator")
16  << "Trying to calculate chi2 of hit with respect to empty mixture!";
17  return std::make_pair(false,0.);
18  }
19 
20  auto const & weights = PosteriorWeightsCalculator(tsvec).weights(hit);
21  if ( weights.empty() ) return std::make_pair(false,0);
22 
23  // Chi2MeasurementEstimator est(chiSquaredCut());
24  double chi2 = 0.;
25  int i = 0;
26  for (auto const & ts : tsvec)
27  chi2 += weights[i++] * theEstimator.estimate(ts,hit).second;
28  // Done - normalisation of weights is ensured
29  // by PosteriorWeightsCalculator
30  return returnIt(chi2);
31 }
32 
std::pair< bool, double > returnIt(double est) const
std::vector< double > weights(const TrackingRecHit &tsos) const
Create random state.
Chi2MeasurementEstimator theEstimator
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const