30 class DetectorElementBase;
37 m_bounds(std::make_shared<const
LineBounds>(radius, halez)) {}
40 std::shared_ptr<const LineBounds> lbounds)
67 const Vector3& direction)
const {
68 Vector3 unitZ0 = lineDirection(gctx);
71 Vector3 radiusAxisGlobal = unitZ0.cross(direction);
76 lposition[
eBoundLoc0] * radiusAxisGlobal.normalized());
86 Vector3 localPosition = referenceFrame(gctx, position, direction).inverse() *
87 (position -
transform(gctx).translation());
95 if (std::abs(localPosition.z()) > std::abs(tolerance)) {
100 Vector2 localXY = localPosition.head<2>();
106 return "Acts::LineSurface";
111 const Vector3& direction)
const {
112 Vector3 unitZ0 = lineDirection(gctx);
113 Vector3 unitD0 = unitZ0.cross(direction).normalized();
114 Vector3 unitDistance = unitD0.cross(unitZ0);
117 mFrame.col(0) = unitD0;
118 mFrame.col(1) = unitZ0;
119 mFrame.col(2) = unitDistance;
137 throw std::runtime_error(
138 "LineSurface: normal is undefined without known direction");
143 return (*m_bounds.get());
160 Vector3 eb = lineDirection(gctx);
164 double eaTeb = ea.dot(eb);
165 double denom = 1 - eaTeb * eaTeb;
169 if (std::abs(denom) < std::abs(tolerance)) {
174 double u = (mab.dot(ea) - mab.dot(eb) * eaTeb) / denom;
177 ? Intersection3D::Status::reachable
178 : Intersection3D::Status::onSurface;
182 if (bcheck and m_bounds) {
184 Vector3 vecLocal = result - mb;
185 double cZ = vecLocal.dot(eb);
187 if ((std::abs(cZ) > std::abs(hZ)) or
188 ((vecLocal - cZ * eb).
norm() >
190 status = Intersection3D::Status::missed;
207 double cosTheta = std::cos(boundParams[
eBoundTheta]);
208 double sinTheta = std::sin(boundParams[eBoundTheta]);
209 double cosPhi = std::cos(boundParams[
eBoundPhi]);
210 double sinPhi = std::sin(boundParams[eBoundPhi]);
212 auto rframe = referenceFrame(gctx, position, direction);
218 jacToGlobal.topLeftCorner<3, 2>() = rframe.topLeftCorner<3, 2>();
222 jacToGlobal(
eFreeDir0, eBoundPhi) = -sinTheta * sinPhi;
223 jacToGlobal(
eFreeDir0, eBoundTheta) = cosTheta * cosPhi;
224 jacToGlobal(
eFreeDir1, eBoundPhi) = sinTheta * cosPhi;
225 jacToGlobal(
eFreeDir1, eBoundTheta) = cosTheta * sinPhi;
226 jacToGlobal(
eFreeDir2, eBoundTheta) = -sinTheta;
230 double ipdn = 1. / direction.dot(rframe.col(2));
233 jacToGlobal.block<3, 1>(
eFreeDir0, eBoundPhi));
236 jacToGlobal.block<3, 1>(
eFreeDir0, eBoundTheta));
238 dDPhiY -= rframe.block<3, 1>(0, 0) * (rframe.block<3, 1>(0, 0).dot(dDPhiY));
240 rframe.block<3, 1>(0, 0) * (rframe.block<3, 1>(0, 0).dot(dDThetaY));
257 Vector3 pcRowVec = position - center(gctx);
259 Vector3 localZAxis = lineDirection(gctx);
261 double pz = pcRowVec.dot(localZAxis);
263 double dz = localZAxis.dot(direction);
264 double norm = 1 / (1 - dz *
dz);
271 norm * (dz * localZAxis.transpose() - direction.transpose());
275 norm * (pz * localZAxis.transpose() - pcRowVec.transpose());
287 Vector3 pcRowVec = position - center(gctx);
289 Vector3 localZAxis = lineDirection(gctx);
291 double pz = pcRowVec.dot(localZAxis);
293 double dz = localZAxis.dot(direction);
294 double norm = 1 / (1 - dz *
dz);
296 auto [rotToLocalXAxis, rotToLocalYAxis, rotToLocalZAxis] =
303 norm * (direction.transpose() - dz * localZAxis.transpose());
305 norm * (dz * pcRowVec.transpose() + pz * direction.transpose()) *
318 loc3DToLocBound << std::cos(localPhi), std::sin(localPhi), 0, 0, 0, 1;
320 return loc3DToLocBound;