The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
PartPropSvc.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
18
"""Demo-file for interactive work with new Particle Property Service"""
19
20
__author__ =
"Vanya BELYAEV Ivan.Belyaev@nikhef.nl"
21
import
GaudiPartProp.decorators
22
23
# =============================================================================
24
import
GaudiPartProp.PartPropAlg
25
26
# The following is misunderstood by flake8 - the import is needed as it
27
# has necessary side effects
28
import
GaudiPartProp.Service
# noqa: F401
29
30
# =============================================================================
31
32
from
GaudiPartProp.Nodes
import
(
33
CC,
34
Baryon,
35
Bottom,
36
EllMinus,
37
EllPlus,
38
FiveHalf,
39
Hadron,
40
Lepton,
41
Meson,
42
Nu,
43
Tensor,
44
ThreeHalf,
45
)
46
from
GaudiPython.Bindings
import
AppMgr
47
48
gaudi =
AppMgr
()
49
gaudi.initialize()
50
51
52
53
def
test
():
54
"""Simple function for the test"""
55
pps = gaudi.gaudiPartProp()
56
57
for
l
in
range(1, 6):
58
# get
59
lst1 = pps.get(
lambda
x: l == x.pid().lSpin())
60
print(f
" {l} == 2*lSpin+1 "
)
61
print(lst1)
62
63
for
s
in
range(0, 2):
64
# get
65
lst1 = pps.get(
lambda
x: s == x.pid().sSpin())
66
print(f
" {s} == 2*sSpin+1 "
)
67
print(lst1)
68
69
for
j
in
range(0, 7):
70
# get
71
lst1 = pps.get(
lambda
x: j == x.pid().jSpin())
72
print(f
" {j} == 2*jSpi+1 "
)
73
print(lst1)
74
75
decays = [
76
"B0 -> K- pi+"
,
77
"B+ -> J/psi(1S) ( K*0 -> K+ pi- ) "
,
78
"D_s+ -> pi+ pi+ pi- "
,
79
"B_s0 -> ( J/psi(1S) -> mu+ mu- ) ( phi(1020) -> K+ K- ) "
,
80
]
81
82
for
decay
in
decays:
83
print(f
"Decay&CC: {decay} : {pps.cc(decay)} "
)
84
85
Item = pps.Item
86
Items = pps.Items
87
Decay = pps.Decay
88
Decays = pps.Decays
89
90
items = Items()
91
items.push_back(Item(
"K+"
))
92
items.push_back(Item(
"K-"
))
93
94
decay = Decay(Item(
"B0"
), items)
95
96
print(decay.validate(pps.svc()))
97
98
decays =
Decays
()
99
decays.push_back(decay)
100
decays.push_back(decay)
101
decays.push_back(decay)
102
103
print(decay)
104
print(decays)
105
106
107
def
test2
():
108
pps = gaudi.gaudiPartProp()
109
110
nodes = [
111
Lepton & ~Meson,
112
EllPlus | Nu,
113
Lepton & ~Nu,
114
EllMinus | CC(
"B0"
),
115
Hadron & Tensor,
116
Hadron & ThreeHalf,
117
Hadron & FiveHalf,
118
EllPlus | (Bottom & Baryon),
119
]
120
121
for
node
in
nodes:
122
node.validate(pps.svc())
123
124
lst1 = pps.get(node)
125
print(f
' selected by node: "{node}" '
)
126
print(lst1)
127
128
129
if
"__main__"
== __name__:
130
test
()
131
test2
()
GaudiPython.Bindings.AppMgr
Definition
Bindings.py:901
Gaudi::Decays
Definition
CC.h:17
GaudiPartProp.Nodes
Definition
Nodes.py:1
GaudiPartProp.PartPropAlg
Definition
PartPropAlg.py:1
GaudiPartProp.PartPropSvc.test2
test2()
Definition
PartPropSvc.py:107
GaudiPartProp.PartPropSvc.test
test()
simple test-function
Definition
PartPropSvc.py:53
GaudiPartProp.Service
Definition
Service.py:1
GaudiPartProp.decorators
Definition
decorators.py:1
GaudiPython.Bindings
Definition
Bindings.py:1
GaudiPartProp
python
GaudiPartProp
PartPropSvc.py
Generated on
for The Gaudi Framework by
1.17.0