Belle II Software  release-08-01-10
DummyDataPacker.py
1 #!/usr/bin/env python3
2 
3 
10 
11 import basf2 as b2
12 import sys
13 argvs = sys.argv
14 
15 if len(argvs) < 3:
16  print('Usage : DummyDataPacker.py <# of events> <output filename>')
17  sys.exit()
18 
19 # Set the log level to show only error and fatal messages
20 b2.set_log_level(b2.LogLevel.ERROR)
21 b2.set_log_level(b2.LogLevel.INFO)
22 
23 # Reader
24 max_event = int(argvs[1])
25 packer = b2.register_module('DummyDataPacker')
26 packer.param('MaxEventNum', max_event)
27 
28 # File output
29 # dump = register_module('SeqRootOutput')
30 dump = b2.register_module('RootOutput')
31 dump.param('outputFileName', argvs[2])
32 
33 # Create main path
34 main = b2.create_path()
35 
36 # Add modules to main path
37 main.add_module(packer)
38 main.add_module(dump)
39 
40 # Process all events
41 b2.process(main)