31 using size_type = traccc::edm::silicon_cell_collection::buffer::size_type;
42 size_type nPix = 0, nStrip = 0;
44 for (
const auto* coll : *pixelRDOHandle) {
49 for (
const auto* coll : *stripRDOHandle) {
56 std::bitset<3> timePattern(raw3->
getTimeBin());
57 if (!
m_common.passTiming(timePattern)) {
61 nStrip += rdo->getGroupSize();
66 ATH_MSG_DEBUG(
"Found " << nPix <<
" Pixel RDOs and " << nStrip
67 <<
" Strip RDOs, total " << (nPix + nStrip) <<
" RDOs");
68 size_type
const nCells = nPix + nStrip;
72 auto host_copy =
m_common.m_copiesTool->hostCopy(ctx);
73 traccc::edm::silicon_cell_collection::buffer traccc_cells_host_buffer{
75 host_copy->setup(traccc_cells_host_buffer)->wait();
78 ATH_MSG_DEBUG(
"no input hits — writing empty cell collection");
80 return StatusCode::SUCCESS;
84 traccc::edm::silicon_cell_collection::device cells{traccc_cells_host_buffer};
89 size_type cell_index = 0;
90 uint64_t current_geometry_id = detray::geometry::identifier{}.value();
91 unsigned int current_det_cond_idx = -1;
94 for (
const auto* coll : *pixelRDOHandle) {
103 const auto geoIdOpt =
m_common.m_geoIdMapping->athenaToDetray(modId);
104 if (!geoIdOpt.has_value()) {
105 ATH_MSG_FATAL(
"No detray id found for Athena identifier " << modId);
106 return StatusCode::FAILURE;
108 const uint64_t geoId = *geoIdOpt;
110 if (geoId != current_geometry_id) {
111 current_geometry_id = geoId;
112 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
115 float activation = 1.;
116 if (
m_common.m_UsePixelToTForCellActivation) {
117 activation =
static_cast<float>(rdo->getToT());
118 if (activation == 0.) {
119 ATH_MSG_ERROR(
"input data error: RDO must not have ToT=0; RDO index: "
124 traccc::edm::silicon_cell cell = cells.at(cell_index++);
125 cell.channel0() =
static_cast<uint32_t
>(cellId.
phiIndex());
126 cell.channel1() =
static_cast<uint32_t
>(cellId.
etaIndex());
127 cell.module_index() = current_det_cond_idx;
128 cell.activation() = activation;
134 for (
const auto* coll : *stripRDOHandle) {
137 assert(
dynamic_cast<const SCT3_RawData*
>(rdo)!=
nullptr);
140 std::bitset<3> timePattern(raw3->
getTimeBin());
141 if (!
m_common.passTiming(timePattern)) {
152 const auto geoIdOpt =
m_common.m_geoIdMapping->athenaToDetray(modId);
153 if (!geoIdOpt.has_value()) {
154 ATH_MSG_FATAL(
"No detray id found for Athena identifier " << modId);
155 return StatusCode::FAILURE;
157 const uint64_t geoId = *geoIdOpt;
159 if (geoId != current_geometry_id) {
160 current_geometry_id = geoId;
161 current_det_cond_idx =
m_common.m_DetrayIdToDetDescrIndexMap.at(current_geometry_id);
164 if (
m_common.m_stripID->barrel_ec(modId) == 0) {
165 for (
int i = 0; i < rdo->getGroupSize(); ++i) {
167 traccc::edm::silicon_cell cell = cells.at(cell_index++);
168 cell.channel0() =
static_cast<uint32_t
>(cellId.
phiIndex() + i);
170 cell.module_index() = current_det_cond_idx;
171 cell.activation() = 1.;
176 for (
int i = 0; i < rdo->getGroupSize(); ++i) {
178 traccc::edm::silicon_cell cell = cells.at(cell_index++);
180 cell.channel1() =
static_cast<uint32_t
>(cellId.
phiIndex() + i);
181 cell.module_index() = current_det_cond_idx;
182 cell.activation() = 1.;
192 traccc::edm::silicon_cell_collection::buffer sorted_cells_host_buffer =
193 m_common.sortCells(*host_copy, cells);
211 <<
m_common.m_tracccCellsKey.key() <<
"'");
212 return StatusCode::SUCCESS;