Versatile electrostatic trap