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