EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
Generic Kalman Filter implementation. More...
#include <EicRoot/blob/master/genfit/GFKalman.h>
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 |
Generic Kalman Filter implementation.
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
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
|
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().
|
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().
|
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().
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().
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.
|
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().
|
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().
|
private |
One Kalman step.
Performs
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().
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().
|
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.
|
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.
|
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
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().