30 #if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
31 !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
32 #define CLANG_NOSTDTLS
36 #if (defined(G4MULTITHREADED) && \
37 (!defined(G4USE_STD11) || (defined(CLANG_NOSTDTLS) || defined(__INTEL_COMPILER))))
66 for (
G4int i=0; i<size; ++i)
67 vect[i] =
shoot(mean,stdDev);
74 for (
G4int i=0; i<size; ++i)
75 vect[i] =
shoot(anEngine,mean,stdDev);
80 for (
G4int i=0; i<size; ++i)
87 for (
G4int i=0; i<size; ++i)
88 vect[i] =
fire( mean, stdDev );
101 #define Table0size 250
102 #define Table1size 1000
103 #define TableSize (Table0size+Table1size)
105 #define Table0step (2.0E-6)
106 #define Table1step (5.0E-4)
108 #define Table0scale (1.0/Table1step)
110 #define Table0offset 0
111 #define Table1offset (Table0size)
116 #include "gaussQTables.cdat"
146 G4double y0 = gaussTables [index++];
149 return (
G4float) (sign * ( y1 * dx + y0 * (1.0-dx) ));
178 for (
G4int i = 1; i < 50; i++ ) {
180 G4double s = -13*11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2*vn2;
181 s += 11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2;
182 s += -9*7*5*3 * vn2*vn2*vn2*vn2*vn2;
183 s += 7*5*3 * vn2*vn2*vn2*vn2;
184 s += -5*3 * vn2*vn2*vn2;
185 s += 3 * vn2*vn2 - vn2 + 1.0;
186 v = std::sqrt ( 2.0 * std::log ( s / (r*guess*std::sqrt(
CLHEP::twopi)) ) );
187 if ( std::fabs(v-guess) < eps )
break;
virtual ~G4MTRandGaussQ()
static const G4double eps
virtual G4double operator()()
G4MTRandGaussQ(CLHEP::HepRandomEngine &anEngine, G4double mean=0.0, G4double stdDev=1.0)
static G4double transformQuick(G4double r)
static G4double transformSmall(G4double r)
static const double gaussTables[2 *TableSize]
static void shootArray(const G4int size, G4double *vect, G4double mean=0.0, G4double stdDev=1.0)
void fireArray(const G4int size, G4double *vect)
static constexpr double twopi
CLHEP::HepRandomEngine * localEngine