added function to save histograms with pulseheigth distribution