Skip to content

Commit

Permalink
Changing names wrt pythons naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
Felicia56 committed Dec 7, 2021
1 parent 9465fd0 commit 0640f1d
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 133 deletions.
56 changes: 28 additions & 28 deletions flavio/physics/bdecays/formfactors/lambdab_32/LatticeQCD.py
@@ -1,12 +1,12 @@
from math import sqrt, exp

def omega(q2, mLb, mLst):
def omega_fct(q2, mLb, mLst):
# eq. (73) in arXiv:2009.09313v1
return (mLb*mLb + mLst*mLst - q2)/(2*mLb*mLst)

def F(q2, Ff, Af, Omega):
def ff_formula(q2, F, A, omega):
# eq. (75)
return Ff + Af*(Omega - 1)
return F + A*(omega - 1)

_process_dict = {}
_process_dict['Lambdab->Lambda(1520)'] = {'X': 'Lambda(1520)'}
Expand All @@ -17,47 +17,47 @@ def formfactors(process, par, q2):
mL = par['m_'+pd['X']]
mLb = par['m_Lambdab']

Omega = omega(q2, mLb, mL)
FList = ['f0', 'fplus', 'fperp', 'fperpPrim',
'g0', 'gplus', 'gperp', 'gperpPrim',
'hplus', 'hperp', 'hperpPrim', 'hTplus', 'hTperp', 'hTperpPrim']
omega = omega_fct(q2, mLb, mL)
ff_list = ['f0', 'fplus', 'fperp', 'fperpPrim',
'g0', 'gplus', 'gperp', 'gperpPrim',
'hplus', 'hperp', 'hperpPrim', 'hTplus', 'hTperp', 'hTperpPrim']

FormDict = {}
for e in FList:
Ff = par[process+' '+e+' F']
Af = par[process+' '+e+' A']
ff_dict = {}
for e in ff_list:
F = par[process+' '+e+' F']
A = par[process+' '+e+' A']

FormDict[e] = F(q2, Ff, Af, Omega)
ff_dict[e] = ff_formula(q2, F, A, omega)

return FormDict, mL, mLb
return ff_dict, mL, mLb


def ff_equiv(process, q2, par):
# eq. (A21) - (A34) and (6)
FD, mLst, mLb = formfactors(process, par, q2)
ff_dict, mLst, mLb = formfactors(process, par, q2)

splus = (mLb + mLst)**2 - q2
sminus = (mLb - mLst)**2 - q2

ff = {}
ff['fVt'] = ( mLst/splus )*FD['f0']
ff['fV0'] = ( mLst/sminus )*FD['fplus']
ff['fVperp'] = ( mLst/sminus )*FD['fperp']
ff['fVg'] = FD['fperpPrim']
ff['fVt'] = ( mLst/splus )*ff_dict['f0']
ff['fV0'] = ( mLst/sminus )*ff_dict['fplus']
ff['fVperp'] = ( mLst/sminus )*ff_dict['fperp']
ff['fVg'] = ff_dict['fperpPrim']

ff['fAt'] = ( mLst/sminus )*FD['g0']
ff['fA0'] = ( mLst/splus )*FD['gplus']
ff['fAperp'] = ( mLst/splus )*FD['gperp']
ff['fAg'] = -FD['gperpPrim']
ff['fAt'] = ( mLst/sminus )*ff_dict['g0']
ff['fA0'] = ( mLst/splus )*ff_dict['gplus']
ff['fAperp'] = ( mLst/splus )*ff_dict['gperp']
ff['fAg'] = -ff_dict['gperpPrim']

ff['fTt'] = 0
ff['fT0'] = ( mLst/sminus )*FD['hplus']
ff['fTperp'] = ( mLst/sminus )*FD['hperp']
ff['fTg'] = ( mLb + mLst )*FD['hperpPrim']
ff['fT0'] = ( mLst/sminus )*ff_dict['hplus']
ff['fTperp'] = ( mLst/sminus )*ff_dict['hperp']
ff['fTg'] = ( mLb + mLst )*ff_dict['hperpPrim']

