Expand description
Beam divergence: the spread of incidence directions about the nominal beam direction, sampled on the per-particle random stream.
A divergence model gives each particle a deflection from the central
direction: a polar angle ϑ from it and an azimuth ψ about it. The
azimuth is uniform on [0, 2π) for both models, and the polar angle has:
Divergence::Gaussianwith standard deviationσ: the two angular deviations(ϑ cos ψ, ϑ sin ψ)in orthogonal planes through the central direction are independent normal variables of mean 0 and standard deviationσ. Changing the bivariate normal densityexp(-(ξ² + η²) / 2σ²) / (2π σ²) dξ dηto polar coordinates gives(1 / 2π) dψ · (ϑ / σ²) exp(-ϑ² / 2σ²) dϑ:ψuniform and independent ofϑ, andϑRayleigh distributed with CDFF(ϑ) = 1 - exp(-ϑ² / 2σ²). It is drawn by inversion,ϑ = σ sqrt(-2 ln(1 - U)). The angular deviations are treated as plane angles, which is the small-angle reading of a Gaussian divergence; a draw withϑ > πhas probabilityexp(-π² / 2σ²)and is still applied as a rotation byϑ.Divergence::UniformConewith half-angleα: directions uniform in solid angle inside the coneϑ <= α. The solid-angle element issin ϑ dϑ dψ, soF(ϑ) = (1 - cos ϑ) / (1 - cos α). Using1 - cos x = 2 sin²(x / 2), inversion givesϑ = 2 asin(sqrt(U) sin(α / 2)), which keeps full relative precision for small angles.
§Random numbers
Draws come from the caller’s generator, which for a transport run is the
particle’s own stream crate::rng::stream(seed, index), so the
result depends only on (seed, index) and not on the thread count. Each
sample takes exactly two 64-bit draws, in this order: U for the polar
angle, then V for the azimuth ψ = 2π V. Uniforms are the top 53 bits
of a draw scaled to [0, 1), as in crate::ion::bca.
Divergence::None takes no draws, so a beam without divergence leaves
the stream untouched.
The deflected direction is the central direction rotated by ϑ at
azimuth ψ with crate::ion::bca::kinematics::rotate; its azimuth
zero is a fixed, documented frame, which is immaterial because ψ is
uniform.
Enums§
- Divergence
- Beam divergence model.