ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
python.subdetectors.afp.AFP Class Reference
Inheritance diagram for python.subdetectors.afp.AFP:
Collaboration diagram for python.subdetectors.afp.AFP:

Public Member Functions

def merge_variable_states (self, states)
 
def __init__ (self, *args, **kwargs)
 

Static Public Member Functions

def color_to_defect_translator (channel, defect_name, color, comment)
 
def defect_combinator (channels, defect_name, code, comment)
 
def comment_GARAGE (iov)
 DCS defects. More...
 
def comment_SIT_LV (iov)
 
def comment_SIT_HV (iov)
 
def comment_TOF_LV (iov)
 
def comment_TOF_HV (iov)
 
def comment_TTC_RESTART (iov)
 TDAQ defects. More...
 
def comment_STOPLESSLY_REMOVED (iov)
 
def comment_SIT_DISABLED (iov)
 
def comment_TOF_DISABLED (iov)
 
def comment_SIT_COMBINATION ()
 Combination defects. More...
 
def comment_planes (iov, message)
 Comment templates. More...
 
def comment_device (iov, device, message)
 

Public Attributes

 translators
 

Static Public Attributes

string folder_base = '/AFP/DCS'
 
list variables
 
float equality_breaker = 0.0001
 
int dead_fraction_caution = 0 + equality_breaker
 
float dead_fraction_bad = 0.25 + equality_breaker
 
 mapping
 

Detailed Description

Definition at line 295 of file afp.py.

Constructor & Destructor Documentation

◆ __init__()

def python.subdetectors.afp.AFP.__init__ (   self,
args,
**  kwargs 
)

Definition at line 436 of file afp.py.

436  def __init__(self, *args, **kwargs):
437  super(AFP, self).__init__(*args, **kwargs)
438  self.translators = [
439  AFP.color_to_defect_translator(*cdcc)
440  for cdcc in [
441 
444  (A_FAR_GARAGE, 'AFP_A_FAR_IN_GARAGE', RED, AFP.comment_GARAGE),
445  (A_NEAR_GARAGE, 'AFP_A_NEAR_IN_GARAGE', RED, AFP.comment_GARAGE),
446  (C_FAR_GARAGE, 'AFP_C_FAR_IN_GARAGE', RED, AFP.comment_GARAGE),
447  (C_NEAR_GARAGE, 'AFP_C_NEAR_IN_GARAGE', RED, AFP.comment_GARAGE),
448 
449  (A_FAR_SIT_HV, 'AFP_A_FAR_SIT_PARTIALLY_OPERATIONAL_HV', YELLOW, AFP.comment_SIT_HV),
450  (A_FAR_SIT_HV, 'AFP_A_FAR_SIT_NOT_OPERATIONAL_HV', RED, AFP.comment_SIT_HV),
451  (A_NEAR_SIT_HV, 'AFP_A_NEAR_SIT_PARTIALLY_OPERATIONAL_HV', YELLOW, AFP.comment_SIT_HV),
452  (A_NEAR_SIT_HV, 'AFP_A_NEAR_SIT_NOT_OPERATIONAL_HV', RED, AFP.comment_SIT_HV),
453  (C_FAR_SIT_HV, 'AFP_C_FAR_SIT_PARTIALLY_OPERATIONAL_HV', YELLOW, AFP.comment_SIT_HV),
454  (C_FAR_SIT_HV, 'AFP_C_FAR_SIT_NOT_OPERATIONAL_HV', RED, AFP.comment_SIT_HV),
455  (C_NEAR_SIT_HV, 'AFP_C_NEAR_SIT_PARTIALLY_OPERATIONAL_HV', YELLOW, AFP.comment_SIT_HV),
456  (C_NEAR_SIT_HV, 'AFP_C_NEAR_SIT_NOT_OPERATIONAL_HV', RED, AFP.comment_SIT_HV),
457 
458  (A_FAR_SIT_LV, 'AFP_A_FAR_SIT_PARTIALLY_OPERATIONAL_LV', YELLOW, AFP.comment_SIT_LV),
459  (A_FAR_SIT_LV, 'AFP_A_FAR_SIT_NOT_OPERATIONAL_LV', RED, AFP.comment_SIT_LV),
460  (A_NEAR_SIT_LV, 'AFP_A_NEAR_SIT_PARTIALLY_OPERATIONAL_LV', YELLOW, AFP.comment_SIT_LV),
461  (A_NEAR_SIT_LV, 'AFP_A_NEAR_SIT_NOT_OPERATIONAL_LV', RED, AFP.comment_SIT_LV),
462  (C_FAR_SIT_LV, 'AFP_C_FAR_SIT_PARTIALLY_OPERATIONAL_LV', YELLOW, AFP.comment_SIT_LV),
463  (C_FAR_SIT_LV, 'AFP_C_FAR_SIT_NOT_OPERATIONAL_LV', RED, AFP.comment_SIT_LV),
464  (C_NEAR_SIT_LV, 'AFP_C_NEAR_SIT_PARTIALLY_OPERATIONAL_LV', YELLOW, AFP.comment_SIT_LV),
465  (C_NEAR_SIT_LV, 'AFP_C_NEAR_SIT_NOT_OPERATIONAL_LV', RED, AFP.comment_SIT_LV),
466 
467  (A_FAR_TOF_LV, 'AFP_A_FAR_TOF_NOT_OPERATIONAL_LV', RED, AFP.comment_TOF_LV),
468  (C_FAR_TOF_LV, 'AFP_C_FAR_TOF_NOT_OPERATIONAL_LV', RED, AFP.comment_TOF_LV),
469 
470  (A_FAR_TOF_HV, 'AFP_A_FAR_TOF_NOT_OPERATIONAL_HV', RED, AFP.comment_TOF_HV),
471  (C_FAR_TOF_HV, 'AFP_C_FAR_TOF_NOT_OPERATIONAL_HV', RED, AFP.comment_TOF_HV),
472 
473 
476  (TTC_RESTART, 'AFP_TTC_RESTART', RED, AFP.comment_TTC_RESTART),
477  (STOPLESSLY_REMOVED, 'AFP_STOPLESSLY_REMOVED', RED, AFP.comment_STOPLESSLY_REMOVED),
478 
479  (A_FAR_SIT_DISABLED, 'AFP_A_FAR_SIT_PARTIALLY_OPERATIONAL_TDAQ', YELLOW, AFP.comment_SIT_DISABLED),
480  (A_FAR_SIT_DISABLED, 'AFP_A_FAR_SIT_NOT_OPERATIONAL_TDAQ', RED, AFP.comment_SIT_DISABLED),
481  (A_NEAR_SIT_DISABLED, 'AFP_A_NEAR_SIT_PARTIALLY_OPERATIONAL_TDAQ', YELLOW, AFP.comment_SIT_DISABLED),
482  (A_NEAR_SIT_DISABLED, 'AFP_A_NEAR_SIT_NOT_OPERATIONAL_TDAQ', RED, AFP.comment_SIT_DISABLED),
483  (C_FAR_SIT_DISABLED, 'AFP_C_FAR_SIT_PARTIALLY_OPERATIONAL_TDAQ', YELLOW, AFP.comment_SIT_DISABLED),
484  (C_FAR_SIT_DISABLED, 'AFP_C_FAR_SIT_NOT_OPERATIONAL_TDAQ', RED, AFP.comment_SIT_DISABLED),
485  (C_NEAR_SIT_DISABLED, 'AFP_C_NEAR_SIT_PARTIALLY_OPERATIONAL_TDAQ', YELLOW, AFP.comment_SIT_DISABLED),
486  (C_NEAR_SIT_DISABLED, 'AFP_C_NEAR_SIT_NOT_OPERATIONAL_TDAQ', RED, AFP.comment_SIT_DISABLED),
487 
488  (A_FAR_TOF_DISABLED, 'AFP_A_FAR_TOF_NOT_OPERATIONAL_TDAQ', RED, AFP.comment_TOF_DISABLED),
489  (C_FAR_TOF_DISABLED, 'AFP_C_FAR_TOF_NOT_OPERATIONAL_TDAQ', RED, AFP.comment_TOF_DISABLED),
490  ]
491  ] + [
492  AFP.defect_combinator(*cdcc)
493  for cdcc in [
494  ([A_FAR_SIT_LV, A_FAR_SIT_DISABLED], 'AFP_A_FAR_SIT_NOT_OPERATIONAL', YELLOW, AFP.comment_SIT_COMBINATION),
495  ([A_NEAR_SIT_LV, A_NEAR_SIT_DISABLED], 'AFP_A_NEAR_SIT_NOT_OPERATIONAL', YELLOW, AFP.comment_SIT_COMBINATION),
496  ([C_FAR_SIT_LV, C_FAR_SIT_DISABLED], 'AFP_C_FAR_SIT_NOT_OPERATIONAL', YELLOW, AFP.comment_SIT_COMBINATION),
497  ([C_NEAR_SIT_LV, C_NEAR_SIT_DISABLED], 'AFP_C_NEAR_SIT_NOT_OPERATIONAL', YELLOW, AFP.comment_SIT_COMBINATION),
498  ]
499  ]
500 

