Search for long-lived particles with displaced vertices using the CMS detector at the LHC