Belle II Software  release-05-02-19
displayGeometry.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 from basf2 import *
5 import os
6 from ROOT import Belle2
7 
8 # ---------------------------------------------------------------------------
9 # Shows the TOP counter using event display
10 #
11 # Usage: basf2 top/analysis/displayGeometry.py
12 #
13 # The filename of the main xml file can be specified as an optional argument
14 # example: basf2 top/analysis/displayGeometry.py top/TOPSpareModule.xml
15 # (hint: omit 'data' from the path)
16 # ---------------------------------------------------------------------------
17 
18 # create path
19 main = create_path()
20 
21 # set number of events to generate
22 eventinfosetter = register_module('EventInfoSetter')
23 eventinfosetter.param('evtNumList', [1])
24 main.add_module(eventinfosetter)
25 
26 # gearbox
27 gearbox = register_module('Gearbox')
28 argvs = sys.argv
29 if len(argvs) > 1:
30  fileName = argvs[1]
31  gearbox.param('fileName', fileName)
32 main.add_module(gearbox)
33 
34 # geometry (TOP only)
35 geometry = register_module('Geometry')
36 geometry.param('useDB', False)
37 geometry.param('components', ['TOP'])
38 main.add_module(geometry)
39 
40 # event display
41 display = register_module('Display')
42 display.param('showMCInfo', False)
43 display.param('assignHitsToPrimaries', False)
44 display.param('showAllPrimaries', False)
45 display.param('showCharged', False)
46 display.param('showNeutrals', False)
47 display.param('showRecoTracks', False)
48 display.param('showCDCHits', False)
49 display.param('showTrackLevelObjects', False)
50 display.param('options', 'D') # default
51 display.param('automatic', False)
52 display.param('fullGeometry', True)
53 display.param('hideObjects', [])
54 main.add_module(display)
55 
56 process(main)