Skip to content
6 changes: 5 additions & 1 deletion .github/workflows/check-tracking-geometry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions compact/tracking/vertex_barrel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<constant name="VertexBarrelL0_nphi" value="12*2" />
<constant name="VertexBarrelL1_nphi" value="16*2" />
<constant name="VertexBarrelL2_nphi" value="40*2" />
<constant name="VertexBarrelL0_nz" value="100" />
<constant name="VertexBarrelL1_nz" value="100" />
<constant name="VertexBarrelL2_nz" value="100" />

<constant name="VertexBarrelStaveL0_width" value="RSU_width/2" />
<constant name="VertexBarrelStaveL1_width" value="RSU_width/2" />
Expand Down Expand Up @@ -172,9 +175,9 @@
outer_r="VertexBarrelLayer0_rmax"
z_length="VertexBarrelLayer_length" />
<layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelL0_nphi"
bins1="100" />
bins1="VertexBarrelL0_nz" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelL0_nphi"
bins1="100" />
bins1="VertexBarrelL0_nz" />
<comment>
phi0 : Starting phi of first module at the first/second halve.
nphi : Number of modules in phi.
Expand All @@ -193,9 +196,9 @@
outer_r="VertexBarrelLayer1_rmax"
z_length="VertexBarrelLayer_length" />
<layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelL1_nphi"
bins1="100" />
bins1="VertexBarrelL1_nz" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelL1_nphi"
bins1="100" />
bins1="VertexBarrelL1_nz" />
<rphi_layout nphi="VertexBarrelL1_nphi" phi0="VertexBarrelModL1_dphi" dr="0.0 * mm" />
<z_layout z0="VertexBarrelLayer_z0" nz="VertexBarrelLayer_nz" />
</layer>
Expand All @@ -207,9 +210,9 @@
outer_r="VertexBarrelLayer2_rmax"
z_length="VertexBarrelLayer_length" />
<layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelL2_nphi"
bins1="100" />
bins1="VertexBarrelL2_nz" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelL2_nphi"
bins1="100" />
bins1="VertexBarrelL2_nz" />
<rphi_layout nphi="VertexBarrelL2_nphi" phi0="VertexBarrelModL2_dphi" dr="0.0 * mm" />
<z_layout z0="VertexBarrelLayer_z0" nz="VertexBarrelLayer_nz" />
</layer>
Expand Down
24 changes: 19 additions & 5 deletions scripts/test_ACTS.cxx → scripts/test_ACTS_gen1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Acts/Geometry/TrackingGeometry.hpp>
#include <Acts/Geometry/TrackingVolume.hpp>
#include <Acts/Visualization/GeometryView3D.hpp>
#include <Acts/Visualization/ObjVisualization3D.hpp>
#include <Acts/Visualization/PlyVisualization3D.hpp>
#include <Acts/Visualization/ViewConfig.hpp>

#if __has_include(<ActsPlugins/DD4hep/ConvertDD4hepDetector.hpp>)
#include <ActsPlugins/DD4hep/ConvertDD4hepDetector.hpp>
#else
#include "ActsPlugins/DD4hep/ConvertDD4hepDetector.hpp"
#endif

// Ensure ActsPlugins namespace is used when present
#if __has_include(<ActsPlugins/DD4hep/ConvertDD4hepDetector.hpp>)
// 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
Expand All @@ -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) {});
Expand Down
19 changes: 19 additions & 0 deletions scripts/test_ACTS_gen3.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 - 2024, Whitney Armstrong, Wouter Deconinck

#include <DD4hep/Detector.h>

#include <ActsExamples/DD4hepDetector/ePICDetector.hpp>

/**
* 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);
}
Loading