Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JROOT::JRootfit< JFs_t > Class Template Reference

ROOT Fit. More...

#include <JRootfit.hh>

Inheritance diagram for JROOT::JRootfit< JFs_t >:
JROOT::JRootfit_t< JFs_t > JFIT::JGandalf< JModel_t > JEEP::JMessage< T >

Classes

struct  function_type
 Auxiliary data structure for fit functions. More...
 

Public Types

typedef JRootfit_t< JFs_t > result_type
 
typedef JFIT_LOCAL::JTypedef_t< JModel_t >::parameter_type parameter_type
 Data type of fit parameter.
 

Public Member Functions

 JRootfit ()
 Default constructor.
 
template<class T >
const result_typeoperator() (const TH1 &h1, const JFs_t &f1, const T &type, const index_list &ls=index_list(), const range_type &X=range_type())
 Fit.
 
template<class T >
const result_typeoperator() (TH1 *h1, const JFs_t &f1, const T &type, const index_list &ls=index_list(), const range_type &X=range_type())
 Fit.
 
template<class T >
const result_typeoperator() (const TH2 &h2, const JFs_t &f2, const T &type, const index_list &ls=index_list(), const range_type &X=range_type(), const range_type &Y=range_type())
 Fit.
 
template<class T >
const result_typeoperator() (TH2 *h2, const JFs_t &f2, const T &type, const index_list &ls=index_list(), const range_type &X=range_type(), const range_type &Y=range_type())
 Fit.
 
template<class T >
const result_typeoperator() (const TH3 &h3, const JFs_t &f3, const T &type, const index_list &ls=index_list(), const range_type &X=range_type(), const range_type &Y=range_type(), const range_type &Z=range_type())
 Fit.
 
template<class T >
const result_typeoperator() (TH3 *h3, const JFs_t &f3, const T &type, const index_list &ls=index_list(), const range_type &X=range_type(), const range_type &Y=range_type(), const range_type &Z=range_type())
 Fit.
 
const JFs_t & getFunction () const
 Get function.
 
size_t getNumberOfParameters () const
 Get number of parameters.
 
size_t getNumberOfFreeParameters () const
 Get number of free parameters.
 
size_t getN () const
 Get number of data points.
 
double getChi2 () const
 Get chi2.
 
int getNDF () const
 Get number of degrees of freedom.
 
double getValue (size_t i) const
 Get value of parameter at given index.
 
double getError (size_t i) const
 Get error of parameter at given index.
 
template<class JFunction_t , class T , class ... Args>
result_type operator() (const JFunction_t &fit, T __begin, T __end, Args ...args)
 Multi-dimensional fit of multiple data sets.
 

Public Attributes

std::vector< parameter_typeparameters
 fit parameters
 
int numberOfIterations
 number of iterations
 
double lambda
 control parameter
 
JModel_t value
 value
 
JModel_t error
 error
 
JMATH::JMatrixNS V
 Hesse matrix.
 

Static Public Attributes

static JRootfit Fit
 Global fit object.
 
static int MAXIMUM_ITERATIONS = 1000
 maximal number of iterations
 
static double EPSILON = 1.0e-3
 maximal distance to minimum
 
static bool EPSILON_ABSOLUTE = false
 set epsilon to absolute difference instead of relative
 
static double LAMBDA_MIN = 0.01
 minimal value control parameter
 
static double LAMBDA_MAX = 100.0
 maximal value control parameter
 
static double LAMBDA_UP = 10.0
 multiplication factor control parameter
 
static double LAMBDA_DOWN = 10.0
 multiplication factor control parameter
 
static double PIVOT = std::numeric_limits<double>::epsilon()
 minimal value diagonal element of Hesse matrix
 
static int debug = 0
 debug level (default is off).
 

Protected Attributes

size_t npx
 number of data points
 
double chi2
 chi2
 

Private Member Functions

size_t getNumberOfFreeParameters ()
 
size_t getN ()
 
double getChi2 ()
 
int getNDF ()
 
