diff --git a/.github/workflows/check-tracking-geometry.yml b/.github/workflows/check-tracking-geometry.yml index 71f3b81038..fc22427369 100644 --- a/.github/workflows/check-tracking-geometry.yml +++ b/.github/workflows/check-tracking-geometry.yml @@ -27,8 +27,12 @@ jobs: setup: install/bin/thisepic.sh run: | /usr/bin/time -v \ - root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/${{matrix.detector_config}}.xml\")" | tee check_tracking_geometry.out + root -b -q "scripts/test_ACTS_gen1.cxx+(\"${DETECTOR_PATH}/${{matrix.detector_config}}.xml\")" | tee check_tracking_geometry.out bin/acts_geo_check check_tracking_geometry.out + + /usr/bin/time -v \ + root -b -q "scripts/test_ACTS_gen3.cxx+(\"${DETECTOR_PATH}/${{matrix.detector_config}}.xml\")" | tee check_tracking_geometry_gen3.out + bin/acts_geo_check check_tracking_geometry_gen3.out - uses: actions/upload-artifact@v5 with: name: ${{matrix.detector_config}}.obj diff --git a/compact/tracking/vertex_barrel.xml b/compact/tracking/vertex_barrel.xml index 7a1eaf4535..c704aa7bfa 100644 --- a/compact/tracking/vertex_barrel.xml +++ b/compact/tracking/vertex_barrel.xml @@ -27,6 +27,9 @@ + + + @@ -172,9 +175,9 @@ outer_r="VertexBarrelLayer0_rmax" z_length="VertexBarrelLayer_length" /> + bins1="VertexBarrelL0_nz" /> + bins1="VertexBarrelL0_nz" /> phi0 : Starting phi of first module at the first/second halve. nphi : Number of modules in phi. @@ -193,9 +196,9 @@ outer_r="VertexBarrelLayer1_rmax" z_length="VertexBarrelLayer_length" /> + bins1="VertexBarrelL1_nz" /> + bins1="VertexBarrelL1_nz" /> @@ -207,9 +210,9 @@ outer_r="VertexBarrelLayer2_rmax" z_length="VertexBarrelLayer_length" /> + bins1="VertexBarrelL2_nz" /> + bins1="VertexBarrelL2_nz" /> diff --git a/scripts/test_ACTS.cxx b/scripts/test_ACTS_gen1.cxx similarity index 73% rename from scripts/test_ACTS.cxx rename to scripts/test_ACTS_gen1.cxx index 2820f2865c..e4e9907cf1 100644 --- a/scripts/test_ACTS.cxx +++ b/scripts/test_ACTS_gen1.cxx @@ -3,19 +3,33 @@ #include "DD4hep/Detector.h" -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "Acts/Geometry/TrackingVolume.hpp" -#include "Acts/Plugins/DD4hep/ConvertDD4hepDetector.hpp" +#include +#include #include #include #include #include +#if __has_include() +#include +#else +#include "ActsPlugins/DD4hep/ConvertDD4hepDetector.hpp" +#endif + +// Ensure ActsPlugins namespace is used when present +#if __has_include() +// Acts_MAJOR_VERSION >= 44 +using ActsPlugins::convertDD4hepDetector; +#else +// Acts_MAJOR_VERSION < 44 +using Acts::convertDD4hepDetector; +#endif + /** Example loading ACTs. * * */ -void test_ACTS(const char* compact = "epic.xml") { +void test_ACTS_gen1(const char* compact = "epic.xml") { // ------------------------- // Get the DD4hep instance // Load the compact XML file @@ -24,7 +38,7 @@ void test_ACTS(const char* compact = "epic.xml") { detector->fromCompact(compact); auto logger = Acts::getDefaultLogger("Acts", Acts::Logging::Level::VERBOSE); - auto acts_tracking_geometry = Acts::convertDD4hepDetector(detector->world(), *logger); + auto acts_tracking_geometry = convertDD4hepDetector(detector->world(), *logger); // Visit all surfaces acts_tracking_geometry->visitSurfaces([](const Acts::Surface* surface) {}); diff --git a/scripts/test_ACTS_gen3.cxx b/scripts/test_ACTS_gen3.cxx new file mode 100644 index 0000000000..abeb1b4413 --- /dev/null +++ b/scripts/test_ACTS_gen3.cxx @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (C) 2022 - 2024, Whitney Armstrong, Wouter Deconinck + +#include + +#include + +/** + * Example: Loading and testing ACTS Gen3 geometry from a DD4hep compact file. + */ +void test_ACTS_gen3(const char* compact = "epic.xml") { + Acts::GeometryContext trackingGeoCtx; + ActsExamples::ePICDetector::Config detectorConfig; + detectorConfig.logLevel = Acts::Logging::Level::VERBOSE; + detectorConfig.dd4hepLogLevel = Acts::Logging::Level::WARNING; + detectorConfig.xmlFileNames.push_back(compact); + detectorConfig.name = compact; + ActsExamples::ePICDetector epicDetector(detectorConfig, trackingGeoCtx); +}