def test_P_consistency(): """ The parity quantum number is stored in the (curated) data CSV files. For unflavoured mesons it can be calculated as P = (-1)^(L+1), and this relation can be checked against the CSV data. Note: mesons with PDGIDs of the kind 9XXXXXX (N=9) are not experimentally well-known particles and P is undefined. """ for p in Particle.all(): if not p.is_unflavoured_meson: continue elif _digit(p.pdgid, Location.N) == 9: continue elif p.pdgid == 22: # Special case of the photon assert p.P == -1 else: assert p.P == (-1)**(p.L + 1)
def test_C_consistency(): """ The charge conjugation parity is stored in the (curated) data CSV files. For unflavoured mesons it can be calculated as C = (-1)^(L+S), and this relation can be checked against the CSV data. Note: mesons with PDGIDs of the kind 9XXXXXX (N=9) are not experimentally well-known particles and C is undefined. """ for p in Particle.all(): if not p.is_unflavoured_meson: continue elif _digit(p.pdgid, Location.N) == 9: continue elif p.pdgid == 22: # Special case of the photon assert p.C == -1 elif p.pdgid in [130, 310]: # Special case of the KS and KL assert p.C == Parity.u else: assert p.C == (-1)**(p.L + p.S)