Determination of jet energy calibration and transverse momentum resolution in CMS