Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Acts/Material/ProtoSurfaceMaterial.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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