The Gaudi Framework
master (42b00024)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace 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
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
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
Typedefs
a
b
c
d
e
f
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
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
Enumerations
a
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
Files
File List
File 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
_
b
c
e
f
g
h
i
l
m
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
q
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
Macros
_
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
tests.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
19
"""
20
The set of basic decorators for objects from GaudiPartProp package
21
"""
22
23
# =============================================================================
24
__author__ =
"Vanya BELYAEV Ivan.Belyaev@nikhef.nl"
25
__version__ =
""
26
# =============================================================================
27
28
from
GaudiPartProp.decorators
import
Gaudi
29
30
pp1 =
Gaudi.ParticleProperty
(
"NAME1"
,
Gaudi.ParticleID
(121), 1.0, 501.0, 0.1, 0.001)
31
pp2 =
Gaudi.ParticleProperty
(
"NAME2"
,
Gaudi.ParticleID
(122), -1, 502.0, 0.1, 0.001)
32
pp3 =
Gaudi.ParticleProperty
(
"NAME3"
,
Gaudi.ParticleID
(123), 0, 503.0, 0.1, 0.001)
33
34
pp1.setAntiParticle(pp2)
35
pp2.setAntiParticle(pp1)
36
37
lst = [pp3, pp2, pp1]
38
39
v1 =
Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties
()
40
41
v1.fromLst(lst)
42
43
for
pp
in
v1:
44
print(pp)
45
46
print(v1)
47
48
lst.sort()
49
v1.clear()
50
v1.fromLst(lst)
51
print(v1)
52
53
pid1 =
Gaudi.ParticleID
(121)
54
pid2 =
Gaudi.ParticleID
(122)
55
pid3 =
Gaudi.ParticleID
(123)
56
57
lst2 = [pid3, pid2, pid1]
58
59
v2 = Gaudi.ParticleIDs()
60
v2.fromLst(lst2)
61
print(v2)
62
63
lst2.sort()
64
65
v2 = Gaudi.ParticleIDs()
66
v2.fromLst(lst2)
67
print(v2)
68
69
for
pid
in
lst2:
70
print(pid, pid.pid())
71
72
73
def
checkPID
(pid):
74
print(pid)
75
print(
" isValid "
, pid.isValid())
76
print(
" isMeson "
, pid.isMeson())
77
print(
" isBaryon "
, pid.isBaryon())
78
print(
" isDiQuark "
, pid.isDiQuark())
79
print(
" isHadron "
, pid.isHadron())
80
print(
" isLepton "
, pid.isLepton())
81
print(
" isNucleus "
, pid.isNucleus())
82
print(
" hasUp "
, pid.hasUp())
83
print(
" hasDown "
, pid.hasDown())
84
print(
" hasStrange "
, pid.hasStrange())
85
print(
" hasCharm "
, pid.hasCharm())
86
print(
" hasBottom "
, pid.hasBottom())
87
print(
" hasTop "
, pid.hasTop())
88
print(
" hasQuarks "
, pid.hasQuarks())
89
print(
" isQuark "
, pid.isQuark())
90
print(
" threeCharge "
, pid.threeCharge())
91
print(
" jSpin "
, pid.jSpin())
92
print(
" sSpin "
, pid.sSpin())
93
print(
" lSpin "
, pid.lSpin())
94
print(
" fundamental "
, pid.fundamentalID())
95
print(
" extra "
, pid.extraBits())
96
print(
" A "
, pid.A())
97
print(
" Z "
, pid.Z())
98
print(
" nLambda "
, pid.nLambda())
99
100
101
lb =
Gaudi.ParticleID
(5122)
102
103
checkPID
(lb)
104
105
c =
Gaudi.ParticleID
(Gaudi.ParticleID.charm)
106
107
checkPID
(c)
108
109
nuc = [2212, 1000020040, 1000822080, 450000000]
110
for
i
in
nuc:
111
id =
Gaudi.ParticleID
(i)
112
checkPID
(id)
113
114
# =============================================================================
115
# The END
116
# =============================================================================
GaudiPartProp.decorators
Definition:
decorators.py:1
Gaudi::Interfaces::IParticlePropertySvc::ParticleProperties
std::vector< const Gaudi::ParticleProperty * > ParticleProperties
the actual type of (ordered) container of particle properties
Definition:
IParticlePropertySvc.h:34
Gaudi::ParticleProperty
Definition:
ParticleProperty.h:37
Gaudi::ParticleID
Definition:
ParticleID.h:43
GaudiPartProp.tests.checkPID
def checkPID(pid)
Definition:
tests.py:73
GaudiPartProp
python
GaudiPartProp
tests.py
Generated on Sat Jun 7 2025 08:04:02 for The Gaudi Framework by
1.8.18