Warning, file /acts/Examples/Detectors/Common/include/ActsExamples/DetectorCommons/Aligned.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "ActsExamples/DetectorCommons/AlignmentContext.hpp"
0014
0015 #include <any>
0016
0017 namespace ActsExamples {
0018
0019
0020
0021
0022
0023 template <typename DetectorElement>
0024 class Aligned : public DetectorElement {
0025 public:
0026
0027 using DetectorElement::DetectorElement;
0028
0029
0030
0031 const Acts::Transform3& transform(
0032 const Acts::GeometryContext& gctx) const final {
0033 if (gctx.hasValue()) {
0034 const auto* alignmentContext = gctx.maybeGet<AlignmentContext>();
0035 if (alignmentContext != nullptr && alignmentContext->store != nullptr) {
0036 const auto* transform =
0037 alignmentContext->store->contextualTransform(this->surface());
0038
0039 if (transform != nullptr) {
0040 return *transform;
0041 }
0042 }
0043 }
0044
0045 return DetectorElement::nominalTransform();
0046 }
0047 };
0048
0049 }