Module flavio.physics.taudecays.test_taulnunu
Classes
class TestTaulnunu (methodName='runTest')-
Expand source code
class TestTaulnunu(unittest.TestCase): def test_taulnunu_exp(self): # compare to the experimental values # cf. eq. (95) of 1705.00929 self.assertAlmostEqual(flavio.sm_prediction('BR(tau->mununu)') / 0.1739, 1 / 1.0060, delta=0.0003) self.assertAlmostEqual(flavio.sm_prediction('BR(tau->enunu)') / 0.1782, 1 / 1.0022, delta=0.0003) def test_taulnunu_wrongflavor(self): self.assertEqual(taulnunu.BR_taulnunu(wc_obj, par, 'e', 'mu', 'e'), 0) def test_taulnunu_np(self): w = Wilson({'CVLL_numunuetaue': 2e-4, 'CVLL_numunueetau': 1e-4}, 80, 'WET', 'flavio') wc_np = flavio.WilsonCoefficients.from_wilson(w, par) BR1 = taulnunu.BR_taulnunu(wc_np, par, 'e', 'e', 'mu') BR2 = taulnunu.BR_taulnunu(wc_np, par, 'e', 'mu', 'e') self.assertEqual(BR1 / BR2, 4) def test_taulnunu_np2(self): w = Wilson({'CVLL_numunuetaue': 2e-2, 'CVLL_numunuetaumu': 1e-2}, 80, 'WET', 'flavio') BR1 = flavio.np_prediction('BR(tau->enunu)', w) BR2 = flavio.np_prediction('BR(tau->mununu)', w) self.assertAlmostEqual(BR1 / BR2, 4, delta=0.2) def test_GFeff(self): CLSM = -4 * par['GF'] / sqrt(2) w = Wilson({'CVLL_numunueemu': CLSM}, 80, 'WET', 'flavio') wc_np = flavio.WilsonCoefficients.from_wilson(w, par) GFeff = taulnunu.GFeff(wc_np, par) self.assertEqual(GFeff / par['GF'], 0.5) w = Wilson({'CVLL_numunueemu': -0.5 * CLSM}, 80, 'WET', 'flavio') wc_np = flavio.WilsonCoefficients.from_wilson(w, par) GFeff = taulnunu.GFeff(wc_np, par) self.assertEqual(GFeff / par['GF'], 2) def test_taulnunu_np3(self): CLSM = -4 * par['GF'] / sqrt(2) w = Wilson({'CVLL_numunueemu': CLSM}, 80, 'WET', 'flavio') BRSM = flavio.sm_prediction('BR(tau->enunu)') BRNP = flavio.np_prediction('BR(tau->enunu)', w) self.assertEqual(BRNP / BRSM, 0.25) w = Wilson({'CVLL_numunueemu': -0.5 * CLSM}, 80, 'WET', 'flavio') BRSM = flavio.sm_prediction('BR(tau->enunu)') BRNP = flavio.np_prediction('BR(tau->enunu)', w) self.assertEqual(BRNP / BRSM, 4) def test_taulnunu_np4(self): CLSM = -4 * par['GF'] / sqrt(2) w = Wilson({'CVLL_numunueemu': -0.5 * CLSM, 'CVLL_nutaunueetau': CLSM}, 80, 'WET', 'flavio') BR1 = flavio.sm_prediction('BR(tau->enunu)') BR2 = flavio.np_prediction('BR(tau->enunu)', w) self.assertAlmostEqual(BR2 / BR1, 9, delta=2e-15)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_GFeff(self)-
Expand source code
def test_GFeff(self): CLSM = -4 * par['GF'] / sqrt(2) w = Wilson({'CVLL_numunueemu': CLSM}, 80, 'WET', 'flavio') wc_np = flavio.WilsonCoefficients.from_wilson(w, par) GFeff = taulnunu.GFeff(wc_np, par) self.assertEqual(GFeff / par['GF'], 0.5) w = Wilson({'CVLL_numunueemu': -0.5 * CLSM}, 80, 'WET', 'flavio') wc_np = flavio.WilsonCoefficients.from_wilson(w, par) GFeff = taulnunu.GFeff(wc_np, par) self.assertEqual(GFeff / par['GF'], 2) def test_taulnunu_exp(self)-
Expand source code
def test_taulnunu_exp(self): # compare to the experimental values # cf. eq. (95) of 1705.00929 self.assertAlmostEqual(flavio.sm_prediction('BR(tau->mununu)') / 0.1739, 1 / 1.0060, delta=0.0003) self.assertAlmostEqual(flavio.sm_prediction('BR(tau->enunu)') / 0.1782, 1 / 1.0022, delta=0.0003) def test_taulnunu_np(self)-
Expand source code
def test_taulnunu_np(self): w = Wilson({'CVLL_numunuetaue': 2e-4, 'CVLL_numunueetau': 1e-4}, 80, 'WET', 'flavio') wc_np = flavio.WilsonCoefficients.from_wilson(w, par) BR1 = taulnunu.BR_taulnunu(wc_np, par, 'e', 'e', 'mu') BR2 = taulnunu.BR_taulnunu(wc_np, par, 'e', 'mu', 'e') self.assertEqual(BR1 / BR2, 4) def test_taulnunu_np2(self)-
Expand source code
def test_taulnunu_np2(self): w = Wilson({'CVLL_numunuetaue': 2e-2, 'CVLL_numunuetaumu': 1e-2}, 80, 'WET', 'flavio') BR1 = flavio.np_prediction('BR(tau->enunu)', w) BR2 = flavio.np_prediction('BR(tau->mununu)', w) self.assertAlmostEqual(BR1 / BR2, 4, delta=0.2) def test_taulnunu_np3(self)-
Expand source code
def test_taulnunu_np3(self): CLSM = -4 * par['GF'] / sqrt(2) w = Wilson({'CVLL_numunueemu': CLSM}, 80, 'WET', 'flavio') BRSM = flavio.sm_prediction('BR(tau->enunu)') BRNP = flavio.np_prediction('BR(tau->enunu)', w) self.assertEqual(BRNP / BRSM, 0.25) w = Wilson({'CVLL_numunueemu': -0.5 * CLSM}, 80, 'WET', 'flavio') BRSM = flavio.sm_prediction('BR(tau->enunu)') BRNP = flavio.np_prediction('BR(tau->enunu)', w) self.assertEqual(BRNP / BRSM, 4) def test_taulnunu_np4(self)-
Expand source code
def test_taulnunu_np4(self): CLSM = -4 * par['GF'] / sqrt(2) w = Wilson({'CVLL_numunueemu': -0.5 * CLSM, 'CVLL_nutaunueetau': CLSM}, 80, 'WET', 'flavio') BR1 = flavio.sm_prediction('BR(tau->enunu)') BR2 = flavio.np_prediction('BR(tau->enunu)', w) self.assertAlmostEqual(BR2 / BR1, 9, delta=2e-15) def test_taulnunu_wrongflavor(self)-
Expand source code
def test_taulnunu_wrongflavor(self): self.assertEqual(taulnunu.BR_taulnunu(wc_obj, par, 'e', 'mu', 'e'), 0)