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 float activation = 1.;
97 if (
m_common.m_UsePixelToTForCellActivation) {
98 activation =
static_cast<float>(pixel_rdo.getToT());
99 if (activation == 0.) {
100 ATH_MSG_ERROR(
"input data error: RDO must not have ToT=0; RDO index: "
105 traccc::edm::silicon_cell cell = cells.at(cell_index++);
106 cell.channel0() =
static_cast<uint32_t
>(pixel_rdo.coordinates()[0]);
107 cell.channel1() =
static_cast<uint32_t
>(pixel_rdo.coordinates()[1]);
108 cell.module_index() = current_det_cond_idx;
109 cell.activation() = activation;
115 for (StripRawDataContainerProxy module_rdo_container_proxy : strip_rdo_container_collection_proxy) {
116 if (module_rdo_container_proxy.empty()) {
119 IdentifierHash const module_id_hash(module_rdo_container_proxy.identifyHash());
121 uint64_t
const detray_geometry_id =
m_common.m_athenaToDetray->at(module_id);
122 if (detray_geometry_id != current_geometry_id) {
123 current_geometry_id = detray_geometry_id;
124 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
127 for (StripRawDataProxy strip_rdo: module_rdo_container_proxy) {
129 if (
m_common.m_stripID->barrel_ec(module_id) == 0) {
130 for (
int i = 0; i < strip_rdo.getGroupSize(); ++i) {
131 traccc::edm::silicon_cell cell = cells.at(cell_index++);
132 cell.channel0() =
static_cast<uint32_t
>(strip_rdo.coordinates()[0] + i);
134 cell.module_index() = current_det_cond_idx;
135 cell.activation() = 1.;
139 for (
int i = 0; i < strip_rdo.getGroupSize(); ++i) {
140 traccc::edm::silicon_cell cell = cells.at(cell_index++);
142 cell.channel1() =
static_cast<uint32_t
>(strip_rdo.coordinates()[0] + i);
143 cell.module_index() = current_det_cond_idx;
144 cell.activation() = 1.;
153 traccc::edm::silicon_cell_collection::buffer sorted_cells_host_buffer =
154 m_common.sortCells(*host_copy, cells);
172 <<
m_common.m_tracccCellsKey.key() <<
"'");
173 return StatusCode::SUCCESS;