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"
45using Acts::Transform3;
47using namespace Acts::UnitLiterals;
54 if (!surf.isAlignable()) {
57 const auto* placement =
dynamic_cast<const ISurfacePlacement*
>(surf.surfacePlacement());
66 GeoVDetectorElement{detElem.getMaterialGeom()},
85 auto rectangleBounds = std::make_shared<Acts::RectangleBounds>(hlX, hlY);
99 auto trapezoidBounds = std::make_shared<Acts::TrapezoidBounds>(minHlX, maxHlX, hlY);
111 if (annulus ==
nullptr) {
112 throw std::domain_error(
"ActsDetectorElement got inconsistent surface");
115 double phi = annulus->phiWidth();
116 double phiS = annulus->stereo();
117 double R = annulus->waferCentreR();
118 double maxR = annulus->maxR();
119 double minR = annulus->minR();
124 double phiMax =
phi / 2.;
125 double phiMin = -phiMax;
129 R * std::sin(-phiS));
131 auto annulusBounds = std::make_shared<Acts::AnnulusBounds>(minR, maxR,
133 originStripXYRotated, phiAvg);
140 std::cout << boundsType << std::endl;
141 throw std::domain_error(
"ActsDetectorElement does not support this surface type");
148 GeoVDetectorElement{detElem.getMaterialGeom()},
163 double innerTubeRadius{0.};
165 innerTubeRadius = ecElem->getDescriptor()->innerTubeRadius() *
length_unit;
169 brlElem->getDescriptor()->innerTubeRadius() *
length_unit;
171 THROW_EXCEPTION(
"Cannot get tube radius for element in ActsDetectorElement c'tor");
175 auto lineBounds = std::make_shared<Acts::LineBounds>(innerTubeRadius,
length);
183 GeoVDetectorElement{detElem.getMaterialGeom()},
199 auto rectangleBounds = std::make_shared<Acts::RectangleBounds>(hlX, hlY);
207 throw std::domain_error(
208 "ActsDetectorElement: the surface type of HGTD is not does not Rectangle, it is wrong");
214 GeoAlignmentStore* geoModelStore = store ? store->geoModelAlignment.get() :
nullptr;
218 l2g=
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore);
234 extraTransform = design.
moduleShift() * extraTransform;
240 const Amg::Vector2D origin2D =
static_cast<const Acts::AnnulusBounds&
>(
surface().bounds()).moduleOrigin();
243 extraTransform = extraTransform * originTrf.inverse();
245 l2g =
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore) * extraTransform;
249 l2g.translation() *= 1.0 / CLHEP::mm *
length_unit;
259 throw std::domain_error(std::format(
"Cannot get IdentityHelper for {:} element" ,
detectorType()));
292 if (
const auto *detElem =
294 detElem !=
nullptr) {
295 return detElem->surface();
297 throw std::domain_error(std::format(
"Cannot get surface for {:} element" ,
detectorType()));
307const GeoVDetectorElement *
constexpr double length_unit
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
Scalar phi() const
phi method
Eigen::Affine3d Transform3D
ActsDetectorElement(const InDetDD::SiDetectorElement &detElem)
Identifier m_explicitIdentifier
std::unique_ptr< const Amg::Transform3D > m_trtTrf
const Acts::Transform3 & getDefaultTransform() const
Returns default transform.
ActsTrk::DetectorType DetectorType
const Acts::Transform3 & localToGlobalTransform(const Acts::GeometryContext &tgContext) const
const Trk::Surface & atlasSurface() const
Return a shared pointer on the ATLAS surface associated with this identifier,.
double m_thickness
Thickness of this detector element.
const Acts::Surface & surface() const
Return surface associated with this identifier, which should come from the.
DetectorType detectorType() const override final
Detector type.
ActsTrk::ReadoutSurfacePositioning< ActsDetectorElement > m_trfCache
std::shared_ptr< const Acts::SurfaceBounds > m_bounds
Boundaries of the detector element.
Identifier identify() const override final
Identifier.
IdentifierHash identifyHash() const
Identifier hash.
IdentityHelper identityHelper() const
virtual unsigned int storeAlignedTransforms(ActsTrk::DetectorAlignStore &alignStore) const override
Caches the aligned transformation in the provided store.
std::shared_ptr< ActsTrk::SurfacePlacement > m_surfHolder
const GeoVDetectorElement * m_detElement
Detector element as variant.
double thickness() const
Returns the thickness of the module.
const GeoVDetectorElement * upstreamDetectorElement() const
Returns the underllying GeoModel detectorelement that this one is based on.
Amg::Transform3D localToGlobal(const ActsTrk::DetectorAlignStore *store) const
Extension of the interface of the Acts::SurfacePlacementBase for ATLAS.
static std::shared_ptr< SurfacePlacement > makeShared(IReadoutSurfacePositioning &transformCache, std::shared_ptr< Bounds_t > &&bounds)
Factory method to create a SurfacePlacement together with an Acts::Surface.
Ensure that the extensions for the Vector3D are properly loaded.
virtual const Amg::Transform3D moduleShift() const
virtual double maxWidth() const =0
Method to calculate maximum width of a module.
virtual double minWidth() const =0
Method to calculate minimum width of a module.
virtual double length() const =0
Method to calculate length of a module.
virtual double width() const =0
Method to calculate average width of a module.
Class to hold geometrical description of an HGTD detector element.
const HGTD_ModuleDesign & design() const override final
access to the local description:
Class used to describe the design of a module (diode segmentation and readout scheme).
virtual double width() const
Method to calculate average width of a module.
virtual double length() const
Method to calculate length of a module.
Base class for the detector design classes for Pixel and SCT.
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
Class to hold geometrical description of a solid state detector element.
virtual const Trk::SurfaceBounds & bounds() const override final
Return the boundaries of the element.
Extended TRT_BaseElement to describe a TRT readout element, this is a planar layer with n ( order of ...
Virtual base class of TRT readout elements.
virtual const double & strawLength() const =0
Active straw length.
Extended class of a TRT_BaseElement to describe a readout elment in the endcap.
BoundsType
This enumerator simplifies the persistency, by saving a dynamic_cast to happen.
Abstract Base Class for tracking surfaces.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
@ Pixel
Inner detector legacy.
Definition of ATLAS Math & Geometry primitives (Amg).
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.
Amg::Transform3D getRotateZ3D(double angle)
Rotate the coordinate system by an angle around the z-axis.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Translation< double, 3 > Translation3D
#define THROW_EXCEPTION(MESSAGE)