CountingWorkspace
Very simple python package to create very simple counting experiment RooFit workspaces.
The statistical model describes the migration of events from truth-bins (e.g. processes) and reco-category. The implemented likelihood is a product of Poissonian distributions:
The product is over all the reconstructed categories. The number of expected events in each category is:
The matrix ε implements the efficiencies and the migrations. It's matrix elements are the conditional probability to be selected and reconstructed in category-c for a process-p: P[c|p]. The generated number of events for each process can be parametrized in any way. A popular one in hep is:
here the generated number of events are equal to the product of the luminosity (the overall normalization), its cross section and the signal strength (which is the free parameter in the fit). The background is added on top of that.
Here a simple example:
import ROOT
from countingworkspace import *
NAMES_PROC = ['proc1', 'proc2']
NCATEGORIES = 3
EFFICIENCIES = [[0.3, 0.1],
[0.5, 0.4],
[0.2, 0.2]]
EXPECTED_BKG_CAT = [100, 30, 10]
LUMI = 100.
# first create the parameters needed for the parametrization. The luminosity
ws = ROOT.RooWorkspace()
ws.factory('lumi[%f]' % LUMI)
# and the cross sections:
xsections = create_variables(ws, 'xsec_{proc}', # {proc} is an index, you can call as you prefer
bins=NAMES_PROC, # the names
values=[101.5, 7.99]) # the values of the cross sections
create_workspace(NCATEGORIES, NAMES_PROC,
efficiencies=EFFICIENCIES,
nexpected_bkg_cat=EXPECTED_BKG_CAT,
expression_nsignal_gen='prod:nsignal_gen_proc{proc}(mu_{proc}[1, -4, 5], lumi, xsec_{proc})',
ws=ws)
It is also possible to add simple systematic uncertainties.
There are some utilies to run toys.
Look at the examples
Installation
pip install countingworkspace
Metadata
Release files for countingworkspace 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| countingworkspace-0.2.3.tar.gz | 15.8 kB | Without provenance | Details for countingworkspace-0.2.3.tar.gz |
Release files / countingworkspace-0.2.3.tar.gz
| Download URL | countingworkspace-0.2.3.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e58974e02837818781ddae24d4e87e8d7a2576d0326fcbf818909b23a69c2b09
|
|
BLAKE2b-256 checksum How to use checksums |
b9c7c02cf13077885fdee30909b6e48ddd3aeb330b7d61acf02fa2e41776113d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.7
|
Security for countingworkspace 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.