11#include <GaudiKernel/IMessageSvc.h>
21 ,
m_tracccCellsKey{&parent,
"TracccCells",
"",
"Output traccc cell collection buffer"}
22 ,
m_hostMR{&parent,
"HostMR",
"",
"The host memory resource tool to use"}
23 ,
m_deviceMR{&parent,
"DeviceMR",
"",
"The device memory resource tool to use"}
24 ,
m_copiesTool{&parent,
"CopiesTool",
"",
"Tool that provides host and device copy objects"}
25 ,
m_detDescSvc{&parent,
"DetectorDescriptionSvc",
"ActsTrk::JSONDeviceDetectorDescriptionProviderSvc"}
27 "Traccc host conditions object"}
29 "Whether to sort traccc cells on CPU or GPU"}
31 "Use Pixel hit time over threshold value to set traccc cell activation value, otherwise defaults to 1"}
49 for (
unsigned int i = 0; i < gids.size(); ++i) {
55 return StatusCode::SUCCESS;
63 <<
", total number of strip hits = " <<
m_nStrip
64 <<
" and created total number of traccc cells = " <<
m_nCells
66 return StatusCode::SUCCESS;
70 vecmem::copy
const & host_copy
71 , traccc::edm::silicon_cell_collection::device
const & cells
74 traccc::edm::silicon_cell_collection::buffer sorted_cells_host_buffer{
76 host_copy.setup(sorted_cells_host_buffer)->wait();
77 traccc::edm::silicon_cell_collection::device sorted_cells{sorted_cells_host_buffer};
79 return sorted_cells_host_buffer;
83 EventContext
const & ctx
84 , traccc::edm::silicon_cell_collection::buffer
const & cells
88 auto traccc_cells_gpu_buffer = std::make_unique<traccc::edm::silicon_cell_collection::buffer>(
92 device_copy->setup(*traccc_cells_gpu_buffer)->ignore();
93 (*device_copy)(cells, *traccc_cells_gpu_buffer)->wait();
96 ATH_CHECK(outputTracccCells.record(std::move(traccc_cells_gpu_buffer)));
97 return StatusCode::SUCCESS;
101 traccc::edm::silicon_cell_collection::device & sorted_cells
102 , traccc::edm::silicon_cell_collection::device
const & cells
105 using size_type = traccc::edm::silicon_cell_collection::buffer::size_type;
107 std::vector<size_type> indices(cells.size());
108 std::iota(indices.begin(), indices.end(), 0u);
111 std::sort(indices.begin(), indices.end(),
112 [&](size_type lhs, size_type rhs) {
113 return cells.at(lhs) < cells.at(rhs);
118 for (size_type i : indices) {
119 sorted_cells.at(s++) = cells.at(i);
#define ATH_CHECK
Evaluate an expression and check for errors.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
An algorithm that can be simultaneously executed in multiple threads.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
void sort_traccc_soa(traccc::edm::silicon_cell_collection::device &sorted_cells, traccc::edm::silicon_cell_collection::device const &cells)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
std::unordered_map< uint64_t, unsigned int > m_DetrayIdToDetDescrIndexMap
ToolHandle< AthDevice::IMemoryResourceTool > m_deviceMR
Gaudi::Property< bool > m_CPUCellSorting
Gaudi::Property< std::string > m_hostCondObjectName
const PixelID * m_pixelID
RDOtoTracccCellConverterCommons(AthReentrantAlgorithm &parent)
const std::unordered_map< Identifier, uint64_t > * m_athenaToDetray
SG::WriteHandleKey< traccc::edm::silicon_cell_collection::buffer > m_tracccCellsKey
std::atomic< int > m_nPix
std::atomic< int > m_nCells
AthReentrantAlgorithm & m_parent
Gaudi::Property< bool > m_UsePixelToTForCellActivation
traccc::edm::silicon_cell_collection::buffer sortCells(vecmem::copy const &host_copy, traccc::edm::silicon_cell_collection::device const &cells) const
std::atomic< int > m_nStrip
ToolHandle< AthDevice::ICopiesTool > m_copiesTool
ToolHandle< AthDevice::IMemoryResourceTool > m_hostMR
const traccc::detector_conditions_description::host * m_hostCond
StatusCode copyToGpuAndRecordToSG(EventContext const &ctx, traccc::edm::silicon_cell_collection::buffer const &cells) const
ServiceHandle< ActsTrk::IDeviceDetectorDescriptionProviderSvc > m_detDescSvc