Skip to content

Commit

Permalink
revert: "fix: Return nullptr if outside tracking geometry in `Track…
Browse files Browse the repository at this point in the history
…ingGeometry::lowestTrackingVolume` (#3481)"

This reverts commit c962d5a.
  • Loading branch information
paulgessinger committed Sep 19, 2024
1 parent b92d063 commit 3d2b0af
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 25 deletions.
Binary file modified CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Core/include/Acts/Geometry/TrackingVolume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class TrackingVolume : public Volume {
/// static layers
std::unique_ptr<const LayerArray> m_confinedLayers = nullptr;

/// Array of Volumes inside the Volume when acting as container
/// Array of Volumes inside the Volume when actin as container
std::shared_ptr<const TrackingVolumeArray> m_confinedVolumes = nullptr;

/// confined dense
Expand Down
5 changes: 0 additions & 5 deletions Core/include/Acts/Propagator/Navigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,6 @@ class Navigator {
: nullptr;
if (state.navigation.startVolume != nullptr) {
ACTS_VERBOSE(volInfo(state) << "Start volume resolved.");
} else {
ACTS_VERBOSE(volInfo(state)
<< "No start volume resolved. Nothing left to do.");
// set the navigation break
state.navigation.navigationBreak = true;
}
}

Expand Down
13 changes: 8 additions & 5 deletions Core/src/Geometry/TrackingGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ Acts::TrackingGeometry::~TrackingGeometry() = default;

const Acts::TrackingVolume* Acts::TrackingGeometry::lowestTrackingVolume(
const GeometryContext& gctx, const Acts::Vector3& gp) const {
return m_world->lowestTrackingVolume(gctx, gp);
const TrackingVolume* searchVolume = m_world.get();
const TrackingVolume* currentVolume = nullptr;
while (currentVolume != searchVolume && (searchVolume != nullptr)) {
currentVolume = searchVolume;
searchVolume = searchVolume->lowestTrackingVolume(gctx, gp);
}
return currentVolume;
}

const Acts::TrackingVolume* Acts::TrackingGeometry::highestTrackingVolume()
Expand All @@ -57,10 +63,7 @@ Acts::TrackingGeometry::highestTrackingVolumeShared() const {

const Acts::Layer* Acts::TrackingGeometry::associatedLayer(
const GeometryContext& gctx, const Acts::Vector3& gp) const {
const TrackingVolume* lowestVol = lowestTrackingVolume(gctx, gp);
if (lowestVol == nullptr) {
return nullptr;
}
const TrackingVolume* lowestVol = (lowestTrackingVolume(gctx, gp));
return lowestVol->associatedLayer(gctx, gp);
}

Expand Down
11 changes: 2 additions & 9 deletions Core/src/Geometry/TrackingVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,11 @@ TrackingVolume::TrackingVolume(const Transform3& transform,
TrackingVolume::~TrackingVolume() = default;

const TrackingVolume* TrackingVolume::lowestTrackingVolume(
const GeometryContext& gctx, const Vector3& position,
const GeometryContext& /*gctx*/, const Vector3& position,
const double tol) const {
if (!inside(position, tol)) {
return nullptr;
}

// confined static volumes - highest hierarchy
if (m_confinedVolumes) {
const TrackingVolume* volume = m_confinedVolumes->object(position).get();
if (volume != nullptr) {
return volume->lowestTrackingVolume(gctx, position, tol);
}
return (m_confinedVolumes->object(position).get());
}

// search for dense volumes
Expand Down
7 changes: 2 additions & 5 deletions Tests/UnitTests/Core/Geometry/CuboidVolumeBuilderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,13 @@ BOOST_AUTO_TEST_CASE(CuboidVolumeBuilderTest) {
std::unique_ptr<const TrackingGeometry> detector =
tgb.trackingGeometry(tgContext);
BOOST_CHECK_EQUAL(
detector->lowestTrackingVolume(tgContext, Vector3(1_mm, 0_mm, 0_mm))
detector->lowestTrackingVolume(tgContext, Vector3(1., 0., 0.))
->volumeName(),
volumeConfig.name);
BOOST_CHECK_EQUAL(
detector->lowestTrackingVolume(tgContext, Vector3(-1_mm, 0_mm, 0_mm))
detector->lowestTrackingVolume(tgContext, Vector3(-1., 0., 0.))
->volumeName(),
volumeConfig2.name);
BOOST_CHECK_EQUAL(
detector->lowestTrackingVolume(tgContext, Vector3(1000_m, 0_m, 0_m)),
nullptr);
}

} // namespace Acts::Test

0 comments on commit 3d2b0af

Please sign in to comment.