ATLAS Offline Software
create_dcsc_inputs_sqlite.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 # This is a script that can be used to copy a number of COOL folders to a sqlite file for DCS Calculator testing
5 
6 FOLDERS = {
7  'COOLONL_TDAQ/CONDBR2': ['/TDAQ/RunCtrl/DataTakingMode', '/TDAQ/OLC/LHC/SCANDATA',],
8  "COOLONL_SCT/CONDBR2": ['/SCT/DAQ/Configuration/Module',],
9  "COOLOFL_TILE/CONDBR2": ['/TILE/OFL02/STATUS/ADC',],
10  "COOLOFL_INDET/CONDBR2": ['/Indet/Beampos',],
11  'COOLONL_INDET/CONDBR2': ['/Indet/Onl/Beampos',],
12  'COOLOFL_TRIGGER/CONDBR2': ['/TRIGGER/OFLLUMI/LumiAccounting',],
13  'COOLONL_TRIGGER/CONDBR2': ['/TRIGGER/LUMI/LBLB',],
14 
15  'COOLOFL_DCS/CONDBR2': [
16  '/AFP/DCS/STATION',
17  '/AFP/DCS/SIT/LV',
18  '/AFP/DCS/SIT/HV',
19  '/AFP/DCS/SIT/HV_VOLTAGE_SET',
20  '/AFP/DCS/TOF_TDC_CURRENT',
21  '/AFP/DCS/TOF',
22  '/AFP/DCS/TOF_PMT_VOLTAGE_SET',
23  '/LAR/DCS/FSM',
24  '/MDT/DCS/HV',
25  '/MDT/DCS/LV',
26  '/MDT/DCS/JTAG',
27  '/PIXEL/DCS/FSMSTATUS',
28  '/PIXEL/DCS/FSMSTATE',
29  '/RPC/DCS/DQTOWERS_3',
30  '/SCT/DCS/HV',
31  '/SCT/DCS/CHANSTAT',
32  '/TDQ/DCS/WIENER/LVL1',
33  '/TILE/DCS/STATES',
34  '/TGC/DCS/PSHVCHSTATE',
35  '/TRT/DCS/HV/BARREL',
36  '/TRT/DCS/HV/ENDCAPA',
37  '/TRT/DCS/HV/ENDCAPC',
38  '/EXT/DCS/MAGNETS/SENSORDATA',
39  '/STG/DCS/HV',
40  '/MMG/DCS/HV'
41  ],
42 }
43 
44 import subprocess
45 RUN = 456685
46 TARGET = 'sqlite://;schema=junk.db;dbname=CONDBR2'
47 for db, folders in FOLDERS.items():
48  arg = ['AtlCoolCopy', db, TARGET, '-r', f'{RUN}',
49  '-bs', '10240', '-gt', '-create']
50  for folder in folders:
51  arg += ['-f', folder]
52  subprocess.run(arg)