ff['fT5t'] = 0
ff['fT50'] = ( mLst/splus )*FD['hTplus']
ff['fT5perp']= ( mLst/splus )*FD['hTperp']
ff['fT5g'] = -( mLb - mLst )*FD['hTperpPrim']
ff['fT50'] = ( mLst/splus )*ff_dict['hTplus']
ff['fT5perp']= ( mLst/splus )*ff_dict['hTperp']
ff['fT5g'] = -( mLb - mLst )*ff_dict['hTperpPrim']

return ff
65 changes: 32 additions & 33 deletions flavio/physics/bdecays/formfactors/lambdab_32/QuarkModel_MCN.py
@@ -1,21 +1,20 @@
from math import sqrt, exp

def p_Lambda(q2, mL, mLb):
def lambda_momentum(q2, mL, mLb):
# daughter baryon momentum in the Lb rest frame
s = q2/(mLb**2)
r = (mL/mLb)**2
Phi = (1-r)**2 - 2*(1+r)*s + s**2
if Phi > 0 :
return mLb/2*sqrt(Phi)
phi = (1-r)**2 - 2*(1+r)*s + s**2
if phi > 0 :
return mLb/2*sqrt(phi)
else :
#print(Phi)
return mLb/2*sqrt(-Phi)
return mLb/2*sqrt(-phi)

def m_Lambda(m_q, m_s):
def lambda_mass(m_q, m_s):
return 2*m_q + m_s


def alpha_ll(alpha_l1, alpha_l2):
def alpha_lambda_lambdaprime(alpha_l1, alpha_l2):
return sqrt((alpha_l1**2 + alpha_l2**2)/2)


Expand All @@ -39,28 +38,28 @@ def formfactors(process, par, q2):
alpha_l1 = par[process +' alpha_Lambdab']
alpha_l2 = par[process +' alpha_'+pd['X']]

FList = ['F1', 'F2', 'F3', 'F4',
'G1', 'G2', 'G3', 'G4',
'H1', 'H2', 'H3', 'H4', 'H5', 'H6']
ff_list = ['F1', 'F2', 'F3', 'F4',
'G1', 'G2', 'G3', 'G4',
'H1', 'H2', 'H3', 'H4', 'H5', 'H6']

p_L = p_Lambda(q2, mL, mLb)
mL_tilde = m_Lambda(m_q, m_s)
alpha_LL = alpha_ll(alpha_l1, alpha_l2)
p_lambda = lambda_momentum(q2, mL, mLb)
m_lambda_tilde = lambda_mass(m_q, m_s)
alpha_ll = alpha_lambda_lambdaprime(alpha_l1, alpha_l2)

FormDict = {}
for e in FList:
ff_dict = {}
for e in ff_list:
a0 = par[process+' '+e+' a0']
a2 = par[process+' '+e+' a2']
a4 = par[process+' '+e+' a4']

FormDict[e] = F(a0, a2, a4, p_L, m_q, mL_tilde, alpha_LL)
ff_dict[e] = F(a0, a2, a4, p_lambda, m_q, m_lambda_tilde, alpha_ll)

return FormDict, mL, mLb
return ff_dict, mL, mLb


def ff_equiv(process, q2, par):
# transform FormDict in form factors used in arXiv:1903.00448
FD, mL, mLb = formfactors(process, par, q2)
ff_dict, mL, mLb = formfactors(process, par, q2)

e_fVt = par[process+' fVt uncertainty']
e_fVperp = par[process+' fVperp uncertainty']
Expand All @@ -80,25 +79,25 @@ def ff_equiv(process, q2, par):
e_fT5g = par[process+' fT5g uncertainty']

