SND@LHC Software
Loading...
Searching...
No Matches
genfit::FitStatus Class Reference

Class where important numbers and properties of a fit can be stored. More...

#include <FitStatus.h>

Inheritance diagram for genfit::FitStatus:

Public Member Functions

 FitStatus ()
 
virtual ~FitStatus ()
 
virtual FitStatusclone () const
 
bool isFitted () const
 Has the track been fitted?
 
bool isFitConverged (bool inAllPoints=true) const
 Did the fit converge (in all Points or only partially)?
 
bool isFitConvergedFully () const
 
bool isFitConvergedPartially () const
 
int getNFailedPoints () const
 
bool hasTrackChanged () const
 Has anything in the Track been changed since the fit?
 
bool isTrackPruned () const
 Has the track been pruned after the fit?
 
double getCharge () const
 Get the fitted charge.
 
double getChi2 () const
 Get chi^2 of the fit.
 
double getNdf () const
 Get the degrees of freedom of the fit.
 
virtual double getPVal () const
 Get the p value of the fit.
 
void setIsFitted (bool fitted=true)
 
void setIsFitConvergedFully (bool fitConverged=true)
 
void setIsFitConvergedPartially (bool fitConverged=true)
 
void setNFailedPoints (int nFailedPoints)
 
void setHasTrackChanged (bool trackChanged=true)
 
void setIsTrackPruned (bool pruned=true)
 
void setCharge (double charge)
 
void setChi2 (const double &chi2)
 
void setNdf (const double &ndf)
 
virtual void Print (const Option_t *="") const
 

Protected Member Functions

 ClassDef (FitStatus, 1)
 

Protected Attributes

bool isFitted_
 has the track been fitted?
 
bool isFitConvergedFully_
 did the fit converge with all TrackPoints?
 
bool isFitConvergedPartially_
 did the fit converge with a subset of all TrackPoints?
 
int nFailedPoints_
 Number of failed TrackPoints.
 
bool trackHasChanged_
 has anything in the Track been changed since the fit? -> fit isn't valid anymore
 
bool trackIsPruned_
 Information has been stripped off, no refitting possible!
 
double charge_
 fitted charge
 
double chi2_
 
double ndf_
 

Detailed Description

Class where important numbers and properties of a fit can be stored.

Author
Johannes Rauch (Technische Universität München, original author)

Definition at line 36 of file FitStatus.h.

Constructor & Destructor Documentation

◆ FitStatus()

genfit::FitStatus::FitStatus ( )
inline

Definition at line 40 of file FitStatus.h.

40 :
42 trackHasChanged_(false), trackIsPruned_(false), charge_(0), chi2_(-1e99), ndf_(-1e99)
43 {;}
int nFailedPoints_
Number of failed TrackPoints.
Definition FitStatus.h:106
bool trackIsPruned_
Information has been stripped off, no refitting possible!
Definition FitStatus.h:110
bool isFitConvergedPartially_
did the fit converge with a subset of all TrackPoints?
Definition FitStatus.h:104
double charge_
fitted charge
Definition FitStatus.h:112
bool trackHasChanged_
has anything in the Track been changed since the fit? -> fit isn't valid anymore
Definition FitStatus.h:108
bool isFitted_
has the track been fitted?
Definition FitStatus.h:100
bool isFitConvergedFully_
did the fit converge with all TrackPoints?
Definition FitStatus.h:102

◆ ~FitStatus()

virtual genfit::FitStatus::~FitStatus ( )
inlinevirtual

Definition at line 45 of file FitStatus.h.

45{};

Member Function Documentation

◆ ClassDef()

genfit::FitStatus::ClassDef ( FitStatus  ,
 
)
protected

◆ clone()

virtual FitStatus * genfit::FitStatus::clone ( ) const
inlinevirtual

Reimplemented in genfit::KalmanFitStatus.

Definition at line 47 of file FitStatus.h.

47{return new FitStatus(*this);}

◆ getCharge()

double genfit::FitStatus::getCharge ( ) const
inline

Get the fitted charge.

Definition at line 72 of file FitStatus.h.

72{return charge_;}

◆ getChi2()

double genfit::FitStatus::getChi2 ( ) const
inline

Get chi^2 of the fit.

Definition at line 74 of file FitStatus.h.

74{return chi2_;}

◆ getNdf()

double genfit::FitStatus::getNdf ( ) const
inline

Get the degrees of freedom of the fit.

Definition at line 76 of file FitStatus.h.

76{return ndf_;}

◆ getNFailedPoints()

int genfit::FitStatus::getNFailedPoints ( ) const
inline

Definition at line 66 of file FitStatus.h.

66{return nFailedPoints_;}

◆ getPVal()

virtual double genfit::FitStatus::getPVal ( ) const
inlinevirtual

Get the p value of the fit.

Virtual, because the fitter may use a different probability distribution.

Definition at line 82 of file FitStatus.h.

82{return ROOT::Math::chisquared_cdf_c(chi2_, ndf_);}

◆ hasTrackChanged()

bool genfit::FitStatus::hasTrackChanged ( ) const
inline

Has anything in the Track been changed since the fit?

Definition at line 68 of file FitStatus.h.

68{return trackHasChanged_;}

◆ isFitConverged()

bool genfit::FitStatus::isFitConverged ( bool  inAllPoints = true) const
inline

Did the fit converge (in all Points or only partially)?

Per default, this function will only be true, if all TrackPoints (with measurements) have been used in the fit, and the fit has converged.

