26 using size_type = traccc::edm::silicon_cell_collection::buffer::size_type;
37 size_type nPix = 0, nStrip = 0;
39 for (
const auto* coll : *pixelRDOHandle) {
44 for (
const auto* coll : *stripRDOHandle) {
47 nStrip += rdo->getGroupSize();
52 size_type
const nCells = nPix + nStrip;
56 return StatusCode::SUCCESS;
60 auto host_copy =
m_common.m_copiesTool->hostCopy(ctx);
61 traccc::edm::silicon_cell_collection::buffer traccc_cells_host_buffer{
63 host_copy->setup(traccc_cells_host_buffer)->wait();
66 traccc::edm::silicon_cell_collection::device cells{traccc_cells_host_buffer};
71 size_type cell_index = 0;
72 uint64_t current_geometry_id = detray::geometry::identifier{}.value();
73 unsigned int current_det_cond_idx = -1;
76 for (
const auto* coll : *pixelRDOHandle) {
85 const uint64_t geoId =
m_common.m_athenaToDetray->at(modId);
87 if (geoId != current_geometry_id) {
88 current_geometry_id = geoId;
89 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
92 float activation = 1.;
93 if (
m_common.m_UsePixelToTForCellActivation) {
94 activation =
static_cast<float>(rdo->getToT());
95 if (activation == 0.) {
96 ATH_MSG_ERROR(
"input data error: RDO must not have ToT=0; RDO index: "
101 traccc::edm::silicon_cell cell = cells.at(cell_index++);
102 cell.channel0() =
static_cast<uint32_t
>(cellId.
phiIndex());
103 cell.channel1() =
static_cast<uint32_t
>(cellId.
etaIndex());
104 cell.module_index() = current_det_cond_idx;
105 cell.activation() = activation;
111 for (
const auto* coll : *stripRDOHandle) {
119 const uint64_t geoId =
m_common.m_athenaToDetray->at(modId);
121 if (geoId != current_geometry_id) {
122 current_geometry_id = geoId;
123 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
126 if (
m_common.m_stripID->barrel_ec(modId) == 0) {
127 for (
int i = 0; i < rdo->getGroupSize(); ++i) {
128 traccc::edm::silicon_cell cell = cells.at(cell_index++);
129 cell.channel0() =
static_cast<uint32_t
>(cellId.
phiIndex() + i);
131 cell.module_index() = current_det_cond_idx;
132 cell.activation() = 1.;
136 for (
int i = 0; i < rdo->getGroupSize(); ++i) {
137 traccc::edm::silicon_cell cell = cells.at(cell_index++);
139 cell.channel1() =
static_cast<uint32_t
>(cellId.
phiIndex() + i);
140 cell.module_index() = current_det_cond_idx;
141 cell.activation() = 1.;
150 traccc::edm::silicon_cell_collection::buffer sorted_cells_host_buffer =
151 m_common.sortCells(*host_copy, cells);
169 <<
m_common.m_tracccCellsKey.key() <<
"'");
170 return StatusCode::SUCCESS;