ff = {}
ff['fVt'] = ( FD['F2']*mL*(mL**2 - mLb**2 - q2) + mLb*(2*FD['F1']*mL*(mL - mLb) - 2*FD['F4']*mL*mLb + FD['F3']*(mL**2 - mLb**2 + q2)) )/( 2*mL*(mL-mLb)*mLb**2 ) * e_fVt
ff['fVperp'] = ( FD["F1"]/mLb - FD["F4"]*mL/(mL**2 - 2*mL*mLb + mLb**2 - q2) )*e_fVperp
ff['fV0'] = ( FD["F2"]*mL*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2)) + mLb*(2*FD["F1"]*mL*(mL + mLb)*(mL**2 - 2*mL*mLb + mLb**2 - q2) - 2*FD["F4"]*mL*mLb*(mL**2 - mLb**2 + q2) + FD["F3"]*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2))) )/( 2*mL*mLb**2*(mL+mLb)*(mL**2 - 2*mL*mLb + mLb**2 - q2) )*e_fV0
ff['fVg'] = FD["F4"]*e_fVg
ff['fVt'] = ( ff_dict['F2']*mL*(mL**2 - mLb**2 - q2) + mLb*(2*ff_dict['F1']*mL*(mL - mLb) - 2*ff_dict['F4']*mL*mLb + ff_dict['F3']*(mL**2 - mLb**2 + q2)) )/( 2*mL*(mL-mLb)*mLb**2 ) * e_fVt
ff['fVperp'] = ( ff_dict["F1"]/mLb - ff_dict["F4"]*mL/(mL**2 - 2*mL*mLb + mLb**2 - q2) )*e_fVperp
ff['fV0'] = ( ff_dict["F2"]*mL*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2)) + mLb*(2*ff_dict["F1"]*mL*(mL + mLb)*(mL**2 - 2*mL*mLb + mLb**2 - q2) - 2*ff_dict["F4"]*mL*mLb*(mL**2 - mLb**2 + q2) + ff_dict["F3"]*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2))) )/( 2*mL*mLb**2*(mL+mLb)*(mL**2 - 2*mL*mLb + mLb**2 - q2) )*e_fV0
ff['fVg'] = ff_dict["F4"]*e_fVg

ff['fAt'] = ( FD["G2"]*mL*(mL**2 - mLb**2 - q2) + mLb*(-2*FD["G4"]*mL*mLb + 2*FD["G1"]*mL*(mL + mLb) + FD["G3"]*(mL**2 - mLb**2 + q2)) )/( 2*mL*mLb**2*(mL + mLb) )*e_fAt
ff['fAperp'] = ( FD["G1"]/mLb - (FD["G4"]*mL)/(mL**2 + 2*mL*mLb + mLb**2 - q2) )*e_fAperp
ff['fA0'] = ( FD["G2"]*mL*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2)) + mLb*(2*FD["G1"]*mL*(mL - mLb)*(mL**2 + 2*mL*mLb + mLb**2 - q2) - 2*FD["G4"]*mL*mLb*(mL**2 - mLb**2 + q2) + FD["G3"]*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2))) )/( 2*mL*(mL - mLb)*mLb**2*(mL**2 + 2*mL*mLb + mLb**2 - q2) )*e_fA0
ff['fAg'] = -FD["G4"]*e_fAg
ff['fAt'] = ( ff_dict["G2"]*mL*(mL**2 - mLb**2 - q2) + mLb*(-2*ff_dict["G4"]*mL*mLb + 2*ff_dict["G1"]*mL*(mL + mLb) + ff_dict["G3"]*(mL**2 - mLb**2 + q2)) )/( 2*mL*mLb**2*(mL + mLb) )*e_fAt
ff['fAperp'] = ( ff_dict["G1"]/mLb - (ff_dict["G4"]*mL)/(mL**2 + 2*mL*mLb + mLb**2 - q2) )*e_fAperp
ff['fA0'] = ( ff_dict["G2"]*mL*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2)) + mLb*(2*ff_dict["G1"]*mL*(mL - mLb)*(mL**2 + 2*mL*mLb + mLb**2 - q2) - 2*ff_dict["G4"]*mL*mLb*(mL**2 - mLb**2 + q2) + ff_dict["G3"]*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2))) )/( 2*mL*(mL - mLb)*mLb**2*(mL**2 + 2*mL*mLb + mLb**2 - q2) )*e_fA0
ff['fAg'] = -ff_dict["G4"]*e_fAg

