Skip to content

Commit

Permalink
chore: add detector directory (#1867)
Browse files Browse the repository at this point in the history
This PR moves the new `Detector` infrastructure into its own directory, it should help organize this effort a bit better.
  • Loading branch information
asalzburger committed Feb 16, 2023
1 parent d857080 commit 656e69a
Show file tree
Hide file tree
Showing 36 changed files with 68 additions and 67 deletions.
1 change: 1 addition & 0 deletions Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ install(
add_subdirectory(src/EventData)
add_subdirectory(src/Digitization)
add_subdirectory(src/Definitions)
add_subdirectory(src/Detector)
add_subdirectory(src/Geometry)
add_subdirectory(src/MagneticField)
add_subdirectory(src/Material)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Common.hpp"
#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Navigation/NavigationDelegates.hpp"
#include "Acts/Utilities/Delegate.hpp"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#pragma once

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Detector/Portal.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/Portal.hpp"
#include "Acts/Geometry/VolumeBounds.hpp"
#include "Acts/Navigation/DetectorVolumeUpdators.hpp"
#include "Acts/Utilities/Helpers.hpp"
Expand All @@ -22,10 +22,8 @@

namespace Acts {
namespace Experimental {
namespace detail {

/// @brief Generator function for creation of portal surfaces
/// for a cylindrical volume
///
/// @param dTransform a contextually resolved transform
/// @param dBounds the detecor volume bounds
Expand Down Expand Up @@ -79,6 +77,5 @@ defaultPortalGenerator() {
return pGenerator;
}

} // namespace detail
} // namespace Experimental
} // namespace Acts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#pragma once

#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Detector/Portal.hpp"
#include "Acts/Detector/PortalGenerators.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/Portal.hpp"
#include "Acts/Geometry/detail/PortalGenerators.hpp"
#include "Acts/Utilities/Delegate.hpp"

#include <exception>
Expand All @@ -21,7 +21,6 @@

namespace Acts {
namespace Experimental {
namespace detail {

/// @brief Calls the portal generation and adds registration to sub portals
///
Expand Down Expand Up @@ -61,6 +60,7 @@ generatePortalsUpdateInternals(
/// Create a default portal generator that connects to the
/// static method.
///
/// @note parameters are ignored in this case
inline static Delegate<std::vector<std::shared_ptr<Portal>>(
const Transform3&, const VolumeBounds&,
const std::shared_ptr<DetectorVolume>&)>
Expand Down Expand Up @@ -127,6 +127,5 @@ std::vector<std::shared_ptr<DetectorVolume>> attachedDetectorVolumes(
return attachedVolumes[iu];
}

} // namespace detail
} // namespace Experimental
} // namespace Acts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#pragma once

#include "Acts/Detector/ProtoDetector.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Geometry/ProtoDetector.hpp"
#include "Acts/Geometry/TrackingGeometryBuilder.hpp"
#include "Acts/Utilities/KDTree.hpp"
#include "Acts/Utilities/Logger.hpp"
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Navigation/DetectorVolumeFinders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#pragma once

#include "Acts/Geometry/Detector.hpp"
#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Detector/Detector.hpp"
#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Navigation/NavigationDelegates.hpp"
#include "Acts/Navigation/NavigationState.hpp"
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Navigation/SurfaceCandidatesUpdators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Common.hpp"
#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Detector/Portal.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/Portal.hpp"
#include "Acts/Navigation/NavigationState.hpp"
#include "Acts/Navigation/NavigationStateUpdators.hpp"
#include "Acts/Surfaces/Surface.hpp"
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Visualization/GeometryView3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#pragma once

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Geometry/AbstractVolume.hpp"
#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Visualization/IVisualization3D.hpp"
#include "Acts/Visualization/ViewConfig.hpp"
Expand Down
8 changes: 8 additions & 0 deletions Core/src/Detector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target_sources(
ActsCore
PRIVATE
Detector.cpp
DetectorVolume.cpp
Portal.cpp
ProtoDetector.cpp
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Geometry/Detector.hpp"
#include "Acts/Detector/Detector.hpp"

#include "Acts/Definitions/Common.hpp"
#include "Acts/Geometry/Portal.hpp"
#include "Acts/Detector/Portal.hpp"
#include "Acts/Geometry/VolumeBounds.hpp"
#include "Acts/Navigation/NavigationState.hpp"
#include "Acts/Surfaces/Surface.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Detector/DetectorVolume.hpp"

#include "Acts/Geometry/Portal.hpp"
#include "Acts/Detector/Portal.hpp"
#include "Acts/Geometry/VolumeBounds.hpp"
#include "Acts/Navigation/DetectorVolumeUpdators.hpp"
#include "Acts/Navigation/NavigationState.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Geometry/Portal.hpp"
#include "Acts/Detector/Portal.hpp"

#include "Acts/Surfaces/Surface.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Geometry/ProtoDetector.hpp"
#include "Acts/Detector/ProtoDetector.hpp"

#include "Acts/Utilities/Enumerate.hpp"

Expand Down
4 changes: 0 additions & 4 deletions Core/src/Geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ target_sources(
CylinderVolumeHelper.cpp
Extent.cpp
KDTreeTrackingGeometryBuilder.cpp
Detector.cpp
DetectorVolume.cpp
DiscLayer.cpp
GenericApproachDescriptor.cpp
GenericCuboidVolumeBounds.cpp
Expand All @@ -27,9 +25,7 @@ target_sources(
PassiveLayerBuilder.cpp
PlaneLayer.cpp
Polyhedron.cpp
Portal.cpp
ProtoLayer.cpp
ProtoDetector.cpp
ProtoLayerHelper.cpp
SurfaceArrayCreator.cpp
TrackingGeometry.cpp
Expand Down
4 changes: 2 additions & 2 deletions Core/src/Visualization/GeometryView3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

#include "Acts/Visualization/GeometryView3D.hpp"

#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Detector/Portal.hpp"
#include "Acts/Geometry/CylinderVolumeBounds.hpp"
#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Geometry/Layer.hpp"
#include "Acts/Geometry/Polyhedron.hpp"
#include "Acts/Geometry/Portal.hpp"
#include "Acts/Geometry/TrackingVolume.hpp"
#include "Acts/Surfaces/ConeBounds.hpp"
#include "Acts/Surfaces/ConeSurface.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#pragma once

#include "Acts/Detector/ProtoDetector.hpp"
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Geometry/ProtoDetector.hpp"
#include "Acts/Plugins/Geant4/Geant4DetectorSurfaceFactory.hpp"

#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion Examples/Detectors/Geant4Detector/src/Geant4Detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "ActsExamples/Geant4Detector/Geant4Detector.hpp"

#include "Acts/Detector/Detector.hpp"
#include "Acts/Geometry/CylinderVolumeHelper.hpp"
#include "Acts/Geometry/Detector.hpp"
#include "Acts/Geometry/KDTreeTrackingGeometryBuilder.hpp"
#include "Acts/Geometry/LayerArrayCreator.hpp"
#include "Acts/Geometry/LayerCreator.hpp"
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/src/Geant4Component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Geometry/Detector.hpp"
#include "Acts/Detector/Detector.hpp"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/MagneticField/MagneticFieldProvider.hpp"
#include "Acts/Plugins/Geant4/Geant4DetectorElement.hpp"
Expand Down
4 changes: 2 additions & 2 deletions Examples/Python/src/Geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Geometry/Detector.hpp"
#include "Acts/Detector/Detector.hpp"
#include "Acts/Detector/ProtoDetector.hpp"
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Geometry/ProtoDetector.hpp"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Plugins/Python/Utilities.hpp"
#include "Acts/Surfaces/Surface.hpp"
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/src/Json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "Acts/Geometry/ProtoDetector.hpp"
#include "Acts/Detector/ProtoDetector.hpp"
#include "Acts/Material/IMaterialDecorator.hpp"
#include "Acts/Plugins/Json/JsonMaterialDecorator.hpp"
#include "Acts/Plugins/Json/MaterialMapJsonConverter.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#pragma once

#include "Acts/Geometry/ProtoDetector.hpp"
#include "Acts/Detector/ProtoDetector.hpp"
#include "Acts/Plugins/Json/UtilitiesJsonConverter.hpp"

// Custom Json encoder/decoders. Naming is mandated by nlohmann::json and thus
Expand Down
1 change: 1 addition & 0 deletions Tests/UnitTests/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ add_unittest(Version VersionTests.cpp)

add_subdirectory(Clusterization)
add_subdirectory(Definitions)
add_subdirectory(Detector)
add_subdirectory(Digitization)
add_subdirectory(EventData)
add_subdirectory(Geometry)
Expand Down
6 changes: 6 additions & 0 deletions Tests/UnitTests/Core/Detector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
add_unittest(Detector DetectorTests.cpp)
add_unittest(DetectorVolume DetectorVolumeTests.cpp)
add_unittest(ProtoDetector ProtoDetectorTests.cpp)
add_unittest(Portal PortalTests.cpp)
add_unittest(PortalGenerators PortalGeneratorsTests.cpp)

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

#include <boost/test/unit_test.hpp>

#include "Acts/Detector/Detector.hpp"
#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Detector/PortalGenerators.hpp"
#include "Acts/Geometry/CylinderVolumeBounds.hpp"
#include "Acts/Geometry/Detector.hpp"
#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/detail/PortalGenerators.hpp"
#include "Acts/Navigation/DetectorVolumeFinders.hpp"
#include "Acts/Navigation/NavigationStateUpdators.hpp"
#include "Acts/Navigation/SurfaceCandidatesUpdators.hpp"
Expand Down Expand Up @@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE(DetectorConstruction) {
auto cyl2Bounds =
std::make_unique<Acts::CylinderVolumeBounds>(r2, r3, zHalfL);

auto portalGenerator = Acts::Experimental::detail::defaultPortalGenerator();
auto portalGenerator = Acts::Experimental::defaultPortalGenerator();

auto cyl0 = Acts::Experimental::DetectorVolumeFactory::construct(
portalGenerator, tContext, "Cyl0", nominal, std::move(cyl0Bounds),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#include <boost/test/unit_test.hpp>

#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Detector/PortalGenerators.hpp"
#include "Acts/Detector/PortalHelper.hpp"
#include "Acts/Geometry/CuboidVolumeBounds.hpp"
#include "Acts/Geometry/CylinderVolumeBounds.hpp"
#include "Acts/Geometry/DetectorVolume.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/detail/PortalGenerators.hpp"
#include "Acts/Geometry/detail/PortalHelper.hpp"
#include "Acts/Navigation/DetectorVolumeUpdators.hpp"
#include "Acts/Navigation/NavigationState.hpp"
#include "Acts/Navigation/SurfaceCandidatesUpdators.hpp"
Expand Down Expand Up @@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE(CylindricalDetectorVolumePortals) {
auto fullCylinderBounds =
std::make_unique<Acts::CylinderVolumeBounds>(0., rOuter, zHalfL);

auto portalGenerator = detail::defaultPortalGenerator();
auto portalGenerator = defaultPortalGenerator();

// Misconfigured - null pointer for bounds
BOOST_CHECK_THROW(
Expand Down Expand Up @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(UpdatePortal) {
auto fullCylinderBounds =
std::make_unique<Acts::CylinderVolumeBounds>(0., 10., 100.);

auto portalGenerator = detail::defaultPortalGenerator();
auto portalGenerator = defaultPortalGenerator();

auto fullCylinderVolume = DetectorVolumeFactory::construct(
portalGenerator, tContext, "FullCylinderVolume", nominal,
Expand Down Expand Up @@ -144,9 +144,8 @@ BOOST_AUTO_TEST_CASE(CuboidWithCuboid) {
auto smallBoxBounds =
std::make_unique<Acts::CuboidVolumeBounds>(smallBox, smallBox, smallBox);

auto portals = detail::defaultPortalGenerator();
auto generatePortalsUpdateInternals =
detail::defaultPortalAndSubPortalGenerator();
auto portals = defaultPortalGenerator();
auto generatePortalsUpdateInternals = defaultPortalAndSubPortalGenerator();

// Create the inner box
auto innerBox =
Expand Down

0 comments on commit 656e69a

Please sign in to comment.