Belle II Software development
PackUnpackFileDQM.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.INFO)
15
16input = b2.register_module('RootInput')
17input.param('inputFileName', 'PXDRawHit.root')
18
19input.param('branchNames', ['EventMetaData', 'PXDDigits', 'PXDDigit'])
20# 'RawPXDs',
21
22# to run the framework the used modules need to be registered
23# eventinfosetter = register_module('EventInfoSetter')
24# Setting the option for all non-hepevt reader modules:
25# eventinfosetter.param('evtNumList', [10]) # we want to process 100 events
26# eventinfosetter.param('runList', [1]) # from run number 1
27# eventinfosetter.param('expList', [1]) # and experiment number 1
28
29histoman = b2.register_module('HistoManager')
30histoman.param('histoFileName', 'your_histo_file.root')
31
32packer = b2.register_module('PXDPacker')
33# [[dhhc1, dhh1, dhh2, dhh3, dhh4, dhh5] [ ... ]]
34# -1 is disable port
35packer.param('dhe_to_dhc', [
36 [0, 2, 4, 34, 36, 38],
37 [1, 6, 8, 40, 42, 44],
38 [2, 10, 12, 46, 48, 50],
39 [3, 14, 16, 52, 54, 56],
40 [4, 3, 5, 35, 37, 39],
41 [5, 7, 9, 41, 43, 45],
42 [6, 11, 13, 47, 49, 51],
43 [7, 15, 17, 53, 55, 57],
44])
45
46# packer.param('dhh_to_dhhc', [
47# [ 1, 1, 2, 3, -1, 5, ],
48# [ 2, 10, 11, 12, 13, 14, ],
49# [ 3, -1, 16 ],
50# [ 4 ],
51# [ 5, 35 ]
52# ])
53
54unpacker = b2.register_module('PXDUnpacker')
55
56simpleoutput = b2.register_module('RootOutput')
57simpleoutput.param('outputFileName', 'Output.root')
58
59# Load parameters
60gearbox = b2.register_module('Gearbox')
61
62# Create geometry
63geometry = b2.register_module('Geometry')
64
65# Select subdetectors to be built
66# geometry.param('Components', ['PXD','SVD'])
67geometry.param('components', ['PXD'])
68
69
70# creating the path for the processing
71main = b2.create_path()
72main.add_module(input)
73main.add_module(gearbox)
74main.add_module(geometry)
75# main.add_module(eventinfosetter)
76# main.add_module(paramloader)
77# main.add_module(geobuilder)
78main.add_module(histoman)
79main.add_module(packer)
80main.add_module(unpacker)
81main.add_module('PXDDAQDQM')
82# main.add_module('PXDRawDQM')
83# main.add_module('PXDROIDQM')
84main.add_module('Progress')
85main.add_module(simpleoutput)
86
87# Process the events
88b2.process(main)
89# if there are less events in the input file the processing will be stopped at
90# EOF.