Skip to content

Commit

Permalink
Update best values _after_ keep check (cms-sw#246)
Browse files Browse the repository at this point in the history
Co-authored-by: bryates <[email protected]>
  • Loading branch information
2 people authored and tomalin committed Dec 29, 2023
1 parent b344d24 commit 1d090a3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions L1Trigger/TrackFindingTracklet/src/MatchProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,6 @@ bool MatchProcessor::matchCalculator(Tracklet* tracklet, const Stub* fpgastub, b

bool imatch = (std::abs(ideltaphi) <= best_ideltaphi_barrel && (ideltaz << dzshift_ < best_ideltaz_barrel) &&
(ideltaz << dzshift_ >= -best_ideltaz_barrel));
// Update the "best" values
if (imatch) {
best_ideltaphi_barrel = std::abs(ideltaphi);
best_ideltaz_barrel = std::abs(ideltaz << dzshift_);
}

if (settings_.debugTracklet()) {
edm::LogVerbatim("Tracklet") << getName() << " imatch = " << imatch << " ideltaphi cut " << ideltaphi << " "
Expand All @@ -610,6 +605,11 @@ bool MatchProcessor::matchCalculator(Tracklet* tracklet, const Stub* fpgastub, b
imatch = keep;
}
}
// Update the "best" values
if (imatch) {
best_ideltaphi_barrel = std::abs(ideltaphi);
best_ideltaz_barrel = std::abs(ideltaz << dzshift_);
}

if (imatch) {
tracklet->addMatch(layerdisk_,
Expand Down Expand Up @@ -767,11 +767,6 @@ bool MatchProcessor::matchCalculator(Tracklet* tracklet, const Stub* fpgastub, b

bool match = (std::abs(drphi) < drphicut) && (std::abs(deltar) < drcut);
bool imatch = (std::abs(ideltaphi * irstub) < best_ideltaphi_disk) && (std::abs(ideltar) < best_ideltar_disk);
// Update the "best" values
if (imatch) {
best_ideltaphi_disk = std::abs(ideltaphi) * irstub;
best_ideltar_disk = std::abs(ideltar);
}

if (settings_.debugTracklet()) {
edm::LogVerbatim("Tracklet") << "imatch match disk: " << imatch << " " << match << " " << std::abs(ideltaphi)
Expand All @@ -789,6 +784,11 @@ bool MatchProcessor::matchCalculator(Tracklet* tracklet, const Stub* fpgastub, b
imatch = keep;
}
}
// Update the "best" values
if (imatch) {
best_ideltaphi_disk = std::abs(ideltaphi) * irstub;
best_ideltar_disk = std::abs(ideltar);
}

if (imatch) {
if (settings_.debugTracklet()) {
Expand Down

0 comments on commit 1d090a3

Please sign in to comment.