{"id":34071145,"url":"https://github.com/wiso/countingworkspace","last_synced_at":"2026-03-12T19:14:20.710Z","repository":{"id":62564984,"uuid":"155900653","full_name":"wiso/countingworkspace","owner":"wiso","description":"Create RooFit workspace for simple counting experiments","archived":false,"fork":false,"pushed_at":"2021-02-10T12:58:33.000Z","size":1345,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-06T23:25:43.503Z","etag":null,"topics":["roofit","roofit-workspace","root-cern","statistics"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-02T17:34:37.000Z","updated_at":"2021-02-10T12:58:35.000Z","dependencies_parsed_at":"2022-11-03T16:00:50.787Z","dependency_job_id":null,"html_url":"https://github.com/wiso/countingworkspace","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wiso/countingworkspace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiso%2Fcountingworkspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiso%2Fcountingworkspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiso%2Fcountingworkspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiso%2Fcountingworkspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiso","download_url":"https://codeload.github.com/wiso/countingworkspace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiso%2Fcountingworkspace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30439658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["roofit","roofit-workspace","root-cern","statistics"],"created_at":"2025-12-14T07:56:47.428Z","updated_at":"2026-03-12T19:14:20.682Z","avatar_url":"https://github.com/wiso.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/wiso/countingworkspace.svg?branch=master)](https://travis-ci.org/wiso/countingworkspace)\n[![Coverage Status](https://coveralls.io/repos/github/wiso/countingworkspace/badge.svg?branch=master)](https://coveralls.io/github/wiso/countingworkspace?branch=master) \n[![PyPI version](https://badge.fury.io/py/countingworkspace.svg)](https://badge.fury.io/py/countingworkspace)\n\n# CountingWorkspace\n\nVery simple python package to create very simple counting experiment RooFit workspaces.\n\nThe 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:\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiso/countingworkspace/master/imgs/formula1.png\" width=\"30%\"/\u003e\n\nThe product is over all the reconstructed categories. The number of expected events in each category is:\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiso/countingworkspace/master/imgs/formula3.png\" width=\"60%\"/\u003e\n\nThe 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].\nThe generated number of events for each process can be parametrized in any way. A popular one in hep is:\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiso/countingworkspace/master/imgs/formula2.png\" width=\"60%\"/\u003e\n\nhere 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.\n\nHere a simple example:\n\n```python\nimport ROOT\nfrom countingworkspace import *\n\nNAMES_PROC = ['proc1', 'proc2']\nNCATEGORIES = 3\nEFFICIENCIES = [[0.3, 0.1],\n                [0.5, 0.4],\n                [0.2, 0.2]]\nEXPECTED_BKG_CAT = [100, 30, 10]\nLUMI = 100.\n# first create the parameters needed for the parametrization. The luminosity\nws = ROOT.RooWorkspace()\nws.factory('lumi[%f]' % LUMI)\n# and the cross sections:\nxsections = create_variables(ws, 'xsec_{proc}',     # {proc} is an index, you can call as you prefer\n                             bins=NAMES_PROC,       # the names\n                             values=[101.5, 7.99])  # the values of the cross sections\ncreate_workspace(NCATEGORIES, NAMES_PROC,\n                 efficiencies=EFFICIENCIES,\n                 nexpected_bkg_cat=EXPECTED_BKG_CAT,\n                 expression_nsignal_gen='prod:nsignal_gen_proc{proc}(mu_{proc}[1, -4, 5], lumi, xsec_{proc})',\n                 ws=ws)                         \n                         \n```\n\nIt is also possible to add simple systematic uncertainties.\n\nThere are some utilies to run toys.\n\nLook at the [examples](examples)\n\n## Installation\n\n    pip install countingworkspace\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiso%2Fcountingworkspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiso%2Fcountingworkspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiso%2Fcountingworkspace/lists"}