A new algorithm for identifying the flavour of $B_s^0$ mesons at LHCb

A new algorithm for the determination of the initial flavour of $B_s^0$ mesons is presented. The algorithm is based on two neural networks and exploits the $b$ hadron production mechanism at a hadron collider. The first network is trained to select charged kaons produced in association with the $B_s^0$ meson. The second network combines the kaon charges to assign the $B_s^0$ flavour and estimates the probability of a wrong assignment. The algorithm is calibrated using data corresponding to an integrated luminosity of 3 fb$^{-1}$ collected by the LHCb experiment in proton-proton collisions at 7 and 8 TeV centre-of-mass energies. The calibration is performed in two ways: by resolving the $B_s^0$-$\bar{B}_s^0$ flavour oscillations in $B_s^0 \to D_s^- \pi^+$ decays, and by analysing flavour-specific $B_{s 2}^{*}(5840)^0 \to B^+ K^-$ decays. The tagging power measured in $B_s^0 \to D_s^- \pi^+$ decays is found to be $(1.80 \pm 0.19({\rm stat}) \pm 0.18({\rm syst}))$\%, which is an improvement of about 50\% compared to a similar algorithm previously used in the LHCb experiment.


Introduction
Precision measurements of flavour oscillations of B 0 (s) mesons and of CP asymmetries in their decays allow the validity of the standard model of particle physics to be probed at energy scales not directly accessible by current colliders [1]. Measurements of associated observables, e.g. the CP -violating phase φ s in B 0 s → J/ψ K + K − and B 0 s → J/ψ π + π − decays [2,3], are among the major goals of the LHCb experiment and its upgrade [4,5]. 1 These analyses require so-called flavour-tagging algorithms to identify the flavour at production of the reconstructed B meson. Improving the effectiveness of those algorithms is of crucial importance, as it increases the statistical power of the dataset collected by an experiment.
Several types of flavour-tagging algorithms have been developed in experiments at hadron colliders. Opposite-side (OS) algorithms exploit the fact that b quarks are predominantly produced in bb pairs in hadron collisions, and thus the flavour at production of the reconstructed B meson is opposite to that of the other b hadron in the event. Therefore, the products of the decay chain of the other b hadron can be used for flavour tagging. The OS algorithms utilised in LHCb are described in Refs. [6,7]. Same-side (SS) algorithms look for particles produced in association with the reconstructed B meson in the hadronisation process [8][9][10]. In about 50% of cases, a B 0 s meson is accompanied by a charged kaon and a B 0 meson by a charged pion. The charge of these particles indicates the b quark content of the B meson. Information from OS and SS algorithms is usually combined in flavour-tagged analyses.
This paper describes a new same-side kaon (SSK) flavour-tagging algorithm at the LHCb experiment. The first use of an SSK algorithm in LHCb is reported in Refs. [11,12]. That version uses a selection algorithm, optimised with data, to identify the kaons produced in the hadronisation of the B 0 s meson. One key part of the algorithm is that, for events in which several particles pass the selection, the one with the largest transverse momentum is chosen as the tagging candidate and its charge defines the tagging decision. The new algorithm presented here exploits two neural networks to identify the flavour at production of a reconstructed B 0 s meson. The first neural network is used to assign to each track reconstructed in the pp collision a probability of being a particle related to the B 0 s hadronisation process. Tracks that have a probability larger than a suitably chosen threshold are combined in the second neural network to determine the tagging decision.
The effectiveness of an algorithm to tag a sample of reconstructed B candidates is quantified by the tagging efficiency, ε tag , and the mistag fraction, ω. These variables are defined as where R, W and U are the number of correctly tagged, incorrectly tagged, and untagged B candidates, respectively. For each tagged B candidate i, the flavour-tagging algorithm estimates the probability, η i , of an incorrect tag decision. To correct for potential biases in η i , a function ω(η) is used to calibrate the mistag probability to provide an unbiased estimate of the mistag fraction for any value of η. The tagging efficiency and mistag probabilities are used to calculate the effective tagging efficiency, ε eff , also known as the tagging power, which represents the figure of merit in the optimisation of a flavour-tagging algorithm, since the overall statistical power of the flavour-tagged sample is proportional to ε eff . The previous SSK algorithm used by the LHCb experiment has a tagging power of 0.9% and 1.2% in B 0 s → J/ψ φ and B 0 s → D − s π + decays, respectively. For comparison, the performance of the combination of the OS algorithms in these decays corresponds to a tagging power of about 2.3% and 2.6% [11,12].
The calibration function ω(η) is obtained with control samples of flavour-specific decays, i.e. decays in which the B flavour at decay is known from the charge of the final-state particles. In the case of the new SSK algorithm described here, the decay B 0 s → D − s π + and, for the first time, the decay B * s2 (5840) 0 → B + K − are used. These decays are reconstructed in a dataset corresponding to an integrated luminosity of 3 fb −1 collected by LHCb in pp collisions at 7 and 8 TeV centre-of-mass energies.

