Belle II Software  release-08-01-10
DataStorager.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 
25 
26 import basf2 as b2
27 import sys
28 argv = sys.argv
29 
30 # Set the log level to show only error and fatal messages
31 # set_log_level(LogLevel.ERROR)
32 # set_log_level(LogLevel.INFO)
33 
34 # gearbox = register_module('Gearbox')
35 # SVDUnpack = register_module('SVDUnpacker')
36 # SVDClust = register_module('SVDClusterizer')
37 # vxdtf = register_module('VXDTF')
38 # SVD_DQM = register_module('SVDDQM')
39 # vxdtf_dqm = register_module('VXDTFDQM')
40 # trackfitter = register_module('GenFitter')
41 # roiprod = register_module('PXDDataReduction')
42 # roipayload = register_module('ROIPayloadAssembler')
43 
44 # Modules
45 deserializer = b2.register_module('StorageDeserializer')
46 deserializer.param('InputBufferName', argv[1])
47 deserializer.param('InputBufferSize', int(argv[2]))
48 if len(argv) >= 6:
49  deserializer.param('NodeName', argv[5])
50  deserializer.param('NodeID', int(argv[6]))
51  deserializer.param('UseShmFlag', int(argv[7]))
52  deserializer.param('EB2', int(argv[8]))
53 output = b2.register_module('StorageSerializer')
54 output.param('OutputBufferName', argv[3])
55 output.param('OutputBufferSize', int(argv[4]))
56 output.param('NodeID', int(argv[6]))
57 output.param('compressionLevel', 0)
58 
59 # Create main path
60 main = b2.create_path()
61 
62 # Add modules to main path
63 main.add_module(deserializer)
64 main.add_module(output)
65 
66 # Process all events
67 b2.process(main)