ATLAS Offline Software
Loading...
Searching...
No Matches
trig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2
3from DCSCalculator2.lib import DCSC_Subdetector_DefectsOnly, DCSC_Defect_Global_Variable, connect_adjacent_iovs_defect
4from DCSCalculator2.variable import DefectIOV
5from DQUtils import process_iovs
6from DQUtils.sugar import IOVSet
7from DQUtils.iov_truncator import truncate_to_run_iovs, make_run_iovs
8
9class 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
31class 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), []))
Definition run.py:1