slophep.Predictions.Observables

class slophep.Predictions.Observables.BToPEllNuPrediction(B: str, P: str, qiqj: str, lep: str, nu: str, FF: FormFactorBToP, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: ObservableBase

property B: str

The B meson

J(q2: float) float[source]

Calculate rate normalised angular coefficients, flavio is used for these calculations, method essentially follows flavio.physics.bdecays.bplnu._get_angularcoeff from https://flav-io.github.io/apidoc/flavio/physics/bdecays/bplnu.m.html

Parameters:

q2 (float)

Returns:

Dictionary of coefficients a, b, c

Return type:

dict

J_bin(q2min: float, q2max: float) dict[source]

Calculate rate normalised binned angular observable

Parameters:
  • q2min (float)

  • q2max (float)

Returns:

Dictionary of observables, integrated over q2min, q2max

Return type:

dict

J_q2int() dict[source]

Calculate rate-normalised q2-integrated observable

Returns:

Dictionary of observables

Return type:

dict

property P: str

The P meson

PDF(q2: float, ctl: float) float[source]

Evaluate PDF (up to normalisation) at phase-space point

Parameters:
  • q2 (float)

  • ctl (float)

Returns:

pdf (up to normalisation)

Return type:

float

PDF_angular_int(ctl_min: float, ctl_max: float) dict[float][source]

Evaluate angular terms of PDF integrated over angular bin

Parameters:
  • ctl_min (float)

  • ctl_max (float)

Returns:

Integrated angular term corresponding to each observable

Return type:

dict

PDF_bin(q2_min: float, q2_max: float, ctl_min: float, ctl_max: float) float[source]

Evaluate pdf integrated over phase-space bin

Parameters:
  • q2_min (float)

  • q2_max (float)

  • ctl_min (float)

  • ctl_max (float)

Returns:

PDF in phase-space bin

Return type:

float

PDF_hist(q2_bins: int | list, ctl_bins: int | list)[source]

Create 4D histogram of PDF. This computes observables integrated over the bin and angular integrals.

Parameters:
  • q2_bins (int | list) – Binning in q2, specify either number of bins or bin edges

  • ctl_bins (int | list) – Binning in ctl, specify either number of bins or bin edges

Returns:

  • h (np.ndarray) – PDF histogram

  • bin_edges (list) – List of bin edges used, in form [q2_edges, ctd_edges, ctl_edges, chi_edges]

  • h_angint (dict) – Angular integrals for angular bin

  • j_bins (dict) – Observables computed to generate h

PDF_hist_angular_int(ctl_bins: int | list)[source]

Compute angular integrals for provided binning scheme

Parameters:

ctl_bins (int | list) – Binning in ctl, specify either number of bins or bin edges

Returns:

Angular integrals for angular bin, output is in the form dict[ctx bin][ctl bin][chi bin] = [angular integrals] where [angular integrals] is a list of the integrated angular term corresponding to each observable in the order stored in dict[“order”]. This is also returned as an array in dict[“asarray”] to use for easier multiplication with numpy.

Return type:

dict

PDF_norm(q2: float, ctl: float) float[source]

Evaluate PDF (up to normalisation) at phase-space point, using rate-normalised observables

Parameters:
  • q2 (float)

  • ctl (float)

Returns:

pdf (up to normalisation)

Return type:

float

_obsq2Bin(obs: str | int, q2min: float, q2max: float) float[source]
_prefactor(q2: float) float[source]

Return the prefactor including constants and CKM elements. Direct reimplementation of flavio equivalent in https://flav-io.github.io/apidoc/flavio/physics/bdecays/bplnu.m.html

afb(q2: float) float[source]

Calculate afb

afb_bin(q2min: float, q2max: float) float[source]

Calculate binned AFB

dBRdq2(q2: float) float[source]

Calculate differential BR, dBR/dq2

Parameters:

q2 (float)

Returns:

dBR/dq2

Return type:

float

dGdq2(q2: float) float[source]

Caclulate q2 distriution

Parameters:

q2 (float)

Returns:

dGamma/dq2 (up to normalisation)

Return type:

float

dGdq2_bin(q2min: float, q2max: float) float[source]

Caclulate binned q2 distriution

Parameters:
  • q2min (float)

  • q2max (float)

Returns:

dGamma/dq2 (up to normalisation) integrated over the bin

Return type:

float

dGdq2_hist(q2_bins: int | list)[source]

Create 1D histogram of dG/dq2

Parameters:

q2_bins (int | list) – Binning in q2, specify either number of bins or bin edges. If an int is not provided it is assumed an iterable for bin edges has been provided.

Returns:

  • h (list[float]) – PDF histogram

  • q2_edges (list[float]) – List of bin edges used

dJ(q2: float) dict[source]

Alias for get_angularcoeff

Parameters:

q2 (float)

Returns:

Dictionary of coefficents a, b, c

Return type:

dict

dJ_bin(q2min: float, q2max: float) dict[source]

Calculate binned angular observable

Parameters:
  • q2min (float)

  • q2max (float)

Returns:

Dictionary of observables, integrated over q2min, q2max

Return type:

dict

dJ_q2int() dict[source]

Calculate q2-integrated observable

Returns:

Dictionary of observables

Return type:

dict

get_angularcoeff(q2: float) dict[source]

Calculate angular coefficients, flavio is used for these calculations, method essentially follows flavio.physics.bdecays.bplnu._get_angularcoeff from https://flav-io.github.io/apidoc/flavio/physics/bdecays/bplnu.m.html

Parameters:

q2 (float)

Returns:

Dictionary of coefficents {a, b, c}

Return type:

dict

property lep: str

Lepton flavour (mu/e/tau)

property nu: str

Neutrino flavour (nu/e/tau)

plot_obs_prediction(obs: str, q2min: float = None, q2max: float = None, label: str = None, plot: tuple[Figure, Axes] = None) tuple[Figure, Axes][source]

Plot prediction for a particular observable

Parameters:
  • obs (str) – Desired observable, available are [“a”, “b”, “c”, “AFB”]

  • q2min (float, optional) – Min. value of q2 to plot, by default None which sets to physical minimum

  • q2max (float, optional) – Max. value of q2 to plot, by default None which sets to physical maximum

  • label (str, optional) – Label for legend, by default None

  • plot (tuple[plt.Figure, plt.Axes], optional) – Figure and axes to plot on, by default None. This allows to plot multiple observables in same axis or to change FFs/WCs and re-plot on same axes

Returns:

  • fig (plt.Figure) – The matplotlib figure, show with fig.show(), update drawing with fig.canvas.draw()

  • ax (plt.Axes) – Matplotlib axes, add legend with ax.legend()

Raises:

ValueError – For unavailable observable

property q2max: float

Maximum physical q2

property q2min: float

Minimum physical q2

class slophep.Predictions.Observables.BToVEllNuPrediction(B: str, V: str, qiqj: str, lep: str, nu: str, FF: FormFactorBToV, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: ObservableBase

property B: str

The B meson

J(q2: float) dict[source]

Alias for get_norm_coeff

Parameters:

q2 (float)

Returns:

Dictionary of coefficients J_i

Return type:

dict

J_bin(q2min: float, q2max: float) dict[source]

Calculate rate normalised binned angular observable

Parameters:
  • q2min (float)

  • q2max (float)

Returns:

Dictionary of observable <J_i>, integrated over q2min, q2max

Return type:

dict

J_q2int() dict[source]

Calculate rate-normalised q2-integrated observable

Returns:

Dictionary of observable <J_i>

Return type:

dict

PDF(q2: float, ctx: float, ctl: float, chi: float) float[source]

Evaluate 4D PDF (up to normalisation) at phase-space point

Parameters:
  • q2 (float)

  • ctx (float)

  • ctl (float)

  • chi (float)

Returns:

pdf (up to normalisation)

Return type:

float

PDF_angular_int(ctx_min: float, ctx_max: float, ctl_min: float, ctl_max: float, chi_min: float, chi_max: float) dict[float][source]

Evaluate angular terms of PDF integrated over angular bin

Parameters:
  • ctx_min (float)

  • ctx_max (float)

  • ctl_min (float)

  • ctl_max (float)

  • chi_min (float)

  • chi_max (float)

Returns:

Integrated angular term corresponding to each observable

Return type:

dict

PDF_bin(q2_min: float, q2_max: float, ctx_min: float, ctx_max: float, ctl_min: float, ctl_max: float, chi_min: float, chi_max: float) float[source]

Evaluate 4D PDF integrated over phase-space bin

Parameters:
  • q2_min (float)

  • q2_max (float)

  • ctx_min (float)

  • ctx_max (float)

  • ctl_min (float)

  • ctl_max (float)

  • chi_min (float)

  • chi_max (float)

Returns:

PDF in phase-space bin

Return type:

float

PDF_hist(q2_bins: int | list, ctx_bins: int | list, ctl_bins: int | list, chi_bins: int | list)[source]

Create 4D histogram of PDF. This computes J_i integrated over the bin and angular integrals.

Parameters:
  • q2_bins (int | list) – Binning in q2, specify either number of bins or bin edges

  • ctx_bins (int | list) – Binning in ctd, specify either number of bins or bin edges

  • ctl_bins (int | list) – Binning in ctl, specify either number of bins or bin edges

  • chi_bins (int | list) – Binning in chi, specify either number of bins or bin edges

Returns:

  • h (np.ndarray) – PDF histogram

  • bin_edges (list) – List of bin edges used, in form [q2_edges, ctd_edges, ctl_edges, chi_edges]

  • h_angint (dict) – Angular integrals for angular bin

  • j_bins (dict) – J_i observables computed to generate h

PDF_hist_angular_int(ctx_bins: int | list, ctl_bins: int | list, chi_bins: int | list)[source]

Compute angular integrals for provided binning scheme

Parameters:
  • ctx_bins (int | list) – Binning in ctd, specify either number of bins or bin edges

  • ctl_bins (int | list) – Binning in ctl, specify either number of bins or bin edges

  • chi_bins (int | list) – Binning in chi, specify either number of bins or bin edges

Returns:

Angular integrals for angular bin, output is in the form dict[ctx bin][ctl bin][chi bin] = [angular integrals] where [angular integrals] is a list of the integrated angular term corresponding to each observable in the order stored in dict[“order”]. This is also returned as an array in dict[“asarray”] to use for easier multiplication with numpy.

Return type:

dict

PDF_norm(q2: float, ctx: float, ctl: float, chi: float) float[source]

Evaluate 4D PDF at phase-space point, using rate-normalised observables

Parameters:
  • q2 (float)

  • ctx (float)

  • ctl (float)

  • chi (float)

Returns:

pdf (up to normalisation)

Return type:

float

PDF_norm_bin(q2_min: float, q2_max: float, ctx_min: float, ctx_max: float, ctl_min: float, ctl_max: float, chi_min: float, chi_max: float) float[source]

Evaluate 4D PDF integrated over phase-space bin, using rate-normalised angular observables

Parameters:
  • q2_min (float)

  • q2_max (float)

  • ctx_min (float)

  • ctx_max (float)

  • ctl_min (float)

  • ctl_max (float)

  • chi_min (float)

  • chi_max (float)

Returns:

PDF in phase-space bin

Return type:

float

property V: str

The Vector meson

_obsq2Bin(obs: str | int, q2min: float, q2max: float) float[source]
_prefactor(q2: float) float[source]

Return the prefactor including constants and CKM elements. Direct reimplementation of flavio equivalent in https://flav-io.github.io/apidoc/flavio/physics/bdecays/bvlnu.m.html

afb(q2: float) float[source]

Calculate Afb NOTE: angular convention for 6s and 6c means this may differ by a sign

afb_bin(q2min: float, q2max: float) float[source]

Calculate binned AFB

binuniang_obs(q2min: float, q2max: float) dict[float][source]

Calculate binned uniangular observables (FL, AFB, Flt, J3, J9)

dBRdq2(q2: float) float[source]

Calculate differential BR, dBR/dq2

Parameters:

q2 (float)

Returns:

dBR/dq2

Return type:

float

dGdchi(chi: float) float[source]

Decay rate in chi, marginalised over q2 and other angles

Parameters:

ctv (float)

Returns:

dGamma/dchi

Return type:

float

dGdchi_norm(chi: float) float[source]

Decay rate in chi, marginalised over q2 and other angles, normalised to total decay rate

Parameters:

chi (float)

Returns:

dGamma/dchi

Return type:

float

dGdctl(ctl: float) float[source]

Decay rate in ctl, marginalised over q2 and other angles

Parameters:

ctl (float)

Returns:

dGamma/dctl

Return type:

float

dGdctl_norm(ctl: float) float[source]

Decay rate in ctl, marginalised over q2 and other angles, normalised to total decay rate

Parameters:

ctl (float)

Returns:

dGamma/dctl

Return type:

float

dGdctv(ctv: float) float[source]

Decay rate in ctv, marginalised over q2 and other angles

Parameters:

ctv (float)

Returns:

dGamma/dctv

Return type:

float

dGdctv_norm(ctv: float) float[source]

Decay rate in ctv, marginalised over q2 and other angles, normalised to total decay rate

Parameters:

ctv (float)

Returns:

dGamma/dctv

Return type:

float

dGdq2(q2: float) float[source]

Caclulate q2 distriution

Parameters:

q2 (float)

Returns:

dGamma/dq2 (up to normalisation)

Return type:

float

dGdq2_bin(q2min: float, q2max: float) float[source]

Caclulate binned q2 distriution

Parameters:
  • q2min (float)

  • q2max (float)

Returns:

dGamma/dq2 (up to normalisation) integrated over the bin

Return type:

float

dGdq2_hist(q2_bins: int | list)[source]

Create 1D histogram of dG/dq2

Parameters:

q2_bins (int | list) – Binning in q2, specify either number of bins or bin edges. If an int is not provided it is assumed an iterable for bin edges has been provided.

Returns:

  • h (list[float]) – PDF histogram

  • q2_edges (list[float]) – List of bin edges used

dGdq2dchi(q2: float, chi: float) float[source]

Decay rate in chi for particular q2, normalised to dGamma/dq2

Parameters:
  • q2 (float)

  • chi (float)

Returns:

dGamma/dq2dchi, normalised to dGamma/dq2

Return type:

float

dGdq2dctl(q2: float, ctl: float) float[source]

Decay rate in ctl for particular q2

Parameters:
  • q2 (float)

  • ctl (float)

Returns:

dGamma/dq2dctl

Return type:

float

dGdq2dctl_norm(q2: float, ctl: float) float[source]

Decay rate in ctl for particular q2, normalised to dGamma/dq2

Parameters:
  • q2 (float)

  • ctl (float)

Returns:

dGamma/dq2dctl, normalised to dGamma/dq2

Return type:

float

dGdq2dctv(q2: float, ctv: float) float[source]

Decay rate in ctv for particular q2

Parameters:
  • q2 (float)

  • ctv (float)

Returns:

dGamma/dq2dctv

Return type:

float

dGdq2dctv_norm(q2: float, ctv: float) float[source]

Decay rate in ctv for particular q2, normalised to dGamma/dq2

Parameters:
  • q2 (float)

  • ctv (float)

Returns:

dGamma/dq2dctv, normalised to dGamma/dq2

Return type:

float

dJ(q2: float) dict[source]

Alias for get_angularcoeff

Parameters:

q2 (float)

Returns:

Dictionary of coefficents J_i

Return type:

dict

dJ_bin(q2min: float, q2max: float) dict[source]

Calculate binned angular observable

Parameters:
  • q2min (float)

  • q2max (float)

Returns:

Dictionary of observable <J_i>, integrated over q2min, q2max

Return type:

dict

dJ_q2int() dict[source]

Calculate q2-integrated observable

Returns:

Dictionary of observable <J_i>

Return type:

dict

fl(q2: float) float[source]

Calculate FL

fl_bin(q2min: float, q2max: float) float[source]

Calculate binned FL

get_angularcoeff(q2: float) dict[source]

Calculate angular coefficients, flavio is used for these calculations, method essentially follows flavio.physics.bdecays.bvlnu._get_angularcoeff from https://flav-io.github.io/apidoc/flavio/physics/bdecays/bvlnu.m.html

Parameters:

q2 (float)

Returns:

Dictionary of coefficents J_i

Return type:

dict

get_norm_coeff(q2: float) dict[source]

Calculate rate normalised angular coefficients, flavio is used for these calculations, method essentially follows flavio.physics.bdecays.bvlnu._get_angularcoeff from https://flav-io.github.io/apidoc/flavio/physics/bdecays/bvlnu.m.html

Parameters:

q2 (float)

Returns:

Dictionary of coefficients J_i

Return type:

dict

property lep: str

Lepton flavour (mu/e/tau)

property nu: str

Neutrino flavour (nu/e/tau)

plot_obs_prediction(obs: str, q2min: float = None, q2max: float = None, label: str = None, plot: tuple[Figure, Axes] = None) tuple[Figure, Axes][source]

Plot prediction for a particular observable

Parameters:
  • obs (str) – Desired observable, available are [“1s”, “1c”, “2s”, “2c”, “6s”, “6c”, 3, 4, 5, 7, 8, 9, “FL”, “AFB”, “FLt”]

  • q2min (float, optional) – Min. value of q2 to plot, by default None which sets to physical minimum

  • q2max (float, optional) – Max. value of q2 to plot, by default None which sets to physical maximum

  • label (str, optional) – Label for legend, by default None

  • plot (tuple[plt.Figure, plt.Axes], optional) – Figure and axes to plot on, by default None. This allows to plot multiple observables in same axis or to change FFs/WCs and re-plot on same axes

Returns:

  • fig (plt.Figure) – The matplotlib figure, show with fig.show(), update drawing with fig.canvas.draw()

  • ax (plt.Axes) – Matplotlib axes, add legend with ax.legend()

Raises:

ValueError – For unavailable observable

property q2max: float

Maximum physical q2

property q2min: float

Minimum physical q2

uniang_obs(q2: float) dict[float][source]

Calculate uniangular observables (FL, AFB, Flt, J3, J9)

class slophep.Predictions.Observables.BdToD0stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD0st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD0stEllNuPrediction

class slophep.Predictions.Observables.BdToD1EllNuPrediction(lep: str, nu: str, FF: FormFactorBToD1, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD1EllNuPrediction

class slophep.Predictions.Observables.BdToD1stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD1st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD1stEllNuPrediction

class slophep.Predictions.Observables.BdToD2stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD2st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD2stEllNuPrediction

class slophep.Predictions.Observables.BdToDEllNuPrediction(lep: str, nu: str, FF: FormFactorBToP, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToPEllNuPrediction

class slophep.Predictions.Observables.BdToDstEllNuPrediction(lep: str, nu: str, FF: FormFactorBToV, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToVEllNuPrediction

class slophep.Predictions.Observables.BdToPiEllNuPrediction(lep: str, nu: str, FF: FormFactorBToP, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToPEllNuPrediction

class slophep.Predictions.Observables.BsToDs0stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD0st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD0stEllNuPrediction

class slophep.Predictions.Observables.BsToDs1EllNuPrediction(lep: str, nu: str, FF: FormFactorBToD1, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD1EllNuPrediction

class slophep.Predictions.Observables.BsToDs1stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD1st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD1stEllNuPrediction

class slophep.Predictions.Observables.BsToDs2stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD2st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD2stEllNuPrediction

class slophep.Predictions.Observables.BsToDsstEllNuPrediction(lep: str, nu: str, FF: FormFactorBToV, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToVEllNuPrediction

class slophep.Predictions.Observables.BuToD0stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD0st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD0stEllNuPrediction

class slophep.Predictions.Observables.BuToD1EllNuPrediction(lep: str, nu: str, FF: FormFactorBToD1, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD1EllNuPrediction

class slophep.Predictions.Observables.BuToD1stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD1st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD1stEllNuPrediction

class slophep.Predictions.Observables.BuToD2stEllNuPrediction(lep: str, nu: str, FF: FormFactorBToD2st, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToD2stEllNuPrediction

class slophep.Predictions.Observables.BuToDEllNuPrediction(lep: str, nu: str, FF: FormFactorBToP, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: BToPEllNuPrediction

class slophep.Predictions.Observables.LbToLcEllNuPrediction(lep: str, nu: str, FF: FormFactorOneHalfpToOneHalfp, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: LbToOneHalfpEllNuPrediction

class slophep.Predictions.Observables.ObservableBase(FF: FormFactor, ffargs: list = [], par: dict = None, scale: float = 4.8)[source]

Bases: object

property FF: FormFactor

Form factors

_fullsetter(params: dict, constants: dict = {})[source]

Set WCs and FF parameters, for usage with Fluctuate

FF parameters must follow naming in self.FF.params

WCs must be in the flavio basis, prepended with ‘WCRe_’ or ‘WCIm_’ for the respective component

Parameters:
  • params (dict) – Dictionary of parameters to set

  • constants (dict) – Dictinoary of parameters that are set constant - for specific use-cases with fluctuate e.g. in case want to set a particular WC to some non-zero value for all fluctations. In principle FF that are not in params should be kept the same so shouldn’t need to pass them here.

property par: dict

Dictionary of parameters, defaults to flavio.default_parameters.get_central_all()

property scale: float

Renorm scale

set_ff(ffparams: dict)[source]

Set form factor parameters. Can use None to leave a parameter unchanged.

Parameters:

ffparams (dict) – Dictionary of form factor parameters, names should match FF.ffpars dictionary in the particular scheme being used

set_ff_fromlist(ffparams: list)[source]

Set form factor parameters in form of list. Must include all parameters in self.FF.params, in order. Can use None to leave a parameter unchanged.

Parameters:

ffparams (list) – All FF parameters, in appropiate order

set_wc(wc_dict: dict, eft: str = 'WET', basis: str = 'flavio')[source]

Set the wilson coefficients

Parameters:
  • wc_dict (dict) – Dictionary of wilson coefficients

  • eft (str, optional) – EFT, by default ‘WET’

  • basis (str, optional) – WC basis (see https://wcxf.github.io/bases.html), by default ‘flavio’

property wc_obj: WilsonCoefficients

Wilson coefficient object