FlavBit: a GAMBIT module for computing flavour observables and likelihoods

Flavour physics observables are excellent probes of new physics up to very high energy scales. Here we present FlavBit, the dedicated flavour physics module of the global-fitting package GAMBIT. FlavBit includes custom implementations of various likelihood routines for a wide range of flavour observables, including detailed uncertainties and correlations associated with LHCb measurements of rare, leptonic and semileptonic decays of B and D mesons, kaons and pions. It provides a generalised interface to external theory codes such as SuperIso, allowing users to calculate flavour observables in and beyond the Standard Model, and then test them in detail against all relevant experimental data. We describe FlavBit and its constituent physics in some detail, then give examples from supersymmetry and effective field theory illustrating how it can be used both as a standalone library for flavour physics, and within GAMBIT.


Introduction
Precise measurement of flavour observables is a powerful indirect probe of physics beyond the Standard arXiv:1705.07933v2[hep-ph] 28 Nov 2017 Model (SM), as new heavy particles predicted by extensions of the SM can contribute to the amplitudes of observables as virtual particles.Flavour observables are therefore sensitive to much higher energy scales than direct searches for new particles.Moreover, rare decays, such as Flavour Changing Neutral Currents (FCNCs), are loop suppressed in the SM.As a consequence, the SM decay rates are small, and could be comparable in magnitude to contributions from new heavy states, allowing stringent constraints to be placed on the parameters of theories for new physics.It is therefore crucial to consider constraints from flavour physics when studying scenarios beyond the SM.The correlations between the different flavour observables, and the interplay between flavour measurements and direct searches at collider experiments, are key tools in the search for new physics, and its eventual understanding.
Public packages exist for carrying out SM and BSM flavour fits in terms of Wilson coefficients [1][2][3], but so far no general package exists for both computing Wilson coefficients and carrying out a global fit.In this article we present FlavBit, a flavour physics library designed in the context of the Global And Modular BSM Inference Tool (GAMBIT) framework [4], but also usable in standalone form.FlavBit allows users to predict flavour physics observables in various models, using external programs such as SuperIso [5][6][7], and then calculate combined likelihoods for arbitrary combinations of the observables.FlavBit takes into account all theoretical and experimental correlations between the different observables.The resulting likelihoods can be incorporated into the GAMBIT global likelihood to scan the parameter spaces of various models for new physics [4,[8][9][10][11], taking into account complementary constraints from direct production [12], dark matter searches [13], and SM and related precision measurements [14].
Recently, some measurements of flavour observables, mainly from LHCb [15][16][17][18] and B factories [19][20][21][22][23], have shown tension with their predicted values in the SM.It is still unclear if these might be accommodated in the SM by larger-than-expected QCD effects, statistical fluctuations or some combination thereof.Nonetheless, these tensions certainly provide motivation for continued interest and effort in careful combination and crosscorrelation of flavour observables with each other, and with searches for new physics in other sectors.We include these measurements in FlavBit.
This paper is organised as follows.In Sec. 2 we provide the general theoretical background of the scheme by which we compute flavour observables, before providing a brief synopsis in Sec. 3 of the broader global-fitting framework within which FlavBit sits.In Sec. 4 we discuss the predictions and measurements of individual observ-ables included in FlavBit 1.0.0, and highlight aspects of new physics models to which the different measurements are sensitive.Sec. 5 gives details of the likelihood calculations that FlavBit performs.Sec.6 gives some usage examples, both in standalone mode and with GAMBIT proper.Sec.7 summarises our conclusions, and Appendix A gives a glossary of relevant GAMBIT terminology helpful for reading this paper.
The FlavBit source code is freely available from gambit.hepforge.orgunder the terms of the standard 3-clause BSD license. 1

Theoretical framework
Our theoretical framework for studying rare decay observables is based on the effective Hamiltonian approach, which provides a simple formulation that can be easily extended to incorporate contributions from new physics.In this formulation, the low-and high-energy effects are separated using the Operator Product Expansion method.Cross-sections for transitions from initial states i to final states f are proportional to squared matrix elements | f |H eff |i | 2 , where the effective Hamiltonian H eff for b → s transitions is given by ( Here G F is the Fermi constant, µ is the energy scale at which calculations are to be performed, and V tb and V ts are the usual CKM matrix elements.The C i are Wilson coefficients, which incorporate the influence of small-scale physics due to heavy states that have been integrated out in the effective theory; their values can be calculated using perturbative methods.The O i are local operators representing long-distance interactions.The most relevant operators for the FCNC rare B decays are 1 http://opensource.org/licenses/BSD-3-Clause.Note that fjcore [24] and some outputs of FlexibleSUSY [25] (incorporating routines from SOFTSUSY [26]) are also shipped with GAMBIT 1.0.These code snippets are distributed under the GNU General Public License (GPL; http://opensource.org/licenses/GPL-3.0), with the special exception, granted to GAMBIT by the authors, that they do not require the rest of GAMBIT to inherit the GPL.
O 5 = (sγ µ1 γ µ2 γ µ3 P L b) q (qγ µ1 γ µ2 γ µ3 q) , O 6 = (sγ µ1 γ µ2 γ µ3 T a P L b) q (qγ µ1 γ µ2 γ µ3 T a q) , where the sums run over q = u, d, s, c, b, m b denotes the b quark mass, T a are the SU(3) c generators, F µν and G a µν are the photon and gluon stress-energy tensors respectively, and g is the strong coupling.A similar set of operators can also be defined for b → d transitions.
This formalism can be easily extended to incorporate effects of new physics, through additional contributions to the Wilson coefficients or the introduction of additional long-distance operators.For instance, the primed versions of these operators are chirality-flipped compared to the non-primed ones, and are highly suppressed in the SM.The scalar (Q 1 ) and pseudoscalar (Q 2 ) operators are absent in the SM, but receive large contributions in many models with an extended Higgs sector.The Wilson coefficients are calculated by requiring matching between the high-scale theory and the lowenergy effective theory at the scale µ W , which is of the order of the W mass. Using the renormalisation group equations of the effective theory, they are then evolved to the scale µ b (of the order of the b quark mass), which is the relevant scale for B physics calculations.
In order to compute the matrix element f |H eff |i , which describes the transition from the initial state |i to the final state |f , in addition to the relevant Wilson coefficients C i , we need to evaluate the hadronic matrix elements f |O i |i , which are usually the main source of uncertainties.These elements lead to decay constants and form factors that must be computed with techniques from non-perturbative QCD.

Computational framework
The GAMBIT framework defines two sorts of functions that can be used to calculate physical observables or other quantities required for computing them: module functions: functions written in C++ and contained within a GAMBIT module.backend functions: external library functions provided by a backend, such as SuperIso or FeynHiggs.
For ease of reference, here we highlight and link specific GAMBIT terms to their entries in the glossary, found in Appendix A. When writing GAMBIT module functions, the author assigns each a capability, which describes what the function can calculate.This may be an observable, e.g. a particular branching fraction for a given rare B decay, or a likelihood, e.g. the combined likelihood defined using a set of rare decays.Module functions can be declared to have dependencies on the results of other module functions, which they indicate by specifying the capability of the module function that must be used to fill the dependency.Dependencies may be filled by any function within GAMBIT that has the requisite capability, whether or not it is part of the same GAMBIT module as the dependent function.Module functions may also have backend requirements, which are satisfied by functions from backend libraries.For example, in FlavBit 1.0.0,SuperIso supplies many of the backend requirements of the module functions that calculate observables.
FlavBit notifies GAMBIT of its available module functions and their capabilities, dependencies and backend requirements.The user tells GAMBIT that they want to compute a given set of observables and likelihoods in a given scan, and the GAMBIT Core identifies the necessary module functions and runs its dependency resolution routines.These hook the module functions up to each other and run them in an order that ensures that all dependencies are computed before the functions that depend on them.Full details of this process can be found in the main GAMBIT paper [4].
In standalone mode, users can just call the module functions of FlavBit directly, providing any required dependencies and backend requirements manually.

Observables
In this section we discuss the observables included in FlavBit and their relevance for searches for new physics.
The most important observables are the rare decays B → X s γ, B 0 s → µ + µ − and B 0 → K * 0 µ + µ − , as well as tree level decays such as B ± → τ ν τ and B → D ( * ) ν . 2ere we discuss the calculation of the different observables in four groups: tree-level leptonic and semileptonic decays (Sec.4.2), electroweak penguin transitions (Sec.4.3), rare purely leptonic decays (Sec.4.4), and other flavour observables (Sec.4.5).In these sections we outline the calculations required to predict each observable from theory; further details can be found in Ref. [6].While for simplicity we present only the leading order expressions in this paper, in FlavBit itself we use the full calculations at the highest available accuracy.
The tree-level category includes B and D decays to leptons with an accompanying hadron and/or a neutrino in the final state.Observables in this category are the branching fractions for processes such as B ± → τ ν τ , B → D ( * ) τ ν τ and B → D ( * ) ν .The electroweak penguin category includes the rare decays B → M + − (with M another meson lighter than the B), in particular the angular observables of the decay B 0 → K * 0 µ + µ − .The rare fully-leptonic category includes B decays with only leptons in the final state, such as B 0 (s) → µ + µ − .The fourth and final category includes b → s transitions in the radiative decays B → X s γ, the mass difference between the heavy B H and light B L eigenstates of the B 0 s system (∆M s ), and decays of kaons and pions, in particular the leptonic decay ratio B(K ± → µν µ )/B(π ± → µν µ ).Note that FlavBit does not incorporate the anomalous magnetic moment of the muon, as this is dealt with in PrecisionBit [14].

Interfaces to external codes
Theoretical predictions of observables in FlavBit are predominantly obtained through interfaces to external codes.Some predictions of flavour observables are available from FeynHiggs [27], for the SM and minimal supersymmetric SM (MSSM). 3In FlavBit 1.0.0,most observable calculations refer to SuperIso 3.6 [5][6][7].
The interface to SuperIso operates via the function SI_fill (see Table 1), which provides the SuperIso_modelinfo.This function fills a SuperIso parameters structure, which is passed back to various other SuperIso functions to compute observables.Observables that are calculated directly from the input model parameters (Table 1) are distinguished from those that involve the calculation of intermediate Wilson coeffispecific rates, is typically used to indicate that the final state does not distinguish between = e and = µ.Some groups use this notation to refer to a sum over all final states involving electrons and muons, others use it to refer to the average.The PDG uses the former notation, which we follow in this paper except where explicitly noted otherwise. 3The GAMBIT interface to FeynHiggs is described in detail in Sec 3.1.3of Ref. [14].
cients (Tables 2 and 3).In FlavBit 1.0.0,observables are implemented for MSSM models ('MSSM63atQ' and descendants; see [4]), and for a flavour EFT model ('WC') where the Wilson coefficients are specified directly as model parameters, and scanned over.
The design of FlavBit and its interface to SuperIso make extending FlavBit to other models quite straightforward, either by computing Wilson coefficients 'upstream' from fundamental parameters, or by constructing the SuperIso_modelinfo to fit the model under investigation.SI_fill deals with the majority of the model-dependence in each calculation, importing different masses and couplings from SpecBit depending on the model being scanned, and using them to set various flags and member variables of the SuperIso_modelinfo.
SI_fill has a single option configurable from the master YAML file of a given scan: a boolean flag take_b_pole_mass_from_spectrum.This option allows the user to choose between SuperIso's internal calculation of the b quark pole mass (based on the M S mass imported from GAMBIT), or GAMBIT's own b pole mass calculation provided by SpecBit [14].Depending on the spectrum generator chosen in SpecBit, the standard 2-loop conversion from M S to pole mass included in SuperIso may be a more accurate choice for precision B physics than other calculations, even if the other calculation includes higher-order corrections.This is because the b pole is sufficiently close to the QCD scale that problems with the perturbative expansion required to compute it start to show already at 3 loops [28], such that the formal error on the b pole mass associated with truncating the asymptotic series may already be larger when truncating at 3 rather than 2 loops.This means that although 3-loop QCD RGEs remain preferable, 2loop self energies give a more precise value for the b pole, and should be preferred for B physics calculations.In FlavBit 1.0.0,take_b_pole_mass_from_spectrum therefore defaults to false. 4.2 Tree-level leptonic and semi-leptonic decays Decays of B mesons with leptons and neutrinos in the final state proceed via tree-level charged currents.They have been intensively studied at B factories (Babar, Belle and CLEO) for the determination of the elements V cb and V ub of the CKM matrix.5.
The rate of the semi-leptonic decay B → M ν in the SM is where q µ = p µ B − p µ M is the momentum transfer, V qb is the CKM element corresponding to the flavour of M , K is a phase-space factor and F (2) (q 2 ) is a combination of form factors [29].
The decays B ± → ν also proceed via tree-level charged currents.The branching fraction is where f B is the meson decay constant and τ B is the lifetime of the B + .This decay is sensitive to the CKM element V ub .The charged Higgs sector of the 2HDM can again provide substantial contributions, as can new charged gauge bosons like the W and W R of the left-right symmetric model [39].Compared to the case where = τ , the decays with = e and = µ have much smaller branching fractions, as they are helicitysuppressed.For this reason, at present only upper limits are available for the decays to light leptons.Although we provide routines to predict the values of all three in FlavBit, we only incorporate the tauonic version into the resulting likelihood.
Similarly, the decays D ± (s) → ν are mediated by the W boson in the SM.The branching fractions can be obtained from Eq. 6 after the replacement B → D (s) and swapping in the relevant CKM element.These decays have been traditionally used to measure the D (s) meson decay constant.However, the charged Higgs boson in the 2HDM would also mediate these decays, so they can provide complementary constraints to the analogous B meson decay [40].
As shown in Table 1, FlavBit provides functions capable of computing branching fractions for , designated by capabilities RD and RDstar.Here in R D ( * ) refers to either µ or e, not their sum (the branching fractions B → D ( * ) lν l are identical for e and µ, as both are effectively massless in the B system).

Electroweak penguin transitions
Rare semi-leptonic decays of B mesons proceed via flavour-changing neutral currents (FCNCs) in electroweak penguin diagrams, and set stringent constraints on possible contributions from new physics.FlavBit includes predictions of various FCNC b → s transitions.These decays are all proportional to the elements V tb and V ts of the CKM matrix.
Rare decays of the type B → M + − , with one meson M in the final state, are sensitive to the Wilson coefficients C ( ) 9,10 .In addition, when M is a vector, such as the K * (892), these decays are also sensitive to the Wilson coefficients C ( )

. The four-quark operators (O 1•••6 ) in the effective
Hamiltonian also contribute to the penguin diagrams, resulting in expressions with the same structure as O 7 and O 9 .They can therefore be reabsorbed and used to define effective Wilson coefficients C eff 7 and C eff 9 [41], where Y contains the short distance contributions from the four-quark operators [42,43].
The most accessible of the B → M + − decays at LHCb are those including final-state muons.The differential decay rate for B → M µ + µ − , where M is a pseudoscalar, is given at leading order by [44]: where u(q 2 ) and v(q 2 ) are kinematic factors, and f 0 , f + and f T are q 2 -dependent form factors.If M is a vector particle, the B → M + − decays are completely described by the dilepton invariant mass squared q 2 and three angles (θ l , θ K and φ; see Ref. [45,46] for definitions).Measurements of angular observables of the decays B 0 → K * (892)µ + µ − and B 0 s → φµ + µ − provide a better sensitivity to new physics than measurements of branching fractions.As a function of q 2 and the three angles, the differential decay rate for where Γ is the decay rate of the CP conjugate mode.The angular observable F L is the longitudinal polarisation fraction of the K * .The other observables are S i , and the forward-backward asymmetry A FB .The most sensitive experimental analyses assume that there are no scalar contributions (which are constrained by the branching fraction of B 0 s → µ + µ − ), and no tensor contributions. 5.This assumption makes it possible to eliminate the observables S c 1 , S s 1 , S c 2 and S s 2 in favour of a single observable F L .The physical observables are sesquilinear combinations of the transversity amplitudes [49],

SuperIso_modelinfo A_BXstautau_highq2_CONV
Table 2: Observable capabilities of FlavBit that involve Wilson coefficients in their calculation (from SuperIso unless otherwise specified).
The indices ⊥, and 0 refer to the K * (892) transversity amplitudes, while L → R refers to the chiralityflipped version of the previous term in each expression.

Backend requirements
BKstarmumu_l_m SI_BKstarmumu_l_m (Flav_KstarMuMu_obs): Computes all observables associated with B 0 → K * 0 µ + µ − in a q 2 bin specified by l and m.See caption for details.

Name (type) Description
BR (double) branching fraction AFB (double) forward-backward asymmetry q2_min (double) q 2 bin lower edge q2_max (double) q 2 bin upper edge The amplitudes A ⊥, ,0 depend on form factors and Wilson coefficients, and can be written at leading order in QCD in the form: In the limit of large recoil (low q 2 ), the seven form factors A 1,2 , T 1,2,3 and V can be replaced by only two form factors ξ ⊥ and ξ .This makes it possible to write a set of six observables that are independent of form factors in this approximation (see Ref. [50]).These are denominated6 P ( ) i , with i ∈ [1,6].Some of these observables were independently proposed by other authors with a different name, e.g.
T [52].The observables P i can be written as ratios of the observables F L and S i , therefore if the full form factors A 1,2 , T 1,2,3 , V [53] and their correlations are used it is equivalent to using the full set of P i observables.One of the most interesting measurements in these decays is the observable P 5 , which shows a deviation with respect to the SM prediction of about 4σ in the region 4 < q 2 /GeV 2 < 8 [18,23,47].The most accredited explanation for this deviation is a reduced C eff 9 (q 2 ) Wilson coefficient, but it is not yet clear if this is due to hadronic uncertainties [54][55][56][57] or a genuine contribution from new physics [58][59][60][61].In FlavBit, we incorporate a 10% theoretical uncertainty (at the amplitude level) into our correlation matrix for B 0 → K * 0 µ + µ − observables, to account for errors arising from non-factorisable power corrections [62].
As set out in Tables 3 and 4, FlavBit can calculate the full suite of observables for B 0 → K * 0 µ + µ − , in six different q 2 bins over the range 1.1 ≤ q 2 /GeV 2 ≤ 19.0.These are provided by the capabilities BKstarmumu_l_m, where the lower q 2 bin edge is denoted by l and the upper edge by m.The functions with these capabilities return a Flav_KstarMuMu_obs object (Table 4), which contains the overall branching fraction, forward-backward asymmetry and detailed angular observables F L , S 3 , S 4 , S 5 , S 7 , S 8 and S 9 .These observables can either be extracted manually from the Flav_KstarMuMu_obs object itself, or output in full via the GAMBIT printer system [4] for later analysis.
The angular analysis of B 0 → K * 0 + − [63] at much lower momentum transfer (q 2  1 GeV 2 ) can also provide strong constraints, specifically on the coefficients C ( ) 7 .However, experimental analyses of B 0 → K * 0 µ + µ − in this regime are impacted by the assumption that the muon is massless.We therefore do not include this lower angular bin in FlavBit.
Asymmetries between B 0 and B0 in B 0 → K * 0 µ + µ − have also been measured by the LHCb collaboration [47].These are important for constraining the imaginary parts of a number of Wilson Coefficients.
Another observable useful for isolating the contribution of new physics, owing to its insensitivity to hadronic parameters such as form factors, is the CP -averaged B → K * µ + µ − isospin asymmetry [64], FlavBit provides the integrated low-q 2 asymmetry, corresponding to the integral of Eq. 22 over the range 1 ≤ q 2 /GeV 2 ≤ 6 (AI_BKstarmumu in Table 3).It also computes the zero-crossing of the asymmetry, corresponding to the q 2 value where the differential decay rates of B 0 → K * 0 µ + µ − and B ± → K * ± µ + µ − are equal (AI_BKstarmumu_zero in Table 3).
The measurement of the inclusive branching fraction of B → X s + − is challenging from the experimental point of view, however has several theory advantages.The differential decay rate at leading order in QCD can be written as (see Ref. [65] and references therein): The inclusive and differential branching fractions of B → X s + − were measured at B factories [66][67][68][69].As detailed in Table 2, FlavBit computes predictions for B(B → X s µ + µ − ), integrated over both high and low q 2 ranges (capabilities BRBXsmumu_highq2 and BRBXsmumu_lowq2).It also computes the branching fraction at high q 2 for the equivalent process with τ leptons in the final state, B(B → X s τ + τ − ) (capability BRBXstautau_highq2).
A complementary B → X s + − angular observable is the forward-backward asymmetry A FB,B→Xs + − , defined differentially with respect to ŝ as where z is the cosine of the forward angle.FlavBit computes the B → X s µ + µ − integrated forwardbackward asymmetry at both low and high q 2 (capabilities A_BXsmumu_highq2 and A_BXsmumu_lowq2), along with the zero-crossing of the asymmetry, corresponding the q 2 value for which the asymmetry vanishes (A_BXsmumu_zero).It also predicts the asymmetry of the equivalent process involving τ leptons at high q 2 (capability A_BXstautau_highq2).The decay B s → φµ + µ − is described by the same formalism as B → K * µ + µ − .However, while the latter is a self-tagging decay, i.e. the flavour of the B meson at decay time can be inferred by the charge of the kaon coming from the decay of the K * (892), this is not the case for the B s → φµ + µ − .This implies that when averaging between B s and Bs , some terms of the angular distributions (including P 5 ) vanish.The branching ratios of both B s → φµ + µ − and the related decay B + → K + µ + µ − are sensitive to BSM physics, mainly via the Wilson coefficients C ( ) 9 and C ( ) 10 .The measurement of the branching fraction of B s → φµ + µ − by the LHCb experiment [15] is also in tension with respect to SM predictions.We do not include these channels directly in FlavBit, because to do so rigorously would require the ability to recompute model-dependent BSM contributions to theoretical uncertainties.This is a capability that we anticipate including in a future version of FlavBit.
In addition, angular measurements of the decay B 0 → Kπµ + µ − outside the K * (892) resonance have been recently performed [70], however we do not yet have enough knowledge of the different K * resonances in that region of Kπ invariant mass to interpret the result in terms of Wilson coefficients [71].For this reason, the decays B 0 → Kπµ + µ − outside the K * 0 (892) are not yet implemented in FlavBit.
Lepton flavour universality in b → s transitions has also been tested by measuring the ratio A tension corresponding to 2.6σ was observed [17].Contrary to the anomalies in the aforementioned b → s transitions, the tension in R K cannot be explained by hadronic uncertainties.Accommodating lepton flavour non-universality within the effective Hamiltonian framework of Eq. 2 requires splitting operators O ( ) 9 and O ( ) 10 into separate effective operators for different leptons.In the context of this expanded treatment, the so-called flavour anomalies in rare decays seem to form a coherent pattern, with a reduction of about 25% observed in the muonic C 9 Wilson coefficient relative to the SM prediction.In general these scenarios are not easy to accommodate within the MSSM, although a global agreement at the 2σ level is still possible [72].Presently, FlavBit does not deal with violations of lepton flavour universality, so R K is not yet included as an observable.

Rare purely leptonic decays
Like its penguin counterparts B → X + − , the rare leptonic decay B 0 s → + − also probes the FCNC b → s transition, and is proportional to the CKM entries V tb and V ts .Similarly, B 0 → + − probes b → d and is proportional to V tb and V td .These are rather clean channels from the theoretical perspective, as the main uncertainty comes only from the meson decay constant, which can be calculated in lattice QCD.The branching fraction of these decays is Because the B meson is a pseudoscalar, these decays are helicity-suppressed, in addition to the GIM suppression.Therefore, in the SM and in all lepton-flavouruniversal V ± A models, the ratio of the branching fractions for different leptons is given by: where m 1(2) is the mass of the lepton 1(2) .These decays set strong constraints on models with extended Higgs sectors such as the 2HDM, as scalar contributions would alleviate the helicity suppression.Such decays are also sensitive to new bosons with V ± A couplings (e.g.W and W R ), which would modify the Wilson coefficients C ( ) 10 of the SM.
FlavBit has the capability to compute the branching fraction for B 0 → µ + µ − (Bmumu in Table 2), as well as for (CP -averaged) B s decays to e + e − and µ + µ − (Bsee_untag and Bsmumu_untag).The latter can also be obtained in the MSSM and SM from FeynHiggs via the FH_FlavourObs capability (see Tables 1 and 5). .The main constraint comes from the measurement of the inclusive decay B → X s γ [73,74].The prediction of this branching fraction is relatively clean, and benefits from the Heavy Quark Expansion in the same way as the B → X s + − process.
The branching ratio can be written at leading order as where B( B → X c eν) exp is the experimentally-measured value of the branching fraction for B → X c eν, and This measurement sets constraints on the charged Higgs mass and couplings of the 2HDM [75][76][77][78].In addition, these measurements constrain models with additional neutral gauge bosons such as the Z [35].FlavBit implements this observable as bsgamma (Table 2), and within the FH_FlavourObs capability (see Tables 1 and 5).
The exclusive decays B → K * γ and B s → φγ also constrain the coefficients C ( ) 7 , but their impact is not yet competitive with the inclusive one.However, the inclusive decays can only constrain the sum of |C 7 | 2 and |C 7 | 2 .The best constraint on the right-handed current C 7 contribution presently comes from the angular analysis of B 0 → K * 0 + − at low q 2 (see Sec. 4.3).In FlavBit, we provide the CP -averaged isospin asymmetry of B → K * γ decays [80], as a calculable observable, as it can receive contributions from charged Higgs bosons and any other new fields with similar quantum numbers (such as charginos in supersymmetry) [81].The predicted asymmetry can be accessed via capability delta0 (Table 2).The leptonic decays of K and π mesons are also sensitive to the existence of charged Higgs bosons [82].

FlavBit computes the ratio [83]
which has a smaller theoretical uncertainty than the individual decays.Here δ em = 0.0070 ± 0.0035 is a long-distance electromagnetic correction factor.We also consider the quantity R µ23 [83], where i refers to leptonic decays with i particles in the final state, and 0 + → 0 + corresponds to nuclear beta decay.These are provided by capabilities Rmu and Rmu23, respectively, and the relevant functions are detailed in Table 1.
It is well known that neutral meson systems are characterised by a rich phenomenology.In general, eigenstates of flavour are not eigenstates of mass, causing neutral mesons to oscillate.The parameters governing oscillations are the difference in mass between the heavy and light eigenstates ∆M = M H − M L and the difference in their decay widths ∆Γ = Γ H − Γ L .While in the neutral kaon system the difference in lifetime is very large, so we denote the two states 'short' (K 0 S ) and 'long' (K 0 L ), in the neutral B system ∆Γ ∆M , so it is more suitable to call them 'heavy' and 'light'.The oscillation frequency is related to the difference in mass ∆M q , which for the neutral B meson is where Bq is the renormalisation-group-invariant parameter, f Bq is the B q decay constant and S 0 (x t ) is a simple function of the top mass.The hadronic parameter f Bq is the same factor that appears in the branching fraction of B q → + − decays (Eq.26).The branching fractions and mass differences are therefore related as [84] B(B In FlavBit, ∆M s can be obtained in either the SM or MSSM, via the FH_FlavourObs capability (see Tables 1  and 5).

Likelihoods
After calculating the observables described in Section 4, FlavBit can be used to compute likelihoods based on a comparison of the predictions with current experimental measurements.
The experimental results and theoretical errors are stored in a YAML database.Taking the branching fraction of B s → µ + µ − as an example, the FlavBit database entry is -name: BR_Bs2mumu islimit: false exp_value: 3.0e-9 exp_stat_error: 0.6e-9 exp_sys_error: 0.25e-9 exp_source: 1703.05747th_error: 0.1 th_error_type: M th_error_source: 1208.0934correlation: -name: NONE The individual fields available in such entries are described in detail in Table 6.Note in particular that the theory error may be given either as a fraction, as in this example, or as an absolute value.The Flav_reader object is responsible for reading the experimental results and theoretical errors, and calculating the resulting covariance matrix.Table 7 describes its specific functions.We consider correlated theoretical and experimental uncertainties separately, building two covariance matrices and assuming linear correlations for both.In the case of asymmetric uncertainties, we symmetrise the errors by taking the mean of the upper and lower uncertainties.FlavBit constructs the experimental covariance matrix directly from the exp_stat_error, exp_sys_error and correlation entries in its YAML database (  FlavBit builds the full covariance matrix by summing the experimental and theoretical covariance matrices.If an observable and its measurements are uncorrelated with other observables, the resulting uncertainty then becomes simply the sum in quadrature of the theoretical and experimental errors. We determine likelihoods for flavour observables under the assumption of correlated Gaussian errors and Wilks' Theorem, taking (twice) the final log-likelihood are substantial and dominant contributors to the error budget of some processes.The current likelihoods in FlavBit should therefore not be employed in any scan where CKM elements are varied as nuisance parameters, without first carefully considering which likelihood terms already include their impact, and either removing those observables from the fit, or reducing the theory errors accordingly.to be χ 2 distributed.This gives

Capability
where x i is the experimental measurement of the ith observable, y i is the ith theory prediction and V −1 is the inverse of the full covariance matrix.FlavBit contains five different likelihood functions.These correspond to different likelihood classes within which observables might be correlated.
SL_likelihood: tree level leptonic and semi-leptonic B and D decays ( The likelihood functions, their capabilities and dependencies are given in Table 8.In the following subsections, we give details of the experimental data included in each.

Tree-level leptonic and semi-leptonic likelihood
We take the branching fractions of the decays B → D ( * ) ν from the PDG [28], which combines results from many experiments but is dominated by the contributions from BaBar [85,86] and Belle [87,88].
In addition to R D and R D * , we also explicitly include in the likelihood the decays B → D ( * ) µν, adopting the experimental values from the PDG [28].Taken with R D and R D * , this set of four likelihood terms constitutes a complete basis for the models of lepton non-universality.The theory errors for the B → D ( * ) µν branching fractions are dominated by form factors [29,93].Performing a detailed error analysis with SuperIso gives a theoretical uncertainty of 9% for B → Dµν and 11% for B → D * µν.
Experiments have not measured any correlation between the muonic and tauonic modes of the decays contributing to R D ( * ) .However, the theory systematics are strongly correlated; in our analysis with SuperIso, we find anti-correlations at the level of 55% for B → Dµν and R D , and 62% for B → D ( * ) µν and R D * .These data are all included in the FlavBit likelihood.
For B ± → ν , FlavBit uses experimental measurements from the PDG [28], This average is dominated by results from the BaBar [97,98] and Belle [99,100] experiments, and is in agreement with the SM.We take this measurement to be uncorrelated with all other measurements.The dominant theoretical uncertainty comes from the CKM element V ub .The present uncertainty on this element is 9.5% [28], giving an overall theoretical uncertainty of 19%.
For the branching fractions of the D ± (s) decays D ± → µν µ , D ± s → τ ν τ and D ± s → µν µ , we adopt the experimental values of the PDG [28].(FlavBit does not include D ± → τ ν τ as an observable, as its decay branching fraction has not yet been measured.)The theory errors on the D ± (s) decays are dominated by the knowledge of the decay constant of the corresponding charmed mesons, f D and f Ds .This leads to a theoretical uncertainty on the branching fractions of 3% for D ± decays and 2% for D ± s decays [28].As shown in Table 8, FlavBit collects together into SL_M the measured values, experimental correlations, theoretical predictions and theory uncertainties for B ± → ν , the four B → D ( * ) ν observables, and the three D ± (s) decays.This fills the only dependency of the final tree-level leptonic and semi-leptonic likelihood, which can be accessed via capability SL_LL.

Electroweak penguin likelihood
The electroweak penguin likelihood in FlavBit is calculated using the angular observables of the B 0 → K * 0 µ + µ − decay, as measured by LHCb [47] in dimuon invariant mass squared bins of (1.1, 2.5), (2.5, 4), (4,6), (6,8), (15,17) and (17,19) GeV 2 .The bin (11, 12.5) GeV 2 cannot be used in the likelihood, as the relative phase between the charmonium resonances in this bin and the non-resonant decay is not currently known.We do not implement the measurements of Belle [23], as their contribution to the likelihood is negligible compared to the LHCb measurement.ATLAS and CMS have also very recently presented preliminary Run I measurements of the B 0 → K * 0 µ + µ − angular observables [101,102]; these data will be included in a future release of FlavBit.
For each q 2 bin, the FlavBit likelihood includes components arising from FL, S3, S4, S5, AFB, S7, S8 and S9.It accounts for experimental correlations between these measurements within each bin, but assumes that measurements are not correlated across q 2 bins, as the uncertainty is dominated by the statistical component.The full correlation matrices within each bin are available publicly from LHCb [47] and included in the FlavBit YAML database.We include theory-induced correlated uncertainties between different angular observables for the same q 2 range from Ref. [62,103].
The branching fractions for B 0 → K * 0 µ + µ − decays are not part of the electroweak penguin likelihood in FlavBit 1.0.0,but are slated for inclusion in a future version, following the next update from LHCb.The isospin asymmetry of the B 0 → K * 0 µ + µ − decay is non-trivially correlated with the angular observables, so we also do not include the corresponding observables (AI_BKstarmumu and AI_BKstarmumu_zero in Table 3) in the likelihood function.
Predictions of the branching fractions and forwardbackward asymmetries of the inclusive decays B → X s µ + µ − and B → X s τ + τ − , corresponding to the last 7 observables of Table 2, have lower theoretical uncertainties than those of B 0 → K * 0 µ + µ − .They are however not included in the FlavBit electroweak penguin likelihood, as they provide little additional constraining power when B → X s γ is already included in a fitand only B → X s + − (where does not distinguish between e and µ) and its forward-backward asymmetry have been measured by BaBar and Belle [66][67][68][69], with higher uncertainties than measurements of the exclusive modes.We expect to include likelihoods for these observables in a future revision of FlavBit.
FlavBit reads the experimental measurements and correlations, collects them together with the theoretical predictions and uncertainties, and publishes them to the rest of GAMBIT under the capability b2sll_M.FlavBit then uses the measurements and correlations to compute the electroweak penguin decay likelihood, which is assigned capability b2sll_LL.See Table 8 for more details.

Rare purely leptonic likelihood
Experimentally, only the decays with muons in the final state have been observed, and therefore give the strongest constraints.For B 0 s → µ + µ − , we adopt the latest result from LHCb [104], For B 0 → µ + µ − , we take the results of Ref.
Although the ATLAS collaboration have also recently measured these two branching fractions [108], they do not yet report a 3σ evidence for these decays.We thus do not include the ATLAS result in FlavBit at this stage.The similar decays B 0 (s) → e + e − and B 0 (s) → τ + τ − have not been measured to date.Only weak upper limits exists in these cases [109-111], which are currently much less constraining for models of new physics than the muon channels; we therefore do not include them in the FlavBit likelihood.
From the theoretical point of view, B 0 (s) → µ + µ − decays are rather clean.The theory uncertainty is 10%, and is dominated by the knowledge of the meson decay constant f Bs [112].This is far smaller than the experimental uncertainty, and therefore has little impact.We also neglect corresponding correlations in the theoretical uncertainties associated with the two decays.
FlavBit reads the experimental measurements and theory errors, collects them together with the theoretical predictions, and publishes them to the rest of GAMBIT as b2ll_M.It then computes the rare purely leptonic decay likelihood from the measurements and uncertainties, and labels it with capability b2ll_LL.Table 8 gives full details.

Rare radiative B decay likelihood
FlavBit includes the average [78] of the measurements of B → X s γ from BaBar [113][114][115] and Belle [116,117] for E γ > 1.6 GeV, We adopt a theoretical uncertainty of 7%, coming partly from non-perturbative effects [77,118].The corresponding likelihood has capability b2sgamma_LL (Table 8), and consists of a direct call to the standard GAMBIT Gaussian likelihood [4].Note that in general the theoretical calculation from SuperIso should be preferred over the corresponding quantity from FeynHiggs as input to this likelihood, as the cut employed on the photon energy in SI_bsgamma (E γ > 1.6 GeV -see Table 2) is correctly matched to the cut applied in the experimental analysis.
The experimental correlation between B(B → X s γ) and the isospin asymmetry of B → K * γ is not known, though it is expected to be non-negligible given that the event selections overlap.Because the inclusive branching ratio of B → X s γ has a smaller theoretical uncertainty, we include B(B → X s γ) but not ∆ 0 in the likelihood function.

B meson mass asymmetry likelihood
The parameters ∆M s and ∆M d have been precisely measured [91]: The measurement of ∆M d is the average of the results from the DELPHI, ALEPH, L3, OPAL, CDF, D0, BaBar, Belle and LHCb experiments, while the ∆M s value is the average of the results from the CDF and LHCb experiments.The sensitivity of these observables is diluted by the theory uncertainty, which is essentially the same for both SM and BSM predictions, as it is dominated by lattice calculations of non-perturbative effects and the uncertainty on the B decay constant f B .The total theoretical uncertainty on ∆M s , for example, is currently 15% [119].At present, FlavBit can predict only ∆M s (Table 1), so the B meson mass asymmetry likelihood simply compares this prediction to Eq. 43, using a theoretical error of 15% and the standard GAMBIT Gaussian likelihood function [4].This likelihood is available via the capability deltaMB_LL (Table 8).

Other observables
The R µ23 average is dominated by the KLOE [120] and NA62 [121] experiments.While both R µ and R µ23 are implemented as observables in FlavBit, they are not included in the likelihood.For several BSM models, such as the 2HDM, they add negligible additional constraints, particularly when the decay B ± → τ ν τ is included in the likelihood via SL_likelihood.

Examples
Basic examples of how to use FlavBit in a GAMBIT BSM global fit can be found in any of the canonical GAMBIT SUSY examples in the yaml_files directory: CMSSM.yaml,NUHM1.yaml,NUHM2.yaml or MSSM7.yaml[4,10,11].In this section, we go through a number of flavour-specific examples, ranging from flavour-only supersymmetric and effective field theory scans with GAMBIT, to an example of how to use FlavBit in standalone mode.

Supersymmetric scan
It is often instructive to consider the impacts of restricted classes of observables on broader global fits.In yaml_files/FlavBit_CMSSM.yaml, we give an example of a Constrained MSSM (CMSSM) fit focussing specifically on observables and likelihoods from FlavBit.This scan varies three dimensionful Lagrangian parameters defined at the GUT scale (the trilinear coupling A 0 , the universal scalar mass m 0 and the universal fermion mass m 1 2 ), the dimensionless ratio of Higgs VEVs at the weak scale (tan β), and two SM nuisance parameters (α s and m t ).The parameters and ranges are shown in Table 9.
In this example scan, we include the FlavBit rare leptonic and semileptonic (SL_LL), electroweak penguin (b2sll_LL), rare purely leptonic (b2ll_LL) and rare radiative likelihoods (b2sgamma_LL).In the interests of speed, numerical stability and comparability to the main CMSSM results presented in Ref. [10], we do not include the prediction of ∆M s from FeynHiggs nor the resulting B mass asymmetry likelihood (deltaMB_LL).We employ nuisance likelihoods from PrecisionBit [14] to constrain α s and m t .
We focus specifically on the frequentist profile likelihood in this scan, and therefore employ differential evolution to sample the parameter space, as implemented in Diver [8].Consistent with Ref. [10], we choose a population of 19200 and a convergence threshold of 10 −5 .Although the profile likelihood is in principle independent of the chosen sampling method and prior, in practice these have an impact on the sampling efficiency and the ability of a scan to uncover more isolated likelihood  The jagged edge of the 2σ contour at low m0 and large m 1/2 is a plotting artefact, caused by interaction of the binning required for plotting and the abruptness of the dropoff of the likelihood in this region (due to the requirement that the lightest supersymmetric particle be a neutralino).
modes [8,122,123].Our scans employ effectively logarithmic priors on the dimensionful BSM parameters, and flat priors on all other parameters.The SM parameters are sufficiently well constrained that the prior is irrelevant.We discuss the impact of the sampling prior on the BSM parameters below.
The resulting scan took approximately 15 minutes to run on 1200 CPU cores, and produced 1.1 million likelihood samples.
The results are shown in Fig. 1, in terms of the 2D profile likelihood of the sparticle masses m 0 and m 1 2 , and the 1D profile likelihood of tan β.The flavour likelihoods have the most impact at large tan β, as has been extensively pointed out in the literature (e.g.[72,124]).The 2D figure shows a weak preference (at the 1-2σ level) for lower sparticle masses.At first glance this may seem surprising, given the lack of hints for SUSY, the fact that the likelihood at large m 0 and m 1 2 essentially recovers the SM result, and the resulting tendency of b → sγ to drive SUSY fits to larger masses to avoid spoiling the good agreement between the SM prediction and the observed value of B(B → X s γ).Indeed, the likelihood improvement at low mass is driven entirely by the angular analysis of B 0 → K * µ + µ − decays, with the fit attempting to account for the deviation from the SM prediction in this channel by making the new states light and boosting the (generally small) SUSY contributions as much as possible.This effect is rather small, providing an improvement in the likelihood contribution from B 0 → K * µ + µ − (b2sll_likelihood) of ∆ ln L = 3.4 relative to the SM.This improvement is mostly counteracted by a corresponding decrease of ∆ ln L = −2.0 in the likelihood associated with B(B → X s γ) (b2sgamma_likelihood).

Wilson coefficient fit
As a more advanced example, we carry out a joint fit to the real parts of the C 7 , C 9 and C 10 effective couplings of Eq. 2, expressed in terms of offsets from their SM values ∆C i ≡ C i − C i,SM .The YAML file for this scan can be found at yaml_files/WC.yaml.
In this example, we use the electroweak penguin likelihood (b2sll_likelihood), the rare purely leptonic decay likelihood (b2ll_likelihood) and the rare radiative decay likelihood (b2sgamma_likelihood).The other two likelihood functions available in FlavBit (based on the B meson mass asymmetry and tree-level leptonic and semi-leptonic decays) have no dependence on the three Wilson coefficients that we vary.We also scan over the M S b quark mass and the strong coupling as nuisance parameters, computing associated nuisance likelihoods with PrecisionBit [14].We sample the parameter space with nested sampling [125,126], using 20 000 live points and a tolerance of 0.1; see Ref. [8] for details of the scanning setup and sampling algorithm.
The results of this scan are shown in Fig 2 .Here we show both Bayesian posterior probabilities (lower left panels) and frequentist profile likelihoods (upper right panels), which are in rather close agreement.The small offset between the peaks of the posterior and the profile likelihood in ∆C 9 is a volume effect, reflecting the fact that the posterior is slightly broader in C 7 and C 10 at values below the best-fit ∆C 9 than above it.The results show a > 3σ preference for a negative offset to the muonic version of the C 9 Wilson coefficient compared to the SM, consistent with recent results from other groups [127][128][129].These are largely driven by the B 0 → K * µ + µ − angular observables, with the corresponding component of the best-fit likelihood improved by ∆ ln L = 13.2 with respect to the SM, and ∆ ln L = 9.8 compared to the CMSSM.We can also see that C 7 is strongly constrained by b → sγ decays, to within +0.04/−0.03 of its SM value.

FlavBit standalone example
GAMBIT modules can also be called directly from other codes as libraries, without actually needing to use GAM-BIT itself.To do this, the calling code must specify the physics model and parameter set to be used, the module and backend functions to be run, and any required options.The calling code is responsible for resolving the dependencies and backend requirements of each module function; this is typically done "by hand" by the author of the calling code, using simple GAMBIT utility functions to hardcode the links between the chosen module and backend functions.More details of using GAMBIT modules in this so-called 'standalone mode' can be found in Ref. [4].
An annotated driver program for calling FlavBit from outside the GAMBIT framework can be found in FlavBit/examples/FlavBit_standalone_example.cpp.As input, this program takes an SLHA file corresponding to the output of a spectrum generator (i.e. containing pole masses, DR parameters, etc).The name of this file can be given as a command-line argument.The program then calculates the full menu of FlavBit observables using SuperIso 3.6 and FeynHiggs 2.11.3, and uses them to calculate the five independent FlavBit likelihoods.Much of this short program is dedicated to resolving module function dependencies and backend requirements.This includes defining a local function that creates a GAMBIT Spectrum object from the input SLHA file, and others that fulfil the dependencies of SI_fill on the widths of the Z and W bosons.
If the user does not give the name of an input SLHA file when invoking the standalone example, it will read a default file given in the line std::string infile("FlavBit/data/example.slha"); The likelihoods are retrieved in the lines loglike = b2ll_likelihood(0); loglike = b2sll_likelihood(0); loglike = SL_likelihood(0); loglike = b2sgamma_likelihood(0); loglike = deltaMs_likelihood(0); and can be combined or used for further analysis as the user requires.
The values of the observables, as used by the likelihoods, can be obtained directly from the respective observable functions in a similar manner, e.g.double bsg = SI_bsgamma(0); double Btaunu = SI_Btaunu(0); and so on for all observables in Tables 1, 2 and 3.

Conclusions
In this paper we have described FlavBit, the flavour physics module of the public global-fitting framework GAMBIT.FlavBit provides calculations of a wide range of observables in flavour physics, ranging from tree-level decays of B and D mesons, to electroweak penguin decays, rare purely leptonic B decays, b → sγ transitions, neutral meson oscillations, kaon and pion decays, and various isospin and forward-backward asymmetries.These are so far implemented for supersymmetric and effective field theories, with the list of available theories expected to grow rapidly.FlavBit also features detailed experimental data, uncertainties, correlations and likelihood functions for tree-level leptonic and semileptonic, electroweak penguin, rare purely leptonic and B → X s γ decays, as well as for the B 0 s -B0 s mass difference.We gave a number of interesting examples of FlavBit in action.These include a standalone example program that runs FlavBit without GAMBIT, in order to compute flavour observables in supersymmetry from an input SLHA file.We carried out an example supersymmetric flavour fit with FlavBit in GAMBIT, illustrating the impacts of its likelihoods.Finally, we performed a fit to a number of observables in the context of an effective theory of flavour, demonstrating about a 4σ preference from combined experimental data for an approximately 25% deficit in the (muonic) C 9 Wilson coefficient, compared to the Standard Model prediction.
The FlavBit source code can be freely downloaded from gambit.hepforge.org,either as part of GAMBIT, or as a standalone package.

Table 9 :
CMSSM parameters varied in the example fit, along with their associated ranges and prior types.The "hybrid" prior on A0 is logarithmic for |A0| > 100 GeV and flat for |A0| < 100 GeV.

Fig. 1 :
Fig.1: 2D (upper) and 1D (lower) profile likelihoods of Lagrangian parameters m0, m 1/2 and tan β in a CMSSM fit including flavour and nuisance likelihoods only.Stars identify the best fit, and contours indicate 1 and 2σ confidence regions.The jagged edge of the 2σ contour at low m0 and large m 1/2 is a plotting artefact, caused by interaction of the binning required for plotting and the abruptness of the dropoff of the likelihood in this region (due to the requirement that the lightest supersymmetric particle be a neutralino).

Fig. 2 :
Fig. 2: Profile likelihoods (upper right panels) and posterior probabilities (bottom left panels) from a scan over the real parts of the Wilson coefficients C7, C9 and C10, expressed in terms of the offsets ∆C i from the SM values.The central diagonal shows both 1D posterior probabilities (blue) and profile likelihoods (red) for each parameter.Stars indicate the location of the best fit, filled circles indicate posterior means, and contours correspond to 1, 2, and 3σ confidence.The SM prediction lies at the intersection of the dashed lines in the 2D panels.

Capability Function (Return Type): Brief Description Dependencies (Model) Backend requirements
lν l ), where = µ or e and the result is the same for each.

Table 1 :
Observable capabilities of FlavBit that do not involve Wilson coefficients.Details of the fh_FlavourObs structure can be found in Table Xsγ for Eγ > 1.6 GeV.Xsγ in the MSSM from FeynHiggs.+ µ − in the MSSM from FeynHiggs.

Table 4 :
Observables contained in the Flav_KstarMuMu_obs structure.

Table 5 :
Flavour observables contained in the fh_FlavourObs structure obtained from FeynHiggs.
74.5 Other flavour observables Other observables included in FlavBit are B → X s γ, the ratio R µ =

Table 6 :
Parameters of a single experimental entry in the FlavBit YAML database.Reads an entire YAML database file name into memory.
void read_yaml_measurement(str name, str measurement_name) Extracts a single measurement measurement_name from the YAML database file name.voiddebug_mode(booldebug)Turns on (debug = true) or off (debug = false) printing of all parameters.voidcreate_global_corr()Constructs a total correlation matrix from all measurements read in.matrix(n,1) get_th_err() Returns the central (uncorrelated) theory error for each of the measurements read in.

Table 7 :
Important methods of the FlavBit Flav_reader class.Here str is an alias for std::string, n is the number of measurements so far read in by the Flav_reader instance, and matrix(x,y) is an x × y boost::numeric::ublas::matrix<double>.and example above).It takes the th_error entries in the YAML database and uses them to populate the and in particular, CKM matrix entries.The SM masses and couplings are sufficiently well constrained that any error term dominated by them can be safely neglected, and generally is in FlavBit, seeing as they can be easily varied within GAMBIT as nuisance parameters.On the other hand, CKM elements

Table 8 :
Likelihood capabilities of FlavBit.All measurement functions (capabilities ending in _M) return experimental and theoretical central values, as well as experimental and theoretical covariance matrices.