Skip to content

Commit

Permalink
Merge branch 'main' into feat-cmake-presets
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Aug 1, 2024
2 parents 591d5ab + 7eb13e8 commit 1d9d788
Show file tree
Hide file tree
Showing 34 changed files with 605 additions and 181 deletions.
4 changes: 4 additions & 0 deletions Core/include/Acts/Geometry/CuboidVolumeBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class CuboidVolumeBuilder : public ITrackingVolumeBuilder {
std::array<ActsScalar, 2u> envelopeZ{0, 0};
// An optional rotation for this
std::optional<RotationMatrix3> rotation{std::nullopt};
// Dimension for the binning
Acts::BinningValue binningDimension = Acts::BinningValue::binX;
};

/// @brief This struct stores the data for the construction of a cuboid
Expand All @@ -102,6 +104,8 @@ class CuboidVolumeBuilder : public ITrackingVolumeBuilder {
std::string name = "Volume";
// Material
std::shared_ptr<const IVolumeMaterial> volumeMaterial = nullptr;
// Dimension for the binning
Acts::BinningValue binningDimension = Acts::BinningValue::binX;
};

/// @brief This struct stores the configuration of the tracking geometry
Expand Down
110 changes: 70 additions & 40 deletions Core/include/Acts/Navigation/InternalNavigation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,70 +25,83 @@
namespace Acts::Experimental {

struct AllPortalsNavigation : public IInternalNavigation {
/// A ordered portal provider
/// Fills all portals into the navigation state
///
/// @param gctx is the Geometry context of this call
/// @param nState is the navigation state to be updated
///
/// @note that the intersections are ordered, such that the
/// smallest intersection pathlength >= overstep tolerance is the lowest
///
/// @return an ordered list of portal candidates
inline void update(const GeometryContext& gctx,
NavigationState& nState) const {
/// @note no intersection ordering is done at this stage
inline void fill([[maybe_unused]] const GeometryContext& gctx,
NavigationState& nState) const {
if (nState.currentVolume == nullptr) {
throw std::runtime_error(
"AllPortalsNavigation: no detector volume set to navigation state.");
}
// Retrieval necessary
if (nState.surfaceCandidates.empty()) {
// Fill internal portals if existing
for (const auto v : nState.currentVolume->volumes()) {
const auto& iPortals = v->portals();
PortalsFiller::fill(nState, iPortals);
}
// Filling the new portal candidates
const auto& portals = nState.currentVolume->portals();
PortalsFiller::fill(nState, portals);
// Fill internal portals if existing
for (const auto v : nState.currentVolume->volumes()) {
const auto& iPortals = v->portals();
PortalsFiller::fill(nState, iPortals);
}
// Sort and update
updateCandidates(gctx, nState);
// Filling the new portal candidates
const auto& portals = nState.currentVolume->portals();
PortalsFiller::fill(nState, portals);
}
};

struct AllPortalsAndSurfacesNavigation : public IInternalNavigation {
/// An ordered list of portals and surfaces provider
/// A ordered portal provider - update method that calls fill and initialize
///
/// @param gctx is the Geometry context of this call
/// @param nState is the navigation state to be updated
///
/// @note that the intersections are ordered, such that the
/// smallest intersection pathlength >= overstep tolerance is the lowest
///
/// @return an ordered list of portal and surface candidates
inline void update(const GeometryContext& gctx,
NavigationState& nState) const {
fill(gctx, nState);
intitializeCandidates(gctx, nState);
}
};

struct AllPortalsAndSurfacesNavigation : public IInternalNavigation {
/// Fills all portals and surfaces into the navigation state
///
/// @param gctx is the Geometry context of this call
/// @param nState is the navigation state to be updated
///
/// @note no intersection ordering is done at this stage
inline void fill([[maybe_unused]] const GeometryContext& gctx,
NavigationState& nState) const {
if (nState.currentDetector == nullptr) {
throw std::runtime_error(
"AllPortalsAndSurfacesNavigation: no detector volume set to "
"navigation "
"state.");
}
// A volume switch has happened, update list of portals & surfaces
if (nState.surfaceCandidates.empty()) {
// Fill internal portals if existing
for (const auto v : nState.currentVolume->volumes()) {
const auto& iPortals = v->portals();
PortalsFiller::fill(nState, iPortals);
}
// Assign the new volume
const auto& portals = nState.currentVolume->portals();
const auto& surfaces = nState.currentVolume->surfaces();
PortalsFiller::fill(nState, portals);
SurfacesFiller::fill(nState, surfaces);
for (const auto v : nState.currentVolume->volumes()) {
const auto& iPortals = v->portals();
PortalsFiller::fill(nState, iPortals);
}
// Update internal candidates
updateCandidates(gctx, nState);
// Assign the new volume
const auto& portals = nState.currentVolume->portals();
const auto& surfaces = nState.currentVolume->surfaces();
PortalsFiller::fill(nState, portals);
SurfacesFiller::fill(nState, surfaces);
}

/// A ordered list of portals and surfaces provider
/// - update method that calls fill and initialize
///
/// @param gctx is the Geometry context of this call
/// @param nState is the navigation state to be updated
///
/// @note that the intersections are ordered, such that the
/// smallest intersection pathlength >= overstep tolerance is the lowest
///
/// @return an ordered list of portal and surface candidates
inline void update(const GeometryContext& gctx,
NavigationState& nState) const {
fill(gctx, nState);
intitializeCandidates(gctx, nState);
}
};

Expand Down Expand Up @@ -124,15 +137,32 @@ struct AdditionalSurfacesNavigation : public IInternalNavigation {
/// The volumes held by this collection
std::vector<const Surface*> surfaces = {};

/// Extract the sub volumes from the volume
/// Extract the additional surfaces from the this volume
///
/// @param gctx the geometry contextfor this extraction call (ignored)
/// @param nState is the navigation state
///
inline void update([[maybe_unused]] const GeometryContext& gctx,
NavigationState& nState) const {
/// @note no intersection ordering is done at this stage
inline void fill([[maybe_unused]] const GeometryContext& gctx,
NavigationState& nState) const {
SurfacesFiller::fill(nState, surfaces);
}

/// Extract the additional surfaces from the this volume
/// - update method that calls fill and initialize
///
/// @param gctx is the Geometry context of this call
/// @param nState is the navigation state to be updated
///
/// @note that the intersections are ordered, such that the
/// smallest intersection pathlength >= overstep tolerance is the lowest
///
/// @return an ordered list of portal and surface candidates
inline void update(const GeometryContext& gctx,
NavigationState& nState) const {
fill(gctx, nState);
intitializeCandidates(gctx, nState);
}
};

/// @brief An indexed surface implementation access
Expand Down
19 changes: 15 additions & 4 deletions Core/include/Acts/Navigation/MultiLayerNavigation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ class MultiLayerNavigation : public IInternalNavigation {

MultiLayerNavigation() = delete;

/// Update the navigation state
/// Fill the navigation state
///
/// @note no initialization is done here (sorting and update)
///
/// @param gctx is the geometry context
/// @param nState is the navigation state
void update(const GeometryContext& gctx, NavigationState& nState) const {
void fill(const GeometryContext& gctx, NavigationState& nState) const {
// get the local position and direction
auto lposition = transform * nState.position;
auto ldirection = transform.linear() * nState.direction;
Expand All @@ -72,8 +75,16 @@ class MultiLayerNavigation : public IInternalNavigation {

resolveDuplicates(gctx, surfCandidates);
SurfacesFiller::fill(nState, surfCandidates);

updateCandidates(gctx, nState);
}
/// Fill the update the navigation state with candidates
///
/// @note initialization is done here (sorting and update)
///
/// @param gctx is the geometry context
/// @param nState is the navigation state
void update(const GeometryContext& gctx, NavigationState& nState) const {
fill(gctx, nState);
intitializeCandidates(gctx, nState);
}

/// Cast into a lookup position
Expand Down
Loading

0 comments on commit 1d9d788

Please sign in to comment.