Belle II Software
release-06-01-15
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
z
Typedefs
a
b
c
d
e
i
k
l
m
n
p
r
s
t
u
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
3
10
11
16
17
from
basf2
import
Module, Path, process, B2INFO
18
import
interactive
19
from
ROOT
import
Belle2
20
21
22
class
MinModule
(Module):
23
"""
24
Example module to drop into ipython and create some objects to look at.
25
If you just want to start IPython and create PyStoreArray etc.
26
interactively in your own steering file, the 'Interactive' module
27
might be of interest.
28
"""
29
30
def
event
(self):
31
"""
32
reimplement Module::event()
33
"""
34
evtmetadata =
Belle2.PyStoreObj
(
"EventMetaData"
)
# noqa
35
particles =
Belle2.PyStoreArray
(
"MCParticles"
)
# noqa
36
B2INFO(80 *
'='
)
37
B2INFO(
"Dropping into interactive python shell. Try:"
38
"\n print evtmetadata.obj().getEvent()"
39
"\n particles[0].Dump()"
40
"\n help(particles[0])"
41
"\nTo continue non-interactively (until next event), press Ctrl+D."
42
"\nPress Ctrl+C followed by Ctrl+D to exit basf2."
)
43
B2INFO(80 *
'='
)
44
interactive.embed()
45
46
47
main = Path()
48
main.add_module(
'EventInfoSetter'
, evtNumList=[2])
49
main.add_module(
'ParticleGun'
)
50
main.add_module(
MinModule
())
51
process(main)
Belle2::PyStoreArray
a (simplified) python wrapper for StoreArray.
Definition:
PyStoreArray.h:56
Belle2::PyStoreObj
a (simplified) python wrapper for StoreObjPtr.
Definition:
PyStoreObj.h:67
interactive_python.MinModule
Definition:
interactive_python.py:22
interactive_python.MinModule.event
def event(self)
Definition:
interactive_python.py:30
framework
examples
interactive_python.py
Generated on Fri Dec 8 2023 04:19:01 for Belle II Software by
1.9.1