forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgeometry_module.cpp
More file actions
41 lines (35 loc) · 1.43 KB
/
geometry_module.cpp
File metadata and controls
41 lines (35 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// This file is part of the ACTS project.
//
// Copyright (C) 2016 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#include "Acts/Geometry/GeometryModuleLoader.hpp"
#include "Acts/Utilities/Logger.hpp"
#include <filesystem>
#ifdef ACTS_BUILD_PLUGIN_DD4HEP
#include "ActsPlugins/DD4hep/GeometryModuleLoader.hpp"
#include <DD4hep/Detector.h>
#endif
void exampleLoadPlainModule(const Acts::Logger& logger,
const std::filesystem::path& modulePath) {
//! [Load Plain Module]
auto geometry = Acts::loadGeometryModule(modulePath, logger);
// 'geometry' is a std::shared_ptr<Acts::TrackingGeometry>.
// The shared library stays loaded until 'geometry' is destroyed.
//! [Load Plain Module]
(void)geometry;
}
#ifdef ACTS_BUILD_PLUGIN_DD4HEP
void exampleLoadDD4hepModule(const dd4hep::Detector& detector,
const Acts::Logger& logger,
const std::filesystem::path& modulePath) {
//! [Load DD4hep Module]
auto geometry = Acts::loadDD4hepGeometryModule(modulePath, detector, logger);
// 'geometry' is a std::shared_ptr<Acts::TrackingGeometry>.
// The shared library stays loaded until 'geometry' is destroyed.
//! [Load DD4hep Module]
(void)geometry;
}
#endif