The mass spectrometer ionizes molecules and produces a mass spectrum from the fragment distribution. It performs three functions: ionization of molecules or atoms, separation of the ion fragments, and detection of ions. In electron ionization, a common ionization method, a vaporized sample in the ionization chamber bombarded with a high-energy electron beam produces radical cations. The radical cation quickly fragments into neutral molecules, radicals, and cations. The cations are then accelerated into an analyzing chamber by a series of negatively charged accelerator plates. Many common analyzers apply a magnetic or electrical field to the analyzing chamber, which bends the trajectories of ions based on their mass and charge. Only ions of particular m/z values have the exact trajectory to pass through the narrow slit placed in front of the ion detector for a given magnetic or electrical field. By altering the field, the mass analyzer scans through a range of ion masses, with their abundances recorded in the mass spectrum.