Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/acts-project/traccc into an…
Browse files Browse the repository at this point in the history
…nulus_shape_measurement
  • Loading branch information
beomki-yeo committed Feb 1, 2024
2 parents 747d37b + 3d591e8 commit bb2e645
Show file tree
Hide file tree
Showing 96 changed files with 1,114 additions and 859 deletions.
2 changes: 1 addition & 1 deletion .github/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -e # abort on error

INCLUDE_DIRS=("core device examples io tests performance plugins")
INCLUDE_DIRS=("core device examples io tests performance plugins simulation")

if [ $# -ne 1 ]; then
echo "wrong number of arguments"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@
*.exe
*.out
*.app

# VSCode build output.
out/
20 changes: 10 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# TRACCC library, part of the ACTS project (R&D line)
#
# (c) 2022-2023 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

stages:
- build
- test
Expand All @@ -8,24 +14,19 @@ build_cuda:
stage: build
image: ghcr.io/acts-project/ubuntu2004_cuda:v30
artifacts:
paths:
paths:
- build
script:
- git clone $CLONE_URL src
- git -C src checkout $HEAD_SHA
- >
cmake -S src -B build -GNinja
-DCMAKE_BUILD_TYPE=Release
-DTRACCC_BUILD_TESTING=ON
-DTRACCC_BUILD_CUDA=ON
- cmake --build build

- cmake --preset cuda -DCMAKE_BUILD_TYPE=Release -S src -B build -G Ninja
- cmake --build build --parallel 2

test_cuda:
stage: test
tags: [docker-gpu-nvidia]
image: ghcr.io/acts-project/ubuntu2004_cuda:v30
needs:
needs:
- build_cuda
script:
- git clone $CLONE_URL src
Expand All @@ -36,4 +37,3 @@ test_cuda:
- cd build
- nvidia-smi
- ctest --output-on-failure -E "^SeedingValidation/CompareWithActsSeedingTests.*"

7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"files.associations": {
"*.hip": "cpp",
"*.sycl": "cpp",
"*.ipp": "cpp"
}
}
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set( CMAKE_CXX_EXTENSIONS FALSE CACHE BOOL "Disable (host) C++ extensions" )
set( CMAKE_CUDA_STANDARD 17 CACHE STRING "The (CUDA) C++ standard to use" )
set( CMAKE_CUDA_EXTENSIONS FALSE CACHE BOOL "Disable (CUDA) C++ extensions" )
set( CMAKE_SYCL_STANDARD 17 CACHE STRING "The (SYCL) C++ standard to use" )
set( CMAKE_HIP_STANDARD 17 CACHE STRING "The (HIP) C++ standard to use" )

# Flag controlling whether warnings should make the build fail.
option( TRACCC_FAIL_ON_WARNINGS
Expand Down
83 changes: 83 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"version" : 3,
"configurePresets": [
{
"name" : "base",
"displayName" : "Base Configuration",
"warnings": {
"deprecated": true
},
"cacheVariables": {
"CMAKE_BUILD_TYPE" : "RelWithDebInfo",
"TRACCC_BUILD_TESTING" : "TRUE",
"TRACCC_BUILD_EXAMPLES" : "TRUE",
"TRACCC_FAIL_ON_WARNINGS" : "TRUE",
"TRACCC_USE_ROOT" : "FALSE"
}
},
{
"name" : "cuda",
"displayName" : "CUDA Code Development",
"inherits": ["base"],
"cacheVariables": {
"TRACCC_BUILD_CUDA" : "TRUE",
"VECMEM_BUILD_CUDA_LIBRARY" : "TRUE"
}
},
{
"name" : "sycl",
"displayName" : "SYCL Code Development",
"inherits": ["base"],
"cacheVariables": {
"TRACCC_BUILD_SYCL" : "TRUE",
"VECMEM_BUILD_SYCL_LIBRARY" : "TRUE"
}
},
{
"name" : "alpaka",
"displayName" : "Alpaka Code Development",
"inherits": ["cuda"],
"cacheVariables": {
"TRACCC_BUILD_ALPAKA" : "TRUE"
}
},
{
"name" : "kokkos",
"displayName" : "Kokkos Code Development",
"inherits": ["cuda"],
"cacheVariables": {
"TRACCC_BUILD_KOKKOS" : "TRUE"
}
},
{
"name" : "root",
"displayName" : "ROOT Enabled Code Development",
"inherits": ["base"],
"cacheVariables": {
"TRACCC_USE_ROOT" : "TRUE",
"TRACCC_USE_SYSTEM_TBB" : "TRUE"
}
},
{
"name" : "array",
"displayName" : "ARRAY Backended Code Development",
"inherits": ["base"],
"cacheVariables": {
"TRACCC_ALGEBRA_PLUGINS" : "ARRAY"
}
},
{
"name" : "eigen",
"displayName" : "EIGEN Backended Code Development",
"inherits": ["base"],
"cacheVariables": {
"TRACCC_ALGEBRA_PLUGINS" : "EIGEN"
}
},
{
"name" : "default",
"displayName": "Default Build Configuration",
"inherits": ["root", "array"]
}
]
}
46 changes: 15 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,45 +234,29 @@ cmake --build <build_directory> <options>
### CPU reconstruction chain

