Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-27 07:55:12

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