Use of std::nearbyint in Utils.cxx
There are several places in Utils.cxx that use std::nearbyint. Here is one example around line 3410:
// next make TPs on the wires that don't have real TPs TrajPoint ltp; // put ltp at the vertex position with direction towards the end point MakeBareTrajPoint(vx2.Pos, tj.Pts[tj.EndPt[end]].Pos, ltp); if(ltp.Dir == 0) continue; unsigned int wire = std::nearbyint(ltp.Pos); ltp.Chg = 0; unsigned short indx = wire - loWire; // Break if we found a real TP if(tjpt[indx].Chg == 0) tjpt[indx] = ltp;
In one event,
ltp.Posis negative (-0.642913) and
wirewas assigned the maximal unsigned integer value 4294967295.
We need to review the code and protect against the case where
Pos is negative.