File indexing completed on 2025-01-18 09:12:45
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Detector/Portal.hpp"
0013 #include "Acts/Navigation/NavigationState.hpp"
0014 #include "Acts/Navigation/NavigationStateFillers.hpp"
0015 #include "Acts/Surfaces/PlaneSurface.hpp"
0016 #include "Acts/Surfaces/RectangleBounds.hpp"
0017 #include "Acts/Surfaces/Surface.hpp"
0018
0019 #include <memory>
0020 #include <vector>
0021
0022 namespace Acts::Experimental {
0023
0024 class DetectorVolume {};
0025 }
0026
0027 BOOST_AUTO_TEST_SUITE(Experimental)
0028
0029 BOOST_AUTO_TEST_CASE(NavigationState) {
0030
0031 Acts::Experimental::NavigationState nState;
0032 auto dTransform = Acts::Transform3::Identity();
0033
0034
0035 auto rectangle = std::make_shared<Acts::RectangleBounds>(10., 100.);
0036 auto surfaceA =
0037 Acts::Surface::makeShared<Acts::PlaneSurface>(dTransform, rectangle);
0038 auto surfaceB =
0039 Acts::Surface::makeShared<Acts::PlaneSurface>(dTransform, rectangle);
0040 auto surfaceC =
0041 Acts::Surface::makeShared<Acts::PlaneSurface>(dTransform, rectangle);
0042
0043
0044 auto pSurfaceA =
0045 Acts::Surface::makeShared<Acts::PlaneSurface>(dTransform, rectangle);
0046 auto pSurfaceB =
0047 Acts::Surface::makeShared<Acts::PlaneSurface>(dTransform, rectangle);
0048
0049
0050 auto portalA = std::make_shared<Acts::Experimental::Portal>(pSurfaceA);
0051 auto portalB = std::make_shared<Acts::Experimental::Portal>(pSurfaceB);
0052
0053 std::vector<const Acts::Surface*> surfaces = {surfaceA.get(), surfaceB.get(),
0054 surfaceC.get()};
0055 std::vector<const Acts::Experimental::Portal*> portals = {portalA.get(),
0056 portalB.get()};
0057
0058 auto dVolume = std::make_unique<Acts::Experimental::DetectorVolume>();
0059 const auto volume = dVolume.get();
0060
0061 Acts::Experimental::DetectorVolumeFiller::fill(nState, volume);
0062 BOOST_CHECK_EQUAL(nState.currentVolume, volume);
0063
0064 Acts::Experimental::PortalsFiller::fill(nState, portals);
0065 BOOST_CHECK_EQUAL(nState.surfaceCandidates.size(), portals.size());
0066
0067 Acts::Experimental::SurfacesFiller::fill(nState, surfaces);
0068 BOOST_CHECK_EQUAL(nState.surfaceCandidates.size(),
0069 portals.size() + surfaces.size());
0070 }
0071
0072 BOOST_AUTO_TEST_SUITE_END()