  We report the development of a multileaf collimator (MLC) for charged
particle beams, based on independently actuated tungsten strips which can
selectively scatter unwanted particles. The MLC is used in conjunction with an
emittance exchange beamline to rapidly generate highly variable longitudinal
bunch profiles. The developed MLC consists of 40 independent leaves that are 2
mm wide and can move up to 10 mm, and operates in an ultra high vacuum
environment, enabled by novel features such as magnetically coupled actuation.
An experiment at the Argonne Wakefield Accelerator, which previously used
inflexible, laser-cut masks for beam shaping before an emittance exchange
beamline, was conducted to test functionality. The experiment demonstrated
myriad transverse mask silhouettes, as measured on a scintillator downstream of
the MLC and the corresponding longitudinal profiles after emittance exchange,
as measured using a transverse deflecting cavity. Rapidly changing between mask
shapes enables expeditious execution of various experiments without the
downtime associated with traditional methods. The many degrees of freedom of
the MLC can enable optimization of experimental figures of merit using
feed-forward control and advanced machine learning methods.
