Example #1
0
def helicity_amps_ff(q2, wc_obj, par_dict, B, P, l1, l2, cp_conjugate):
    par = par_dict.copy()
    if cp_conjugate:
        par = conjugate_par(par)
    scale = config['renormalization scale']['bpll']
    label = meson_quark[(B,P)] + l1 + l2 # e.g. bsmumu, bdtautau
    if l1 == l2:
        # include SM contributions for LF conserving decay
        wc = wctot_dict(wc_obj, label, scale, par)
    else:
        wc = wc_obj.get_wc(label, scale, par)
    if cp_conjugate:
        wc = conjugate_wc(wc)
    if l1 == l2:
        wc_eff = get_wceff(q2, wc, par, B, P, l1, scale)
    else:
        wc_eff = get_wceff_lfv(q2, wc, par, B, P, l1, l2, scale)
    ml1 = par['m_'+l1]
    ml2 = par['m_'+l2]
    mB = par['m_'+B]
    mP = par['m_'+P]
    mb = running.get_mb(par, scale)
    N = prefactor(q2, par, B, P)
    ff = get_ff(q2, par, B, P)
    h = angular.helicity_amps_p(q2, mB, mP, mb, 0, ml1, ml2, ff, wc_eff, N)
    return h
Example #2
0
def helicity_amps_ff(q2, wc_obj, par_dict, B, P, l1, l2, cp_conjugate):
    par = par_dict.copy()
    if cp_conjugate:
        par = conjugate_par(par)
    scale = config['renormalization scale']['bpll']
    label = meson_quark[(B,P)] + l1 + l2 # e.g. bsmumu, bdtautau
    if l1 == l2:
        # include SM contributions for LF conserving decay
        wc = wctot_dict(wc_obj, label, scale, par)
    else:
        wc = wc_obj.get_wc(label, scale, par)
    if cp_conjugate:
        wc = conjugate_wc(wc)
    if l1 == l2:
        wc_eff = get_wceff(q2, wc, par, B, P, l1, scale)
    else:
        wc_eff = get_wceff_lfv(q2, wc, par, B, P, l1, l2, scale)
    ml1 = par['m_'+l1]
    ml2 = par['m_'+l2]
    mB = par['m_'+B]
    mP = par['m_'+P]
    mb = running.get_mb(par, scale)
    N = prefactor(q2, par, B, P)
    ff = get_ff(q2, par, B, P)
    h = angular.helicity_amps_p(q2, mB, mP, mb, 0, ml1, ml2, ff, wc_eff, N)
    return h
 def test_functions(self):
     # check if the limit q2->0 is implemented correctly
     self.assertAlmostEqual(matrixelements.F_87(0.1, 0.),
                            matrixelements.F_87(0.1, 1e-8),
                            places=6)
     self.assertAlmostEqual(matrixelements.SeidelA(0, 4, 5),
                            matrixelements.SeidelA(1e-8, 4, 5),
                            places=6)
     # for F_89, just see if this raises an exception
     matrixelements.F_89(0.4, 0.5)
     wc_obj = WilsonCoefficients()
     wc = wctot_dict(wc_obj, 'bsmumu', 4.2, par)
     matrixelements.delta_C7(par, wc, q2=3.5, scale=4.2, qiqj='bs')
     matrixelements.delta_C9(par, wc, q2=3.5, scale=4.2, qiqj='bs')
     # comparing to the values from the data file
     x =  [1.3, 0.13, 0.18]
     self.assertEqual(matrixelements.F_17(*x), -0.795182 -0.0449909j)
     self.assertAlmostEqual(matrixelements.F_19(*x),-16.3032 +0.281462j, places=3)
     self.assertEqual(matrixelements.F_27(*x), 4.77109 +0.269943j)
     self.assertAlmostEqual(matrixelements.F_29(*x), 6.75552 -1.6887j, places=3)
     # it should be that F17+F27/6=0
     self.assertAlmostEqual(matrixelements.F_17(*x),-matrixelements.F_27(*x)/6,places=5)
     # check the limiting cases of the quark loop function
     self.assertAlmostEqual(matrixelements.h(3.5, 1e-8, 4.2), matrixelements.h(3.5, 0., 4.2), places=6)
     self.assertAlmostEqual(matrixelements.h(1e-8, 1.2, 4.2), matrixelements.h(0., 1.2, 4.2), places=6)
     # comparing roughly to the plots in hep-ph/0403185v2 (but with opposite sign!)
     x = [2.5, 4.75, 4.75]
     np.testing.assert_almost_equal(-matrixelements.Fu_17(*x), 1.045 + 0.62j, decimal=1)
     np.testing.assert_almost_equal(-matrixelements.Fu_19(*x), -0.57 + 8.3j, decimal=1)
     np.testing.assert_almost_equal(-matrixelements.Fu_29(*x), -13.9 + -32.5j, decimal=0)
 def function(wc_obj, par_dict, q2, cp_conjugate):
     par = par_dict.copy()
     if cp_conjugate:
         par = conjugate_par(par)
     wc = wctot_dict(wc_obj, label, scale, par)
     if cp_conjugate:
         wc = conjugate_wc(wc)
     return flavio.physics.bdecays.bvll.qcdf.helicity_amps_qcdf(q2, wc, par, B, V)
