Pre-launch characterization of the spectrometer of Hard X-ray Imager (HXI) onboard the ASO-S mission. (1st May 2022)