7.8 Muon Analysis

Complete: 5

Detailed Review status

Goals of this page

This document explains how to get access to muon tracks and associated information available in the event record, which can be used for muon identification purposes as well as analyses. Brief summary of muon reconstruction algorithms and of muon selectors is provided. (See WorkBookSetComputerNode for instructions on how to set up a proper CMSSW computing environment.)

Introduction to muon reconstruction

Muon reconstruction overview:

muonreco.png

The muon reconstruction chain starts with the "local reconstruction". First, hits in DTs, CSCs and RPCs are reconstructed from digitized electronics signals. Hits within each DT and CSC chamber are then matched to form "segments" (track stubs). The production of hits and segments in muon sub-systems is discussed in detail in the tutorial on local muon reconstruction. The reconstruction of the tracks inside the silicon tracker is described in the tutorial on track reconstruction.

Standalone muons

In the offline reconstruction, the segments reconstructed in the muon chambers are used to generate "seeds" consisting of position and direction vectors and an estimate of the muon transverse momentum. These initial estimates are used as seeds for the track fits in the muon system, which are performed using segments and hits from DTs, CSCs and RPCs and are based on the Kalman filter technique. The result is a collection of reco::Track objects reconstructed in the muon spectrometer, which are referred to as "standalone muons". To improve the momentum resolution, a beam-spot constraint can be applied in the fit. Two collections of "standalone muons", with and without the beam-spot constraint, are available in the event record (in both RECO and AOD). A more detailed description of the reconstruction of tracks in the muon system alone can be found in Section 4 of CMS AN 2008/097. A tutorial explaining how to run standalone muon reconstruction and to analyze its results is available at this link.

Global muons

For each standalone muon track, a search for tracks matching it among those reconstructed in the inner tracking system (referred to as "tracker tracks", "inner tracks" or "silicon tracks") is performed, and the best-matching tracker track is selected. For each "tracker track" - "standalone muon" pair, the track fit using all hits in both tracks is performed, again based on the Kalman filter technique. The result is a collection of reco::Track objects referred to as "global muons". More details on the reconstruction of global muons can be found in Section 5 of CMS AN 2008/097.

References to the matching tracker tracks, standalone muon tracks, and global muon tracks are assembled into one single collection of reco::Muon objects described below.

High-pT muons

As the muon traverses the iron yoke, multiple scattering and/or showers can corrupt the measurement of the muon trajectory, so using all available hits in the track fit is not always the best choice. In order to provide improved performance for energetic muons, the global muon track is refitted with different hit content. The results of two alternative global track refits are available in RECO and AOD collections:

  • "Tracker plus the first muon station" (TPFMS) algorithm uses all tracker hits and hits in the innermost muon station containing hits.
  • "Picky muon reconstructor" (PMR) uses all tracker hits and hits in those muon stations which do not appear to contain electromagnetic showers.
These refitted tracks are accessible through TrackToTrackMap's linking to the corresponding global muon track:
Handle <reco::TrackToTrackMap> tevMap;
iEvent.getByLabel("tevMuons", "refit_name", tevMap);
where refit_name can be default (a refit of the global trajectory with all hits), firstHit (TPFMS refit) or picky (PMR refit).

A method for selecting the best refit on a track-by-track basis is also provided, and is illustrated below. This "cocktail" of fits is intended to provide the best performance for high-pT muons in terms of resolution and controlling the non-gaussian tails.

#include "DataFormats/MuonReco/interface/MuonCocktails.h"
[...]
iEvent.getByLabel("tevMuons", "default", tevMapH1);
const reco::TrackToTrackMap tevMap1 = *(tevMapH1.product());
iEvent.getByLabel("tevMuons", "firstHit", tevMapH2);
const reco::TrackToTrackMap tevMap2 = *(tevMapH2.product());
iEvent.getByLabel("tevMuons", "picky", tevMapH3);
const reco::TrackToTrackMap tevMap3 = *(tevMapH3.product());
iEvent.getByLabel(MuonTags_, MuCollection);
const reco::MuonCollection muonC = *(MuCollection.product());

