ATLAS Offline Software
ObjSurfaceWriter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // This file was largely imported from the Acts testing framework
6 
7 #pragma once
8 
9 #include "Acts/Geometry/GeometryContext.hpp"
10 #include <fstream>
11 #include <iostream>
12 #include <mutex>
13 #include "ObjHelper.h"
14 #include "Acts/Surfaces/Surface.hpp"
15 #include "Acts/Utilities/Logger.hpp"
16 
17 namespace Acts {
18 
24 {
25 public:
26  // @class Config
27  //
28  // The nested config class
29  class Config
30  {
31  public:
33  std::shared_ptr<const Acts::Logger> logger;
35  std::string name;
37  unsigned int outputPhiSegments = 72;
39  double outputThickness = 2.;
41  bool outputSensitive = true;
43  bool outputLayerSurface = true;
45  double outputScalor = 1.;
47  unsigned int outputPrecision = 6;
49  std::string filePrefix = "";
52  std::string planarPrefix = "";
53  std::string cylinderPrefix = "";
54  std::string diskPrefix = "";
56  std::shared_ptr<std::ofstream> outputStream = nullptr;
57 
58  Config(const std::string& lname = "ObjSurfaceWriter",
60  : logger(Acts::getDefaultLogger(lname, lvl)), name(lname)
61  {
62  }
63  };
64 
68  ObjSurfaceWriter(const Config& cfg);
69 
71  const std::string &
72  name() const;
73 
76  void
77  write(const Acts::GeometryContext &gctx, const Acts::Surface &surface);
78 
81  void
82  write(const std::string& sinfo);
83 
84 private:
88 
90  const Acts::Logger&
91  logger() const
92  {
93  return *m_cfg.logger;
94  }
95 };
96 
97 }
Acts::ObjSurfaceWriter::Config::diskPrefix
std::string diskPrefix
Definition: ObjSurfaceWriter.h:54
Acts::ObjSurfaceWriter::Config::outputScalor
double outputScalor
output scalor
Definition: ObjSurfaceWriter.h:45
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
Acts::ObjSurfaceWriter::Config::filePrefix
std::string filePrefix
file prefix to be written out
Definition: ObjSurfaceWriter.h:49
Acts::ObjSurfaceWriter::Config::logger
std::shared_ptr< const Acts::Logger > logger
the default logger
Definition: ObjSurfaceWriter.h:33
Acts::ObjSurfaceWriter::logger
const Acts::Logger & logger() const
Private access to the logging instance.
Definition: ObjSurfaceWriter.h:91
Acts::ObjSurfaceWriter::Config::outputLayerSurface
bool outputLayerSurface
write the layer surface out
Definition: ObjSurfaceWriter.h:43
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
Acts::ObjSurfaceWriter::Config::outputPrecision
unsigned int outputPrecision
precision for out
Definition: ObjSurfaceWriter.h:47
Acts
Definition: ChamberAssembleTool.h:18
Acts::ObjSurfaceWriter::Config::outputThickness
double outputThickness
write thickness if available
Definition: ObjSurfaceWriter.h:39
Acts::ObjSurfaceWriter::ObjSurfaceWriter
ObjSurfaceWriter(const Config &cfg)
Constructor.
Definition: ObjSurfaceWriter.cxx:51
Acts::ObjSurfaceWriter::write
void write(const Acts::GeometryContext &gctx, const Acts::Surface &surface)
The write interface.
Definition: ObjSurfaceWriter.cxx:83
Config
Definition: dumpNPs.cxx:47
Acts::ObjSurfaceWriter::m_vtnCounter
ObjHelper::VtnCounter m_vtnCounter
vertex, texture, normal
Definition: ObjSurfaceWriter.h:86
Acts::ObjSurfaceWriter::Config::cylinderPrefix
std::string cylinderPrefix
Definition: ObjSurfaceWriter.h:53
Acts::ObjSurfaceWriter::Config::outputPhiSegments
unsigned int outputPhiSegments
approximate cyinders by that
Definition: ObjSurfaceWriter.h:37
Acts::ObjSurfaceWriter::Config::outputSensitive
bool outputSensitive
write sensitive surfaces
Definition: ObjSurfaceWriter.h:41
Acts::ObjSurfaceWriter::Config::Config
Config(const std::string &lname="ObjSurfaceWriter", Acts::Logging::Level lvl=Acts::Logging::INFO)
Definition: ObjSurfaceWriter.h:58
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
Acts::ObjSurfaceWriter::Config::outputStream
std::shared_ptr< std::ofstream > outputStream
the output stream
Definition: ObjSurfaceWriter.h:56
Acts::ObjSurfaceWriter::m_cfg
Config m_cfg
the config class
Definition: ObjSurfaceWriter.h:85
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:16
ObjHelper::VtnCounter
This is the counter struct for keeping track of the vertices.
Definition: ObjHelper.h:18
Acts::ObjSurfaceWriter::Config
Definition: ObjSurfaceWriter.h:30
Acts::ObjSurfaceWriter::Config::name
std::string name
the name of the algorithm
Definition: ObjSurfaceWriter.h:35
Acts::ObjSurfaceWriter::m_write_mutex
std::mutex m_write_mutex
mutex to protect multi-threaded writes
Definition: ObjSurfaceWriter.h:87
ObjHelper.h
Acts::ObjSurfaceWriter::name
const std::string & name() const
Framework name() method.
Definition: ObjSurfaceWriter.cxx:69
Acts::ObjSurfaceWriter
Definition: ObjSurfaceWriter.h:24
Acts::ObjSurfaceWriter::Config::planarPrefix
std::string planarPrefix
prefixes
Definition: ObjSurfaceWriter.h:52