Wei's code to produce smear functions for Momentum resolution