Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:46:21

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 #if !defined(__unix__) && !defined(__APPLE__)
0012 #error \
0013     "Runtime geometry modules are only supported on Unix-like systems (Linux, macOS)."
0014 #endif
0015 
0016 #include "Acts/Utilities/Logger.hpp"
0017 
0018 #include <filesystem>
0019 #include <memory>
0020 
0021 namespace Acts {
0022 
0023 class TrackingGeometry;
0024 
0025 /// Load a module shared library, validate ABI compatibility, build and return
0026 /// the tracking geometry. The returned deleter keeps the module loaded until
0027 /// the geometry is destroyed. Throws if the module requires user data (e.g.
0028 /// a DD4hep module) — use the appropriate typed loader instead.
0029 /// @param modulePath Path to the geometry module shared library.
0030 /// @param logger Logger instance used by the module loader.
0031 /// @return Shared pointer to the loaded tracking geometry.
0032 std::shared_ptr<TrackingGeometry> loadGeometryModule(
0033     const std::filesystem::path& modulePath,
0034     const Logger& logger = getDummyLogger());
0035 
0036 namespace detail {
0037 /// Low-level loader used by typed wrappers (e.g. loadDD4hepGeometryModule).
0038 /// Validates that the module's ABI tag matches \a expectedAbiTag.
0039 /// Validates that the module's user_data_type matches \a expectedUserDataType
0040 /// (nullptr means the module must declare no user data requirement).
0041 std::shared_ptr<TrackingGeometry> loadGeometryModuleImpl(
0042     const std::filesystem::path& modulePath, const char* expectedAbiTag,
0043     const char* expectedUserDataType, const void* userData,
0044     const Logger& logger);
0045 }  // namespace detail
0046 
0047 }  // namespace Acts