Back to home page

EIC code displayed by LXR

 
 

    


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

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/Geometry/PortalShell.hpp"
0013 #include "Acts/Geometry/TrackingVolume.hpp"
0014 #include "Acts/Geometry/TrapezoidVolumeBounds.hpp"
0015 #include "Acts/Utilities/AxisDefinitions.hpp"
0016 #include "Acts/Utilities/Logger.hpp"
0017 
0018 namespace Acts {
0019 
0020 /// @class TrapezoidPortalShell
0021 /// Base class for trapezoid shaped portal shells, e.g. shells for trapezoid
0022 /// volumes
0023 class TrapezoidPortalShell : public PortalShellBase {
0024  public:
0025   /// Type alias for trapezoid volume face enumeration
0026   using Face = TrapezoidVolumeBounds::Face;
0027 
0028   using enum TrapezoidVolumeBounds::Face;
0029 
0030   /// Retrieve a shared_ptr for the portal associated to the given face. Can be
0031   /// nullptr if unset.
0032   /// @param face The face to retrieve the portal for
0033   /// @return The portal associated to the face
0034   virtual std::shared_ptr<Portal> portal(Face face) = 0;
0035 
0036   /// Set the portal associated to the given face.
0037   /// @param portal The portal to set
0038   /// @param face The face to set the portal
0039   virtual void setPortal(std::shared_ptr<Portal> portal, Face face) = 0;
0040 
0041   /// @copydoc PortalShellBase::fill
0042   void fill(TrackingVolume& volume) override;
0043 };
0044 
0045 /// Output stream operator for the TrapezoidPortalShell::Face enum
0046 /// @param os The output stream
0047 /// @param face The face to output
0048 /// @return The output stream
0049 std::ostream& operator<<(std::ostream& os, TrapezoidPortalShell::Face face);
0050 
0051 /// @class SingleTrapezoidPortalShell
0052 /// This class describes a trapezoid shell containing a single volume.
0053 class SingleTrapezoidPortalShell : public TrapezoidPortalShell {
0054  public:
0055   /// Construct a single trapezoid shell for the given tracking volume.
0056   /// @param gctx The current geometry context object, e.g. alignment
0057   /// @param volume The volume to create the shell for
0058   explicit SingleTrapezoidPortalShell(const GeometryContext& gctx,
0059                                       TrackingVolume& volume);
0060 
0061   /// @copydoc PortalShellBase::size
0062   std::size_t size() const override;
0063 
0064   /// @copydoc TrapezoidPortalShell::portal
0065   std::shared_ptr<Portal> portal(Face face) override;
0066 
0067   /// @copydoc TrapezoidPortalShell::setPortal
0068   void setPortal(std::shared_ptr<Portal> portal, Face face) override;
0069 
0070   /// @copydoc PortalShellBase::applyToVolume
0071   void applyToVolume() override;
0072 
0073   /// @copydoc PortalShellBase::isValid
0074   bool isValid() const override;
0075 
0076   /// @copydoc PortalShellBase::label
0077   std::string label() const override;
0078 
0079  private:
0080   std::array<std::shared_ptr<Portal>, 6> m_portals{};
0081 
0082   TrackingVolume* m_volume;
0083 };
0084 
0085 }  // namespace Acts