ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsGeometry
src
ITkMaterialDecoratorTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ITkMaterialDecoratorTool.h
"
6
7
#include "
ActsInterop/LoggerUtils.h
"
8
#include "
PathResolver/PathResolver.h
"
9
10
#include "ActsPlugins/Root/RootMaterialDecorator.hpp"
11
#include "ActsPlugins/Json/JsonMaterialDecorator.hpp"
12
13
namespace
ActsTrk
{
14
ITkMaterialDecoratorTool::~ITkMaterialDecoratorTool
() =
default
;
15
void
ITkMaterialDecoratorTool::visitSurface
(Acts::Surface& surface) {
16
m_matDecorator
->decorate(surface);
17
}
18
StatusCode
ITkMaterialDecoratorTool::initialize
() {
19
std::string fullPath =
PathResolverFindCalibFile
(
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
}
45
StatusCode
ITkMaterialDecoratorTool::finalize
() {
46
m_matDecorator
.reset();
47
return
StatusCode::SUCCESS;
48
}
49
}
// namespace ActsTrk
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
ITkMaterialDecoratorTool.h
LoggerUtils.h
PathResolver.h
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition
PathResolver.cxx:325
ActsTrk::ITkMaterialDecoratorTool::m_matDecorator
std::unique_ptr< Acts::IMaterialDecorator > m_matDecorator
Definition
ITkMaterialDecoratorTool.h:29
ActsTrk::ITkMaterialDecoratorTool::finalize
virtual StatusCode finalize() override final
Definition
ITkMaterialDecoratorTool.cxx:45
ActsTrk::ITkMaterialDecoratorTool::~ITkMaterialDecoratorTool
virtual ~ITkMaterialDecoratorTool()
ActsTrk::ITkMaterialDecoratorTool::m_materialMapFolder
Gaudi::Property< std::string > m_materialMapFolder
Definition
ITkMaterialDecoratorTool.h:28
ActsTrk::ITkMaterialDecoratorTool::m_materialMapFile
Gaudi::Property< std::string > m_materialMapFile
Definition
ITkMaterialDecoratorTool.h:27
ActsTrk::ITkMaterialDecoratorTool::initialize
virtual StatusCode initialize() override final
Definition
ITkMaterialDecoratorTool.cxx:18
ActsTrk::ITkMaterialDecoratorTool::visitSurface
virtual void visitSurface(Acts::Surface &surface) override final
Definition
ITkMaterialDecoratorTool.cxx:15
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
ActsTrk::actsLevelVector
Acts::Logging::Level actsLevelVector(MSG::Level lvl)
Definition
LoggerUtils.cxx:9
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0