If one or more TrackPoints have been skipped (e.g. plane could not be constructed or extrapolation to plane failed), but the fit otherwise met the convergence criteria, isFitConverged(false) will return true.

Definition at line 61 of file FitStatus.h.

61 {
62 if (inAllPoints) return isFitConvergedFully_; return isFitConvergedPartially_;
63 }

◆ isFitConvergedFully()

bool genfit::FitStatus::isFitConvergedFully ( ) const
inline

Definition at line 64 of file FitStatus.h.

◆ isFitConvergedPartially()

bool genfit::FitStatus::isFitConvergedPartially ( ) const
inline

Definition at line 65 of file FitStatus.h.

◆ isFitted()

bool genfit::FitStatus::isFitted ( ) const
inline

Has the track been fitted?

Definition at line 50 of file FitStatus.h.

50{return isFitted_;}

◆ isTrackPruned()

bool genfit::FitStatus::isTrackPruned ( ) const
inline

Has the track been pruned after the fit?

Definition at line 70 of file FitStatus.h.

70{return trackIsPruned_;}

◆ Print()

void genfit::FitStatus::Print ( const Option_t *  = "") const
virtual

Reimplemented in genfit::KalmanFitStatus.

Definition at line 27 of file FitStatus.cc.

28{
29 std::cout << "fitStatus \n";
30 if (isFitted_) {
31 std::cout << " track has been fitted,";
33 std::cout << " fit has converged fully,";
35 std::cout << " fit has converged partially,";
36 else
37 std::cout << " fit has NOT converged,";
38 std::cout << " " << nFailedPoints_ << " TrackPoints could not be processed,";
39 if (trackHasChanged_) std::cout << " track has changed since the fit,";
40 if (trackIsPruned_) std::cout << " track is pruned,";
41 std::cout << " fitted charge = " << charge_ << " \n";
42 }
43 else
44 std::cout << " track has NOT been fitted,";
45}

◆ setCharge()

void genfit::FitStatus::setCharge ( double  charge)
inline

Definition at line 90 of file FitStatus.h.

90{charge_ = charge;}

◆ setChi2()

void genfit::FitStatus::setChi2 ( const double &  chi2)
inline

Definition at line 92 of file FitStatus.h.

92{chi2_ = chi2;}

◆ setHasTrackChanged()

void genfit::FitStatus::setHasTrackChanged ( bool  trackChanged = true)
inline

Definition at line 88 of file FitStatus.h.

88{trackHasChanged_ = trackChanged;}

◆ setIsFitConvergedFully()

void genfit::FitStatus::setIsFitConvergedFully ( bool  fitConverged = true)
inline

Definition at line 85 of file FitStatus.h.

85{isFitConvergedFully_ = fitConverged;}

◆ setIsFitConvergedPartially()

void genfit::FitStatus::setIsFitConvergedPartially ( bool  fitConverged = true)
inline

Definition at line 86 of file FitStatus.h.

86{isFitConvergedPartially_ = fitConverged;}

◆ setIsFitted()

void genfit::FitStatus::setIsFitted ( bool  fitted = true)
inline

Definition at line 84 of file FitStatus.h.

84{isFitted_ = fitted;}

◆ setIsTrackPruned()

void genfit::FitStatus::setIsTrackPruned ( bool  pruned = true)
inline

Definition at line 89 of file FitStatus.h.

89{trackIsPruned_ = pruned;}

◆ setNdf()

void genfit::FitStatus::setNdf ( const double &  ndf)
inline

Definition at line 93 of file FitStatus.h.

93{ndf_ = ndf;}

◆ setNFailedPoints()

void genfit::FitStatus::setNFailedPoints ( int  nFailedPoints)
inline

Definition at line 87 of file FitStatus.h.

87{nFailedPoints_ = nFailedPoints;}

Member Data Documentation

◆ charge_

double genfit::FitStatus::charge_
protected

fitted charge

Definition at line 112 of file FitStatus.h.

◆ chi2_

double genfit::FitStatus::chi2_
protected

These are provided for the sake of the fitter, and their interpretation may vary. For the Kalman-derived fitters in particular, this corresponds to the backwards fit.

Definition at line 116 of file FitStatus.h.

◆ isFitConvergedFully_

bool genfit::FitStatus::isFitConvergedFully_
protected

did the fit converge with all TrackPoints?

Definition at line 102 of file FitStatus.h.

◆ isFitConvergedPartially_

bool genfit::FitStatus::isFitConvergedPartially_
protected

did the fit converge with a subset of all TrackPoints?

Definition at line 104 of file FitStatus.h.

◆ isFitted_

bool genfit::FitStatus::isFitted_
protected

has the track been fitted?

Definition at line 100 of file FitStatus.h.

◆ ndf_

double genfit::FitStatus::ndf_
protected

Definition at line 117 of file FitStatus.h.

◆ nFailedPoints_

int genfit::FitStatus::nFailedPoints_
protected

Number of failed TrackPoints.

Definition at line 106 of file FitStatus.h.

◆ trackHasChanged_

bool genfit::FitStatus::trackHasChanged_
protected

has anything in the Track been changed since the fit? -> fit isn't valid anymore

Definition at line 108 of file FitStatus.h.

◆ trackIsPruned_

bool genfit::FitStatus::trackIsPruned_
protected

Information has been stripped off, no refitting possible!

Definition at line 110 of file FitStatus.h.


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