Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:22:27

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