  A search for W' bosons decaying to a top and a bottom quark in final states
including an electron or a muon is performed with the CMS detector at the LHC.
The analyzed data correspond to an integrated luminosity of 138 fb$^{-1}$ of
proton-proton collisions at a center-of-mass energy of 13 Tev. Good agreement
with the standard model expectation is observed and no evidence for the
existence of the W' boson is found over the mass range examined. The largest
observed deviation from the standard model expectation is found for a W' boson
mass ($m_\mathrm{W'}$) hypothesis of 3.8 TeV with a relative decay width of 1%,
with a local (global) significance of 2.6 (2.0) standard deviations. Upper
limits on the production cross sections of W' bosons decaying to a top and a
bottom quark are set. Left- and right-handed W' bosons with $m_\mathrm{W'}$
below 3.9 and 4.3 TeV, respectively, are excluded at the 95% confidence level,
under the assumption that the new particle has a narrow decay width. Limits are
also set for relative decay widths up to 30%.
