ATLAS Offline Software
genGasmonSource.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 from __future__ import print_function
4 
5 import sys
6 from MuonCalibDbOperations.CalibrationSourceConfig import MuonCalib__gCalibrationSourceConfigs, MuonCalib__CalibrationSourceConfig
7 import time
8 
9 def MuonCalib__genGasmonSource(toroidOn, cal_time, reader_cursor):
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")
12  sys.exit(1)
13 
14  if not cal_time:
15  cal_time = MuonCalib__gCalibrationSourceConfigs[0].GetTime(reader_cursor)
16 
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"
21  if toroidOn:
22  imp_str += "M"
23 
24  print ("INFO Getting", imp_str)
25 
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()
28 
29  return MuonCalib__CalibrationSourceConfig("UM", gm_head_id, "", True, False)
30 
31 
32 
genGasmonSource.MuonCalib__genGasmonSource
def MuonCalib__genGasmonSource(toroidOn, cal_time, reader_cursor)
Definition: genGasmonSource.py:9
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
str
Definition: BTagTrackIpAccessor.cxx:11