29 Acts::DiscSurface::DiscSurface(
const DiscSurface& other)
30 : GeometryObject(),
Surface(other), m_bounds(other.m_bounds) {}
33 const DiscSurface& other,
37 m_bounds(other.m_bounds) {}
39 Acts::DiscSurface::DiscSurface(std::shared_ptr<const Transform3D> htrans,
40 double rmin,
double rmax,
double hphisec)
43 m_bounds(std::make_shared<const RadialBounds>(rmin, rmax, hphisec)) {}
45 Acts::DiscSurface::DiscSurface(std::shared_ptr<const Transform3D> htrans,
46 double minhalfx,
double maxhalfx,
double maxR,
47 double minR,
double avephi,
double stereo)
50 m_bounds(std::make_shared<const DiscTrapezoidBounds>(
51 minhalfx, maxhalfx, maxR, minR, avephi, stereo)) {}
53 Acts::DiscSurface::DiscSurface(std::shared_ptr<const Transform3D> htrans,
54 std::shared_ptr<const DiscBounds> dbounds)
57 m_bounds(std::move(dbounds)) {}
59 Acts::DiscSurface::DiscSurface(
const std::shared_ptr<const DiscBounds>& dbounds,
60 const DetectorElementBase& detelement)
61 : GeometryObject(),
Surface(detelement), m_bounds(dbounds) {
65 Acts::DiscSurface& Acts::DiscSurface::operator=(
const DiscSurface& other) {
68 m_bounds = other.m_bounds;
83 lposition[
Acts::eLOC_R] * sin(lposition[Acts::eLOC_PHI]),
99 const Acts::Vector2D Acts::DiscSurface::localPolarToLocalCartesian(
101 const DiscTrapezoidBounds* dtbo =
103 if (dtbo !=
nullptr) {
104 double rMedium = dtbo->
rCenter();
108 Vector2D cartCenter = localPolarToCartesian(polarCenter);
109 Vector2D cartPos = localPolarToCartesian(locpol);
131 return Vector2D(loc3Dframe.x(), loc3Dframe.y());
135 return "Acts::DiscSurface";
140 return (*(m_bounds.get()));
148 std::vector<Vector3D> vertices;
149 std::vector<Polyhedron::FaceType> faces;
150 std::vector<Polyhedron::FaceType> triangularMesh;
153 bool fullDisc = m_bounds->coversFullAzimuth();
157 auto vertices2D = m_bounds->vertices(lseg);
158 vertices.reserve(vertices2D.size() + 1);
160 for (
const auto& v2D : vertices2D) {
162 wCenter += (*vertices.rbegin());
169 wCenter *= 1. / vertices.size();
170 vertices.push_back(wCenter);
172 faces = facesMesh.first;
173 triangularMesh = facesMesh.second;
179 faces = facesMesh.first;
180 triangularMesh = facesMesh.second;
183 throw std::domain_error(
184 "Polyhedron repr of boundless surface not possible.");
186 return Polyhedron(vertices, faces, triangularMesh);