54 if (endline) os << std::endl;
63 void MnPrint::PrintState(std::ostream & os,
double fval,
double edm,
int ncalls,
const char * msg,
int iter) {
66 if (iter>=0) os << std::setw(3) << iter;
69 os <<
" - FCN = " << std::setw(width) << fval;
71 os <<
" Edm = " << std::setw(12) << edm <<
" NCalls = " << std::setw(6) << ncalls;
78 os <<
"LAVector parameters:" << std::endl;
81 int nrow = vec.
size();
82 for (
int i = 0; i < nrow; i++) {
84 os << vec(i) << std::endl;
93 os <<
"LASymMatrix parameters:" << std::endl;
94 int pr = os.precision(8);
97 int n = matrix.
Nrow();
98 for (
int i = 0; i <
n; i++) {
99 for (
int j = 0; j <
n; j++) {
100 os.width(15); os << matrix(i,j);
113 os <<
"# ext. |" <<
"| Name |" <<
"| type |" <<
"| Value |" <<
"| Error +/- " << std::endl;
116 int pr = os.precision();
118 bool atLoLim =
false;
119 bool atHiLim =
false;
120 for(std::vector<MinuitParameter>::const_iterator ipar = par.
Parameters().begin(); ipar != par.
Parameters().end(); ipar++) {
121 os << std::setw(4) << (*ipar).Number() << std::setw(5) <<
"||";
122 os << std::setw(10) << (*ipar).Name() << std::setw(3) <<
"||";
123 if((*ipar).IsConst()) {
124 os <<
" const ||" << std::setprecision(
PRECISION) << std::setw(
WIDTH) << (*ipar).Value() <<
" ||" << std::endl;
125 }
else if((*ipar).IsFixed()) {
126 os <<
" fixed ||" << std::setprecision(
PRECISION) << std::setw(
WIDTH) << (*ipar).Value() <<
" ||" << std::endl;
127 }
else if((*ipar).HasLimits()) {
128 if((*ipar).Error() > 0.) {
129 os <<
" limited ||" << std::setprecision(
PRECISION) << std::setw(
WIDTH) << (*ipar).Value();
138 os <<
" ||" << std::setw(12) << (*ipar).Error() << std::endl;
140 os <<
" free ||" << std::setprecision(
PRECISION) << std::setw(
WIDTH) << (*ipar).Value() <<
" ||" << std::setw(12) <<
"no" << std::endl;
142 if((*ipar).Error() > 0.)
143 os <<
" free ||" << std::setprecision(
PRECISION) << std::setw(
WIDTH) << (*ipar).Value() <<
" ||" << std::setw(12) << (*ipar).Error() << std::endl;
145 os <<
" free ||" << std::setprecision(
PRECISION) << std::setw(
WIDTH) << (*ipar).Value() <<
" ||" << std::setw(12) <<
"no" << std::endl;
150 if(atLoLim) os <<
"* Parameter is at Lower limit" << std::endl;
151 if(atHiLim) os <<
"** Parameter is at Upper limit" << std::endl;
162 os <<
"MnUserCovariance: " << std::endl;
163 int pr = os.precision(6);
166 unsigned int n = matrix.
Nrow();
167 for (
unsigned int i = 0; i <
n; i++) {
168 for (
unsigned int j = 0; j <
n; j++) {
169 os.width(13); os << matrix(i,j);
176 os <<
"MnUserCovariance Parameter correlations: " << std::endl;
180 unsigned int n = matrix.
Nrow();
181 for (
unsigned int i = 0; i <
n; i++) {
182 double di = matrix(i,i);
183 for (
unsigned int j = 0; j <
n; j++) {
184 double dj = matrix(j,j);
185 os.width(13); os << matrix(i,j)/
sqrt(
fabs(di*dj));
199 os <<
"MnGlobalCorrelationCoeff: " << std::endl;
200 int pr = os.precision(6);
203 for (
unsigned int i = 0; i < coeff.
GlobalCC().size(); i++) {
204 os.width(13); os << coeff.
GlobalCC()[i];
219 os <<
"WARNING: MnUserParameterState is not valid."<<std::endl;
224 os <<
"# of function calls: "<<state.
NFcn()<<std::endl;
225 os <<
"function Value: " << state.
Fval()<<std::endl;
226 os <<
"expected distance to the Minimum (edm): " << state.
Edm()<<std::endl;
227 os <<
"external parameters: "<<state.
Parameters()<<std::endl;
230 os <<
"covariance matrix: "<<state.
Covariance()<<std::endl;
232 os <<
"covariance matrix is not present or not valid "<<std::endl;
234 os <<
"global correlation coefficients : "<<state.
GlobalCC()<<std::endl;
237 os <<
"WARNING: MnUserParameterState is not valid."<<std::endl;
249 os <<
"WARNING: Minuit did not converge."<<std::endl;
252 os <<
"Minuit did successfully converge."<<std::endl;
256 os <<
"# of function calls: "<<min.
NFcn()<<std::endl;
257 os <<
"minimum function Value: " << min.
Fval()<<std::endl;
258 os <<
"minimum edm: " << min.
Edm()<<std::endl;
259 os <<
"minimum internal state vector: "<<min.
Parameters().
Vec()<<std::endl;
261 os <<
"minimum internal covariance matrix: "<<min.
Error().
Matrix()<<std::endl;
268 os <<
"WARNING: FunctionMinimum is invalid: " << std::endl;
270 os <<
"\t State is invalid" << std::endl;
272 os <<
"\t Edm is above max" << std::endl;
274 os <<
"\t Reached call limit" << std::endl;
289 os <<
"minimum function Value: " << min.
Fval()<<std::endl;
290 os <<
"minimum edm: " << min.
Edm()<<std::endl;
291 os <<
"minimum internal state vector: "<<min.
Vec()<<std::endl;
292 os <<
"minimum internal Gradient vector: "<<min.
Gradient().
Vec()<<std::endl;
294 os <<
"minimum internal covariance matrix: "<<min.
Error().
Matrix()<<std::endl;
307 os <<
"current machine precision is set to "<<prec.
Eps()<<std::endl;
319 os <<
"Minos # of function calls: "<<me.
NFcn()<<std::endl;
322 os <<
"Minos Error is not valid." <<std::endl;
324 os <<
"lower Minos Error is not valid." <<std::endl;
326 os <<
"upper Minos Error is not valid." <<std::endl;
328 os <<
"Minos Error is Lower limit of Parameter "<<me.
Parameter()<<
"." <<std::endl;
330 os <<
"Minos Error is Upper limit of Parameter "<<me.
Parameter()<<
"." <<std::endl;
332 os <<
"Minos number of function calls for Lower Error exhausted."<<std::endl;
334 os <<
"Minos number of function calls for Upper Error exhausted."<<std::endl;
336 os <<
"Minos found a new Minimum in negative direction."<<std::endl;
340 os <<
"Minos found a new Minimum in positive direction."<<std::endl;
344 int pr = os.precision();
346 os <<
"# ext. |" <<
"| Name |" <<
"| Value@min |" <<
"| negative |" <<
"| positive " << std::endl;
347 os << std::setw(4) << me.
Parameter() << std::setw(5) <<
"||";
360 os <<
"Contours # of function calls: "<<ce.
NFcn()<<std::endl;
361 os <<
"MinosError in x: "<<std::endl;
363 os <<
"MinosError in y: "<<std::endl;
367 for(std::vector<std::pair<double,double> >::const_iterator ipar = ce().begin(); ipar != ce().end(); ipar++) {
368 os << ipar - ce().begin() <<
" "<< (*ipar).first <<
" "<< (*ipar).second <<std::endl;
bool AtLowerMaxFcn() const
Namespace for new ROOT classes and functions.
const MnAlgebraicVector & Vec() const
static void PrintFcn(std::ostream &os, double value, bool endline=true)
double Eps() const
eps returns the smallest possible number so that 1.+eps > 1.
const MinosError & YMinosError() const
Class describing a symmetric matrix of size n.
MnPlot produces a text-screen graphical output of (x,y) points, e.g.
const std::vector< ROOT::Minuit2::MinuitParameter > & Parameters() const
access to parameters (row-wise)
const MnAlgebraicVector & Vec() const
unsigned int Nrow() const
const MinosError & XMinosError() const
bool HasValidCovariance() const
unsigned int NFcn() const
determines the relative floating point arithmetic precision.
bool IsAboveMaxEdm() const
const FunctionGradient & Gradient() const
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
bool AtLowerLimit() const
const MinimumParameters & Parameters() const
const MinimumState & State() const
static void PrintState(std::ostream &os, const MinimumState &state, const char *msg, int iter=-1)
bool AtUpperLimit() const
bool AtUpperMaxFcn() const
const MnUserParameters & UserParameters() const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
const MnUserParameterState & UpperState() const
unsigned int Parameter() const
int CovarianceStatus() const
unsigned int Nrow() const
Class holding the result of Minos (lower and upper values) for a specific parameter.
MnAlgebraicSymMatrix Matrix() const
class which holds the external user and/or internal Minuit representation of the parameters and error...
const MnGlobalCorrelationCoeff & GlobalCC() const
unsigned int size() const
API class for the user interaction with the parameters; serves as input to the minimizer as well as o...
const std::vector< double > & GlobalCC() const
const MnUserCovariance & Covariance() const
bool HasReachedCallLimit() const
bool HasCovariance() const
static int SetLevel(int level)
const MnUserParameters & Parameters() const
const MinimumError & Error() const
class for global correlation coefficient
const char * Name(unsigned int) const
unsigned int NFcn() const
const MnUserParameterState & LowerState() const
double Eps2() const
eps2 returns 2*sqrt(eps)
std::ostream & operator<<(std::ostream &, const FunctionMinimum &)
bool HasCovariance() const
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
const MinimumError & Error() const
unsigned int NFcn() const
const MnMachinePrecision & Precision() const
const MnAlgebraicVector & Vec() const
Class containing the covariance matrix data represented as a vector of size n*(n+1)/2 Used to hide in...