Example #5
0
def bqll_obs(function, wc_obj, par, B, l1, l2):
    scale = config['renormalization scale']['bll']
    label = meson_quark[B] + l1 + l2
    if l1 == l2:
        # include SM contributions for LF conserving decay
        wc = wctot_dict(wc_obj, label, scale, par)
    else:
        wc = wc_obj.get_wc(label, scale, par)
    return function(par, wc, B, l1, l2)
Example #6
0
File: bll.py Project: nsahoo/flavio
def bqll_obs(function, wc_obj, par, B, l1, l2):
    scale = config['renormalization scale']['bll']
    label = meson_quark[B]+l1+l2
    if l1 == l2:
        # include SM contributions for LF conserving decay
        wc = wctot_dict(wc_obj, label, scale, par)
    else:
        wc = wc_obj.get_wc(label, scale, par)
    return function(par, wc, B, l1, l2)
 def test_functions(self):
     # check if the limit q2->0 is implemented correctly
     self.assertAlmostEqual(matrixelements.F_87(0.1, 0.),
                            matrixelements.F_87(0.1, 1e-8),
                            places=6)
     self.assertAlmostEqual(matrixelements.SeidelA(0, 4, 5),
                            matrixelements.SeidelA(1e-8, 4, 5),
                            places=6)
     # for F_89, just see if this raises an exception
     matrixelements.F_89(0.4, 0.5)
     wc_obj = WilsonCoefficients()
     wc = wctot_dict(wc_obj, 'bsmumu', 4.2, par)
     matrixelements.delta_C7(par, wc, q2=3.5, scale=4.2, qiqj='bs')
     matrixelements.delta_C9(par, wc, q2=3.5, scale=4.2, qiqj='bs')
     # comparing to the values from the data file
     x = [1.3, 0.13, 0.18]
     self.assertEqual(matrixelements.F_17(*x), -0.795182 - 0.0449909j)
     self.assertAlmostEqual(matrixelements.F_19(*x),
                            -16.3032 + 0.281462j,
                            places=3)
     self.assertEqual(matrixelements.F_27(*x), 4.77109 + 0.269943j)
     self.assertAlmostEqual(matrixelements.F_29(*x),
                            6.75552 - 1.6887j,
                            places=3)
     # it should be that F17+F27/6=0
     self.assertAlmostEqual(matrixelements.F_17(*x),
                            -matrixelements.F_27(*x) / 6,
                            places=5)
     # check the limiting cases of the quark loop function
     self.assertAlmostEqual(matrixelements.h(3.5, 1e-8, 4.2),
                            matrixelements.h(3.5, 0., 4.2),
                            places=6)
     self.assertAlmostEqual(matrixelements.h(1e-8, 1.2, 4.2),
                            matrixelements.h(0., 1.2, 4.2),
                            places=6)
     # comparing roughly to the plots in hep-ph/0403185v2 (but with opposite sign!)
     x = [2.5, 4.75, 4.75]
     np.testing.assert_almost_equal(-matrixelements.Fu_17(*x),
                                    1.045 + 0.62j,
                                    decimal=1)
     np.testing.assert_almost_equal(-matrixelements.Fu_19(*x),
                                    -0.57 + 8.3j,
                                    decimal=1)
     np.testing.assert_almost_equal(-matrixelements.Fu_29(*x),
                                    -13.9 + -32.5j,
                                    decimal=0)
