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
impl IkedaCarpenter
Sourcepub fn new(
params: IkedaCarpenterParams,
flight_path_m: f64,
grid: &SynthesisGrid,
) -> Result<Self, ResolutionParseError>
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.
Sourcepub fn tabulated(&self) -> &TabulatedResolution
pub fn tabulated(&self) -> &TabulatedResolution
The synthesized tabulated kernel set (the broadening engine).
Sourcepub fn params(&self) -> &IkedaCarpenterParams
pub fn params(&self) -> &IkedaCarpenterParams
The IC parameters.
Sourcepub fn flight_path_m(&self) -> f64
pub fn flight_path_m(&self) -> f64
Flight-path length (m).
Sourcepub fn with_flight_path(
&self,
flight_path_m: f64,
) -> Result<Self, ResolutionParseError>
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.
Sourcepub fn ref_energies(&self) -> &[f64]
pub fn ref_energies(&self) -> &[f64]
Reference energies (eV, ascending) the table was synthesized on.
Sourcepub fn kernel_at(
&self,
energy_ev: f64,
) -> Result<(Vec<f64>, Vec<f64>), ResolutionParseError>
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.
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 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.
Sourcepub fn rise_us(&self, energy_ev: f64) -> Result<f64, ResolutionParseError>
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
Sourcepub fn source_pulse_at(
&self,
energy_ev: f64,
) -> Result<(Vec<f64>, Vec<f64>), ResolutionParseError>
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.
Sourcepub fn detector_bin_probabilities(
&self,
true_energy_ev: f64,
detector_time_edges_us: &[f64],
timing_offset_us: f64,
) -> Result<Vec<f64>, ResolutionParseError>
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
impl Clone for IkedaCarpenter
Source§fn clone(&self) -> IkedaCarpenter
fn clone(&self) -> IkedaCarpenter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for IkedaCarpenter
impl RefUnwindSafe for IkedaCarpenter
impl Send for IkedaCarpenter
impl Sync for IkedaCarpenter
impl Unpin for IkedaCarpenter
impl UnsafeUnpin for IkedaCarpenter
impl UnwindSafe for IkedaCarpenter
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