Skip to main content

IkedaCarpenterParams

Struct IkedaCarpenterParams 

Source
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: EnergyLaw

Fast (slowing-down) rate α(E), 1/µs. Must evaluate to at least 1e-9.

§beta: EnergyLaw

Slow (storage) rate β(E), 1/µs. Must evaluate to at least 1e-9.

§r: EnergyLaw

Storage 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

Source

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.

Source

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.

Source

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.

Source

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

As Self::bin_probabilities_at.

Source

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

As Self::bin_probabilities_at.

Source

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

Source§

fn clone(&self) -> IkedaCarpenterParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IkedaCarpenterParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for IkedaCarpenterParams

Source§

fn eq(&self, other: &IkedaCarpenterParams) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for IkedaCarpenterParams

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more