Skip to content

Commit

Permalink
fix how HLTDeDxFilter fills TriggerFilterObjectWithRefs output product
Browse files Browse the repository at this point in the history
  • Loading branch information
missirol committed Jun 18, 2023
1 parent 2f899a2 commit 41d21c4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions RecoTracker/DeDx/plugins/HLTDeDxFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ bool HLTDeDxFilter::hltFilter(edm::Event& iEvent,
iEvent.getByToken(caloTowersToken_, caloTowersHandle);

bool accept = false;
int NTracks = 0;

// early return
if (trackCollection.empty())
Expand All @@ -131,7 +130,6 @@ bool HLTDeDxFilter::hltFilter(edm::Event& iEvent,
reco::TrackRef track = reco::TrackRef(trackCollectionHandle, i);
if (pt[i] > minPT_ && fabs(eta[i]) < maxETA_ && dEdxTrack[track].numberOfMeasurements() > minNOM_ &&
dEdxTrack[track].dEdx() > minDEDx_) {
NTracks++;
if (track->numberOfValidHits() < minNumValidHits_)
continue;
if (track->hitPattern().trackerLayersWithoutMeasurement(reco::HitPattern::MISSING_INNER_HITS) > maxNHitMissIn_)
Expand Down Expand Up @@ -194,10 +192,9 @@ bool HLTDeDxFilter::hltFilter(edm::Event& iEvent,

// put filter object into the Event
if (saveTags()) {
edm::OrphanHandle<RecoChargedCandidateCollection> chargedCandidatesHandle =
iEvent.put(std::move(chargedCandidates));
for (int i = 0; i < NTracks; i++) {
filterproduct.addObject(TriggerMuon, RecoChargedCandidateRef(chargedCandidatesHandle, i));
auto const chargedCandidatesHandle = iEvent.put(std::move(chargedCandidates));
for (unsigned int i = 0; i < chargedCandidatesHandle->size(); ++i) {
filterproduct.addObject(trigger::TriggerMuon, reco::RecoChargedCandidateRef(chargedCandidatesHandle, i));
}
}

Expand Down

0 comments on commit 41d21c4

Please sign in to comment.