TFoamSampler Class Reference

#include <TFoamSampler.h>

Inheritance diagram for TFoamSampler:

ROOT::Math::DistSampler ROOT::Math::DistSampler List of all members.

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)
TRandomGetRandom ()
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)
TRandomGetRandom ()
bool Sample (double *x)
bool SampleBin (double prob, double &value, double *error=0)

Private Attributes

bool fOneDim
const ROOT::Math::IGenFunctionfFunc1D
TFoamfFoam
TFoamIntegrandfFoamDist
const ROOT::Math::IGenFunctionfFunc1D
TFoamfFoam
TFoamIntegrandfFoamDist

Detailed Description

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

Definition at line 50 of file TFoamSampler.h.


Constructor & Destructor Documentation

TFoamSampler::TFoamSampler (  ) 

default constructor

TFoamSampler::~TFoamSampler (  )  [virtual]

virtual destructor

Definition at line 97 of file TFoamSampler.cxx.

References fFoam, and fFoamDist.

TFoamSampler::TFoamSampler (  ) 

default constructor

virtual TFoamSampler::~TFoamSampler (  )  [virtual]

virtual destructor


Member Function Documentation

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.

References fFunc1D, and func().

void TFoamSampler::SetFunction ( TF1 pdf  ) 

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().

bool TFoamSampler::SampleBin ( double  prob,
double value,
double error = 0 
) [virtual]

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.

References fFunc1D, and func().

void TFoamSampler::SetFunction ( TF1 pdf  ) 

set the Function using a TF1 pointer

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.

bool TFoamSampler::SampleBin ( double  prob,
double value,
double error = 0 
) [virtual]

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.


Member Data Documentation

bool TFoamSampler::fOneDim [private]

Definition at line 126 of file TFoamSampler.h.

const ROOT::Math::IGenFunction* TFoamSampler::fFunc1D [private]

Definition at line 131 of file TFoamSampler.h.

Referenced by SetFunction().

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]

Definition at line 133 of file TFoamSampler.h.

Referenced by Init(), Sample(), and ~TFoamSampler().

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.


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:37:53 2011 for ROOT_528-00b_version by  doxygen 1.5.1