Belle II Software development
dqmTest.py
1
8
9import basf2 as b2
10
11
12def add_neuro_2d_unpackers(path, debug_level=4, debugout=True):
13 unpacker = b2.register_module('CDCTriggerUnpacker')
14 if debugout:
15 unpacker.logging.log_level = b2.LogLevel.DEBUG
16 # increase this value to get debug mesages in more detail
17 unpacker.logging.debug_level = debug_level
18 unpacker.logging.set_info(b2.LogLevel.DEBUG, b2.LogInfo.LEVEL | b2.LogInfo.MESSAGE)
19 # size (number of words) of the Belle2Link header
20 unpacker.param('headerSize', 3)
21 # unpack the data from the 2D tracker and save its Bitstream
22 unpacker.param('unpackTracker2D', True)
23 # make CDCTriggerTrack and CDCTriggerSegmentHit objects from the 2D output
24 unpacker.param('decode2DFinderTrack', True)
25 # make CDCTriggerSegmentHit objects from the 2D input
26 unpacker.param('decode2DFinderInput', True)
27 unpacker.param('2DNodeId', [
28 [0, 0],
29 [0x11000001, 0],
30 [0, 0],
31 [0, 0]])
32 unpacker.param('NeuroNodeId', [
33 [0x11000001, 1],
34 [0, 0],
35 [0, 0],
36 [0, 0]])
37
38 unpacker.param('unpackNeuro', True)
39 unpacker.param('decodeNeuro', True)
40 path.add_module(unpacker)
41
42
43b2.set_log_level(b2.LogLevel.ERROR)
44b2.use_database_chain()
45b2.use_central_database("data_reprocessing_prod6")
46
47main = b2.create_path()
48dstfiles = ['/hsm/belle2/bdata/Data/\
49release-02-01-00/DB00000438/prod00000006/e0003/4S/\
50r05613/all/dst/sub00/dst.physics.0003.05613.HLT2.f00000.root']
51main.add_module("RootInput", inputFileNames=dstfiles)
52add_neuro_2d_unpackers(main, debug_level=2, debugout=False)
53
54main.add_module('HistoManager',
55 histoFileName='histogram.root')
56
57main.add_module('CDCTriggerDQM')
58main.add_module('Progress')
59
60b2.process(main)
61print(b2.statistics)