-
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
Fix charged and neutral candidate converters for reco::Jets #35922
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35922/26327
|
A new Pull Request was created by @SWuchterl (Sebastian Wuchterl) for master. It involves the following packages:
@jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild please test |
-1 Failed Tests: RelVals RelVals-INPUT AddOn RelVals
Expand to see more relval errors ...RelVals-INPUT
Expand to see more relval errors ...AddOn Tests
Expand to see more addon errors ... |
The IB is broken. tests will need to be restarted after the new IB shows up anyways to get appropriate comparisons |
if (patJet->nSubjetCollections() > 0) { | ||
auto subjets = patJet->subjets(); | ||
// sort by pt | ||
std::sort(subjets.begin(), subjets.end(), [](const edm::Ptr<pat::Jet>& p1, const edm::Ptr<pat::Jet>& p2) { |
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.
no need for a full sorting here.
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.
Those pieces of the code were already there, I just inverted the logic of the if statement in the beginning. From the diff it seems different, I know. But of course, I can change it as suggested.
(Also applies for the second comment below)
Just for clarification, do you suggest removing the line entirely because the collection should already be sorted?
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.
stil this code is very sub-optimal
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.
@SWuchterl I understand you only need the first and second jet by pt, so you don't need to do a full sorting. This could be a straightforward improvement for both the new and original code. I'm not sure you can safely assume that the collection is sorted.
We can also run a profiling on this PR to check if this is a measurable/detectable issue.
std::sort(subjets.begin(), subjets.end(), [](const edm::Ptr<pat::Jet>& p1, const edm::Ptr<pat::Jet>& p2) { | ||
return p1->pt() > p2->pt(); | ||
}); | ||
c_pf_features.drsubjet1 = !subjets.empty() ? reco::deltaR(*c_pf, *subjets.at(0)) : -1; |
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.
use operator[]
not at
}); | ||
n_pf_features.drsubjet1 = !subjets.empty() ? reco::deltaR(*n_pf, *subjets.at(0)) : -1; | ||
n_pf_features.drsubjet2 = subjets.size() > 1 ? reco::deltaR(*n_pf, *subjets.at(1)) : -1; | ||
if (patJet) { |
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 all this code duplication?
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.
Could you please clarify the comment about what code exactly is duplicated in this file?
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.
the code in this file looks identical to the one in the previous one.
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.
@SWuchterl for clarification, the duplication is between ChargedCandidateConverter.h and NeutralCandidateConverter.h. The new code could be a simple utility function defined once, and called from both files.
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.
The first file is about Charged candidates and this one is about the Neutral ones. Some elements look similar indeed but they define 2 different inputs used by the neural network.
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-4a1543/20153/summary.html Comparison SummarySummary:
|
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.
There is some duplication and a possible code optimization that was brought up by Vincenzo that could be addressed. I don't see any reco changes - good.
After changes are implemented, we could run another round of tests with profiling.
if (patJet->nSubjetCollections() > 0) { | ||
auto subjets = patJet->subjets(); | ||
// sort by pt | ||
std::sort(subjets.begin(), subjets.end(), [](const edm::Ptr<pat::Jet>& p1, const edm::Ptr<pat::Jet>& p2) { |
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.
@SWuchterl I understand you only need the first and second jet by pt, so you don't need to do a full sorting. This could be a straightforward improvement for both the new and original code. I'm not sure you can safely assume that the collection is sorted.
We can also run a profiling on this PR to check if this is a measurable/detectable issue.
}); | ||
n_pf_features.drsubjet1 = !subjets.empty() ? reco::deltaR(*n_pf, *subjets.at(0)) : -1; | ||
n_pf_features.drsubjet2 = subjets.size() > 1 ? reco::deltaR(*n_pf, *subjets.at(1)) : -1; | ||
if (patJet) { |
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.
@SWuchterl for clarification, the duplication is between ChargedCandidateConverter.h and NeutralCandidateConverter.h. The new code could be a simple utility function defined once, and called from both files.
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35922/26512
|
@cmsbuild please test |
-1 Failed Tests: RelVals RelVals
|
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-4a1543/20416/summary.html Comparison SummarySummary:
|
+reconstruction
|
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, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
Fix charged and neutral candidate converters for reco::Jets
Fix charged and neutral candidate converters for reco::Jets
PR description:
This PR allows the evaluation of DeepJet on
reco::Jet
s, which to my understanding should have worked before the latest change. With the current logic, onlypat::Jet
s are accepted.The fix is needed to use DeepJet at HLT. For the
reco::
case, features needed for DeepDoubleX are filled with the same dummy variables as in the case of no subjets.PR validation:
Code compiles.
40 39 38 29 18 4 1 1 1 tests passed, 0 0 0 0 0 0 0 0 0 failed
Also, tested on data and MC samples, running a modified HLT menu with DeepJet instead of DeepCSV.
if this PR is a backport please specify the original PR and why you need to backport that PR:
N/A