From 0db39e0bb921c5aeaf3656abc7fd0c27a403dbae Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Tue, 12 Nov 2024 16:49:24 +0100 Subject: [PATCH] more removal of binning namings --- .../Acts/Geometry/CylinderVolumeBuilder.hpp | 1 - .../Acts/Geometry/CylinderVolumeHelper.hpp | 6 +- Core/include/Acts/Geometry/Extent.hpp | 29 ++--- Core/include/Acts/Geometry/GeometryObject.hpp | 8 +- .../Acts/Geometry/GeometryObjectSorter.hpp | 2 +- .../Acts/Geometry/ILayerArrayCreator.hpp | 8 +- .../Acts/Geometry/ITrackingVolumeHelper.hpp | 12 +- .../Acts/Geometry/LayerArrayCreator.hpp | 20 +--- .../Acts/Geometry/SurfaceBinningMatcher.hpp | 16 +-- Core/src/Geometry/Extent.cpp | 108 +++++++++--------- Core/src/Geometry/LayerArrayCreator.cpp | 52 ++++----- 11 files changed, 125 insertions(+), 137 deletions(-) diff --git a/Core/include/Acts/Geometry/CylinderVolumeBuilder.hpp b/Core/include/Acts/Geometry/CylinderVolumeBuilder.hpp index 5f07503818d..8ef64c7232a 100644 --- a/Core/include/Acts/Geometry/CylinderVolumeBuilder.hpp +++ b/Core/include/Acts/Geometry/CylinderVolumeBuilder.hpp @@ -12,7 +12,6 @@ #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/ITrackingVolumeBuilder.hpp" #include "Acts/Geometry/ITrackingVolumeHelper.hpp" -#include "Acts/Utilities/AxisDefinitions.hpp" #include "Acts/Utilities/Logger.hpp" #include diff --git a/Core/include/Acts/Geometry/CylinderVolumeHelper.hpp b/Core/include/Acts/Geometry/CylinderVolumeHelper.hpp index df1a32b79a9..8a0db5bf659 100644 --- a/Core/include/Acts/Geometry/CylinderVolumeHelper.hpp +++ b/Core/include/Acts/Geometry/CylinderVolumeHelper.hpp @@ -71,7 +71,7 @@ class CylinderVolumeHelper : public ITrackingVolumeHelper { /// @param mtvVector (optional) Vector of confined TrackingVolumes /// @param transform (optional) placement of this TrackingVolume /// @param volumeName volume name to be given - /// @param bType (optional) AxisType - arbitrary(default) or equidistant + /// @param bType (optional) AxisType - Variable (default) or Equidistant /// /// @return shared pointer to a new TrackingVolume MutableTrackingVolumePtr createTrackingVolume( @@ -96,7 +96,7 @@ class CylinderVolumeHelper : public ITrackingVolumeHelper { /// @param zMin minimum z /// @param zMax maximum z /// @param volumeName volume name to be given - /// @param bType (optional) AxisType - arbitrary(default) or equidistant + /// @param bType (optional) AxisType - Variable (default) or Equidistant /// /// @return shared pointer to a new TrackingVolume MutableTrackingVolumePtr createTrackingVolume( @@ -141,7 +141,7 @@ class CylinderVolumeHelper : public ITrackingVolumeHelper { /// @param layerPositions custom layer positions /// @param cylinder type of layers /// @param volumeName : volume name to be given - /// @param bType (optional) AxisType - arbitrary(default) or equidistant + /// @param bType (optional) AxisType - Variable (default) or Equidistant /// /// @return shared pointer to a new TrackingVolume MutableTrackingVolumePtr createGapTrackingVolume( diff --git a/Core/include/Acts/Geometry/Extent.hpp b/Core/include/Acts/Geometry/Extent.hpp index 211f718185b..f3decb4d6f4 100644 --- a/Core/include/Acts/Geometry/Extent.hpp +++ b/Core/include/Acts/Geometry/Extent.hpp @@ -28,20 +28,21 @@ using Envelope = std::array; constexpr Envelope zeroEnvelope = {0, 0}; -/// This struct models a multi-dimensional enveloper along the binning values +/// This struct models a multi-dimensional enveloper along +/// the predefined axis drections struct ExtentEnvelope { /// Access a single envelope configuration - /// @param bValue the binning value + /// @param aDir the axis direction /// @return the envelope - Envelope& operator[](AxisDirection bValue) { - return m_values.at(toUnderlying(bValue)); + Envelope& operator[](AxisDirection aDir) { + return m_values.at(toUnderlying(aDir)); } /// Access a single envelope configuration - /// @param bValue the binning value + /// @param aDir the axis direction /// @return the envelope - const Envelope& operator[](AxisDirection bValue) const { - return m_values.at(toUnderlying(bValue)); + const Envelope& operator[](AxisDirection aDir) const { + return m_values.at(toUnderlying(aDir)); } /// Constructor from a single envelope that is assigned to all values @@ -124,28 +125,28 @@ class Extent { /// Extend with a position vertex /// /// @param vtx the vertex to be used for extending - /// @param bValues the binning values + /// @param aDirs the axis directions /// @param applyEnv boolean to steer if envelope should be applied /// @param fillHistograms is a boolean flag to steer whether the values /// to fill this extent should be stored void extend(const Vector3& vtx, - const std::vector& bValues = allAxisDirections(), + const std::vector& aDirs = allAxisDirections(), bool applyEnv = true, bool fillHistograms = false); /// Extend with a set of vectors by iterators /// /// @param start the start iterator of the loop /// @param end the end iterator of the loop - /// @param bValues the binning values + /// @param aDirs the axis directions /// @param applyEnv boolean to steer if envelope should be applied /// @param fillHistograms is a boolean flag to steer whether the values /// to fill this extent should be stored template void extend(const vector_iterator_t& start, const vector_iterator_t& end, - const std::vector& bValues = allAxisDirections(), + const std::vector& aDirs = allAxisDirections(), bool applyEnv = true, bool fillHistograms = false) { for (vector_iterator_t vIt = start; vIt < end; ++vIt) { - extend(*vIt, bValues, applyEnv, fillHistograms); + extend(*vIt, aDirs, applyEnv, fillHistograms); } } @@ -157,14 +158,14 @@ class Extent { /// which then is applied to the current one /// /// @param rhs is the other source Extent - /// @param bValues the binning values + /// @param aDirs the axis directions /// @param applyEnv boolean to steer if envelope should be applied /// on the constraint values, if only an envelope is given /// but the value not constraint, then it is always applied /// /// @note that the histogram values can not be filled in this call void extend(const Extent& rhs, - const std::vector& bValues = allAxisDirections(), + const std::vector& aDirs = allAxisDirections(), bool applyEnv = true); /// Constrain an extent by another one, this is diff --git a/Core/include/Acts/Geometry/GeometryObject.hpp b/Core/include/Acts/Geometry/GeometryObject.hpp index c1d00dd76c0..48075cb0569 100644 --- a/Core/include/Acts/Geometry/GeometryObject.hpp +++ b/Core/include/Acts/Geometry/GeometryObject.hpp @@ -53,20 +53,20 @@ class GeometryObject { /// Force a binning position method /// /// @param gctx The current geometry context object, e.g. alignment - /// @param bValue is the value in which you want to bin + /// @param aDir is the axis direction for the reference position /// /// @return vector 3D used for the binning schema virtual Vector3 referencePosition(const GeometryContext& gctx, - AxisDirection bValue) const = 0; + AxisDirection aDir) const = 0; /// Implement the binningValue /// /// @param gctx The current geometry context object, e.g. alignment - /// @param bValue is the dobule in which you want to bin + /// @param aDir is the reference position value offset /// /// @return float to be used for the binning schema virtual double referencePositionValue(const GeometryContext& gctx, - AxisDirection bValue) const; + AxisDirection aDir) const; /// Set the value /// diff --git a/Core/include/Acts/Geometry/GeometryObjectSorter.hpp b/Core/include/Acts/Geometry/GeometryObjectSorter.hpp index 30649d5b036..b8e13301288 100644 --- a/Core/include/Acts/Geometry/GeometryObjectSorter.hpp +++ b/Core/include/Acts/Geometry/GeometryObjectSorter.hpp @@ -27,7 +27,7 @@ class ObjectSorterT { public: /// Constructor from a binning value /// - /// @param bValue is the value in which the binning is done + /// @param aDir is the axis direction offset ObjectSorterT(AxisDirection bValue) : m_binningValue(bValue) {} /// Comparison operator diff --git a/Core/include/Acts/Geometry/ILayerArrayCreator.hpp b/Core/include/Acts/Geometry/ILayerArrayCreator.hpp index fad1051caf9..5085f67b424 100644 --- a/Core/include/Acts/Geometry/ILayerArrayCreator.hpp +++ b/Core/include/Acts/Geometry/ILayerArrayCreator.hpp @@ -27,8 +27,6 @@ using LayerVector = std::vector; /// @class ILayerArrayCreator /// -/// Interface class ILayerArrayCreators. -/// /// It receives the LayerVector and creaets an array with NaivgationLayer /// objects filled in between. class ILayerArrayCreator { @@ -42,13 +40,13 @@ class ILayerArrayCreator { /// @param layers are the layers to be moved into an array /// @param min is the minimul value for binning /// @param max is the maximum value for binning - /// @param bType is the type of the ordering: Equidistant, Variable - /// @param bValue is the value in which the layer ordering is done + /// @param aType is the axis type: Equidistant, Variable + /// @param aDir is the axis direction in which the ordering is done /// /// @return unique pointer to a new LayerArray virtual std::unique_ptr layerArray( const GeometryContext& gctx, const LayerVector& layers, double min, double max, AxisType bType = AxisType::Variable, - AxisDirection bValue = AxisDirection::AxisX) const = 0; + AxisDirection aDir = AxisDirection::AxisX) const = 0; }; } // namespace Acts diff --git a/Core/include/Acts/Geometry/ITrackingVolumeHelper.hpp b/Core/include/Acts/Geometry/ITrackingVolumeHelper.hpp index ca371af3b22..e978963796d 100644 --- a/Core/include/Acts/Geometry/ITrackingVolumeHelper.hpp +++ b/Core/include/Acts/Geometry/ITrackingVolumeHelper.hpp @@ -57,7 +57,7 @@ class ITrackingVolumeHelper { /// @param mtvVector (optional) Vector of confined TrackingVolumes /// @param transform (optional) placement of this TrackingVolume /// @param volumeName volume name to be given - /// @param btype (optional) AxisType - arbitrary(default) or equidistant + /// @param aType (optional) AxisType - Variable (default) or Equidistant /// /// @return shared pointer to a new TrackingVolume virtual MutableTrackingVolumePtr createTrackingVolume( @@ -67,7 +67,7 @@ class ITrackingVolumeHelper { MutableTrackingVolumeVector mtvVector = {}, const Transform3& transform = Transform3::Identity(), const std::string& volumeName = "UndefinedVolume", - AxisType btype = AxisType::Variable) const = 0; + AxisType aType = AxisType::Variable) const = 0; /// Create a TrackingVolume* from a set of layers and (optional) parameters /// @@ -80,7 +80,7 @@ class ITrackingVolumeHelper { /// @param loc0Min, loc0Max, loc1Min, loc1Max : local position in space, /// this TrackingVolume is restricted to Translation only /// @param volumeName volume name to be given - /// @param btype (optional) AxisType - arbitrary(default) or equidistant + /// @param aType (optional) AxisType - Variable (default) or Equidistant /// /// @return shared pointer to a new TrackingVolume virtual MutableTrackingVolumePtr createTrackingVolume( @@ -89,7 +89,7 @@ class ITrackingVolumeHelper { std::shared_ptr volumeMaterial, double loc0Min, double loc0Max, double loc1Min, double loc1Max, const std::string& volumeName = "UndefinedVolume", - AxisType btype = AxisType::Variable) const = 0; + AxisType aType = AxisType::Variable) const = 0; /// Create a gap volume from dimensions and /// @@ -119,7 +119,7 @@ class ITrackingVolumeHelper { /// @param layerPositions custom layer positions /// @param cylinder type of layers /// @param volumeName : volume name to be given - /// @param btype (optional) AxisType - arbitrary(default) or equidistant + /// @param aType (optional) AxisType - Variable (default) or Equidistant /// /// @return shared pointer to a new TrackingVolume virtual MutableTrackingVolumePtr createGapTrackingVolume( @@ -128,7 +128,7 @@ class ITrackingVolumeHelper { double loc0Max, double loc1Min, double loc1Max, const std::vector& layerPositions, bool cylinder = true, const std::string& volumeName = "UndefinedVolume", - AxisType btype = AxisType::Variable) const = 0; + AxisType aType = AxisType::Variable) const = 0; /// Create a one level higher TrackingVolue /// diff --git a/Core/include/Acts/Geometry/LayerArrayCreator.hpp b/Core/include/Acts/Geometry/LayerArrayCreator.hpp index bf4646cb270..d53e44d7c4c 100644 --- a/Core/include/Acts/Geometry/LayerArrayCreator.hpp +++ b/Core/include/Acts/Geometry/LayerArrayCreator.hpp @@ -46,20 +46,11 @@ class LayerArrayCreator : public ILayerArrayCreator { /// Destructor ~LayerArrayCreator() override = default; - /// LayerArrayCreator interface method - /// - /// @param gctx is the geometry context for witch the array is built - /// @param layersInput are the layers to be moved into an array - /// @param min is the minimum value for binning - /// @param max is the maximum value for binning - /// @param bType is the binning type - /// @param bValue is the value in which the binning should be done - /// - /// @return unique pointer to a newly created LayerArray + /// @copydoc ILayerArrayCreator::layerArray std::unique_ptr layerArray( const GeometryContext& gctx, const LayerVector& layersInput, double min, - double max, AxisType bType = AxisType::Variable, - AxisDirection bValue = AxisDirection::AxisX) const override; + double max, AxisType aType = AxisType::Variable, + AxisDirection aDir = AxisDirection::AxisX) const override; /// set logging instance void setLogger(std::unique_ptr logger) { @@ -77,12 +68,11 @@ class LayerArrayCreator : public ILayerArrayCreator { /// the NavigationLayer, it clones the /// @param layer object and thus needs the /// @param gctx geometry context. - /// - /// @param bValue is the Binning value for the layer array + /// @param aDir is the axis direction for the ordering /// @param offset is the sift for the navigation layer std::shared_ptr createNavigationSurface(const GeometryContext& gctx, const Layer& layer, - AxisDirection bValue, + AxisDirection aDir, double offset) const; }; diff --git a/Core/include/Acts/Geometry/SurfaceBinningMatcher.hpp b/Core/include/Acts/Geometry/SurfaceBinningMatcher.hpp index 1b336681e96..881680afb5a 100644 --- a/Core/include/Acts/Geometry/SurfaceBinningMatcher.hpp +++ b/Core/include/Acts/Geometry/SurfaceBinningMatcher.hpp @@ -31,10 +31,10 @@ struct SurfaceBinningMatcher { /// Check function for surface equivalent /// /// @param gctx [in] gctx the geometry context for this check - /// @param bValue the binning value for the binning + /// @param aDir the axis direction for the binning /// @param one first surface for checking /// @param other second surface for checking - bool operator()(const Acts::GeometryContext& gctx, AxisDirection bValue, + bool operator()(const Acts::GeometryContext& gctx, AxisDirection aDir, const Acts::Surface* one, const Acts::Surface* other) const { // Fast exit if (one == other) { @@ -44,15 +44,15 @@ struct SurfaceBinningMatcher { auto oneExt = one->polyhedronRepresentation(gctx, 1).extent(); auto otherExt = other->polyhedronRepresentation(gctx, 1).extent(); - double oneMin = oneExt.min(bValue); - double oneMax = oneExt.max(bValue); + double oneMin = oneExt.min(aDir); + double oneMax = oneExt.max(aDir); - double otherMin = otherExt.min(bValue); - double otherMax = otherExt.max(bValue); + double otherMin = otherExt.min(aDir); + double otherMax = otherExt.max(aDir); return ( - std::abs(oneMin - otherMin) <= tolerances[toUnderlying(bValue)].first && - std::abs(oneMax - otherMax) <= tolerances[toUnderlying(bValue)].second); + std::abs(oneMin - otherMin) <= tolerances[toUnderlying(aDir)].first && + std::abs(oneMax - otherMax) <= tolerances[toUnderlying(aDir)].second); } }; diff --git a/Core/src/Geometry/Extent.cpp b/Core/src/Geometry/Extent.cpp index a149ae1b1f0..f2863db6958 100644 --- a/Core/src/Geometry/Extent.cpp +++ b/Core/src/Geometry/Extent.cpp @@ -30,92 +30,92 @@ Acts::Extent::Extent(const ExtentEnvelope& envelope) } void Acts::Extent::extend(const Vector3& vtx, - const std::vector& bValues, + const std::vector& aDirs, bool applyEnv, bool fillHistograms) { - for (auto bValue : bValues) { + for (auto aDir : aDirs) { // Get the casted value given the binning value description - ActsScalar cValue = VectorHelpers::cast(vtx, bValue); + ActsScalar cValue = VectorHelpers::cast(vtx, aDir); if (fillHistograms) { - m_valueHistograms[toUnderlying(bValue)].push_back(cValue); + m_valueHistograms[toUnderlying(aDir)].push_back(cValue); } // Apply envelope as suggested - ActsScalar lEnv = applyEnv ? m_envelope[bValue][0] : 0.; - ActsScalar hEnv = applyEnv ? m_envelope[bValue][1] : 0.; + ActsScalar lEnv = applyEnv ? m_envelope[aDir][0] : 0.; + ActsScalar hEnv = applyEnv ? m_envelope[aDir][1] : 0.; ActsScalar mValue = cValue - lEnv; // Special protection for radial value - if (bValue == AxisDirection::AxisR && mValue < 0.) { + if (aDir == AxisDirection::AxisR && mValue < 0.) { mValue = std::max(mValue, 0.); } - if (constrains(bValue)) { - m_range[toUnderlying(bValue)].expand(mValue, cValue + hEnv); + if (constrains(aDir)) { + m_range[toUnderlying(aDir)].expand(mValue, cValue + hEnv); } else { - m_range[toUnderlying(bValue)].shrink(mValue, cValue + hEnv); + m_range[toUnderlying(aDir)].shrink(mValue, cValue + hEnv); } - m_constrains.set(toUnderlying(bValue)); + m_constrains.set(toUnderlying(aDir)); } } void Acts::Extent::extend(const Extent& rhs, - const std::vector& bValues, + const std::vector& aDirs, bool applyEnv) { - for (auto bValue : bValues) { + for (auto aDir : aDirs) { // The value is constraint, envelope can be optional - if (rhs.constrains(bValue)) { - ActsScalar lEnv = applyEnv ? m_envelope[bValue][0] : 0.; - ActsScalar hEnv = applyEnv ? m_envelope[bValue][1] : 0.; - if (constrains(bValue)) { - m_range[toUnderlying(bValue)].expand( - rhs.range()[toUnderlying(bValue)].min() - lEnv, - rhs.range()[toUnderlying(bValue)].max() + hEnv); + if (rhs.constrains(aDir)) { + ActsScalar lEnv = applyEnv ? m_envelope[aDir][0] : 0.; + ActsScalar hEnv = applyEnv ? m_envelope[aDir][1] : 0.; + if (constrains(aDir)) { + m_range[toUnderlying(aDir)].expand( + rhs.range()[toUnderlying(aDir)].min() - lEnv, + rhs.range()[toUnderlying(aDir)].max() + hEnv); } else { - m_range[toUnderlying(bValue)].shrink( - rhs.range()[toUnderlying(bValue)].min() - lEnv, - rhs.range()[toUnderlying(bValue)].max() + hEnv); + m_range[toUnderlying(aDir)].shrink( + rhs.range()[toUnderlying(aDir)].min() - lEnv, + rhs.range()[toUnderlying(aDir)].max() + hEnv); } - m_constrains.set(toUnderlying(bValue)); - } else if (rhs.envelope()[bValue] != zeroEnvelope) { + m_constrains.set(toUnderlying(aDir)); + } else if (rhs.envelope()[aDir] != zeroEnvelope) { // Only an envelope given, but value is not constraint -> apply envelope - m_range[toUnderlying(bValue)].expand( - m_range[toUnderlying(bValue)].min() - rhs.envelope()[bValue][0], - m_range[toUnderlying(bValue)].max() + rhs.envelope()[bValue][1]); - m_constrains.set(toUnderlying(bValue)); + m_range[toUnderlying(aDir)].expand( + m_range[toUnderlying(aDir)].min() - rhs.envelope()[aDir][0], + m_range[toUnderlying(aDir)].max() + rhs.envelope()[aDir][1]); + m_constrains.set(toUnderlying(aDir)); } } } void Acts::Extent::addConstrain(const Acts::Extent& rhs, const ExtentEnvelope& envelope) { - for (const auto& bValue : allAxisDirections()) { - if (rhs.constrains(bValue) && !constrains(bValue)) { - const auto& cRange = rhs.range(bValue); - m_range[toUnderlying(bValue)].setMin(cRange.min() - envelope[bValue][0u]); - m_range[toUnderlying(bValue)].setMax(cRange.max() + envelope[bValue][1u]); - m_constrains.set(toUnderlying(bValue)); + for (const auto& aDir : allAxisDirections()) { + if (rhs.constrains(aDir) && !constrains(aDir)) { + const auto& cRange = rhs.range(aDir); + m_range[toUnderlying(aDir)].setMin(cRange.min() - envelope[aDir][0u]); + m_range[toUnderlying(aDir)].setMax(cRange.max() + envelope[aDir][1u]); + m_constrains.set(toUnderlying(aDir)); } } } -void Acts::Extent::set(AxisDirection bValue, ActsScalar min, ActsScalar max) { +void Acts::Extent::set(AxisDirection aDir, ActsScalar min, ActsScalar max) { ActsScalar minval = min; - if (bValue == AxisDirection::AxisR && minval < 0.) { + if (aDir == AxisDirection::AxisR && minval < 0.) { minval = 0.; } - m_range[toUnderlying(bValue)] = Range1D{minval, max}; - m_constrains.set(toUnderlying(bValue)); + m_range[toUnderlying(aDir)] = Range1D{minval, max}; + m_constrains.set(toUnderlying(aDir)); } -void Acts::Extent::setMin(AxisDirection bValue, ActsScalar min) { +void Acts::Extent::setMin(AxisDirection aDir, ActsScalar min) { ActsScalar minval = min; - if (bValue == AxisDirection::AxisR && minval < 0.) { + if (aDir == AxisDirection::AxisR && minval < 0.) { minval = 0.; } - m_range[toUnderlying(bValue)].setMin(0u, minval); - m_constrains.set(toUnderlying(bValue)); + m_range[toUnderlying(aDir)].setMin(0u, minval); + m_constrains.set(toUnderlying(aDir)); } -void Acts::Extent::setMax(AxisDirection bValue, ActsScalar max) { - m_range[toUnderlying(bValue)].setMax(0u, max); - m_constrains.set(toUnderlying(bValue)); +void Acts::Extent::setMax(AxisDirection aDir, ActsScalar max) { + m_range[toUnderlying(aDir)].setMax(0u, max); + m_constrains.set(toUnderlying(aDir)); } void Acts::Extent::setEnvelope(const ExtentEnvelope& envelope) { @@ -134,7 +134,7 @@ bool Acts::Extent::contains(const Vector3& vtx) const { } bool Acts::Extent::contains(const Extent& rhs, - std::optional bValue) const { + std::optional aDir) const { // Helper to check including a constraint bit set check auto checkContainment = [&](AxisDirection bvc) -> bool { if (!constrains(bvc)) { @@ -144,15 +144,15 @@ bool Acts::Extent::contains(const Extent& rhs, }; // Check all - if (!bValue.has_value()) { + if (!aDir.has_value()) { return std::ranges::all_of(allAxisDirections(), checkContainment); } // Check specific - return checkContainment(bValue.value()); + return checkContainment(aDir.value()); } bool Acts::Extent::intersects(const Extent& rhs, - std::optional bValue) const { + std::optional aDir) const { // Helper to check including a constraint bit set check auto checkIntersect = [&](AxisDirection bvc) -> bool { if (!constrains(bvc) || !rhs.constrains(bvc)) { @@ -162,15 +162,15 @@ bool Acts::Extent::intersects(const Extent& rhs, }; // Check all - if (!bValue.has_value()) { + if (!aDir.has_value()) { return std::ranges::any_of(allAxisDirections(), checkIntersect); } // Check specific - return checkIntersect(bValue.value()); + return checkIntersect(aDir.value()); } -bool Acts::Extent::constrains(AxisDirection bValue) const { - return m_constrains.test(static_cast(bValue)); +bool Acts::Extent::constrains(AxisDirection aDir) const { + return m_constrains.test(static_cast(aDir)); } bool Acts::Extent::constrains() const { diff --git a/Core/src/Geometry/LayerArrayCreator.cpp b/Core/src/Geometry/LayerArrayCreator.cpp index f5645afdbd4..c9a41a52e43 100644 --- a/Core/src/Geometry/LayerArrayCreator.cpp +++ b/Core/src/Geometry/LayerArrayCreator.cpp @@ -30,18 +30,18 @@ std::unique_ptr Acts::LayerArrayCreator::layerArray( const GeometryContext& gctx, const LayerVector& layersInput, double min, - double max, AxisType bType, AxisDirection bValue) const { + double max, AxisType aType, AxisDirection aDir) const { ACTS_VERBOSE("Build LayerArray with " << layersInput.size() << " layers at input."); ACTS_VERBOSE(" min/max provided : " << min << " / " << max); - ACTS_VERBOSE(" binning type : " << bType); - ACTS_VERBOSE(" binning value : " << bValue); + ACTS_VERBOSE(" binning type : " << aType); + ACTS_VERBOSE(" binning value : " << aDir); // create a local copy of the layer vector LayerVector layers(layersInput); // sort it accordingly to the binning value - GeometryObjectSorterT> layerSorter(gctx, bValue); + GeometryObjectSorterT> layerSorter(gctx, aDir); std::ranges::sort(layers, layerSorter); // useful typedef using LayerOrderPosition = std::pair, Vector3>; @@ -51,19 +51,19 @@ std::unique_ptr Acts::LayerArrayCreator::layerArray( std::vector layerOrderVector; // switch the binning type - switch (bType) { + switch (aType) { // equidistant binning - no navigation layers built - only equdistant layers case AxisType::Equidistant: { // loop over layers and put them in for (auto& layIter : layers) { ACTS_VERBOSE("equidistant : registering a Layer at binning position : " - << (layIter->referencePosition(gctx, bValue))); + << (layIter->referencePosition(gctx, aDir))); layerOrderVector.push_back(LayerOrderPosition( - layIter, layIter->referencePosition(gctx, bValue))); + layIter, layIter->referencePosition(gctx, aDir))); } // create the binUitlity binUtility = std::make_unique( - layers.size(), min, max, AxisBoundaryType::Bound, bValue); + layers.size(), min, max, AxisBoundaryType::Bound, aDir); ACTS_VERBOSE("equidistant : created a BinUtility as " << *binUtility); } break; @@ -80,7 +80,7 @@ std::unique_ptr Acts::LayerArrayCreator::layerArray( for (auto& layIter : layers) { // estimate the offset layerThickness = layIter->thickness(); - layerValue = layIter->referencePositionValue(gctx, bValue); + layerValue = layIter->referencePositionValue(gctx, aDir); // register the new boundaries in the step vector boundaries.push_back(layerValue - 0.5 * layerThickness); boundaries.push_back(layerValue + 0.5 * layerThickness); @@ -107,25 +107,25 @@ std::unique_ptr Acts::LayerArrayCreator::layerArray( // create the navigation layer surface from the layer std::shared_ptr navLayerSurface = - createNavigationSurface(gctx, *layIter, bValue, + createNavigationSurface(gctx, *layIter, aDir, -std::abs(layerValue - navigationValue)); ACTS_VERBOSE( "arbitrary : creating a NavigationLayer at " - << (navLayerSurface->referencePosition(gctx, bValue)).x() << ", " - << (navLayerSurface->referencePosition(gctx, bValue)).y() << ", " - << (navLayerSurface->referencePosition(gctx, bValue)).z()); + << (navLayerSurface->referencePosition(gctx, aDir)).x() << ", " + << (navLayerSurface->referencePosition(gctx, aDir)).y() << ", " + << (navLayerSurface->referencePosition(gctx, aDir)).z()); navLayer = NavigationLayer::create(std::move(navLayerSurface)); // push the navigation layer in layerOrderVector.push_back(LayerOrderPosition( - navLayer, navLayer->referencePosition(gctx, bValue))); + navLayer, navLayer->referencePosition(gctx, aDir))); // push the original layer in layerOrderVector.push_back(LayerOrderPosition( - layIter, layIter->referencePosition(gctx, bValue))); + layIter, layIter->referencePosition(gctx, aDir))); ACTS_VERBOSE("arbitrary : registering MaterialLayer at " - << (layIter->referencePosition(gctx, bValue)).x() << ", " - << (layIter->referencePosition(gctx, bValue)).y() << ", " - << (layIter->referencePosition(gctx, bValue)).z()); + << (layIter->referencePosition(gctx, aDir)).x() << ", " + << (layIter->referencePosition(gctx, aDir)).y() << ", " + << (layIter->referencePosition(gctx, aDir)).z()); // remember the last lastLayer = layIter; } @@ -137,17 +137,17 @@ std::unique_ptr Acts::LayerArrayCreator::layerArray( if (navigationValue != max && lastLayer != nullptr) { // create the navigation layer surface from the layer std::shared_ptr navLayerSurface = - createNavigationSurface(gctx, *lastLayer, bValue, + createNavigationSurface(gctx, *lastLayer, aDir, navigationValue - layerValue); ACTS_VERBOSE( "arbitrary : creating a NavigationLayer at " - << (navLayerSurface->referencePosition(gctx, bValue)).x() << ", " - << (navLayerSurface->referencePosition(gctx, bValue)).y() << ", " - << (navLayerSurface->referencePosition(gctx, bValue)).z()); + << (navLayerSurface->referencePosition(gctx, aDir)).x() << ", " + << (navLayerSurface->referencePosition(gctx, aDir)).y() << ", " + << (navLayerSurface->referencePosition(gctx, aDir)).z()); navLayer = NavigationLayer::create(std::move(navLayerSurface)); // push the navigation layer in layerOrderVector.push_back(LayerOrderPosition( - navLayer, navLayer->referencePosition(gctx, bValue))); + navLayer, navLayer->referencePosition(gctx, aDir))); } // now close the boundaries boundaries.push_back(max); @@ -156,7 +156,7 @@ std::unique_ptr Acts::LayerArrayCreator::layerArray( << " Layers (material + navigation) built. "); // create the BinUtility binUtility = std::make_unique( - boundaries, AxisBoundaryType::Bound, bValue); + boundaries, AxisBoundaryType::Bound, aDir); ACTS_VERBOSE("arbitrary : created a BinUtility as " << *binUtility); } break; @@ -171,14 +171,14 @@ std::unique_ptr Acts::LayerArrayCreator::layerArray( } std::shared_ptr Acts::LayerArrayCreator::createNavigationSurface( - const GeometryContext& gctx, const Layer& layer, AxisDirection bValue, + const GeometryContext& gctx, const Layer& layer, AxisDirection aDir, double offset) const { // surface reference const Surface& layerSurface = layer.surfaceRepresentation(); // translation to be applied Vector3 translation(0., 0., 0.); // switching he binnig values - switch (bValue) { + switch (aDir) { // case x case AxisDirection::AxisX: { translation = Vector3(offset, 0., 0.);