Generating Functions Of Tandem Mass Spectra And Their Applications For Peptide Identifications