ATLAS Offline Software
Loading...
Searching...
No Matches
DataQuality
DCSCalculator2
python
subdetectors
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.subdetectors.trig.Online_Beamspot_Status
Definition
trig.py:9
python.subdetectors.trig.Online_Beamspot_Status.make_good_iovs
make_good_iovs(self, iovs)
Definition
trig.py:16
python.subdetectors.trig.Online_Beamspot_Status.beamspot_generator
beamspot_generator(self, iovs)
Definition
trig.py:19
python.subdetectors.trig.Trigger
Definition
trig.py:31
python.subdetectors.trig.Trigger.variables
list variables
Definition
trig.py:35
run
Definition
run.py:1
Generated on
for ATLAS Offline Software by
1.14.0