  A search for supersymmetry is presented in events with a single charged
lepton, electron or muon, and multiple hadronic jets. The data correspond to an
integrated luminosity of 138 fb$^{-1}$ of proton-proton collisions at a
center-of-mass energy of 13 TeV, recorded by the CMS experiment at the CERN
LHC. The search targets gluino pair production, where the gluinos decay into
final states with the lightest supersymmetric particle (LSP) and either a top
quark-antiquark ($\mathrm{t\bar{t}}$) pair, or a light-flavor quark-antiquark
($\mathrm{q\bar{q}}$) pair and a virtual or on-shell W boson. The main
backgrounds, $\mathrm{t\bar{t}}$ pair and W+jets production, are suppressed by
requirements on the azimuthal angle between the momenta of the lepton and of
its reconstructed parent W boson candidate, and by top quark and W boson
identification based on a machine-learning technique. The number of observed
events is consistent with the expectations from standard model processes.
Limits are evaluated on supersymmetric particle masses in the context of two
simplified models of gluino pair production. Exclusions for gluino masses reach
up to 2120 (2050) GeV at 95% confidence level for a model with gluino decay to
a $\mathrm{t\bar{t}}$ pair (a $\mathrm{q\bar{q}}$ pair and a W boson) and the
LSP. For the same models, limits on the mass of the LSP reach up to 1250 (1070)
GeV.
