ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Acts::ObjTrackingGeometryWriter Class Reference

#include <ObjTrackingGeometryWriter.h>

Collaboration diagram for Acts::ObjTrackingGeometryWriter:

Classes

class  Config
 

Public Member Functions

 ObjTrackingGeometryWriter (const Config &cfg)
 Constructor. More...
 
const std::string & name () const
 Framework name() method. More...
 
void write (const Acts::GeometryContext &gctx, const Acts::TrackingGeometry &tGeometry)
 The write interface. More...
 

Private Member Functions

void write (const Acts::GeometryContext &gctx, const Acts::TrackingVolume &tVolume)
 process this volume More...
 
const Acts::Logger & logger () const
 Private access to the logging instance. More...
 

Private Attributes

Config m_cfg
 the config class More...
 

Detailed Description

An Obj writer for the geometry It delegates the writing of surfaces to the surface writers

Definition at line 26 of file ObjTrackingGeometryWriter.h.

Constructor & Destructor Documentation

◆ ObjTrackingGeometryWriter()

Acts::ObjTrackingGeometryWriter::ObjTrackingGeometryWriter ( const Config cfg)

Constructor.

Parameters
cfgis the configuration class

Definition at line 16 of file ObjTrackingGeometryWriter.cxx.

18  : m_cfg(cfg)
19 {
20 }

Member Function Documentation

◆ logger()

const Acts::Logger& Acts::ObjTrackingGeometryWriter::logger ( ) const
inlineprivate

Private access to the logging instance.

Definition at line 78 of file ObjTrackingGeometryWriter.h.

79  {
80  return *m_cfg.logger;
81  }

◆ name()

const std::string & Acts::ObjTrackingGeometryWriter::name ( ) const

Framework name() method.

Returns
the name of the tool

Definition at line 23 of file ObjTrackingGeometryWriter.cxx.

24 {
25  return m_cfg.name;
26 }

◆ write() [1/2]

void Acts::ObjTrackingGeometryWriter::write ( const Acts::GeometryContext &  gctx,
const Acts::TrackingGeometry &  tGeometry 
)

The write interface.

Parameters
tGeometryis the geometry to be written out
Returns
ProcessCode to indicate success/failure

Definition at line 29 of file ObjTrackingGeometryWriter.cxx.

30 {
31  ACTS_DEBUG(">>Obj: Writer for TrackingGeometry object called.");
32  // get the world volume
33  auto world = tGeometry.highestTrackingVolume();
34  if (world) write(gctx, *world);
35  // return the success code
36 }

◆ write() [2/2]

void Acts::ObjTrackingGeometryWriter::write ( const Acts::GeometryContext &  gctx,
const Acts::TrackingVolume &  tVolume 
)
private

process this volume

Parameters
tVolumethe volume to be processed

Definition at line 40 of file ObjTrackingGeometryWriter.cxx.

41 {
42  ACTS_DEBUG(">>Obj: Writer for TrackingVolume object called.");
43  // get the confined layers and process them
44  if (tVolume.confinedLayers()) {
45  ACTS_VERBOSE(">>Obj: Layers are present, process them.");
46  // loop over the layers
47  for (auto layer : tVolume.confinedLayers()->arrayObjects()) {
48  // we jump navigation layers
49  if (layer->layerType() == Acts::navigation) continue;
50  // get the volume name
51  const std::string& volumeName = tVolume.volumeName();
52  // find the right surfacewriter
53  std::shared_ptr<ObjSurfaceWriter> surfaceWriter = nullptr;
54  for (auto writer : m_cfg.surfaceWriters) {
55  // get name and writer
56  auto writerName = writer->name();
57  if (volumeName.find(writerName) != std::string::npos) {
58  // asign the writer
59  surfaceWriter = std::move(writer);
60  // and break
61  break;
62  }
63  }
64  // bail out if you have no surface writer
65  if (!surfaceWriter) return;
66  // layer prefix
67  surfaceWriter->write(m_cfg.layerPrefix);
68  // check for sensitive surfaces
69  if (layer->surfaceArray() && surfaceWriter) {
70  // surfaces
71  surfaceWriter->write(m_cfg.sensitiveGroupPrefix);
72  // loop over the surface
73  for (auto surface : layer->surfaceArray()->surfaces()) {
74  if (surface) surfaceWriter->write(gctx, *surface);
75  }
76  }
77  }
78  }
79  // get the confined volumes and step down the hierarchy
80  if (tVolume.confinedVolumes()) {
81  // loop over the volumes and write what they have
82  for (auto volume : tVolume.confinedVolumes()->arrayObjects()) {
83  write(gctx, *volume.get());
84  }
85  }
86 }

Member Data Documentation

◆ m_cfg

Config Acts::ObjTrackingGeometryWriter::m_cfg
private

the config class

Definition at line 69 of file ObjTrackingGeometryWriter.h.


The documentation for this class was generated from the following files:
Acts::ObjTrackingGeometryWriter::Config::logger
std::shared_ptr< const Acts::Logger > logger
the default logger
Definition: ObjTrackingGeometryWriter.h:35
Acts::ObjTrackingGeometryWriter::Config::layerPrefix
std::string layerPrefix
Definition: ObjTrackingGeometryWriter.h:42
Acts::ObjTrackingGeometryWriter::Config::name
std::string name
the name of the writer
Definition: ObjTrackingGeometryWriter.h:37
Acts::ObjTrackingGeometryWriter::m_cfg
Config m_cfg
the config class
Definition: ObjTrackingGeometryWriter.h:69
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Acts::ObjTrackingGeometryWriter::Config::sensitiveGroupPrefix
std::string sensitiveGroupPrefix
Definition: ObjTrackingGeometryWriter.h:41
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
Acts::ObjTrackingGeometryWriter::write
void write(const Acts::GeometryContext &gctx, const Acts::TrackingGeometry &tGeometry)
The write interface.
Definition: ObjTrackingGeometryWriter.cxx:29
example.writer
writer
show summary of content
Definition: example.py:36
Acts::ObjTrackingGeometryWriter::Config::surfaceWriters
std::vector< std::shared_ptr< ObjSurfaceWriter > > surfaceWriters
surfaceWriters
Definition: ObjTrackingGeometryWriter.h:39