Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:23

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2020 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 http://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 <cstddef>
0016 #include <iosfwd>
0017 
0018 namespace Acts {
0019 
0020 /// @class HomogeneousSurfaceMaterial
0021 ///
0022 /// It extends the ISurfaceMaterial virtual base class to describe
0023 /// a simple homogeneous material on a surface
0024 class HomogeneousSurfaceMaterial : public ISurfaceMaterial {
0025  public:
0026   /// Default Constructor - defaulted
0027   HomogeneousSurfaceMaterial() = default;
0028 
0029   /// Explicit constructor
0030   ///
0031   /// @param full are the full material properties
0032   /// @param splitFactor is the split for pre/post update
0033   /// @param mappingType is the type of surface mapping associated to the surface
0034   HomogeneousSurfaceMaterial(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   HomogeneousSurfaceMaterial& operator=(const HomogeneousSurfaceMaterial& hsm) =
0054       default;
0055 
0056   /// Assignment Move operator
0057   ///
0058   /// @param hsm is the source material
0059   HomogeneousSurfaceMaterial& operator=(HomogeneousSurfaceMaterial&& hsm) =
0060       default;
0061 
0062   /// Scale operator
0063   /// - it is effectively a thickness scaling
0064   ///
0065   /// @param scale is the scale factor
0066   HomogeneousSurfaceMaterial& operator*=(double scale) final;
0067 
0068   /// Equality operator
0069   ///
0070   /// @param hsm is the source material
0071   bool operator==(const HomogeneousSurfaceMaterial& hsm) const;
0072 
0073   /// @copydoc ISurfaceMaterial::materialSlab(const Vector2&) const
0074   ///
0075   /// @note the input parameter is ignored
0076   const MaterialSlab& materialSlab(const Vector2& lp) const final;
0077 
0078   /// @copydoc ISurfaceMaterial::materialSlab(const Vector3&) const
0079   ///
0080   /// @note the input parameter is ignored
0081   const MaterialSlab& materialSlab(const Vector3& gp) const final;
0082 
0083   /// The inherited methods - for MaterialSlab access
0084   using ISurfaceMaterial::materialSlab;
0085 
0086   /// The inherited methods - for scale access
0087   using ISurfaceMaterial::factor;
0088 
0089   /// Output Method for std::ostream
0090   ///
0091   /// @param sl The outoput stream
0092   std::ostream& toStream(std::ostream& sl) const final;
0093 
0094  private:
0095   /// The five different MaterialSlab
0096   MaterialSlab m_fullMaterial = MaterialSlab();
0097 };
0098 
0099 inline const MaterialSlab& HomogeneousSurfaceMaterial::materialSlab(
0100     const Vector2& /*lp*/) const {
0101   return (m_fullMaterial);
0102 }
0103 
0104 inline const MaterialSlab& HomogeneousSurfaceMaterial::materialSlab(
0105     const Vector3& /*gp*/) const {
0106   return (m_fullMaterial);
0107 }
0108 
0109 inline bool HomogeneousSurfaceMaterial::operator==(
0110     const HomogeneousSurfaceMaterial& hsm) const {
0111   return (m_fullMaterial == hsm.m_fullMaterial);
0112 }
0113 
0114 }  // namespace Acts