triggercalib 2.0.4__tar.gz → 2.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {triggercalib-2.0.4 → triggercalib-2.0.8}/.gitlab-ci.yml +5 -3
- {triggercalib-2.0.4 → triggercalib-2.0.8}/PKG-INFO +2 -2
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/releases.md +8 -0
- triggercalib-2.0.8/releases/v2/r0/v2r0p5.md +20 -0
- triggercalib-2.0.8/releases/v2/r0/v2r0p6.md +20 -0
- triggercalib-2.0.8/releases/v2/r0/v2r0p7.md +21 -0
- triggercalib-2.0.8/releases/v2/r0/v2r0p8.md +22 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/commands/fit_and_count.py +8 -1
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/commands/sideband.py +4 -1
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/commands/sweights.py +8 -1
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/BaseEff.py +0 -1
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/FitCountEff.py +3 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/Fitter.py +16 -1
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/SWeightsEff.py +3 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/Sideband.py +3 -2
- triggercalib-2.0.8/src/triggercalib/version.py +24 -0
- triggercalib-2.0.4/src/triggercalib/version.py +0 -4
- {triggercalib-2.0.4 → triggercalib-2.0.8}/.coveragerc +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/.flake8 +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/.gitignore +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/CONTRIBUTING.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/COPYING +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/README.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/build-docs.sh +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/contributing.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/cheat-sheet.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/getting-started.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/index.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/running-triggercalib.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/trigger-efficiencies.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/troubleshooting.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/tutorials/2d-binning.ipynb +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/tutorials/combined.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/tutorials/fit-and-count.ipynb +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/tutorials/hlt1-and-hlt2.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/tutorials/hlt1.ipynb +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/tutorials/hlt2.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/tutorials/index.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/guide/tutorials/sweights.ipynb +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/img/logo-smaller.png +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/img/logo.jpeg +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/img/tistos.png +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/index.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/javascripts/mathjax.js +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/javascripts/notebooks.js +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/reference/core.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/reference/index.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/reference/utils.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/stylesheets/colours.css +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/stylesheets/fonts.css +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/docs/stylesheets/styles.css +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/environment-docs.yml +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/mkdocs.yml +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/pyproject.toml +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/template.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r4/v1r4p0.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r4/v1r4p1.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r4/v1r4p2.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r4/v1r4p3.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r4/v1r4p4.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r4/v1r4p5.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r5/v1r5p0.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r5/v1r5p1.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r5/v1r5p2.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v1/r5/v1r5p3.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v2/r0/v2r0p0.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v2/r0/v2r0p1.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v2/r0/v2r0p2.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v2/r0/v2r0p3.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/releases/v2/r0/v2r0p4.md +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/requirements-ci.txt +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/requirements-dev.txt +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/__init__.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/commands/__init__.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/Binning.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/Model.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/SidebandEff.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/core/__init__.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/__init__.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/config/binning.yaml +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/config/model.yaml +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/config/sideband.yaml +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/conftest.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/test_commands.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/test_core.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/test_fit_count.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/test_sideband.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/test_stats.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/test_sweights.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/tests/test_utils.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/utils/__init__.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/utils/helpers.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/utils/io.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/utils/stats.py +0 -0
- {triggercalib-2.0.4 → triggercalib-2.0.8}/src/triggercalib/utils/tests.py +0 -0
|
@@ -14,6 +14,7 @@ variables:
|
|
|
14
14
|
MATERIAL_VERSION: '9.6.1'
|
|
15
15
|
DOCSTRINGS_VERSION: '2.0.1'
|
|
16
16
|
JUPYTER_VERSION: '0.25.1'
|
|
17
|
+
TWINE_VERSION: '6.2.0'
|
|
17
18
|
|
|
18
19
|
image: gitlab-registry.cern.ch/ci-tools/ci-worker:cc7
|
|
19
20
|
|
|
@@ -60,7 +61,7 @@ testing:
|
|
|
60
61
|
|
|
61
62
|
package:
|
|
62
63
|
stage: build
|
|
63
|
-
image:
|
|
64
|
+
image: registry.cern.ch/docker.io/library/python:3.11
|
|
64
65
|
script:
|
|
65
66
|
- python -m build
|
|
66
67
|
artifacts:
|
|
@@ -111,13 +112,14 @@ pages:
|
|
|
111
112
|
|
|
112
113
|
deploy:
|
|
113
114
|
stage: deploy
|
|
114
|
-
image:
|
|
115
|
+
image: registry.cern.ch/docker.io/library/python:3.11
|
|
115
116
|
only:
|
|
116
117
|
- tags
|
|
117
118
|
dependencies:
|
|
118
119
|
- package
|
|
120
|
+
before_script:
|
|
121
|
+
- pip install twine==${TWINE_VERSION}
|
|
119
122
|
script:
|
|
120
123
|
- if [ -z "$TWINE_PASSWORD" ] ; then echo "Set TWINE_PASSWORD in CI variables" ; exit 1 ; fi
|
|
121
124
|
- twine upload -u __token__ dist/*
|
|
122
|
-
before_script: []
|
|
123
125
|
after_script: []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: triggercalib
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.8
|
|
4
4
|
Summary: A turnkey package for estimating LHCb trigger efficiencies
|
|
5
5
|
Project-URL: Homepage, https://gitlab.cern.ch/lhcb-rta/triggercalib/
|
|
6
6
|
Project-URL: Documentation, https://triggercalib.docs.cern.ch/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## TriggerCalib 2.0.5 (07-04-2026)
|
|
2
|
+
|
|
3
|
+
TriggerCalib 2.0.5 is built from ``master`` and contains the following changes with respect to 2.0.0.
|
|
4
|
+
|
|
5
|
+
Potentially breaking changes are labelled with :warning:
|
|
6
|
+
|
|
7
|
+
### New features
|
|
8
|
+
- Enhance Fitter and related CLI (!105)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug fixes
|
|
12
|
+
- Fix LaTeX in docs (!97, contributed by @jherdiec)
|
|
13
|
+
- Fix spelling mistake in pyproject.toml (!98, contributed by @jherdiec)
|
|
14
|
+
- Fix handling of friend trees in v2.0 (!99)
|
|
15
|
+
- Remove print statement of branches (!102)
|
|
16
|
+
- Fix disabling of implicit MT for friend trees (!103)
|
|
17
|
+
- Handle finding of RVec weights (!104)
|
|
18
|
+
|
|
19
|
+
### Other
|
|
20
|
+
- Package and test with Python 3.11 (!106)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## TriggerCalib 2.0.6 (07-04-2026)
|
|
2
|
+
|
|
3
|
+
TriggerCalib 2.0.6 is built from ``master`` and contains the following changes with respect to 2.0.0.
|
|
4
|
+
|
|
5
|
+
Potentially breaking changes are labelled with :warning:
|
|
6
|
+
|
|
7
|
+
### New features
|
|
8
|
+
- Enhance Fitter and related CLI (!105)
|
|
9
|
+
|
|
10
|
+
### Bug fixes
|
|
11
|
+
- Fix LaTeX in docs (!97, contributed by @jherdiec)
|
|
12
|
+
- Fix spelling mistake in pyproject.toml (!98, contributed by @jherdiec)
|
|
13
|
+
- Fix handling of friend trees in v2.0 (!99)
|
|
14
|
+
- Remove print statement of branches (!102)
|
|
15
|
+
- Fix disabling of implicit MT for friend trees (!103)
|
|
16
|
+
- Handle finding of RVec weights (!104)
|
|
17
|
+
- Add twine to CI requirements (!108)
|
|
18
|
+
|
|
19
|
+
### Other
|
|
20
|
+
- Package and test with Python 3.11 (!106)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## TriggerCalib 2.0.7 (07-04-2026)
|
|
2
|
+
|
|
3
|
+
TriggerCalib 2.0.7 is built from ``master`` and contains the following changes with respect to 2.0.0.
|
|
4
|
+
|
|
5
|
+
Potentially breaking changes are labelled with :warning:
|
|
6
|
+
|
|
7
|
+
### New features
|
|
8
|
+
- Enhance Fitter and related CLI (!105)
|
|
9
|
+
|
|
10
|
+
### Bug fixes
|
|
11
|
+
- Fix LaTeX in docs (!97, contributed by @jherdiec)
|
|
12
|
+
- Fix spelling mistake in pyproject.toml (!98, contributed by @jherdiec)
|
|
13
|
+
- Fix handling of friend trees in v2.0 (!99)
|
|
14
|
+
- Remove print statement of branches (!102)
|
|
15
|
+
- Fix disabling of implicit MT for friend trees (!103)
|
|
16
|
+
- Handle finding of RVec weights (!104)
|
|
17
|
+
- Add twine to CI requirements (!108)
|
|
18
|
+
- Fix deploy rule in CI (!109)
|
|
19
|
+
|
|
20
|
+
### Other
|
|
21
|
+
- Package and test with Python 3.11 (!106)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## TriggerCalib 2.0.8 (13-05-2026)
|
|
2
|
+
|
|
3
|
+
TriggerCalib 2.0.8 is built from ``master`` and contains the following changes with respect to 2.0.0.
|
|
4
|
+
|
|
5
|
+
Potentially breaking changes are labelled with :warning:
|
|
6
|
+
|
|
7
|
+
### New features
|
|
8
|
+
- Enhance Fitter and related CLI (!105)
|
|
9
|
+
|
|
10
|
+
### Bug fixes
|
|
11
|
+
- Fix LaTeX in docs (!97, contributed by @jherdiec)
|
|
12
|
+
- Fix spelling mistake in pyproject.toml (!98, contributed by @jherdiec)
|
|
13
|
+
- Fix handling of friend trees in v2.0 (!99)
|
|
14
|
+
- Remove print statement of branches (!102)
|
|
15
|
+
- Fix disabling of implicit MT for friend trees (!103)
|
|
16
|
+
- Handle finding of RVec weights (!104)
|
|
17
|
+
- Add twine to CI requirements (!108)
|
|
18
|
+
- Fix deploy rule in CI (!109)
|
|
19
|
+
- Fix scale calculation in Sideband (!110)
|
|
20
|
+
|
|
21
|
+
### Other
|
|
22
|
+
- Package and test with Python 3.11 (!106)
|
|
@@ -30,12 +30,16 @@ def parse_args():
|
|
|
30
30
|
|
|
31
31
|
parser.add_argument("--output", type=str, required=True)
|
|
32
32
|
|
|
33
|
+
parser.add_argument("--cut", type=str, default=None, nargs="+")
|
|
33
34
|
parser.add_argument("--friend-path", type=str, nargs="+", default=None)
|
|
34
35
|
parser.add_argument("--friend-tree", type=str, default=None)
|
|
35
|
-
parser.add_argument("--
|
|
36
|
+
parser.add_argument("--min-entries", type=int, default=50)
|
|
37
|
+
parser.add_argument("--max-attempts", type=int, default=5)
|
|
36
38
|
parser.add_argument("--weight", type=str, default=None, nargs="+")
|
|
37
39
|
parser.add_argument("--threads", type=int, default=1)
|
|
38
40
|
|
|
41
|
+
parser.add_argument("--no-trig", action="store_true")
|
|
42
|
+
|
|
39
43
|
return parser.parse_args()
|
|
40
44
|
|
|
41
45
|
|
|
@@ -92,6 +96,9 @@ def main(args=None):
|
|
|
92
96
|
fit_kwargs={
|
|
93
97
|
"NumCPU": args.threads,
|
|
94
98
|
},
|
|
99
|
+
max_attempts=args.max_attempts,
|
|
100
|
+
min_entries=args.min_entries,
|
|
101
|
+
trig_effs=not (args.no_trig),
|
|
95
102
|
)
|
|
96
103
|
fitcount_eff.write(args.output)
|
|
97
104
|
|
|
@@ -32,6 +32,8 @@ def parse_args():
|
|
|
32
32
|
parser.add_argument("--weight", type=str, default=None, nargs="+")
|
|
33
33
|
parser.add_argument("--threads", type=int, default=1)
|
|
34
34
|
|
|
35
|
+
parser.add_argument("--no-trig", action="store_true")
|
|
36
|
+
|
|
35
37
|
return parser.parse_args()
|
|
36
38
|
|
|
37
39
|
|
|
@@ -66,9 +68,10 @@ def main(args=None):
|
|
|
66
68
|
tos=args.tos,
|
|
67
69
|
binning=args.binning,
|
|
68
70
|
sideband=args.sideband,
|
|
71
|
+
cut=args.cut,
|
|
69
72
|
friend_path=args.friend_path,
|
|
70
73
|
friend_tree=args.friend_tree,
|
|
71
|
-
|
|
74
|
+
trig_effs=not (args.no_trig),
|
|
72
75
|
weight=args.weight,
|
|
73
76
|
)
|
|
74
77
|
sideband_eff.write(args.output)
|
|
@@ -30,12 +30,16 @@ def parse_args():
|
|
|
30
30
|
|
|
31
31
|
parser.add_argument("--output", type=str, required=True)
|
|
32
32
|
|
|
33
|
+
parser.add_argument("--cut", type=str, default=None, nargs="+")
|
|
33
34
|
parser.add_argument("--friend-path", type=str, nargs="+", default=None)
|
|
34
35
|
parser.add_argument("--friend-tree", type=str, default=None)
|
|
35
|
-
parser.add_argument("--
|
|
36
|
+
parser.add_argument("--min-entries", type=int, default=50)
|
|
37
|
+
parser.add_argument("--max-attempts", type=int, default=5)
|
|
36
38
|
parser.add_argument("--weight", type=str, default=None, nargs="+")
|
|
37
39
|
parser.add_argument("--threads", type=int, default=1)
|
|
38
40
|
|
|
41
|
+
parser.add_argument("--no-trig", action="store_true")
|
|
42
|
+
|
|
39
43
|
return parser.parse_args()
|
|
40
44
|
|
|
41
45
|
|
|
@@ -92,6 +96,9 @@ def main(args=None):
|
|
|
92
96
|
fit_kwargs={
|
|
93
97
|
"NumCPU": args.threads,
|
|
94
98
|
},
|
|
99
|
+
max_attempts=args.max_attempts,
|
|
100
|
+
min_entries=args.min_entries,
|
|
101
|
+
trig_effs=not (args.no_trig),
|
|
95
102
|
)
|
|
96
103
|
sweights_eff.write(args.output)
|
|
97
104
|
|
|
@@ -34,7 +34,6 @@ class BaseEff:
|
|
|
34
34
|
particle (str): Particle to seek TIS/TOS branches for
|
|
35
35
|
tos (Union[str, List[str]]): Trigger line(s) to be used as TOS
|
|
36
36
|
tis (Union[str, List[str]]): Trigger line(s) to be used as TIS
|
|
37
|
-
trig (Union[str, List[str]]): Trigger line(s) to be used as trigger
|
|
38
37
|
min_entries (float): minimum number of entries in each category required to evaluate trigger efficiency
|
|
39
38
|
uncertainty_method (Literal["poisson", "generalised_wilson", "standard_wilson"]): method with which to evaluate statistical uncertainties
|
|
40
39
|
weight (Union[str, List[str]]): weight branch
|
|
@@ -43,6 +43,7 @@ class FitCountEff(BaseEff):
|
|
|
43
43
|
ws_pdf: str = None,
|
|
44
44
|
fit_kwargs: Dict = {},
|
|
45
45
|
plot_kwargs: Dict = {},
|
|
46
|
+
max_attempts: int = 5,
|
|
46
47
|
*args,
|
|
47
48
|
**kwargs,
|
|
48
49
|
):
|
|
@@ -68,6 +69,7 @@ class FitCountEff(BaseEff):
|
|
|
68
69
|
|
|
69
70
|
self.fit_kwargs = fit_kwargs
|
|
70
71
|
self.plot_kwargs = plot_kwargs
|
|
72
|
+
self.max_attempts = max_attempts
|
|
71
73
|
|
|
72
74
|
assert (
|
|
73
75
|
int(fit_description is not None)
|
|
@@ -194,6 +196,7 @@ class FitCountEff(BaseEff):
|
|
|
194
196
|
if self.pdf is not None
|
|
195
197
|
else None
|
|
196
198
|
),
|
|
199
|
+
max_attempts=self.max_attempts,
|
|
197
200
|
)
|
|
198
201
|
|
|
199
202
|
# And finally now
|
|
@@ -34,6 +34,8 @@ class Fitter:
|
|
|
34
34
|
data: R.RooDataSet,
|
|
35
35
|
model: Union[dict, Model] = None,
|
|
36
36
|
pdf: R.RooAddPdf = None,
|
|
37
|
+
max_attempts: int = 5,
|
|
38
|
+
verbose: bool = False,
|
|
37
39
|
):
|
|
38
40
|
"""
|
|
39
41
|
Constructor for the `Fitter` class
|
|
@@ -43,6 +45,8 @@ class Fitter:
|
|
|
43
45
|
data (R.RooDataSet): data to be fit
|
|
44
46
|
model (Union[dict, Model], optional): model to be used in the fit. Defaults to None.
|
|
45
47
|
pdf (R.RooAddPdf, optional): extended PDF to be used in the fit. Defaults to None.
|
|
48
|
+
max_attempts (int): number of times to try performing the fit. Defaults to 5.
|
|
49
|
+
verbose (bool): whether to print additional outputs. Defaults to False.
|
|
46
50
|
|
|
47
51
|
Note:
|
|
48
52
|
Exactly one of model and pdf must be passed.
|
|
@@ -62,6 +66,8 @@ class Fitter:
|
|
|
62
66
|
|
|
63
67
|
self.model = model
|
|
64
68
|
self.fit_result = None
|
|
69
|
+
self.max_attempts = max_attempts
|
|
70
|
+
self.verbose = verbose
|
|
65
71
|
|
|
66
72
|
def fit(self, **kwargs):
|
|
67
73
|
"""
|
|
@@ -86,7 +92,16 @@ class Fitter:
|
|
|
86
92
|
if kwargs["Save"] is False:
|
|
87
93
|
raise ValueError("Fit must be performed with `Save=True`")
|
|
88
94
|
|
|
89
|
-
|
|
95
|
+
n_attempts = 0
|
|
96
|
+
while n_attempts < self.max_attempts:
|
|
97
|
+
n_attempts += 1
|
|
98
|
+
self.fit_result = self.model.pdf.fitTo(self.data, **kwargs)
|
|
99
|
+
if self.fit_result.status() == 0 and self.fit_result.covQual() == 3:
|
|
100
|
+
if self.verbose:
|
|
101
|
+
print(f"INFO: Fit succeeded on attempt {n_attempts}")
|
|
102
|
+
return self.fit_result
|
|
103
|
+
if self.verbose:
|
|
104
|
+
print(f"WARNING: Fit did not succeed after {n_attempts} attempts")
|
|
90
105
|
return self.fit_result
|
|
91
106
|
|
|
92
107
|
def plot(self, path: str = None, **kwargs):
|
|
@@ -46,6 +46,7 @@ class SWeightsEff(BaseEff):
|
|
|
46
46
|
ws_pdf: str = None,
|
|
47
47
|
fit_kwargs: Dict = {},
|
|
48
48
|
plot_kwargs: Dict = {},
|
|
49
|
+
max_attempts: int = 5,
|
|
49
50
|
*args,
|
|
50
51
|
**kwargs,
|
|
51
52
|
):
|
|
@@ -83,6 +84,7 @@ class SWeightsEff(BaseEff):
|
|
|
83
84
|
|
|
84
85
|
self.fit_kwargs = fit_kwargs
|
|
85
86
|
self.plot_kwargs = plot_kwargs
|
|
87
|
+
self.max_attempts = max_attempts
|
|
86
88
|
|
|
87
89
|
self.fit_description = None
|
|
88
90
|
self.pdf = None
|
|
@@ -200,6 +202,7 @@ class SWeightsEff(BaseEff):
|
|
|
200
202
|
if self.pdf is not None
|
|
201
203
|
else None
|
|
202
204
|
),
|
|
205
|
+
self.max_attempts,
|
|
203
206
|
)
|
|
204
207
|
|
|
205
208
|
def _sweight_counts(self):
|
|
@@ -72,8 +72,9 @@ class Sideband:
|
|
|
72
72
|
signal_width / (lower_sideband_width + upper_sideband_width)
|
|
73
73
|
"""
|
|
74
74
|
if not (width):
|
|
75
|
-
width =
|
|
76
|
-
|
|
75
|
+
width = self.signal[1] - self.signal[0]
|
|
76
|
+
|
|
77
|
+
return width / np.sum(np.diff(self.sidebands))
|
|
77
78
|
|
|
78
79
|
def range_cut(self):
|
|
79
80
|
"""Generate a cut string for the full variable range
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '2.0.8'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 0, 8)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|