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 ()
 
 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 ()
 Destructor.
 
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
 Binding of RooAbsReal to TFoam function interface.
 
double_range
 Range of observables to be generated ;.
 
TFoam_tfoam
 Instance of TFOAM generator.
 
double_vec
 Transfer array for FOAM output.
 
double_xmin
 Lower bound of observables to be generated ;.
 
- Protected Attributes inherited from RooAbsNumGenerator
RooDataSet_cache
 Dataset holding generared values of observables.
 
RooArgSet _catVars
 
RooArgSet_cloneSet
 Set owning clone of input function.
 
RooAbsReal_funcClone
 Pointer to top level node of cloned function.
 
const RooAbsReal_funcMaxVal
 Container for maximum function value.
 
RooRealVar_funcValPtr
 RRVs storing function value in context and in output dataset.
 
RooRealVar_funcValStore
 
bool _isValid
 Verbose and valid flag.
 
RooArgSet _realVars
 Sets of discrete and real valued observabeles.
 
bool _verbose
 

Friends

class RooNumGenFactory
 

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

Inheritance diagram for RooFoamGenerator:
[legend]

Constructor & Destructor Documentation

◆ RooFoamGenerator() [1/2]

RooFoamGenerator::RooFoamGenerator ( )
inline

Definition at line 33 of file RooFoamGenerator.h.

◆ 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
protected

Binding of RooAbsReal to TFoam function interface.

Definition at line 55 of file RooFoamGenerator.h.

◆ _range

double* RooFoamGenerator::_range
protected

Range of observables to be generated ;.

Definition at line 58 of file RooFoamGenerator.h.

◆ _tfoam

TFoam* RooFoamGenerator::_tfoam
protected

Instance of TFOAM generator.

Definition at line 56 of file RooFoamGenerator.h.

◆ _vec

double* RooFoamGenerator::_vec
protected

Transfer array for FOAM output.

Definition at line 59 of file RooFoamGenerator.h.

◆ _xmin

double* RooFoamGenerator::_xmin
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