Belle II Software
release-05-02-19
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
k
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
u
v
w
x
z
Typedefs
a
b
c
d
e
h
i
l
m
n
p
r
s
t
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
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
interactive_python.py
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
4
9
10
from
basf2
import
Module, Path, process, B2INFO
11
import
interactive
12
from
ROOT
import
Belle2
13
14
15
class
MinModule
(Module):
16
"""
17
Example module to drop into ipython and create some objects to look at.
18
If you just want to start IPython and create PyStoreArray etc.
19
interactively in your own steering file, the 'Interactive' module
20
might be of interest.
21
"""
22
23
def
event
(self):
24
"""
25
reimplement Module::event()
26
"""
27
evtmetadata =
Belle2.PyStoreObj
(
"EventMetaData"
)
28
particles =
Belle2.PyStoreArray
(
"MCParticles"
)
29
B2INFO(80 *
'='
)
30
B2INFO(
"Dropping into interactive python shell. Try:"
31
"\n print evtmetadata.obj().getEvent()"
32
"\n particles[0].Dump()"
33
"\n help(particles[0])"
34
"\nTo continue non-interactively (until next event), press Ctrl+D."
35
"\nPress Ctrl+C followed by Ctrl+D to exit basf2."
)
36
B2INFO(80 *
'='
)
37
interactive.embed()
38
39
40
main = Path()
41
main.add_module(
'EventInfoSetter'
, evtNumList=[2])
42
main.add_module(
'ParticleGun'
)
43
main.add_module(
MinModule
())
44
process(main)
Belle2::PyStoreObj
a (simplified) python wrapper for StoreObjPtr.
Definition:
PyStoreObj.h:69
interactive_python.MinModule.event
def event(self)
Definition:
interactive_python.py:23
Belle2::PyStoreArray
a (simplified) python wrapper for StoreArray.
Definition:
PyStoreArray.h:58
interactive_python.MinModule
Definition:
interactive_python.py:15
framework
examples
interactive_python.py
Generated on Tue Jan 4 2022 02:56:42 for Belle II Software by
1.8.17