An apparatus includes an accelerator guide and a shielding structure enclosing the accelerator guide. The accelerator guide includes an electron source at a first end, a target at a second end, and a plurality of accelerating cavities coupled in series along a longitudinal axis between the first end and the second end. The accelerator guide has a contour as viewed in the longitudinal axis. The shielding structure has an inner wall surface defining a contour as viewed in the longitudinal axis generally conformal to the contour of the accelerator guide.