Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:43

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 #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& /*options*/) 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 }  // namespace ActsExamples