|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/ThreadLocalContext.h"
24 ISvcLocator* pSvcLocator)
44 ATH_MSG_INFO(
"initialize: using created map for field cache ");
47 return StatusCode::SUCCESS;
90 return StatusCode::SUCCESS;
93 ATH_MSG_INFO (
"StandardFieldSvc::createFieldMap: Set map currents from FieldSvc: solenoid/toroid "
95 ATH_MSG_INFO (
"StandardFieldSvc::createFieldMap: Use map file " << mapFile);
99 if ( resolvedMapFile.empty() ) {
100 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: Field map file " << mapFile <<
" not found" );
101 return StatusCode::FAILURE;
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;
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;
116 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: unable to cd() into the ROOT field map TFile");
118 return StatusCode::FAILURE;
122 if (
tree ==
nullptr ) {
124 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: TTree 'BFieldMap' does not exist in ROOT field map");
126 return StatusCode::FAILURE;
130 m_fieldMap = std::make_unique<MagField::AtlasFieldMap>();
135 ATH_MSG_ERROR(
"StandardFieldSvc::createFieldMap: unable to initialize the map for AtlasFieldMap for file " << resolvedMapFile);
137 return StatusCode::FAILURE;
142 ATH_MSG_INFO(
"StandardFieldSvc::createFieldMap: Initialized the field map from " << resolvedMapFile );
143 return StatusCode::SUCCESS;
Gaudi::Property< std::string > m_toroMapFilename
ServiceHandle< MagField::IMagFieldSvc > m_magFieldSvc
Handle to the the Forward ATLAS magnetic field service.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Gaudi::Property< bool > m_useMagFieldSvc
Gaudi::Property< double > m_mapSoleCurrent
nominal current for the maps
std::unique_ptr< MagField::AtlasFieldMap > m_fieldMap
Gaudi::Property< double > m_mapToroCurrent
StandardFieldSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
G4 wrapper around the main ATLAS magnetic field cache or field svc for forward field.
Gaudi::Property< double > m_useToroCurrent
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< std::string > m_fullMapFilename
map file names
G4MagneticField * makeField() override final
Create/retrieve the AtlasField object.
StatusCode createFieldMap()
Gaudi::Property< std::string > m_soleMapFilename
StatusCode initialize() override final
Athena method. called at initialization time, being customized here.
Gaudi::Property< double > m_useSoleCurrent
configurable current for map scaling