calculate the number of photons received by the detector.