22 declareInterface<IModuleStepper>(
this);
35 return StatusCode::SUCCESS;
41 return StatusCode::SUCCESS;
51 std::vector<Trk::DigitizationStep> cSteps;
54 const auto& stepSurfaces = dmodule.
stepSurfaces(startPoint,endPoint);
60 std::vector<Trk::Intersection> stepIntersections;
61 stepIntersections.reserve(stepSurfaces.size()+1);
64 for (
const auto& sSurface : stepSurfaces){
66 Trk::Intersection sIntersection = sSurface->straightLineIntersection(startPoint,trackDirection,
true,
true);
67 if (sIntersection.
valid) {
69 stepIntersections.push_back(sIntersection);
74 stepIntersections.emplace_back(endPoint,(startPoint-endPoint).
mag(),
true);
75 std::sort(stepIntersections.begin(),stepIntersections.end());
79 cSteps.reserve(stepIntersections.size());
80 for (
auto& sIntersection : stepIntersections){
82 cSteps.push_back( dmodule.
digitizationStep(lastPosition,sIntersection.position));
83 lastPosition = sIntersection.position;
100 Amg::Vector3D intersection3D(moduleIntersection.x(),moduleIntersection.y(),0.);
103 std::vector< Trk::Intersection > boundaryIntersections;
105 for (
const auto& bSurface : boundarySurfaces){
109 Trk::Intersection bIntersection = bSurface->straightLineIntersection(intersection3D,trackDirection,
false,
true);
110 if (bIntersection.
valid) {
112 boundaryIntersections.push_back(bIntersection);
116 if (attempts == 2 && boundaryIntersections.size() == attempts)
break;
117 else if (attempts > 2 && boundaryIntersections.size()==3)
break;
120 if (boundaryIntersections.size() > 2){
121 ATH_MSG_VERBOSE(
"More than 2 Boundary Surfaces intersected, this is an edge case, resolving ... ");
122 std::sort(boundaryIntersections.begin(),boundaryIntersections.end());
123 if (boundaryIntersections[0].pathLength*boundaryIntersections[1].pathLength < 0.) boundaryIntersections.pop_back();
124 else boundaryIntersections.erase(boundaryIntersections.begin());
127 return cellSteps(dmodule, boundaryIntersections[0].position, boundaryIntersections[1].position);