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
Convert TrackFromPVSelector from legacy producer to global producer #17472
Conversation
A new Pull Request was created by @knoepfel (Kyle Knoepfel) for CMSSW_9_0_X. It involves the following packages: Validation/RecoTau @cmsbuild, @dmitrijus, @vanbesien, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
|
||
edm::Handle<std::vector<reco::Vertex>> vertices; | ||
edm::Handle<std::vector<reco::Track>> tracks; | ||
if (iEvent.getByToken(v_recoVertexToken_, vertices) && !vertices->empty() && |
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 is not the same logic. Previously if the data product was missing we'd throw an exception at the VertexHandle->
or TrackHandle->
call. Now you will put in an empty container. Please remove the check on return value of getByToken
.
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.
Ack. Good catch. Yes I'll make the change.
auto const& vtxPos = vertices->front().position(); | ||
std::copy_if(std::cbegin(*tracks), std::cend(*tracks), std::back_inserter(*goodTracks), | ||
[this, &vtxPos](auto const& track) { | ||
return fabs(track.dxy(vtxPos)) < max_dxy_ && fabs(track.dz(vtxPos)) < max_dz_; |
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 switch to using std::abs
?
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.
Yep.
Pull request #17472 was updated. @cmsbuild, @dmitrijus, @vanbesien, @davidlange6 can you please check and sign again. |
@Dr15Jones Logic error fixed and pushed. |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_9_0_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar |
+1 |
This was a nicely written module. Straightforward to convert.