Muon Isolation

Complete: 4


Slava Krutelyov (


  • develop algorithms to define muon isolation quantities using calorimeters, tracker tracks, etc. for different types of muon candidates (standalone muons, global muons, etc.)
  • define resulting object(s) to be stored
  • provide algorithms which can be used for offline and HLT
  • validate and optimize the performance of these algorithms

Status and introduction

Isolation of a muon is done relative to measurements in the detector (tracks, calorimeter towers and hits) that can be viewed as a swarm of other objects. Isolation of a muon relative to a list of other objects is not a trivial task in general. Highly flexible methods are provided in the CMSSW (>=1_5_0) together with the configurations which are run by the standard reconstruction with outputs stored in the event record. The outputs of these methods are intended to be flexible enough to suite most analysis purposes.

The following data can be obtained from the event record

  • Sum-pt and n-track, sum-et in hcal, ecal and outer-cal (ho) in cones of dR = √(dφ^2 + dη^2) = 0.3 and 0.5 around the muon trajectory can be obtained in reco::Muon.
  • A list of track-pt or tower et separately in hcal, ho, ecal (called deposits below) with their directions relative to the muon are available in the objects of IsoDeposit type.
    • These objects are stored in the event record as associations (MuIsoDepositAssociationMap in CMSSW_1_6_X, IsoDepositMap in >=2_0_X).
    • Easy access to the IsoDeposits is provided by PAT: use pat::Muon::isoDeposit(key). It is a recommended way to access IsoDeposits associated to muons.
    • Based on the content stored in IsoDeposit it is possible to recalculate nearly any quantity related to (pt,eta,phi) of the deposits around the muon: sum in a different cone (or even a rectangle, solid angle, or a combination of them), count above threshold, all the above relative to a different direction, remove (veto) any of the deposits based on their direction.
    • You can get a sumPt by simply calling deposit.depositWithin(0.3);//sum of deposits in cone 0.3.

SHORT DESCRIPTION OF CUTS AND SELECTION USED IN THE CODE IS GIVEN in this not well-formatted text. Documentation note is currently in development: it is available in cvs.

Frequently Asked Questions (FAQs)

A collection of Q&A spread over private emails/IM and hypernews is available at MuonIsolationFAQs page.

CMSSW packages (doxygen documentation)

Other than the automatically generated doxygen documentation [links above], see examples below.

Suggested cuts

In its simplest form, requirements on isolation can be:
  • For tracker
    • trackIso = sumPt < 3 GeV in a cone of radius 0.3 around the muon will give a 96.7 \pm 0.7 % efficiency for isolated muons from W or Z decays with about a factor of 10 rejection of muon candidates reconstructed in QCD events.
      • You might want to require chi2/ndof < 10, nTrackerHits > 10 as a quality cut on reconstructed muon (applied to a global muon, this cut allows to suppress fake muons from K/pi). See more details in CMS-AN2008/098.
  • For the calorimeters
    • caloIso = sumEtHcal+sumEtEcal < 5 GeV in the cone of 0.3.

The cuts above are given only as a guideline for a fairly loose isolation requirement for muons from electroweak (W/Z and alike) kind of sources. If desired, further background reduction can be achieved by tightening the above cuts: either reduce the value of the cut or apply a cut on the relative isolation relIso = (trackIso+caloIso)/muonPt < x, which allows to effectively suppress backgrounds with softer spectrum than the signal muons. The optimal isolation selection is specific to each particular analysis.

Examples of access to isolation

A standard set of isolation information is provided in the reco::Muon as well as (Mu)IsoDeposits associated to muons in the event by the standard reconstruction. In general there is no need to recalculate them (re-run producers).

For many analyses sums in cones 0.3 and 0.5 available as reco::Muon::getIsolationR03,05().{sumPt, emEt, hadEt, hoEt, nTracks} are enough to perform muon isolation relative to tracks or calorimeter measurements.

Access to Isolation using IsoDeposit maps

If the isolation sums stored in the reco::Muon do not satisfy your needs and you do not have access to PAT muons, please select the following link to display information on how to access the IsoDeposit maps stored in RECO/AOD by the standard muon reconstruction sequence. Show... Hide

Framework-based code

The names of collections used in the examples below can also be found at SWGuideDataFormatRecoMuon. Note: in CMSSW_1_6_X the collection names (to cover global and trackerMuon collections) are in the form muGlobalIsoXXX or muTrackerIsoXXX.
  • The easiest to pick up some examples of the code is to search for IsoDeposit in lxr something like this
  • HCAL Example (provided by Evelyne Delmeire). The config-file part is only needed in <CMSSW_1_5_0. For post-CMSSW_1_6_0_pre5 releases check/change the names following the above note.
  • Example using CAL and tracker (applicable as the above one, with additions from Dmitry Hits). This example also includes some more fancy access to IsoDeposit methods (like getting a track count).
  • is meant to be an up-to-date example code in >=20X. Mind the typo in the default value of hcal iso deposit: modify based on this cvs diff to fix.


f = new TFile("isoTest.root");
e = (TTree*)f->Get("Events");
// e.g., muonEnergy() == sumEt close to a muon (r<0.1 for hcal).
e->Draw("hcaldep.muonEnergy()", "abs(hcaldep.direction().eta())<1.", "");
// e.g., depositWithin(0.4) == sumEt in dR<0.4, excluding deposit from a muon.
e->Draw("hcaldep.depositWithin(0.4)", "abs(hcaldep.direction().eta())<1.", "");
Note that collection names change (as detailed above).

More examples, in particular how to re-run producers of IsoDeposits can be found at CMS.MuonIsolation page

Release-specific notes

Select the following link to show information for cases when you are migrating from CMSSW 1_6_X to 2_X_Y or later version, or need to access isolation in CMSSW_1_6_X. Show... Hide

Notes specific to CMSSW_1_6_X

Note (also mentioned above): the collection names change here. Instead of muIsoXXX there are muGlobalIsoXXX and muTrackerIsoXXX for globalMuons and trackerMuons respectively. Please correct your InputTags accordingly.

Instructions specific to migration from CMSSW_1_6_X to >= CMSSW_2_0_0_pre4

Several major changes to code infrastructure have been made. If you had your code reading MuIsoDeposit association in previous versions, you will now need to make some changes:
  • reco::MuIsoDeposit --> reco::IsoDeposit
    • instead of "DataFormats/MuonReco/interface/MuIsoDeposit.h" and "DataFormats/MuonReco/interface/MuIsoDepositFwd.h" use files from RecoCandidate
      • replace in include: MuonReco/interface/MuIso --> RecoCandidate/interface/Iso
  • The new IsoDeposit is now stored in a edm::ValueMap container. The basic access stays the same, one can still do myValueMap[muRef].

To remake IsoDeposits in >=CMSSW_3_4_X

To (re)reconstruct muon IsoDeposits in versions >= CMSSW_3_4_0 in case a new set is needed, do the following
  • addpkg RecoMuon/MuonIsolationProducers
  • comment out the line with Copies_cff and uncomment 3 lines following #the default set of modules first
  • The remaining is the same as what had to be done to remake isodeposits starting from CMSSW_1_5_X, in your config file


  • Physics TDR vol. I, section 9.3.
  • DAQ TDR (2002): section 15.3.2; reference: CMS NOTE 2002-040 and in the HLT TDR.

Status Talks

Show older status talks ... Hide

Review status

Reviewer/Editor and Date (copy from screen) Comments
KatiLassilaPerini - 11 May 2007 moved from MuonIsolation
VyacheslavKrutelyov - 23 July 2007 clean-up, update up to 160pre5
VyacheslavKrutelyov - 23 Feb 2009 clean-up, update up to >= 22X

Responsible: SlavaKrutelyov
Last reviewed by: SlavaValuev - 16 Mar 2009

Edit | Attach | Watch | Print version | History: r19 < r18 < r17 < r16 < r15 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r19 - 2010-03-10 - MonikaJindal

    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback