Integrated Quenching-and-Reset Circuit for Single-Photon Avalanche Diodes