template<class T >
const result_typeeval (const JFs_t &fs, const index_list &ls, const data_type< T > &data)
 Evaluate fit.
 
void reset ()
 Reset current parameters.
 
template<class JFunction_t , class T , class ... Args>
void update (const JFunction_t &fit, T __begin, T __end, Args ...args)
 Recursive method to update current parameters.
 
template<class JFunction_t >
void update (const JFunction_t &fit)
 Termination method to update current parameters.
 

Static Private Member Functions

static double get (const JModel_t &model, double JModel_t::*parameter)
 Read/write access to parameter value by data member.
 
static double & get (JModel_t &model, double JModel_t::*parameter)
 Read/write access to parameter value by data member.
 
static double get (const JModel_t &model, const size_t index)
 Read/write access to parameter value by index.
 
static double & get (JModel_t &model, const size_t index)
 Read/write access to parameter value by index.
 
static double get (const JModel_t &model, const int index)
 Read/write access to parameter value by index.
 
static double & get (JModel_t &model, const int index)
 Read/write access to parameter value by index.
 

Private Attributes

const struct JROOT::JRootfit::function_type fit
 
std::vector< double > h
 
JMATH::JVectorND x
 
struct { 
 
   result_type   result 
 
current 
 
struct { 
 
   JModel_t   value 
 
