Systematic treatment of the photopeak efficiency