Doping by irradiation with electromagnetic waves or by particle radiation