Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-19 07:35:25

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 
0015 #include <iosfwd>
0016 
0017 namespace Acts {
0018 
0019 /// @ingroup material
0020 ///
0021 /// It extends the ISurfaceMaterial virtual base class to describe
0022 /// a simple homogeneous material on a surface
0023 class HomogeneousSurfaceMaterial : public ISurfaceMaterial {
0024  public:
0025   /// Default Constructor - defaulted
0026   HomogeneousSurfaceMaterial() = default;
0027 
0028   /// Explicit constructor
0029   ///
0030   /// @param full are the full material properties
0031   /// @param splitFactor is the split for pre/post update
0032   /// @param mappingType is the type of surface mapping associated to the surface
0033   explicit HomogeneousSurfaceMaterial(
0034       const MaterialSlab& full, double splitFactor = 1.,
0035       MappingType mappingType = MappingType::Default);
0036 
0037   /// Copy Constructor
0038   ///
0039   /// @param hsm is the source material
0040   HomogeneousSurfaceMaterial(const HomogeneousSurfaceMaterial& hsm) = default;
0041 
0042   /// Copy Move Constructor
0043   ///
0044   /// @param hsm is the source material
0045   HomogeneousSurfaceMaterial(HomogeneousSurfaceMaterial&& hsm) = default;
0046 
0047   /// Destructor
0048   ~HomogeneousSurfaceMaterial() override = default;
0049 
0050   /// Assignment operator
0051   ///
0052   /// @param hsm is the source material
0053   /// @return Reference to this material after assignment
0054   HomogeneousSurfaceMaterial& operator=(const HomogeneousSurfaceMaterial& hsm) =
0055       default;
0056 
0057   /// Assignment Move operator
0058   ///
0059   /// @param hsm is the source material
0060   /// @return Reference to this material after move assignment
0061   HomogeneousSurfaceMaterial& operator=(HomogeneousSurfaceMaterial&& hsm) =
0062       default;
0063 
0064   /// Scale operator
0065   /// - it is effectively a thickness scaling
0066   ///
0067   /// @param factor is the scale factor
0068   /// @return Reference to this scaled material
0069   HomogeneousSurfaceMaterial& scale(double factor) final;
0070 
0071   /// @copydoc ISurfaceMaterial::materialSlab(const Vector2&) const
0072   ///
0073   /// @note the input parameter is ignored
0074   const MaterialSlab& materialSlab(const Vector2& lp = Vector2{0.,
0075                                                                0.}) const final;
0076 
0077   /// @copydoc ISurfaceMaterial::localAxisDirections() const
0078   std::vector<AxisDirection> localAxisDirections() const final;
0079 
0080   /// @copydoc ISurfaceMaterial::materialSlab(const Vector3&) const
0081   ///
0082   /// @note the input parameter is ignored
0083   [[deprecated(
0084       "Use materialSlab(const Vector2& lp) with a prior "
0085       "Surface::globalToLocal() call instead")]] const MaterialSlab&
0086   materialSlab(const Vector3& gp) const final;
0087 
0088   // Inherit additional materialSlab overloads from base class
0089   using ISurfaceMaterial::materialSlab;
0090 
0091   /// The inherited methods - for scale access
0092   ///
0093   /// @param pDir Direction through the surface
0094   /// @param mode Material update directive
0095   /// @return The scaling factor for the material
0096   using ISurfaceMaterial::factor;
0097 
0098   /// Output Method for std::ostream
0099   ///
0100   /// @param sl The outoput stream
0101   /// @return Reference to the output stream for chaining
0102   std::ostream& toStream(std::ostream& sl) const final;
0103 
0104  private:
0105   /// The five different MaterialSlab
0106   MaterialSlab m_fullMaterial = MaterialSlab::Nothing();
0107 
0108   /// @brief Check if two materials are exactly equal.
0109   ///
0110   /// This is a strict equality check, i.e. the materials must have identical
0111   /// properties.
0112   ///
0113   /// @param lhs is the left hand side material
0114   /// @param rhs is the right hand side material
0115   ///
0116   /// @return true if the materials are equal
0117   friend constexpr bool operator==(const HomogeneousSurfaceMaterial& lhs,
0118                                    const HomogeneousSurfaceMaterial& rhs) {
0119     return lhs.m_fullMaterial == rhs.m_fullMaterial;
0120   }
0121 };
0122 
0123 }  // namespace Acts