7 #include "GeoModelKernel/throwExcept.h"
26 #include "Acts/Definitions/Units.hpp"
27 #include "Acts/Geometry/GeometryContext.hpp"
28 #include "Acts/Surfaces/AnnulusBounds.hpp"
29 #include "Acts/Surfaces/DiscSurface.hpp"
30 #include "Acts/Surfaces/LineBounds.hpp"
31 #include "Acts/Surfaces/PlaneSurface.hpp"
32 #include "Acts/Surfaces/RectangleBounds.hpp"
33 #include "Acts/Surfaces/StrawSurface.hpp"
34 #include "Acts/Surfaces/TrapezoidBounds.hpp"
35 #include "Acts/Visualization/ObjVisualization3D.hpp"
36 #include "Acts/Visualization/PlyVisualization3D.hpp"
45 using Acts::Transform3;
47 using namespace Acts::UnitLiterals;
54 GeoVDetectorElement{detElem.getMaterialGeom()},
55 m_idHash(detElem.identifyHash()),
57 m_detElement{&detElem},
58 m_explicitIdentifier(detElem.identify())
62 auto boundsType = detElem.bounds().type();
64 m_thickness = detElem.thickness();
73 auto rectangleBounds = std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
75 m_bounds = rectangleBounds;
76 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *
this);
86 auto trapezoidBounds =
87 std::make_shared<const Acts::TrapezoidBounds>(minHlX, maxHlX, hlY);
89 m_bounds = trapezoidBounds;
91 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(trapezoidBounds, *
this);
98 if (annulus ==
nullptr) {
99 throw std::domain_error(
"ActsDetectorElement got inconsistent surface");
102 double phi = annulus->phiWidth();
103 double phiS = annulus->stereo();
104 double R = annulus->waferCentreR();
105 double maxR = annulus->maxR();
106 double minR = annulus->minR();
111 double phiMax =
phi / 2.;
112 double phiMin = -phiMax;
118 auto annulusBounds = std::make_shared<Acts::AnnulusBounds>(
119 minR, maxR, phiMin, phiMax, originStripXYRotated, phiAvg);
120 m_bounds = annulusBounds;
122 m_surface = Acts::Surface::makeShared<Acts::DiscSurface>(annulusBounds, *
this);
125 std::cout << boundsType << std::endl;
126 throw std::domain_error(
"ActsDetectorElement does not support this surface type");
133 GeoVDetectorElement{detElem.getMaterialGeom()},
134 m_idHash(detElem.identifyHash()),
135 m_type{DetectorType::Trt},
136 m_detElement{&detElem},
137 m_trtTrf{std::make_unique<Amg::Transform3D>(
trf)},
138 m_explicitIdentifier(
id)
148 double innerTubeRadius{0.};
154 brlElem->getDescriptor()->innerTubeRadius() *
length_unit;
156 THROW_EXCEPTION(
"Cannot get tube radius for element in ActsDetectorElement c'tor");
161 std::make_shared<const Acts::LineBounds>(innerTubeRadius,
length);
162 m_bounds = lineBounds;
164 m_surface = Acts::Surface::makeShared<Acts::StrawSurface>(lineBounds, *
this);
168 GeoVDetectorElement{detElem.getMaterialGeom()},
169 m_idHash(detElem.identifyHash()),
170 m_type{DetectorType::Hgtd},
171 m_detElement{&detElem},
172 m_thickness{detElem.thickness()},
173 m_explicitIdentifier{
id}
176 auto boundsType = detElem.bounds().type();
184 auto rectangleBounds =
185 std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
187 m_bounds = rectangleBounds;
189 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *
this);
192 throw std::domain_error(
193 "ActsDetectorElement: the surface type of HGTD is not does not Rectangle, it is wrong");
202 case DetectorType::Hgtd:{
203 l2g=
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore);
205 }
case DetectorType::Trt: {
219 extraTransform = design.
moduleShift() * extraTransform;
225 const Amg::Vector2D origin2D =
static_cast<const Acts::AnnulusBounds&
>(
m_surface->bounds()).moduleOrigin();
228 extraTransform = extraTransform * originTrf.inverse();
230 l2g =
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore) * extraTransform;
243 throw std::domain_error(
"Cannot get IdentityHelper for TRT element");
270 if (
const auto *detElem =
272 detElem !=
nullptr) {
273 return detElem->surface();
275 throw std::domain_error(
"Cannot get surface for TRT element");
285 const GeoVDetectorElement *