ATLAS Offline Software
Public Member Functions | List of all members
python.subdetectors.magnets.Magnet_Currents Class Reference
Inheritance diagram for python.subdetectors.magnets.Magnet_Currents:
Collaboration diagram for python.subdetectors.magnets.Magnet_Currents:

Public Member Functions

def make_good_iovs (self, iovs)
 
def magnet_iov_generator (self, iovs, system, measured_channel, desired_channel, tolerance)
 

Detailed Description

Overloads calculate_good_iovs

Definition at line 11 of file magnets.py.

Member Function Documentation

◆ magnet_iov_generator()

def python.subdetectors.magnets.Magnet_Currents.magnet_iov_generator (   self,
  iovs,
  system,
  measured_channel,
  desired_channel,
  tolerance 
)

Definition at line 22 of file magnets.py.

22  def magnet_iov_generator(self, iovs, system,
23  measured_channel, desired_channel, tolerance):
24 
25  measured_iovs = iovs.select_channels(measured_channel)
26  desired_iovs = iovs.select_channels(desired_channel)
27 
28  events = process_iovs(measured_iovs, desired_iovs)
29 
30  for since, until, (measured, desired) in events:
31 
32  # 28-05-2015: excluding empty 'desired' value, because how do we make
33  # a decision without an expectation? Should debug this some more, as
34  # the issue came up in 2015 run 253014.
35 
36  # At least temporarily ignore desired value
37  # if measured is not None and desired is not None and not desired._is_empty:
38  if measured is not None:
39  # NOTE: if measured is 'empty', this is always true
40  if measured.value is None:
41  continue
42  elif measured.value <= tolerance:
43  # Magnet off
44  defect = system + '_OFF'
45 
46  # this code is what we should use if desired values become valid again
47  # elif abs(measured.value - desired.value) <= tolerance:
48  # if ((system == 'GLOBAL_SOLENOID' and abs(desired.value - 7730.) > tolerance)
49  # or (system == 'GLOBAL_TOROID' and abs(desired.value - 20400.) > tolerance)):
50  # # Magnet has non-nominal current
51  # defect = system + '_NOTNOMINAL'
52  # else:
53  # defect = None
54  elif ((system == 'GLOBAL_SOLENOID' and abs(measured.value - 7730.) < tolerance)
55  or (system == 'GLOBAL_TOROID' and abs(measured.value - 20400.) < tolerance)):
56  # Magnet is nominal
57  defect = None
58  else:
59  # Magnet is ramping (possibly not true if we run at reduced field ...)
60  defect = system + '_RAMPING'
61 
62  if defect is None:
63  continue
64 
65  mcurrent = '%.1f' % measured.value if measured.value is not None else 'None'
66  scurrent = '%.1f' % desired.value if desired.value is not None else 'None'
67  yield DefectIOV(since, until, defect, True,
68  comment='Measured current: %s, Set current: %s' % (mcurrent, scurrent))
69 
70 

◆ make_good_iovs()

def python.subdetectors.magnets.Magnet_Currents.make_good_iovs (   self,
  iovs 
)

Definition at line 15 of file magnets.py.

15  def make_good_iovs(self, iovs):
16  atlsol_iovs = self.magnet_iov_generator(iovs, 'GLOBAL_SOLENOID', 1, 2,
17  TOLERANCE_SOLENOID)
18  atltor_iovs = self.magnet_iov_generator(iovs, 'GLOBAL_TOROID', 3, 4,
19  TOLERANCE_TOROID)
20  return IOVSet(list(atlsol_iovs) + list(atltor_iovs))
21 

The documentation for this class was generated from the following file:
python.variable.DefectIOV
def DefectIOV(channel, present, comment)
Definition: variable.py:26
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.events.process_iovs
def process_iovs(*iovsets)
Definition: events.py:30