The Gaudi Framework  master (37c0b60a)
PythiaID Namespace Reference

Functions

def properties (pid, sgn=1)
 (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 PythiaID.generate (   dat = None)

Definition at line 30 of file PythiaID.py.

30 def generate(dat=None):
31  import pythia8
32 
33  pythia = pythia8.Pythia("", False)
34 
35  # Loop over the particles.
36  pid, pids = 1, {}
37  while pid != 0:
38  pids[pid] = properties(pythia.particleData.particleDataEntryPtr(pid))
39  if pids[pid]["hasAnti"]:
40  pids[-pid] = properties(pythia.particleData.particleDataEntryPtr(pid), -1)
41  pid = pythia.particleData.nextId(abs(pid))
42 
43  # Archive if requested.
44  if dat:
45  with open(dat, "w") as dat:
46  dat.write(repr(pids))
47  return pids
48 
49 
50 # Load the Pythia dictionary.
51 try:
52  pids = eval(open("PythiaID.dat").read())

◆ properties()

def PythiaID.properties (   pid,
  sgn = 1 
)

(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 Pythia8::ParticleDataEntry.

Definition at line 14 of file PythiaID.py.

14 def properties(pid, sgn=1):
15  return {
16  "name": pid.name(sgn),
17  "threeCharge": pid.chargeType(sgn),
18  "hasAnti": pid.hasAnti(),
19  "isLepton": pid.isLepton(),
20  "isQuark": pid.isQuark(),
21  "isDiQuark": pid.isDiquark(),
22  "isHadron": pid.isHadron(),
23  "isMeson": pid.isMeson(),
24  "isBaryon": pid.isBaryon(),
25  "jSpin": pid.spinType(),
26  }
27 
28 
29 # Generate the PID dictionary and optionally archive.

Variable Documentation

◆ pids

PythiaID.pids

Definition at line 54 of file PythiaID.py.

PythiaID.generate
def generate(dat=None)
Definition: PythiaID.py:30
std::abs
Gaudi::ParticleID abs(const Gaudi::ParticleID &p)
Return the absolute value for a PID.
Definition: ParticleID.h:191
hivetimeline.read
def read(f, regex=".*", skipevents=0)
Definition: hivetimeline.py:32
PythiaID.properties
def properties(pid, sgn=1)
(c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations # # This software i...
Definition: PythiaID.py:14