Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-12-05 09:54:30

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
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 }  // namespace ActsExamples