  Based on cosmic ray events without a magnetic field taken with the BESIII
detector during the summer shutdown of BEPCII in 2012 and di-muon events from a
data sample taken at center-of-mass energy of 3.686 GeV in 2009, we compare the
coordinates of hits registered in the BESIII muon counter with the expected
interaction point extrapolated from reconstructed tracks from the inner
tracking system in the absence of a magnetic field. By minimizing the
difference, we align the muon counter with the inner tracking system. Moreover,
the strength of the magnetic field in the muon counter is measured for the
first time with di-muon events from data taken at a center-of-mass energy of
3.686~GeV. After the alignment and the magnetic field strength measurement, the
offsets in the reconstructed hit positions for muon tracks are reduced, which
improves the muon identification. The alignment and magnetic field strength
measurement have been adopted in the latest version of the BESIII offline
software system. This addition to the software reduces the systematic
uncertainty for the physics analysis in cases where the muon counter
information is used.
