Skip to content

Commit b473181

Browse files
authored
chore!: rename BinningValue to AxisDirection (acts-project#4005)
This PR supersede acts-project#3826 by encapsulating only the move of `BinningValue` to `AxisDirection` and move it into the renamed `AxisDefinitions.hpp`. This will allow to keep the same enums once the `BinUtility` infrastructure is gone. For Json files, a legacy reading mode is implemented. --- END COMMIT MESSAGE --- Any further description goes here, @-mentions are ok here! - Use a *conventional commits* prefix: [quick summary](https://www.conventionalcommits.org/en/v1.0.0/#summary) - We mostly use `feat`, `fix`, `refactor`, `docs`, `chore` and `build` types. - A milestone will be assigned by one of the maintainers
1 parent 7806575 commit b473181

File tree

299 files changed

+3333
-3204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+3333
-3204
lines changed

Core/include/Acts/Detector/Blueprint.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "Acts/Detector/ProtoBinning.hpp"
1414
#include "Acts/Geometry/Extent.hpp"
1515
#include "Acts/Geometry/VolumeBounds.hpp"
16-
#include "Acts/Utilities/BinningData.hpp"
16+
#include "Acts/Utilities/AxisDefinitions.hpp"
1717
#include "Acts/Utilities/StringHelpers.hpp"
1818

1919
#include <map>
@@ -47,11 +47,11 @@ struct Node final {
4747
/// @param t the transform
4848
/// @param bt the boundary type
4949
/// @param bv the boundary values
50-
/// @param bss the binning values
50+
/// @param bss the axis directions for the binning
5151
/// @param cs the children of the node
5252
/// @param e the estimated extent of the node (optional)
5353
Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt,
54-
const std::vector<double>& bv, const std::vector<BinningValue>& bss,
54+
const std::vector<double>& bv, const std::vector<AxisDirection>& bss,
5555
std::vector<std::unique_ptr<Node>> cs = {}, const Extent& e = Extent())
5656
: name(n),
5757
transform(t),
@@ -96,7 +96,7 @@ struct Node final {
9696
/// Branch definitions: children
9797
std::vector<std::unique_ptr<Node>> children = {};
9898
/// Branch definition binning
99-
std::vector<BinningValue> binning = {};
99+
std::vector<AxisDirection> binning = {};
100100

101101
/// Portal proto material binning
102102
std::map<unsigned int, BinningDescription> portalMaterialBinning = {};

Core/include/Acts/Detector/CuboidalContainerBuilder.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "Acts/Detector/DetectorComponents.hpp"
1313
#include "Acts/Detector/interface/IDetectorComponentBuilder.hpp"
1414
#include "Acts/Geometry/GeometryContext.hpp"
15-
#include "Acts/Utilities/BinningType.hpp"
15+
#include "Acts/Utilities/AxisDefinitions.hpp"
1616
#include "Acts/Utilities/Logger.hpp"
1717

1818
#include <memory>
@@ -36,8 +36,8 @@ class IGeometryIdGenerator;
3636
/// @note the builder expects a fully consistent set of sub volume builders
3737
/// that will be executed in a chain
3838
///
39-
/// @note allowed BinningValue(s) for the cuboid container builder are
40-
/// {binX}, {binY}, {binZ}.
39+
/// @note allowed AxisDirection(s) for the cuboid container builder are
40+
/// {AxisX}, {AxisY}, {AxisZ}.
4141
///
4242
/// @note Connecting containers isn't functional yet due to the underlying
4343
/// issues in the CuboidDetectorHelper
@@ -48,8 +48,8 @@ class CuboidalContainerBuilder : public IDetectorComponentBuilder {
4848
struct Config {
4949
/// The configured volume builders
5050
std::vector<std::shared_ptr<const IDetectorComponentBuilder>> builders = {};
51-
/// Binning prescription of attachment
52-
BinningValue binning{};
51+
/// Axis direction for the binning
52+
AxisDirection binning{};
5353
/// The root volume finder
5454
std::shared_ptr<const IRootVolumeFinderBuilder> rootVolumeFinderBuilder =
5555
nullptr;

Core/include/Acts/Detector/CylindricalContainerBuilder.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "Acts/Detector/ProtoBinning.hpp"
1414
#include "Acts/Detector/interface/IDetectorComponentBuilder.hpp"
1515
#include "Acts/Geometry/GeometryContext.hpp"
16-
#include "Acts/Utilities/BinningType.hpp"
16+
#include "Acts/Utilities/AxisDefinitions.hpp"
1717
#include "Acts/Utilities/Logger.hpp"
1818

1919
#include <map>
@@ -39,17 +39,17 @@ class IGeometryIdGenerator;
3939
/// @note the builder expects a fully consistent set of sub volume builders
4040
/// that will be executed in a chain
4141
///
42-
/// @note allowed BinningValue(s) for the cylindrical container builder are
43-
/// {binZ}, {binR}, {binPhi}, {binZ, binR}, whereas the last option indicates
44-
/// a wrapping setup.
42+
/// @note allowed AxisDirection(s) for the cylindrical container builder are
43+
/// {AxisZ}, {AxisR}, {AxisPhi}, {AxisZ, AxisR}, whereas the last option
44+
/// indicates a wrapping setup.
4545
class CylindricalContainerBuilder : public IDetectorComponentBuilder {
4646
public:
4747
/// Nested configuration object
4848
struct Config {
4949
/// The configured volume builders
5050
std::vector<std::shared_ptr<const IDetectorComponentBuilder>> builders = {};
51-
/// Binning prescription of attachment
52-
std::vector<BinningValue> binning = {};
51+
/// The axis direction for the binning
52+
std::vector<AxisDirection> binning = {};
5353
/// The root volume finder
5454
std::shared_ptr<const IRootVolumeFinderBuilder> rootVolumeFinderBuilder =
5555
nullptr;

Core/include/Acts/Detector/IndexedRootVolumeFinderBuilder.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "Acts/Detector/interface/IRootVolumeFinderBuilder.hpp"
1212
#include "Acts/Geometry/GeometryContext.hpp"
1313
#include "Acts/Navigation/PortalNavigation.hpp"
14-
#include "Acts/Utilities/BinningData.hpp"
14+
#include "Acts/Utilities/AxisDefinitions.hpp"
1515

1616
#include <memory>
1717
#include <vector>
@@ -26,7 +26,7 @@ class IndexedRootVolumeFinderBuilder final : public IRootVolumeFinderBuilder {
2626
public:
2727
/// @brief Constructor with binning casts
2828
/// @param binning the cast values for the grid binning
29-
IndexedRootVolumeFinderBuilder(std::vector<Acts::BinningValue> binning);
29+
IndexedRootVolumeFinderBuilder(std::vector<Acts::AxisDirection> binning);
3030

3131
/// The virtual interface definition for root volume finder builders
3232
///
@@ -40,7 +40,7 @@ class IndexedRootVolumeFinderBuilder final : public IRootVolumeFinderBuilder {
4040
const final;
4141

4242
private:
43-
std::vector<Acts::BinningValue> m_casts;
43+
std::vector<Acts::AxisDirection> m_casts;
4444
};
4545

4646
} // namespace Acts::Experimental

Core/include/Acts/Detector/KdtSurfacesProvider.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "Acts/Detector/detail/ReferenceGenerators.hpp"
1313
#include "Acts/Detector/interface/ISurfacesProvider.hpp"
1414
#include "Acts/Surfaces/Surface.hpp"
15-
#include "Acts/Utilities/BinningData.hpp"
15+
#include "Acts/Utilities/AxisDefinitions.hpp"
1616
#include "Acts/Utilities/KDTree.hpp"
1717

1818
#include <array>
@@ -50,7 +50,7 @@ class KdtSurfaces {
5050
/// @param rgen the reference point generator
5151
KdtSurfaces(const GeometryContext& gctx,
5252
const std::vector<std::shared_ptr<Surface>>& surfaces,
53-
const std::array<BinningValue, kDIM>& casts,
53+
const std::array<AxisDirection, kDIM>& casts,
5454
const reference_generator& rgen =
5555
detail::PolyhedronReferenceGenerator<1u, false>{})
5656
: m_kdt(nullptr), m_casts(casts), m_rGenerator(rgen) {
@@ -113,7 +113,7 @@ class KdtSurfaces {
113113
std::unique_ptr<KDTS> m_kdt = nullptr;
114114

115115
/// Cast values that turn a global position to lookup position
116-
std::array<BinningValue, kDIM> m_casts = {};
116+
std::array<AxisDirection, kDIM> m_casts = {};
117117

118118
/// Helper to generate reference points for filling
119119
reference_generator m_rGenerator;

Core/include/Acts/Detector/ProtoBinning.hpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
#include "Acts/Definitions/Algebra.hpp"
1212
#include "Acts/Definitions/Common.hpp"
13-
#include "Acts/Utilities/AxisFwd.hpp"
13+
#include "Acts/Utilities/AxisDefinitions.hpp"
1414
#include "Acts/Utilities/BinUtility.hpp"
15-
#include "Acts/Utilities/BinningType.hpp"
1615

1716
#include <sstream>
1817
#include <stdexcept>
@@ -27,8 +26,8 @@ namespace Acts::Experimental {
2726
/// only for convenience that the binning can be defined and then
2827
/// translated into concrete axis types
2928
struct ProtoBinning {
30-
/// The binning value of this
31-
BinningValue binValue;
29+
/// The axis direction
30+
AxisDirection axisDir;
3231
/// The axis type: equidistant or variable
3332
Acts::AxisType axisType = Acts::AxisType::Equidistant;
3433
/// The axis boundary type: Open, Bound or Closed
@@ -42,13 +41,13 @@ struct ProtoBinning {
4241

4342
/// Convenience constructors - for variable binning
4443
///
45-
/// @param bValue the value/cast in which this is binned
44+
/// @param aDir the value/cast in which this is binned
4645
/// @param bType the axis boundary type
4746
/// @param e the bin edges (variable binning)
4847
/// @param exp the expansion (in bins)
49-
ProtoBinning(BinningValue bValue, Acts::AxisBoundaryType bType,
48+
ProtoBinning(AxisDirection aDir, Acts::AxisBoundaryType bType,
5049
const std::vector<double>& e, std::size_t exp = 0u)
51-
: binValue(bValue),
50+
: axisDir(aDir),
5251
axisType(Acts::AxisType::Variable),
5352
boundaryType(bType),
5453
edges(e),
@@ -61,18 +60,18 @@ struct ProtoBinning {
6160

6261
/// Convenience constructors - for equidistant binning
6362
///
64-
/// @param bValue the value/cast in which this is binned
63+
/// @param aDir the value/cast in which this is binned
6564
/// @param bType the axis boundary type
6665
/// @param minE the lowest edge of the binning
6766
/// @param maxE the highest edge of the binning
6867
/// @param nbins the number of bins
6968
/// @param exp the expansion (in bins)
70-
ProtoBinning(BinningValue bValue, Acts::AxisBoundaryType bType, double minE,
69+
ProtoBinning(AxisDirection aDir, Acts::AxisBoundaryType bType, double minE,
7170
double maxE, std::size_t nbins, std::size_t exp = 0u)
72-
: binValue(bValue), boundaryType(bType), expansion(exp) {
71+
: axisDir(aDir), boundaryType(bType), expansion(exp) {
7372
if (minE >= maxE) {
74-
std::string msg = "ProtoBinning: Invalid binning for value '";
75-
msg += binningValueName(bValue);
73+
std::string msg = "ProtoBinning: Invalid axis range for direction '";
74+
msg += axisDirectionName(axisDir);
7675
msg += "', min edge (" + std::to_string(minE) + ") ";
7776
msg += " needs to be smaller than max edge (";
7877
msg += std::to_string(maxE) + ").";
@@ -96,13 +95,13 @@ struct ProtoBinning {
9695
/// when the actual extent is not yet evaluated, only works
9796
/// for equidistant binning obviously
9897
///
99-
/// @param bValue the value/cast in which this is binned
98+
/// @param aDir the value/cast in which this is binned
10099
/// @param bType the axis boundary type
101100
/// @param nbins the number of bins
102101
/// @param exp the expansion (in bins)
103-
ProtoBinning(BinningValue bValue, Acts::AxisBoundaryType bType,
102+
ProtoBinning(AxisDirection aDir, Acts::AxisBoundaryType bType,
104103
std::size_t nbins, std::size_t exp = 0u)
105-
: binValue(bValue),
104+
: axisDir(aDir),
106105
boundaryType(bType),
107106
edges(nbins + 1, 0.),
108107
expansion(exp),
@@ -115,7 +114,7 @@ struct ProtoBinning {
115114
std::string toString() const {
116115
std::stringstream ss;
117116
ss << "ProtoBinning: " << bins() << " bins in "
118-
<< binningValueName(binValue);
117+
<< axisDirectionName(axisDir);
119118
ss << (axisType == Acts::AxisType::Variable ? ", variable "
120119
: ", equidistant ");
121120
if (!autorange) {
@@ -165,12 +164,12 @@ struct BinningDescription {
165164
: Acts::closed;
166165
if (b.axisType == Acts::AxisType::Equidistant) {
167166
binUtility += BinUtility(b.bins(), b.edges.front(), b.edges.back(),
168-
bOption, b.binValue);
167+
bOption, b.axisDir);
169168
} else {
170169
std::vector<float> edges;
171170
std::for_each(b.edges.begin(), b.edges.end(),
172171
[&](double edge) { edges.push_back(edge); });
173-
binUtility += BinUtility(edges, bOption, b.binValue);
172+
binUtility += BinUtility(edges, bOption, b.axisDir);
174173
}
175174
}
176175
return binUtility;

Core/include/Acts/Detector/ProtoDetector.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ struct ProtoVolume {
9898
void extendUp(ProtoVolume& ptVolume);
9999

100100
/// Extend the tracking volume with its own constituents
101-
/// @param bValue the binning value that is propagated
102-
void propagateMinDown(BinningValue bValue);
101+
/// @param aDir the axis direction that is propagated
102+
void propagateMinDown(AxisDirection aDir);
103103

104104
/// Extend the tracking volume with its own constituents
105-
/// @param bValue the binning value that is propagated
106-
void propagateMaxDown(BinningValue bValue);
105+
/// @param aDir the axis direction that is propagated
106+
void propagateMaxDown(AxisDirection aDir);
107107

108108
/// Constrain the daughter volumes with this volume
109109
///

Core/include/Acts/Detector/ProtoSupport.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "Acts/Definitions/Common.hpp"
1313
#include "Acts/Detector/ProtoBinning.hpp"
1414
#include "Acts/Surfaces/Surface.hpp"
15-
#include "Acts/Utilities/AxisFwd.hpp"
15+
#include "Acts/Utilities/AxisDefinitions.hpp"
1616
#include "Acts/Utilities/BinningData.hpp"
1717

1818
#include <optional>
@@ -55,7 +55,7 @@ struct ProtoSupport {
5555
/// The internal constraint would overwrite the volume one in order to allow
5656
/// support surfaces to be fitted from global volume extensions to the
5757
/// actually contained internal objects.
58-
std::vector<BinningValue> internalConstraints = {};
58+
std::vector<AxisDirection> internalConstraints = {};
5959

6060
// Building instructions 2 (surface is provided):
6161

@@ -69,7 +69,7 @@ struct ProtoSupport {
6969
unsigned int splits = 1u;
7070

7171
/// Planar placement (only valid for planar support surfaces)
72-
BinningValue pPlacement = BinningValue::binZ;
72+
AxisDirection pPlacement = AxisDirection::AxisZ;
7373

7474
/// Indicate if the support surface(s) should always be addressed in
7575
/// navigation

Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace detail::CuboidalDetectorHelper {
3333
///
3434
/// @param gctx The geometry context
3535
/// @param volumes the volumes
36-
/// @param bValue the binning value (allowed are binX, binY, binZ)
36+
/// @param bValue the binning value (allowed are AxisX, AxisY, AxisZ)
3737
/// @param selectedOnly switch only selected boundaries
3838
/// @param logLevel is the screen logging level
3939
///
@@ -43,15 +43,15 @@ namespace detail::CuboidalDetectorHelper {
4343
/// @return a proto container with the outside portals
4444
DetectorComponent::PortalContainer connect(
4545
const GeometryContext& gctx,
46-
std::vector<std::shared_ptr<DetectorVolume>>& volumes, BinningValue bValue,
46+
std::vector<std::shared_ptr<DetectorVolume>>& volumes, AxisDirection bValue,
4747
const std::vector<unsigned int>& selectedOnly = {},
4848
Acts::Logging::Level logLevel = Acts::Logging::INFO);
4949

5050
/// @brief Connect containers given a binning value
5151
///
5252
/// @param gctx The geometry context
5353
/// @param containers the containers
54-
/// @param bValue the binning value (allowed are binX, binY, binZ)
54+
/// @param bValue the binning value (allowed are AxisX, AxisY, AxisZ)
5555
/// @param selectedOnly switch only selected boundaries
5656
/// @param logLevel is the screen logging level
5757
///
@@ -62,7 +62,7 @@ DetectorComponent::PortalContainer connect(
6262
DetectorComponent::PortalContainer connect(
6363
const GeometryContext& gctx,
6464
const std::vector<DetectorComponent::PortalContainer>& containers,
65-
BinningValue bValue, const std::vector<unsigned int>& selectedOnly = {},
65+
AxisDirection bValue, const std::vector<unsigned int>& selectedOnly = {},
6666
Acts::Logging::Level logLevel = Acts::Logging::INFO);
6767

6868
/// @brief Helper method to extract r,z,phi boundaries for

Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void checkRotationAlignment(
4848
std::vector<double> checkCenterAlignment(
4949
const GeometryContext& gctx,
5050
const std::vector<std::shared_ptr<Experimental::DetectorVolume>>& volumes,
51-
BinningValue axisValue);
51+
AxisDirection axisValue);
5252

5353
} // namespace detail::DetectorVolumeConsistency
5454
} // namespace Acts::Experimental

0 commit comments

Comments
 (0)