Made integration of energy spectrum optional (it takes some time)