Offline calibrations and performance of the CMS pixel detector