ff['fTt'] = 0*e_fTt
ff['fTperp'] = ( 2*FD["H5"]*mL - ((FD["H3"]+FD["H6"])*mL**2)/mLb + FD["H3"]*mLb + 2*FD["H1"]*mL*(mL + mLb)/mLb - 2*(FD["H5"] + FD["H6"])*mL**2*(mL - mLb)/((mL - mLb)**2 - q2) - FD["H3"]*q2/mLb + FD["H2"]*mL*(-mL**2 + mLb**2 + q2)/mLb**2 )/( 2*mL*(mL + mLb) )*e_fTperp
ff['fT0'] = ( (FD["H1"] + FD["H2"] - FD["H3"] - FD["H6"])/mLb - 2*((FD["H5"] + FD["H6"])*mL)/((mL - mLb)**2 - q2) + FD["H4"]*((mL + mLb)**2 - q2)/(2*mL*mLb**2) )*e_fT0
ff['fTg'] = ( FD["H5"]*(mL- mLb) - FD["H6"]*(-mL**2 + mLb**2 + q2)/(2*mLb) )*e_fTg
ff['fTperp'] = ( 2*ff_dict["H5"]*mL - ((ff_dict["H3"]+ff_dict["H6"])*mL**2)/mLb + ff_dict["H3"]*mLb + 2*ff_dict["H1"]*mL*(mL + mLb)/mLb - 2*(ff_dict["H5"] + ff_dict["H6"])*mL**2*(mL - mLb)/((mL - mLb)**2 - q2) - ff_dict["H3"]*q2/mLb + ff_dict["H2"]*mL*(-mL**2 + mLb**2 + q2)/mLb**2 )/( 2*mL*(mL + mLb) )*e_fTperp
ff['fT0'] = ( (ff_dict["H1"] + ff_dict["H2"] - ff_dict["H3"] - ff_dict["H6"])/mLb - 2*((ff_dict["H5"] + ff_dict["H6"])*mL)/((mL - mLb)**2 - q2) + ff_dict["H4"]*((mL + mLb)**2 - q2)/(2*mL*mLb**2) )*e_fT0
ff['fTg'] = ( ff_dict["H5"]*(mL- mLb) - ff_dict["H6"]*(-mL**2 + mLb**2 + q2)/(2*mLb) )*e_fTg

ff['fT5t'] = 0*e_fT5t
ff['fT5perp'] = ( -1/(2*mL*(mL-mLb)*mLb**2*(mL**2 + 2*mL*mLb + mLb**2 - q2)) * (FD["H2"]*mL*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2)) + mLb*(mL*(2*FD["H5"]*mLb*(mL*mLb + mLb**2 - q2) + FD["H6"]*mL*(mL**2 + 2*mL*mLb + mLb**2 -q2)) - 2*FD["H1"]*mL*(mL - mLb)*(mL**2 + 2*mL*mLb + mLb**2 -q2) + FD["H3"]*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2)))) )*e_fT5perp
ff['fT50'] = ( FD["H1"]/mLb + 2*FD["H5"]*mL/(mL**2 + 2*mL*mLb + mLb**2 - q2) )*e_fT50
ff['fT5g'] = ( -FD["H5"]*(mL + mLb) - FD["H6"]*(mL**2 + 2*mL*mLb + mLb**2 - q2)/(2*mLb) )*e_fT5g
ff['fT5perp'] = ( -1/(2*mL*(mL-mLb)*mLb**2*(mL**2 + 2*mL*mLb + mLb**2 - q2)) * (ff_dict["H2"]*mL*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2)) + mLb*(mL*(2*ff_dict["H5"]*mLb*(mL*mLb + mLb**2 - q2) + ff_dict["H6"]*mL*(mL**2 + 2*mL*mLb + mLb**2 -q2)) - 2*ff_dict["H1"]*mL*(mL - mLb)*(mL**2 + 2*mL*mLb + mLb**2 -q2) + ff_dict["H3"]*(mL**4 + (mLb**2 - q2)**2 - 2*mL**2*(mLb**2 + q2)))) )*e_fT5perp
ff['fT50'] = ( ff_dict["H1"]/mLb + 2*ff_dict["H5"]*mL/(mL**2 + 2*mL*mLb + mLb**2 - q2) )*e_fT50
ff['fT5g'] = ( -ff_dict["H5"]*(mL + mLb) - ff_dict["H6"]*(mL**2 + 2*mL*mLb + mLb**2 - q2)/(2*mLb) )*e_fT5g

