Belle II Software
development
Toggle main menu visibility
Main Page
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
x
z
Typedefs
a
b
c
d
e
g
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
e
f
g
n
p
s
v
z
Enumerator
c
d
f
p
t
v
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Symbols
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
Typedefs
Macros
▼
Belle II Software
►
Topics
►
Namespaces
►
Classes
▼
Files
▼
File List
►
alignment
►
analysis
►
arich
►
b2bii
►
background
►
beast
►
calibration
►
cdc
►
daq
►
decfiles
►
display
►
dqm
►
ecl
▼
framework
►
core
►
data
►
database
►
dataobjects
►
datastore
►
dbobjects
►
examples
►
gearbox
►
geometry
►
io
►
logging
►
modules
►
particledb
►
pcore
►
pybasf2
►
scripts
▼
tests
angle.cc
b2file-normalize.py
B2Vector3.cc
basf2_args.py
basf2_rootinit.py
BeamParameters.cc
binnedEventT0.cc
CalcMeanCov.cc
chain_input.py
check_globaltag_trim.py
check_payload_metadata.py
check_payload_names.py
checkRandomNumbers.py
conditional_iov.py
conditions.py
conditions_metadataprovider.cc
conditions_process2.py
const.cc
cutNodes.cc
database.cc
datastore.cc
dowhile.py
dry-run.py
emptyrelations.py
eventExtraInfo.cc
eventlimiter.py
eventT0.cc
evtmetadata.py
evtpdl.py
filemetadata.py
FileSystem.cc
findFile.py
foreach.py
formula_parser.cc
framework_cppcheck.py
framework_doxygen_check.py
gearbox.cc
generalCut.cc
hardwareClockSettings.cc
Helix.cc
HTML.cc
include_exclude_branches.py
independent_merge_path.py
independent_path.py
iointercept.cc
ioutils.cc
local_database_file.py
local_metadata_provider.py
logging.cc
logsummary.py
make_root_compatible.cc
mcevent_forwarding.py
merge_files.py
mixed_runs.py
module_paths.py
module_setparameters.py
modulelist.py
mrucache.cc
msghandler.cc
multiple_module_conditions.py
node_factory.cc
numberSequence.cc
parallel_processing.py
partialselect.py
path_serialisation.py
prescale.py
processstatistics.cc
prune_datastore.py
pylogging.py
pyroot_tfile.py
python_datastore.py
python_dbinterface.py
recommend.py
relations_consolidate.cc
relations_internal.cc
relationsobject.cc
root_input.py
root_output.py
root_output_split.py
root_returnvalues.py
ScopeGuards.cc
select_subset.cc
seqroot_input.py
seqroot_output.py
signals.py
sphinx_full_release.py
sphinx_light_release.py
sqlite.cc
stop_on_error.py
stream.cc
streamer_test.py
test_b2conditionsdb_commands.py
test_b2file-mix.py
test_b2help_recommendation.py
test_basf2_utils.py
test_calculation.py
test_calculationList.py
test_calculationProcess.py
test_calculationQueue.py
test_check_basf2_file.py
test_entities.py
test_environmentInformation.py
test_globaltag_forwarding.py
test_iov.py
test_IPythonHandler.py
test_light_dependencies.py
test_module_log_level.py
test_module_log_level_run.py
test_print_module_parameters.py
test_runningupdate.py
test_tag_merge.py
UncertainHelix.cc
unit.cc
utils.cc
►
tools
►
utilities
►
generators
►
geometry
►
hlt
►
ir
►
klm
►
masterclass
►
mdst
►
mva
►
online_book
►
pxd
►
rawdata
►
reconstruction
►
simulation
►
site_scons
►
structure
►
svd
►
top
►
tracking
►
trg
►
validation
►
vxd
Doxygen.h
resource_analyzer.py
►
File Members
evtmetadata.py
1
#!/usr/bin/env python3
2
3
10
11
import
basf2
12
from
ROOT
import
Belle2
13
from
b2test_utils
import
safe_process
14
15
basf2.set_random_seed(
"something important"
)
16
17
18
class
NoopModule
(basf2.Module):
19
20
"""Doesn't do anything."""
21
22
18
class
NoopModule
(basf2.Module):
…
23
class
EvtMetaDataTest
(basf2.Module):
24
25
"""Prints EventMetaData objects and stops event processing in event 3."""
26
27
def
__init__
(self):
28
"""constructor."""
29
30
# need to call super() _if_ we reimplement the constructor
31
super().
__init__
()
32
basf2.B2INFO(
'event\trun\texp'
)
33
27
def
__init__
(self):
…
34
def
initialize
(self):
35
"""reimplementation of Module::initialize()."""
36
37
basf2.B2INFO(
'EvtMetaDataTest::initialize()'
)
38
34
def
initialize
(self):
…
39
def
beginRun
(self):
40
"""reimplementation of Module::beginRun()."""
41
42
basf2.B2INFO(
'EvtMetaDataTest::beginRun()'
)
43
39
def
beginRun
(self):
…
44
def
event
(self):
45
"""reimplementation of Module::event()."""
46
47
evtmetadata =
Belle2.PyStoreObj
(
'EventMetaData'
)
48
49
if
not
evtmetadata:
50
basf2.B2ERROR(
'No EventMetaData found'
)
51
else
:
52
event = evtmetadata.obj().getEvent()
53
run = evtmetadata.obj().getRun()
54
exp = evtmetadata.obj().getExperiment()
55
basf2.B2INFO(f
"{event}\t{run}\t{exp}"
)
56
if
event == 4:
57
# stop event processing.
58
evtmetadata.obj().setEndOfData()
59
44
def
event
(self):
…
60
def
endRun
(self):
61
"""reimplementation of Module::endRun()."""
62
63
basf2.B2INFO(
'EvtMetaDataTest::endRun()'
)
64
60
def
endRun
(self):
…
65
def
terminate
(self):
66
"""reimplementation of Module::terminate()."""
67
68
basf2.B2INFO(
'EvtMetaDataTest::terminate()'
)
69
70
71
# Normal steering file part begins here
72
65
def
terminate
(self):
…
23
class
EvtMetaDataTest
(basf2.Module):
…
73
for
skipNEvents
in
range(10):
74
# Create main path
75
main = basf2.Path()
76
77
# not used for anything, just checking whether the master module
78
# can be found if it's not the first module in the path.
79
main.add_module(
NoopModule
())
80
81
# exp 0 has only 2 events, so cannot trigger the test module
82
# also tests for a problem where beginRun() wasn't called
83
# exp 1 has only 2 events, so cannot trigger the test module,
84
# exp 2 has no events and will be skipped
85
# exp 3 will be stopped in event 3 by EvtMetaDataTest
86
main.add_module(
'EventInfoSetter'
,
87
expList=[0, 1, 2, 3],
88
runList=[0, 1, 2, 3],
89
evtNumList=[2, 2, 0, 5],
90
skipNEvents=skipNEvents)
91
92
main.add_module(
EvtMetaDataTest
())
93
94
safe_process(main)
95
96
# test skipping to specific events
97
skipToEvents = [
98
[0, 0, 1],
99
[0, 0, 3],
100
[0, 1, 1],
101
[0, 1, 6],
102
[0, 2, 3],
103
[1, 0, 1],
104
[2, 0, 1],
105
]
106
107
for
event
in
skipToEvents:
108
basf2.B2INFO(
"skipping to exp={}, run={}, evt={}"
.format(*event))
109
main = basf2.Path()
110
main.add_module(
"EventInfoSetter"
, evtNumList=[3, 3, 3, 3], expList=[0, 0, 0, 1],
111
runList=[0, 1, 2, 0], skipToEvent=event)
112
main.add_module(
EvtMetaDataTest
())
113
safe_process(main)
Belle2::PyStoreObj
a (simplified) python wrapper for StoreObjPtr.
Definition
PyStoreObj.h:67
evtmetadata.EvtMetaDataTest
Definition
evtmetadata.py:23
evtmetadata.EvtMetaDataTest.terminate
terminate(self)
Definition
evtmetadata.py:65
evtmetadata.EvtMetaDataTest.initialize
initialize(self)
Definition
evtmetadata.py:34
evtmetadata.EvtMetaDataTest.__init__
__init__(self)
Definition
evtmetadata.py:27
evtmetadata.EvtMetaDataTest.event
event(self)
Definition
evtmetadata.py:44
evtmetadata.EvtMetaDataTest.endRun
endRun(self)
Definition
evtmetadata.py:60
evtmetadata.EvtMetaDataTest.beginRun
beginRun(self)
Definition
evtmetadata.py:39
evtmetadata.NoopModule
Definition
evtmetadata.py:18
framework
tests
evtmetadata.py
Generated on Sun May 18 2025 02:57:43 for Belle II Software by
1.13.2