Member Function Documentation

◆ color_to_defect_translator()

def python.subdetectors.afp.AFP.color_to_defect_translator (   channel,
  defect_name,
  color,
  comment 
)
static

Definition at line 411 of file afp.py.

411  def color_to_defect_translator(channel, defect_name, color, comment):
412  def translator_core(iovs):
413  return [DefectIOV(iov.since, iov.until, defect_name, True,
414  comment=comment(iov))
415  for iov in iovs if iov.channel == channel
416  and iov.Code == color]
417  return translator_core
418 

◆ comment_device()

def python.subdetectors.afp.AFP.comment_device (   iov,
  device,
  message 
)
static

Definition at line 562 of file afp.py.

562  def comment_device(iov, device, message):
563  count = iov.NConfig - iov.NWorking
564  if count != 1:
565  device += 's'
566  return f"{count} {device} {message}"

◆ comment_GARAGE()

def python.subdetectors.afp.AFP.comment_GARAGE (   iov)
static

DCS defects.

Definition at line 506 of file afp.py.

506  def comment_GARAGE(iov):
507  return 'Station not in physics'
508 

◆ comment_planes()

def python.subdetectors.afp.AFP.comment_planes (   iov,
  message 
)
static

Comment templates.

Definition at line 558 of file afp.py.

558  def comment_planes(iov, message):
559  return AFP.comment_device(iov, 'SiT plane', message)
560 

◆ comment_SIT_COMBINATION()

def python.subdetectors.afp.AFP.comment_SIT_COMBINATION ( )
static

Combination defects.

Definition at line 550 of file afp.py.

550  def comment_SIT_COMBINATION():
551  return "Combination of 'partially operational' defects"
552 

◆ comment_SIT_DISABLED()

def python.subdetectors.afp.AFP.comment_SIT_DISABLED (   iov)
static

Definition at line 538 of file afp.py.

538  def comment_SIT_DISABLED(iov):
539  return AFP.comment_planes(iov, 'removed from readout')
540 

◆ comment_SIT_HV()

def python.subdetectors.afp.AFP.comment_SIT_HV (   iov)
static

Definition at line 514 of file afp.py.

514  def comment_SIT_HV(iov):
515  return AFP.comment_planes(iov, 'out of nominal voltage')
516 

◆ comment_SIT_LV()

def python.subdetectors.afp.AFP.comment_SIT_LV (   iov)
static

Definition at line 510 of file afp.py.

510  def comment_SIT_LV(iov):
511  return AFP.comment_planes(iov, 'with too low current')
512 

◆ comment_STOPLESSLY_REMOVED()

def python.subdetectors.afp.AFP.comment_STOPLESSLY_REMOVED (   iov)
static

Definition at line 534 of file afp.py.

534  def comment_STOPLESSLY_REMOVED(iov):
535  return 'AFP stoplessly removed from the run'
536 

◆ comment_TOF_DISABLED()

def python.subdetectors.afp.AFP.comment_TOF_DISABLED (   iov)
static

Definition at line 542 of file afp.py.

542  def comment_TOF_DISABLED(iov):
543  return AFP.comment_device(iov, 'ToF TDC', 'removed from readout')
544 

◆ comment_TOF_HV()

def python.subdetectors.afp.AFP.comment_TOF_HV (   iov)
static

Definition at line 522 of file afp.py.

522  def comment_TOF_HV(iov):
523  return 'ToF PMT out of nominal voltage'
524 

