Пример #1
0
 def getQuantumNumbrers(pdgid):
     QN = {}
     QN["I"] = Particle.from_pdgid(pdgid).I  # Isospin
     QN["J"] = Particle.from_pdgid(pdgid).J  # Total angular momentum
     QN["G"] = Particle.from_pdgid(pdgid).G  # Parity: '', +, -, or ?
     QN["P"] = Particle.from_pdgid(pdgid).P  # Space parity
     QN["C"] = Particle.from_pdgid(pdgid).C  # Charge conjugation parity
     return QN
def test_simple():
    lines, all_states = GooFitChain.read_AmpGen(text='''

    # This is a test (should not affect output)

    EventType D0 K- pi+ pi+ pi-

    D0[D]{K*(892)bar0{K-,pi+},rho(770)0{pi+,pi-}} 2 1         0          2 0         0
    ''')

    assert Particle.from_pdg(421) == all_states[0]  # D0
    assert Particle.from_pdg(-321) == all_states[1]  # K-
    assert Particle.from_pdg(211) == all_states[2]  # pi+
    assert Particle.from_pdg(211) == all_states[3]  # pi+
    assert Particle.from_pdg(-211) == all_states[4]  # pi-
Пример #3
0
 def getTau(pdgid):
     width = Particle.from_pdgid(pdgid).width * u.GeV / u.MeV
     if width != 0.0:
         tau = width_to_lifetime(width) * u.nanosecond / u.picosecond
     else:
         tau = P.STABLE
     return tau
Пример #4
0
 def getComposition(pdgid):
     quarks = list(Particle.from_pdgid(pdgid).quarks)
     quarkdict = {
         'U': 'ubar',
         'D': 'dbar',
         'C': 'cbar',
         'S': 'sbar',
         'T': 'tbar',
         'B': 'bbar'
     }
     for n, quark in enumerate(quarks):
         if quark in quarkdict.keys():
             quarks[n] = quarkdict[quark]
     return quarks
Пример #5
0
 def getWidthLimits(pdgid):
     return [
         Particle.from_pdgid(pdgid).width_lower,
         Particle.from_pdgid(pdgid).wodth_upper
     ]
Пример #6
0
 def getRadius(pdgid):
     return Particle.from_pdgid(pdgid).radius
Пример #7
0
 def getMass(pdgid):
     return Particle.from_pdgid(pdgid).mass * u.GeV
Пример #8
0
 def getMassLimits(pdgid):
     return [
         Particle.from_pdgid(pdgid).mass_lower,
         Particle.from_pdgid(pdgid).mass_upper
     ]
Пример #9
0
 def getLatexName(pdgid):
     return Particle.from_pdgid(pdgid).latex
Пример #10
0
 def getHTMLName(pdgid):
     return Particle.from_pdgid(pdgid).html_name
def test_rep():
    pi = Particle.from_pdg(211)
    assert 'val=211' in repr(pi)
    assert "name='pi'" in repr(pi)
    assert 'mass=0.13957' in repr(pi)
    assert 'charge=<Par.p: 1>' in repr(pi)
Пример #12
0
 def getStatus(pdgid):
     return Particle.from_pdgid(pdgid).status.name
def test_pdg():
    assert Particle.from_pdg(211).val == 211
Пример #14
0
 def getPDGId(name):
     return Particle.from_search(name=name).val
Пример #15
0
 def getCharge(pdgid):
     return Particle.from_pdgid(pdgid).charge
Пример #16
0
 def getWidth(pdgid):
     return Particle.from_pdgid(pdgid).width * u.GeV
Пример #17
0
 def getName(pdgid):
     return Particle.from_pdgid(pdgid).name
def test_str():
    pi = Particle.from_pdg(211)
    assert str(pi) == 'pi+'
Пример #19
0
 def getAnti(pdgid):
     if pdgid in [12, 14, 16, -12, -14, -16]:
         return -1 * pdgid
     else:
         return Particle.from_pdgid(pdgid).invert().val
def test_prop():
    pi = Particle.from_pdg(211)
    assert pi.name == 'pi'
    assert pi.val == 211
    assert pi.charge == Par.p
Пример #21
0
 def getSpinType(pdgid):
     return Particle.from_pdgid(pdgid).spin_type.name