Reproduction of true energy spectrum of charged particles with Monte Carlo method