  Locating the centers of dark matter halos is critical for understanding the
mass profiles of halos as well as the formation and evolution of the massive
galaxies that they host. The task is observationally challenging because we
cannot observe halos directly, and tracers such as bright galaxies or X-ray
emission from hot plasma are imperfect. In this paper we quantify the
consequences of miscentering on the weak lensing signal from a sample of 129
X-ray selected galaxy groups in the COSMOS field with redshifts 0<z<1 and halo
masses in the range 10^13 - 10^14 M_sun. By measuring the stacked lensing
signal around eight different candidate centers (such as the brightest member
galaxy, the mean position of all member galaxies, or the X-ray centroid), we
determine which candidates best trace the center of mass in halos. In this
sample of groups, we find that massive galaxies near the X-ray centroids trace
the center of mass to <~75 kpc, while the X-ray position and centroids based on
the mean position of member galaxies have larger offsets primarily due to the
statistical uncertainties in their positions (typically ~50-150 kpc).
Approximately 30% of groups in our sample have ambiguous centers with multiple
bright or massive galaxies, and these groups show disturbed mass profiles that
are not well fit by standard models, suggesting that they are merging systems.
We find that halo mass estimates from stacked weak lensing can be biased low by
5-30% if inaccurate centers are used and the issue of miscentering is not
addressed.
