43RooAbsNumGenerator::RooAbsNumGenerator() =
default;
53 _funcMaxVal(maxFuncVal), _verbose(
verbose)
58 if (nodes.snapshot(_cloneSet,
true)) {
59 oocoutE(
nullptr, Generation) <<
"RooAbsNumGenerator::RooAbsNumGenerator(" << func.
GetName() <<
") Couldn't deep-clone function, abort," << std::endl ;
73 if(!arg->isFundamental()) {
74 oocoutE(
nullptr, Generation) << func.
GetName() <<
"::RooAbsNumGenerator: cannot generate values for derived \""
75 << arg->GetName() <<
"\"" << std::endl;
80 found= (
const RooAbsArg*)_cloneSet.find(arg->GetName());
85 arg= _cloneSet.addClone(*arg);
87 assert(
nullptr != arg);
91 if(
nullptr != catVar) {
92 _catVars.add(*catVar);
94 else if(
nullptr != realVar) {
96 _realVars.add(*realVar);
99 oocoutE(
nullptr, Generation) << func.
GetName() <<
"::RooAbsNumGenerator: cannot generate values for \""
100 << realVar->
GetName() <<
"\" with unbound range" << std::endl;
105 oocoutE(
nullptr, Generation) << func.
GetName() <<
"::RooAbsNumGenerator" <<
": cannot generate values for \""
106 << arg->GetName() <<
"\" with unexpected type" << std::endl;
111 oocoutE(
nullptr, Generation) << func.
GetName() <<
"::RooAbsNumGenerator" <<
": constructor failed with errors" << std::endl;
116 _funcValStore= std::unique_ptr<RooAbsArg>{_funcClone->createFundamental()};
120 cacheArgs.add(_realVars);
121 cacheArgs.add(*_funcValStore);
122 _cache= std::make_unique<RooDataSet>(
"cache",
"Accept-Reject Event Cache",cacheArgs);
126 assert(
nullptr != cacheVars);
127 _funcClone->recursiveRedirectServers(*cacheVars,
false);
131 _catVars.replace(*dataVars);
132 _realVars.replace(*dataVars);
135 _funcValPtr=
static_cast<RooRealVar*
>(dataVars->
find(_funcValStore->GetName()));
140RooAbsNumGenerator::~RooAbsNumGenerator() =
default;
146void RooAbsNumGenerator::attachParameters(
const RooArgSet& vars)
149 newParams.remove(*_cache->get(),
true,
true) ;
150 _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.