LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "GFKalman.h"
Public Member Functions | |
GFKalman () | |
~GFKalman () | |
void | operator() (GFTrack *track) |
Operator for use with STL. More... | |
void | operator() (std::pair< int, GFTrack * > tr) |
Operator for use with STL. More... | |
void | setLazy (Int_t) |
Switch lazy error handling. More... | |
void | setNumIterations (Int_t i) |
Set number of iterations for Kalman Filter. More... | |
void | processTrack (GFTrack *) |
Performs fit on a GFTrack. More... | |
void | fittingPass (GFTrack *, int dir) |
Performs fit on a GFTrack beginning with the current hit. More... | |
double | getChi2Hit (GFAbsRecoHit *, GFAbsTrackRep *) |
Calculates chi2 of a given hit with respect to a given track representation. More... | |
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. More... | |
void | setBlowUpFactor (double f) |
Set the blowup factor (see blowUpCovs() ) More... | |
void | setMomLow (Double_t f) |
void | setMomHigh (Double_t f) |
void | setMaxUpdate (Double_t f) |
void | setErrorScaleSTh (Double_t f) |
void | setErrorScaleMTh (Double_t f) |
Private Member Functions | |
void | processHit (GFTrack *, int, int, int) |
One Kalman step. More... | |
void | switchDirection (GFTrack *trk) |
Used to switch between forward and backward filtering. More... | |
TMatrixT< Double_t > | calcGain (const TMatrixT< Double_t > &cov, const TMatrixT< Double_t > &HitCov, const TMatrixT< Double_t > &H) |
Calculate Kalman Gain. More... | |
TMatrixT< Double_t > | calcCov7x7 (const TMatrixT< Double_t > &cov, const genf::GFDetPlane &plane) |
double | chi2Increment (const TMatrixT< Double_t > &r, const TMatrixT< Double_t > &H, const TMatrixT< Double_t > &cov, const TMatrixT< Double_t > &V) |
this returns the reduced chi2 increment for a hit More... | |
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 More... | |
void | blowUpCovsDiag (GFTrack *trk) |
Private Attributes | |
int | fInitialDirection |
Int_t | fNumIt |
double | fBlowUpFactor |
Double_t | fMomLow |
Double_t | fMomHigh |
Double_t | fMaxUpdate |
Double_t | fErrScaleSTh |
Double_t | fErrScaleMTh |
bool | fGENfPRINT |
Definition at line 53 of file GFKalman.h.
genf::GFKalman::GFKalman | ( | ) |
Definition at line 38 of file GFKalman.cxx.
genf::GFKalman::~GFKalman | ( | ) |
Definition at line 52 of file GFKalman.cxx.
|
private |
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 158 of file GFKalman.cxx.
References fBlowUpFactor, genf::GFAbsTrackRep::getCov(), genf::GFTrack::getNumReps(), genf::GFAbsTrackRep::getStatusFlag(), genf::GFTrack::getTrackRep(), and genf::GFAbsTrackRep::setCov().
Referenced by processTrack(), and setErrorScaleMTh().
|
private |
Definition at line 135 of file GFKalman.cxx.
References fBlowUpFactor, genf::GFAbsTrackRep::getCov(), genf::GFTrack::getNumReps(), genf::GFAbsTrackRep::getStatusFlag(), genf::GFTrack::getTrackRep(), and genf::GFAbsTrackRep::setCov().
Referenced by setErrorScaleMTh().
|
private |
Definition at line 668 of file GFKalman.cxx.
References genf::GFDetPlane::getU(), genf::GFDetPlane::getV(), GFException::setFatal(), and w.
Referenced by processHit(), and setErrorScaleMTh().
|
private |
Calculate Kalman Gain.
Definition at line 731 of file GFKalman.cxx.
References e, GFException::setFatal(), and GFException::setMatrices().
Referenced by processHit(), and setErrorScaleMTh().
|
private |
this returns the reduced chi2 increment for a hit
Definition at line 227 of file GFKalman.cxx.
References e, r, GFException::setFatal(), GFException::setMatrices(), and GFException::setNumbers().
Referenced by getChi2Hit(), processHit(), and setErrorScaleMTh().
void genf::GFKalman::fittingPass | ( | GFTrack * | trk, |
int | dir | ||
) |
Performs fit on a GFTrack beginning with the current hit.
Definition at line 181 of file GFKalman.cxx.
References genf::GFTrack::addFailedHit(), genf::GFBookkeeping::clearFailedHits(), e, genf::GFTrack::getBK(), genf::GFTrack::getNextHitToFit(), genf::GFTrack::getNumHits(), genf::GFTrack::getNumReps(), genf::GFAbsTrackRep::getStatusFlag(), genf::GFTrack::getTrackRep(), GFException::info(), GFException::isFatal(), processHit(), genf::GFAbsTrackRep::setChiSqu(), genf::GFAbsTrackRep::setNDF(), genf::GFTrack::setNextHitToFit(), genf::GFAbsTrackRep::setStatusFlag(), and GFException::what().
Referenced by processTrack(), and setNumIterations().
double genf::GFKalman::getChi2Hit | ( | GFAbsRecoHit * | hit, |
GFAbsTrackRep * | rep | ||
) |
Calculates chi2 of a given hit with respect to a given track representation.
Definition at line 282 of file GFKalman.cxx.
References chi2Increment(), genf::GFAbsTrackRep::extrapolate(), fErrScaleMTh, genf::GFAbsRecoHit::getDetPlane(), genf::GFAbsTrackRep::getDim(), genf::GFAbsRecoHit::getHitCov(), genf::GFAbsRecoHit::getHMatrix(), r, and genf::GFAbsRecoHit::residualVector().
Referenced by setNumIterations().
|
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 67 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 74 of file GFKalman.h.
References processTrack().
|
private |
One Kalman step.
Performs
Definition at line 307 of file GFKalman.cxx.
References genf::GFAbsTrackRep::addChiSqu(), genf::GFAbsTrackRep::addNDF(), calcCov7x7(), calcGain(), chi2Increment(), COVEXC, larg4::dist(), E, e, genf::GFAbsTrackRep::extrapolate(), fErrScaleMTh, fGENfPRINT, fMaxUpdate, fMomHigh, fMomLow, genf::GFAbsTrackRep::getCov(), genf::GFAbsRecoHit::getDetPlane(), genf::GFAbsTrackRep::getDim(), genf::GFTrack::getHit(), genf::GFAbsRecoHit::getHitCov(), genf::GFAbsRecoHit::getHMatrix(), genf::GFTrack::getNumHits(), genf::GFDetPlane::getO(), genf::GFTrack::getPDG(), genf::GFAbsRecoHit::getRawHitCoord(), genf::GFAbsTrackRep::getReferencePlane(), genf::GFTrack::getRepAtHit(), genf::GFAbsTrackRep::getState(), genf::GFTrack::getTrackRep(), genf::GFDetPlane::getU(), genf::GFDetPlane::getV(), part, r, genf::GFAbsRecoHit::residualVector(), genf::GFAbsTrackRep::setData(), genf::GFTrack::setHitChi2(), genf::GFTrack::setHitCov(), genf::GFTrack::setHitCov7x7(), genf::GFTrack::setHitMeasuredCov(), genf::GFTrack::setHitPlaneU(), genf::GFTrack::setHitPlaneUxUyUz(), genf::GFTrack::setHitPlaneV(), genf::GFTrack::setHitPlaneXYZ(), genf::GFTrack::setHitState(), genf::GFTrack::setHitUpdate(), genf::GFTrack::setRepAtHit(), and w.
Referenced by fittingPass(), and setErrorScaleMTh().
void genf::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 57 of file GFKalman.cxx.
References blowUpCovs(), genf::GFTrack::clearRepAtHit(), fInitialDirection, fittingPass(), fNumIt, genf::GFAbsTrackRep::getCov(), genf::GFTrack::getNumHits(), genf::GFTrack::getNumReps(), genf::GFAbsTrackRep::getReferencePlane(), genf::GFAbsTrackRep::getState(), genf::GFTrack::getTrackRep(), GFException::setFatal(), genf::GFAbsTrackRep::setFirstCov(), genf::GFAbsTrackRep::setFirstPlane(), genf::GFAbsTrackRep::setFirstState(), genf::GFAbsTrackRep::setLastCov(), genf::GFAbsTrackRep::setLastPlane(), genf::GFAbsTrackRep::setLastState(), genf::GFTrack::setNextHitToFit(), and switchDirection().
Referenced by operator()(), trkf::Track3DKalman::produce(), trkf::Track3DKalmanSPS::produce(), and setNumIterations().
|
inline |
Set the blowup factor (see blowUpCovs() )
Definition at line 116 of file GFKalman.h.
References f, and fBlowUpFactor.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 121 of file GFKalman.h.
References blowUpCovs(), blowUpCovsDiag(), calcCov7x7(), calcGain(), chi2Increment(), f, fErrScaleMTh, processHit(), r, and switchDirection().
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 120 of file GFKalman.h.
References f, and fErrScaleSTh.
Referenced by trkf::Track3DKalmanSPS::produce().
|
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 112 of file GFKalman.h.
References d, and fInitialDirection.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Switch lazy error handling.
This is a historically left-over method and shall be deleted some time
Definition at line 82 of file GFKalman.h.
|
inline |
Definition at line 119 of file GFKalman.h.
References f, and fMaxUpdate.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
|
inline |
|
inline |
Set number of iterations for Kalman Filter.
One iteration is one forward pass plus one backward pass
Definition at line 91 of file GFKalman.h.
References dir, fittingPass(), fNumIt, getChi2Hit(), and processTrack().
Referenced by trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().
|
private |
Used to switch between forward and backward filtering.
Definition at line 127 of file GFKalman.cxx.
References genf::GFTrack::getNumReps(), genf::GFTrack::getTrackRep(), and genf::GFAbsTrackRep::switchDirection().
Referenced by processTrack(), and setErrorScaleMTh().
|
private |
Definition at line 161 of file GFKalman.h.
Referenced by blowUpCovs(), blowUpCovsDiag(), and setBlowUpFactor().
|
private |
Definition at line 167 of file GFKalman.h.
Referenced by getChi2Hit(), processHit(), and setErrorScaleMTh().
|
private |
Definition at line 166 of file GFKalman.h.
Referenced by setErrorScaleSTh().
|
private |
Definition at line 168 of file GFKalman.h.
Referenced by processHit().
|
private |
Definition at line 159 of file GFKalman.h.
Referenced by processTrack(), and setInitialDirection().
|
private |
Definition at line 165 of file GFKalman.h.
Referenced by processHit(), and setMaxUpdate().
|
private |
Definition at line 164 of file GFKalman.h.
Referenced by processHit(), and setMomHigh().
|
private |
Definition at line 163 of file GFKalman.h.
Referenced by processHit(), and setMomLow().
|
private |
Definition at line 160 of file GFKalman.h.
Referenced by processTrack(), and setNumIterations().