3 from __future__
import print_function
6 from MuonCalibDbOperations.CalibrationSourceConfig
import MuonCalib__gCalibrationSourceConfigs, MuonCalib__CalibrationSourceConfig
10 if len(MuonCalib__gCalibrationSourceConfigs)==0
and not time:
11 print (
"FATAL Cannot generate gasmon source if no time and no other calibration sources are given")
15 cal_time = MuonCalib__gCalibrationSourceConfigs[0].GetTime(reader_cursor)
17 if not isinstance(
type(cal_time), str):
18 tm=time.gmtime(cal_time)
19 cal_time=
str(tm.tm_year) +
str(tm.tm_mon).zfill(2) +
str(tm.tm_mday).zfill(2)
20 imp_str=
"GASMON_RT_" + cal_time +
"_TP"
24 print (
"INFO Getting", imp_str)
26 reader_cursor.execute(
"select head_id, data_schema from ATLAS_MUONCALIB_UM_META.MDT_HEAD where IMPLEMENTATION=:imp", {
'imp':imp_str})
27 gm_head_id, gm_schema= reader_cursor.fetchone()
29 return MuonCalib__CalibrationSourceConfig(
"UM", gm_head_id,
"",
True,
False)