-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Using new Event::get and ::getHandle in PFProducers #25681
Using new Event::get and ::getHandle in PFProducers #25681
Conversation
The code-checks are being triggered in jenkins. |
//Assign the PFAlgo Parameters | ||
setPFVertexParameters(vertices.product()); |
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 think if there are no vertices in the event, the call to Handle::product()
will already raise a readable error [1], so the log might not be needed?
[1] https://github.com/cms-sw/cmssw/blob/master/FWCore/Framework/interface/GenericHandle.h#L105
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25681/8031
|
LOGDRESSED("PFEGammaProducer")<<"getting blocks"<<std::endl; | ||
bool found = iEvent.getByToken( inputTagBlocks_, blocks ); |
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.
This would be a good opportunity to use the auto handle = iEvent.getHandle(token_).makeValidHandle();
as @makortel suggested. Then, the following checks would truly unnecessary. Do you already have a specific implementation is mind for makeValidHandle()
?
A new Pull Request was created by @guitargeek (Jonas Rembser) for master. It involves the following packages: FWCore/Framework @perrotta, @smuzaffar, @cmsbuild, @Dr15Jones, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
|
||
//Assign the PFAlgo Parameters | ||
pfAlgo_->setPFVertexParameters(useVerticesForNeutral_,vertices.product()); |
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.
Same as for PFEGammaProducer
; I think the logging before is not necessary because product()
throws an exception already.
-1 |
Ok! I'm happy to know you are working on it, that was not really clear in the issue thread! I suppose I can keep using this version privately and can then migrate my analysis code to what you will come up with without any effort :) |
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25681/8099
|
The tests are being triggered in jenkins. |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1
|
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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
code-checks |
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25681/8203
|
+1 |
This PR builds on top of #25707 to replace the occurrences of
getByToken
with the more modernget
andgetHandle
in RecoParticleFlow/PFProducer.