ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
9
10#include "ActsPlugins/Root/RootMaterialDecorator.hpp"
11#include "ActsPlugins/Json/JsonMaterialDecorator.hpp"
12
13namespace ActsTrk {
15void ITkMaterialDecoratorTool::visitSurface(Acts::Surface& surface) {
16 m_matDecorator->decorate(surface);
17}
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}
46 m_matDecorator.reset();
47 return StatusCode::SUCCESS;
48}
49} // namespace ActsTrk
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
std::unique_ptr< Acts::IMaterialDecorator > m_matDecorator
virtual StatusCode finalize() override final
Gaudi::Property< std::string > m_materialMapFolder
Gaudi::Property< std::string > m_materialMapFile
virtual StatusCode initialize() override final
virtual void visitSurface(Acts::Surface &surface) override final
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Acts::Logging::Level actsLevelVector(MSG::Level lvl)
MsgStream & msg
Definition testRead.cxx:32