45RooAbsNumGenerator::RooAbsNumGenerator() =
default;
55 _funcMaxVal(maxFuncVal), _verbose(
verbose)
60 if (nodes.snapshot(_cloneSet,
true)) {
61 oocoutE(
nullptr, Generation) <<
"RooAbsNumGenerator::RooAbsNumGenerator(" << func.
GetName() <<
") Couldn't deep-clone function, abort," << std::endl ;
75 if(!arg->isFundamental()) {
76 oocoutE(
nullptr, Generation) << func.
GetName() <<
"::RooAbsNumGenerator: cannot generate values for derived \""
77 << arg->GetName() <<
"\"" << std::endl;
82 found= (
const RooAbsArg*)_cloneSet.find(arg->GetName());
87 arg= _cloneSet.addClone(*arg);
89 assert(
nullptr != arg);
93 if(
nullptr != catVar) {
94 _catVars.add(*catVar);
96 else if(
nullptr != realVar) {
98 _realVars.add(*realVar);
101 oocoutE(
nullptr, Generation) << func.
GetName() <<
"::RooAbsNumGenerator: cannot generate values for \""
102 << realVar->
GetName() <<
"\" with unbound range" << std::endl;
107 oocoutE(
nullptr, Generation) << func.
GetName() <<
"::RooAbsNumGenerator" <<
": cannot generate values for \""
108 << arg->GetName() <<
"\" with unexpected type" << std::endl;
113 oocoutE(
nullptr, Generation) << func.
GetName() <<
"::RooAbsNumGenerator" <<
": constructor failed with errors" << std::endl;
118 _funcValStore= std::unique_ptr<RooAbsArg>{_funcClone->createFundamental()};
122 cacheArgs.add(_realVars);
123 cacheArgs.add(*_funcValStore);
124 _cache= std::make_unique<RooDataSet>(
"cache",
"Accept-Reject Event Cache",cacheArgs);
128 assert(
nullptr != cacheVars);
129 _funcClone->recursiveRedirectServers(*cacheVars,
false);
133 _catVars.replace(*dataVars);
134 _realVars.replace(*dataVars);
137 _funcValPtr=
static_cast<RooRealVar*
>(dataVars->
find(_funcValStore->GetName()));
142RooAbsNumGenerator::~RooAbsNumGenerator() =
default;
148void RooAbsNumGenerator::attachParameters(
const RooArgSet& vars)
151 newParams.remove(*_cache->get(),
true,
true) ;
152 _funcClone->recursiveRedirectServers(newParams) ;
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Storage_t const & get() const
Const access to the underlying stl container.
RooAbsArg * find(const char *name) const
Find object with given name in list.
bool hasMax(const char *name=nullptr) const
Check if variable has an upper bound.
bool hasMin(const char *name=nullptr) const
Check if variable has a lower bound.
Abstract base class for objects that represent a real value and implements functionality common to al...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
static void softAbort()
Soft abort function that interrupts macro execution but doesn't kill ROOT.
Variable that can be changed from the outside.
const char * GetName() const override
Returns name of object.