  The solenoid scan is one of the most common methods for the in-situ
measurement of the thermal emittance of a photocathode in an rf photoinjector.
The fringe field of the solenoid overlaps with the gun rf field in quite a
number of photoinjectors, which makes accurate knowledge of the transfer matrix
challenging, thus increases the measurement uncertainty of the thermal
emittance. This paper summarizes two methods that have been used to solve the
overlap issue and explains their deficiencies. Furthermore, we provide a new
method to eliminate the measurement error due to the overlap issue in solenoid
scans. The new method is systematically demonstrated using theoretical
derivations, beam dynamics simulations, and experimental data based on the
photoinjector configurations from three different groups, proving that the
measurement error with the new method is very small and can be ignored in most
of the photoinjector configurations.
