#include <TFoamSampler.h>
Inheritance diagram for TFoamSampler:
Public Member Functions | |
TFoamSampler () | |
default constructor | |
virtual | ~TFoamSampler () |
virtual destructor | |
void | SetFunction (const ROOT::Math::IGenFunction &func) |
set the parent function distribution to use for random sampling (one dim case) | |
void | SetFunction (TF1 *pdf) |
set the Function using a TF1 pointer | |
bool | Init (const char *="") |
bool | Init (const ROOT::Math::DistSamplerOptions &opt) |
void | SetRandom (TRandom *r) |
void | SetSeed (unsigned int seed) |
TRandom * | GetRandom () |
bool | Sample (double *x) |
bool | SampleBin (double prob, double &value, double *error=0) |
TFoamSampler () | |
default constructor | |
virtual | ~TFoamSampler () |
virtual destructor | |
void | SetFunction (const ROOT::Math::IGenFunction &func) |
set the parent function distribution to use for random sampling (one dim case) | |
void | SetFunction (TF1 *pdf) |
set the Function using a TF1 pointer | |
bool | Init (const char *="") |
bool | Init (const ROOT::Math::DistSamplerOptions &opt) |
void | SetRandom (TRandom *r) |
void | SetSeed (unsigned int seed) |
TRandom * | GetRandom () |
bool | Sample (double *x) |
bool | SampleBin (double prob, double &value, double *error=0) |
Private Attributes | |
bool | fOneDim |
const ROOT::Math::IGenFunction * | fFunc1D |
TFoam * | fFoam |
TFoamIntegrand * | fFoamDist |
const ROOT::Math::IGenFunction * | fFunc1D |
TFoam * | fFoam |
TFoamIntegrand * | fFoamDist |
Definition at line 50 of file TFoamSampler.h.
TFoamSampler::TFoamSampler | ( | ) |
default constructor
TFoamSampler::~TFoamSampler | ( | ) | [virtual] |
TFoamSampler::TFoamSampler | ( | ) |
default constructor
virtual TFoamSampler::~TFoamSampler | ( | ) | [virtual] |
virtual destructor
void TFoamSampler::SetFunction | ( | const ROOT::Math::IGenFunction & | func | ) | [inline, virtual] |
set the parent function distribution to use for random sampling (one dim case)
Reimplemented from ROOT::Math::DistSampler.
Definition at line 65 of file TFoamSampler.h.
void TFoamSampler::SetFunction | ( | TF1 * | ) |
set the Function using a TF1 pointer
Definition at line 161 of file TFoamSampler.cxx.
References TFormula::GetNdim().
bool TFoamSampler::Init | ( | const char * | = "" |
) | [virtual] |
initialize the generators with the default options
Reimplemented from ROOT::Math::DistSampler.
Definition at line 103 of file TFoamSampler.cxx.
References ROOT::Math::DistSamplerOptions::FindDefault(), and ROOT::Math::DistSamplerOptions::SetExtraOptions().
bool TFoamSampler::Init | ( | const ROOT::Math::DistSamplerOptions & | opt | ) | [virtual] |
initialize the generators with the fiven options
Reimplemented from ROOT::Math::DistSampler.
Definition at line 112 of file TFoamSampler.cxx.
References Error, ROOT::Math::DistSamplerOptions::ExtraOptions(), fFoam, fFoamDist, ROOT::Math::IOptions::GetIntValue(), GetRandom(), ROOT::Math::IOptions::GetRealValue(), gRandom, TFoam::Initialize(), ROOT::Math::DistSampler::NDim(), ROOT::Math::DistSampler::ParentPdf(), ROOT::Math::DistSampler::PdfRange(), ROOT::Math::DistSamplerOptions::PrintLevel(), TFoam::SetChat(), TFoam::SetkDim(), TFoam::SetMaxWtRej(), TFoam::SetnBin(), TFoam::SetnCells(), TFoam::SetnSampl(), TFoam::SetOptDrive(), TFoam::SetOptRej(), SetRandom(), and TFoam::SetRho().
void TFoamSampler::SetRandom | ( | TRandom * | r | ) | [virtual] |
Set the random engine to be used Needs to be called before Init to have effect
Reimplemented from ROOT::Math::DistSampler.
Definition at line 166 of file TFoamSampler.cxx.
References fFoam, and TFoam::SetPseRan().
Referenced by Init().
void TFoamSampler::SetSeed | ( | unsigned int | seed | ) | [virtual] |
Set the random seed for the TRandom instances used by the sampler classes Needs to be called before Init to have effect
Reimplemented from ROOT::Math::DistSampler.
Definition at line 171 of file TFoamSampler.cxx.
References fFoam, and TFoam::GetPseRan().
TRandom * TFoamSampler::GetRandom | ( | ) | [virtual] |
Get the random engine used by the sampler
Reimplemented from ROOT::Math::DistSampler.
Definition at line 177 of file TFoamSampler.cxx.
References fFoam, and TFoam::GetPseRan().
Referenced by Init(), and SampleBin().
bool TFoamSampler::Sample | ( | double * | x | ) | [virtual] |
sample one event in multi-dimension by filling the given array return false if sampling failed
Implements ROOT::Math::DistSampler.
Definition at line 187 of file TFoamSampler.cxx.
References fFoam, fFoamDist, TFoam::GetMCvect(), i, TFoam::MakeEvent(), and ROOT::Math::DistSampler::NDim().
sample one bin given an estimated of the pdf in the bin (this can be function value at the center or its integral in the bin divided by the bin width) By default do not do random sample, just return the function values
Reimplemented from ROOT::Math::DistSampler.
Definition at line 200 of file TFoamSampler.cxx.
References GetRandom(), and sqrt().
void TFoamSampler::SetFunction | ( | const ROOT::Math::IGenFunction & | func | ) | [inline, virtual] |
set the parent function distribution to use for random sampling (one dim case)
Reimplemented from ROOT::Math::DistSampler.
Definition at line 65 of file TFoamSampler.h.
bool TFoamSampler::Init | ( | const char * | = "" |
) | [virtual] |
initialize the generators with the default options
Reimplemented from ROOT::Math::DistSampler.
bool TFoamSampler::Init | ( | const ROOT::Math::DistSamplerOptions & | opt | ) | [virtual] |
initialize the generators with the fiven options
Reimplemented from ROOT::Math::DistSampler.
void TFoamSampler::SetRandom | ( | TRandom * | r | ) | [virtual] |
Set the random engine to be used Needs to be called before Init to have effect
Reimplemented from ROOT::Math::DistSampler.
void TFoamSampler::SetSeed | ( | unsigned int | seed | ) | [virtual] |
Set the random seed for the TRandom instances used by the sampler classes Needs to be called before Init to have effect
Reimplemented from ROOT::Math::DistSampler.
TRandom* TFoamSampler::GetRandom | ( | ) | [virtual] |
Get the random engine used by the sampler
Reimplemented from ROOT::Math::DistSampler.
bool TFoamSampler::Sample | ( | double * | x | ) | [virtual] |
sample one event in multi-dimension by filling the given array return false if sampling failed
Implements ROOT::Math::DistSampler.
sample one bin given an estimated of the pdf in the bin (this can be function value at the center or its integral in the bin divided by the bin width) By default do not do random sample, just return the function values
Reimplemented from ROOT::Math::DistSampler.
bool TFoamSampler::fOneDim [private] |
Definition at line 126 of file TFoamSampler.h.
const ROOT::Math::IGenFunction* TFoamSampler::fFunc1D [private] |
TFoam* TFoamSampler::fFoam [private] |
Definition at line 132 of file TFoamSampler.h.
Referenced by GetRandom(), Init(), Sample(), SetRandom(), SetSeed(), and ~TFoamSampler().
TFoamIntegrand* TFoamSampler::fFoamDist [private] |
const ROOT::Math::IGenFunction* TFoamSampler::fFunc1D [private] |
Definition at line 131 of file TFoamSampler.h.
TFoam* TFoamSampler::fFoam [private] |
Definition at line 132 of file TFoamSampler.h.
TFoamIntegrand* TFoamSampler::fFoamDist [private] |
Definition at line 133 of file TFoamSampler.h.