1#include "Tracking/geo/DetectorElement.h"
3#include "Tracking/geo/GeometryContext.h"
7DetectorElement::~DetectorElement(){};
9const Acts::Transform3& DetectorElement::transform(
10 const Acts::GeometryContext& gctx)
const {
12 throw std::logic_error(
"DetectorElement:: Sensor/Element ID not set");
22 if (elementId > 9999) {
27 auto ctx = gctx.get<GeometryContext*>();
30 if ((ctx->alignment_map).count(elementId) > 0) {
31 const Acts::Transform3& c_transform = ctx->alignment_map[elementId];
34 std::cout <<
"Aligned transform" << std::endl;
35 std::cout << c_transform.translation() << std::endl;
36 std::cout << c_transform.rotation() << std::endl;
37 std::cout <<
"Original transform" << std::endl;
38 std::cout << m_transform.translation() << std::endl;
39 std::cout << m_transform.rotation() << std::endl;
49const Acts::Surface& DetectorElement::surface()
const {
51 throw std::logic_error(
52 "DetectorElement::Attempted to return reference of null ptr");
55Acts::Surface& DetectorElement::surface() {
57 throw std::logic_error(
58 "DetectorElement::Attempted to return reference of null ptr");
64double DetectorElement::thickness()
const {
66 auto material =
static_cast<const Acts::HomogeneousSurfaceMaterial*
>(
67 m_surface->surfaceMaterial());
68 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.