Added klm quality cut. Implemented IDmom() global utility function.