rewrote detectorXYtoGVec to support cuda