16 return Vector3D(tMatrix(0, 3), tMatrix(1, 3), tMatrix(2, 3));
26 if (m_transform !=
nullptr) {
27 return (*(m_transform.get()));
29 if (m_associatedDetElement !=
nullptr) {
30 return m_associatedDetElement->transform(gctx);
35 inline bool Surface::insideBounds(
const Vector2D& lposition,
37 return bounds().inside(lposition, bcheck);
43 return transform(gctx).matrix().block<3, 3>(0, 0);
57 const double x = direction(0);
58 const double y = direction(1);
59 const double z = direction(2);
62 const double cos_theta =
z;
63 const double sin_theta = sqrt(x * x + y * y);
64 const double inv_sin_theta = 1. / sin_theta;
65 const double cos_phi = x * inv_sin_theta;
66 const double sin_phi = y * inv_sin_theta;
68 const auto rframe = referenceFrame(gctx, position, direction);
70 jacobian.topLeftCorner<3, 2>() = rframe.topLeftCorner<3, 2>();
74 jacobian(4,
ePHI) = (-sin_theta) * sin_phi;
75 jacobian(4,
eTHETA) = cos_theta * cos_phi;
76 jacobian(5,
ePHI) = sin_theta * cos_phi;
77 jacobian(5,
eTHETA) = cos_theta * sin_phi;
78 jacobian(6,
eTHETA) = (-sin_theta);
79 jacobian(7,
eQOP) = 1;
86 const double x = direction(0);
87 const double y = direction(1);
88 const double z = direction(2);
90 const double cosTheta =
z;
91 const double sinTheta = sqrt(x * x + y * y);
92 const double invSinTheta = 1. / sinTheta;
93 const double cosPhi = x * invSinTheta;
94 const double sinPhi = y * invSinTheta;
97 referenceFrame(gctx, position, direction).transpose();
99 jacobian.block<2, 3>(0, 0) = rframeT.block<2, 3>(0, 0);
103 jacobian(
ePHI, 4) = -sinPhi * invSinTheta;
104 jacobian(
ePHI, 5) = cosPhi * invSinTheta;
105 jacobian(
eTHETA, 4) = cosPhi * cosTheta;
106 jacobian(
eTHETA, 5) = sinPhi * cosTheta;
107 jacobian(
eTHETA, 6) = -sinTheta;
108 jacobian(
eQOP, 7) = 1;
119 norm_vec /= (norm_vec * direction);
125 return m_associatedDetElement;
128 inline const Layer* Surface::associatedLayer()
const {
129 return (m_associatedLayer);
133 return m_surfaceMaterial.get();
136 inline const std::shared_ptr<const ISurfaceMaterial>&
137 Surface::surfaceMaterialSharedPtr()
const {
138 return m_surfaceMaterial;
141 inline void Surface::assignSurfaceMaterial(
142 std::shared_ptr<const ISurfaceMaterial>
material) {
143 m_surfaceMaterial = std::move(material);
146 inline void Surface::associateLayer(
const Layer& lay) {
147 m_associatedLayer = (&lay);