WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
WireCell::Gen::Random Class Reference

#include <Random.h>

Inheritance diagram for WireCell::Gen::Random:
Collaboration diagram for WireCell::Gen::Random:

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

Additional Inherited Members

- Public Types inherited from WireCell::IComponent< IRandom >
typedef std::shared_ptr< IRandompointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 
- Public Types inherited from WireCell::IComponent< IConfigurable >
typedef std::shared_ptr< IConfigurablepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 

Detailed Description

Definition at line 14 of file Random.h.

Constructor & Destructor Documentation

◆ Random()

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.

◆ ~Random()

virtual WireCell::Gen::Random::~Random ( )
inlinevirtual

Definition at line 18 of file Random.h.

Here is the call graph for this function:

Member Function Documentation

◆ binomial()

int Gen::Random::binomial ( int  max,
double  prob 
)
virtual

Sample a binomial distribution.

Implements WireCell::IRandom.

Definition at line 109 of file Random.cxx.

Here is the caller graph for this function:

◆ configure()

void Gen::Random::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 71 of file Random.cxx.

Here is the caller graph for this function:

◆ default_configuration()

WireCell::Configuration Gen::Random::default_configuration ( ) const
virtual

Optional, override to return a hard-coded default configuration.

Reimplemented from WireCell::IConfigurable.

Definition at line 97 of file Random.cxx.

Here is the caller graph for this function:

◆ exponential()

double Gen::Random::exponential ( double  mean)
virtual

Sample an exponential distribution.

Implements WireCell::IRandom.

Definition at line 128 of file Random.cxx.

Here is the caller graph for this function:

◆ normal()

double Gen::Random::normal ( double  mean,
double  sigma 
)
virtual

Sample a normal distribution.

Implements WireCell::IRandom.

Definition at line 118 of file Random.cxx.

Here is the caller graph for this function:

◆ poisson()

int Gen::Random::poisson ( double  mean)
virtual

Sample a Poisson distribution.

Implements WireCell::IRandom.

Definition at line 113 of file Random.cxx.

Here is the caller graph for this function:

◆ range()

int Gen::Random::range ( int  first,
int  last 
)
virtual

Sample a uniform integer range.

Implements WireCell::IRandom.

Definition at line 133 of file Random.cxx.

Here is the caller graph for this function:

◆ uniform()

double Gen::Random::uniform ( double  begin,
double  end 
)
virtual

Sample a uniform distribution.

Implements WireCell::IRandom.

Definition at line 123 of file Random.cxx.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: