#include <Random.h>
Public Member Functions | |
Random (const std::string &generator="default", const std::vector< unsigned int > seeds={0, 0, 0, 0, 0}) | |
virtual | ~Random () |
virtual void | configure (const WireCell::Configuration &config) |
Accept a configuration. More... | |
virtual WireCell::Configuration | default_configuration () const |
Optional, override to return a hard-coded default configuration. More... | |
virtual int | binomial (int max, double prob) |
Sample a binomial distribution. More... | |
virtual int | poisson (double mean) |
Sample a Poisson distribution. More... | |
virtual double | normal (double mean, double sigma) |
Sample a normal distribution. More... | |
virtual double | uniform (double begin, double end) |
Sample a uniform distribution. More... | |
virtual double | exponential (double mean) |
Sample an exponential distribution. More... | |
virtual int | range (int first, int last) |
Sample a uniform integer range. More... | |
Public Member Functions inherited from WireCell::IRandom | |
virtual | ~IRandom () |
Public Member Functions inherited from WireCell::IComponent< IRandom > | |
virtual | ~IComponent () |
Public Member Functions inherited from WireCell::Interface | |
virtual | ~Interface () |
Public Member Functions inherited from WireCell::IConfigurable | |
virtual | ~IConfigurable () |
Public Member Functions inherited from WireCell::IComponent< IConfigurable > | |
virtual | ~IComponent () |
Private Attributes | |
std::string | m_generator |
std::vector< unsigned int > | m_seeds |
IRandom * | m_pimpl |
Additional Inherited Members | |
Public Types inherited from WireCell::IComponent< IRandom > | |
typedef std::shared_ptr< IRandom > | pointer |
Access subclass facet by pointer. More... | |
typedef std::vector< pointer > | vector |
Vector of shared pointers. More... | |
Public Types inherited from WireCell::Interface | |
typedef std::shared_ptr< Interface > | pointer |
Public Types inherited from WireCell::IComponent< IConfigurable > | |
typedef std::shared_ptr< IConfigurable > | pointer |
Access subclass facet by pointer. More... | |
typedef std::vector< pointer > | vector |
Vector of shared pointers. More... | |
Gen::Random::Random | ( | const std::string & | generator = "default" , |
const std::vector< unsigned int > | seeds = {0,0,0,0,0} |
||
) |
Definition at line 25 of file Random.cxx.
|
inlinevirtual |
|
virtual |
Sample a binomial distribution.
Implements WireCell::IRandom.
Definition at line 109 of file Random.cxx.
|
virtual |
Accept a configuration.
Implements WireCell::IConfigurable.
Definition at line 71 of file Random.cxx.
|
virtual |
Optional, override to return a hard-coded default configuration.
Reimplemented from WireCell::IConfigurable.
Definition at line 97 of file Random.cxx.
|
virtual |
Sample an exponential distribution.
Implements WireCell::IRandom.
Definition at line 128 of file Random.cxx.
|
virtual |
Sample a normal distribution.
Implements WireCell::IRandom.
Definition at line 118 of file Random.cxx.
|
virtual |
Sample a Poisson distribution.
Implements WireCell::IRandom.
Definition at line 113 of file Random.cxx.
|
virtual |
Sample a uniform integer range.
Implements WireCell::IRandom.
Definition at line 133 of file Random.cxx.
|
virtual |
Sample a uniform distribution.
Implements WireCell::IRandom.
Definition at line 123 of file Random.cxx.
|
private |
|
private |