Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-30 07:45:39

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 
0015 #include <iosfwd>
0016 
0017 namespace Acts {
0018 
0019 /// @class HomogeneousVolumeMaterial
0020 ///
0021 /// @ingroup material
0022 ///
0023 /// It extends the IVolumeMaterial base class to describe a simple
0024 /// homogeneous material in a volume
0025 class HomogeneousVolumeMaterial : public IVolumeMaterial {
0026  public:
0027   /// Explicit constructor
0028   ///
0029   /// @param material is the material held by this
0030   explicit HomogeneousVolumeMaterial(const Material& material);
0031 
0032   /// Copy Constructor
0033   ///
0034   /// @param hvm is the source material
0035   HomogeneousVolumeMaterial(const HomogeneousVolumeMaterial& hvm) = default;
0036 
0037   /// Copy Move Constructor
0038   ///
0039   /// @param hvm is the source material
0040   HomogeneousVolumeMaterial(HomogeneousVolumeMaterial&& hvm) = default;
0041 
0042   /// Destructor
0043   ~HomogeneousVolumeMaterial() override = default;
0044 
0045   /// Assignment operator
0046   ///
0047   /// @param hvm is the source material
0048   /// @return Reference to this object for assignment chaining
0049   HomogeneousVolumeMaterial& operator=(const HomogeneousVolumeMaterial& hvm) =
0050       default;
0051 
0052   /// Access to actual material
0053   ///
0054   /// @param position is the request position for the material call
0055   /// @note @p position is ignored
0056   /// @todo interface to change including 'cell'
0057   /// @return The homogeneous material properties at any position
0058   const Material material(const Vector3& position) const final;
0059 
0060   /// Output Method for std::ostream
0061   ///
0062   /// @param sl The outoput stream
0063   /// @return Reference to the output stream for method chaining
0064   std::ostream& toStream(std::ostream& sl) const final;
0065 
0066  private:
0067   Material m_material;
0068 
0069   /// @brief Check if two materials are exactly equal.
0070   ///
0071   /// This is a strict equality check, i.e. the materials must have identical
0072   /// properties.
0073   ///
0074   /// @param lhs is the left hand side material
0075   /// @param rhs is the right hand side material
0076   ///
0077   /// @return true if the materials are equal
0078   friend constexpr bool operator==(const HomogeneousVolumeMaterial& lhs,
0079                                    const HomogeneousVolumeMaterial& rhs) {
0080     return lhs.m_material == rhs.m_material;
0081   }
0082 };
0083 
0084 }  // namespace Acts