Detector and simulation
The LHCb detector [13,14] is a single-arm forward spectrometer covering the pseudorapidity range between 2 and 5, designed for the study of particles containing b or c quarks. The detector includes a high-precision tracking system consisting of a silicon-strip vertex detector surrounding the pp interaction region, a large-area silicon-strip detector located upstream of a dipole magnet with a bending power of about 4 Tm, and three stations of silicon-strip detectors and straw drift tubes placed downstream of the magnet. The polarity of the dipole magnet is reversed periodically throughout data-taking to reduce the effect of asymmetries in the detection of charged particles. The tracking system provides a measurement of momentum, p, of charged particles with a relative uncertainty that varies from 0.5% at low momentum to 1.0% at 200 GeV/c. The minimum distance of a track to a primary pp interaction vertex (PV), the impact parameter, is measured with a resolution of (15 + 29/p T ) µm, where p T is the component of the momentum transverse to the beam, in GeV/c. Different types of charged hadrons are distinguished using information from two ring-imaging Cherenkov detectors. Photons, electrons and hadrons are identified by a calorimeter system consisting of scintillating-pad and preshower detectors, an electromagnetic calorimeter and a hadronic calorimeter. Muons are identified by a system composed of alternating layers of iron and multiwire proportional chambers. The online event selection is performed by a trigger [15], which consists of a hardware stage and a software stage. At the hardware trigger stage, for decay candidates of interest in this paper, events are required to have a hadron with high transverse energy in the calorimeters, or muons with high p T . For hadrons, the transverse energy threshold is 3.5 GeV. The software trigger requires a two-, three-or four-track secondary vertex with a significant displacement from the primary vertices. At least one charged particle must have a transverse momentum p T > 1.7 GeV/c and be inconsistent with originating from a PV. A multivariate algorithm [16] is used for the identification of secondary vertices consistent with the decay of a b hadron.
In the simulation, pp collisions are generated using Pythia [17] with a specific LHCb configuration [18]. Decays of hadronic particles are described by EvtGen [19], in which final-state radiation is generated using Photos [20]. The interaction of the generated particles with the detector, and its response, are implemented using the Geant4 toolkit [21] as described in Ref. [22].

