Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Functions
PDGHelpers Namespace Reference

Classes

class  ExtraParticle
 
class  PDGParser
 

Functions

def getPDGTABLE (table)
 
def getExtraParticleAcceptList (acceptlist)
 
def updateExtraParticleAcceptList (listName='G4particle_acceptlist_ExtraParticles.txt', pdgcodes=[])
 

Function Documentation

◆ getExtraParticleAcceptList()

def PDGHelpers.getExtraParticleAcceptList (   acceptlist)

Definition at line 47 of file PDGHelpers.py.

47 def getExtraParticleAcceptList(acceptlist):
48  # Delete a local file if present
49  if os.path.isfile(acceptlist):
50  os.remove(acceptlist)
51  #create blank file
52  blank = open('G4particle_acceptlist_ExtraParticles.txt', 'x')
53  blank.close()
54  return True
55 
56 

◆ getPDGTABLE()

def PDGHelpers.getPDGTABLE (   table)

Definition at line 37 of file PDGHelpers.py.

37 def getPDGTABLE(table):
38  # Delete a local file if present
39  if os.path.isfile(table):
40  os.remove(table)
41  # Grab the file
42  os.system('get_files -data %s' % table)
43  return True
44 
45 
46 @lru_cache

◆ updateExtraParticleAcceptList()

def PDGHelpers.updateExtraParticleAcceptList (   listName = 'G4particle_acceptlist_ExtraParticles.txt',
  pdgcodes = [] 
)

Definition at line 57 of file PDGHelpers.py.

57 def updateExtraParticleAcceptList(listName='G4particle_acceptlist_ExtraParticles.txt', pdgcodes=[]):
58  if getExtraParticleAcceptList(listName):
59  import shutil
60  shutil.copy(listName, listName+'.org')
61  existingpdgcodes = [int(x) for x in open(listName).readlines()]
62  newpdgcodes = list(set(pdgcodes).difference(existingpdgcodes))
63  # update the acceptlist for GenParticleSimAcceptList
64  with open(listName, 'a') as writer:
65  for pdg in newpdgcodes:
66  writer.write('%s\n' % pdg)
67 
68 
PDGHelpers.updateExtraParticleAcceptList
def updateExtraParticleAcceptList(listName='G4particle_acceptlist_ExtraParticles.txt', pdgcodes=[])
Definition: PDGHelpers.py:57
PDGHelpers.getPDGTABLE
def getPDGTABLE(table)
Definition: PDGHelpers.py:37
PDGHelpers.getExtraParticleAcceptList
def getExtraParticleAcceptList(acceptlist)
Definition: PDGHelpers.py:47
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
Trk::open
@ open
Definition: BinningType.h:40