20 #include <system_error>
26 Acts::DiscSurface::DiscSurface(
const DiscSurface& other)
27 : GeometryObject(),
Surface(other), m_bounds(other.m_bounds) {}
30 const DiscSurface& other,
32 : GeometryObject(),
Surface(gctx, other, shift), m_bounds(other.m_bounds) {}
35 double rmax,
double hphisec)
38 m_bounds(std::make_shared<const RadialBounds>(rmin, rmax, hphisec)) {}
41 double maxhalfx,
double minR,
double maxR,
42 double avephi,
double stereo)
45 m_bounds(std::make_shared<const DiscTrapezoidBounds>(
46 minhalfx, maxhalfx, minR, maxR, avephi, stereo)) {}
49 std::shared_ptr<const DiscBounds> dbounds)
50 : GeometryObject(),
Surface(transform), m_bounds(std::move(dbounds)) {}
52 Acts::DiscSurface::DiscSurface(
const std::shared_ptr<const DiscBounds>& dbounds,
53 const DetectorElementBase& detelement)
54 : GeometryObject(),
Surface(detelement), m_bounds(dbounds) {
58 Acts::DiscSurface& Acts::DiscSurface::operator=(
const DiscSurface& other) {
61 m_bounds = other.m_bounds;
86 if (loc3Dframe.z() * loc3Dframe.z() >
88 return Result<Vector2D>::failure(SurfaceError::GlobalPositionNotOnSurface);
90 return Result<Acts::Vector2D>::success({
perp(loc3Dframe),
phi(loc3Dframe)});
95 const DiscTrapezoidBounds* dtbo =
97 if (dtbo !=
nullptr) {
98 double rMedium = dtbo->
rCenter();
102 Vector2D cartCenter = localPolarToCartesian(polarCenter);
103 Vector2D cartPos = localPolarToCartesian(locpol);
104 Vector2D Pos = cartPos - cartCenter;
126 return Vector2D(loc3Dframe.x(), loc3Dframe.y());
130 return "Acts::DiscSurface";
135 return (*(m_bounds.get()));
143 std::vector<Vector3D> vertices;
144 std::vector<Polyhedron::FaceType> faces;
145 std::vector<Polyhedron::FaceType> triangularMesh;
148 bool fullDisc = m_bounds->coversFullAzimuth();
153 auto vertices2D = m_bounds->vertices(lseg);
154 vertices.reserve(vertices2D.size() + 1);
156 for (
const auto& v2D : vertices2D) {
158 wCenter += (*vertices.rbegin());
165 wCenter *= 1. / vertices.size();
166 vertices.push_back(wCenter);
168 faces = facesMesh.first;
169 triangularMesh = facesMesh.second;
175 faces = facesMesh.first;
176 triangularMesh = facesMesh.second;
179 throw std::domain_error(
180 "Polyhedron repr of boundless surface not possible.");
182 return Polyhedron(vertices, faces, triangularMesh, exactPolyhedron);