Generic Monte Carlo toy generator that implement the TFOAM sampling technique on any positively valued function.
The RooFoamGenerator generator is used by the various generator context classes to take care of generation of observables for which p.d.fs do not define internal methods.
The foam generator reacts to the following config options:
Definition at line 32 of file RooFoamGenerator.h.
Public Member Functions | |
RooFoamGenerator ()=default | |
RooFoamGenerator (const RooAbsReal &func, const RooArgSet &genVars, const RooNumGenConfig &config, bool verbose=false, const RooAbsReal *maxFuncVal=nullptr) | |
bool | canSampleCategories () const override |
bool | canSampleConditional () const override |
RooAbsNumGenerator * | clone (const RooAbsReal &func, const RooArgSet &genVars, const RooArgSet &, const RooNumGenConfig &config, bool verbose=false, const RooAbsReal *maxFuncVal=nullptr) const override |
TFoam & | engine () |
const RooArgSet * | generateEvent (UInt_t remaining, double &resampleRatio) override |
are we actually generating anything? (the cache always contains at least our function value) | |
std::string const & | generatorName () const override |
Return unique name of generator implementation. | |
Public Member Functions inherited from RooAbsNumGenerator | |
RooAbsNumGenerator () | |
RooAbsNumGenerator (const RooAbsReal &func, const RooArgSet &genVars, bool verbose=false, const RooAbsReal *maxFuncVal=nullptr) | |
Initialize an accept-reject generator for the specified distribution function, which must be non-negative but does not need to be normalized over the variables to be generated, genVars. | |
virtual | ~RooAbsNumGenerator () |
void | attachParameters (const RooArgSet &vars) |
Reattach original parameters to function clone. | |
virtual double | getFuncMax () |
bool | isValid () const |
bool | isVerbose () const |
void | setVerbose (bool verbose=true) |
Static Protected Member Functions | |
static void | registerSampler (RooNumGenFactory &fact) |
Register RooIntegrator1D, is parameters and capabilities with RooNumIntFactory. | |
Protected Attributes | |
std::unique_ptr< TFoamIntegrand > | _binding |
Binding of RooAbsReal to TFoam function interface. | |
std::vector< double > | _range |
Range of observables to be generated ;. | |
std::unique_ptr< TFoam > | _tfoam |
Instance of TFOAM generator. | |
std::vector< double > | _vec |
Transfer array for FOAM output. | |
std::vector< double > | _xmin |
Lower bound of observables to be generated ;. | |
Protected Attributes inherited from RooAbsNumGenerator | |
std::unique_ptr< RooDataSet > | _cache |
Dataset holding generared values of observables. | |
RooArgSet | _catVars |
Set of discrete observabeles. | |
RooArgSet | _cloneSet |
Set owning clone of input function. | |
RooAbsReal * | _funcClone = nullptr |
Pointer to top level node of cloned function. | |
const RooAbsReal * | _funcMaxVal = nullptr |
Container for maximum function value. | |
RooRealVar * | _funcValPtr = nullptr |
RRV storing function value in output dataset. | |
std::unique_ptr< RooAbsArg > | _funcValStore |
RRV storing function value in context. | |
bool | _isValid = false |
Valid flag. | |
RooArgSet | _realVars |
Set of real valued observabeles. | |
bool | _verbose = false |
Verbose flag. | |
Friends | |
class | RooNumGenFactory |
|
default |
RooFoamGenerator::RooFoamGenerator | ( | const RooAbsReal & | func, |
const RooArgSet & | genVars, | ||
const RooNumGenConfig & | config, | ||
bool | verbose = false , |
||
const RooAbsReal * | maxFuncVal = nullptr |
||
) |
Definition at line 105 of file RooFoamGenerator.cxx.
|
inlineoverridevirtual |
Reimplemented from RooAbsNumGenerator.
Definition at line 46 of file RooFoamGenerator.h.
|
inlineoverridevirtual |
Reimplemented from RooAbsNumGenerator.
Definition at line 45 of file RooFoamGenerator.h.
|
inlineoverridevirtual |
Implements RooAbsNumGenerator.
Definition at line 36 of file RooFoamGenerator.h.
|
inline |
Definition at line 43 of file RooFoamGenerator.h.
|
overridevirtual |
are we actually generating anything? (the cache always contains at least our function value)
Implements RooAbsNumGenerator.
Definition at line 140 of file RooFoamGenerator.cxx.
|
overridevirtual |
Return unique name of generator implementation.
Implements RooAbsNumGenerator.
Definition at line 158 of file RooFoamGenerator.cxx.
|
staticprotected |
Register RooIntegrator1D, is parameters and capabilities with RooNumIntFactory.
Definition at line 86 of file RooFoamGenerator.cxx.
|
friend |
Definition at line 52 of file RooFoamGenerator.h.
|
protected |
Binding of RooAbsReal to TFoam function interface.
Definition at line 55 of file RooFoamGenerator.h.
|
protected |
Range of observables to be generated ;.
Definition at line 58 of file RooFoamGenerator.h.
|
protected |
Instance of TFOAM generator.
Definition at line 56 of file RooFoamGenerator.h.
|
protected |
Transfer array for FOAM output.
Definition at line 59 of file RooFoamGenerator.h.
|
protected |
Lower bound of observables to be generated ;.
Definition at line 57 of file RooFoamGenerator.h.