Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-14 08:25:12

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Surfaces/SurfaceBounds.hpp"
0012 #include "Acts/Utilities/BinningType.hpp"
0013 
0014 #include <span>
0015 #include <tuple>
0016 
0017 #include <nlohmann/json.hpp>
0018 
0019 namespace Acts::DetrayJsonHelper {
0020 
0021 /// @brief Helper function to switch keys from ACTS to detray
0022 ///
0023 /// DETRAY types @todo change to detray imports when available
0024 ///    annulus2 = 0u,
0025 ///    cuboid3 = 1u,
0026 ///    cylinder2 = 2u,
0027 ///    cylinder3 = 3u,
0028 ///    portal_cylinder2 = 4u,
0029 ///    rectangle2 = 5u,
0030 ///    ring2 = 6u,
0031 ///    trapezoid2 = 7u,
0032 ///    cell_wire = 8u,
0033 ///    straw_wire = 9u,
0034 ///    single1 = 10u,
0035 ///    single2 = 11u,
0036 ///    single3 = 12u,
0037 ///    unknown = 13u
0038 ///
0039 /// @param sBounds is the surface bounds type
0040 /// @param portal is the flag for conversion into detray portal format
0041 ///
0042 /// @return type and value array in detray format
0043 std::tuple<unsigned int, std::vector<ActsScalar>> maskFromBounds(
0044     const Acts::SurfaceBounds& sBounds, bool portal = false);
0045 
0046 /// @brief add volume link
0047 ///
0048 /// @param jSurface [in,out] is the json object to be patched
0049 /// @param vLink is the volume link to be added
0050 void addVolumeLink(nlohmann::json& jSurface, int vLink);
0051 
0052 /// Determine the acceleration link from a grid
0053 ///
0054 ///
0055 ///   brute_force = 0u,      // try all
0056 ///   cartesian2_grid = 1u,  // rectangle, trapezoid, (triangle) grids
0057 ///   cuboid3_grid = 2u,     // cuboid grid
0058 ///   polar2_grid = 3u,      // ring/disc, annulus grids
0059 ///   cylinder2_grid = 4u,   // 2D cylinder grid
0060 ///   cylinder3_grid = 5u,   // 3D cylinder grid
0061 ///
0062 /// @param casts are the grid axes cast types
0063 ///
0064 /// @return the acceleration link idnetifier
0065 std::size_t accelerationLink(std::span<const BinningValue> casts);
0066 
0067 }  // namespace Acts::DetrayJsonHelper