The neural-network-based SSK algorithm
In this section, charged kaons related to the fragmentation process of the reconstructed B 0 s candidate are called signal, and other particles in the event are called background. This background includes, for example, the decay products of the OS b hadron, and particles originating from soft QCD processes in pp interactions. In the neural-network-based SSK algorithm, a neural network (NN1) classifies as signal or background all tracks passing an initial preselection. A second neural network (NN2) combines the tracks selected by NN1 to tag the reconstructed B candidate as either B 0 s or B 0 s , and estimates the mistag probability associated with the tagging decision. Both NN1 and NN2 are based on the algorithms of Ref. [23].
The preselection imposes a number of requirements on the tracks to be considered as tagging candidates, and is common to other flavour-tagging algorithms used in LHCb [6]. The tracks must have been measured in at least one of the tracking stations both before and after the magnet. Their momentum is required to be larger than 2 GeV/c, and their transverse momentum to be smaller than 10 GeV/c. A requirement that the angle between the tracks and the beam line must be at least 12 mrad is applied, to reject particles which either originate from interactions with the beam pipe material or which suffer from multiple scattering in this region. The tracks associated with the reconstructed decay products of the B 0 s candidate are excluded. Tracks in a cone of 5 mrad around the B 0 s flight direction are rejected to remove any remaining B 0 s decay products. Tracks outside a cone of 1.5 rad are also rejected, to suppress particles which are not correlated with the B 0 s flavour. Finally, tracks must be inconsistent with originating at a different PV from the one associated with the reconstructed B 0 s candidate, which is taken to be that closest to the B 0 s flight path. The network NN1 is trained using signal and background kaons from approximately 80,000 simulated events containing a reconstructed B 0 s → D − s (→ K + K − π − )π + decay. An independent sample of similar size is used to test the network's performance. Information from the simulation is used to ensure that only genuine, correctly reconstructed B 0 s → D − s π + decays are used. The following ten variables are used as input to NN1: the momentum and transverse momentum of the track; the χ 2 per degree of freedom of the track fit; the track impact parameter significance, defined as the ratio between the track impact parameter with respect to the PV associated with the B 0 s candidate, and its uncertainty; the difference of the transverse momenta of the track and the B 0 s candidate; the difference of the azimuthal angles and of the pseudorapidities between the track and the B 0 s candidate; the number of reconstructed primary vertices; the number of tracks passing the preselection; and the transverse momentum of the B 0 s candidate. The track impact parameter significance is used to quantify the probability that a track originates from the same primary vertex as the reconstructed B 0 s candidate. In an event with a large number of tracks and primary vertices, the probability that a given track is a signal fragmentation track is lower; hence the use of these variables in NN1. The B 0 s transverse momentum is correlated with the difference in pseudorapidity of the fragmentation tracks and the B 0 s candidate. The network NN1 features one hidden layer with nine nodes. The activation function and the estimator type are chosen following the recommendations of Ref.
[24], to guarantee the probabilistic interpretation of the response function. The distribution of the NN1 output, o 1 , for signal and background candidates is illustrated in Fig. 1. After requiring o 1 > 0.65, about 60% of the reconstructed B 0 s → D − s π + decays have at least one tagging candidate in background-subtracted data. This number corresponds to the tagging efficiency. The network configuration and the o 1 requirement are chosen to give the largest tagging power. For each tagged B 0 s candidate there are on average 1.6 tagging tracks, to be combined in NN2.
The training of NN2 is carried out with a simulated sample of approximately 80,000 reconstructed B 0 s → D − s π + decays, statistically independent of that used to train NN1. All of the events contain at least one track passing the NN1 selection requirement. Half of the events contain a meson whose true initial flavour is B 0 s , and the other half contain B 0 s mesons. About 90% of the simulated events are used to train NN2, and the remaining 10% are used to test its performance. The likelihood of the track of being a kaon [14] and the value of o 1 are used as input variables to NN2. These variables are multiplied by the charge of the tagging track, to exploit the charge correlation of fragmentation kaons with the flavour of the B 0 s meson. The reconstructed B 0 s momentum, its transverse momentum, the number of reconstructed primary vertices and the number of reconstructed tracks in the event that pass the B 0 s candidate's selection are also used as input to NN2. Different configurations of NN2 with up to n max input tagging tracks and several network structures are tested. In all cases, one hidden layer with n − 1 nodes is chosen, where n is the number of input variables. If more than n max tracks pass the requirement on o 1 , the n max tracks with the greatest o 1 are used. If fewer than n max pass, the unused input values are set to zero. The networks with n max = 2, 3 and 4 perform very similarly and show a significantly better separation than the configurations with n max = 1 or 5. The NN2 configuration with n max = 3 is chosen. The main additional tagging power of this algorithm compared to the previous SSK algorithm comes from the possibility to treat events with multiple tracks of similar tagging quality, which allows a looser selection (i.e. a larger tagging efficiency) compared to the algorithm using a single tagging track. The distribution of the NN2 output, o 2 , of initially produced B 0 s and B 0 s mesons is shown in Fig. 1. In the training configuration used [24], the NN2 output can be directly interpreted as the probability that a B candidate with a given value of o 2 was initially produced as a B 0 s meson, where the second equality holds in the limit of infinite statistics, and N B 0 s (o 2 ) and N B 0 s (o 2 ) refer to the number of initial B 0 s and B 0 s mesons in the training sample with a given o 2 value. The distribution of the NN2 output of initial B 0 s mesons has a peak at o 2 values slightly larger than 0.5, while that of initial B 0 s mesons has a peak at o 2 values slightly smaller than 0.5 ( Fig. 1). In case of no CP asymmetries, and no asymmetries related to the different interaction probabilities of charged kaons with the detector, the NN2 distribution of initial B 0 s mesons is expected to be identical, within uncertainties, to the NN2 distribution of initial B 0 s mesons mirrored at o 2 = 0.5. This is a prerequisite for interpreting the NN2 output as a mistag probability. Therefore, to ensure such an interpretation, a new variable is defined, which has a mirrored distribution for initial B 0 s and B 0 s mesons of the same kinematics, whereō 2 stands for the NN2 output with the charged-conjugated input variables, i.e. for a specific candidate,ō 2 is evaluated by flipping the charge signs of the input variables of NN2. The tagging decision is defined such that the B candidate is assumed to be produced as a B 0 s if o 2 > 0.5 and as a B 0 s if o 2 < 0.5. Likewise, the mistag probability is defined as η = 1 − o 2 for candidates tagged as B 0 s , and as η = o 2 for candidates tagged as B 0 s .

