Back to home page

EIC code displayed by LXR

 
 

    


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

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/Geometry/GeometryContext.hpp"
0012 #include "Acts/Geometry/ILayerBuilder.hpp"
0013 #include "Acts/Utilities/Logger.hpp"
0014 
0015 #include <memory>
0016 #include <string>
0017 #include <vector>
0018 
0019 namespace Acts {
0020 
0021 class ISurfaceMaterial;
0022 
0023 /// @class PassiveLayerBuilder
0024 ///
0025 /// The PassiveLayerBuilder is able to build cylinder & disc layers with given
0026 /// dimensions and material. The specifications of the layers have to be
0027 /// given by the configuration struct.
0028 
0029 class PassiveLayerBuilder : public ILayerBuilder {
0030  public:
0031   /// @struct Config
0032   /// Configuration struct for the passive layer builder
0033   /// This nested struct is used to configure the layer building
0034   struct Config {
0035     /// string based identification
0036     std::string layerIdentification;
0037 
0038     std::vector<double> centralLayerRadii;        ///< central layer specs
0039     std::vector<double> centralLayerHalflengthZ;  ///< central layer specs
0040     std::vector<double> centralLayerThickness;    ///< central layer specs
0041     std::vector<std::shared_ptr<const ISurfaceMaterial>>
0042         centralLayerMaterial;  ///< central layer specs
0043 
0044     // the layers at p/e side
0045     std::vector<double> posnegLayerPositionZ;  ///< p/n layer specs
0046     std::vector<double> posnegLayerRmin;       ///< p/n layer specs
0047     std::vector<double> posnegLayerRmax;       ///< p/n layer specs
0048     std::vector<double> posnegLayerThickness;  ///< p/n layer specs
0049     std::vector<std::shared_ptr<const ISurfaceMaterial>>
0050         posnegLayerMaterial;  ///< p/n  layer specs
0051   };
0052 
0053   /// Constructor
0054   ///
0055   /// @param plConfig is the ocnfiguration struct that steers behavior
0056   /// @param logger logging instance
0057   PassiveLayerBuilder(const Config& plConfig,
0058                       std::unique_ptr<const Logger> logger = getDefaultLogger(
0059                           "PassiveLayerBuilder", Logging::INFO));
0060 
0061   /// Destructor
0062   ~PassiveLayerBuilder() override = default;
0063 
0064   /// LayerBuilder interface method
0065   ///
0066   /// @param gctx is the geometry context under
0067   /// which the geometry is built
0068   ///
0069   /// @return  the layers at negative side
0070   const LayerVector negativeLayers(const GeometryContext& gctx) const override;
0071 
0072   /// LayerBuilder interface method
0073   ///
0074   /// @param gctx is the geometry context under
0075   /// which the geometry is built
0076   ///
0077   /// @return the layers at the central sector
0078   const LayerVector centralLayers(const GeometryContext& gctx) const override;
0079 
0080   /// LayerBuilder interface method
0081   ///
0082   /// @param gctx is the geometry context under
0083   /// which the geometry is built
0084   ///
0085   /// @return  the layers at positive side
0086   const LayerVector positiveLayers(const GeometryContext& gctx) const override;
0087 
0088   /// Name identification
0089   /// @return the string based identification
0090   const std::string& identification() const override {
0091     return m_cfg.layerIdentification;
0092   }
0093 
0094   /// Set configuration method
0095   ///
0096   /// @param plConfig is a configuration struct
0097   /// it overwrites the current configuration
0098   void setConfiguration(const Config& plConfig);
0099 
0100   /// Get configuration method
0101   Config getConfiguration() const;
0102 
0103   /// Set logging instance
0104   ///
0105   /// @param newLogger the logger instance
0106   void setLogger(std::unique_ptr<const Logger> newLogger);
0107 
0108  protected:
0109   Config m_cfg;  //!< configuration
0110 
0111  private:
0112   /// Helper interface method
0113   ///
0114   /// @param gctx is the geometry context under
0115   /// which the geometry is built
0116   /// @param side is the side of the layer to be built
0117   ///
0118   /// @return  the layers at positive side
0119   const LayerVector endcapLayers(const GeometryContext& gctx, int side) const;
0120 
0121   const Logger& logger() const { return *m_logger; }
0122 
0123   /// logging instance
0124   std::unique_ptr<const Logger> m_logger;
0125 };
0126 
0127 inline PassiveLayerBuilder::Config PassiveLayerBuilder::getConfiguration()
0128     const {
0129   return m_cfg;
0130 }
0131 
0132 }  // namespace Acts