Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-18 08:20:44

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/EventData/SpacePointMutableData.hpp"
0012 #include "Acts/Seeding/SeedFinderConfig.hpp"
0013 
0014 namespace Acts {
0015 
0016 /// @brief A partial description of a circle in u-v space.
0017 struct LinCircle {
0018   LinCircle() = default;
0019   /// Constructor with circle parameters
0020   /// @param ct Cotangent of polar angle theta
0021   /// @param idr Inverse delta radius
0022   /// @param er Error on radius
0023   /// @param u U coordinate
0024   /// @param v V coordinate
0025   /// @param X X coordinate
0026   /// @param Y Y coordinate
0027   LinCircle(float ct, float idr, float er, float u, float v, float X, float Y)
0028       : cotTheta(ct), iDeltaR(idr), Er(er), U(u), V(v), x(X), y(Y) {}
0029 
0030   /// Cotangent of polar angle theta in coordinate transformation
0031   float cotTheta{0.};
0032   /// Inverse delta radius between space points
0033   float iDeltaR{0.};
0034   /// Error term in circle fitting for u-v transformation
0035   float Er{0.};
0036   /// U coordinate in transformed coordinate system
0037   float U{0.};
0038   /// V coordinate in transformed coordinate system
0039   float V{0.};
0040   /// X coordinate in local coordinate system
0041   float x{0.};
0042   /// Y coordinate in local coordinate system
0043   float y{0.};
0044 };
0045 
0046 /// Transform a single spacepoint to u-v space coordinates
0047 /// @tparam external_spacepoint_t The external spacepoint type
0048 /// @tparam callable_t The callable type for coordinate extraction
0049 /// @param mutableData Container for mutable variables used in seeding
0050 /// @param sp The spacepoint to transform
0051 /// @param spM The middle reference spacepoint
0052 /// @param bottom Whether this is a bottom spacepoint
0053 /// @param extractFunction Function to extract coordinates from spacepoints
0054 /// @return LinCircle representing the transformed coordinates
0055 template <typename external_spacepoint_t, typename callable_t>
0056 LinCircle transformCoordinates(Acts::SpacePointMutableData& mutableData,
0057                                const external_spacepoint_t& sp,
0058                                const external_spacepoint_t& spM, bool bottom,
0059                                callable_t&& extractFunction);
0060 
0061 /// @brief Transform a vector of spacepoints to u-v space circles with respect
0062 /// to a given middle spacepoint.
0063 ///
0064 /// @tparam external_spacepoint_t The external spacepoint type.
0065 ///
0066 /// @param mutableData Container for mutable variables used in the seeding
0067 /// @param[in] vec The list of bottom or top spacepoints
0068 /// @param[in] spM The middle spacepoint.
0069 /// @param[in] bottom Should be true if vec are bottom spacepoints.
0070 /// @param[out] linCircleVec The output vector to write to.
0071 template <typename external_spacepoint_t>
0072 void transformCoordinates(Acts::SpacePointMutableData& mutableData,
0073                           const std::vector<const external_spacepoint_t*>& vec,
0074                           const external_spacepoint_t& spM, bool bottom,
0075                           std::vector<LinCircle>& linCircleVec);
0076 
0077 /// @brief Check the compatibility of spacepoint coordinates in xyz assuming the Bottom-Middle direction with the strip meassument details
0078 ///
0079 /// @tparam external_spacepoint_t The external spacepoint type.
0080 ///
0081 /// @param[in] config SeedFinder config containing the delegates to the strip measurement details.
0082 /// @param[in] sp Input space point used in the check.
0083 /// @param[in] spacepointPosition Spacepoint coordinates in xyz plane.
0084 /// @param[out] outputCoordinates The output vector to write to.
0085 /// @returns Boolean that says if spacepoint is compatible with being inside the detector element.
0086 template <typename external_spacepoint_t>
0087 bool xyzCoordinateCheck(
0088     const Acts::SeedFinderConfig<external_spacepoint_t>& config,
0089     const external_spacepoint_t& sp, const double* spacepointPosition,
0090     double* outputCoordinates);
0091 
0092 }  // namespace Acts
0093 
0094 #include "Acts/Seeding/SeedFinderUtils.ipp"