Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-18 07:35:20

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/ISurfaceMaterial.hpp"
0013 #include "Acts/Material/MaterialSlab.hpp"
0014 #include "Acts/Utilities/BinUtility.hpp"
0015 
0016 #include <iosfwd>
0017 
0018 namespace Acts {
0019 
0020 /// @ingroup material
0021 ///
0022 /// It extends the @ref ISurfaceMaterial base class and is an array pf
0023 /// MaterialSlab. This is not memory optimised as every bin
0024 /// holds one material property object.
0025 class BinnedSurfaceMaterial : public ISurfaceMaterial {
0026  public:
0027   /// Default Constructor - deleted
0028   BinnedSurfaceMaterial() = delete;
0029 
0030   /// Explicit constructor with only full MaterialSlab,
0031   /// for one-dimensional binning.
0032   ///
0033   /// The split factors:
0034   ///    - 1. : oppositePre
0035   ///    - 0. : alongPre
0036   ///  ===> 1 Dimensional array
0037   ///
0038   /// @param binUtility defines the binning structure on the surface (copied)
0039   /// @param fullProperties is the vector of properties as recorded (moved)
0040   /// @param splitFactor is the pre/post splitting directive
0041   /// @param mappingType is the type of surface mapping associated to the surface
0042   BinnedSurfaceMaterial(const BinUtility& binUtility,
0043                         MaterialSlabVector fullProperties,
0044                         double splitFactor = 0.,
0045                         MappingType mappingType = MappingType::Default);
0046 
0047   /// Explicit constructor with only full MaterialSlab,
0048   /// for two-dimensional binning.
0049   ///
0050   /// The split factors:
0051   ///    - 1. : oppositePre
0052   ///    - 0. : alongPre
0053   ///  ===> 1 Dimensional array
0054   ///
0055   /// @param binUtility defines the binning structure on the surface (copied)
0056   /// @param fullProperties is the vector of properties as recorded (moved)
0057   /// @param splitFactor is the pre/post splitting directive
0058   /// @param mappingType is the type of surface mapping associated to the surface
0059   BinnedSurfaceMaterial(const BinUtility& binUtility,
0060                         MaterialSlabMatrix fullProperties,
0061                         double splitFactor = 0.,
0062                         MappingType mappingType = MappingType::Default);
0063 
0064   /// Copy Move Constructor
0065   ///
0066   /// @param bsm is the source object to be copied
0067   BinnedSurfaceMaterial(BinnedSurfaceMaterial&& bsm) = default;
0068 
0069   /// Copy Constructor
0070   ///
0071   /// @param bsm is the source object to be copied
0072   BinnedSurfaceMaterial(const BinnedSurfaceMaterial& bsm) = default;
0073 
0074   /// Assignment Move operator
0075   /// @param bsm The source object to move from
0076   /// @return Reference to this object after move assignment
0077   BinnedSurfaceMaterial& operator=(BinnedSurfaceMaterial&& bsm) = default;
0078 
0079   /// Assignment operator
0080   /// @param bsm The source object to copy from
0081   /// @return Reference to this object after copy assignment
0082   BinnedSurfaceMaterial& operator=(const BinnedSurfaceMaterial& bsm) = default;
0083 
0084   /// Destructor
0085   ~BinnedSurfaceMaterial() override = default;
0086 
0087   /// Scale operation
0088   ///
0089   /// @param factor is the scale factor for the full material
0090   /// @return Reference to this object after scaling
0091   BinnedSurfaceMaterial& scale(double factor) final;
0092 
0093   /// Return the BinUtility
0094   /// @return Reference to the bin utility used for material binning
0095   const BinUtility& binUtility() const;
0096 
0097   /// @brief Retrieve the entire material slab matrix
0098   /// @return Reference to the complete matrix of material slabs
0099   const MaterialSlabMatrix& fullMaterial() const;
0100 
0101   /// @copydoc ISurfaceMaterial::materialSlab(const Vector2&) const
0102   const MaterialSlab& materialSlab(const Vector2& lp) const final;
0103 
0104   /// @copydoc ISurfaceMaterial::materialSlab(const Vector3&) const
0105   const MaterialSlab& materialSlab(const Vector3& gp) const final;
0106 
0107   using ISurfaceMaterial::materialSlab;
0108 
0109   /// Output Method for std::ostream, to be overloaded by child classes
0110   /// @param sl The output stream to write to
0111   /// @return Reference to the output stream after writing
0112   std::ostream& toStream(std::ostream& sl) const final;
0113 
0114  private:
0115   /// The helper for the bin finding
0116   BinUtility m_binUtility;
0117 
0118   /// The five different MaterialSlab
0119   MaterialSlabMatrix m_fullMaterial;
0120 };
0121 
0122 inline const BinUtility& BinnedSurfaceMaterial::binUtility() const {
0123   return m_binUtility;
0124 }
0125 
0126 inline const MaterialSlabMatrix& BinnedSurfaceMaterial::fullMaterial() const {
0127   return m_fullMaterial;
0128 }
0129 
0130 }  // namespace Acts