-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
L1 DT AM - heap-buffer-overflow fix + slight logic improvement in confirmed TPs #39411
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39411/32123
|
A new Pull Request was created by @jaimeleonh (Jaime Leon Holgado) for master. It involves the following packages:
@rekovic, @epalencia, @cmsbuild, @AdrianoDee, @srimanob, @cecilecaillol can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b7785b/27594/summary.html Comparison SummarySummary:
|
+l1 |
if (dtLId.layer() != best_layer) { | ||
minx = std::abs(x_inSL3 - x_wire); | ||
next_wire = best_wire; | ||
next_tdc = best_tdc; | ||
next_layer = best_layer; | ||
next_lat = best_lat; | ||
|
||
best_wire = (*digiIt).wire(); | ||
best_tdc = (*digiIt).time(); | ||
best_layer = dtLId.layer(); | ||
best_lat = lat; | ||
matched_digis++; | ||
} else if (dtLId.layer() == | ||
best_layer) { // same layer than stored, just substituting the hit, no matched_digis++; | ||
best_wire = (*digiIt).wire(); | ||
best_tdc = (*digiIt).time(); | ||
best_layer = dtLId.layer(); | ||
best_lat = lat; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not:
if (dtLId.layer() != best_layer) { | |
minx = std::abs(x_inSL3 - x_wire); | |
next_wire = best_wire; | |
next_tdc = best_tdc; | |
next_layer = best_layer; | |
next_lat = best_lat; | |
best_wire = (*digiIt).wire(); | |
best_tdc = (*digiIt).time(); | |
best_layer = dtLId.layer(); | |
best_lat = lat; | |
matched_digis++; | |
} else if (dtLId.layer() == | |
best_layer) { // same layer than stored, just substituting the hit, no matched_digis++; | |
best_wire = (*digiIt).wire(); | |
best_tdc = (*digiIt).time(); | |
best_layer = dtLId.layer(); | |
best_lat = lat; | |
} | |
if (dtLId.layer() != best_layer) { | |
minx = std::abs(x_inSL3 - x_wire); | |
next_wire = best_wire; | |
next_tdc = best_tdc; | |
next_layer = best_layer; | |
next_lat = best_lat; | |
matched_digis++; | |
} | |
best_wire = (*digiIt).wire(); | |
best_tdc = (*digiIt).time(); | |
best_layer = dtLId.layer(); | |
best_lat = lat; |
// buggy, as we could have stored as next LayerX -> LayerY -> LayerX, and this should | ||
// count only as 2 hits. However, as we confirm with at least 2 hits, having 2 or more | ||
// makes no difference | ||
else if (dtLId.layer() != next_layer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the else if
needed after a continue
in case of the complementary possibility?
if (dtLId.layer() != best_layer) { | ||
minx = std::abs(x_inSL1 - x_wire); | ||
next_wire = best_wire; | ||
next_tdc = best_tdc; | ||
next_layer = best_layer; | ||
next_lat = best_lat; | ||
|
||
best_wire = (*digiIt).wire(); | ||
best_tdc = (*digiIt).time(); | ||
best_layer = dtLId.layer(); | ||
best_lat = lat; | ||
matched_digis++; | ||
} else if (dtLId.layer() == | ||
best_layer) { // same layer than stored, just substituting the hit, no matched_digis++; | ||
best_wire = (*digiIt).wire(); | ||
best_tdc = (*digiIt).time(); | ||
best_layer = dtLId.layer(); | ||
best_lat = lat; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (dtLId.layer() != best_layer) { | |
minx = std::abs(x_inSL1 - x_wire); | |
next_wire = best_wire; | |
next_tdc = best_tdc; | |
next_layer = best_layer; | |
next_lat = best_lat; | |
best_wire = (*digiIt).wire(); | |
best_tdc = (*digiIt).time(); | |
best_layer = dtLId.layer(); | |
best_lat = lat; | |
matched_digis++; | |
} else if (dtLId.layer() == | |
best_layer) { // same layer than stored, just substituting the hit, no matched_digis++; | |
best_wire = (*digiIt).wire(); | |
best_tdc = (*digiIt).time(); | |
best_layer = dtLId.layer(); | |
best_lat = lat; | |
} | |
if (dtLId.layer() != best_layer) { | |
minx = std::abs(x_inSL1 - x_wire); | |
next_wire = best_wire; | |
next_tdc = best_tdc; | |
next_layer = best_layer; | |
next_lat = best_lat; | |
matched_digis++; | |
} | |
best_wire = (*digiIt).wire(); | |
best_tdc = (*digiIt).time(); | |
best_layer = dtLId.layer(); | |
best_lat = lat; |
else if (dtLId.layer() != next_layer) | ||
matched_digis++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if (dtLId.layer() != next_layer) | |
matched_digis++; | |
matched_digis++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not asking for updating the PR, just take into account these possible simplifications in case you need to update it further eventually
@jaimeleonh , do I understand correctly that the bug fix for #39338 is not included in this PR any more? Or could you please point it out to me which is the code change that fixes it? |
The bug fix is included in the changes in L1Trigger/DTTriggerPhase2/src/MPQualityEnhancerFilter.cc. |
@cmsbuild please test Just re-trigger the test after 2 weeks. |
@jaimeleonh @perrotta |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b7785b/27909/summary.html Comparison Summary@slava77 comparisons for the following workflows were not done due to missing matrix map:
Summary:
|
Hi @jaimeleonh @cms-sw/l1-l2 |
Sorry, I missed your previous comment. What I understood from @perrotta is that his last suggestions didn't have to be included in this PR, so I left them for future PRs. I resolved the conversation about these suggestions in any case. |
+Upgrade |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
@@ -390,6 +390,8 @@ void MuonPathAssociator::correlateMPaths(edm::Handle<DTDigiCollection> dtdigis, | |||
double x_inSL3 = SL1metaPrimitive->x - SL1metaPrimitive->tanPhi * (VERT_PHI1_PHI3 + l_shift); | |||
for (auto digiIt = (dtLayerId_It.second).first; digiIt != (dtLayerId_It.second).second; ++digiIt) { | |||
DTWireId wireId(dtLId, (*digiIt).wire()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still for a possible future improvement: this can be moved after L394, so that it gets only executed if needed
+1
|
PR description:
This PR tries to solve issue #39338, where a heap-buffer-overflow error was encountered and associated to one line in the MPQuality filter. It also includes some improved logic in a different class.
PR validation:
Passed code-format and code-checks tests