Belle II Software  release-05-01-25
assert_correct_modules_on_hlt.py
1 # Test for some modules in the current HLT reconstruction path
2 #
3 # Author: Nils Braun
4 import basf2
5 from softwaretrigger.processing import add_hlt_processing
6 
7 from softwaretrigger.constants import SoftwareTriggerModes, RunTypes
8 
9 
10 def yield_module_names(path):
11  for m in path.modules():
12  yield m.name()
13  for sub_path in m.get_all_condition_paths():
14  yield from yield_module_names(sub_path)
15 
16 
17 if __name__ == "__main__":
18  path = basf2.create_path()
19  add_hlt_processing(path, run_type=RunTypes.beam, softwaretrigger_mode=SoftwareTriggerModes.filter)
20 
21  module_names = list(yield_module_names(path))
22  assert "SoftwareTriggerHLTDQM" in module_names
23  assert "SoftwareTrigger" in module_names
24  assert "Geometry" in module_names
25  assert "Gearbox" in module_names
26  assert "HistoManager" not in module_names
softwaretrigger.constants
Definition: constants.py:1
softwaretrigger.processing
Definition: processing.py:1