Interface to obtain tabulated random numbers. More...
#include <TabulatedRandomGenerator.h>
Public Member Functions | |
TabulatedRandomGenerator (TabulatedRngEngine &engine, int numChannels=1) | |
Constructor. | |
double | Gaus (int channel, double mean=0., double sigma=1.) const |
Obtain a random number following normal distribution with given parameters. | |
double | Rndm (int channel) const |
Obtain a random number uniformly distributed on [0, 1]. | |
Private Attributes | |
TabulatedRngEngine & | engine_ |
Underlying engine. | |
int | numChannels_ |
Number of channels used by this generator. | |
int | offset_ |
Offset returned by TabulatedRngEngine::Register. |
Interface to obtain tabulated random numbers.
Uses TabulatedRngEngine. The number of random numbers consumed per event (number of channels) is a parameter of an object of this class. All methods that return random numbers accept the channel as the first argument; if it is larger or equal than the requested number of channels, it is silently wrapped around.
TabulatedRandomGenerator::TabulatedRandomGenerator | ( | TabulatedRngEngine & | engine, | |
int | numChannels = 1 | |||
) |
Constructor.
[in] | engine | Engine to be used. A reference is saved internally. |
[in] | numChannels | (Maximal) number of different random numbers consumed per event. |