Schematic of an electron gun. The two cells form a resonant microwave cavity filled by radio-frequency (rf) power from a klystron tube. The photocathode emits electrons when illuminated by a laser pulse. The strong rf electric field on the cathode surface immediately accelerates and redirects the electrons. The field reverses polarity by the time they reach the second cell of the gun for additional acceleration. A pair of focusing solenoid magnets (not shown) surround the gun. The same aperture provides the exit for the electrons and the entrance for the laser light.