Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
47bc5b4
bump dependancy versions, add full chain alg example
paradajzblond Apr 13, 2026
c8a284c
switching to traccc tag
paradajzblond Apr 14, 2026
78c1ba5
set traccc tag, adding sequence example
paradajzblond Apr 14, 2026
1390ffa
ensure linking against device code only when cuda available, traccc b…
paradajzblond Apr 15, 2026
3d6798a
fixing wrong conditional statement for cuda includes
paradajzblond Apr 15, 2026
11ad3bb
making IAlg Traccc chain
paradajzblond Apr 20, 2026
2f2b999
format tidy
paradajzblond Apr 20, 2026
38ab425
chore: Version bump of Traccc, Detray and VecMem (#5376)
paradajzblond Apr 27, 2026
5b353cc
add traccc example alg
paradajzblond Apr 28, 2026
972f58a
remove unwanted duplicate detray dir
paradajzblond Apr 28, 2026
6d29668
switching to traccc tag
paradajzblond Apr 14, 2026
8ec4d80
set traccc tag, adding sequence example
paradajzblond Apr 14, 2026
b83e07b
ensure linking against device code only when cuda available, traccc b…
paradajzblond Apr 15, 2026
1a8c067
rebasing to main
paradajzblond Apr 29, 2026
73bb2a1
clean up after rebase
paradajzblond Apr 29, 2026
4c12761
removing duplicate steering scripts
paradajzblond Apr 29, 2026
9482c64
format tidy
paradajzblond Apr 29, 2026
fd0d087
turn off TBB build
paradajzblond Apr 29, 2026
d7d3b15
remove second detray inclusion
paradajzblond Apr 29, 2026
91609be
format tidy
paradajzblond Apr 29, 2026
f932626
adding converters
paradajzblond May 13, 2026
16e6aab
making backend choice at run time
paradajzblond May 18, 2026
dcacdb1
set single prec as default
paradajzblond May 18, 2026
f1e1145
format tidy
paradajzblond May 18, 2026
97bae46
adding deprication warning
paradajzblond May 19, 2026
54f4065
updating seq alg, make pixel volumes configurable
paradajzblond May 19, 2026
977d77b
remove converters from plugins
paradajzblond May 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ build_gnn_cpu:
- >
cmake -B build -S src
--preset=gitlab-ci-gnn
-DACTS_GNN_ENABLE_CUDA=OFF
-DACTS_ENABLE_CUDA=OFF
-DACTS_GNN_ENABLE_MODULEMAP=OFF
- ccache -z
Expand Down
30 changes: 26 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,22 @@ option(ACTS_BUILD_PLUGIN_EDM4HEP "Build EDM4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_FPEMON "Build FPE monitoring plugin" OFF)
option(ACTS_BUILD_PLUGIN_GEOMODEL "Build GeoModel plugin" OFF)
option(ACTS_BUILD_PLUGIN_TRACCC "Build Traccc plugin" OFF)
option(ACTS_ENABLE_CUDA "Enable CUDA for the gnn/Traccc plugins" OFF)
option(ACTS_GNN_ENABLE_CUDA "[Deprecated] Enable CUDA for the gnn plugin" OFF)

# Preserve previous behaviour of ACTS_GNN_ENABLE_CUDA but mark as deprecated
if(ACTS_GNN_ENABLE_CUDA)
message(
DEPRECATION
"ACTS_GNN_ENABLE_CUDA is deprecated. Enable ACTS_ENABLE_CUDA to achieve the same effect."
)
set(ACTS_ENABLE_CUDA ON)
endif()

option(ACTS_BUILD_PLUGIN_GEANT4 "Build Geant4 plugin" OFF)
option(ACTS_BUILD_PLUGIN_GNN "Build the GNN plugin" OFF)
option(ACTS_GNN_ENABLE_ONNX "Build the Onnx backend for the gnn plugin" OFF)
option(ACTS_GNN_ENABLE_TORCH "Build the torchscript backend for the gnn plugin" ON)
option(ACTS_GNN_ENABLE_CUDA "Enable CUDA for the gnn plugin" OFF)
Comment thread
paradajzblond marked this conversation as resolved.
option(ACTS_GNN_ENABLE_MODULEMAP "Enable Module-Map-based graph construction" OFF)
option(ACTS_GNN_ENABLE_TENSORRT "Enable the native TensorRT inference modules" OFF)
option(ACTS_BUILD_PLUGIN_JSON "Build json plugin" OFF)
Expand Down Expand Up @@ -207,7 +218,12 @@ set_option_if(ACTS_BUILD_PLUGIN_GNN ACTS_BUILD_EXAMPLES_GNN)
set_option_if(ACTS_BUILD_PLUGIN_FPEMON ACTS_BUILD_EXAMPLES)
set_option_if(ACTS_BUILD_PLUGIN_JSON ACTS_BUILD_PLUGIN_TRACCC)
set_option_if(ACTS_BUILD_PLUGIN_ACTSVG ACTS_BUILD_PLUGIN_TRACCC)
set_option_if(ACTS_GNN_ENABLE_CUDA ACTS_GNN_ENABLE_MODULEMAP)
set_option_if(
ACTS_ENABLE_CUDA
ACTS_GNN_ENABLE_MODULEMAP
AND
ACTS_BUILD_PLUGIN_GNN
)
set_option_if(ACTS_BUILD_PYTHON_BINDINGS ACTS_BUILD_PYTHON_WHEEL)
set_option_if(ACTS_BUILD_ALIGNMENT ACTS_BUILD_PLUGIN_MILLE)

Expand Down Expand Up @@ -502,7 +518,7 @@ if(ACTS_BUILD_ANALYSIS_APPS)
)
endif()
if(ACTS_BUILD_PLUGIN_GNN)
if(ACTS_GNN_ENABLE_CUDA)
if(ACTS_ENABLE_CUDA)
find_package(CUDAToolkit REQUIRED)
enable_cuda()
message(STATUS "Build GNN plugin with CUDA")
Expand All @@ -511,7 +527,7 @@ if(ACTS_BUILD_PLUGIN_GNN)
endif()
if(ACTS_GNN_ENABLE_TORCH)
find_package(Torch REQUIRED)
if(ACTS_GNN_ENABLE_CUDA)
if(ACTS_ENABLE_CUDA)
add_subdirectory(thirdparty/FRNN)
endif()
endif()
Expand Down Expand Up @@ -576,6 +592,12 @@ if(ACTS_BUILD_PLUGIN_TRACCC)
endif()
endif()

if(ACTS_ENABLE_CUDA)
message(STATUS "Build Traccc plugin with CUDA support")
else()
message(STATUS "Build Traccc plugin for CPU only")
endif()
Comment thread
paradajzblond marked this conversation as resolved.

# traccc also depends on vecmem and covfie, but those plugins should always
# be enabled if traccc is.
if(ACTS_USE_SYSTEM_TRACCC)
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"ACTS_BUILD_EXAMPLES_GNN": "ON",
"ACTS_GNN_ENABLE_TORCH": "ON",
"ACTS_GNN_ENABLE_ONNX": "ON",
"ACTS_GNN_ENABLE_CUDA": "ON",
"ACTS_ENABLE_CUDA": "ON",
"ACTS_GNN_ENABLE_MODULEMAP": "ON",
"ACTS_USE_SYSTEM_NLOHMANN_JSON": "ON",
"ACTS_USE_SYSTEM_PYBIND11": "ON"
Expand Down
1 change: 1 addition & 0 deletions Examples/Algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ add_subdirectory_if(GeneratorsPythia8 ACTS_BUILD_EXAMPLES_PYTHIA8)
add_subdirectory(MaterialMapping)
add_subdirectory(Printers)
add_subdirectory(Propagation)
add_subdirectory_if(Traccc ACTS_BUILD_PLUGIN_TRACCC)
add_subdirectory_if(Detray ACTS_BUILD_PLUGIN_DETRAY)
add_subdirectory(TrackFinding)
add_subdirectory_if(TrackFindingGnn ACTS_BUILD_EXAMPLES_GNN)
Expand Down
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe remove this from the diff?

Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class DetrayPropagator : public PropagatorInterface {
// Propagator with empty actor chain (for the moment)
using Propagator =
detray::propagator<stepper_t, DetrayNavigator, detray::actor_chain<>>;

detray::propagation::config prop_cfg{};
auto dCtx = prop_cfg.context;

Expand Down
35 changes: 35 additions & 0 deletions Examples/Algorithms/Traccc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
acts_add_library(
ExamplesTraccc
SHARED
src/TracccChain.cpp
src/TracccSeqAlg.cpp
src/ActsMeasToTracccAlg.cpp
src/ActsSpToTracccAlg.cpp
)

target_include_directories(
ActsExamplesTraccc
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_link_libraries(
ActsExamplesTraccc
PUBLIC
Acts::Core
Acts::ExamplesFramework
traccc::core
detray::core
detray::io
traccc::io
vecmem::core
)

if(ACTS_ENABLE_CUDA)
target_compile_definitions(ActsExamplesTraccc PRIVATE ACTS_ENABLE_CUDA)
target_link_libraries(
ActsExamplesTraccc
PRIVATE traccc::cuda traccc::device_common vecmem::cuda
)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// This file is part of the ACTS project.
//
// Copyright (C) 2016 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#pragma once
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/SpacePointFormation2/PixelSpacePointBuilder.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "ActsExamples/EventData/Measurement.hpp"
#include "ActsExamples/Framework/DataHandle.hpp"
#include "ActsExamples/Framework/IAlgorithm.hpp"
#include "ActsExamples/Framework/ProcessCode.hpp"

#include <string>
#include <unordered_map>

#include <traccc/edm/measurement_collection.hpp>
#include <traccc/edm/spacepoint_collection.hpp>
#include <vecmem/memory/host_memory_resource.hpp>

#include "traccc/geometry/detector.hpp"
#include "traccc/geometry/host_detector.hpp"
#include "traccc/io/read_detector.hpp"

namespace ActsExamples {

class ActsMeasToTracccAlg final : public IAlgorithm {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't check what other example algorithms do (😦), but some (Doxygen) documentation would be in order here, right?

public:
struct Config {
std::string detectorFile = "";
std::string inputActsMeasurements = "measurements";
std::string outputDetrayToActsMap = "detray-to-acts-map";
std::string outputTracccMeasurements = "acts-to-traccc-measurements";
std::vector<int> pixelVolumes;
std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry;
};

mutable vecmem::host_memory_resource m_mr;
traccc::host_detector m_host_det;
std::unordered_map<Acts::GeometryIdentifier, std::uint64_t> m_actsToDetrayMap;
std::unordered_map<std::uint64_t, Acts::GeometryIdentifier> m_detrayToActsMap;

explicit ActsMeasToTracccAlg(
const Config& cfg, std::unique_ptr<const Acts::Logger> logger = nullptr);

ProcessCode execute(const AlgorithmContext& ctx) const override;
void buildSurfaceMap(
const Acts::TrackingGeometry& trackingGeometry,
const std::string& detectorFile,
std::unordered_map<std::uint64_t, Acts::GeometryIdentifier>&
m_detrayToActsMap,
std::unordered_map<Acts::GeometryIdentifier, std::uint64_t>&
m_actsToDetrayMap);
const Config& config() const { return m_cfg; }

private:
Config m_cfg;

ReadDataHandle<MeasurementContainer> m_inputActsMeasurements{
this, "inputActsMeasurements"};
WriteDataHandle<std::unordered_map<std::uint64_t, Acts::GeometryIdentifier>>
m_outputDetrayToActsMap{this, "outputDetrayToActsMap"};
WriteDataHandle<traccc::edm::measurement_collection::host>
m_outputTracccMeasurements{this, "outputTracccMeasurements"};
};

} // namespace ActsExamples
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// This file is part of the ACTS project.
//
// Copyright (C) 2016 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#pragma once
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "ActsExamples/EventData/Measurement.hpp"
#include "ActsExamples/EventData/SpacePoint.hpp"
#include "ActsExamples/Framework/DataHandle.hpp"
#include "ActsExamples/Framework/IAlgorithm.hpp"
#include "ActsExamples/Framework/ProcessCode.hpp"

#include <string>
#include <unordered_map>

#include <traccc/edm/spacepoint_collection.hpp>
#include <vecmem/memory/host_memory_resource.hpp>

namespace ActsExamples {

class ActsSpToTracccAlg final : public IAlgorithm {
public:
struct Config {
std::string inputSpacePoints = "spacepoints";
std::string outputTracccSpacepoints = "acts-traccc-spacepoints";
};

explicit ActsSpToTracccAlg(
const Config& cfg, std::unique_ptr<const Acts::Logger> logger = nullptr);

ProcessCode execute(const AlgorithmContext& ctx) const override;
const Config& config() const { return m_cfg; }

mutable vecmem::host_memory_resource m_mr;

private:
Config m_cfg;

ReadDataHandle<SpacePointContainer> m_inputSpacePoints{this,
"inputSpacePoints"};
WriteDataHandle<traccc::edm::spacepoint_collection::host>
m_outputTracccSpacepoints{this, "outputTracccSpacepoints"};
};

} // namespace ActsExamples
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// This file is part of the ACTS project.
//
// Copyright (C) 2016 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#pragma once

#include "Acts/Utilities/Logger.hpp"

#include <memory>
#include <string>

#include "traccc/ambiguity_resolution/greedy_ambiguity_resolution_algorithm.hpp"
#include "traccc/clusterization/clustering_config.hpp"
#include "traccc/clusterization/clusterization_algorithm.hpp"
#include "traccc/edm/measurement_collection.hpp"
#include "traccc/edm/spacepoint_collection.hpp"
#include "traccc/finding/combinatorial_kalman_filter_algorithm.hpp"
#include "traccc/fitting/kalman_fitting_algorithm.hpp"
#include "traccc/seeding/detail/seeding_config.hpp"
#include "traccc/seeding/detail/track_params_estimation_config.hpp"
#include "traccc/seeding/seeding_algorithm.hpp"
#include "traccc/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp"
#include "traccc/seeding/track_params_estimation.hpp"

namespace ActsExamples::Traccc {

struct TracccChainConfig {
enum class Backend { CPU, CUDA };
Backend backend = Backend::CPU;

// Detector files
std::string detectorFile;
std::string digitizationFile;
std::string conditionsFile;
std::string gridFile;
std::string materialFile;

// Magnetic field file
std::string magneticFieldFile;
// z-component used by CPU track_params_estimation
float bFieldInZ = 2.0f;

// Algorithm configs
traccc::clustering_config clusteringConfig;
traccc::seedfinder_config seedfinderConfig;
traccc::seedfilter_config seedfilterConfig;
traccc::track_params_estimation_config trackParamsEstConfig;
traccc::finding_config findingConfig;
traccc::fitting_config fittingConfig;
traccc::host::greedy_ambiguity_resolution_algorithm::config_type
resolutionConfig;
};

struct EventResult {
std::size_t n_measurements = 0;
std::size_t n_spacepoints = 0;
std::size_t n_seeds = 0;
std::size_t n_track_candidates = 0;
std::size_t n_fitted_tracks = 0;
};

class TracccChain {
public:
struct Impl;

explicit TracccChain(const TracccChainConfig& cfg,
Acts::Logging::Level logLevel = Acts::Logging::INFO);
~TracccChain();

TracccChain(TracccChain&&) noexcept;
TracccChain& operator=(TracccChain&&) noexcept;

EventResult operator()(
traccc::edm::measurement_collection::host& measurements,
traccc::edm::spacepoint_collection::host& spacepoints) const;

private:
std::unique_ptr<Impl> m_impl;
};

} // namespace ActsExamples::Traccc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// This file is part of the ACTS project.
//
// Copyright (C) 2016 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#pragma once

#include "ActsExamples/Framework/DataHandle.hpp"
#include "ActsExamples/Framework/IAlgorithm.hpp"
#include "ActsExamples/Framework/ProcessCode.hpp"
#include "ActsExamples/Traccc/TracccChain.hpp"

#include <string>

#include "traccc/edm/silicon_cell_collection.hpp"

namespace ActsExamples::Traccc {

class TracccSeqAlg final : public IAlgorithm {
public:
struct Config {
/// Full traccc chain configuration (geometry, seeding params, etc.)
TracccChainConfig chain;

/// WhiteBoard key for the input collections
std::string inputMeasurements = "";
std::string inputSpacepoints = "";
};

explicit TracccSeqAlg(const Config& cfg,
std::unique_ptr<const Acts::Logger> logger = nullptr);

ProcessCode execute(const AlgorithmContext& ctx) const override;
const Config& config() const { return m_cfg; }

private:
Config m_cfg;
TracccChain m_chain;

ReadDataHandle<traccc::edm::measurement_collection::host> m_inputMeasurements{
this, "inputMeasurements"};
ReadDataHandle<traccc::edm::spacepoint_collection::host> m_inputSpacepoints{
this, "inputSpacepoints"};
};

} // namespace ActsExamples::Traccc
Loading
Loading