for(imuon = muonC.begin(); imuon != muonC.end(); ++imuon) 
  reco::TrackRef pmcTrack = muon::tevOptimized(*imuon, tevMap1, tevMap2, tevMap3);

An EDProducer, MuonsFromRefitTracksProducer, has been implemented to create reco::MuonCollection out of any of the above tracks, so that the refit muons may be used anywhere a reco::Muon can be (e.g. using View and modules in the PAT, such as CandViewCombiner). For each reco::Muon object in the input collection, the corresponding track is found in the selected refit collection. A clone of the reco::Muon is then stored in the output collection, with its kinematic variables (momentum, charge, vertex) taken from the refit track. The module's use from a python configuration file is illustrated here. After that, PAT modules can be used; e.g.

 # Make dimuons out of the cocktail muons we just made.
 process.cocktailDimuons = cms.EDProducer('CandViewCombiner',
   decay = cms.string('cocktailMuons@+ cocktailMuons@-'),
   cut = cms.string('mass > 110.0')
 )

Tracker muons

An approach complementary to the global-muon reconstruction consists in considering all tracker tracks to be potential muon candidates and in checking this hypothesis by looking for compatible signatures in the calorimeters and in the muon system. Tracker tracks identified as muons by this method are referred to as "tracker muons". A detailed description of the reconstruction of tracker muons can be found in Section 6 of CMS AN 2008/097.

The tracker-muon algorithm is particularly useful for the identification of low-pT muons (with pT of the order of several GeV), which may not leave enough hits in the muon stations for a standalone muon to be reconstructed. The default criteria for tagging a tracker track as "tracker muon" are very loose (in CMSSW_3_X_Y series, every track with p > 2.5 GeV and pT > 0.5 GeV matched with at least one segment in the muon stations is labeled as "tracker muon"), so tracker muons should in general not be used without further requirements. Several sets of such requirements recommended by the muon POG are described in Sections 6-8 of CMS AN 2008/098; the corresponding flags can be retrieved from the reco::Muon object (see WorkBook section on muon ID).

#RPCMu

RPC muons

An approach similar to Tracker Muons is followed to define the RPC Muons: in this case a match is sought between the extrapolated inner track and hits on the RPC muon detectors. A description of the algorithm and the performance measurements is contained in the CMS AN-2012/482 . The effects of including the RPC hits in the global muon reconstruction have also been studied and are described in M.S.Kim, JINST 8 (2013) T03001 . The main twiki page documenting the RPC Muon algorithm is linked HERE .

Calorimeter-based muons

Calorimeter-based muons, or "calo muons" for short, represent a subset of all tracker tracks reconstructed in the event, which includes tracks with energy depositions in the calorimeters compatible with those of a minimum-ionizing particle. The fake rate of these muon candidates is high and they should not be used when muon purity is essential. A typical use case for "calo muons" is the reconstruction of the J/ψ decaying to low-momentum muons that have little or no information in the muon system, thus improving signal to background ratio compared with the inner tracks. In the event record, "calo muons" are stored in a collection of dedicated objects, reco::CaloMuon's.

Available information

The information on various types of muons discussed above is assembled in one single collection of reco::Muon objects, "muons". This collection serves as the main entry point for accessing muon-related information in CMSSW: various quantities are either directly included in the reco::Muon objects, or can be accessed from there via provided references. One exception to this rule is "calo muons", which are stored in a separate collection of reco::CaloMuon objects. The full list of muon collections available in the event record is available in SWGuideDataFormatRecoMuon.

reco::Muon

Full description of the reco::Muon class can be found here: DataFormats/MuonReco/interface/Muon.h.

