Precision measurement of the structure of the CMS inner tracking system using nuclear interactions