Belle II Software
development
Toggle main menu visibility
Main Page
Modules
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
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 Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
Typedefs
Macros
root_output.py
1
#!/usr/bin/env python3
2
3
10
11
import
os
12
from
basf2
import
create_path, process, B2FATAL, set_random_seed
13
from
ROOT
import
TFile
14
15
set_random_seed(
"something important"
)
16
17
# Create paths
18
main = create_path()
19
# Add modules to paths
20
main.add_module(
"EventInfoSetter"
, expList=[1, 1], runList=[1, 2], evtNumList=[100, 100])
21
main.add_module(
"EventInfoPrinter"
)
22
main.add_module(
"RootOutput"
, outputFileName=
'root_output_test.root'
, updateFileCatalog=
False
)
23
24
# Process events
25
process(main)
26
27
# check whether output file contains correct number of events
28
tfile = TFile(
'root_output_test.root'
)
29
tree = tfile.Get(
'tree'
)
30
if
tree.GetEntries() != 200:
31
B2FATAL(
'Created output file contains wrong number of events!'
)
32
33
os.remove(
'root_output_test.root'
)
framework
tests
root_output.py
Generated on Wed Apr 9 2025 02:41:00 for Belle II Software by
1.9.6