1 #ifndef PhysicsTools_PatUtils_interface_PFMuonSelector_h
2 #define PhysicsTools_PatUtils_interface_PFMuonSelector_h
40 if ( versionStr ==
"TOPPAG12_LJETS" ) {
44 throw cms::Exception(
"InvalidInput") <<
"Expect version to be one of SPRING11" << std::endl;
56 if ( parameters.
exists(
"cutsToIgnore") )
65 int minTrackerLayers = 6,
66 int minValidMuonHits = 1,
78 push_back(
"minTrackerLayers", minTrackerLayers);
79 push_back(
"minValidMuHits", minValidMuonHits );
82 push_back(
"minMatchedStations", minNMatches);
88 set(
"minTrackerLayers");
89 set(
"minValidMuHits");
92 set(
"minMatchedStations");
105 set(
"TrackerMuon",
false);
128 double norm_chi2 = 9999999.0;
129 int minTrackerLayers = 0;
130 int minValidMuonHits = 0;
132 int minPixelHits = 0;
135 minTrackerLayers =
static_cast<int> (muon.
track()->hitPattern().trackerLayersWithMeasurement());
136 minValidMuonHits =
static_cast<int> (muon.
globalTrack()->hitPattern().numberOfValidMuonHits());
138 minPixelHits = muon.
innerTrack()->hitPattern().numberOfValidPixelHits();
146 double pt = muon.
pt() ;
148 double pfIso = (chIso + nhIso + gIso) / pt;
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.
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.
PFMuonSelector(edm::ParameterSet const ¶meters, edm::ConsumesCollector &&iC)
bool isTrackerMuon() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool isGlobalMuon() const
pat::strbitset::index_type index_type
void setIgnored(pat::strbitset &ret)
set ignored bits
pat::strbitset retInternal_
internal ret if users don't care about return bits
bool TopPag12LjetsCuts(const pat::Muon &muon, pat::strbitset &ret)
index_type indexStations_
bool isNonnull() const
Checks for non-null.
index_type indexminValidMuHits_
pat::strbitset bits_
the bitset indexed by strings
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
void initialize(Version_t version, double chi2=10.0, int minTrackerLayers=6, int minValidMuonHits=1, double maxIp=0.2, int minPixelHits=1, int minNMatches=2, double pfiso=0.12)
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.
index_type indexMinTrackerLayers_
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
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
index_type indexmaxPfRelIso_
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.
reco::TrackRef track() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
int cut(index_type const &i, int val) const
Access the int cut values at index "s".