1 #ifndef PhysicsTools_PatUtils_interface_PFMuonSelector_h
2 #define PhysicsTools_PatUtils_interface_PFMuonSelector_h
31 if ( versionStr ==
"SPRING11" ) {
35 throw cms::Exception(
"InvalidInput") <<
"Expect version to be one of SPRING11" << std::endl;
47 if ( parameters.
exists(
"cutsToIgnore") )
58 int nValidMuonHits = 0,
71 push_back(
"nMatchedStations", minNMatches);
79 set(
"nMatchedStations");
107 double norm_chi2 = 9999999.0;
110 double corr_d0 = 999999.0;
115 int nValidMuonHits = 0;
117 nValidMuonHits = static_cast<int> (muon.
globalTrack()->hitPattern().numberOfValidMuonHits());
122 double pt = muon.
pt() ;
124 double pfIso = (chIso + nhIso + gIso) / pt;
128 nPixelHits = muon.
innerTrack()->hitPattern().pixelLayersWithMeasurement();
double normChi2() const
Norm chi2 gives the normalized chi2 of the global track.
T getParameter(std::string const &) const
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
unsigned int numberOfValidHits() const
numberOfValidHits returns the number of valid hits on the global track.
reco::TrackRef innerTrack() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
bool operator()(const pat::Muon &muon, pat::strbitset &ret)
This provides the interface for base classes to select objects.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
pat::strbitset::index_type index_type
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)
void setIgnored(pat::strbitset &ret)
set ignored bits
pat::strbitset retInternal_
internal ret if users don't care about return bits
index_type indexStations_
index_type indexNValMuHits_
bool isNonnull() const
Checks for non-null.
pat::strbitset bits_
the bitset indexed by strings
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
PFMuonSelector(edm::ParameterSet const ¶meters)
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Functor that operates on <T>
double dB(IpType type=None) const
reco::TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon) ...
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
float userIsolation(IsolationKeys key) const
strbitset & set(bool val=true)
set method of all bits
bool spring11Cuts(const pat::Muon &muon, pat::strbitset &ret)
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
virtual float pt() const GCC11_FINAL
transverse momentum
Analysis-level muon class.
int cut(index_type const &i, int val) const
Access the int cut values at index "s".