Abstract: A method and apparatus are provided. The method includes selectively supplying a neutralizing gas to a position on a trajectory of an ion beam between an extraction electrode system and an analysis slit based on a composition of a dopant gas introduced into an ion source that produces the ion beam. The apparatus includes the ion source, the extraction electrode system, the analysis slit, and a gas supply system that selectively supplies the neutralizing gas to the position on the trajectory.