Belle II Software  release-08-01-10
PrintEventRate.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
24 
25 import basf2 as b2
26 import sys
27 
28 # Set the log level to show only error and fatal messages
29 # set_log_level(LogLevel.ERROR)
30 b2.set_log_level(b2.LogLevel.INFO)
31 
32 # input
33 argvs = sys.argv
34 input = b2.register_module('SeqRootInput')
35 input.param('fileNameIsPattern', True)
36 # input.param('fileNameIsPattern', False )
37 # input.param('inputFileName', '/x02/data/e0000r000554.sroot')
38 # input.param('inputFileName', '/rawdata/disk01/storage/0001/03218/cosmic.0001.03218.HLT1.f%05d.sroot')
39 input.param('inputFileName', argvs[1])
40 
41 
42 # rate
43 rate = b2.register_module('PrintEventRate')
44 rate.param('PrintInterval', 60)
45 # unpack = register_module('CDCUnpacker')
46 
47 dump = b2.register_module('RootOutput')
48 prog = b2.register_module('Progress')
49 
50 # Create main path
51 main = b2.create_path()
52 
53 # Add modules to main path
54 main.add_module(input)
55 # main.add_module(output)
56 main.add_module(rate)
57 # main.add_module(dump)
58 # main.add_module(unpack)
59 # main.add_module(prog)
60 
61 # Process all events
62 b2.process(main)