46 double bevelMinZ =
get(eBevelMinZ);
47 double bevelMaxZ =
get(eBevelMaxZ);
49 double halfLengthZ =
get(eHalfLengthZ);
50 double halfPhi =
get(eHalfPhiSector);
51 if (bevelMinZ != 0. && bevelMaxZ != 0.) {
52 double radius =
get(
eR);
61 lposition[0] > radius ? 2 * radius - lposition[0] : lposition[0];
62 Vector2 shiftedlposition = shifted(lposition);
63 if ((std::fabs(shiftedlposition[0]) <= halfPhi &&
64 std::fabs(shiftedlposition[1]) <= halfLengthZ)) {
66 }
else if ((lposition[1] >=
67 -(localx * std::tan(bevelMinZ) + halfLengthZ)) &&
68 (lposition[1] <= (localx * std::tan(bevelMaxZ) + halfLengthZ))) {
74 Vector2 lowerLeft = {-radius, -halfLengthZ};
75 Vector2 middleLeft = {0., -(halfLengthZ + radius * std::tan(bevelMinZ))};
76 Vector2 upperLeft = {radius, -halfLengthZ};
77 Vector2 upperRight = {radius, halfLengthZ};
78 Vector2 middleRight = {0., (halfLengthZ + radius * std::tan(bevelMaxZ))};
79 Vector2 lowerRight = {-radius, halfLengthZ};
81 upperRight, middleRight, lowerRight};
83 boundaryCheck.computeClosestPointOnPolygon(lposition, vertices);
97 bool checkAbsolute = bcheck.
m_type == BoundaryCheck::Type::eAbsolute;
100 double addToleranceR =
101 (checkAbsolute && m_closed) ? bcheck.
m_tolerance[0] : 0.;
102 double addToleranceZ = checkAbsolute ? bcheck.
m_tolerance[1] : 0.;
105 std::abs(
perp(position) -
get(
eR))) {
107 }
else if (checkAbsolute && m_closed) {
108 double bevelMinZ =
get(eBevelMinZ);
109 double bevelMaxZ =
get(eBevelMaxZ);
112 bevelMinZ != 0. ? position.y() * std::sin(bevelMinZ) : 0.;
114 bevelMinZ != 0. ? position.y() * std::sin(bevelMaxZ) : 0.;
117 addedMinZ) >= position.z()) &&
119 addedMaxZ) <= position.z());
126 Vector2(
get(eHalfPhiSector),
get(eHalfLengthZ)));
130 sl << std::setiosflags(std::ios::fixed);
131 sl << std::setprecision(7);
132 sl <<
"Acts::CylinderBounds: (radius, halfLengthZ, halfPhiSector, "
133 "averagePhi, bevelMinZ, bevelMaxZ) = ";
134 sl <<
"(" <<
get(
eR) <<
", " <<
get(eHalfLengthZ) <<
", ";
135 sl <<
get(eHalfPhiSector) <<
", " <<
get(eAveragePhi) <<
", ";
136 sl <<
get(eBevelMinZ) <<
", " <<
get(eBevelMaxZ) <<
")";
137 sl << std::setprecision(-1);
145 double avgPhi =
get(eAveragePhi);
146 double halfPhi =
get(eHalfPhiSector);
148 bool fullCylinder = coversFullAzimuth();
153 avgPhi - halfPhi, avgPhi + halfPhi,
157 std::vector<int> sides = {-1, 1};
158 for (
auto& side : sides) {
159 for (
size_t iseg = 0; iseg < phiSegs.size() - 1; ++iseg) {
160 int addon = (iseg == phiSegs.size() - 2 and not fullCylinder) ? 1 : 0;
163 vertices, {
get(
eR),
get(
eR)}, phiSegs[iseg], phiSegs[iseg + 1], lseg,
164 addon,
Vector3(0., 0., side *
get(eHalfLengthZ)), ctrans);
168 double bevelMinZ =
get(eBevelMinZ);
169 double bevelMaxZ =
get(eBevelMaxZ);
172 if ((bevelMinZ != 0. || bevelMaxZ != 0.) && vertices.size() % 2 == 0) {
173 auto halfWay = vertices.end() - vertices.size() / 2;
175 auto invCtrans = ctrans.inverse();
176 auto func = [&mult, &ctrans, &invCtrans](
Vector3&
v) {
181 if (bevelMinZ != 0.) {
182 mult = std::tan(-bevelMinZ);
183 std::for_each(vertices.begin(), halfWay, func);
185 if (bevelMaxZ != 0.) {
186 mult = std::tan(bevelMaxZ);
187 std::for_each(halfWay, vertices.end(), func);