From 65110d9a5704adaf14d0d690166f0cb4a524b75a Mon Sep 17 00:00:00 2001 From: Stephen Nicholas Swatman Date: Thu, 22 Aug 2024 16:26:58 +0200 Subject: [PATCH] fix: Further fixes to detray plugin This commit makes several minor changes to the detray plugin: 1. It fixes a bug in the detray conversion code. 2. It adds the detray plugin to the downstream project. 3. It disables the build of the detray CUDA code, which we don't need. --- .../Acts/Plugins/Detray/DetrayConverter.hpp | 20 ++++++------------- Tests/DownstreamProject/CMakeLists.txt | 10 ++++++++-- thirdparty/detray/CMakeLists.txt | 5 +++++ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp b/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp index ff332d6d2a6..05eb5e17e00 100644 --- a/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp +++ b/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp @@ -10,8 +10,11 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Detector/Detector.hpp" +#include "Acts/Detector/DetectorVolume.hpp" +#include "Acts/Detector/Portal.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/VolumeBounds.hpp" +#include "Acts/Surfaces/Surface.hpp" #include @@ -23,17 +26,7 @@ #include "detray/io/frontend/payloads.hpp" #include "detray/utils/consistency_checker.hpp" -namespace Acts { - -class Surface; -class SurfaceBounds; - -namespace Experimental { -class DetectorVolume; -class Portal; -} // namespace Experimental - -namespace DetrayConverter { +namespace Acts::DetrayConverter { using DetrayDetector = detray::detector; @@ -135,10 +128,9 @@ std::tuple convertDetector( // checks and print detray::detail::check_consistency(detrayDetector); - converterPrint(detrayDetector, names); + writeToJson(detrayDetector, names); return {std::move(detrayDetector), mr}; } -} // namespace DetrayConverter -} // namespace Acts +} // namespace Acts::DetrayConverter diff --git a/Tests/DownstreamProject/CMakeLists.txt b/Tests/DownstreamProject/CMakeLists.txt index 27f2f10583b..73eaacdce4d 100644 --- a/Tests/DownstreamProject/CMakeLists.txt +++ b/Tests/DownstreamProject/CMakeLists.txt @@ -7,7 +7,7 @@ find_package( Acts CONFIG REQUIRED - COMPONENTS Core Fatras PluginJson PluginLegacy PluginTGeo + COMPONENTS Core Fatras PluginJson PluginLegacy PluginTGeo PluginDetray ) # place artifacts in GNU-like paths, e.g. binaries in `/bin` @@ -24,7 +24,13 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY add_executable(ShowActsVersion ShowActsVersion.cpp) target_link_libraries( ShowActsVersion - PRIVATE ActsCore ActsFatras ActsPluginJson ActsPluginLegacy ActsPluginTGeo + PRIVATE + ActsCore + ActsFatras + ActsPluginJson + ActsPluginLegacy + ActsPluginTGeo + ActsPluginDetray ) option(DD4HEP "Build with DD4hep" ON) diff --git a/thirdparty/detray/CMakeLists.txt b/thirdparty/detray/CMakeLists.txt index c24b260b0ff..d07bd4a02db 100644 --- a/thirdparty/detray/CMakeLists.txt +++ b/thirdparty/detray/CMakeLists.txt @@ -30,6 +30,11 @@ set(DETRAY_CUSTOM_SCALARTYPE "Scalar type to use in the Detray code" ) +set(DETRAY_BUILD_CUDA + OFF + CACHE BOOL + "Turn off the build of the Detray CUDA code" +) set(DETRAY_BUILD_TESTING OFF CACHE BOOL