Improvement of the characterization of the proton source for the European Spallation Source by means of optical emission spectroscopy