Vertex reconstruction at the CMS experiment