The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
tests.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2
19"""
20The set of basic decorators for objects from GaudiPartProp package
21"""
22
23# =============================================================================
24__author__ = "Vanya BELYAEV Ivan.Belyaev@nikhef.nl"
25__version__ = ""
26# =============================================================================
27
28from GaudiPartProp.decorators import Gaudi
29
30pp1 = Gaudi.ParticleProperty("NAME1", Gaudi.ParticleID(121), 1.0, 501.0, 0.1, 0.001)
31pp2 = Gaudi.ParticleProperty("NAME2", Gaudi.ParticleID(122), -1, 502.0, 0.1, 0.001)
32pp3 = Gaudi.ParticleProperty("NAME3", Gaudi.ParticleID(123), 0, 503.0, 0.1, 0.001)
33
34pp1.setAntiParticle(pp2)
35pp2.setAntiParticle(pp1)
36
37lst = [pp3, pp2, pp1]
38
40
41v1.fromLst(lst)
42
43for pp in v1:
44 print(pp)
45
46print(v1)
47
48lst.sort()
49v1.clear()
50v1.fromLst(lst)
51print(v1)
52
56
57lst2 = [pid3, pid2, pid1]
58
59v2 = Gaudi.ParticleIDs()
60v2.fromLst(lst2)
61print(v2)
62
63lst2.sort()
64
65v2 = Gaudi.ParticleIDs()
66v2.fromLst(lst2)
67print(v2)
68
69for pid in lst2:
70 print(pid, pid.pid())
71
72
73def 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
102
103checkPID(lb)
104
105c = Gaudi.ParticleID(Gaudi.ParticleID.charm)
106
107checkPID(c)
108
109nuc = [2212, 1000020040, 1000822080, 450000000]
110for i in nuc:
112 checkPID(id)
113
114# =============================================================================
115# The END
116# =============================================================================
std::vector< const Gaudi::ParticleProperty * > ParticleProperties
the actual type of (ordered) container of particle properties
Holds PDG + LHCb extension particle code, following the PDG particle numbering scheme (pdg....
Definition ParticleID.h:43
A trivial class to hold information about a single particle properties.