A medical apparatus includes: a beam deflector having an electromagnet configured to provide a first magnetic field for deflecting a particle beam; and a current control configured to adjust a current of the electromagnet in correspondence with an energy level associated with an accelerator. A treatment planning method includes: defining control points in a treatment plan; setting up energy switching in one or more of the control points; and performing treatment optimization on the treatment plan based at least in part on the energy switching that is set up in the one or more of the control points. The medical apparatus also includes an energy adjuster configured to adjust the treatment energy so that the treatment energy has a first energy level when the beam output is at the first gantry angle, and a second energy level when the beam output is at the first gantry angle.