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");
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);
186 if(aopt.NewMinimum())
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);
virtual double Up() const =0
Error definition of the function.
MnMinos(const FCNBase &fcn, const FunctionMinimum &min, unsigned int stra=1)
construct from FCN + Minimum + strategy
#define MN_INFO_VAL2(loc, x)
unsigned int NFcn() const
MnCross Upval(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
const MnAlgebraicVector & Vec() const
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 LowerLimit() const
Class describing a symmetric matrix of size n.
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 ...
const MinuitParameter & Parameter(unsigned int i) const
MnCross Loval(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
unsigned int ExtOfInt(unsigned int) const
unsigned int VariableParameters() const
double Error(unsigned int) const
const FunctionMinimum & fMinimum
MnCross FindCrossValue(int dir, unsigned int, unsigned int maxcalls, double toler) const
internal method to get crossing value via MnFunctionCross
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
const MinimumParameters & Parameters() const
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
double UpperLimit() const
double Upper(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
unsigned int IntOfExt(unsigned int) const
unsigned int Nrow() const
Class holding the result of Minos (lower and upper values) for a specific parameter.
MnAlgebraicSymMatrix Matrix() const
void SetValue(unsigned int, double)
class which holds the external user and/or internal Minuit representation of the parameters and error...
const char * Name(unsigned int) 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 ...
double Int2ext(unsigned int, double) const
const MnUserParameterState & UserState() const
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
const MinimumError & Error() const
double Value(unsigned int) const