pub struct CalibrationResult {
pub family: String,
pub theta: Vec<f64>,
pub chi2_dof: f64,
pub resolution: ResolutionFunction,
pub iterations: usize,
pub converged: bool,
pub position_t0_us: f64,
pub position_l_scale: f64,
pub prior_penalty: f64,
pub n_free_params: usize,
pub intervals: Option<Vec<(f64, f64)>>,
pub bounds_hit: Vec<String>,
}Expand description
Result of a resolution calibration.
Fields§
§family: StringFamily label ("gaussian" | "udr_corr" | "ic").
theta: Vec<f64>Fitted parameter vector (raw optimizer space; see ResolutionFamily
and ResolutionFamily::param_names). For the IC family these are
ln/box-encoded — read decoded physical values off
resolution instead of exponentiating by hand.
chi2_dof: f64Reduced data χ²/dof of the best fit (after anorm/baseline). The
energy-scale prior penalty is excluded — it is reported separately as
prior_penalty.
resolution: ResolutionFunctionThe calibrated resolution, ready to pin into a sample fit.
iterations: usizeOptimizer iterations of the winning restart.
converged: boolWhether the winning restart self-converged.
position_t0_us: f64Fitted (or pinned) SAMMY energy-scale TOF zero t0 (µs). Equals
config.position_t0_center_us when fit_t0 is false (pinned). When fit, it
is a SHARED energy-scale parameter (not a per-family nuisance): the resonance
dip position is confounded with flight-path geometry (the asymmetric-kernel
lag is the same 1/√E basis as L_scale), so t0/L_scale are constrained
by the metrology prior, not free.
position_l_scale: f64Fitted (or pinned) flight-path scale L_scale. Equals
config.position_l_scale_center when fit_l_scale is false.
prior_penalty: f64Gaussian-prior penalty Σ((θ−center)/σ)² on the fitted (t0, L_scale) at the
solution (0 when no position prior is active). objective = χ²_data + prior_penalty; report it alongside chi2_dof so a large position move
(e.g. a wrong family needing ΔL/L ≫ the metrology σ) is visible, not hidden.
n_free_params: usizeTotal outer-loop free parameters: resolution θ plus any FITTED position
coordinates (t0, L_scale). Makes cross-family χ² comparisons and
dof bookkeeping explicit now that families differ in size (IC is 4–5
parameters, Gaussian/UdrCorr are 2).
intervals: Option<Vec<(f64, f64)>>One-sigma interval of each fitted coordinate as absolute (lower, upper) bounds, in the same raw optimizer space as
theta (plus any fitted t0 / L_scale), one entry
per n_free_params.
Each bound is where the objective, minimized over the other coordinates, rises by one above its floor. The two sides are independent numbers because the interval is genuinely asymmetric: a kernel narrower than the line it broadens stops being visible, so the objective is nearly flat below the intrinsic width and steep above it.
A bound equal to the coordinate’s box edge means the data does not constrain that side at all.
None when CalibrationConfig::intervals is off, or when the run
exhausted its iteration budget without self-converging (which
converged reports): an interval about a point
that was never shown to be a minimum is not an uncertainty.
This is what a sample fit needs in order to carry the calibrated resolution as a prior instead of pinning it. Pinning does not bias the fitted temperature much, but it reports it as more certain than it is: resolution width and temperature both broaden the line, so the uncertainty that belongs to their degeneracy is dropped.
bounds_hit: Vec<String>Coordinates that finished within BOUND_HIT_REL_TOL·(hi−lo) of a box
bound, as "name:lower" / "name:upper" (names from
ResolutionFamily::param_names, plus "t0_us" / "l_scale" when
position is fitted). Empty = interior solution. A pinned bound makes a
degenerate calibration visible instead of silent: e.g. an eV-regime
calibrant with no storage tail drives R → 0 ("r:lower") — on that
β↔R ridge the storage term vanishes and β is unconstrained, so the
reported β must not be physically interpreted.
Trait Implementations§
Source§impl Clone for CalibrationResult
impl Clone for CalibrationResult
Source§fn clone(&self) -> CalibrationResult
fn clone(&self) -> CalibrationResult
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 CalibrationResult
impl RefUnwindSafe for CalibrationResult
impl Send for CalibrationResult
impl Sync for CalibrationResult
impl Unpin for CalibrationResult
impl UnsafeUnpin for CalibrationResult
impl UnwindSafe for CalibrationResult
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