13from argparse
import ArgumentParser
18 """Print some random numbers to check reproducibility"""
21 """Make sure we can run in multiple processes"""
23 self.set_property_flags(basf2.ModulePropFlags.PARALLELPROCESSINGCERTIFIED)
24 self.
evt = ROOT.Belle2.PyStoreObj(
"EventMetaData")
27 """Print the first 5 random numbers"""
28 numbers = [f
"First 5 random values in event({self.evt.getExperiment()}, {self.evt.getRun()}, {self.evt.getEvent()}):"]
29 numbers += [
"%08x" % ROOT.gRandom.Integer(0xffffffff)
for i
in range(5)]
30 basf2.B2INFO(
" ".join(numbers))
33if __name__ ==
'__main__':
34 basf2.reset_database()
35 basf2.use_central_database(
"data_reprocessing_prompt")
36 basf2.set_nprocesses(2)
38 parser = ArgumentParser(description=
"Example steering file for the ZMQ tests")
39 parser.add_argument(
"--input", required=
True, help=
"ZMQ Input Address")
40 parser.add_argument(
"--output", required=
True, help=
"ZMQ Output Address")
41 parser.add_argument(
"--dqm", required=
False, default=
"", help=
"ZMQ DQM Address (or empty for no DQM)")
42 parser.add_argument(
"--raw", action=
"store_true", help=
"Send out data in raw format")
43 parser.add_argument(
"--expressreco", action=
"store_true", help=
"Also initialize express reco objects")
44 parser.add_argument(
"--mimik-startup", action=
"store_true", help=
"Mimik the geometry loading with a sleep")
46 args = parser.parse_args()
49 reco_path = basf2.Path()
51 input_module = add_input_module(path, input_address=args.input, add_expressreco_objects=args.expressreco)
54 add_reco_modules(reco_path, dqm_address=args.dqm, mimik_startup=args.mimik_startup)
56 input_module.if_value(
"==0", reco_path, basf2.AfterConditionPath.CONTINUE)
58 add_output_module(path, output_address=args.output, raw=args.raw)
61 hbasf2.process(path, [args.output, args.dqm],
False)
63 hbasf2.process(path, [args.output],
False)