Study and Design of Magnet System for Linacs