ATLAS Offline Software
Loading...
Searching...
No Matches
MuonGMR4::MuonMaterialDecoratorTool Class Reference

Mutable tracking geometry visitor to load the material on the tracking surfaces inside the Muon System by visiting the tracking volumes of the active chambers and assign material to the portals and by visiting the surfaces to assign the passive material on. More...

#include <MuonMaterialDecoratorTool.h>

Inheritance diagram for MuonGMR4::MuonMaterialDecoratorTool:
Collaboration diagram for MuonGMR4::MuonMaterialDecoratorTool:

Public Member Functions

virtual ~MuonMaterialDecoratorTool ()
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, "MuonMaterialDbFile", "", ""}
 Material map file, read with the Json reader for '.json' / '.cbor' and with the Root reader otherwise.
Gaudi::Property< std::string > m_materialMapFolder {this, "MuonMaterialDbFolder", "", ""}
std::unique_ptr< Acts::IMaterialDecorator > m_matDecorator {}

Detailed Description

Mutable tracking geometry visitor to load the material on the tracking surfaces inside the Muon System by visiting the tracking volumes of the active chambers and assign material to the portals and by visiting the surfaces to assign the passive material on.

Definition at line 21 of file MuonMaterialDecoratorTool.h.

Constructor & Destructor Documentation

◆ ~MuonMaterialDecoratorTool()

MuonGMR4::MuonMaterialDecoratorTool::~MuonMaterialDecoratorTool ( )
virtualdefault

Member Function Documentation

◆ finalize()

StatusCode MuonGMR4::MuonMaterialDecoratorTool::finalize ( )
finaloverridevirtual

Definition at line 50 of file MuonMaterialDecoratorTool.cxx.

50 {
51 m_matDecorator.reset();
52 return StatusCode::SUCCESS;
53 }
std::unique_ptr< Acts::IMaterialDecorator > m_matDecorator

◆ initialize()

StatusCode MuonGMR4::MuonMaterialDecoratorTool::initialize ( )
finaloverridevirtual

Definition at line 26 of file MuonMaterialDecoratorTool.cxx.

26 {
27 const Acts::Logging::Level level = ActsTrk::actsLevelVector(msg().level());
28 std::string fullPath = std::format("{:}/{:}", m_materialMapFolder.value() , m_materialMapFile.value());
29 if (fullPath.size() && fullPath[0] != '/') fullPath = PathResolverFindCalibFile(fullPath);
30
31 if(fullPath.empty()){
32 ATH_MSG_ERROR(__func__<<"() "<<__LINE__<<" Could not find material map file: "
33 <<m_materialMapFolder.value() + "/" + m_materialMapFile.value());
34 return StatusCode::FAILURE;
35 }
36 ATH_MSG_INFO("Loading material map from " << fullPath);
37
38 // Json (or Cbor) maps are read with the Json reader, everything else keeps the Root reader
39 if (fullPath.ends_with(".json") || fullPath.ends_with(".cbor")) {
40 Acts::MaterialMapJsonConverter::Config converterConfig;
41 m_matDecorator = std::make_unique<Acts::JsonMaterialDecorator>(converterConfig, fullPath, level);
42 } else {
43 ActsPlugins::RootMaterialDecorator::Config decoratorConfig;
44 decoratorConfig.fileName = fullPath;
45 m_matDecorator = std::make_unique<ActsPlugins::RootMaterialDecorator>(decoratorConfig, level);
46 }
47 return StatusCode::SUCCESS;
48 }
#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
Material map file, read with the Json reader for '.json' / '.cbor' and with the Root reader otherwise...
Acts::Logging::Level actsLevelVector(MSG::Level lvl)
MsgStream & msg
Definition testRead.cxx:32

◆ visitSurface()

void MuonGMR4::MuonMaterialDecoratorTool::visitSurface ( Acts::Surface & surface)
finaloverridevirtual

Definition at line 18 of file MuonMaterialDecoratorTool.cxx.

18 {
19 bool hasMat = surface.hasMaterial();
20 m_matDecorator->decorate(surface);
21 if (hasMat != surface.hasMaterial()) {
22 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" Decorated "<<surface.geometryId()<<" with material");
23 }
24 }
#define ATH_MSG_DEBUG(x,...)

Member Data Documentation

◆ m_matDecorator

std::unique_ptr<Acts::IMaterialDecorator> MuonGMR4::MuonMaterialDecoratorTool::m_matDecorator {}
private

Definition at line 33 of file MuonMaterialDecoratorTool.h.

33{};

◆ m_materialMapFile

Gaudi::Property<std::string> MuonGMR4::MuonMaterialDecoratorTool::m_materialMapFile {this, "MuonMaterialDbFile", "", ""}
private

Material map file, read with the Json reader for '.json' / '.cbor' and with the Root reader otherwise.

Definition at line 31 of file MuonMaterialDecoratorTool.h.

31{this, "MuonMaterialDbFile", "", ""};

◆ m_materialMapFolder

Gaudi::Property<std::string> MuonGMR4::MuonMaterialDecoratorTool::m_materialMapFolder {this, "MuonMaterialDbFolder", "", ""}
private

Definition at line 32 of file MuonMaterialDecoratorTool.h.

32{this, "MuonMaterialDbFolder", "", ""};

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