|
| 1 | +// This file is part of the ACTS project. |
| 2 | +// |
| 3 | +// Copyright (C) 2016 CERN for the benefit of the ACTS project |
| 4 | +// |
| 5 | +// This Source Code Form is subject to the terms of the Mozilla Public |
| 6 | +// License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 | +// file, You can obtain one at https://mozilla.org/MPL/2.0/. |
| 8 | + |
| 9 | +#include "Acts/Geometry/GeometryModuleLoader.hpp" |
| 10 | +#include "Acts/Utilities/Logger.hpp" |
| 11 | + |
| 12 | +#include <filesystem> |
| 13 | + |
| 14 | +#ifdef ACTS_BUILD_PLUGIN_DD4HEP |
| 15 | +#include "ActsPlugins/DD4hep/GeometryModuleLoader.hpp" |
| 16 | + |
| 17 | +#include <DD4hep/Detector.h> |
| 18 | +#endif |
| 19 | + |
| 20 | +void exampleLoadPlainModule(const Acts::Logger& logger, |
| 21 | + const std::filesystem::path& modulePath) { |
| 22 | + //! [Load Plain Module] |
| 23 | + auto geometry = Acts::loadGeometryModule(modulePath, logger); |
| 24 | + // 'geometry' is a std::shared_ptr<Acts::TrackingGeometry>. |
| 25 | + // The shared library stays loaded until 'geometry' is destroyed. |
| 26 | + //! [Load Plain Module] |
| 27 | + (void)geometry; |
| 28 | +} |
| 29 | + |
| 30 | +#ifdef ACTS_BUILD_PLUGIN_DD4HEP |
| 31 | +void exampleLoadDD4hepModule(const dd4hep::Detector& detector, |
| 32 | + const Acts::Logger& logger, |
| 33 | + const std::filesystem::path& modulePath) { |
| 34 | + //! [Load DD4hep Module] |
| 35 | + auto geometry = |
| 36 | + Acts::loadDD4hepGeometryModule(modulePath, detector, logger); |
| 37 | + // 'geometry' is a std::shared_ptr<Acts::TrackingGeometry>. |
| 38 | + // The shared library stays loaded until 'geometry' is destroyed. |
| 39 | + //! [Load DD4hep Module] |
| 40 | + (void)geometry; |
| 41 | +} |
| 42 | +#endif |
0 commit comments