Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFoamGenerator Class Reference

Class RooFoamGenerator is a generic toy monte carlo 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:

  • nCell[123N]D
  • nSample
  • chatLevel Access those using: myPdf->specialGeneratorConfig()->getConfigSection("RooFoamGenerator").setRealValue("nSample",1e4);
See also
rf902_numgenconfig.C

Definition at line 31 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)
 
 ~RooFoamGenerator () override
 Destructor.
 
bool canSampleCategories () const override
 
bool canSampleConditional () const override
 
RooAbsNumGeneratorclone (const RooAbsReal &func, const RooArgSet &genVars, const RooArgSet &, const RooNumGenConfig &config, bool verbose=false, const RooAbsReal *maxFuncVal=nullptr) const override
 
TFoamengine ()
 
const RooArgSetgenerateEvent (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

RooTFoamBinding * _binding = nullptr
 Binding of RooAbsReal to TFoam function interface.
 
double_range = nullptr
 Range of observables to be generated ;.
 
TFoam_tfoam = nullptr
 Instance of TFOAM generator.
 
double_vec = nullptr
 Transfer array for FOAM output.
 
double_xmin = nullptr
 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
 

#include </home/sftnight/build/workspace/root-makedoc-v630/rootspi/rdoc/src/v6-30-00-patches/roofit/roofitcore/src/RooFoamGenerator.h>

Inheritance diagram for RooFoamGenerator:
[legend]

Constructor & Destructor Documentation

◆ RooFoamGenerator() [1/2]

RooFoamGenerator::RooFoamGenerator ( )
default

◆ RooFoamGenerator() [2/2]

RooFoamGenerator::RooFoamGenerator ( const RooAbsReal func,
const RooArgSet genVars,
const RooNumGenConfig config,
bool  verbose = false,
const RooAbsReal maxFuncVal = nullptr 
)

Definition at line 81 of file RooFoamGenerator.cxx.

◆ ~RooFoamGenerator()

RooFoamGenerator::~RooFoamGenerator ( )
override

Destructor.

Definition at line 118 of file RooFoamGenerator.cxx.

Member Function Documentation

◆ canSampleCategories()

bool RooFoamGenerator::canSampleCategories ( ) const
inlineoverridevirtual

Reimplemented from RooAbsNumGenerator.

Definition at line 46 of file RooFoamGenerator.h.

◆ canSampleConditional()

bool RooFoamGenerator::canSampleConditional ( ) const
inlineoverridevirtual

Reimplemented from RooAbsNumGenerator.

Definition at line 45 of file RooFoamGenerator.h.

◆ clone()

RooAbsNumGenerator * RooFoamGenerator::clone ( const RooAbsReal func,
const RooArgSet genVars,
const RooArgSet ,
const RooNumGenConfig config,
bool  verbose = false,
const RooAbsReal maxFuncVal = nullptr 
) const
inlineoverridevirtual

Implements RooAbsNumGenerator.

Definition at line 35 of file RooFoamGenerator.h.

◆ engine()

TFoam & RooFoamGenerator::engine ( )
inline

Definition at line 43 of file RooFoamGenerator.h.

◆ generateEvent()

const RooArgSet * RooFoamGenerator::generateEvent ( UInt_t  remaining,
double resampleRatio 
)
overridevirtual

are we actually generating anything? (the cache always contains at least our function value)

Implements RooAbsNumGenerator.

Definition at line 132 of file RooFoamGenerator.cxx.

◆ generatorName()

std::string const & RooFoamGenerator::generatorName ( ) const
overridevirtual

Return unique name of generator implementation.

Implements RooAbsNumGenerator.

Definition at line 150 of file RooFoamGenerator.cxx.

◆ registerSampler()

void RooFoamGenerator::registerSampler ( RooNumGenFactory fact)
staticprotected

Register RooIntegrator1D, is parameters and capabilities with RooNumIntFactory.

Definition at line 62 of file RooFoamGenerator.cxx.

Friends And Related Symbol Documentation

◆ RooNumGenFactory

friend class RooNumGenFactory
friend

Definition at line 52 of file RooFoamGenerator.h.

Member Data Documentation

◆ _binding

RooTFoamBinding* RooFoamGenerator::_binding = nullptr
protected

Binding of RooAbsReal to TFoam function interface.

Definition at line 55 of file RooFoamGenerator.h.

◆ _range

double* RooFoamGenerator::_range = nullptr
protected

Range of observables to be generated ;.

Definition at line 58 of file RooFoamGenerator.h.

◆ _tfoam

TFoam* RooFoamGenerator::_tfoam = nullptr
protected

Instance of TFOAM generator.

Definition at line 56 of file RooFoamGenerator.h.

◆ _vec

double* RooFoamGenerator::_vec = nullptr
protected

Transfer array for FOAM output.

Definition at line 59 of file RooFoamGenerator.h.

◆ _xmin

double* RooFoamGenerator::_xmin = nullptr
protected

Lower bound of observables to be generated ;.

Definition at line 57 of file RooFoamGenerator.h.

  • roofit/roofitcore/src/RooFoamGenerator.h
  • roofit/roofitcore/src/RooFoamGenerator.cxx