pub struct MomentumTransferSampler { /* private fields */ }Expand description
Samples the momentum transfer q of an inelastic collision with incident
kinetic energy E and loss W (module docs). Built once per (E, W).
Implementations§
Source§impl MomentumTransferSampler
impl MomentumTransferSampler
Sourcepub fn new(
penn: &SinglePolePenn,
energy_ev: f64,
loss_ev: f64,
) -> Result<Self, InelasticTableError>
pub fn new( penn: &SinglePolePenn, energy_ev: f64, loss_ev: f64, ) -> Result<Self, InelasticTableError>
Build the sampler with the default tolerance DEFAULT_Q_TOLERANCE.
Sourcepub fn with_tolerance(
penn: &SinglePolePenn,
energy_ev: f64,
loss_ev: f64,
tol: f64,
) -> Result<Self, InelasticTableError>
pub fn with_tolerance( penn: &SinglePolePenn, energy_ev: f64, loss_ev: f64, tol: f64, ) -> Result<Self, InelasticTableError>
Build the sampler with density-model tolerance tol in
[1e-9, 1e-2]. Fails if 0 < W <= E does not hold or the slice has
no support (W below the ELF table, or no q allowed).
Sourcepub fn sample(&self, u: f64) -> f64
pub fn sample(&self, u: f64) -> f64
The momentum transfer (as a wavenumber, m⁻¹) at cumulative
probability u in [0, 1] (clamped).
Sourcepub fn q_range_per_m(&self) -> (f64, f64)
pub fn q_range_per_m(&self) -> (f64, f64)
The support (q_min, q_max) of the sampler, m⁻¹: the kinematic
limits q± cut to the tabulated ELF range.
Sourcepub fn kinematic_limits_per_m(&self) -> (f64, f64)
pub fn kinematic_limits_per_m(&self) -> (f64, f64)
The kinematic limits q- = k - k' and q+ = k + k', m⁻¹.
Sourcepub fn cos_theta(&self, q_per_m: f64) -> f64
pub fn cos_theta(&self, q_per_m: f64) -> f64
The cosine of the primary’s deflection angle for momentum transfer
q (m⁻¹), (k² + k'² - q²)/(2 k k'), clamped to [-1, 1].
Sourcepub fn diimfp_per_m_ev(&self) -> f64
pub fn diimfp_per_m_ev(&self) -> f64
The DIIMFP p(E, W) (m⁻¹ eV⁻¹) of the sampler’s own density model:
the integral of the density over ln q, divided by π T'. It agrees
with SinglePolePenn::diimfp_per_m_ev to the model tolerance.
Trait Implementations§
Source§impl Clone for MomentumTransferSampler
impl Clone for MomentumTransferSampler
Source§fn clone(&self) -> MomentumTransferSampler
fn clone(&self) -> MomentumTransferSampler
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MomentumTransferSampler
impl Debug for MomentumTransferSampler
Source§impl PartialEq for MomentumTransferSampler
impl PartialEq for MomentumTransferSampler
impl StructuralPartialEq for MomentumTransferSampler
Auto Trait Implementations§
impl Freeze for MomentumTransferSampler
impl RefUnwindSafe for MomentumTransferSampler
impl Send for MomentumTransferSampler
impl Sync for MomentumTransferSampler
impl Unpin for MomentumTransferSampler
impl UnsafeUnpin for MomentumTransferSampler
impl UnwindSafe for MomentumTransferSampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more