19#if defined(DEBUG) || defined(WARNINGMSG)
36 if (fcn.
Up() != min.
Up() ) {
38 MN_INFO_MSG(
"MnMinos UP value has changed, need to update FunctionMinimum class");
50 if (fcn.
Up() != min.
Up() ) {
52 MN_INFO_MSG(
"MnMinos UP value has changed, need to update FunctionMinimum class");
58std::pair<double,double>
MnMinos::operator()(
unsigned int par,
unsigned int maxcalls,
double toler)
const {
64double MnMinos::Lower(
unsigned int par,
unsigned int maxcalls,
double toler)
const {
76double MnMinos::Upper(
unsigned int par,
unsigned int maxcalls,
double toler)
const {
96 std::cout <<
"Function calls to find upper error " << up.
NFcn() << std::endl;
102 std::cout <<
"Function calls to find lower error " << lo.
NFcn() << std::endl;
115 assert(direction == 1 || direction == -1);
118 std::cout <<
"\n--------- MnMinos --------- \n Determination of positive Minos error for parameter "
121 std::cout <<
"\n--------- MnMinos --------- \n Determination of positive Minos error for parameter "
130 maxcalls = 2*(nvar+1)*(200 + 100*nvar + 5*nvar*nvar);
133 std::vector<unsigned int> para(1, par);
136 double err = direction * upar.
Error(par);
137 double val = upar.
Value(par) + err;
138 std::vector<double> xmid(1, val);
139 std::vector<double> xdir(1, err);
142 unsigned int ind = upar.
IntOfExt(par);
148 double xunit =
sqrt(up/
m(ind,ind));
150 for(
unsigned int i = 0; i <
m.Nrow(); i++) {
151 if(i == ind)
continue;
152 double xdev = xunit*
m(ind,i);
153 double xnew = xt(i) + direction * xdev;
156 unsigned int ext = upar.
ExtOfInt(i);
158 double unew = upar.
Int2ext(i, xnew);
161 std::cout <<
"Parameter " << ext <<
" is set from " << upar.
Value(ext) <<
" to " << unew << std::endl;
170 std::cout <<
"Parameter " << par <<
" is fixed and set from " <<
fMinimum.
UserState().
Value(par) <<
" to " << val << std::endl;
175 MnCross aopt = cross(para, xmid, xdir, toler, maxcalls);
179 std::cout<<
"----- MnMinos: aopt found from MnFunctionCross = "<<aopt.
Value()<<std::endl << std::endl;
183 const char * par_name = upar.
Name(par);
185 MN_INFO_VAL2(
"MnMinos maximum number of function calls exceeded for Parameter ",par_name);
187 MN_INFO_VAL2(
"MnMinos new Minimum found while looking for Parameter ",par_name);
190 MN_INFO_VAL2(
"MnMinos Parameter is at Upper limit.",par_name);
192 MN_INFO_VAL2(
"MnMinos could not find Upper Value for Parameter ",par_name);
196 MN_INFO_VAL2(
"MnMinos Parameter is at Lower limit.",par_name);
198 MN_INFO_VAL2(
"MnMinos could not find Lower Value for Parameter ",par_name);
#define MN_INFO_VAL2(loc, x)
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
virtual double Up() const =0
Error definition of the function.
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
const MinimumParameters & Parameters() const
const MinimumError & Error() const
const MnUserParameterState & UserState() const
Class describing a symmetric matrix of size n.
MnAlgebraicSymMatrix Matrix() const
const MnAlgebraicVector & Vec() const
Class holding the result of Minos (lower and upper values) for a specific parameter.
double LowerLimit() const
double UpperLimit() const
unsigned int NFcn() const
const FunctionMinimum & fMinimum
MinosError Minos(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
ask for MinosError (Lower + Upper) can be printed via std::cout
double Upper(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
std::pair< double, double > operator()(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
returns the negative (pair.first) and the positive (pair.second) Minos Error of the Parameter
MnCross Loval(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
MnCross FindCrossValue(int dir, unsigned int, unsigned int maxcalls, double toler) const
internal method to get crossing value via MnFunctionCross
MnMinos(const FCNBase &fcn, const FunctionMinimum &min, unsigned int stra=1)
construct from FCN + Minimum + strategy
double Lower(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
calculate one side (negative or positive Error) of the Parameter give as input (optionally) maxcalls ...
MnCross Upval(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
class which holds the external user and/or internal Minuit representation of the parameters and error...
double Value(unsigned int) const
double Error(unsigned int) const
double Int2ext(unsigned int, double) const
unsigned int VariableParameters() const
const MinuitParameter & Parameter(unsigned int i) const
void SetValue(unsigned int, double)
unsigned int ExtOfInt(unsigned int) const
const char * Name(unsigned int) const
unsigned int IntOfExt(unsigned int) const