58 RooTFoamBinding(
const RooAbsReal &pdf,
const RooArgSet &observables)
59 : _binding(std::make_unique<RooRealBinding>(pdf, observables, &_nset, false, nullptr))
61 _nset.add(observables);
64 double Density(
Int_t ndim,
double *xvec)
override
67 for (
int i = 0;
i < ndim;
i++) {
68 x[
i] = xvec[
i] * (_binding->getMaxLimit(
i) - _binding->getMinLimit(
i)) + _binding->getMinLimit(
i);
70 double ret = (*_binding)(
x);
71 return ret < 0 ? 0 : ret;
74 RooRealBinding &binding() {
return *_binding; }
78 std::unique_ptr<RooRealBinding> _binding;
89 RooRealVar nSample(
"nSample",
"Number of samples per cell",200,0,1e6) ;
90 RooRealVar nCell1D(
"nCell1D",
"Number of cells for 1-dim generation",30,0,1e6) ;
91 RooRealVar nCell2D(
"nCell2D",
"Number of cells for 2-dim generation",500,0,1e6) ;
92 RooRealVar nCell3D(
"nCell3D",
"Number of cells for 3-dim generation",5000,0,1e6) ;
93 RooRealVar nCellND(
"nCellND",
"Number of cells for N-dim generation",10000,0,1e6) ;
94 RooRealVar chatLevel(
"chatLevel",
"TFOAM 'chat level' (verbosity)",0,0,2) ;
110 _tfoam = std::make_unique<TFoam>(
"TFOAM") ;
131 _xmin[
i] = var->getMin() ;
132 _range[
i] = var->getMax() - var->getMin() ;
143 if(event->size() == 1)
return event;
159 static const std::string
name =
"RooFoamGenerator";
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
double getRealValue(const char *name, double defVal=0.0, bool verbose=false) const
Get value of a RooAbsReal stored in set with given name.
RooArgSet _realVars
Set of real valued observabeles.
RooAbsReal * _funcClone
Pointer to top level node of cloned function.
std::unique_ptr< RooDataSet > _cache
Dataset holding generared values of observables.
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.
const RooArgSet * generateEvent(UInt_t remaining, double &resampleRatio) override
are we actually generating anything? (the cache always contains at least our function value)
std::vector< double > _xmin
Lower bound of observables to be generated ;.
RooFoamGenerator()=default
friend class RooNumGenFactory
std::vector< double > _range
Range of observables to be generated ;.
std::unique_ptr< TFoam > _tfoam
Instance of TFOAM generator.
std::unique_ptr< TFoamIntegrand > _binding
Binding of RooAbsReal to TFoam function interface.
std::string const & generatorName() const override
Return unique name of generator implementation.
std::vector< double > _vec
Transfer array for FOAM output.
static void registerSampler(RooNumGenFactory &fact)
Register RooIntegrator1D, is parameters and capabilities with RooNumIntFactory.
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
bool storeProtoSampler(RooAbsNumGenerator *proto, const RooArgSet &defConfig)
Method accepting registration of a prototype numeric integrator along with a RooArgSet of its default...
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
Abstract class representing n-dimensional real positive integrand function.