◆ comment_TOF_LV()

def python.subdetectors.afp.AFP.comment_TOF_LV (   iov)
static

Definition at line 518 of file afp.py.

518  def comment_TOF_LV(iov):
519  return 'ToF TDC with too low current'
520 

◆ comment_TTC_RESTART()

def python.subdetectors.afp.AFP.comment_TTC_RESTART (   iov)
static

TDAQ defects.

Definition at line 530 of file afp.py.

530  def comment_TTC_RESTART(iov):
531  return 'AFP not in the RUNNING state'
532 

◆ defect_combinator()

def python.subdetectors.afp.AFP.defect_combinator (   channels,
  defect_name,
  code,
  comment 
)
static

Definition at line 420 of file afp.py.

420  def defect_combinator(channels, defect_name, code, comment):
421  def combinator_core(iovs):
422  result = []
423  channel_diffs = [channels[0] - channel for channel in channels]
424  channel_iovs = iovs.by_channel
425  defect_iovs = [channel_iovs.get(channel) for channel in channels]
426  for since, until, states in process_iovs(*defect_iovs):
427  matched = [state for state in states if state.Code == code]
428  if len(matched) < 2: continue # We need at least two defects
429  matched_diffs = [diff for state,diff in zip(states, channel_diffs) if state.Code == code]
430  bad_channels = [{iov.channel + diff for iov in state._orig_iovs if not iov.good} for state,diff in zip(matched,matched_diffs)]
431  if all(a.issubset(b) or a.issuperset(b) for a,b in combinations(bad_channels, 2)): continue # We need that the defects have different origin
432  result.append(DefectIOV(since, until, defect_name, True, comment=comment()))
433  return result
434  return combinator_core
435 

◆ merge_variable_states()

def python.subdetectors.afp.AFP.merge_variable_states (   self,
  states 
)
Merge input channel states across variables, taking the worst.

Ignore configuration variables and variables without channel.

Definition at line 397 of file afp.py.

397  def merge_variable_states(self, states):
398  """
399  Merge input channel states across variables, taking the worst.
400 
401  Ignore configuration variables and variables without channel.
402  """
403 
404  # Remove variables without channel
405  states = [state for state in states if state and state.channel is not None]
406 
407  # More simplistic way of doing the above, but cannot handle config vars:
408  return min(state.good for state in states) if len(states) > 0 else None
409 

Member Data Documentation

◆ dead_fraction_bad

float python.subdetectors.afp.AFP.dead_fraction_bad = 0.25 + equality_breaker
static

Definition at line 389 of file afp.py.

◆ dead_fraction_caution

int python.subdetectors.afp.AFP.dead_fraction_caution = 0 + equality_breaker
static

Definition at line 388 of file afp.py.

◆ equality_breaker

float python.subdetectors.afp.AFP.equality_breaker = 0.0001
static

Definition at line 386 of file afp.py.

◆ folder_base

string python.subdetectors.afp.AFP.folder_base = '/AFP/DCS'
static

Definition at line 296 of file afp.py.

◆ mapping

python.subdetectors.afp.AFP.mapping
static
Initial value:
1: [*GARAGE, TTC_RESTART, STOPLESSLY_REMOVED, *TOF_LV, *TOF_HV],
2: TOF_DISABLED,
4: [*SIT_DISABLED, *SIT_LV, *SIT_HV],
})

Definition at line 391 of file afp.py.

◆ translators

python.subdetectors.afp.AFP.translators

Definition at line 438 of file afp.py.

◆ variables

list python.subdetectors.afp.AFP.variables
static

Definition at line 297 of file afp.py.


The documentation for this class was generated from the following file:
python.variable.DefectIOV
def DefectIOV(channel, present, comment)
Definition: variable.py:26
python.subdetectors.afp.mapTranslatorCounts
def mapTranslatorCounts(countMap)
Definition: afp.py:289
python.events.process_iovs
def process_iovs(*iovsets)
Definition: events.py:30
min
#define min(a, b)
Definition: cfImp.cxx:40
CaloCondBlobAlgs_fillNoiseFromASCII.comment
string comment
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:27
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.combo.combinations
def combinations(items, n)
Definition: combo.py:85
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:64