-
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
properly treat averaging with self in GhostTrackVertexFinder::vtxMean #37088
properly treat averaging with self in GhostTrackVertexFinder::vtxMean #37088
Conversation
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37088/28574
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37088/28576
|
A new Pull Request was created by @slava77 (Slava Krutelyov) for master. It involves the following packages:
@jpata, @cmsbuild, @clacaputo, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-85247b/22718/summary.html Comparison SummarySummary:
|
@@ -123,6 +125,11 @@ static double vtxErrorLong(const GlobalError &error, const GlobalVector &dir) { | |||
static GlobalPoint vtxMean(const GlobalPoint &p1, const GlobalError &e1, const GlobalPoint &p2, const GlobalError &e2) { | |||
GlobalVector diff = p2 - p1; | |||
|
|||
if UNLIKELY (diff.perp2() == 0) { |
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.
uhm, I actually meant to use mag2
here. I will update.
fd748b1
to
fc78082
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37088/28585
|
Pull request #37088 was updated. @jpata, @cmsbuild, @clacaputo, @slava77 can you please check and sign again. |
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-85247b/22725/summary.html Comparison SummarySummary:
|
136.874 and 35034.0 have one logWarning each related to this PR. The comparisons also show differences in 39496.0 39500.0 in simPVZ plot |
So, this apparently means that not all cases of |
so there are no reco differences (in e.g. 136.874), despite the bugfix? |
After debugging this a bit I have updated the description of the PR: the condition was leading to an exception, but the exception was caught, which explains why there is no crash for the events with a warning. I can confirm that without the fix (in Run: 319450 Event: 105539294; event index 43 in the workflow) this part of the code is producing an invalid point with a At least in this workflow this PR affects only |
@emilbols are |
+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 |
while debugging in some corner of phase space I noticed that a relatively benign case of averaging of two identical points in
GhostTrackVertexFinder::vtxMean
can lead to a NaN in the results.The NaN eventually propagates downstream and leads to
an exception thrown in
PerigeeConversions::ftsToPerigeeParameters
(cms::Exception("PerigeeConversions", "Track with pt=0")
), which is actually caught incmssw/TrackingTools/TrajectoryState/src/TrajectoryStateClosestToPoint.cc
Lines 17 to 22 in 14da925
I'm proposing a simple fix to return one of the identical points.
I'm adding a warning only because this condition was previously leading to a (caught) exception.
(
Also, I'm not familiar enough with)GhostTrackVertexFinder
to conclude that an averaging with self is an indication of a logic error and that a fix upstream is needed.After some tests in relvals, the conditions seems to happen in
O(1e-3)
events.