Move the MET study into function

Clean up the code by moving all the MET study filling into two functions
Merge branch 'HTBin' of github.com:zhenbinwu/CMSUpgrade into HTBin