How to reset an atom after a photon detection: Applications to photon-counting processes | Synapse