EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlaneSurface.ipp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PlaneSurface.ipp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 inline Vector3D PlaneSurface::normal(const GeometryContext& gctx,
10  const Vector2D& /*lpos*/) const {
11  // fast access via tranform matrix (and not rotation())
12  const auto& tMatrix = transform(gctx).matrix();
13  return Vector3D(tMatrix(0, 2), tMatrix(1, 2), tMatrix(2, 2));
14 }
15 
16 inline Vector3D PlaneSurface::binningPosition(const GeometryContext& gctx,
17  BinningValue /*bValue*/) const {
18  return center(gctx);
19 }
20 
21 inline double PlaneSurface::pathCorrection(const GeometryContext& gctx,
22  const Vector3D& position,
23  const Vector3D& direction) const {
24  // We can ignore the global position here
25  return 1. / std::abs(Surface::normal(gctx, position).dot(direction));
26 }
27 
29  const GeometryContext& gctx, const Vector3D& position,
30  const Vector3D& direction, const BoundaryCheck& bcheck) const {
31  // Get the contextual transform
32  const auto& gctxTransform = transform(gctx);
33  // Use the intersection helper for planar surfaces
34  auto intersection =
35  PlanarHelper::intersect(gctxTransform, position, direction);
36  // Evaluate boundary check if requested (and reachable)
37  if (intersection.status != Intersection3D::Status::unreachable and bcheck) {
38  // Built-in local to global for speed reasons
39  const auto& tMatrix = gctxTransform.matrix();
40  // Create the reference vector in local
41  const Vector3D vecLocal(intersection.position - tMatrix.block<3, 1>(0, 3));
42  if (not insideBounds(tMatrix.block<3, 2>(0, 0).transpose() * vecLocal,
43  bcheck)) {
44  intersection.status = Intersection3D::Status::missed;
45  }
46  }
47  return {intersection, this};
48 }
49 
51 PlaneSurface::localCartesianToBoundLocalDerivative(
52  const GeometryContext& /*unused*/, const Vector3D& /*unused*/) const {
53  const LocalCartesianToBoundLocalMatrix loc3DToLocBound =
54  LocalCartesianToBoundLocalMatrix::Identity();
55  return loc3DToLocBound;
56 }