Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 08:19: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 #include "Acts/Geometry/PortalShell.hpp"
0010 
0011 #include "Acts/Geometry/CuboidPortalShell.hpp"
0012 #include "Acts/Geometry/CylinderPortalShell.hpp"
0013 #include "Acts/Geometry/DiamondPortalShell.hpp"
0014 #include "Acts/Geometry/TrackingVolume.hpp"
0015 #include "Acts/Geometry/TrapezoidPortalShell.hpp"
0016 #include "Acts/Geometry/VolumeBounds.hpp"
0017 
0018 #include <stdexcept>
0019 
0020 namespace Acts {
0021 
0022 std::unique_ptr<PortalShellBase> PortalShellBase::makeSingle(
0023     const GeometryContext& gctx, TrackingVolume& volume) {
0024   switch (volume.volumeBounds().type()) {
0025     case VolumeBounds::eCylinder:
0026       return std::make_unique<SingleCylinderPortalShell>(gctx, volume);
0027     case VolumeBounds::eCuboid:
0028       return std::make_unique<SingleCuboidPortalShell>(gctx, volume);
0029     case VolumeBounds::eTrapezoid:
0030       return std::make_unique<SingleTrapezoidPortalShell>(gctx, volume);
0031     case VolumeBounds::eDiamond:
0032       return std::make_unique<SingleDiamondPortalShell>(gctx, volume);
0033     default:
0034       throw std::logic_error("Volume type is not supported");
0035   }
0036 }
0037 
0038 }  // namespace Acts