Belle II Software development
printMappings.py
1#!/usr/bin/env python
2
3
10
11import basf2 as b2
12import sys
13
14# ---------------------------------------------------------------------------
15# Prints mapping of TOP electronic channels to pixels and to front end mapping
16# e.g. scrods to slot/boardstacks
17#
18# Usage: basf2 top/analysis/printMappings.py
19#
20# The filename of the main xml file can be specified as an optional argument
21# example: basf2 top/analysis/printMappings.py top/TOPSpareModule.xml
22# (hint: omit 'data' from the path)
23# ---------------------------------------------------------------------------
24
25# Suppress messages and warnings for all other packages
26b2.set_log_level(b2.LogLevel.ERROR)
27
28# set DEBUG level for top only to print mappings
29b2.logging.set_package('top', b2.LogConfig(b2.LogLevel.DEBUG, 100))
30
31# Create path
32main = b2.create_path()
33
34# Set number of events to generate
35eventinfosetter = b2.register_module('EventInfoSetter')
36eventinfosetter.param('evtNumList', [1])
37main.add_module(eventinfosetter)
38
39# Gearbox: access to database (xml files)
40gearbox = b2.register_module('Gearbox')
41argvs = sys.argv
42if len(argvs) > 1:
43 fileName = argvs[1]
44 gearbox.param('fileName', fileName)
45main.add_module(gearbox)
46
47# Geometry
48geometry = b2.register_module('Geometry')
49geometry.param('useDB', False)
50geometry.param('components', ['TOP'])
51main.add_module(geometry)
52
53# Process events
54b2.process(main)