16 const std::vector<ActsScalar>& phiRefs,
ActsScalar phiTolerance) {
20 std::vector<ActsScalar> quarters = {-M_PI, -0.5 * M_PI, 0., 0.5 * M_PI, M_PI};
22 if (phiMin != -M_PI or phiMax != M_PI) {
23 phiSegments.push_back(phiMin);
24 for (
unsigned int iq = 1; iq < 4; ++iq) {
25 if (phiMin < quarters[iq] and phiMax > quarters[iq]) {
26 phiSegments.push_back(quarters[iq]);
29 phiSegments.push_back(phiMax);
31 phiSegments = quarters;
34 if (not phiRefs.empty()) {
35 for (
const auto& phiRef : phiRefs) {
37 auto match = std::find_if(
38 phiSegments.begin(), phiSegments.end(), [&](
ActsScalar phiSeg) {
39 return std::abs(phiSeg - phiRef) < phiTolerance;
41 if (match == phiSegments.end()) {
42 phiSegments.push_back(phiRef);
45 std::sort(phiSegments.begin(), phiSegments.end());
56 std::vector<Vector2> rvertices;
57 std::vector<Vector2> ivertices;
58 std::vector<Vector2> overtices;
60 bool innerExists = (innerRx > 0. and innerRy > 0.);
65 avgPhi - halfPhi, avgPhi + halfPhi, {avgPhi});
68 for (
unsigned int iseg = 0; iseg < phiSegs.size() - 1; ++iseg) {
69 int addon = (iseg == phiSegs.size() - 2 and not
closed) ? 1 : 0;
71 createSegment<Vector2, Transform2>(ivertices, {innerRx, innerRy},
72 phiSegs[iseg], phiSegs[iseg + 1], lseg,
75 createSegment<Vector2, Transform2>(overtices, {outerRx, outerRy},
76 phiSegs[iseg], phiSegs[iseg + 1], lseg,
81 if (not innerExists) {
84 rvertices.push_back(
Vector2(0., 0.));
86 rvertices.insert(rvertices.end(), overtices.begin(), overtices.end());
87 }
else if (not closed) {
88 rvertices.insert(rvertices.end(), overtices.begin(), overtices.end());
89 rvertices.insert(rvertices.end(), ivertices.rbegin(), ivertices.rend());
91 rvertices.insert(rvertices.end(), overtices.begin(), overtices.end());
92 rvertices.insert(rvertices.end(), ivertices.begin(), ivertices.end());
107 if (vertices.size() < 4) {
111 auto hyperPlane = Eigen::Hyperplane<ActsScalar, 3>::Through(
112 vertices[0], vertices[1], vertices[2]);
113 for (
size_t ip = 3; ip < vertices.size(); ++ip) {
114 if (hyperPlane.absDistance(vertices[ip]) >
tolerance) {