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