ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ActsMaterialJsonWriterTool Class Reference

#include <ActsMaterialJsonWriterTool.h>

Inheritance diagram for ActsMaterialJsonWriterTool:
Collaboration diagram for ActsMaterialJsonWriterTool:

Public Member Functions

virtual StatusCode initialize () override
 
 ActsMaterialJsonWriterTool (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~ActsMaterialJsonWriterTool ()
 
virtual void write (const ActsGeometryContext &gctx, const Acts::MaterialMapJsonConverter::DetectorMaterialMaps &detMaterial) const override
 
virtual void write (const ActsGeometryContext &gctx, const Acts::TrackingGeometry &tGeometry) const override
 

Private Attributes

Gaudi::Property< std::string > m_filePath {this, "OutputFile", "material-maps.json", "Output json file for the Material Map"}
 
Gaudi::Property< bool > m_processSensitives {this, "processSensitives", true, "Write sensitive surface to the json file"}
 
Gaudi::Property< bool > m_processApproaches {this, "processApproaches", true, "Write approche surface to the json file"}
 
Gaudi::Property< bool > m_processRepresenting {this, "processRepresenting", true, "Write representing surface to the json file"}
 
Gaudi::Property< bool > m_processBoundaries {this, "processBoundaries", true, "Write boundary surface to the json file"}
 
Gaudi::Property< bool > m_processVolumes {this, "processVolumes", true, "Write volume to the json file"}
 
Gaudi::Property< bool > m_processDenseVolumes {this, "processDenseVolumes", false, "Write dense volume to the json file"}
 
Gaudi::Property< bool > m_processNonMaterial {this, "processNonMaterial", false, "Add proto material to all surfaces and volumes"}
 

Detailed Description

Definition at line 25 of file ActsMaterialJsonWriterTool.h.

Constructor & Destructor Documentation

◆ ActsMaterialJsonWriterTool()

ActsMaterialJsonWriterTool::ActsMaterialJsonWriterTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 15 of file ActsMaterialJsonWriterTool.cxx.

17  : base_class(type, name, parent)
18 {
19 }

◆ ~ActsMaterialJsonWriterTool()

ActsMaterialJsonWriterTool::~ActsMaterialJsonWriterTool ( )

Definition at line 21 of file ActsMaterialJsonWriterTool.cxx.

22 {
23 }

Member Function Documentation

◆ initialize()

StatusCode ActsMaterialJsonWriterTool::initialize ( )
overridevirtual

Definition at line 26 of file ActsMaterialJsonWriterTool.cxx.

27 {
28  ATH_MSG_INFO("Starting Material writer");
29 
30  return StatusCode::SUCCESS;
31 }

◆ write() [1/2]

void ActsMaterialJsonWriterTool::write ( const ActsGeometryContext gctx,
const Acts::MaterialMapJsonConverter::DetectorMaterialMaps &  detMaterial 
) const
overridevirtual

Definition at line 34 of file ActsMaterialJsonWriterTool.cxx.

35 {
36  // Setup the converter config
37  Acts::MaterialMapJsonConverter::Config cfg;
38  cfg.context = gctx.context();
39  cfg.processSensitives = m_processSensitives;
40  cfg.processApproaches = m_processApproaches;
41  cfg.processRepresenting = m_processRepresenting;
42  cfg.processBoundaries = m_processBoundaries;
43  cfg.processVolumes = m_processVolumes;
44  cfg.processDenseVolumes = m_processDenseVolumes;
45  cfg.processNonMaterial = m_processNonMaterial;
46 
47  // Evoke the converter
48  Acts::MaterialMapJsonConverter jmConverter(cfg, Acts::Logging::INFO);
49  auto jout = jmConverter.materialMapsToJson(detMaterial);
50  // And write the file
51  std::ofstream ofj(m_filePath);
52  ofj << std::setw(4) << jout << std::endl;
53 }

◆ write() [2/2]

void ActsMaterialJsonWriterTool::write ( const ActsGeometryContext gctx,
const Acts::TrackingGeometry &  tGeometry 
) const
overridevirtual

Definition at line 56 of file ActsMaterialJsonWriterTool.cxx.

57 {
58  // Setup the converter config
59  Acts::MaterialMapJsonConverter::Config cfg;
60  cfg.context = gctx.context();
61  cfg.processSensitives = m_processSensitives;
62  cfg.processApproaches = m_processApproaches;
63  cfg.processRepresenting = m_processRepresenting;
64  cfg.processBoundaries = m_processBoundaries;
65  cfg.processVolumes = m_processVolumes;
66  cfg.processDenseVolumes = m_processDenseVolumes;
67  cfg.processNonMaterial = m_processNonMaterial;
68 
69  // Evoke the converter
70  Acts::MaterialMapJsonConverter jmConverter(cfg, Acts::Logging::INFO);
71  auto jout = jmConverter.trackingGeometryToJson(tGeometry);
72  // And write the file
73  std::ofstream ofj(m_filePath);
74  ofj << std::setw(4) << jout << std::endl;
75 }

Member Data Documentation

◆ m_filePath

Gaudi::Property<std::string> ActsMaterialJsonWriterTool::m_filePath {this, "OutputFile", "material-maps.json", "Output json file for the Material Map"}
private

Definition at line 48 of file ActsMaterialJsonWriterTool.h.

◆ m_processApproaches

Gaudi::Property<bool> ActsMaterialJsonWriterTool::m_processApproaches {this, "processApproaches", true, "Write approche surface to the json file"}
private

Definition at line 50 of file ActsMaterialJsonWriterTool.h.

◆ m_processBoundaries

Gaudi::Property<bool> ActsMaterialJsonWriterTool::m_processBoundaries {this, "processBoundaries", true, "Write boundary surface to the json file"}
private

Definition at line 52 of file ActsMaterialJsonWriterTool.h.

◆ m_processDenseVolumes

Gaudi::Property<bool> ActsMaterialJsonWriterTool::m_processDenseVolumes {this, "processDenseVolumes", false, "Write dense volume to the json file"}
private

Definition at line 54 of file ActsMaterialJsonWriterTool.h.

◆ m_processNonMaterial

Gaudi::Property<bool> ActsMaterialJsonWriterTool::m_processNonMaterial {this, "processNonMaterial", false, "Add proto material to all surfaces and volumes"}
private

Definition at line 55 of file ActsMaterialJsonWriterTool.h.

◆ m_processRepresenting

Gaudi::Property<bool> ActsMaterialJsonWriterTool::m_processRepresenting {this, "processRepresenting", true, "Write representing surface to the json file"}
private

Definition at line 51 of file ActsMaterialJsonWriterTool.h.

◆ m_processSensitives

Gaudi::Property<bool> ActsMaterialJsonWriterTool::m_processSensitives {this, "processSensitives", true, "Write sensitive surface to the json file"}
private

Definition at line 49 of file ActsMaterialJsonWriterTool.h.

◆ m_processVolumes

Gaudi::Property<bool> ActsMaterialJsonWriterTool::m_processVolumes {this, "processVolumes", true, "Write volume to the json file"}
private

Definition at line 53 of file ActsMaterialJsonWriterTool.h.


The documentation for this class was generated from the following files:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ActsMaterialJsonWriterTool::m_processBoundaries
Gaudi::Property< bool > m_processBoundaries
Definition: ActsMaterialJsonWriterTool.h:52
ActsMaterialJsonWriterTool::m_processRepresenting
Gaudi::Property< bool > m_processRepresenting
Definition: ActsMaterialJsonWriterTool.h:51
ActsMaterialJsonWriterTool::m_processSensitives
Gaudi::Property< bool > m_processSensitives
Definition: ActsMaterialJsonWriterTool.h:49
ActsGeometryContext::context
Acts::GeometryContext context() const
Definition: ActsGeometryContext.h:46
ActsMaterialJsonWriterTool::m_processDenseVolumes
Gaudi::Property< bool > m_processDenseVolumes
Definition: ActsMaterialJsonWriterTool.h:54
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ActsMaterialJsonWriterTool::m_filePath
Gaudi::Property< std::string > m_filePath
Definition: ActsMaterialJsonWriterTool.h:48
ActsMaterialJsonWriterTool::m_processApproaches
Gaudi::Property< bool > m_processApproaches
Definition: ActsMaterialJsonWriterTool.h:50
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
ActsMaterialJsonWriterTool::m_processVolumes
Gaudi::Property< bool > m_processVolumes
Definition: ActsMaterialJsonWriterTool.h:53
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:16
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ActsMaterialJsonWriterTool::m_processNonMaterial
Gaudi::Property< bool > m_processNonMaterial
Definition: ActsMaterialJsonWriterTool.h:55