Optimum preamplification and shaping of signals delivered by photodetectors without internal amplification: a theoretical analysis