Measurement and simulation of the background in the CMS muon detectors