Cofnod E-bost: Statistical treatment of photon/electron counting; extending the linear dynamic range from the dark count rate to saturation