Function initializing and executing the file loading.
27{
28 ATH_MSG_DEBUG(
"Initializing device detector description provider service ");
29
33
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());
36
37 std::unique_ptr<traccc::detector_design_description::buffer> deviceDesign;
38 std::unique_ptr<traccc::detector_conditions_description::buffer> deviceCond;
39
41
47 return StatusCode::FAILURE;
48 }
49
54
55
57 auto hostDetector = std::make_unique<traccc::host_detector>();
58 traccc::io::read_detector(
59 *hostDetector, *
m_MRs->hostMR(),
61
62 auto deviceDetector =
63 std::make_unique<traccc::detector_buffer>(traccc::buffer_from_host_detector(*hostDetector,
m_MRs->mainMR(),
const_cast<vecmem::copy&
>(*copy)));
64
65
66 traccc::io::read_detector_description(
67 *hostDesign, *hostCond,
71 traccc::data_format::json);
72
74 << hostCond->size() << " conditions entries");
75
76
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())));
83 }
84
85 deviceDesign =
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();
91
92
93 deviceCond =
94 std::make_unique<traccc::detector_conditions_description::buffer>(
95 static_cast<traccc::detector_conditions_description::buffer::size_type>(
96 hostCond->size()),
98 (*copy).setup(*deviceCond)->wait();
99 (*copy)(vecmem::get_data(*hostCond), *deviceCond)->wait();
100
102
103
104
105 constexpr bool allowMods = false;
110
113
115 return StatusCode::SUCCESS;
116}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
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()
Helper function to load Athena<->detray ID maps from csv.
Gaudi::Property< std::string > m_deviceCondObjectName