24 throw std::invalid_argument(
"Missing material mapper");
26 throw std::invalid_argument(
"Missing tracking geometry");
29 ACTS_INFO(
"This algorithm requires inter-event information, "
30 <<
"run in single-threaded mode!");
47 if (m_cfg.materialSurfaceMapper && m_cfg.materialVolumeMapper) {
49 m_cfg.materialSurfaceMapper->finalizeMaps(m_mappingState);
50 m_cfg.materialVolumeMapper->finalizeMaps(m_mappingStateVol);
52 for (
auto& [key,
value] : m_mappingState.surfaceMaterial) {
53 detectorMaterial.first.insert({key, std::move(
value)});
56 for (
auto& [key,
value] : m_mappingStateVol.volumeMaterial) {
57 detectorMaterial.second.insert({key, std::move(
value)});
60 if (m_cfg.materialSurfaceMapper) {
62 m_cfg.materialSurfaceMapper->finalizeMaps(m_mappingState);
64 for (
auto& [key,
value] : m_mappingState.surfaceMaterial) {
65 detectorMaterial.first.insert({key, std::move(
value)});
68 for (
auto& [key,
value] : m_mappingState.volumeMaterial) {
69 detectorMaterial.second.insert({key, std::move(
value)});
72 if (m_cfg.materialVolumeMapper) {
74 m_cfg.materialVolumeMapper->finalizeMaps(m_mappingStateVol);
76 for (
auto& [key,
value] : m_mappingStateVol.surfaceMaterial) {
77 detectorMaterial.first.insert({key, std::move(
value)});
80 for (
auto& [key,
value] : m_mappingStateVol.volumeMaterial) {
81 detectorMaterial.second.insert({key, std::move(
value)});
86 for (
auto& imw : m_cfg.materialWriters) {
87 imw->writeMaterial(detectorMaterial);
94 std::vector<Acts::RecordedMaterialTrack> mtrackCollection =
95 context.
eventStore.
get<std::vector<Acts::RecordedMaterialTrack>>(
98 if (m_cfg.materialSurfaceMapper) {
103 for (
auto& mTrack : mtrackCollection) {
105 m_cfg.materialSurfaceMapper->mapMaterialTrack(*mappingState, mTrack);
108 if (m_cfg.materialVolumeMapper) {
113 for (
auto& mTrack : mtrackCollection) {
115 m_cfg.materialVolumeMapper->mapMaterialTrack(*mappingState, mTrack);
120 std::move(mtrackCollection));