Belle II Software  release-05-01-25
printGeometry.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 all geometry parameters of TOP
10 #
11 # Usage: basf2 top/analysis/printGeometry.py
12 #
13 # Note: print-out is about 2000 lines long
14 # pipe it to less or redirect the output to a file
15 #
16 # The filename of the main xml file can be specified as an optional argument
17 # example: basf2 top/analysis/printGeometry.py top/TOPSpareModule.xml
18 # (hint: omit 'data' from the path)
19 # ---------------------------------------------------------------------------
20 
21 # Suppress messages and warnings for all other packages
22 set_log_level(LogLevel.ERROR)
23 
24 # set DEBUG level for top only to print mappings
25 logging.set_package('top', LogConfig(LogLevel.DEBUG, 10000))
26 
27 # Create path
28 main = create_path()
29 
30 # Set number of events to generate
31 eventinfosetter = register_module('EventInfoSetter')
32 eventinfosetter.param('evtNumList', [1])
33 main.add_module(eventinfosetter)
34 
35 # Gearbox: access to database (xml files)
36 gearbox = register_module('Gearbox')
37 argvs = sys.argv
38 if len(argvs) > 1:
39  fileName = argvs[1]
40  gearbox.param('fileName', fileName)
41 main.add_module(gearbox)
42 
43 # Geometry
44 geometry = register_module('Geometry')
45 geometry.param('useDB', False)
46 geometry.param('components', ['TOP'])
47 main.add_module(geometry)
48 
49 # Process events
50 process(main)