Design and test of a particle mass spectrometer (PMS)