   result_type   result 
 
previous 
 

Detailed Description

template<class JFs_t>
class JROOT::JRootfit< JFs_t >

ROOT Fit.

Definition at line 938 of file JRootfit.hh.

Member Typedef Documentation

◆ result_type

template<class JFs_t >
JRootfit_t<JFs_t> JROOT::JRootfit< JFs_t >::result_type

Definition at line 943 of file JRootfit.hh.

◆ parameter_type

template<class JModel_t >
JFIT_LOCAL::JTypedef_t<JModel_t>::parameter_type JFIT::JGandalf< JModel_t >::parameter_type
inherited

Data type of fit parameter.

Definition at line 96 of file JGandalf.hh.

Constructor & Destructor Documentation

◆ JRootfit()

template<class JFs_t >
JROOT::JRootfit< JFs_t >::JRootfit ( )
inline

Default constructor.

Definition at line 949 of file JRootfit.hh.

950 {}

Member Function Documentation

◆ operator()() [1/7]

template<class JFs_t >
template<class T >
const result_type & JROOT::JRootfit< JFs_t >::operator() ( const TH1 & h1,
const JFs_t & f1,
const T & type,
const index_list & ls = index_list(),
const range_type & X = range_type() )
inline

Fit.

Parameters
h1histogram
f1start value
typetype of data for histogram unpacking
lslist of fixed parameters
Xfit range
Returns
result

Definition at line 964 of file JRootfit.hh.

969 {
970 return eval(f1, ls, data_type< m_1d<T> >(h1, X));
971 }
const result_type & eval(const JFs_t &fs, const index_list &ls, const data_type< T > &data)
Evaluate fit.
Definition JRootfit.hh:1136

◆ operator()() [2/7]

template<class JFs_t >
template<class T >
const result_type & JROOT::JRootfit< JFs_t >::operator() ( TH1 * h1,
const JFs_t & f1,
const T & type,
const index_list & ls = index_list(),
const range_type & X = range_type() )
inline

Fit.

The fitted function is added to the input histogram.

Parameters
h1pointer to histogram
f1start value
typetype of data for histogram unpacking
lslist of fixed parameters
Xfit range
Returns
result

Definition at line 987 of file JRootfit.hh.

992 {
993 (*this)(*h1, f1, type, ls, X);
994
995 h1->GetListOfFunctions()->Add(new JF1("f1",
996 this->value,
997 JTOOLS::join(X, getRange(h1->GetXaxis()))));
998
999 return static_cast<const result_type&>(*this);
1000 }
JModel_t value
value
Definition JGandalf.hh:342
JRootfit_t< JFs_t > result_type
Definition JRootfit.hh:943
const JPolynome f1(1.0, 2.0, 3.0)
Function.
range_type getRange(TAxis *pAxis)
Get range of given axis.
Definition JRootfit.hh:52
JRange< T, JComparator_t > join(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Join ranges.
Definition JRange.hh:659

◆ operator()() [3/7]

template<class JFs_t >
template<class T >
const result_type & JROOT::JRootfit< JFs_t >::operator() ( const TH2 & h2,
const JFs_t & f2,
const T & type,
const index_list & ls = index_list(),
const range_type & X = range_type(),
const range_type & Y = range_type() )
inline

Fit.

Parameters
h2histogram
f2start value
typetype of data for histogram unpacking
lslist of fixed parameters
Xfit range
Yfit range
Returns
result

Definition at line 1015 of file JRootfit.hh.

1021 {
1022 return eval(f2, ls, data_type< m_2d<T> >(h2, X, Y));
1023 }

◆ operator()() [4/7]

template<class JFs_t >
template<class T >
const result_type & JROOT::JRootfit< JFs_t >::operator() ( TH2 * h2,
const JFs_t & f2,
const T & type,
const index_list & ls = index_list(),
const range_type & X = range_type(),
const range_type & Y = range_type() )
inline

Fit.

The fitted function is added to the input histogram.

Parameters
h2pointer to histogram
f2start value
typetype of data for histogram unpacking
lslist of fixed parameters
Xfit range
Yfit range
Returns
result

Definition at line 1040 of file JRootfit.hh.

1046 {
1047 (*this)(*h2, f2, type, ls, X, Y);
1048
1049 h2->GetListOfFunctions()->Add(new JF2("f2",
1050 this->value,
1051 JTOOLS::join(X, getRange(h2->GetXaxis())),
1052 JTOOLS::join(Y, getRange(h2->GetYaxis()))));
1053
1054 return static_cast<const result_type&>(*this);
1055 }

◆ operator()() [5/7]

template<class JFs_t >
template<class T >
const result_type & JROOT::JRootfit< JFs_t >::operator() ( const TH3 & h3,
const JFs_t & f3,
const T & type,
const index_list & ls = index_list(),
const range_type & X = range_type(),
const range_type & Y = range_type(),
const range_type & Z = range_type() )
inline

Fit.

Parameters
h3histogram
f3start value
typetype of data for histogram unpacking
lslist of fixed parameters
Xfit range
Yfit range
Zfit range
Returns
result

Definition at line 1071 of file JRootfit.hh.

1078 {
1079 return eval(f3, ls, data_type< m_3d<T> >(h3, X, Y, Z));
1080 }
double f3(const double x, const double y, const double z)
3D function.

◆ operator()() [6/7]

template<class JFs_t >
template<class T >
const result_type & JROOT::JRootfit< JFs_t >::operator() ( TH3 * h3,
const JFs_t & f3,
const T & type,
const index_list & ls = index_list(),
const range_type & X = range_type(),
const range_type & Y = range_type(),
const range_type & Z = range_type() )
inline

Fit.

The fitted function is added to the input histogram.

Parameters
h3pointer to histogram
f3start value
typetype of data for histogram unpacking
lslist of fixed parameters
Xfit range
Yfit range
Zfit range
Returns
result

Definition at line 1098 of file JRootfit.hh.

1105 {
1106 (*this)(*h3, f3, type, ls, X, Y, Z);
1107
1108 h3->GetListOfFunctions()->Add(new JF3("f3",
1109 this->value,
1110 JTOOLS::join(X, getRange(h3->GetXaxis())),
1111 JTOOLS::join(Y, getRange(h3->GetYaxis())),
1112 JTOOLS::join(Z, getRange(h3->GetZaxis()))));
1113
1114 return static_cast<const result_type&>(*this);
1115 }

◆ getNumberOfFreeParameters() [1/2]

template<class JFs_t >
size_t JROOT::JRootfit< JFs_t >::getNumberOfFreeParameters ( )
private

◆ getN() [1/2]

template<class JFs_t >
size_t JROOT::JRootfit< JFs_t >::getN ( )
private

◆ getChi2() [1/2]

template<class JFs_t >
double JROOT::JRootfit< JFs_t >::getChi2 ( )
private

◆ getNDF() [1/2]

template<class JFs_t >
int JROOT::JRootfit< JFs_t >::getNDF ( )
private

◆ eval()

template<class JFs_t >
template<class T >
const result_type & JROOT::JRootfit< JFs_t >::eval ( const JFs_t & fs,
const index_list & ls,
const data_type< T > & data )
inlineprivate

Evaluate fit.

Parameters
fsstart value
lslist of fixed parameters
datadata
Returns
result

Definition at line 1136 of file JRootfit.hh.

1139 {
1140 this->parameters.clear();
1141
1142 for (size_t i = 0; i != JFs_t::parameters.size(); ++i) {
1143 if (ls.count(i) == 0) {
1144 this->parameters.push_back(JFs_t::parameters[i]);
1145 }
1146 }
1147
1148 this->value = fs;
1149 this->npx = data.size();
1150 this->chi2 = static_cast<JGandalf<JFs_t>&>(*this)(this->fit, data.begin(), data.end()).chi2;
1151
1152 return static_cast<const result_type&>(*this);
1153 }
std::vector< parameter_type > parameters
fit parameters
Definition JGandalf.hh:339
double chi2
chi2
Definition JRootfit.hh:842
size_t npx
number of data points
Definition JRootfit.hh:841
const struct JROOT::JRootfit::function_type fit

◆ getFunction()

template<class JFs_t >
const JFs_t & JROOT::JRootfit_t< JFs_t >::getFunction ( ) const
inlineinherited

Get function.

Returns
function.

Definition at line 850 of file JRootfit.hh.

851 {
852 return this->value;
853 }

◆ getNumberOfParameters()

template<class JFs_t >
size_t JROOT::JRootfit_t< JFs_t >::getNumberOfParameters ( ) const
inlineinherited

Get number of parameters.

Returns
number of parameters

Definition at line 861 of file JRootfit.hh.

862 {
863 return JFs_t::parameters.size();
864 }

◆ getNumberOfFreeParameters() [2/2]

template<class JFs_t >
size_t JROOT::JRootfit_t< JFs_t >::getNumberOfFreeParameters ( ) const
inlineinherited

Get number of free parameters.

Returns
number of free parameters

Definition at line 872 of file JRootfit.hh.

873 {
874 return this->parameters.size();
875 }

◆ getN() [2/2]

template<class JFs_t >
size_t JROOT::JRootfit_t< JFs_t >::getN ( ) const
inlineinherited

Get number of data points.

Returns
number of data points

Definition at line 883 of file JRootfit.hh.

884 {
885 return npx;
886 }

◆ getChi2() [2/2]

template<class JFs_t >
double JROOT::JRootfit_t< JFs_t >::getChi2 ( ) const
inlineinherited

Get chi2.

Returns
chi2

Definition at line 894 of file JRootfit.hh.

895 {
896 return chi2;
897 }

◆ getNDF() [2/2]

template<class JFs_t >
int JROOT::JRootfit_t< JFs_t >::getNDF ( ) const
inlineinherited

Get number of degrees of freedom.

Returns
number of degrees of freedom

Definition at line 905 of file JRootfit.hh.

906 {
907 return (int) getN() - (int) getNumberOfFreeParameters();
908 }
size_t getNumberOfFreeParameters() const
Get number of free parameters.
Definition JRootfit.hh:872
size_t getN() const
Get number of data points.
Definition JRootfit.hh:883

◆ getValue()

template<class JFs_t >
double JROOT::JRootfit_t< JFs_t >::getValue ( size_t i) const
inlineinherited

Get value of parameter at given index.

Parameters
iindex

Definition at line 916 of file JRootfit.hh.

917 {
918 return getParameter(this->value, i);
919 }

◆ getError()

template<class JFs_t >
double JROOT::JRootfit_t< JFs_t >::getError ( size_t i) const
inlineinherited

Get error of parameter at given index.

Parameters
iindex

Definition at line 927 of file JRootfit.hh.

928 {
929 return getParameter(this->error, i);
930 }
JModel_t error
error
Definition JGandalf.hh:343

◆ operator()() [7/7]

template<class JModel_t >
template<class JFunction_t , class T , class ... Args>
result_type JFIT::JGandalf< JModel_t >::operator() ( const JFunction_t & fit,
T __begin,
T __end,
Args ... args )
inlineinherited

Multi-dimensional fit of multiple data sets.

The fit function should return the chi2 as well as the partial derivatives for the current value of the model and a given data point.

Parameters
fitfit function
__beginbegin of data
__endend of data
argsoptional data
Returns
chi2 and gradient

Definition at line 161 of file JGandalf.hh.

162 {
163 using namespace std;
164 using namespace JPP;
165
166 // note that all model values should be assigned to the start value of the model before use
167 // because the actual list of model parameters can vary from fit to fit
168 // (e.g. if model consists of a container).
169
170 const size_t N = parameters.size();
171
172 V.resize(N);
173 h.resize(N);
174 x.resize(N);
175
176 previous.result.chi2 = numeric_limits<double>::max();
177
178 current.result.chi2 = numeric_limits<double>::max();
179 current.result.gradient = value;
180 current.result.gradient = zero;
181
182 error = value;
183 error = zero;
184
186
188
189 DEBUG("step: " << numberOfIterations << endl);
190
191 reset();
192
193 update(fit, __begin, __end, args...);
194
195 DEBUG("lambda: " << FIXED(12,5) << lambda << endl);
196 DEBUG("chi2: " << FIXED(12,5) << current.result.chi2 << endl);
197
198 if (current.result.chi2 < previous.result.chi2) {
199
200 if (numberOfIterations != 0) {
201
202 const double tolerance = EPSILON * (EPSILON_ABSOLUTE ? 1.0 : fabs(previous.result.chi2));
203
204 if (fabs(previous.result.chi2 - current.result.chi2) <= tolerance) {
205
206 // normal end
207
208 const result_type result = current.result;
209
210 reset();
211
212 update(fit, __begin, __end, args...);
213
214 try {
215 V.invert();
216 }
217 catch (const exception& error) {}
218
219 for (size_t i = 0; i != N; ++i) {
220 get(error, parameters[i]) = sqrt(V(i,i));
221 }
222
223 return result;
224 }
225
226 if (lambda > LAMBDA_MIN) {
228 }
229 }
230
231 // store current values
232
233 previous.value = value;
234 previous.result = current.result;
235
236 } else {
237
238 value = previous.value; // restore value
239
240 lambda *= LAMBDA_UP;
241
242 if (lambda > LAMBDA_MAX) {
243 break;
244 }
245
246 reset();
247
248 update(fit, __begin, __end, args...);
249 }
250
251 DEBUG("Hesse matrix:" << endl << V << endl);
252
253 // force definite positiveness
254
255 for (size_t i = 0; i != N; ++i) {
256
257 if (V(i,i) < PIVOT) {
258 V(i,i) = PIVOT;
259 }
260
261 h[i] = 1.0 / sqrt(V(i,i));
262 }
263
264 // normalisation
265
266 for (size_t row = 0; row != N; ++row) {
267 for (size_t col = 0; col != row; ++col) {
268 V(row,col) *= h[row] * h[col];
269 V(col,row) = V(row,col);
270 }
271 }
272
273 for (size_t i = 0; i != N; ++i) {
274 V(i,i) = 1.0 + lambda;
275 }
276
277 // solve A x = b
278
279 for (size_t col = 0; col != N; ++col) {
280 x[col] = h[col] * get(current.result.gradient, parameters[col]);
281 }
282
283 try {
284 V.solve(x);
285 }
286 catch (const exception& error) {
287
288 ERROR("JGandalf: " << error.what() << endl << V << endl);
289
290 break;
291 }
292
293 // update value
294
295 for (size_t row = 0; row != N; ++row) {
296
297 DEBUG("u[" << noshowpos << setw(3) << row << "] = " << showpos << FIXED(15,5) << get(value, parameters[row]));
298
299 get(value, parameters[row]) -= h[row] * x[row];
300
301 DEBUG(" -> " << FIXED(15,5) << get(value, parameters[row]) << noshowpos << endl);
302 }
303
304 model(value);
305 }
306
307 // abnormal end
308
309 const result_type result = previous.result;
310
311 value = previous.value; // restore value
312
313 reset();
314
315 update(fit, __begin, __end, args...);
316
317 try {
318 V.invert();
319 }
320 catch (const exception& error) {}
321
322 for (size_t i = 0; i != N; ++i) {
323 get(error, parameters[i]) = sqrt(V(i,i));
324 }
325
326 return result;
327 }
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define ERROR(A)
Definition JMessage.hh:66
double lambda
control parameter
Definition JGandalf.hh:341
static double LAMBDA_MIN
minimal value control parameter
Definition JGandalf.hh:333
JMATH::JVectorND x
Definition JGandalf.hh:484
struct JFIT::JGandalf::@12 current
void reset()
Reset current parameters.
Definition JGandalf.hh:350
static double LAMBDA_DOWN
multiplication factor control parameter
Definition JGandalf.hh:336
static double LAMBDA_UP
multiplication factor control parameter
Definition JGandalf.hh:335
int numberOfIterations
number of iterations
Definition JGandalf.hh:340
static bool EPSILON_ABSOLUTE
set epsilon to absolute difference instead of relative
Definition JGandalf.hh:332
std::vector< double > h
Definition JGandalf.hh:483
static double get(const JModel_t &model, double JModel_t::*parameter)
Read/write access to parameter value by data member.
Definition JGandalf.hh:413
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition JGandalf.hh:330
static double PIVOT
minimal value diagonal element of Hesse matrix
Definition JGandalf.hh:337
void update(const JFunction_t &fit, T __begin, T __end, Args ...args)
Recursive method to update current parameters.
Definition JGandalf.hh:370
result_type result
Definition JGandalf.hh:487
static double EPSILON
maximal distance to minimum
Definition JGandalf.hh:331
JMATH::JMatrixNS V
Hesse matrix.
Definition JGandalf.hh:344
static double LAMBDA_MAX
maximal value control parameter
Definition JGandalf.hh:334
struct JFIT::JGandalf::@13 previous
void model(JModel_t &value)
Auxiliary function to constrain model during fit.
Definition JGandalf.hh:57
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
void resize(const size_t size)
Resize matrix.
Definition JMatrixND.hh:446
void solve(JVectorND_t &u)
Get solution of equation A x = b.
Definition JMatrixNS.hh:308
void invert()
Invert matrix according LDU decomposition.
Definition JMatrixNS.hh:75

◆ reset()

template<class JModel_t >
void JFIT::JGandalf< JModel_t >::reset ( )
inlineprivateinherited

Reset current parameters.

Definition at line 350 of file JGandalf.hh.

351 {
352 using namespace JPP;
353
354 current.result.chi2 = 0.0;
355 current.result.gradient = zero;
356
357 V.reset();
358 }
JMatrixND & reset()
Set matrix to the null matrix.
Definition JMatrixND.hh:459

◆ update() [1/2]

template<class JModel_t >
template<class JFunction_t , class T , class ... Args>
void JFIT::JGandalf< JModel_t >::update ( const JFunction_t & fit,
T __begin,
T __end,
Args ... args )
inlineprivateinherited

Recursive method to update current parameters.

Parameters
fitfit function
__beginbegin of data
__endend of data
argsoptional data

Definition at line 370 of file JGandalf.hh.

371 {
372 for (T i = __begin; i != __end; ++i) {
373
374 const result_type& result = fit(value, *i);
375
376 current.result.chi2 += result.chi2;
377 current.result.gradient += result.gradient;
378
379 for (size_t row = 0; row != parameters.size(); ++row) {
380 for (size_t col = row; col != parameters.size(); ++col) {
381 V(row,col) += get(result.gradient, parameters[row]) * get(result.gradient, parameters[col]);
382 }
383 }
384 }
385
386 update(fit, args...);
387 }
JModel_t gradient
partial derivatives of chi2
Definition JGandalf.hh:137

◆ update() [2/2]

template<class JModel_t >
template<class JFunction_t >
void JFIT::JGandalf< JModel_t >::update ( const JFunction_t & fit)
inlineprivateinherited

Termination method to update current parameters.

Parameters
fitfit function

Definition at line 396 of file JGandalf.hh.

397 {
398 for (size_t row = 0; row != parameters.size(); ++row) {
399 for (size_t col = 0; col != row; ++col) {
400 V(row,col) = V(col,row);
401 }
402 }
403 }

◆ get() [1/6]

template<class JModel_t >
static double JFIT::JGandalf< JModel_t >::get ( const JModel_t & model,
double JModel_t::* parameter )
inlinestaticprivateinherited

Read/write access to parameter value by data member.

Parameters
modelmodel
parameterparameter
Returns
value

Definition at line 413 of file JGandalf.hh.

414 {
415 return model.*parameter;
416 }

◆ get() [2/6]

template<class JModel_t >
static double & JFIT::JGandalf< JModel_t >::get ( JModel_t & model,
double JModel_t::* parameter )
inlinestaticprivateinherited

Read/write access to parameter value by data member.

Parameters
modelmodel
parameterparameter
Returns
value

Definition at line 426 of file JGandalf.hh.

427 {
428 return model.*parameter;
429 }

◆ get() [3/6]

template<class JModel_t >
static double JFIT::JGandalf< JModel_t >::get ( const JModel_t & model,
const size_t index )
inlinestaticprivateinherited

Read/write access to parameter value by index.

Parameters
modelmodel
indexindex
Returns
value

Definition at line 439 of file JGandalf.hh.

440 {
441 return model[index];
442 }

◆ get() [4/6]

template<class JModel_t >
static double & JFIT::JGandalf< JModel_t >::get ( JModel_t & model,
const size_t index )
inlinestaticprivateinherited

Read/write access to parameter value by index.

Parameters
modelmodel
indexindex
Returns
value

Definition at line 452 of file JGandalf.hh.

453 {
454 return model[index];
455 }

◆ get() [5/6]

template<class JModel_t >
static double JFIT::JGandalf< JModel_t >::get ( const JModel_t & model,
const int index )
inlinestaticprivateinherited

Read/write access to parameter value by index.

Parameters
modelmodel
indexindex
Returns
value

Definition at line 465 of file JGandalf.hh.

466 {
467 return model[index];
468 }

◆ get() [6/6]

template<class JModel_t >
static double & JFIT::JGandalf< JModel_t >::get ( JModel_t & model,
const int index )
inlinestaticprivateinherited

Read/write access to parameter value by index.

Parameters
modelmodel
indexindex
Returns
value

Definition at line 478 of file JGandalf.hh.

479 {
480 return model[index];
481 }

Member Data Documentation

◆ Fit

template<class JFs_t >
JRootfit< JFs_t > JROOT::JRootfit< JFs_t >::Fit
static

Global fit object.

Definition at line 1118 of file JRootfit.hh.

◆ fit

template<class JFs_t >
const struct JROOT::JRootfit::function_type JROOT::JRootfit< JFs_t >::fit
private

◆ npx

template<class JFs_t >
size_t JROOT::JRootfit_t< JFs_t >::npx
protectedinherited

number of data points

Definition at line 841 of file JRootfit.hh.

◆ chi2

template<class JFs_t >
double JROOT::JRootfit_t< JFs_t >::chi2
protectedinherited

chi2

Definition at line 842 of file JRootfit.hh.

◆ MAXIMUM_ITERATIONS

template<class JModel_t >
int JFIT::JGandalf< JModel_t >::MAXIMUM_ITERATIONS = 1000
staticinherited

maximal number of iterations

maximal number of iterations.

Definition at line 330 of file JGandalf.hh.

◆ EPSILON

template<class JModel_t >
double JFIT::JGandalf< JModel_t >::EPSILON = 1.0e-3
staticinherited

maximal distance to minimum

maximal distance to minimum.

Definition at line 331 of file JGandalf.hh.

◆ EPSILON_ABSOLUTE

template<class JModel_t >
bool JFIT::JGandalf< JModel_t >::EPSILON_ABSOLUTE = false
staticinherited

set epsilon to absolute difference instead of relative

set epsilon to absolute difference instead of relative.

Definition at line 332 of file JGandalf.hh.

◆ LAMBDA_MIN

template<class JModel_t >
double JFIT::JGandalf< JModel_t >::LAMBDA_MIN = 0.01
staticinherited

minimal value control parameter

Definition at line 333 of file JGandalf.hh.

◆ LAMBDA_MAX

template<class JModel_t >
double JFIT::JGandalf< JModel_t >::LAMBDA_MAX = 100.0
staticinherited

maximal value control parameter

Definition at line 334 of file JGandalf.hh.

◆ LAMBDA_UP

template<class JModel_t >
double JFIT::JGandalf< JModel_t >::LAMBDA_UP = 10.0
staticinherited

multiplication factor control parameter

Definition at line 335 of file JGandalf.hh.

◆ LAMBDA_DOWN

template<class JModel_t >
double JFIT::JGandalf< JModel_t >::LAMBDA_DOWN = 10.0
staticinherited

multiplication factor control parameter

Definition at line 336 of file JGandalf.hh.

◆ PIVOT

template<class JModel_t >
double JFIT::JGandalf< JModel_t >::PIVOT = std::numeric_limits<double>::epsilon()
staticinherited

minimal value diagonal element of Hesse matrix

minimal value diagonal element of matrix

Definition at line 337 of file JGandalf.hh.

◆ parameters

template<class JModel_t >
std::vector<parameter_type> JFIT::JGandalf< JModel_t >::parameters
inherited

fit parameters

Definition at line 339 of file JGandalf.hh.

◆ numberOfIterations

template<class JModel_t >
int JFIT::JGandalf< JModel_t >::numberOfIterations
inherited

number of iterations

Definition at line 340 of file JGandalf.hh.

◆ lambda

template<class JModel_t >
double JFIT::JGandalf< JModel_t >::lambda
inherited

control parameter

Definition at line 341 of file JGandalf.hh.

◆ value

template<class JModel_t >
JModel_t JFIT::JGandalf< JModel_t >::value
inherited

value

Definition at line 342 of file JGandalf.hh.

◆ error

template<class JModel_t >
JModel_t JFIT::JGandalf< JModel_t >::error
inherited

error

Definition at line 343 of file JGandalf.hh.

◆ V

template<class JModel_t >
JMATH::JMatrixNS JFIT::JGandalf< JModel_t >::V
inherited

Hesse matrix.

Definition at line 344 of file JGandalf.hh.

◆ h

template<class JModel_t >
std::vector<double> JFIT::JGandalf< JModel_t >::h
privateinherited

Definition at line 483 of file JGandalf.hh.

◆ x

template<class JModel_t >
JMATH::JVectorND JFIT::JGandalf< JModel_t >::x
privateinherited

Definition at line 484 of file JGandalf.hh.

◆ result

template<class JModel_t >
result_type JFIT::JGandalf< JModel_t >::result
inherited

Definition at line 487 of file JGandalf.hh.

◆ [struct]

struct { ... } JFIT::JGandalf< JModel_t >::current

◆ [struct]

struct { ... } JFIT::JGandalf< JModel_t >::previous

◆ debug

template<class T >
int JEEP::JMessage< T >::debug = 0
staticinherited

debug level (default is off).

Definition at line 45 of file JMessage.hh.


The documentation for this class was generated from the following file: