12 from ROOT
import Belle2
13 from b2test_utils
import safe_process
15 basf2.set_random_seed(
"something important")
20 """Doesn't do anything."""
25 """Prints EventMetaData objects and stops event processing in event 3."""
32 basf2.B2INFO(
'event\trun\texp')
35 """reimplementation of Module::initialize()."""
37 basf2.B2INFO(
'EvtMetaDataTest::initialize()')
40 """reimplementation of Module::beginRun()."""
42 basf2.B2INFO(
'EvtMetaDataTest::beginRun()')
45 """reimplementation of Module::event()."""
50 basf2.B2ERROR(
'No EventMetaData found')
52 event = evtmetadata.obj().getEvent()
53 run = evtmetadata.obj().
getRun()
54 exp = evtmetadata.obj().getExperiment()
55 basf2.B2INFO(f
"{event}\t{run}\t{exp}")
58 evtmetadata.obj().setEndOfData()
61 """reimplementation of Module::endRun()."""
63 basf2.B2INFO(
'EvtMetaDataTest::endRun()')
66 """reimplementation of Module::terminate()."""
68 basf2.B2INFO(
'EvtMetaDataTest::terminate()')
73 for skipNEvents
in range(10):
86 main.add_module(
'EventInfoSetter',
89 evtNumList=[2, 2, 0, 5],
90 skipNEvents=skipNEvents)
107 for event
in skipToEvents:
108 basf2.B2INFO(
"skipping to exp={}, run={}, evt={}".format(*event))
110 main.add_module(
"EventInfoSetter", evtNumList=[3, 3, 3, 3], expList=[0, 0, 0, 1],
111 runList=[0, 1, 2, 0], skipToEvent=event)
a (simplified) python wrapper for StoreObjPtr.
static ExpRun getRun(std::map< ExpRun, std::pair< double, double >> runs, double t)
Get exp number + run number from time.