76{
78
79
80
81
82
83 std::string mapFile;
87 else {
88
89 return StatusCode::SUCCESS;
90 }
91
92 ATH_MSG_INFO (
"StandardFieldSvc::createFieldMap: Set map currents from FieldSvc: solenoid/toroid "
94 ATH_MSG_INFO (
"StandardFieldSvc::createFieldMap: Use map file " << mapFile);
95
96
98 if ( resolvedMapFile.empty() ) {
99 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: Field map file " << mapFile <<
" not found" );
100 return StatusCode::FAILURE;
101 }
102
103 if ( resolvedMapFile.find(".root") == std::string::npos ) {
104 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: input file name '" << resolvedMapFile <<
"' does not end with .root");
105 return StatusCode::FAILURE;
106 }
107
108 std::unique_ptr<TFile>
rootfile = std::make_unique<TFile>(resolvedMapFile.c_str(),
"OLD");
110 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: failed to open " << resolvedMapFile);
111 return StatusCode::FAILURE;
112 }
114
115 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: unable to cd() into the ROOT field map TFile");
117 return StatusCode::FAILURE;
118 }
119
121 if (
tree ==
nullptr ) {
122
123 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: TTree 'BFieldMap' does not exist in ROOT field map");
125 return StatusCode::FAILURE;
126 }
127
128
129 m_fieldMap = std::make_unique<MagField::AtlasFieldMap>();
130
131
133
134 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: unable to initialize the map for AtlasFieldMap for file " << resolvedMapFile);
136 return StatusCode::FAILURE;
137 }
138
140
141 ATH_MSG_INFO(
"StandardFieldSvc::createFieldMap: Initialized the field map from " << resolvedMapFile );
142 return StatusCode::SUCCESS;
143}
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
Gaudi::Property< double > m_useSoleCurrent
configurable current for map scaling
Gaudi::Property< std::string > m_fullMapFilename
map file names
std::unique_ptr< MagField::AtlasFieldMap > m_fieldMap
Gaudi::Property< double > m_useToroCurrent
Gaudi::Property< std::string > m_toroMapFilename
Gaudi::Property< std::string > m_soleMapFilename
static std::vector< std::string > rootfile