  The performance of muon tracking, identification, triggering, momentum
resolution, and momentum scale has been studied with the CMS detector at the
LHC using data collected at $\sqrt{s_\mathrm{NN}}$ = 5.02 TeV in proton-proton
(pp) and lead-lead (PbPb) collisions in 2017 and 2018, respectively, and at
$\sqrt{s_\mathrm{NN}}$ = 8.16 TeV in proton-lead (pPb) collisions in 2016. Muon
efficiencies, momentum resolutions, and momentum scales are compared by
focusing on how the muon reconstruction performance varies from relatively
small occupancy pp collisions to the larger occupancies of pPb collisions and,
finally, to the highest track multiplicity PbPb collisions. We find the
efficiencies of muon tracking, identification, and triggering to be above 90%
throughout most of the track multiplicity range. The momentum resolution and
scale are unaffected by the detector occupancy. The excellent muon
reconstruction of the CMS detector enables precision studies across all
available collision systems.
