Time-gated photon counting method for two-photon spectroscopy using synchrotron radiation and laser