Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-09 08:17:47

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   /// @copydoc ISurfaceMaterial::localAxisDirections() const
0095   std::vector<AxisDirection> localAxisDirections() const final { return {}; }
0096 
0097   /// Return method for full material description of the Surface - from the
0098   /// global coordinates
0099   ///
0100   /// @return will return dummy material
0101   /// @deprecated Use materialSlab(const Vector2&) with a prior
0102   ///             Surface::globalToLocal() call instead.
0103   [[deprecated(
0104       "Use materialSlab(const Vector2& lp) with a prior "
0105       "Surface::globalToLocal() call instead")]] const MaterialSlab&
0106   materialSlab(const Vector3& /*gp*/) const final {
0107     return (m_materialSlab);
0108   }
0109 
0110   using ISurfaceMaterial::materialSlab;
0111 
0112   /// Output Method for std::ostream, to be overloaded by child classes
0113   ///
0114   /// @param sl is the output stream
0115   /// @return The output stream
0116   std::ostream& toStream(std::ostream& sl) const final {
0117     sl << "Acts::ProtoSurfaceMaterial : " << std::endl;
0118     sl << m_binning << std::endl;
0119     return sl;
0120   }
0121 
0122  private:
0123   /// A binning description
0124   BinningType m_binning;
0125 
0126   /// Dummy material properties
0127   MaterialSlab m_materialSlab = MaterialSlab::Nothing();
0128 };
0129 
0130 /// @brief Type alias for a prototype surface material using BinUtility
0131 /// A surface material implementation that uses BinUtility for binning
0132 using ProtoSurfaceMaterial = ProtoSurfaceMaterialT<Acts::BinUtility>;
0133 
0134 /// @brief Type alias for a prototype surface material using a grid of ProtoAxis
0135 /// A surface material implementation that uses a vector of ProtoAxis for
0136 /// grid-based binning
0137 using ProtoGridSurfaceMaterial =
0138     ProtoSurfaceMaterialT<std::vector<DirectedProtoAxis>>;
0139 
0140 /// @}
0141 
0142 }  // namespace Acts