28 ATH_MSG_DEBUG(
"Initializing device detector description provider service ");
34 auto hostDesign = std::make_unique<traccc::detector_design_description::host>(*
m_MRs->hostMR());
35 auto hostCond = std::make_unique<traccc::detector_conditions_description::host>(*
m_MRs->hostMR());
37 std::unique_ptr<traccc::detector_design_description::buffer> deviceDesign;
38 std::unique_ptr<traccc::detector_conditions_description::buffer> deviceCond;
40 auto copy =
m_copy->copy(EventContext{});
47 return StatusCode::FAILURE;
57 auto hostDetector = std::make_unique<traccc::host_detector>();
58 traccc::io::read_detector(
59 *hostDetector, *
m_MRs->hostMR(),
63 std::make_unique<traccc::detector_buffer>(traccc::buffer_from_host_detector(*hostDetector,
m_MRs->mainMR(),
const_cast<vecmem::copy&
>(*copy)));
66 traccc::io::read_detector_description(
67 *hostDesign, *hostCond,
71 traccc::data_format::json);
74 << hostCond->size() <<
" conditions entries");
77 std::vector<unsigned int> sizes;
78 sizes.reserve(hostDesign->size());
79 for (std::size_t i = 0; i < hostDesign->size(); ++i) {
80 const auto& e = hostDesign->at(i);
81 sizes.push_back(
static_cast<unsigned int>(
82 std::max(e.bin_edges_x().size(), e.bin_edges_y().size())));
86 std::make_unique<traccc::detector_design_description::buffer>(
88 vecmem::data::buffer_type::resizable);
89 (*copy).setup(*deviceDesign)->wait();
90 (*copy)(vecmem::get_data(*hostDesign), *deviceDesign)->wait();
94 std::make_unique<traccc::detector_conditions_description::buffer>(
95 static_cast<traccc::detector_conditions_description::buffer::size_type
>(
98 (*copy).setup(*deviceCond)->wait();
99 (*copy)(vecmem::get_data(*hostCond), *deviceCond)->wait();
105 constexpr bool allowMods =
false;
115 return StatusCode::SUCCESS;