Skip to main content

IkedaCarpenter

Struct IkedaCarpenter 

Source
pub struct IkedaCarpenter { /* private fields */ }
Expand description

Analytical Ikeda–Carpenter resolution model.

Synthesizes a TabulatedResolution at construction and applies it through the same broadening path as a Monte-Carlo file. Cloning is cheap (the synthesized table is the only large field). Re-synthesize (construct anew) when fitting changes the parameters.

Implementations§

Source§

impl IkedaCarpenter

Source

pub fn new( params: IkedaCarpenterParams, flight_path_m: f64, grid: &SynthesisGrid, ) -> Result<Self, ResolutionParseError>

Build the model, synthesizing its kernel table over grid.

§Errors

Returns ResolutionParseError::InvalidFormat for a non-positive flight path, a degenerate grid (n_energies < 2, n_tau < 8, e_min ≤ 0, e_max ≤ e_min), a non-positive β(E), a parameter/grid combination whose τ-grid cannot resolve the prompt core and requested folds within the MAX_TAU_SAMPLES cap at some reference energy (see tau_geometry — remedy: larger β, R = 0, or a wider/disabled fold), or if the synthesized kernels fail TabulatedResolution::from_kernels validation.

Source

pub fn tabulated(&self) -> &TabulatedResolution

The synthesized tabulated kernel set (the broadening engine).

Source

pub fn params(&self) -> &IkedaCarpenterParams

The IC parameters.

Source

pub fn flight_path_m(&self) -> f64

Flight-path length (m).

Source

pub fn with_flight_path( &self, flight_path_m: f64, ) -> Result<Self, ResolutionParseError>

The same pulse read against a different flight path.

The synthesized kernels are emission-time distributions built from α(E), β(E) and R(E) — no flight path appears in the synthesis. The flight path enters only the TOF↔energy map and the nominal arrival time, so rebinding it is exact and does not resynthesize the table.

§Errors

Returns ResolutionParseError::InvalidFormat if flight_path_m is not positive and finite.

Source

pub fn ref_energies(&self) -> &[f64]

Reference energies (eV, ascending) the table was synthesized on.

Source

pub fn kernel_at( &self, energy_ev: f64, ) -> Result<(Vec<f64>, Vec<f64>), ResolutionParseError>

Evaluate the (burst/channel-folded) IC kernel at one energy.

Returns ascending TOF-offsets (µs, 0 = pulse start) and peak-normalized weights (max = 1), matching the TabulatedResolution storage convention.

§Errors

Returns ResolutionParseError::InvalidFormat when the requested energy or an energy-dependent rate/fraction is non-physical, or when the τ-grid cannot resolve the prompt core and requested folds within MAX_TAU_SAMPLES at this energy. Construction validates every reference energy, but a probe outside [e_min, e_max] can still leave the physical or resolvable region.

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 Self::detector_bin_probabilities gives it less than NEGLIGIBLE_ARRIVAL_PROBABILITY chance of arriving: without a fold, 0 and the delay where 1 − ic_cdf falls to that chance; with a fold, the fold’s reach before 0 and a bound on the end of the sampled pulse those probabilities integrate.

§Errors

ResolutionParseError::InvalidFormat when energy_ev is not positive and finite, or a law is singular or out of range there.

Source

pub fn rise_us(&self, energy_ev: f64) -> Result<f64, ResolutionParseError>

The time in µs from the first sample of the pulse at energy_ev to its peak.

§Errors

As Self::source_pulse_at.

Source

pub fn source_pulse_at( &self, energy_ev: f64, ) -> Result<(Vec<f64>, Vec<f64>), ResolutionParseError>

Evaluate the physical source pulse at one true neutron energy.

Returns sampled moderator-delay coordinates in µs and peak-normalized densities. Unlike Self::kernel_at, this method does not move the pulse mode to zero. With no symmetric proton/channel fold, the delay is causal and starts at zero. A symmetric fold may extend the sampled support below zero relative to its stated time origin.

§Errors

Returns ResolutionParseError::InvalidFormat if energy_ev is not a positive finite true energy, if an energy law is unphysical at that energy, or if the requested pulse cannot be resolved by the configured sampling limits.

Source

pub fn detector_bin_probabilities( &self, true_energy_ev: f64, detector_time_edges_us: &[f64], timing_offset_us: f64, ) -> Result<Vec<f64>, ResolutionParseError>

Probability that a neutron of known true energy is recorded in each supplied detector-time bin.

detector_time_edges_us are the actual measured bin edges. The nominal arrival time is timing_offset_us + TOF_FACTOR * flight_path_m / sqrt(true_energy_ev). timing_offset_us represents the shared clock/detector offset; it does not absorb or remove the moderator pulse’s physical mode.

The returned vector has one entry per adjacent edge pair and is not renormalized to the supplied window: bins that do not cover the full pulse correctly sum to less than one.

With no burst or channel fold, probabilities come directly from the analytical IC CDF. With either optional fold, the continuous pulse is represented on the configured synthesis grid and integrated as a piecewise-linear density. The finite numerical support is not silently renormalized; omitted physical tail probability remains omitted.

§Errors

Returns ResolutionParseError::InvalidFormat unless the true energy is physical, the timing offset is finite, and at least two finite bin edges are supplied in strictly increasing order.

Trait Implementations§

Source§

impl Clone for IkedaCarpenter

Source§

fn clone(&self) -> IkedaCarpenter

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 IkedaCarpenter

Source§

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

Formats the value using the given formatter. Read more

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