FairRoot/PandaRoot
|
Determinstic Annealing Filter (DAF) implementation. More...
#include <GFDaf.h>
Public Member Functions | |
GFDaf () | |
~GFDaf () | |
void | processTrack (GFTrack *trk) |
Process a track using the DAF. More... | |
const std::vector< std::vector < std::vector< double > > > | getWeights () |
Return the weights present after the track was processed. More... | |
void | setProbCut (double prob_cut) |
Set the probabilty cut for the weight calculation for the hits. More... | |
void | setBetas (double b1, double b2, double b3=-1., double b4=-1., double b5=-1., double b6=-1., double b7=-1., double b8=-1., double b9=-1., double b10=-1.) |
Configure the annealing scheme. More... | |
Private Member Functions | |
std::vector< GFDafHit * > | initHitsWeights (GFTrack *trk) |
Initialize the GFDafHit and their weights before the fit. More... | |
std::vector< std::vector < double > > | calcWeights (GFTrack *trk, double beta) |
Calculate the weights for the next fitting pass. More... | |
void | copySmoothing (GFTrack *source, GFTrack *target, int target_ire) |
Copy the smoothing matrices from the source track to the target. More... | |
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 | 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... | |
Private Attributes | |
std::vector< std::vector < std::vector< double > > > | fWeights |
std::vector< double > | fBeta |
std::map< int, double > | fchi2Cuts |
Determinstic Annealing Filter (DAF) implementation.
The DAF is an iterative Kalman filter with annealing. It is capable of fitting tracks which are contaminated with noise hits. The algorithm is taken from the references R. Fruehwirth & A. Strandlie, Computer Physics Communications 120 (1999) 197-214 and CERN thesis: Dissertation by Matthias Winkler.
GFDaf::GFDaf | ( | ) |
Definition at line 21 of file GFDaf.cxx.
References setBetas(), GFKalman::setNumIterations(), and setProbCut().
|
private |
Calculate the weights for the next fitting pass.
Definition at line 80 of file GFDaf.cxx.
References exp(), fchi2Cuts, GFAbsRecoHit::getDetPlane(), GFDafHit::getHit(), GFTrack::getHit(), GFAbsRecoHit::getHitCoord(), GFAbsRecoHit::getHitCov(), GFDafHit::getNumHits(), GFTrack::getNumHits(), GFTools::getSmoothedPos(), GFTrack::getTrackRep(), i, GFException::info(), GFTools::invertMatrix(), m, phi, Pi, sqrt(), and GFException::what().
Referenced by processTrack().
Copy the smoothing matrices from the source track to the target.
Definition at line 238 of file GFDaf.cxx.
References GFBookkeeping::bookGFDetPlanes(), GFBookkeeping::bookMatrices(), GFTrack::getBK(), GFBookkeeping::getDetPlane(), GFTrack::getHit(), GFBookkeeping::getMatrix(), GFBookkeeping::getMatrixKeys(), GFDafHit::getNumHits(), GFTrack::getNumHits(), GFTrack::getNumReps(), GFTrack::getTrackRep(), GFAbsTrackRep::hasAuxInfo(), i, GFBookkeeping::setDetPlane(), GFBookkeeping::setMatrix(), and GFBookkeeping::setNhits().
Referenced by processTrack().
|
inherited |
Performs fit on a GFTrack beginning with the current hit.
Definition at line 133 of file GFKalman.cxx.
References GFTrack::addFailedHit(), GFBookkeeping::clearFailedHits(), GFTrack::getBK(), GFTrack::getNextHitToFit(), GFTrack::getNumHits(), GFTrack::getNumReps(), GFAbsTrackRep::getStatusFlag(), GFTrack::getTrackRep(), GFException::info(), GFException::isFatal(), nhits, GFKalman::processHit(), GFAbsTrackRep::setChiSqu(), GFAbsTrackRep::setNDF(), GFTrack::setNextHitToFit(), GFAbsTrackRep::setStatusFlag(), and GFException::what().
Referenced by GFKalman::processTrack().
|
inherited |
Calculates chi2 of a given hit with respect to a given track representation.
Definition at line 215 of file GFKalman.cxx.
References GFKalman::chi2Increment(), GFAbsTrackRep::extrapolate(), GFAbsRecoHit::getDetPlane(), GFAbsTrackRep::getDim(), GFAbsRecoHit::getHitCov(), GFAbsRecoHit::getHMatrix(), r, and GFAbsRecoHit::residualVector().
|
inline |
Return the weights present after the track was processed.
The DAF uses special effective hits defined in the class GFDafHit. A GFDafHit is a wrappe class and contains all the real hits from one plane. The structure of the return vector of getWeights allows to reconstruct in what way the hits were grouped: the outermost vector represents the track representation, there is one entry per track representation. The middle vector represents the effective hits, and the innermost vector contains the real hits contained in the corresponding effective hit.
Definition at line 66 of file GFDaf.h.
References fWeights.
Initialize the GFDafHit and their weights before the fit.
Definition at line 203 of file GFDaf.cxx.
References fWeights, GFTrack::getHit(), GFTrack::getHitsByPlane(), GFTrack::getNumReps(), hits, and i.
Referenced by processTrack().
|
inlineinherited |
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.
References GFKalman::processTrack().
|
inlineinherited |
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.
References GFKalman::processTrack().
void GFDaf::processTrack | ( | GFTrack * | trk | ) |
Process a track using the DAF.
Definition at line 30 of file GFDaf.cxx.
References GFTrack::addHit(), GFTrack::addTrackRep(), calcWeights(), copySmoothing(), fBeta, fWeights, GFTrack::getHit(), GFTrack::getNumHits(), GFTrack::getNumReps(), GFTrack::getSmoothing(), GFAbsTrackRep::getStatusFlag(), GFTrack::getTrackRep(), hit, i, GFException::info(), initHitsWeights(), GFKalman::processTrack(), GFTrack::releaseTrackReps(), GFDafHit::setBlowUp(), GFTrack::setSmoothing(), GFAbsTrackRep::setStatusFlag(), GFDafHit::setWeights(), and GFException::what().
Referenced by PndRecoDafFit::Fit().
void GFDaf::setBetas | ( | double | b1, |
double | b2, | ||
double | b3 = -1. , |
||
double | b4 = -1. , |
||
double | b5 = -1. , |
||
double | b6 = -1. , |
||
double | b7 = -1. , |
||
double | b8 = -1. , |
||
double | b9 = -1. , |
||
double | b10 = -1. |
||
) |
|
inlineinherited |
Set the blowup factor (see blowUpCovs() )
Definition at line 111 of file GFKalman.h.
References f, and GFKalman::fBlowUpFactor.
|
inlineinherited |
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 107 of file GFKalman.h.
References d, and GFKalman::fInitialDirection.
|
inlineinherited |
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.
|
inlineinherited |
Set number of iterations for Kalman Filter.
One iteration is one forward pass plus one backward pass
Definition at line 86 of file GFKalman.h.
References GFKalman::fNumIt, and i.
Referenced by PndHypDKalmanTask::Exec(), PndLmdKalmanTask::Exec(), GFDaf(), and PndRecoKalmanFit::Init().
void GFDaf::setProbCut | ( | double | prob_cut | ) |
Set the probabilty cut for the weight calculation for the hits.
Currently supported are the values 0.01 0.005, and 0.001. The corresponding chi2 cuts for different hits dimensionalities are hardcoded in the implementation because I did not yet figure out how to calculate them. Please feel very welcome to change the implementtion if you know how to do it.
Definition at line 143 of file GFDaf.cxx.
References fabs(), fchi2Cuts, and GFException::setFatal().
Referenced by GFDaf().
|
private |
Definition at line 100 of file GFDaf.h.
Referenced by processTrack(), and setBetas().
|
private |
Definition at line 101 of file GFDaf.h.
Referenced by calcWeights(), and setProbCut().
|
private |
Definition at line 99 of file GFDaf.h.
Referenced by getWeights(), initHitsWeights(), and processTrack().