The photon-avalanche effect: review, model and application