Belle II Software  release-08-01-10
displayGeometry.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 import sys
14 
15 # ---------------------------------------------------------------------------
16 # Shows the TOP counter using event display
17 #
18 # Usage: basf2 top/analysis/displayGeometry.py
19 #
20 # The filename of the main xml file can be specified as an optional argument
21 # example: basf2 top/analysis/displayGeometry.py top/TOPSpareModule.xml
22 # (hint: omit 'data' from the path)
23 # ---------------------------------------------------------------------------
24 
25 # create path
26 main = b2.create_path()
27 
28 # set number of events to generate
29 eventinfosetter = b2.register_module('EventInfoSetter')
30 eventinfosetter.param('evtNumList', [1])
31 main.add_module(eventinfosetter)
32 
33 # gearbox
34 gearbox = b2.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 (TOP only)
42 geometry = b2.register_module('Geometry')
43 geometry.param('useDB', False)
44 geometry.param('components', ['TOP'])
45 main.add_module(geometry)
46 
47 # event display
48 display = b2.register_module('Display')
49 display.param('showMCInfo', False)
50 display.param('assignHitsToPrimaries', False)
51 display.param('showAllPrimaries', False)
52 display.param('showCharged', False)
53 display.param('showNeutrals', False)
54 display.param('showRecoTracks', False)
55 display.param('showCDCHits', False)
56 display.param('showTrackLevelObjects', False)
57 display.param('options', 'D') # default
58 display.param('automatic', False)
59 display.param('fullGeometry', True)
60 display.param('hideObjects', [])
61 main.add_module(display)
62 
63 b2.process(main)