Function RMGGeneratorUtil::rand(const G4Box *, bool)

Function Documentation

G4ThreeVector RMGGeneratorUtil::rand(const G4Box*, bool on_surface = false)

Generate a random point in or on the surface of a G4Box.

Calculates a random 3D point either inside the box or on one of its surfaces.

Parameters:
  • box – Pointer to the G4Box.

  • on_surface – If true, the point lies on the box’s surface; if false, it lies within the volume.

Returns:

A random point as G4ThreeVector.