GENFIT Rev: NoNumberAvailable
Loading...
Searching...
No Matches
genfit::DAF Class Reference

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

#include <DAF.h>

Inheritance diagram for genfit::DAF:
Inheritance graph
Collaboration diagram for genfit::DAF:
Collaboration graph

Public Member Functions

 DAF (const std::tuple< double, double, int > &annealingScheme, int minIter, int maxIter, int minIterForPval, bool useRefKalman=true, double deltaPval=1e-3, double deltaWeight=1e-3, double probCut=1e-3)
 Create DAF. Per default, use KalmanFitterRefTrack as fitter, this constructor should be used for additional configuration of the DAF, allows to provide custom parameters.
 
 DAF (bool useRefKalman=true, double deltaPval=1e-3, double deltaWeight=1e-3)
 Create DAF. Per default, use KalmanFitterRefTrack as fitter.
 
 DAF (AbsKalmanFitter *kalman, double deltaPval=1e-3, double deltaWeight=1e-3)
 Create DAF. Use the provided AbsKalmanFitter as fitter.
 
 ~DAF ()
 Destruct DAF.
 
void processTrackWithRep (Track *tr, const AbsTrackRep *rep, bool resortHits=false) override
 Process a track using the DAF.
 
void setProbCut (const double prob_cut)
 Set the probability cut for the weight calculation for the hits.
 
void addProbCut (const double prob_cut, const int measDim)
 Set the probability cut for the weight calculation for the hits for a specific measurement dimensionality.
 
const std::vector< double > & getBetas () const
 
void setAnnealingScheme (double bStart, double bFinal, unsigned int nSteps)
 Configure the annealing scheme.
 
void setAnnealingScheme (double bStart, double bFinal, unsigned int nSteps, unsigned int minIter, unsigned int maxIter)
 Configure the annealing scheme with custom values of min and max iterations.
 
void setMaxIterations (unsigned int n) override
 Set the maximum number of iterations of the DAF.
 
void setConvergenceDeltaWeight (double delta)
 If all weights change less than delta between two iterations, the fit is regarded as converged.
 
AbsKalmanFittergetKalman () const
 Get a pointer to the internal Kalman fitter.
 
void setMaxIterationsKalman (unsigned int n)
 Set the maximum number of iterations of the internal Kalman fitter.
 
virtual void setMaxFailedHits (int val) override
 Set the maximum number of accepted failed hits by the internal Kalman fitter.
 
virtual void setDebugLvl (unsigned int lvl=1) override
 
- Public Member Functions inherited from genfit::AbsKalmanFitter
 AbsKalmanFitter (unsigned int maxIterations=4, double deltaPval=1e-3, double blowUpFactor=1e3)
 
virtual ~AbsKalmanFitter ()
 
void getChiSquNdf (const Track *tr, const AbsTrackRep *rep, double &bChi2, double &fChi2, double &bNdf, double &fNdf) const
 
double getChiSqu (const Track *tr, const AbsTrackRep *rep, int direction=-1) const
 
double getNdf (const Track *tr, const AbsTrackRep *rep, int direction=-1) const
 
double getRedChiSqu (const Track *tr, const AbsTrackRep *rep, int direction=-1) const
 
double getPVal (const Track *tr, const AbsTrackRep *rep, int direction=-1) const
 
unsigned int getMinIterations () const
 
unsigned int getMaxIterations () const
 
double getDeltaPval () const
 
double getRelChi2Change () const
 
double getBlowUpFactor () const
 
bool getResetOffDiagonals () const
 
double getBlowUpMaxVal () const
 
eMultipleMeasurementHandling getMultipleMeasurementHandling () const
 
int getMaxFailedHits () const
 
virtual void setMinIterations (unsigned int n)
 Set the minimum number of iterations.
 
void setDeltaPval (double deltaPval)
 Set Convergence criterion.
 
void setRelChi2Change (double relChi2Change)
 
void setBlowUpFactor (double blowUpFactor)
 
void setResetOffDiagonals (bool resetOffDiagonals)
 
void setBlowUpMaxVal (double blowUpMaxVal)
 Limit the cov entries to this maximum value when blowing up the cov. Set to negative value to disable. Default is 1.E6.
 
void setMultipleMeasurementHandling (eMultipleMeasurementHandling mmh)
 How should multiple measurements be handled?
 
bool isTrackPrepared (const Track *tr, const AbsTrackRep *rep) const
 
bool isTrackFitted (const Track *tr, const AbsTrackRep *rep) const
 
bool canIgnoreWeights () const
 returns if the fitter can ignore the weights and handle the MeasurementOnPlanes as if they had weight 1.
 
- Public Member Functions inherited from genfit::AbsFitter
 AbsFitter ()
 
virtual ~AbsFitter ()
 
void processTrack (Track *, bool resortHits=false)
 

Private Member Functions

 DAF (const DAF &)
 
DAFoperator= (genfit::DAF const &)
 
