Belle II Software development
VisualizeGeometry+DAWN.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12b2.logging.log_level = b2.LogLevel.WARNING
13
14# create path
15main = b2.create_path()
16# process one event
17main.add_module('EventInfoSetter', evtNumList=[1])
18# Load XML parameters
19main.add_module('Gearbox')
20# Create Geometry and show info messages for that
21main.add_module('Geometry', logLevel=b2.LogLevel.INFO)
22particlegun = main.add_module('ParticleGun')
23simulation = main.add_module('FullSim')
24
25simulation.param('EnableVisualization', True)
26simulation.param('UICommandsAtIdle', [
27 # Use VRML2 backend
28 '/vis/open DAWNFILE',
29 # Draw the geometry
30 '/vis/drawVolume',
31 # Draw coordinate axes at the origin with a length of 100mm in each direction
32 '/vis/scene/add/axes 0 0 0 100 mm',
33 # Draw simulated tracks
34 '/vis/scene/add/trajectories smooth',
35 '/vis/modeling/trajectories/create/drawByCharge'
36 # Uncomment the following two lines to have yellow dots at each step boundary
37 # along the trajectory
38 # '/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true',
39 # '/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 0.5',
40])
41
42# Parameters for particle gun
43particlegun.param('nTracks', 1)
44particlegun.param('pdgCodes', [211])
45particlegun.param('momentumParams', [2.0, 5.0])
46particlegun.param('thetaParams', [85.0, 95.0])
47particlegun.param('phiParams', [-5.0, 5.0])
48
49b2.process(main)