The energy production rate & the generation spectrum of UHECRs