Skip to content

Commit aeccc21

Browse files
committed
traccc::detector_description -> traccc::silicon_detector_description.
In preparation for introducing detector description objects for other types of detectors as well later on.
1 parent 4ec38cf commit aeccc21

File tree

84 files changed

+244
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+244
-223
lines changed

core/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ traccc_add_library( traccc_core core TYPE SHARED
3333
"include/traccc/edm/cell.hpp"
3434
# Geometry description.
3535
"include/traccc/geometry/detector.hpp"
36-
"include/traccc/geometry/detector_description.hpp"
3736
"include/traccc/geometry/module_map.hpp"
3837
"include/traccc/geometry/geometry.hpp"
3938
"include/traccc/geometry/pixel_data.hpp"
39+
"include/traccc/geometry/silicon_detector_description.hpp"
4040
# Utilities.
4141
"include/traccc/utils/algorithm.hpp"
4242
"include/traccc/utils/type_traits.hpp"

core/include/traccc/clusterization/clusterization_algorithm.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "traccc/clusterization/sparse_ccl_algorithm.hpp"
1313
#include "traccc/edm/cell.hpp"
1414
#include "traccc/edm/measurement.hpp"
15-
#include "traccc/geometry/detector_description.hpp"
15+
#include "traccc/geometry/silicon_detector_description.hpp"
1616
#include "traccc/utils/algorithm.hpp"
1717

1818
// VecMem include(s).
@@ -32,7 +32,7 @@ namespace traccc::host {
3232
class clusterization_algorithm
3333
: public algorithm<measurement_collection_types::host(
3434
const cell_collection_types::const_view&,
35-
const detector_description::const_view&)> {
35+
const silicon_detector_description::const_view&)> {
3636

3737
public:
3838
using config_type = std::monostate;
@@ -51,7 +51,7 @@ class clusterization_algorithm
5151
///
5252
output_type operator()(
5353
const cell_collection_types::const_view& cells_view,
54-
const detector_description::const_view& dd_view) const override;
54+
const silicon_detector_description::const_view& dd_view) const override;
5555

5656
private:
5757
/// @name Sub-algorithms used by this algorithm

core/include/traccc/clusterization/details/measurement_creation.hpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@
1212
#include "traccc/definitions/qualifiers.hpp"
1313
#include "traccc/edm/cell.hpp"
1414
#include "traccc/edm/measurement.hpp"
15-
#include "traccc/geometry/detector_description.hpp"
15+
#include "traccc/geometry/silicon_detector_description.hpp"
1616

1717
namespace traccc::details {
1818

1919
/// Function used for retrieving the cell signal based on the module id
2020
TRACCC_HOST_DEVICE
21-
inline scalar signal_cell_modelling(scalar signal_in,
22-
const detector_description::const_device&);
21+
inline scalar signal_cell_modelling(
22+
scalar signal_in, const silicon_detector_description::const_device&);
2323

2424
/// Function for pixel segmentation
2525
TRACCC_HOST_DEVICE
2626
inline vector2 position_from_cell(
27-
const cell& cell, const detector_description::const_device& det_descr);
27+
const cell& cell,
28+
const silicon_detector_description::const_device& det_descr);
2829

2930
/// Function used for calculating the properties of the cluster during
3031
/// measurement creation
@@ -38,7 +39,7 @@ inline vector2 position_from_cell(
3839
///
3940
TRACCC_HOST_DEVICE inline void calc_cluster_properties(
4041
const cell_collection_types::const_device& cluster,
41-
const detector_description::const_device& det_descr, point2& mean,
42+
const silicon_detector_description::const_device& det_descr, point2& mean,
4243
point2& var, scalar& totalWeight);
4344

4445
/// Function used for calculating the properties of the cluster during
@@ -54,7 +55,7 @@ TRACCC_HOST_DEVICE inline void fill_measurement(
5455
measurement_collection_types::device& measurements,
5556
measurement_collection_types::device::size_type index,
5657
const cell_collection_types::const_device& cluster,
57-
const detector_description::const_device& det_descr);
58+
const silicon_detector_description::const_device& det_descr);
5859

5960
} // namespace traccc::details
6061

core/include/traccc/clusterization/details/spacepoint_formation.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "traccc/definitions/qualifiers.hpp"
1212
#include "traccc/edm/measurement.hpp"
1313
#include "traccc/edm/spacepoint.hpp"
14-
#include "traccc/geometry/detector_description.hpp"
14+
#include "traccc/geometry/silicon_detector_description.hpp"
1515

1616
namespace traccc::details {
1717

@@ -23,7 +23,7 @@ namespace traccc::details {
2323
///
2424
TRACCC_HOST_DEVICE inline void fill_spacepoint(
2525
spacepoint& sp, const measurement& meas,
26-
const detector_description::const_device& dd);
26+
const silicon_detector_description::const_device& dd);
2727

2828
} // namespace traccc::details
2929

core/include/traccc/clusterization/impl/measurement_creation.ipp

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
namespace traccc::details {
1313

1414
TRACCC_HOST_DEVICE
15-
inline scalar signal_cell_modelling(scalar signal_in,
16-
const detector_description::const_device&) {
15+
inline scalar signal_cell_modelling(
16+
scalar signal_in, const silicon_detector_description::const_device&) {
1717
return signal_in;
1818
}
1919

2020
TRACCC_HOST_DEVICE
2121
inline vector2 position_from_cell(
22-
const cell& cell, const detector_description::const_device& det_descr) {
22+
const cell& cell,
23+
const silicon_detector_description::const_device& det_descr) {
2324

2425
// Retrieve the specific values based on module idx
2526
const cell::link_type module_link = cell.module_link;
@@ -33,7 +34,7 @@ inline vector2 position_from_cell(
3334

3435
TRACCC_HOST_DEVICE inline void calc_cluster_properties(
3536
const cell_collection_types::const_device& cluster,
36-
const detector_description::const_device& det_descr, point2& mean,
37+
const silicon_detector_description::const_device& det_descr, point2& mean,
3738
point2& var, scalar& totalWeight) {
3839

3940
point2 offset{0., 0.};
@@ -79,7 +80,7 @@ TRACCC_HOST_DEVICE inline void fill_measurement(
7980
measurement_collection_types::device& measurements,
8081
const measurement_collection_types::device::size_type index,
8182
const cell_collection_types::const_device& cluster,
82-
const detector_description::const_device& det_descr) {
83+
const silicon_detector_description::const_device& det_descr) {
8384

8485
// To calculate the mean and variance with high numerical stability
8586
// we use a weighted variant of Welford's algorithm. This is a

core/include/traccc/clusterization/impl/spacepoint_formation.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace traccc::details {
1414

1515
TRACCC_HOST_DEVICE inline void fill_spacepoint(
1616
spacepoint& sp, const measurement& meas,
17-
const detector_description::const_device& dd) {
17+
const silicon_detector_description::const_device& dd) {
1818

1919
// Transform measurement position to 3D
2020
const point3 local_3d = {meas.local[0], meas.local[1], 0.f};

core/include/traccc/clusterization/measurement_creation_algorithm.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Library include(s).
1111
#include "traccc/edm/cluster.hpp"
1212
#include "traccc/edm/measurement.hpp"
13-
#include "traccc/geometry/detector_description.hpp"
13+
#include "traccc/geometry/silicon_detector_description.hpp"
1414
#include "traccc/utils/algorithm.hpp"
1515

1616
// VecMem include(s).
@@ -30,7 +30,7 @@ namespace traccc::host {
3030
class measurement_creation_algorithm
3131
: public algorithm<measurement_collection_types::host(
3232
const cluster_container_types::const_view &,
33-
const detector_description::const_view &)> {
33+
const silicon_detector_description::const_view &)> {
3434

3535
public:
3636
/// Measurement_creation algorithm constructor
@@ -48,7 +48,7 @@ class measurement_creation_algorithm
4848
///
4949
output_type operator()(
5050
const cluster_container_types::const_view &clusters_view,
51-
const detector_description::const_view &dd_view) const override;
51+
const silicon_detector_description::const_view &dd_view) const override;
5252

5353
private:
5454
/// The memory resource used by the algorithm

core/include/traccc/clusterization/spacepoint_formation_algorithm.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Library include(s).
1111
#include "traccc/edm/measurement.hpp"
1212
#include "traccc/edm/spacepoint.hpp"
13-
#include "traccc/geometry/detector_description.hpp"
13+
#include "traccc/geometry/silicon_detector_description.hpp"
1414
#include "traccc/utils/algorithm.hpp"
1515

1616
// VecMem include(s).
@@ -29,7 +29,7 @@ namespace traccc::host {
2929
class spacepoint_formation_algorithm
3030
: public algorithm<spacepoint_collection_types::host(
3131
const measurement_collection_types::const_view&,
32-
const detector_description::const_view&)> {
32+
const silicon_detector_description::const_view&)> {
3333

3434
public:
3535
/// Constructor for spacepoint_formation
@@ -47,7 +47,7 @@ class spacepoint_formation_algorithm
4747
///
4848
output_type operator()(
4949
const measurement_collection_types::const_view& measurements_view,
50-
const detector_description::const_view& dd_view) const override;
50+
const silicon_detector_description::const_view& dd_view) const override;
5151

5252
private:
5353
/// The memory resource used by the algorithm

core/include/traccc/geometry/detector_description.hpp core/include/traccc/geometry/silicon_detector_description.hpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
namespace traccc {
2121

22-
/// Interface for the @c traccc::detector_description class.
22+
/// Interface for the @c traccc::silicon_detector_description class.
2323
///
2424
/// It provides the API that users would interact with, while using the
25-
/// columns/arrays defined in @c traccc::detector_description.
25+
/// columns/arrays defined in @c traccc::silicon_detector_description.
2626
///
2727
template <typename BASE>
28-
class detector_description_interface : public BASE {
28+
class silicon_detector_description_interface : public BASE {
2929

3030
public:
3131
/// Inherit the base class's constructor(s)
@@ -225,11 +225,11 @@ class detector_description_interface : public BASE {
225225

226226
/// @}
227227

228-
}; // class detector_description_interface
228+
}; // class silicon_detector_description_interface
229229

230-
/// SoA container describing the detector
231-
using detector_description = vecmem::edm::container<
232-
detector_description_interface,
230+
/// SoA container describing a silicon detector
231+
using silicon_detector_description = vecmem::edm::container<
232+
silicon_detector_description_interface,
233233
vecmem::edm::type::vector<detray::geometry::barcode>,
234234
vecmem::edm::type::vector<transform3>,
235235
vecmem::edm::type::vector<geometry_id>, vecmem::edm::type::vector<scalar>,

core/src/clusterization/clusterization_algorithm.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ clusterization_algorithm::clusterization_algorithm(vecmem::memory_resource& mr)
1515

1616
clusterization_algorithm::output_type clusterization_algorithm::operator()(
1717
const cell_collection_types::const_view& cells_view,
18-
const detector_description::const_view& dd_view) const {
18+
const silicon_detector_description::const_view& dd_view) const {
1919

2020
const sparse_ccl_algorithm::output_type clusters = m_cc(cells_view);
2121
const auto clusters_data = get_data(clusters);

core/src/clusterization/measurement_creation_algorithm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ measurement_creation_algorithm::measurement_creation_algorithm(
2020
measurement_creation_algorithm::output_type
2121
measurement_creation_algorithm::operator()(
2222
const cluster_container_types::const_view &clusters_view,
23-
const detector_description::const_view &dd_view) const {
23+
const silicon_detector_description::const_view &dd_view) const {
2424

2525
// Create device containers for the input variables.
2626
const cluster_container_types::const_device clusters{clusters_view};
27-
const detector_description::const_device det_descr{dd_view};
27+
const silicon_detector_description::const_device det_descr{dd_view};
2828

2929
// Create the result object.
3030
output_type result(clusters.size(), &(m_mr.get()));

core/src/clusterization/spacepoint_formation_algorithm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ spacepoint_formation_algorithm::spacepoint_formation_algorithm(
1919
spacepoint_formation_algorithm::output_type
2020
spacepoint_formation_algorithm::operator()(
2121
const measurement_collection_types::const_view& measurements_view,
22-
const detector_description::const_view& dd_view) const {
22+
const silicon_detector_description::const_view& dd_view) const {
2323

2424
// Create device containers for the inputs.
2525
const measurement_collection_types::const_device measurements{
2626
measurements_view};
27-
const detector_description::const_device det_descr{dd_view};
27+
const silicon_detector_description::const_device det_descr{dd_view};
2828

2929
// Create the result container.
3030
output_type result(measurements.size(), &(m_mr.get()));

device/alpaka/include/traccc/alpaka/clusterization/clusterization_algorithm.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "traccc/edm/cell.hpp"
1414
#include "traccc/edm/measurement.hpp"
1515
#include "traccc/edm/spacepoint.hpp"
16-
#include "traccc/geometry/detector_description.hpp"
16+
#include "traccc/geometry/silicon_detector_description.hpp"
1717
#include "traccc/utils/algorithm.hpp"
1818
#include "traccc/utils/memory_resource.hpp"
1919

@@ -36,7 +36,7 @@ namespace traccc::alpaka {
3636
class clusterization_algorithm
3737
: public algorithm<measurement_collection_types::buffer(
3838
const cell_collection_types::const_view&,
39-
const detector_description::const_view&)> {
39+
const silicon_detector_description::const_view&)> {
4040

4141
public:
4242
/// Configuration type
@@ -58,9 +58,9 @@ class clusterization_algorithm
5858
/// @param det_descr The detector description
5959
/// @return a measurement collection (buffer)
6060
///
61-
output_type operator()(
62-
const cell_collection_types::const_view& cells,
63-
const detector_description::const_view& det_descr) const override;
61+
output_type operator()(const cell_collection_types::const_view& cells,
62+
const silicon_detector_description::const_view&
63+
det_descr) const override;
6464

6565
private:
6666
/// The average number of cells in each partition

device/alpaka/include/traccc/alpaka/clusterization/spacepoint_formation_algorithm.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "traccc/edm/cell.hpp"
1212
#include "traccc/edm/measurement.hpp"
1313
#include "traccc/edm/spacepoint.hpp"
14-
#include "traccc/geometry/detector_description.hpp"
14+
#include "traccc/geometry/silicon_detector_description.hpp"
1515
#include "traccc/utils/algorithm.hpp"
1616
#include "traccc/utils/memory_resource.hpp"
1717

@@ -31,7 +31,7 @@ namespace traccc::alpaka {
3131
class spacepoint_formation_algorithm
3232
: public algorithm<spacepoint_collection_types::buffer(
3333
const measurement_collection_types::const_view&,
34-
const detector_description::const_view&)> {
34+
const silicon_detector_description::const_view&)> {
3535

3636
public:
3737
/// Constructor for spacepoint_formation
@@ -51,7 +51,8 @@ class spacepoint_formation_algorithm
5151
///
5252
output_type operator()(
5353
const measurement_collection_types::const_view& measurements_view,
54-
const detector_description::const_view& det_descr) const override;
54+
const silicon_detector_description::const_view& det_descr)
55+
const override;
5556

5657
private:
5758
/// The memory resource(s) to use

device/alpaka/src/clusterization/clusterization_algorithm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct CCLKernel {
2727
ALPAKA_FN_ACC void operator()(
2828
TAcc const& acc, const clustering_config cfg,
2929
const cell_collection_types::const_view cells_view,
30-
const detector_description::const_view det_descr_view,
30+
const silicon_detector_description::const_view det_descr_view,
3131
vecmem::data::vector_view<device::details::index_t> f_backup_view,
3232
vecmem::data::vector_view<device::details::index_t> gf_backup_view,
3333
vecmem::data::vector_view<unsigned char> adjc_backup_view,
@@ -85,7 +85,7 @@ clusterization_algorithm::clusterization_algorithm(
8585

8686
clusterization_algorithm::output_type clusterization_algorithm::operator()(
8787
const cell_collection_types::const_view& cells,
88-
const detector_description::const_view& det_descr) const {
88+
const silicon_detector_description::const_view& det_descr) const {
8989

9090
// Setup alpaka
9191
auto devAcc = ::alpaka::getDevByIdx(::alpaka::Platform<Acc>{}, 0u);

device/alpaka/src/clusterization/spacepoint_formation_algorithm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct FormSpacepointsKernel {
2121
ALPAKA_FN_ACC void operator()(
2222
TAcc const& acc,
2323
measurement_collection_types::const_view measurements_view,
24-
const detector_description::const_view det_descr_view,
24+
const silicon_detector_description::const_view det_descr_view,
2525
const unsigned int measurement_count,
2626
spacepoint_collection_types::view spacepoints_view) const {
2727

@@ -41,7 +41,7 @@ spacepoint_formation_algorithm::spacepoint_formation_algorithm(
4141
spacepoint_formation_algorithm::output_type
4242
spacepoint_formation_algorithm::operator()(
4343
const measurement_collection_types::const_view& measurements_view,
44-
const detector_description::const_view& det_descr) const {
44+
const silicon_detector_description::const_view& det_descr) const {
4545

4646
// Setup alpaka
4747
auto devAcc = ::alpaka::getDevByIdx(::alpaka::Platform<Acc>{}, 0u);

device/common/include/traccc/clusterization/device/aggregate_cluster.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "traccc/definitions/qualifiers.hpp"
1313
#include "traccc/edm/cell.hpp"
1414
#include "traccc/edm/measurement.hpp"
15-
#include "traccc/geometry/detector_description.hpp"
15+
#include "traccc/geometry/silicon_detector_description.hpp"
1616

1717
// VecMem include(s).
1818
#include <vecmem/containers/data/vector_view.hpp>
@@ -34,7 +34,7 @@ namespace traccc::device {
3434
TRACCC_HOST_DEVICE
3535
inline void aggregate_cluster(
3636
const cell_collection_types::const_device& cells,
37-
const detector_description::const_device& det_descr,
37+
const silicon_detector_description::const_device& det_descr,
3838
const vecmem::device_vector<details::index_t>& f, unsigned int start,
3939
unsigned int end, unsigned short cid, measurement& out,
4040
vecmem::data::vector_view<unsigned int> cell_links, unsigned int link);

0 commit comments

Comments
 (0)