Belle II Software development
RecvStream2.py
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3
4
11
12
18
19import basf2 as b2
20import sys
21argvs = sys.argv
22if len(argvs) != 5:
23 print('Usage : RecvStream2.py <COPPER hostname> <Use NSM(Network Shared Memory)? yes=1/no=0> <port # of eb0> <NSM nodename>')
24 sys.exit()
25
26# Set the log level to show only error and fatal messages
27b2.set_log_level(b2.LogLevel.INFO)
28
29# Modules
30processor = b2.register_module('DesSerPrePCMain')
31
32# Processor
33processor.param('HostNameFrom', argvs[1])
34processor.param('PortTo', int(argvs[3]))
35
36processor.param('NodeID', 3) # ROPC node ID (only used for Run control)
37processor.param('NodeName', argvs[4]) # node name for Run control
38use_shm_flag = int(argvs[2])
39processor.param('UseShmFlag', use_shm_flag)
40
41# Create main path
42main = b2.create_path()
43
44# Add modules to main path
45main.add_module(processor)
46
47# Process all events
48b2.process(main)