return ff

Expand Down
66 changes: 33 additions & 33 deletions flavio/physics/bdecays/formfactors/lambdab_32/test_lambdab.py
Expand Up @@ -7,7 +7,7 @@
import numpy as np

path = get_datapath('flavio', 'data/test/')
SMarray = np.load(path+'2009.09313_digitized.npz')
sm_array = np.load(path+'2009.09313_digitized.npz')

wc_sm = flavio.WilsonCoefficients()

Expand All @@ -18,7 +18,7 @@ def pred_sm(s, name, q2val, target, delta, scalef=1):
return None


def pred_SMarrays(s, name, targetArray, Unc, delta, scalef=1):
def pred_sm_arrays(s, name, targetArray, Unc, delta, scalef=1):
obs = flavio.classes.Observable[name]
for i, q2val in enumerate(targetArray[0]):
target = targetArray[1][i]
Expand All @@ -40,41 +40,41 @@ def test_lambdab_lambda1520_ff(self):
par = flavio.default_parameters.get_central_all()
mLst = par['m_Lambda(1520)']
mLb = par['m_Lambdab']
BR = par['BR(Lambda(1520)->NKbar)_exp']
BRinv = 2/BR
BRinv2 = 2e9/BR
br = par['BR(Lambda(1520)->NKbar)_exp']
br_inv = 2/br
br_inv2 = 2e9/br

# Comparison to figure 6 in arXiv:2009.09313v2
# Scale factor BRinv2 used since in np-array factor e^(-9) not included
dBR = 'dBR/dq2(Lambdab->Lambda(1520)mumu)'
Dbr = 'dBR/dq2(Lambdab->Lambda(1520)mumu)'

pred_SMarrays(self, dBR, SMarray['dB_central'], False, 0.05, BRinv2)
pred_SMarrays(self, dBR, SMarray['dB_upper'], True, 0.15, BRinv2)
pred_SMarrays(self, dBR, SMarray['dB_lower'], True, 0.2, BRinv2)
pred_sm_arrays(self, Dbr, sm_array['dB_central'], False, 0.05, br_inv2)
pred_sm_arrays(self, Dbr, sm_array['dB_upper'], True, 0.15, br_inv2)
pred_sm_arrays(self, Dbr, sm_array['dB_lower'], True, 0.2, br_inv2)

# BRinv since not included in figure
pred_sm(self, dBR, 16.0, 2.5e-9, 0.1e-9, BRinv)
pred_sm(self, dBR, 16.4, 1.2e-9, 0.1e-9, BRinv)
pred_sm(self, dBR, 16.8, 0.0, 0.05e-9, BRinv)
pred_sm(self, Dbr, 16.0, 2.5e-9, 0.1e-9, br_inv)
pred_sm(self, Dbr, 16.4, 1.2e-9, 0.1e-9, br_inv)
pred_sm(self, Dbr, 16.8, 0.0, 0.05e-9, br_inv)


# Comparison to figure 9 right in arXiv:2009.09313v2
AFB = 'AFBl(Lambdab->Lambda(1520)mumu)'
Afb = 'AFBl(Lambdab->Lambda(1520)mumu)'

pred_SMarrays(self, AFB, SMarray['AFBl_central'], False, 0.06)
pred_SMarrays(self, AFB, SMarray['AFBl_upper'], True, 0.11)
pred_SMarrays(self, AFB, SMarray['AFBl_lower'], True, 0.11)
pred_sm_arrays(self, Afb, sm_array['AFBl_central'], False, 0.06)
pred_sm_arrays(self, Afb, sm_array['AFBl_upper'], True, 0.11)
pred_sm_arrays(self, Afb, sm_array['AFBl_lower'], True, 0.11)

