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);
unsigned int NFcn() const
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)
void para(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
double Value(unsigned int) const
unsigned int VariableParameters() const
TVector3 cross(const TVector3 &v1, const TVector3 &v2)
Class describing a symmetric matrix of size n.
unsigned int Nrow() const
const MnUserParameterState & UserState() const
MnCross Loval(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
double LowerLimit() const
const char * Name(unsigned int) const
unsigned int IntOfExt(unsigned int) const
const FunctionMinimum & fMinimum
double Int2ext(unsigned int, double) const
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
const MnAlgebraicVector & Vec() const
MnCross FindCrossValue(int dir, unsigned int, unsigned int maxcalls, double toler) const
internal method to get crossing value via MnFunctionCross
double UpperLimit() const
unsigned int ExtOfInt(unsigned int) const
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
const MinimumParameters & Parameters() const
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 ...
Class holding the result of Minos (lower and upper values) for a specific parameter.
void SetValue(unsigned int, double)
class which holds the external user and/or internal Minuit representation of the parameters and error...
double Upper(unsigned int, unsigned int maxcalls=0, double toler=0.1) 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
MnAlgebraicSymMatrix Matrix() const
const MinuitParameter & Parameter(unsigned int i) const
MnCross Upval(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
const MinimumError & Error() 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 ...
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
double Error(unsigned int) const