Belle II Software development
PackUnpackError.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12
13# suppress messages and warnings during processing:
14b2.set_log_level(b2.LogLevel.WARNING)
15
16# to run the framework the used modules need to be registered
17eventinfosetter = b2.register_module('EventInfoSetter')
18# Setting the option for all non-hepevt reader modules:
19eventinfosetter.param('evtNumList', [80]) # we want to process nr defined error events
20eventinfosetter.param('runList', [1]) # from run number 1
21eventinfosetter.param('expList', [1]) # and experiment number 1
22
23packer = b2.register_module('PXDPackerErr')
24# [[dhhc1, dhh1, dhh2, dhh3, dhh4, dhh5] [ ... ]]
25# -1 is disable port
26packer.param('dhe_to_dhc', [
27 [0, 2]
28])
29# packer.param('dhe_to_dhc', [
30# [0, 2, 4, 34, 36, 38],
31# [1, 6, 8, 40, 42, 44],
32# [2, 10, 12, 46, 48, 50],
33# [3, 14, 16, 52, 54, 56],
34# [4, 3, 5, 35, 37, 39],
35# [5, 7, 9, 41, 43, 45],
36# [6, 11, 13, 47, 49, 51],
37# [7, 15, 17, 53, 55, 57],
38# ])
39
40unpacker = b2.register_module('PXDUnpacker')
41unpacker.param('ContinueOnError', True)
42unpacker.param("overrideFirmwareVersion", 10)
43
44packercheck = b2.register_module('PXDPackerErr')
45packercheck.param('dhe_to_dhc', [
46 [0, 2]
47])
48
49b2.logging.enable_summary(False)
50
51# creating minimal path for test
52main = b2.create_path()
53main.add_module(eventinfosetter)
54main.add_module(packer)
55unpacker.set_log_level(b2.LogLevel.WARNING) # this does not work yet, will fall back to ERROR
56main.add_module(unpacker)
57packercheck.set_log_level(b2.LogLevel.INFO) # tell us more in the log in case of any problem
58main.add_module(packercheck, Check=True)
59
60b2.process(main)
61
62# EOF.