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

Apply spacepoint formation to the 2D pixel detector only #727

Merged
merged 2 commits into from
Oct 9, 2024
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
5 changes: 5 additions & 0 deletions core/include/traccc/seeding/detail/spacepoint_formation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

namespace traccc::details {

/// Function helping with checking a measurement obejct for spacepoint creation
///
/// @param[in] measurement The input measurement
TRACCC_HOST_DEVICE inline bool is_valid_measurement(const measurement& meas);

/// Function helping with filling/setting up a spacepoint object
///
/// @param[in] det The tracking geometry
Expand Down
8 changes: 8 additions & 0 deletions core/include/traccc/seeding/impl/spacepoint_formation.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

namespace traccc::details {

TRACCC_HOST_DEVICE inline bool is_valid_measurement(const measurement& meas) {
// We use 2D (pixel) measurements only for spacepoint creation
if (meas.meas_dim == 2u) {
return true;
}
return false;
}

template <typename detector_t>
TRACCC_HOST_DEVICE inline spacepoint create_spacepoint(
const detector_t& det, const measurement& meas) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ spacepoint_formation_algorithm<detector_t>::operator()(

// Set up each spacepoint in the result container.
for (const auto& meas : measurements) {

result.push_back(details::create_spacepoint(det, meas));
if (details::is_valid_measurement(meas)) {
result.push_back(details::create_spacepoint(det, meas));
}
}

// Return the created container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ TRACCC_HOST_DEVICE inline void form_spacepoints(
const auto& meas = measurements.at(globalIndex);

// Fill the spacepoint using the common function.
spacepoints.push_back(details::create_spacepoint(det, meas));
if (details::is_valid_measurement(meas)) {
spacepoints.push_back(details::create_spacepoint(det, meas));
}
}

} // namespace traccc::device
Loading