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

Function Documentation

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

Generate a random point in or on the surface of a G4Tubs (cylindrical tube).

Handles random point generation for cylindrical shapes, accounting for inner and outer radii.

Parameters:
  • tub – Pointer to the G4Tubs.

  • on_surface – If true, sample on the surface; if false, sample within the volume.

Returns:

A random point as G4ThreeVector.