34 #ifndef __NEWTONFITTERGSL_H
35 #define __NEWTONFITTERGSL_H
39 #include <gsl/gsl_vector.h>
40 #include <gsl/gsl_matrix.h>
41 #include <gsl/gsl_permutation.h>
42 #include <gsl/gsl_eigen.h>
65 virtual int getDoF()
const;
85 virtual void setDebug (
int debuglevel);
98 void printMy (
double M[],
double y[],
int idim);
100 bool updateParams (gsl_vector *xnew);
103 int calcM (
bool errorpropagation =
false);
108 void calcCovMatrix();
110 double meritFunction(
double mu);
111 double meritFunctionDeriv(
double mu);
113 enum {NPARMAX=50, NCONMAX=10, NUNMMAX=10};
125 static void ini_gsl_permutation (gsl_permutation *&p,
unsigned int size);
126 static void ini_gsl_vector (gsl_vector *&v,
int unsigned size);
127 static void ini_gsl_matrix (gsl_matrix *&m,
int unsigned size1,
unsigned int size2);
129 static void debug_print (gsl_matrix *m,
const char *name);
130 static void debug_print (gsl_vector *v,
const char *name);
159 gsl_permutation *permM;
160 gsl_eigen_symmv_workspace *ws;
172 double scalevals[NITMAX];
173 double fvals[NITMAX];
180 #endif // __NEWTONFITTERGSL_H
virtual int getNunm() const
Get the number of unmeasured parameters of the last fit.
Definition: NewtonFitterGSL.cc:697
A kinematic fitter using the Newton-Raphson method to solve the equations.
Definition: NewtonFitterGSL.h:47
int calcDx()
Calculate the vector dx to update the parameters; returns fail code, 0=OK.
Definition: NewtonFitterGSL.cc:490
int nit
Number of iterations.
Definition: NewtonFitterGSL.h:120
virtual int getNsoft() const
Get the number of soft constraints of the last fit.
Definition: NewtonFitterGSL.cc:696
int npar
total number of parameters
Definition: NewtonFitterGSL.h:115
Abstract base class for fitting engines of kinematic fits.
Definition: BaseFitter.h:63
int calcDxSVD()
Calculate the vector dx to update the parameters; returns fail code, 0=OK.
Definition: NewtonFitterGSL.cc:536
void printMy(double M[], double y[], int idim)
Print a Matrix M and a vector y of dimension idim.
Definition: NewtonFitterGSL.cc:476
int ncon
total number of hard constraints
Definition: NewtonFitterGSL.h:116
virtual double getChi2() const
Get the chi**2 of the last fit.
Definition: NewtonFitterGSL.cc:486
NewtonFitterGSL()
Constructor.
Definition: NewtonFitterGSL.cc:80
virtual double getProbability() const
Get the fit probability of the last fit.
Definition: NewtonFitterGSL.cc:485
int ierr
Error status.
Definition: NewtonFitterGSL.h:119
virtual int getNcon() const
Get the number of hard constraints of the last fit.
Definition: NewtonFitterGSL.cc:695
virtual double calcChi2()
Calculate the chi2.
Definition: NewtonFitterGSL.cc:461
Declares class BaseFitter.
virtual int getError() const
Get the error code of the last fit: 0=OK, 1=failed.
Definition: NewtonFitterGSL.cc:484
double chi2
final chi2
Definition: NewtonFitterGSL.h:123
virtual double fit()
The fit method, returns the fit probability.
Definition: NewtonFitterGSL.cc:127
virtual bool initialize()
Initialize the fitter.
Definition: NewtonFitterGSL.cc:381
double fitprob
fit probability
Definition: NewtonFitterGSL.h:122
int nunm
total number of unmeasured parameters
Definition: NewtonFitterGSL.h:118
virtual ~NewtonFitterGSL()
Virtual destructor.
Definition: NewtonFitterGSL.cc:96
virtual int getIterations() const
Get the number of iterations of the last fit.
Definition: NewtonFitterGSL.cc:488
virtual void setDebug(int debuglevel)
Set the Debug Level.
Definition: NewtonFitterGSL.cc:1025
int nsoft
total number of soft constraints
Definition: NewtonFitterGSL.h:117
virtual int getDoF() const
Get the number of degrees of freedom of the last fit.
Definition: NewtonFitterGSL.cc:487
virtual int getNpar() const
Get the number of all parameters of the last fit.
Definition: NewtonFitterGSL.cc:698