The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
ParticleProperty Namespace Reference

Functions

 properties (pid)
 (c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations # # This software is distributed under the terms of the Apache version 2 licence, # copied verbatim in the file "LICENSE".
 
 generate (dat=None)
 

Variables

 pids = eval(open("ParticleProperty.dat").read())
 

Function Documentation

◆ generate()

ParticleProperty.generate ( dat = None)

Definition at line 23 of file ParticleProperty.py.

23def generate(dat=None):
24 # The following is misunderstood by flake8 - the import is needed as it
25 # has necessary side effects
26 import GaudiPartProp.PartPropSvc # noqa: F401
27 from GaudiPython.Bindings import AppMgr
28
29 gaudi = AppMgr()
30 ppsvc = gaudi.gaudiPartProp()
31
32 # Loop over the particles and add entries.
33 pids = {}
34 for pid in ppsvc:
35 pids[pid.pid().pid()] = properties(pid)
36
37 # Archive if requested.
38 if dat:
39 with open(dat, "w") as dat:
40 dat.write(repr(pids))
41 return pids
42
43
44# Load the PID dictionary.

◆ properties()

ParticleProperty.properties ( pid)

(c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations # # This software is distributed under the terms of the Apache version 2 licence, # copied verbatim in the file "LICENSE".

# # In applying this licence, CERN does not waive the privileges and immunities # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. #

Date
21/03/2018
Author
Philip Ilten Return the property dictionary for a given Gaudi.ParticleProperty.

Definition at line 14 of file ParticleProperty.py.

14def properties(pid):
15 return {
16 "name": pid.name(),
17 "threeCharge": int(round(pid.charge() * 3)),
18 "hasAnti": pid.selfcc(),
19 }
20
21
22# Generate the PID dictionary and optionally archive.

Variable Documentation

◆ pids

ParticleProperty.pids = eval(open("ParticleProperty.dat").read())

Definition at line 46 of file ParticleProperty.py.