MarlinKinfit  0.4.0
OPALFitterGSL.h
Go to the documentation of this file.
1 
25 // Class OPALFitter
27 //
28 // Author: Jenny Boehme
29 // Last update: $Date: 2010/10/29 14:55:27 $
30 // by: $Author: mbeckman $
31 //
32 // Description: kinematic fit a la WWFGO
33 //
35 
36 #ifndef __OPALFITTERGSL_H
37 #define __OPALFITTERGSL_H
38 
39 #include<vector>
40 #include "BaseFitter.h"
41 
42 #include <gsl/gsl_vector.h>
43 #include <gsl/gsl_matrix.h>
44 #include <gsl/gsl_permutation.h>
45 
46 class BaseFitObject;
47 class BaseConstraint;
99 class OPALFitterGSL : public BaseFitter {
100  public:
101  OPALFitterGSL();
102  virtual ~OPALFitterGSL();
103  virtual double fit();
104 
106 
114  virtual int getError() const;
116 
118  virtual double getProbability() const;
120  virtual double getChi2() const;
122  virtual int getDoF() const;
124  virtual int getIterations() const;
125 
127  virtual int getNcon() const;
128 
130  virtual int getNsoft() const;
131 
133  virtual int getNpar() const;
134 
136  virtual int getNunm() const;
137 
138  virtual bool initialize();
139 
141  virtual void setDebug (int debuglevel);
142 
143  protected:
144 
145 
146  virtual bool updateFitObjects (double etaxi[]);
147  enum {NPARMAX=50, NCONMAX=20, NUNMMAX=20};
148 
149  int npar; // total number of parameters
150  int nmea; // total number of measured parameters
151  int nunm; // total number of unmeasured parameters
152  int ncon; // total number of constraints
153  int ierr; // Error status
154  int nit; // Number of iterations
155 
156  double fitprob; // fit probability
157  double chi2; // final chi2
158 
159  static void ini_gsl_permutation (gsl_permutation *&p, unsigned int size);
160  static void ini_gsl_vector (gsl_vector *&v, int unsigned size);
161  static void ini_gsl_matrix (gsl_matrix *&m, int unsigned size1, unsigned int size2);
162 
163  static void debug_print (gsl_matrix *m, const char *name);
164  static void debug_print (gsl_vector *v, const char *name);
165 
166  private:
167  gsl_vector *f;
168  gsl_vector *r;
169  gsl_matrix *Fetaxi;
170  gsl_matrix *S;
171  gsl_matrix *Sinv;
172  gsl_matrix *SinvFxi;
173  gsl_matrix *SinvFeta;
174  gsl_matrix *W1;
175  gsl_matrix *G;
176  gsl_matrix *H;
177  gsl_matrix *HU;
178  gsl_matrix *IGV;
179  gsl_matrix *V;
180  gsl_matrix *VLU;
181  gsl_matrix *Vinv;
182  gsl_matrix *Vnew;
183  gsl_matrix *Minv;
184  gsl_matrix *dxdt;
185  gsl_matrix *Vdxdt;
186  gsl_vector *dxi;
187  gsl_vector *Fxidxi;
188  gsl_vector *lambda;
189  gsl_vector *FetaTlambda;
190  gsl_vector *etaxi;
191  gsl_vector *etasv;
192  gsl_vector *y;
193  gsl_vector *y_eta;
194  gsl_vector *Vinvy_eta;
195  // gsl_matrix *Feta; //<-- DJeans: not used/needed
196  gsl_matrix *FetaV;
197 
198  gsl_permutation *permS;
199  gsl_permutation *permU;
200  gsl_permutation *permV;
201 
202  int debug;
203 
204 };
205 
206 #endif // __OPALFITTERGSL_H
virtual double fit()
Definition: OPALFitterGSL.cc:156
virtual int getNsoft() const
Get the number of soft constraints of the last fit.
Definition: OPALFitterGSL.cc:1123
Abstract base class for fitting engines of kinematic fits.
Definition: BaseFitter.h:63
virtual int getNunm() const
Get the number of unmeasured parameters of the last fit.
Definition: OPALFitterGSL.cc:1124
Description of the fit algorithm and interface:
Definition: OPALFitterGSL.h:99
Declares class BaseFitter.
virtual int getNpar() const
Get the number of all parameters of the last fit.
Definition: OPALFitterGSL.cc:1125
virtual int getDoF() const
Get the number of degrees of freedom of the last fit.
Definition: OPALFitterGSL.cc:1065
virtual double getProbability() const
Get the fit probability of the last fit.
Definition: OPALFitterGSL.cc:1063
virtual void setDebug(int debuglevel)
Set the Debug Level.
Definition: OPALFitterGSL.cc:1105
virtual int getError() const
Return error code.
Definition: OPALFitterGSL.cc:1062
virtual int getIterations() const
Get the number of iterations of the last fit.
Definition: OPALFitterGSL.cc:1066
virtual double getChi2() const
Get the chi**2 of the last fit.
Definition: OPALFitterGSL.cc:1064
Abstract base class for constraints of kinematic fits.
Definition: BaseConstraint.h:85
virtual int getNcon() const
Get the number of hard constraints of the last fit.
Definition: OPALFitterGSL.cc:1122
Abstract base class for particle objects of kinematic fits.
Definition: BaseFitObject.h:110