7 #include "GeoModelKernel/throwExcept.h"
24 #include "Acts/Definitions/Units.hpp"
25 #include "Acts/Geometry/GeometryContext.hpp"
26 #include "Acts/Surfaces/AnnulusBounds.hpp"
27 #include "Acts/Surfaces/DiscSurface.hpp"
28 #include "Acts/Surfaces/LineBounds.hpp"
29 #include "Acts/Surfaces/PlaneSurface.hpp"
30 #include "Acts/Surfaces/RectangleBounds.hpp"
31 #include "Acts/Surfaces/StrawSurface.hpp"
32 #include "Acts/Surfaces/TrapezoidBounds.hpp"
33 #include "Acts/Visualization/ObjVisualization3D.hpp"
34 #include "Acts/Visualization/PlyVisualization3D.hpp"
43 using Acts::Transform3;
45 using namespace Acts::UnitLiterals;
52 GeoVDetectorElement{detElem.getMaterialGeom()},
53 m_idHash(detElem.identifyHash()),
55 m_detElement{&detElem},
56 m_explicitIdentifier(detElem.identify())
60 auto boundsType = detElem.bounds().type();
62 m_thickness = detElem.thickness();
71 auto rectangleBounds = std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
73 m_bounds = rectangleBounds;
74 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *
this);
84 auto trapezoidBounds =
85 std::make_shared<const Acts::TrapezoidBounds>(minHlX, maxHlX, hlY);
87 m_bounds = trapezoidBounds;
89 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(trapezoidBounds, *
this);
96 if (annulus ==
nullptr) {
97 throw std::domain_error(
"ActsDetectorElement got inconsistent surface");
100 double phi = annulus->phiWidth();
101 double phiS = annulus->stereo();
102 double R = annulus->waferCentreR();
103 double maxR = annulus->maxR();
104 double minR = annulus->minR();
109 double phiMax =
phi / 2.;
110 double phiMin = -phiMax;
116 auto annulusBounds = std::make_shared<Acts::AnnulusBounds>(
117 minR, maxR, phiMin, phiMax, originStripXYRotated, phiAvg);
118 m_bounds = annulusBounds;
120 m_surface = Acts::Surface::makeShared<Acts::DiscSurface>(annulusBounds, *
this);
123 std::cout << boundsType << std::endl;
124 throw std::domain_error(
"ActsDetectorElement does not support this surface type");
131 GeoVDetectorElement{detElem.getMaterialGeom()},
132 m_idHash(detElem.identifyHash()),
133 m_type{DetectorType::Trt},
134 m_detElement{&detElem},
135 m_trtTrf{std::make_unique<Amg::Transform3D>(
trf)},
136 m_explicitIdentifier(
id)
146 double innerTubeRadius{0.};
152 brlElem->getDescriptor()->innerTubeRadius() *
length_unit;
154 THROW_EXCEPTION(
"Cannot get tube radius for element in ActsDetectorElement c'tor");
159 std::make_shared<const Acts::LineBounds>(innerTubeRadius,
length);
160 m_bounds = lineBounds;
162 m_surface = Acts::Surface::makeShared<Acts::StrawSurface>(lineBounds, *
this);
166 GeoVDetectorElement{detElem.getMaterialGeom()},
167 m_idHash(detElem.identifyHash()),
168 m_type{DetectorType::Hgtd},
169 m_detElement{&detElem},
170 m_thickness{detElem.thickness()},
171 m_explicitIdentifier{
id}
174 auto boundsType = detElem.bounds().type();
182 auto rectangleBounds =
183 std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
185 m_bounds = rectangleBounds;
187 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *
this);
190 throw std::domain_error(
191 "ActsDetectorElement: the surface type of HGTD is not does not Rectangle, it is wrong");
200 case DetectorType::Hgtd:{
201 l2g=
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore);
203 }
case DetectorType::Trt: {
217 extraTransform = design.
moduleShift() * extraTransform;
223 const Amg::Vector2D origin2D =
static_cast<const Acts::AnnulusBounds&
>(
m_surface->bounds()).moduleOrigin();
226 extraTransform = extraTransform * originTrf.inverse();
228 l2g =
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore) * extraTransform;
241 throw std::domain_error(
"Cannot get IdentityHelper for TRT element");
268 if (
const auto *detElem =
270 detElem !=
nullptr) {
271 return detElem->surface();
273 throw std::domain_error(
"Cannot get surface for TRT element");
283 const GeoVDetectorElement *