37 double mean,
double stdDev )
39 for(
double*
v = vect;
v != vect + size; ++
v )
44 const int size,
double* vect,
45 double mean,
double stdDev )
47 for(
double*
v = vect;
v != vect + size; ++
v )
48 *
v =
shoot(anEngine,mean,stdDev);
53 for(
double*
v = vect;
v != vect + size; ++
v )
58 double mean,
double stdDev )
60 for(
double*
v = vect;
v != vect + size; ++
v )
61 *
v =
fire( mean, stdDev );
74 #define Table0size 250
75 #define Table1size 1000
76 #define TableSize (Table0size+Table1size)
78 #define Table0step (2.0E-6)
79 #define Table1step (5.0E-4)
81 #define Table0scale (1.0/Table1step)
83 #define Table0offset 0
84 #define Table1offset (Table0size)
89 #include "CLHEP/Random/gaussQTables.cdat"
121 return (
float) (sign * ( y1 * dx + y0 * (1.0-dx) ));
150 for (
int i = 1; i < 50; i++ ) {
151 double vn2 = 1.0/(guess*guess);
152 double s1 = -13*11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2*vn2;
153 s1 += 11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2;
154 s1 += -9*7*5*3 * vn2*vn2*vn2*vn2*vn2;
155 s1 += 7*5*3 * vn2*vn2*vn2*vn2;
156 s1 += -5*3 * vn2*vn2*vn2;
157 s1 += 3 * vn2*vn2 - vn2 + 1.0;
158 v = std::sqrt ( 2.0 * std::log ( s1 / (r*guess*std::sqrt(
CLHEP::twopi)) ) );
159 if ( std::fabs(v-guess) < eps )
break;
167 int pr=os.precision(20);
168 os <<
" " <<
name() <<
"\n";
177 if (inName !=
name()) {
178 is.clear(std::ios::badbit | is.rdstate());
179 std::cerr <<
"Mismatch when expecting to read state of a "
180 <<
name() <<
" distribution\n"
181 <<
"Name found was " << inName
182 <<
"\nistream is left in the badbit state\n";
std::istream & get(std::istream &is)
HepRandomEngine & engine()
static double transformSmall(double r)
static double transformQuick(double r)
static const G4double eps
std::shared_ptr< HepRandomEngine > localEngine
HepRandomEngine & engine()
std::istream & get(std::istream &is)
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
static const double gaussTables[2 *TableSize]
std::ostream & put(std::ostream &os) const
static void shootArray(const int size, double *vect, double mean=0.0, double stdDev=1.0)
std::ostream & put(std::ostream &os) const
static constexpr double twopi
virtual double operator()()
void fireArray(const int size, double *vect)