Device and method for optimizing diffusion section of electron beam