Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove placement from detector description which is not necessary #899

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 14 additions & 34 deletions core/include/traccc/geometry/silicon_detector_description.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,6 @@ class silicon_detector_description_interface : public BASE {
TRACCC_HOST_DEVICE
const auto& geometry_id() const { return BASE::template get<0>(); }

/// The placement of the detector module "in the world frame" (non-const)
///
/// To be used for local-to-global transformations during spacepoint
/// creation.
///
/// @return A (non-const) vector of @c traccc::transform3 objects
///
TRACCC_HOST_DEVICE
auto& placement() { return BASE::template get<1>(); }
/// The placement of the detector module "in the world frame" (const)
///
/// To be used for local-to-global transformations during spacepoint
/// creation.
///
/// @return A (const) vector of @c traccc::transform3 objects
///
TRACCC_HOST_DEVICE
const auto& placement() const { return BASE::template get<1>(); }

/// @}

/// @name Detector module information
Expand All @@ -83,7 +64,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (non-const) vector of @c traccc::geometry_id values
///
TRACCC_HOST_DEVICE
auto& acts_geometry_id() { return BASE::template get<2>(); }
auto& acts_geometry_id() { return BASE::template get<1>(); }
/// Acts geometry identifier for the detector module (const)
///
/// It is the "Acts geometry ID" for the module, as used in the simulation
Expand All @@ -92,7 +73,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (const) vector of @c traccc::geometry_id values
///
TRACCC_HOST_DEVICE
const auto& acts_geometry_id() const { return BASE::template get<2>(); }
const auto& acts_geometry_id() const { return BASE::template get<1>(); }

/// Signal threshold for detection elements (non-const)
///
Expand All @@ -102,7 +83,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (non-const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
auto& threshold() { return BASE::template get<3>(); }
auto& threshold() { return BASE::template get<2>(); }
/// Signal threshold for detection elements (const)
///
/// It controls which elements (pixels and strips) are considered during
Expand All @@ -111,7 +92,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
const auto& threshold() const { return BASE::template get<3>(); }
const auto& threshold() const { return BASE::template get<2>(); }

/// Reference for local position calculation in X direction (non-const)
///
Expand All @@ -122,7 +103,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (non-const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
auto& reference_x() { return BASE::template get<4>(); }
auto& reference_x() { return BASE::template get<3>(); }
/// Reference for local position calculation in X direction (const)
///
/// The position of a detector element (pixel or strip) is calculated
Expand All @@ -132,7 +113,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
const auto& reference_x() const { return BASE::template get<4>(); }
const auto& reference_x() const { return BASE::template get<3>(); }

/// Reference for local position calculation in Y direction (non-const)
///
Expand All @@ -143,7 +124,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (non-const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
auto& reference_y() { return BASE::template get<5>(); }
auto& reference_y() { return BASE::template get<4>(); }
/// Reference for local position calculation in Y direction (const)
///
/// The position of a detector element (pixel or strip) is calculated
Expand All @@ -153,7 +134,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
const auto& reference_y() const { return BASE::template get<5>(); }
const auto& reference_y() const { return BASE::template get<4>(); }

/// Pitch for local position calculation in X direction (non-const)
///
Expand All @@ -164,7 +145,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (non-const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
auto& pitch_x() { return BASE::template get<6>(); }
auto& pitch_x() { return BASE::template get<5>(); }
/// Pitch for local position calculation in X direction (const)
///
/// The position of a detector element (pixel or strip) is calculated
Expand All @@ -174,7 +155,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
const auto& pitch_x() const { return BASE::template get<6>(); }
const auto& pitch_x() const { return BASE::template get<5>(); }

/// Pitch for local position calculation in Y direction (non-const)
///
Expand All @@ -185,7 +166,7 @@ class silicon_detector_description_interface : public BASE {
/// @return A (non-const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
auto& pitch_y() { return BASE::template get<7>(); }
auto& pitch_y() { return BASE::template get<6>(); }
/// Pitch for local position calculation in Y direction (const)
///
/// The position of a detector element (pixel or strip) is calculated
Expand All @@ -195,20 +176,20 @@ class silicon_detector_description_interface : public BASE {
/// @return A (const) vector of @c traccc::scalar objects
///
TRACCC_HOST_DEVICE
const auto& pitch_y() const { return BASE::template get<7>(); }
const auto& pitch_y() const { return BASE::template get<6>(); }

/// The dimensionality (1D/2D) of the detector module (non-const)
///
/// @return A (non-const) vector of @c char objects
///
TRACCC_HOST_DEVICE
auto& dimensions() { return BASE::template get<8>(); }
auto& dimensions() { return BASE::template get<7>(); }
/// The dimensionality (1D/2D) of the detector module (const)
///
/// @return A (const) vector of @c char objects
///
TRACCC_HOST_DEVICE
const auto& dimensions() const { return BASE::template get<8>(); }
const auto& dimensions() const { return BASE::template get<7>(); }

/// @}

Expand All @@ -218,7 +199,6 @@ class silicon_detector_description_interface : public BASE {
using silicon_detector_description = vecmem::edm::container<
silicon_detector_description_interface,
vecmem::edm::type::vector<detray::geometry::barcode>,
vecmem::edm::type::vector<transform3>,
vecmem::edm::type::vector<geometry_id>, vecmem::edm::type::vector<scalar>,
vecmem::edm::type::vector<scalar>, vecmem::edm::type::vector<scalar>,
vecmem::edm::type::vector<scalar>, vecmem::edm::type::vector<scalar>,
Expand Down
3 changes: 0 additions & 3 deletions io/src/read_detector_description.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ void read_csv_dd(traccc::silicon_detector_description::host& dd,
// Fill the new element with the geometry ID and the transformation of
// the surface in question.
dd.geometry_id().back() = detray::geometry::barcode{geom_id};
dd.placement().back() = transform;
dd.acts_geometry_id().back() = geom_id;

// Find the module's digitization configuration.
Expand All @@ -96,7 +95,6 @@ void read_json_dd(traccc::silicon_detector_description::host& dd,
// configuration file.
vecmem::host_memory_resource mr;
traccc::default_detector::host detector{mr};
const traccc::default_detector::host::geometry_context ctx{};
traccc::io::read_detector(detector, mr, geometry_file);

// Iterate over the surfaces of the detector.
Expand Down Expand Up @@ -125,7 +123,6 @@ void read_json_dd(traccc::silicon_detector_description::host& dd,
// Fill the new element with the geometry ID and the transformation of
// the surface in question.
dd.geometry_id().back() = surface_desc.barcode();
dd.placement().back() = surface.transform(ctx);
dd.acts_geometry_id().back() = geom_id;

// Find the module's digitization configuration.
Expand Down
Loading