To plot stopping power vs Energy

Hii, I’m a beginner and trying to learn Geant4. I’m trying to simulate a proton of Energy 10GeV passing through air or water and wants to get plot of stopping power Vs Range and Stopping Power Vs Energy. I’m using Scintillator detector to detect the particle. I’m confused how to implement different physics processes to get that.
I would appreciate any guidance how to achieve these. Let me know if you need more information from me.

Hi, you can define a dummy surface and make simulation for several positions of the dummy surface, getting the beam energy at the exit of the dummy surface.
You will fit (gaussian fit) the beam energy at the exit of the dummy surface getting the means.
Then you can fit (linear function) the means as a function of the starting energy of the beam. The slope is the energy loss.