1 #ifndef PhysicsTools_PatUtils_interface_PFMuonSelector_h
2 #define PhysicsTools_PatUtils_interface_PFMuonSelector_h
31 if ( versionStr ==
"TOPPAG12_LJETS" ) {
35 throw cms::Exception(
"InvalidInput") <<
"Expect version to be one of SPRING11" << std::endl;
47 if ( parameters.
exists(
"cutsToIgnore") )
56 int minTrackerLayers = 6,
57 int minValidMuonHits = 1,
69 push_back(
"minTrackerLayers", minTrackerLayers);
70 push_back(
"minValidMuHits", minValidMuonHits );
73 push_back(
"minMatchedStations", minNMatches);
79 set(
"minTrackerLayers");
80 set(
"minValidMuHits");
83 set(
"minMatchedStations");
96 set(
"TrackerMuon",
false);
119 double norm_chi2 = 9999999.0;
120 int minTrackerLayers = 0;
121 int minValidMuonHits = 0;
123 int minPixelHits = 0;
126 minTrackerLayers =
static_cast<int> (muon.
track()->hitPattern().trackerLayersWithMeasurement());
127 minValidMuonHits =
static_cast<int> (muon.
globalTrack()->hitPattern().numberOfValidMuonHits());
129 minPixelHits = muon.
innerTrack()->hitPattern().numberOfValidPixelHits();
137 double pt = muon.
pt() ;
139 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.
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".