Detector simulation