Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:45

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 #include "Acts/Detector/interface/IDetectorBuilder.hpp"
0012 #include "Acts/Detector/interface/IDetectorComponentBuilder.hpp"
0013 #include "Acts/Utilities/Logger.hpp"
0014 
0015 #include <memory>
0016 #include <string>
0017 
0018 namespace Acts {
0019 
0020 class IMaterialDecorator;
0021 
0022 namespace Experimental {
0023 
0024 class IGeometryIdGenerator;
0025 
0026 /// @brief Standard generic Detector builder that calls
0027 /// the top level component builder and transfers the
0028 /// result into a detector object
0029 ///
0030 /// @note This is the last builder in the chain and the
0031 /// the returned detector object is const and cannot be
0032 /// modified anymore.
0033 class DetectorBuilder final : public IDetectorBuilder {
0034  public:
0035   /// Nested configuration object
0036   struct Config {
0037     /// The name of the volume to be built
0038     std::string name = "unnamed";
0039     /// An external builder
0040     std::shared_ptr<const IDetectorComponentBuilder> builder = nullptr;
0041     /// A geometry id generator
0042     std::shared_ptr<const IGeometryIdGenerator> geoIdGenerator = nullptr;
0043     /// A material decorator
0044     std::shared_ptr<const IMaterialDecorator> materialDecorator = nullptr;
0045     /// Auxiliary information
0046     std::string auxiliary = "";
0047   };
0048 
0049   /// Constructor with configuration arguments
0050   ///
0051   /// @param cfg is the configuration struct
0052   /// @param mlogger logging instance for screen output
0053   DetectorBuilder(const Config& cfg,
0054                   std::unique_ptr<const Logger> mlogger =
0055                       getDefaultLogger("DetectorBuilder", Logging::INFO));
0056 
0057   /// Final implementation of a volume builder that is purely defined
0058   /// by an internal and external structure builder
0059   ///
0060   /// @param gctx The geometry context for this call
0061   ///
0062   /// @return an outgoing detector component
0063   std::shared_ptr<const Detector> construct(
0064       const GeometryContext& gctx) const final;
0065 
0066  private:
0067   /// configuration object
0068   Config m_cfg;
0069 
0070   /// Private access method to the logger
0071   const Logger& logger() const { return *m_logger; }
0072 
0073   /// logging instance
0074   std::unique_ptr<const Logger> m_logger;
0075 };
0076 
0077 }  // namespace Experimental
0078 }  // namespace Acts