9from iov_conditional
import phase_2_conditional, make_conditional_at
13 """Print the given string on each event"""
16 """Remember the given string to print later"""
22 """And now would be a good time for printing ..."""
26def simulate_run(run_numbers, exp_numbers):
27 assert len(exp_numbers) == len(run_numbers)
29 path = basf2.create_path()
31 path.add_module(
"EventInfoSetter", evtNumList=[1] * len(run_numbers), runList=run_numbers, expList=exp_numbers)
32 path.add_module(
"EventInfoPrinter")
35 phase2_path = basf2.create_path()
39 phase3_path = basf2.create_path()
43 no_phase3_path = basf2.create_path()
44 no_phase3_path.add_module(
PrinterModule(
"Phase 3 is not here"))
47 weird_path = basf2.create_path()
51 phase_2_conditional(path, phase2_path=phase2_path)
54 make_conditional_at(path, iov_list=[(0, 0, 0, -1)], path_when_in_iov=phase3_path, path_when_not_in_iov=no_phase3_path)
57 make_conditional_at(path, iov_list=[(42, 42, 47, 47)], path_when_in_iov=weird_path)
65if __name__ ==
"__main__":
66 basf2.set_random_seed(1)
67 simulate_run(exp_numbers=[0, 1002], run_numbers=[1, 67])
68 simulate_run(exp_numbers=[42, 43, 47], run_numbers=[41, 1, 48])
_print_string
The string we want to print each event.
def __init__(self, print_string)