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 if (!
m_common.passTiming(strip_rdo.getTimeBin())) {
58 nStrip += strip_rdo.getGroupSize();
63 size_type
const nCells = nPix + nStrip;
66 auto host_copy =
m_common.m_copiesTool->hostCopy(ctx);
67 traccc::edm::silicon_cell_collection::buffer traccc_cells_host_buffer{
69 host_copy->setup(traccc_cells_host_buffer)->wait();
72 ATH_MSG_DEBUG(
"no input hits — writing empty cell collection");
74 return StatusCode::SUCCESS;
78 traccc::edm::silicon_cell_collection::device cells{traccc_cells_host_buffer};
83 size_type cell_index = 0;
84 uint64_t current_geometry_id = detray::geometry::identifier{}.value();
85 unsigned int current_det_cond_idx = -1;
88 for (PixelRawDataContainerProxy module_rdo_container_proxy : pixel_rdo_container_collection_proxy) {
89 if (module_rdo_container_proxy.empty()) {
92 IdentifierHash const module_id_hash(module_rdo_container_proxy.identifyHash());
94 uint64_t
const detray_geometry_id =
m_common.m_athenaToDetray->at(module_id);
95 if (detray_geometry_id != current_geometry_id) {
96 current_geometry_id = detray_geometry_id;
97 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
100 for (PixelRawDataProxy pixel_rdo: module_rdo_container_proxy) {
101 float activation = 1.;
102 if (
m_common.m_UsePixelToTForCellActivation) {
103 activation =
static_cast<float>(pixel_rdo.getToT());
104 if (activation == 0.) {
105 ATH_MSG_ERROR(
"input data error: RDO must not have ToT=0; RDO index: "
110 traccc::edm::silicon_cell cell = cells.at(cell_index++);
111 cell.channel0() =
static_cast<uint32_t
>(pixel_rdo.coordinates()[0]);
112 cell.channel1() =
static_cast<uint32_t
>(pixel_rdo.coordinates()[1]);
113 cell.module_index() = current_det_cond_idx;
114 cell.activation() = activation;
120 for (StripRawDataContainerProxy module_rdo_container_proxy : strip_rdo_container_collection_proxy) {
121 if (module_rdo_container_proxy.empty()) {
124 IdentifierHash const module_id_hash(module_rdo_container_proxy.identifyHash());
126 uint64_t
const detray_geometry_id =
m_common.m_athenaToDetray->at(module_id);
127 if (detray_geometry_id != current_geometry_id) {
128 current_geometry_id = detray_geometry_id;
129 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
132 for (StripRawDataProxy strip_rdo: module_rdo_container_proxy) {
133 if (!
m_common.passTiming(strip_rdo.getTimeBin())) {
138 if (
m_common.m_stripID->barrel_ec(module_id) == 0) {
139 for (
int i = 0; i < strip_rdo.getGroupSize(); ++i) {
140 traccc::edm::silicon_cell cell = cells.at(cell_index++);
141 cell.channel0() =
static_cast<uint32_t
>(strip_rdo.coordinates()[0] + i);
143 cell.module_index() = current_det_cond_idx;
144 cell.activation() = 1.;
148 for (
int i = 0; i < strip_rdo.getGroupSize(); ++i) {
149 traccc::edm::silicon_cell cell = cells.at(cell_index++);
151 cell.channel1() =
static_cast<uint32_t
>(strip_rdo.coordinates()[0] + i);
152 cell.module_index() = current_det_cond_idx;
153 cell.activation() = 1.;
162 traccc::edm::silicon_cell_collection::buffer sorted_cells_host_buffer =
163 m_common.sortCells(*host_copy, cells);
181 <<
m_common.m_tracccCellsKey.key() <<
"'");
182 return StatusCode::SUCCESS;