  The mass of the top quark is measured using a sample of
$\mathrm{t\overline{t}}$ events collected by the CMS detector using
proton-proton collisions at $\sqrt{s} =$ 13 TeV at the CERN LHC. Events are
selected with one isolated muon or electron and at least four jets from data
corresponding to an integrated luminosity of 35.9 fb$^{-1}$. For each event the
mass is reconstructed from a kinematic fit of the decay products to a
$\mathrm{t\overline{t}}$ hypothesis. Using the ideogram method, the top quark
mass is determined simultaneously with an overall jet energy scale factor
(JSF), constrained by the mass of the W boson in $\mathrm{q\overline{q}'}$
decays. The measurement is calibrated on samples simulated at next-to-leading
order matched to a leading-order parton shower. The top quark mass is found to
be 172.25 $\pm$ 0.08 (stat+JSF) $\pm$ 0.62 (syst) GeV. The dependence of this
result on the kinematic properties of the event is studied and compared to
predictions of different models of $\mathrm{t\overline{t}}$ production, and no
indications of a bias in the measurements are observed.
