Belle II Software development
select_events.py
1#!/usr/bin/env python3
2
3
10
11# Demonstrates selecting events to save in the event display:
12# * create 'conditionspath' with e.g. RootOutput
13# * use if_true() on the display module to activate it
14#
15# Once started, a widget will be shown to toggle the return value,
16# if the box is checked when advancing to the next event, the event
17# will be saved in saved_from_display.root.
18
19import basf2 as b2
20from simulation import add_simulation
21
22# register necessary modules
23eventinfosetter = b2.register_module('EventInfoSetter')
24eventinfosetter.param('evtNumList', [5000])
25
26main = b2.Path()
27
28# add modules to paths
29main.add_module(eventinfosetter)
30
31main.add_module('EvtGenInput')
32
33add_simulation(main)
34
35# add_reconstruction(main)
36
37display = main.add_module('Display')
38conditionpath = b2.Path()
39conditionpath.add_module('RootOutput', outputFileName='saved_from_display.root')
40display.if_true(conditionpath)
41
42b2.process(main)
43print(b2.statistics)