Skip to content

Commit

Permalink
fix: Further fixes to detray plugin
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stephenswat committed Aug 27, 2024
1 parent e03d106 commit 65110d9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
20 changes: 6 additions & 14 deletions Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <vector>

Expand All @@ -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<detray::default_metadata>;

Expand Down Expand Up @@ -135,10 +128,9 @@ std::tuple<detector_t, vecmem::memory_resource&> 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
10 changes: 8 additions & 2 deletions Tests/DownstreamProject/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<build>/bin`
Expand All @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions thirdparty/detray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65110d9

Please sign in to comment.