77{
79
80
81
82
83
84 std::string mapFile;
88 else {
89
90 return StatusCode::SUCCESS;
91 }
92
93 ATH_MSG_INFO (
"StandardFieldSvc::createFieldMap: Set map currents from FieldSvc: solenoid/toroid "
95 ATH_MSG_INFO (
"StandardFieldSvc::createFieldMap: Use map file " << mapFile);
96
97
99 if ( resolvedMapFile.empty() ) {
100 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: Field map file " << mapFile <<
" not found" );
101 return StatusCode::FAILURE;
102 }
103
104 if ( resolvedMapFile.find(".root") == std::string::npos ) {
105 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: input file name '" << resolvedMapFile <<
"' does not end with .root");
106 return StatusCode::FAILURE;
107 }
108
109 std::unique_ptr<TFile>
rootfile = std::make_unique<TFile>(resolvedMapFile.c_str(),
"OLD");
111 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: failed to open " << resolvedMapFile);
112 return StatusCode::FAILURE;
113 }
115
116 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: unable to cd() into the ROOT field map TFile");
118 return StatusCode::FAILURE;
119 }
120
122 if (
tree ==
nullptr ) {
123
124 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: TTree 'BFieldMap' does not exist in ROOT field map");
126 return StatusCode::FAILURE;
127 }
128
129
130 m_fieldMap = std::make_unique<MagField::AtlasFieldMap>();
131
132
134
135 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: unable to initialize the map for AtlasFieldMap for file " << resolvedMapFile);
137 return StatusCode::FAILURE;
138 }
139
141
142 ATH_MSG_INFO(
"StandardFieldSvc::createFieldMap: Initialized the field map from " << resolvedMapFile );
143 return StatusCode::SUCCESS;
144}
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