Belle II Software development
CreateAndSaveGeometry.py
1#!/usr/bin/env python3
2
3
10
11
21
22import basf2 as b2
23
24# EventInfoSetter - generate event meta data
25eventinfosetter = b2.register_module('EventInfoSetter')
26# eventinfosetter.param({'evtNumList': [nevent], 'runList': [1], 'expList': [1]})
27
28# Geometry parameter loader
29gearbox = b2.register_module('Gearbox')
30gearbox.param('fileName', '/geometry/Beast2_phase2.xml')
31# Geometry builder
32geometry = 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
39geosaver = b2.register_module('ExportGeometry')
40geosaver.param('Filename', 'Belle2Geo.root')
41
42# Create main path
43main = b2.create_path()
44
45# Add modules to main path
46main.add_module(eventinfosetter)
47main.add_module(gearbox)
48main.add_module(geometry)
49# main.add_module(overlapchecker)
50main.add_module(geosaver)
51
52# Process one event
53b2.process(main)