File indexing completed on 2026-12-05 09:54:30
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/Io/Csv/CsvGeometryIdMap.hpp"
0010
0011 #include "ActsExamples/Io/Csv/CsvInputOutput.hpp"
0012
0013 #include <stdexcept>
0014
0015 #include "CsvOutputData.hpp"
0016
0017 namespace ActsExamples {
0018
0019 std::shared_ptr<GeometryIdMapActsAthena> readCsvGeometryIdMap(
0020 const std::filesystem::path& path) {
0021 auto map = std::make_shared<GeometryIdMapActsAthena>();
0022
0023 BoostDescribeCsvReader<GeometryIdMapData> reader(path.string());
0024 GeometryIdMapData data;
0025 while (reader.read(data)) {
0026 const bool inserted =
0027 map->insert({data.athena_id, Acts::GeometryIdentifier(data.acts_id)})
0028 .second;
0029 if (!inserted) {
0030 throw std::runtime_error("Duplicate geometry identifier in " +
0031 path.string());
0032 }
0033 }
0034
0035 return map;
0036 }
0037
0038 }