EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GFKalman Class Reference

Generic Kalman Filter implementation. More...

#include <EicRoot/blob/master/genfit/GFKalman.h>

+ Inheritance diagram for GFKalman:

Public Member Functions

 GFKalman ()
 
 ~GFKalman ()
 
void operator() (GFTrack *track)
 Operator for use with STL.
 
void operator() (std::pair< int, GFTrack * > tr)
 Operator for use with STL.
 
void setLazy (Int_t flag)
 Switch lazy error handling.
 
void setNumIterations (Int_t i)
 Set number of iterations for Kalman Filter.
 
void processTrack (GFTrack *trk)
 Performs fit on a GFTrack.
 
void fittingPass (GFTrack *, int dir)
 Performs fit on a GFTrack beginning with the current hit.
 
double getChi2Hit (GFAbsRecoHit *, GFAbsTrackRep *)
 Calculates chi2 of a given hit with respect to a given track representation.
 
void setInitialDirection (int d)
 Sets the inital direction of the track fit (1 for inner to outer, or -1 for outer to inner). The standard is 1 and is set in the ctor.
 
void setBlowUpFactor (double f)
 Set the blowup factor (see blowUpCovs() )
 

Protected Member Functions

void blowUpCovs (GFTrack *trk)
 this is needed to blow up the covariance matrix before a fitting pass drops off-diagonal elements and blows up diagonal by blowUpFactor
 

Private Member Functions

void processHit (GFTrack *, int, int, int)
 One Kalman step.
 
void switchDirection (GFTrack *trk)
 Used to switch between forward and backward filtering.
 
TMatrixT< double > calcGain (const TMatrixT< double > &cov, const TMatrixT< double > &HitCov, const TMatrixT< double > &H)
 Calculate Kalman Gain.
 
double chi2Increment (const TMatrixT< double > &r, const TMatrixT< double > &H, const TMatrixT< double > &cov, const TMatrixT< double > &V)
 this returns the reduced chi2 increment for a hit
 

Private Attributes

int fInitialDirection
 
Int_t fNumIt
 
double fBlowUpFactor
 
bool fSmooth
 
bool fSmoothFast
 

Detailed Description

Generic Kalman Filter implementation.

Author
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)

The Kalman Filter operates on genfit GFTrack objects. It is an implementation of the Kalman Filter algebra that uses the genfit interface classes GFAbsRecoHit and GFAbsTrackRep in order to be independent from the specific detector geometry and the details of the track parameterization / track extraoplation engine.

The Kalman Filter can use hits from several detectors in a single fit to estimate the parameters of several track representations in parallel.

Definition at line 50 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 50 of file GFKalman.h

Constructor & Destructor Documentation

GFKalman::GFKalman ( )

Definition at line 36 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 36 of file GFKalman.cxx

GFKalman::~GFKalman ( )

Definition at line 38 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 38 of file GFKalman.cxx

Member Function Documentation

void GFKalman::blowUpCovs ( GFTrack trk)
protected

this is needed to blow up the covariance matrix before a fitting pass drops off-diagonal elements and blows up diagonal by blowUpFactor

Definition at line 144 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 144 of file GFKalman.cxx

References GFTrack::blowUpCovs(), and fBlowUpFactor.

Referenced by GFDaf::processTrack(), and processTrack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TMatrixT< double > GFKalman::calcGain ( const TMatrixT< double > &  cov,
const TMatrixT< double > &  HitCov,
const TMatrixT< double > &  H 
)
private

Calculate Kalman Gain.

Definition at line 402 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 402 of file GFKalman.cxx

References GFTools::invertMatrix().

Referenced by processHit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double GFKalman::chi2Increment ( const TMatrixT< double > &  r,
const TMatrixT< double > &  H,
const TMatrixT< double > &  cov,
const TMatrixT< double > &  V 
)
private

this returns the reduced chi2 increment for a hit

Definition at line 203 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 203 of file GFKalman.cxx

References GFTools::invertMatrix(), Acts::IntegrationTest::R, GFException::setFatal(), and GFException::setMatrices().

Referenced by getChi2Hit(), and processHit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GFKalman::fittingPass ( GFTrack trk,
int  dir 
)

Performs fit on a GFTrack beginning with the current hit.

Definition at line 149 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 149 of file GFKalman.cxx

References GFTrack::addFailedHit(), GFBookkeeping::clearFailedHits(), Acts::UnitConstants::e, GFTrack::getBK(), GFTrack::getNextHitToFit(), GFTrack::getNumHits(), GFTrack::getNumReps(), GFAbsTrackRep::getStatusFlag(), GFTrack::getTrackRep(), GFException::info(), GFException::isFatal(), processHit(), GFAbsTrackRep::setChiSqu(), GFAbsTrackRep::setForwardChiSqu(), GFAbsTrackRep::setNDF(), GFTrack::setNextHitToFit(), GFAbsTrackRep::setStatusFlag(), and GFException::what().

Referenced by processTrack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double GFKalman::getChi2Hit ( GFAbsRecoHit hit,
GFAbsTrackRep rep 
)

Calculates chi2 of a given hit with respect to a given track representation.

Definition at line 240 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 240 of file GFKalman.cxx

References chi2Increment(), Acts::Test::cov, GFAbsTrackRep::extrapolate(), GFAbsRecoHit::getDetPlane(), GFAbsTrackRep::getDim(), GFAbsRecoHit::getHMatrix(), GFAbsRecoHit::getMeasurement(), H, and Acts::UnitConstants::m.

+ Here is the call graph for this function:

