Jpp  18.6.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
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 >

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. More...
 
typedef JGandalf< JFs_t >
::result_type 
result_type
 

Public Member Functions

 JRootfit ()
 Default constructor. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
const JFs_t & getFunction () const
 Get function. More...
 
size_t getNumberOfParameters () const
 Get number of parameters. More...
 
size_t getNumberOfFreeParameters () const
 Get number of free parameters. More...
 
size_t getN () const
 Get number of data points. More...
 
double getChi2 () const
 Get chi2. More...
 
int getNDF () const
 Get number of degrees of freedom. More...
 
double getValue (size_t i) const
 Get value of parameter at given index. More...
 
double getError (size_t i) const
 Get error of parameter at given index. More...
 
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. More...
 

Public Attributes

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

Static Public Attributes

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

Protected Attributes

size_t npx
 number of data points More...
 
double chi2
 chi2 More...
 

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. More...
 

Private Attributes

struct {
   typedef JGandalf< JFs_t >
::result_type   result_type
 
   result_type   result
 
fit
 Auxiliary data structure for fit functions. More...
 

Detailed Description

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

ROOT Fit.

Definition at line 937 of file JRootfit.hh.

Member Typedef Documentation

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

Definition at line 942 of file JRootfit.hh.

template<class JFs_t >
typedef JGandalf<JFs_t>::result_type JROOT::JRootfit< JFs_t >::result_type

Definition at line 1160 of file JRootfit.hh.

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

Data type of fit parameter.

Definition at line 95 of file JGandalf.hh.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 948 of file JRootfit.hh.

949  {}

Member Function Documentation

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 963 of file JRootfit.hh.

968  {
969  return eval(f1, ls, data_type< m_1d<T> >(h1, X));
970  }
Template definition of data structure for set of data points.
Definition: JRootfit.hh:291
const JPolynome f1(1.0, 2.0, 3.0)
Function.
1D data point.
Definition: JRootfit.hh:186
const result_type & eval(const JFs_t &fs, const index_list &ls, const data_type< T > &data)
Evaluate fit.
Definition: JRootfit.hh:1135
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 986 of file JRootfit.hh.

991  {
992  (*this)(*h1, f1, type, ls, X);
993 
994  h1->GetListOfFunctions()->Add(new JF1("f1",
995  this->value,
996  JTOOLS::join(X, getRange(h1->GetXaxis()))));
997 
998  return static_cast<const result_type&>(*this);
999  }
JRange< T, JComparator_t > join(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Join ranges.
Definition: JRange.hh:659
JModel_t value
value
Definition: JGandalf.hh:333
then set_variable PMT_FILE set_variable DAQ_FILE set_variable OUTPUT_FILE set_variable DETECTOR else fatal Wrong number of arguments fi JPrintTree f $DAQ_FILE type
const JPolynome f1(1.0, 2.0, 3.0)
Function.
Wrapper data structure to build ROOT 1D function.
Definition: JRootfit.hh:588
range_type getRange(TAxis *pAxis)
Get range of given axis.
Definition: JRootfit.hh:51
no fit printf nominal n $STRING awk v X
JRootfit_t< JFs_t > result_type
Definition: JRootfit.hh:942
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 1014 of file JRootfit.hh.

1020  {
1021  return eval(f2, ls, data_type< m_2d<T> >(h2, X, Y));
1022  }
Template definition of data structure for set of data points.
Definition: JRootfit.hh:291
2D data point.
Definition: JRootfit.hh:217
const result_type & eval(const JFs_t &fs, const index_list &ls, const data_type< T > &data)
Evaluate fit.
Definition: JRootfit.hh:1135
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 1039 of file JRootfit.hh.

1045  {
1046  (*this)(*h2, f2, type, ls, X, Y);
1047 
1048  h2->GetListOfFunctions()->Add(new JF2("f2",
1049  this->value,
1050  JTOOLS::join(X, getRange(h2->GetXaxis())),
1051  JTOOLS::join(Y, getRange(h2->GetYaxis()))));
1052 
1053  return static_cast<const result_type&>(*this);
1054  }
JRange< T, JComparator_t > join(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Join ranges.
Definition: JRange.hh:659
JModel_t value
value
Definition: JGandalf.hh:333
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
then set_variable PMT_FILE set_variable DAQ_FILE set_variable OUTPUT_FILE set_variable DETECTOR else fatal Wrong number of arguments fi JPrintTree f $DAQ_FILE type
range_type getRange(TAxis *pAxis)
Get range of given axis.
Definition: JRootfit.hh:51
Wrapper data structure to build ROOT 2D function.
Definition: JRootfit.hh:649
no fit printf nominal n $STRING awk v X
JRootfit_t< JFs_t > result_type
Definition: JRootfit.hh:942
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 1070 of file JRootfit.hh.

1077  {
1078  return eval(f3, ls, data_type< m_3d<T> >(h3, X, Y, Z));
1079  }
Template definition of data structure for set of data points.
Definition: JRootfit.hh:291
const result_type & eval(const JFs_t &fs, const index_list &ls, const data_type< T > &data)
Evaluate fit.
Definition: JRootfit.hh:1135
double f3(const double x, const double y, const double z)
3D function.
Definition: JPolynome3D.cc:23
3D data point.
Definition: JRootfit.hh:252
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 1097 of file JRootfit.hh.

1104  {
1105  (*this)(*h3, f3, type, ls, X, Y, Z);
1106 
1107  h3->GetListOfFunctions()->Add(new JF3("f3",
1108  this->value,
1109  JTOOLS::join(X, getRange(h3->GetXaxis())),
1110  JTOOLS::join(Y, getRange(h3->GetYaxis())),
1111  JTOOLS::join(Z, getRange(h3->GetZaxis()))));
1112 
1113  return static_cast<const result_type&>(*this);
1114  }
JRange< T, JComparator_t > join(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Join ranges.
Definition: JRange.hh:659
JModel_t value
value
Definition: JGandalf.hh:333
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
then set_variable PMT_FILE set_variable DAQ_FILE set_variable OUTPUT_FILE set_variable DETECTOR else fatal Wrong number of arguments fi JPrintTree f $DAQ_FILE type
range_type getRange(TAxis *pAxis)
Get range of given axis.
Definition: JRootfit.hh:51
Wrapper data structure to build ROOT 3D function.
Definition: JRootfit.hh:715
no fit printf nominal n $STRING awk v X
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
double f3(const double x, const double y, const double z)
3D function.
Definition: JPolynome3D.cc:23
JRootfit_t< JFs_t > result_type
Definition: JRootfit.hh:942
template<class JFs_t >
size_t JROOT::JRootfit< JFs_t >::getNumberOfFreeParameters ( )
private
template<class JFs_t >
size_t JROOT::JRootfit< JFs_t >::getN ( )
private
template<class JFs_t >
double JROOT::JRootfit< JFs_t >::getChi2 ( )
private
template<class JFs_t >
int JROOT::JRootfit< JFs_t >::getNDF ( )
private
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 1135 of file JRootfit.hh.

1138  {
1139  this->parameters.clear();
1140 
1141  for (size_t i = 0; i != JFs_t::parameters.size(); ++i) {
1142  if (ls.count(i) == 0) {
1143  this->parameters.push_back(JFs_t::parameters[i]);
1144  }
1145  }
1146 
1147  this->value = fs;
1148  this->npx = data.size();
1149  this->chi2 = static_cast<JGandalf<JFs_t>&>(*this)(this->fit, data.begin(), data.end()).chi2;
1150 
1151  return static_cast<const result_type&>(*this);
1152  }
JModel_t value
value
Definition: JGandalf.hh:333
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
std::vector< parameter_type > parameters
fit parameters
Definition: JGandalf.hh:330
struct JROOT::JRootfit::@61 fit
Auxiliary data structure for fit functions.
size_t npx
number of data points
Definition: JRootfit.hh:840
JRootfit_t< JFs_t > result_type
Definition: JRootfit.hh:942
double chi2
chi2
Definition: JRootfit.hh:841
template<class JFs_t >
const JFs_t& JROOT::JRootfit_t< JFs_t >::getFunction ( ) const
inlineinherited

Get function.

Returns
function.

Definition at line 849 of file JRootfit.hh.

850  {
851  return this->value;
852  }
JModel_t value
value
Definition: JGandalf.hh:333
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 860 of file JRootfit.hh.

861  {
862  return JFs_t::parameters.size();
863  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
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 871 of file JRootfit.hh.

872  {
873  return this->parameters.size();
874  }
std::vector< parameter_type > parameters
fit parameters
Definition: JGandalf.hh:330
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 882 of file JRootfit.hh.

883  {
884  return npx;
885  }
size_t npx
number of data points
Definition: JRootfit.hh:840
template<class JFs_t >
double JROOT::JRootfit_t< JFs_t >::getChi2 ( ) const
inlineinherited

Get chi2.

Returns
chi2

Definition at line 893 of file JRootfit.hh.

894  {
895  return chi2;
896  }
double chi2
chi2
Definition: JRootfit.hh:841
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 904 of file JRootfit.hh.

905  {
906  return (int) getN() - (int) getNumberOfFreeParameters();
907  }
size_t getNumberOfFreeParameters() const
Get number of free parameters.
Definition: JRootfit.hh:871
size_t getN() const
Get number of data points.
Definition: JRootfit.hh:882
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 915 of file JRootfit.hh.

916  {
917  return getParameter(this->value, i);
918  }
int getParameter(const std::string &text)
Get parameter number from text string.
JModel_t value
value
Definition: JGandalf.hh:333
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 926 of file JRootfit.hh.

927  {
928  return getParameter(this->error, i);
929  }
int getParameter(const std::string &text)
Get parameter number from text string.
JModel_t error
error
Definition: JGandalf.hh:334
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 160 of file JGandalf.hh.

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

Member Data Documentation

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

Global fit object.

Definition at line 1117 of file JRootfit.hh.

template<class JFs_t >
result_type JROOT::JRootfit< JFs_t >::result
mutableprivate

Definition at line 1222 of file JRootfit.hh.

struct { ... } JROOT::JRootfit< JFs_t >::fit

Auxiliary data structure for fit functions.

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

number of data points

Definition at line 840 of file JRootfit.hh.

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

chi2

Definition at line 841 of file JRootfit.hh.

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

maximal number of iterations

maximal number of iterations.

Definition at line 322 of file JGandalf.hh.

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 323 of file JGandalf.hh.

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

minimal value control parameter

Definition at line 324 of file JGandalf.hh.

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

maximal value control parameter

Definition at line 325 of file JGandalf.hh.

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

multiplication factor control parameter

Definition at line 326 of file JGandalf.hh.

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

multiplication factor control parameter

Definition at line 327 of file JGandalf.hh.

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 328 of file JGandalf.hh.

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

fit parameters

Definition at line 330 of file JGandalf.hh.

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

number of iterations

Definition at line 331 of file JGandalf.hh.

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

control parameter

Definition at line 332 of file JGandalf.hh.

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

value

Definition at line 333 of file JGandalf.hh.

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

error

Definition at line 334 of file JGandalf.hh.

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

Hesse matrix.

Definition at line 335 of file JGandalf.hh.

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: