We describe a setup for the analysis of secondary ions and neutrals emitted from solid surfaces and two-dimensional materials during irradiation with highly charged ions. The ultrahigh vacuum setup consists of an electron beam ion source to produce bunches of ions with various charge states q (e.g., Xe1+-Xe46+) and thus potential energies, a deceleration/acceleration section to tune the kinetic energy of the ions in the range of 5 keV to 20 × q keV, a sample stage for laser-cleaning and positioning of freestanding as well as supported samples, a pulsed excimer laser for post-ionization of sputtered neutrals, and a reflectron type time-of-flight mass spectrometer, enabling us to analyze mass and velocity distributions of the emitted particles. With our setup, contributions from potential and kinetic energy deposition can be studied independently of each other. Charge dependent experiments conducted at a constant kinetic energy show a clear threshold for the emission of secondary ions from SrTiO3. Data taken with the same projectile charge state, but at a different kinetic energy, reveal a difference in the ratio of emitted particles from MoS2. In addition, first results are presented, demonstrating how velocity distributions can be measured with the new setup.