Belle II Software  release-08-01-10
RecvStream2.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 
18 
19 import basf2 as b2
20 import sys
21 argvs = sys.argv
22 if 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
27 b2.set_log_level(b2.LogLevel.INFO)
28 
29 # Modules
30 processor = b2.register_module('DesSerPrePCMain')
31 
32 # Processor
33 processor.param('HostNameFrom', argvs[1])
34 processor.param('PortTo', int(argvs[3]))
35 
36 processor.param('NodeID', 3) # ROPC node ID (only used for Run control)
37 processor.param('NodeName', argvs[4]) # node name for Run control
38 use_shm_flag = int(argvs[2])
39 processor.param('UseShmFlag', use_shm_flag)
40 
41 # Create main path
42 main = b2.create_path()
43 
44 # Add modules to main path
45 main.add_module(processor)
46 
47 # Process all events
48 b2.process(main)