Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-24 07:35:30

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 // For whatever reason, this compilation unit does not compile
0010 // with those assertions and GCC 13. For now just disable the
0011 // flags in this case.
0012 #if defined(_GLIBCXX_ASSERTIONS) && __GNUC__ == 13
0013 #undef _GLIBCXX_ASSERTIONS
0014 #endif
0015 
0016 #include "ActsPlugins/Json/DetrayJsonHelper.hpp"
0017 
0018 namespace Acts::DetrayJsonHelper {
0019 
0020 std::size_t accelerationLink(std::span<const AxisDirection> casts) {
0021   // Default is `brute_force`
0022   using enum AxisDirection;
0023   std::size_t accLink = 0u;
0024   if (casts.size() == 2u) {
0025     if (casts[0u] == AxisX && casts[1u] == AxisY) {
0026       accLink = 1u;
0027     } else if (casts[0u] == AxisR && casts[1u] == AxisPhi) {
0028       accLink = 3u;
0029     } else if (casts[0u] == AxisZ && casts[1u] == AxisPhi) {
0030       accLink = 4u;
0031     } else if (casts[0u] == AxisZ && casts[1u] == AxisR) {
0032       accLink = 5u;
0033     }
0034   } else if (casts.size() == 3u) {
0035     if (casts[0u] == AxisX && casts[1u] == AxisY && casts[2u] == AxisZ) {
0036       accLink = 2u;
0037     } else if (casts[0u] == AxisZ && casts[1u] == AxisPhi &&
0038                casts[2u] == AxisR) {
0039       accLink = 5u;
0040     }
0041   }
0042   return accLink;
0043 }
0044 }  // namespace Acts::DetrayJsonHelper