CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
reco::KalmanGhostTrackUpdater Class Reference

#include <KalmanGhostTrackUpdater.h>

Inheritance diagram for reco::KalmanGhostTrackUpdater:
reco::GhostTrackFitter::PredictionUpdater

Public Member Functions

virtual KalmanGhostTrackUpdaterclone () const
 
void contribution (const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2, bool withPredError=false) const
 
GhostTrackPrediction update (const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2) const
 
virtual ~KalmanGhostTrackUpdater ()
 
- Public Member Functions inherited from reco::GhostTrackFitter::PredictionUpdater
virtual ~PredictionUpdater ()
 

Detailed Description

Definition at line 11 of file KalmanGhostTrackUpdater.h.

Constructor & Destructor Documentation

virtual reco::KalmanGhostTrackUpdater::~KalmanGhostTrackUpdater ( )
inlinevirtual

Definition at line 13 of file KalmanGhostTrackUpdater.h.

13 {}

Member Function Documentation

virtual KalmanGhostTrackUpdater* reco::KalmanGhostTrackUpdater::clone ( void  ) const
inlinevirtual

Implements reco::GhostTrackFitter::PredictionUpdater.

Definition at line 15 of file KalmanGhostTrackUpdater.h.

16  { return new KalmanGhostTrackUpdater(*this); }
void KalmanGhostTrackUpdater::contribution ( const GhostTrackPrediction pred,
const GhostTrackState state,
double &  ndof,
double &  chi2,
bool  withPredError = false 
) const
virtual

Implements reco::GhostTrackFitter::PredictionUpdater.

Definition at line 128 of file KalmanGhostTrackUpdater.cc.

133 {
134  using namespace ROOT::Math;
135 
136  KalmanState kalmanState(pred, state);
137 
138  // this is called on the full predicted state,
139  // so the residual is already with respect to the filtered state
140 
141  // inverted error
142  Matrix2S invErr = kalmanState.measErr;
143  if (withPredError)
144  invErr += kalmanState.measPredErr;
145  if (!invErr.Invert()) {
146  ndof = 0.;
147  chi2 = 0.;
148  }
149 
150  ndof = 2.;
151  chi2 = Similarity(kalmanState.residual, invErr);
152 }
GhostTrackPrediction KalmanGhostTrackUpdater::update ( const GhostTrackPrediction pred,
const GhostTrackState state,
double &  ndof,
double &  chi2 
) const
virtual

Implements reco::GhostTrackFitter::PredictionUpdater.

Definition at line 86 of file KalmanGhostTrackUpdater.cc.

References reco::GhostTrackPrediction::covariance(), reco::if(), reco::GhostTrackPrediction::prediction(), and reco::GhostTrackState::weight().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

90 {
91  using namespace ROOT::Math;
92 
93  KalmanState kalmanState(pred, state);
94 
95  if (state.weight() < 1.0e-3)
96  return pred;
97 
98  // inverted combined error
99  Matrix2S invErr = kalmanState.measPredErr +
100  (1.0 / state.weight()) * kalmanState.measErr;
101  if (!invErr.Invert())
102  return pred;
103 
104  // gain
105  Matrix42 gain = pred.covariance() * Transpose(kalmanState.h) * invErr;
106 
107  // new prediction
108  Vector4 newPred = pred.prediction() + (gain * kalmanState.residual);
109  Matrix44 tmp44 = SMatrixIdentity();
110  tmp44 = (tmp44 - gain * kalmanState.h) * pred.covariance();
111  Matrix4S newError(tmp44.LowerBlock());
112 
113  // filtered residuals
114  Matrix22 tmp22 = SMatrixIdentity();
115  tmp22 = tmp22 - kalmanState.h * gain;
116  Vector2 filtRes = tmp22 * kalmanState.residual;
117  tmp22 *= kalmanState.measErr;
118  Matrix2S filtResErr(tmp22.LowerBlock());
119  if (!filtResErr.Invert())
120  return pred;
121 
122  ndof += state.weight() * 2.;
123  chi2 += state.weight() * Similarity(filtRes, filtResErr);
124 
125  return GhostTrackPrediction(newPred, newError);
126 }
double weight() const
const Vector & prediction() const
const Error & covariance() const
if(dp >Float(M_PI)) dp-