Dynamic time-over-threshold method for multi-channel APD based gamma-ray detectors