Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 08:21:04

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 /// @ingroup material
0023 ///
0024 /// @brief proxy to VolumeMaterial hand over BinUtility
0025 ///
0026 /// The ProtoVolumeMaterial class acts as a proxy to the VolumeMaterial
0027 /// to mark the volume 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 
0031 class ProtoVolumeMaterial : public IVolumeMaterial {
0032  public:
0033   /// Constructor without BinUtility - homogeneous material
0034   ProtoVolumeMaterial() = default;
0035 
0036   /// Constructor with BinUtility - multidimensional material
0037   ///
0038   /// @param binUtility a BinUtility determining the granularity
0039   ///        and binning of the material on the volume
0040   explicit ProtoVolumeMaterial(const BinUtility& binUtility);
0041 
0042   /// Copy constructor
0043   ///
0044   /// @param vmproxy The source proxy
0045   ProtoVolumeMaterial(const ProtoVolumeMaterial& vmproxy) = default;
0046 
0047   /// Copy move constructor
0048   ///
0049   /// @param vmproxy The source proxy
0050   ProtoVolumeMaterial(ProtoVolumeMaterial&& vmproxy) = default;
0051 
0052   /// Destructor
0053   ///
0054   ~ProtoVolumeMaterial() override = default;
0055 
0056   /// Return the BinUtility
0057   /// @return Const reference to the bin utility for this material
0058   const BinUtility& binUtility() const;
0059 
0060   /// Assignment operator
0061   ///
0062   /// @param vmproxy The source proxy
0063   /// @return Reference to this material proxy for assignment chaining
0064   ProtoVolumeMaterial& operator=(const ProtoVolumeMaterial& vmproxy) = default;
0065 
0066   /// Return the material
0067   /// @return The vacuum material (always the same as this is a proxy)
0068   const Material material(const Vector3& /*position*/) const final;
0069 
0070   /// Output Method for std::ostream
0071   ///
0072   /// @param sl The outoput stream
0073   /// @return Reference to the output stream for method chaining
0074   std::ostream& toStream(std::ostream& sl) const final;
0075 
0076  private:
0077   BinUtility m_binUtility;
0078   Material m_material = Material::Vacuum();
0079 };
0080 
0081 inline const Acts::Material Acts::ProtoVolumeMaterial::material(
0082     const Acts::Vector3& /*position*/) const {
0083   return m_material;
0084 }
0085 
0086 inline const Acts::BinUtility& Acts::ProtoVolumeMaterial::binUtility() const {
0087   return m_binUtility;
0088 }
0089 
0090 }  // namespace Acts