1 #ifndef PhysicsTools_PatUtils_interface_PFMuonSelector_h
2 #define PhysicsTools_PatUtils_interface_PFMuonSelector_h
27 std::string versionStr = parameters.
getParameter<std::string>(
"version");
31 if ( versionStr ==
"TOPPAG12_LJETS" ) {
35 throw cms::Exception(
"InvalidInput") <<
"Expect version to be one of SPRING11" << std::endl;
47 if ( parameters.
exists(
"cutsToIgnore") )
58 int minTrackerLayers = 6,
59 int minValidMuonHits = 1,
71 push_back(
"minTrackerLayers", minTrackerLayers);
72 push_back(
"minValidMuHits", minValidMuonHits );
75 push_back(
"minMatchedStations", minNMatches);
81 set(
"minTrackerLayers");
82 set(
"minValidMuHits");
85 set(
"minMatchedStations");
98 set(
"TrackerMuon",
false);
127 double norm_chi2 = 9999999.0;
128 int minTrackerLayers = 0;
129 int minValidMuonHits = 0;
131 int minPixelHits = 0;
134 minTrackerLayers =
static_cast<int> (muon.
track()->hitPattern().trackerLayersWithMeasurement());
135 minValidMuonHits =
static_cast<int> (muon.
globalTrack()->hitPattern().numberOfValidMuonHits());
137 minPixelHits = muon.
innerTrack()->hitPattern().numberOfValidPixelHits();
148 double pt = muon.
pt() ;
150 double pfIso = ( chIso +
std::max( 0.0, nhIso + gIso - 0.5 * puIso) ) / 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)
const T & max(const T &a, const T &b)
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
virtual double pt() const
transverse momentum
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
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".