Calibration using
The mistag probability estimated by the SSK algorithm is calibrated using two different decays, s flavour oscillations to be resolved via a fit to the B 0 s decay time distribution, since the amplitude of the oscillation is related to the mistag fraction. In contrast, there are no flavour oscillations before the strong decay of the B * s2 (5840) 0 and the charged mesons produced in its decays directly identify the B * s2 (5840) 0 production flavour. Therefore, the calibration with B * s2 (5840) 0 is performed by counting the number of correctly and incorrectly tagged signal candidates. Thus, the two calibrations feature different analysis techniques, which are affected by different sources of systematic uncertainties, and serve as cross-checks of each other. The calibration with B 0 s → D − s π + decays is described in this section and that using B * s2 (5840) 0 → B + K − decays in Sect. 5. The results are combined in Sect. 8 after equalising the transverse momentum spectra of the reconstructed B 0 s and B * s2 (5840) 0 candidates, since the calibration parameters depend on the kinematics of the reconstructed B decay. These calibrations also serve as a test of the new algorithm in data, to evaluate the performance of the tagger and to compare it to that of the previous SSK algorithm used in LHCb.
A sample of B 0 s → D − s π + candidates is selected according to the requirements presented in Ref. [25]. The D − s candidates are reconstructed in the final states K + K − π − and π − π + π − . The D − s π + mass spectrum contains a narrow peak, corresponding to B 0 s → D − s π + signal candidates, and other broader structures due to misreconstructed b-hadron decays, all on top of a smooth background distribution due to random combinations of tracks passing the selection requirements. The signal and background components are determined by a fit to the mass distribution of candidates in the range 5100-5600 MeV/c 2 (Fig. 2). The signal component is described as the sum of two Gaussian functions with a common mean, plus a power-law tail on each side, which is fixed from simulations. The combinatorial background is modelled by an exponential function. The broad structures are due to B and Λ 0 b decays in which a final-state particle is either not reconstructed or is misidentified as a different hadron, and the mass distributions of these backgrounds are derived from simulations. The B 0 s signal yield obtained from the fit is approximately 95,000. Candidates in the mass range 5320-5600 MeV/c 2 are selected for the calibration of the SSK algorithm. A fit to the B 0 s mass distribution is performed to extract sWeights [26]; in this fit the relative fractions of the background components are fixed by integrating the components obtained in the previous fit across the small mass window. The sWeights are used to subtract the background in the fit to the unbinned distribution of the reconstructed B 0 s decay time, t. This procedure for subtracting the background is validated with pseudoexperiments and provides unbiased estimates of the calibration parameters.
The sample is split into three categories -untagged, mixed and unmixed candidatesand a simultaneous fit to the t distributions of the three subsamples is performed. Untagged candidates are those for which the SSK algorithm cannot make a tagging decision, i.e. that contain no tagging tracks passing the o 1 selection. A B 0 s candidate is defined as mixed if the flavour found by the SSK algorithm differs from the flavour at decay, determined  by the charges of the final-state particles; it is defined as unmixed if the flavours are the same. The probability density function (PDF) used to fit the t distribution is where t is the true decay time of the B 0 s meson, Γ(t ) is the B 0 s decay rate, R(t − t ) the decay time resolution function, and a(t) is the decay time acceptance.
The decay rate of untagged candidates is given by and that of tagged candidates by where q mix is −1 or +1 for candidates which are mixed or unmixed respectively, and ω is the mistag fraction. The average B 0 s lifetime, τ s , the width difference of the B 0 s mass eigenstates, ∆Γ s , and their mass difference, ∆m s , are fixed to known values [2,12,27].
Each measurement of t is assumed to have a Gaussian uncertainty, σ t , which is estimated by a kinematic fit of the B 0 s decay chain. This uncertainty is corrected with a scale factor of 1.37, as measured with data from a sample of fake B 0 s candidates, which consist of combinations of a D − s candidate and a π + candidate, both originating from a primary interaction [12]. Their decay time distribution is a δ-function at zero convolved with the decay time resolution function, R(t − t ). The latter is described as the sum of three Gaussian functions. The functional form of a(t) is modelled with simulated data and its parameters are determined in the fit to data. Two methods are used to calibrate the mistag probability. In the first one, η is an input variable of the fit, and ω in Eq. 7 is replaced by the calibration function ω(η), which is assumed to be a first-order polynomial, where η is the average of the η distribution of signal candidates (Fig. 3), fixed to the value 0.4377, while p 0 and p 1 are the calibration parameters to be determined by the fit.
They are found to be consistent with the expectations of a well-calibrated algorithm, p 0 − η = 0 and p 1 = 1.
The fitted values above are considered as the nominal results of the calibration. After calibration of the mistag probability, the tagging efficiency and tagging power measured in B 0 s → D − s π + decays are found to be ε tag = (60.38 ± 0.16 (stat))% and ε eff = (1.80 ± 0.19 (stat))%.
In the second method, the average mistag fraction ω is determined by fitting the B 0 s decay time distribution split into nine bins of mistag probability. Nine pairs ( η j , ω j ) are obtained, where ω j is the mistag fraction fitted in the bin j, which has an average mistag probability η j . The ( η j , ω j ) pairs are fitted with the calibration function of Eq. 8 to measure the calibration parameters p 0 and p 1 . The calibration parameters obtained, p 0 − η = 0.0050 ± 0.0045 (stat) and p 1 = 0.983 ± 0.072 (stat), are in good agreement with those reported above. This method also demonstrates the validity of the linear parametrisation (Eq. 8), as shown in Fig. 3. A summary of the systematic uncertainties on the calibration parameters is given in Table 1. The dominant systematic uncertainty is due to the uncertainty of the scale factor associated with σ t . The scale factor is varied by ±10%, the value of its relative uncertainty, and the largest change of the calibration parameters due to these variations is taken as the systematic uncertainty. Variations of the functions which describe the signal and the background components in the mass fit, and variations of the fraction of the main peaking background under the signal peak due to B 0 s → D − s K + decays, result only in minor changes of the calibration parameters. The systematic uncertainties associated with these variations are assessed by generating pseudoexperiments with a range of different models and fitting them with the nominal model. Systematic uncertainties related to the parametrisation of the acceptance function, and to the parameters ∆Γ s , τ s and ∆m s , are evaluated with the same method; no significant effect on the calibration parameters is observed. The difference between the two calibration methods reported in the previous section is assigned as a systematic uncertainty. Additionally, the calibration parameters  5 Calibration using B * s2 (5840) 0 → B + K − decays In B * s2 (5840) 0 → B + K − decays, the B + candidates are reconstructed in four exclusive final states, B + → J/ψ (→ µ + µ − )K + , B + → D 0 (→ K + π − )π + , B + → D 0 (→ K + π − )π + π − π + and B + → D 0 (→ K + π − π + π − )π + . The B + candidate selection follows the same strategy as in Ref.
[28], retaining only those candidates with a B + mass in the range 5230-5320 MeV/c 2 . The B + candidate is then combined with a K − candidate to form a common vertex. Combinatorial background is reduced by requiring the B + and K − candidates to have a minimum p T of 2000 MeV/c and 250 MeV/c respectively, and to be compatible with coming from the PV. The kaon candidate must have good particle identification and a minimum momentum of 5000 MeV/c. A good-quality vertex fit of the B + K − combination is required. In order to improve the mass resolution, the invariant mass of the system,  The yields of the three peaks are obtained through a fit of the Q distribution in the range shown. Both the B s1 (5830) 0 → B * + K − and the B * s2 (5840) 0 → B * + K − signals are described by Gaussian functions. The B * s2 (5840) 0 → B + K − signal is parametrised as a relativistic Breit-Wigner function convolved with a Gaussian function to account for the detector resolution. This resolution is fixed to the value determined in the simulation ( 1 MeV/c 2 ). The background is modelled by the function f (Q) = Q α e βQ , where α and β are free parameters. The yields of the three peaks are found to be approximately 2,900, 1,200 and 12,700, respectively. The mass and width parameters are in agreement with those obtained in Ref. [28]. Only the third peak, corresponding to the fully reconstructed B * s2 (5840) 0 meson, is used in the calibration of the mistag probability.
Since the B * s2 (5840) 0 meson is flavour-tagged by the charges of the final-state particles of its decay, the mistag fraction can be determined by comparing the tagging decision of the SSK algorithm with the known B * s2 (5840) 0 flavour. From the fit of the Q distribution, sWeights are obtained and used to statistically disentangle the signal from the combinatorial background. The fit is performed separately on the Q distributions of correctly and incorrectly tagged candidates, to allow for different background fractions in the two categories. In these fits the mass parameters are fixed to the values obtained in the fit to all candidates. In Fig. 5 the η distribution of signal candidates and the mistag fraction ω in bins of η are shown. Each bin of η has an average predicted mistag η . The ( η , ω) pairs are fitted with the calibration function of Eq. 8 to determine the calibration parameters.
The calibration parameters depend on the kinematics of the reconstructed B meson, and in particular on its transverse momentum. In order to test whether the calibrations are consistent between the two samples, the B * s2 (5840) 0 p T spectrum must be reweighted to match that of the B 0 s candidates seen in B 0 s → D − s π + decays. This is done for each of the four B + decay modes separately. Due to the requirement of a higher minimum p T of the B * s2 (5840) 0 candidates, 2.5 GeV/c, compared to 2.0 GeV/c for the B 0 s candidates, a 1% difference in the mean value of the p T spectra remains. This is covered by the systematic uncertainties discussed in Section 6, which account for differences in the mean transverse momenta of B mesons of up to 30%. The calibration parameters obtained from the full sample of weighted B * s2 (5840) 0 decays are where η is fixed to the value 0.441. They are consistent within statistical uncertainties with the calibration parameters obtained with B 0 s → D − s π + decays. The systematic uncertainties of the calibration parameters are determined by repeating the calibration under different conditions. In each case the fit to the Q distribution is repeated and the sWeights are calculated. A summary of all of the systematic uncertainties is given in Table 2. To test for potential differences in the signal model for correctly and incorrectly tagged candidates, the fit to the Q distribution is repeated for both subsets of B * s2 (5840) 0 candidates without fixing the mass parameters to the values obtained in the fit to all candidates. The background fit model is tested by fitting the Q distribution of correctly and incorrectly tagged candidates with the default background model replaced by a second-order polynomial, and with the fit range limited to 40 < Q < 100 MeV/c 2 . The mass resolution for B * s2 (5840) 0 is varied by ±10% to account for differences in resolution between data and simulation. Potential biases due to the B * s2 (5840) 0 signal selection are studied by varying the requirements on the p T or on the particle identification probability of the kaon produced in the B * s2 (5840) 0 decay and repeating the full calibration procedure. To test the background subtraction procedure, an alternative method of performing the calibration is used. The sample of tagged candidates is divided into bins of η, and, in each bin, the Q distributions of correctly and incorrectly tagged candidates are fitted separately. The measured signal yields of the B * s2 (5840) 0 peak are used to calculate the mistag fraction Table 3: Systematic uncertainties of the parameters p 0 and p 1 related to the portability of the calibration to different decay modes.
Source σ p 0 σ p 1 Weighting in p T 0.0011 0.030 Weighting in track multiplicity 0.0006 0.006 Sum in quadrature 0.0012 0.031 ω which is plotted against the average η of each bin. The calibration parameters obtained are in agreement within statistical uncertainties with those determined from the default method. The variation of the calibration parameters with data-taking conditions is checked by repeating the calibration procedure after splitting the candidate sample according to the data-taking period and magnet polarity. No significant variation is observed. The calibration is also repeated separately on each of the four B + decay modes, after weighting the transverse momentum spectra. The parameters obtained agree within statistical uncertainties.

