 |
Belle II Software
release-05-01-25
|
17 #ifndef __NEWTONFITTERGSL_H
18 #define __NEWTONFITTERGSL_H
20 #include "analysis/OrcaKinFit/BaseFitter.h"
22 #include <gsl/gsl_vector.h>
23 #include <gsl/gsl_matrix.h>
24 #include <gsl/gsl_permutation.h>
25 #include <gsl/gsl_eigen.h>
36 namespace OrcaKinFit {
38 class NewtonFitterGSL :
public BaseFitter {
46 virtual double fit()
override;
49 virtual int getError()
const override;
54 virtual double getChi2()
const override;
56 virtual int getDoF()
const override;
76 virtual void setDebug(
int debuglevel);
89 void printMy(
double M[],
double y[],
int idim);
91 bool updateParams(gsl_vector* xnew);
94 int calcM(
bool errorpropagation =
false);
101 double meritFunction(
double mu);
102 double meritFunctionDeriv();
104 enum {NPARMAX = 50, NCONMAX = 10, NUNMMAX = 10};
116 static void ini_gsl_permutation(gsl_permutation*& p,
unsigned int size);
117 static void ini_gsl_vector(gsl_vector*& v,
int unsigned size);
118 static void ini_gsl_matrix(gsl_matrix*& m,
int unsigned size1,
unsigned int size2);
120 static void debug_print(gsl_matrix* m,
const char* name);
121 static void debug_print(gsl_vector* v,
const char* name);
150 gsl_permutation* permM;
151 gsl_eigen_symmv_workspace* ws;
163 double scalevals[NITMAX];
164 double fvals[NITMAX];
175 #endif // __NEWTONFITTERGSL_H
int nsoft
total number of soft constraints
virtual double getChi2() const override
Get the chi**2 of the last fit.
int nit
Number of iterations.
void printMy(double M[], double y[], int idim)
Print a Matrix M and a vector y of dimension idim.
virtual int getNcon() const
Get the number of hard constraints of the last fit.
NewtonFitterGSL()
Constructor.
virtual int getError() const override
Get the error code of the last fit: 0=OK, 1=failed.
double fitprob
fit probability
virtual int getNunm() const
Get the number of unmeasured parameters of the last fit.
virtual int getNsoft() const
Get the number of soft constraints of the last fit.
int ncon
total number of hard constraints
int nunm
total number of unmeasured parameters
virtual int getDoF() const override
Get the number of degrees of freedom of the last fit.
virtual bool initialize() override
Initialize the fitter.
virtual void setDebug(int debuglevel)
Set the Debug Level.
virtual double calcChi2()
Calculate the chi2.
Abstract base class for different kinds of events.
virtual double fit() override
The fit method, returns the fit probability.
virtual ~NewtonFitterGSL()
Virtual destructor.
int calcDxSVD()
Calculate the vector dx to update the parameters; returns fail code, 0=OK.
virtual int getNpar() const
Get the number of all parameters of the last fit.
int calcDx()
Calculate the vector dx to update the parameters; returns fail code, 0=OK.
virtual int getIterations() const override
Get the number of iterations of the last fit.
int npar
total number of parameters
virtual double getProbability() const override
Get the fit probability of the last fit.