bool calcWeights (Track *trk, const AbsTrackRep *rep, double beta)
 Calculate and set the weights for the next fitting pass. Return if convergence is met. The convergence criterium is the largest absolute change of all weights.
 

Private Attributes

int minIterForPval_
 
double deltaWeight_
 
std::vector< double > betas_
 
double chi2Cuts_ [7]
 
std::unique_ptr< AbsKalmanFitterkalman_
 

Additional Inherited Members

- Protected Member Functions inherited from genfit::AbsKalmanFitter
const std::vector< MeasurementOnPlane * > getMeasurements (const KalmanFitterInfo *fi, const TrackPoint *tp, int direction) const
 get the measurementsOnPlane taking the multipleMeasurementHandling_ into account
 
- Protected Attributes inherited from genfit::AbsKalmanFitter
unsigned int minIterations_
 Minimum number of iterations to attempt. Forward and backward are counted as one iteration.
 
unsigned int maxIterations_
 Maximum number of iterations to attempt. Forward and backward are counted as one iteration.
 
double deltaPval_
 Convergence criterion.
 
double relChi2Change_
 
double blowUpFactor_
 Blow up the covariance of the forward (backward) fit by this factor before seeding the backward (forward) fit.
 
bool resetOffDiagonals_
 Reset the off-diagonals to 0 when blowing up the cov.
 
double blowUpMaxVal_
 Limit the cov entries to this maxuimum value when blowing up the cov.
 
eMultipleMeasurementHandling multipleMeasurementHandling_
 How to handle if there are multiple MeasurementsOnPlane.
 
int maxFailedHits_
 
- Protected Attributes inherited from genfit::AbsFitter
unsigned int debugLvl_
 

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 in the MeasurementOnPlane objects in the KalmanFitterInfo objects.

Definition at line 50 of file DAF.h.

Constructor & Destructor Documentation

◆ DAF() [1/4]

genfit::DAF::DAF ( const DAF & )
private

References DAF().

Referenced by DAF(), and operator=().

◆ DAF() [2/4]

genfit::DAF::DAF ( const std::tuple< double, double, int > & annealingScheme,
int minIter,
int maxIter,
int minIterForPval,
bool useRefKalman = true,
double deltaPval = 1e-3,
double deltaWeight = 1e-3,
double probCut = 1e-3 )

Create DAF. Per default, use KalmanFitterRefTrack as fitter, this constructor should be used for additional configuration of the DAF, allows to provide custom parameters.

Parameters
annealingSchemeStart and Final temperatures, and number of steps for the annealing scheme
minIterMinimum number of iterations for the annealing scheme
maxIterMaximum number of iterations for the annealing scheme
minIterForPvalMinimum number of iterations before checking the convergence by pvalue
useRefKalmanIf false, use KalmanFitter as fitter.
deltaPvalThreshold value for pvalue convergence criterion
deltaWeightThreshold value for weight convergence criterion
probCutProbability cut for weight calculation

Definition at line 43 of file DAF.cc.

References genfit::AbsKalmanFitter::AbsKalmanFitter(), deltaWeight_, kalman_, minIterForPval_, setAnnealingScheme(), setProbCut(), genfit::KalmanFitterRefTrack::setRefitAll(), and genfit::weightedAverage.

◆ DAF() [3/4]

genfit::DAF::DAF ( bool useRefKalman = true,
double deltaPval = 1e-3,
double deltaWeight = 1e-3 )

Create DAF. Per default, use KalmanFitterRefTrack as fitter.

Parameters
useRefKalmanIf false, use KalmanFitter as fitter.

Definition at line 63 of file DAF.cc.

References genfit::AbsKalmanFitter::AbsKalmanFitter(), deltaWeight_, kalman_, setAnnealingScheme(), setProbCut(), genfit::KalmanFitterRefTrack::setRefitAll(), and genfit::weightedAverage.

◆ DAF() [4/4]

genfit::DAF::DAF ( AbsKalmanFitter * kalman,
double deltaPval = 1e-3,
double deltaWeight = 1e-3 )

Create DAF. Use the provided AbsKalmanFitter as fitter.

Definition at line 80 of file DAF.cc.

References genfit::AbsKalmanFitter::AbsKalmanFitter(), deltaWeight_, kalman_, setAnnealingScheme(), setProbCut(), and genfit::weightedAverage.

◆ ~DAF()

genfit::DAF::~DAF ( )
inline

Destruct DAF.

Definition at line 86 of file DAF.h.

Member Function Documentation

◆ addProbCut()

void genfit::DAF::addProbCut ( const double prob_cut,
const int measDim )

Set the probability cut for the weight calculation for the hits for a specific measurement dimensionality.

Definition at line 200 of file DAF.cc.

References chi2Cuts_, and genfit::Exception::setFatal().

Referenced by setProbCut().

◆ calcWeights()

◆ getBetas()

const std::vector< double > & genfit::DAF::getBetas ( ) const
inline

