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

Function Documentation

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

Generate a random 3D point within or on the surface of the given solid.

For a generic G4VSolid, this function delegates to the appropriate specialized function based on the solid’s type.

Parameters:
  • solid – Pointer to the Geant4 solid.

  • on_surface – If true, sample a point on the surface; otherwise, inside the solid.

Returns:

A random point as G4ThreeVector.