Set spectrum as a particle source

hello,
I have the following energy spectrum, my question is how can I use this spectrum as a source

http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/ForApplicationDeveloper/html/GettingStarted/generalParticleSource.html

see also examples/extended/eventgenerator/particleGun : run2
and exgps/macros/README

Thank you all.
It’s helpful