GENFIT  Rev:NoNumberAvailable
KalmanFitStatus.h
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
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_KalmanFitStatus_h
24 #define genfit_KalmanFitStatus_h
25 
26 #include "FitStatus.h"
27 
28 #include <Math/ProbFunc.h>
29 
30 
31 namespace genfit {
32 
36 class KalmanFitStatus : public FitStatus {
37 
38  public:
39 
42  trackLen_(0), fChi2_(-1e99), fNdf_(-1e99), fPval_(-1e99) {;}
43 
44  virtual ~KalmanFitStatus() {};
45 
46  virtual FitStatus* clone() const {return new KalmanFitStatus(*this);}
47 
48  unsigned int getNumIterations() const {return numIterations_;}
49  bool isFittedWithDaf() const {return fittedWithDaf_;}
51  double getTrackLen() const {return trackLen_;}
52  double getForwardChi2() const {return fChi2_;}
53  double getBackwardChi2() const {return FitStatus::getChi2();}
54  double getForwardNdf() const {return fNdf_;}
55  double getBackwardNdf() const {return FitStatus::getNdf();}
56  // virtual double getPVal() : not overridden, as it does the right thing.
57  double getForwardPVal() const {return std::max(0.,ROOT::Math::chisquared_cdf_c(fChi2_, fNdf_));}
58  double getBackwardPVal() const {return FitStatus::getPVal(); }
59 
60  void setNumIterations(unsigned int numIterations) {numIterations_ = numIterations;}
61  void setIsFittedWithDaf(bool fittedWithDaf = true) {fittedWithDaf_ = fittedWithDaf;}
62  void setIsFittedWithReferenceTrack(bool fittedWithReferenceTrack = true) {fittedWithReferenceTrack_ = fittedWithReferenceTrack;}
63  void setTrackLen(double trackLen) {trackLen_ = trackLen;}
64  void setForwardChi2(double fChi2) {fChi2_ = fChi2;}
65  void setBackwardChi2(double bChi2) {FitStatus::setChi2(bChi2);}
66  void setForwardNdf(double fNdf) {fNdf_ = fNdf;}
67  void setBackwardNdf(double bNdf) {FitStatus::setNdf(bNdf);}
68 
69  virtual void Print(const Option_t* = "") const;
70 
71  protected:
72 
73  unsigned int numIterations_; // number of iterations that have been performed
76 
77  double trackLen_;
78 
79  double fChi2_; // chi^2 of the forward fit
80  double fNdf_; // degrees of freedom of the forward fit
81  double fPval_; // p-value of the forward fit, set whenever either of chi2 or ndf changes
82 
83  public:
84 
86 
87 };
88 
89 } /* End of namespace genfit */
92 #endif // genfit_KalmanFitStatus_h
genfit::FitStatus::getPVal
virtual double getPVal() const
Get the p value of the fit.
Definition: FitStatus.h:126
genfit::KalmanFitStatus::getForwardChi2
double getForwardChi2() const
Definition: KalmanFitStatus.h:52
FitStatus.h
genfit::FitStatus::ClassDef
ClassDef(FitStatus, 3)
genfit::KalmanFitStatus::setIsFittedWithReferenceTrack
void setIsFittedWithReferenceTrack(bool fittedWithReferenceTrack=true)
Definition: KalmanFitStatus.h:62
genfit::KalmanFitStatus::fittedWithReferenceTrack_
bool fittedWithReferenceTrack_
Definition: KalmanFitStatus.h:75
genfit
Defines for I/O streams used for error and debug printing.
Definition: AbsFinitePlane.cc:22
genfit::KalmanFitStatus::numIterations_
unsigned int numIterations_
Definition: KalmanFitStatus.h:73
genfit::FitStatus::setNdf
void setNdf(const double &ndf)
Definition: FitStatus.h:138
genfit::KalmanFitStatus::setForwardChi2
void setForwardChi2(double fChi2)
Definition: KalmanFitStatus.h:64
genfit::FitStatus::getNdf
double getNdf() const
Get the degrees of freedom of the fit.
Definition: FitStatus.h:120
genfit::KalmanFitStatus::Print
virtual void Print(const Option_t *="") const
Definition: KalmanFitStatus.cc:27
genfit::KalmanFitStatus::getBackwardChi2
double getBackwardChi2() const
Definition: KalmanFitStatus.h:53
genfit::KalmanFitStatus::isFittedWithDaf
bool isFittedWithDaf() const
Definition: KalmanFitStatus.h:49
genfit::KalmanFitStatus::isFittedWithReferenceTrack
bool isFittedWithReferenceTrack() const
Definition: KalmanFitStatus.h:50
genfit::KalmanFitStatus::fNdf_
double fNdf_
Definition: KalmanFitStatus.h:80
genfit::KalmanFitStatus::getForwardNdf
double getForwardNdf() const
Definition: KalmanFitStatus.h:54
genfit::KalmanFitStatus::KalmanFitStatus
KalmanFitStatus()
Definition: KalmanFitStatus.h:40
genfit::KalmanFitStatus::getTrackLen
double getTrackLen() const
Definition: KalmanFitStatus.h:51
genfit::KalmanFitStatus::clone
virtual FitStatus * clone() const
Definition: KalmanFitStatus.h:46
genfit::KalmanFitStatus::setBackwardChi2
void setBackwardChi2(double bChi2)
Definition: KalmanFitStatus.h:65
genfit::KalmanFitStatus::fittedWithDaf_
bool fittedWithDaf_
Definition: KalmanFitStatus.h:74
genfit::FitStatus
Class where important numbers and properties of a fit can be stored.
Definition: FitStatus.h:80
genfit::KalmanFitStatus::setTrackLen
void setTrackLen(double trackLen)
Definition: KalmanFitStatus.h:63
genfit::FitStatus::setChi2
void setChi2(const double &chi2)
Definition: FitStatus.h:137
genfit::KalmanFitStatus::setBackwardNdf
void setBackwardNdf(double bNdf)
Definition: KalmanFitStatus.h:67
genfit::KalmanFitStatus::~KalmanFitStatus
virtual ~KalmanFitStatus()
Definition: KalmanFitStatus.h:44
genfit::KalmanFitStatus::getForwardPVal
double getForwardPVal() const
Definition: KalmanFitStatus.h:57
genfit::KalmanFitStatus::setIsFittedWithDaf
void setIsFittedWithDaf(bool fittedWithDaf=true)
Definition: KalmanFitStatus.h:61
genfit::KalmanFitStatus::fChi2_
double fChi2_
Definition: KalmanFitStatus.h:79
genfit::KalmanFitStatus::setNumIterations
void setNumIterations(unsigned int numIterations)
Definition: KalmanFitStatus.h:60
genfit::KalmanFitStatus::trackLen_
double trackLen_
Definition: KalmanFitStatus.h:77
genfit::KalmanFitStatus::getBackwardNdf
double getBackwardNdf() const
Definition: KalmanFitStatus.h:55
genfit::KalmanFitStatus::setForwardNdf
void setForwardNdf(double fNdf)
Definition: KalmanFitStatus.h:66
genfit::FitStatus::getChi2
double getChi2() const
Get chi^2 of the fit.
Definition: FitStatus.h:118
genfit::KalmanFitStatus
FitStatus for use with AbsKalmanFitter implementations.
Definition: KalmanFitStatus.h:36
genfit::KalmanFitStatus::getBackwardPVal
double getBackwardPVal() const
Definition: KalmanFitStatus.h:58
genfit::KalmanFitStatus::fPval_
double fPval_
Definition: KalmanFitStatus.h:81
genfit::KalmanFitStatus::getNumIterations
unsigned int getNumIterations() const
Definition: KalmanFitStatus.h:48