Physics of Single Photon Avalanche Detectors With Built-In Self-Quenching and Self-Recovering Capabilities