12from ROOT
import Belle2
16 """Count the number of events passing this module"""
19 """Start number of events at zero"""
26 """Increment number of events each event"""
28 self.
events.append(evtmetadata.obj().getEvent())
33expected_success_events = 200
38expected_event_start = 301
39expected_event_stop = 500
42main.add_module(
"EventInfoSetter", evtNumList=[input_events], expList=[0], runList=[0])
43partial_select_mod = main.add_module(
'PartialSelect', entryStart=entry_start, entryStop=entry_stop)
45success_path = basf2.Path()
46success_count = success_path.add_module(
CountEvents())
47partial_select_mod.if_true(success_path)
51print(basf2.statistics)
53assert success_count.num_events == expected_success_events
54assert success_count.events[0] == expected_event_start
55assert success_count.events[-1] == expected_event_stop
a (simplified) python wrapper for StoreObjPtr.
events
Stores the list of events passing this module.
num_events
Stores the total number of events passing this module.