test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GsfChi2MeasurementEstimator Class Reference

#include <GsfChi2MeasurementEstimator.h>

Inheritance diagram for GsfChi2MeasurementEstimator:
Chi2MeasurementEstimatorBase MeasurementEstimator

Public Member Functions

virtual
GsfChi2MeasurementEstimator
clone () const
 
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &, const TrackingRecHit &) const
 
 GsfChi2MeasurementEstimator ()
 
 GsfChi2MeasurementEstimator (double aMaxChi2)
 
- Public Member Functions inherited from Chi2MeasurementEstimatorBase
 Chi2MeasurementEstimatorBase (double maxChi2, double nSigma=3.)
 
double chiSquaredCut () const
 
virtual bool estimate (const TrajectoryStateOnSurface &ts, const Plane &plane) const
 
virtual Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const Plane &plane) const
 
double nSigmaCut () const
 
- Public Member Functions inherited from MeasurementEstimator
virtual bool preFilter (const TrajectoryStateOnSurface &, OpaquePayload const &) const
 
virtual ~MeasurementEstimator ()
 

Private Attributes

Chi2MeasurementEstimator theEstimator
 

Additional Inherited Members

- Public Types inherited from MeasurementEstimator
typedef std::pair< bool, double > HitReturnType
 
typedef Vector2DBase< float,
LocalTag
Local2DVector
 
typedef bool SurfaceReturnType
 
- 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::GsfChi2MeasurementEstimator ( )
inline

Definition at line 18 of file GsfChi2MeasurementEstimator.h.

Referenced by clone().

18  :
20  theEstimator(100.) {}
Chi2MeasurementEstimator theEstimator
Chi2MeasurementEstimatorBase(double maxChi2, double nSigma=3.)
GsfChi2MeasurementEstimator::GsfChi2MeasurementEstimator ( double  aMaxChi2)
inline

Definition at line 22 of file GsfChi2MeasurementEstimator.h.

22  :
24  theEstimator(aMaxChi2) {}
Chi2MeasurementEstimator theEstimator
Chi2MeasurementEstimatorBase(double maxChi2, double nSigma=3.)

Member Function Documentation

virtual GsfChi2MeasurementEstimator* GsfChi2MeasurementEstimator::clone ( void  ) const
inlinevirtual

Implements MeasurementEstimator.

Definition at line 29 of file GsfChi2MeasurementEstimator.h.

References GsfChi2MeasurementEstimator().

29  {
30  return new GsfChi2MeasurementEstimator(*this);
31  }
std::pair< bool, double > GsfChi2MeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TrackingRecHit 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.

10  {
11 
12  std::vector<TrajectoryStateOnSurface> tsvec = tsos.components();
13  if (tsvec.empty()) {
14  edm::LogError("GsfChi2MeasurementEstimator")
15  << "Trying to calculate chi2 of hit with respect to empty mixture!";
16  return std::make_pair(false,0.);
17  }
18 
19  std::vector<double> weights = PosteriorWeightsCalculator(tsvec).weights(hit);
20  if ( weights.empty() ) return std::make_pair(false,0);
21 
22  // Chi2MeasurementEstimator est(chiSquaredCut());
23  double chi2 = 0.;
24  int i = 0;
25  for (std::vector<TrajectoryStateOnSurface>::const_iterator it = tsvec.begin();
26  it != tsvec.end(); it++) {
27  chi2 += weights[i++] * theEstimator.estimate(*it,hit).second;
28  }
29  // Done - normalisation of weights is ensured
30  // by PosteriorWeightsCalculator
31  return returnIt(chi2);
32 }
int i
Definition: DBlmapReader.cc:9
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

Member Data Documentation

Chi2MeasurementEstimator GsfChi2MeasurementEstimator::theEstimator
private

Definition at line 34 of file GsfChi2MeasurementEstimator.h.

Referenced by estimate().