Skip to content

Commit 1015d44

Browse files
authored
Use bfield interpolation rather than NN (acts-project#617)
I believe the trilinear interpolation should be used instead of the nearest neighbor (NN) method. The interpolation is what Geant4 and Acts are using with RKN method - If we want to use the NN method, we need to prove that it doesn't harm the performanc first.
1 parent ac96097 commit 1015d44

7 files changed

Lines changed: 20 additions & 12 deletions

File tree

.github/workflows/builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
# Set the path to the test data files
7474
env:
7575
DETRAY_DATA_DIRECTORY: ${{ github.workspace }}/data/
76-
DETRAY_BFIELD_FILE: ${{ github.workspace }}/data/odd-bfield_v0_8_0.cvf
76+
DETRAY_BFIELD_FILE: ${{ github.workspace }}/data/odd-bfield_v0_9_0.cvf
7777

7878
# The build/test steps to execute.
7979
steps:

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ build_cuda:
2828
test_cuda:
2929
variables:
3030
DETRAY_DATA_DIRECTORY: src/data/
31-
DETRAY_BFIELD_FILE: $CI_PROJECT_DIR/src/data/odd-bfield_v0_8_0.cvf
31+
DETRAY_BFIELD_FILE: $CI_PROJECT_DIR/src/data/odd-bfield_v0_9_0.cvf
3232
stage: test
3333
tags: [docker-gpu-nvidia]
3434
image: ghcr.io/acts-project/ubuntu2004_cuda:v30

data/detray_data_get_files.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ usage() {
2727
}
2828

2929
# Default script arguments.
30-
DETRAY_DATA_NAME=${DETRAY_DATA_NAME:-"detray-data-v1"}
30+
DETRAY_DATA_NAME=${DETRAY_DATA_NAME:-"detray-data-v2"}
3131
DETRAY_WEB_DIRECTORY=${DETRAY_WEB_DIRECTORY:-"https://acts.web.cern.ch/traccc/data"}
3232
DETRAY_DATA_DIRECTORY=${DETRAY_DATA_DIRECTORY:-$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)}
3333
DETRAY_CMAKE_EXECUTABLE=${DETRAY_CMAKE_EXECUTABLE:-cmake}

extern/covfie/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ message( STATUS "Fetching covfie as part of the Detray project" )
1818

1919
# Declare where to get covfie from.
2020
set( DETRAY_COVFIE_SOURCE
21-
"URL;https://github.com/acts-project/covfie/archive/refs/tags/v0.8.1.tar.gz;URL_MD5;0b4dc9624533d1ed4ea7a763da47f07e"
21+
"URL;https://github.com/acts-project/covfie/archive/refs/tags/v0.9.0.tar.gz;URL_MD5;b310712c6dd1acc8104c734086f40fc0"
2222
CACHE STRING "Source for covfie, when built as part of this project" )
2323
mark_as_advanced( DETRAY_COVFIE_SOURCE )
2424
FetchContent_Declare( covfie ${DETRAY_COVFIE_SOURCE} )

tests/unit_tests/device/cuda/propagator_cuda_kernel.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ namespace detray {
2424
namespace bfield::cuda {
2525

2626
// Inhomogeneous field (cuda)
27-
using inhom_bknd_t = covfie::backend::affine<
28-
covfie::backend::nearest_neighbour<covfie::backend::strided<
29-
covfie::vector::ulong3, covfie::backend::cuda_device_array<
30-
covfie::vector::vector_d<scalar, 3>>>>>;
27+
using inhom_bknd_t = covfie::backend::affine<covfie::backend::linear<
28+
covfie::backend::strided<covfie::vector::vector_d<std::size_t, 3>,
29+
covfie::backend::cuda_device_array<
30+
covfie::vector::vector_d<scalar, 3>>>>>;
3131

3232
} // namespace bfield::cuda
3333

tutorials/src/device/cuda/propagation.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ namespace detray::tutorial {
3131
namespace bfield::cuda {
3232

3333
// Inhomogeneous field (cuda)
34-
using inhom_bknd_t = covfie::backend::affine<
35-
covfie::backend::nearest_neighbour<covfie::backend::strided<
36-
covfie::vector::ulong3,
34+
using inhom_bknd_t =
35+
covfie::backend::affine<covfie::backend::linear<covfie::backend::strided<
36+
covfie::vector::vector_d<std::size_t, 3>,
3737
covfie::backend::cuda_device_array<
3838
covfie::vector::vector_d<detray::scalar, 3>>>>>;
3939

utils/include/detray/detectors/bfield.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
// Covfie include(s)
1515
#include <covfie/core/backend/primitive/constant.hpp>
1616
#include <covfie/core/backend/transformer/affine.hpp>
17+
#include <covfie/core/backend/transformer/linear.hpp>
1718
#include <covfie/core/backend/transformer/nearest_neighbour.hpp>
1819
#include <covfie/core/backend/transformer/strided.hpp>
1920
#include <covfie/core/field.hpp>
21+
#include <covfie/core/vector.hpp>
2022

2123
namespace detray::bfield {
2224

@@ -28,7 +30,13 @@ using const_bknd_t =
2830
using const_field_t = covfie::field<const_bknd_t>;
2931

3032
/// Inhomogeneous field (host)
31-
using inhom_bknd_t = covfie::backend::affine<
33+
using inhom_bknd_t =
34+
covfie::backend::affine<covfie::backend::linear<covfie::backend::strided<
35+
covfie::vector::vector_d<std::size_t, 3>,
36+
covfie::backend::array<covfie::vector::vector_d<detray::scalar, 3>>>>>;
37+
38+
/// Inhomogeneous field with nearest neighbor (host)
39+
using inhom_bknd_nn_t = covfie::backend::affine<
3240
covfie::backend::nearest_neighbour<covfie::backend::strided<
3341
covfie::vector::ulong3,
3442
covfie::backend::array<covfie::vector::vector_d<detray::scalar, 3>>>>>;

0 commit comments

Comments
 (0)