26operator()(
unsigned int px,
unsigned int py,
unsigned int npoints)
const
40 unsigned int nfcn = 0;
44 std::vector<std::pair<double, double>> result;
45 result.reserve(npoints);
46 std::vector<MnUserParameterState> states;
62 print.
Error(
"unable to find first two points");
65 std::pair<double, double>
ex = mex();
70 print.
Error(
"unable to find second two points");
73 std::pair<double, double>
ey = mey();
80 nfcn += exy_up.
NFcn();
82 print.
Error(
"unable to find Upper y Value for x Parameter", px);
88 nfcn += exy_lo.
NFcn();
90 print.
Error(
"unable to find Lower y Value for x Parameter", px);
98 nfcn += eyx_up.
NFcn();
100 print.
Error(
"unable to find Upper x Value for y Parameter", py);
106 nfcn += eyx_lo.
NFcn();
108 print.
Error(
"unable to find Lower x Value for y Parameter", py);
112 double scalx = 1. / (
ex.second -
ex.first);
113 double scaly = 1. / (
ey.second -
ey.first);
122 print.
Info(
"List of found points",
'\n',
" Parameter x is", upar.
Name(px),
'\n',
" Parameter y is", upar.
Name(py),
123 '\n', result[0],
'\n', result[1],
'\n', result[2],
'\n', result[3]);
128 std::vector<unsigned int> par(2);
133 for (
unsigned int i = 4; i < npoints; i++) {
135 auto idist1 = result.end() - 1;
136 auto idist2 = result.begin();
137 double dx = idist1->first - (idist2)->
first;
138 double dy = idist1->second - (idist2)->second;
139 double bigdis = scalx * scalx * dx * dx + scaly * scaly * dy * dy;
141 for (
auto ipair = result.begin(); ipair != result.end() - 1; ++ipair) {
142 double distx = ipair->first - (ipair + 1)->
first;
143 double disty = ipair->second - (ipair + 1)->second;
144 double dist = scalx * scalx * distx * distx + scaly * scaly * disty * disty;
158 if (nfcn > maxcalls) {
159 print.
Error(
"maximum number of function calls exhausted");
163 double xmidcr = a1 * idist1->first + a2 * (idist2)->
first;
164 double ymidcr = a1 * idist1->second + a2 * (idist2)->second;
165 double xdir = (idist2)->second - idist1->second;
166 double ydir = idist1->first - (idist2)->
first;
167 double scalfac = sca * std::max(std::fabs(xdir * scalx), std::fabs(ydir * scaly));
168 double xdircr = xdir / scalfac;
169 double ydircr = ydir / scalfac;
170 std::vector<double> pmid(2);
173 std::vector<double> pdir(2);
177 MnCross opt = cross(par, pmid, pdir, toler, maxcalls);
182 print.
Error(
"unable to find point on Contour", i + 1,
'\n',
"found only", i,
"points");
191 double aopt = opt.
Value();
192 if (idist2 == result.begin()) {
193 result.emplace_back(xmidcr + (aopt)*xdircr, ymidcr + (aopt)*ydircr);
194 print.
Info(result.back());
196 result.insert(idist2, {xmidcr + (aopt)*xdircr, ymidcr + (aopt)*ydircr});
201 print.
Info(
"Number of contour points =", result.size());
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
const MnUserParameterState & UserState() const
Class holding the result of Minos (lower and upper values) for a specific parameter.
unsigned int NFcn() const
void SetValue(unsigned int, double)
std::vector< std::pair< double, double > > operator()(unsigned int, unsigned int, unsigned int npoints=20) const
ask for one Contour (points only) from number of points (>=4) and parameter indeces
ContoursError Contour(unsigned int, unsigned int, unsigned int npoints=20) const
ask for one Contour ContoursError (MinosErrors + points) from number of points (>=4) and parameter in...
const FunctionMinimum & fMinimum
unsigned int NFcn() const
API class for minimization using Variable Metric technology ("MIGRAD"); allows for user interaction: ...
API class for Minos Error analysis (asymmetric errors); minimization has to be done before and Minimu...
MinosError Minos(unsigned int, unsigned int maxcalls=0, double toler=0.1) const
ask for MinosError (Lower + Upper) can be printed via std::cout
void Error(const Ts &... args)
void Info(const Ts &... args)
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
unsigned int Strategy() const
class which holds the external user and/or internal Minuit representation of the parameters and error...
double Value(unsigned int) const
unsigned int VariableParameters() const
const char * Name(unsigned int) const
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...