3 from AthenaConfiguration.AthConfigFlags
import AthConfigFlags
4 from AthenaCommon.Logging
import logging
6 msg = logging.getLogger(
'BFieldConfigFlags')
18 if prevFlags.Input.isMC
or prevFlags.Common.isOnline:
21 from CoolConvUtilities.MagFieldUtils
import getFieldForRun
22 lbs=prevFlags.Input.LumiBlockNumbers
23 fieldStat=
getFieldForRun(run=prevFlags.Input.RunNumbers[0],lumiblock=0
if len(lbs)==0
else lbs[0],quiet=
True)
25 msg.error(
"Unable to get field status from DCS, assume both magnets ON")
27 return [fieldStat.solenoidCurrent()>1, fieldStat.toroidCurrent()>1]
34 bcf.addFlag(
"BField.solenoidOn",
lambda prevFlags :
_fieldAutoCfg(prevFlags)[0])
36 bcf.addFlag(
"BField.barrelToroidOn",
lambda prevFlags :
_fieldAutoCfg(prevFlags)[1])
38 bcf.addFlag(
"BField.endcapToroidOn",
lambda prevFlags :
_fieldAutoCfg(prevFlags)[1])
40 bcf.addFlag(
"BField.configuredSolenoidFieldScale", 1.)