def test_dec_with_new_particle(): """ This decay file is special (at least for now) since the mother particle is not known to the PDG data table. """ p = DecFileParser(DIR / '../data/test_Xicc2XicPiPi.dec') p.parse() assert 'MyantiXic-' in p.list_decay_mother_names() assert 'anti-Xi_cc-sig' not in p.list_decay_mother_names()
def test_duplicate_decay_definitions(): p = DecFileParser(DIR / '../data/duplicate-decays.dec') p.parse() assert p.number_of_decays == 2 assert p.list_decay_mother_names() == ['Sigma(1775)0', 'anti-Sigma(1775)0']
def test_simple_dec(): p = DecFileParser(DIR / '../data/test_example_Dst.dec') p.parse() assert p.list_decay_mother_names() == ['D*+', 'D*-', 'D0', 'D+', 'pi0'] assert p.list_decay_modes('D0') == [['K-', 'pi+']]
def test_simple_dec(): p = DecFileParser(DIR / "../data/test_example_Dst.dec") p.parse() assert p.list_decay_mother_names() == ["D*+", "D*-", "D0", "D+", "pi0"] assert p.list_decay_modes("D0") == [["K-", "pi+"]]
def test_duplicate_decay_definitions(): p = DecFileParser(DIR / "../data/duplicate-decays.dec") with pytest.warns(UserWarning) as w: p.parse() assert len(w) == 2 assert p.number_of_decays == 2 assert p.list_decay_mother_names() == ["Sigma(1775)0", "anti-Sigma(1775)0"]
def test_with_missing_info(): """ This decay file misses a ChargeConj statement relating the particle aliases Xi_cc+sig and anti-Xi_cc-sig. As a consequence, only 3 decays are parsed and the following warning is issued: `` Corresponding 'Decay' statement for 'CDecay' statement(s) of following particle(s) not found: anti-Xi_cc-sig. Skipping creation of these charge-conjugate decay trees. warnings.warn(msg) `` """ p = DecFileParser(DIR / '../data/test_Xicc2XicPiPi.dec') p.parse() # Decay of anti-Xi_cc-sig missing assert p.number_of_decays == 3 assert 'anti-Xi_cc-sig' not in p.list_decay_mother_names() # CDecay statements assert 'anti-Xi_cc-sig' in p.list_charge_conjugate_decays()
def test_non_parsed_decfile(): with pytest.raises(DecFileNotParsed): p = DecFileParser(DIR / '../data/test_example_Dst.dec') p.list_decay_mother_names()