ROOT logo
ROOT » MATH » FOAM » TFoamSampler

class TFoamSampler: public ROOT::Math::DistSampler


   TFoamSampler class
   class implementing  the ROOT::Math::DistSampler interface using FOAM
   for sampling arbitrary distributions.



Function Members (Methods)

public:
TFoamSampler()
TFoamSampler(const TFoamSampler&)
virtual~TFoamSampler()
virtual boolROOT::Math::DistSampler::Generate(unsigned int nevt, ROOT::Fit::UnBinData& data)
virtual boolROOT::Math::DistSampler::Generate(unsigned int nevt, const int* nbins, ROOT::Fit::BinData& data, bool extend = true)
boolROOT::Math::DistSampler::Generate(unsigned int nevt, int nbins, double xmin, double xmax, ROOT::Fit::BinData& data, bool extend = true)
virtual TRandom*GetRandom()
virtual boolInit(const char* = "")
virtual boolInit(const ROOT::Math::DistSamplerOptions& opt)
unsigned intROOT::Math::DistSampler::NDim() const
const ROOT::Math::IMultiGenFunction&ROOT::Math::DistSampler::ParentPdf() const
virtual boolSample(double* x)
virtual doubleROOT::Math::DistSampler::Sample1D()
virtual boolSampleBin(double prob, double& value, double* error = 0)
virtual boolROOT::Math::DistSampler::SampleBins(unsigned int n, const double* prob, double* values, double* errors = 0)
virtual voidROOT::Math::DistSampler::SetArea(double)
virtual voidSetFunction(const ROOT::Math::IGenFunction& func)
voidSetFunction(TF1* pdf)
virtual voidROOT::Math::DistSampler::SetMode(double)
virtual voidSetRandom(TRandom* r)
voidROOT::Math::DistSampler::SetRange(const ROOT::Fit::DataRange& range)
voidROOT::Math::DistSampler::SetRange(const double* xmin, const double* xmax)
voidROOT::Math::DistSampler::SetRange(double xmin, double xmax, int icoord = 0)
virtual voidSetSeed(unsigned int seed)
protected:
virtual voidROOT::Math::DistSampler::DoSetFunction(const ROOT::Math::IMultiGenFunction& func, bool copy)
boolROOT::Math::DistSampler::IsInitialized()
const ROOT::Fit::DataRange&ROOT::Math::DistSampler::PdfRange() const

Data Members

private:
TFoam*fFoamfoam engine class
TFoamIntegrand*fFoamDistfoam distribution interface
const ROOT::Math::IBaseFunctionOneDim*fFunc1D1D function pointer
boolfOneDimflag to indicate if the function is 1 dimension

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TFoamSampler()
    fDiscrete(false),
    fHasMode(false), fHasArea(false),
    fMode(0), fArea(0),
{}
~TFoamSampler()
bool Init(const char* = "")
bool Init(const ROOT::Math::DistSamplerOptions& opt)
 initialize foam classes using the given algorithm
void SetFunction(TF1* pdf)
 set function from a TF1 pointer
void SetRandom(TRandom* r)
 set random generator (must be called before Init to have effect)
void SetSeed(unsigned int seed)
 set random generator seed (must be called before Init to have effect)
TRandom * GetRandom()
 get random generator used
bool Sample(double* x)
 sample multi-dim distributions
bool SampleBin(double prob, double& value, double* error = 0)
 sample a bin according to Poisson statistics
TFoamSampler()
 default constructor
void SetFunction(const ROOT::Math::IGenFunction& func)
 set the parent function distribution to use for random sampling (one dim case)