Пример #1
0
    def check_004_Options(self):
        from eos import Options

        try:
            opt = Options()
        except:
            raise TestFailedError('cannot initialize empty Options')

        try:
            kin = Options(foo='bar', baz='harr')
        except:
            raise TestFailedError('cannot initialize Options with kwargs')

        try:
            kin = Options(**{'foo': 'bar', 'baz': 'harr'})
        except:
            raise TestFailedError('cannot initialize Options with explicit kwargs')
Пример #2
0
    def check_007_Constraint(self):
        from eos import Constraint, Options

        con = None
        try:
            con = Constraint.make('B->D::f_++f_0@HPQCD2015A', Options())
        except:
            raise TestFailedError('cannot create Constraint')

        if not con.name() == 'B->D::f_++f_0@HPQCD2015A':
            raise TestFailedError('cannot obtain Constraint name')

        for llhb in con.blocks():
            print llhb.as_string()

        for obs in con.observables():
            print obs.name()
Пример #3
0
    def check_008_Model(self):
        from eos import Model, Parameters, Options

        m = None
        p = None
        try:
            p = Parameters.Defaults()
            o = Options()
            m = Model.make('SM', p, o)
        except:
            raise TestFailedError('cannot create Model')

        try:
            pvalue = p['mass::b(MSbar)'].evaluate()
            mvalue = m.m_b_msbar(pvalue)
            if not pvalue == mvalue:
                raise TestFailedError('internal error')
        except:
            raise TestFailedError('cannot determine running b quark mass')
Пример #4
0
    def check_006_Observable(self):
        from eos import Observable, Parameters, Kinematics, Options, QualifiedName

        obs = None
        try:
            obs = Observable.make('B->K^*ll::A_FB(s)@LargeRecoil', Parameters.Defaults(), Kinematics(s=1.0),
                    Options(model='SM'))
        except:
            raise TestFailedError('cannot create Observable')

        if not obs:
            raise TestFailedError('lookup of Observable failed')

        if not obs.name() == 'B->K^*ll::A_FB(s)@LargeRecoil':
            raise TestFailedError('cannot obtain Observable name')

        value = None
        try:
            value = obs.evaluate()
        except:
            raise TestFailedError('cannote evaluate Observable')
Пример #5
0
    def check_007_Constraint(self):
        """
        Check if an instance of Constraint can be created, and if we can iterate over
        its LogLikelihoodBlock range.
        """
        from eos import Constraint, Options

        con = None
        try:
            con = Constraint.make('B->D::f_++f_0@HPQCD2015A', Options())
        except:
            raise TestFailedError('cannot create Constraint')

        if not con.name() == 'B->D::f_++f_0@HPQCD2015A':
            raise TestFailedError('cannot obtain Constraint name')

        for llhb in con.blocks():
            print(llhb)

        for obs in con.observables():
            print(obs.name())
Пример #6
0
    def check_006_Observable(self):
        """Check if an instance of Observable can be created."""
        from eos import Observable, Parameters, Kinematics, Options, QualifiedName

        obs = None
        try:
            obs = Observable.make('B->Dlnu::BR', Parameters.Defaults(),
                                  Kinematics(q2_min=0.02, q2_max=10),
                                  Options(model='SM'))
        except:
            raise TestFailedError('cannot create Observable')

        if not obs:
            raise TestFailedError('lookup of Observable failed')

        if not obs.name() == 'B->Dlnu::BR':
            raise TestFailedError('cannot obtain Observable name')

        value = None
        try:
            value = obs.evaluate()
        except:
            raise TestFailedError('cannote evaluate Observable')