Esempio n. 1
0
def test_decay_model_parsing_with_variable_defs():
    """
    In this example the decay model details are "VSS_BMIX dm",
    where dm stands for a variable name whose value is defined via the statement
    'Define dm 0.507e12'. The parser should recognise this and return
    [0.507e12] rather than ['dm'] as model parameters.
    """
    p = DecFileParser(DIR / '../data/test_Upsilon4S2B0B0bar.dec')
    p.parse()

    assert p.dict_definitions() == {'dm': 507000000000.0}

    dl = p._parsed_decays[0].children[1]
    assert get_model_name(dl) == 'VSS_BMIX'
    assert get_model_parameters(dl) == [0.507e12]
Esempio n. 2
0
def test_definitions_parsing():
    p = DecFileParser(DIR / '../data/defs-aliases-chargeconj.dec')
    p.parse()

    assert len(p.dict_definitions()) == 24