#include <PFMuonSelector.h>
Public Types | |
enum | Version_t { SPRING11, N_VERSIONS } |
Public Member Functions | |
void | initialize (Version_t version, double chi2=10.0, double d0=0.02, int nhits=11, int nValidMuonHits=0, double pfiso=0.15, int minPixelHits=1, int minNMatches=1) |
bool | operator() (const pat::Muon &muon, pat::strbitset &ret) |
This provides the interface for base classes to select objects. | |
PFMuonSelector (edm::ParameterSet const ¶meters) | |
PFMuonSelector () | |
bool | spring11Cuts (const pat::Muon &muon, pat::strbitset &ret) |
Public Attributes | |
bool | verbose_ |
Private Attributes | |
index_type | indexChi2_ |
index_type | indexD0_ |
index_type | indexNHits_ |
index_type | indexNValMuHits_ |
index_type | indexPFIso_ |
index_type | indexPixHits_ |
index_type | indexStations_ |
Version_t | version_ |
Definition at line 13 of file PFMuonSelector.h.
Definition at line 19 of file PFMuonSelector.h.
{ SPRING11, N_VERSIONS };
PFMuonSelector::PFMuonSelector | ( | ) | [inline] |
Definition at line 21 of file PFMuonSelector.h.
{}
PFMuonSelector::PFMuonSelector | ( | edm::ParameterSet const & | parameters | ) | [inline] |
Definition at line 23 of file PFMuonSelector.h.
References Exception, edm::ParameterSet::exists(), Selector< pat::Muon >::getBitTemplate(), edm::ParameterSet::getParameter(), initialize(), N_VERSIONS, Selector< pat::Muon >::retInternal_, Selector< pat::Muon >::setIgnoredCuts(), SPRING11, verbose_, and BeamSplash_cfg::version.
{ verbose_ = false; std::string versionStr = parameters.getParameter<std::string>("version"); Version_t version = N_VERSIONS; if ( versionStr == "SPRING11" ) { version = SPRING11; } else { throw cms::Exception("InvalidInput") << "Expect version to be one of SPRING11" << std::endl; } initialize( version, parameters.getParameter<double>("Chi2"), parameters.getParameter<double>("D0") , parameters.getParameter<int> ("NHits") , parameters.getParameter<int> ("NValMuHits"), parameters.getParameter<double>("PFIso"), parameters.getParameter<int> ("nPixelHits"), parameters.getParameter<int> ("nMatchedStations") ); if ( parameters.exists("cutsToIgnore") ) setIgnoredCuts( parameters.getParameter<std::vector<std::string> >("cutsToIgnore") ); retInternal_ = getBitTemplate(); }
void PFMuonSelector::initialize | ( | Version_t | version, |
double | chi2 = 10.0 , |
||
double | d0 = 0.02 , |
||
int | nhits = 11 , |
||
int | nValidMuonHits = 0 , |
||
double | pfiso = 0.15 , |
||
int | minPixelHits = 1 , |
||
int | minNMatches = 1 |
||
) | [inline] |
Definition at line 54 of file PFMuonSelector.h.
References Selector< pat::Muon >::bits_, indexChi2_, indexD0_, indexNHits_, indexNValMuHits_, indexPFIso_, indexPixHits_, indexStations_, Selector< pat::Muon >::push_back(), BeamSplash_cfg::version, and version_.
Referenced by PFMuonSelector().
{ version_ = version; push_back("Chi2", chi2 ); push_back("D0", d0 ); push_back("NHits", nhits ); push_back("NValMuHits",nValidMuonHits ); push_back("PFIso", pfiso ); push_back("nPixelHits",minPixelHits); push_back("nMatchedStations", minNMatches); set("Chi2"); set("D0"); set("NHits"); set("NValMuHits"); set("PFIso"); set("nPixelHits"); set("nMatchedStations"); indexChi2_ = index_type(&bits_, "Chi2" ); indexD0_ = index_type(&bits_, "D0" ); indexNHits_ = index_type(&bits_, "NHits" ); indexNValMuHits_ = index_type(&bits_, "NValMuHits" ); indexPFIso_ = index_type(&bits_, "PFIso" ); indexPixHits_ = index_type(&bits_, "nPixelHits"); indexStations_ = index_type(&bits_, "nMatchedStations"); }
bool PFMuonSelector::operator() | ( | const pat::Muon & | t, |
pat::strbitset & | ret | ||
) | [inline, virtual] |
This provides the interface for base classes to select objects.
Implements Selector< pat::Muon >.
Definition at line 92 of file PFMuonSelector.h.
References SPRING11, spring11Cuts(), and version_.
{ if (version_ == SPRING11 ) return spring11Cuts(muon, ret); else { return false; } }
bool PFMuonSelector::spring11Cuts | ( | const pat::Muon & | muon, |
pat::strbitset & | ret | ||
) | [inline] |
Definition at line 103 of file PFMuonSelector.h.
References Selector< pat::Muon >::cut(), pat::Muon::dB(), pat::Muon::globalTrack(), Selector< pat::Muon >::ignoreCut(), indexChi2_, indexD0_, indexNHits_, indexNValMuHits_, indexPFIso_, indexPixHits_, indexStations_, pat::Muon::innerTrack(), edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), pat::Muon::normChi2(), reco::Muon::numberOfMatches(), pat::Muon::numberOfValidHits(), Selector< pat::Muon >::passCut(), pat::PfChargedHadronIso, pat::PfGammaIso, pat::PfNeutralHadronIso, reco::LeafCandidate::pt(), runTheMatrix::ret, pat::strbitset::set(), Selector< pat::Muon >::setIgnored(), and pat::Lepton< LeptonType >::userIsolation().
Referenced by operator()().
{ ret.set(false); double norm_chi2 = 9999999.0; if ( muon.globalTrack().isNonnull() && muon.globalTrack().isAvailable() ) norm_chi2 = muon.normChi2(); double corr_d0 = 999999.0; if ( muon.globalTrack().isNonnull() && muon.globalTrack().isAvailable() ) corr_d0 = muon.dB(); int nhits = static_cast<int>( muon.numberOfValidHits() ); int nValidMuonHits = 0; if ( muon.globalTrack().isNonnull() && muon.globalTrack().isAvailable() ) nValidMuonHits = static_cast<int> (muon.globalTrack()->hitPattern().numberOfValidMuonHits()); double chIso = muon.userIsolation(pat::PfChargedHadronIso); double nhIso = muon.userIsolation(pat::PfNeutralHadronIso); double gIso = muon.userIsolation(pat::PfGammaIso); double pt = muon.pt() ; double pfIso = (chIso + nhIso + gIso) / pt; int nPixelHits = 0; if ( muon.innerTrack().isNonnull() && muon.innerTrack().isAvailable() ) nPixelHits = muon.innerTrack()->hitPattern().pixelLayersWithMeasurement(); int nMatchedStations = muon.numberOfMatches(); if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ ); if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ ); if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ ); if ( nValidMuonHits> cut(indexNValMuHits_,int()) || ignoreCut(indexNValMuHits_)) passCut(ret, indexNValMuHits_ ); if ( pfIso < cut(indexPFIso_, double()) || ignoreCut(indexPFIso_) ) passCut(ret, indexPFIso_ ); if ( nPixelHits > cut(indexPixHits_,int()) || ignoreCut(indexPixHits_)) passCut(ret, indexPixHits_); if ( nMatchedStations> cut(indexStations_,int()) || ignoreCut(indexStations_)) passCut(ret, indexStations_); setIgnored(ret); return (bool)ret; }
index_type PFMuonSelector::indexChi2_ [private] |
Definition at line 151 of file PFMuonSelector.h.
Referenced by initialize(), and spring11Cuts().
index_type PFMuonSelector::indexD0_ [private] |
Definition at line 152 of file PFMuonSelector.h.
Referenced by initialize(), and spring11Cuts().
index_type PFMuonSelector::indexNHits_ [private] |
Definition at line 153 of file PFMuonSelector.h.
Referenced by initialize(), and spring11Cuts().
index_type PFMuonSelector::indexNValMuHits_ [private] |
Definition at line 154 of file PFMuonSelector.h.
Referenced by initialize(), and spring11Cuts().
index_type PFMuonSelector::indexPFIso_ [private] |
Definition at line 155 of file PFMuonSelector.h.
Referenced by initialize(), and spring11Cuts().
index_type PFMuonSelector::indexPixHits_ [private] |
Definition at line 156 of file PFMuonSelector.h.
Referenced by initialize(), and spring11Cuts().
index_type PFMuonSelector::indexStations_ [private] |
Definition at line 157 of file PFMuonSelector.h.
Referenced by initialize(), and spring11Cuts().
Definition at line 17 of file PFMuonSelector.h.
Referenced by PFMuonSelector().
Version_t PFMuonSelector::version_ [private] |
Definition at line 149 of file PFMuonSelector.h.
Referenced by initialize(), and operator()().