diff --git a/Tracker/TrackerRecTools/FaserSiSpacePointTool/src/TrackerSpacePointMakerTool.cxx b/Tracker/TrackerRecTools/FaserSiSpacePointTool/src/TrackerSpacePointMakerTool.cxx index 6dac89b8160545f6bc7318249efa10e094516bb9..a26a3c3460a48b131de633dbfe3b3e09f177f39d 100644 --- a/Tracker/TrackerRecTools/FaserSiSpacePointTool/src/TrackerSpacePointMakerTool.cxx +++ b/Tracker/TrackerRecTools/FaserSiSpacePointTool/src/TrackerSpacePointMakerTool.cxx @@ -112,30 +112,26 @@ Trk::SpacePoint* TrackerSpacePointMakerTool::makeSCT_SpacePoint(const Tracker::T Amg::Vector3D s(a+b); Amg::Vector3D t(c+d); double lambda0 = r.cross(Amg::Vector3D(s-t)).z()/det; + double lambda1 = q.cross(Amg::Vector3D(s-t)).z()/det; point = (s + lambda0 * q)/2; ATH_MSG_VERBOSE( "Endpoints 1 : ( " << a.x() << " , " << a.y() << " , " << a.z() << " ) to (" << b.x() << " , " << b.y() << " , " << b.z() << " ) " ); ATH_MSG_VERBOSE( "Endpoints 2 : ( " << c.x() << " , " << c.y() << " , " << c.z() << " ) to (" << d.x() << " , " << d.y() << " , " << d.z() << " ) " ); ATH_MSG_VERBOSE( "Intersection: ( " << point.x() << " , " << point.y() << " , " << point.z() << " ) " ); + // require that the point is within the bounds of at least one of the two strips + if (fabs(lambda0) > 1 + m_stripLengthTolerance) + { + if (fabs(lambda1) > 1 + m_stripLengthTolerance) + { + ATH_MSG_WARNING("Intersection lies outside the bounds of both strips"); + ok = false; + } + } } else { - ATH_MSG_WARNING("Alt Intersection failed"); + ATH_MSG_WARNING("Intersection failed"); ok = false; } - - // Amg::Vector3D mab(c - a); - // double eaTeb = q.dot(r); - // double denom = 1. - eaTeb*eaTeb; - // if (fabs(denom)>10e-7){ - // double lambda0 = (mab.dot(q) - mab.dot(r)*eaTeb)/denom; - // point = a+lambda0*q; - // ATH_MSG_VERBOSE( "Endpoints 1 : ( " << a.x() << " , " << a.y() << " , " << a.z() << " ) to (" << b.x() << " , " << b.y() << " , " << b.z() << " ) " ); - // ATH_MSG_VERBOSE( "Endpoints 2 : ( " << c.x() << " , " << c.y() << " , " << c.z() << " ) to (" << d.x() << " , " << d.y() << " , " << d.z() << " ) " ); - // ATH_MSG_VERBOSE( "Intersection: ( " << point.x() << " , " << point.y() << " , " << point.z() << " ) " ); - // } else { - // ATH_MSG_WARNING("Intersection failed"); - // ok = false; - // } } else { Amg::Vector3D s(a+b-2.*vertexVec); // twice the vector from vertex to midpoint Amg::Vector3D t(c+d-2.*vertexVec); // twice the vector from vertex to midpoint