PandaRoot
KalmanFitStatus.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2008-2010, Technische Universitaet Muenchen,
14  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30 */
35 #ifndef genfit_KalmanFitStatus_h
36 #define genfit_KalmanFitStatus_h
37 
38 #include "FitStatus.h"
39 
40 #include <Math/ProbFunc.h>
41 
42 namespace genfit {
43 
47 class KalmanFitStatus : public FitStatus {
48 
49  public:
50  KalmanFitStatus() : FitStatus(), numIterations_(0), fittedWithDaf_(false), fittedWithReferenceTrack_(false), trackLen_(0), fChi2_(-1e99), fNdf_(-1e99), fPval_(-1e99) { ; }
51 
52  virtual ~KalmanFitStatus(){};
53 
54  virtual FitStatus *clone() const { return new KalmanFitStatus(*this); }
55 
56  unsigned int getNumIterations() const { return numIterations_; }
57  bool isFittedWithDaf() const { return fittedWithDaf_; }
59  double getTrackLen() const { return trackLen_; }
60  double getForwardChi2() const { return fChi2_; }
61  double getBackwardChi2() const { return FitStatus::getChi2(); }
62  double getForwardNdf() const { return fNdf_; }
63  double getBackwardNdf() const { return FitStatus::getNdf(); }
64  // virtual double getPVal() : not overridden, as it does the right thing.
65  double getForwardPVal() const { return std::max(0., ROOT::Math::chisquared_cdf_c(fChi2_, fNdf_)); }
66  double getBackwardPVal() const { return FitStatus::getPVal(); }
67 
68  void setNumIterations(unsigned int numIterations) { numIterations_ = numIterations; }
69  void setIsFittedWithDaf(bool fittedWithDaf = true) { fittedWithDaf_ = fittedWithDaf; }
70  void setIsFittedWithReferenceTrack(bool fittedWithReferenceTrack = true) { fittedWithReferenceTrack_ = fittedWithReferenceTrack; }
71  void setTrackLen(double trackLen) { trackLen_ = trackLen; }
72  void setForwardChi2(double fChi2) { fChi2_ = fChi2; }
73  void setBackwardChi2(double bChi2) { FitStatus::setChi2(bChi2); }
74  void setForwardNdf(double fNdf) { fNdf_ = fNdf; }
75  void setBackwardNdf(double bNdf) { FitStatus::setNdf(bNdf); }
76 
77  virtual void Print(const Option_t * = "") const;
78 
79  protected:
80  unsigned int numIterations_; // number of iterations that have been performed
83 
84  double trackLen_;
85 
86  double fChi2_; // chi^2 of the forward fit
87  double fNdf_; // degrees of freedom of the forward fit
88  double fPval_; // p-value of the forward fit, set whenever either of chi2 or ndf changes
89 
90  public:
92 };
93 
94 } /* End of namespace genfit */
97 #endif // genfit_KalmanFitStatus_h
bool isFittedWithReferenceTrack() const
void setChi2(const double &chi2)
Definition: FitStatus.h:143
virtual FitStatus * clone() const
double getForwardNdf() const
Class where important numbers and properties of a fit can be stored.
Definition: FitStatus.h:82
double getForwardPVal() const
ClassDef(FitStatus, 3)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:37
void setBackwardChi2(double bChi2)
void setForwardNdf(double fNdf)
void setIsFittedWithDaf(bool fittedWithDaf=true)
void setTrackLen(double trackLen)
double getTrackLen() const
void setIsFittedWithReferenceTrack(bool fittedWithReferenceTrack=true)
FitStatus for use with AbsKalmanFitter implementations.
void setNumIterations(unsigned int numIterations)
void setBackwardNdf(double bNdf)
double getBackwardNdf() const
virtual void Print(const Option_t *="") const
double getBackwardPVal() const
unsigned int getNumIterations() const
double getForwardChi2() const
virtual double getPVal() const
Get the p value of the fit.
Definition: FitStatus.h:132
double getNdf() const
Get the degrees of freedom of the fit.
Definition: FitStatus.h:126
bool isFittedWithDaf() const
void setForwardChi2(double fChi2)
double getBackwardChi2() const
void setNdf(const double &ndf)
Definition: FitStatus.h:144
double getChi2() const
Get chi^2 of the fit.
Definition: FitStatus.h:124
Matrix inversion tools.
Definition: AbsBField.h:40