diff --git a/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.icc b/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.icc index 0ea794a5eae8a8dae481a6fe670beb7c760d0d54..8f5bd59d0217f015142800299c1ad4676e4a9e8b 100644 --- a/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.icc +++ b/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.icc @@ -51,10 +51,8 @@ MagField::AtlasFieldCache::getField(const double* ATH_RESTRICT xyz, { // Allow for the case of no map for testing if (m_fieldMap == nullptr) { - // constant ATLAS magnetic field if no map has been set - for testing - constexpr double TEST_BFIELD = 1.997; - bxyz[0] = bxyz[1] = 0; - bxyz[2] = TEST_BFIELD; + // return 0 bfield if map is missing + bxyz[0] = bxyz[1] = bxyz[2] = 0; if (deriv) { for (int i = 0; i < 9; i++) { deriv[i] = 0.; diff --git a/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx b/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx index 261c22ecf732cf30c83f1890b3ef72838a77afb2..c60f448f33e893166a442b9318cd1a56eecdd6e9 100644 --- a/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx +++ b/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx @@ -260,9 +260,21 @@ MagField::AtlasFieldMapCondAlg::updateFieldMap(const EventContext& ctx, Cache& c fullMapFilename = m_fullMapFilename; soleMapFilename = m_soleMapFilename; toroMapFilename = m_toroMapFilename; - cache.m_mapSoleCurrent = m_mapSoleCurrent; - cache.m_mapToroCurrent = m_mapToroCurrent; - + if (m_mapSoleCurrent < m_soleMinCurrent) { + cache.m_mapSoleCurrent = 0; + ATH_MSG_INFO("updateFieldMap: requested solenoid current in JobOpt " << m_mapSoleCurrent << " is below allowed minimum " << m_soleMinCurrent << " setting to 0"); + } + else { + cache.m_mapSoleCurrent = m_mapSoleCurrent; + } + if (m_mapToroCurrent < m_toroMinCurrent) { + cache.m_mapToroCurrent = 0; + ATH_MSG_INFO("updateFieldMap: requested toroid current in JobOpt " << m_mapToroCurrent << " is below allowed minimum " << m_toroMinCurrent << " setting to 0"); + } + else { + cache.m_mapToroCurrent = m_mapToroCurrent; + } + // Create a range for the current run EventIDBase start, stop; start.set_run_number(ctx.eventID().run_number());