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