Brief summary of available information:

  • Methods to check to which category of muon candidates a given reco::Muon object belongs: isStandAloneMuon(), isGlobalMuon(), isTrackerMuon() (isCaloMuon() is currently not used). Note that a single object can belong to more than one category.
  • References to the corresponding reco::Track objects for tracks reconstructed in the inner tracker (tracker track), muon system alone (standalone muon track with a beam-spot constraint), and to a combined tracker-muon fit (global muon track). Refits available for high-pT muons can be accessed through TrackToTrackMap's linking to the global muon track as described above.
  • For tracker muons:
    • Energy depositions in ECAL, HCAL and HO in crossed elements as well as 3x3 shapes around them.
    • Compatibility with muon hypothesis based on energy depositions in calorimeters.
    • Vector of muon segments matched with the extrapolated tracker track and some other track-segments matching information.
  • Summary of muon isolation information: sums of pT/ET and numbers of tracks and jets for two cones of dR = √(dφ^2 + dη^2) = 0.3 and 0.5 around the muon trajectory (see below).
  • Identification flags (see below).
  • Timing information (see below).

reco::Muon timing information

Timing information is calculated from information in the DT, CSC and ECAL (RPC timing information is not available for offline at all; efforts to implement HCAL timing are currently under way). Information is stored in reco::MuonTime format. It contains a summary of the combined fit of all subdetector data with two estimates of time at the interaction point and its error, assuming an outside-in or inside-out β=1 particle, plus an estimate of the muon's direction.

More detailed information about muon timing (time, velocity with and without the assumption of the muon being produced in-time, etc.) separated into subsystems is available in a set external products of type reco::MuonTimeExtra linked to the muons via association maps. If necessary, these objects can be regenerated independent of the muon reconstruction chain using the MuonTimingProducer.

For a simple example of accessing all the information, please take a look at MuonTimingValidator.cc in here. For more details on the interpretation of the different quantities and performance in early data, see CMS IN-2010/003.

Muon identification

Detailed information about muon identification and the various selection algorithms can be found in the CMS AN-2008/098 analysis note. There is a detailed accounting of changes made to the tracker-muon-based muon identification algorithms since AN-2008/098 (over 1.5 years ago as of this writing) at SWGuideTrackerMuons. Below is a brief summary.

There are several categories of muon identification algorithms that have been developed:

  • Cut-based ID for global muons, which consists of a set of track-quality requirements
  • Likelihood-based ID for tracker muons, which uses compatibility of the calorimeter response with the muon hypothesis and the presence of matched segments in the muon system
  • Cut-based ID for tracker muons, which selects muons on the basis of the track-penetration depth in the detector

The muon id selection function and selection types exist outside of the reco::Muon object. This means that one should use an external function

bool muon::isGoodMuon( const reco::Muon& muon, muon::SelectionType type )
which returns true if the muon passes the given selection type. The following selection types are available:

namespace muon {
enum SelectionType {
All = 0,                      // dummy options - always true
AllGlobalMuons = 1,           // checks isGlobalMuon flag
AllStandAloneMuons = 2,       // checks isStandAloneMuon flag
AllTrackerMuons = 3,          // checks isTrackerMuon flag
TrackerMuonArbitrated = 4,    // resolve ambiguity of sharing segments
AllArbitrated = 5,            // all muons with the tracker muon arbitrated
GlobalMuonPromptTight = 6,    // global muons with tighter fit requirements
TMLastStationLoose = 7,       // penetration depth loose selector
TMLastStationTight = 8,       // penetration depth tight selector
TM2DCompatibilityLoose = 9,   // likelihood based loose selector
TM2DCompatibilityTight = 10,  // likelihood based tight selector
TMOneStationLoose = 11,       // require one well matched segment
TMOneStationTight = 12,       // require one well matched segment
TMLastStationOptimizedLowPtLoose = 13, // combination of TMLastStation and TMOneStation
TMLastStationOptimizedLowPtTight = 14, // combination of TMLastStation and TMOneStation
GMTkChiCompatibility = 15,    // require tk stub have good chi2 relative to glb track
GMStaChiCompatibility = 16,   // require sta stub have good chi2 compatibility relative to glb track
GMTkKinkTight = 17,           // require a small kink value in the tracker stub
TMLastStationAngLoose = 18,   // TMLastStationLoose with additional angular cuts
TMLastStationAngTight = 19,   // TMLastStationTight with additional angular cuts
TMOneStationAngLoose = 20,    // TMOneStationLoose with additional angular cuts
TMOneStationAngTight = 21,    // TMOneStationTight with additional angular cuts
TMLastStationOptimizedBarrelLowPtLoose = 22, // combination of TMLastStation and TMOneStation with low pT optimization in barrel only
TMLastStationOptimizedBarrelLowPtTight = 23  // combination of TMLastStation and TMOneStation with low pT optimization in barrel only
};
}

