File indexing completed on 2025-01-18 09:11:43
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/DetectorCommons/Detector.hpp"
0010
0011 #include "Acts/Detector/Detector.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Geometry/TrackingGeometry.hpp"
0014 #include "Acts/Utilities/Logger.hpp"
0015 #include "ActsExamples/Framework/IContextDecorator.hpp"
0016
0017 namespace ActsExamples {
0018
0019 Detector::Detector(std::unique_ptr<const Acts::Logger> logger)
0020 : m_logger(std::move(logger)) {}
0021
0022 Detector::~Detector() = default;
0023
0024 std::vector<std::shared_ptr<IContextDecorator>> Detector::contextDecorators()
0025 const {
0026 return m_contextDecorators;
0027 }
0028
0029 std::unique_ptr<G4VUserDetectorConstruction>
0030 Detector::buildGeant4DetectorConstruction(
0031 const Geant4ConstructionOptions& ) const {
0032 throw std::runtime_error("Geant4 detector construction is not available.");
0033 }
0034
0035 const Acts::GeometryContext& Detector::nominalGeometryContext() const {
0036 return m_nominalGeometryContext;
0037 }
0038
0039 std::shared_ptr<const Acts::TrackingGeometry> Detector::trackingGeometry()
0040 const {
0041 if (m_trackingGeometry == nullptr) {
0042 throw std::runtime_error("Tracking geometry is not built");
0043 }
0044 return m_trackingGeometry;
0045 }
0046
0047 std::shared_ptr<Acts::Experimental::Detector> Detector::gen2Geometry() const {
0048 if (m_gen2Geometry == nullptr) {
0049 throw std::runtime_error("Gen2 geometry is not built");
0050 }
0051 return m_gen2Geometry;
0052 }
0053
0054 const Acts::Logger& Detector::logger() const {
0055 return *m_logger;
0056 }
0057
0058 }