Skip to content

Commit

Permalink
Preliminar fix to DisplacedMuonFilterProducer
Browse files Browse the repository at this point in the history
  • Loading branch information
24LopezR committed Apr 28, 2023
1 parent 7530dfd commit db1ce80
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion 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 @@ -170,8 +171,22 @@ void pat::DisplacedMuonFilterProducer::produce(edm::Event& iEvent, const edm::Ev
continue;
}
} else {
// Compute number of DT+CSC segments
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 and below pt threshold
if (!muon.isMatchesValid() || muon.numberOfMatches() < minMatches_ || muon.standAloneMuon()->pt() < minPtSTA_) {
if (nsegments < minMatches_ || muon.standAloneMuon()->pt() < minPtSTA_) {
filteredmuons[i] = false;
oMuons = oMuons - 1;
continue;
Expand Down

0 comments on commit db1ce80

Please sign in to comment.