-
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
Modernized some modules in RecoBTag #35018
Conversation
- made modules global - use new Event get syntax - added fillDescriptions
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35018/24872
|
A new Pull Request was created by @Dr15Jones (Chris Jones) 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 |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-afe11b/18034/summary.html The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
You can see more details here: Comparison SummarySummary:
|
|
||
if (PVCollection->empty() and not theJetCollection.empty() and not theGEDGsfElectronCollection.empty()) { | ||
//we would need to access a vertex from the collection but there isn't one. | ||
return; |
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 expect an event.emplace
should still happen
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 was following the logic done on line '49-50' in the old code
cmssw/RecoBTag/SoftLepton/plugins/SoftPFElectronTagInfoProducer.cc
Lines 49 to 50 in fd2a236
if (!PVCollection.isValid()) | |
return; |
I can push an empty container if you'd prefer
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.
Just for some context, I added that condition check because in the original code if that condition was meet the algorithm would dereference a nullptr
for the vertex and pass it to a function expecting a const &
.
|
||
// Declare and open Vertex collection | ||
edm::Handle<reco::VertexCollection> theVertexCollection; | ||
iEvent.getByToken(vertexToken, theVertexCollection); | ||
edm::Handle<reco::VertexCollection> theVertexCollection = iEvent.getHandle(vertexToken); | ||
if (!theVertexCollection.isValid() || theVertexCollection->empty()) | ||
return; |
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.
event put/emplace is missing here as well
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.
again, that is the logic which was there before this change. I can change it if you wish.
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.
again, that is the logic which was there before this change. I can change it if you wish.
since this PR has fairly extensive changes, it would be nice to include this one as well.
(The other producers in this PR apparently produce a product per ::produce
call already)
Thank you.
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 making the change so the module always pushes a container. That being said, if one of these conditions fails it will now be pretty hard to find the problem as it will just appear to be OK. Previously, if this failed later modules trying to access it would likely throw an exception.
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35018/24891
|
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-afe11b/18064/summary.html Comparison SummarySummary:
|
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 |
PR description:
PR validation:
Code compiles. Non of these changes are meant to change the behavior of the modules.
resolves cms-sw/framework-team#247