Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:10:49

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2017 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #include "ActsExamples/Plugins/Obj/ObjTrackingGeometryWriter.hpp"
0010 
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0013 #include <Acts/Geometry/TrackingGeometry.hpp>
0014 #include <Acts/Visualization/GeometryView3D.hpp>
0015 #include <Acts/Visualization/ObjVisualization3D.hpp>
0016 
0017 ActsExamples::ObjTrackingGeometryWriter::ObjTrackingGeometryWriter(
0018     const ActsExamples::ObjTrackingGeometryWriter::Config& config,
0019     Acts::Logging::Level level)
0020     : m_logger{Acts::getDefaultLogger(name(), level)}, m_cfg(config) {}
0021 
0022 std::string ActsExamples::ObjTrackingGeometryWriter::name() const {
0023   return "ObjTrackingGeometryWriter";
0024 }
0025 
0026 ActsExamples::ProcessCode ActsExamples::ObjTrackingGeometryWriter::write(
0027     const AlgorithmContext& context, const Acts::TrackingGeometry& tGeometry) {
0028   ACTS_DEBUG(">>Obj: Writer for TrackingGeometry object called.");
0029 
0030   auto world = tGeometry.highestTrackingVolume();
0031   if (world != nullptr) {
0032     write(context, *world);
0033   }
0034   return ActsExamples::ProcessCode::SUCCESS;
0035 }
0036 
0037 void ActsExamples::ObjTrackingGeometryWriter::write(
0038     const AlgorithmContext& context, const Acts::TrackingVolume& tVolume) {
0039   ACTS_DEBUG(">>Obj: Writer for TrackingVolume object called.");
0040 
0041   Acts::ObjVisualization3D objVis(m_cfg.outputPrecision, m_cfg.outputScalor);
0042 
0043   Acts::GeometryView3D::drawTrackingVolume(
0044       objVis, tVolume, context.geoContext, m_cfg.containerView,
0045       m_cfg.volumeView, m_cfg.passiveView, m_cfg.sensitiveView, m_cfg.gridView,
0046       true, "", m_cfg.outputDir);
0047 }