pred_sm(self, AFB, 16.0, -0.09, 0.01)
pred_sm(self, AFB, 16.4, 0.05, 0.01)
pred_sm(self, AFB, 16.8, 0.25, 0.02)
pred_sm(self, Afb, 16.0, -0.09, 0.01)
pred_sm(self, Afb, 16.4, 0.05, 0.01)
pred_sm(self, Afb, 16.8, 0.25, 0.02)

# Comparison to figure 7 top right in arXiv:2009.09313v3
S1cc = 'S_1cc(Lambdab->Lambda(1520)mumu)'
pred_SMarrays(self, S1cc, SMarray['S1cc_central'], False, 0.01)
pred_SMarrays(self, S1cc, SMarray['S1cc_upper'], True, 0.1)
pred_SMarrays(self, S1cc, SMarray['S1cc_lower'], True, 0.1)

pred_sm_arrays(self, S1cc, sm_array['S1cc_central'], False, 0.01)
pred_sm_arrays(self, S1cc, sm_array['S1cc_upper'], True, 0.1)
pred_sm_arrays(self, S1cc, sm_array['S1cc_lower'], True, 0.1)

pred_sm(self, S1cc, 16.0, 0.56, 0.01)
pred_sm(self, S1cc, 16.4, 0.56, 0.02)
Expand All @@ -83,22 +83,22 @@ def test_lambdab_lambda1520_ff(self):
flavio.config['implementation']['Lambdab->Lambda(1520) form factor'] = 'Lambdab->Lambda(1520) MCN'

# Comparison to figure on slide 12 S.Meinel b-baryon FEST 2020
pred_SMarrays(self, dBR, SMarray['dB_QM'], False, 0.07, BRinv2)
pred_sm_arrays(self, Dbr, sm_array['dB_QM'], False, 0.07, br_inv2)

pred_sm(self, dBR, 16.0, 5.4e-9, 0.1e-9, BRinv)
pred_sm(self, dBR, 16.4, 2.2e-9, 0.1e-9, BRinv)
pred_sm(self, dBR, 16.6, 0.8e-9, 0.1e-9, BRinv)
pred_sm(self, Dbr, 16.0, 5.4e-9, 0.1e-9, br_inv)
pred_sm(self, Dbr, 16.4, 2.2e-9, 0.1e-9, br_inv)
pred_sm(self, Dbr, 16.6, 0.8e-9, 0.1e-9, br_inv)

# Comparison to figure on slide 14 S.Meinel b-baryon FEST 2020
pred_SMarrays(self, AFB, SMarray['AFBl_QM'], False, 0.07)
pred_sm_arrays(self, Afb, sm_array['AFBl_QM'], False, 0.07)

pred_sm(self, AFB, 16.0, -0.16, 0.02)
pred_sm(self, AFB, 16.4, -0.08, 0.02)
pred_sm(self, AFB, 16.6, 0.0, 0.02)
pred_sm(self, AFB, 16.8, 0.22, 0.02)
pred_sm(self, Afb, 16.0, -0.16, 0.02)
pred_sm(self, Afb, 16.4, -0.08, 0.02)
pred_sm(self, Afb, 16.6, 0.0, 0.02)
pred_sm(self, Afb, 16.8, 0.22, 0.02)

# Comparison to figure on slide 13 S.Meinel b-baryon FEST 2020
pred_SMarrays(self, S1cc, SMarray['S1cc_QM'], False, 0.02)
pred_sm_arrays(self, S1cc, sm_array['S1cc_QM'], False, 0.02)

pred_sm(self, S1cc, 16.0, 0.6, 0.02)
pred_sm(self, S1cc, 16.4, 0.6, 0.02)
Expand Down

0 comments on commit 0640f1d

Please sign in to comment.