Why you use solenoids in ion source?

Solenoids are not intimately involved in the production of ions, but electromagnets will be used to steer and focus an ion beam.