ATLAS Offline Software
trig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2 
3 from DCSCalculator2.lib import DCSC_Subdetector_DefectsOnly, DCSC_Defect_Global_Variable, connect_adjacent_iovs_defect
4 from DCSCalculator2.variable import DefectIOV
5 from DQUtils import process_iovs
6 from DQUtils.sugar import IOVSet
7 from DQUtils.iov_truncator import truncate_to_run_iovs, make_run_iovs
8 
9 class Online_Beamspot_Status(DCSC_Defect_Global_Variable):
10  """
11  Overloads calculate_good_iovs
12  """
13  input_db = 'COOLONL_INDET/CONDBR2'
14  fetch_args = {'tag': "IndetBeamposOnl-HLT-UPD1-001-00"}
15  timewise_folder = False
16  def make_good_iovs(self, iovs):
17  return IOVSet(list(connect_adjacent_iovs_defect(self.beamspot_generator(iovs))))
18 
19  def beamspot_generator(self, iovs):
20  state = iovs.select_channels(0)
21  events = process_iovs(iovs)
22  for since, until, (state,) in events:
23  if state is not None:
24  #print since, until, state.status
25  if state.status == 7 or state.status is None:
26  continue
27 
28  yield DefectIOV(since, until, 'TRIG_HLT_IDT_BSPOT_INVALID_STATUS', True,
29  comment='Bad online beamspot status')
30 
31 class Trigger(DCSC_Subdetector_DefectsOnly):
32  #__DISABLED__ = True
33  folder_base = ''
34 
35  variables = [
36  Online_Beamspot_Status('/Indet/Onl/Beampos', lambda x: True),
37  ]
38 
39  def run(self, lbtime, run_iovs):
40  self.evaluate_inputs(lbtime)
41  return IOVSet(sum((truncate_to_run_iovs(
42  make_run_iovs([run_iovs]), var.iovs)[0]
43  for var in self.variables), []))
python.iov_truncator.make_run_iovs
def make_run_iovs(iovs)
Definition: iov_truncator.py:62
python.variable.DefectIOV
def DefectIOV(channel, present, comment)
Definition: variable.py:26
python.subdetectors.trig.Online_Beamspot_Status.beamspot_generator
def beamspot_generator(self, iovs)
Definition: trig.py:19
python.subdetectors.trig.Trigger.run
def run(self, lbtime, run_iovs)
Definition: trig.py:39
python.subdetectors.trig.Online_Beamspot_Status.make_good_iovs
def make_good_iovs(self, iovs)
Definition: trig.py:16
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
python.subdetectors.trig.Trigger.variables
list variables
Definition: trig.py:35
python.iov_truncator.truncate_to_run_iovs
def truncate_to_run_iovs(run_iovs, *iovs)
Definition: iov_truncator.py:84
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.events.process_iovs
def process_iovs(*iovsets)
Definition: events.py:30
python.libcore.connect_adjacent_iovs_defect
def connect_adjacent_iovs_defect(generator)
Definition: libcore.py:69
python.subdetectors.trig.Online_Beamspot_Status
Definition: trig.py:9
python.subdetectors.trig.Trigger
Definition: trig.py:31