Project

General

Profile

Bug #17048

floating point divide by zero in tca:MCSMom

Added by Thomas Junk about 2 years ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Reconstruction
Target version:
-
Start date:
06/27/2017
Due date:
% Done:

50%

Estimated time:
Spent time:
Occurs In:
Experiment:
-
Co-Assignees:
Duration:

Description

This is spotted in larsoft v06_33_00, but it looks like the code may still be unprotected.

in

larreco/RecoAlg/TCAlg/Utils.cxx

MCSMom can divide by zero if MCSThetaRMS returns zero. MCSThetaRMS can return 0 if this line

if(numPts > 5 && cnt < 0.7 * numPts) return tj.MCSMom;

satisfies the conditions in the if and tj.MCSMom is zero. The divide that fails is this:

double mom = 13.8 * sqrt(tjLen / 14) / MCSThetaRMS(tjs, tj, firstPt, lastPt);

and tjLen is close to zero (1E-315) as well. So it's not a big deal, but if we turn on FP Exceptions,
then 0/0 will cause the program to fault.


Related issues

Blocks LArSoft - Necessary Maintenance #17047: Floating Point ExceptionsAssigned2017-06-27

History

#1 Updated by Gianluca Petrillo about 2 years ago

#2 Updated by Bruce Baller about 2 years ago

  • % Done changed from 0 to 100

Changed return value from 0 to 1 in MCSThetaRMS if a 0 length trajectory is found.

#3 Updated by Lynn Garren about 2 years ago

  • Status changed from New to Resolved

This fix is in the newly built larsoft v06_42_00 release.

#4 Updated by Gianluca Petrillo about 2 years ago

#5 Updated by Gianluca Petrillo about 2 years ago

#6 Updated by Gianluca Petrillo about 2 years ago

#7 Updated by Gianluca Petrillo about 2 years ago

#8 Updated by Thomas Junk about 2 years ago

  • Status changed from Resolved to Assigned

I'll change this back to assigned. I reran a dune reconstruction job in
v06_42_00 and got the same FP exception. Putting a tracepoint on line 2036 of larreco/RecoAlg/TCAlg/Utils.cxx shows that just before the FP exception, numPts = 10, cnt = 1, and tj.MCSMom = 0, and the return statement returns zero. Thanks for fixing the other return 0 at the end of that method -- that's probably the source of similar FP divide by zeros.

#9 Updated by Katherine Lato over 1 year ago

  • Category set to Reconstruction
  • Assignee set to Bruce Baller
  • % Done changed from 100 to 50

Bruce,
Can you see if you can find and fix this?
Katherine

#10 Updated by Bruce Baller about 1 year ago

  • Status changed from Assigned to Resolved


Also available in: Atom PDF