Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:35:01

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 "Acts/Plugins/GeoModel/GeoModelReader.hpp"
0010 
0011 #include <GeoModelDBManager/GMDBManager.h>
0012 #include <GeoModelKernel/GeoFullPhysVol.h>
0013 #include <GeoModelRead/ReadGeoModel.h>
0014 
0015 Acts::GeoModelTree Acts::GeoModelReader::readFromDb(const std::string& dbPath) {
0016   // Data base manager
0017   GMDBManager* db = new GMDBManager(dbPath);
0018   if (!db->checkIsDBOpen()) {
0019     throw std::runtime_error("GeoModelReader: Could not open the database");
0020   }
0021   // Setup the GeoModel reader
0022   auto geoReader = std::make_shared<GeoModelIO::ReadGeoModel>(db);
0023   // Read the GeoModel
0024   GeoModelTree geoModel{geoReader, geoReader->buildGeoModel()};
0025   return geoModel;
0026 }