Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-11 08:00:31

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/Algebra.hpp"
0012 #include "Acts/Material/ISurfaceMaterial.hpp"
0013 #include "Acts/Material/MaterialSlab.hpp"
0014 #include "Acts/Utilities/BinUtility.hpp"
0015 #include "Acts/Utilities/ProtoAxis.hpp"
0016 
0017 #include <iosfwd>
0018 #include <vector>
0019 
0020 namespace Acts {
0021 
0022 /// @addtogroup material
0023 /// @{
0024 
0025 ///
0026 /// @brief proxy to SurfaceMaterial hand over BinUtility or other suitable
0027 /// binning description
0028 ///
0029 /// The ProtoSurfaceMaterial class acts as a proxy to the SurfaceMaterial
0030 /// to mark the layers and surfaces on which the material should be mapped on
0031 /// at construction time of the geometry and to hand over the granularity of
0032 /// of the material map with the bin Utility.
0033 template <typename BinningType>
0034 class ProtoSurfaceMaterialT : public ISurfaceMaterial {
0035  public:
0036   /// Constructor without binningType - homogeneous material
0037   ProtoSurfaceMaterialT() = default;
0038 
0039   /// Constructor with BinningType
0040   /// @param binning a binning description for the material map binning
0041   /// @param mappingType is the type of surface mapping associated to the surface
0042   explicit ProtoSurfaceMaterialT(const BinningType& binning,
0043                                  MappingType mappingType = MappingType::Default)
0044       : ISurfaceMaterial(1., mappingType), m_binning(binning) {}
0045 
0046   /// Copy constructor
0047   ///
0048   /// @param smproxy The source proxy
0049   ProtoSurfaceMaterialT(const ProtoSurfaceMaterialT<BinningType>& smproxy) =
0050       default;
0051 
0052   /// Copy move constructor
0053   ///
0054   /// @param smproxy The source proxy
0055   ProtoSurfaceMaterialT(ProtoSurfaceMaterialT<BinningType>&& smproxy) noexcept =
0056       default;
0057 
0058   /// Destructor
0059   ~ProtoSurfaceMaterialT() override = default;
0060 
0061   /// Assignment operator
0062   ///
0063   /// @param smproxy The source proxy
0064   /// @return Reference to this object
0065   ProtoSurfaceMaterialT<BinningType>& operator=(
0066       const ProtoSurfaceMaterialT<BinningType>& smproxy) = default;
0067 
0068   /// Assignment move operator
0069   ///
0070   /// @param smproxy The source proxy
0071   /// @return Reference to this object
0072   ProtoSurfaceMaterialT<BinningType>& operator=(
0073       ProtoSurfaceMaterialT<BinningType>&& smproxy) noexcept = default;
0074 
0075   /// Scale operation - dummy implementation
0076   ///
0077   /// @return Reference to this object
0078   ProtoSurfaceMaterialT<BinningType>& scale(double /*factor*/) final {
0079     return (*this);
0080   }
0081 
0082   /// Return the BinUtility
0083   /// @return Reference to the binning
0084   const BinningType& binning() const { return (m_binning); }
0085 
0086   /// Return method for full material description of the Surface - from local
0087   /// coordinates
0088   ///
0089   /// @return will return dummy material
0090   const MaterialSlab& materialSlab(const Vector2& /*lp*/) const final {
0091     return (m_materialSlab);
0092   }
0093 
0094   /// Return method for full material description of the Surface - from the
0095   /// global coordinates
0096   ///
0097   /// @return will return dummy material
0098   const MaterialSlab& materialSlab(const Vector3& /*gp*/) const final {
0099     return (m_materialSlab);
0100   }
0101 
0102   using ISurfaceMaterial::materialSlab;
0103 
0104   /// Output Method for std::ostream, to be overloaded by child classes
0105   ///
0106   /// @param sl is the output stream
0107   /// @return The output stream
0108   std::ostream& toStream(std::ostream& sl) const final {
0109     sl << "Acts::ProtoSurfaceMaterial : " << std::endl;
0110     sl << m_binning << std::endl;
0111     return sl;
0112   }
0113 
0114  private:
0115   /// A binning description
0116   BinningType m_binning;
0117 
0118   /// Dummy material properties
0119   MaterialSlab m_materialSlab = MaterialSlab::Nothing();
0120 };
0121 
0122 /// @brief Type alias for a prototype surface material using BinUtility
0123 /// A surface material implementation that uses BinUtility for binning
0124 using ProtoSurfaceMaterial = ProtoSurfaceMaterialT<Acts::BinUtility>;
0125 
0126 /// @brief Type alias for a prototype surface material using a grid of ProtoAxis
0127 /// A surface material implementation that uses a vector of ProtoAxis for
0128 /// grid-based binning
0129 using ProtoGridSurfaceMaterial =
0130     ProtoSurfaceMaterialT<std::vector<DirectedProtoAxis>>;
0131 
0132 /// @}
0133 
0134 }  // namespace Acts