ATLAS Offline Software
Loading...
Searching...
No Matches
generate_mdt_mapping Namespace Reference

Functions

 detector_region (key)
 main ()

Variables

str database = "COOLOFL_DCS/CONDBR2"
 MDTBA
 MDTBC
 MDTEA
 MDTEC

Detailed Description

generate_mdt_mapping.py -- a script to generate the MDT channel mapping for HV, LV, JTAG from the COOL database.

from:
        BEE1A02__HV   <=> X
        BEE1A02__LV   <=> Y
        BEE1A02__JTAG <=> Z

to:
        X Y Z BEE1A02 302

https://svnweb.cern.ch/trac/atlasoff/browser/DataQuality/DQUtils/tags/DQUtils-00-01-04/python/db.py
https://svnweb.cern.ch/trac/atlasoff/browser/DataQuality/DQUtils/tags/DQUtils-00-01-04/python/channel_mapping.py

Run like:

[afs] asetup 20.1.4.7,here
[afs] python generate_mdt_mapping.py > mdt_codes.dat

Two exceptions, thanks to George Iakovidis and Stephanie Zimmerman:
 * BOG0B12, BOG0B14 are associated to BOG0A12, BOG0A14 because they are located at z=0.
 * BME5A13, BME5C13 share the same HV, LV with BME4A13, BME4C13 respectively (bigger chambers with 2xCSM)

Alex Tuna <tuna@cern>

Function Documentation

◆ detector_region()

generate_mdt_mapping.detector_region ( key)
e.g., translate BOF7C12 to MDTBC 

Definition at line 35 of file generate_mdt_mapping.py.

35def detector_region(key):
36 """ e.g., translate BOF7C12 to MDTBC """
37
38 if key[0] == "B" and key[4] == "A": return MDTBA
39 if key[0] == "B" and key[4] == "B": return MDTBA # exception
40 if key[0] == "B" and key[4] == "C": return MDTBC
41 if key[0] == "E" and key[4] == "A": return MDTEA
42 if key[0] == "E" and key[4] == "C": return MDTEC
43

◆ main()

generate_mdt_mapping.main ( )

Definition at line 44 of file generate_mdt_mapping.py.

44def main():
45
46 _, _, hv = get_channel_ids_names(Databases.get_folder("/MDT/DCS/HV", database))
47 _, _, lv = get_channel_ids_names(Databases.get_folder("/MDT/DCS/LV", database))
48 _, _, jt = get_channel_ids_names(Databases.get_folder("/MDT/DCS/JTAG", database))
49
50 all_keys = hv.keys() + lv.keys() + jt.keys()
51 string_keys = filter(lambda key: isinstance(key, str), all_keys)
52 region_keys = set()
53
54 for key in string_keys:
55
56 region, folder = key.split("__")
57 region_keys.add(region)
58
59 for key in sorted(region_keys):
60 line = "%-6s %-6s %-6s %-8s %3s" % (hv.get(key+"__HV", 0),
61 lv.get(key+"__LV", 0),
62 jt.get(key+"__JTAG", 0),
63 key,
64 detector_region(key),
65 )
66
67 # exceptions
68 if key == "BOG0A12" and "BOG0B12" in region_keys: continue
69 if key == "BOG0A14" and "BOG0B14" in region_keys: continue
70 if key == "BOG0B12": line = line.replace("%-6s BOG0B12" % (0), "%-6s BOG0A12" % (jt["BOG0A12__JTAG"]))
71 if key == "BOG0B14": line = line.replace("%-6s BOG0B14" % (0), "%-6s BOG0A14" % (jt["BOG0A14__JTAG"]))
72 if key == "BME5A13": line = line.replace("%-6s %-6s" % (0, 0), "%-6s %-6s" % (hv["BME4A13__HV"], lv["BME4A13__LV"]))
73 if key == "BME5C13": line = line.replace("%-6s %-6s" % (0, 0), "%-6s %-6s" % (hv["BME4C13__HV"], lv["BME4C13__LV"]))
74
75 if line:
76 print line
77
78
STL class.
int main()
Definition hello.cxx:18

Variable Documentation

◆ database

str generate_mdt_mapping.database = "COOLOFL_DCS/CONDBR2"

Definition at line 31 of file generate_mdt_mapping.py.

◆ MDTBA

generate_mdt_mapping.MDTBA

Definition at line 33 of file generate_mdt_mapping.py.

◆ MDTBC

generate_mdt_mapping.MDTBC

Definition at line 33 of file generate_mdt_mapping.py.

◆ MDTEA

generate_mdt_mapping.MDTEA

Definition at line 33 of file generate_mdt_mapping.py.

◆ MDTEC

generate_mdt_mapping.MDTEC

Definition at line 33 of file generate_mdt_mapping.py.