Photoeffect spectra in silicon at different states of bulk and surface: I. Theoretical analysis