You can heat the wafer to redistribute more nomrally using diffusion after this. As seen below:

The more energy the ions have, the deeper they go.

The Machine

The analyser magnet bends the target ion by 90 degrees. The idea being that ions that are too heavy will bend too slow, overshoot and miss the slit, and the ions that are too light will bend too much, undershoot and miss the slit.