1#include "Tracking/geo/DetectorElement.h"
5#include "Acts/Material/HomogeneousSurfaceMaterial.hpp"
6#include "Framework/Exception/Exception.h"
7#include "Tracking/geo/GeoUtils.h"
8#include "Tracking/geo/GeometryContext.h"
12DetectorElement::~DetectorElement() {};
14const Acts::Transform3& DetectorElement::localToGlobalTransform(
15 const Acts::GeometryContext& gctx)
const {
17 EXCEPTION_RAISE(
"BadGeometry",
18 "DetectorElement:: Sensor/Element ID not set");
28 if (element_id > 9999) {
33 auto ctx = gctx.get<GeometryContext*>();
36 if ((ctx->alignment_map_).count(element_id) > 0) {
37 const Acts::Transform3& c_transform = ctx->alignment_map_[element_id];
41 std::cout <<
"Aligned transform" << std::endl;
42 std::cout << c_transform.translation() << std::endl;
43 std::cout << c_transform.rotation() << std::endl;
44 std::cout <<
"Original transform" << std::endl;
45 std::cout << m_transform_.translation() << std::endl;
46 std::cout << m_transform_.rotation() << std::endl;
56const Acts::Surface& DetectorElement::surface()
const {
60 "DetectorElement::Attempted to return reference of null ptr");
63Acts::Surface& DetectorElement::surface() {
67 "DetectorElement::Attempted to return reference of null ptr");
73double DetectorElement::thickness()
const {
75 auto material =
static_cast<const Acts::HomogeneousSurfaceMaterial*
>(
76 m_surface_->surfaceMaterial());
77 return material->materialSlab(Acts::Vector2{0., 0.}).thickness();
unsigned int unpackGeometryIdentifier(const Acts::GeometryIdentifier &geoId)
The geometry identifier will return vol=0 and lay=0 when it is not valid.