pub struct ExactTwoArmRatioModel { /* private fields */ }Expand description
Maps a true-energy transmission model into measured detector-bin ratios.
For a fixed response matrix R and fixed incident fluence weights F
(F_j = w_j ε(E_j) Φ(E_j) — detector efficiency folded in, pipeline-map
R5·7), the model supplied to the joint-Poisson objective is evaluated as
T_eff,i = sum_j F_j T_j R_ij / sum_j F_j R_ij.The open and sample arms are therefore broadened separately. This is not
the invalid post-hoc shortcut R[T].
§Dead-bin precondition
A detector bin whose open-arm expectation sum_j F_j R_ij is at or below
the pivot floor is a dead bin: the ratio is undefined there, so
evaluate fills it with T_eff = 1.0 and analytical_jacobian zeroes
its row. That filler is harmless only when the caller guarantees dead
bins carry no observed counts — a joint-Poisson objective then ignores
the bin entirely (its profiled rate is zero). Callers fitting observed
data MUST enforce that invariant before constructing this model, as
fit_counts_joint_poisson does with its occupied-bin pre-check: observed
counts in a dead bin would otherwise be silently compared against an
arbitrary T = 1 instead of raising an error.
Implementations§
Source§impl ExactTwoArmRatioModel
impl ExactTwoArmRatioModel
Sourcepub fn new(
inner: Box<dyn FitModel>,
response: DetectorBinResponseMatrix,
incident_fluence_weights: &[f64],
) -> Result<Self, FittingError>
pub fn new( inner: Box<dyn FitModel>, response: DetectorBinResponseMatrix, incident_fluence_weights: &[f64], ) -> Result<Self, FittingError>
Build the reusable fixed-response model.
Sourcepub fn open_expectation(&self) -> &[f64]
pub fn open_expectation(&self) -> &[f64]
Expected open-arm source shape in detector-bin order.
Trait Implementations§
Source§impl FitModel for ExactTwoArmRatioModel
impl FitModel for ExactTwoArmRatioModel
Source§fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>
fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>
Source§fn analytical_jacobian(
&self,
params: &[f64],
free_param_indices: &[usize],
_y_current: &[f64],
) -> Option<FlatMatrix>
fn analytical_jacobian( &self, params: &[f64], free_param_indices: &[usize], _y_current: &[f64], ) -> Option<FlatMatrix>
Auto Trait Implementations§
impl Freeze for ExactTwoArmRatioModel
impl !RefUnwindSafe for ExactTwoArmRatioModel
impl !Send for ExactTwoArmRatioModel
impl !Sync for ExactTwoArmRatioModel
impl Unpin for ExactTwoArmRatioModel
impl UnsafeUnpin for ExactTwoArmRatioModel
impl !UnwindSafe for ExactTwoArmRatioModel
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
§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