Portability to different decay channels
The tagging calibration parameters will in general depend on the kinematics of the reconstructed B candidate and on the properties of the event. The largest dependences are found to be on the p T of the B candidate and on the track multiplicity of the event. The calibration parameters measured in B 0 s → D − s π + and B * s2 (5840) 0 → B + K − decays can thus be used in decays which have similar distributions in these variables. This is not necessarily the case for all B 0 s decay modes, due to different trigger and selection requirements. Three representative B 0 s decay modes have been studied: The sample of B 0 s → D − s π + candidates is weighted to match the B meson p T and event track multiplicity distributions of each of the three other decay modes in turn, with the weighting done for each variable separately. For each of the weighted samples, p 0 and p 1 are measured and compared to those of the unweighted sample. For each calibration parameter, a systematic uncertainty due to decay mode dependence is assigned, equal to half of the largest difference seen between the unweighted and weighted B 0 s → D − s π + samples. The systematic uncertainties obtained are listed in Table 3. The dominant effect is due to the weighting to match the p T distribution.

Flavour-tagging asymmetry
The calibration parameters depend on the initial flavour of the B 0 s meson, due to the different interaction cross-sections of K + and K − with matter. Therefore, additional calibration parameters, ∆p 0 and ∆p 1 , are introduced to take this flavour dependence into account. The mistag fraction of mesons produced with initial flavour B 0 s (accompanied by a K + ) and mesons produced with initial flavour B 0 s (accompanied by a K − ) are given by ω(η) = p 0 + ∆p 0 2 + p 1 + ∆p 1 2 (η − η ) and (9) respectively. The statistical power of the B 0 s → D − s π + data sample is not sufficient to determine these additional parameters, so they are studied with D − s → φ(→ K + K − )π − decays. The D − s mesons produced in the primary interaction are also accompanied by charged kaons produced in the c quark hadronisation. The SSK algorithm can tag the initial flavour of the D − s candidate, with a tagging decision opposite to the case of B 0 s mesons. The D − s meson is charged and does not oscillate, so its initial flavour can be determined from the charge of the decay products. This can then be compared to the SSK tagging decision, and a calibration can be performed with the same method used with B * s2 (5840) 0 → B + K − decays. The ∆p 0 and ∆p 1 parameters can be determined by the difference in the calibration parameters obtained with D − s and D + s decays. A high-purity sample of D − s → φ(→ K + K − )π − candidates is selected in a sample corresponding to 3 fb −1 of data taken at centre-of-mass energies of 7 and 8 TeV by applying the following criteria. The momenta of the final-state particles must be larger than 2 GeV/c and their transverse momenta larger than 250 MeV/c. The tracks must be significantly displaced from the primary vertex. Their associated particle type information is required to be consistent with a kaon or a pion, as appropriate. The K + K − invariant mass must be within 7 MeV/c 2 of the known φ mass. The φ and the D − s reconstructed vertices must be of good quality. The momentum vector of the D − s candidate must be consistent with the displacement vector between the primary vertex and the D − s decay vertex. Only candidates with a reconstructed D − s mass in the range 1920-2040 MeV/c 2 are considered. The resulting D − s mass distribution is fitted by a sum of two Gaussian functions with a common mean to describe the signal component, and an exponential function for the combinatorial background (Fig. 6). In total about 784,000 signal candidates are reconstructed with a background fraction below 5%.
A systematic uncertainty is computed by taking the maximum of the differences seen when comparing these calibration parameters and those obtained by weighting the transverse momentum distribution of the D − s candidates to match the following B 0 s decay modes: These uncertainties are 0.0030 and 0.040 for ∆p 0 and ∆p 1 respectively, and 0.66% for ∆ε tag . The same procedure is applied to assess the systematic uncertainty associated with the different track multiplicity distribution between D + s and B 0 s decays (0.0002 and 0.020 for ∆p 0 and ∆p 1 respectively, and 0.15% for ∆ε tag ). The systematic uncertainty in Eq. 11 is the sum in quadrature of these two sources of uncertainties.
While the shift of the slope parameter ∆p 1 is compatible with zero, there is a significant overall shift, ∆p 0 , of about 1.6% towards higher mistag rates for B 0 s particles. This can be explained by the higher interaction rate in matter of K − particles compared to K + particles. These values are consistent with results obtained in simulated samples of B 0 s → D − s π + and B 0 s → J/ψ φ decays. The B * s2 (5840) 0 decays can also be used to measure the values of ∆p 0 , ∆p 1 and ∆ε tag . The B * s2 (5840) 0 candidates are split into two samples according to the final-state charges, B + K − and B − K + , and the calibration described in Sect. 5 is performed in the two samples. The differences of the calibration parameters between B * s2 (5840) 0 and B * s2 (5840) 0 are ∆p 0 = −0.01±0.02 (stat) and ∆p 1 = −0.4±0.2 (stat), and ∆ε tag = (−1.4±1.3 (stat))%. They are compatible with the shifts measured in the prompt D − s meson sample.

