43#include <unordered_map>
46using std::setprecision;
53template <
class InputIt1,
class InputIt2>
78 funct.getParameters(
nullptr, out,
false);
92 std::unordered_map<TNamed const *, std::vector<int>>
groups;
131 if (
auto wrapper =
dynamic_cast<RooFit::Experimental::RooEvaluatorWrapper
const *
>(&arg)) {
156 _multiGenFcn = std::make_unique<ROOT::Math::GradFunctor>(
this, &RooMinimizerFcn::operator(),
157 &RooMinimizerFcn::evaluateGradient,
nDim);
159 _multiGenFcn = std::make_unique<ROOT::Math::Functor>(std::cref(*
this),
nDim);
167double RooMinimizerFcn::operator()(
const double *
x)
const
172 (*_logfile) <<
x[
index] <<
" ";
197void RooMinimizerFcn::evaluateGradient(
const double *
x,
double *out)
const
202 (*_logfile) <<
x[
index] <<
" ";
208 std::size_t
iAll = 0;
220 std::cout <<
"\n gradient = ";
221 for (std::size_t i = 0; i <
getNDim(); ++i) {
222 std::cout << out[i] <<
", ";
227std::string RooMinimizerFcn::getFunctionName()
const
232std::string RooMinimizerFcn::getFunctionTitle()
const
234 return _funct->GetTitle();
237void RooMinimizerFcn::setOffsetting(
bool flag)
242RooArgSet RooMinimizerFcn::freezeDisconnectedParameters()
const
258 if (
v && !
v->isConstant()) {
261 }
else if (
cv && !
cv->isConstant()) {
270bool RooMinimizerFcn::evaluateHessian(std::span<const double>
x,
double *out)
const
275 (*_logfile) <<
x[
index] <<
" ";
283 std::size_t
iAll = 0;
287 std::size_t
jAll = 0;
303 std::cout <<
"\n hessian = " << std::endl;
304 for (std::size_t i = 0; i <
getNDim(); ++i) {
306 std::cout << out[i *
n +
j] <<
", ";
308 std::cout << std::endl;
318 minim.SetHessianFunction(
319 std::bind(&RooMinimizerFcn::evaluateHessian,
this, std::placeholders::_1, std::placeholders::_2));
326 minuit2->SetSecondDerivativeAlwaysVanishesFunc(
337void RooMinimizerFcn::buildSecondDerivMask()
const
347 for (std::size_t i = 0; i <
nParams; ++i) {
350 for (std::size_t
j = 0;
j < i; ++
j) {
368bool RooMinimizerFcn::secondDerivativeAlwaysVanishes(
unsigned int i,
unsigned int j)
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
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2,...
Minuit2Minimizer class implementing the ROOT::Math::Minimizer interface for Minuit2 minimization algo...
const_iterator begin() const
const_iterator end() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
void treeNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool doBranch=true, bool doLeaf=true, bool valueOnly=false, bool recurseNonDerived=false) const
Fill supplied list with nodes of the arg tree, following all server links, starting with ourself as t...
void setConstant(bool value=true)
Abstract container object that can hold multiple RooAbsArg objects.
Abstract base class for objects that represent a real value and implements functionality common to al...
static void setHideOffset(bool flag)
Calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
Calculates the sum of the -(log) likelihoods of a set of RooAbsPfs that represent constraint function...
Wrapper class around ROOT::Math::Minimizer that provides a seamless interface between the minimizer f...
RooMinimizer::Config _cfg
Variable that can be changed from the outside.
double constraintSum(DoubleArray comp, unsigned int compSize)