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

Library for a GPU-friendly tracking geometry description and propagation

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

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 (13.7%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Library for a GPU-friendly tracking geometry description and propagation

Basic Info
  • Host: GitHub
  • Owner: acts-project
  • License: mpl-2.0
  • Language: C++
  • Default Branch: main
  • Homepage:
  • Size: 75.4 MB
Statistics
  • Stars: 11
  • Watchers: 3
  • Forks: 22
  • Open Issues: 28
  • Releases: 118
Created over 5 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

detray

Test Status Lint Status Quality Gate Status

Detray is part of the ACTS project (R&D line for parallelization).

This is a modern, C++20 header-only library providing a GPU-friendly tracking detector description using different linear algebra libraries. It follows the navigation and propagation concept of ACTS, but implementing a geometry using a flat memory layout and no abstract interfaces (virtual functions). A detray detector can therefore be constructed on the host and copied to an accelerator device in a straight-forward way.

With the geometry description comes a fully featured, GPU-ready track state propagation implementation in inhomogeneous magnetic fields (vector field description using covfie), with track parameter covariance transport including material interactions.

Requirements and Dependencies

OS & Compilers:

  • The C++ compiler must support C++20
  • The CUDA Toolkit version must be greater than major version 11

Dependencies:

  • CMake (version >= 3.21)

Getting started

The respository should build "out of the box", with standard CMake build procedures.

shell git clone https://github.com/acts-project/detray.git cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -S detray -B detray-build cmake --build detray-build

For unit and integration tests using the Open Data Detector (ODD) solenoid field, a magnetic field map file in covfie format needs to be downloaded and the corresponding environment variable should be set to: shell cd detray/data bash detray_data_get_files.sh export DETRAY_BFIELD_FILE="${PWD}/odd-bfield_v0_9_0.cvf"

Build options

A number of cmake preset configurations are provided and can be listed by: shell cmake -S detray --list-presets For a developer build, the dev-fp32 and dev-fp64 configurations are available (fp: floating point precision): shell cmake -S detray -B detray-build --preset dev-fp32 The developer presets will fetch all dependencies, but not automatically trigger the build of additional detray components. For example, in order to trigger the build of the unit tests, the corresponding option needs to be specified: shell cmake -S detray -B detray-build --preset dev-fp32 \ -DDETRAY_BUILD_UNITTESTS=ON A full build, containing all components (e.g. tests and benchmarks), can be configured using the full-fp32 and full-fp64 presets.

The following cmake options are available and can also be specified explicitly for any preset:

| Option | Description | Default | | --- | --- | --- | | DETRAYBUILDCUDA | Build the CUDA sources included in detray | ON (if available) | | DETRAYBUILDSYCL | Build the SYCL sources included in detray | OFF | | DETRAYBUILDTESTUTILS | Build the detray test utilities library (contains e.g. test detectors) | OFF | | DETRAYBUILDUNITTESTS | Build the detray unit tests | OFF | | DETRAYBUILDINTEGRATIONTESTS | Build the detray integration tests | OFF | | DETRAYBUILDALLTESTS | Build the detray unit and integration tests | OFF | | DETRAYBUILDBENCHMARKS | Build the detray benchmarks | OFF | | DETRAYBUILDCLITOOLS | Build the detray command line tools | OFF | | DETRAYBUILDTUTORIALS | Build the examples of detray | OFF | | DETRAYCUSTOMSCALARTYPE | Floating point precision | double | | DETRAYEIGENPLUGIN | Build Eigen math plugin | OFF | | DETRAYSMATRIXPLUGIN | Build ROOT/SMatrix math plugin | OFF | | DETRAYVCAOSPLUGIN | Build Vc based AoS math plugin | OFF | | DETRAYVCSOAPLUGIN | Build Vc based SoA math plugin (currently only supports the ray-surface intersectors) | OFF | | DETRAYSVG_DISPLAY | Build ActSVG display module | OFF |

Tutorials

In the tutorials folder of the repository, there are a number of standalone executables that showcase different tasks: - Building a detector (either a predefined one or designing a detector from scatch) - Detector file IO - Additional debugging options, like performing a ray scan or obtaining extra navigation tracing information - Moving a detector to device - Host and device track propagation

Detector Validation

Given a detray detector (and optionally also a grid and a material) json file, a number of validation test can be run from the command-line. For this, the library has to be built with the -DDETRAY_BUILD_CLI_TOOLS=ON option enabled. An example detector file can then be obtained using e.g. shell detray-build/bin/detray_generate_toy_detector --write_material --write_grids All of the validation tools presented in the following can also be run as part of a corresponding python script which takes the same arguments and will automatically create plots from the collected data. However, this requires Python 3, pandas, SciPy and NumPy, as well as Matplotlib to be available.

The detector geometry can be visualized in SVG format with the following command: shell detray-build/bin/detray_detector_display \ --geometry_file ./toy_detector/toy_detector_geometry.json The tool can also display single volumes or surfaces, as well as the navigation grids and material maps (the corresponding json files need to loaded in this case). For an overview of all available options for the command-line tools add --help.

Navigation Validation

In order to validate that the navigation works correctly in a given detector geometry, run the detector validation tool. It will first perform a consistency check on the detector, followed by a "ray scan" of the detector. The scan result will be compared to a full straight-line navigation run for every ray. After that, the navigation in a constant magnetic field of 2T is being tested in a similar fashion, using parameterized helix trajectories and a Newton-Raphson/Bisection algorithm to generate the truth intersections. For example: shell detray-build/bin/detray_navigation_validation \ --geometry_file ./toy_detector/toy_detector_geometry.json \ --grid_file ./toy_detector/toy_detector_surface_grids.json \ --search_window 3 3 --n_tracks 100 --pT_range 0.5 100 In case of failures, this command will give a detailed debug output in the form of a log file, as well as an SVG representation of the failed tracks. The grid file is optional, but will trigger the use of spacial grids as acceleration structures during the navigation run.

Note: The search_window option defines the size of lookup area of the grid acceleration structure and is therefore detector dependent! Use --search_window 3 3 (or larger) for the toy detector and wire chamber example detectors and --search_window 0 0 otherwise.

Material Validation

This tool checks whether the navigator picks up the material correctly by comparing the material found during a ray scan with the material collected during navigation by a specialized actor: shell detray-build/bin/detray_material_validation \ --geometry_file ./toy_detector/toy_detector_geometry.json \ --material_file ./toy_detector/toy_detector_homogeneous_material.json \ --phi_steps 100 --eta_steps 100 --eta_range -4 4 Note: The correct material file must be loaded in addition to the geometry file!

Benchmarks

A number of benchmarks exist, which are based on the google benchmark library, and can be run from command-line. For this, the -DDETRAY_BUILD_BENCHMARKS=ON and -DDETRAY_BUILD_CLI_TOOLS=ON flags need to be specified. Then pass the detray detector file(s) and additional options to the benchmark tools for the different hardware backends: shell detray-build/bin/detray_propagation_benchmark_<backend>_<algebra> \ --geometry_file ./toy_detector/toy_detector_geometry.json \ --grid_file ./toy_detector/toy_detector_surface_grids.json \ --material_file ./toy_detector/toy_detector_homogeneous_material.json \ --sort_tracks --randomize_charge --eta_range -3 3 --pT_range 0.5 100 \ --search_window 3 3 --covariance_transport --bknd_name [HW_BACKEND_NAME] For every algebra-plugin that was built, a corresponding benchmark executable will be present. The CPU-backend benchmark is built by default and the CUDA-backend benchmark will be available if detray was built with CUDA enabled (-DDETRAY_BUILD_CUDA=ON). This executable can additionally be configured with any arguments targeted at google benchmark.

If the data is dumped into json files using the options --benchmark_repetitions=N (N standing for the number of repetitions), --benchmark_display_aggregates_only=true, as well as --benchmark_out_format=json and --benchmark_out=<some_file_name>.json, it can afterwards be plotted with e.g.: shell python3 detray/tests/tools/python/propagation_benchmarks.py \ --geometry_file ./toy_detector/toy_detector_geometry.json \ --data_files [FILES]...

Continuous benchmark

Monitoring the propagation throughput with the toy geometry per commit:

Owner

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

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 23
  • Total pull requests: 504
  • Average time to close issues: 11 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 4
  • Total pull request authors: 16
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.45
  • Merged pull requests: 361
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 8
  • Pull requests: 322
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 8 days
  • Issue authors: 4
  • Pull request authors: 13
  • Average comments per issue: 0.38
  • Average comments per pull request: 1.48
  • Merged pull requests: 226
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • beomki-yeo (10)
  • niermann999 (10)
  • stephenswat (2)
  • asalzburger (1)
Pull Request Authors
  • niermann999 (262)
  • beomki-yeo (112)
  • stephenswat (67)
  • krasznaa (15)
  • tsulaiav (13)
  • Larb-YasmineBadrElhouda (10)
  • StewMH (5)
  • paulgessinger (5)
  • wermos (4)
  • fredevb (4)
  • asalzburger (2)
  • georgi-mania (1)
  • flg (1)
  • CrossR (1)
  • JasmijnB (1)
Top Labels
Issue Labels
bug (7) refactor (5) enhancement (3) priority: low (3) priority: high (2) help wanted (2) priority: medium (1) question (1)
Pull Request Labels
bug (108) enhancement (108) refactor (99) priority: low (66) priority: high (64) priority: medium (34) performance (19) build (13) cleanup (13) optimization (13) blocked (4) documentation (2) question (1)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 38
  • Total maintainers: 1
spack.io: detray

Detray is a description library for high energy physics experiments that works entirely without polymorphism, making it exceptionally suitable for use on GPU platforms.

  • Versions: 38
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 29.1%
Dependent packages count: 58.2%
Maintainers (1)
Last synced: 10 months ago

Dependencies

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