Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change from numberOfMatches() to segment number in DisplacedMuonFilterProducer #42763

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions PhysicsTools/PatAlgos/plugins/DisplacedMuonFilterProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ void pat::DisplacedMuonFilterProducer::produce(edm::Event& iEvent, const edm::Ev
std::vector<bool> filteredmuons(nMuons, true);
int oMuons = nMuons;

unsigned int nsegments = 0;
for (unsigned int i = 0; i < srcMuons->size(); i++) {
const reco::Muon& muon(srcMuons->at(i));

Expand All @@ -169,9 +170,28 @@ void pat::DisplacedMuonFilterProducer::produce(edm::Event& iEvent, const edm::Ev
oMuons = oMuons - 1;
continue;
}
// Discard STA-only muons below pt threshold
} else if (muon.standAloneMuon()->pt() < minPtSTA_) {
filteredmuons[i] = false;
oMuons = oMuons - 1;
continue;
} else {
// Discard STA-only muons with less than minMatches_ segments and below pt threshold
if (!muon.isMatchesValid() || muon.numberOfMatches() < minMatches_ || muon.standAloneMuon()->pt() < minPtSTA_) {
// Compute number of DT+CSC segments and discard those that have less than the minimum required
nsegments = 0;
for (trackingRecHit_iterator hit = muon.standAloneMuon()->recHitsBegin();
hit != muon.standAloneMuon()->recHitsEnd();
++hit) {
if (!(*hit)->isValid())
continue;
DetId id = (*hit)->geographicalId();
if (id.det() != DetId::Muon)
continue;
if (id.subdetId() == MuonSubdetId::DT || id.subdetId() == MuonSubdetId::CSC) {
nsegments++;
}
}
// Discard STA-only muons with less than minMatches_ segments
if (nsegments < minMatches_) {
filteredmuons[i] = false;
oMuons = oMuons - 1;
continue;
Expand Down