CMS is one of the detectors of the 4 experiments (in addition to Alice, Atlas and LHCb) currently taking data at the LHC, the CERN protons collider near Geneva. CMS is located at point 5 of the LHC Collider.
To measure the energy of the particles one uses a magnetic field all the more powerful that the particles are energetic.