Algorithm to analyse detector threshold scans