pub struct CountsBackgroundConfig {
pub alpha_1_init: f64,
pub alpha_2_init: f64,
pub fit_alpha_1: bool,
pub fit_alpha_2: bool,
pub c: f64,
}Expand description
Background model for the counts fitting engine.
In the counts domain, the forward model is: Y(E) = α₁ · [Φ(E) · exp(-Σ nᵢσᵢ(E))] + α₂ · B(E)
where Φ(E) is the incident flux and B(E) is detector/gamma background. The reference Φ(E) / B(E) spectra are supplied by the caller or by spatial pre-processing; this config only controls the fitted scale factors.
Important distinction:
- This is a detector-space counts background model
B(E). - It is NOT the same as the transmission-lift background used by
BackgroundConfig, which models additive uplift of the apparent transmission curve (for example gamma-tail structure that pushes transmission upward).
For VENUS MCP/TPX event detectors, the current working assumption is:
- raw/open-beam is the correct normalization baseline
- dark-current / CCD-style electronic offset is not modeled
- rare ghost counts may exist at the hardware level, but are currently treated as negligible unless a detector-background reference spectrum is explicitly provided
This is structurally different from the transmission background model
(BackgroundConfig) because:
- Φ and B are reference spectra, not fitted per pixel
- α₁ and α₂ are optional per-pixel scale corrections
- All terms are non-negative (required for valid Poisson NLL)
Fields§
§alpha_1_init: f64Research-only. Initial α₁ flux-scale value used by
crate::pipeline::evaluate_jacobian_and_fisher (Fisher-info
research helper, Epic #394). Not honoured by the production fit
path; SolverConfig::PoissonKL profiles the flux via λ̂ and
rejects alpha fitting.
alpha_2_init: f64Research-only. Initial α₂ detector-bg-scale value, same
provisions as alpha_1_init.
fit_alpha_1: boolResearch-only. Fit α₁ flag — only consumed by
evaluate_jacobian_and_fisher. Passing true through
SolverConfig::PoissonKL on counts input yields an error.
fit_alpha_2: boolResearch-only. Fit α₂ flag — see fit_alpha_1.
c: f64Proton-charge ratio c = Q_s / Q_ob for the counts-KL solver
(memo 35 §P1.3 — “make c a first-class API parameter”).
Default 1.0, correct only when the caller has already PC-
normalized the open-beam counts so that flux = c · O. For the
counts-KL dispatch (SolverConfig::PoissonKL on counts input),
set this to the actual Q_sample / Q_open_beam ratio and pass
raw open-beam counts — the joint-Poisson solver will profile
λ̂ itself. Ignored by LM paths.
Trait Implementations§
Source§impl Clone for CountsBackgroundConfig
impl Clone for CountsBackgroundConfig
Source§fn clone(&self) -> CountsBackgroundConfig
fn clone(&self) -> CountsBackgroundConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CountsBackgroundConfig
impl Debug for CountsBackgroundConfig
Auto Trait Implementations§
impl Freeze for CountsBackgroundConfig
impl RefUnwindSafe for CountsBackgroundConfig
impl Send for CountsBackgroundConfig
impl Sync for CountsBackgroundConfig
impl Unpin for CountsBackgroundConfig
impl UnsafeUnpin for CountsBackgroundConfig
impl UnwindSafe for CountsBackgroundConfig
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