atlas-ftag-tools 0.0.8__tar.gz → 0.0.9__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.
Files changed (24) hide show
  1. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/PKG-INFO +25 -1
  2. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/README.md +24 -0
  3. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/atlas_ftag_tools.egg-info/PKG-INFO +25 -1
  4. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/atlas_ftag_tools.egg-info/entry_points.txt +1 -0
  5. atlas-ftag-tools-0.0.9/ftag/__init__.py +25 -0
  6. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/flavour.py +10 -0
  7. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/vds.py +5 -3
  8. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/pyproject.toml +1 -0
  9. atlas-ftag-tools-0.0.8/ftag/__init__.py +0 -23
  10. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/MANIFEST.in +0 -0
  11. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/atlas_ftag_tools.egg-info/SOURCES.txt +0 -0
  12. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/atlas_ftag_tools.egg-info/dependency_links.txt +0 -0
  13. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/atlas_ftag_tools.egg-info/requires.txt +0 -0
  14. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/atlas_ftag_tools.egg-info/top_level.txt +0 -0
  15. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/cuts.py +0 -0
  16. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/flavours.yaml +0 -0
  17. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/hdf5/__init__.py +0 -0
  18. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/hdf5/h5reader.py +0 -0
  19. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/hdf5/h5utils.py +0 -0
  20. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/hdf5/h5writer.py +0 -0
  21. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/mock.py +0 -0
  22. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/region.py +0 -0
  23. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/ftag/sample.py +0 -0
  24. {atlas-ftag-tools-0.0.8 → atlas-ftag-tools-0.0.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atlas-ftag-tools
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Summary: ATLAS Flavour Tagging Tools
5
5
  Author: Sam Van Stroud, Philipp Gadow
6
6
  License: MIT
@@ -50,3 +50,27 @@ The script is `vds.py` and can be run after installing this package with
50
50
  ```
51
51
  vds <pattern> <output path>
52
52
  ```
53
+
54
+ The `<pattern>` argument should be a quotes enclosed [glob pattern](https://en.wikipedia.org/wiki/Glob_(programming)), for example `"dsid/path/*.h5"`
55
+
56
+
57
+ ## Calculate WPs
58
+
59
+ This package contains a script to calculate tagger working points (WPs).
60
+ The script is `working_points.py` and can be run after installing this package with
61
+
62
+ ```
63
+ wps \
64
+ --ttbar "path/to/ttbar/*.h5" \
65
+ --tagger GN120220509 \
66
+ --fx 0.1
67
+ ```
68
+
69
+ Both the `--tagger` and `--fx` options accept a list if you want to get the WPs for multiple taggers.
70
+
71
+ If you want to use the `ttbar` WPs get the efficiencies and rejections for the `zprime` sample, you can add `--zprime "path/to/zprime/*.h5"` to the command.
72
+ Note that a default selection of $p_T > 250 ~GeV$ to jets in the `zprime` sample.
73
+
74
+ By default the working points are printed to the terminal, but you can save the results to a YAML file with the `--outfile` option.
75
+
76
+ Use `--help` for more options and information.
@@ -39,3 +39,27 @@ The script is `vds.py` and can be run after installing this package with
39
39
  ```
40
40
  vds <pattern> <output path>
41
41
  ```
42
+
43
+ The `<pattern>` argument should be a quotes enclosed [glob pattern](https://en.wikipedia.org/wiki/Glob_(programming)), for example `"dsid/path/*.h5"`
44
+
45
+
46
+ ## Calculate WPs
47
+
48
+ This package contains a script to calculate tagger working points (WPs).
49
+ The script is `working_points.py` and can be run after installing this package with
50
+
51
+ ```
52
+ wps \
53
+ --ttbar "path/to/ttbar/*.h5" \
54
+ --tagger GN120220509 \
55
+ --fx 0.1
56
+ ```
57
+
58
+ Both the `--tagger` and `--fx` options accept a list if you want to get the WPs for multiple taggers.
59
+
60
+ If you want to use the `ttbar` WPs get the efficiencies and rejections for the `zprime` sample, you can add `--zprime "path/to/zprime/*.h5"` to the command.
61
+ Note that a default selection of $p_T > 250 ~GeV$ to jets in the `zprime` sample.
62
+
63
+ By default the working points are printed to the terminal, but you can save the results to a YAML file with the `--outfile` option.
64
+
65
+ Use `--help` for more options and information.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atlas-ftag-tools
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Summary: ATLAS Flavour Tagging Tools
5
5
  Author: Sam Van Stroud, Philipp Gadow
6
6
  License: MIT
@@ -50,3 +50,27 @@ The script is `vds.py` and can be run after installing this package with
50
50
  ```
51
51
  vds <pattern> <output path>
52
52
  ```
53
+
54
+ The `<pattern>` argument should be a quotes enclosed [glob pattern](https://en.wikipedia.org/wiki/Glob_(programming)), for example `"dsid/path/*.h5"`
55
+
56
+
57
+ ## Calculate WPs
58
+
59
+ This package contains a script to calculate tagger working points (WPs).
60
+ The script is `working_points.py` and can be run after installing this package with
61
+
62
+ ```
63
+ wps \
64
+ --ttbar "path/to/ttbar/*.h5" \
65
+ --tagger GN120220509 \
66
+ --fx 0.1
67
+ ```
68
+
69
+ Both the `--tagger` and `--fx` options accept a list if you want to get the WPs for multiple taggers.
70
+
71
+ If you want to use the `ttbar` WPs get the efficiencies and rejections for the `zprime` sample, you can add `--zprime "path/to/zprime/*.h5"` to the command.
72
+ Note that a default selection of $p_T > 250 ~GeV$ to jets in the `zprime` sample.
73
+
74
+ By default the working points are printed to the terminal, but you can save the results to a YAML file with the `--outfile` option.
75
+
76
+ Use `--help` for more options and information.
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  vds = ftag.vds:main
3
+ wps = ftag.wps.working_points:main
@@ -0,0 +1,25 @@
1
+ """atlas-ftag-tools - Common tools for ATLAS flavour tagging software."""
2
+
3
+
4
+ __version__ = "v0.0.9"
5
+
6
+
7
+ import ftag.hdf5 as hdf5
8
+ from ftag.cuts import Cuts
9
+ from ftag.flavour import Flavour, Flavours
10
+ from ftag.mock import get_mock_file
11
+ from ftag.sample import Sample
12
+ from ftag.wps.discriminant import get_discriminant
13
+ from ftag.wps.working_points import get_working_points
14
+
15
+ __all__ = [
16
+ "Cuts",
17
+ "Flavour",
18
+ "Flavours",
19
+ "Sample",
20
+ "hdf5",
21
+ "get_mock_file",
22
+ "get_discriminant",
23
+ "get_working_points",
24
+ "__version__",
25
+ ]
@@ -2,6 +2,9 @@ from __future__ import annotations
2
2
 
3
3
  from collections.abc import Generator
4
4
  from dataclasses import dataclass
5
+ from pathlib import Path
6
+
7
+ import yaml
5
8
 
6
9
  from ftag.cuts import Cuts
7
10
 
@@ -74,3 +77,10 @@ class FlavourContainer:
74
77
  if flavour.cuts == cuts:
75
78
  return flavour
76
79
  raise KeyError(f"Flavour with {cuts} not found")
80
+
81
+
82
+ with open(Path(__file__).parent / "flavours.yaml") as f:
83
+ flavours_yaml = yaml.safe_load(f)
84
+ flavours_dict = {f["name"]: Flavour(cuts=Cuts.from_list(f.pop("cuts")), **f) for f in flavours_yaml}
85
+ assert len(flavours_dict) == len(flavours_yaml), "Duplicate flavour names detected"
86
+ Flavours = FlavourContainer(flavours_dict)
@@ -65,9 +65,11 @@ def create_virtual_file(
65
65
  def main():
66
66
  import argparse
67
67
 
68
- parser = argparse.ArgumentParser(description="Create a virtual dataset from a glob pattern")
69
- parser.add_argument("pattern", type=Path, help="Glob pattern of files to merge")
70
- parser.add_argument("output", type=Path, help="Output file name")
68
+ parser = argparse.ArgumentParser(
69
+ description="Create a lightweight wrapper around a set of h5 files"
70
+ )
71
+ parser.add_argument("pattern", type=Path, help="quotes-enclosed glob pattern of files to merge")
72
+ parser.add_argument("output", type=Path, help="path to output virtual file")
71
73
  args = parser.parse_args()
72
74
 
73
75
  print(f"Globbing {args.pattern}...")
@@ -28,6 +28,7 @@ dev = [
28
28
 
29
29
  [project.scripts]
30
30
  vds = "ftag.vds:main"
31
+ wps = "ftag.wps.working_points:main"
31
32
 
32
33
  [tool.setuptools]
33
34
  packages = ["ftag", "ftag.hdf5"]
@@ -1,23 +0,0 @@
1
- """atlas-ftag-tools - Common tools for ATLAS flavour tagging software."""
2
-
3
-
4
- __version__ = "v0.0.8"
5
-
6
- from pathlib import Path
7
-
8
- import yaml
9
-
10
- import ftag.hdf5 as hdf5
11
- from ftag.cuts import Cuts
12
- from ftag.flavour import Flavour, FlavourContainer
13
- from ftag.mock import get_mock_file
14
- from ftag.sample import Sample
15
-
16
- # load flavours
17
- with open(Path(__file__).parent / "flavours.yaml") as f:
18
- flavours_yaml = yaml.safe_load(f)
19
- flavours_dict = {f["name"]: Flavour(cuts=Cuts.from_list(f.pop("cuts")), **f) for f in flavours_yaml}
20
- assert len(flavours_dict) == len(flavours_yaml), "Duplicate flavour names detected"
21
- Flavours = FlavourContainer(flavours_dict)
22
-
23
- __all__ = ["Cuts", "Flavours", "Sample", "hdf5", "get_mock_file", "__version__"]