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 GeoVDetectorElement{detElem.getMaterialGeom()},
73 auto rectangleBounds = std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
76 m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *
this);
86 auto trapezoidBounds =
87 std::make_shared<const Acts::TrapezoidBounds>(minHlX, maxHlX, hlY);
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;
116 R * std::sin(-phiS));
118 auto annulusBounds = std::make_shared<Acts::AnnulusBounds>(
119 minR, maxR, phiMin, phiMax, originStripXYRotated, phiAvg);
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()},
148 double innerTubeRadius{0.};
150 innerTubeRadius = ecElem->getDescriptor()->innerTubeRadius() *
length_unit;
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);
164 m_surface = Acts::Surface::makeShared<Acts::StrawSurface>(lineBounds, *
this);
168 GeoVDetectorElement{detElem.getMaterialGeom()},
184 auto rectangleBounds =
185 std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
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");
199 GeoAlignmentStore* geoModelStore = store ? store->geoModelAlignment.get() :
nullptr;
203 l2g=
m_detElement->getMaterialGeom()->getAbsoluteTransform(geoModelStore);
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;
234 l2g.translation() *= 1.0 / CLHEP::mm *
length_unit;
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");
285const GeoVDetectorElement *
constexpr double length_unit
Scalar phi() const
phi method
Eigen::Affine3d Transform3D
ActsDetectorElement(const InDetDD::SiDetectorElement &detElem)
Identifier m_explicitIdentifier
std::unique_ptr< const Amg::Transform3D > m_trtTrf
virtual double thickness() const final override
Returns the thickness of the module.
const Acts::Transform3 & getDefaultTransform() const
Returns default transform.
virtual const Acts::Transform3 & transform(const Acts::GeometryContext &gctx) const final override
ActsTrk::DetectorType DetectorType
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.
ActsTrk::TransformCacheDetEle< ActsDetectorElement > m_trfCache
DetectorType detectorType() const override final
Detector type.
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
std::shared_ptr< Acts::Surface > m_surface
Corresponding Surface.
const GeoVDetectorElement * m_detElement
Detector element as variant.
const GeoVDetectorElement * upstreamDetectorElement() const
Returns the underllying GeoModel detectorelement that this one is based on.
virtual const Acts::Surface & surface() const final override
Return surface associated with this identifier, which should come from the.
virtual unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore &alignStore) const override
Caches the aligned transformation in the provided store. Returns the number of cached elements.
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):
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.
@ Trt
Maybe the Sct / Pixel for Itk become seperate entries?
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)
get a rotation transformation around Z-axis
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Translation< double, 3 > Translation3D
#define THROW_EXCEPTION(MESSAGE)