|
|
|||
File indexing completed on 2025-12-11 09:40:21
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/Definitions/Units.hpp" 0012 #include "Acts/Detector/LayerStructureBuilder.hpp" 0013 #include "Acts/Geometry/Extent.hpp" 0014 #include "Acts/Utilities/BinningData.hpp" 0015 #include "Acts/Utilities/Logger.hpp" 0016 #include "Acts/Utilities/ProtoAxis.hpp" 0017 #include "ActsPlugins/DD4hep/DD4hepDetectorElement.hpp" 0018 #include "ActsPlugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp" 0019 0020 #include <memory> 0021 #include <optional> 0022 #include <string> 0023 #include <tuple> 0024 0025 namespace dd4hep { 0026 class DetElement; 0027 } 0028 0029 namespace ActsPlugins { 0030 0031 /// @brief This class allows to generate layer structure builders for dd4hep sub detectors 0032 /// It performs an intermediate step by taking dd4hep::DetElemnent objects that 0033 /// describe a detector structure and prepares the translation of the detector 0034 /// element and eventual passive surfaces. 0035 /// 0036 /// It would also build passive support structures if configured to do so. 0037 /// 0038 class DD4hepLayerStructure { 0039 public: 0040 /// Constructor with DD4hepDetectorSurfaceFactory 0041 /// 0042 /// @param surfaceFactory the surfac factory which converts dd4hep::DetElement objects 0043 /// into their Acts coutnerparts 0044 /// @param logger is the screen output logger 0045 /// 0046 /// @note this needs to be provided 0047 explicit DD4hepLayerStructure( 0048 std::shared_ptr<DD4hepDetectorSurfaceFactory> surfaceFactory, 0049 std::unique_ptr<const Acts::Logger> logger = 0050 Acts::getDefaultLogger("DD4hepLayerStructure", Acts::Logging::INFO)); 0051 0052 DD4hepLayerStructure() = delete; 0053 0054 /// @brief Nested options struct 0055 /// 0056 /// If a binning description or a support cylinder 0057 /// description is chosen through options, it overwrites the corresponding 0058 /// description coming from DD4hep. 0059 struct Options { 0060 /// The name of the object 0061 std::string name = ""; 0062 /// An out put log level 0063 Acts::Logging::Level logLevel = Acts::Logging::INFO; 0064 std::optional<Acts::Extent> extent = std::nullopt; 0065 /// The extent structure - optionally 0066 /// The extent constraints - optionally 0067 std::vector<Acts::AxisDirection> extentConstraints = {}; 0068 /// Approximation for the polyhedron binning 0069 unsigned int quarterSegments = 1u; 0070 /// Patch the binning with the extent if possible 0071 bool patchBinningWithExtent = true; 0072 /// Conversion options 0073 DD4hepDetectorSurfaceFactory::Options conversionOptions; 0074 }; 0075 0076 /// @brief This method generates a LayerStructure builder, which extends the 0077 /// IInternalStructureBuilder and can be used in the conjunction with a 0078 /// IExternalStructureBuilder to create `DetectorVolume` objects. 0079 /// 0080 /// It takes the detector element from DD4hep and some optional parameters 0081 /// 0082 /// @param dd4hepStore [in, out] the detector store for the built elements 0083 /// @param gctx the geometry context 0084 /// @param dd4hepElement the dd4hep detector element 0085 /// @param options containing the optional descriptions 0086 /// 0087 /// @return a LayerStructureBuilder, and an optional extent 0088 std::tuple<std::shared_ptr<Acts::Experimental::LayerStructureBuilder>, 0089 std::optional<Acts::Extent>> 0090 builder(DD4hepDetectorElement::Store& dd4hepStore, 0091 const Acts::GeometryContext& gctx, 0092 const dd4hep::DetElement& dd4hepElement, 0093 const Options& options) const; 0094 0095 private: 0096 /// The workorse: the surface factory 0097 std::shared_ptr<DD4hepDetectorSurfaceFactory> m_surfaceFactory = nullptr; 0098 0099 /// Logging instance 0100 std::unique_ptr<const Acts::Logger> m_logger; 0101 0102 /// Private access to the logger 0103 const Acts::Logger& logger() const { return *m_logger; } 0104 }; 0105 0106 } // namespace ActsPlugins
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|