https://jrbourbeau.github.io/pyunfold/index.html
https://github.com/jrbourbeau/pyunfold
https://zhampel.github.io/intro-pyunfold-iihe
An ideal detector:
Real world detectors have:
$$ n(E) = \mathbf{R} \, \phi(C) $$
Two ways to get $\phi(C)$:
So why don't we just invert $\mathbf{R}$?
What if
Proposal: build a matrix $\mathbf{M}$ s.t.
$$ \begin{align} \mathbf{M} &\approx \mathbf{R}^{-1} \\ \phi(C) &\approx \mathbf{M} \, n(E) \end{align} $$
A Python package to account for imperfect measurements in an iterative unfolding.
A Python package to account for imperfect measurements in an iterative unfolding*.
Authors: James Bourbeau, Zig Hampel
PyUnfold provides users:
Installation: pip install pyunfold
To use PyUnfold, one needs only to provide the
# Perform iterative unfolding
unfolded_result = iterative_unfold(data=data,
data_err=data_err,
response=response,
response_err=response_err,
efficiencies=efficiencies,
efficiencies_err=efficiencies_err)
Flexibility of prior to test results's robustness
Other unfolding toolkits do not permit user defined prior.
from pyunfold.priors import jeffreys_prior, uniform_prior
cause_lim = np.logspace(0, 3, num_causes)
uni_prior = uniform_prior(num_causes)
jeff_prior = jeffreys_prior(cause_lim)
print('Running with uniform prior...')
unfolded_uniform = iterative_unfold(data=data_observed,
data_err=data_observed_err,
response=response,
response_err=response_err,
efficiencies=efficiencies,
efficiencies_err=efficiencies_err,
ts='ks',
ts_stopping=0.01,
callbacks=[Logger()])
print('\nRunning with Jeffreys prior...')
unfolded_jeffreys = iterative_unfold(data=data_observed,
data_err=data_observed_err,
response=response,
response_err=response_err,
efficiencies=efficiencies,
efficiencies_err=efficiencies_err,
prior=jeff_prior,
ts='ks',
ts_stopping=0.01,
callbacks=[Logger()])
Running with uniform prior... Iteration 1: ts = 0.1460, ts_stopping = 0.01 Iteration 2: ts = 0.0060, ts_stopping = 0.01 Running with Jeffreys prior... Iteration 1: ts = 0.7231, ts_stopping = 0.01 Iteration 2: ts = 0.0171, ts_stopping = 0.01 Iteration 3: ts = 0.0006, ts_stopping = 0.01
Optimal reg. strength problem dependent, default does not exist.
https://jrbourbeau.github.io/pyunfold/index.html
https://github.com/jrbourbeau/pyunfold
Introductory and advanced example notebooks
Mathematical details
Can be used used out of the box right now: pip install pyunfold
Flexible framework. Submit an issue if you see something you want to change or see!
PyUnfold submitted to J.O.S.S. Under review
Designed to make it easier to:
Hoping to make unfolding accessible beyond HEP