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 {
74double MnMinos::Upper(
unsigned int par,
unsigned int maxcalls,
double toler)
const {
89 std::cout <<
"Function calls to find upper error " << up.
NFcn() << std::endl;
95 std::cout <<
"Function calls to find lower error " << lo.
NFcn() << std::endl;
98 std::cout <<
"return Minos error " << lo.
Value() <<
" , " << up.
Value() << std::endl;
110 assert(direction == 1 || direction == -1);
113 if (printLevel > 2) {
115 std::cout <<
"--------- MnMinos -------\nDetermination of upper Minos error for parameter "
118 std::cout <<
"--------- MnMinos -------\nDetermination of lower Minos error for parameter "
128 maxcalls = 2*(nvar+1)*(200 + 100*nvar + 5*nvar*nvar);
131 std::vector<unsigned int> para(1, par);
134 double err = direction * upar.
Error(par);
135 double val = upar.
Value(par) + err;
144 err = val-upar.
Value(par);
145 std::vector<double> xmid(1, val);
146 std::vector<double> xdir(1, err);
149 unsigned int ind = upar.
IntOfExt(par);
155 double xunit =
sqrt(up/
m(ind,ind));
158 for(
unsigned int i = 0; i <
m.Nrow(); i++) {
159 if(i == ind)
continue;
160 double xdev = xunit*
m(ind,i);
161 double xnew = xt(i) + direction * xdev;
164 unsigned int ext = upar.
ExtOfInt(i);
166 double unew = upar.
Int2ext(i, xnew);
177 std::cout <<
"Parameter " << ext <<
" is set from " << upar.
Value(ext) <<
" to " << unew << std::endl;
186 std::cout <<
"Parameter " << par <<
" is fixed and set from " <<
fMinimum.
UserState().
Value(par) <<
" to " << val
187 <<
" delta = " << err << std::endl;
192 MnCross aopt = cross(para, xmid, xdir, toler, maxcalls);
196 std::cout<<
"----- MnMinos: aopt value found from MnFunctionCross = "<<aopt.
Value()<<std::endl << std::endl;
200 const char * par_name = upar.
Name(par);
202 MN_INFO_VAL2(
"MnMinos maximum number of function calls exceeded for Parameter ",par_name);
204 MN_INFO_VAL2(
"MnMinos new Minimum found while looking for Parameter ",par_name);
207 MN_INFO_VAL2(
"MnMinos: parameter is at Upper limit.",par_name);
209 MN_INFO_VAL2(
"MnMinos: could not find Upper Value for Parameter ",par_name);
213 MN_INFO_VAL2(
"MnMinos: parameter is at Lower limit.",par_name);
215 MN_INFO_VAL2(
"MnMinos: could not find Lower Value for Parameter ",par_name);
219 if (printLevel > 2) {
220 std::string scanType = (direction == 1) ?
"up" :
"low";
221 std::cout <<
" ------ end Minos scan for " << scanType <<
" interval for parameter " << upar.
Name(par) << std::endl;
#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
bool HasLowerLimit() const
bool HasUpperLimit() 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
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...