It is not a clear question, but i can give the following answers:
1- If you want to have results from each energy separately, you need to execute your program separately for 50 energies.!
2- If you want to execute your program for 50 different energies simultaneously, you can define more than one energy in the primary generator action class (it is easier to use GPS class for defining the source). Then, the results from different energies are mixed together. It means that the results are due to particles emitted with different 50 energies.
3- Probably the parallel examples in Geant4 examples help you (examples/extended/parallel)
I think a better way is write a macro with all the energies like
/gun/energy xx keV
/run/beamOn
......
and saving the terminal output in a output.log file so that you can see the results in one output file. This can be easily done using the following command in terminal
./ macro.mac | tee output.log
You can also use loops and a good description about how to use them is available at