7 #ifndef ICARUSALG_UTILITIES_RANDFASTGAUS_H
8 #define ICARUSALG_UTILITIES_RANDFASTGAUS_H
15 #include "CLHEP/Random/Random.h"
16 #include "CLHEP/Random/RandomEngine.h"
23 namespace util {
class RandFastGauss; }
38 CLHEP::HepRandomEngine& anEngine,
39 double mean = 0.0,
double stdDev = 1.0
49 CLHEP::HepRandomEngine* anEngine,
50 double mean = 0.0,
double stdDev = 1.0
54 static double shoot();
56 static double shoot(
double mean,
double stdDev);
59 (
const int size,
double* vect,
double mean = 0.0,
double stdDev = 1.0);
61 static double shoot(CLHEP::HepRandomEngine* anEngine);
64 (CLHEP::HepRandomEngine* anEngine,
double mean,
double stdDev);
66 static void shootArray(CLHEP::HepRandomEngine* anEngine,
67 const int size,
double* vect,
double mean = 0.0,
double stdDev = 1.0);
78 void fireArray(
const int size,
double* vect);
79 void fireArray(
const int size,
double* vect,
double mean,
double stdDev);
98 virtual std::ostream&
put(std::ostream& os)
const override
100 virtual std::istream&
get(std::istream& is)
override
149 CLHEP::HepRandomEngine& anEngine,
150 double mean ,
double stdDev
160 CLHEP::HepRandomEngine* anEngine,
161 double mean ,
double stdDev
172 #endif // ICARUSALG_UTILITIES_RANDFASTGAUS_H
Fast approximate Gaussian random translator.
BEGIN_PROLOG could also be dds filename
virtual std::ostream & put(std::ostream &os) const override
static std::ostream & saveFullState(std::ostream &os)
double operator()(double mean, double stdDev)
Extracts a single normal value under the specified normal distribution.
static void shootArray(const int size, double *vect, double mean=0.0, double stdDev=1.0)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
static std::string distributionName()
Returns the name of the distribution.
double fire(double mean, double stdDev)
Extracts a single normal value under the specified normal distribution.
util::GaussianTransformer< double > fTransform
RandFastGauss(CLHEP::HepRandomEngine &anEngine, double mean=0.0, double stdDev=1.0)
Constructor: borrows an engine but does not manage it.
util::FastAndPoorGauss< 32768U > fToGauss
Translates uniform number in [ 0, 1 ] into a Gaussian number.
static std::ostream & saveDistState(std::ostream &os)
virtual double operator()() override
Extracts a single normal value under the default distribution.
static std::istream & restoreDistState(std::istream &is)
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Normal distribution focussing on speed.
void fireArray(const int size, double *vect)
virtual CLHEP::HepRandomEngine & engine() override
Returns the default random generator engine.
static void restoreEngineStatus(const char filename[]="Config.conf")
virtual std::string name() const override
Returns the name of the distribution.
static void saveEngineStatus(const char filename[]="Config.conf")
double fire()
Extracts a single normal value under the default distribution.
std::shared_ptr< CLHEP::HepRandomEngine > localEngine
static std::istream & restoreFullState(std::istream &is)