Flat beams and application to the mass separation of radioactive beams