40def make_sct_mapping():
41 """
42 Generate a mapping for the channelids in /SCT/DCS/HV to DCSOFL output
43 channel ids. The highest two bits can be used to determine the system.
44 (see `subdets`)
45 """
46 from DQUtils.db import Databases
47 from DQUtils.channel_mapping import get_channel_ids_names
48 f = Databases.get_folder("/SCT/DCS/HV", "COOLOFL_DCS/CONDBR2")
49 cids, cnames, cmap = get_channel_ids_names(f)
50
51 mapping = {}
52
53 subdets = {0: 114, 1: 111, 2: 115}
54
55 for cid in cids:
56
57 output_subdet = subdets[(cid >> 25) & 0x3]
58 mapping.setdefault(output_subdet, []).append(cid)
59
60 return mapping
61