ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::ITkMaterialDecoratorTool Class Reference

Mutable tracking geometry visitor to load the material on the tracking surfaces inside the ITk. More...

#include <ITkMaterialDecoratorTool.h>

Inheritance diagram for ActsTrk::ITkMaterialDecoratorTool:
Collaboration diagram for ActsTrk::ITkMaterialDecoratorTool:

Public Member Functions

virtual ~ITkMaterialDecoratorTool ()
virtual void visitSurface (Acts::Surface &surface) override final
virtual StatusCode initialize () override final
virtual StatusCode finalize () override final

Private Attributes

Gaudi::Property< std::string > m_materialMapFile {this, "MaterialDbFile", "", ""}
Gaudi::Property< std::string > m_materialMapFolder {this, "MaterialDbFolder", "", ""}
std::unique_ptr< Acts::IMaterialDecorator > m_matDecorator {}

Detailed Description

Mutable tracking geometry visitor to load the material on the tracking surfaces inside the ITk.

The material map is read from either a Json (or Cbor) file or a Root file, chosen automatically from the extension of "MaterialDbFile" ('.root' selects the Root reader, anything else - notably '.json' / '.cbor' - selects the Json reader).

Definition at line 19 of file ITkMaterialDecoratorTool.h.

Constructor & Destructor Documentation

◆ ~ITkMaterialDecoratorTool()

ActsTrk::ITkMaterialDecoratorTool::~ITkMaterialDecoratorTool ( )
virtualdefault

Member Function Documentation

◆ finalize()

StatusCode ActsTrk::ITkMaterialDecoratorTool::finalize ( )
finaloverridevirtual

Definition at line 45 of file ITkMaterialDecoratorTool.cxx.

45 {
46 m_matDecorator.reset();
47 return StatusCode::SUCCESS;
48}
std::unique_ptr< Acts::IMaterialDecorator > m_matDecorator

◆ initialize()

StatusCode ActsTrk::ITkMaterialDecoratorTool::initialize ( )
finaloverridevirtual

Definition at line 18 of file ITkMaterialDecoratorTool.cxx.

18 {
20 m_materialMapFolder.value() + "/" + m_materialMapFile.value());
21
22 if (fullPath.empty()) {
23 ATH_MSG_ERROR("Could not locate material map file '"
24 << m_materialMapFolder.value() << "/" << m_materialMapFile.value() << "'");
25 return StatusCode::FAILURE;
26 }
27 ATH_MSG_INFO("Loading material map from " << fullPath);
28
29 const Acts::Logging::Level level = ActsTrk::actsLevelVector(msg().level());
30
31 // The Root reader only understands '.root' files; everything else
32 // (in particular '.json' and '.cbor') is handled by the Json reader.
33 if (fullPath.ends_with(".root")) {
34 ActsPlugins::RootMaterialDecorator::Config decoratorConfig;
35 decoratorConfig.fileName = std::move(fullPath);
36 m_matDecorator = std::make_unique<ActsPlugins::RootMaterialDecorator>(
37 decoratorConfig, level);
38 } else {
39 Acts::MaterialMapJsonConverter::Config converterConfig;
40 m_matDecorator = std::make_unique<Acts::JsonMaterialDecorator>(
41 converterConfig, fullPath, level);
42 }
43 return StatusCode::SUCCESS;
44}
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::string > m_materialMapFolder
Gaudi::Property< std::string > m_materialMapFile
Acts::Logging::Level actsLevelVector(MSG::Level lvl)
MsgStream & msg
Definition testRead.cxx:32

◆ visitSurface()

void ActsTrk::ITkMaterialDecoratorTool::visitSurface ( Acts::Surface & surface)
finaloverridevirtual

Definition at line 15 of file ITkMaterialDecoratorTool.cxx.

15 {
16 m_matDecorator->decorate(surface);
17}

Member Data Documentation

◆ m_matDecorator

std::unique_ptr<Acts::IMaterialDecorator> ActsTrk::ITkMaterialDecoratorTool::m_matDecorator {}
private

Definition at line 29 of file ITkMaterialDecoratorTool.h.

29{};

◆ m_materialMapFile

Gaudi::Property<std::string> ActsTrk::ITkMaterialDecoratorTool::m_materialMapFile {this, "MaterialDbFile", "", ""}
private

Definition at line 27 of file ITkMaterialDecoratorTool.h.

27{this, "MaterialDbFile", "", ""};

◆ m_materialMapFolder

Gaudi::Property<std::string> ActsTrk::ITkMaterialDecoratorTool::m_materialMapFolder {this, "MaterialDbFolder", "", ""}
private

Definition at line 28 of file ITkMaterialDecoratorTool.h.

28{this, "MaterialDbFolder", "", ""};

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