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/Blueprint.hpp"
0012 #include "Acts/Detector/DetectorComponents.hpp"
0013 #include "Acts/Detector/interface/IDetectorComponentBuilder.hpp"
0014 #include "Acts/Geometry/GeometryContext.hpp"
0015 #include "Acts/Utilities/AxisDefinitions.hpp"
0016 #include "Acts/Utilities/Logger.hpp"
0017 
0018 #include <memory>
0019 #include <string>
0020 #include <vector>
0021 
0022 namespace Acts::Experimental {
0023 
0024 class IRootVolumeFinderBuilder;
0025 class IGeometryIdGenerator;
0026 
0027 /// @brief A dedicated container builder for cuboid detector containers
0028 ///
0029 /// It relies on the detailed implementation of the CuboidDetectorHelper
0030 /// and allows for DetectorVolume attachment in x/y/z
0031 ///
0032 /// There exists an option to create this container builder (recursively)
0033 /// from a blueprint tree, which attempts to fill in the gap volumes
0034 /// accordingly.
0035 ///
0036 /// @note the builder expects a fully consistent set of sub volume builders
0037 /// that will be executed in a chain
0038 ///
0039 /// @note allowed AxisDirection(s) for the cuboid container builder are
0040 /// {AxisX}, {AxisY}, {AxisZ}.
0041 ///
0042 /// @note Connecting containers isn't functional yet due to the underlying
0043 /// issues in the CuboidDetectorHelper
0044 ///
0045 class CuboidalContainerBuilder : public IDetectorComponentBuilder {
0046  public:
0047   /// Nested configuration object
0048   struct Config {
0049     /// The configured volume builders
0050     std::vector<std::shared_ptr<const IDetectorComponentBuilder>> builders = {};
0051     /// Axis direction for the binning
0052     AxisDirection binning{};
0053     /// The root volume finder
0054     std::shared_ptr<const IRootVolumeFinderBuilder> rootVolumeFinderBuilder =
0055         nullptr;
0056     /// The geometry id generator
0057     std::shared_ptr<const IGeometryIdGenerator> geoIdGenerator = nullptr;
0058     /// An eventual reverse geometry id generation
0059     bool geoIdReverseGen = false;
0060     /// Auxiliary information, mainly for screen output
0061     std::string auxiliary = "";
0062   };
0063 
0064   /// Constructor with configuration struct
0065   ///
0066   /// @param cfg is the configuration struct
0067   /// @param logger logging instance for screen output
0068   CuboidalContainerBuilder(const Config& cfg,
0069                            std::unique_ptr<const Logger> logger =
0070                                getDefaultLogger("CuboidalContainerBuilder",
0071                                                 Logging::INFO));
0072 
0073   /// Constructor from blueprint and logging level
0074   ///
0075   /// It will create recursively the builders of sub volumes
0076   ///
0077   /// @param bpNode is the entry blue print node
0078   /// @param logLevel is the logging output level for the builder tools
0079   ///
0080   /// @note no checking is being done on consistency of the blueprint,
0081   /// it is assumed it has passed first through gap filling via the
0082   /// blueprint helper.
0083   ///
0084   /// @note that the naming of the builders is taken from the bluprint nodes
0085   ///
0086   /// @return a cylindrical container builder representing this blueprint
0087   CuboidalContainerBuilder(const Acts::Experimental::Blueprint::Node& bpNode,
0088                            Acts::Logging::Level logLevel = Acts::Logging::INFO);
0089 
0090   /// The final implementation of the cylindrical container builder
0091   ///
0092   /// @param gctx The geometry context for this call
0093   ///
0094   /// @return an outgoing detector component
0095   DetectorComponent construct(const GeometryContext& gctx) const final;
0096 
0097  private:
0098   /// configuration object
0099   Config m_cfg;
0100 
0101   /// Private access method to the logger
0102   const Logger& logger() const { return *m_logger; }
0103 
0104   /// logging instance
0105   std::unique_ptr<const Logger> m_logger;
0106 };
0107 
0108 }  // namespace Acts::Experimental