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

fix how HLTDeDxFilter fills TriggerFilterObjectWithRefs output product [13_0_X] #42002

Merged
merged 1 commit into from
Jun 22, 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
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