#include <TrackingTools/GsfTracking/interface/GsfChi2MeasurementEstimator.h>
Public Member Functions | |
virtual GsfChi2MeasurementEstimator * | clone () const |
virtual std::pair< bool, double > | estimate (const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const |
Returns pair( true, value) if the TrajectoryStateOnSurface is compatible with the RecHit, and pair( false, value) if it is not compatible. | |
GsfChi2MeasurementEstimator (double aMaxChi2) | |
GsfChi2MeasurementEstimator () | |
Private Attributes | |
Chi2MeasurementEstimator | theEstimator |
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().
00018 : 00019 Chi2MeasurementEstimatorBase(100.), 00020 theEstimator(100.) {}
GsfChi2MeasurementEstimator::GsfChi2MeasurementEstimator | ( | double | aMaxChi2 | ) | [inline] |
Definition at line 22 of file GsfChi2MeasurementEstimator.h.
00022 : 00023 Chi2MeasurementEstimatorBase(aMaxChi2), 00024 theEstimator(aMaxChi2) {}
virtual GsfChi2MeasurementEstimator* GsfChi2MeasurementEstimator::clone | ( | void | ) | const [inline, virtual] |
Implements MeasurementEstimator.
Definition at line 29 of file GsfChi2MeasurementEstimator.h.
References GsfChi2MeasurementEstimator().
00029 { 00030 return new GsfChi2MeasurementEstimator(*this); 00031 }
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, it, Chi2MeasurementEstimatorBase::returnIt(), theEstimator, and weights.
00010 { 00011 00012 std::vector<TrajectoryStateOnSurface> tsvec = tsos.components(); 00013 if (tsvec.empty()) { 00014 edm::LogError("GsfChi2MeasurementEstimator") 00015 << "Trying to calculate chi2 of hit with respect to empty mixture!"; 00016 return std::make_pair(false,0.); 00017 } 00018 00019 std::vector<double> weights = PosteriorWeightsCalculator(tsvec).weights(hit); 00020 if ( weights.empty() ) return std::make_pair(false,0); 00021 00022 // Chi2MeasurementEstimator est(chiSquaredCut()); 00023 double chi2 = 0.; 00024 int i = 0; 00025 for (std::vector<TrajectoryStateOnSurface>::const_iterator it = tsvec.begin(); 00026 it != tsvec.end(); it++) { 00027 chi2 += weights[i++] * theEstimator.estimate(*it,hit).second; 00028 } 00029 // Done - normalisation of weights is ensured 00030 // by PosteriorWeightsCalculator 00031 return returnIt(chi2); 00032 }