Simulation of X-ray spectra generated by electron impact on solids