Belle II Software  release-08-01-10
CreateAndSaveGeometry.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
21 
22 import basf2 as b2
23 
24 # EventInfoSetter - generate event meta data
25 eventinfosetter = b2.register_module('EventInfoSetter')
26 # eventinfosetter.param({'evtNumList': [nevent], 'runList': [1], 'expList': [1]})
27 
28 # Geometry parameter loader
29 gearbox = b2.register_module('Gearbox')
30 gearbox.param('fileName', '/geometry/Beast2_phase2.xml')
31 # Geometry builder
32 geometry = b2.register_module('Geometry')
33 
34 # Overlap Checker
35 # overlapchecker = register_module('OverlapChecker')
36 # overlapchecker.param('Tolerance', 0.01)
37 
38 # Saves the geometry as a Root file
39 geosaver = b2.register_module('ExportGeometry')
40 geosaver.param('Filename', 'Belle2Geo.root')
41 
42 # Create main path
43 main = b2.create_path()
44 
45 # Add modules to main path
46 main.add_module(eventinfosetter)
47 main.add_module(gearbox)
48 main.add_module(geometry)
49 # main.add_module(overlapchecker)
50 main.add_module(geosaver)
51 
52 # Process one event
53 b2.process(main)