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