12Check for possible problems on the processing path that will affect HLT procesing
141. Conditions not continuing to main path
16 On HLT we never want to just end processing, we always want to reach the end
17 to send the event on to the output. So make sure no conditions with
18 AfterConditionPath.END
is present.
202. Multiple EventErrorFlags on one path
22 We don
't want to sent multiple error flags unconditionally after each other so if there are two ore more EventErrorFlags on one path this
is wrong.
28from softwaretrigger import constants
29from softwaretrigger.processing import add_hlt_processing
33 """Just print a short version of the path"""
34 return '[' +
" -> ".join(m.name()
for m
in path.modules()) +
']'
38 """Check the given path recursively"""
43 for m
in path.modules():
44 if m.type()
in max_number:
45 max_number[m.type()] -= 1
46 if max_number[m.type()] < 0:
47 basf2.B2ERROR(
"Too many identical modules in path", type=m.type(), path=short_path(path))
50 for c
in m.get_all_conditions():
51 if c.get_after_path() != basf2.AfterConditionPath.CONTINUE:
52 basf2.B2ERROR(f
"Condition on '{m.name()}' doesn't return to original path, potential loss of events",
55 result &= check_path(c.get_path())
59if __name__ ==
"__main__":
61 for run_type, mode
in itertools.product(constants.RunTypes, constants.SoftwareTriggerModes):
62 basf2.B2INFO(f
"Checking processing path for {run_type} in {mode} mode")
64 add_hlt_processing(path, run_type=run_type, softwaretrigger_mode=mode)
65 basf2.print_path(path)
66 if not check_path(path):
67 basf2.B2ERROR(f
"Problems found for {run_type} in {mode} mode")
70 sys.exit(0
if all_good
else 1)