Belle II Software  release-06-01-15
async_display.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # example steering file to produce events and show them in the display
13 # without stopping the simulation.
14 # event data is buffered in shared memory, previous events may be overwritten
15 # once the buffer is full.
16 
17 import basf2 as b2
18 from simulation import add_simulation
19 from reconstruction import add_reconstruction
20 
21 # register necessary modules
22 eventinfosetter = b2.register_module('EventInfoSetter')
23 eventinfosetter.param('evtNumList', [5000])
24 
25 main = b2.create_path()
26 
27 # add modules to paths
28 main.add_module(eventinfosetter)
29 main.add_module('ProgressBar')
30 
31 main.add_module('EvtGenInput')
32 
33 # (no ECL because of unsupported solids)
34 components = [
35  'MagneticField',
36  'BeamPipe',
37  'PXD',
38  'SVD',
39  'CDC',
40  'TOP',
41  'ARICH',
42  'EKLM',
43  'BKLM',
44 ]
45 add_simulation(main, components)
46 
47 # reconstruction
48 add_reconstruction(main, components)
49 
50 # default parameters
51 display = b2.register_module('AsyncDisplay')
52 # make some room in the buffer when full
53 display.param('discardOldEvents', True)
54 main.add_module(display)
55 
56 b2.process(main)
57 print(b2.statistics)