Modified generate_events to compile DetectorInteraction