Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-30 07:51: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/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   explicit PassiveLayerBuilder(const Config& plConfig,
0058                                std::unique_ptr<const Logger> logger =
0059                                    getDefaultLogger("PassiveLayerBuilder",
0060                                                     Logging::INFO));
0061 
0062   /// Destructor
0063   ~PassiveLayerBuilder() override = default;
0064 
0065   /// LayerBuilder interface method
0066   ///
0067   /// @param gctx is the geometry context under
0068   /// which the geometry is built
0069   ///
0070   /// @return  the layers at negative side
0071   const LayerVector negativeLayers(const GeometryContext& gctx) const override;
0072 
0073   /// LayerBuilder interface method
0074   ///
0075   /// @param gctx is the geometry context under
0076   /// which the geometry is built
0077   ///
0078   /// @return the layers at the central sector
0079   const LayerVector centralLayers(const GeometryContext& gctx) const override;
0080 
0081   /// LayerBuilder interface method
0082   ///
0083   /// @param gctx is the geometry context under
0084   /// which the geometry is built
0085   ///
0086   /// @return  the layers at positive side
0087   const LayerVector positiveLayers(const GeometryContext& gctx) const override;
0088 
0089   /// Name identification
0090   /// @return the string based identification
0091   const std::string& identification() const override {
0092     return m_cfg.layerIdentification;
0093   }
0094 
0095   /// Set configuration method
0096   ///
0097   /// @param plConfig is a configuration struct
0098   /// it overwrites the current configuration
0099   void setConfiguration(const Config& plConfig);
0100 
0101   /// Get configuration method
0102   Config getConfiguration() const;
0103 
0104   /// Set logging instance
0105   ///
0106   /// @param newLogger the logger instance
0107   void setLogger(std::unique_ptr<const Logger> newLogger);
0108 
0109  protected:
0110   Config m_cfg;  //!< configuration
0111 
0112  private:
0113   /// Helper interface method
0114   ///
0115   /// @param gctx is the geometry context under
0116   /// which the geometry is built
0117   /// @param side is the side of the layer to be built
0118   ///
0119   /// @return  the layers at positive side
0120   const LayerVector endcapLayers(const GeometryContext& gctx, int side) const;
0121 
0122   const Logger& logger() const { return *m_logger; }
0123 
0124   /// logging instance
0125   std::unique_ptr<const Logger> m_logger;
0126 };
0127 
0128 inline PassiveLayerBuilder::Config PassiveLayerBuilder::getConfiguration()
0129     const {
0130   return m_cfg;
0131 }
0132 
0133 }  // namespace Acts