Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:54

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