Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-27 07:24:50

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Surfaces/Surface.hpp"
0014 #include "Acts/Utilities/Result.hpp"
0015 
0016 #include <array>
0017 #include <tuple>
0018 
0019 namespace ActsFatras {
0020 
0021 /// The PlanarSurfaceDrift takes an intersection in the nominal surface and
0022 /// projects the ends into the readout surface, which can be at : -1, 0, 1
0023 ///
0024 /// A Lorentz drift angle can be applied.
0025 ///
0026 /// A single implementation handles all supported surface types; the readout
0027 /// frame is selected internally from `surface.type()`:
0028 ///   - Plane / Disc : the Cartesian local frame (x, y), surface normal = local
0029 ///     z. (For discs the polar conversion is done downstream in SurfaceMask /
0030 ///     Segmentizer, consistent with the historical behaviour.)
0031 ///   - Cylinder     : the unrolled readout frame (rPhi, z), surface normal =
0032 ///     radial direction. rPhi = R * phi is the tangential arc length at the
0033 ///     cylinder radius.
0034 ///
0035 /// In every case the in-plane "x"/"y" coordinates carry the same physical
0036 /// (length) units, so the downstream masking and segmentation are identical.
0037 struct SurfaceDrift {
0038   /// Shorthand for a 2D segment - drifted segment in 2D readout coordinates
0039   using Segment2D = std::array<Acts::Vector2, 2>;
0040   /// Shorthand for a 3D segment - undrifted segment in the local 3D frame
0041   using Segment3D = std::array<Acts::Vector3, 2>;
0042 
0043   /// Drift the full 3D segment onto the surface 2D readout frame.
0044   ///
0045   ///
0046   /// @param gctx The current Geometry context
0047   /// @param surface The nominal intersection surface
0048   /// @param thickness The emulated module/depletion thickness
0049   /// @param pos The position in global coordinates
0050   /// @param dir The direction in global coordinates
0051   /// @param driftDir The drift direction in the readout-local frame
0052   ///                 (plane/disc: local x, y, normal; cylinder: tangential,
0053   ///                 axial, radial). A direction with no perpendicular
0054   ///                 component emulates a 3D pixel sensor / no Lorentz drift.
0055   ///
0056   /// @note The readout is always emulated at the central surface,
0057   /// as the mask will be deployed there, and the measurement is
0058   /// presented there.
0059   ///
0060   /// @return a tuple of the (drifted) Segment2D on the readout surface
0061   /// ( @note without masking ) and the original undrifted 3D segment, or a
0062   /// DigitizationError if the track is parallel to the surface.
0063   Acts::Result<std::tuple<Segment2D, Segment3D>> toReadout(
0064       const Acts::GeometryContext& gctx, const Acts::Surface& surface,
0065       double thickness, const Acts::Vector3& pos, const Acts::Vector3& dir,
0066       const Acts::Vector3& driftDir = Acts::Vector3(0., 0., 0.)) const;
0067 };
0068 
0069 }  // namespace ActsFatras