ATLAS Offline Software
Functions | Variables
python.OnlineISConfig Namespace Reference

Functions

def GetAtlasReady ()
 
def GetRunType ()
 
def GetBFields ()
 

Variables

 log
 
 runType
 
 bFields
 

Function Documentation

◆ GetAtlasReady()

def python.OnlineISConfig.GetAtlasReady ( )

Definition at line 26 of file OnlineISConfig.py.

26 def GetAtlasReady():
27  try:
28  r4p = ISObject(IPCPartition("ATLAS"), "RunParams.Ready4Physics", "RunParams")
29  r4p.checkout()
30  return r4p.ready4physics
31  except Exception:
32  log.error("#### Failed to determine if we are ready for physics")
33  raise
34 
35 

◆ GetBFields()

def python.OnlineISConfig.GetBFields ( )

Definition at line 72 of file OnlineISConfig.py.

72 def GetBFields():
73  # BFields are read from initial partition
74  partition = "initial"
75  log.debug(f"Trying to read magnetic field configuration from {partition=}")
76 
77  # now try and read the information from IS
78  try:
79  ipcPart = ipc.IPCPartition(partition)
80  if not ipcPart.isValid():
81  raise UserWarning(
82  f"{partition=} invalid - cannot access magnetic field setting "
83  )
84 
85  torCurrent = ISInfoDynAny(ipcPart, "DdcFloatInfo")
86  solCurrent = ISInfoDynAny(ipcPart, "DdcFloatInfo")
87  torInvalid = ISInfoDynAny(ipcPart, "DdcIntInfo")
88  solInvalid = ISInfoDynAny(ipcPart, "DdcIntInfo")
89 
90  torInvalid.value = 1
91  solInvalid.value = 1
92 
93  log.info(f"toroidCurrent = {torCurrent.value}")
94  log.info(f"toroidInvalid = {torInvalid.value}")
95  log.info(f"solenoidCurrent = {solCurrent.value}")
96  log.info(f"solenoidInvalid = {solInvalid.value}")
97 
98  # And calculate the flags
99  solOn = (solCurrent.value > 1000.0) and (solInvalid.value == 0)
100  torOn = (torCurrent.value > 1000.0) and (torInvalid.value == 0)
101  except UserWarning as err:
102  log.error(err)
103  # Should always be able to access initial parititon
104  log.fatal("Failed to read magnetic field configuration from IS, aborting")
105 
106  sys.exit(1)
107 
108  # print the result
109  log.info(f"Magnetic field in solenoid is {((solOn and 'ON') or 'OFF')}")
110  log.info(f"Magnetic field in toroid is {((torOn and 'ON') or 'OFF')}")
111 
112  # finally return our values
113  return (solCurrent, torCurrent)
114 
115 

◆ GetRunType()

def python.OnlineISConfig.GetRunType ( )
Get the run type by reading the run-type setting in the partition from IS

Definition at line 36 of file OnlineISConfig.py.

36 def GetRunType():
37  """Get the run type by reading the run-type setting in the partition from IS"""
38 
39  # Try to get the partition name
40  try:
41  partition = os.environ["TDAQ_PARTITION"]
42  if partition == "EventDisplays":
43  partition = "ATLAS"
44  except KeyError:
45  partition = "ATLAS"
46  log.warning(
47  f"TDAQ_PARTITION not defined in environment, using {partition} as default"
48  )
49 
50  # now try and read the information from IS
51  try:
52  ipcPart = ipc.IPCPartition(partition)
53  if not ipcPart.isValid():
54  raise UserWarning(f"{partition=} invalid - cannot access run type settings")
55  runparams = ISObject(ipcPart, "RunParams.RunParams", "RunParams")
56  runparams.checkout()
57  beamEnergy = runparams.beam_energy
58  projectTag = runparams.T0_project_tag
59  except UserWarning as err:
60  log.error(err)
61  beamEnergy = None
62  projectTag = None
63 
64  log.info(f"Setting {projectTag=}")
65  return (
66  None,
67  beamEnergy,
68  projectTag,
69  ) # the BeamType in the IS RunParams is not useful for auto-configuration
70 
71 

Variable Documentation

◆ bFields

python.OnlineISConfig.bFields

Definition at line 119 of file OnlineISConfig.py.

◆ log

python.OnlineISConfig.log

Definition at line 23 of file OnlineISConfig.py.

◆ runType

python.OnlineISConfig.runType

Definition at line 117 of file OnlineISConfig.py.

python.OnlineISConfig.GetBFields
def GetBFields()
Definition: OnlineISConfig.py:72
python.OnlineISConfig.GetRunType
def GetRunType()
Definition: OnlineISConfig.py:36
python.OnlineISConfig.GetAtlasReady
def GetAtlasReady()
Definition: OnlineISConfig.py:26