Belle II Software development
DataStorager.py
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3
4
11
12
25
26import basf2 as b2
27import sys
28argv = 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
45deserializer = b2.register_module('StorageDeserializer')
46deserializer.param('InputBufferName', argv[1])
47deserializer.param('InputBufferSize', int(argv[2]))
48if 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]))
53output = b2.register_module('StorageSerializer')
54output.param('OutputBufferName', argv[3])
55output.param('OutputBufferSize', int(argv[4]))
56output.param('NodeID', int(argv[6]))
57output.param('compressionLevel', 0)
58
59# Create main path
60main = b2.create_path()
61
62# Add modules to main path
63main.add_module(deserializer)
64main.add_module(output)
65
66# Process all events
67b2.process(main)