Skip to content

Commit

Permalink
more removal of binning namings
Browse files Browse the repository at this point in the history
  • Loading branch information
asalzburger committed Nov 12, 2024
1 parent f9553b4 commit 0db39e0
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 137 deletions.
1 change: 0 additions & 1 deletion Core/include/Acts/Geometry/CylinderVolumeBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm>
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Geometry/CylinderVolumeHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
29 changes: 15 additions & 14 deletions Core/include/Acts/Geometry/Extent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,21 @@ using Envelope = std::array<ActsScalar, 2>;

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
Expand Down Expand Up @@ -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<AxisDirection>& bValues = allAxisDirections(),
const std::vector<AxisDirection>& 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 <typename vector_iterator_t>
void extend(const vector_iterator_t& start, const vector_iterator_t& end,
const std::vector<AxisDirection>& bValues = allAxisDirections(),
const std::vector<AxisDirection>& 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);
}
}

Expand All @@ -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<AxisDirection>& bValues = allAxisDirections(),
const std::vector<AxisDirection>& aDirs = allAxisDirections(),
bool applyEnv = true);

/// Constrain an extent by another one, this is
Expand Down
8 changes: 4 additions & 4 deletions Core/include/Acts/Geometry/GeometryObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Geometry/GeometryObjectSorter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions Core/include/Acts/Geometry/ILayerArrayCreator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ using LayerVector = std::vector<LayerPtr>;

/// @class ILayerArrayCreator
///
/// Interface class ILayerArrayCreators.
///
/// It receives the LayerVector and creaets an array with NaivgationLayer
/// objects filled in between.
class ILayerArrayCreator {
Expand All @@ -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<const LayerArray> 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
12 changes: 6 additions & 6 deletions Core/include/Acts/Geometry/ITrackingVolumeHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
///
Expand All @@ -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(
Expand All @@ -89,7 +89,7 @@ class ITrackingVolumeHelper {
std::shared_ptr<const IVolumeMaterial> 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
///
Expand Down Expand Up @@ -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(
Expand All @@ -128,7 +128,7 @@ class ITrackingVolumeHelper {
double loc0Max, double loc1Min, double loc1Max,
const std::vector<double>& 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
///
Expand Down
20 changes: 5 additions & 15 deletions Core/include/Acts/Geometry/LayerArrayCreator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const LayerArray> 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<const Logger> logger) {
Expand All @@ -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<Surface> createNavigationSurface(const GeometryContext& gctx,
const Layer& layer,
AxisDirection bValue,
AxisDirection aDir,
double offset) const;
};

Expand Down
16 changes: 8 additions & 8 deletions Core/include/Acts/Geometry/SurfaceBinningMatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}
};

Expand Down
Loading

0 comments on commit 0db39e0

Please sign in to comment.