The detailed simulation of the CMS detector