Пример #1
0
class ParticleProperties(object):
    modtab = SibyllParticleTable()
    pd = PYTHIAParticleData()

    mass_dict = {}
    lifetime_dict = {}
    pdg_id = {}
    sibling = {}

    for k in modtab.part_table:
        pdg_id[k] = modtab.modname2pdg[k]
        mass_dict[k] = pd.mass(pdg_id[k]) * Units.GeV
        lifetime_dict[k] = pd.ctau(pdg_id[k]) * Units.cm

    @staticmethod
    def rr(mother, daughter):
        """ returns ratio of masses
        """
        other_masses = []
        mother_pdg = ParticleProperties.pdg_id[mother]
        daughter_pdg = ParticleProperties.pdg_id[daughter]
        for br, prod in ParticleProperties.pd.decay_channels(mother_pdg):
            if daughter_pdg in prod:
                mass_tot = sum([
                    ParticleProperties.pd.mass(abs(prod)) for prod in prod
                ]) - ParticleProperties.pd.mass(daughter_pdg)
                other_masses.append(mass_tot)

        return (min(other_masses) / ParticleProperties.mass_dict[mother])**2

    @staticmethod
    def br_2body(mother, daughter):
        """ returns the two-body branching ratio if it exists
        """
        mother_pdg = ParticleProperties.pdg_id[mother]
        daughter_pdg = ParticleProperties.pdg_id[daughter]
        brs = 0
        for br, prod in ParticleProperties.pd.decay_channels(mother_pdg):
            if daughter_pdg in prod and len(prod) == 2:
                brs += br
        return brs
from __future__ import print_function
from particletools.tables import (PYTHIAParticleData, c_speed_of_light,
                                  print_stable, make_stable_list)
import math

pdata = PYTHIAParticleData()

print_stable(pdata.ctau('D0') / c_speed_of_light,
             title=('Particles with known finite lifetimes longer '
                    'than that of D0 ({0}cm)').format(pdata.ctau('D0')))
print()
print('Known particles with tau > 1e-8s:', make_stable_list(1e-8))
Пример #3
0
from __future__ import division
import math

from phenomena.particles.particle import Particle
from skhep.constants import c_light
from skhep import units as u
from skhep.math  import lifetime_to_width
from .particle_unicode import unicodedict

#https://github.com/afedynitch/ParticleDataTool

from particletools.tables import PYTHIAParticleData
pythia = PYTHIAParticleData()

class ParticleDataToolFetcher(object):

    @staticmethod
    def getName(pdgid):
        return pythia.name(pdgid)

    @staticmethod
    def getSymbolName(pdgid):
        name = ParticleDataToolFetcher.getName(pdgid)
        symbolname = unicodedict[name]
        if symbolname == '':
            symbolname = name
        return symbolname

    @staticmethod
    def getMass(pdgid):
        return pythia.mass(pdgid) * u.GeV
Пример #4
0
from particletools.tables import PYTHIAParticleData, print_decay_channels
import argparse
import six

pyth_data = PYTHIAParticleData()

parser = argparse.ArgumentParser()
parser.add_argument("pid_or_name", default="Ds+")
args = parser.parse_args()

try:
    pid = int(args.pid_or_name)
except ValueError:
    pid = pyth_data.pdg_id(args.pid_or_name)

pd = pyth_data[pid]

print('List decay channels and branching ratios of {} (ID={})'.format(
    pd.name, pid))
print_decay_channels(pid, pyth_data)