Belle II Software development
DummyDataPacker.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12import sys
13argvs = sys.argv
14
15if 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
20b2.set_log_level(b2.LogLevel.ERROR)
21b2.set_log_level(b2.LogLevel.INFO)
22
23# Reader
24max_event = int(argvs[1])
25packer = b2.register_module('DummyDataPacker')
26packer.param('MaxEventNum', max_event)
27
28# File output
29# dump = register_module('SeqRootOutput')
30dump = b2.register_module('RootOutput')
31dump.param('outputFileName', argvs[2])
32
33# Create main path
34main = b2.create_path()
35
36# Add modules to main path
37main.add_module(packer)
38main.add_module(dump)
39
40# Process all events
41b2.process(main)