├── .gitmodules ├── extras ├── benchmark │ ├── .gitignore │ ├── traccc_bench_tools │ │ ├── __init__.py │ │ ├── types.py │ │ ├── git.py │ │ └── utils.py │ ├── pyproject.toml │ └── README.md ├── cut_optimiser │ ├── .gitignore │ ├── pyproject.toml │ └── example.json ├── event_trimmer │ ├── .gitignore │ ├── pyproject.toml │ └── README.md ├── README.md └── ccl_generator │ └── README.md ├── .github ├── wip.yml ├── check_duplicate_cu_files.sh ├── check_quote_includes.sh ├── workflows │ ├── benchmarks.yml │ └── checks.yml ├── ci_setup.sh └── check_taboos.sh ├── doc └── images │ ├── sketch-seeding.png │ ├── sketch-sp-formation.png │ ├── sparseCCL-example.png │ ├── tml-pixel-barrrel-sp.png │ ├── sketch-measurement-creation.png │ └── tm-pixel-measurements-local.gif ├── tests ├── io │ ├── mock_data │ │ ├── event000000000-measurement-simhit-map.csv │ │ ├── event000000000-particles_initial.csv │ │ ├── event000000000-cells.csv │ │ ├── event000000000-measurements.csv │ │ └── event000000000-hits.csv │ └── CMakeLists.txt ├── examples │ └── CMakeLists.txt ├── common │ └── tests │ │ ├── ckf_toy_detector_test.hpp │ │ ├── test_detectors.hpp │ │ └── ckf_telescope_test.hpp ├── hip │ └── CMakeLists.txt ├── cuda │ └── cuda_main.cpp ├── core │ └── CMakeLists.txt ├── sycl │ └── CMakeLists.txt ├── cpu │ └── CMakeLists.txt └── alpaka │ └── CMakeLists.txt ├── data ├── .gitignore └── README.md ├── extern ├── acts │ ├── README.md │ └── CMakeLists.txt ├── cccl │ └── README.md ├── detray │ └── README.md ├── eigen3 │ └── README.md ├── dfelibs │ └── README.md ├── tbb │ ├── README.md │ └── CMakeLists.txt ├── dpl │ ├── README.txt │ └── CMakeLists.txt ├── vecmem │ ├── README.md │ └── CMakeLists.txt ├── algebra-plugins │ └── README.md ├── indicators │ └── README.md ├── googletest │ └── README.md └── alpaka │ └── alpaka-1.2.0-cmake-boost.patch ├── plugins ├── CMakeLists.txt └── algebra │ ├── vecmem │ └── CMakeLists.txt │ ├── array │ └── CMakeLists.txt │ ├── eigen │ ├── CMakeLists.txt │ └── include │ │ └── traccc │ │ └── plugins │ │ └── algebra │ │ └── eigen_definitions.hpp │ ├── vc_aos │ ├── CMakeLists.txt │ └── include │ │ └── traccc │ │ └── plugins │ │ └── algebra │ │ └── vc_aos_definitions.hpp │ └── smatrix │ ├── CMakeLists.txt │ └── include │ └── traccc │ └── plugins │ └── algebra │ └── smatrix_definitions.hpp ├── examples ├── utils │ └── CMakeLists.txt ├── io │ └── CMakeLists.txt ├── CMakeLists.txt ├── tools │ ├── CMakeLists.txt │ └── bfield_type.hpp ├── run │ ├── cpu │ │ ├── throughput_mt.cpp │ │ └── throughput_st.cpp │ ├── cuda │ │ ├── throughput_mt.cpp │ │ └── throughput_st.cpp │ ├── sycl │ │ ├── throughput_st.cpp │ │ └── throughput_mt.cpp │ ├── alpaka │ │ ├── throughput_mt.cpp │ │ └── throughput_st.cpp │ ├── common │ │ ├── make_magnetic_field.hpp │ │ ├── print_fitted_tracks_statistics.hpp │ │ ├── make_magnetic_field.cpp │ │ ├── throughput_mt.hpp │ │ └── throughput_st.hpp │ └── CMakeLists.txt └── options │ ├── src │ ├── details │ │ └── interface.cpp │ └── performance.cpp │ └── include │ └── traccc │ └── options │ ├── details │ └── config_provider.hpp │ ├── performance.hpp │ ├── seed_matching.hpp │ ├── logging.hpp │ ├── accelerator.hpp │ ├── track_matching.hpp │ ├── threading.hpp │ ├── track_resolution.hpp │ └── program_options.hpp ├── .gitattributes ├── .vscode ├── settings.json └── launch.json ├── simulation ├── include │ └── traccc │ │ └── simulation │ │ └── event_generators.hpp └── CMakeLists.txt ├── core ├── include │ └── traccc │ │ ├── geometry │ │ ├── geometry.hpp │ │ ├── detector_type_list.hpp.in │ │ └── pixel_data.hpp │ │ ├── utils │ │ ├── pair.hpp │ │ ├── propagation.hpp │ │ ├── projections.hpp │ │ ├── memory_resource.hpp │ │ ├── messaging.hpp │ │ ├── type_traits.hpp │ │ └── relations.hpp │ │ ├── definitions │ │ ├── track_parametrization.hpp │ │ ├── hints.hpp │ │ ├── common.hpp │ │ └── qualifiers.hpp │ │ ├── seeding │ │ └── detail │ │ │ ├── spacepoint_type.hpp │ │ │ ├── singlet.hpp │ │ │ └── track_params_estimation_config.hpp │ │ ├── edm │ │ ├── track_fit_outcome.hpp │ │ ├── impl │ │ │ ├── track_collection.ipp │ │ │ ├── track_state_collection.ipp │ │ │ └── seed_collection.ipp │ │ ├── track_state_helpers.hpp │ │ ├── particle.hpp │ │ └── track_constituent_link.hpp │ │ ├── ambiguity_resolution │ │ └── ambiguity_resolution_config.hpp │ │ ├── bfield │ │ ├── impl │ │ │ └── construct_const_bfield.ipp │ │ └── construct_const_bfield.hpp │ │ └── finding │ │ └── candidate_link.hpp └── src │ ├── bfield │ └── construct_const_bfield.cpp │ └── clusterization │ └── clusterization_algorithm.cpp ├── .clang-format ├── device ├── common │ └── include │ │ └── traccc │ │ ├── device │ │ └── global_index.hpp │ │ ├── clusterization │ │ └── device │ │ │ ├── ccl_kernel_definitions.hpp │ │ │ ├── tags.hpp │ │ │ ├── impl │ │ │ └── reify_cluster_data.ipp │ │ │ └── reify_cluster_data.hpp │ │ ├── edm │ │ └── device │ │ │ ├── seeding_global_counter.hpp │ │ │ ├── sort_key.hpp │ │ │ ├── identity_projector.hpp │ │ │ └── device_doublet.hpp │ │ └── ambiguity_resolution │ │ └── device │ │ ├── sort_tracks_per_measurement.hpp │ │ ├── fill_unique_meas_id_map.hpp │ │ ├── add_block_offset.hpp │ │ ├── fill_inverted_ids.hpp │ │ └── scan_block_offsets.hpp ├── cuda │ ├── src │ │ ├── ambiguity_resolution │ │ │ └── kernels │ │ │ │ ├── remove_tracks.cuh │ │ │ │ ├── update_status.cuh │ │ │ │ ├── add_block_offset.cuh │ │ │ │ ├── fill_inverted_ids.cuh │ │ │ │ ├── scan_block_offsets.cuh │ │ │ │ ├── block_inclusive_scan.cuh │ │ │ │ ├── sort_updated_tracks.cuh │ │ │ │ ├── fill_track_candidates.cuh │ │ │ │ ├── fill_unique_meas_id_map.cuh │ │ │ │ ├── count_shared_measurements.cuh │ │ │ │ ├── fill_tracks_per_measurement.cuh │ │ │ │ ├── sort_tracks_per_measurement.cuh │ │ │ │ ├── rearrange_tracks.cuh │ │ │ │ ├── fill_vectors.cuh │ │ │ │ └── fill_unique_meas_id_map.cu │ │ ├── finding │ │ │ ├── kernels │ │ │ │ ├── remove_duplicates.cuh │ │ │ │ ├── fill_finding_duplicate_removal_sort_keys.cuh │ │ │ │ ├── build_tracks.cuh │ │ │ │ ├── fill_finding_propagation_sort_keys.cuh │ │ │ │ ├── remove_duplicates.cu │ │ │ │ ├── find_tracks.cuh │ │ │ │ ├── specializations │ │ │ │ │ ├── apply_interaction.cu.template │ │ │ │ │ ├── find_tracks.cu.template │ │ │ │ │ └── propagate_to_next_surface.cu.template │ │ │ │ ├── fill_finding_duplicate_removal_sort_keys.cu │ │ │ │ ├── fill_finding_propagation_sort_keys.cu │ │ │ │ ├── apply_interaction.hpp │ │ │ │ ├── build_tracks.cu │ │ │ │ ├── propagate_to_next_surface.hpp │ │ │ │ ├── gather_measurement_votes.cuh │ │ │ │ └── update_tip_length_buffer.cuh │ │ │ └── combinatorial_kalman_filter_algorithm.cpp │ │ ├── utils │ │ │ ├── global_index.hpp │ │ │ ├── barrier.hpp │ │ │ ├── opaque_stream.hpp │ │ │ └── cuda_error_handling.cpp │ │ ├── fitting │ │ │ ├── kernels │ │ │ │ ├── fit_forward.hpp │ │ │ │ ├── fit_backward.hpp │ │ │ │ ├── fit_prelude.hpp │ │ │ │ ├── fill_fitting_sort_keys.hpp │ │ │ │ └── specializations │ │ │ │ │ ├── fit_forward_src.cuh │ │ │ │ │ └── fit_backward_src.cuh │ │ │ └── kalman_fitting_algorithm.cpp │ │ └── clusterization │ │ │ └── kernels │ │ │ ├── reify_cluster_data.cu │ │ │ └── reify_cluster_data.cuh │ └── include │ │ └── traccc │ │ └── cuda │ │ └── utils │ │ └── make_magnetic_field.hpp ├── alpaka │ ├── src │ │ └── utils │ │ │ ├── oneDPL.hpp │ │ │ ├── magnetic_field_types.hpp │ │ │ ├── get_queue.hpp │ │ │ ├── get_device_info.cpp │ │ │ └── get_queue.cpp │ └── include │ │ └── traccc │ │ └── alpaka │ │ └── utils │ │ ├── get_device_info.hpp │ │ └── make_prefix_sum_buff.hpp └── sycl │ ├── src │ ├── utils │ │ ├── oneDPL.hpp │ │ ├── queue_wrapper.cpp │ │ ├── calculate1DimNdRange.sycl │ │ ├── get_queue.sycl │ │ ├── get_queue.hpp │ │ ├── calculate1DimNdRange.hpp │ │ └── global_index.hpp │ ├── fitting │ │ └── kalman_fitting_algorithm.cpp │ ├── seeding │ │ └── silicon_pixel_spacepoint_formation_algorithm.cpp │ └── finding │ │ └── combinatorial_kalman_filter_algorithm.cpp │ └── include │ └── traccc │ └── sycl │ └── utils │ └── make_magnetic_field.hpp ├── performance ├── include │ └── traccc │ │ ├── utils │ │ ├── seed_matching_config.hpp │ │ ├── track_matching_config.hpp │ │ ├── truth_matching_config.hpp │ │ └── helpers.hpp │ │ ├── performance │ │ ├── impl │ │ │ ├── comparator_factory.ipp │ │ │ ├── is_same_object.ipp │ │ │ └── is_same_track_parameters.ipp │ │ ├── details │ │ │ ├── is_same_scalar.hpp │ │ │ └── is_same_angle.hpp │ │ └── throughput.hpp │ │ └── resolution │ │ └── stat_plot_tool_config.hpp └── src │ ├── performance │ ├── details │ │ └── is_same_scalar.cpp │ └── throughput.cpp │ └── efficiency │ └── track_filter.cpp ├── .policy.yml ├── cmake ├── traccc-ctest.sh.in └── FindROOT.cmake ├── io ├── src │ ├── csv │ │ ├── make_measurement_hit_id_reader.cpp │ │ ├── make_cell_reader.cpp │ │ ├── make_surface_reader.cpp │ │ ├── make_particle_reader.cpp │ │ ├── make_hit_reader.cpp │ │ ├── make_measurement_reader.cpp │ │ └── write_cells.hpp │ ├── json │ │ ├── write_digitization_config.hpp │ │ └── read_digitization_config.hpp │ ├── obj │ │ ├── write_spacepoints.hpp │ │ ├── write_seeds.hpp │ │ └── write_tracks.hpp │ ├── data_format.cpp │ └── read_digitization_config.cpp └── include │ └── traccc │ └── io │ ├── data_format.hpp │ ├── csv │ ├── measurement_hit_id.hpp │ ├── make_hit_reader.hpp │ ├── make_cell_reader.hpp │ ├── make_surface_reader.hpp │ ├── make_particle_reader.hpp │ ├── make_measurement_reader.hpp │ ├── make_measurement_hit_id_reader.hpp │ ├── cell.hpp │ ├── particle.hpp │ ├── surface.hpp │ ├── hit.hpp │ └── measurement.hpp │ ├── digitization_config.hpp │ ├── read_digitization_config.hpp │ └── read_magnetic_field.hpp ├── .gitignore ├── spack.yaml └── .pre-commit-config.yaml /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extras/benchmark/.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | *.csv 3 | .venv/ 4 | **/__pycache__ 5 | -------------------------------------------------------------------------------- /.github/wip.yml: -------------------------------------------------------------------------------- 1 | - locations: 2 | - title 3 | - label_name 4 | terms: 5 | - WIP 6 | -------------------------------------------------------------------------------- /extras/cut_optimiser/.gitignore: -------------------------------------------------------------------------------- 1 | *.csv 2 | *.csv.bak 3 | *.json 4 | .venv/ 5 | !example.json 6 | -------------------------------------------------------------------------------- /doc/images/sketch-seeding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acts-project/traccc/HEAD/doc/images/sketch-seeding.png -------------------------------------------------------------------------------- /tests/io/mock_data/event000000000-measurement-simhit-map.csv: -------------------------------------------------------------------------------- 1 | measurement_id,hit_id 2 | 0,0 3 | 1,1 4 | 2,2 5 | -------------------------------------------------------------------------------- /doc/images/sketch-sp-formation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acts-project/traccc/HEAD/doc/images/sketch-sp-formation.png -------------------------------------------------------------------------------- /doc/images/sparseCCL-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acts-project/traccc/HEAD/doc/images/sparseCCL-example.png -------------------------------------------------------------------------------- /doc/images/tml-pixel-barrrel-sp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acts-project/traccc/HEAD/doc/images/tml-pixel-barrrel-sp.png -------------------------------------------------------------------------------- /doc/images/sketch-measurement-creation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acts-project/traccc/HEAD/doc/images/sketch-measurement-creation.png -------------------------------------------------------------------------------- /doc/images/tm-pixel-measurements-local.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acts-project/traccc/HEAD/doc/images/tm-pixel-measurements-local.gif -------------------------------------------------------------------------------- /.github/check_duplicate_cu_files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ! [[ $(find device tests -name "*\.cu" | xargs -I {} basename {} | sort | uniq -d) ]] 4 | exit $? 5 | -------------------------------------------------------------------------------- /data/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2023-2024 CERN for the benefit of the ACTS project 3 | # 4 | # Mozilla Public License Version 2.0 5 | # 6 | */ 7 | *.tar.gz 8 | *.md5 9 | -------------------------------------------------------------------------------- /extern/acts/README.md: -------------------------------------------------------------------------------- 1 | # Build Recipe for Acts 2 | 3 | This directory holds a simple build recipe for the 4 | [Acts](https://github.com/acts-project/acts) project. 5 | -------------------------------------------------------------------------------- /extern/cccl/README.md: -------------------------------------------------------------------------------- 1 | # Build Recipe for CCCL 2 | 3 | This directory holds a build recipe for building 4 | [CCCL](https://github.com/NVIDIA/cccl) for this project. 5 | -------------------------------------------------------------------------------- /extern/detray/README.md: -------------------------------------------------------------------------------- 1 | # Build Recipe for Detray 2 | 3 | This directory holds a build recipe for the 4 | [detray](https://github.com/acts-project/detray) project. 5 | -------------------------------------------------------------------------------- /extern/eigen3/README.md: -------------------------------------------------------------------------------- 1 | # Build Recipe for Eigen3 2 | 3 | This directory holds a simple build recipe for the 4 | [Eigen3](https://eigen.tuxfamily.org) project. 5 | -------------------------------------------------------------------------------- /extern/dfelibs/README.md: -------------------------------------------------------------------------------- 1 | # Build Recipe for dfelibs 2 | 3 | This directory holds a simple build recipe for the 4 | [dfelibs](https://github.com/msmk0/dfelibs) project. 5 | -------------------------------------------------------------------------------- /extern/tbb/README.md: -------------------------------------------------------------------------------- 1 | # Build Recipe for TBB 2 | 3 | This directory holds a build recipe for building 4 | [TBB](https://github.com/oneapi-src/oneTBB) for this project. 5 | -------------------------------------------------------------------------------- /extern/dpl/README.txt: -------------------------------------------------------------------------------- 1 | # Build Recipe for oneDPL 2 | 3 | This directory holds a build recipe for building 4 | [DPL](https://github.com/oneapi-src/oneDPL) for this project. 5 | -------------------------------------------------------------------------------- /extern/vecmem/README.md: -------------------------------------------------------------------------------- 1 | # Build Recipe for VecMem 2 | 3 | This directory holds a simple build recipe for the 4 | [VecMem](https://github.com/acts-project/vecmem) project. 5 | -------------------------------------------------------------------------------- /extras/benchmark/traccc_bench_tools/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-PackageName = "traccc, a part of the ACTS project" 2 | # SPDX-FileCopyrightText: CERN 3 | # SPDX-License-Identifier: MPL-2.0 4 | -------------------------------------------------------------------------------- /extras/event_trimmer/.gitignore: -------------------------------------------------------------------------------- 1 | # Python-generated files 2 | __pycache__/ 3 | *.py[oc] 4 | build/ 5 | dist/ 6 | wheels/ 7 | *.egg-info 8 | 9 | # Virtual environments 10 | .venv 11 | -------------------------------------------------------------------------------- /extern/algebra-plugins/README.md: -------------------------------------------------------------------------------- 1 | # Build Recipe for Algebra Plugins 2 | 3 | This directory holds a build recipe for the 4 | [algebra-plugins](https://github.com/acts-project/algebra-plugins) project. 5 | -------------------------------------------------------------------------------- /extern/indicators/README.md: -------------------------------------------------------------------------------- 1 | # Build recipe for p-ranav/indicators 2 | 3 | This package downloads the https://github.com/p-ranav/indicators project, 4 | to be used in the test executables of the repository. 5 | -------------------------------------------------------------------------------- /plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2022 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | add_subdirectory( algebra ) 8 | -------------------------------------------------------------------------------- /extras/benchmark/traccc_bench_tools/types.py: -------------------------------------------------------------------------------- 1 | # SPDX-PackageName = "traccc, a part of the ACTS project" 2 | # SPDX-FileCopyrightText: CERN 3 | # SPDX-License-Identifier: MPL-2.0 4 | 5 | import collections 6 | 7 | GpuSpec = collections.namedtuple("GpuSpec", ["n_sm", "n_threads_per_sm"]) 8 | -------------------------------------------------------------------------------- /examples/utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2022-2024 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | traccc_add_library( traccc_utils utils TYPE SHARED 8 | "src/printable.cpp" 9 | ) 10 | -------------------------------------------------------------------------------- /extras/event_trimmer/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "traccc-event-trimmer" 3 | version = "0.1.0" 4 | description = "Tool for slimming down events" 5 | readme = "README.md" 6 | requires-python = ">=3.13" 7 | dependencies = [ 8 | "black>=25.9.0", 9 | "pandas>=2.3.2", 10 | ] 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2022 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Consider .hip and .sycl files as C++. 8 | *.hip linguist-language=C++ 9 | *.sycl linguist-language=C++ 10 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.hip": "cpp", 4 | "*.sycl": "cpp", 5 | "*.ipp": "cpp" 6 | }, 7 | "sonarlint.connectedMode.project": { 8 | "connectionId": "acts-project", 9 | "projectKey": "acts-project_traccc" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /extras/README.md: -------------------------------------------------------------------------------- 1 | # traccc extras 2 | 3 | This directory is designed to hold miscellaneous bits and bobs that are 4 | relevant to the traccc project. Examples include small scripts, write-ups, 5 | small data files, and whatever else which may be useful to the traccc team, but 6 | which does not fit in any of the other directories. 7 | -------------------------------------------------------------------------------- /examples/io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2022 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | traccc_add_executable( create_binaries "create_binaries.cpp" 8 | LINK_LIBRARIES vecmem::core traccc::core traccc::io traccc::options) 9 | -------------------------------------------------------------------------------- /simulation/include/traccc/simulation/event_generators.hpp: -------------------------------------------------------------------------------- 1 | /** Detray library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Detray include(s). 11 | #include 12 | -------------------------------------------------------------------------------- /extras/benchmark/traccc_bench_tools/git.py: -------------------------------------------------------------------------------- 1 | # SPDX-PackageName = "traccc, a part of the ACTS project" 2 | # SPDX-FileCopyrightText: CERN 3 | # SPDX-License-Identifier: MPL-2.0 4 | 5 | 6 | def is_parent_of(subj, parent_str): 7 | for p in subj.iter_parents(): 8 | if str(subj) == parent_str or str(p) == parent_str: 9 | return True 10 | return False 11 | -------------------------------------------------------------------------------- /tests/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2023 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Declare tests related to the example code. 8 | traccc_add_test( examples 9 | "test_options.cpp" 10 | LINK_LIBRARIES GTest::gtest_main traccc_tests_common traccc::options ) 11 | -------------------------------------------------------------------------------- /extras/benchmark/traccc_bench_tools/utils.py: -------------------------------------------------------------------------------- 1 | # SPDX-PackageName = "traccc, a part of the ACTS project" 2 | # SPDX-FileCopyrightText: CERN 3 | # SPDX-License-Identifier: MPL-2.0 4 | 5 | 6 | def harmonic_sum(vals): 7 | """ 8 | Return the harmonic addition of values, i.e. the reciprocal of the sum of 9 | the reciprocals. 10 | """ 11 | return 1.0 / sum(1.0 / x for x in vals) 12 | -------------------------------------------------------------------------------- /core/include/traccc/geometry/geometry.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/geometry/module_map.hpp" 12 | 13 | namespace traccc { 14 | using geometry = traccc::module_map<>; 15 | } 16 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | IndentWidth: 4 4 | Language: Cpp 5 | AllowShortBlocksOnASingleLine: false 6 | AllowShortCaseLabelsOnASingleLine: false 7 | AllowShortFunctionsOnASingleLine: Inline 8 | AllowShortIfStatementsOnASingleLine: false 9 | AllowShortLoopsOnASingleLine: false 10 | PointerAlignment: Left 11 | ColumnLimit: 80 12 | AccessModifierOffset: 0 13 | KeepEmptyLinesAtTheStartOfBlocks: true 14 | -------------------------------------------------------------------------------- /extras/cut_optimiser/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "cut-optimiser" 3 | version = "0.1.0" 4 | description = "Add your description here" 5 | readme = "README.md" 6 | requires-python = ">=3.13" 7 | dependencies = [ 8 | "pydantic>=2.11.7", 9 | "traccc-bench-tools", 10 | ] 11 | 12 | [tool.uv.sources] 13 | traccc-bench-tools = { path = "../benchmark" } 14 | 15 | [dependency-groups] 16 | dev = [ 17 | "black>=25.1.0", 18 | ] 19 | -------------------------------------------------------------------------------- /device/common/include/traccc/device/global_index.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * traccc library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2025 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | namespace traccc::device { 12 | 13 | /// Type for passing "global indices" to device functions 14 | using global_index_t = unsigned int; 15 | 16 | } // namespace traccc::device 17 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2023 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Project include(s). 8 | include( traccc-compiler-options-cpp ) 9 | 10 | add_subdirectory(utils) 11 | add_subdirectory(options) 12 | add_subdirectory(run) 13 | add_subdirectory(io) 14 | add_subdirectory(simulation) 15 | add_subdirectory(tools) 16 | -------------------------------------------------------------------------------- /performance/include/traccc/utils/seed_matching_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "traccc/definitions/common.hpp" 11 | 12 | namespace traccc { 13 | 14 | struct seed_matching_config { 15 | float matching_ratio = 0.5f; 16 | }; 17 | 18 | } // namespace traccc 19 | -------------------------------------------------------------------------------- /tests/io/mock_data/event000000000-particles_initial.csv: -------------------------------------------------------------------------------- 1 | particle_id,particle_type,process,vx,vy,vz,vt,px,py,pz,m,q 2 | 4503599644147712,-321,0,-0.0120002991,-9.48547313e-05,-15.1165705,-1.45888221,-0.188283622,-0.232863113,21.2549496,0.49368,-1 3 | 4503599660924928,211,0,-0.4,-0.23412,-100.,-1.45888221,-0.466783375,0.054883033,20.2191887,0.139569998,1 4 | 4503599744811008,211,0,-1999.,-9.231,23425.,-1.45888221,-0.00233761151,0.418767303,20.1930237,0.139569998,1 5 | -------------------------------------------------------------------------------- /data/README.md: -------------------------------------------------------------------------------- 1 | # Data Directory 2 | 3 | This subdirectory is what normally holds the data files used by the tests 4 | and examples. 5 | 6 | To download the "default version" of the files (corresponding to the version 7 | of the code in the repository), just execute 8 | 9 | ``` 10 | ./traccc_data_get_files.sh 11 | ``` 12 | 13 | without any additional arguments. 14 | 15 | To produce a new tarball of data files, use the `traccc_data_package_files.sh` 16 | script. 17 | -------------------------------------------------------------------------------- /extras/event_trimmer/README.md: -------------------------------------------------------------------------------- 1 | # Event trimmer 2 | 3 | This tool takes an input event and extracts the data for a small number of particles. It is designed to be useful for debugging all kinds of reconstruction issues. For example, the invocation: 4 | 5 | ``` 6 | python main.py -p 1 -p 5 -i 2 input output 7 | ``` 8 | 9 | Will read event 2 (`-i`) from directory `input` and extract particles 1 and 5 (`-p`) from it. It will then write the trimmed event to the `output` directory. 10 | -------------------------------------------------------------------------------- /.github/check_quote_includes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [ -x "$(command -v rg)" ]; then 4 | GREP="grep -R" 5 | else 6 | GREP="rg -j 1 --no-heading -N" 7 | fi 8 | 9 | ${GREP} "#include \"vecmem" "$@" ; test $? -eq 1 || exit 1 10 | ${GREP} "#include \"detray" "$@" ; test $? -eq 1 || exit 1 11 | ${GREP} "#include \"Acts" "$@" ; test $? -eq 1 || exit 1 12 | ${GREP} "#include \"covfie" "$@" ; test $? -eq 1 || exit 1 13 | ${GREP} "#include \"algebra" "$@" ; test $? -eq 1 || exit 1 14 | -------------------------------------------------------------------------------- /core/include/traccc/utils/pair.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc { 11 | template 12 | struct pair { 13 | public: 14 | using first_type = T1; 15 | using second_type = T2; 16 | 17 | T1 first; 18 | T2 second; 19 | }; 20 | } // namespace traccc 21 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/remove_tracks.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/remove_tracks.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void remove_tracks(device::remove_tracks_payload payload); 16 | } 17 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/update_status.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/update_status.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void update_status(device::update_status_payload payload); 16 | } 17 | -------------------------------------------------------------------------------- /core/include/traccc/definitions/track_parametrization.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Detray include(s) 11 | #include 12 | 13 | namespace traccc { 14 | 15 | using enum detray::bound_indices; 16 | using enum detray::free_indices; 17 | 18 | } // namespace traccc 19 | -------------------------------------------------------------------------------- /performance/include/traccc/utils/track_matching_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "traccc/definitions/common.hpp" 11 | 12 | namespace traccc { 13 | 14 | struct track_matching_config { 15 | float matching_ratio = 0.5f; 16 | 17 | bool double_matching = true; 18 | }; 19 | 20 | } // namespace traccc 21 | -------------------------------------------------------------------------------- /core/src/bfield/construct_const_bfield.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/bfield/construct_const_bfield.hpp" 10 | 11 | namespace traccc { 12 | 13 | magnetic_field construct_const_bfield(const vector3& v) { 14 | 15 | return construct_const_bfield(v[0], v[1], v[2]); 16 | } 17 | 18 | } // namespace traccc 19 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/add_block_offset.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/add_block_offset.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void add_block_offset(device::add_block_offset_payload payload); 16 | } 17 | -------------------------------------------------------------------------------- /examples/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2022-2023 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | traccc_add_executable(convert_csv_bfield "convert_csv_bfield.cpp" 8 | LINK_LIBRARIES traccc::core covfie::core Boost::program_options) 9 | 10 | traccc_add_executable(generate_constant_bfield "generate_constant_bfield.cpp" 11 | LINK_LIBRARIES traccc::core covfie::core Boost::program_options) 12 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/fill_inverted_ids.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/fill_inverted_ids.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void fill_inverted_ids(device::fill_inverted_ids_payload payload); 16 | } 17 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/scan_block_offsets.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/scan_block_offsets.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void scan_block_offsets(device::scan_block_offsets_payload payload); 16 | } 17 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/remove_duplicates.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "traccc/finding/device/remove_duplicates.hpp" 11 | 12 | namespace traccc::cuda::kernels { 13 | 14 | __global__ void remove_duplicates(const finding_config cfg, 15 | device::remove_duplicates_payload payload); 16 | } 17 | -------------------------------------------------------------------------------- /.policy.yml: -------------------------------------------------------------------------------- 1 | policy: 2 | approval: 3 | - One of the reviewers has approved 4 | 5 | approval_rules: 6 | - name: One of the reviewers has approved 7 | requires: 8 | count: 1 9 | teams: 10 | - "acts-project/reviewers" 11 | options: 12 | allow_author: false # just for completeness 13 | allow_contributor: true # Update button 'contributions' should be ignored 14 | invalidate_on_push: false 15 | ignore_update_merges: true 16 | 17 | methods: 18 | comments: [] 19 | github_review: true 20 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/block_inclusive_scan.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/block_inclusive_scan.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void block_inclusive_scan( 16 | device::block_inclusive_scan_payload payload); 17 | } 18 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/sort_updated_tracks.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/sort_updated_tracks.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void sort_updated_tracks( 16 | device::sort_updated_tracks_payload payload); 17 | } 18 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/fill_track_candidates.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/fill_track_candidates.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void fill_track_candidates( 16 | device::fill_track_candidates_payload payload); 17 | } 18 | -------------------------------------------------------------------------------- /extern/googletest/README.md: -------------------------------------------------------------------------------- 1 | # GoogleTest Build Instructions 2 | 3 | This subdirectory holds instructions for building 4 | [GoogleTest](https://github.com/google/googletest) as part of this project. 5 | This is meant to come in handy for building the project's tests in environments 6 | which do not provide GoogleTest themselves. 7 | 8 | Note that since GoogleTest is only needed for the unit tests of this project, 9 | which are not installed together with the project, GoogleTest is not installed 10 | together with the project either. 11 | -------------------------------------------------------------------------------- /tests/common/tests/ckf_toy_detector_test.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "kalman_fitting_toy_detector_test.hpp" 12 | 13 | namespace traccc { 14 | 15 | /// Combinatorial Kalman Finding Test to Comapre CPU results 16 | class CkfToyDetectorTests : public KalmanFittingToyDetectorTests {}; 17 | 18 | } // namespace traccc 19 | -------------------------------------------------------------------------------- /extras/benchmark/pyproject.toml: -------------------------------------------------------------------------------- 1 | # SPDX-PackageName = "traccc, a part of the ACTS project" 2 | # SPDX-FileCopyrightText: CERN 3 | # SPDX-License-Identifier: MPL-2.0 4 | 5 | [project] 6 | name = "traccc-bench-tools" 7 | version = "0.0.1" 8 | requires-python = "~=3.9" 9 | dependencies = [ 10 | "gitpython>=3.1.44,<4", 11 | "pandas>=2.2.3,<3", 12 | "matplotlib~=3.9", 13 | ] 14 | 15 | [dependency-groups] 16 | dev = ["black>=25.1.0,<26"] 17 | 18 | [build-system] 19 | requires = ["hatchling"] 20 | build-backend = "hatchling.build" 21 | -------------------------------------------------------------------------------- /tests/hip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2024 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | enable_language(HIP) 8 | traccc_add_test( 9 | hip 10 | # Define the sources for the test. 11 | test_thrust.hip 12 | LINK_LIBRARIES 13 | rocthrust 14 | GTest::gtest_main 15 | vecmem::core 16 | vecmem::hip 17 | ) 18 | 19 | set_target_properties( traccc_test_hip PROPERTIES 20 | POSITION_INDEPENDENT_CODE TRUE ) 21 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/fill_unique_meas_id_map.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/fill_unique_meas_id_map.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void fill_unique_meas_id_map( 16 | device::fill_unique_meas_id_map_payload payload); 17 | } 18 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/count_shared_measurements.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/count_shared_measurements.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void count_shared_measurements( 16 | device::count_shared_measurements_payload payload); 17 | } 18 | -------------------------------------------------------------------------------- /performance/include/traccc/performance/impl/comparator_factory.ipp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::details { 11 | 12 | template 13 | is_same_object comparator_factory::make_comparator( 14 | const TYPE& ref, scalar unc) const { 15 | 16 | return is_same_object{ref, unc}; 17 | } 18 | 19 | } // namespace traccc::details 20 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/fill_tracks_per_measurement.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/fill_tracks_per_measurement.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void fill_tracks_per_measurement( 16 | device::fill_tracks_per_measurement_payload payload); 17 | } 18 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/sort_tracks_per_measurement.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/sort_tracks_per_measurement.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void sort_tracks_per_measurement( 16 | device::sort_tracks_per_measurement_payload payload); 17 | } 18 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/fill_finding_duplicate_removal_sort_keys.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "traccc/finding/device/fill_finding_duplicate_removal_sort_keys.hpp" 11 | 12 | namespace traccc::cuda::kernels { 13 | 14 | __global__ void fill_finding_duplicate_removal_sort_keys( 15 | device::fill_finding_duplicate_removal_sort_keys_payload payload); 16 | } 17 | -------------------------------------------------------------------------------- /tests/io/mock_data/event000000000-cells.csv: -------------------------------------------------------------------------------- 1 | geometry_id,measurement_id,channel0,channel1,timestamp,value 2 | 1224979236083738112,0,1,0,0,0.0041470062 3 | 1224979236083738112,0,0,1,0,0.00306466641 4 | 1224979236083738112,0,1,1,0,0.00868905429 5 | 1224979236083738112,1,1,1,0,0.00886478275 6 | 1224979236083738112,1,1,2,0,0.00580428448 7 | 1224979236083738112,1,2,1,0,0.0016894876 8 | 1224979236083738112,1,2,2,0,0.00199076766 9 | 1224979236083738112,2,5,5,0,0.00632160669 10 | 1224979236083738112,2,5,6,0,0.00911649223 11 | 1224979236083738112,2,5,7,0,0.00518329488 12 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/build_tracks.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/finding/device/build_tracks.hpp" 12 | #include "traccc/finding/finding_config.hpp" 13 | 14 | namespace traccc::cuda::kernels { 15 | 16 | __global__ void build_tracks(bool run_mbf, 17 | device::build_tracks_payload payload); 18 | } 19 | -------------------------------------------------------------------------------- /cmake/traccc-ctest.sh.in: -------------------------------------------------------------------------------- 1 | #!@BASH_EXECUTABLE@ 2 | # 3 | # TRACCC library, part of the ACTS project (R&D line) 4 | # 5 | # (c) 2024 CERN for the benefit of the ACTS project 6 | # 7 | # Mozilla Public License Version 2.0 8 | 9 | # Propagate errors. 10 | set -e 11 | set -o pipefail 12 | 13 | # Run every command through the time command. Recording the time, memory, etc. 14 | # used by each and every build command. 15 | command @TIME_EXECUTABLE@ @TIME_VERBOSE_FLAG@ \ 16 | -ao @CMAKE_CURRENT_BINARY_DIR@/traccc_build_performance.log \ 17 | @CMAKE_CTEST_COMMAND@ $* 18 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/fill_finding_propagation_sort_keys.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/finding/device/fill_finding_propagation_sort_keys.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | __global__ void fill_finding_propagation_sort_keys( 16 | device::fill_finding_propagation_sort_keys_payload payload); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/run/cpu/throughput_mt.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../common/throughput_mt.hpp" 10 | 11 | #include "full_chain_algorithm.hpp" 12 | 13 | int main(int argc, char* argv[]) { 14 | 15 | // Execute the throughput test. 16 | return traccc::throughput_mt( 17 | "Multi-threaded host-only throughput tests", argc, argv); 18 | } 19 | -------------------------------------------------------------------------------- /examples/run/cpu/throughput_st.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../common/throughput_st.hpp" 10 | 11 | #include "full_chain_algorithm.hpp" 12 | 13 | int main(int argc, char* argv[]) { 14 | 15 | // Execute the throughput test. 16 | return traccc::throughput_st( 17 | "Single-threaded host-only throughput tests", argc, argv); 18 | } 19 | -------------------------------------------------------------------------------- /device/alpaka/src/utils/oneDPL.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Mark this as a "system header". To suppress all warnings from oneDPL. 11 | // This is needed because at the time of writing we cannot provide oneDPL with 12 | // "-isystem" to the oneAPI compiler. 13 | #pragma clang system_header 14 | 15 | // oneDPL include(s). 16 | #include 17 | #include 18 | -------------------------------------------------------------------------------- /device/sycl/src/utils/oneDPL.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Mark this as a "system header". To suppress all warnings from oneDPL. 11 | // This is needed because at the time of writing we cannot provide oneDPL with 12 | // "-isystem" to the oneAPI compiler. 13 | #pragma clang system_header 14 | 15 | // oneDPL include(s). 16 | #include 17 | #include 18 | -------------------------------------------------------------------------------- /examples/run/cuda/throughput_mt.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../common/throughput_mt.hpp" 10 | 11 | #include "full_chain_algorithm.hpp" 12 | 13 | int main(int argc, char* argv[]) { 14 | 15 | // Execute the throughput test. 16 | return traccc::throughput_mt( 17 | "Multi-threaded CUDA GPU throughput tests", argc, argv); 18 | } 19 | -------------------------------------------------------------------------------- /examples/run/cuda/throughput_st.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../common/throughput_st.hpp" 10 | 11 | #include "full_chain_algorithm.hpp" 12 | 13 | int main(int argc, char* argv[]) { 14 | 15 | // Execute the throughput test. 16 | return traccc::throughput_st( 17 | "Single-threaded CUDA GPU throughput tests", argc, argv); 18 | } 19 | -------------------------------------------------------------------------------- /examples/run/sycl/throughput_st.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../common/throughput_st.hpp" 10 | 11 | #include "full_chain_algorithm.hpp" 12 | 13 | int main(int argc, char* argv[]) { 14 | 15 | // Execute the throughput test. 16 | return traccc::throughput_st( 17 | "Single-threaded SYCL GPU throughput tests", argc, argv); 18 | } 19 | -------------------------------------------------------------------------------- /core/include/traccc/geometry/detector_type_list.hpp.in: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/geometry/detector.hpp" 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc { 17 | 18 | /// Detector types supported by the built libraries. 19 | using detector_type_list = std::tuple<@TRACCC_DETECTOR_TYPES@>; 20 | 21 | } // namespace traccc 22 | -------------------------------------------------------------------------------- /examples/run/alpaka/throughput_mt.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../common/throughput_mt.hpp" 10 | 11 | #include "full_chain_algorithm.hpp" 12 | 13 | int main(int argc, char* argv[]) { 14 | 15 | // Execute the throughput test. 16 | return traccc::throughput_mt( 17 | "Multi-threaded Alpaka GPU throughput tests", argc, argv); 18 | } 19 | -------------------------------------------------------------------------------- /examples/run/alpaka/throughput_st.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../common/throughput_st.hpp" 10 | 11 | #include "full_chain_algorithm.hpp" 12 | 13 | int main(int argc, char* argv[]) { 14 | 15 | // Execute the throughput test. 16 | return traccc::throughput_st( 17 | "Single-threaded Alpaka GPU throughput tests", argc, argv); 18 | } 19 | -------------------------------------------------------------------------------- /examples/run/sycl/throughput_mt.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../common/throughput_mt.hpp" 10 | 11 | #include "full_chain_algorithm.hpp" 12 | 13 | int main(int argc, char* argv[]) { 14 | 15 | // Execute the throughput test. 16 | 17 | return traccc::throughput_mt( 18 | "Multi-threaded SYCL GPU throughput tests", argc, argv); 19 | } 20 | -------------------------------------------------------------------------------- /extern/alpaka/alpaka-1.2.0-cmake-boost.patch: -------------------------------------------------------------------------------- 1 | diff -ur alpaka-1.2.0-orig/cmake/alpakaCommon.cmake alpaka-1.2.0-fixed/cmake/alpakaCommon.cmake 2 | --- alpaka-1.2.0-orig/cmake/alpakaCommon.cmake 2024-10-02 08:27:25.000000000 +0200 3 | +++ alpaka-1.2.0-fixed/cmake/alpakaCommon.cmake 2025-05-13 10:36:55.325318647 +0200 4 | @@ -214,6 +214,9 @@ 5 | SET(Boost_DETAILED_FAILURE_MSG ON) 6 | endif() 7 | 8 | +if(POLICY CMP0167) 9 | + cmake_policy(SET CMP0167 OLD) 10 | +endif() 11 | find_package(Boost ${_alpaka_BOOST_MIN_VER} REQUIRED 12 | OPTIONAL_COMPONENTS atomic) 13 | 14 | -------------------------------------------------------------------------------- /performance/include/traccc/performance/impl/is_same_object.ipp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::details { 11 | 12 | template 13 | is_same_object::is_same_object(const T& ref, scalar) : m_ref(ref) {} 14 | 15 | template 16 | bool is_same_object::operator()(const T& obj) const { 17 | return (obj == m_ref.get()); 18 | } 19 | 20 | } // namespace traccc::details 21 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/rearrange_tracks.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/device/rearrange_tracks.hpp" 12 | 13 | namespace traccc::cuda::kernels { 14 | 15 | constexpr const int nThreads_per_track = 4; 16 | 17 | __global__ void rearrange_tracks(device::rearrange_tracks_payload payload); 18 | } // namespace traccc::cuda::kernels 19 | -------------------------------------------------------------------------------- /io/src/csv/make_measurement_hit_id_reader.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/io/csv/make_measurement_hit_id_reader.hpp" 10 | 11 | namespace traccc::io::csv { 12 | 13 | dfe::NamedTupleCsvReader make_measurement_hit_id_reader( 14 | std::string_view filename) { 15 | 16 | return {filename.data(), {"measurement_id", "hit_id"}}; 17 | } 18 | 19 | } // namespace traccc::io::csv 20 | -------------------------------------------------------------------------------- /device/sycl/src/utils/queue_wrapper.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Project include(s). 9 | #include "traccc/sycl/utils/queue_wrapper.hpp" 10 | 11 | namespace traccc::sycl { 12 | 13 | queue_wrapper::queue_wrapper(void* queue) : m_queue(queue) {} 14 | 15 | void* queue_wrapper::queue() { 16 | return m_queue; 17 | } 18 | 19 | const void* queue_wrapper::queue() const { 20 | return m_queue; 21 | } 22 | 23 | } // namespace traccc::sycl 24 | -------------------------------------------------------------------------------- /plugins/algebra/vecmem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2022 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Set up the "build" of the traccc::vecmem library. 8 | traccc_add_library( traccc_vecmem vecmem TYPE INTERFACE 9 | "include/traccc/plugins/algebra/vecmem_definitions.hpp" ) 10 | target_link_libraries( traccc_vecmem 11 | INTERFACE algebra::vecmem_cmath vecmem::core ) 12 | target_compile_definitions( traccc_vecmem 13 | INTERFACE TRACCC_CUSTOM_SCALARTYPE=${TRACCC_CUSTOM_SCALARTYPE} ) 14 | -------------------------------------------------------------------------------- /device/cuda/src/utils/global_index.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/device/global_index.hpp" 12 | 13 | namespace traccc::cuda::details { 14 | 15 | /// Function creating a global index in a 1D CUDA kernel 16 | __device__ inline device::global_index_t global_index1() { 17 | 18 | return blockIdx.x * blockDim.x + threadIdx.x; 19 | } 20 | 21 | } // namespace traccc::cuda::details 22 | -------------------------------------------------------------------------------- /plugins/algebra/array/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2022 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Set up the "build" of the traccc::array library. 8 | traccc_add_library( traccc_array array TYPE INTERFACE 9 | "include/traccc/plugins/algebra/array_definitions.hpp" ) 10 | target_link_libraries( traccc_array 11 | INTERFACE algebra::array_cmath detray::algebra_array vecmem::core ) 12 | target_compile_definitions( traccc_array 13 | INTERFACE TRACCC_CUSTOM_SCALARTYPE=${TRACCC_CUSTOM_SCALARTYPE} ) 14 | -------------------------------------------------------------------------------- /plugins/algebra/eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2022 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Set up the "build" of the traccc::eigen library. 8 | traccc_add_library( traccc_eigen eigen TYPE INTERFACE 9 | "include/traccc/plugins/algebra/eigen_definitions.hpp" ) 10 | target_link_libraries( traccc_eigen 11 | INTERFACE algebra::eigen_eigen detray::algebra_eigen vecmem::core ) 12 | target_compile_definitions( traccc_eigen 13 | INTERFACE TRACCC_CUSTOM_SCALARTYPE=${TRACCC_CUSTOM_SCALARTYPE} ) 14 | -------------------------------------------------------------------------------- /.github/workflows/benchmarks.yml: -------------------------------------------------------------------------------- 1 | name: Benchmarks 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | jobs: 8 | traccc_benchmark_job: 9 | if: github.repository == 'acts-project/traccc' 10 | runs-on: ubuntu-latest 11 | steps: 12 | - run: > 13 | curl -X POST --fail 14 | -F token=${{ secrets.TRACCC_BENCHMARK_TRIGGER_TOKEN }} 15 | -F ref=master 16 | --form variables[MERGE_TIME]="$(date '+%Y-%m-%d_%H:%M:%S')" 17 | --form variables[SOURCE_SHA]="${{ github.sha }}" 18 | https://gitlab.cern.ch/api/v4/projects/190887/trigger/pipeline 19 | -------------------------------------------------------------------------------- /io/src/csv/make_cell_reader.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/io/csv/make_cell_reader.hpp" 10 | 11 | namespace traccc::io::csv { 12 | 13 | dfe::NamedTupleCsvReader make_cell_reader(std::string_view filename) { 14 | 15 | return {filename.data(), 16 | {"geometry_id", "measurement_id", "cannel0", "channel1", 17 | "timestamp", "value"}}; 18 | } 19 | 20 | } // namespace traccc::io::csv 21 | -------------------------------------------------------------------------------- /plugins/algebra/vc_aos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2024 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Set up the "build" of the traccc::vc_aos library. 8 | traccc_add_library( traccc_vc_aos vc_aos TYPE INTERFACE 9 | "include/traccc/plugins/algebra/vc_aos_definitions.hpp" ) 10 | target_link_libraries( traccc_vc_aos 11 | INTERFACE algebra::vc_aos detray::algebra_vc_aos vecmem::core ) 12 | target_compile_definitions( traccc_vc_aos 13 | INTERFACE TRACCC_CUSTOM_SCALARTYPE=${TRACCC_CUSTOM_SCALARTYPE} ) 14 | -------------------------------------------------------------------------------- /device/alpaka/include/traccc/alpaka/utils/get_device_info.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace traccc::alpaka { 13 | 14 | /// Function that prints the current device information to the console. 15 | /// Included as part of the traccc::alpaka namespace, to avoid having to include 16 | /// alpaka headers in any users of the library. 17 | std::string get_device_info(); 18 | 19 | } // namespace traccc::alpaka 20 | -------------------------------------------------------------------------------- /tests/io/mock_data/event000000000-measurements.csv: -------------------------------------------------------------------------------- 1 | measurement_id,geometry_id,local_key,local0,local1,phi,theta,time,var_local0,var_local1,var_phi,var_theta,var_time 2 | 0,1224979236083738112,,4.2657785415649414,11.742777824401855,-2.8126237392425537,2.1995303630828857,0,0.0025000001769512892,0.0025000001769512892,0,0,0 3 | 1,1224979236083738112,,2.4493119716644287,-17.223770141601562,-2.8123311996459961,2.1995320320129395,0,0.0025000001769512892,0.0025000001769512892,0,0,0 4 | 2,1224979236083738112,,3.1442358493804932,21.099834442138672,-2.8119988441467285,2.1995346546173096,0,0.0025000001769512892,0.0025000001769512892,0,0,0 5 | -------------------------------------------------------------------------------- /core/include/traccc/seeding/detail/spacepoint_type.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::details { 11 | 12 | /// Type of a space point 13 | enum class spacepoint_type : int { 14 | bottom = 0, //< The referenced type is a "bottom" spacepoint 15 | middle = 1, //< The referenced type is a "middle" spacepoint 16 | top = 2 //< The referenced type is a "top" spacepoint 17 | }; 18 | 19 | } // namespace traccc::details 20 | -------------------------------------------------------------------------------- /plugins/algebra/smatrix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2022 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Set up the "build" of the traccc::smatrix library. 8 | traccc_add_library( traccc_smatrix smatrix TYPE INTERFACE 9 | "include/traccc/plugins/algebra/smatrix_definitions.hpp" ) 10 | target_link_libraries( traccc_smatrix 11 | INTERFACE algebra::smatrix_smatrix detray::algebra_smatrix vecmem::core ) 12 | target_compile_definitions( traccc_smatrix 13 | INTERFACE TRACCC_CUSTOM_SCALARTYPE=${TRACCC_CUSTOM_SCALARTYPE} ) 14 | -------------------------------------------------------------------------------- /tests/common/tests/test_detectors.hpp: -------------------------------------------------------------------------------- 1 | /** Detray library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Detray include(s). 11 | #include 12 | #include 13 | #include 14 | 15 | // useful for telescope detector creation 16 | #include 17 | #include 18 | #include 19 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/fill_vectors.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/ambiguity_resolution_config.hpp" 12 | #include "traccc/ambiguity_resolution/device/fill_vectors.hpp" 13 | 14 | namespace traccc::cuda::kernels { 15 | 16 | __global__ void fill_vectors(const ambiguity_resolution_config cfg, 17 | device::fill_vectors_payload payload); 18 | } 19 | -------------------------------------------------------------------------------- /tests/io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Declare the io library test(s). 8 | traccc_add_test( io 9 | "test_bfield.cpp" 10 | "test_csv.cpp" 11 | "test_event_data.cpp" 12 | "test_json.cpp" 13 | LINK_LIBRARIES GTest::gtest_main traccc_tests_common 14 | traccc::core traccc::io traccc::performance ) 15 | 16 | target_compile_definitions( 17 | traccc_test_io 18 | PRIVATE 19 | TRACCC_TEST_IO_MOCK_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/mock_data" 20 | ) 21 | -------------------------------------------------------------------------------- /device/alpaka/src/utils/magnetic_field_types.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "traccc/bfield/magnetic_field_types.hpp" 11 | 12 | namespace traccc::alpaka { 13 | 14 | /// @brief the standard list of Alpaka bfield types to support 15 | template 16 | using bfield_type_list = std::tuple, 17 | host::inhom_bfield_backend_t>; 18 | 19 | } // namespace traccc::alpaka 20 | -------------------------------------------------------------------------------- /core/include/traccc/utils/propagation.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/track_parameters.hpp" 12 | 13 | // Detray include(s). 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | -------------------------------------------------------------------------------- /io/src/csv/make_surface_reader.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/io/csv/make_surface_reader.hpp" 10 | 11 | namespace traccc::io::csv { 12 | 13 | dfe::NamedTupleCsvReader make_surface_reader( 14 | std::string_view filename) { 15 | 16 | return {filename.data(), 17 | {"geometry_id", "cx", "cy", "cz", "rot_xu", "rot_xv", "rot_xw", 18 | "rot_zu", "rot_zv", "rot_zw"}}; 19 | } 20 | 21 | } // namespace traccc::io::csv 22 | -------------------------------------------------------------------------------- /io/src/csv/make_particle_reader.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/io/csv/make_particle_reader.hpp" 10 | 11 | namespace traccc::io::csv { 12 | 13 | dfe::NamedTupleCsvReader make_particle_reader( 14 | std::string_view filename) { 15 | 16 | return {filename.data(), 17 | {"particle_id", "particle_type", "process", "vx", "vy", "vz", "vt", 18 | "px", "py", "pz", "m", "q"}}; 19 | } 20 | 21 | } // namespace traccc::io::csv 22 | -------------------------------------------------------------------------------- /extras/benchmark/README.md: -------------------------------------------------------------------------------- 1 | # Benchmark tools 2 | 3 | This directory contains some tools to help benchmark traccc: 4 | 5 | * `benchmark.py` is designed to benchmark and compare the performance of traccc over time; it examines performance commit-by-commit and produces a CSV output. 6 | * `plot.py` can be used to plot the output of `benchmark.py`. 7 | * `parse_profile.py` takes an NSight Compute profile captured with `--section LaunchStats --section Occupancy --metrics gpu__time_duration.sum` and converts it into an easy-to-process CSV format. 8 | 9 | All tools are designed to run with uv, e.g.: 10 | 11 | ```bash 12 | $ uv run python3 benchmark.py ... 13 | ``` 14 | -------------------------------------------------------------------------------- /io/src/csv/make_hit_reader.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/io/csv/make_hit_reader.hpp" 10 | 11 | namespace traccc::io::csv { 12 | 13 | dfe::NamedTupleCsvReader make_hit_reader(std::string_view filename) { 14 | 15 | return {filename.data(), 16 | {"particle_id", "geometry_id", "tx", "ty", "tz", "tt", "tpx", "tpy", 17 | "tpz", "te", "deltapx", "deltapy", "deltapz", "deltae", "index"}}; 18 | } 19 | 20 | } // namespace traccc::io::csv 21 | -------------------------------------------------------------------------------- /device/common/include/traccc/clusterization/device/ccl_kernel_definitions.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * traccc library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2024 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | namespace traccc::device::details { 12 | /// These indices in clusterization will only range from 0 to 13 | /// max_cells_per_partition, so we only need a short 14 | using index_t = unsigned short; 15 | 16 | /// The limit on the stack size in terms of cells per thread. 17 | static constexpr std::size_t CELLS_PER_THREAD_STACK_LIMIT = 32; 18 | } // namespace traccc::device::details 19 | -------------------------------------------------------------------------------- /device/alpaka/src/utils/get_queue.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * traccc library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2025 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | // Local include(s). 12 | #include "traccc/alpaka/utils/queue.hpp" 13 | #include "utils.hpp" 14 | 15 | namespace traccc::alpaka::details { 16 | 17 | /// Helper function for getting a @c Queue out of @c queue (non-const) 18 | Queue& get_queue(queue& q); 19 | 20 | /// Helper function for getting a @c Queue out of @c queue (const) 21 | const Queue& get_queue(const queue& q); 22 | 23 | } // namespace traccc::alpaka::details 24 | -------------------------------------------------------------------------------- /tests/cuda/cuda_main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * TRACCC library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2022 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | int main(int argc, char** argv) { 13 | testing::InitGoogleTest(&argc, argv); 14 | 15 | int r = RUN_ALL_TESTS(); 16 | 17 | cudaError_t cErr = cudaDeviceReset(); 18 | 19 | if (cErr == cudaSuccess || cErr == cudaErrorNoDevice || 20 | cErr == cudaErrorInsufficientDriver) { 21 | return r; 22 | } else { 23 | return static_cast(cErr); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Prerequisites 8 | *.d 9 | 10 | # Compiled Object files 11 | *.slo 12 | *.lo 13 | *.o 14 | *.obj 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Compiled Dynamic libraries 21 | *.so 22 | *.dylib 23 | *.dll 24 | 25 | # Fortran module files 26 | *.mod 27 | *.smod 28 | 29 | # Compiled Static libraries 30 | *.lai 31 | *.la 32 | *.a 33 | *.lib 34 | 35 | # Executables 36 | *.exe 37 | *.out 38 | *.app 39 | 40 | # Build system related files. 41 | CMakeUserPresets.json 42 | out/ 43 | -------------------------------------------------------------------------------- /core/include/traccc/utils/projections.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * traccc library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2024-2025 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | // Project include(s). 12 | #include "traccc/definitions/qualifiers.hpp" 13 | #include "traccc/edm/silicon_cell_collection.hpp" 14 | 15 | namespace traccc { 16 | 17 | struct [[maybe_unused]] cell_module_projection { 18 | template 19 | TRACCC_HOST_DEVICE auto operator()(const edm::silicon_cell& c) const { 20 | return c.module_index(); 21 | } 22 | }; 23 | 24 | } // namespace traccc 25 | -------------------------------------------------------------------------------- /core/include/traccc/utils/memory_resource.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // VecMem include(s). 11 | #include 12 | 13 | namespace traccc { 14 | 15 | // Simple struct for combining multiple memory resources 16 | struct memory_resource { 17 | 18 | // device or shared memory resource 19 | vecmem::memory_resource& main; 20 | 21 | // optional host accesible memory resource 22 | vecmem::memory_resource* host = nullptr; 23 | }; 24 | 25 | } // namespace traccc 26 | -------------------------------------------------------------------------------- /tests/io/mock_data/event000000000-hits.csv: -------------------------------------------------------------------------------- 1 | particle_id,geometry_id,tx,ty,tz,tt,tpx,tpy,tpz,te,deltapx,deltapy,deltapz,deltae,index 2 | 4503599644147712,1224979236083738112,39.2037048,0.352969825,-1502.5,11.427907,0.584509015,-0.00557432789,-21.142601,21.1511402,-2.12927662e-05,0.000648729096,9.68955137e-05,-9.76058363e-05,3 3 | 4503599660924928,1224979236083738112,31.5048428,5.16000509,-1502.5,2.78843093,0.435487628,0.0612908453,-21.5235882,21.528532,-6.28146518e-05,2.1960961e-05,8.08380282e-05,-8.20274799e-05,1 4 | 4503599744811008,1224979236083738112,90.4015808,0.7420941,-1502.5,2.79669714,0.478592962,-0.0223038904,-8.27326393,8.28830051,0.000280289998,0.000398003991,8.34398961e-05,-6.81602833e-05,13 5 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/remove_duplicates.cu: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #include "../../utils/global_index.hpp" 9 | #include "remove_duplicates.cuh" 10 | #include "traccc/finding/device/remove_duplicates.hpp" 11 | 12 | namespace traccc::cuda::kernels { 13 | 14 | __global__ void remove_duplicates(const finding_config cfg, 15 | device::remove_duplicates_payload payload) { 16 | 17 | device::remove_duplicates(details::global_index1(), cfg, payload); 18 | } 19 | 20 | } // namespace traccc::cuda::kernels 21 | -------------------------------------------------------------------------------- /examples/options/src/details/interface.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/options/details/interface.hpp" 10 | 11 | namespace traccc::opts { 12 | 13 | interface::interface(std::string_view group_desc) 14 | : m_desc(std::string{group_desc}), m_description(group_desc) {} 15 | 16 | void interface::read(const boost::program_options::variables_map&) {} 17 | 18 | const boost::program_options::options_description& interface::options() const { 19 | 20 | return m_desc; 21 | } 22 | } // namespace traccc::opts 23 | -------------------------------------------------------------------------------- /core/include/traccc/definitions/hints.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * TRACCC library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2024 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | #if not defined __has_builtin 12 | #define TRACCC_ASSUME(...) 13 | #elif __has_builtin(__builtin_assume) 14 | #define TRACCC_ASSUME(...) __builtin_assume(__VA_ARGS__) 15 | #else 16 | #define TRACCC_ASSUME(...) 17 | #endif 18 | 19 | #if defined(__CUDACC__) || defined(__HIP__) || defined(__OPENMP) || \ 20 | defined(__SYCL__) || defined(__clang__) 21 | #define TRACCC_PRAGMA_UNROLL _Pragma("unroll") 22 | #else 23 | #define TRACCC_PRAGMA_UNROLL 24 | #endif 25 | -------------------------------------------------------------------------------- /core/include/traccc/definitions/common.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/definitions/primitives.hpp" 12 | 13 | // Detray include(s). 14 | #include 15 | 16 | namespace traccc { 17 | 18 | template 19 | using unit = detray::unit; 20 | 21 | template 22 | using constant = detray::constant; 23 | 24 | // epsilon for float variables 25 | constexpr scalar float_epsilon = 1e-5f; 26 | 27 | } // namespace traccc 28 | -------------------------------------------------------------------------------- /device/sycl/src/utils/calculate1DimNdRange.sycl: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Project include(s). 9 | #include "calculate1DimNdRange.hpp" 10 | 11 | namespace traccc::sycl::details { 12 | 13 | ::sycl::nd_range<1> calculate1DimNdRange(const std::size_t globalSize, 14 | const std::size_t localSize) { 15 | 16 | const std::size_t nBlocks = (globalSize + localSize - 1) / localSize; 17 | return {::sycl::range<1>(nBlocks * localSize), ::sycl::range<1>(localSize)}; 18 | } 19 | 20 | } // namespace traccc::sycl::details 21 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/details/config_provider.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::opts { 11 | /** 12 | * @brief Mixin type to indicate that some set of program options can be 13 | * converted to some configuration type. 14 | * 15 | * @tparam Config The config type to which this can be converted 16 | */ 17 | template 18 | class config_provider { 19 | public: 20 | using config_type = Config; 21 | 22 | virtual operator config_type() const = 0; 23 | }; 24 | } // namespace traccc::opts 25 | -------------------------------------------------------------------------------- /simulation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2023 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Set up the "build" of the traccc::io library. 8 | traccc_add_library( traccc_simulation simulation TYPE INTERFACE 9 | # Public headers 10 | "include/traccc/simulation/event_generators.hpp" 11 | "include/traccc/simulation/measurement_smearer.hpp" 12 | "include/traccc/simulation/simulator.hpp" 13 | "include/traccc/simulation/smearing_writer.hpp" ) 14 | target_link_libraries( traccc_simulation 15 | INTERFACE traccc::core traccc::io detray::core detray::io 16 | detray::test_common detray::test_utils dfelibs::dfelibs ) 17 | -------------------------------------------------------------------------------- /tests/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Declare the core library test(s). 8 | traccc_add_test(core 9 | "test_algorithm.cpp" 10 | "test_module_map.cpp" 11 | "test_pvalue.cpp" 12 | "particle.cpp" 13 | LINK_LIBRARIES GTest::gtest_main traccc_tests_common 14 | traccc::core traccc::io) 15 | 16 | if( TRACCC_USE_ROOT ) 17 | find_package( ROOT COMPONENTS Core RIO Hist REQUIRED ) 18 | target_link_libraries( traccc_test_core 19 | PRIVATE ROOT::Core ) 20 | target_compile_definitions( traccc_test_core 21 | PRIVATE TRACCC_HAVE_ROOT ) 22 | endif() 23 | -------------------------------------------------------------------------------- /device/alpaka/src/utils/get_device_info.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "utils.hpp" 10 | 11 | // Project include(s). 12 | #include "traccc/alpaka/utils/get_device_info.hpp" 13 | 14 | namespace traccc::alpaka { 15 | 16 | std::string get_device_info() { 17 | int device = 0; 18 | auto devAcc = ::alpaka::getDevByIdx(::alpaka::Platform{}, 0u); 19 | return std::string("Using Alpaka device: " + ::alpaka::getName(devAcc) + 20 | " [id: " + std::to_string(device) + "] "); 21 | } 22 | 23 | } // namespace traccc::alpaka 24 | -------------------------------------------------------------------------------- /io/include/traccc/io/data_format.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // System include(s). 11 | #include 12 | 13 | namespace traccc { 14 | 15 | /// Format for an input or output file 16 | enum data_format : int { 17 | csv = 0, ///< Comma-separated values 18 | binary = 1, ///< Binary format 19 | json = 2, ///< JSON format 20 | obj = 3, ///< Wavefront OBJ format 21 | }; 22 | 23 | /// Printout helper for @c traccc::data_format 24 | std::ostream& operator<<(std::ostream& out, data_format format); 25 | 26 | } // namespace traccc 27 | -------------------------------------------------------------------------------- /io/src/csv/make_measurement_reader.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/io/csv/make_measurement_reader.hpp" 10 | 11 | namespace traccc::io::csv { 12 | 13 | dfe::NamedTupleCsvReader make_measurement_reader( 14 | std::string_view filename) { 15 | 16 | return {filename.data(), 17 | {"measurement_id", "geometry_id", "local_key", "local0", "local1", 18 | "phi", "theta", "time", "var_local0", "var_local1", "var_phi", 19 | "var_theta", "var_time"}}; 20 | } 21 | 22 | } // namespace traccc::io::csv 23 | -------------------------------------------------------------------------------- /core/include/traccc/edm/track_fit_outcome.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // System include(s). 11 | #include 12 | 13 | namespace traccc { 14 | 15 | /// Possible outcomes of a track fit 16 | enum class track_fit_outcome : std::uint16_t { 17 | UNKNOWN, 18 | SUCCESS, 19 | FAILURE_NON_POSITIVE_NDF, 20 | FAILURE_NOT_ALL_FITTED, 21 | FAILURE_NOT_ALL_SMOOTHED, 22 | FAILURE_FITTER, 23 | FAILURE_SMOOTHER, 24 | FAILURE_FORWARD_PROPAGATION, 25 | FAILURE_BACKWARD_PROPAGATION, 26 | MAX_OUTCOME 27 | }; 28 | 29 | } // namespace traccc 30 | -------------------------------------------------------------------------------- /device/common/include/traccc/edm/device/seeding_global_counter.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::device { 11 | 12 | /// Total number of doublets and triplets found in seeding 13 | struct seeding_global_counter { 14 | 15 | /// The total number of middle-bottom doublets 16 | unsigned int m_nMidBot; 17 | 18 | /// The total number of middle-top doublets 19 | unsigned int m_nMidTop; 20 | 21 | /// The total number of triplets 22 | unsigned int m_nTriplets; 23 | 24 | }; // struct seeding_global_counter 25 | 26 | } // namespace traccc::device 27 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/find_tracks.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/finding/device/find_tracks.hpp" 12 | #include "traccc/finding/finding_config.hpp" 13 | 14 | namespace traccc::cuda { 15 | 16 | template 17 | void find_tracks(const dim3& grid_size, const dim3& block_size, 18 | std::size_t shared_mem_size, const cudaStream_t& stream, 19 | const finding_config cfg, 20 | device::find_tracks_payload payload); 21 | } // namespace traccc::cuda 22 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/specializations/apply_interaction.cu.template: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "${SOURCE_DIR}/apply_interaction_src.cuh" 10 | 11 | // Project include(s). 12 | #include "traccc/geometry/detector.hpp" 13 | 14 | namespace traccc::cuda { 15 | 16 | template void apply_interaction( 17 | const dim3& grid_size, const dim3& block_size, std::size_t shared_mem_size, 18 | const cudaStream_t& stream, const finding_config, 19 | device::apply_interaction_payload); 20 | } 21 | -------------------------------------------------------------------------------- /device/cuda/src/fitting/kernels/fit_forward.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "traccc/fitting/device/fit.hpp" 13 | #include "traccc/fitting/fitting_config.hpp" 14 | 15 | namespace traccc::cuda { 16 | 17 | template 18 | void fit_forward(const dim3& grid_size, const dim3& block_size, 19 | std::size_t shared_mem_size, const cudaStream_t& stream, 20 | const fitting_config& cfg, 21 | const device::fit_payload& payload); 22 | 23 | } // namespace traccc::cuda 24 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/measurement_hit_id.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // DFE include(s). 11 | #include 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::io::csv { 17 | 18 | /// Type used in reading CSV measurement-to-hit ID data into memory 19 | struct measurement_hit_id { 20 | 21 | std::uint64_t measurement_id = 0u; 22 | std::uint64_t hit_id = 0u; 23 | 24 | // measurement_id, hit_id 25 | DFE_NAMEDTUPLE(measurement_hit_id, measurement_id, hit_id); 26 | }; 27 | 28 | } // namespace traccc::io::csv 29 | -------------------------------------------------------------------------------- /performance/include/traccc/utils/truth_matching_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "traccc/definitions/common.hpp" 11 | 12 | namespace traccc { 13 | 14 | struct truth_matching_config { 15 | float pT_min = 0.5f * traccc::unit::GeV; 16 | 17 | float z_min = -500.f * traccc::unit::mm; 18 | float z_max = 500.f * traccc::unit::mm; 19 | float r_max = 200.f * traccc::unit::mm; 20 | float eta_max = 3.f; 21 | int process_id = -1; 22 | 23 | unsigned int min_track_candidates = 3; 24 | }; 25 | 26 | } // namespace traccc 27 | -------------------------------------------------------------------------------- /device/alpaka/src/utils/get_queue.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * traccc library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2025 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | // Local include(s). 10 | #include "get_queue.hpp" 11 | 12 | // System include(s). 13 | #include 14 | 15 | namespace traccc::alpaka::details { 16 | 17 | Queue& get_queue(queue& q) { 18 | 19 | assert(q.alpakaQueue() != nullptr); 20 | return *(reinterpret_cast(q.alpakaQueue())); 21 | } 22 | 23 | const Queue& get_queue(const queue& q) { 24 | 25 | assert(q.alpakaQueue() != nullptr); 26 | return *(reinterpret_cast(q.alpakaQueue())); 27 | } 28 | 29 | } // namespace traccc::alpaka::details 30 | -------------------------------------------------------------------------------- /device/cuda/src/fitting/kernels/fit_backward.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "traccc/fitting/device/fit.hpp" 13 | #include "traccc/fitting/fitting_config.hpp" 14 | 15 | namespace traccc::cuda { 16 | 17 | template 18 | void fit_backward(const dim3& grid_size, const dim3& block_size, 19 | std::size_t shared_mem_size, const cudaStream_t& stream, 20 | const fitting_config& cfg, 21 | const device::fit_payload& payload); 22 | 23 | } // namespace traccc::cuda 24 | -------------------------------------------------------------------------------- /examples/run/common/make_magnetic_field.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/bfield/magnetic_field.hpp" 12 | #include "traccc/options/magnetic_field.hpp" 13 | 14 | namespace traccc::details { 15 | 16 | /// Create a magnetic field object based on the provided options 17 | /// 18 | /// @param opts The command line options for the magnetic field 19 | /// @return A magnetic field object configured according to the options 20 | /// 21 | magnetic_field make_magnetic_field(const opts::magnetic_field& opts); 22 | 23 | } // namespace traccc::details 24 | -------------------------------------------------------------------------------- /performance/src/performance/details/is_same_scalar.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Library include(s). 9 | #include "traccc/performance/details/is_same_scalar.hpp" 10 | 11 | // System include(s). 12 | #include 13 | 14 | namespace traccc::details { 15 | 16 | bool is_same_scalar(scalar lhs, scalar rhs, scalar unc) { 17 | 18 | // The difference of the two values is meant to be smaller than 19 | // their average times the uncertainty. 20 | return (std::abs(lhs - rhs) <= 21 | (unc * ((std::abs(lhs) + std::abs(rhs)) / 2.f))); 22 | } 23 | 24 | } // namespace traccc::details 25 | -------------------------------------------------------------------------------- /spack.yaml: -------------------------------------------------------------------------------- 1 | # traccc library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | spack: 7 | specs: 8 | # Build tools 9 | - "cmake@3.26:" 10 | - "intel-oneapi-compilers@2024.2.0" 11 | - "cuda@12.5" 12 | - "gcc@13" 13 | # HEP dependencies 14 | - "acts@39.0.0 +json" 15 | - "root cxxstd=20" 16 | # General dependencies 17 | - "intel-oneapi-tbb@2021.12.0" 18 | - "alpaka" 19 | - "boost@1.85.0: +log+program_options" 20 | - "indicators" 21 | # SYCL dependencies 22 | - "intel-oneapi-dpl" 23 | # Examples and test dependencies 24 | - "googletest@1.14:" 25 | view: true 26 | concretizer: 27 | unify: true 28 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/specializations/find_tracks.cu.template: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "${SOURCE_DIR}/find_tracks_src.cuh" 10 | 11 | // Project include(s). 12 | #include "traccc/geometry/detector.hpp" 13 | 14 | namespace traccc::cuda { 15 | template void find_tracks( 16 | const dim3& grid_size, const dim3& block_size, std::size_t shared_mem_size, 17 | const cudaStream_t& stream, const finding_config cfg, 18 | device::find_tracks_payload payload); 19 | } // namespace traccc::cuda 20 | -------------------------------------------------------------------------------- /core/include/traccc/utils/messaging.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "traccc/utils/logging.hpp" 13 | 14 | namespace traccc { 15 | class messaging { 16 | public: 17 | explicit messaging(std::unique_ptr ilogger) 18 | : m_logger(std::move(ilogger)) {} 19 | 20 | messaging() = delete; 21 | 22 | const Logger& logger() const { 23 | assert(m_logger.get() != nullptr); 24 | return *m_logger; 25 | } 26 | 27 | private: 28 | std::unique_ptr m_logger; 29 | }; 30 | } // namespace traccc 31 | -------------------------------------------------------------------------------- /device/sycl/src/fitting/kalman_fitting_algorithm.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/sycl/fitting/kalman_fitting_algorithm.hpp" 10 | 11 | namespace traccc::sycl { 12 | 13 | kalman_fitting_algorithm::kalman_fitting_algorithm( 14 | const config_type& config, const traccc::memory_resource& mr, 15 | vecmem::copy& copy, queue_wrapper queue, 16 | std::unique_ptr logger) 17 | : messaging(std::move(logger)), 18 | m_config{config}, 19 | m_mr{mr}, 20 | m_copy{copy}, 21 | m_queue{queue} {} 22 | 23 | } // namespace traccc::sycl 24 | -------------------------------------------------------------------------------- /device/sycl/src/seeding/silicon_pixel_spacepoint_formation_algorithm.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/sycl/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp" 10 | 11 | namespace traccc::sycl { 12 | 13 | silicon_pixel_spacepoint_formation_algorithm:: 14 | silicon_pixel_spacepoint_formation_algorithm( 15 | const traccc::memory_resource& mr, vecmem::copy& copy, 16 | queue_wrapper queue, std::unique_ptr logger) 17 | : messaging(std::move(logger)), m_mr(mr), m_copy(copy), m_queue(queue) {} 18 | 19 | } // namespace traccc::sycl 20 | -------------------------------------------------------------------------------- /device/common/include/traccc/edm/device/sort_key.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/definitions/primitives.hpp" 12 | #include "traccc/edm/track_parameters.hpp" 13 | 14 | namespace traccc::device { 15 | 16 | using sort_key = traccc::scalar; 17 | 18 | template 19 | TRACCC_HOST_DEVICE inline sort_key get_sort_key( 20 | const bound_track_parameters& params) { 21 | // key = |theta - pi/2| 22 | return math::fabs(params.theta() - constant::pi_2); 23 | } 24 | 25 | } // namespace traccc::device 26 | -------------------------------------------------------------------------------- /examples/run/common/print_fitted_tracks_statistics.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/track_container.hpp" 12 | #include "traccc/utils/logging.hpp" 13 | 14 | namespace traccc::details { 15 | 16 | /// Print statistics for the fitted tracks. 17 | /// 18 | /// @param tracks The fitted tracks to print statistics for 19 | /// @param log The logger to use for outputting the statistics 20 | /// 21 | void print_fitted_tracks_statistics( 22 | const edm::track_container::host& tracks, 23 | const Logger& log); 24 | 25 | } // namespace traccc::details 26 | -------------------------------------------------------------------------------- /extras/cut_optimiser/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "event_dir": "/data/Acts/odd-simulations-20240506/geant4_ttbar_mu200", 4 | "digitization_file": "geometries/odd/odd-digi-geometric-config.json", 5 | "detector_file": "geometries/odd/odd-detray_geometry_detray.json", 6 | "grid_file": "geometries/odd/odd-detray_surface_grids_detray.json", 7 | "material_file": "geometries/odd/odd-detray_material_detray.json" 8 | }, 9 | "config": { 10 | "truth-finding-min-track-candidates": 7, 11 | "track-candidates-range": "7:100" 12 | }, 13 | "parameters": { 14 | "max-num-branches-per-surface": [1, 2, 3], 15 | "max-num-skipping-per-cand": [2, 3], 16 | "chi2-max": [2.5, 5.0, 7.5, 10.0, 15.0, 20.0] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /device/cuda/src/fitting/kernels/fit_prelude.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "traccc/edm/track_container.hpp" 13 | 14 | namespace traccc::cuda { 15 | void fit_prelude( 16 | const dim3& grid_size, const dim3& block_size, std::size_t shared_mem_size, 17 | const cudaStream_t& stream, 18 | vecmem::data::vector_view param_ids_view, 19 | edm::track_container::const_view track_candidates_view, 20 | edm::track_container::view tracks_view, 21 | vecmem::data::vector_view param_liveness_view); 22 | } 23 | -------------------------------------------------------------------------------- /io/src/json/write_digitization_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/io/digitization_config.hpp" 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::io::json { 17 | 18 | /// Write a digitization configuration to a file 19 | /// 20 | /// @param filename The name of the file to write the data to 21 | /// @param config The digitization configuration to write 22 | /// 23 | void write_digitization_config(std::string_view filename, 24 | const digitization_config& config); 25 | 26 | } // namespace traccc::io::json 27 | -------------------------------------------------------------------------------- /io/src/obj/write_spacepoints.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/spacepoint_collection.hpp" 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::io::obj { 17 | 18 | /// Write a spacepoint collection into a Wavefront OBJ file. 19 | /// 20 | /// @param filename is the name of the output file 21 | /// @param spacepoints is the spacepoint collection to write 22 | /// 23 | void write_spacepoints(std::string_view filename, 24 | edm::spacepoint_collection::const_view spacepoints); 25 | 26 | } // namespace traccc::io::obj 27 | -------------------------------------------------------------------------------- /.github/workflows/checks.yml: -------------------------------------------------------------------------------- 1 | name: Checks 2 | 3 | on: 4 | push: 5 | pull_request: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | format: 11 | runs-on: ubuntu-latest 12 | env: 13 | PRE_COMMIT_HOME: '/tmp/pre-commit' 14 | 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v4 18 | - uses: actions/setup-python@v5 19 | with: 20 | python-version: '3.12' 21 | - uses: actions/cache@v4 22 | with: 23 | path: | 24 | ${{ env.PRE_COMMIT_HOME }} 25 | key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} 26 | - name: Install pre-commit 27 | run: pip install pre-commit 28 | - name: Run pre-commit 29 | run: pre-commit run --all-files --show-diff-on-failure 30 | -------------------------------------------------------------------------------- /device/cuda/src/utils/barrier.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::cuda { 11 | 12 | struct barrier { 13 | __device__ inline void blockBarrier() const { __syncthreads(); } 14 | 15 | __device__ inline bool blockAnd(bool predicate) const { 16 | return __syncthreads_and(predicate); 17 | } 18 | 19 | __device__ inline bool blockOr(bool predicate) const { 20 | return __syncthreads_or(predicate); 21 | } 22 | 23 | __device__ inline int blockCount(bool predicate) const { 24 | return __syncthreads_count(predicate); 25 | } 26 | }; 27 | 28 | } // namespace traccc::cuda 29 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/make_hit_reader.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/io/csv/hit.hpp" 12 | 13 | // DFE include(s). 14 | #include 15 | 16 | // System include(s). 17 | #include 18 | 19 | namespace traccc::io::csv { 20 | 21 | /// Set up an object for reading a CSV file containing hit information 22 | /// 23 | /// @param filename The name of the file to read 24 | /// @return An object that can read the specified CSV file 25 | /// 26 | dfe::NamedTupleCsvReader make_hit_reader(std::string_view filename); 27 | 28 | } // namespace traccc::io::csv 29 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/make_cell_reader.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/io/csv/cell.hpp" 12 | 13 | // DFE include(s). 14 | #include 15 | 16 | // System include(s). 17 | #include 18 | 19 | namespace traccc::io::csv { 20 | 21 | /// Set up an object for reading a CSV file containing cell information 22 | /// 23 | /// @param filename The name of the file to read 24 | /// @return An object that can read the specified CSV file 25 | /// 26 | dfe::NamedTupleCsvReader make_cell_reader(std::string_view filename); 27 | 28 | } // namespace traccc::io::csv 29 | -------------------------------------------------------------------------------- /io/src/json/read_digitization_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/io/digitization_config.hpp" 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::io::json { 17 | 18 | /// Read the detector digitization configuration from a JSON input file 19 | /// 20 | /// @param filename The name of the file to read the data from 21 | /// @return An object describing the digitization configuration of the 22 | /// detector 23 | /// 24 | digitization_config read_digitization_config(std::string_view filename); 25 | 26 | } // namespace traccc::io::json 27 | -------------------------------------------------------------------------------- /device/sycl/src/finding/combinatorial_kalman_filter_algorithm.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/sycl/finding/combinatorial_kalman_filter_algorithm.hpp" 10 | 11 | namespace traccc::sycl { 12 | 13 | combinatorial_kalman_filter_algorithm::combinatorial_kalman_filter_algorithm( 14 | const config_type& config, const traccc::memory_resource& mr, 15 | vecmem::copy& copy, queue_wrapper queue, 16 | std::unique_ptr logger) 17 | : messaging(std::move(logger)), 18 | m_config{config}, 19 | m_mr{mr}, 20 | m_copy{copy}, 21 | m_queue{queue} {} 22 | 23 | } // namespace traccc::sycl 24 | -------------------------------------------------------------------------------- /device/sycl/src/utils/get_queue.sycl: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "get_queue.hpp" 10 | 11 | // System include(s). 12 | #include 13 | 14 | namespace traccc::sycl::details { 15 | 16 | ::sycl::queue& get_queue(traccc::sycl::queue_wrapper& queue) { 17 | 18 | assert(queue.queue() != nullptr); 19 | return *(reinterpret_cast<::sycl::queue*>(queue.queue())); 20 | } 21 | 22 | const ::sycl::queue& get_queue(const traccc::sycl::queue_wrapper& queue) { 23 | 24 | assert(queue.queue() != nullptr); 25 | return *(reinterpret_cast(queue.queue())); 26 | } 27 | 28 | } // namespace traccc::sycl::details 29 | -------------------------------------------------------------------------------- /io/include/traccc/io/digitization_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Acts include(s). 11 | #include 12 | #include 13 | 14 | namespace traccc { 15 | 16 | /// Type describing the digitization configuration of a detector module 17 | struct module_digitization_config { 18 | Acts::BinUtility segmentation; 19 | unsigned char dimensions = 2; 20 | }; 21 | 22 | /// Type describing the digitization configuration for the whole detector 23 | using digitization_config = 24 | Acts::GeometryHierarchyMap; 25 | 26 | } // namespace traccc 27 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/fill_finding_duplicate_removal_sort_keys.cu: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #include "../../utils/global_index.hpp" 9 | #include "fill_finding_duplicate_removal_sort_keys.cuh" 10 | #include "traccc/finding/device/fill_finding_duplicate_removal_sort_keys.hpp" 11 | 12 | namespace traccc::cuda::kernels { 13 | 14 | __global__ void fill_finding_duplicate_removal_sort_keys( 15 | device::fill_finding_duplicate_removal_sort_keys_payload payload) { 16 | 17 | device::fill_finding_duplicate_removal_sort_keys(details::global_index1(), 18 | payload); 19 | } 20 | 21 | } // namespace traccc::cuda::kernels 22 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/make_surface_reader.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/io/csv/surface.hpp" 12 | 13 | // DFE include(s). 14 | #include 15 | 16 | // System include(s). 17 | #include 18 | 19 | namespace traccc::io::csv { 20 | 21 | /// Set up an object for reading a CSV file containing surface information 22 | /// 23 | /// @param filename The name of the file to read 24 | /// @return An object that can read the specified CSV file 25 | /// 26 | dfe::NamedTupleCsvReader make_surface_reader( 27 | std::string_view filename); 28 | 29 | } // namespace traccc::io::csv 30 | -------------------------------------------------------------------------------- /core/include/traccc/definitions/qualifiers.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * TRACCC library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2021 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | #if defined(__CUDACC__) || defined(__HIP__) 12 | #define TRACCC_DEVICE __device__ 13 | #else 14 | #define TRACCC_DEVICE 15 | #endif 16 | 17 | #if defined(__CUDACC__) || defined(__HIP__) 18 | #define TRACCC_HOST __host__ 19 | #else 20 | #define TRACCC_HOST 21 | #endif 22 | 23 | #if defined(__CUDACC__) || defined(__HIP__) 24 | #define TRACCC_HOST_DEVICE __host__ __device__ 25 | #else 26 | #define TRACCC_HOST_DEVICE 27 | #endif 28 | 29 | #if defined(__CUDACC__) || defined(__HIP__) 30 | #define TRACCC_ALIGN(x) __align__(x) 31 | #else 32 | #define TRACCC_ALIGN(x) alignas(x) 33 | #endif 34 | -------------------------------------------------------------------------------- /device/sycl/src/utils/get_queue.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/sycl/utils/queue_wrapper.hpp" 12 | 13 | // SYCL include(s). 14 | #include 15 | 16 | namespace traccc::sycl::details { 17 | 18 | /// Helper function for getting a @c sycl::queue out of 19 | /// @c traccc::sycl::queue_wrapper (non-const) 20 | ::sycl::queue& get_queue(traccc::sycl::queue_wrapper& queue); 21 | 22 | /// Helper function for getting a @c sycl::queue out of 23 | /// @c traccc::sycl::queue_wrapper (const) 24 | const ::sycl::queue& get_queue(const traccc::sycl::queue_wrapper& queue); 25 | 26 | } // namespace traccc::sycl::details 27 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/make_particle_reader.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/io/csv/particle.hpp" 12 | 13 | // DFE include(s). 14 | #include 15 | 16 | // System include(s). 17 | #include 18 | 19 | namespace traccc::io::csv { 20 | 21 | /// Set up an object for reading a CSV file containing particle information 22 | /// 23 | /// @param filename The name of the file to read 24 | /// @return An object that can read the specified CSV file 25 | /// 26 | dfe::NamedTupleCsvReader make_particle_reader( 27 | std::string_view filename); 28 | 29 | } // namespace traccc::io::csv 30 | -------------------------------------------------------------------------------- /device/cuda/src/fitting/kalman_fitting_algorithm.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/cuda/fitting/kalman_fitting_algorithm.hpp" 10 | 11 | #include "../utils/utils.hpp" 12 | 13 | namespace traccc::cuda { 14 | 15 | kalman_fitting_algorithm::kalman_fitting_algorithm( 16 | const config_type& config, const traccc::memory_resource& mr, 17 | vecmem::copy& copy, stream& str, std::unique_ptr logger) 18 | : messaging(std::move(logger)), 19 | m_config{config}, 20 | m_mr{mr}, 21 | m_copy{copy}, 22 | m_stream{str}, 23 | m_warp_size(details::get_warp_size(str.device())) {} 24 | 25 | } // namespace traccc::cuda 26 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/make_measurement_reader.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/io/csv/measurement.hpp" 12 | 13 | // DFE include(s). 14 | #include 15 | 16 | // System include(s). 17 | #include 18 | 19 | namespace traccc::io::csv { 20 | 21 | /// Set up an object for reading a CSV file containing measurement information 22 | /// 23 | /// @param filename The name of the file to read 24 | /// @return An object that can read the specified CSV file 25 | /// 26 | dfe::NamedTupleCsvReader make_measurement_reader( 27 | std::string_view filename); 28 | 29 | } // namespace traccc::io::csv 30 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/fill_finding_propagation_sort_keys.cu: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../../utils/global_index.hpp" 10 | #include "fill_finding_propagation_sort_keys.cuh" 11 | 12 | // Project include(s). 13 | #include "traccc/finding/device/fill_finding_propagation_sort_keys.hpp" 14 | 15 | namespace traccc::cuda::kernels { 16 | 17 | __global__ void fill_finding_propagation_sort_keys( 18 | device::fill_finding_propagation_sort_keys_payload payload) { 19 | 20 | device::fill_finding_propagation_sort_keys(details::global_index1(), 21 | payload); 22 | } 23 | 24 | } // namespace traccc::cuda::kernels 25 | -------------------------------------------------------------------------------- /examples/tools/bfield_type.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | using backend_t = covfie::backend::affine>>>; 19 | 20 | using field_t = covfie::field; 21 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/apply_interaction.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/finding/device/apply_interaction.hpp" 12 | #include "traccc/finding/finding_config.hpp" 13 | 14 | // CUDA include(s). 15 | #include 16 | 17 | namespace traccc::cuda { 18 | 19 | template 20 | void apply_interaction(const dim3& grid_size, const dim3& block_size, 21 | std::size_t shared_mem_size, const cudaStream_t& stream, 22 | const finding_config cfg, 23 | device::apply_interaction_payload payload); 24 | 25 | } // namespace traccc::cuda 26 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/build_tracks.cu: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../../utils/global_index.hpp" 10 | #include "build_tracks.cuh" 11 | 12 | // Project include(s). 13 | #include "traccc/edm/track_parameters.hpp" 14 | #include "traccc/finding/candidate_link.hpp" 15 | #include "traccc/finding/device/build_tracks.hpp" 16 | #include "traccc/finding/finding_config.hpp" 17 | 18 | namespace traccc::cuda::kernels { 19 | 20 | __global__ void build_tracks(bool run_mbf, 21 | device::build_tracks_payload payload) { 22 | 23 | device::build_tracks(details::global_index1(), run_mbf, payload); 24 | } 25 | } // namespace traccc::cuda::kernels 26 | -------------------------------------------------------------------------------- /device/sycl/src/utils/calculate1DimNdRange.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Sycl include(s). 11 | #include 12 | 13 | namespace traccc::sycl::details { 14 | 15 | /// Function that calculates 1 dim nd range for sycl kernel execution 16 | /// 17 | /// @param[in] globalSize The global execution range of the kernel 18 | /// @param[in] localSize Desired Work group size of the kernel 19 | /// @return The 1 dim sycl nd_range object 20 | /// 21 | ::sycl::nd_range<1> calculate1DimNdRange(const std::size_t globalSize, 22 | const std::size_t localSize); 23 | 24 | } // namespace traccc::sycl::details 25 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/performance.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/options/details/interface.hpp" 12 | 13 | namespace traccc::opts { 14 | 15 | /// Command line options used to configure performance measurements 16 | class performance : public interface { 17 | 18 | public: 19 | /// @name Options 20 | /// @{ 21 | 22 | /// Whether to run performance checks 23 | bool run = false; 24 | 25 | /// @} 26 | 27 | /// Constructor 28 | performance(); 29 | 30 | std::unique_ptr as_printable() const override; 31 | }; // struct performance 32 | 33 | } // namespace traccc::opts 34 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/make_measurement_hit_id_reader.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/io/csv/measurement_hit_id.hpp" 12 | 13 | // DFE include(s). 14 | #include 15 | 16 | // System include(s). 17 | #include 18 | 19 | namespace traccc::io::csv { 20 | 21 | /// Set up a reader for measurement<->hit association information 22 | /// 23 | /// @param filename The name of the file to read 24 | /// @return An object that can read the specified CSV file 25 | /// 26 | dfe::NamedTupleCsvReader make_measurement_hit_id_reader( 27 | std::string_view filename); 28 | 29 | } // namespace traccc::io::csv 30 | -------------------------------------------------------------------------------- /core/include/traccc/ambiguity_resolution/ambiguity_resolution_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // System include(s). 11 | #include 12 | #include 13 | 14 | namespace traccc { 15 | 16 | /// Configuration struct for ambiguity resolution 17 | struct ambiguity_resolution_config { 18 | 19 | /// Minimum number of measurement to form a track. 20 | unsigned int min_meas_per_track = 3; 21 | 22 | /// Max iteration to remove the bad tracks 23 | unsigned int max_iterations = std::numeric_limits::max(); 24 | 25 | /// Max shared measurements to break the iteration 26 | unsigned int max_shared_meas = 1; 27 | }; 28 | 29 | } // namespace traccc 30 | -------------------------------------------------------------------------------- /device/cuda/src/clusterization/kernels/reify_cluster_data.cu: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../../utils/thread_id.hpp" 10 | #include "reify_cluster_data.cuh" 11 | 12 | // Project include(s). 13 | #include "traccc/clusterization/device/reify_cluster_data.hpp" 14 | 15 | namespace traccc::cuda::kernels { 16 | __global__ void reify_cluster_data( 17 | vecmem::data::vector_view disjoint_set_view, 18 | traccc::edm::silicon_cluster_collection::view cluster_view) { 19 | 20 | device::reify_cluster_data(details::thread_id1{}.getGlobalThreadId(), 21 | disjoint_set_view, cluster_view); 22 | } 23 | } // namespace traccc::cuda::kernels 24 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/propagate_to_next_surface.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/finding/device/propagate_to_next_surface.hpp" 12 | #include "traccc/finding/finding_config.hpp" 13 | 14 | // CUDA include(s). 15 | #include 16 | 17 | namespace traccc::cuda { 18 | 19 | template 20 | void propagate_to_next_surface( 21 | const dim3& grid_size, const dim3& block_size, std::size_t shared_mem_size, 22 | const cudaStream_t& stream, const finding_config cfg, 23 | device::propagate_to_next_surface_payload payload); 24 | 25 | } // namespace traccc::cuda 26 | -------------------------------------------------------------------------------- /core/include/traccc/geometry/pixel_data.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/definitions/primitives.hpp" 12 | #include "traccc/definitions/qualifiers.hpp" 13 | 14 | namespace traccc { 15 | 16 | /// A very basic pixel segmentation with 17 | /// a minimum corner and ptich x/y 18 | /// 19 | /// No checking on out of bounds done 20 | struct pixel_data { 21 | 22 | scalar min_corner_x = 0.f; 23 | scalar min_corner_y = 0.f; 24 | scalar pitch_x = 1.f; 25 | scalar pitch_y = 1.f; 26 | char dimension = 2; 27 | 28 | TRACCC_HOST_DEVICE 29 | vector2 get_pitch() const { return {pitch_x, pitch_y}; }; 30 | }; 31 | 32 | } // namespace traccc 33 | -------------------------------------------------------------------------------- /core/include/traccc/bfield/impl/construct_const_bfield.ipp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/bfield/magnetic_field_types.hpp" 12 | 13 | // Covfie include(s). 14 | #include 15 | 16 | namespace traccc { 17 | 18 | template 19 | magnetic_field construct_const_bfield(scalar_t x, scalar_t y, scalar_t z) { 20 | 21 | return magnetic_field{::covfie::field>{ 22 | ::covfie::make_parameter_pack( 23 | typename const_bfield_backend_t::configuration_t{x, y, 24 | z})}}; 25 | } 26 | 27 | } // namespace traccc 28 | -------------------------------------------------------------------------------- /device/common/include/traccc/clusterization/device/tags.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::device { 11 | /** 12 | * @defgroup Clustering algorithm cluster retention parameters 13 | * 14 | * Optional parameters to clustering algorithms which convert directly from 15 | * cells to measurements, determining whether to reconstruct the intermediate 16 | * cluster data or not. 17 | * 18 | * @{ 19 | * @brief Explicitly discard cluster information. 20 | */ 21 | struct clustering_discard_disjoint_set {}; 22 | /* 23 | * @brief Explicitly reconstruct and return cluster information. 24 | */ 25 | struct clustering_keep_disjoint_set {}; 26 | /* 27 | * @} 28 | */ 29 | } // namespace traccc::device 30 | -------------------------------------------------------------------------------- /device/common/include/traccc/edm/device/identity_projector.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/definitions/qualifiers.hpp" 12 | 13 | namespace traccc::device { 14 | 15 | /// @brief Identity projector functor 16 | /// 17 | /// This comes in handy when using an SoA collection with some code that was 18 | /// originally designed for AoS collections. 19 | /// 20 | struct identity_projector { 21 | 22 | /// Return the input value unchanged 23 | template 24 | TRACCC_HOST_DEVICE constexpr T operator()(const T& value) const noexcept { 25 | return value; 26 | } 27 | 28 | }; // struct identity_projector 29 | 30 | } // namespace traccc::device 31 | -------------------------------------------------------------------------------- /cmake/FindROOT.cmake: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2023 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # This is a simple wrapper around the ROOTConfig.cmake file that would come 8 | # with a ROOT installation. It serves two purposes: 9 | # - Provides a nice printout about ROOT having been found, which 10 | # ROOTConfig.cmake doesn't do for some reason; 11 | # - Avoids printing scary-looking warnings from CMake when ROOT is 12 | # not found. 13 | 14 | # Look for ROOTConfig.cmake. 15 | find_package( ROOT CONFIG QUIET ) 16 | 17 | # Print a standard output about ROOT (not) having been found. 18 | include( FindPackageHandleStandardArgs ) 19 | find_package_handle_standard_args( ROOT 20 | FOUND_VAR ROOT_FOUND 21 | REQUIRED_VARS ROOT_INCLUDE_DIRS ROOT_LIBRARY_DIR ROOT_BINDIR 22 | VERSION_VAR ROOT_VERSION ) 23 | -------------------------------------------------------------------------------- /device/cuda/src/clusterization/kernels/reify_cluster_data.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/silicon_cluster_collection.hpp" 12 | 13 | // VecMem include(s). 14 | #include 15 | namespace traccc::cuda::kernels { 16 | 17 | /// Fill the cluster collection with the cell indices 18 | /// 19 | /// @param disjoint_set_view The cluster/measurement index of each cell 20 | /// @param cluster_view The collection to fill 21 | /// 22 | __global__ void reify_cluster_data( 23 | vecmem::data::vector_view disjoint_set_view, 24 | traccc::edm::silicon_cluster_collection::view cluster_view); 25 | 26 | } // namespace traccc::cuda::kernels 27 | -------------------------------------------------------------------------------- /examples/run/common/make_magnetic_field.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "make_magnetic_field.hpp" 10 | 11 | // Project include(s). 12 | #include "traccc/bfield/construct_const_bfield.hpp" 13 | #include "traccc/definitions/primitives.hpp" 14 | #include "traccc/io/read_magnetic_field.hpp" 15 | 16 | namespace traccc::details { 17 | 18 | magnetic_field make_magnetic_field(const opts::magnetic_field& opts) { 19 | 20 | if (opts.read_from_file) { 21 | magnetic_field result; 22 | io::read_magnetic_field(result, opts.file, opts.format); 23 | return result; 24 | } else { 25 | return construct_const_bfield({0.f, 0.f, opts.value}); 26 | } 27 | } 28 | 29 | } // namespace traccc::details 30 | -------------------------------------------------------------------------------- /core/include/traccc/utils/type_traits.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::details { 11 | 12 | /// Helper trait for detecting when a type is a non-const version of another 13 | /// 14 | /// This comes into play multiple times to enable certain constructors 15 | /// conditionally through SFINAE. 16 | /// 17 | template 18 | struct is_same_nc { 19 | static constexpr bool value = false; 20 | }; 21 | 22 | template 23 | struct is_same_nc { 24 | static constexpr bool value = true; 25 | }; 26 | 27 | template 28 | struct is_same_nc { 29 | static constexpr bool value = true; 30 | }; 31 | 32 | } // namespace traccc::details 33 | -------------------------------------------------------------------------------- /device/cuda/src/utils/opaque_stream.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // CUDA include(s). 11 | #include 12 | 13 | namespace traccc::cuda::details { 14 | 15 | /// RAII wrapper around @c cudaStream_t 16 | /// 17 | /// It is used only internally by the CUDA library, so it does not need to 18 | /// provide any nice interface. 19 | /// 20 | struct opaque_stream { 21 | 22 | /// Default constructor 23 | opaque_stream(int device); 24 | /// Destructor 25 | ~opaque_stream(); 26 | 27 | /// Device that the stream is associated to 28 | int m_device; 29 | /// Stream managed by the object 30 | cudaStream_t m_stream; 31 | 32 | }; // class opaque_stream 33 | 34 | } // namespace traccc::cuda::details 35 | -------------------------------------------------------------------------------- /device/sycl/include/traccc/sycl/utils/make_magnetic_field.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/sycl/utils/queue_wrapper.hpp" 12 | 13 | // Project include(s). 14 | #include "traccc/bfield/magnetic_field.hpp" 15 | 16 | namespace traccc::sycl { 17 | 18 | /// Create a magnetic field usable on the selected SYCL device 19 | /// 20 | /// @param bfield The magnetic field to be copied 21 | /// @param queue The SYCL queue to use for the operation 22 | /// @return A copy of the magnetic field that can be used on the selected SYCL 23 | /// device 24 | /// 25 | magnetic_field make_magnetic_field(const magnetic_field& bfield, 26 | queue_wrapper& queue); 27 | 28 | } // namespace traccc::sycl 29 | -------------------------------------------------------------------------------- /device/cuda/src/finding/combinatorial_kalman_filter_algorithm.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/cuda/finding/combinatorial_kalman_filter_algorithm.hpp" 10 | 11 | #include "../utils/magnetic_field_types.hpp" 12 | #include "../utils/utils.hpp" 13 | 14 | namespace traccc::cuda { 15 | 16 | combinatorial_kalman_filter_algorithm::combinatorial_kalman_filter_algorithm( 17 | const config_type& config, const traccc::memory_resource& mr, 18 | vecmem::copy& copy, stream& str, std::unique_ptr logger) 19 | : messaging(std::move(logger)), 20 | m_config{config}, 21 | m_mr{mr}, 22 | m_copy{copy}, 23 | m_stream{str}, 24 | m_warp_size(details::get_warp_size(str.device())) {} 25 | 26 | } // namespace traccc::cuda 27 | -------------------------------------------------------------------------------- /performance/include/traccc/utils/helpers.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // System include(s). 11 | #include 12 | #include 13 | 14 | namespace traccc::plot_helpers { 15 | 16 | /// @brief Nested binning struct for booking plots 17 | struct binning { 18 | 19 | /// Constructor with default arguments 20 | binning(std::string_view b_title = "", int bins = 0, float b_min = 0.f, 21 | float b_max = 0.f) 22 | : title(b_title), n_bins(bins), min(b_min), max(b_max) {} 23 | 24 | std::string title; ///< title to be displayed 25 | int n_bins; ///< number of bins 26 | float min; ///< minimum value 27 | float max; ///< maximum value 28 | }; 29 | 30 | } // namespace traccc::plot_helpers 31 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/seed_matching.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "traccc/definitions/common.hpp" 13 | #include "traccc/options/details/config_provider.hpp" 14 | #include "traccc/options/details/interface.hpp" 15 | #include "traccc/utils/seed_matching_config.hpp" 16 | 17 | namespace traccc::opts { 18 | class seed_matching : public interface, 19 | public config_provider { 20 | 21 | public: 22 | float m_matching_ratio = 0.5f; 23 | 24 | seed_matching(); 25 | 26 | operator seed_matching_config() const override; 27 | 28 | std::unique_ptr as_printable() const override; 29 | }; 30 | } // namespace traccc::opts 31 | -------------------------------------------------------------------------------- /io/src/obj/write_seeds.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/seed_collection.hpp" 12 | #include "traccc/edm/spacepoint_collection.hpp" 13 | 14 | // System include(s). 15 | #include 16 | 17 | namespace traccc::io::obj { 18 | 19 | /// Write a seed collection into a Wavefront OBJ file. 20 | /// 21 | /// @param filename is the name of the output file 22 | /// @param seeds is the seed collection to write 23 | /// @param spacepoints is the spacepoint collection that the seeds reference 24 | /// 25 | void write_seeds(std::string_view filename, 26 | edm::seed_collection::const_view seeds, 27 | edm::spacepoint_collection::const_view spacepoints); 28 | 29 | } // namespace traccc::io::obj 30 | -------------------------------------------------------------------------------- /device/cuda/src/utils/cuda_error_handling.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "cuda_error_handling.hpp" 10 | 11 | // System include(s). 12 | #include 13 | #include 14 | #include 15 | 16 | namespace traccc::cuda::details { 17 | 18 | void throw_error(cudaError_t errorCode, const char* expression, 19 | const char* file, int line) { 20 | 21 | // Create a nice error message. 22 | std::ostringstream errorMsg; 23 | errorMsg << file << ":" << line << " Failed to execute: " << expression 24 | << " (" << cudaGetErrorString(errorCode) << ")"; 25 | 26 | // Now throw a runtime error with this message. 27 | throw std::runtime_error(errorMsg.str()); 28 | } 29 | 30 | } // namespace traccc::cuda::details 31 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/logging.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "traccc/options/details/config_provider.hpp" 13 | #include "traccc/options/details/interface.hpp" 14 | #include "traccc/utils/logging.hpp" 15 | 16 | namespace traccc::opts { 17 | 18 | /// Options for logging 19 | class logging : public interface, 20 | public config_provider { 21 | public: 22 | logging(); 23 | 24 | virtual operator traccc::Logging::Level() const override; 25 | 26 | std::unique_ptr as_printable() const override; 27 | 28 | private: 29 | int m_verbosity_incr = 0; 30 | int m_verbosity_decr = 0; 31 | }; // class output_data 32 | 33 | } // namespace traccc::opts 34 | -------------------------------------------------------------------------------- /io/include/traccc/io/read_digitization_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/io/data_format.hpp" 12 | 13 | // Project include(s). 14 | #include "traccc/io/digitization_config.hpp" 15 | 16 | // System include(s). 17 | #include 18 | 19 | namespace traccc::io { 20 | 21 | /// Read the detector digitization configuration from an input file 22 | /// 23 | /// @param filename The name of the file to read the data from 24 | /// @param format The format of the input file 25 | /// @return An object describing the digitization configuration of the 26 | /// detector 27 | /// 28 | digitization_config read_digitization_config( 29 | std::string_view filename, data_format format = data_format::json); 30 | 31 | } // namespace traccc::io 32 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/accelerator.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/options/details/interface.hpp" 12 | 13 | namespace traccc::opts { 14 | 15 | /// Option(s) for accelerator usage 16 | class accelerator : public interface { 17 | 18 | public: 19 | /// @name Options 20 | /// @{ 21 | 22 | /// Whether to compare the accelerator code's output with that of the CPU 23 | bool compare_with_cpu = false; 24 | /// Whether GPU texture memory should be used 25 | bool use_gpu_texture_memory = false; 26 | 27 | /// @} 28 | 29 | /// Constructor 30 | accelerator(); 31 | 32 | std::unique_ptr as_printable() const override; 33 | }; // struct accelerator 34 | 35 | } // namespace traccc::opts 36 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/cell.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // DFE include(s). 11 | #include 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::io::csv { 17 | 18 | /// Type used in reading CSV data into memory 19 | struct cell { 20 | 21 | uint64_t geometry_id = 0; 22 | uint64_t measurement_id = 0; 23 | uint32_t channel0 = 0; 24 | uint32_t channel1 = 0; 25 | float timestamp = 0.f; 26 | float value = 0.f; 27 | 28 | auto operator<=>(const cell& other) const = default; 29 | 30 | // geometry_id,measurement_id,channel0,channel1,timestamp,value 31 | DFE_NAMEDTUPLE(cell, geometry_id, measurement_id, channel0, channel1, 32 | timestamp, value); 33 | }; 34 | 35 | } // namespace traccc::io::csv 36 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/particle.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // DFE include(s). 11 | #include 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::io::csv { 17 | 18 | /// Type used in reading CSV particle data into memory 19 | struct particle { 20 | 21 | uint64_t particle_id = 0; 22 | int particle_type = 0; 23 | int process = 0; 24 | float vx = 0.f; 25 | float vy = 0.f; 26 | float vz = 0.f; 27 | float vt = 0.f; 28 | float px = 0.f; 29 | float py = 0.f; 30 | float pz = 0.f; 31 | float m = 0.f; 32 | float q = 0.f; 33 | 34 | DFE_NAMEDTUPLE(particle, particle_id, particle_type, process, vx, vy, vz, 35 | vt, px, py, pz, m, q); 36 | }; 37 | 38 | } // namespace traccc::io::csv 39 | -------------------------------------------------------------------------------- /device/common/include/traccc/ambiguity_resolution/device/sort_tracks_per_measurement.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/definitions/primitives.hpp" 12 | 13 | // VecMem include(s). 14 | #include 15 | #include 16 | 17 | // System include(s). 18 | #include 19 | 20 | namespace traccc::device { 21 | 22 | /// (Event Data) Payload for the @c traccc::device::sort_tracks_per_measurement 23 | /// function 24 | struct sort_tracks_per_measurement_payload { 25 | 26 | /** 27 | * @brief View object to the tracks per measurement 28 | */ 29 | vecmem::data::jagged_vector_view tracks_per_measurement_view; 30 | }; 31 | 32 | } // namespace traccc::device 33 | -------------------------------------------------------------------------------- /examples/run/common/throughput_mt.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // System include(s). 11 | #include 12 | 13 | namespace traccc { 14 | 15 | /// Helper function running a multi-threaded throughput test 16 | /// 17 | /// @tparam FULL_CHAIN_ALG The type of the full chain algorithm to use 18 | /// 19 | /// @param description A short description of the application 20 | /// @param argc The count of command line arguments (from @c main(...)) 21 | /// @param argv The command line arguments (from @c main(...)) 22 | /// 23 | /// @return The value to be returned from @c main(...) 24 | /// 25 | template 26 | int throughput_mt(std::string_view description, int argc, char* argv[]); 27 | 28 | } // namespace traccc 29 | 30 | // Local include(s). 31 | #include "throughput_mt.ipp" 32 | -------------------------------------------------------------------------------- /examples/run/common/throughput_st.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // System include(s). 11 | #include 12 | 13 | namespace traccc { 14 | 15 | /// Helper function running a single-threaded throughput test 16 | /// 17 | /// @tparam FULL_CHAIN_ALG The type of the full chain algorithm to use 18 | /// 19 | /// @param description A short description of the application 20 | /// @param argc The count of command line arguments (from @c main(...)) 21 | /// @param argv The command line arguments (from @c main(...)) 22 | /// 23 | /// @return The value to be returned from @c main(...) 24 | /// 25 | template 26 | int throughput_st(std::string_view description, int argc, char* argv[]); 27 | 28 | } // namespace traccc 29 | 30 | // Local include(s). 31 | #include "throughput_st.ipp" 32 | -------------------------------------------------------------------------------- /core/include/traccc/edm/impl/track_collection.ipp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::edm { 11 | 12 | template 13 | TRACCC_HOST_DEVICE void track::reset_quality() { 14 | 15 | ndf() = {}; 16 | chi2() = {}; 17 | pval() = {}; 18 | nholes() = {}; 19 | } 20 | 21 | template 22 | template 23 | TRACCC_HOST_DEVICE bool track::operator==(const track& other) const { 24 | 25 | return ((fit_outcome() == other.fit_outcome()) && 26 | (params() == other.params()) && (ndf() == other.ndf()) && 27 | (chi2() == other.chi2()) && (pval() == other.pval()) && 28 | (nholes() == other.nholes()) && 29 | (constituent_links() == other.constituent_links())); 30 | } 31 | 32 | } // namespace traccc::edm 33 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/track_matching.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "traccc/definitions/common.hpp" 13 | #include "traccc/options/details/config_provider.hpp" 14 | #include "traccc/options/details/interface.hpp" 15 | #include "traccc/utils/track_matching_config.hpp" 16 | 17 | namespace traccc::opts { 18 | class track_matching : public interface, 19 | public config_provider { 20 | 21 | public: 22 | float m_matching_ratio = 0.5f; 23 | bool m_double_matching = true; 24 | 25 | track_matching(); 26 | 27 | operator track_matching_config() const override; 28 | 29 | std::unique_ptr as_printable() const override; 30 | }; 31 | } // namespace traccc::opts 32 | -------------------------------------------------------------------------------- /extras/ccl_generator/README.md: -------------------------------------------------------------------------------- 1 | # CCL data generator 2 | 3 | This little Python tool is designed to generate example data for connected 4 | component analysis and labeling problems. While the data generated from this 5 | tool is not meaningful from a physics perspective, it exposes the most 6 | important parameters from a computational performance point of view. 7 | 8 | The configurable parameters are as follows: 9 | 10 | * Number of detector modules 11 | * Size of each detector module (assumed to be square) 12 | * Mean hits per module 13 | * Variance of hits per module 14 | * Mean cells per hit 15 | * Variance of cells per hit 16 | 17 | ## Generating test files 18 | 19 | An example run of this program looks like this: 20 | 21 | ``` 22 | $ python3 ccl_generator.py -N 1000 -S 5000 --Mm 1.65 --Ms 0.95 --Hm 1.8 --Hs 0.89 -C 100 -o my_run 23 | ``` 24 | 25 | This will generate one hundred files, in the format `my_run_0000000000.csv` and 26 | so on. The files should in a CSV format readably by traccc. 27 | -------------------------------------------------------------------------------- /io/src/data_format.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/io/data_format.hpp" 10 | 11 | // System include(s). 12 | #include 13 | 14 | namespace traccc { 15 | 16 | std::ostream& operator<<(std::ostream& out, data_format format) { 17 | 18 | switch (format) { 19 | case data_format::csv: 20 | out << "csv"; 21 | break; 22 | case data_format::binary: 23 | out << "binary"; 24 | break; 25 | case data_format::json: 26 | out << "json"; 27 | break; 28 | case data_format::obj: 29 | out << "wavefront obj"; 30 | break; 31 | default: 32 | out << "?!?unknown?!?"; 33 | break; 34 | } 35 | return out; 36 | } 37 | 38 | } // namespace traccc 39 | -------------------------------------------------------------------------------- /device/cuda/src/fitting/kernels/fill_fitting_sort_keys.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/device/sort_key.hpp" 12 | #include "traccc/edm/track_collection.hpp" 13 | 14 | // CUDA include(s). 15 | #include 16 | 17 | // VecMem include(s). 18 | #include 19 | 20 | namespace traccc::cuda { 21 | 22 | /// Function calling a kernel for @c traccc::device::fill_fitting_sort_keys 23 | void fill_fitting_sort_keys( 24 | const dim3& grid_size, const dim3& block_size, cudaStream_t stream, 25 | edm::track_collection::const_view track_candidates_view, 26 | vecmem::data::vector_view keys_view, 27 | vecmem::data::vector_view ids_view); 28 | 29 | } // namespace traccc::cuda 30 | -------------------------------------------------------------------------------- /io/src/obj/write_tracks.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/track_container.hpp" 12 | #include "traccc/geometry/detector.hpp" 13 | #include "traccc/geometry/host_detector.hpp" 14 | 15 | // System include(s). 16 | #include 17 | 18 | namespace traccc::io::obj { 19 | 20 | /// Write a track candidate container into a Wavefront OBJ file. 21 | /// 22 | /// @param filename is the name of the output file 23 | /// @param tracks is the track container to write 24 | /// @param detector is the Detray detector describing the geometry 25 | /// 26 | void write_tracks(std::string_view filename, 27 | edm::track_container::const_view tracks, 28 | const traccc::host_detector& detector); 29 | 30 | } // namespace traccc::io::obj 31 | -------------------------------------------------------------------------------- /.github/ci_setup.sh: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2022-2024 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | # 7 | # This script is meant to configure the build/runtime environment of the 8 | # Docker contaners that are used in the project's CI configuration. 9 | # 10 | # Usage: source .github/ci_setup.sh 11 | # 12 | 13 | # The platform name. 14 | PLATFORM_NAME=$1 15 | 16 | # Make sure that the build and CTest would use all available cores. 17 | export CMAKE_BUILD_PARALLEL_LEVEL=`nproc` 18 | export CTEST_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} 19 | export MAKEFLAGS="-j${CMAKE_BUILD_PARALLEL_LEVEL}" 20 | 21 | # Set up the correct environment for the SYCL tests. 22 | if [[ "${PLATFORM_NAME}" == *"SYCL"* ]]; then 23 | if [ -f "/opt/intel/oneapi/setvars.sh" ]; then 24 | OLD_CPATH=${CPATH} 25 | source /opt/intel/oneapi/setvars.sh --include-intel-llvm 26 | export CPATH=${OLD_CPATH} 27 | fi 28 | fi 29 | -------------------------------------------------------------------------------- /device/common/include/traccc/ambiguity_resolution/device/fill_unique_meas_id_map.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/definitions/primitives.hpp" 12 | 13 | // VecMem include(s). 14 | #include 15 | 16 | namespace traccc::device { 17 | 18 | /// (Event Data) Payload for the @c traccc::device::fill_unique_meas_id_map 19 | /// function 20 | struct fill_unique_meas_id_map_payload { 21 | 22 | /** 23 | * @brief View object to the unique measurement ids 24 | */ 25 | vecmem::data::vector_view unique_meas_view; 26 | 27 | /** 28 | * @brief View object to the meas id to unique id map 29 | */ 30 | vecmem::data::vector_view meas_id_to_unique_id_view; 31 | }; 32 | 33 | } // namespace traccc::device 34 | -------------------------------------------------------------------------------- /tests/common/tests/ckf_telescope_test.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "kalman_fitting_telescope_test.hpp" 12 | 13 | namespace traccc { 14 | 15 | /// Combinatorial Kalman Finding Test with Sparse tracks 16 | class CkfSparseTrackTelescopeTests : public KalmanFittingTelescopeTests {}; 17 | 18 | /// Combinatorial Kalman Finding Test with Identical tracks 19 | class CkfCombinatoricsTelescopeTests : public KalmanFittingTelescopeTests {}; 20 | 21 | /// Combinatorial Kalman Finding Test with Identical tracks (CPU) 22 | class CpuCkfCombinatoricsTelescopeTests 23 | : public CkfCombinatoricsTelescopeTests {}; 24 | 25 | /// Combinatorial Kalman Finding Test with Identical tracks (CUDA) 26 | class CudaCkfCombinatoricsTelescopeTests 27 | : public CkfCombinatoricsTelescopeTests {}; 28 | 29 | } // namespace traccc 30 | -------------------------------------------------------------------------------- /extern/vecmem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # CMake include(s). 8 | cmake_minimum_required( VERSION 3.25 ) 9 | include( FetchContent ) 10 | 11 | # Tell the user what's happening. 12 | message( STATUS "Building VecMem as part of the TRACCC project" ) 13 | 14 | # Declare where to get VecMem from. 15 | set( TRACCC_VECMEM_SOURCE 16 | "URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.21.0.tar.gz;URL_MD5;4a02195eef26491b9b196d1945c1c594" 17 | CACHE STRING "Source for VecMem, when built as part of this project" ) 18 | mark_as_advanced( TRACCC_VECMEM_SOURCE ) 19 | FetchContent_Declare( VecMem SYSTEM ${TRACCC_VECMEM_SOURCE} ) 20 | 21 | # Options used in the build of VecMem. 22 | set( VECMEM_BUILD_TESTING FALSE CACHE BOOL 23 | "Turn off the build of the VecMem unit tests" ) 24 | 25 | # Get it into the current directory. 26 | FetchContent_MakeAvailable( VecMem ) 27 | -------------------------------------------------------------------------------- /core/include/traccc/utils/relations.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * traccc library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2024 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | // Project include(s). 12 | #include "traccc/definitions/qualifiers.hpp" 13 | #include "traccc/edm/silicon_cell_collection.hpp" 14 | 15 | namespace traccc { 16 | struct [[maybe_unused]] channel0_major_cell_order_relation { 17 | template 18 | [[maybe_unused]] TRACCC_HOST_DEVICE bool operator()( 19 | const edm::silicon_cell& a, const edm::silicon_cell& b) const { 20 | if (a.module_index() == b.module_index()) { 21 | if (a.channel1() == b.channel1()) { 22 | return a.channel0() <= b.channel0(); 23 | } else { 24 | return a.channel1() <= b.channel1(); 25 | } 26 | } else { 27 | return true; 28 | } 29 | } 30 | }; 31 | } // namespace traccc 32 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/surface.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // DFE include(s). 11 | #include 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::io::csv { 17 | 18 | /// Type to read information into about the detector modules/surfaces 19 | struct surface { 20 | 21 | uint64_t geometry_id = 0; 22 | float cx = 0.f, cy = 0.f, cz = 0.f; 23 | float rot_xu = 0.f, rot_xv = 0.f, rot_xw = 0.f; 24 | float rot_yu = 0.f, rot_yv = 0.f, rot_yw = 0.f; 25 | float rot_zu = 0.f, rot_zv = 0.f, rot_zw = 0.f; 26 | 27 | // geometry_id,hit_id,channel0,channel1,timestamp,value 28 | DFE_NAMEDTUPLE(surface, geometry_id, cx, cy, cz, rot_xu, rot_xv, rot_xw, 29 | rot_yu, rot_yv, rot_yw, rot_zu, rot_zv, rot_zw); 30 | 31 | }; // struct surface 32 | 33 | } // namespace traccc::io::csv 34 | -------------------------------------------------------------------------------- /device/common/include/traccc/clusterization/device/impl/reify_cluster_data.ipp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::device { 11 | 12 | TRACCC_HOST_DEVICE inline void reify_cluster_data( 13 | global_index_t thread_id, 14 | vecmem::data::vector_view disjoint_set_view, 15 | traccc::edm::silicon_cluster_collection::view cluster_view) { 16 | 17 | // Create the device objects. 18 | const vecmem::device_vector disjoint_set( 19 | disjoint_set_view); 20 | traccc::edm::silicon_cluster_collection::device clusters(cluster_view); 21 | 22 | // Fill the output container. 23 | if (thread_id < disjoint_set.size()) { 24 | clusters.cell_indices() 25 | .at(disjoint_set.at(thread_id)) 26 | .push_back(thread_id); 27 | } 28 | } 29 | 30 | } // namespace traccc::device 31 | -------------------------------------------------------------------------------- /device/common/include/traccc/edm/device/device_doublet.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/container.hpp" 12 | #include "traccc/edm/device/doublet_counter.hpp" 13 | #include "traccc/seeding/detail/singlet.hpp" 14 | 15 | namespace traccc::device { 16 | 17 | /// Doublet of middle-bottom or middle-top spacepoints 18 | struct device_doublet { 19 | /// bottom (or top) spacepoint location in internal spacepoint container 20 | sp_location sp2; 21 | 22 | using link_type = 23 | device::doublet_counter_collection_types::device::size_type; 24 | /// Link to doublet counter where the middle spacepoint is stored 25 | link_type counter_link; 26 | }; 27 | 28 | /// Declare all device doublet collection types 29 | using device_doublet_collection_types = collection_types; 30 | 31 | } // namespace traccc::device 32 | -------------------------------------------------------------------------------- /io/src/read_digitization_config.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/io/read_digitization_config.hpp" 10 | 11 | #include "json/read_digitization_config.hpp" 12 | #include "traccc/io/utils.hpp" 13 | 14 | // System include(s). 15 | #include 16 | 17 | namespace traccc::io { 18 | 19 | digitization_config read_digitization_config(std::string_view filename, 20 | data_format format) { 21 | 22 | // Construct the full filename. 23 | std::string full_filename = get_absolute_path(filename); 24 | 25 | // Decide how to read the file. 26 | switch (format) { 27 | case data_format::json: 28 | return json::read_digitization_config(full_filename); 29 | default: 30 | throw std::invalid_argument("Unsupported data format"); 31 | } 32 | } 33 | 34 | } // namespace traccc::io 35 | -------------------------------------------------------------------------------- /performance/src/efficiency/track_filter.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | namespace traccc { 14 | simple_charged_eta_pt_cut::simple_charged_eta_pt_cut(scalar eta, scalar pt) 15 | : m_eta(eta), m_pT(pt) {} 16 | 17 | std::string simple_charged_eta_pt_cut::get_name() const { 18 | char buffer[512]; 19 | snprintf(buffer, 512, "Charged with |η| ≤ %.2f and pT ≥ %.3f GeV", m_eta, 20 | m_pT); 21 | return std::string(buffer); 22 | } 23 | 24 | bool simple_charged_eta_pt_cut::operator()(const particle& p) const { 25 | const scalar eta = vector::eta(p.momentum); 26 | const scalar pT = vector::perp(p.momentum); 27 | 28 | return p.charge != 0 && std::abs(eta) <= m_eta && pT >= m_pT; 29 | } 30 | } // namespace traccc 31 | -------------------------------------------------------------------------------- /examples/options/src/performance.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/options/performance.hpp" 10 | 11 | #include "traccc/examples/utils/printable.hpp" 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::opts { 17 | 18 | performance::performance() : interface("Performance Measurement Options") { 19 | 20 | m_desc.add_options()("check-performance", 21 | boost::program_options::bool_switch(&run), 22 | "Run performance checks"); 23 | } 24 | 25 | std::unique_ptr performance::as_printable() const { 26 | auto cat = std::make_unique(m_description); 27 | 28 | cat->add_child(std::make_unique( 29 | "Run performance checks", std::format("{}", run))); 30 | 31 | return cat; 32 | } 33 | } // namespace traccc::opts 34 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/hit.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // DFE include(s). 11 | #include 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::io::csv { 17 | 18 | /// Type to read information into about Fatras hits 19 | struct hit { 20 | 21 | uint64_t particle_id = 0; 22 | uint64_t geometry_id = 0; 23 | float tx = 0; 24 | float ty = 0; 25 | float tz = 0; 26 | float tt = 0; 27 | float tpx = 0; 28 | float tpy = 0; 29 | float tpz = 0; 30 | float te = 0; 31 | float deltapx = 0; 32 | float deltapy = 0; 33 | float deltapz = 0; 34 | float deltae = 0; 35 | uint64_t index = 0; 36 | 37 | DFE_NAMEDTUPLE(hit, particle_id, geometry_id, tx, ty, tz, tt, tpx, tpy, tpz, 38 | te, deltapx, deltapy, deltapz, deltae, index); 39 | }; 40 | 41 | } // namespace traccc::io::csv 42 | -------------------------------------------------------------------------------- /performance/include/traccc/performance/details/is_same_scalar.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Library include(s). 11 | #include "traccc/definitions/common.hpp" 12 | #include "traccc/definitions/primitives.hpp" 13 | 14 | namespace traccc::details { 15 | 16 | /// Comparison of scalars, used in algorithmic code validation 17 | /// 18 | /// This helper function can be used to decide if two scalar values are "the 19 | /// same" within some specific uncertainty. 20 | /// 21 | /// @param lhs The Left Hand Side of the comparison 22 | /// @param rhs The Right Hand Side of the comparison 23 | /// @param unc The uncertainty percentage expressed in the 0.0-1.0 range 24 | /// @return @c true if the two values are "the same" within uncertainty, 25 | /// @c false otherwise 26 | /// 27 | bool is_same_scalar(scalar lhs, scalar rhs, scalar unc = float_epsilon); 28 | 29 | } // namespace traccc::details 30 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/gather_measurement_votes.cuh: -------------------------------------------------------------------------------- 1 | /** traccc library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | #include "traccc/definitions/common.hpp" 12 | #include "traccc/device/array_insertion_mutex.hpp" 13 | #include "traccc/edm/measurement_collection.hpp" 14 | #include "traccc/finding/candidate_link.hpp" 15 | #include "traccc/finding/finding_config.hpp" 16 | #include "traccc/utils/prob.hpp" 17 | 18 | namespace traccc::cuda::kernels { 19 | 20 | __global__ void gather_measurement_votes( 21 | const vecmem::data::vector_view 22 | insertion_mutex_view, 23 | const vecmem::data::vector_view tip_index_view, 24 | vecmem::data::vector_view votes_per_tip_view, 25 | const unsigned int max_num_tracks_per_measurement); 26 | 27 | } // namespace traccc::cuda::kernels 28 | -------------------------------------------------------------------------------- /tests/sycl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2022-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | include(traccc-compiler-options-sycl) 8 | 9 | enable_language(SYCL) 10 | 11 | traccc_add_test( 12 | sycl 13 | 14 | test_kalman_fitter_telescope.cpp 15 | test_ckf_combinatorics_telescope.cpp 16 | test_ckf_toy_detector.cpp 17 | test_clusterization.cpp 18 | test_dpl.sycl 19 | test_spacepoint_formation.cpp 20 | test_barrier.sycl 21 | test_mutex.sycl 22 | test_unique_lock.sycl 23 | test_cca.cpp 24 | test_sanity_contiguous_on.sycl 25 | test_sanity_ordered_on.sycl 26 | test_sort.sycl 27 | 28 | LINK_LIBRARIES 29 | GTest::gtest_main 30 | vecmem::sycl 31 | detray::core 32 | detray::io 33 | detray::test_common 34 | traccc::core 35 | traccc::device_common 36 | traccc::sycl 37 | traccc::performance 38 | traccc::io 39 | traccc::simulation 40 | traccc_tests_common 41 | oneDPL 42 | ) 43 | -------------------------------------------------------------------------------- /extern/dpl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2024-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # CMake include(s). 8 | cmake_minimum_required( VERSION 3.25 ) 9 | include( FetchContent ) 10 | 11 | # Tell the user what's happening. 12 | message( STATUS "Building oneDPL as part of the TRACCC project" ) 13 | 14 | # Declare where to get DPL from. 15 | set( TRACCC_DPL_SOURCE 16 | "URL;https://github.com/oneapi-src/oneDPL/archive/refs/tags/oneDPL-2022.7.1-release.tar.gz;URL_MD5;21d45dc27ba3133bfb282ec7383177f4" 17 | CACHE STRING "Source for DPL, when built as part of this project" ) 18 | mark_as_advanced( TRACCC_DPL_SOURCE ) 19 | # Must not use SYSTEM here, as the oneAPI compiler then ignores this version 20 | # of oneDPL. 21 | FetchContent_Declare( DPL ${TRACCC_DPL_SOURCE} ) 22 | 23 | # Set the default oneDPL threading backend. 24 | set( ONEDPL_BACKEND "dpcpp" CACHE STRING "oneDPL threading backend" ) 25 | 26 | # Get it into the current directory. 27 | FetchContent_MakeAvailable( DPL ) 28 | -------------------------------------------------------------------------------- /performance/src/performance/throughput.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "traccc/performance/throughput.hpp" 10 | 11 | // System include(s). 12 | #include 13 | #include 14 | #include 15 | 16 | namespace traccc::performance { 17 | 18 | throughput::throughput(std::size_t events, const timing_info& ti, 19 | std::string_view timer_name) 20 | : m_timer_name(timer_name) { 21 | 22 | auto totalTime = ti.get_time(timer_name); 23 | m_perEvent = (totalTime / static_cast(events)).count() * 1e-6; 24 | m_perSecond = 1000. / m_perEvent; 25 | } 26 | 27 | std::ostream& operator<<(std::ostream& out, const throughput& thr) { 28 | 29 | out << std::setw(30) << std::right << thr.m_timer_name << " " 30 | << thr.m_perEvent << " ms/event, " << thr.m_perSecond << " events/s"; 31 | return out; 32 | } 33 | 34 | } // namespace traccc::performance 35 | -------------------------------------------------------------------------------- /examples/run/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Project include(s). 8 | include( traccc-compiler-options-cpp ) 9 | 10 | # Create the common library. 11 | add_library(traccc_examples_common STATIC 12 | "common/make_magnetic_field.hpp" 13 | "common/make_magnetic_field.cpp" 14 | "common/print_fitted_tracks_statistics.hpp" 15 | "common/print_fitted_tracks_statistics.cpp" 16 | "common/throughput_mt.hpp" 17 | "common/throughput_mt.ipp" 18 | "common/throughput_st.hpp" 19 | "common/throughput_st.ipp") 20 | target_link_libraries(traccc_examples_common 21 | PUBLIC traccc::core traccc::options 22 | PRIVATE traccc::io) 23 | 24 | # Add all the subdirectories that can be built. 25 | add_subdirectory(cpu) 26 | 27 | if (TRACCC_BUILD_CUDA) 28 | add_subdirectory(cuda) 29 | endif() 30 | 31 | if (TRACCC_BUILD_SYCL) 32 | add_subdirectory(sycl) 33 | endif() 34 | 35 | if (TRACCC_BUILD_ALPAKA) 36 | add_subdirectory(alpaka) 37 | endif() 38 | -------------------------------------------------------------------------------- /.github/check_taboos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [ -x "$(command -v rg)" ]; then 4 | GREP="grep -R" 5 | else 6 | GREP="rg -j 1 --no-heading -N" 7 | fi 8 | 9 | INPUT="$@" 10 | 11 | INPUT_EX_THIS_FILE=${INPUT[@]/".github/check_taboos.sh"} 12 | 13 | UNIT_CONSTANT_EXCUDE_FILE="core/include/traccc/definitions/common.hpp" 14 | INPUT_EX_UNIT_CONSTANT=${INPUT_EX_THIS_FILE[@]/$UNIT_CONSTANT_EXCUDE_FILE} 15 | 16 | ${GREP} "detray::unit" ${INPUT_EX_UNIT_CONSTANT[@]} ; test $? -eq 1 || exit 1 17 | ${GREP} "detray::constant" ${INPUT_EX_UNIT_CONSTANT[@]} ; test $? -eq 1 || exit 1 18 | 19 | TRACK_PARAMS_EXCLUDE_FILE="core/include/traccc/edm/track_parameters.hpp" 20 | INPUT_EX_TRACK_PARAMS=${INPUT_EX_THIS_FILE[@]/$TRACK_PARAMS_EXCLUDE_FILE} 21 | 22 | ${GREP} "detray::free_track_parameters" ${INPUT_EX_TRACK_PARAMS[@]} ; test $? -eq 1 || exit 1 23 | ${GREP} "detray::bound_track_parameters" ${INPUT_EX_TRACK_PARAMS[@]} ; test $? -eq 1 || exit 1 24 | ${GREP} "detray::bound_vector" ${INPUT_EX_TRACK_PARAMS[@]} ; test $? -eq 1 || exit 1 25 | ${GREP} "detray::bound_matrix" ${INPUT_EX_TRACK_PARAMS[@]} ; test $? -eq 1 || exit 1 26 | -------------------------------------------------------------------------------- /extern/acts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # CMake include(s). 8 | cmake_minimum_required( VERSION 3.25 ) 9 | include( FetchContent ) 10 | 11 | # Tell the user what's happening. 12 | message( STATUS "Building Acts as part of the TRACCC project" ) 13 | 14 | # Declare where to get Acts from. 15 | set( TRACCC_ACTS_SOURCE 16 | "URL;https://github.com/acts-project/acts/archive/refs/tags/v44.0.1.tar.gz;URL_MD5;3c1b1073d5c0e535def2661c81efa1e6" 17 | CACHE STRING "Source for Acts, when built as part of this project" ) 18 | mark_as_advanced( TRACCC_ACTS_SOURCE ) 19 | FetchContent_Declare( Acts SYSTEM ${TRACCC_ACTS_SOURCE} ) 20 | 21 | # Options used in the build of Acts. 22 | set( ACTS_SETUP_EIGEN3 FALSE CACHE BOOL 23 | "Do not set up Eigen in the Acts code, we do it in this project" ) 24 | set( ACTS_BUILD_PLUGIN_JSON TRUE CACHE BOOL 25 | "Build JSON plugin in Acts" ) 26 | 27 | # Get it into the current directory. 28 | FetchContent_MakeAvailable( Acts ) 29 | -------------------------------------------------------------------------------- /core/include/traccc/seeding/detail/singlet.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "traccc/definitions/qualifiers.hpp" 11 | #include "traccc/edm/container.hpp" 12 | 13 | namespace traccc { 14 | 15 | /// location of spacepoint in internal spacepoint container 16 | struct sp_location { 17 | /// index of the bin of the spacepoint grid 18 | unsigned int bin_idx; 19 | /// index of the spacepoint in the bin 20 | unsigned int sp_idx; 21 | }; 22 | 23 | inline TRACCC_HOST_DEVICE bool operator==(const sp_location& lhs, 24 | const sp_location& rhs) { 25 | return (lhs.bin_idx == rhs.bin_idx && lhs.sp_idx == rhs.sp_idx); 26 | } 27 | 28 | inline TRACCC_HOST_DEVICE bool operator!=(const sp_location& lhs, 29 | const sp_location& rhs) { 30 | return (lhs.bin_idx != rhs.bin_idx || lhs.sp_idx != rhs.sp_idx); 31 | } 32 | 33 | } // namespace traccc 34 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/update_tip_length_buffer.cuh: -------------------------------------------------------------------------------- 1 | /** traccc library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | #include "traccc/definitions/common.hpp" 12 | #include "traccc/device/array_insertion_mutex.hpp" 13 | #include "traccc/edm/measurement_collection.hpp" 14 | #include "traccc/finding/candidate_link.hpp" 15 | #include "traccc/finding/finding_config.hpp" 16 | #include "traccc/utils/prob.hpp" 17 | 18 | namespace traccc::cuda::kernels { 19 | 20 | __global__ void update_tip_length_buffer( 21 | const vecmem::data::vector_view old_tip_length_view, 22 | vecmem::data::vector_view new_tip_length_view, 23 | const vecmem::data::vector_view measurement_votes_view, 24 | unsigned int* tip_to_output_map, unsigned int* tip_to_output_map_idx, 25 | float min_measurement_voting_fraction); 26 | 27 | } // namespace traccc::cuda::kernels 28 | -------------------------------------------------------------------------------- /io/include/traccc/io/read_magnetic_field.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/io/data_format.hpp" 12 | 13 | // Project include(s). 14 | #include "traccc/bfield/magnetic_field.hpp" 15 | #include "traccc/definitions/common.hpp" 16 | #include "traccc/utils/logging.hpp" 17 | 18 | // System include(s). 19 | #include 20 | 21 | namespace traccc::io { 22 | 23 | /// Read a magnetic field from a file 24 | /// 25 | /// @param[out] bfield The field to fill 26 | /// @param[in] filename The name of the file to read 27 | /// @param[in] format The data format of the input file 28 | /// @param[in] logger Logger to use for output messages 29 | /// 30 | void read_magnetic_field( 31 | magnetic_field& bfield, std::string_view filename, 32 | data_format format = data_format::binary, 33 | std::unique_ptr logger = getDummyLogger().clone()); 34 | 35 | } // namespace traccc::io 36 | -------------------------------------------------------------------------------- /io/src/csv/write_cells.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/edm/silicon_cell_collection.hpp" 12 | #include "traccc/geometry/silicon_detector_description.hpp" 13 | 14 | // System include(s). 15 | #include 16 | 17 | namespace traccc::io::csv { 18 | 19 | /// Function for cell file writing to CSV files 20 | /// 21 | /// @param filename The name of the file to write the data to 22 | /// @param cells Cell collection to write 23 | /// @param dd Silicon detector description 24 | /// @param use_acts_geometry_id Flag to use the ACTS geometry ID (or the Detray 25 | /// one) 26 | /// 27 | void write_cells(std::string_view filename, 28 | traccc::edm::silicon_cell_collection::const_view cells, 29 | traccc::silicon_detector_description::const_view dd, 30 | bool use_acts_geometry_id); 31 | 32 | } // namespace traccc::io::csv 33 | -------------------------------------------------------------------------------- /core/include/traccc/edm/impl/track_state_collection.ipp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::edm { 11 | 12 | template 13 | TRACCC_HOST_DEVICE bool track_state::is_hole() const { 14 | 15 | return (state() & IS_HOLE_MASK); 16 | } 17 | 18 | template 19 | TRACCC_HOST_DEVICE void track_state::set_hole(bool value) { 20 | 21 | if (value) { 22 | state() |= IS_HOLE_MASK; 23 | } else { 24 | state() &= ~IS_HOLE_MASK; 25 | } 26 | } 27 | 28 | template 29 | TRACCC_HOST_DEVICE bool track_state::is_smoothed() const { 30 | 31 | return (state() & IS_SMOOTHED_MASK); 32 | } 33 | 34 | template 35 | TRACCC_HOST_DEVICE void track_state::set_smoothed(bool value) { 36 | 37 | if (value) { 38 | state() |= IS_SMOOTHED_MASK; 39 | } else { 40 | state() &= ~IS_SMOOTHED_MASK; 41 | } 42 | } 43 | 44 | } // namespace traccc::edm 45 | -------------------------------------------------------------------------------- /core/include/traccc/edm/impl/seed_collection.ipp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::edm { 11 | 12 | template 13 | template 14 | TRACCC_HOST_DEVICE bool seed::operator==(const seed& other) const { 15 | 16 | return ((top_index() == other.top_index()) && 17 | (middle_index() == other.middle_index()) && 18 | (bottom_index() == other.bottom_index())); 19 | } 20 | 21 | template 22 | template 23 | TRACCC_HOST_DEVICE std::strong_ordering seed::operator<=>( 24 | const seed& other) const { 25 | 26 | if (top_index() != other.top_index()) { 27 | return (top_index() <=> other.top_index()); 28 | } else if (middle_index() != other.middle_index()) { 29 | return (middle_index() <=> other.middle_index()); 30 | } else { 31 | return (bottom_index() <=> other.bottom_index()); 32 | } 33 | } 34 | 35 | } // namespace traccc::edm 36 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/threading.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/options/details/interface.hpp" 12 | 13 | // System include(s). 14 | #include 15 | 16 | namespace traccc::opts { 17 | 18 | /// Option(s) for multi-threaded code execution 19 | class threading : public interface { 20 | 21 | public: 22 | /// @name Options 23 | /// @{ 24 | 25 | /// The number of threads to use for the data processing 26 | std::size_t threads = 1; 27 | 28 | /// @} 29 | 30 | /// Constructor 31 | threading(); 32 | 33 | /// Read/process the command line options 34 | /// 35 | /// @param vm The command line options to interpret/read 36 | /// 37 | void read(const boost::program_options::variables_map& vm) override; 38 | 39 | std::unique_ptr as_printable() const override; 40 | }; // struct threading 41 | 42 | } // namespace traccc::opts 43 | -------------------------------------------------------------------------------- /performance/include/traccc/performance/throughput.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/performance/timing_info.hpp" 12 | 13 | // System include(s). 14 | #include 15 | #include 16 | #include 17 | 18 | namespace traccc::performance { 19 | 20 | /// Convenience type for printing throughput information 21 | struct throughput { 22 | 23 | /// Constructor with a "timer name" and event processing time 24 | throughput(std::size_t events, const timing_info& ti, 25 | std::string_view timer_name); 26 | 27 | /// The timer name 28 | std::string m_timer_name; 29 | /// The milliseconds per event value 30 | double m_perEvent; 31 | /// The events per second value 32 | double m_perSecond; 33 | 34 | }; // class throughput 35 | 36 | /// Printout operator 37 | std::ostream& operator<<(std::ostream& out, const throughput& thr); 38 | 39 | } // namespace traccc::performance 40 | -------------------------------------------------------------------------------- /device/cuda/include/traccc/cuda/utils/make_magnetic_field.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/bfield/magnetic_field.hpp" 12 | 13 | namespace traccc::cuda { 14 | 15 | /// Storage method for inhomogeneous magnetic fields 16 | enum class magnetic_field_storage { 17 | global_memory, ///< Store the magnetic field in global device memory 18 | texture_memory ///< Store the magnetic field in texture device memory 19 | }; 20 | 21 | /// Create a magnetic field usable on the active CUDA device 22 | /// 23 | /// @param bfield The magnetic field to be copied 24 | /// @param storage The storage method to use for the magnetic field 25 | /// @return A copy of the magnetic field that can be used on the active CUDA 26 | /// device 27 | /// 28 | magnetic_field make_magnetic_field( 29 | const magnetic_field& bfield, 30 | magnetic_field_storage storage = magnetic_field_storage::global_memory); 31 | 32 | } // namespace traccc::cuda 33 | -------------------------------------------------------------------------------- /core/src/clusterization/clusterization_algorithm.cpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Library include(s). 9 | #include "traccc/clusterization/clusterization_algorithm.hpp" 10 | 11 | namespace traccc::host { 12 | 13 | clusterization_algorithm::clusterization_algorithm( 14 | vecmem::memory_resource& mr, std::unique_ptr logger) 15 | : messaging(logger->clone()), 16 | m_cc(mr, logger->cloneWithSuffix("CclAlg")), 17 | m_mc(mr, logger->cloneWithSuffix("MeasurementCreationAlg")), 18 | m_mr(mr) {} 19 | 20 | clusterization_algorithm::output_type clusterization_algorithm::operator()( 21 | const edm::silicon_cell_collection::const_view& cells_view, 22 | const silicon_detector_description::const_view& dd_view) const { 23 | 24 | const sparse_ccl_algorithm::output_type clusters = m_cc(cells_view); 25 | const auto clusters_data = vecmem::get_data(clusters); 26 | return m_mc(cells_view, clusters_data, dd_view); 27 | } 28 | 29 | } // namespace traccc::host 30 | -------------------------------------------------------------------------------- /core/include/traccc/bfield/construct_const_bfield.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/bfield/magnetic_field.hpp" 12 | #include "traccc/definitions/primitives.hpp" 13 | 14 | namespace traccc { 15 | 16 | /// Construct a constant magnetic field object 17 | /// 18 | /// @tparam scalar_t The scalar type to construct the field with 19 | /// 20 | /// @param x The X component of the constant field 21 | /// @param y The Y component of the constant field 22 | /// @param z The Z component of the constant field 23 | /// 24 | template 25 | magnetic_field construct_const_bfield(scalar_t x, scalar_t y, scalar_t z); 26 | 27 | /// Construct a constant magnetic field object 28 | /// 29 | /// @param v The 3-vector describing the constant field 30 | /// 31 | magnetic_field construct_const_bfield(const vector3& v); 32 | 33 | } // namespace traccc 34 | 35 | // Include the implementation. 36 | #include "traccc/bfield/impl/construct_const_bfield.ipp" 37 | -------------------------------------------------------------------------------- /device/cuda/src/finding/kernels/specializations/propagate_to_next_surface.cu.template: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "${SOURCE_DIR}/../../../utils/magnetic_field_types.hpp" 10 | #include "${SOURCE_DIR}/propagate_to_next_surface_src.cuh" 11 | 12 | // Project include(s). 13 | #include "traccc/finding/details/combinatorial_kalman_filter_types.hpp" 14 | #include "traccc/geometry/detector.hpp" 15 | 16 | // Covfie include(s). 17 | #include 18 | 19 | namespace traccc::cuda { 20 | 21 | using bfield_t = covfie::field<${BFIELD_NAME}>::view_t; 22 | using propagator_t = traccc::details::ckf_propagator_t<${DETECTOR_NAME}::device, bfield_t>; 23 | 24 | template void propagate_to_next_surface( 25 | const dim3& grid_size, const dim3& block_size, std::size_t shared_mem_size, 26 | const cudaStream_t& stream, const finding_config, 27 | device::propagate_to_next_surface_payload); 28 | 29 | } // namespace traccc::cuda 30 | -------------------------------------------------------------------------------- /core/include/traccc/edm/track_state_helpers.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/edm/measurement_collection.hpp" 12 | #include "traccc/edm/track_state_collection.hpp" 13 | 14 | namespace traccc::edm { 15 | 16 | /// Create a track state with default values. 17 | /// 18 | /// @param measurements The collection of measurements to use for initialization 19 | /// @param mindex The index of the measurement to associate with the state 20 | /// 21 | /// @return A track state object initialized with default values 22 | /// 23 | template 24 | TRACCC_HOST_DEVICE 25 | typename track_state_collection::device::object_type 26 | make_track_state(const typename measurement_collection< 27 | algebra_t>::const_device& measurements, 28 | unsigned int mindex); 29 | 30 | } // namespace traccc::edm 31 | 32 | // Include the implementation. 33 | #include "traccc/edm/impl/track_state_helpers.ipp" 34 | -------------------------------------------------------------------------------- /core/include/traccc/seeding/detail/track_params_estimation_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2021-2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "traccc/definitions/common.hpp" 13 | #include "traccc/definitions/primitives.hpp" 14 | #include "traccc/definitions/track_parametrization.hpp" 15 | 16 | namespace traccc { 17 | 18 | struct track_params_estimation_config { 19 | std::array initial_sigma = { 20 | 1.f * unit::mm, 21 | 1.f * unit::mm, 22 | 1.f * unit::degree, 23 | 1.f * unit::degree, 24 | 0.f * unit::e / unit::GeV, 25 | 1.f * unit::ns}; 26 | 27 | scalar initial_sigma_qopt = 0.1f * unit::e / unit::GeV; 28 | 29 | scalar initial_sigma_pt_rel = 0.1f; 30 | 31 | std::array initial_inflation = {1.f, 1.f, 1.f, 32 | 1.f, 1.f, 100.f}; 33 | }; 34 | 35 | } // namespace traccc 36 | -------------------------------------------------------------------------------- /core/include/traccc/edm/particle.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/definitions/primitives.hpp" 12 | #include "traccc/edm/container.hpp" 13 | 14 | // System include(s). 15 | #include 16 | 17 | namespace traccc { 18 | 19 | /// Definition of a truth particle 20 | struct particle { 21 | std::uint64_t particle_id; 22 | int particle_type; 23 | int process; 24 | point3 vertex; 25 | scalar time; 26 | vector3 momentum; 27 | scalar mass; 28 | scalar charge; 29 | }; 30 | 31 | inline bool operator<(const particle& lhs, const particle& rhs) { 32 | if (lhs.particle_id < rhs.particle_id) { 33 | return true; 34 | } 35 | return false; 36 | } 37 | 38 | /// Declare all particle collection types 39 | using particle_collection_types = collection_types; 40 | /// Declare all particle container types 41 | using particle_container_types = container_types; 42 | 43 | } // namespace traccc 44 | -------------------------------------------------------------------------------- /io/include/traccc/io/csv/measurement.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // DFE include(s). 11 | #include 12 | 13 | // System include(s). 14 | #include 15 | #include 16 | 17 | namespace traccc::io::csv { 18 | 19 | /// Type used in reading CSV measurement data into memory 20 | struct measurement { 21 | 22 | uint64_t measurement_id = 0; 23 | uint64_t geometry_id = 0; 24 | uint8_t local_key = 0; 25 | float local0 = 0.f; 26 | float local1 = 0.f; 27 | float phi = 0.f; 28 | float theta = 0.f; 29 | float time = 0.f; 30 | float var_local0 = 0.f; 31 | float var_local1 = 0.f; 32 | float var_phi = 0.f; 33 | float var_theta = 0.f; 34 | float var_time = 0.f; 35 | 36 | DFE_NAMEDTUPLE(measurement, measurement_id, geometry_id, local_key, local0, 37 | local1, phi, theta, time, var_local0, var_local1, var_phi, 38 | var_theta, var_time); 39 | }; 40 | 41 | } // namespace traccc::io::csv 42 | -------------------------------------------------------------------------------- /device/sycl/src/utils/global_index.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/device/global_index.hpp" 12 | 13 | // SYCL include(s). 14 | #include 15 | 16 | namespace traccc::sycl::details { 17 | 18 | /// Function creating a global index in a 1D SYCL kernel 19 | inline device::global_index_t global_index(const ::sycl::nd_item<1>& item) { 20 | 21 | return static_cast(item.get_global_linear_id()); 22 | } 23 | 24 | /// Function creating a global index in a 2D SYCL kernel 25 | inline device::global_index_t global_index(const ::sycl::nd_item<2>& item) { 26 | 27 | return static_cast(item.get_global_linear_id()); 28 | } 29 | 30 | /// Function creating a global index in a 3D SYCL kernel 31 | inline device::global_index_t global_index(const ::sycl::nd_item<3>& item) { 32 | 33 | return static_cast(item.get_global_linear_id()); 34 | } 35 | 36 | } // namespace traccc::sycl::details 37 | -------------------------------------------------------------------------------- /extern/tbb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2022-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # CMake include(s). 8 | cmake_minimum_required( VERSION 3.25 ) 9 | include( FetchContent ) 10 | 11 | # Tell the user what's happening. 12 | message( STATUS "Building TBB as part of the TRACCC project" ) 13 | 14 | # Declare where to get TBB from. 15 | set( TRACCC_TBB_SOURCE 16 | "URL;https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2022.0.0.tar.gz;URL_MD5;78ec44cecf3cd78c4984e61f1bb93134" 17 | CACHE STRING "Source for TBB, when built as part of this project" ) 18 | mark_as_advanced( TRACCC_TBB_SOURCE ) 19 | FetchContent_Declare( TBB SYSTEM ${TRACCC_TBB_SOURCE} OVERRIDE_FIND_PACKAGE ) 20 | 21 | # Options used in the build of TBB. 22 | set( TBB_TEST FALSE CACHE BOOL "Turn off the TBB tests" ) 23 | set( TBB_STRICT FALSE CACHE BOOL "Do not throw errors on compiler warnings" ) 24 | 25 | # Make TBB work without warnings with modern CMake versions. 26 | set( CMAKE_POLICY_VERSION_MINIMUM "3.10" ) 27 | 28 | # Get it into the current directory. 29 | FetchContent_MakeAvailable( TBB ) 30 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/mirrors-clang-format 3 | rev: v18.1.8 4 | hooks: 5 | - id: clang-format 6 | types_or: [file] 7 | files: \.(cpp|hpp|ipp|cu|cuh|sycl|hip)$ 8 | 9 | - repo: https://github.com/pre-commit/pre-commit-hooks 10 | rev: v5.0.0 11 | hooks: 12 | - id: trailing-whitespace 13 | exclude: \.(diff|patch)$ 14 | - id: end-of-file-fixer 15 | exclude: \.(diff|patch)$ 16 | - id: check-yaml 17 | - id: check-added-large-files 18 | 19 | - repo: local 20 | hooks: 21 | - id: check_quote_includes 22 | name: Check includes with quotes 23 | language: system 24 | entry: .github/check_quote_includes.sh 25 | 26 | - repo: local 27 | hooks: 28 | - id: check_taboos 29 | name: Check taboo code patterns 30 | language: system 31 | entry: .github/check_taboos.sh 32 | 33 | - repo: local 34 | hooks: 35 | - id: check_duplicate_cu_files 36 | name: Check duplicate .cu file names 37 | language: system 38 | entry: .github/check_duplicate_cu_files.sh 39 | pass_filenames: false 40 | -------------------------------------------------------------------------------- /performance/include/traccc/performance/impl/is_same_track_parameters.ipp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Library include(s). 11 | #include "traccc/edm/track_parameters.hpp" 12 | 13 | namespace traccc::details { 14 | 15 | /// @c traccc::is_same_object specialisation for 16 | /// @c traccc::bound_track_parameters 17 | template <> 18 | class is_same_object> { 19 | 20 | public: 21 | /// Constructor with a reference object, and an allowed uncertainty 22 | is_same_object(const bound_track_parameters<>& ref, 23 | scalar unc = float_epsilon); 24 | 25 | /// Specialised implementation for @c traccc::bound_track_parameters 26 | bool operator()(const bound_track_parameters<>& obj) const; 27 | 28 | private: 29 | /// The reference object 30 | std::reference_wrapper> m_ref; 31 | /// The uncertainty 32 | scalar m_unc; 33 | 34 | }; // class is_same_object 35 | 36 | } // namespace traccc::details 37 | -------------------------------------------------------------------------------- /performance/include/traccc/resolution/stat_plot_tool_config.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/utils/helpers.hpp" 12 | 13 | // System include(s). 14 | #include 15 | #include 16 | 17 | namespace traccc { 18 | 19 | /// @brief Configuration structure for @c traccc::stat_plot_tool 20 | struct stat_plot_tool_config { 21 | 22 | /// Binning setups 23 | std::map var_binning = { 24 | {"ndf", plot_helpers::binning("ndf", 35, -5.f, 30.f)}, 25 | {"chi2", plot_helpers::binning("chi2", 100, 0.f, 50.f)}, 26 | {"reduced_chi2", plot_helpers::binning("chi2/ndf", 100, 0.f, 10.f)}, 27 | {"pval", plot_helpers::binning("pval", 50, 0.f, 1.f)}, 28 | {"chi2_local", plot_helpers::binning("chi2", 100, 0.f, 10.f)}, 29 | {"completeness", plot_helpers::binning("completeness", 20, 0.f, 1.f)}, 30 | {"purity", plot_helpers::binning("purity", 20, 0.f, 1.f)}}; 31 | }; 32 | 33 | } // namespace traccc 34 | -------------------------------------------------------------------------------- /device/cuda/src/fitting/kernels/specializations/fit_forward_src.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "../../../utils/global_index.hpp" 11 | #include "../fit_forward.hpp" 12 | #include "traccc/fitting/device/fit_forward.hpp" 13 | 14 | namespace traccc::cuda { 15 | namespace kernels { 16 | template 17 | __global__ __launch_bounds__(128) void fit_forward( 18 | const fitting_config cfg, const device::fit_payload payload) { 19 | device::fit_forward(details::global_index1(), cfg, payload); 20 | } 21 | } // namespace kernels 22 | 23 | template 24 | void fit_forward(const dim3& grid_size, const dim3& block_size, 25 | std::size_t shared_mem_size, const cudaStream_t& stream, 26 | const fitting_config& cfg, 27 | const device::fit_payload& payload) { 28 | kernels::fit_forward<<>>( 29 | cfg, payload); 30 | } 31 | 32 | } // namespace traccc::cuda 33 | -------------------------------------------------------------------------------- /tests/cpu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2021-2025 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | # Declare the cpu algorithm test(s). 8 | traccc_add_test(cpu 9 | "compare_with_acts_seeding.cpp" 10 | "seq_single_module.cpp" 11 | "test_ambiguity_resolution.cpp" 12 | "test_cca.cpp" 13 | "test_ckf_combinatorics_telescope.cpp" 14 | "test_ckf_sparse_tracks_telescope.cpp" 15 | "test_clusterization_resolution.cpp" 16 | "test_copy.cpp" 17 | "test_kalman_fitter_hole_count.cpp" 18 | "test_kalman_fitter_momentum_resolution.cpp" 19 | "test_kalman_fitter_telescope.cpp" 20 | "test_kalman_fitter_wire_chamber.cpp" 21 | "test_ranges.cpp" 22 | "test_seeding.cpp" 23 | "test_simulation.cpp" 24 | "test_spacepoint_formation.cpp" 25 | "test_track_params_estimation.cpp" 26 | "test_sanity_ordered_on.cpp" 27 | "test_sanity_contiguous_on.cpp" 28 | LINK_LIBRARIES GTest::gtest_main vecmem::core 29 | traccc_tests_common traccc::core traccc::io traccc::performance 30 | traccc::simulation detray::core detray::io detray::test_common covfie::core ) 31 | -------------------------------------------------------------------------------- /device/cuda/src/ambiguity_resolution/kernels/fill_unique_meas_id_map.cu: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | // Local include(s). 9 | #include "../../utils/global_index.hpp" 10 | #include "fill_unique_meas_id_map.cuh" 11 | 12 | // VecMem include(s). 13 | #include 14 | #include 15 | 16 | namespace traccc::cuda::kernels { 17 | 18 | __global__ void fill_unique_meas_id_map( 19 | device::fill_unique_meas_id_map_payload payload) { 20 | 21 | vecmem::device_vector unique_meas( 22 | payload.unique_meas_view); 23 | 24 | const auto globalIndex = details::global_index1(); 25 | if (globalIndex >= unique_meas.size()) { 26 | return; 27 | } 28 | 29 | vecmem::device_vector meas_id_to_unique_id( 30 | payload.meas_id_to_unique_id_view); 31 | 32 | auto meas_id = unique_meas.at(globalIndex); 33 | meas_id_to_unique_id.at(meas_id) = globalIndex; 34 | } 35 | 36 | } // namespace traccc::cuda::kernels 37 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/track_resolution.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/ambiguity_resolution/ambiguity_resolution_config.hpp" 12 | #include "traccc/options/details/config_provider.hpp" 13 | #include "traccc/options/details/interface.hpp" 14 | 15 | namespace traccc::opts { 16 | 17 | /// Configuration for track ambiguity resulution 18 | class track_resolution : public interface, 19 | public config_provider { 20 | 21 | public: 22 | /// Constructor 23 | track_resolution(); 24 | 25 | /// Configuration conversion operators 26 | operator ambiguity_resolution_config() const override; 27 | 28 | /// Configuration conversion operators 29 | std::unique_ptr as_printable() const override; 30 | 31 | private: 32 | /// The internal configuration 33 | ambiguity_resolution_config m_config; 34 | }; // class track_resolution 35 | 36 | } // namespace traccc::opts 37 | -------------------------------------------------------------------------------- /core/include/traccc/edm/track_constituent_link.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace traccc::edm { 11 | 12 | /// A link to a constituent of a track 13 | /// 14 | /// It is a poor man's version of @c Acts::SourceLink. Only providing the 15 | /// functionality needed in the GPU algorithms. 16 | /// 17 | struct track_constituent_link { 18 | 19 | /// The type of the constituent 20 | enum constituent_type : unsigned short { 21 | measurement = 0, ///< The link points at a measurement 22 | track_state = 1 ///< The link points at a track state 23 | }; 24 | 25 | unsigned short type; ///< The type of the constituent 26 | unsigned int index; ///< The index of the constituent in its collection 27 | 28 | /// Equality operator 29 | /// 30 | /// For some reason Clang fails to generate it automatically for this type. 31 | /// 32 | bool operator==(const track_constituent_link&) const = default; 33 | 34 | }; // struct track_constituent_link 35 | 36 | } // namespace traccc::edm 37 | -------------------------------------------------------------------------------- /device/alpaka/include/traccc/alpaka/utils/make_prefix_sum_buff.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Library include(s). 11 | #include "traccc/alpaka/utils/queue.hpp" 12 | 13 | // Project include(s). 14 | #include "traccc/device/fill_prefix_sum.hpp" 15 | #include "traccc/utils/memory_resource.hpp" 16 | 17 | namespace traccc::alpaka { 18 | 19 | /// Function that returns vector of prefix_sum_element_t for accessing a jagged 20 | /// vector's elements in device Example: Jagged vector with sizes = {3,2,1,...} 21 | /// Returns: {[0,0], [0,1], [0,2], [1,0], [1,1], [2,0], ...} 22 | /// 23 | /// @param[in] sizes The sizes of the jagged vector 24 | /// @param copy A "copy object" capable of dealing with the view 25 | /// @return A vector buffer of prefix_sum element 26 | /// 27 | vecmem::data::vector_buffer make_prefix_sum_buff( 28 | const std::vector& sizes, vecmem::copy& copy, 29 | const traccc::memory_resource& mr, queue& q); 30 | 31 | } // namespace traccc::alpaka 32 | -------------------------------------------------------------------------------- /device/common/include/traccc/ambiguity_resolution/device/add_block_offset.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // VecMem include(s). 11 | #include 12 | 13 | namespace traccc::device { 14 | 15 | /// (Event Data) Payload for the @c 16 | /// traccc::device::add_block_offset function 17 | struct add_block_offset_payload { 18 | 19 | /** 20 | * @brief Whether to terminate the calculation 21 | */ 22 | int* terminate; 23 | 24 | /** 25 | * @brief The number of accepted tracks 26 | */ 27 | unsigned int* n_accepted; 28 | 29 | /** 30 | * @brief The number of updated tracks 31 | */ 32 | unsigned int* n_updated_tracks; 33 | 34 | /** 35 | * @brief View object to the block_offset vector 36 | */ 37 | vecmem::data::vector_view block_offsets_view; 38 | 39 | /** 40 | * @brief View object to the prefix_sum vector 41 | */ 42 | vecmem::data::vector_view prefix_sums_view; 43 | }; 44 | 45 | } // namespace traccc::device 46 | -------------------------------------------------------------------------------- /device/cuda/src/fitting/kernels/specializations/fit_backward_src.cuh: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "../../../utils/global_index.hpp" 11 | #include "../fit_backward.hpp" 12 | #include "traccc/fitting/device/fit_backward.hpp" 13 | 14 | namespace traccc::cuda { 15 | namespace kernels { 16 | template 17 | __global__ __launch_bounds__(128) void fit_backward( 18 | const fitting_config cfg, const device::fit_payload payload) { 19 | device::fit_backward(details::global_index1(), cfg, payload); 20 | } 21 | } // namespace kernels 22 | 23 | template 24 | void fit_backward(const dim3& grid_size, const dim3& block_size, 25 | std::size_t shared_mem_size, const cudaStream_t& stream, 26 | const fitting_config& cfg, 27 | const device::fit_payload& payload) { 28 | kernels::fit_backward 29 | <<>>(cfg, payload); 30 | } 31 | 32 | } // namespace traccc::cuda 33 | -------------------------------------------------------------------------------- /plugins/algebra/vc_aos/include/traccc/plugins/algebra/vc_aos_definitions.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * TRACCC library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2021-2022 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | // Detray include(s). 12 | #include 13 | 14 | // Algebra Plugins include(s). 15 | #include 16 | 17 | // VecMem include(s). 18 | #include 19 | #include 20 | 21 | // System include(s). 22 | #include 23 | #include 24 | #include 25 | 26 | #define ALGEBRA_PLUGIN detray::vc_aos 27 | 28 | namespace traccc { 29 | 30 | using scalar = TRACCC_CUSTOM_SCALARTYPE; 31 | 32 | template 33 | using darray = std::array; 34 | 35 | template 36 | using dvector = vecmem::vector; 37 | 38 | template 39 | using dmap = std::map; 40 | 41 | template 42 | using dtuple = std::tuple; 43 | 44 | } // namespace traccc 45 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Debug Host Executable", 6 | "type": "cppdbg", 7 | "request": "launch", 8 | "program": "${command:cmake.launchTargetPath}", 9 | "cwd" : "${command:cmake.launchTargetDirectory}", 10 | "stopAtEntry": false, 11 | "environment": [], 12 | "externalConsole": false, 13 | "MIMode": "gdb", 14 | "setupCommands": [ 15 | { 16 | "description": "Enable pretty-printing for gdb", 17 | "text": "-enable-pretty-printing", 18 | "ignoreFailures": true 19 | }, 20 | { 21 | "description": "Set Disassembly Flavor to Intel", 22 | "text": "-gdb-set disassembly-flavor intel", 23 | "ignoreFailures": true 24 | } 25 | ] 26 | }, 27 | { 28 | "name": "Debug NVIDIA Executable", 29 | "type": "cuda-gdb", 30 | "request": "launch", 31 | "program": "${command:cmake.launchTargetPath}", 32 | "cwd" : "${command:cmake.launchTargetDirectory}" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /device/common/include/traccc/ambiguity_resolution/device/fill_inverted_ids.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // VecMem include(s). 11 | #include 12 | 13 | namespace traccc::device { 14 | 15 | /// (Event Data) Payload for the @c 16 | /// traccc::device::fill_inverted_ids function 17 | struct fill_inverted_ids_payload { 18 | 19 | /** 20 | * @brief View object to the sorted track 21 | */ 22 | vecmem::data::vector_view sorted_ids_view; 23 | 24 | /** 25 | * @brief Whether to terminate the calculation 26 | */ 27 | int* terminate; 28 | 29 | /** 30 | * @brief The number of accepted tracks 31 | */ 32 | unsigned int* n_accepted; 33 | 34 | /** 35 | * @brief The number of updated tracks 36 | */ 37 | unsigned int* n_updated_tracks; 38 | 39 | /** 40 | * @brief View object to the inverted ids 41 | */ 42 | vecmem::data::vector_view inverted_ids_view; 43 | }; 44 | 45 | } // namespace traccc::device 46 | -------------------------------------------------------------------------------- /examples/options/include/traccc/options/program_options.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2024 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/options/details/interface.hpp" 12 | #include "traccc/utils/logging.hpp" 13 | 14 | // Boost include(s). 15 | #include 16 | 17 | // System include(s). 18 | #include 19 | #include 20 | #include 21 | 22 | namespace traccc::opts { 23 | 24 | /// Top-level propgram options for an executable 25 | class program_options { 26 | 27 | public: 28 | /// Constructor 29 | program_options( 30 | std::string_view description, 31 | const std::vector >& options, 32 | int argc, char* argv[], 33 | std::unique_ptr ilogger = 34 | traccc::getDummyLogger().clone()); 35 | 36 | private: 37 | /// Description of all program options 38 | boost::program_options::options_description m_desc; 39 | 40 | }; // class program_options 41 | 42 | } // namespace traccc::opts 43 | -------------------------------------------------------------------------------- /performance/include/traccc/performance/details/is_same_angle.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2022 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Library include(s). 11 | #include "traccc/definitions/common.hpp" 12 | #include "traccc/definitions/primitives.hpp" 13 | 14 | namespace traccc::details { 15 | 16 | /// Comparison of angles, used in algorithmic code validation 17 | /// 18 | /// This helper function can be used to decide if two angle values are "the 19 | /// same" within some specific uncertainty. 20 | /// 21 | /// It is different from @c traccc::details:is_same_scalar in that it considers 22 | /// values just above -Pi and just below Pi to be close to each other. 23 | /// 24 | /// @param lhs The Left Hand Side of the comparison 25 | /// @param rhs The Right Hand Side of the comparison 26 | /// @param unc The uncertainty percentage expressed in the 0.0-1.0 range 27 | /// @return @c true if the two values are "the same" within uncertainty, 28 | /// @c false otherwise 29 | /// 30 | bool is_same_angle(scalar lhs, scalar rhs, scalar unc = float_epsilon); 31 | 32 | } // namespace traccc::details 33 | -------------------------------------------------------------------------------- /plugins/algebra/smatrix/include/traccc/plugins/algebra/smatrix_definitions.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * TRACCC library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2021-2022 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | // Detray include(s). 12 | #include 13 | 14 | // Algebra Plugins include(s). 15 | #include 16 | 17 | // VecMem include(s). 18 | #include 19 | #include 20 | 21 | // System include(s). 22 | #include 23 | #include 24 | #include 25 | 26 | #define ALGEBRA_PLUGIN detray::smatrix 27 | 28 | namespace traccc { 29 | 30 | using scalar = TRACCC_CUSTOM_SCALARTYPE; 31 | 32 | template 33 | using darray = std::array; 34 | 35 | template 36 | using dvector = vecmem::vector; 37 | 38 | template 39 | using dmap = std::map; 40 | 41 | template 42 | using dtuple = std::tuple; 43 | 44 | } // namespace traccc 45 | -------------------------------------------------------------------------------- /core/include/traccc/finding/candidate_link.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2023-2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Project include(s). 11 | #include "traccc/utils/pair.hpp" 12 | 13 | namespace traccc { 14 | 15 | // A link that contains the index of corresponding measurement and the index of 16 | // a link from a previous step of track finding 17 | struct candidate_link { 18 | // Step on which this link was found 19 | unsigned int step; 20 | 21 | // Index of the previous candidate 22 | unsigned int previous_candidate_idx; 23 | 24 | // Measurement index 25 | unsigned int meas_idx; 26 | 27 | // Index to the initial seed 28 | unsigned int seed_idx; 29 | 30 | // How many times it skipped a surface 31 | unsigned int n_skipped; 32 | 33 | // Number of consecutive holes; reset on measurement 34 | unsigned int n_consecutive_skipped; 35 | 36 | // chi2 37 | traccc::scalar chi2; 38 | 39 | // chi2 sum 40 | traccc::scalar chi2_sum; 41 | 42 | // degrees of freedom 43 | unsigned int ndf_sum; 44 | }; 45 | 46 | } // namespace traccc 47 | -------------------------------------------------------------------------------- /device/common/include/traccc/ambiguity_resolution/device/scan_block_offsets.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // VecMem include(s). 11 | #include 12 | 13 | namespace traccc::device { 14 | 15 | /// (Event Data) Payload for the @c 16 | /// traccc::device::scan_block_offsets function 17 | struct scan_block_offsets_payload { 18 | 19 | /** 20 | * @brief Whether to terminate the calculation 21 | */ 22 | int* terminate; 23 | 24 | /** 25 | * @brief The number of accepted tracks 26 | */ 27 | unsigned int* n_accepted; 28 | 29 | /** 30 | * @brief The number of updated tracks 31 | */ 32 | unsigned int* n_updated_tracks; 33 | 34 | /** 35 | * @brief View object to the block_offset vector 36 | */ 37 | vecmem::data::vector_view block_offsets_view; 38 | 39 | /** 40 | * @brief View object to the scanned block_offset vector 41 | */ 42 | vecmem::data::vector_view scanned_block_offsets_view; 43 | }; 44 | 45 | } // namespace traccc::device 46 | -------------------------------------------------------------------------------- /device/common/include/traccc/clusterization/device/reify_cluster_data.hpp: -------------------------------------------------------------------------------- 1 | /** TRACCC library, part of the ACTS project (R&D line) 2 | * 3 | * (c) 2025 CERN for the benefit of the ACTS project 4 | * 5 | * Mozilla Public License Version 2.0 6 | */ 7 | 8 | #pragma once 9 | 10 | // Local include(s). 11 | #include "traccc/device/global_index.hpp" 12 | 13 | // Project include(s). 14 | #include "traccc/definitions/qualifiers.hpp" 15 | #include "traccc/edm/silicon_cluster_collection.hpp" 16 | 17 | // VecMem include(s). 18 | #include 19 | 20 | namespace traccc::device { 21 | 22 | /// Fill a cluster collection with the cell indices 23 | /// 24 | /// @param thread_id The thread identifier 25 | /// @param disjoint_set_view The cluster/measurement index of each cell 26 | /// @param cluster_view The collection to fill 27 | /// 28 | TRACCC_HOST_DEVICE inline void reify_cluster_data( 29 | global_index_t thread_id, 30 | vecmem::data::vector_view disjoint_set_view, 31 | traccc::edm::silicon_cluster_collection::view cluster_view); 32 | 33 | } // namespace traccc::device 34 | 35 | // Include the implementation. 36 | #include "traccc/clusterization/device/impl/reify_cluster_data.ipp" 37 | -------------------------------------------------------------------------------- /plugins/algebra/eigen/include/traccc/plugins/algebra/eigen_definitions.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * TRACCC library, part of the ACTS project (R&D line) 3 | * 4 | * (c) 2021-2022 CERN for the benefit of the ACTS project 5 | * 6 | * Mozilla Public License Version 2.0 7 | */ 8 | 9 | #pragma once 10 | 11 | // Detray include(s). 12 | #include 13 | 14 | // VecMem include(s). 15 | #include 16 | #include 17 | 18 | // System include(s). 19 | #include 20 | #include 21 | #include 22 | 23 | #define ALGEBRA_PLUGIN detray::eigen 24 | 25 | namespace traccc { 26 | 27 | using scalar = TRACCC_CUSTOM_SCALARTYPE; 28 | 29 | template 30 | using darray = std::array; 31 | 32 | template 33 | using dvector = vecmem::vector; 34 | 35 | template 36 | using djagged_vector = vecmem::jagged_vector; 37 | 38 | template 39 | using dmap = std::map; 40 | 41 | template 42 | using dtuple = std::tuple; 43 | 44 | } // namespace traccc 45 | -------------------------------------------------------------------------------- /tests/alpaka/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TRACCC library, part of the ACTS project (R&D line) 2 | # 3 | # (c) 2022 CERN for the benefit of the ACTS project 4 | # 5 | # Mozilla Public License Version 2.0 6 | 7 | include(traccc-alpaka-functions) 8 | traccc_enable_language_alpaka() 9 | 10 | if(alpaka_ACC_GPU_CUDA_ENABLE) 11 | set_source_files_properties(alpaka_basic.cpp PROPERTIES LANGUAGE CUDA) 12 | list(APPEND DEVICE_LIBRARIES vecmem::cuda) 13 | elseif(alpaka_ACC_GPU_HIP_ENABLE) 14 | set_source_files_properties(alpaka_basic.cpp PROPERTIES LANGUAGE HIP) 15 | list(APPEND DEVICE_LIBRARIES vecmem::hip) 16 | elseif(alpaka_ACC_SYCL_ENABLE) 17 | list(APPEND DEVICE_LIBRARIES vecmem::sycl) 18 | set_source_files_properties(alpaka_basic.cpp PROPERTIES LANGUAGE SYCL) 19 | endif() 20 | 21 | traccc_add_test( alpaka 22 | alpaka_basic.cpp 23 | test_cca.cpp 24 | LINK_LIBRARIES 25 | GTest::gtest_main 26 | traccc_tests_common 27 | alpaka::alpaka 28 | vecmem::core 29 | traccc::alpaka 30 | ${DEVICE_LIBRARIES} 31 | ) 32 | 33 | #Can only do this once target is defined, so need another if here 34 | if(alpaka_ACC_GPU_HIP_ENABLE) 35 | set_target_properties( traccc_test_alpaka PROPERTIES 36 | POSITION_INDEPENDENT_CODE TRUE ) 37 | endif() 38 | --------------------------------------------------------------------------------