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), an α(E) or β(E) below 1e-9 µs⁻¹ at a
reference energy, 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), a detector tail, 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 detector_pulse(&self) -> DetectorPulse
pub fn detector_pulse(&self) -> DetectorPulse
The pulse as the counts path reads it, over the energies 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 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.
Each probability is a difference of the analytical IC CDF, folded with
the proton-pulse triangle when channel_fwhm_us is set.
§Errors
Returns ResolutionParseError::InvalidFormat unless the true energy
is physical, the timing offset is finite, at least two finite bin
edges are supplied in strictly increasing order, and the pulse has no
Gaussian burst.
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