  The production of a top quark-antiquark pair in association with a W boson is
measured in proton-proton collisions at a centre-of-mass energy of 13 TeV. The
data recorded by the CMS experiment at the CERN LHC correspond to an integrated
luminosity of 138 fb$^{-1}$. Events with two or three leptons (electrons and
muons) and additional jets are selected. In events with two leptons, a
multiclass neural network is used to distinguish between events from the signal
and background processes. Events with three leptons are categorised based on
the number of jets, number of b-tagged jets, and the lepton charges. An
inclusive production cross section of $868 \pm 40 \, \text{(stat)}\pm 51 \,
\text{(syst) fb}$ is measured. The cross sections of top quark-antiquark pair
production with a W$^+$ and a W$^-$ boson are measured as $553 \pm 30 \,
\text{(stat)} \pm 30 \, \text{(syst) fb}$ and $343 \pm 26 \, \text{(stat)} \pm
25 \, \text{(syst) fb}$, respectively, and thecorresponding ratio of the two
cross sections is found to be $1.61 \pm 0.15 \, \text{(stat)}^{+0.07}_{-0.05}
\, \text{(syst)}$. The results are in agreement with the standard model
predictions within two standard deviations, and represent the most precise
measurements of this production process to date.
