Skip to content

Core: applying baseline and gain breaks (Poisson) statistics

The following in core/integration/PixelSumIntegrator.cpp offers a clue:

    // TODO: ERROR ESTIMATE!!
    // This INCORRECTLY assumes Poisson statistics (no gain or baseline)
    result.sum_intensity =
        Intensity(sum_peak, sum_peak + npeak * mean_bkg + npeak * npeak * std_bkg * std_bkg);

If the GUI checkbox to add the baseline and gain is checked, the statistics, specifically sigmas are wildly inaccurate. Considering the baseline and gain arise from effects that are not simply neutron counting events (electronic background, photon counting), does it even make sense to use Poisson statistics, even when the form is essentially the same as a Gaussian at high enough counts?

We should consider replacing the Poisson statistics with Gaussian.

https://iffgit.fz-juelich.de/neutron-simlab/openhkl/-/blob/main/core/integration/PixelSumIntegrator.cpp?ref_type=heads#L150-153