Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:18

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Detector/DetectorComponents.hpp"
0013 #include "Acts/Detector/interface/IExternalStructureBuilder.hpp"
0014 #include "Acts/Geometry/Extent.hpp"
0015 #include "Acts/Geometry/GeometryContext.hpp"
0016 #include "Acts/Geometry/VolumeBounds.hpp"
0017 #include "Acts/Utilities/Logger.hpp"
0018 
0019 #include <optional>
0020 #include <string>
0021 
0022 namespace Acts::Experimental {
0023 
0024 /// This class provides the external detector volume structure, configured
0025 /// either from:
0026 ///
0027 ///  - a volume extent
0028 ///  - from an array with volume bounds identification
0029 ///
0030 /// @note A starting transform (defaulted to identity) can be provided,
0031 /// in case of volume bounds construction from an ```Acts::Extent```
0032 /// object, the transform steming from the extent definition will
0033 /// be applied on top of the provided starting transform.
0034 /// In case of volume bounds construction from an array of values,
0035 /// the starting transform is already the final volume placement.
0036 class VolumeStructureBuilder : public IExternalStructureBuilder {
0037  public:
0038   /// Nexted configuration struct
0039   struct Config {
0040     /// A defined volume bound type
0041     VolumeBounds::BoundsType boundsType = VolumeBounds::BoundsType::eOther;
0042     /// The starting transform
0043     Transform3 transform = Transform3::Identity();
0044     /// The values (if already defined)
0045     std::vector<ActsScalar> boundValues = {};
0046     /// The optional extent to feed into the values
0047     std::optional<Extent> extent = std::nullopt;
0048     /// Some auxiliary information
0049     std::string auxiliary = "";
0050   };
0051 
0052   /// Constructor
0053   ///
0054   /// @param cfg is the configuration struct
0055   /// @param mlogger logging instance for screen output
0056   VolumeStructureBuilder(const Config& cfg,
0057                          std::unique_ptr<const Logger> mlogger =
0058                              getDefaultLogger("VolumeStructureBuilder",
0059                                               Logging::INFO));
0060 
0061   /// The interface definition for internal structure creation
0062   ///
0063   /// @param gctx the geometry context at the creation of the internal structure
0064   ///
0065   /// @return a consistent set of detector volume internals
0066   ExternalStructure construct(const GeometryContext& gctx) const final;
0067 
0068  private:
0069   /// configuration object
0070   Config m_cfg;
0071 
0072   /// Private access method to the logger
0073   const Logger& logger() const { return *m_logger; }
0074 
0075   /// logging instance
0076   std::unique_ptr<const Logger> m_logger;
0077 };
0078 
0079 }  // namespace Acts::Experimental