Example #8
0
def helicity_amps_ff(q2, ff, wc_obj, par_dict, B, V, lep, cp_conjugate):
    par = par_dict.copy()
    if cp_conjugate:
        par = conjugate_par(par)
    scale = config['renormalization scale']['bvll']
    label = meson_quark[(B,V)] + lep + lep # e.g. bsmumu, bdtautau
    wc = wctot_dict(wc_obj, label, scale, par)
    if cp_conjugate:
        wc = conjugate_wc(wc)
    wc_eff = get_wceff(q2, wc, par, B, V, lep, scale)
    ml = par['m_'+lep]
    mB = par['m_'+B]
    mV = par['m_'+V]
    mb = running.get_mb(par, scale)
    N = prefactor(q2, par, B, V)
    h = angular.helicity_amps_v(q2, mB, mV, mb, 0, ml, ml, ff, wc_eff, N)
    return h
Example #9
0
def helicity_amps_ff(q2, ff, wc_obj, par_dict, B, V, lep, cp_conjugate):
    par = par_dict.copy()
    if cp_conjugate:
        par = conjugate_par(par)
    scale = config['renormalization scale']['bvll']
    label = meson_quark[(B, V)] + lep + lep  # e.g. bsmumu, bdtautau
    wc = wctot_dict(wc_obj, label, scale, par)
    if cp_conjugate:
        wc = conjugate_wc(wc)
    wc_eff = get_wceff(q2, wc, par, B, V, lep, scale)
    ml = par['m_' + lep]
    mB = par['m_' + B]
    mV = par['m_' + V]
    mb = running.get_mb(par, scale)
    N = prefactor(q2, par, B, V)
    h = angular.helicity_amps_v(q2, mB, mV, mb, 0, ml, ml, ff, wc_eff, N)
    return h
Example #10
0
def amps_ff(wc_obj, par_dict, B, V, cp_conjugate):
    par = par_dict.copy()
    if cp_conjugate:
        par = conjugate_par(par)
    N = prefactor(par, B, V)
    bq = meson_quark[(B, V)]
    ff_name = meson_ff[(B, V)] + " form factor"
    ff = AuxiliaryQuantity.get_instance(ff_name).prediction(par_dict=par, wc_obj=None, q2=0.0)
    scale = config["renormalization scale"]["bvgamma"]
    # these are the b->qee Wilson coefficients - they contain the b->qgamma ones as a subset
    wc = wctot_dict(wc_obj, bq + "ee", scale, par)
    if cp_conjugate:
        wc = conjugate_wc(wc)
    delta_C7 = flavio.physics.bdecays.matrixelements.delta_C7(par=par, wc=wc, q2=0, scale=scale, qiqj=bq)
    a = {}
    a["L"] = N * (wc["C7eff_" + bq] + delta_C7) * ff["T1"]
    a["R"] = N * wc["C7effp_" + bq] * ff["T1"]
    return a
