The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
ParticleID.py
Go to the documentation of this file.
14def properties(pid):
15 from GaudiPartProp.decorators import Gaudi
16
17 pid = Gaudi.ParticleID(pid)
18 return {
19 "isSM": pid.isSM(),
20 "isValid": pid.isValid(),
21 "isMeson": pid.isMeson(),
22 "isBaryon": pid.isBaryon(),
23 "isDiQuark": pid.isDiQuark(),
24 "isHadron": pid.isHadron(),
25 "isLepton": pid.isLepton(),
26 "isNucleus": pid.isNucleus(),
27 "hasUp": pid.hasUp(),
28 "hasDown": pid.hasDown(),
29 "hasStrange": pid.hasStrange(),
30 "hasCharm": pid.hasCharm(),
31 "hasBottom": pid.hasBottom(),
32 "hasTop": pid.hasTop(),
33 "hasBottomPrime": pid.hasBottomPrime(),
34 "hasTopPrime": pid.hasTopPrime(),
35 "isQuark": pid.isQuark(),
36 "hasQuarks": pid.hasQuarks(),
37 "Z": pid.Z(),
38 "A": pid.A(),
39 "nLambda": pid.nLambda(),
40 "threeCharge": pid.threeCharge(),
41 "jSpin": pid.jSpin(),
42 "sSpin": pid.sSpin(),
43 "lSpin": pid.lSpin(),
44 }
45
46
47# Generate the PID dictionary and optionally archive.
48def generate(dat=None):
49 import ParticleProperty
50 import PythiaID
51
52 pids = PythiaID.pids
53 pids.update(ParticleProperty.pids)
54
55 # Loop over the particles and update entries.
56 for pid in pids:
57 pids[pid] = properties(pid)
58
59 # Archive if requested.
60 if dat:
61 with open(dat, "w") as dat:
62 dat.write(repr(pids))
63 return pids
64
65
66# Load the PID dictionary.
67try:
68 pids = eval(open("ParticleID.dat").read())
69except FileNotFoundError:
70 pids = generate("ParticleID.dat")
Holds PDG + LHCb extension particle code, following the PDG particle numbering scheme (pdg....
Definition ParticleID.h:43
generate(dat=None)
Definition ParticleID.py:48
properties(pid)
(c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations # # This software i...
Definition ParticleID.py:14