Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a832854
feat: Inclination dependent `SurfaceArray` lookup
andiwand Mar 2, 2026
1058cc1
fill neighbor map correctly
andiwand Mar 2, 2026
d54f6e9
fix silly
andiwand Mar 2, 2026
9619658
try again
andiwand Mar 2, 2026
5f01eba
fix docs
andiwand Mar 2, 2026
cb51d1f
fix silly
andiwand Mar 2, 2026
6ba04b6
Merge branch 'main' of https://github.com/acts-project/acts into incl…
andiwand Mar 19, 2026
9773d7c
wire param
andiwand Mar 19, 2026
41b0e31
Merge branch 'main' of github.com:acts-project/acts into inclination-…
andiwand Mar 23, 2026
325ea5f
packed surface array; fix docs
andiwand Mar 23, 2026
f8a10ac
fix
andiwand Mar 23, 2026
4a30741
fix
andiwand Mar 24, 2026
7bfd604
fix docs
andiwand Mar 24, 2026
eac2cda
Merge branch 'main' of github.com:acts-project/acts into inclination-…
andiwand Mar 30, 2026
143d9ba
Merge branch 'main' of github.com:acts-project/acts into inclination-…
andiwand Mar 30, 2026
88d236f
fix docs
andiwand Mar 30, 2026
36a8fdf
use std::span all the way
andiwand Mar 31, 2026
92b542e
cleanup docs
andiwand Mar 31, 2026
409c8af
try fix
andiwand Mar 31, 2026
18f1894
revert some docs changes as `LayerCreator` and `SurfaceArrayCreator` …
andiwand Mar 31, 2026
193ba81
refactor further
andiwand Mar 31, 2026
8b0cb1f
fix
andiwand Mar 31, 2026
908d04e
minor
andiwand Mar 31, 2026
56a3369
fix docs; try fix detray
andiwand Mar 31, 2026
ddbed72
fix again
andiwand Mar 31, 2026
4dc6705
fix
andiwand Mar 31, 2026
db91242
Merge branch 'main' into inclination-dependent-surface-array-lookup
andiwand Mar 31, 2026
cca5aa6
Merge branch 'main' of github.com:acts-project/acts into inclination-…
andiwand Mar 31, 2026
ba55230
Merge branch 'inclination-dependent-surface-array-lookup' of github.c…
andiwand Mar 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions Core/include/Acts/Geometry/LayerCreator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ class LayerCreator {
/// @param ad possibility to hand over a specific ApproachDescriptor, which is
/// needed for material mapping. Otherwise the default ApproachDescriptor will
/// be taken used for this layer
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return shared pointer to a newly created layer
MutableLayerPtr cylinderLayer(
const GeometryContext& gctx,
std::vector<std::shared_ptr<const Surface>> surfaces, std::size_t binsPhi,
std::size_t binsZ, std::optional<ProtoLayer> _protoLayer = std::nullopt,
const Transform3& transform = Transform3::Identity(),
std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
std::unique_ptr<ApproachDescriptor> ad = nullptr,
std::uint8_t maxNeighborDistance = 1) const;

/// returning a cylindrical layer
///
Expand All @@ -105,6 +107,7 @@ class LayerCreator {
/// @param ad possibility to hand over a specific ApproachDescriptor, which is
/// needed for material mapping. Otherwise the default ApproachDescriptor will
/// be taken used for this layer
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return shared pointer to a newly created layer
MutableLayerPtr cylinderLayer(
Expand All @@ -113,7 +116,8 @@ class LayerCreator {
BinningType bTypePhi, BinningType bTypeZ,
std::optional<ProtoLayer> _protoLayer = std::nullopt,
const Transform3& transform = Transform3::Identity(),
std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
std::unique_ptr<ApproachDescriptor> ad = nullptr,
std::uint8_t maxNeighborDistance = 1) const;

/// returning a disc layer
///
Expand All @@ -130,14 +134,16 @@ class LayerCreator {
/// @param ad possibility to hand over a specific ApproachDescriptor, which is
/// needed for material mapping. Otherwise the default ApproachDescriptor will
/// be taken used for this layer
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return shared pointer to a newly created layer
MutableLayerPtr discLayer(
const GeometryContext& gctx,
std::vector<std::shared_ptr<const Surface>> surfaces, std::size_t binsR,
std::size_t binsPhi, std::optional<ProtoLayer> _protoLayer = std::nullopt,
const Transform3& transform = Transform3::Identity(),
std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
std::unique_ptr<ApproachDescriptor> ad = nullptr,
std::uint8_t maxNeighborDistance = 1) const;

/// returning a disc layer
///
Expand All @@ -154,6 +160,7 @@ class LayerCreator {
/// @param ad possibility to hand over a specific ApproachDescriptor, which is
/// needed for material mapping. Otherwise the default ApproachDescriptor will
/// be taken used for this layer
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return shared pointer to a newly created layer
MutableLayerPtr discLayer(
Expand All @@ -162,7 +169,8 @@ class LayerCreator {
BinningType bTypePhi,
std::optional<ProtoLayer> _protoLayer = std::nullopt,
const Transform3& transform = Transform3::Identity(),
std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
std::unique_ptr<ApproachDescriptor> ad = nullptr,
std::uint8_t maxNeighborDistance = 1) const;

/// returning a plane layer
///
Expand All @@ -183,6 +191,7 @@ class LayerCreator {
/// @param [in] ad possibility to hand over a specific ApproachDescriptor,
/// which is needed for material mapping. Otherwise the default
/// ApproachDescriptor will be taken used for this layer
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return shared pointer to a newly created layer
MutableLayerPtr planeLayer(
Expand All @@ -191,7 +200,8 @@ class LayerCreator {
std::size_t bins2, AxisDirection aDir,
std::optional<ProtoLayer> _protoLayer = std::nullopt,
const Transform3& transform = Transform3::Identity(),
std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
std::unique_ptr<ApproachDescriptor> ad = nullptr,
std::uint8_t maxNeighborDistance = 1) const;

/// Set the configuration object
/// @param lcConfig is the configuration struct
Expand Down
38 changes: 28 additions & 10 deletions Core/include/Acts/Geometry/SurfaceArrayCreator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "Acts/Surfaces/RegularSurface.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Surfaces/SurfaceArray.hpp"
#include "Acts/Utilities/Axis.hpp"
#include "Acts/Utilities/AxisDefinitions.hpp"
#include "Acts/Utilities/BinningType.hpp"
#include "Acts/Utilities/Logger.hpp"
Expand Down Expand Up @@ -152,13 +153,15 @@
/// @param binsPhi is the number of bins in phi for the surfaces
/// @param binsZ is the number of bin in Z for the surfaces
/// @param transform is the (optional) additional transform applied
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return a unique pointer to a new SurfaceArray
std::unique_ptr<SurfaceArray> surfaceArrayOnCylinder(
const GeometryContext& gctx,
std::vector<std::shared_ptr<const Surface>> surfaces, std::size_t binsPhi,
std::size_t binsZ, std::optional<ProtoLayer> protoLayerOpt = std::nullopt,
const Transform3& transform = Transform3::Identity()) const;
const Transform3& transform = Transform3::Identity(),
std::uint8_t maxNeighborDistance = 1) const;

/// SurfaceArrayCreator interface method
///
Expand All @@ -175,14 +178,16 @@
/// @param bTypePhi the binning type in phi direction (equidistant/arbitrary)
/// @param bTypeZ the binning type in z direction (equidistant/arbitrary)
/// @param transform is the (optional) additional transform applied
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return a unique pointer a new SurfaceArray
std::unique_ptr<SurfaceArray> surfaceArrayOnCylinder(
const GeometryContext& gctx,
std::vector<std::shared_ptr<const Surface>> surfaces,
BinningType bTypePhi = equidistant, BinningType bTypeZ = equidistant,
std::optional<ProtoLayer> protoLayerOpt = std::nullopt,
const Transform3& transform = Transform3::Identity()) const;
const Transform3& transform = Transform3::Identity(),
std::uint8_t maxNeighborDistance = 1) const;

/// SurfaceArrayCreator interface method
/// - create an array on a disc, binned in r, phi when extrema and
Expand All @@ -198,14 +203,16 @@
/// @param binsPhi is the number of bins in phi for the surfaces
/// @param binsR is the number of bin in R for the surfaces
/// @param transform is the (optional) additional transform applied
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return a unique pointer a new SurfaceArray
std::unique_ptr<SurfaceArray> surfaceArrayOnDisc(
const GeometryContext& gctx,
std::vector<std::shared_ptr<const Surface>> surfaces, std::size_t binsR,
std::size_t binsPhi,
std::optional<ProtoLayer> protoLayerOpt = std::nullopt,
const Transform3& transform = Transform3::Identity()) const;
const Transform3& transform = Transform3::Identity(),
std::uint8_t maxNeighborDistance = 1) const;

/// SurfaceArrayCreator interface method
///
Expand All @@ -222,8 +229,10 @@
/// @param bTypeR the binning type in r direction (equidistant/arbitrary)
/// @param bTypePhi the binning type in phi direction (equidistant/arbitrary)
/// @param transform is the (optional) additional transform applied
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return a unique pointer a new SurfaceArray
///
/// @note If there is more than on R-Ring, number of phi bins
/// will be set to lowest number of surfaces of any R-ring.
/// This ignores bTypePhi and produces equidistant binning in phi
Expand All @@ -232,7 +241,8 @@
std::vector<std::shared_ptr<const Surface>> surfaces, BinningType bTypeR,
BinningType bTypePhi,
std::optional<ProtoLayer> protoLayerOpt = std::nullopt,
const Transform3& transform = Transform3::Identity()) const;
const Transform3& transform = Transform3::Identity(),
std::uint8_t maxNeighborDistance = 1) const;

/// SurfaceArrayCreator interface method
/// - create an array on a plane
Expand All @@ -251,14 +261,16 @@
/// @param [in] aDir Direction of the aligned surfaces
/// @param [in] protoLayerOpt Optional @c ProtoLayer instance
/// @param [in] transform is the (optional) additional transform applied
/// @param maxNeighborDistance Maximum next neighbor distance to be included in neighbor lookups
///
/// @return a unique pointer a new SurfaceArray
std::unique_ptr<SurfaceArray> surfaceArrayOnPlane(
const GeometryContext& gctx,
std::vector<std::shared_ptr<const Surface>> surfaces, std::size_t bins1,
std::size_t bins2, AxisDirection aDir,
std::optional<ProtoLayer> protoLayerOpt = std::nullopt,
const Transform3& transform = Transform3::Identity()) const;
const Transform3& transform = Transform3::Identity(),
std::uint8_t maxNeighborDistance = 1) const;

/// Static check function for surface equivalent
///
Expand Down Expand Up @@ -392,11 +404,13 @@
/// @param layerTolerance the layer tolerance
/// @param pAxisA ProtoAxis object for axis A
/// @param pAxisB ProtoAxis object for axis B
/// @param maxNeighborDistance the maximum neighbor distance for the grid lookup
template <AxisBoundaryType bdtA, AxisBoundaryType bdtB>
static std::unique_ptr<SurfaceArray::ISurfaceGridLookup>
makeSurfaceGridLookup2D(std::shared_ptr<RegularSurface> surface,
double layerTolerance, const ProtoAxis& pAxisA,
const ProtoAxis& pAxisB) {
const ProtoAxis& pAxisB,
std::uint8_t maxNeighborDistance) {

Check warning on line 413 in Core/include/Acts/Geometry/SurfaceArrayCreator.hpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Reduce verbosity with "using enum" for "Acts::AxisType".

See more on https://sonarcloud.io/project/issues?id=acts-project_acts&issues=AZ095nkKfAaywEzS6kX5&open=AZ095nkKfAaywEzS6kX5&pullRequest=5186
using ISGL = SurfaceArray::ISurfaceGridLookup;
std::unique_ptr<ISGL> ptr;

Expand All @@ -407,30 +421,34 @@
pAxisB.nBins);

ptr = SurfaceArray::makeSurfaceGridLookup(
std::move(surface), layerTolerance, std::tuple{axisA, axisB});
std::move(surface), layerTolerance, std::tuple{axisA, axisB},
maxNeighborDistance);

} else if (pAxisA.bType == equidistant && pAxisB.bType == arbitrary) {
Axis<AxisType::Equidistant, bdtA> axisA(pAxisA.min, pAxisA.max,
pAxisA.nBins);
Axis<AxisType::Variable, bdtB> axisB(pAxisB.binEdges);

ptr = SurfaceArray::makeSurfaceGridLookup(
std::move(surface), layerTolerance, std::tuple{axisA, axisB});
std::move(surface), layerTolerance, std::tuple{axisA, axisB},
maxNeighborDistance);

} else if (pAxisA.bType == arbitrary && pAxisB.bType == equidistant) {
Axis<AxisType::Variable, bdtA> axisA(pAxisA.binEdges);
Axis<AxisType::Equidistant, bdtB> axisB(pAxisB.min, pAxisB.max,
pAxisB.nBins);

ptr = SurfaceArray::makeSurfaceGridLookup(
std::move(surface), layerTolerance, std::tuple{axisA, axisB});
std::move(surface), layerTolerance, std::tuple{axisA, axisB},
maxNeighborDistance);

} else /*if (pAxisA.bType == arbitrary && pAxisB.bType == arbitrary)*/ {
Axis<AxisType::Variable, bdtA> axisA(pAxisA.binEdges);
Axis<AxisType::Variable, bdtB> axisB(pAxisB.binEdges);

ptr = SurfaceArray::makeSurfaceGridLookup(
std::move(surface), layerTolerance, std::tuple{axisA, axisB});
std::move(surface), layerTolerance, std::tuple{axisA, axisB},
maxNeighborDistance);
}

return ptr;
Expand Down
Loading
Loading