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

Host Clusterization Reorganization, main branch (2024.04.16.) #543

Merged
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
22 changes: 13 additions & 9 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TRACCC library, part of the ACTS project (R&D line)
#
# (c) 2021-2023 CERN for the benefit of the ACTS project
# (c) 2021-2024 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

Expand Down Expand Up @@ -40,16 +40,20 @@ traccc_add_library( traccc_core core TYPE SHARED
"include/traccc/utils/seed_generator.hpp"
"include/traccc/utils/subspace.hpp"
# Clusterization algorithmic code.
"include/traccc/clusterization/detail/measurement_creation_helper.hpp"
"include/traccc/clusterization/detail/sparse_ccl.hpp"
"include/traccc/clusterization/component_connection.hpp"
"src/clusterization/component_connection.cpp"
"include/traccc/clusterization/details/sparse_ccl.hpp"
"include/traccc/clusterization/impl/sparse_ccl.ipp"
"include/traccc/clusterization/sparse_ccl_algorithm.hpp"
"src/clusterization/sparse_ccl_algorithm.cpp"
"include/traccc/clusterization/details/measurement_creation.hpp"
"include/traccc/clusterization/impl/measurement_creation.ipp"
"include/traccc/clusterization/measurement_creation_algorithm.hpp"
"src/clusterization/measurement_creation_algorithm.cpp"
"include/traccc/clusterization/details/spacepoint_formation.hpp"
"include/traccc/clusterization/impl/spacepoint_formation.ipp"
"include/traccc/clusterization/spacepoint_formation_algorithm.hpp"
"src/clusterization/spacepoint_formation_algorithm.cpp"
"include/traccc/clusterization/clusterization_algorithm.hpp"
"src/clusterization/clusterization_algorithm.cpp"
"include/traccc/clusterization/spacepoint_formation.hpp"
"src/clusterization/spacepoint_formation.cpp"
"include/traccc/clusterization/measurement_creation.hpp"
"src/clusterization/measurement_creation.cpp"
# Finding algorithmic code
"include/traccc/finding/candidate_link.hpp"
"include/traccc/finding/finding_algorithm.hpp"
Expand Down
28 changes: 14 additions & 14 deletions core/include/traccc/clusterization/clusterization_algorithm.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2021-2022 CERN for the benefit of the ACTS project
* (c) 2021-2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/

#pragma once

// Library include(s).
#include "traccc/clusterization/component_connection.hpp"
#include "traccc/clusterization/measurement_creation.hpp"
#include "traccc/clusterization/measurement_creation_algorithm.hpp"
#include "traccc/clusterization/sparse_ccl_algorithm.hpp"
#include "traccc/edm/cell.hpp"
#include "traccc/edm/measurement.hpp"
#include "traccc/utils/algorithm.hpp"
Expand All @@ -20,7 +20,7 @@
// System include(s).
#include <functional>

namespace traccc {
namespace traccc::host {

/// Clusterization algorithm, creating measurements from cells
///
Expand All @@ -29,8 +29,8 @@ namespace traccc {
///
class clusterization_algorithm
: public algorithm<measurement_collection_types::host(
const cell_collection_types::host&,
const cell_module_collection_types::host&)> {
const cell_collection_types::const_view&,
const cell_module_collection_types::const_view&)> {

public:
/// Clusterization algorithm constructor
Expand All @@ -41,23 +41,23 @@ class clusterization_algorithm

/// Construct measurements for each detector module
///
/// @param cells The cells for every detector module in the event
/// @param modules A collection of detector modules
/// @param cells_view The cells for every detector module in the event
/// @param modules_view A collection of detector modules
/// @return The measurements reconstructed for every detector module
///
output_type operator()(
const cell_collection_types::host& cells,
const cell_module_collection_types::host& modules) const override;
output_type operator()(const cell_collection_types::const_view& cells_view,
const cell_module_collection_types::const_view&
modules_view) const override;

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

/// Per-module cluster creation algorithm
component_connection m_cc;
sparse_ccl_algorithm m_cc;

/// Per-module measurement creation algorithm
measurement_creation m_mc;
measurement_creation_algorithm m_mc;

/// @}

Expand All @@ -66,4 +66,4 @@ class clusterization_algorithm

}; // class clusterization_algorithm

} // namespace traccc
} // namespace traccc::host
64 changes: 0 additions & 64 deletions core/include/traccc/clusterization/component_connection.hpp

This file was deleted.

136 changes: 0 additions & 136 deletions core/include/traccc/clusterization/detail/sparse_ccl.hpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/** 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

// Project include(s).
#include "traccc/definitions/primitives.hpp"
#include "traccc/definitions/qualifiers.hpp"
#include "traccc/edm/cell.hpp"
#include "traccc/edm/measurement.hpp"

namespace traccc::details {

/// Function used for retrieving the cell signal based on the module id
TRACCC_HOST_DEVICE
inline scalar signal_cell_modelling(scalar signal_in,
const cell_module& module);

/// Function for pixel segmentation
TRACCC_HOST_DEVICE
inline vector2 position_from_cell(const cell& cell, const cell_module& module);

/// Function used for calculating the properties of the cluster during
/// measurement creation
///
/// @param[in] cluster The vector of cells describing the identified cluster
/// @param[in] module The cell module
/// @param[out] mean The mean position of the cluster/measurement
/// @param[out] var The variation on the mean position of the
/// cluster/measurement
/// @param[out] totalWeight The total weight of the cluster/measurement
///
TRACCC_HOST_DEVICE inline void calc_cluster_properties(
const cell_collection_types::const_device& cluster,
const cell_module& module, point2& mean, point2& var, scalar& totalWeight);

/// Function used for calculating the properties of the cluster during
/// measurement creation
///
/// @param[out] measurements is the measurement collection where the measurement
/// object will be filled
/// @param[in] measurement_index is the index of the measurement object to fill
/// @param[in] cluster is the input cell vector
/// @param[in] module is the cell module where the cluster belongs to
/// @param[in] module_link is the module index
///
TRACCC_HOST_DEVICE inline void fill_measurement(
measurement_collection_types::device& measurements,
std::size_t measurement_index,
const cell_collection_types::const_device& cluster,
const cell_module& module, const unsigned int module_link);

} // namespace traccc::details

// Include the implementation.
#include "traccc/clusterization/impl/measurement_creation.ipp"
Loading
Loading