Characterization of HPGe gamma spectrometers by geant4 Monte Carlo simulations