compute score of a spectrum