18 #include <system_error>
32 double radius,
double halfz,
33 double halfphi,
double avphi)
35 m_bounds(std::make_shared<const
CylinderBounds>(radius, halfz, halfphi,
39 std::shared_ptr<const CylinderBounds> cbounds,
41 :
Surface(detelement), m_bounds(std::move(cbounds)) {
48 const std::shared_ptr<const CylinderBounds>& cbounds)
49 :
Surface(transform), m_bounds(cbounds) {
50 throw_assert(cbounds,
"CylinderBounds must not be nullptr");
70 return Vector3D(sfCenter.x() + R *
cos(phi), sfCenter.y() + R * sin(phi),
85 Vector3D measY = rotSymmetryAxis(gctx);
87 Vector3D measDepth = normal(gctx, position);
89 Vector3D measX(measY.cross(measDepth).normalized());
91 mFrame.col(0) = measX;
92 mFrame.col(1) = measY;
93 mFrame.col(2) = measDepth;
122 Vector3D loc3Dframe(inverseTrans * position);
131 return "Acts::CylinderSurface";
149 return sfTransform.linear() * pos3D.normalized();
155 Vector3D normalT = normal(gctx, position);
156 double cosAlpha = normalT.dot(direction);
157 return std::fabs(1. / cosAlpha);
161 return (*m_bounds.get());
167 std::vector<Vector3D> vertices;
168 std::vector<Polyhedron::FaceType> faces;
169 std::vector<Polyhedron::FaceType> triangularMesh;
172 bool fullCylinder = bounds().coversFullAzimuth();
178 auto phiSegs = fullCylinder
181 avgPhi - halfPhi, avgPhi + halfPhi, {avgPhi});
184 std::vector<int> sides = {-1, 1};
185 for (
auto& side : sides) {
186 for (
size_t iseg = 0; iseg < phiSegs.size() - 1; ++iseg) {
187 int addon = (iseg == phiSegs.size() - 2 and not fullCylinder) ? 1 : 0;
192 phiSegs[iseg], phiSegs[iseg + 1], lseg, addon,
199 return Polyhedron(vertices, facesMesh.first, facesMesh.second,
false);