https://github.com/acts-project/traccc

Demonstrator tracking chain on accelerators

https://github.com/acts-project/traccc

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (4.6%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Demonstrator tracking chain on accelerators

Basic Info
  • Host: GitHub
  • Owner: acts-project
  • License: mpl-2.0
  • Language: C++
  • Default Branch: main
  • Size: 5.62 MB
Statistics
  • Stars: 34
  • Watchers: 4
  • Forks: 53
  • Open Issues: 86
  • Releases: 24
Created about 5 years ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

traccc

Demonstrator tracking chain for accelerators.

Features

| Category | Algorithms | CPU | CUDA | SYCL | Alpaka | Kokkos | Futhark | | ------------------------- | ---------------------- | --- | ---- | ---- | ------ | ------ | ------- | | Clusterization | CCL / FastSv / etc. | ✅ | ✅ | ✅ | ✅ | ⚪ | ✅ | | | Measurement creation | ✅ | ✅ | ✅ | ✅ | ⚪ | ✅ | | Seeding | Spacepoint formation | ✅ | ✅ | ✅ | ✅ | ⚪ | ⚪ | | | Spacepoint binning | ✅ | ✅ | ✅ | ✅ | ✅ | ⚪ | | | Seed finding | ✅ | ✅ | ✅ | ✅ | ⚪ | ⚪ | | | Track param estimation | ✅ | ✅ | ✅ | ✅ | ⚪ | ⚪ | | Track finding | Combinatorial KF | ✅ | ✅ | ✅ | ✅ | ⚪ | ⚪ | | Ambiguity resolution | Greedy resolver | ✅ | 🟡 | ⚪ | ⚪ | ⚪ | ⚪ | | Track fitting | KF | ✅ | ✅ | 🟡 | ✅ | ⚪ | ⚪ |

✅: exists, 🟡: work started, ⚪: work not started yet

The relations between datatypes and algorithms is given in the (approximately commutative) diagram shown below. Black lines indicate CPU algorithms, green lines indicate CUDA algorithms, blue lines indicate SYCL algorithms, and brown lines indicate Futhark algorithms. Solid algorithms are ready for use, dashed algorithms are in development or future goals. Data types for different heterogeneous platforms are contracted for legibility, and identities are hidden.

```mermaid flowchart LR subgraph clusterization [Clusterization] direction TB cell(Cells); cluster(Clusters); meas(Measurements); end

subgraph trkfinding [<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/finding/'>Track Finding</a>]
    sp(Spacepoints);
    bin(Spacepoint Grid);
    seed(Seeds);
    ptrack(Prototracks);
end

subgraph trkfitting [<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/fitting/'>Track Fitting</a>]
    trackc(Track Candidates)
    tracks(Track States);
end

click cell href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/edm/silicon_cell_collection.hpp";
click cluster href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/edm/silicon_cluster_collection.hpp";
click meas href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/edm/measurement.hpp";
click sp href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/edm/spacepoint.hpp";
click bin href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/seeding/detail/spacepoint_grid.hpp";
click seed href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/edm/seed.hpp";
click ptrack href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/edm/track_parameters.hpp";
click trackc href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/edm/track_candidate.hpp";
click tracks href "https://github.com/acts-project/traccc/blob/main/core/include/traccc/edm/track_state.hpp";

%% Host CCL algorithm
cell -->|<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/clusterization/sparse_ccl_algorithm.hpp'>Sparse CCL</a>| cluster;
linkStyle 0 stroke: black;

%% Host measurement creation
cluster -->|<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/clusterization/measurement_creation_algorithm.hpp'>Meas. Creat.</a>| meas;
linkStyle 1 stroke: black;

%% SYCL clusterization
cell -->|<a href='https://github.com/acts-project/traccc/blob/main/device/sycl/include/traccc/sycl/clusterization/clusterization_algorithm.hpp'>Clustering</a>| meas;
linkStyle 2 stroke: blue;

%% CUDA clusterization
cell -->|<a href='https://github.com/acts-project/traccc/blob/main/device/cuda/include/traccc/cuda/clusterization/clusterization_algorithm.hpp'>Clustering</a>| meas;
linkStyle 3 stroke: green;

%% Alpaka clusterization
cell -->|<a href='https://github.com/acts-project/traccc/blob/main/device/alpaka/include/traccc/alpaka/clusterization/clusterization_algorithm.hpp'>Clustering</a>| meas;
linkStyle 4 stroke: orange;

%% Host spacepoint formation
meas -->|<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp'>SP Form.</a>| sp;
linkStyle 5 stroke: black;

%% SYCL spacepoint formation
meas -->|<a href='https://github.com/acts-project/traccc/blob/main/device/sycl/include/traccc/sycl/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp'>SP Form.</a>| sp;
linkStyle 6 stroke: blue;

%% CUDA spacepoint formation
meas -->|<a href='https://github.com/acts-project/traccc/blob/main/device/cuda/include/traccc/cuda/seeding/spacepoint_formation_algorithm.hpp'>SP Form.</a>| sp;
linkStyle 7 stroke: green;

%% Alpaka spacepoint formation
meas -->|<a href='https://github.com/acts-project/traccc/blob/main/device/alpaka/include/traccc/alpaka/seeding/spacepoint_formation_algorithm.hpp'>SP Form.</a>| sp;
linkStyle 8 stroke: orange;

%% Host spacepoint binning
sp -->|<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/seeding/spacepoint_binning.hpp'>SP Binning</a>| bin;
linkStyle 9 stroke: black;

%% SYCL spacepoint binning
sp -->|<a href='https://github.com/acts-project/traccc/blob/main/device/sycl/include/traccc/sycl/seeding/spacepoint_binning.hpp'>SP Binning</a>| bin;
linkStyle 10 stroke: blue;

%% CUDA spacepoint binning
sp -->|<a href='https://github.com/acts-project/traccc/blob/main/device/cuda/include/traccc/cuda/seeding/spacepoint_binning.hpp'>SP Binning</a>| bin;
linkStyle 11 stroke: green;

%% Alpaka spacepoint binning
sp -->|<a href='https://github.com/acts-project/traccc/blob/main/device/alpaka/include/traccc/alpaka/seeding/spacepoint_binning.hpp'>SP Binning</a>| bin;
linkStyle 12 stroke: orange;

%% Host seeding
bin -->|<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/seeding/seed_finding.hpp'>Seeding</a>| seed;
linkStyle 13 stroke: black;

%% SYCL seeding
bin -->|<a href='https://github.com/acts-project/traccc/blob/main/device/sycl/include/traccc/sycl/seeding/seed_finding.hpp'>Seeding</a>| seed;
linkStyle 14 stroke: blue;

%% CUDA seeding
bin -->|<a href='https://github.com/acts-project/traccc/blob/main/device/cuda/include/traccc/cuda/seeding/seed_finding.hpp'>Seeding</a>| seed;
linkStyle 15 stroke: green;

%% Alpaka seeding
bin -->|<a href='https://github.com/acts-project/traccc/blob/main/device/alpaka/include/traccc/alpaka/seeding/seed_finding.hpp'>Seeding</a>| seed;
linkStyle 16 stroke: orange;

%% Host param est.
seed -->|<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/seeding/track_params_estimation.hpp'>Param. Est.</a>| ptrack;
linkStyle 17 stroke: black;

%% SYCL param est.
seed -->|<a href='https://github.com/acts-project/traccc/blob/main/device/sycl/include/traccc/sycl/seeding/track_params_estimation.hpp'>Param. Est.</a>| ptrack;
linkStyle 18 stroke: blue;

%% CUDA param est.
seed -->|<a href='https://github.com/acts-project/traccc/blob/main/device/cuda/include/traccc/cuda/seeding/track_params_estimation.hpp'>Param. Est.</a>| ptrack;
linkStyle 19 stroke: green;

%% Alpaka param est.
seed -->|<a href='https://github.com/acts-project/traccc/blob/main/device/alpaka/include/traccc/alpaka/seeding/track_params_estimation.hpp'>Param. Est.</a>| ptrack;
linkStyle 20 stroke: orange;

%% Host CKF
ptrack -->|<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/finding/combinatorial_kalman_filter_algorithm.hpp'>CKF</a>| trackc;
linkStyle 21 stroke: black;

%% Host Kalman filter
trackc -->|<a href='https://github.com/acts-project/traccc/blob/main/core/include/traccc/fitting/kalman_fitting_algorithm.hpp'>Kalman filter</a>| tracks;
linkStyle 22 stroke: black;

%% SYCL CKF
ptrack -->|<a href='https://github.com/acts-project/traccc/blob/main/device/sycl/include/traccc/sycl/finding/combinatorial_kalman_filter_algorithm.hpp'>CKF</a>| trackc;
linkStyle 23 stroke: blue;

%% SYCL Kalman filter
trackc -->|<a href='https://github.com/acts-project/traccc/blob/main/device/sycl/include/traccc/sycl/fitting/kalman_fitting_algorithm.hpp'>Kalman filter</a>| tracks;
linkStyle 24 stroke: blue;

%% CUDA CKF
ptrack -->|<a href='https://github.com/acts-project/traccc/blob/main/device/cuda/include/traccc/cuda/finding/finding_algorithm.hpp'>CKF</a>| trackc;
linkStyle 25 stroke: green;

%% CUDA Kalman filter
trackc -->|<a href='https://github.com/acts-project/traccc/blob/main/device/cuda/include/traccc/cuda/fitting/fitting_algorithm.hpp'>Kalman filter</a>| tracks;
linkStyle 26 stroke: green;

```

Requirements and dependencies

OS & compilers:

Please note that due to the complexity of this software and its build system, it may be somewhat fragile in the face of compiler version changes. The following are general guidelines for getting traccc to compile:

  • The C++ compiler must support C++20

In addition, the following requirements hold when CUDA is enabled:

  • The CUDA Toolkit version must be greater than major version 12
  • Ensure that the CUDA host compiler supports C++20 and is compatible with the nvcc compiler driver

The following table lists currently combinations of builds, compilers, and toolchains that are currently known to work (last updated 2022/01/24):

| Build | OS | gcc | CUDA | comment | | --- | --- | --- | --- | --- | | CUDA | Ubuntu 24.04 | 13.3.0 | 12.6 | runs on CI |

Dependencies

Dependency management with Spack

The Spack project provides a particularly easy way to install the dependencies that you need to use traccc. In order to use Spack to manage your dependencies, simply create a new Spack environment using the provided environment file:

sh spack env create traccc spack.yaml spack -e traccc concretize -f spack -e traccc install spack env activate traccc

This way, Spack will automatically download and install all dependencies necessary to use traccc with the CUDA, SYCL, Kokkos, and Alpaka programming models. When using Spack to manage your dependencies, make sure to compile traccc with the -DTRACCC_USE_SPACK_LIBS=ON flag.

Getting started

Clone the repository

Clone the repository and setup the data directory.

sh git clone https://github.com/acts-project/traccc.git ./traccc/data/traccc_data_get_files.sh

Build the project

sh cmake --preset <preset> [options] -S traccc/ -B build cmake --build build/

Build presets

| Name | Description | | --- | --- | | host-fp32 | FP32 build of the host code with ROOT enabled | | host-fp64 | FP64 build of the host code with ROOT enabled | | cuda-fp32 | FP32 build of the CUDA code | | cuda-fp64 | FP64 build of the CUDA code | | sycl-fp32 | FP32 build of the SYCL code | | sycl-fp64 | FP64 build of the SYCL code | | alpaka-fp32 | FP32 build of the Alpaka code | | alpaka-fp64 | FP64 build of the Alpaka code |

Detailed build options

| Option | Description | | --- | --- | | TRACCCBUILDCUDA | Build the CUDA sources included in traccc | | TRACCCBUILDSYCL | Build the SYCL sources included in traccc | | TRACCCBUILDALPAKA | Build the Alpaka sources included in traccc | | TRACCCBUILDTESTING | Build the (unit) tests of traccc | | TRACCCBUILDEXAMPLES | Build the examples of traccc | | TRACCCUSESYSTEMVECMEM | Pick up an existing installation of VecMem from the build environment | | TRACCCUSESYSTEMEIGEN3 | Pick up an existing installation of Eigen3 from the build environment | | TRACCCUSESYSTEMALGEBRAPLUGINS | Pick up an existing installation of Algebra Plugins from the build environment | | TRACCCUSESYSTEMDFELIBS | Pick up an existing installation of dfelibs from the build environment | | TRACCCUSESYSTEMDETRAY | Pick up an existing installation of Detray from the build environment | | TRACCCUSESYSTEMACTS | Pick up an existing installation of Acts from the build environment | | TRACCCUSESYSTEMGOOGLETEST | Pick up an existing installation of GoogleTest from the build environment | | TRACCCUSEROOT | Build physics performance analysis code using an existing installation of ROOT from the build environment |

Examples

Full reconstruction chain

```console /bin/tracccseqexample \ --detector-file=geometries/odd/odd-detraygeometrydetray.json \ --material-file=geometries/odd/odd-detraymaterialdetray.json \ --grid-file=geometries/odd/odd-detraysurfacegridsdetray.json \ --digitization-file=geometries/odd/odd-digi-geometric-config.json \ --use-acts-geom-source --input-directory=odd/geant410muon_10GeV/ \ --input-events=10

/bin/tracccthroughputmt \ --detector-file=geometries/odd/odd-detraygeometrydetray.json \ --material-file=geometries/odd/odd-detraymaterialdetray.json \ --grid-file=geometries/odd/odd-detraysurfacegridsdetray.json \ --digitization-file=geometries/odd/odd-digi-geometric-config.json \ --use-acts-geom-source --input-directory=odd/geant410muon_10GeV/ \ --input-events=10 --processed-events=1000 --threads=1 ```

Depending on the build options, can also use variants of the executables postfixed by _cuda, _sycl and _alpaka, with the same options.

Running a partial chain with simplified simulation data

Users can generate muon-like particle simulation data with the pre-built detray geometries:

```sh

Generate telescope geometry data

/bin/tracccsimulatetelescope --gen-vertex-xyz-mm=0:0:0 --gen-vertex-xyz-std-mm=0:0:0 --gen-mom-gev=100:100 --gen-phi-degree=0:0 --gen-events=10 --gen-nparticles=2000 --output-directory=detraysimulation/telescopedetector/nparticles2000/ --gen-eta=1:3

Generate toy geometry data

/bin/tracccsimulatetoydetector --gen-vertex-xyz-mm=0:0:0 --gen-vertex-xyz-std-mm=0:0:0 --gen-mom-gev=100:100 --gen-phi-degree=0:360 --gen-events=10 --gen-nparticles=2000 --output-directory=detraysimulation/toydetector/nparticles_2000/ --gen-eta=-3:3 --constraint-step-size-mm=1 --search-window 3:3

Generate drift chamber data

/bin/tracccsimulatewirechamber --gen-vertex-xyz-mm=0:0:0 --gen-vertex-xyz-std-mm=0:0:0 --gen-mom-gev=2:2 --gen-phi-degree=0:360 --gen-events=10 --gen-nparticles=100 --output-directory=detraysimulation/wirechamber/nparticles_100/ --gen-eta=-1:1 --constraint-step-size-mm=1 --search-window 3:3 ```

The simulation will also generate the detector json files (geometry, material and surfacegrid) in the current directory. It is user's responsibility to move them to an appropriate place (e.g. `<detectordirectory>`) and match them to the input file arguments of reconstruction chains.

If users have a geometry json file already, it is also possible to run simulation with traccc_simulate application

```sh

Given that users have a geometry json file

/bin/tracccsimulate --output-directory= --detector-file=<geometryfile> --material-file= --grid-file= --event=10 --constraint-step-size-mm=1 ```

There are three types of partial reconstruction chain users can operate: seeding_example, truth_finding_example, and truth_fitting_example where their algorithm coverages are shown in the table below. Each of them starts from truth measurements, truth seeds, and truth tracks, respectively.

| Category | Clusterization | Seeding | Track finding | Track fitting | | ----------------------- | -------------- | ------- | ------------- | ------------- | | seeding_example | | ✅ | ✅ | ✅ | | truth_finding_example | | | ✅ | ✅ | | truth_fitting_example | | | | ✅ |

The dirft chamber will not produce meaningful results with seeding_example as the current seeding algorithm is only designed for 2D measurement objects. Truth finding works OK in general but the combinatoric explosion can occur for a few unlucky events, leading to poor pull value distributions. The followings are example commands:

```sh

Run cuda seeding example for toy geometry

/bin/tracccseedingexamplecuda --input-directory=detraysimulation/toydetector/nparticles2000/ --check-performance --detector-file=<detectordirectory>/toydetectorgeometry.json --material-file=/toydetectorhomogeneousmaterial.json --grid-file=<detectordirectory>/toydetectorsurface_grids.json --input-events=1 --track-candidates-range=3:30 --constraint-step-size-mm=1000 --run-cpu=1 --search-window 3:3 ```

```sh

Run cuda truth finding example for toy geometry

/bin/traccctruthfindingexamplecuda --input-directory=detraysimulation/toydetector/nparticles2000/ --check-performance --detector-file=/toydetectorgeometry.json --material-file=/toydetectorhomogeneousmaterial.json --grid-file=<detectordirectory>/toydetectorsurface_grids.json --input-events=1 --track-candidates-range=3:30 --constraint-step-size-mm=1000 --run-cpu=1 --search-window 3:3 ```

```sh

Run cuda truth finding example for drift chamber

/bin/traccctruthfindingexamplecuda --input-directory=detraysimulation/wirechamber/nparticles100/ --check-performance --detector-file=/wirechambergeometry.json --material-file=/wirechamberhomogeneousmaterial.json --grid-file=<detectordirectory>/wirechambersurface_grids.json --input-events=10 --track-candidates-range=6:30 --constraint-step-size-mm=1 --run-cpu=1 --search-window 3:3 ```

```sh

Run cpu truth fitting example for drift chamber

/bin/traccctruthfittingexample --input-directory=detraysimulation/wirechamber/nparticles2000100GeV/ --check-performance --detector-file=/wirechambergeometry.json --material-file=/wirechamberhomogeneousmaterial.json --grid-file=<detectordirectory>/wirechambersurface_grids.json --input-events=10 --constraint-step-size-mm=1 --search-window 3:3 ```

Users can open the performance root files (with --check-performance=true) and draw the histograms.

sh $ root -l performance_track_finding.root root [0] Attaching file performance_track_finding.root as _file0... (TFile *) 0x3871910 root [1] finding_trackeff_vs_eta->Draw()

Contributing

Code formatting

The traccc code is formatted using clang-format; the recommended way to ensure that your code is properly formatted is to use pre-commit. The pre-commit webpage has a useful guide for using the tool, but the simplest way of using it (without installing it as a pre-commit hook) is as follows. First, install the tool with your favourite Python package manager:

```console

With pip

$ pip install pre-commit

With pipx

$ pip install pre-commit ```

The install step needs to be executed only once. After that, the code can be easily formatted as follows:

console $ pre-commit run --all-files

Continuous benchmark

Monitoring the event throughput of track reconstruction with the toy geometry

  • Number of events: 100
  • Number of tracks per event: 5000
  • Algorithms used: seeding, track finding and track fitting

Troubleshooting

The following are potentially useful instructions for troubleshooting various problems with your build:

CUDA

Incompatible host compiler

You may experience errors being issued about standard library features, for example:

/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’ /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’: 530 | operator=(_Functor&& __f)

In this case, your nvcc host compiler is most likely incompatible with your CUDA toolkit. Consider installing a supported version and selecting it through the CUDAHOSTCXX environment variable at build-time.

ptxas failures due to non-ASCII characters

You may encounter errors that look like the following:

ptxas fatal : Unexpected non-ASCII character encountered on line 30 ptxas fatal : Ptx assembly aborted due to errors

This means that you are compiling with a version later than CUDA 12.8 which has not been fixed and you are running in debug mode. This error is due to a bug in the CUDA toolkit. Either downgrade to CUDA 12.6 or disable the debug build.

Owner

  • Name: Acts
  • Login: acts-project
  • Kind: organization

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 45
  • Total pull requests: 517
  • Average time to close issues: 6 months
  • Average time to close pull requests: 22 days
  • Total issue authors: 7
  • Total pull request authors: 25
  • Average comments per issue: 0.76
  • Average comments per pull request: 1.85
  • Merged pull requests: 336
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 23
  • Pull requests: 343
  • Average time to close issues: 10 days
  • Average time to close pull requests: 5 days
  • Issue authors: 5
  • Pull request authors: 16
  • Average comments per issue: 0.39
  • Average comments per pull request: 1.69
  • Merged pull requests: 210
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • stephenswat (20)
  • beomki-yeo (13)
  • krasznaa (8)
  • asalzburger (1)
  • StewMH (1)
  • chavid (1)
  • bwynneHEP (1)
Pull Request Authors
  • stephenswat (169)
  • beomki-yeo (117)
  • krasznaa (116)
  • niermann999 (41)
  • StewMH (18)
  • CrossR (12)
  • SylvainJoube (7)
  • fredevb (6)
  • paulgessinger (5)
  • noyaboy (3)
  • fiedlerp (3)
  • flg (3)
  • arkslobodkins (2)
  • shimasnd (2)
  • 16willthompson (2)
Top Labels
Issue Labels
bug (16) performance (6) build (6) feature (5) physics (5) good first issue (4) cuda (4) improvement (4) sycl (4) cicd (4) shared (3) tests (2) high prioirity (2) help wanted (1)
Pull Request Labels
bug (81) build (73) cuda (50) feature (45) improvement (45) sycl (37) examples (31) cpu (26) shared (25) performance (23) refactor (23) tests (20) cicd (19) cleanup (15) alpaka (15) edm (14) kokkos (9) physics (8) extras (6) high priority (5) formatting (3) documentation (3) high prioirity (3) AI assistance (2) futhark (1) dependencies (1) hip (1)

Dependencies

.github/workflows/builds.yml actions
  • actions/checkout v2 composite
.github/workflows/checks.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v1 composite