CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GsfChi2MeasurementEstimator Class Reference

#include <GsfChi2MeasurementEstimator.h>

Inheritance diagram for GsfChi2MeasurementEstimator:
Chi2MeasurementEstimatorBase MeasurementEstimator

Public Member Functions

GsfChi2MeasurementEstimatorclone () const override
 
std::pair< bool, double > estimate (const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
 
 GsfChi2MeasurementEstimator ()
 
 GsfChi2MeasurementEstimator (double aMaxChi2)
 
- Public Member Functions inherited from Chi2MeasurementEstimatorBase
 Chi2MeasurementEstimatorBase (double maxChi2, double nSigma=3., float maxDisp=std::numeric_limits< float >::max())
 
template<typename... Args>
 Chi2MeasurementEstimatorBase (double maxChi2, double nSigma, float maxDisp, Args &&... args)
 
double chiSquaredCut () const
 
bool estimate (const TrajectoryStateOnSurface &ts, const Plane &plane) const final
 
Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const Plane &plane) const final
 
double nSigmaCut () const
 
- Public Member Functions inherited from MeasurementEstimator
float maxSagitta () const
 
 MeasurementEstimator ()
 
 MeasurementEstimator (float maxSag, float minToll, float mpt)
 
float minPt2ForHitRecoveryInGluedDet () const
 
float minTolerance2 () const
 
virtual bool preFilter (const TrajectoryStateOnSurface &, OpaquePayload const &) const
 
virtual ~MeasurementEstimator ()
 

Private Attributes

Chi2MeasurementEstimator theEstimator
 

Additional Inherited Members

- Public Types inherited from MeasurementEstimator
using HitReturnType = std::pair< bool, double >
 
using Local2DVector = Vector2DBase< float, LocalTag >
 
using SurfaceReturnType = bool
 
- Protected Member Functions inherited from Chi2MeasurementEstimatorBase
std::pair< bool, double > returnIt (double est) const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GsfChi2MeasurementEstimator() [1/2]

GsfChi2MeasurementEstimator::GsfChi2MeasurementEstimator ( )
inline

Definition at line 17 of file GsfChi2MeasurementEstimator.h.

Referenced by clone().

Chi2MeasurementEstimatorBase(double maxChi2, double nSigma=3., float maxDisp=std::numeric_limits< float >::max())
Chi2MeasurementEstimator theEstimator

◆ GsfChi2MeasurementEstimator() [2/2]

GsfChi2MeasurementEstimator::GsfChi2MeasurementEstimator ( double  aMaxChi2)
inline

Definition at line 19 of file GsfChi2MeasurementEstimator.h.

19 : Chi2MeasurementEstimatorBase(aMaxChi2), theEstimator(aMaxChi2) {}
Chi2MeasurementEstimatorBase(double maxChi2, double nSigma=3., float maxDisp=std::numeric_limits< float >::max())
Chi2MeasurementEstimator theEstimator

Member Function Documentation

◆ clone()

GsfChi2MeasurementEstimator* GsfChi2MeasurementEstimator::clone ( void  ) const
inlineoverridevirtual

◆ estimate()

std::pair< bool, double > GsfChi2MeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TrackingRecHit hit 
) const
overridevirtual

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 8 of file GsfChi2MeasurementEstimator.cc.

References hltPixelTracks_cff::chi2, Chi2MeasurementEstimator::estimate(), mps_fire::i, Chi2MeasurementEstimatorBase::returnIt(), theEstimator, PosteriorWeightsCalculator::weights(), and HLT_2022v12_cff::weights.

9  {
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 }
std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Log< level::Error, false > LogError
Chi2MeasurementEstimator theEstimator
std::vector< double > weights(const TrackingRecHit &tsos) const
Create random state.
std::pair< bool, double > returnIt(double est) const

Member Data Documentation

◆ theEstimator

Chi2MeasurementEstimator GsfChi2MeasurementEstimator::theEstimator
private

Definition at line 26 of file GsfChi2MeasurementEstimator.h.

Referenced by estimate().