12from ROOT
import Belle2
14basf2.set_random_seed(
"something important")
19 """For events with an odd event number, set module return value to False"""
22 """reimplementation of Module::event()."""
26 basf2.B2ERROR(
'No EventMetaData found')
28 event = evtmetadata.obj().getEvent()
29 basf2.B2INFO(
'Setting return value to ' + str(event % 2 == 0))
30 self.return_value(event % 2 == 0)
33 """reimplementation of Module::terminate()."""
35 basf2.B2INFO(
'terminating SelectOddEvents')
40 """Always return false"""
43 """reimplementation of Module::event()."""
44 self.return_value(
False)
49 """Print name in event"""
58 """reimplementation of Module::event()."""
60 basf2.B2ERROR(
"In module " + self.name())
63main = basf2.create_path()
67emptypath = basf2.create_path()
68emptypath.add_path(basf2.create_path())
69main.add_path(emptypath)
72main.add_module(
'EventInfoSetter', expList=[0, 1], runList=[1, 2], evtNumList=[2, 1])
74anotherpath = basf2.create_path()
75main.add_path(anotherpath)
76main.add_module(
'PrintCollections')
78subsubpath = basf2.create_path()
79subsubpath.add_module(
'Progress')
80subsubpath.add_path(emptypath)
84anotherpath.add_module(module_with_condition)
85anotherpath.add_module(
'EventInfoPrinter')
94module_with_condition.if_true(subsubpath)
100returnfalse1_condition_path = basf2.create_path()
101returnfalse1_condition_path.add_module(
PrintName(
'ReturnFalse1Condition'))
102returnfalse1.if_false(returnfalse1_condition_path, basf2.AfterConditionPath.CONTINUE)
103main.add_module(returnfalse1)
107returnfalse2_condition_path = basf2.create_path()
108returnfalse2_condition_path.add_module(
PrintName(
'ReturnFalse2Condition'))
109returnfalse2.if_true(returnfalse2_condition_path)
115basf2.B2INFO(
"second process() call follows...")
a (simplified) python wrapper for StoreObjPtr.