Belle II Software light-2507-europa
helpers.py
1# This script contains the utility functions used for flavor tagging
2
3
4def get_Belle_or_Belle2():
5 """
6 Gets the global ModeCode.
7 """
8 # imports
9 import b2bii
10
11 if b2bii.isB2BII():
12 return 'Belle'
13 else:
14 return 'Belle2'
15
16
17def read_yaml(filepath: str):
18 """
19 Reads the yaml file contents and returns a dictionary object.
20 """
21 # imports
22 import yaml
23 from basf2 import B2FATAL
24
25 with open(filepath) as stream:
26 try:
27 data = yaml.safe_load(stream)
28 except yaml.YAMLError as exc:
29 B2FATAL(exc)
30
31 return data
isB2BII()
Definition b2bii.py:14