CMS 3D CMS Logo

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