Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 08:20:05

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/Svg/SvgTrackingGeometryWriter.hpp"
0010 
0011 #include "Acts/Geometry/TrackingGeometry.hpp"
0012 #include "ActsExamples/Utilities/Paths.hpp"
0013 
0014 namespace ActsExamples {
0015 
0016 SvgTrackingGeometryWriter::SvgTrackingGeometryWriter(
0017     const SvgTrackingGeometryWriter::Config& config, Acts::Logging::Level level)
0018     : m_logger{Acts::getDefaultLogger(name(), level)}, m_cfg(config) {}
0019 
0020 std::string SvgTrackingGeometryWriter::name() const {
0021   return "SvgTrackingGeometryWriter";
0022 }
0023 
0024 ProcessCode SvgTrackingGeometryWriter::write(
0025     const AlgorithmContext& context, const Acts::TrackingGeometry& tGeometry) {
0026   ACTS_DEBUG(">>Svg: Writer for TrackingGeometry object called.");
0027 
0028   m_writeMutex.lock();
0029 
0030   auto geometrySheets = ActsPlugins::Svg::TrackingGeometryConverter::convert(
0031       context.recoGeoContext, tGeometry, m_cfg.converterOptions);
0032 
0033   // Write them out
0034   for (const auto& sheet : geometrySheets) {
0035     ActsPlugins::Svg::toFile({sheet},
0036                              joinPaths(m_cfg.outputDir, sheet._id + ".svg"));
0037   }
0038   // Successfully done
0039   return ProcessCode::SUCCESS;
0040 }
0041 
0042 }  // namespace ActsExamples