Definition at line 102 of file DAF.h.

References betas_.

◆ getKalman()

AbsKalmanFitter * genfit::DAF::getKalman ( ) const
inline

Get a pointer to the internal Kalman fitter.

Definition at line 131 of file DAF.h.

References genfit::AbsKalmanFitter::AbsKalmanFitter(), and kalman_.

Referenced by setDebugLvl(), setMaxFailedHits(), and setMaxIterationsKalman().

◆ operator=()

DAF & genfit::DAF::operator= ( genfit::DAF const & )
private

◆ processTrackWithRep()

◆ setAnnealingScheme() [1/2]

void genfit::DAF::setAnnealingScheme ( double bStart,
double bFinal,
unsigned int nSteps )

Configure the annealing scheme.

Set a start and end temperature and the number of steps. A logarithmic sequence of temperatures will be calculated. Also sets minIterations_, maxIterations_ and #minIterForPval as a function of the number of steps

Definition at line 214 of file DAF.cc.

References betas_, genfit::AbsKalmanFitter::maxIterations_, genfit::AbsKalmanFitter::minIterations_, and minIterForPval_.

Referenced by DAF(), DAF(), and DAF().

◆ setAnnealingScheme() [2/2]

void genfit::DAF::setAnnealingScheme ( double bStart,
double bFinal,
unsigned int nSteps,
unsigned int minIter,
unsigned int maxIter )

Configure the annealing scheme with custom values of min and max iterations.

Set a start and end temperature and the number of steps. A logarithmic sequence of temperatures will be calculated. Also sets minIterations_ and maxIterations_ to the values provided instead of values depending on nSteps

Definition at line 235 of file DAF.cc.

References betas_, genfit::AbsKalmanFitter::maxIterations_, and genfit::AbsKalmanFitter::minIterations_.

◆ setConvergenceDeltaWeight()

void genfit::DAF::setConvergenceDeltaWeight ( double delta)
inline

If all weights change less than delta between two iterations, the fit is regarded as converged.

Definition at line 126 of file DAF.h.

References deltaWeight_.

◆ setDebugLvl()

virtual void genfit::DAF::setDebugLvl ( unsigned int lvl = 1)
inlineoverridevirtual

Reimplemented from genfit::AbsFitter.

Definition at line 147 of file DAF.h.

References getKalman(), and genfit::AbsFitter::setDebugLvl().

◆ setMaxFailedHits()

virtual void genfit::DAF::setMaxFailedHits ( int val)
inlineoverridevirtual

Set the maximum number of accepted failed hits by the internal Kalman fitter.

Reimplemented from genfit::AbsKalmanFitter.

Definition at line 145 of file DAF.h.

References getKalman(), and genfit::AbsKalmanFitter::setMaxFailedHits().

◆ setMaxIterations()

void genfit::DAF::setMaxIterations ( unsigned int n)
inlineoverridevirtual

Set the maximum number of iterations of the DAF.

Reimplemented from genfit::AbsKalmanFitter.

Definition at line 121 of file DAF.h.

References betas_, and genfit::AbsKalmanFitter::maxIterations_.

◆ setMaxIterationsKalman()

void genfit::DAF::setMaxIterationsKalman ( unsigned int n)
inline

Set the maximum number of iterations of the internal Kalman fitter.

Set the maximum number of iterations of the internal Kalman fitter. Note that the internal Kalman fitter can be called multiple times for each DAF iteration, up to the (maximum) number of iterations set by this method.

Definition at line 140 of file DAF.h.

References getKalman(), and genfit::AbsKalmanFitter::setMaxIterations().

◆ setProbCut()

void genfit::DAF::setProbCut ( const double prob_cut)

Set the probability cut for the weight calculation for the hits.

By default the cut values for measurements of dimensionality from 1 to 5 are calculated. If you what to have cut values for an arbitrary measurement dimensionality use addProbCut(double prob_cut, int maxDim);

Definition at line 194 of file DAF.cc.

References addProbCut().

Referenced by DAF(), DAF(), and DAF().

Member Data Documentation

◆ betas_

std::vector<double> genfit::DAF::betas_
private

◆ chi2Cuts_

double genfit::DAF::chi2Cuts_[7]
private

Definition at line 160 of file DAF.h.

Referenced by addProbCut(), and calcWeights().

◆ deltaWeight_

double genfit::DAF::deltaWeight_
private

Definition at line 158 of file DAF.h.

Referenced by calcWeights(), DAF(), DAF(), DAF(), and setConvergenceDeltaWeight().

◆ kalman_

std::unique_ptr<AbsKalmanFitter> genfit::DAF::kalman_
private

Definition at line 165 of file DAF.h.

Referenced by DAF(), DAF(), DAF(), getKalman(), and processTrackWithRep().

◆ minIterForPval_

int genfit::DAF::minIterForPval_
private

Definition at line 157 of file DAF.h.

Referenced by DAF(), processTrackWithRep(), and setAnnealingScheme().


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