Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4QuickRand.hh File Reference
#include "G4Types.hh"
#include <cstdint>

Go to the source code of this file.

Functions

G4double G4QuickRand (uint32_t seed=0)

Function Documentation

◆ G4QuickRand()

G4double G4QuickRand ( uint32_t seed = 0)
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 = uint32_t(seed == 0) * y + seed;
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

Referenced by G4VSolid::EstimateCubicVolume(), G4VSolid::EstimateSurfaceArea(), G4VSceneHandler::GetPointInBox(), G4VSceneHandler::GetPointInTet(), G4PolyconeSide::GetPointOnFace(), G4QuadrangularFacet::GetPointOnFace(), G4TriangularFacet::GetPointOnFace(), G4BooleanSolid::GetPointOnSurface(), G4Box::GetPointOnSurface(), G4CutTubs::GetPointOnSurface(), G4Ellipsoid::GetPointOnSurface(), G4EllipticalCone::GetPointOnSurface(), G4EllipticalTube::GetPointOnSurface(), G4GenericPolycone::GetPointOnSurface(), G4GenericTrap::GetPointOnSurface(), G4Hype::GetPointOnSurface(), G4MultiUnion::GetPointOnSurface(), G4Orb::GetPointOnSurface(), G4Para::GetPointOnSurface(), G4Paraboloid::GetPointOnSurface(), G4Polycone::GetPointOnSurface(), G4Polyhedra::GetPointOnSurface(), G4Sphere::GetPointOnSurface(), G4TessellatedSolid::GetPointOnSurface(), G4Tet::GetPointOnSurface(), G4Torus::GetPointOnSurface(), G4Trap::GetPointOnSurface(), G4Trd::GetPointOnSurface(), G4Tubs::GetPointOnSurface(), G4TwistedTubs::GetPointOnSurface(), G4VTwistedFaceted::GetPointOnSurface(), G4VCSGfaceted::GetPointOnSurfaceGeneric(), G4CSGSolid::GetRadiusInRing(), and G4VSceneHandler::RequestPrimitives().