Reference / binference.simulate.mock_unfolding

binference.simulate.mock_unfolding

binference.simulate.mock_unfolding(n_objects=5000, n_true=20, n_reco=25, *, slope=3.0, resolution=0.08, efficiency=(0.6, 0.95), rng=None)[source]

An unfolding problem: an exponential spectrum smeared by a detector.

Unlike in the other mocks, n_objects counts the objects (events) before detection, so the number observed is random (mock.truth.counts.sum()). True values on [0, 1] follow exp(-slope * z); events are detected with an efficiency rising linearly across the range, smeared with Gaussian resolution and histogrammed in n_reco bins on [-0.1, 1.1]. The response matrix is computed for a population uniform within each true bin, mock.response is a Response and mock.likelihoods is built with Likelihoods.from_binned() (its efficiency becomes the selection function).

Parameters:
n_objectsint, optional

Number of events before detection.

n_trueint, optional

Number of true bins.

n_recoint, optional

Number of measured bins.

slopefloat, optional

Decay rate of the exponential spectrum.

resolutionfloat, optional

Standard deviation of the Gaussian smearing.

efficiency(float, float), optional

Detection efficiency at the two ends of the range.

rngint, Generator or None

Random number generator.