Calibration summary
The final calibration parameters are computed as the weighted average of the results obtained in B 0 s → D − s π + and B * s2 (5840) 0 → B + K − decays, fixing η = 0.4377 and considering the systematic uncertainties reported in Tables 1 and 2 to be uncorrelated. The uncertainties relating to the portability of the calibrations to different B 0 s decays as reported in Table 3

Possible application to OS kaons
The two-step neural-network approach of the SSK tagging algorithm presented here is a promising method for improving any tagging algorithm which needs to combine information from multiple tagging tracks. A natural candidate for the application of this method is the OS kaon tagging algorithm, which searches for kaons from b → c → s transitions of the OS b hadron. The current implementation of the OS kaon algorithm selects tracks with large impact parameters with respect to the primary vertex associated with the signal B meson [6]. This selection gives a tagging efficiency of about 15%. A preliminary implementation of a neural-network-based algorithm shows that loosening the impact parameter requirements for the track candidates and using the new approach increases the tagging efficiency to about 70% and significantly improves the effective tagging efficiency of B + and B 0 mesons. However, the inclusion of kaons with smaller impact parameters results in up to 10% of the signal fragmentation tracks being assigned as OS kaon candidates. As the correlation of signal fragmentation kaons with the signal B flavour is different for B + , B 0 and B 0 s mesons, this contamination of SS kaon tracks introduces a dependence of the calibration parameters on the B meson species, and the gain in tagging performance observed in B + and B 0 is not reproduced in B 0 s mesons.

Conclusion
A new algorithm for the determination of the flavour of B 0 s mesons at production has been presented. The algorithm is based on two neural networks, the first trained to select charged kaons produced in association with the B 0 s meson, and the second to combine the kaon charges to assign the B 0 s flavour, and to estimate the probability of an incorrect flavour assignment. The algorithm is calibrated with data corresponding to an integrated luminosity of 3 fb −1 collected by the LHCb experiment in proton-proton collisions at 7 and 8 TeV centre-of-mass energies. The calibration is performed in two ways: by resolving the B 0 s -B 0 s flavour oscillations in B 0 s → D − s π + decays, and, for the first time, by analysing flavour-specific B * s2 (5840) 0 → B + K − strong decays. The tagging power of the new algorithm as measured in B 0 s → D − s π + decays is (1.80 ± 0.19 (stat) ± 0.18 (syst))%, a significant improvement over the tagging power of 1.2% of the previous implementation used at the LHCb experiment. This new algorithm represents important progress for many analyses aiming to make high-precision measurements of B 0 s -B 0 s mixing and CP asymmetries of B 0 s decays. Its performance has been demonstrated in several recent measurements by the LHCb collaboration [2,3,[29][30][31]].