Skip to main content

fit_two_arm_background_templates

Function fit_two_arm_background_templates 

Source
pub fn fit_two_arm_background_templates(
    observed_open_counts: &[f64],
    observed_sample_counts: &[f64],
    neutron_signal: TwoArmCounts,
    open_exposure_scale: f64,
    sample_exposure_scale: f64,
    templates: &[TwoArmBackgroundTemplate],
    initial_amplitudes: &[f64],
    config: &PoissonConfig,
) -> Result<TwoArmBackgroundFitResult, FittingError>
Expand description

Fit amplitudes of independently supplied detector-bin templates.

The neutron signal and every template shape remain fixed. This tests whether an independently chosen shape explains the counts, but cannot prove its provenance; callers must retain the independent measurement record.

observed_open_counts and observed_sample_counts are measured counts, so they are plain slices rather than a [TwoArmCounts]: that type carries an acquisition-window loss, which is a property of a prediction and has no meaning for data read off a detector.