3 from ..lib
import DCSC_DefectTranslate_Subdetector, DCSC_Global_Variable
5 GREY, RED, YELLOW = 0, 1, 2
6 EMBA, EMBC, EMECA, EMECC, HECA, HECC, FCALA, FCALC = 202, 203, 204, 205, 214, 215, 224, 225
10 This subdetector only uses one global variable, FSM.
12 Since it only has a global variable, it is not possible to calculate a dead
13 fraction, so this is set to -1, and the dead fraction logic is not called.
16 folder_base =
"/LAR/DCS"
35 Returns a list where each element is a list of (single channel) iovs.
37 The purpose of this function is to map (one or more) channels in the
38 /LAR/DCS/FSM folder on to output DQ regions. These channels are merged
39 together downstream from this function.
41 The `input_globals` may contain a list of iovs which has multiple
42 channels. This function may be over-ridden by inheriting classes to
43 select channels for this output channel.
46 belongs_to_output =
set(self.
mapping[output_channel])
48 for input_global
in input_globals:
49 for input_channel, iovs
in sorted(input_global.by_channel.items()):
50 if input_channel
in belongs_to_output:
51 global_iov_sets.append(iovs)
53 return global_iov_sets
57 evaluator=
lambda iov: (iov.STATE ==
"READY" and (iov.STATUS ==
"OK" or iov.STATUS ==
"WARNING")),
58 caution_evaluator=
lambda iov: (iov.STATE ==
"UNKNOWN" or iov.STATE ==
"DEAD" or iov.STATUS ==
"ERROR")
63 super(LAr, self).
__init__(*args, **kwargs)
64 self.
translators = ([LAr.color_to_defect_translator(flag, defect, [RED])
65 for flag, defect
in ((EMBA,
'LAR_EMBA_DCS_ERROR'),
66 (EMBC,
'LAR_EMBC_DCS_ERROR'),
67 (EMECA,
'LAR_EMECA_DCS_ERROR'),
68 (EMECC,
'LAR_EMECC_DCS_ERROR'),
69 (HECA,
'LAR_HECA_DCS_ERROR'),
70 (HECC,
'LAR_HECC_DCS_ERROR'),
71 (FCALA,
'LAR_FCALA_DCS_ERROR'),
72 (FCALC,
'LAR_FCALC_DCS_ERROR'),
74 + [LAr.color_to_defect_translator(flag, defect, [YELLOW, GREY])
75 for flag, defect
in ((EMBA,
'LAR_EMBA_DCS_WARNING'),
76 (EMBC,
'LAR_EMBC_DCS_WARNING'),
77 (EMECA,
'LAR_EMECA_DCS_WARNING'),
78 (EMECC,
'LAR_EMECC_DCS_WARNING'),
79 (HECA,
'LAR_HECA_DCS_WARNING'),
80 (HECC,
'LAR_HECC_DCS_WARNING'),
81 (FCALA,
'LAR_FCALA_DCS_WARNING'),
82 (FCALC,
'LAR_FCALC_DCS_WARNING'),