11#include <GaudiKernel/IMessageSvc.h>
22 ,
m_tracccCellsKey{&parent,
"TracccCells",
"",
"Output traccc cell collection buffer"}
23 ,
m_hostMR{&parent,
"HostMR",
"",
"The host memory resource tool to use"}
24 ,
m_deviceMR{&parent,
"DeviceMR",
"",
"The device memory resource tool to use"}
25 ,
m_copiesTool{&parent,
"CopiesTool",
"",
"Tool that provides host and device copy objects"}
27 "StoreGate name for the detray/acts/athena geo id mapping"}
29 "Traccc host conditions object"}
31 "Whether to sort traccc cells on CPU or GPU"}
33 "Use Pixel hit time over threshold value to set traccc cell activation value, otherwise defaults to 1"}
55 return StatusCode::SUCCESS;
68 for (
unsigned int i = 0; i < gids.size(); ++i) {
74 return StatusCode::SUCCESS;
82 <<
", total number of strip hits = " <<
m_nStrip
83 <<
" and created total number of traccc cells = " <<
m_nCells
85 return StatusCode::SUCCESS;
89 vecmem::copy
const & host_copy
90 , traccc::edm::silicon_cell_collection::device
const & cells
93 traccc::edm::silicon_cell_collection::buffer sorted_cells_host_buffer{
95 host_copy.setup(sorted_cells_host_buffer)->wait();
96 traccc::edm::silicon_cell_collection::device sorted_cells{sorted_cells_host_buffer};
98 return sorted_cells_host_buffer;
102 EventContext
const & ctx
103 , traccc::edm::silicon_cell_collection::buffer
const & cells
107 auto traccc_cells_gpu_buffer = std::make_unique<traccc::edm::silicon_cell_collection::buffer>(
111 device_copy->setup(*traccc_cells_gpu_buffer)->ignore();
112 (*device_copy)(cells, *traccc_cells_gpu_buffer)->wait();
115 ATH_CHECK(outputTracccCells.record(std::move(traccc_cells_gpu_buffer)));
116 return StatusCode::SUCCESS;
120 traccc::edm::silicon_cell_collection::device & sorted_cells
121 , traccc::edm::silicon_cell_collection::device
const & cells
124 using size_type = traccc::edm::silicon_cell_collection::buffer::size_type;
126 std::vector<size_type> indices(cells.size());
127 std::iota(indices.begin(), indices.end(), 0u);
130 std::sort(indices.begin(), indices.end(),
131 [&](size_type lhs, size_type rhs) {
132 return cells.at(lhs) < cells.at(rhs);
137 for (size_type i : indices) {
138 sorted_cells.at(s++) = cells.at(i);
144 static const size_t MAX_BINS = 2;
149 for (
size_t i = 0; i < MAX_BINS; ++i) {
156 return StatusCode::FAILURE;
159 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
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.
StringProperty m_stripRDOTimeBinStr
std::unordered_map< uint64_t, unsigned int > m_DetrayIdToDetDescrIndexMap
ToolHandle< AthDevice::IMemoryResourceTool > m_deviceMR
const ActsTrk::GeometryIdMapping * m_geoIdMapping
Gaudi::Property< bool > m_CPUCellSorting
Gaudi::Property< std::string > m_hostCondObjectName
const PixelID * m_pixelID
RDOtoTracccCellConverterCommons(AthReentrantAlgorithm &parent)
int m_stripRDOTimeBinBits[3]
SG::WriteHandleKey< traccc::edm::silicon_cell_collection::buffer > m_tracccCellsKey
std::atomic< int > m_nPix
StatusCode decodeTimeBins()
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
StatusCode buildDetrayMaps() const
bool passTiming(const std::bitset< 3 > &timePattern) 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
Gaudi::Property< std::string > m_geoIdMappingObjectName