Geant4-11
Functions
G4QuickRand.hh File Reference
#include "G4Types.hh"
#include <cstdint>

Go to the source code of this file.

Functions

G4double G4QuickRand ()
 

Function Documentation

◆ G4QuickRand()

G4double G4QuickRand ( )
inline

Definition at line 34 of file G4QuickRand.hh.

35{
36 static const G4double f = 1. / 4294967296.; // 2^-32
37
38 // Algorithm "xor" from p.4 of G.Marsaglia, "Xorshift RNGs"
39 static G4ThreadLocal uint32_t y = 2463534242;
40 uint32_t x = y;
41 x ^= x << 13;
42 x ^= x >> 17;
43 x ^= x << 5;
44 y = x;
45 return x * f;
46}
double G4double
Definition: G4Types.hh:83
#define G4ThreadLocal
Definition: tls.hh:77

References G4ThreadLocal.

Referenced by G4VSolid::EstimateCubicVolume(), G4VSolid::EstimateSurfaceArea(), G4BooleanSolid::GetPointOnSurface(), G4Box::GetPointOnSurface(), G4CutTubs::GetPointOnSurface(), G4Sphere::GetPointOnSurface(), G4Trap::GetPointOnSurface(), G4Trd::GetPointOnSurface(), G4Tubs::GetPointOnSurface(), G4Ellipsoid::GetPointOnSurface(), G4GenericPolycone::GetPointOnSurface(), G4Polycone::GetPointOnSurface(), G4Polyhedra::GetPointOnSurface(), G4Tet::GetPointOnSurface(), and G4CSGSolid::GetRadiusInRing().