10 #include "GaudiKernel/SystemOfUnits.h"
22 m_inputLayerMaterialMapName(
"/GLOBAL/TrackingGeo/Input"),
23 m_inputLayerMaterialMap(nullptr),
24 m_outputLayerMaterialMapName(
"/GLOBAL/TrackingGeo/Output"),
25 m_layerMaterialManipulator(
"")
41 if (!m_layerMaterialManipulator.empty() && m_layerMaterialManipulator.retrieve().isFailure()){
42 ATH_MSG_FATAL(
"Could not retrieve LayerMaterial manipulator - although configured. Aborting.");
43 return StatusCode::FAILURE;
45 return StatusCode::SUCCESS;
56 if (!m_inputLayerMaterialMap){
59 if (
detStore()->
retrieve(m_inputLayerMaterialMap, m_inputLayerMaterialMapName).isFailure()){
60 ATH_MSG_FATAL(
"Could not retrieve LayerMaterialMap wiht name '" << m_inputLayerMaterialMapName <<
"'. Aborting.");
61 return StatusCode::FAILURE;
63 ATH_MSG_DEBUG(
"Retrieved LayerMaterialMap wiht name '" << m_inputLayerMaterialMapName <<
"' for " << m_inputLayerMaterialMap->size() <<
" layers.");
68 for (
const auto & lmIter : (*m_inputLayerMaterialMap) ){
74 if (!m_layerMaterialManipulator.empty())
75 lmp = m_layerMaterialManipulator->processLayerMaterial(lmIter.first,*(lmIter.second));
77 lmp = lmIter.second->
clone();
79 (*outputLayerMaterialMap)[lmIter.first] = lmp;
83 const ElementTable* eTable = m_inputLayerMaterialMap->elementTable();
89 if ( (
detStore()->record(outputLayerMaterialMap, m_outputLayerMaterialMapName,
false)).isFailure()){
90 ATH_MSG_ERROR(
"Writing of LayerMaterialMap with name '" << m_outputLayerMaterialMapName <<
"' was not successful." );
91 delete outputLayerMaterialMap;
93 ATH_MSG_INFO(
"Successfully wrote LayerMaterialMap with name '" << m_outputLayerMaterialMapName <<
"' to the detector store.");
96 return StatusCode::SUCCESS;
104 ATH_MSG_INFO(
"========================================================================================= ");
106 return StatusCode::SUCCESS;