Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-01 07:46:27

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 #pragma once
0010 
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "Acts/Visualization/ViewConfig.hpp"
0013 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0014 #include "ActsExamples/Framework/ProcessCode.hpp"
0015 
0016 #include <cstddef>
0017 #include <memory>
0018 #include <string>
0019 
0020 namespace Acts {
0021 class TrackingVolume;
0022 class TrackingGeometry;
0023 }  // namespace Acts
0024 
0025 namespace ActsExamples {
0026 
0027 /// @class ObjTrackingGeometryWriter
0028 ///
0029 /// An Obj writer for the geometry: TrackingGeometry master
0030 /// It delegates the writing of surfaces to the surface writers
0031 class ObjTrackingGeometryWriter {
0032  public:
0033   // @class Config
0034   //
0035   // The nested config class
0036   class Config {
0037    public:
0038     double outputScalor = 1.0;        ///< scale output values
0039     std::size_t outputPrecision = 6;  ///< floating point precision
0040     std::filesystem::path outputDir = ".";
0041 
0042     Acts::ViewConfig containerView = {.color = {220, 220, 220}};
0043     Acts::ViewConfig volumeView = {.color = {220, 220, 0}};
0044     Acts::ViewConfig sensitiveView = {.color = {0, 180, 240}};
0045     Acts::ViewConfig passiveView = {.color = {240, 280, 0}};
0046     Acts::ViewConfig gridView = {.color = {220, 0, 0}};
0047 
0048     Acts::ViewConfig portalView = passiveView;
0049   };
0050 
0051   /// Constructor
0052   /// @param config is the configuration class
0053   /// @param level the log level
0054   ObjTrackingGeometryWriter(const Config& config, Acts::Logging::Level level);
0055 
0056   /// Framework name() method
0057   /// @return the name of the tool
0058   std::string name() const;
0059 
0060   /// The write interface
0061   /// @param context the Algorithm/Event context of this call
0062   /// @param tGeometry is the geometry to be written out
0063   /// @return ProcessCode to indicate success/failure
0064   ProcessCode write(const AlgorithmContext& context,
0065                     const Acts::TrackingGeometry& tGeometry);
0066 
0067  private:
0068   std::unique_ptr<const Acts::Logger> m_logger;  ///< the logger instance
0069 
0070   Config m_cfg;  ///< the config class
0071 
0072   /// process this volume
0073   /// @param context the Algorithm/Event context for this call
0074   /// @param tVolume the volume to be processed
0075   void write(const AlgorithmContext& context,
0076              const Acts::TrackingVolume& tVolume, bool gen3 = false);
0077 
0078   /// Private access to the logging instance
0079   const Acts::Logger& logger() const { return *m_logger; }
0080 };
0081 
0082 }  // namespace ActsExamples