Belle II Software development
RecvOnlyCOPPER.py
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3
4
11
12
25
26import basf2 as b2
27import sys
28argvs = sys.argv
29
30if len(argvs) < 6:
31 print('Usage : RecvSendCOPPER.py <COPPER hostname> <COPPER nodeID> <bit flag of FINNESEs> '
32 '<Use shared memory? yes=1/no=0> <nodename>')
33 sys.exit()
34
35# Set the log level to show only error and fatal messages
36b2.set_log_level(b2.LogLevel.ERROR)
37b2.set_log_level(b2.LogLevel.INFO)
38
39# Reader
40# reader = register_module('HSLBReaderArray')
41reader = b2.register_module('DeSerializerCOPPER')
42reader.param('NodeID', int(argvs[2]))
43reader.param('FinesseBitFlag', int(argvs[3]))
44use_shm_flag = int(argvs[4])
45reader.param('UseShmFlag', use_shm_flag)
46reader.param('NodeName', argvs[5])
47# reader.param('DumpFileName', 'COPPERdump.dat' )
48
49# Histo Module
50# histo = register_module('HistoManager')
51# main.add_module (histo)
52histo = b2.register_module('DqmHistoManager')
53histo.param('HostName', 'ropc04')
54histo.param('Port', 9991)
55histo.param('DumpInterval', 10)
56
57histo.param('HistoFileName', 'histo_file_'.join([argvs[1], '.root']))
58
59# Monitor module
60monitor = b2.register_module('MonitorDataCOPPER')
61
62# Sender
63sender = b2.register_module('Serializer')
64sender.param('DestPort', 30000)
65# sender.param('LocalHostName', 'cpr006')
66sender.param('LocalHostName', argvs[1])
67
68# Create main path
69main = b2.create_path()
70
71# Add modules to main path
72main.add_module(reader)
73# if use_shm_flag != 0:
74# main.add_module(histo)
75# main.add_module(monitor)
76# main.add_module(sender)
77
78# Process all events
79b2.process(main)