```sh
<build_directory>/bin/traccc_seq_example --detector_file=tml_detector/trackml-detector.csv --digitization_config_file=tml_detector/default-geometric-config-generic.json --input_directory=tml_pixels/ --events=10
<build_directory>/bin/traccc_seq_example --detector-file=tml_detector/trackml-detector.csv --digitization-config-file=tml_detector/default-geometric-config-generic.json --input-directory=tml_pixels/ --events=10

<build_directory>/bin/traccc_throughput_mt --detector_file=tml_detector/trackml-detector.csv --digitization_config_file=tml_detector/default-geometric-config-generic.json --input_directory=tml_pixels/ --cold_run_events=100 --processed_events=1000 --threads=1
<build_directory>/bin/traccc_throughput_mt --detector-file=tml_detector/trackml-detector.csv --digitization-config-file=tml_detector/default-geometric-config-generic.json --input-directory=tml_pixels/ --cold-run-events=100 --processed-events=1000 --threads=1
```

### CUDA reconstruction chain

- Users can generate CUDA examples by adding `-DTRACCC_BUILD_CUDA=ON` to cmake options

```sh
<build_directory>/bin/traccc_seq_example_cuda --detector_file=tml_detector/trackml-detector.csv --digitization_config_file=tml_detector/default-geometric-config-generic.json --input_directory=tml_pixels/ --events=10 --run_cpu=1
<build_directory>/bin/traccc_seq_example_cuda --detector-file=tml_detector/trackml-detector.csv --digitization-config-file=tml_detector/default-geometric-config-generic.json --input-directory=tml_pixels/ --events=10 --run-cpu=1

<build_directory>/bin/traccc_throughput_mt_cuda --detector_file=tml_detector/trackml-detector.csv --digitization_config_file=tml_detector/default-geometric-config-generic.json --input_directory=tml_pixels/ --cold_run_events=100 --processed_events=1000 --threads=1
```

```sh
# Toy geometry examples
<build_directory>/bin/traccc_simulate_toy_detector --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 --events=10 --gen-nparticles=2000 --output_directory=detray_simulation/toy_detector/n_particles_2000/ --gen-eta=-3:3 --constraint-step-size-mm=1

<build_directory>/bin/traccc_seeding_example_cuda --input_directory=detray_simulation/toy_detector/n_particles_2000/ --check_performance=true --detector_file=<detector_directory>/toy_detector_geometry.json --material_file=<detector_directory>/toy_detector_homogeneous_material.json --grid_file=<detector_directory>/toy_detector_surface_grids.json --event=1 --track_candidates_range=3:30 --constraint-step-size-mm=1000 --run_cpu=1

<build_directory>/bin/traccc_truth_finding_example_cuda --input_directory=detray_simulation/toy_detector/n_particles_2000/ --check_performance=true --detector_file=<detector_directory>/toy_detector_geometry.json --material_file=<detector_directory>/toy_detector_homogeneous_material.json --grid_file=<detector_directory>/toy_detector_surface_grids.json --event=1 --track_candidates_range=3:30 --constraint-step-size-mm=1 --run_cpu=1
```

```sh
# Wire chamber examples
<build_directory>/bin/traccc_simulate_wire_chamber --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 --events=10 --gen-nparticles=1000 --output_directory=detray_simulation/wire_chamber/n_particles_1000/ --gen-eta=-1:1 --constraint-step-size-mm=1

<build_directory>/bin/traccc_truth_finding_example_cuda --input_directory=detray_simulation/wire_chamber/n_particles_1000/ --check_performance=true --detector_file=<detector_directory>/wire_chamber_geometry.json --material_file=<detector_directory>/wire_chamber_homogeneous_material.json --grid_file=<detector_directory>/wire_chamber_surface_grids.json --event=10 --track_candidates_range=6:30 --constraint-step-size-mm=1
<build_directory>/bin/traccc_throughput_mt_cuda --detector-file=tml_detector/trackml-detector.csv --digitization-config-file=tml_detector/default-geometric-config-generic.json --input-directory=tml_pixels/ --cold-run-events=100 --processed-events=1000 --threads=1
```

