23 using size_type = traccc::edm::silicon_cell_collection::buffer::size_type;
38 size_type nPix = 0, nStrip = 0;
42 for (PixelRawDataContainerProxy module_rdo_container_proxy : pixel_rdo_container_collection_proxy) {
43 if (!module_rdo_container_proxy.empty()) {
44 nPix += module_rdo_container_proxy.size();
51 for (StripRawDataContainerProxy module_rdo_container_proxy : strip_rdo_container_collection_proxy) {
52 if (!module_rdo_container_proxy.empty()) {
53 for (StripRawDataProxy strip_rdo: module_rdo_container_proxy) {
54 nStrip += strip_rdo.getGroupSize();
59 size_type
const nCells = nPix + nStrip;
63 return StatusCode::SUCCESS;
67 auto host_copy =
m_common.m_copiesTool->hostCopy(ctx);
68 traccc::edm::silicon_cell_collection::buffer traccc_cells_host_buffer{
70 host_copy->setup(traccc_cells_host_buffer)->wait();
73 traccc::edm::silicon_cell_collection::device cells{traccc_cells_host_buffer};
78 size_type cell_index = 0;
79 uint64_t current_geometry_id = detray::geometry::identifier{}.value();
80 unsigned int current_det_cond_idx = -1;
83 for (PixelRawDataContainerProxy module_rdo_container_proxy : pixel_rdo_container_collection_proxy) {
84 if (module_rdo_container_proxy.empty()) {
87 IdentifierHash const module_id_hash(module_rdo_container_proxy.identifyHash());
89 uint64_t
const detray_geometry_id =
m_common.m_athenaToDetray->at(module_id);
90 if (detray_geometry_id != current_geometry_id) {
91 current_geometry_id = detray_geometry_id;
92 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
95 for (PixelRawDataProxy pixel_rdo: module_rdo_container_proxy) {
96 traccc::edm::silicon_cell cell = cells.at(cell_index++);
97 cell.channel0() =
static_cast<uint32_t
>(pixel_rdo.coordinates()[0]);
98 cell.channel1() =
static_cast<uint32_t
>(pixel_rdo.coordinates()[1]);
99 cell.module_index() = current_det_cond_idx;
100 cell.activation() =
m_common.m_UsePixelToTForCellActivation ?
101 static_cast<float>(pixel_rdo.getToT()) : 1.;
107 for (StripRawDataContainerProxy module_rdo_container_proxy : strip_rdo_container_collection_proxy) {
108 if (module_rdo_container_proxy.empty()) {
111 IdentifierHash const module_id_hash(module_rdo_container_proxy.identifyHash());
113 uint64_t
const detray_geometry_id =
m_common.m_athenaToDetray->at(module_id);
114 if (detray_geometry_id != current_geometry_id) {
115 current_geometry_id = detray_geometry_id;
116 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
119 for (StripRawDataProxy strip_rdo: module_rdo_container_proxy) {
121 if (
m_common.m_stripID->barrel_ec(module_id) == 0) {
122 for (
int i = 0; i < strip_rdo.getGroupSize(); ++i) {
123 traccc::edm::silicon_cell cell = cells.at(cell_index++);
124 cell.channel0() =
static_cast<uint32_t
>(strip_rdo.coordinates()[0] + i);
126 cell.module_index() = current_det_cond_idx;
127 cell.activation() = 1.;
131 for (
int i = 0; i < strip_rdo.getGroupSize(); ++i) {
132 traccc::edm::silicon_cell cell = cells.at(cell_index++);
134 cell.channel1() =
static_cast<uint32_t
>(strip_rdo.coordinates()[0] + i);
135 cell.module_index() = current_det_cond_idx;
136 cell.activation() = 1.;
145 traccc::edm::silicon_cell_collection::buffer sorted_cells_host_buffer =
146 m_common.sortCells(*host_copy, cells);
164 <<
m_common.m_tracccCellsKey.key() <<
"'");
165 return StatusCode::SUCCESS;