Module flavio.physics.bdecays.test_wc

Classes

class TestBWilson (methodName='runTest')
Expand source code
class TestBWilson(unittest.TestCase):
    def test_wctot(self):
        wc_low_correct = np.array([ -2.93671059e-01,   1.01676402e+00,  -5.87762813e-03,
        -8.70666812e-02,   4.11098919e-04,   1.10641294e-03,
        -2.95662859e-01,  -1.63048361e-01,   4.11363023e+00,
        -4.19345312e+00,   3.43507549e-03,   1.22202095e-03,
        -1.03192325e-03,  -1.00703396e-04,  -3.17810374e-03])
        wc_obj = eft.WilsonCoefficients()
        wc_low = wilsoncoefficients.wctot_dict(wc_obj, 'bsmumu', 4.2, par)
        wc_names = ['C1_bs', 'C2_bs', 'C3_bs', 'C4_bs', 'C5_bs', 'C6_bs', 'C7_bs', 'C8_bs', 'C9_bsmumu', 'C10_bsmumu', 'C3Q_bs', 'C4Q_bs', 'C5Q_bs', 'C6Q_bs', 'Cb_bs', 'C1p_bs', 'C2p_bs', 'C3p_bs', 'C4p_bs', 'C5p_bs', 'C6p_bs', 'C7p_bs', 'C8p_bs', 'C9p_bsmumu', 'C10p_bsmumu', 'C3Qp_bs', 'C4Qp_bs', 'C5Qp_bs', 'C6Qp_bs', 'Cbp_bs', 'CS_bsmumu', 'CP_bsmumu', 'CSp_bsmumu', 'CPp_bsmumu']
        wc_low_array = np.asarray([wc_low[key] for key in wc_names])
        yi = np.array([0, 0, -1/3., -4/9., -20/3., -80/9.])
        zi = np.array([0, 0, 1, -1/6., 20, -10/3.])
        wc_low_array[6] = wc_low_array[6] + np.dot(yi, wc_low_array[:6]) # c7eff
        wc_low_array[7] = wc_low_array[7] + np.dot(zi, wc_low_array[:6]) # c8eff
        np.testing.assert_almost_equal(wc_low_array[:15], wc_low_correct, decimal=2)

    def test_C78p(self):
        wc_obj = eft.WilsonCoefficients()
        wc_low = wilsoncoefficients.wctot_dict(wc_obj, 'bsmumu', 4.2, par)
        ms = flavio.physics.running.running.get_ms(par, 4.2, nf_out=5)
        mb = flavio.physics.running.running.get_mb(par, 4.2, nf_out=5)
        self.assertAlmostEqual(wc_low['C7p_bs']/wc_low['C7_bs'], ms/mb)
        self.assertAlmostEqual(wc_low['C8p_bs']/wc_low['C8_bs'], ms/mb)

    def test_clnu(self):
        par_dict = flavio.default_parameters.get_central_all()
        cl = wilsoncoefficients.CL_SM(par_dict, scale=91.1876)
        # comparing the central value of X_t to (5) of 2105.02868
        self.assertAlmostEqual(-cl*par_dict['s2w']/1.462, 1, delta=0.001)

A class whose instances are single test cases.

By default, the test code itself should be placed in a method named 'runTest'.

If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute.

Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test's environment ('fixture') can be implemented by overriding the 'setUp' and 'tearDown' methods respectively.

If it is necessary to override the init method, the base class init method must always be called. It is important that subclasses should not change the signature of their init method, since instances of the classes are instantiated automatically by parts of the framework in order to be run.

When subclassing TestCase, you can set these attributes: * failureException: determines which exception will be raised when the instance's assertion methods fail; test methods raising this exception will be deemed to have 'failed' rather than 'errored'. * longMessage: determines whether long messages (including repr of objects used in assert methods) will be printed on failure in addition to any explicit message passed. * maxDiff: sets the maximum length of a diff in failure messages by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Ancestors

  • unittest.case.TestCase

Methods

def test_C78p(self)
Expand source code
def test_C78p(self):
    wc_obj = eft.WilsonCoefficients()
    wc_low = wilsoncoefficients.wctot_dict(wc_obj, 'bsmumu', 4.2, par)
    ms = flavio.physics.running.running.get_ms(par, 4.2, nf_out=5)
    mb = flavio.physics.running.running.get_mb(par, 4.2, nf_out=5)
    self.assertAlmostEqual(wc_low['C7p_bs']/wc_low['C7_bs'], ms/mb)
    self.assertAlmostEqual(wc_low['C8p_bs']/wc_low['C8_bs'], ms/mb)
def test_clnu(self)
Expand source code
def test_clnu(self):
    par_dict = flavio.default_parameters.get_central_all()
    cl = wilsoncoefficients.CL_SM(par_dict, scale=91.1876)
    # comparing the central value of X_t to (5) of 2105.02868
    self.assertAlmostEqual(-cl*par_dict['s2w']/1.462, 1, delta=0.001)
def test_wctot(self)
Expand source code
def test_wctot(self):
    wc_low_correct = np.array([ -2.93671059e-01,   1.01676402e+00,  -5.87762813e-03,
    -8.70666812e-02,   4.11098919e-04,   1.10641294e-03,
    -2.95662859e-01,  -1.63048361e-01,   4.11363023e+00,
    -4.19345312e+00,   3.43507549e-03,   1.22202095e-03,
    -1.03192325e-03,  -1.00703396e-04,  -3.17810374e-03])
    wc_obj = eft.WilsonCoefficients()
    wc_low = wilsoncoefficients.wctot_dict(wc_obj, 'bsmumu', 4.2, par)
    wc_names = ['C1_bs', 'C2_bs', 'C3_bs', 'C4_bs', 'C5_bs', 'C6_bs', 'C7_bs', 'C8_bs', 'C9_bsmumu', 'C10_bsmumu', 'C3Q_bs', 'C4Q_bs', 'C5Q_bs', 'C6Q_bs', 'Cb_bs', 'C1p_bs', 'C2p_bs', 'C3p_bs', 'C4p_bs', 'C5p_bs', 'C6p_bs', 'C7p_bs', 'C8p_bs', 'C9p_bsmumu', 'C10p_bsmumu', 'C3Qp_bs', 'C4Qp_bs', 'C5Qp_bs', 'C6Qp_bs', 'Cbp_bs', 'CS_bsmumu', 'CP_bsmumu', 'CSp_bsmumu', 'CPp_bsmumu']
    wc_low_array = np.asarray([wc_low[key] for key in wc_names])
    yi = np.array([0, 0, -1/3., -4/9., -20/3., -80/9.])
    zi = np.array([0, 0, 1, -1/6., 20, -10/3.])
    wc_low_array[6] = wc_low_array[6] + np.dot(yi, wc_low_array[:6]) # c7eff
    wc_low_array[7] = wc_low_array[7] + np.dot(zi, wc_low_array[:6]) # c8eff
    np.testing.assert_almost_equal(wc_low_array[:15], wc_low_correct, decimal=2)