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") )
66 int minValidMuonHits = 1,
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;
130 int minValidMuonHits = 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;
T getParameter(std::string const &) const
bool operator()(const pat::Muon &muon, pat::strbitset &ret) override
bool isNonnull() const
Checks for non-null.
PFMuonSelector(edm::ParameterSet const ¶meters, edm::ConsumesCollector &&iC)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
double dB(IPTYPE type) const
double pt() const final
transverse momentum
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)
reco::TrackRef track() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
index_type indexStations_
bool isTrackerMuon() const override
index_type indexminValidMuHits_
pat::strbitset bits_
the bitset indexed by strings
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
reco::TrackRef innerTrack() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
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 isGlobalMuon() const override
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>
float userIsolation(IsolationKeys key) const
reco::TrackRef globalTrack() const override
reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon) ...
strbitset & set(bool val=true)
set method of all bits
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
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
double normChi2() const
Norm chi2 gives the normalized chi2 of the global track.
Analysis-level muon class.
int cut(index_type const &i, int val) const
Access the int cut values at index "s".