Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:22

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2018 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Geometry/BoundarySurfaceFace.hpp"
0012 #include "Acts/Utilities/BinnedArray.hpp"
0013 
0014 #include <iosfwd>
0015 #include <map>
0016 #include <memory>
0017 #include <string>
0018 #include <vector>
0019 
0020 namespace Acts {
0021 
0022 class TrackingVolume;
0023 
0024 using TrackingVolumePtr = std::shared_ptr<const TrackingVolume>;
0025 using TrackingVolumeArray = BinnedArray<TrackingVolumePtr>;
0026 
0027 ///  @class GlueVolumesDescriptor
0028 ///
0029 /// Descriptor class to hold GlueVolumes of a TrackingGeometry object.
0030 /// Should ease the wrapping of a TrackingGeometry object describing one
0031 /// Detector
0032 /// by another one.
0033 ///
0034 class GlueVolumesDescriptor {
0035  public:
0036   /// Constructor
0037   GlueVolumesDescriptor() = default;
0038   /// Constructor - with arguments
0039   ///
0040   /// @param gvs are the glue volume arrays mapped to the volume faces
0041   GlueVolumesDescriptor(
0042       const std::map<BoundarySurfaceFace,
0043                      std::shared_ptr<const TrackingVolumeArray>>& gvs);
0044 
0045   /// Destructor
0046   ~GlueVolumesDescriptor() = default;
0047   /// Register the volumes
0048   ///
0049   /// @param bsf is the boundary surface face where the volume array is attached
0050   /// @param gvs is the array of volumes to be attached
0051   void registerGlueVolumes(Acts::BoundarySurfaceFace bsf,
0052                            std::shared_ptr<const TrackingVolumeArray> gvs);
0053 
0054   /// Retrieve the glue volumes
0055   ///
0056   /// @param bsf is the boundary surface face for which you want to get the
0057   /// array
0058   ///
0059   /// @return the shared pointer to the TrackingVolume array
0060   std::shared_ptr<const TrackingVolumeArray> glueVolumes(
0061       BoundarySurfaceFace bsf) const;
0062 
0063   /// Retrieve the available Glue Faces
0064   /// @return the list of faces for which glue information is there
0065   const std::vector<BoundarySurfaceFace>& glueFaces() const;
0066 
0067   /// Dump it to the screen
0068   std::string screenOutput() const;
0069 
0070  private:
0071   std::map<BoundarySurfaceFace, std::shared_ptr<const TrackingVolumeArray>>
0072       m_glueVolumes;
0073   std::vector<BoundarySurfaceFace> m_glueFaces;
0074 };
0075 
0076 inline const std::vector<BoundarySurfaceFace>&
0077 GlueVolumesDescriptor::glueFaces() const {
0078   return m_glueFaces;
0079 }
0080 
0081 std::ostream& operator<<(std::ostream& sl, const GlueVolumesDescriptor& gvd);
0082 }  // namespace Acts