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

Determinstic Annealing Filter (DAF) implementation. More...

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

+ Inheritance diagram for GFDaf:
+ Collaboration diagram for GFDaf:

Public Member Functions

 GFDaf ()
 
 ~GFDaf ()
 
void processTrack (GFTrack *trk)
 Process a track using the DAF.
 
const std::vector< std::vector
< std::vector< double > > > 
getWeights ()
 Return the weights present after the track was processed.
 
void setProbCut (double prob_cut)
 Set the probabilty cut for the weight calculation for the hits.
 
void setBetas (double b1, double b2=-1, 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.
 

Private Member Functions

std::vector< GFDafHit * > initHitsWeights (GFTrack *trk)
 Initialize the GFDafHit and their weights before the fit.
 
std::vector< std::vector
< double > > 
calcWeights (GFTrack *trk, double beta)
 Calculate the weights for the next fitting pass.
 
void copySmoothing (GFTrack *source, GFTrack *target, int target_ire)
 Copy the smoothing matrices from the source track to the target.
 
void saveWeights (GFTrack *trk, const std::vector< std::vector< std::vector< double > > > &weights) const
 
- Private Member Functions inherited from GFKalman
 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() )
 
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 Attributes

std::vector< std::vector
< std::vector< double > > > 
fWeights
 
std::vector< double > fBeta
 
std::map< int, double > fchi2Cuts
 

Detailed Description

Determinstic Annealing Filter (DAF) implementation.

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

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.

The weights which were assigned to the hits by the DAF are accessible by using the bookkeeping object of the fitted track. The weight is stored under the key "dafWeight". So to retrieve for example the weight of hit 10, fitted with track representation 2, use GFTrack::getBK(2)->getNumber("dafWeight", 10, double& wght).

Definition at line 51 of file GFDaf.h.

View newest version in sPHENIX GitHub at line 51 of file GFDaf.h

Constructor & Destructor Documentation

GFDaf::GFDaf ( )

Definition at line 21 of file GFDaf.cxx.

View newest version in sPHENIX GitHub at line 21 of file GFDaf.cxx

References setBetas(), GFKalman::setNumIterations(), and setProbCut().

+ Here is the call graph for this function:

GFDaf::~GFDaf ( )
inline

Definition at line 55 of file GFDaf.h.

View newest version in sPHENIX GitHub at line 55 of file GFDaf.h

Member Function Documentation

std::vector< std::vector< double > > GFDaf::calcWeights ( GFTrack trk,
double  beta 
)
private

Calculate the weights for the next fitting pass.

Definition at line 91 of file GFDaf.cxx.

View newest version in sPHENIX GitHub at line 91 of file GFDaf.cxx

References Acts::UnitConstants::e, fchi2Cuts, GFTools::getBiasedSmoothedData(), GFTools::getBiasedSmoothedPos(), GFAbsRecoHit::getDetPlane(), GFDafHit::getHit(), GFTrack::getHit(), GFAbsRecoHit::getMeasurement(), GFDafHit::getNumHits(), GFTrack::getNumHits(), GFTrack::getTrackRep(), GFException::info(), GFTools::invertMatrix(), Acts::UnitConstants::m, phi, and GFException::what().

Referenced by processTrack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GFDaf::copySmoothing ( GFTrack source,
GFTrack target,
int  target_ire 
)
private

Copy the smoothing matrices from the source track to the target.

Definition at line 255 of file GFDaf.cxx.

View newest version in sPHENIX GitHub at line 255 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(), GFBookkeeping::setDetPlane(), and GFBookkeeping::setMatrix().

Referenced by processTrack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::vector<std::vector<std::vector<double> > > GFDaf::getWeights ( )
inline

Return the weights present after the track was processed.

WARNING: This function is deprecated! Use the bookkeeping instead.

The DAF uses special effective hits defined in the class GFDafHit. A GFDafHit is a wrapper 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 73 of file GFDaf.h.

View newest version in sPHENIX GitHub at line 73 of file GFDaf.h

References fWeights.

std::vector< GFDafHit * > GFDaf::initHitsWeights ( GFTrack trk)
private

Initialize the GFDafHit and their weights before the fit.

Definition at line 220 of file GFDaf.cxx.

View newest version in sPHENIX GitHub at line 220 of file GFDaf.cxx

References fWeights, GFTrack::getHit(), GFTrack::getHitsByPlane(), and GFTrack::getNumReps().

Referenced by processTrack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GFDaf::processTrack ( GFTrack trk)

Process a track using the DAF.

Definition at line 29 of file GFDaf.cxx.

View newest version in sPHENIX GitHub at line 29 of file GFDaf.cxx

References GFTrack::addHit(), GFTrack::addTrackRep(), GFKalman::blowUpCovs(), calcWeights(), copySmoothing(), Acts::UnitConstants::e, fBeta, fWeights, GFTrack::getBK(), GFTrack::getHit(), GFTrack::getNumHits(), GFTrack::getNumReps(), GFTrack::getSmoothing(), GFAbsTrackRep::getStatusFlag(), GFTrack::getTrackRep(), GFException::info(), initHitsWeights(), GFKalman::processTrack(), GFTrack::releaseTrackReps(), saveWeights(), GFBookkeeping::setNhits(), GFTrack::setSmoothing(), GFAbsTrackRep::setStatusFlag(), GFDafHit::setWeights(), and GFException::what().

Referenced by PndRecoDafFit::Fit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GFDaf::saveWeights ( GFTrack trk,
const std::vector< std::vector< std::vector< double > > > &  weights 
) const
private

Definition at line 319 of file GFDaf.cxx.

View newest version in sPHENIX GitHub at line 319 of file GFDaf.cxx

References bk(), GFBookkeeping::bookNumbers(), GFTrack::getBK(), GFTrack::getNumHits(), GFTrack::getNumReps(), and GFBookkeeping::setNumber().

Referenced by processTrack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GFDaf::setBetas ( double  b1,
double  b2 = -1,
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.

In the current implementation you need to provide at least one temperatures and not more then ten tempertatures.

Definition at line 188 of file GFDaf.cxx.

View newest version in sPHENIX GitHub at line 188 of file GFDaf.cxx

References fBeta.

Referenced by GFDaf().

+ Here is the caller graph for this function:

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 157 of file GFDaf.cxx.

View newest version in sPHENIX GitHub at line 157 of file GFDaf.cxx

References fchi2Cuts, and GFException::setFatal().

Referenced by GFDaf().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<double> GFDaf::fBeta
private

Definition at line 112 of file GFDaf.h.

View newest version in sPHENIX GitHub at line 112 of file GFDaf.h

Referenced by processTrack(), and setBetas().

std::map<int,double> GFDaf::fchi2Cuts
private

Definition at line 113 of file GFDaf.h.

View newest version in sPHENIX GitHub at line 113 of file GFDaf.h

Referenced by calcWeights(), and setProbCut().

std::vector<std::vector<std::vector<double> > > GFDaf::fWeights
private

Definition at line 111 of file GFDaf.h.

View newest version in sPHENIX GitHub at line 111 of file GFDaf.h

Referenced by getWeights(), initHitsWeights(), and processTrack().


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