Belle II Software  release-08-01-10
runTOPDQM.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 
14 b2.set_log_level(b2.LogLevel.ERROR)
15 
16 # Create path
17 main = b2.create_path()
18 
19 # input
20 roinput = b2.register_module('SeqRootInput')
21 main.add_module(roinput)
22 
23 # conversion from RawCOPPER or RawDataBlock to RawTOP
24 # converter = register_module('Convert2RawDet')
25 # main.add_module(converter)
26 
27 # geometry parameters
28 gearbox = b2.register_module('Gearbox')
29 main.add_module(gearbox)
30 
31 # Geometry (only TOP needed)
32 geometry = b2.register_module('Geometry')
33 geometry.param('components', ['TOP'])
34 main.add_module(geometry)
35 
36 # Unpacking
37 unpack = b2.register_module('TOPUnpacker')
38 unpack.param('swapBytes', True)
39 unpack.param('dataFormat', 0x0301)
40 main.add_module(unpack)
41 
42 # Convert to TOPDigits
43 converter = b2.register_module('TOPRawDigitConverter')
44 converter.param('useSampleTimeCalibration', False)
45 converter.param('useChannelT0Calibration', False)
46 converter.param('useModuleT0Calibration', False)
47 converter.param('useCommonT0Calibration', False)
48 main.add_module(converter)
49 
50 # TOP's data quality module
51 # histo = register_module("HistoManager")
52 histo = b2.register_module("DqmHistoManager")
53 histo.param('HostName', 'localhost')
54 histo.param('Port', 9991)
55 histo.param('DumpInterval', 1000)
56 main.add_module(histo)
57 
58 dqm = b2.register_module('TOPDataQualityOnline')
59 main.add_module(dqm)
60 
61 # Print progress
62 progress = b2.register_module('Progress')
63 main.add_module(progress)
64 
65 # Process events
66 b2.process(main)
67 
68 # Print statistics
69 print(b2.statistics)