7 #include "GeoModelHelpers/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()},
54 m_detElement{&detElem} {
57 auto boundsType = detElem.bounds().type();
59 m_thickness = detElem.thickness();
68 auto rectangleBounds = std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
70 m_bounds = rectangleBounds;
71 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *
this);
81 auto trapezoidBounds =
82 std::make_shared<const Acts::TrapezoidBounds>(minHlX, maxHlX, hlY);
84 m_bounds = trapezoidBounds;
86 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(trapezoidBounds, *
this);
93 if (annulus ==
nullptr) {
94 throw std::domain_error(
"ActsDetectorElement got inconsistent surface");
97 double phi = annulus->phiWidth();
98 double phiS = annulus->stereo();
99 double R = annulus->waferCentreR();
100 double maxR = annulus->maxR();
101 double minR = annulus->minR();
106 double phiMax =
phi / 2.;
107 double phiMin = -phiMax;
113 auto annulusBounds = std::make_shared<Acts::AnnulusBounds>(
114 minR, maxR, phiMin, phiMax, originStripXYRotated, phiAvg);
115 m_bounds = annulusBounds;
117 m_surface = Acts::Surface::makeShared<Acts::DiscSurface>(annulusBounds, *
this);
120 std::cout << boundsType << std::endl;
121 throw std::domain_error(
"ActsDetectorElement does not support this surface type");
128 GeoVDetectorElement{detElem.getMaterialGeom()},
129 m_type{DetectorType::Trt},
130 m_detElement{&detElem},
131 m_trtTrf{std::make_unique<Amg::Transform3D>(
trf)},
132 m_explicitIdentifier(
id) {
140 double innerTubeRadius{0.};
146 brlElem->getDescriptor()->innerTubeRadius() *
length_unit;
148 THROW_EXCEPTION(
"Cannot get tube radius for element in ActsDetectorElement c'tor");
153 std::make_shared<const Acts::LineBounds>(innerTubeRadius,
length);
154 m_bounds = lineBounds;
156 m_surface = Acts::Surface::makeShared<Acts::StrawSurface>(lineBounds, *
this);
160 GeoVDetectorElement{detElem.getMaterialGeom()},
161 m_type{DetectorType::Hgtd},
162 m_detElement{&detElem},
163 m_thickness{detElem.thickness()},
164 m_explicitIdentifier{
id} {
166 auto boundsType = detElem.bounds().type();
174 auto rectangleBounds =
175 std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
177 m_bounds = rectangleBounds;
179 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *
this);
182 throw std::domain_error(
183 "ActsDetectorElement: the surface type of HGTD is not does not Rectangle, it is wrong");
192 case DetectorType::Hgtd:{
193 l2g=
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore);
195 }
case DetectorType::Trt: {
209 extraTransform = design.
moduleShift() * extraTransform;
215 const Amg::Vector2D origin2D =
static_cast<const Acts::AnnulusBounds&
>(
m_surface->bounds()).moduleOrigin();
218 extraTransform = extraTransform * originTrf.inverse();
220 l2g =
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore) * extraTransform;
233 throw std::domain_error(
"Cannot get IdentityHelper for TRT element");
260 if (
const auto *detElem =
262 detElem !=
nullptr) {
263 return detElem->surface();
265 throw std::domain_error(
"Cannot get surface for TRT element");
272 if (
const auto *detElem =
274 detElem !=
nullptr) {
275 return detElem->identify();
287 const GeoVDetectorElement *