Theory of time-resolved resonance scattering