ATLAS Offline Software
Loading...
Searching...
No Matches
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 ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometryMaterial &detMaterial) const override
virtual void write (const ActsTrk::GeometryContext &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 26 of file ActsMaterialJsonWriterTool.h.

Constructor & Destructor Documentation

◆ ActsMaterialJsonWriterTool()

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

Definition at line 17 of file ActsMaterialJsonWriterTool.cxx.

19 : base_class(type, name, parent)
20{
21}

◆ ~ActsMaterialJsonWriterTool()

ActsMaterialJsonWriterTool::~ActsMaterialJsonWriterTool ( )

Definition at line 23 of file ActsMaterialJsonWriterTool.cxx.

24{
25}

Member Function Documentation

◆ initialize()

StatusCode ActsMaterialJsonWriterTool::initialize ( )
overridevirtual

Definition at line 28 of file ActsMaterialJsonWriterTool.cxx.

29{
30 ATH_MSG_INFO("Starting Material writer");
31
32 return StatusCode::SUCCESS;
33}
#define ATH_MSG_INFO(x)

◆ write() [1/2]

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

Definition at line 58 of file ActsMaterialJsonWriterTool.cxx.

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

◆ write() [2/2]

void ActsMaterialJsonWriterTool::write ( const ActsTrk::GeometryContext & gctx,
const Acts::TrackingGeometryMaterial & detMaterial ) const
overridevirtual

Definition at line 36 of file ActsMaterialJsonWriterTool.cxx.

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

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 50 of file ActsMaterialJsonWriterTool.h.

50{this, "OutputFile", "material-maps.json", "Output json file for the Material Map"};

◆ m_processApproaches

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

Definition at line 52 of file ActsMaterialJsonWriterTool.h.

52{this, "processApproaches", true, "Write approche surface to the json file"};

◆ m_processBoundaries

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

Definition at line 54 of file ActsMaterialJsonWriterTool.h.

54{this, "processBoundaries", true, "Write boundary surface to the json file"};

◆ m_processDenseVolumes

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

Definition at line 56 of file ActsMaterialJsonWriterTool.h.

56{this, "processDenseVolumes", false, "Write dense volume to the json file"};

◆ m_processNonMaterial

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

Definition at line 57 of file ActsMaterialJsonWriterTool.h.

57{this, "processNonMaterial", false, "Add proto material to all surfaces and volumes"};

◆ m_processRepresenting

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

Definition at line 53 of file ActsMaterialJsonWriterTool.h.

53{this, "processRepresenting", true, "Write representing surface to the json file"};

◆ m_processSensitives

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

Definition at line 51 of file ActsMaterialJsonWriterTool.h.

51{this, "processSensitives", true, "Write sensitive surface to the json file"};

◆ m_processVolumes

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

Definition at line 55 of file ActsMaterialJsonWriterTool.h.

55{this, "processVolumes", true, "Write volume to the json file"};

The documentation for this class was generated from the following files: