SND@LHC Software
Loading...
Searching...
No Matches
FitStatus.h
Go to the documentation of this file.
1/* Copyright 2008-2010, Technische Universitaet Muenchen,
2 Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch & Tobias Schlüter
3
4 This file is part of GENFIT.
5
6 GENFIT is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 GENFIT is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18*/
23#ifndef genfit_FitStatus_h
24#define genfit_FitStatus_h
25
26#include <Rtypes.h>
27#include <Math/ProbFuncMathCore.h>
28
29
30namespace genfit {
31
36class FitStatus {
37
38 public:
39
42 trackHasChanged_(false), trackIsPruned_(false), charge_(0), chi2_(-1e99), ndf_(-1e99)
43 {;}
44
45 virtual ~FitStatus() {};
46
47 virtual FitStatus* clone() const {return new FitStatus(*this);}
48
50 bool isFitted() const {return isFitted_;}
52
61 bool isFitConverged(bool inAllPoints = true) const {
62 if (inAllPoints) return isFitConvergedFully_; return isFitConvergedPartially_;
63 }
66 int getNFailedPoints() const {return nFailedPoints_;}
68 bool hasTrackChanged() const {return trackHasChanged_;}
70 bool isTrackPruned() const {return trackIsPruned_;}
72 double getCharge() const {return charge_;}
74 double getChi2() const {return chi2_;}
76 double getNdf() const {return ndf_;}
82 virtual double getPVal() const {return ROOT::Math::chisquared_cdf_c(chi2_, ndf_);}
83
84 void setIsFitted(bool fitted = true) {isFitted_ = fitted;}
85 void setIsFitConvergedFully(bool fitConverged = true) {isFitConvergedFully_ = fitConverged;}
86 void setIsFitConvergedPartially(bool fitConverged = true) {isFitConvergedPartially_ = fitConverged;}
87 void setNFailedPoints(int nFailedPoints) {nFailedPoints_ = nFailedPoints;}
88 void setHasTrackChanged(bool trackChanged = true) {trackHasChanged_ = trackChanged;}
89 void setIsTrackPruned(bool pruned = true) {trackIsPruned_ = pruned;}
90 void setCharge(double charge) {charge_ = charge;}
91
92 void setChi2(const double& chi2) {chi2_ = chi2;}
93 void setNdf(const double& ndf) {ndf_ = ndf;}
94
95 virtual void Print(const Option_t* = "") const;
96
97 protected:
98
112 double charge_;
113
116 double chi2_;
117 double ndf_;
118
120};
121
122} /* End of namespace genfit */
125#endif // genfit_FitStatus_h
Class where important numbers and properties of a fit can be stored.
Definition FitStatus.h:36
void setNdf(const double &ndf)
Definition FitStatus.h:93
int getNFailedPoints() const
Definition FitStatus.h:66
bool isFitConvergedPartially() const
Definition FitStatus.h:65
int nFailedPoints_
Number of failed TrackPoints.
Definition FitStatus.h:106
virtual ~FitStatus()
Definition FitStatus.h:45
void setIsFitConvergedPartially(bool fitConverged=true)
Definition FitStatus.h:86
bool trackIsPruned_
Information has been stripped off, no refitting possible!
Definition FitStatus.h:110
virtual double getPVal() const
Get the p value of the fit.
Definition FitStatus.h:82
double getCharge() const
Get the fitted charge.
Definition FitStatus.h:72
virtual FitStatus * clone() const
Definition FitStatus.h:47
double getNdf() const
Get the degrees of freedom of the fit.
Definition FitStatus.h:76
bool isFitConvergedPartially_
did the fit converge with a subset of all TrackPoints?
Definition FitStatus.h:104
void setIsTrackPruned(bool pruned=true)
Definition FitStatus.h:89
ClassDef(FitStatus, 1)
bool hasTrackChanged() const
Has anything in the Track been changed since the fit?
Definition FitStatus.h:68
bool isFitConverged(bool inAllPoints=true) const
Did the fit converge (in all Points or only partially)?
Definition FitStatus.h:61
double charge_
fitted charge
Definition FitStatus.h:112
bool isFitted() const
Has the track been fitted?
Definition FitStatus.h:50
void setIsFitted(bool fitted=true)
Definition FitStatus.h:84
bool trackHasChanged_
has anything in the Track been changed since the fit? -> fit isn't valid anymore
Definition FitStatus.h:108
void setNFailedPoints(int nFailedPoints)
Definition FitStatus.h:87
bool isTrackPruned() const
Has the track been pruned after the fit?
Definition FitStatus.h:70
bool isFitted_
has the track been fitted?
Definition FitStatus.h:100
bool isFitConvergedFully_
did the fit converge with all TrackPoints?
Definition FitStatus.h:102
bool isFitConvergedFully() const
Definition FitStatus.h:64
void setHasTrackChanged(bool trackChanged=true)
Definition FitStatus.h:88
void setIsFitConvergedFully(bool fitConverged=true)
Definition FitStatus.h:85
double getChi2() const
Get chi^2 of the fit.
Definition FitStatus.h:74
virtual void Print(const Option_t *="") const
Definition FitStatus.cc:27
void setChi2(const double &chi2)
Definition FitStatus.h:92
void setCharge(double charge)
Definition FitStatus.h:90
Matrix inversion tools.
Definition AbsBField.h:29