The isGoodMuon method and the available selection types are defined in DataFormats/MuonReco/interface/MuonSelectors.h, so one must include this header file to utilize the selectors.

The muon-identification algorithms recommended by the muon POG can be found in SWGuideMuonId. Tracker-muon selectors (TMLastStationLoose, etc.) are described in SWGuideTrackerMuons. GlobalMuonPromptTight consists of the following requirements, designed to suppress hadronic punch-throughs and muons from decays in flight:

muon.isGlobalMuon() && muon.globalTrack()->normalizedChi2() < 10. && muon.globalTrack()->hitPattern().numberOfValidMuonHits() > 0
that is:
  • the track is identified as a global muon
  • χ2/ndof of the global muon fit < 10
  • number of valid muon-detector hits used in the global fit > 0

The following additional track-quality cuts using the tracker-track information are recommended to further suppress non-prompt muons, although they are not explicitly included in the selection types above:

  • Transverse impact parameter of the tracker track (or global muon) relative to the beam spot position, |d0|, < 2 mm. This loose cut preserves efficiency for muons from decays of b and c hadrons.
  • Number of hits in the tracker track, Nhits, > 10.

One can also impose cuts on the last point in the global fit to reject punch-throughs that terminate in the first station of the muon detector:

// barrel region
if ( abs(z) < 660 && r > 400 && r < 480)  keepMuon = false;

// endcap region
if ( abs(z) > 600 && abs(z) < 650 && r < 300)  keepMuon = false; 
if ( abs(z) > 680 && abs(z) < 730 && r < 480)  keepMuon = false; 
This can reduce the fake rate by ~20% with minimal loss in efficiency.

More information can be found in CMS AN 2008/098, in SWGuideTrackerMuons, and in several dedicated talks: "Muons in CMSSW_2_1_X", "Global Muon Selections" and "Summary of the Muon ID Note".

The muon-identification criteria used by the Vector-Boson Task Force of the Electroweak PAG follow closely muon-POG recommendations and can be found here.

Muon isolation

For each muon candidate, a number of quantities is computed that can help to distinguish isolated muons from the muons embedded in jets. The following data can be obtained directly from the reco::Muon class:

  • Scalar sum of pT of all tracks reconstructed in cones of R = 0.3 and 0.5 around the direction of a muon, and the number of such tracks.
  • Scalar sum of transverse energy depositions ET in ECAL, HCAL, and HO in cones of R = 0.3 and 0.5, and the total number of jets in these cones.
Additional information allowing to calculate other isolation-related quantities is stored in the event record as associations (IsoDepositMap); a detailed descripition can be found in SWGuideMuonIsolation.

Muons in missing ET calculations

Muons in Physics Analysis Tools

Examples

The example provided is for FWLite since it allows for quick demonstration of some basic concepts on how to get access to information. The framework side of the code is fairly similar. See SWGuideFWLite for details. Let's assume that you have some collection or local data file that you want to look at. To get a proper path so that FWLite can open the collection one can use EdmFileUtil:

