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
particlelisthelper.py
1
#!/usr/bin/env python3
2
3
10
11
"""
12
Simple script to create some particles in a list with a python module
13
"""
14
15
# Go away doxygen, no one likes you
16
# @cond
17
18
import
basf2
19
from
ROOT
import
Belle2
20
from
ROOT.Math
import
PxPyPzEVector
21
22
23
class
MyParticleCreator(basf2.Module):
24
def
initialize(self):
25
self.listB0 =
Belle2.ParticleListHelper
(
"B0:all"
)
26
self.listPi0 =
Belle2.ParticleListHelper
(
"pi0:all"
)
27
print(self.listB0.isSelfConjugated(), self.listPi0.isSelfConjugated())
28
29
def
event(self):
30
self.listB0.create()
31
self.listPi0.create()
32
for
i
in
range(5):
33
self.listB0.addParticle(PxPyPzEVector(i, 0, 0, i), i % 2 == 0)
34
self.listPi0.addParticle(PxPyPzEVector(i, 0, 0, i), i % 2 == 0)
35
36
37
basf2.set_random_seed(
"something important"
)
38
path = basf2.create_path()
39
path.add_module(
"EventInfoSetter"
, evtNumList=[2])
40
path.add_module(MyParticleCreator())
41
path.add_module(
"ParticlePrinter"
, listName=
"B0:all"
)
42
path.add_module(
"ParticlePrinter"
, listName=
"pi0:all"
)
43
basf2.process(path)
44
45
# @endcond
Belle2::ParticleListHelper
Class to help managing creation and adding to ParticleLists.
Definition:
ParticleListHelper.h:47
Math
analysis
tests
particlelisthelper.py
Generated on Wed Apr 9 2025 02:35:01 for Belle II Software by
1.9.6