52 oocoutW(
_context, Minimization) <<
"RooAbsMinimizerFcn::RooAbsMinimizerFcn: removing parameter "
53 << param->
GetName() <<
" from list because it is not of type RooRealVar"
71bool RooAbsMinimizerFcn::synchronizeParameterSettings(std::vector<ROOT::Fit::ParameterSettings> ¶meters)
75 for (std::size_t i = 0; i <
_allParams.size(); ++i) {
78 ss <<
"RooMinimzer: the parameter named " <<
_allParams[i].GetName()
79 <<
" is not constant anymore, but it was constant at the time where the RooMinimizer was constructed."
80 " This is illegal. The other way around is supported: you can always change the constant flag of "
81 "parameters that were floating at the time the minimizer was instantiated.";
82 oocxcoutF(
nullptr, LinkStateMgmt) <<
ss.str() << std::endl;
83 throw std::runtime_error(
ss.str());
87 std::vector<ROOT::Fit::ParameterSettings>
oldParameters = parameters;
100 double pmin = par.hasMin() ? par.getMin() : 0.0;
101 double pmax = par.hasMax() ? par.getMax() : 0.0;
104 double pstep = par.getError();
107 if (par.hasMin() && par.hasMax()) {
113 }
else if (par.getVal() -
pmin < 2 *
pstep) {
127 <<
"RooAbsMinimizerFcn::synchronize: WARNING: no initial error estimate available for " << par.GetName()
128 <<
": using " <<
pstep << std::endl;
132 if (par.hasMin() && par.hasMax()) {
133 parameters.emplace_back(par.GetName(), par.getVal(),
pstep,
pmin,
pmax);
135 parameters.emplace_back(par.GetName(), par.getVal(),
pstep);
137 parameters.back().SetLowerLimit(
pmin);
138 }
else if (par.hasMax()) {
139 parameters.back().SetUpperLimit(
pmax);
143 par.isConstant() ? parameters.back().Fix() : parameters.back().Release();
149bool RooAbsMinimizerFcn::Synchronize(std::vector<ROOT::Fit::ParameterSettings> ¶meters)
151 return synchronizeParameterSettings(parameters);
155void RooAbsMinimizerFcn::BackProp()
173 if (eplus > 0 ||
eminus < 0) {
175 param.setAsymError(
eminus, eplus);
178 param.removeAsymError();
186bool RooAbsMinimizerFcn::SetLogFile(
const char *
inLogfile)
189 oocoutI(
_context, Minimization) <<
"RooAbsMinimizerFcn::setLogFile: closing previous log file" << std::endl;
208void RooAbsMinimizerFcn::ApplyCovarianceMatrix(
TMatrixDSym &V)
210 for (
unsigned int i = 0; i <
getNDim(); i++) {
216bool RooAbsMinimizerFcn::SetPdfParamVal(
int index,
double value)
const
220 if (par.getVal() !=
value) {
222 std::cout << par.GetName() <<
"=" <<
value <<
", ";
234void RooAbsMinimizerFcn::printEvalErrors()
const
236 if (cfg().printEvalErrors < 0)
239 std::ostringstream
msg;
240 if (cfg().doEEWall) {
241 msg <<
"RooAbsMinimizerFcn: Minimized function has error status." << std::endl
242 <<
"Returning maximum FCN so far (" <<
_maxFCN
243 <<
") to force MIGRAD to back out of this region. Error log follows.\n";
245 msg <<
"RooAbsMinimizerFcn: Minimized function has error status but is ignored.\n";
248 msg <<
"Parameter values: ";
249 for (std::size_t i = 0; i <
getNDim(); ++i) {
251 msg <<
"\t" << var.GetName() <<
"=" << var.getVal();
265double RooAbsMinimizerFcn::applyEvalErrorHandling(
double fvalue)
const
272 if (cfg().doEEWall) {
289void RooAbsMinimizerFcn::finishDoEval()
const
294RooArgList RooAbsMinimizerFcn::floatParams()
const
304RooArgList RooAbsMinimizerFcn::constParams()
const
314RooArgList RooAbsMinimizerFcn::initFloatParams()
const
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Common abstract base class for objects that represent a value and a "shape" in RooFit.
const char * GetName() const override
Returns name of object.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
static void printEvalErrors(std::ostream &os=std::cout, Int_t maxPerNode=10000000)
Print all outstanding logged evaluation error on the given ostream.
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Wrapper class around ROOT::Math::Minimizer that provides a seamless interface between the minimizer f...
static float unpackNaN(double val)
If val is NaN and a this NaN has been tagged as containing a payload, unpack the float from the manti...