Simulation of a MassSpectrometer