Example #11
0
def amps_ff(wc_obj, par_dict, B, V, cp_conjugate):
    par = par_dict.copy()
    if cp_conjugate:
        par = conjugate_par(par)
    N = prefactor(par, B, V)
    bq = meson_quark[(B,V)]
    ff_name = meson_ff[(B,V)] + ' form factor'
    ff = AuxiliaryQuantity[ff_name].prediction(par_dict=par, wc_obj=None, q2=0.)
    scale = config['renormalization scale']['bvgamma']
    # these are the b->qee Wilson coefficients - they contain the b->qgamma ones as a subset
    wc = wctot_dict(wc_obj, bq+'ee', scale, par)
    if cp_conjugate:
        wc = conjugate_wc(wc)
    delta_C7 = flavio.physics.bdecays.matrixelements.delta_C7(par=par, wc=wc, q2=0, scale=scale, qiqj=bq)
    a = {}
    a['L'] = N * (wc['C7eff_'+bq] + delta_C7)  * ff['T1']
    a['R'] = N * wc['C7effp_'+bq] * ff['T1']
    return a
Example #12
0
def bllg_dbrdq2(q2, wc_obj, par, B, lep):
    if q2 >= 8.7 and q2 < 14 and lep != 'tau':
        warnings.warn(
            "The predictions in the region of narrow charmonium resonances are not meaningful"
        )
    tauB = par['tau_' + B]
    ml = par['m_' + lep]
    mB = par['m_' + B]
    scale = config['renormalization scale']['bllgamma']
    ff = get_ff(q2, par, B)
    ff0 = get_ff(0, par, B)
    label = meson_quark[B] + lep + lep
    wc = wctot_dict(wc_obj, label, scale, par)
    if q2 <= 4 * ml**2 or q2 > mB**2:
        return 0
    else:
        dBR = tauB * dGdsMN(q2 / mB**2, par, B, ff, ff0, lep, wc)
        return dBR
Example #13
0
def amps_ff(wc_obj, par_dict, B, V, cp_conjugate):
    par = par_dict.copy()
    if cp_conjugate:
        par = conjugate_par(par)
    N = prefactor(par, B, V)
    bq = meson_quark[(B,V)]
    ff_name = meson_ff[(B,V)] + ' form factor'
    ff = AuxiliaryQuantity.get_instance(ff_name).prediction(par_dict=par, wc_obj=None, q2=0.)
    scale = config['renormalization scale']['bvgamma']
    # these are the b->qee Wilson coefficients - they contain the b->qgamma ones as a subset
    wc = wctot_dict(wc_obj, bq+'ee', scale, par)
    if cp_conjugate:
        wc = conjugate_wc(wc)
    delta_C7 = flavio.physics.bdecays.matrixelements.delta_C7(par=par, wc=wc, q2=0, scale=scale, qiqj=bq)
    a = {}
    a['L'] = N * (wc['C7eff_'+bq] + delta_C7)  * ff['T1']
    a['R'] = N * wc['C7effp_'+bq] * ff['T1']
    return a
Example #14
0
 def __init__(self, B, V, lep, wc_obj, par):
     """Initialize the class and cache results needed more often."""
     self.B = B
     self.V = V
     self.lep = lep
     self.wc_obj = wc_obj
     self.par = par
     self.par_conjugate = conjugate_par(par)
     self.prefactor = prefactor(None, self.par, B, V)
     self.prefactor_conjugate = prefactor(None, self.par_conjugate, B, V)
     self.scale = config['renormalization scale']['bvll']
     self.label = meson_quark[(B,V)] + lep + lep # e.g. bsmumu, bdtautau
     self.wctot_dict = wctot_dict(wc_obj, self.label, self.scale, par)
     self._ff = {}
     self._wceff = {}
     self._wceff_bar = {}
     self._ha = {}
     self._ha_bar = {}
     self._j = {}
     self._j_bar = {}
     self.ml = par['m_'+lep]
     self.mB = par['m_'+B]
     self.mV = par['m_'+V]
     self.mb = running.get_mb(par, self.scale)
