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