> EdmFileUtil -d /store/mc/2007/10/20/RelVal-RelValTTbar-1192895175/0000
/00C41641-2A81-DC11-B6EA-0019DB29C620.root

dcap://cmsdca3.fnal.gov:24142/pnfs/fnal.gov/usr/cms/WAX/11/store/mc/2007/10/20/
RelVal-RelValTTbar-1192895175/0000/00C41641-2A81-DC11-B6EA-0019DB29C620.root

Now start ROOT in the project area of one of the recent releases and enable Cintex, load FWLite library, enable auto-loading and load the file:

root [0] Cintex::Enable()
root [1] gSystem->Load("libFWCoreFWLite");
root [2] AutoLibraryLoader::enable();
root [3] f = TFile::Open("events.root")

For each muon candidate in the event, let's look at the global-muon pT, inner-track pT, and ECAL energy deposition associated with the candidate:

root [4] Events->Scan("muons.globalTrack().pt():muons.innerTrack().pt():muons.calEnergy().em")
***********************************************************
*    Row   * Instance * muons.p4( * muons.tra * muons.get *
***********************************************************
*        0 *        0 * 26.570809 * 26.387926 * 0.1964492 *
*        1 *        0 * 9.6703965 * 9.6947574 * 5.2962083 *
*        1 *        1 * 25.099496 * 25.039489 * 0.3504051 *

Isolation variables for the muon candidates (e.g., sum of pT's of tracks and sum of ET's for ECAL in a cone of R = 0.5) can be obtained with the following command:

root [5] Events->Scan("muons.isolationR05().sumPt:muons.isolationR05().emEt")
***********************************************
*    Row   * Instance * muons.get * muons.get *
***********************************************
*        0 *        0 *         0 * 4.5468702 *
*        1 *        0 * 16.282365 * 66.035476 *
*        1 *        1 * 7.0197601 * 2.9328436 *

Review status

Reviewer/Editor and Date (copy from screen) Comments
RiccardoBellan - 30 Nov 2006 Added initial info
JennyWilliams - 12 Jan 2006 Added info from very similar page by ChangLiu and remove that page
GianlucaCerminara - 09 Feb 2007 Update to CMSSW_1_2_2
JennyWilliams - 23 Mar 2007 reinstated manual contents for pdf generation
DmytroKovalskyi - 17 Feb 2008 Modified the workbook to include full spectrum of muon information available
MartijnMulders - Feb 2008 Updated in course of documentation review
Main.Aresh - 27 Feb 2008 Changes in verbatim elements because of some lines too long for printable version
PiotrTraczyk - 06 Oct 2008 Updated TeV muon part
MartijnMulders - 07 Oct 2008 Updated muon identification part
SlavaValuev - Feb 2009 Updated in course of documentation review
PiotrTraczyk - 31 Aug 2010 Muon timing part made up-to-date

Responsible: DmytroKovalskyi
Last reviewed by: SlavaValuev - 04 Mar 2009

Topic attachments
I Attachment History Action Size Date WhoSorted ascending Comment
PNGpng muonreco.png r2 r1 manage 5.9 K 2008-02-17 - 07:32 DmytroKovalskyi Muon reconstruction overview
GIFgif MuonReco.gif r2 r1 manage 4.7 K 2006-07-19 - 11:43 NicolaAmapane Schema of the muon local reco
GIFgif res.gif r1 manage 10.2 K 2006-10-09 - 18:28 RiccardoBellan  
GIFgif lastLoose.gif r1 manage 7.7 K 2010-11-12 - 14:13 ShuklaPrashant  

This topic: CMSPublic > CMSCommunicationsGroup > CMSCommunicationsProjects > WebHome > SWGuide > WorkBook > WorkBookMuonAnalysis
Topic revision: r89 - 2014-05-01 - GiovanniAbbiendi
 
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