Example #15
0
 def __init__(self, B, V, lep, wc_obj, par):
     """Initialize the class and cache results needed more often."""
     self.B = B
     self.V = V
     self.lep = lep
     self.wc_obj = wc_obj
     self.par = par
     self.par_conjugate = conjugate_par(par)
     self.prefactor = prefactor(None, self.par, B, V)
     self.prefactor_conjugate = prefactor(None, self.par_conjugate, B, V)
     self.scale = config['renormalization scale']['bvll']
     self.label = meson_quark[(B,V)] + lep + lep # e.g. bsmumu, bdtautau
     self.wctot_dict = wctot_dict(wc_obj, self.label, self.scale, par)
     self._ff = {}
     self._wceff = {}
     self._wceff_bar = {}
     self._ha = {}
     self._ha_bar = {}
     self._j = {}
     self._j_bar = {}
     self.ml = par['m_'+lep]
     self.mB = par['m_'+B]
     self.mV = par['m_'+V]
     self.mb = running.get_mb(par, self.scale)
Example #16
0
def tau_ll_func(wc_obj, par, B, lep):
    scale = config['renormalization scale']['bll']
    label = meson_quark[B]+lep+lep
    wc = wctot_dict(wc_obj, label, scale, par)
    return tau_ll(wc, par, B, lep)
Example #17
0
from flavio.physics.bdecays.bvll.amplitudes import *
from flavio.physics.eft import WilsonCoefficients
from flavio.physics.bdecays.wilsoncoefficients import wctot_dict
from flavio.physics.bdecays.formfactors.b_v import bsz_parameters
from flavio.physics.running import running
from flavio.parameters import default_parameters
import copy

s = 1.519267515435317e+24

c = copy.deepcopy(default_parameters)
bsz_parameters.bsz_load_v1_lcsr(c)
par = c.get_central_all()

wc_obj = WilsonCoefficients()
wc = wctot_dict(wc_obj, 'bsmumu', 4.2, par)


