-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
De-Template Spacepoint Formation, main branch (2024.10.23.) (#749)
* Re-wrote spacepoint formation as a non-templated algorithm. Renamed the algorithm to traccc::host::silicon_pixel_spacepoint_formation_algorithm, to make it very clear what the algorithm is doing. Once we introduce logic for creating spacepoints off of silicon strip measurements, we can see what to do. (Rename this algorithm, or add a separate algorithm that does the strip spacepoint creation.) * Updated all clients to the new (host) spacepoint formation algorithm.
- Loading branch information
Showing
18 changed files
with
220 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
core/include/traccc/seeding/impl/spacepoint_formation_algorithm.ipp
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
core/include/traccc/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2021-2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Library include(s). | ||
#include "traccc/edm/measurement.hpp" | ||
#include "traccc/edm/spacepoint.hpp" | ||
#include "traccc/geometry/detector.hpp" | ||
#include "traccc/utils/algorithm.hpp" | ||
|
||
// VecMem include(s). | ||
#include <vecmem/memory/memory_resource.hpp> | ||
|
||
// System include(s). | ||
#include <functional> | ||
|
||
namespace traccc::host { | ||
|
||
/// Algorithm forming space points out of measurements | ||
/// | ||
/// This algorithm performs the local-to-global transformation of the 2D | ||
/// measurements made on every detector module, into 3D spacepoint coordinates. | ||
/// | ||
class silicon_pixel_spacepoint_formation_algorithm | ||
: public algorithm<spacepoint_collection_types::host( | ||
const default_detector::host&, | ||
const measurement_collection_types::const_view&)>, | ||
public algorithm<spacepoint_collection_types::host( | ||
const telescope_detector::host&, | ||
const measurement_collection_types::const_view&)> { | ||
|
||
public: | ||
/// Output type | ||
using output_type = spacepoint_collection_types::host; | ||
|
||
/// Constructor for spacepoint_formation | ||
/// | ||
/// @param mr is the memory resource | ||
/// | ||
silicon_pixel_spacepoint_formation_algorithm(vecmem::memory_resource& mr); | ||
|
||
/// Construct spacepoints from 2D silicon pixel measurements | ||
/// | ||
/// @param det Detector object | ||
/// @param measurements A collection of measurements | ||
/// @return A spacepoint container, with one spacepoint for every | ||
/// silicon pixel measurement | ||
/// | ||
output_type operator()( | ||
const default_detector::host& det, | ||
const measurement_collection_types::const_view&) const override; | ||
|
||
/// Construct spacepoints from 2D silicon pixel measurements | ||
/// | ||
/// @param det Detector object | ||
/// @param measurements A collection of measurements | ||
/// @return A spacepoint container, with one spacepoint for every | ||
/// silicon pixel measurement | ||
/// | ||
output_type operator()( | ||
const telescope_detector::host& det, | ||
const measurement_collection_types::const_view&) const override; | ||
|
||
private: | ||
/// Memory resource to use for the output container | ||
std::reference_wrapper<vecmem::memory_resource> m_mr; | ||
|
||
}; // class silicon_pixel_spacepoint_formation_algorithm | ||
|
||
} // namespace traccc::host |
58 changes: 0 additions & 58 deletions
58
core/include/traccc/seeding/spacepoint_formation_algorithm.hpp
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2022-2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Local include(s). | ||
#include "traccc/edm/measurement.hpp" | ||
#include "traccc/edm/spacepoint.hpp" | ||
#include "traccc/seeding/detail/spacepoint_formation.hpp" | ||
|
||
// VecMem include(s). | ||
#include <vecmem/memory/memory_resource.hpp> | ||
|
||
namespace traccc::host::details { | ||
|
||
/// Common implementation for the spacepoint formation algorithm's execute | ||
/// functions | ||
/// | ||
/// @tparam detector_t The detector type to use | ||
/// | ||
/// @param det The detector object | ||
/// @param measurements_view The view of the measurements to process | ||
/// @param mr The memory resource to create the output with | ||
/// @return A container of the created spacepoints | ||
/// | ||
template <typename detector_t> | ||
spacepoint_collection_types::host silicon_pixel_spacepoint_formation( | ||
const detector_t& det, | ||
const measurement_collection_types::const_view& measurements_view, | ||
vecmem::memory_resource& mr) { | ||
|
||
// Create a device container for the input. | ||
const measurement_collection_types::const_device measurements{ | ||
measurements_view}; | ||
|
||
// Create the result container. | ||
spacepoint_collection_types::host result(&mr); | ||
result.reserve(measurements.size()); | ||
|
||
// Set up each spacepoint in the result container. | ||
for (const auto& meas : measurements) { | ||
if (traccc::details::is_valid_measurement(meas)) { | ||
result.push_back(traccc::details::create_spacepoint(det, meas)); | ||
} | ||
} | ||
|
||
// Return the created container. | ||
return result; | ||
} | ||
|
||
} // namespace traccc::host::details |
17 changes: 17 additions & 0 deletions
17
core/src/seeding/silicon_pixel_spacepoint_formation_algorithm.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2022-2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// Library include(s). | ||
#include "traccc/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp" | ||
|
||
namespace traccc::host { | ||
|
||
silicon_pixel_spacepoint_formation_algorithm:: | ||
silicon_pixel_spacepoint_formation_algorithm(vecmem::memory_resource& mr) | ||
: m_mr(mr) {} | ||
|
||
} // namespace traccc::host |
22 changes: 22 additions & 0 deletions
22
core/src/seeding/silicon_pixel_spacepoint_formation_algorithm_defdet.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2022-2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// Library include(s). | ||
#include "silicon_pixel_spacepoint_formation.hpp" | ||
#include "traccc/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp" | ||
|
||
namespace traccc::host { | ||
|
||
silicon_pixel_spacepoint_formation_algorithm::output_type | ||
silicon_pixel_spacepoint_formation_algorithm::operator()( | ||
const default_detector::host& det, | ||
const measurement_collection_types::const_view& meas) const { | ||
|
||
return details::silicon_pixel_spacepoint_formation(det, meas, m_mr); | ||
} | ||
|
||
} // namespace traccc::host |
22 changes: 22 additions & 0 deletions
22
core/src/seeding/silicon_pixel_spacepoint_formation_algorithm_teldet.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2022-2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// Library include(s). | ||
#include "silicon_pixel_spacepoint_formation.hpp" | ||
#include "traccc/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp" | ||
|
||
namespace traccc::host { | ||
|
||
silicon_pixel_spacepoint_formation_algorithm::output_type | ||
silicon_pixel_spacepoint_formation_algorithm::operator()( | ||
const telescope_detector::host& det, | ||
const measurement_collection_types::const_view& meas) const { | ||
|
||
return details::silicon_pixel_spacepoint_formation(det, meas, m_mr); | ||
} | ||
|
||
} // namespace traccc::host |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.