From ccc19756cd83ec1e08e538f4373e5bcd62d4817c Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Wed, 13 Mar 2024 08:42:39 +0100 Subject: [PATCH] refactor: Remove BVH navigation remnants (to be reimplemented) (#3029) This is to be reimplemented in the navigation delegate scheme, and blocks refactoring. --- Core/include/Acts/Geometry/TrackingVolume.hpp | 46 ------- Core/include/Acts/Propagator/Navigator.hpp | 76 ----------- Core/src/Geometry/TrackingVolume.cpp | 120 ---------------- .../CubicBVHTrackingGeometry.hpp | 91 ------------ Tests/IntegrationTests/BVHNavigationTest.cpp | 46 ------- Tests/IntegrationTests/CMakeLists.txt | 1 - .../Core/Geometry/BVHDataTestCase.hpp | 129 ------------------ .../Core/Geometry/TrackingVolumeTests.cpp | 9 +- .../Core/Propagator/NavigatorTests.cpp | 52 ------- 9 files changed, 5 insertions(+), 565 deletions(-) delete mode 100644 Tests/CommonHelpers/Acts/Tests/CommonHelpers/CubicBVHTrackingGeometry.hpp delete mode 100644 Tests/IntegrationTests/BVHNavigationTest.cpp delete mode 100644 Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp diff --git a/Core/include/Acts/Geometry/TrackingVolume.hpp b/Core/include/Acts/Geometry/TrackingVolume.hpp index fa1b2874c7b..00a4e020dd4 100644 --- a/Core/include/Acts/Geometry/TrackingVolume.hpp +++ b/Core/include/Acts/Geometry/TrackingVolume.hpp @@ -132,31 +132,6 @@ class TrackingVolume : public Volume { return MutableTrackingVolumePtr(new TrackingVolume( transform, std::move(volumeBounds), containedVolumes, volumeName)); } - - /// Factory constructor for Tracking Volume with a bounding volume hierarchy - /// - /// @param transform is the global 3D transform to position the volume in - /// space - /// @param volbounds is the description of the volume boundaries - /// @param boxStore Vector owning the contained bounding boxes - /// @param descendants Vector owning the child volumes - /// @param top The top of the hierarchy (top node) - /// @param volumeMaterial is the materials of the tracking volume - /// @param volumeName is a string identifier - /// - /// @return shared pointer to a new TrackingVolume - static MutableTrackingVolumePtr create( - const Transform3& transform, VolumeBoundsPtr volbounds, - std::vector> boxStore, - std::vector> descendants, - const Volume::BoundingBox* top, - std::shared_ptr volumeMaterial, - const std::string& volumeName = "undefined") { - return MutableTrackingVolumePtr(new TrackingVolume( - transform, std::move(volbounds), std::move(boxStore), - std::move(descendants), top, std::move(volumeMaterial), volumeName)); - } - /// Factory constructor for Tracking Volumes with content /// - can not be a container volume /// @@ -435,11 +410,6 @@ class TrackingVolume : public Volume { /// - positiveFaceXY GlueVolumesDescriptor& glueVolumesDescriptor(); - /// Return whether this TrackingVolume has a BoundingVolumeHierarchy - /// associated - /// @return If it has a BVH or not. - bool hasBoundingVolumeHierarchy() const; - /// Register the color code /// /// @param icolor is a color number @@ -470,13 +440,6 @@ class TrackingVolume : public Volume { containedVolumeArray = nullptr, const std::string& volumeName = "undefined"); - TrackingVolume(const Transform3& transform, VolumeBoundsPtr volbounds, - std::vector> boxStore, - std::vector> descendants, - const Volume::BoundingBox* top, - std::shared_ptr volumeMaterial, - const std::string& volumeName = "undefined"); - /// Constructor for a full equipped Tracking Volume /// /// @param transform is the global 3D transform to position the volume in @@ -555,11 +518,6 @@ class TrackingVolume : public Volume { /// color code for displaying unsigned int m_colorCode{20}; - - /// Bounding Volume Hierarchy (BVH) - std::vector> m_boundingBoxes; - std::vector> m_descendantVolumes; - const Volume::BoundingBox* m_bvhTop{nullptr}; }; inline const std::string& TrackingVolume::volumeName() const { @@ -609,10 +567,6 @@ inline void TrackingVolume::setMotherVolume(const TrackingVolume* mvol) { m_motherVolume = mvol; } -inline bool TrackingVolume::hasBoundingVolumeHierarchy() const { - return m_bvhTop != nullptr; -} - #ifndef DOXYGEN #include "Acts/Geometry/detail/TrackingVolume.ipp" #endif diff --git a/Core/include/Acts/Propagator/Navigator.hpp b/Core/include/Acts/Propagator/Navigator.hpp index 7a6725fe930..30a05159794 100644 --- a/Core/include/Acts/Propagator/Navigator.hpp +++ b/Core/include/Acts/Propagator/Navigator.hpp @@ -719,82 +719,6 @@ class Navigator { ACTS_VERBOSE(volInfo(state) << "No layers present, resolve volume first."); - // check if current volume has BVH, or layers - if (state.navigation.currentVolume->hasBoundingVolumeHierarchy()) { - // has hierarchy, use that, skip layer resolution - NavigationOptions navOpts; - navOpts.resolveSensitive = m_cfg.resolveSensitive; - navOpts.resolveMaterial = m_cfg.resolveMaterial; - navOpts.resolvePassive = m_cfg.resolvePassive; - navOpts.endObject = state.navigation.targetSurface; - navOpts.nearLimit = stepper.overstepLimit(state.stepping); - double opening_angle = 0; - - // Preliminary version of the frustum opening angle estimation. - // Currently not used (only rays), but will be. - - /* - Vector3 pos = stepper.position(state.stepping); - double mom = stepper.momentum(state.stepping) / UnitConstants::GeV; - double q = stepper.charge(state.stepping); - Vector3 dir = stepper.direction(state.stepping); - Vector3 B = stepper.getField(state.stepping, pos); - if (B.squaredNorm() > 1e-9) { - // ~ non-zero field - double ir = (dir.cross(B).norm()) * q / mom; - double s; - if (state.options.direction == Direction::Forward) { - s = state.stepping.stepSize.max(); - } else { - s = state.stepping.stepSize.min(); - } - opening_angle = std::atan((1 - std::cos(s * ir)) / std::sin(s * ir)); - } - - ACTS_VERBOSE(volInfo(state) << "Estimating opening angle for frustum - nav:"); ACTS_VERBOSE(volInfo(state) << "pos: " << pos.transpose()); - ACTS_VERBOSE(volInfo(state) << "dir: " << dir.transpose()); - ACTS_VERBOSE(volInfo(state) << "B: " << B.transpose() << " |B|: " << - B.norm()); ACTS_VERBOSE(volInfo(state) << "step mom: " << - stepper.momentum(state.stepping)); ACTS_VERBOSE(volInfo(state) << "=> - opening angle: " << opening_angle); - */ - - auto protoNavSurfaces = - state.navigation.currentVolume->compatibleSurfacesFromHierarchy( - state.geoContext, stepper.position(state.stepping), - state.options.direction * stepper.direction(state.stepping), - opening_angle, navOpts); - if (!protoNavSurfaces.empty()) { - // did we find any surfaces? - - // Check: are we on the first surface? - // TODO magic number `1_um` - if ((state.navigation.currentSurface == nullptr && - state.navigation.navSurfaces.empty()) || - protoNavSurfaces.front().pathLength() > 1_um) { - // we are not, go on - // state.navigation.navSurfaces = std::move(protoNavSurfaces); - state.navigation.navSurfaces.clear(); - state.navigation.navSurfaces.insert( - state.navigation.navSurfaces.begin(), protoNavSurfaces.begin(), - protoNavSurfaces.end()); - - state.navigation.navSurfaceIndex = 0; - state.navigation.navLayers = {}; - state.navigation.navLayerIndex = state.navigation.navLayers.size(); - // The stepper updates the step size ( single / multi component) - stepper.updateStepSize(state.stepping, - state.navigation.navSurface(), - state.options.direction, true); - ACTS_VERBOSE(volInfo(state) - << "Navigation stepSize updated to " - << stepper.outputStepSize(state.stepping)); - return true; - } - } - } - if (resolveLayers(state, stepper)) { // The layer resolving worked return true; diff --git a/Core/src/Geometry/TrackingVolume.cpp b/Core/src/Geometry/TrackingVolume.cpp index bd20cf8ebeb..2531b688689 100644 --- a/Core/src/Geometry/TrackingVolume.cpp +++ b/Core/src/Geometry/TrackingVolume.cpp @@ -69,28 +69,6 @@ Acts::TrackingVolume::TrackingVolume( connectDenseBoundarySurfaces(denseVolumeVector); } -// constructor for arguments -Acts::TrackingVolume::TrackingVolume( - const Transform3& transform, VolumeBoundsPtr volbounds, - std::vector> boxStore, - std::vector> descendants, - const Volume::BoundingBox* top, - std::shared_ptr volumeMaterial, - const std::string& volumeName) - : Volume(transform, std::move(volbounds)), - m_volumeMaterial(std::move(volumeMaterial)), - m_name(volumeName), - m_descendantVolumes(std::move(descendants)), - m_bvhTop(top) { - createBoundarySurfaces(); - // we take a copy of the unique box pointers, but we want to - // store them as consts. - for (auto& uptr : boxStore) { - m_boundingBoxes.push_back( - std::unique_ptr(uptr.release())); - } -} - Acts::TrackingVolume::~TrackingVolume() { delete m_glueVolumeDescriptor; } @@ -429,23 +407,6 @@ void Acts::TrackingVolume::closeGeometry( mutableLayerPtr->closeGeometry(materialDecorator, layerID, hook, logger); } - } else if (m_bvhTop != nullptr) { - GeometryIdentifier::Value isurface = 0; - for (const auto& descVol : m_descendantVolumes) { - // Attempt to cast to AbstractVolume: only one we'll handle - const AbstractVolume* avol = - dynamic_cast(descVol.get()); - if (avol != nullptr) { - const auto& bndSrf = avol->boundarySurfaces(); - for (const auto& bnd : bndSrf) { - const auto& srf = bnd->surfaceRepresentation(); - RegularSurface* mutableSurfcePtr = - const_cast(&srf); - auto geoID = GeometryIdentifier(volumeID).setSensitive(++isurface); - mutableSurfcePtr->assignGeometryId(geoID); - } - } - } } } else { // B) this is a container volume, go through sub volume @@ -632,84 +593,3 @@ Acts::TrackingVolume::compatibleLayers( // and return return lIntersections; } - -namespace { -template -std::vector intersectSearchHierarchy( - const T obj, const Acts::Volume::BoundingBox* lnode) { - std::vector hits; - hits.reserve(20); // arbitrary - do { - if (lnode->intersect(obj)) { - if (lnode->hasEntity()) { - // found primitive - // check obb to limit false positives - const Acts::Volume* vol = lnode->entity(); - const auto& obb = vol->orientedBoundingBox(); - if (obb.intersect(obj.transformed(vol->itransform()))) { - hits.push_back(vol); - } - // we skip in any case, whether we actually hit the OBB or not - lnode = lnode->getSkip(); - } else { - // go over children - lnode = lnode->getLeftChild(); - } - } else { - lnode = lnode->getSkip(); - } - } while (lnode != nullptr); - - return hits; -} -} // namespace - -std::vector -Acts::TrackingVolume::compatibleSurfacesFromHierarchy( - const GeometryContext& gctx, const Vector3& position, - const Vector3& direction, double angle, - const NavigationOptions& options) const { - std::vector sIntersections; - sIntersections.reserve(20); // arbitrary - - // The limits for this navigation step - double nearLimit = options.nearLimit; - double farLimit = options.farLimit; - - if (m_bvhTop == nullptr) { - return sIntersections; - } - - std::vector hits; - if (angle == 0) { - // use ray - Ray3D obj(position, direction); - hits = intersectSearchHierarchy(std::move(obj), m_bvhTop); - } else { - Acts::Frustum obj(position, direction, angle); - hits = intersectSearchHierarchy(std::move(obj), m_bvhTop); - } - - // have cells, decompose to surfaces - for (const Volume* vol : hits) { - const AbstractVolume* avol = dynamic_cast(vol); - const std::vector>>& - boundarySurfaces = avol->boundarySurfaces(); - for (const auto& bs : boundarySurfaces) { - const Surface& srf = bs->surfaceRepresentation(); - auto sfmi = - srf.intersect(gctx, position, direction, BoundaryCheck(false)); - for (const auto& sfi : sfmi.split()) { - if (sfi && detail::checkIntersection(sfi, nearLimit, farLimit)) { - sIntersections.push_back(sfi); - } - } - } - } - - // Sort according to the path length - std::sort(sIntersections.begin(), sIntersections.end(), - SurfaceIntersection::pathLengthOrder); - - return sIntersections; -} diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/CubicBVHTrackingGeometry.hpp b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/CubicBVHTrackingGeometry.hpp deleted file mode 100644 index 905b8651456..00000000000 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/CubicBVHTrackingGeometry.hpp +++ /dev/null @@ -1,91 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2016-2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Geometry/AbstractVolume.hpp" -#include "Acts/Geometry/CuboidVolumeBounds.hpp" -#include "Acts/Geometry/GeometryContext.hpp" -#include "Acts/Geometry/TrackingVolume.hpp" -#include "Acts/Geometry/Volume.hpp" -#include "Acts/Utilities/BoundingBox.hpp" - -#include -#include - -namespace Acts { -namespace Test { - -struct CubicBVHTrackingGeometry { - using Box = Acts::Volume::BoundingBox; - - /// Default constructor for the Cubic Bounding Volume Hierarchy tracking - /// geometry - /// - /// @param n number of boxes in each direction - /// @param hl Range of the volume - /// @param octd maximum depth - CubicBVHTrackingGeometry(std::size_t n = 29, double hl = 1000, - std::size_t octd = 5) { - Box::Size size(Acts::Vector3(2, 2, 2)); - - std::shared_ptr vbds = - std::make_shared(10, 10, 10); - - double min = -hl; - double max = hl; - - double step = (max - min) / double(n); - std::vector> boxVolumes; - std::vector> boxStore; - boxStore.reserve((n + 1) * (n + 1) * (n + 1)); - - std::vector boxes; - boxes.reserve(boxStore.size()); - - for (std::size_t i = 0; i <= n; i++) { - for (std::size_t j = 0; j <= n; j++) { - for (std::size_t k = 0; k <= n; k++) { - Vector3 pos(min + i * step, min + j * step, min + k * step); - - auto trf = Transform3(Translation3(pos)); - auto vol = std::make_unique(trf, vbds); - - boxVolumes.push_back(std::move(vol)); - boxStore.push_back( - std::make_unique(boxVolumes.back()->boundingBox())); - boxes.push_back(boxStore.back().get()); - } - } - } - - Box* top = make_octree(boxStore, boxes, octd); - - // create trackingvolume - // will own the volumes, so make non-owning copy first - volumes.reserve(boxVolumes.size()); - for (auto& vol : boxVolumes) { - volumes.push_back(vol.get()); - } - - // box like overall shape - auto tvBounds = - std::make_shared(hl * 1.1, hl * 1.1, hl * 1.1); - - auto tv = TrackingVolume::create(Transform3::Identity(), tvBounds, - std::move(boxStore), std::move(boxVolumes), - top, nullptr, "TheVolume"); - - trackingGeometry = std::make_shared(tv); - } - std::vector volumes; - std::shared_ptr trackingGeometry; -}; - -} // namespace Test -} // namespace Acts diff --git a/Tests/IntegrationTests/BVHNavigationTest.cpp b/Tests/IntegrationTests/BVHNavigationTest.cpp deleted file mode 100644 index ad5e0de82f3..00000000000 --- a/Tests/IntegrationTests/BVHNavigationTest.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include -#include - -#include "Acts/EventData/TrackParameters.hpp" -#include "Acts/Geometry/AbstractVolume.hpp" -#include "Acts/Geometry/CuboidVolumeBounds.hpp" -#include "Acts/Geometry/GeometryContext.hpp" -#include "Acts/Geometry/TrackingVolume.hpp" -#include "Acts/Geometry/Volume.hpp" -#include "Acts/Propagator/ActionList.hpp" -#include "Acts/Propagator/ConstrainedStep.hpp" -#include "Acts/Propagator/Navigator.hpp" -#include "Acts/Propagator/Propagator.hpp" -#include "Acts/Propagator/StandardAborters.hpp" -#include "Acts/Propagator/StraightLineStepper.hpp" -#include "Acts/Propagator/detail/SteppingLogger.hpp" -#include "Acts/Tests/CommonHelpers/CubicBVHTrackingGeometry.hpp" -#include "Acts/Utilities/BoundingBox.hpp" -#include "Acts/Utilities/Ray.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Acts { -namespace IntegrationTest { - -#define NBOXES 29 -#define NTESTS 100 -#include "../UnitTests/Core/Geometry/BVHDataTestCase.hpp" - -} // namespace IntegrationTest -} // namespace Acts diff --git a/Tests/IntegrationTests/CMakeLists.txt b/Tests/IntegrationTests/CMakeLists.txt index 45386024cd2..ffe28c1ea63 100644 --- a/Tests/IntegrationTests/CMakeLists.txt +++ b/Tests/IntegrationTests/CMakeLists.txt @@ -30,7 +30,6 @@ macro(add_integrationtest _name) add_dependencies(integrationtests ${_run}) endmacro() -add_integrationtest(BVHNavigation BVHNavigationTest.cpp) add_integrationtest(InterpolatedSolenoidBField InterpolatedSolenoidBFieldTest.cpp) add_integrationtest(PrintDataDirectory PrintDataDirectory.cpp) add_integrationtest(PropagationAtlasConstant PropagationAtlasConstant.cpp) diff --git a/Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp b/Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp deleted file mode 100644 index 59d3186e67f..00000000000 --- a/Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp +++ /dev/null @@ -1,129 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Surfaces/Surface.hpp" - -namespace bdata = boost::unit_test::data; -using Ray = Acts::Ray; - -GeometryContext tgContext = GeometryContext(); -MagneticFieldContext mfContext = MagneticFieldContext(); - -Test::CubicBVHTrackingGeometry grid(NBOXES, 1000, 5); - -auto volumes = grid.volumes; -auto tg = grid.trackingGeometry; - -BOOST_DATA_TEST_CASE( - bvhnavigation_test, - bdata::random( - (bdata::engine = std::mt19937(), bdata::seed = 7, - bdata::distribution = std::uniform_real_distribution(-5, 5))) ^ - bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, - bdata::distribution = - std::uniform_real_distribution(-M_PI, - M_PI))) ^ - bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, - bdata::distribution = - std::uniform_real_distribution(-100, 100))) ^ - bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, - bdata::distribution = - std::uniform_real_distribution(-100, 100))) ^ - bdata::random((bdata::engine = std::mt19937(), bdata::seed = 5, - bdata::distribution = - std::uniform_real_distribution(-100, 100))) ^ - bdata::xrange(NTESTS), - eta, phi, x, y, z, index) { - using namespace Acts::UnitLiterals; - (void)index; - - // construct ray from parameters - double theta = 2 * std::atan(std::exp(-eta)); - Acts::Vector3 dir; - dir << std::cos(phi), std::sin(phi), 1. / std::tan(theta); - dir.normalize(); - Ray ray({x, y, z}, dir); - - // naive collection: iterate over all the boxes - std::vector hits; - for (const auto& vol : volumes) { - const auto& absVol = dynamic_cast(*vol); - auto bndSurfaces = absVol.boundarySurfaces(); - // collect all surfaces that are hit - for (const auto& bndSrf : bndSurfaces) { - const auto& srf = bndSrf->surfaceRepresentation(); - auto srmi = srf.intersect(tgContext, ray.origin(), ray.dir(), - Acts::BoundaryCheck(true)); - for (const auto& sri : srmi.split()) { - if (sri && sri.pathLength() >= s_onSurfaceTolerance) { - // does intersect - hits.push_back(sri); - } - } - } - } - - // sort by path length - std::sort(hits.begin(), hits.end(), SurfaceIntersection::pathLengthOrder); - std::vector expHits; - expHits.reserve(hits.size()); - for (const auto& hit : hits) { - expHits.push_back(hit.object()); - } - - // now do the same through a propagator - using SteppingLogger = Acts::detail::SteppingLogger; - using Stepper = StraightLineStepper; - using PropagatorType = Propagator; - - Stepper stepper{}; - Navigator navigator({tg}); - PropagatorType propagator(stepper, navigator); - - using ActionList = Acts::ActionList; - using AbortConditions = Acts::AbortList<>; - - Acts::PropagatorOptions options(tgContext, - mfContext); - - options.pathLimit = 20_m; - - Acts::Vector4 pos4 = Acts::Vector4::Zero(); - pos4.segment<3>(Acts::ePos0) = ray.origin(); - // momentum value should be irrelevant. - Acts::CurvilinearTrackParameters startPar( - pos4, ray.dir(), 1_e / 50_GeV, std::nullopt, ParticleHypothesis::pion()); - - const auto result = propagator.propagate(startPar, options).value(); - - // collect surfaces - std::vector actHits; - auto steppingResults = - result.template get().steps; - for (const auto& step : steppingResults) { - if (!step.surface) { - continue; - } - - auto sensitiveID = step.surface->geometryId().sensitive(); - if (sensitiveID != 0) { - actHits.push_back(step.surface.get()); - } - } - - BOOST_CHECK_EQUAL(expHits.size(), actHits.size()); - for (std::size_t i = 0; i < expHits.size(); i++) { - const Surface* exp = expHits[i]; - const Surface* act = actHits[i]; - - BOOST_CHECK_EQUAL(exp, act); - BOOST_CHECK_EQUAL(exp->geometryId(), act->geometryId()); - } -} diff --git a/Tests/UnitTests/Core/Geometry/TrackingVolumeTests.cpp b/Tests/UnitTests/Core/Geometry/TrackingVolumeTests.cpp index 1c987d4a2f3..2813c7d6415 100644 --- a/Tests/UnitTests/Core/Geometry/TrackingVolumeTests.cpp +++ b/Tests/UnitTests/Core/Geometry/TrackingVolumeTests.cpp @@ -22,7 +22,6 @@ #include "Acts/Propagator/StandardAborters.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" #include "Acts/Propagator/detail/SteppingLogger.hpp" -#include "Acts/Tests/CommonHelpers/CubicBVHTrackingGeometry.hpp" #include "Acts/Utilities/BoundingBox.hpp" #include "Acts/Utilities/Ray.hpp" @@ -31,9 +30,11 @@ namespace Test { BOOST_AUTO_TEST_SUITE(Geometry) -#define NBOXES 10 -#define NTESTS 20 -#include "BVHDataTestCase.hpp" +// @TODO: Add TrackingVolume tests + +BOOST_AUTO_TEST_CASE(placeholder) { + BOOST_CHECK(true); +} BOOST_AUTO_TEST_SUITE_END() diff --git a/Tests/UnitTests/Core/Propagator/NavigatorTests.cpp b/Tests/UnitTests/Core/Propagator/NavigatorTests.cpp index 5af7d925dcd..4fe5a409c38 100644 --- a/Tests/UnitTests/Core/Propagator/NavigatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/NavigatorTests.cpp @@ -27,7 +27,6 @@ #include "Acts/Propagator/detail/SteppingHelper.hpp" #include "Acts/Surfaces/BoundaryCheck.hpp" #include "Acts/Surfaces/Surface.hpp" -#include "Acts/Tests/CommonHelpers/CubicBVHTrackingGeometry.hpp" #include "Acts/Tests/CommonHelpers/CylindricalTrackingGeometry.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" #include "Acts/Utilities/Helpers.hpp" @@ -694,56 +693,5 @@ BOOST_AUTO_TEST_CASE(Navigator_target_methods) { } } -BOOST_AUTO_TEST_CASE(Navigator_target_methods_BVH) { - // create a navigator for the Bounding Volume Hierarchy test - CubicBVHTrackingGeometry grid(20, 1000, 5); - Navigator::Config bvhNavCfg; - bvhNavCfg.trackingGeometry = grid.trackingGeometry; - bvhNavCfg.resolveSensitive = true; - bvhNavCfg.resolveMaterial = true; - bvhNavCfg.resolvePassive = false; - Navigator bvhNavigator{bvhNavCfg}; - - // test the navigation in a bounding volume hierarchy - // ---------------------------------------------- - if (debug) { - std::cout << "<<<<<<<<<<<<<<<<<<<<< BVH Navigation >>>>>>>>>>>>>>>>>>" - << std::endl; - } - - // position and direction vector - Vector4 bvhPosition4(0., 0., 0, 0); - Vector3 bvhMomentum(1., 1., 0.); - - // the propagator cache - PropagatorState bvhState; - bvhState.options.debug = debug; - - // the stepper cache - bvhState.stepping.pos4 = bvhPosition4; - bvhState.stepping.dir = bvhMomentum.normalized(); - - // Stepper - PropagatorState::Stepper bvhStepper; - - bvhNavigator.initialize(bvhState, bvhStepper); - - // Check that the currentVolume is set - BOOST_CHECK_NE(bvhState.navigation.currentVolume, nullptr); - // Check that the currentVolume is the startVolume - BOOST_CHECK_EQUAL(bvhState.navigation.currentVolume, - bvhState.navigation.startVolume); - // Check that the currentSurface is reset to: - BOOST_CHECK_EQUAL(bvhState.navigation.currentSurface, nullptr); - // No layer has been found - BOOST_CHECK_EQUAL(bvhState.navigation.navLayers.size(), 0u); - // ACTORS-ABORTERS-TARGET - bvhNavigator.preStep(bvhState, bvhStepper); - // Still no layer - BOOST_CHECK_EQUAL(bvhState.navigation.navLayers.size(), 0u); - // Surfaces have been found - BOOST_CHECK_EQUAL(bvhState.navigation.navSurfaces.size(), 42u); -} - } // namespace Test } // namespace Acts