pub struct IkedaCarpenterParams {
pub alpha: EnergyLaw,
pub beta: EnergyLaw,
pub r: EnergyLaw,
pub burst_sigma_us: Option<f64>,
pub channel_fwhm_us: Option<f64>,
pub detector_tail: Option<DetectorTail>,
}Expand description
Parameters of the Ikeda–Carpenter resolution model.
Fields§
§alpha: EnergyLawFast (slowing-down) rate α(E), 1/µs. Must evaluate to at least
1e-9.
beta: EnergyLawSlow (storage) rate β(E), 1/µs. Must evaluate to at least 1e-9.
r: EnergyLawStorage mixing fraction R(E), 0 ≤ R ≤ 1.
burst_sigma_us: Option<f64>Optional proton-burst Gaussian standard deviation (µs); refused in detector time.
channel_fwhm_us: Option<f64>Optional chopper/channel triangle FWHM (µs).
detector_tail: Option<DetectorTail>Optional detector tail; detector time only, refused by the kernel table.
Implementations§
Source§impl IkedaCarpenterParams
impl IkedaCarpenterParams
Sourcepub fn constant(alpha: f64, beta: f64, r: f64) -> Self
pub fn constant(alpha: f64, beta: f64, r: f64) -> Self
A pure-moderator parameter set (no burst, no channel) with constant rates — the simplest case, useful for fixed-parameter or unit-test use.
Sourcepub fn delays_us(
&self,
energy_ev: f64,
) -> Result<(f64, f64), ResolutionParseError>
pub fn delays_us( &self, energy_ev: f64, ) -> Result<(f64, f64), ResolutionParseError>
The first and last delay, in µs after the nominal arrival, of a
neutron of energy_ev, outside which IkedaCarpenter::detector_bin_probabilities
gives it less than NEGLIGIBLE_ARRIVAL_PROBABILITY chance of
arriving: the triangle’s half-base before 0, and that half-base after
the delay where the chance of a later record without the triangle
falls to that chance.
§Errors
ResolutionParseError::InvalidFormat when energy_ev is not
positive and finite, a law is singular or out of range there, the
pulse has a Gaussian burst, or its detector tail is out of range.
Sourcepub fn bin_probabilities_at(
&self,
true_energy_ev: f64,
arrival_us: f64,
detector_time_edges_us: &[f64],
) -> Result<Vec<f64>, ResolutionParseError>
pub fn bin_probabilities_at( &self, true_energy_ev: f64, arrival_us: f64, detector_time_edges_us: &[f64], ) -> Result<Vec<f64>, ResolutionParseError>
Probability that a neutron of true_energy_ev whose nominal arrival,
before the pulse’s delay, is arrival_us is recorded in each bin of
detector_time_edges_us; as IkedaCarpenter::detector_bin_probabilities.
§Errors
As IkedaCarpenter::detector_bin_probabilities, with arrival_us finite.
Sourcepub fn bin_arrival_slopes_at(
&self,
true_energy_ev: f64,
arrival_us: f64,
detector_time_edges_us: &[f64],
) -> Result<Vec<f64>, ResolutionParseError>
pub fn bin_arrival_slopes_at( &self, true_energy_ev: f64, arrival_us: f64, detector_time_edges_us: &[f64], ) -> Result<Vec<f64>, ResolutionParseError>
The derivative of each of Self::bin_probabilities_at with respect
to arrival_us, per µs: the pulse density, folded with the triangle,
at the bin’s lower edge minus that at its upper edge.
§Errors
Sourcepub fn bin_pulse_slopes_at(
&self,
true_energy_ev: f64,
arrival_us: f64,
detector_time_edges_us: &[f64],
) -> Result<[Vec<f64>; 4], ResolutionParseError>
pub fn bin_pulse_slopes_at( &self, true_energy_ev: f64, arrival_us: f64, detector_time_edges_us: &[f64], ) -> Result<[Vec<f64>; 4], ResolutionParseError>
The derivatives of each of Self::bin_probabilities_at with
respect to α, β, R and the square of the triangle’s FWHM h,
each evaluated at true_energy_ev: [∂P/∂α, ∂P/∂β, ∂P/∂R, ∂P/∂h²],
one value per bin. The probabilities are even in h and smooth in
h², so ∂P/∂h² is finite and generally not 0 at h = 0.
§Errors
Sourcepub fn bin_tail_slopes_at(
&self,
true_energy_ev: f64,
arrival_us: f64,
detector_time_edges_us: &[f64],
) -> Result<[Vec<f64>; 2], ResolutionParseError>
pub fn bin_tail_slopes_at( &self, true_energy_ev: f64, arrival_us: f64, detector_time_edges_us: &[f64], ) -> Result<[Vec<f64>; 2], ResolutionParseError>
The derivatives of each of Self::bin_probabilities_at with
respect to the detector tail’s f and τ_D, each per its unit:
[∂P/∂f, ∂P/∂τ_D], one value per bin.
§Errors
As Self::bin_probabilities_at, and
ResolutionParseError::InvalidFormat for a pulse without a
detector tail.
Trait Implementations§
Source§impl Clone for IkedaCarpenterParams
impl Clone for IkedaCarpenterParams
Source§fn clone(&self) -> IkedaCarpenterParams
fn clone(&self) -> IkedaCarpenterParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IkedaCarpenterParams
impl Debug for IkedaCarpenterParams
Source§impl PartialEq for IkedaCarpenterParams
impl PartialEq for IkedaCarpenterParams
impl StructuralPartialEq for IkedaCarpenterParams
Auto Trait Implementations§
impl Freeze for IkedaCarpenterParams
impl RefUnwindSafe for IkedaCarpenterParams
impl Send for IkedaCarpenterParams
impl Sync for IkedaCarpenterParams
impl Unpin for IkedaCarpenterParams
impl UnsafeUnpin for IkedaCarpenterParams
impl UnwindSafe for IkedaCarpenterParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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