Belle II Software
development
check_payload_names.py
1
8
'''
9
Check if the database correctly returns the names of all the payloads used by the basf2 process.
10
'''
11
12
import
basf2
as
b2
13
import
b2test_utils
as
b2tu
14
15
16
class
CheckPayloadNames
(b2.Module):
17
'''
18
Small module that asks
for
some payloads
and
checks their names.
19
'''
20
21
def
__init__
(self):
22
'''Constructor.'''
23
from
ROOT
import
Belle2
as
B2
24
super().
__init__
()
25
26
self.
payload_names
= [
27
'BeamParameters'
,
28
'BeamSpot'
,
29
'BunchStructure'
,
30
'CollisionBoostVector'
,
31
'HardwareClockSettings'
,
32
'MagneticField'
]
33
self.
payload_names
.sort()
34
for
payload_name
in
self.
payload_names
:
35
B2.PyDBObj(payload_name)
36
37
def
event
(self):
38
'''Event.'''
39
from
ROOT
import
Belle2
as
B2
# this is only run once
40
payload_names = sorted(B2.Database.Instance().getAllDataNames())
41
print(
'Set payloads:'
, self.
payload_names
)
42
print(
'Got payloads:'
, payload_names)
43
assert
(self.
payload_names
== payload_names)
44
45
46
if
__name__ ==
'__main__'
:
47
48
with
b2tu.clean_working_directory():
49
main = b2.Path()
50
main.add_module(
'EventInfoSetter'
, expList=[0], runList=[0], evtNumList=[1])
51
main.add_module(
CheckPayloadNames
())
52
b2.process(main)
check_payload_names.CheckPayloadNames
Definition:
check_payload_names.py:16
check_payload_names.CheckPayloadNames.payload_names
payload_names
Payload names to be required.
Definition:
check_payload_names.py:26
check_payload_names.CheckPayloadNames.__init__
def __init__(self)
Definition:
check_payload_names.py:21
check_payload_names.CheckPayloadNames.event
def event(self)
Definition:
check_payload_names.py:37
framework
tests
check_payload_names.py
Generated on Fri Nov 8 2024 02:37:56 for Belle II Software by
1.9.6