A simple simulation of particle detectors