### SYCL reconstruction chain

- Users can generate SYCL examples by adding `-DTRACCC_BUILD_SYCL=ON` to cmake options

```sh
<build_directory>/bin/traccc_seq_example_sycl --detector_file=tml_detector/trackml-detector.csv --digitization_config_file=tml_detector/default-geometric-config-generic.json --input_directory=tml_pixels/ --events=10 --run_cpu=1
<build_directory>/bin/traccc_seq_example_sycl --detector-file=tml_detector/trackml-detector.csv --digitization-config-file=tml_detector/default-geometric-config-generic.json --input-directory=tml_pixels/ --events=10 --run-cpu=1

<build_directory>/bin/traccc_throughput_mt_sycl --detector_file=tml_detector/trackml-detector.csv --digitization_config_file=tml_detector/default-geometric-config-generic.json --input_directory=tml_pixels/ --cold_run_events=100 --processed_events=1000 --threads=1
<build_directory>/bin/traccc_throughput_mt_sycl --detector-file=tml_detector/trackml-detector.csv --digitization-config-file=tml_detector/default-geometric-config-generic.json --input-directory=tml_pixels/ --cold-run-events=100 --processed-events=1000 --threads=1
```

### Running a partial chain with simplified simulation data
Expand All @@ -281,13 +265,13 @@ Users can generate muon-like particle simulation data with the pre-built detray

```sh
# Generate telescope geometry data
<build_directory>/bin/traccc_simulate_telescope --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 --events=10 --gen-nparticles=2000 --output_directory=detray_simulation/telescope_detector/n_particles_2000/ --gen-eta=1:3
<build_directory>/bin/traccc_simulate_telescope --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 --events=10 --gen-nparticles=2000 --output-directory=detray_simulation/telescope_detector/n_particles_2000/ --gen-eta=1:3

# Generate toy geometry data
<build_directory>/bin/traccc_simulate_toy_detector --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 --events=10 --gen-nparticles=2000 --output_directory=detray_simulation/toy_detector/n_particles_2000/ --gen-eta=-3:3 --constraint-step-size-mm=1
<build_directory>/bin/traccc_simulate_toy_detector --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 --events=10 --gen-nparticles=2000 --output-directory=detray_simulation/toy_detector/n_particles_2000/ --gen-eta=-3:3 --constraint-step-size-mm=1

# Generate drift chamber data
<build_directory>/bin/traccc_simulate_wire_chamber --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 --events=10 --gen-nparticles=100 --output_directory=detray_simulation/wire_chamber/n_particles_100/ --gen-eta=-1:1 --constraint-step-size-mm=1
<build_directory>/bin/traccc_simulate_wire_chamber --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 --events=10 --gen-nparticles=100 --output-directory=detray_simulation/wire_chamber/n_particles_100/ --gen-eta=-1:1 --constraint-step-size-mm=1
```

The simulation will also generate the detector json files (geometry, material and surface_grid) in the current directory. It is user's responsibility to move them to an appropriate place (e.g. `<detector_directory>`) and match them to the input file arguments of reconstruction chains.
Expand All @@ -296,7 +280,7 @@ If users have a geometry json file already, it is also possible to run simulatio

```sh
# Given that users have a geometry json file
<build_directory>/bin/traccc_simulate --output_directory=<output_directory> --detector_file=<geometry_file> --material_file=<material_file> --grid_file=<grid_file> --event=10 --constraint-step-size-mm=1
<build_directory>/bin/traccc_simulate --output-directory=<output-directory> --detector-file=<geometry_file> --material-file=<material-file> --grid-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.
Expand All @@ -311,25 +295,25 @@ The dirft chamber will not produce meaningful results with `seeding_example` as

```sh
# Run cuda seeding example for toy geometry
<build_directory>/bin/traccc_seeding_example_cuda --input_directory=detray_simulation/toy_detector/n_particles_2000/ --check_performance=true --detector_file=<detector_directory>/toy_detector_geometry.json --material_file=<detector_directory>/toy_detector_homogeneous_material.json --grid_file=<detector_directory>/toy_detector_surface_grids.json --event=1 --track_candidates_range=3:30 --constraint-step-size-mm=1000 --run_cpu=1
<build_directory>/bin/traccc_seeding_example_cuda --input-directory=detray_simulation/toy_detector/n_particles_2000/ --check-performance=true --detector-file=<detector_directory>/toy_detector_geometry.json --material-file=<detector_directory>/toy_detector_homogeneous_material.json --grid-file=<detector_directory>/toy_detector_surface_grids.json --event=1 --track-candidates-range=3:30 --constraint-step-size-mm=1000 --run-cpu=1
```

```sh
# Run cuda truth finding example for toy geometry
<build_directory>/bin/traccc_truth_finding_example_cuda --input_directory=detray_simulation/toy_detector/n_particles_2000/ --check_performance=true --detector_file=<detector_directory>/toy_detector_geometry.json --material_file=<detector_directory>/toy_detector_homogeneous_material.json --grid_file=<detector_directory>/toy_detector_surface_grids.json --event=1 --track_candidates_range=3:30 --constraint-step-size-mm=1000 --run_cpu=1
<build_directory>/bin/traccc_truth_finding_example_cuda --input-directory=detray_simulation/toy_detector/n_particles_2000/ --check-performance=true --detector-file=<detector_directory>/toy_detector_geometry.json --material-file=<detector_directory>/toy_detector_homogeneous_material.json --grid-file=<detector_directory>/toy_detector_surface_grids.json --event=1 --track-candidates-range=3:30 --constraint-step-size-mm=1000 --run-cpu=1
```

```sh
# Run cuda truth finding example for drift chamber
<build_directory>/bin/traccc_truth_finding_example_cuda --input_directory=detray_simulation/wire_chamber/n_particles_100/ --check_performance=true --detector_file=<detector_directory>/wire_chamber_geometry.json --material_file=<detector_directory>/wire_chamber_homogeneous_material.json --grid_file=<detector_directory>/wire_chamber_surface_grids.json --event=10 --track_candidates_range=6:30 --constraint-step-size-mm=1 --run_cpu=1
<build_directory>/bin/traccc_truth_finding_example_cuda --input-directory=detray_simulation/wire_chamber/n_particles_100/ --check-performance=true --detector-file=<detector_directory>/wire_chamber_geometry.json --material-file=<detector_directory>/wire_chamber_homogeneous_material.json --grid-file=<detector_directory>/wire_chamber_surface_grids.json --event=10 --track-candidates-range=6:30 --constraint-step-size-mm=1 --run-cpu=1
```

```sh
# Run cpu truth fitting example for drift chamber
<build_directory>/bin/traccc_truth_fitting_example --input_directory=detray_simulation/wire_chamber/n_particles_2000_100GeV/ --check_performance=true --detector_file=<detector_directory>/wire_chamber_geometry.json --material_file=<detector_directory>/wire_chamber_homogeneous_material.json --grid_file=<detector_directory>/wire_chamber_surface_grids.json --event=10 --constraint-step-size-mm=1
<build_directory>/bin/traccc_truth_fitting_example --input-directory=detray_simulation/wire_chamber/n_particles_2000_100GeV/ --check-performance=true --detector-file=<detector_directory>/wire_chamber_geometry.json --material-file=<detector_directory>/wire_chamber_homogeneous_material.json --grid-file=<detector_directory>/wire_chamber_surface_grids.json --event=10 --constraint-step-size-mm=1
```

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

```sh
$ root -l performance_track_finding.root
Expand Down
1 change: 0 additions & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ traccc_add_library( traccc_core core TYPE SHARED
"include/traccc/geometry/pixel_data.hpp"
# Utilities.
"include/traccc/utils/algorithm.hpp"
"include/traccc/utils/compare.hpp"
"include/traccc/utils/type_traits.hpp"
"include/traccc/utils/memory_resource.hpp"
"include/traccc/utils/seed_generator.hpp"
Expand Down
4 changes: 2 additions & 2 deletions core/include/traccc/edm/track_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace traccc {

/// Fitting result per track
template <typename algebra_t>
struct fitter_info {
struct fitting_result {
using scalar_type = typename algebra_t::scalar_type;

/// Fitted track parameter
Expand Down Expand Up @@ -174,6 +174,6 @@ using track_state_collection_types = collection_types<track_state<transform3>>;

/// Declare all track_state container types
using track_state_container_types =
container_types<fitter_info<transform3>, track_state<transform3>>;
container_types<fitting_result<transform3>, track_state<transform3>>;

} // namespace traccc
5 changes: 4 additions & 1 deletion core/include/traccc/finding/candidate_link.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ struct candidate_link {

// Measurement index
unsigned int meas_idx;

// Index to the initial seed
unsigned int seed_idx;
};

} // namespace traccc
} // namespace traccc
Loading

0 comments on commit bb2e645

Please sign in to comment.