void GFKalman::operator() ( GFTrack track)
inline

Operator for use with STL.

This operator allows to use the std::foreach algorithm with an STL container o GFTrack* objects.

Definition at line 65 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 65 of file GFKalman.h

References processTrack().

+ Here is the call graph for this function:

void GFKalman::operator() ( std::pair< int, GFTrack * >  tr)
inline

Operator for use with STL.

This operator allows to use the std::foreach algorithm with an STL container o GFTrack* objects.

Definition at line 72 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 72 of file GFKalman.h

References processTrack().

+ Here is the call graph for this function:

void GFKalman::processHit ( GFTrack tr,
int  ihit,
int  irep,
int  direction 
)
private

One Kalman step.

Performs

  • Extrapolation to detector plane of the hit
  • Calculation of residual and Kalman Gain
  • Update of track representation state and chi2

Definition at line 265 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 265 of file GFKalman.cxx

References GFAbsTrackRep::addChiSqu(), GFAbsTrackRep::addForwardChiSqu(), GFAbsTrackRep::addNDF(), calcGain(), chi2Increment(), Acts::Test::cov, COVEXC, GFAbsTrackRep::extrapolate(), fSmooth, fSmoothFast, GFAbsTrackRep::getAuxInfo(), GFTrack::getBK(), GFAbsTrackRep::getCov(), GFAbsRecoHit::getDetPlane(), GFAbsTrackRep::getDim(), GFTrack::getHit(), GFAbsRecoHit::getHMatrix(), GFAbsRecoHit::getMeasurement(), GFAbsTrackRep::getReferencePlane(), GFTrack::getRepAtHit(), GFAbsTrackRep::getState(), GFTrack::getTrackRep(), H, GFAbsTrackRep::hasAuxInfo(), Acts::UnitConstants::m, GFAbsTrackRep::setData(), GFBookkeeping::setDetPlane(), GFBookkeeping::setMatrix(), GFBookkeeping::setNumber(), GFTrack::setRepAtHit(), and Acts::KalmanVertexTrackUpdater::update().

Referenced by fittingPass().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GFKalman::processTrack ( GFTrack trk)

Performs fit on a GFTrack.

The hits are processed in the order in which they are stored in the GFTrack object. Sorting of hits in space has to be done before!

Definition at line 40 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 40 of file GFKalman.cxx

References blowUpCovs(), GFBookkeeping::bookGFDetPlanes(), GFBookkeeping::bookMatrices(), GFBookkeeping::bookNumbers(), GFTrack::clearRepAtHit(), fInitialDirection, fittingPass(), fNumIt, fSmooth, fSmoothFast, GFTrack::getBK(), GFAbsTrackRep::getCov(), GFBookkeeping::getMatrixKeys(), GFTrack::getNumHits(), GFTrack::getNumReps(), GFAbsTrackRep::getReferencePlane(), GFTrack::getSmoothing(), GFTrack::getSmoothingFast(), GFAbsTrackRep::getState(), GFTrack::getTrackRep(), GFAbsTrackRep::hasAuxInfo(), GFAbsTrackRep::resetXX0(), GFTrack::setNextHitToFit(), GFBookkeeping::setNhits(), and switchDirection().

Referenced by PndRecoKalmanFit::Fit(), operator()(), and GFDaf::processTrack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GFKalman::setBlowUpFactor ( double  f)
inline

Set the blowup factor (see blowUpCovs() )

Definition at line 114 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 114 of file GFKalman.h

References fBlowUpFactor.

void GFKalman::setInitialDirection ( int  d)
inline

Sets the inital direction of the track fit (1 for inner to outer, or -1 for outer to inner). The standard is 1 and is set in the ctor.

Definition at line 110 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 110 of file GFKalman.h

References d, and fInitialDirection.

void GFKalman::setLazy ( Int_t  flag)
inline

Switch lazy error handling.

This is a historically left-over method and shall be deleted some time

Definition at line 80 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 80 of file GFKalman.h

void GFKalman::setNumIterations ( Int_t  i)
inline

Set number of iterations for Kalman Filter.

One iteration is one forward pass plus one backward pass

Definition at line 89 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 89 of file GFKalman.h

References fNumIt.

Referenced by GFDaf::GFDaf(), and PndRecoKalmanFit::Init().

+ Here is the caller graph for this function:

void GFKalman::switchDirection ( GFTrack trk)
private

Used to switch between forward and backward filtering.

Definition at line 137 of file GFKalman.cxx.

View newest version in sPHENIX GitHub at line 137 of file GFKalman.cxx

References GFTrack::getNumReps(), GFTrack::getTrackRep(), and GFAbsTrackRep::switchDirection().

Referenced by processTrack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

double GFKalman::fBlowUpFactor
private

Definition at line 154 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 154 of file GFKalman.h

Referenced by blowUpCovs(), and setBlowUpFactor().

int GFKalman::fInitialDirection
private

Definition at line 152 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 152 of file GFKalman.h

Referenced by processTrack(), and setInitialDirection().

Int_t GFKalman::fNumIt
private

Definition at line 153 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 153 of file GFKalman.h

Referenced by processTrack(), and setNumIterations().

bool GFKalman::fSmooth
private

Definition at line 155 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 155 of file GFKalman.h

Referenced by processHit(), and processTrack().

bool GFKalman::fSmoothFast
private

Definition at line 156 of file GFKalman.h.

View newest version in sPHENIX GitHub at line 156 of file GFKalman.h

Referenced by processHit(), and processTrack().


The documentation for this class was generated from the following files: