Skip to content
Snippets Groups Projects
Commit 401a585d authored by R D Schaffer's avatar R D Schaffer
Browse files

moving to allow for LockMapCurrents = True the field to turn on and off

parent 336cd863
No related branches found
No related tags found
No related merge requests found
......@@ -87,14 +87,11 @@ MagField::AtlasFieldCacheCondAlg::execute(const EventContext& ctx) const {
//This will need to be filled before we construct the condition object
Cache cache{};
// set current scale factor from either conditions or from jobOption parameters if not locked
if (!m_lockMapCurrents) {
if (m_useDCS) {
ATH_CHECK( updateCurrentFromConditions(ctx, cache) );
}
else {
ATH_CHECK( updateCurrentFromParameters(cache) );
}
if (m_useDCS) {
ATH_CHECK( updateCurrentFromConditions(ctx, cache) );
}
else {
ATH_CHECK( updateCurrentFromParameters(cache) );
}
// Must read map cond object to get previously created map
......@@ -113,6 +110,11 @@ MagField::AtlasFieldCacheCondAlg::execute(const EventContext& ctx) const {
scaleField(cache, fieldMap);
}
else {
// For locked currents, we allow the SF to be either 0 or 1, i.e. allow the DCS currents to
// say whether or not the solenoid or toroid is on or not
cache.m_solScaleFactor = (cache.m_solenoidCurrent > 0) ? 1 : 0;
cache.m_torScaleFactor = (cache.m_toroidCurrent > 0) ? 1 : 0;
ATH_MSG_INFO( "execute: map currents locked");
ATH_MSG_INFO( "execute: Solenoid field scale factor " << cache.m_solScaleFactor << ". Desired current and map current: "
<< cache.m_solenoidCurrent << "," << ((fieldMap) ? fieldMap->solenoidCurrent() : 0));
......@@ -235,6 +237,7 @@ MagField::AtlasFieldCacheCondAlg::updateCurrentFromConditions(const EventContext
torcur = 0.0;
ATH_MSG_INFO( "UpdateCurrentFromConditions: Toroids are off" );
}
cache.m_solenoidCurrent = solcur;
cache.m_toroidCurrent = torcur;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment