Skip to content

Commit

Permalink
feat: TrackingGeometry gains shared_ptr world volume accessor (#2262
Browse files Browse the repository at this point in the history
)

This is necessary to forward the `shared_ptr` of the world volume to
other modules like Geant4 particle killer

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
andiwand and kodiakhq[bot] committed Jul 4, 2023
1 parent af748f6 commit d73c864
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Core/include/Acts/Geometry/TrackingGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class TrackingGeometry {
/// @return plain pointer to the world volume
const TrackingVolume* highestTrackingVolume() const;

/// Access to the world volume
/// @return shared pointer to the world volume
const std::shared_ptr<const TrackingVolume>& highestTrackingVolumeShared()
const;

/// return the lowest tracking Volume
///
/// @param gctx The current geometry context object, e.g. alignment
Expand Down
7 changes: 6 additions & 1 deletion Core/src/Geometry/TrackingGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ const Acts::TrackingVolume* Acts::TrackingGeometry::lowestTrackingVolume(

const Acts::TrackingVolume* Acts::TrackingGeometry::highestTrackingVolume()
const {
return (m_world.get());
return m_world.get();
}

const std::shared_ptr<const Acts::TrackingVolume>&
Acts::TrackingGeometry::highestTrackingVolumeShared() const {
return m_world;
}

const Acts::Layer* Acts::TrackingGeometry::associatedLayer(
Expand Down

0 comments on commit d73c864

Please sign in to comment.