CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

pat::MuonSelector Class Reference

Selects good muons. More...

#include <PhysicsTools/PatUtils/MuonSelector.h>

List of all members.

Public Member Functions

const pat::ParticleStatus filter (const unsigned int &index, const edm::View< reco::Muon > &muons) const
 MuonSelector (const MuonSelection &cfg)
 ~MuonSelector ()

Private Member Functions

const pat::ParticleStatus customSelection_ (const unsigned int &index, const edm::View< reco::Muon > &muons) const
 Full-fledged selection based on SusyAnalyser.
const pat::ParticleStatus muIdSelection_ (const unsigned int &index, const edm::View< reco::Muon > &muons) const

Private Attributes

MuonSelection config_

Detailed Description

Selects good muons.

The muon selector returns a flag (see pat::ParticleStatus) based on one of the possible selections: reconstruction-based (global muons) or muId based (various algorithms), or custom (user-defined set of cuts). This is driven by the configuration parameters (see the PATMuonCleaner documentation for configuration details).

The parameters are passed to the selector through an MuonSelection struct. (An adapter exists for use in CMSSW: reco::modules::ParameterAdapter< pat::MuonSelector >.)

Author:
F.J. Ronga (ETH Zurich)
Version:
Id:
MuonSelector.h,v 1.8 2009/04/01 18:18:53 hegner Exp

Definition at line 50 of file MuonSelector.h.


Constructor & Destructor Documentation

pat::MuonSelector::MuonSelector ( const MuonSelection cfg) [inline]

Definition at line 54 of file MuonSelector.h.

: config_( cfg ) {}
pat::MuonSelector::~MuonSelector ( ) [inline]

Definition at line 55 of file MuonSelector.h.

{}

Member Function Documentation

const pat::ParticleStatus MuonSelector::customSelection_ ( const unsigned int &  index,
const edm::View< reco::Muon > &  muons 
) const [private]

Full-fledged selection based on SusyAnalyser.

Definition at line 43 of file MuonSelector.cc.

References pat::BAD, pat::GOOD, and getHLTprescales::index.

{

  // Custom muon selection from SusyAnalyzer (TQAF has a subset of these cuts)

  // Use global muon if possible
  TrackRef muontrack;
  if ( muons[index].isGlobalMuon() )
    muontrack = muons[index].track();
  else
    muontrack = muons[index].combinedMuon();

  float pt_track  = muontrack->pt();
  float dpt_track = muontrack->error(0)/muontrack->qoverp()*muontrack->pt();
  float chisq     = muontrack->normalizedChi2();
  int nHitsValid  = muontrack->numberOfValidHits();

  if ( dpt_track >= config_.dPbyPmax * pt_track ) return BAD;
  
  if ( chisq > config_.chi2max ) return BAD;

  if ( nHitsValid < config_.nHitsMin ) return BAD;

  return GOOD;

}
const pat::ParticleStatus pat::MuonSelector::filter ( const unsigned int &  index,
const edm::View< reco::Muon > &  muons 
) const

Returns 0 if muon matches criteria, a flag otherwise. Criteria depend on the selector's configuration.

const pat::ParticleStatus MuonSelector::muIdSelection_ ( const unsigned int &  index,
const edm::View< reco::Muon > &  muons 
) const [private]

Definition at line 74 of file MuonSelector.cc.

References pat::BAD, muon::caloCompatibility(), pat::GOOD, muon::isGoodMuon(), and muon::segmentCompatibility().

{
  // MuonID algorithm
  if ( muon::isGoodMuon((muons[index]),config_.flag) )
    {
      return BAD;
    }

  // Direct cuts on compatibility
  if (  muons[index].caloCompatibility()    <= config_.minCaloCompatibility
     || muon::segmentCompatibility(muons[index]) <= config_.minSegmentCompatibility )
    {
      return BAD;
    }

  return GOOD;
}

Member Data Documentation

Definition at line 65 of file MuonSelector.h.