Monolithic integration of detectors and transistors on high-resistivity silicon