Function initializing and executing the file loading.
30{
31 ATH_MSG_DEBUG(
"Initializing device detector description provider service ");
32
35
36 auto hostDesign = std::make_unique<traccc::detector_design_description::host>(*
m_MRs->hostMR());
37 auto hostCond = std::make_unique<traccc::detector_conditions_description::host>(*
m_MRs->hostMR());
38
39 std::unique_ptr<traccc::detector_design_description::buffer> deviceDesign;
40 std::unique_ptr<traccc::detector_conditions_description::buffer> deviceCond;
41
43
49 return StatusCode::FAILURE;
50 }
51
56
57
59 auto hostDetector = std::make_unique<traccc::host_detector>();
60 traccc::io::read_detector(
61 *hostDetector, *
m_MRs->hostMR(),
65
66 auto deviceDetector =
67 std::make_unique<traccc::detector_buffer>(traccc::buffer_from_host_detector(*hostDetector,
m_MRs->mainMR(),
const_cast<vecmem::copy&
>(*copy)));
68
70
71
72 traccc::io::read_detector_description(
73 *hostDesign, *hostCond,
77 traccc::data_format::json);
78
80 << hostCond->size() << " conditions entries");
81
82
83 std::vector<unsigned int> sizes;
84 sizes.reserve(hostDesign->size());
85 for (std::size_t i = 0;
i < hostDesign->size(); ++
i) {
86 const auto&
e = hostDesign->at(i);
87 sizes.push_back(static_cast<unsigned int>(
88 std::max(
e.bin_edges_x().size(),
e.bin_edges_y().size())));
89 }
90
91 deviceDesign =
92 std::make_unique<traccc::detector_design_description::buffer>(
94 vecmem::data::buffer_type::resizable);
95 (*copy).setup(*deviceDesign)->wait();
96 (*copy)(vecmem::get_data(*hostDesign), *deviceDesign)->wait();
97
98
99 deviceCond =
100 std::make_unique<traccc::detector_conditions_description::buffer>(
101 static_cast<traccc::detector_conditions_description::buffer::size_type>(
102 hostCond->size()),
104 (*copy).setup(*deviceCond)->wait();
105 (*copy)(vecmem::get_data(*hostCond), *deviceCond)->wait();
106
108
109
110
111 constexpr bool allowMods = false;
116
119
121 return StatusCode::SUCCESS;
122}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::string > m_materialFile
Gaudi::Property< std::string > m_hostDesignObjectName
Gaudi::Property< std::string > m_hostCondObjectName
Gaudi::Property< std::string > m_deviceDesignObjectName
Gaudi::Property< std::string > m_hostDetectorName
Gaudi::Property< std::string > m_deviceDetectorName
ServiceHandle< StoreGateSvc > m_detStore
ToolHandle< AthDevice::ICopyTool > m_copy
The copy tool used for copying data to device.
Gaudi::Property< std::string > m_geometryFile
Gaudi::Property< std::string > m_conditionsFile
Gaudi::Property< std::string > m_digitizationFile
ToolHandle< AthDevice::IMemoryResourcesTool > m_MRs
StatusCode loadIdMaps(const std::unique_ptr< traccc::host_detector > &hostDetector)
Helper function to load Athena<->detray ID maps from csv.
Gaudi::Property< std::string > m_surfaceGridFile
Gaudi::Property< std::string > m_deviceCondObjectName