#include <GsfChi2MeasurementEstimator.h>
Public Member Functions | |
virtual GsfChi2MeasurementEstimator * | clone () const |
virtual std::pair< bool, double > | estimate (const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const |
GsfChi2MeasurementEstimator () | |
GsfChi2MeasurementEstimator (double aMaxChi2) | |
Private Attributes | |
Chi2MeasurementEstimator | theEstimator |
Class which calculates the chisquare of a predicted Gaussian mixture trajectory state with respect to a reconstructed hit according to the Gaussian-sum filter (GSF) strategy. The relevant formulas can be found in R. Fruhwirth, Computer Physics Communications 100 (1997), 1.
Definition at line 15 of file GsfChi2MeasurementEstimator.h.
GsfChi2MeasurementEstimator::GsfChi2MeasurementEstimator | ( | ) | [inline] |
Definition at line 18 of file GsfChi2MeasurementEstimator.h.
Referenced by clone().
: Chi2MeasurementEstimatorBase(100.), theEstimator(100.) {}
GsfChi2MeasurementEstimator::GsfChi2MeasurementEstimator | ( | double | aMaxChi2 | ) | [inline] |
Definition at line 22 of file GsfChi2MeasurementEstimator.h.
: Chi2MeasurementEstimatorBase(aMaxChi2), theEstimator(aMaxChi2) {}
virtual GsfChi2MeasurementEstimator* GsfChi2MeasurementEstimator::clone | ( | void | ) | const [inline, virtual] |
Implements MeasurementEstimator.
Definition at line 29 of file GsfChi2MeasurementEstimator.h.
References GsfChi2MeasurementEstimator().
{ return new GsfChi2MeasurementEstimator(*this); }
std::pair< bool, double > GsfChi2MeasurementEstimator::estimate | ( | const TrajectoryStateOnSurface & | ts, |
const TransientTrackingRecHit & | hit | ||
) | const [virtual] |
Returns pair( true, value) if the TrajectoryStateOnSurface is compatible with the RecHit, and pair( false, value) if it is not compatible. The TrajectoryStateOnSurface must be on the same Surface as the RecHit. For an estimator where there is no value computed, e.g. fixed window estimator, only the first(bool) part is of interest.
Implements Chi2MeasurementEstimatorBase.
Definition at line 9 of file GsfChi2MeasurementEstimator.cc.
References TrajectoryStateOnSurface::components(), Chi2MeasurementEstimator::estimate(), i, Chi2MeasurementEstimatorBase::returnIt(), theEstimator, PosteriorWeightsCalculator::weights(), and create_public_pileup_plots::weights.
{ std::vector<TrajectoryStateOnSurface> tsvec = tsos.components(); if (tsvec.empty()) { edm::LogError("GsfChi2MeasurementEstimator") << "Trying to calculate chi2 of hit with respect to empty mixture!"; return std::make_pair(false,0.); } std::vector<double> weights = PosteriorWeightsCalculator(tsvec).weights(hit); if ( weights.empty() ) return std::make_pair(false,0); // Chi2MeasurementEstimator est(chiSquaredCut()); double chi2 = 0.; int i = 0; for (std::vector<TrajectoryStateOnSurface>::const_iterator it = tsvec.begin(); it != tsvec.end(); it++) { chi2 += weights[i++] * theEstimator.estimate(*it,hit).second; } // Done - normalisation of weights is ensured // by PosteriorWeightsCalculator return returnIt(chi2); }
Definition at line 34 of file GsfChi2MeasurementEstimator.h.
Referenced by estimate().