The Gaudi Framework  master (37c0b60a)
ParticleProperty Namespace Reference

Functions

def 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". More...
 
def generate (dat=None)
 

Variables

 pids
 

Function Documentation

◆ generate()

def ParticleProperty.generate (   dat = None)

Definition at line 23 of file ParticleProperty.py.

23 def 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.
45 try:
46  pids = eval(open("ParticleProperty.dat").read())

◆ properties()

def 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.

14 def 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

Definition at line 48 of file ParticleProperty.py.

GaudiPartProp.Service.AppMgr
AppMgr
Definition: Service.py:41
GaudiPartProp.PartPropSvc
Definition: PartPropSvc.py:1
GaudiPython.Bindings
Definition: Bindings.py:1
ParticleProperty.properties
def properties(pid)
(c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations # # This software i...
Definition: ParticleProperty.py:14
hivetimeline.read
def read(f, regex=".*", skipevents=0)
Definition: hivetimeline.py:32
ParticleProperty.generate
def generate(dat=None)
Definition: ParticleProperty.py:23