class TestQCDF(unittest.TestCase):
    def test_qcdf(self):
        q2 = 3.5
        B = 'B0'
        V = 'K*0'
        u = 0.5
        scale = 4.8
        # compare to David's old Mathematica code
        # (commented lines correspond to errors in the old code)
        np.testing.assert_almost_equal(L1(1.), 0, decimal=5)
        np.testing.assert_almost_equal(L1(-1.), -0.582241, decimal=5)
        np.testing.assert_almost_equal(L1(0), -1.64493, decimal=5)
        np.testing.assert_almost_equal(L1(1. + 1.j),
Example #18
0
from flavio.physics.bdecays.bvll.amplitudes import *
from flavio.physics.eft import WilsonCoefficients
from flavio.physics.bdecays.wilsoncoefficients import wctot_dict
from flavio.physics.bdecays.formfactors.b_v import bsz_parameters
from flavio.physics.running import running
from flavio.parameters import default_parameters
import copy

s = 1.519267515435317e+24

c = copy.deepcopy(default_parameters)
bsz_parameters.bsz_load_v1_lcsr(c)
par = c.get_central_all()

wc_obj = WilsonCoefficients()
wc = wctot_dict(wc_obj, 'bsmumu', 4.2, par)

class TestQCDF(unittest.TestCase):
    def test_qcdf(self):
        q2=3.5
        B='B0'
        V='K*0'
        u=0.5
        scale=4.8
        # compare to David's old Mathematica code
        np.testing.assert_almost_equal(L1(1.), 0, decimal=5)
        np.testing.assert_almost_equal(L1(-1.), -0.582241, decimal=5)
        np.testing.assert_almost_equal(L1(0), -1.64493, decimal=5)
        np.testing.assert_almost_equal(L1(1.+1.j), 0.205617-0.915966j, decimal=5)
        np.testing.assert_almost_equal(L1(1.-1.j), 0.205617+0.915966j, decimal=5)
        np.testing.assert_almost_equal(i1_bfs(q2, u, 4.8, 5.27961), -0.0768, decimal=3)
Example #19
0
c = copy.deepcopy(default_parameters)
# parameters taken from PDG and table I of 1311.0903
c.set_constraint('alpha_s', '0.1184(7)')
c.set_constraint('f_Bs', '0.2277(45)')
c.set_constraint('f_B0', '0.1905(42)')
c.set_constraint('Vcb', 4.24e-2)
c.set_constraint('Vub', 3.82e-3)
c.set_constraint('gamma', radians(73.))
c.set_constraint('DeltaGamma/Gamma_Bs', 0.1226)

par = c.get_central_all()


wc_obj = WilsonCoefficients()
wc = wctot_dict(wc_obj, 'bsmumu', 4.8, par)
wc_e = wctot_dict(wc_obj, 'bsee', 4.8, par)
wc_tau = wctot_dict(wc_obj, 'bstautau', 4.8, par)


class TestBll(unittest.TestCase):
    def test_bsll(self):
        # just some trivial tests to see if calling the functions raises an error
        self.assertGreater(br_lifetime_corr(0.08, -1), 0)
        self.assertEqual(len(amplitudes(par, wc, 'Bs', 'mu', 'mu')), 2)
        # ADeltaGamma should be +1.0 in the SM
        self.assertEqual(ADeltaGamma(par, wc, 'Bs', 'mu'), 1.0)
        self.assertEqual(flavio.sm_prediction('ADeltaGamma(Bs->mumu)'), 1.0)
        # BR should be around 3.5e-9
        self.assertAlmostEqual(br_inst(par, wc, 'Bs', 'mu', 'mu')*1e9, 3.5, places=0)
        # correction factor should enhance the BR by roughly 7%
Example #20
0
 def ADG_func(wc_obj, par):
     scale = config['renormalization scale']['bll']
     label = meson_quark[B] + lep + lep
     wc = wctot_dict(wc_obj, label, scale, par)
     return ADeltaGamma(par, wc, B, lep)
Example #21
0
def tau_ll_func(wc_obj, par, B, lep):
    scale = config['renormalization scale']['bll']
    label = meson_quark[B] + lep + lep
    wc = wctot_dict(wc_obj, label, scale, par)
    return tau_ll(wc, par, B, lep)
Example #22
0
c = copy.deepcopy(default_parameters)
# parameters taken from PDG and table I of 1311.0903
c.set_constraint('alpha_s', '0.1184(7)')
c.set_constraint('f_Bs', '0.2277(45)')
c.set_constraint('f_B0', '0.1905(42)')
c.set_constraint('Vcb', 4.24e-2)
c.set_constraint('Vub', 3.82e-3)
c.set_constraint('delta', radians(73.))
c.set_constraint('DeltaGamma/Gamma_Bs', 0.1226)

par = c.get_central_all()


wc_obj = WilsonCoefficients()
wc = wctot_dict(wc_obj, 'bsmumu', 4.8, par)
wc_e = wctot_dict(wc_obj, 'bsee', 4.8, par)
wc_tau = wctot_dict(wc_obj, 'bstautau', 4.8, par)


class TestBll(unittest.TestCase):
    def test_bsll(self):
        # just some trivial tests to see if calling the functions raises an error
        self.assertGreater(br_lifetime_corr(0.08, -1), 0)
        self.assertEqual(len(amplitudes(par, wc, 'Bs', 'mu', 'mu')), 2)
        # ADeltaGamma should be +1.0 in the SM
        self.assertEqual(ADeltaGamma(par, wc, 'Bs', 'mu'), 1.0)
        self.assertEqual(flavio.sm_prediction('ADeltaGamma(Bs->mumu)'), 1.0)
        # BR should be around 3.5e-9
        self.assertAlmostEqual(br_inst(par, wc, 'Bs', 'mu', 'mu')*1e9, 3.5, places=0)
        # correction factor should enhance the BR by roughly 7%
Example #23
0
 def ADG_func(wc_obj, par):
     scale = config['renormalization scale']['bll']
     label = meson_quark[B]+lep+lep
     wc = wctot_dict(wc_obj, label, scale, par)
     return ADeltaGamma(par, wc, B, lep)