Logo ROOT  
Reference Guide
FCNBase.h
Go to the documentation of this file.
1// @(#)root/minuit2:$Id$
2// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7 * *
8 **********************************************************************/
9
10#ifndef ROOT_Minuit2_FCNBase
11#define ROOT_Minuit2_FCNBase
12
13#include "Minuit2/MnConfig.h"
14
15#include <vector>
16
18
19namespace ROOT {
20
21 namespace Minuit2 {
22
23
24/**
25
26 \defgroup Minuit Minuit2 Minimization Library
27
28 New Object-oriented implementation of the MINUIT minimization package.
29 More information is available at the home page of the \ref Minuit2Page "Minuit2" minimization package".
30
31 \ingroup Math
32*/
33
34
35//______________________________________________________________________________
36/**
37
38
39Interface (abstract class) defining the function to be minimized, which has to be implemented by the user.
40
41@author Fred James and Matthias Winkler; modified by Andras Zsenei and Lorenzo Moneta
42
43\ingroup Minuit
44
45 */
46
47class FCNBase : public GenericFunction {
48
49public:
50
51
52 virtual ~FCNBase() {}
53
54
55
56 /**
57
58 The meaning of the vector of parameters is of course defined by the user,
59 who uses the values of those parameters to calculate their function Value.
60 The order and the position of these parameters is strictly the one specified
61 by the user when supplying the starting values for minimization. The starting
62 values must be specified by the user, either via an std::vector<double> or the
63 MnUserParameters supplied as input to the MINUIT minimizers such as
64 VariableMetricMinimizer or MnMigrad. Later values are determined by MINUIT
65 as it searches for the Minimum or performs whatever analysis is requested by
66 the user.
67
68 @param par function parameters as defined by the user.
69
70 @return the Value of the function.
71
72 @see MnUserParameters
73 @see VariableMetricMinimizer
74 @see MnMigrad
75
76 */
77
78 virtual double operator()(const std::vector<double>& x) const = 0;
79
80
81 /**
82
83 Error definition of the function. MINUIT defines Parameter errors as the
84 change in Parameter Value required to change the function Value by up. Normally,
85 for chisquared fits it is 1, and for negative log likelihood, its Value is 0.5.
86 If the user wants instead the 2-sigma errors for chisquared fits, it becomes 4,
87 as Chi2(x+n*sigma) = Chi2(x) + n*n.
88
89 Comment a little bit better with links!!!!!!!!!!!!!!!!!
90
91 */
92
93 virtual double ErrorDef() const {return Up();}
94
95
96 /**
97
98 Error definition of the function. MINUIT defines Parameter errors as the
99 change in Parameter Value required to change the function Value by up. Normally,
100 for chisquared fits it is 1, and for negative log likelihood, its Value is 0.5.
101 If the user wants instead the 2-sigma errors for chisquared fits, it becomes 4,
102 as Chi2(x+n*sigma) = Chi2(x) + n*n.
103
104 \todo Comment a little bit better with links!!!!!!!!!!!!!!!!! Idem for ErrorDef()
105
106 */
107
108 virtual double Up() const = 0;
109
110 /**
111 add interface to set dynamically a new error definition
112 Re-implement this function if needed.
113 */
114 virtual void SetErrorDef(double ) {};
115
116};
117
118 } // namespace Minuit2
119
120} // namespace ROOT
121
122#endif // ROOT_Minuit2_FCNBase
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
Definition: FCNBase.h:47
virtual double Up() const =0
Error definition of the function.
virtual ~FCNBase()
Definition: FCNBase.h:52
virtual void SetErrorDef(double)
add interface to set dynamically a new error definition Re-implement this function if needed.
Definition: FCNBase.h:114
virtual double ErrorDef() const
Error definition of the function.
Definition: FCNBase.h:93
virtual double operator()(const std::vector< double > &x) const =0
The meaning of the vector of parameters is of course defined by the user, who uses the values of thos...
Class from which all the other classes, representing functions, inherit.
Double_t x[n]
Definition: legend1.C:17
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21