Skip to content

Commit

Permalink
refactor: Remove separate default DetectorElementBase file (#2617)
Browse files Browse the repository at this point in the history
`DetectorElementBase.hpp` has an `ifdef` that either includes the preprocessor define or previously included the default base class header. We included that header in a numbr of locations by accident, breaking the pattern. This removes the separate header (and erroneous inlcudes) and puts the default interface into `DetectorElementBase.hpp` inside the `ifdef`.
  • Loading branch information
paulgessinger authored Nov 4, 2023
1 parent f908ed6 commit eb12644
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 59 deletions.
35 changes: 34 additions & 1 deletion Core/include/Acts/Geometry/DetectorElementBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

#pragma once

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Geometry/GeometryContext.hpp"

#include <memory>
#include <vector>

/// This is the plugin mechanism to exchange the entire DetectorElementBase
///
/// By defining ACTS_DETECTOR_ELEMENT_BASE_REPLACEMENT pre-compile time the
Expand All @@ -18,5 +24,32 @@
#ifdef ACTS_DETECTOR_ELEMENT_BASE_REPLACEMENT
#include ACTS_DETECTOR_ELEMENT_BASE_REPLACEMENT
#else
#include "detail/DefaultDetectorElementBase.hpp"

namespace Acts {

class Surface;

class DetectorElementBase {
public:
DetectorElementBase() = default;
virtual ~DetectorElementBase() = default;

/// Return the transform for the Element proxy mechanism
///
/// @param gctx The current geometry context object, e.g. alignment
virtual const Transform3& transform(const GeometryContext& gctx) const = 0;

/// Return surface representation - const return pattern
virtual const Surface& surface() const = 0;

/// Non-const return pattern
virtual Surface& surface() = 0;

/// Returns the thickness of the module
/// @return double that indicates the thickness of the module
virtual double thickness() const = 0;
};

} // namespace Acts

#endif
49 changes: 0 additions & 49 deletions Core/include/Acts/Geometry/detail/DefaultDetectorElementBase.hpp

This file was deleted.

1 change: 0 additions & 1 deletion Core/src/Geometry/ProtoLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Geometry/Polyhedron.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Utilities/Helpers.hpp"

#include <algorithm>
Expand Down
1 change: 0 additions & 1 deletion Core/src/Surfaces/Surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "Acts/Definitions/Common.hpp"
#include "Acts/EventData/detail/TransformationBoundToFree.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Surfaces/SurfaceBounds.hpp"
#include "Acts/Surfaces/detail/AlignmentHelper.hpp"
#include "Acts/Utilities/VectorHelpers.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "Acts/EventData/SourceLink.hpp"
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Plugins/Identification/IdentifiedDetectorElement.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Surfaces/SurfaceArray.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Geometry/DetectorElementBase.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Surfaces/Surface.hpp"

#include <memory>
Expand Down
1 change: 0 additions & 1 deletion Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Geometry/TrackingVolume.hpp"
#include "Acts/Geometry/VolumeBounds.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Plugins/Identification/IdentifiedDetectorElement.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Surfaces/SurfaceArray.hpp"
Expand Down
1 change: 0 additions & 1 deletion Examples/Io/Root/src/RootPlanarClusterWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "Acts/EventData/SourceLink.hpp"
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Plugins/Identification/IdentifiedDetectorElement.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/Result.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Geometry/DetectorElementBase.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Surfaces/Surface.hpp"

#include <memory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "Acts/Geometry/PlaneLayer.hpp"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Geometry/TrackingVolume.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Material/HomogeneousSurfaceMaterial.hpp"
#include "Acts/Surfaces/PlaneSurface.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
Expand Down
1 change: 0 additions & 1 deletion Tests/UnitTests/Core/Geometry/AlignmentContextTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp"
#include "Acts/Surfaces/PlaneSurface.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
#include "Acts/Surfaces/Surface.hpp"
Expand Down

0 comments on commit eb12644

Please sign in to comment.