Belle II Software
light-2403-persian
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
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
Variables
Typedefs
a
b
c
d
l
m
n
p
r
s
w
Enumerations
Enumerator
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
_
c
d
e
f
h
i
m
o
p
r
s
t
v
w
Enumerations
b
c
e
g
h
m
p
s
t
v
Enumerator
b
c
k
t
Related Functions
Files
File List
File Members
All
Functions
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 wether 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 Fri Apr 12 2024 06:51:27 for Belle II Software by
1.9.1