Analysis Software
Documentation for sPHENIX simulation software
|
Determinstic Annealing Filter (DAF) implementation. More...
#include <GenFit/blob/master/fitters/include/DAF.h>
Public Member Functions | |
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 () | |
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 | setMaxIterations (unsigned int n) override |
Set the maximum number of iterations. | |
void | setConvergenceDeltaWeight (double delta) |
If all weights change less than delta between two iterations, the fit is regarded as converged. | |
AbsKalmanFitter * | getKalman () const |
virtual void | setMaxFailedHits (int val) override |
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 &) | |
DAF & | operator= (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 | |
double | deltaWeight_ |
std::vector< double > | betas_ |
double | chi2Cuts_ [7] |
std::unique_ptr< AbsKalmanFitter > | kalman_ |
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_ |
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.
The weights which were assigned to the hits by the DAF are accessible in the MeasurementOnPlane objects in the KalmanFitterInfo objects.
Definition at line 49 of file DAF.h.
View newest version in sPHENIX GitHub at line 49 of file DAF.h
|
private |
Create DAF. Per default, use KalmanFitterRefTrack as fitter.
useRefKalman | If false, use KalmanFitter as fitter. |
Definition at line 43 of file DAF.cc.
View newest version in sPHENIX GitHub at line 43 of file DAF.cc
References kalman_, setAnnealingScheme(), setProbCut(), and genfit::weightedAverage.
genfit::DAF::DAF | ( | AbsKalmanFitter * | kalman, |
double | deltaPval = 1e-3 , |
||
double | deltaWeight = 1e-3 |
||
) |
Create DAF. Use the provided AbsKalmanFitter as fitter.
Definition at line 60 of file DAF.cc.
View newest version in sPHENIX GitHub at line 60 of file DAF.cc
References kalman_, setAnnealingScheme(), setProbCut(), and genfit::weightedAverage.
|
inline |
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 180 of file DAF.cc.
View newest version in sPHENIX GitHub at line 180 of file DAF.cc
References chi2Cuts_, and genfit::Exception::setFatal().
Referenced by setProbCut().
|
private |
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.
Definition at line 218 of file DAF.cc.
View newest version in sPHENIX GitHub at line 218 of file DAF.cc
References genfit::KalmanFitterInfo::areWeightsFixed(), assert, chi2Cuts_, genfit::AbsFitter::debugLvl_, genfit::debugOut, deltaWeight_, E, Acts::UnitConstants::e, genfit::errorOut, genfit::MeasuredStateOnPlane::getCov(), genfit::KalmanFitterInfo::getMeasurementOnPlane(), genfit::KalmanFitterInfo::getNumMeasurements(), genfit::Track::getPointsWithMeasurement(), genfit::KalmanFitterInfo::getResidual(), genfit::StateOnPlane::getState(), genfit::MeasurementOnPlane::getWeight(), genfit::Exception::info(), genfit::tools::invertMatrix(), j, norm, ActsTests::PropagationDatasets::phi, genfit::MeasurementOnPlane::setWeight(), physmon_simulation::tp, and genfit::Exception::what().
Referenced by processTrackWithRep().
|
inline |
|
inline |
Definition at line 98 of file DAF.h.
View newest version in sPHENIX GitHub at line 98 of file DAF.h
References kalman_.
Referenced by setDebugLvl(), and setMaxFailedHits().
|
private |
|
overridevirtual |
Process a track using the DAF.
Implements genfit::AbsFitter.
Definition at line 76 of file DAF.cc.
View newest version in sPHENIX GitHub at line 76 of file DAF.cc
References betas_, calcWeights(), genfit::AbsFitter::debugLvl_, genfit::debugOut, genfit::AbsKalmanFitter::deltaPval_, Acts::UnitConstants::e, genfit::errorOut, genfit::KalmanFitStatus::getBackwardPVal(), genfit::Track::getFitStatus(), genfit::KalmanFitStatus::getForwardPVal(), genfit::FitStatus::getNFailedPoints(), genfit::Exception::info(), genfit::FitStatus::isFitted(), kalman_, genfit::AbsKalmanFitter::maxIterations_, genfit::AbsKalmanFitter::minIterations_, genfit::FitStatus::setIsFitConvergedFully(), genfit::FitStatus::setIsFitConvergedPartially(), genfit::FitStatus::setIsFitted(), genfit::KalmanFitStatus::setIsFittedWithDaf(), genfit::KalmanFitStatus::setNumIterations(), utils::status, and genfit::Exception::what().
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_ and maxIterations_.
Definition at line 194 of file DAF.cc.
View newest version in sPHENIX GitHub at line 194 of file DAF.cc
References assert, betas_, E, i, genfit::AbsKalmanFitter::maxIterations_, and genfit::AbsKalmanFitter::minIterations_.
Referenced by DAF().
|
inline |
If all weights change less than delta between two iterations, the fit is regarded as converged.
Definition at line 96 of file DAF.h.
View newest version in sPHENIX GitHub at line 96 of file DAF.h
References physmon_vertexing::delta, and deltaWeight_.
|
inlineoverridevirtual |
Reimplemented from genfit::AbsFitter.
Definition at line 102 of file DAF.h.
View newest version in sPHENIX GitHub at line 102 of file DAF.h
References getKalman(), and genfit::AbsFitter::setDebugLvl().
|
inlineoverridevirtual |
Reimplemented from genfit::AbsKalmanFitter.
Definition at line 100 of file DAF.h.
View newest version in sPHENIX GitHub at line 100 of file DAF.h
References getKalman(), and genfit::AbsKalmanFitter::setMaxFailedHits().
|
inlineoverridevirtual |
Set the maximum number of iterations.
Reimplemented from genfit::AbsKalmanFitter.
Definition at line 93 of file DAF.h.
View newest version in sPHENIX GitHub at line 93 of file DAF.h
References betas_, genfit::AbsKalmanFitter::maxIterations_, and n.
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 174 of file DAF.cc.
View newest version in sPHENIX GitHub at line 174 of file DAF.cc
References addProbCut(), and i.
Referenced by DAF().
|
private |
Definition at line 114 of file DAF.h.
View newest version in sPHENIX GitHub at line 114 of file DAF.h
Referenced by getBetas(), processTrackWithRep(), setAnnealingScheme(), and setMaxIterations().
|
private |
Definition at line 115 of file DAF.h.
View newest version in sPHENIX GitHub at line 115 of file DAF.h
Referenced by addProbCut(), and calcWeights().
|
private |
Definition at line 113 of file DAF.h.
View newest version in sPHENIX GitHub at line 113 of file DAF.h
Referenced by calcWeights(), and setConvergenceDeltaWeight().
|
private |
Definition at line 120 of file DAF.h.
View newest version in sPHENIX GitHub at line 120 of file DAF.h
Referenced by DAF(), getKalman(), and processTrackWithRep().