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/Material/IVolumeMaterial.hpp"
0013 #include "Acts/Material/Material.hpp"
0014 #include "Acts/Utilities/BinUtility.hpp"
0015 
0016 #include <iosfwd>
0017 
0018 namespace Acts {
0019 
0020 /// @class ProtoVolumeMaterial
0021 ///
0022 /// @brief proxy to VolumeMaterial hand over BinUtility
0023 ///
0024 /// The ProtoVolumeMaterial class acts as a proxy to the VolumeMaterial
0025 /// to mark the volume on which the material should be mapped on
0026 /// at construction time of the geometry and to hand over the granularity of
0027 /// of the material map with the bin Utility.
0028 
0029 class ProtoVolumeMaterial : public IVolumeMaterial {
0030  public:
0031   /// Constructor without BinUtility - homogeneous material
0032   ProtoVolumeMaterial() = default;
0033 
0034   /// Constructor with BinUtility - multidimensional material
0035   ///
0036   /// @param binUtility a BinUtility determining the granularity
0037   ///        and binning of the material on the volume
0038   ProtoVolumeMaterial(const BinUtility& binUtility);
0039 
0040   /// Copy constructor
0041   ///
0042   /// @param vmproxy The source proxy
0043   ProtoVolumeMaterial(const ProtoVolumeMaterial& vmproxy) = default;
0044 
0045   /// Copy move constructor
0046   ///
0047   /// @param vmproxy The source proxy
0048   ProtoVolumeMaterial(ProtoVolumeMaterial&& vmproxy) = default;
0049 
0050   /// Destructor
0051   ///
0052   ~ProtoVolumeMaterial() override = default;
0053 
0054   /// Return the BinUtility
0055   const BinUtility& binUtility() const;
0056 
0057   /// Assignment operator
0058   ///
0059   /// @param vmproxy The source proxy
0060   ProtoVolumeMaterial& operator=(const ProtoVolumeMaterial& vmproxy) = default;
0061 
0062   /// Return the material
0063   const Material material(const Vector3& /*position*/) const final;
0064 
0065   /// Output Method for std::ostream
0066   ///
0067   /// @param sl The outoput stream
0068   std::ostream& toStream(std::ostream& sl) const final;
0069 
0070  private:
0071   BinUtility m_binUtility;
0072   Material m_material;
0073 };
0074 
0075 inline const Acts::Material Acts::ProtoVolumeMaterial::material(
0076     const Acts::Vector3& /*position*/) const {
0077   return m_material;
0078 }
0079 
0080 inline const Acts::BinUtility& Acts::ProtoVolumeMaterial::binUtility() const {
0081   return m_binUtility;
0082 }
0083 
0084 }  // namespace Acts