diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/CMakeLists.txt b/InnerDetector/InDetConditions/SCT_ConditionsServices/CMakeLists.txt index 108f127a16db204a0d0b75f9dc7d42173cb325b9..1b8b5071a5ca5cba1419b3dabbb79292054685f3 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/CMakeLists.txt +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/CMakeLists.txt @@ -61,3 +61,4 @@ atlas_add_test( SCT_RODVetoSvc_test # Install files from the package: atlas_install_headers( SCT_ConditionsServices ) +atlas_install_python_modules( python/*.py ) diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_CachedSummarySvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_CachedSummarySvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..e2dabba1779ce2d3e32370be3393a5061133390a --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_CachedSummarySvcSetup.py @@ -0,0 +1,23 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_CachedSummarySvcSetup: + "Class to simplify setup of SCT_CachedSummarySvc and required conditions algorithms" + + def __init__(self): + self.svcName = "SCT_CachedSummarySvc" + self.svc = None + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_CachedSummarySvc + ServiceMgr += SCT_CachedSummarySvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setSvc() + +sct_CachedSummarySvcSetup = SCT_CachedSummarySvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsParameterSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsParameterSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..67db059deb54ce39679da57d661e0c373502df46 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsParameterSvcSetup.py @@ -0,0 +1,67 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_ConditionsParameterSvcSetup: + "Class to simplify setup of SCT_ConditionsParameterSvc and required conditions algorithms" + + def __init__(self): + self.folder = "/SCT/DAQ/Configuration/Chip" + self.folderDb = None + self.dbInstance = "SCT" + self.algName = "SCT_ConditionsParameterCondAlg" + self.alg = None + self.svcName = "SCT_ConditionsParameterSvc" + self.svc = None + + def getFolder(self): + return self.folder + + def getFolderDb(self): + return self.folderDb + + def setFolderDb(self, folderDb): + self.folderDb = folderDb + + def getDbInstance(self): + return self.dbInstance + + def setDbInstance(self, dbInstance): + self.dbInstance = dbInstance + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.folder): + if self.folderDb is None: + self.folderDb = self.folder + conddb.addFolder(self.dbInstance, self.folderDb, className="CondAttrListVec") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsParameterCondAlg + condSeq += SCT_ConditionsParameterCondAlg(name = self.algName, + ReadKey = self.folder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsParameterSvc + ServiceMgr += SCT_ConditionsParameterSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_ConditionsParameterSvcSetup = SCT_ConditionsParameterSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsServicesSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsServicesSetup.py deleted file mode 100644 index 23a553e0254d327af7f8b9f66492da8ed3a89fb9..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsServicesSetup.py +++ /dev/null @@ -1,178 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Usage: -# -# from SCT_ConditionsServices import SCT_ConditionsServicesSetup -# -# For more configuration one can get access to the service configurables via -# members summarySvc, monitorSvc, etc. Eg: -# SCT_ConditionsServicesSetup.monitorSvc.OutputLevel = VERBOSE -# print SCT_ConditionsServicesSetup.monitorSvc.OutputLevel -# -# Alternatively, you can also access the services directly by e.g: -# from SCT_ConditionsServices.SCT_ConditionsServicesSetup import InDetSCT_ConditionsSummarySvc, InDetSCT_FlaggedConditionSvc -# InDetSCT_ConditionsSummarySvc.OutputLevel = VERBOSE - -class SCT_ConditionsServicesSetup: - "Class to simplify setup of SCT_ConditionsSerivces" - def __init__(self): - - from AthenaCommon.AppMgr import ServiceMgr - self.svcMgr = ServiceMgr - - from IOVDbSvc.CondDB import conddb - self.condDB = conddb - - self.isMC = False - from AthenaCommon.GlobalFlags import globalflags - if globalflags.DataSource() == 'geant4': isMC = True - - self.eventInfoKey = "ByteStreamEventInfo" - if isMC: - self.eventInfoKey = "McEventInfo" - - self.summarySvc = self.initSummarySvc('InDetSCT_ConditionsSummarySvc') - self.flaggedSvc = self.initFlaggedSvc('InDetSCT_FlaggedConditionSvc') - self.configSvc = self.initConfigSvc('InDetSCT_ConfigurationConditionsSvc') - self.monitorSvc = self.initMonitorSvc('InDetSCT_MonitorConditionsSvc') - self.bsErrSvc = self.initBSErrSvc('InDetSCT_ByteStreamErrorsSvc') - self.calibSvc = self.initCalibSvc('InDetSCT_ReadCalibDataSvc') - #if not self.isMC: self.dcsSvc = self.initDcsSvc('InDetSCT_DCSConditionsSvc') - pass - - def initSummarySvc(self, instanceName): - "Init summary conditions servic" - - if hasattr(self.svcMgr,instanceName): - summarySvc = getattr(self.svcMgr, instanceName); - else: - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsSummarySvc - summarySvc = SCT_ConditionsSummarySvc(name = instanceName) - self.svcMgr += summarySvc - return summarySvc - - def initFlaggedSvc(self, instanceName): - "Init flagged conditions service" - - if hasattr(self.svcMgr,instanceName): - flaggedSvc = getattr(self.svcMgr, instanceName); - else : - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_FlaggedConditionSvc - flaggedSvc = SCT_FlaggedConditionSvc(name = instanceName) - self.svcMgr += flaggedSvc - - self.summarySvc.ConditionsServices+=[instanceName] - return flaggedSvc - - def initConfigSvc(self, instanceName): - "Init configuration conditions service" - - if hasattr(self.svcMgr,instanceName): - configSvc = getattr(self.svcMgr, instanceName); - else: - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationConditionsSvc - configSvc = SCT_ConfigurationConditionsSvc(name = instanceName) - self.svcMgr += configSvc - - self.summarySvc.ConditionsServices+=[instanceName] - - if not self.condDB.folderRequested('/SCT/DAQ/Configuration/Chip'): - self.condDB.addFolder("SCT","/SCT/DAQ/Configuration/Chip") - if not self.condDB.folderRequested('/SCT/DAQ/Configuration/Module'): - self.condDB.addFolder("SCT","/SCT/DAQ/Configuration/Module") - if not self.condDB.folderRequested('/SCT/DAQ/Configuration/MUR'): - self.condDB.addFolder("SCT","/SCT/DAQ/Configuration/MUR") - - return configSvc - - def initMonitorSvc(self, instanceName): - "Init monitoring conditions service" - - if hasattr(self.svcMgr,instanceName): - monitorSvc = getattr(self.svcMgr, instanceName); - else: - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MonitorConditionsSvc - monitorSvc = SCT_MonitorConditionsSvc(name = instanceName, - WriteCondObjs = False, - RegisterIOV = False, - ReadWriteCool = True, - EventInfoKey = self.eventInfoKey) - #OutputLevel = INFO) - self.svcMgr += monitorSvc - - self.summarySvc.ConditionsServices+=[instanceName] - - if not self.condDB.folderRequested('/SCT/Derived/Monitoring'): - self.condDB.addFolder("SCT","/SCT/Derived/Monitoring") - - return monitorSvc - - def initDcsSvc(self, instanceName): - "Init DCS conditions service" - - if hasattr(self.svcMgr,instanceName): - dcsSvc = getattr(self.svcMgr, instanceName); - else: - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc - dcsSvc = SCT_DCSConditionsSvc(name = instanceName) - self.svcMgr += dcsSvc - - self.summarySvc.ConditionsServices+=[instanceName] - - if not self.condDB.folderRequested('/SCT/DCS/HV'): - self.condDB.addFolder("DCS_OFL","/SCT/DCS/HV") - if not self.condDB.folderRequested('/SCT/DCS/MODTEMP'): - self.condDB.addFolder("DCS_OFL","/SCT/DCS/MODTEMP") - if not self.condDB.folderRequested('/SCT/DCS/MPS/LV'): - self.condDB.addFolder("DCS_OFL","/SCT/DCS/MPS/LV") - if not self.condDB.folderRequested('/SCT/DCS/CHANSTAT'): - self.condDB.addFolder("DCS_OFL","/SCT/DCS/CHANSTAT") - - return dcsSvc - - def initBSErrSvc(self, instanceName): - "Init ByteStream errors service" - - if hasattr(self.svcMgr,instanceName): - bsErrSvc = getattr(self.svcMgr, instanceName); - else: - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ByteStreamErrorsSvc - bsErrSvc = SCT_ByteStreamErrorsSvc(name = instanceName) - self.svcMgr += bsErrSvc - - self.summarySvc.ConditionsServices+=[instanceName] - return bsErrSvc - - def initCalibSvc(self, instanceName): - "Init Calibration Data service" - - if hasattr(self.svcMgr,instanceName): - calibSvc = getattr(self.svcMgr, instanceName); - else: - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibDataSvc - calibSvc = SCT_ReadCalibDataSvc(name = instanceName, - EventInfoKey = self.eventInfoKey) - self.svcMgr += calibSvc - - self.summarySvc.ConditionsServices+=[instanceName] - - if not self.condDB.folderRequested('/SCT/DAQ/Calibration/ISNPtGainSummaryData'): - self.condDB.addFolder("SCT","/SCT/DAQ/Calibration/ISNPtGainSummaryDat") - if not self.condDB.folderRequested('/SCT/DAQ/Calibration/ISNoiseOccupancySummaryData'): - self.condDB.addFolder("SCT","/SCT/DAQ/Calibration/ISNoiseOccupancySummaryData") - - return calibSvc - - pass - -# Create instance of setup service -sctConditionsSvc = SCT_ConditionsServicesSetup() - -InDetSCT_ConditionsSummarySvc = sctConditionsSvc.summarySvc -InDetSCT_ConfigurationConditionsSvc = sctConditionsSvc.configSvc -InDetSCT_FlaggedConditionSvc = sctConditionsSvc.flaggedSvc -InDetSCT_MonitorConditionsSvc = sctConditionsSvc.monitorSvc -InDetSCT_ByteStreamErrorsSvc = sctConditionsSvc.bsErrSvc -InDetSCT_ReadCalibDataSvc = sctConditionsSvc.calibSvc -#if not self.isMC: InDetSCT_DCSConditionsSvc = sctConditionsSvc.dcsSvc - diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsSummarySvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsSummarySvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..0ac30101d847b7dc39f688b37ab06afa75e3c1b3 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConditionsSummarySvcSetup.py @@ -0,0 +1,23 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_ConditionsSummarySvcSetup: + "Class to simplify setup of SCT_ConditionsSummarySvc and required conditions algorithms" + + def __init__(self): + self.svcName = "SCT_ConditionsSummarySvc" + self.svc = None + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsSummarySvc + ServiceMgr += SCT_ConditionsSummarySvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setSvc() + +sct_ConditionsSummarySvcSetup = SCT_ConditionsSummarySvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConfigurationConditionsSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConfigurationConditionsSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..42fa7fb6bb629f9be85a09192fd236fddc9a2b63 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ConfigurationConditionsSvcSetup.py @@ -0,0 +1,105 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_ConfigurationConditionsSvcSetup: + "Class to simplify setup of SCT_ConfigurationConditionsSvcSetup and required conditions algorithms" + + def __init__(self): + self.channelFolder = "/SCT/DAQ/Config/Chip" + self.moduleFolder = "/SCT/DAQ/Config/Module" + self.murFolder = "/SCT/DAQ/Config/MUR" + self.channelFolderDb = None + self.moduleFolderDb = None + self.murFolderDb = None + self.dbInstance = "SCT" + self.algName = "SCT_ConfigurationCondAlg" + self.alg = None + self.svcName = "SCT_ReadCalibChipDataSvc" + self.svc = None + + def getChannelFolder(self): + return self.channelFolder + + def getModuleFolder(self): + return self.moduleFolder + + def getMurFolder(self): + return self.murFolder + + def getChannelFolderDb(self): + return self.channelFolderDb + + def getModuleFolderDb(self): + return self.moduleFolderDb + + def getMurFolderDb(self): + return self.murFolderDb + + def setChannelFolderDb(self, channelFolderDb): + self.channelFolderDb = channelFolderDb + + def setModuleFolderDb(self, moduleFolderDb): + self.moduleFolderDb = moduleFolderDb + + def setMurFolderDb(self, murFolderDb): + self.murFolderDb = murFolderDb + + def getDbInstance(self): + return self.dbInstance + + def setDbInstance(self, dbInstance): + self.dbInstance = dbInstance + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.channelFolder): + if self.channelFolderDb is None: + conddb.addFolderSplitMC(self.dbInstance, self.channelFolder, self.channelFolder, className="CondAttrListVec") + else: + conddb.addFolder(self.dbInstance, self.channelFolderDb, className="CondAttrListVec") + if not conddb.folderRequested(self.moduleFolder): + if self.moduleFolderDb is None: + conddb.addFolderSplitMC(self.dbInstance, self.moduleFolder, self.moduleFolder, className="CondAttrListVec") + else: + conddb.addFolder(self.dbInstance, self.moduleFolderDb, className="CondAttrListVec") + if not conddb.folderRequested(self.murFolder): + if self.murFolderDb is None: + conddb.addFolderSplitMC(self.dbInstance, self.murFolder, self.murFolder, className="CondAttrListVec") + else: + conddb.addFolder(self.dbInstance, self.murFolderDb, className="CondAttrListVec") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationCondAlg + condSeq += SCT_ConfigurationCondAlg(name = self.algName, + ReadKeyChannel = self.channelFolder, + ReadKeyModule = self.moduleFolder, + ReadKeyMur = self.murFolder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationConditionsSvc + ServiceMgr += SCT_ConfigurationConditionsSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def getSvcName(self): + return self.svcName + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_ConfigurationConditionsSvcSetup = SCT_ConfigurationConditionsSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_DCSConditionsSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_DCSConditionsSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..79b7df89a1cc78cb1c9d4de24e7f8e53f14c0925 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_DCSConditionsSvcSetup.py @@ -0,0 +1,99 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_DCSConditionsSvcSetup: + "Class to simplify setup of SCT_DCSConditionsSvc and required conditions algorithms" + + def __init__(self): + self.stateFolder = "/SCT/DCS/CHANSTAT" + self.hvFolder = "/SCT/DCS/HV" + self.tempFolder = "/SCT/DCS/MODTEMP" + + self.stateAlgName = "SCT_DCSConditionsStatCondAlg" + self.hvAlgName = "SCT_DCSConditionsHVCondAlg" + self.tempAlgName = "SCT_DCSConditionsTempCondAlg" + + self.stateAlg = None + self.hvAlg = None + self.tempAlg = None + + self.svcName = "InDetSCT_DCSConditionsSvc" + self.svc = None + + def getStateFolder(self): + return self.stateFolder + + def getHVFolder(self): + return self.hvFolder + + def getTempFolder(self): + return self.tempFolder + + def getStateAlgName(self): + return self.stateAlgName + + def getHVAlgName(self): + return self.hvAlgName + + def getTempAlgName(self): + return self.tempAlgName + + def getStateAlg(self): + return self.stateAlg + + def getHVAlg(self): + return self.hvAlg + + def getTempAlg(self): + return self.tempAlg + + def getSvcName(self): + return self.svcName + + def getSvc(self): + return self.svc + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.stateFolder): + conddb.addFolder("DCS_OFL", self.stateFolder, className="CondAttrListCollection") + if not conddb.folderRequested(self.hvFolder): + conddb.addFolder("DCS_OFL", self.hvFolder, className="CondAttrListCollection") + if not conddb.folderRequested(self.tempFolder): + conddb.addFolder("DCS_OFL", self.tempFolder, className="CondAttrListCollection") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + + if not hasattr(condSeq, self.stateAlgName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsStatCondAlg + condSeq += SCT_DCSConditionsStatCondAlg(name = self.stateAlgName, + ReadKeyHV = self.hvFolder, + ReadKeyState = self.stateFolder) + self.stateAlg = getattr(condSeq, self.stateAlgName) + + if not hasattr(condSeq, self.hvAlgName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsHVCondAlg + condSeq += SCT_DCSConditionsHVCondAlg(name = self.hvAlgName, + ReadKey = self.hvFolder) + self.hvAlg = getattr(condSeq, self.hvAlgName) + + if not hasattr(condSeq, self.tempAlgName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsTempCondAlg + condSeq += SCT_DCSConditionsTempCondAlg(name = self.tempAlgName, + ReadKey = self.tempFolder) + self.tempAlg = getattr(condSeq, self.tempAlgName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc + ServiceMgr += SCT_DCSConditionsSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_DCSConditionsSvcSetup = SCT_DCSConditionsSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_LinkMaskingSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_LinkMaskingSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..061b250dc4220f58dc375f0d20d820e2bae18960 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_LinkMaskingSvcSetup.py @@ -0,0 +1,67 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_LinkMaskingSvcSetup: + "Class to simplify setup of SCT_LinkMaskingSvc and required conditions algorithms" + + def __init__(self): + self.folder = "/purple/pants" + self.folderDb = None + self.dbInstance = "" + self.algName = "SCT_LinkMaskingCondAlg" + self.alg = None + self.svcName = "SCT_LinkMaskingSvc" + self.svc = None + + def getFolder(self): + return self.folder + + def getFolderDb(self): + return self.folderDb + + def setFolderDb(self, folderDb): + self.folderDb = folderDb + + def getDbInstance(self): + return self.dbInstance + + def setDbInstance(self, dbInstance): + self.dbInstance = dbInstance + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.folder): + if self.folderDb is None: + self.folderDb = self.folder + conddb.addFolder(self.dbInstance, self.folderDb, className="CondAttrListCollection") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_LinkMaskingCondAlg + condSeq += SCT_LinkMaskingCondAlg(name = self.algName, + ReadKey = self.folder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_LinkMaskingSvc + ServiceMgr += SCT_LinkMaskingSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_LinkMaskingSvcSetup = SCT_LinkMaskingSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_MajorityConditionsSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_MajorityConditionsSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..530e3492e45e50ea08d1c89d1086ebb93f60ab52 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_MajorityConditionsSvcSetup.py @@ -0,0 +1,67 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_MajorityConditionsSvcSetup: + "Class to simplify setup of SCT_MajorityConditionsSvc and required conditions algorithms" + + def __init__(self): + self.folder = "/SCT/DCS/MAJ" + self.folderDb = None + self.dbInstance = "DCS_OFL" + self.algName = "SCT_MajorityCondAlg" + self.alg = None + self.svcName = "SCT_MajorityConditionsSvc" + self.svc = None + + def getFolder(self): + return self.folder + + def getFolderDb(self): + return self.folderDb + + def setFolderDb(self, folderDb): + self.folderDb = folderDb + + def getDbInstance(self): + return self.dbInstance + + def setDbInstance(self, dbInstance): + self.dbInstance = dbInstance + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.folder): + if self.folderDb is None: + self.folderDb = self.folder + conddb.addFolder(self.dbInstance, self.folderDb, className="CondAttrListCollection") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MajorityCondAlg + condSeq += SCT_MajorityCondAlg(name = self.algName, + ReadKey = self.folder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MajorityConditionsSvc + ServiceMgr += SCT_MajorityConditionsSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_MajorityConditionsSvcSetup = SCT_MajorityConditionsSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ModuleVetoSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ModuleVetoSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..cc1d6ec1a51eafc6c932bf0c342331808e676b70 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ModuleVetoSvcSetup.py @@ -0,0 +1,88 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_ModuleVetoSvcSetup: + "Class to simplify setup of SCT_ModuleVetoSvc and required conditions algorithms" + + def __init__(self): + self.folder = "/SCT/Manual/BadModules" + self.folderDb = None + self.folderTag = None + self.dbInstance = "SCT_OFL" + self.algName = "SCT_ModuleVetoCondAlg" + self.alg = None + self.svcName = "SCT_ModuleVetoSvc" + self.svc = None + self.useDB = True + + def getFolder(self): + return self.folder + + def getFolderDb(self): + return self.folderDb + + def setFolderTag(self, folderTag): + self.folderTag = folderTag + + def getFolderTag(self): + return self.folderTag + + def setFolderDb(self, folderDb): + self.folderDb = folderDb + + def getDbInstance(self): + return self.dbInstance + + def setDbInstance(self, dbInstance): + self.dbInstance = dbInstance + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.folder): + if self.folderDb is None: + self.folderDb = self.folder + if self.folderTag is None: + conddb.addFolder(self.dbInstance, self.folderDb, className="AthenaAttributeList") + else: + conddb.addFolderWithTag(self.dbInstance, self.folderDb, self.folderTag, className="AthenaAttributeList") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ModuleVetoCondAlg + condSeq += SCT_ModuleVetoCondAlg(name = self.algName, + ReadKey = self.folder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ModuleVetoSvc + ServiceMgr += SCT_ModuleVetoSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def getSvcName(self): + return self.svcName + + def getUseDB(self): + return self.useDB + + def setUseDB(self, useDB): + self.useDB = useDB + + def setup(self): + if self.useDB: + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_ModuleVetoSvcSetup = SCT_ModuleVetoSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_MonitorConditionsSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_MonitorConditionsSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..a0ab1d4d678125e0f4788a8eeddb842e1e430911 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_MonitorConditionsSvcSetup.py @@ -0,0 +1,67 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_MonitorConditionsSvcSetup: + "Class to simplify setup of SCT_MonitorConditionsSvc and required conditions algorithms" + + def __init__(self): + self.folder = "/SCT/Derived/Monitoring" + self.folderDb = None + self.dbInstance = "SCT_OFL" + self.algName = "SCT_MonitorConditionsCondAlg" + self.alg = None + self.svcName = "SCT_MonitorConditionsSvc" + self.svc = None + + def getFolder(self): + return self.folder + + def getFolderDb(self): + return self.folderDb + + def setFolderDb(self, folderDb): + self.folderDb = folderDb + + def getDbInstance(self): + return self.dbInstance + + def setDbInstance(self, dbInstance): + self.dbInstance = dbInstance + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.folder): + if self.folderDb is None: + self.folderDb = self.folder + conddb.addFolder(self.dbInstance, self.folderDb, className="CondAttrListCollection") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MonitorConditionsCondAlg + condSeq += SCT_MonitorConditionsCondAlg(name = self.algName, + ReadKey = self.folder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MonitorConditionsSvc + ServiceMgr += SCT_MonitorConditionsSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_MonitorConditionsSvcSetup = SCT_MonitorConditionsSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_RODVetoSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_RODVetoSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..3b97b80e977e3e6fc73cfb26a8a2d089bb60322a --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_RODVetoSvcSetup.py @@ -0,0 +1,23 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_RODVetoSvcSetup: + "Class to simplify setup of SCT_RODVetoSvc and required conditions algorithms" + + def __init__(self): + self.svcName = "SCT_RODVetoSvc" + self.svc = None + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_RODVetoSvc + ServiceMgr += SCT_RODVetoSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setSvc() + +sct_RODVetoSvcSetup = SCT_RODVetoSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ReadCalibChipDataSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ReadCalibChipDataSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..151deb553a2e52b6c4e9cb20eb9a1290c1144955 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ReadCalibChipDataSvcSetup.py @@ -0,0 +1,90 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_ReadCalibChipDataSvcSetup: + "Class to simplify setup of SCT_ReadCalibChipDataSvc and required conditions algorithms" + + def __init__(self): + self.noiseFolder = "/SCT/DAQ/Calibration/ChipNoise" + self.gainFolder = "/SCT/DAQ/Calibration/ChipGain" + self.noiseFolderTag = None + self.gainFolderTag = None + self.noiseAlgName = "SCT_ReadCalibChipNoiseCondAlg" + self.gainAlgName = "SCT_ReadCalibChipGainCondAlg" + self.noiseAlg = None + self.gainAlg = None + self.svcName = "SCT_ReadCalibChipDataSvc" + self.svc = None + + def getNoiseFolder(self): + return self.noiseFolder + + def getGainFolder(self): + return self.gainFolder + + def getNoiseFolderTag(self): + return self.noiseFolderTag + + def getGainFolderTag(self): + return self.gainFolderTag + + def setNoiseFolderTag(self, noiseFolderTag): + self.noiseFolderTag = noiseFolderTag + + def setGainFolderTag(self, gainFolderTag): + self.gainFolderTag = gainFolderTag + + def getNoiseAlgName(self): + return self.noiseAlgName + + def getGainAlgName(self): + return self.gainAlgName + + def getNoiseAlg(self): + return self.noiseAlg + + def getGainAlg(self): + return self.gainAlg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.noiseFolder): + if self.noiseFolderTag is None: + conddb.addFolder("SCT", self.noiseFolder, className="CondAttrListCollection") + else: + conddb.addFolderWithTag("SCT", self.noiseFolder, self.noiseFolderTag, className="CondAttrListCollection") + if not conddb.folderRequested(self.gainFolder): + if self.gainFolderTag is None: + conddb.addFolder("SCT", self.gainFolder, className="CondAttrListCollection") + else: + conddb.addFolderWithTag("SCT", self.gainFolder, self.gainFolderTag, className="CondAttrListCollection") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.noiseAlgName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibChipNoiseCondAlg + condSeq += SCT_ReadCalibChipNoiseCondAlg(name = self.noiseAlgName, + ReadKey=self.noiseFolder) + self.noiseAlg = getattr(condSeq, self.noiseAlgName) + if not hasattr(condSeq, self.gainAlgName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibChipGainCondAlg + condSeq += SCT_ReadCalibChipGainCondAlg(name = self.gainAlgName, + ReadKey=self.gainFolder) + self.alg = getattr(condSeq, self.gainAlgName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibChipDataSvc + ServiceMgr += SCT_ReadCalibChipDataSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_ReadCalibChipDataSvcSetup = SCT_ReadCalibChipDataSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ReadCalibDataSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ReadCalibDataSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..f68917370a7247b7b09ca3a4e665bd1e0de38726 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_ReadCalibDataSvcSetup.py @@ -0,0 +1,58 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_ReadCalibDataSvcSetup: + "Class to simplify setup of SCT_ReadCalibDataSvc and required conditions algorithms" + + def __init__(self): + self.noiseFolder = "/SCT/DAQ/Calibration/NoiseOccupancyDefects" + self.gainFolder = "/SCT/DAQ/Calibration/NPtGainDefects" + self.algName = "SCT_ReadCalibDataCondAlg" + self.alg = None + self.svcName = "SCT_ReadCalibDataSvc" + self.svc = None + + def getNoiseFolder(self): + return self.noiseFolder + + def getGainFolder(self): + return self.gainFolder + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.noiseFolder): + conddb.addFolder("SCT", self.noiseFolder, className="CondAttrListCollection") + if not conddb.folderRequested(self.gainFolder): + conddb.addFolder("SCT", self.gainFolder, className="CondAttrListCollection") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibDataCondAlg + condSeq += SCT_ReadCalibDataCondAlg(name = self.algName, + ReadKeyGain = self.gainFolder, + ReadKeyNoise = self.noiseFolder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibDataSvc + ServiceMgr += SCT_ReadCalibDataSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_ReadCalibDataSvcSetup = SCT_ReadCalibDataSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_SensorsSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_SensorsSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..9cada1e449b99eacddfd576505a0ea316de25fb2 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_SensorsSvcSetup.py @@ -0,0 +1,77 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_SensorsSvcSetup: + "Class to simplify setup of SCT_SensorsSvc and required conditions algorithms" + + def __init__(self): + self.folder = "/SCT/Sensors" + self.folderDb = None + self.folderTag = None + self.dbInstance = "SCT_OFL" + self.algName = "SCT_SensorsCondAlg" + self.alg = None + self.svcName = "SCT_SensorsSvc" + self.svc = None + + def getFolder(self): + return self.folder + + def getFolderDb(self): + return self.folderDb + + def setFolderTag(self, folderTag): + self.folderTag = folderTag + + def getFolderTag(self): + return self.folderTag + + def setFolderDb(self, folderDb): + self.folderDb = folderDb + + def getDbInstance(self): + return self.dbInstance + + def setDbInstance(self, dbInstance): + self.dbInstance = dbInstance + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.folder): + if self.folderDb is None: + self.folderDb = self.folder + if self.folderTag is None: + conddb.addFolder(self.dbInstance, self.folderDb, className="CondAttrListCollection") + else: + conddb.addFolderWithTag(self.dbInstance, self.folderDb, self.folderTag, className="CondAttrListCollection") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SensorsCondAlg + condSeq += SCT_SensorsCondAlg(name = self.algName, + ReadKey = self.folder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SensorsSvc + ServiceMgr += SCT_SensorsSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_SensorsSvcSetup = SCT_SensorsSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_SiliconConditionsSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_SiliconConditionsSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..c1d697aecccea061ed1d4743b968b60fc73b5e64 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_SiliconConditionsSvcSetup.py @@ -0,0 +1,72 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_SiliconConditionsSvcSetup: + "Class to simplify setup of SCT_SiliconConditionsSvc and required conditions algorithms" + + def __init__(self): + self.hvAlgName = "SCT_SiliconHVCondAlg" + self.tempAlgName = "SCT_SiliconTempCondAlg" + + self.hvAlg = None + self.tempAlg = None + + self.svcName = "SCT_SiliconConditionsSvc" + self.svc = None + + self.useDB = True + + def getHVAlgName(self): + return self.hvAlgName + + def getTempAlgName(self): + return self.tempAlgName + + def getHVAlg(self): + return self.hvAlg + + def getTempAlg(self): + return self.tempAlg + + def getSvcName(self): + return self.svcName + + def getSvc(self): + return self.svc + + def getUseDB(self): + return self.useDB + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + + if not hasattr(condSeq, self.hvAlgName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SiliconHVCondAlg + condSeq += SCT_SiliconHVCondAlg(name = self.hvAlgName) + self.hvAlg = getattr(condSeq, self.hvAlgName) + + if not hasattr(condSeq, self.tempAlgName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SiliconTempCondAlg + condSeq += SCT_SiliconTempCondAlg(name = self.tempAlgName) + self.tempAlg = getattr(condSeq, self.tempAlgName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SiliconConditionsSvc + ServiceMgr += SCT_SiliconConditionsSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def setUseDB(self, useDB): + self.useDB = useDB + + def setup(self): + if self.useDB: + from SCT_ConditionsServices.SCT_DCSConditionsSvcSetup import SCT_DCSConditionsSvcSetup + SCT_DCSConditionsSvcSetup = SCT_DCSConditionsSvcSetup() + SCT_DCSConditionsSvcSetup.setup() + self.setAlgs() + self.setSvc() + self.svc.UseDB = self.useDB + +sct_SiliconConditionsSvcSetup = SCT_SiliconConditionsSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_StripVetoSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_StripVetoSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..91b5e923b3f607915c5c452b905586c8e50afdad --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_StripVetoSvcSetup.py @@ -0,0 +1,23 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_StripVetoSvcSetup: + "Class to simplify setup of SCT_StripVetoSvc and required conditions algorithms" + + def __init__(self): + self.svcName = "SCT_StripVetoSvc" + self.svc = None + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_StripVetoSvc + ServiceMgr += SCT_StripVetoSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def setup(self): + self.setSvc() + +sct_StripVetoSvcSetup = SCT_StripVetoSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_TdaqEnabledSvcSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_TdaqEnabledSvcSetup.py new file mode 100644 index 0000000000000000000000000000000000000000..916dab3cc346e71f3e9d8ec976e7915f7f1640cd --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/python/SCT_TdaqEnabledSvcSetup.py @@ -0,0 +1,80 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +class SCT_TdaqEnabledSvcSetup: + "Class to simplify setup of SCT_TdaqEnabledSvc and required conditions algorithms" + + def __init__(self): + self.folder = "/TDAQ/Resources/ATLAS/SCT/Robins" + self.folderDb = None + self.folderTag = None + self.dbInstance = "TDAQ" + self.algName = "SCT_TdaqEnabledCondAlg" + self.alg = None + self.svcName = "SCT_TdaqEnabledSvc" + self.svc = None + + def getFolder(self): + return self.folder + + def getFolderDb(self): + return self.folderDb + + def setFolderTag(self, folderTag): + self.folderTag = folderTag + + def getFolderTag(self): + return self.folderTag + + def setFolderDb(self, folderDb): + self.folderDb = folderDb + + def getDbInstance(self): + return self.dbInstance + + def setDbInstance(self, dbInstance): + self.dbInstance = dbInstance + + def getAlgName(self): + return self.algName + + def getAlg(self): + return self.alg + + def setFolders(self): + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested(self.folder): + if self.folderDb is None: + self.folderDb = self.folder + if self.folderTag is None: + conddb.addFolder(self.dbInstance, self.folderDb, className="CondAttrListCollection") + else: + conddb.addFolderWithTag(self.dbInstance, self.folderDb, self.folderTag, className="CondAttrListCollection") + + def setAlgs(self): + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, self.algName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_TdaqEnabledCondAlg + condSeq += SCT_TdaqEnabledCondAlg(name = self.algName, + ReadKey = self.folder) + self.alg = getattr(condSeq, self.algName) + + def setSvc(self): + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr, self.svcName): + from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_TdaqEnabledSvc + ServiceMgr += SCT_TdaqEnabledSvc(name = self.svcName) + self.svc = getattr(ServiceMgr, self.svcName) + + def getSvc(self): + return self.svc + + def getSvcName(self): + return self.svcName + + def setup(self): + self.setFolders() + self.setAlgs() + self.setSvc() + +sct_TdaqEnabledSvcSetup = SCT_TdaqEnabledSvcSetup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCachedSummary.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCachedSummary.py index 2c3b071a5539df5b38c74dc062d88f55d3fd1826..d051d6fa5b073c891f03441529092b8078029bc4 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCachedSummary.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCachedSummary.py @@ -2,15 +2,11 @@ import AthenaCommon.AtlasUnixStandardJob # use auditors from AthenaCommon.AppMgr import ServiceMgr - from GaudiSvc.GaudiSvcConf import AuditorSvc - ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True @@ -69,42 +65,28 @@ from IOVDbSvc.CondDB import conddb IOVDbSvc.GlobalTag="CONDBR2-BLKPA-2017-06" IOVDbSvc.OutputLevel = 3 -#ToolSvc = ServiceMgr.ToolSvc - -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -conddb.addFolder("TDAQ", "/TDAQ/Resources/ATLAS/SCT/Robins", className="CondAttrListCollection") -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_TdaqEnabledCondAlg -condSeq += SCT_TdaqEnabledCondAlg(name="SCT_TdaqEnabledCondAlg") - -conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Chip", "/SCT/DAQ/Config/Chip", className="CondAttrListVec") -conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Module", "/SCT/DAQ/Config/Module", className="CondAttrListVec") -conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/MUR", "/SCT/DAQ/Config/MUR", className="CondAttrListVec") # Also for cabling -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationCondAlg -condSeq += SCT_ConfigurationCondAlg(name = "SCT_ConfigurationCondAlg", - ReadKeyChannel = "/SCT/DAQ/Config/Chip", - ReadKeyModule = "/SCT/DAQ/Config/Module", - ReadKeyMur = "/SCT/DAQ/Config/MUR") - conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Geog", "/SCT/DAQ/Config/Geog") # Needed for cabling conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/RODMUR", "/SCT/DAQ/Config/RODMUR") # Needed for cabling conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/ROD", "/SCT/DAQ/Config/ROD") # Needed for cabling -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ModuleVetoSvc -ServiceMgr +=SCT_ModuleVetoSvc() -SCT_ModuleVeto=ServiceMgr.SCT_ModuleVetoSvc -SCT_ModuleVeto.BadModuleIdentifiers=["1","2"] +from SCT_ConditionsServices.SCT_TdaqEnabledSvcSetup import sct_TdaqEnabledSvcSetup +sct_TdaqEnabledSvcSetup.setup() -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationConditionsSvc -ServiceMgr +=SCT_ConfigurationConditionsSvc() +from SCT_ConditionsServices.SCT_ConfigurationConditionsSvcSetup import sct_ConfigurationConditionsSvcSetup +sct_ConfigurationConditionsSvcSetup.setup() +from SCT_ConditionsServices.SCT_ModuleVetoSvcSetup import sct_ModuleVetoSvcSetup +sct_ModuleVetoSvcSetup.setUseDB(False) +sct_ModuleVetoSvcSetup.setup() +SCT_ModuleVetoSvc=sct_ModuleVetoSvcSetup.getSvc() +SCT_ModuleVetoSvc.BadModuleIdentifiers=["1", "2"] -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_CachedSummarySvc -ServiceMgr +=SCT_CachedSummarySvc() - -SCT_CachedSummary=ServiceMgr.SCT_CachedSummarySvc -SCT_CachedSummary.ConditionsServices=["SCT_ModuleVetoSvc", "SCT_ConfigurationConditionsSvc","SCT_TdaqEnabledSvc"] +from SCT_ConditionsServices.SCT_CachedSummarySvcSetup import sct_CachedSummarySvcSetup +sct_CachedSummarySvcSetup.setup() +SCT_CachedSummarySvc = sct_CachedSummarySvcSetup.getSvc() +SCT_CachedSummarySvc.ConditionsServices=[sct_ModuleVetoSvcSetup.getSvcName(), + sct_ConfigurationConditionsSvcSetup.getSvcName(), + sct_TdaqEnabledSvcSetup.getSvcName()] from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_CachedSummaryTestAlg job+= SCT_CachedSummaryTestAlg() @@ -112,14 +94,12 @@ job+= SCT_CachedSummaryTestAlg() import AthenaCommon.AtlasUnixGeneratorJob ServiceMgr.EventSelector.RunNumber = 310809 - # initial time stamp - this is number of seconds since 1st Jan 1970 GMT # run 310809 Recording start/end 2016-Oct-17 21:39:18 / 2016-Oct-18 16:45:23 UTC ServiceMgr.EventSelector.InitialTimeStamp = 1476741326 # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC) -# increment of 3 minutes -ServiceMgr.EventSelector.TimeStampInterval = 180 +ServiceMgr.EventSelector.TimeStampInterval = 180 # increment of 3 minutes -theApp.EvtMax = 5 +theApp.EvtMax = 5 ServiceMgr.MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M" ServiceMgr.MessageSvc.OutputLevel = 3 diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCalibChipRead.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCalibChipRead.py index 2f8827502993fb89fef370dddfd7900339df1b57..10d64396caf2f18f05f7cc643fe505e8b43b70c2 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCalibChipRead.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCalibChipRead.py @@ -20,9 +20,7 @@ from AthenaCommon.AppMgr import theApp ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True @@ -95,36 +93,16 @@ topSequence = AlgSequence() from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg topSequence +=xAODMaker__EventInfoCnvAlg(OutputLevel=2) -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -sctGainFolder = "/SCT/DAQ/Calibration/ChipGain" -sctGainCondAlg = "SCT_ReadCalibChipGainCondAlg" -if not conddb.folderRequested(sctGainFolder): - conddb.addFolderWithTag("SCT","/SCT/DAQ/Calibration/ChipGain","SctDaqCalibrationChipGain-UPD1-002-00", className="CondAttrListCollection") -if not hasattr(condSeq, sctGainCondAlg): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibChipGainCondAlg - condSeq += SCT_ReadCalibChipGainCondAlg(name=sctGainCondAlg, ReadKey=sctGainFolder) - -sctNoiseFolder = "/SCT/DAQ/Calibration/ChipNoise" -sctNoiseCondAlg = "SCT_ReadCalibChipNoiseCondAlg" -if not conddb.folderRequested(sctNoiseFolder): - conddb.addFolderWithTag("SCT","/SCT/DAQ/Calibration/ChipNoise","SctDaqCalibrationChipNoise-UPD1-002-00", className="CondAttrListCollection") -if not hasattr(condSeq, sctNoiseCondAlg): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibChipNoiseCondAlg - condSeq += SCT_ReadCalibChipNoiseCondAlg(name=sctNoiseCondAlg, ReadKey=sctNoiseFolder) +from SCT_ConditionsServices.SCT_ReadCalibChipDataSvcSetup import sct_ReadCalibChipDataSvcSetup +sct_ReadCalibChipDataSvcSetup.setNoiseFolderTag("SctDaqCalibrationChipNoise-UPD1-002-00") +sct_ReadCalibChipDataSvcSetup.setGainFolderTag("SctDaqCalibrationChipGain-UPD1-002-00") +sct_ReadCalibChipDataSvcSetup.setup() -from AthenaCommon.AppMgr import ServiceMgr +SCT_ReadCalibChipDataSvc=sct_ReadCalibChipDataSvcSetup.getSvc() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibChipDataTestAlg topSequence+= SCT_ReadCalibChipDataTestAlg() -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibChipDataSvc -ServiceMgr += SCT_ReadCalibChipDataSvc() - -SCT_ReadCalibChipDataSvc=ServiceMgr.SCT_ReadCalibChipDataSvc - - ##Modules to test: ##136523776, strips 0-255 BAD_OPE=good #SCT_ReadCalibDataTestAlg.ModuleOfflinePosition = [-2, 1, 0, 6, 0, 111] #(EC/B, Disk/Layer, eta, phi, side, strip) @@ -141,6 +119,7 @@ import AthenaCommon.AtlasUnixGeneratorJob #ServiceMgr+= EventSelector() #ServiceMgr.EventSelector.FirstEvent = 1 #ServiceMgr.EventSelector.EventsPerRun = 5 +from AthenaCommon.AppMgr import ServiceMgr ServiceMgr.EventSelector.RunNumber = 215643 theApp.EvtMax = 1 @@ -148,25 +127,25 @@ theApp.EvtMax = 1 # Set output lvl (VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL) #-------------------------------------------------------------- ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.SCT_ReadCalibChipDataSvc.OutputLevel = INFO -topSequence.SCT_ReadCalibChipDataTestAlg.OutputLevel = INFO +SCT_ReadCalibChipDataSvc.OutputLevel = INFO +SCT_ReadCalibChipDataTestAlg.OutputLevel = INFO #-------------------------------------------------------------- # Set the correct flags #-------------------------------------------------------------- # Test return ConditionsSummary? if DoTestmyConditionsSummary: - SCT_ReadCalibChipDataTestAlg.DoTestmyConditionsSummary = True + SCT_ReadCalibChipDataTestAlg.DoTestmyConditionsSummary = True else: - SCT_ReadCalibChipDataTestAlg.DoTestmyConditionsSummary = False + SCT_ReadCalibChipDataTestAlg.DoTestmyConditionsSummary = False # Test return DataSummary? if DoTestmyDataSummary: - SCT_ReadCalibChipDataTestAlg.DoTestmyDataSummary = True + SCT_ReadCalibChipDataTestAlg.DoTestmyDataSummary = True else: - SCT_ReadCalibChipDataTestAlg.DoTestmyDataSummary = False + SCT_ReadCalibChipDataTestAlg.DoTestmyDataSummary = False #Print out defects maps if PrintOutCalibDataMaps: - ServiceMgr.SCT_ReadCalibChipDataSvc.PrintCalibDataMaps = True + SCT_ReadCalibChipDataSvc.PrintCalibDataMaps = True diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCalibRead.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCalibRead.py index ac22a56b91934178d4ee24329d14bf049fe0c7b5..54c32698872e45c5ba6a10152530531b5edc9a74 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCalibRead.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testCalibRead.py @@ -92,33 +92,15 @@ from IOVDbSvc.CondDB import conddb IOVDbSvc.GlobalTag='CONDBR2-BLKPA-2017-06' IOVDbSvc.OutputLevel = DEBUG -# Load AthCondSeq -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") +from SCT_ConditionsServices.SCT_ReadCalibDataSvcSetup import sct_ReadCalibDataSvcSetup +sct_ReadCalibDataSvcSetup.setup() -# Load conditions folders -sctGainDefectFolder="/SCT/DAQ/Calibration/NPtGainDefects" -if not conddb.folderRequested(sctGainDefectFolder): - conddb.addFolderSplitMC("SCT", sctGainDefectFolder, sctGainDefectFolder, className="CondAttrListCollection") -sctNoiseDefectFolder="/SCT/DAQ/Calibration/NoiseOccupancyDefects" -if not conddb.folderRequested(sctNoiseDefectFolder): - conddb.addFolderSplitMC("SCT", sctNoiseDefectFolder, sctNoiseDefectFolder, className="CondAttrListCollection") - - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibDataCondAlg -condSeq += SCT_ReadCalibDataCondAlg(name = "SCT_ReadCalibDataCondAlg", - ReadKeyGain = sctGainDefectFolder, - ReadKeyNoise = sctNoiseDefectFolder) -SCT_ReadCalibDataCondAlg = condSeq.SCT_ReadCalibDataCondAlg +SCT_ReadCalibDataCondAlg = sct_ReadCalibDataSvcSetup.getAlg() +SCT_ReadCalibDataSvc = sct_ReadCalibDataSvcSetup.getSvc() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibDataTestAlg topSequence+= SCT_ReadCalibDataTestAlg() -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ReadCalibDataSvc -ServiceMgr += SCT_ReadCalibDataSvc() - -SCT_ReadCalibDataSvc=ServiceMgr.SCT_ReadCalibDataSvc - #SCT_ReadCalibDataSvc.RecoOnly = False # <-999 setting ignores the defect, otherwise it will be checked against the set value SCT_ReadCalibDataCondAlg.IgnoreDefects = ["NOISE_SLOPE","OFFSET_SLOPE","GAIN_SLOPE","BAD_OPE"] @@ -175,35 +157,35 @@ conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/ROD", "/SCT/DAQ/Config/ROD") #-------------------------------------------------------------- # Test return ConditionsSummary? if DoTestmyConditionsSummary: - SCT_ReadCalibDataTestAlg.DoTestmyConditionsSummary = True + SCT_ReadCalibDataTestAlg.DoTestmyConditionsSummary = True else: - SCT_ReadCalibDataTestAlg.DoTestmyConditionsSummary = False + SCT_ReadCalibDataTestAlg.DoTestmyConditionsSummary = False # Test my isGood method if DoTestmyDefectIsGood: - SCT_ReadCalibDataTestAlg.DoTestmyDefectIsGood = True + SCT_ReadCalibDataTestAlg.DoTestmyDefectIsGood = True else: - SCT_ReadCalibDataTestAlg.DoTestmyDefectIsGood = False + SCT_ReadCalibDataTestAlg.DoTestmyDefectIsGood = False # Test return DefectType? if DoTestmyDefectType: - SCT_ReadCalibDataTestAlg.DoTestmyDefectType = True + SCT_ReadCalibDataTestAlg.DoTestmyDefectType = True else: - SCT_ReadCalibDataTestAlg.DoTestmyDefectType = False + SCT_ReadCalibDataTestAlg.DoTestmyDefectType = False # Test return DefectsSummary? if DoTestmyDefectsSummary: - SCT_ReadCalibDataTestAlg.DoTestmyDefectsSummary = True + SCT_ReadCalibDataTestAlg.DoTestmyDefectsSummary = True else: - SCT_ReadCalibDataTestAlg.DoTestmyDefectsSummary = False + SCT_ReadCalibDataTestAlg.DoTestmyDefectsSummary = False # Test return DefectsList? if DoTestmyDefectList: - SCT_ReadCalibDataTestAlg.DoTestmyDefectList = True + SCT_ReadCalibDataTestAlg.DoTestmyDefectList = True else: - SCT_ReadCalibDataTestAlg.DoTestmyDefectList = False + SCT_ReadCalibDataTestAlg.DoTestmyDefectList = False #Print out defects maps if PrintOutCalibDefectMaps: - ServiceMgr.SCT_ReadCalibDataSvc.PrintCalibDefectMaps = True + ServiceMgr.SCT_ReadCalibDataSvc.PrintCalibDefectMaps = True diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testConfig.py index f949a07d0a08103c9795f5787124a44d26313f6f..89ef45666721680bb98df715b4a5f49061f5efea 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testConfig.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testConfig.py @@ -65,12 +65,6 @@ from IOVDbSvc.CondDB import conddb IOVDbSvc.GlobalTag='OFLCOND-RUN12-SDR-25' IOVDbSvc.OutputLevel = DEBUG -#-------------------------------------------------------------- -# Load AthCondSeq -#-------------------------------------------------------------- -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - test='MC' # #NOTE: Testing with run2 requires presence of local sqlite file 'configTest.db' @@ -125,47 +119,34 @@ else: ''' #test perfect DB on server - conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec") - conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec") - conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec") + # conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec") + # conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec") + # conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec") conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/ROD <tag>SctDaqConfigRod-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>") conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Geog <tag>SctDaqConfigGeog-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>") conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/RODMUR <tag>SctDaqConfigRodmur-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>") - if not hasattr(condSeq, "SCT_ConfigurationCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationCondAlg - condSeq += SCT_ConfigurationCondAlg(name = "SCT_ConfigurationCondAlg", - ReadKeyChannel = "/SCT/DAQ/Config/Chip", - ReadKeyModule = "/SCT/DAQ/Config/Module", - ReadKeyMur = "/SCT/DAQ/Config/MUR") from SCT_Cabling.SCT_CablingConf import SCT_CablingSvc ToolSvc = ServiceMgr.ToolSvc ServiceMgr+=SCT_CablingSvc() ServiceMgr.SCT_CablingSvc.DataSource='COOLVECTOR' -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationConditionsSvc -MyConfigConditions = SCT_ConfigurationConditionsSvc("MyConfigConditions") -ServiceMgr += MyConfigConditions +from SCT_ConditionsServices.SCT_ConfigurationConditionsSvcSetup import sct_ConfigurationConditionsSvcSetup +sct_ConfigurationConditionsSvcSetup.setChannelFolderDb("<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>") +sct_ConfigurationConditionsSvcSetup.setModuleFolderDb("<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>") +sct_ConfigurationConditionsSvcSetup.setMurFolderDb("<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>") +sct_ConfigurationConditionsSvcSetup.setDbInstance("") +sct_ConfigurationConditionsSvcSetup.setup() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationConditionsTestAlg MyConfigTestAlg = SCT_ConfigurationConditionsTestAlg("MyConfigTestAlg") -MyConfigTestAlg.ConfigConditions = MyConfigConditions +MyConfigTestAlg.ConfigConditions = sct_ConfigurationConditionsSvcSetup.getSvc() job += MyConfigTestAlg import AthenaCommon.AtlasUnixGeneratorJob ServiceMgr.EventSelector.RunNumber =200805 ServiceMgr.EventSelector.InitialTimeStamp=1333597198 -#runNumber=2000805 -#timeStamp=1228142560 -#if (test!='run1'): -# timeStamp=1333597198 - -#ServiceMgr.EventSelector.RunNumber = runNumber -#import time, calendar -#time in seconds , now -#ServiceMgr.EventSelector.InitialTimeStamp = calendar.timegm(time.gmtime()) -#ServiceMgr.EventSelector.InitialTimeStamp = timeStamp -theApp.EvtMax = 1 - -ServiceMgr.MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M" +theApp.EvtMax = 1 + +ServiceMgr.MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M" ServiceMgr.MessageSvc.OutputLevel = DEBUG diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testDCSConditions.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testDCSConditions.py index 947ce74a4bef4f56116803a0ad13e6fd7f951e18..56c16a4350f6b189fde8bba7b3100525e273ad7c 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testDCSConditions.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testDCSConditions.py @@ -13,16 +13,11 @@ import AthenaCommon.AtlasUnixStandardJob # use auditors #-------------------------------------------------------------- from AthenaCommon.AppMgr import ServiceMgr - from GaudiSvc.GaudiSvcConf import AuditorSvc -#from AthenaCommon.AppMgr import theApp - ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True #-------------------------------------------------------------- @@ -79,26 +74,20 @@ topSequence = AlgSequence() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsTestAlg topSequence+= SCT_DCSConditionsTestAlg() -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc -ServiceMgr += SCT_DCSConditionsSvc() - -#SCT_DCSConditionsSvc=ServiceMgr.SCT_DCSConditionsSvc -SCT_DCSConditionsSvc.AttrListCollFolders=["/SCT/DCS/HV","/SCT/DCS/MODTEMP","/SCT/DCS/CHANSTAT","/SCT/DCS/MPS/LV"] +# Set up SCT_DCSConditionsSvc and required conditions folders and conditions algorithms +from SCT_ConditionsServices.SCT_DCSConditionsSvcSetup import sct_DCSConditionsSvcSetup +sct_DCSConditionsSvcSetup.setup() #-------------------------------------------------------------- # Event selector settings. Use McEventSelector #-------------------------------------------------------------- import AthenaCommon.AtlasUnixGeneratorJob -#ServiceMgr+= EventSelector() -#ServiceMgr.EventSelector.FirstEvent = 1 -#ServiceMgr.EventSelector.EventsPerRun = 5 ServiceMgr.EventSelector.RunNumber = 310809 # initial time stamp - this is number of seconds since 1st Jan 1970 GMT ServiceMgr.EventSelector.InitialTimeStamp = 1476741326 # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC) -# increment of 3 minutes -ServiceMgr.EventSelector.TimeStampInterval = 180 +ServiceMgr.EventSelector.TimeStampInterval = 180 # increment of 3 minutes -theApp.EvtMax = 10 +theApp.EvtMax = 10 #-------------------------------------------------------------- # Set output lvl (VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL) @@ -112,41 +101,5 @@ ServiceMgr.MessageSvc.OutputLevel = 3 #-------------------------------------------------------------- IOVDbSvc = Service("IOVDbSvc") from IOVDbSvc.CondDB import conddb -#IOVDbSvc.GlobalTag="HEAD" IOVDbSvc.GlobalTag="CONDBR2-BLKPA-2017-06" IOVDbSvc.OutputLevel = 3 - -# Conditions sequence for Athena MT -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -sctDCSStateFolder = '/SCT/DCS/CHANSTAT' -sctDCSTempFolder = '/SCT/DCS/MODTEMP' -sctDCSHVFolder = '/SCT/DCS/HV' -if not conddb.folderRequested(sctDCSStateFolder): - conddb.addFolder("DCS_OFL", sctDCSStateFolder, className="CondAttrListCollection") -if not conddb.folderRequested(sctDCSTempFolder): - conddb.addFolder("DCS_OFL", sctDCSTempFolder, className="CondAttrListCollection") -if not conddb.folderRequested(sctDCSHVFolder): - conddb.addFolder("DCS_OFL", sctDCSHVFolder, className="CondAttrListCollection") -if not hasattr(condSeq, "SCT_DCSConditionsHVCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsHVCondAlg - condSeq += SCT_DCSConditionsHVCondAlg(name = "SCT_DCSConditionsHVCondAlg", - ReadKey = sctDCSHVFolder) -if not hasattr(condSeq, "SCT_DCSConditionsStatCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsStatCondAlg - condSeq += SCT_DCSConditionsStatCondAlg(name = "SCT_DCSConditionsStatCondAlg", - ReadKeyHV = sctDCSHVFolder, - ReadKeyState = sctDCSStateFolder) -if not hasattr(condSeq, "SCT_DCSConditionsTempCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsTempCondAlg - condSeq += SCT_DCSConditionsTempCondAlg(name = "SCT_DCSConditionsTempCondAlg", - ReadKey = sctDCSTempFolder) - -#InDetSCT_ConditionsSummarySvc.ConditionsServices+=["InDetSCT_DCSConditionsSvc"] -#Temporary access to May Barrel COOL 2.0 data -#CoolSCTDCS='<dbConnection>impl=cool;techno=oracle;schema=ATLAS_COOL_SCT;ATLAS_COOLPROD:DCSP200:ATLAS_COOL_READER</dbConnection>' -#CoolSCTDCS='<dbConnection>impl=cool;techno=sqlite;schema=ATLAS_COOL_SCT;ATLAS_COOLPROD:DCSP200:ATLAS_COOL_READER</dbConnection>' -#IOVDbSvc.Folders+= [ CoolSCTDCS + ' /SCT/DCS/HV' ] -#IOVDbSvc.Folders+= [ CoolSCTDCS + ' /SCT/DCS/MODTEMP' ] -#IOVDbSvc.OutputLevel =INFO diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testLinkMasking.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testLinkMasking.py index 858c712d9b257e921a1dc26066a9db151e1323a0..0006d196241703bef664efc9db5ae119d973d71d 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testLinkMasking.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testLinkMasking.py @@ -67,23 +67,15 @@ conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/ROD", "/SCT/DAQ/Config/ROD") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Geog", "/SCT/DAQ/Config/Geog") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/RODMUR", "/SCT/DAQ/Config/RODMUR") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/MUR", "/SCT/DAQ/Config/MUR") -conddb.addFolder("", "<dbConnection>sqlite://;schema=LinkMasking.db;dbname=CONDBR2</dbConnection>/purple/pants", className="CondAttrListCollection") -# This folder can be created by SCT_ConditionsServices/python/createLinkMaskingSQLiteFile.py - -from IOVSvc.IOVSvcConf import CondSvc -ServiceMgr += CondSvc() -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_LinkMaskingCondAlg -condSeq += SCT_LinkMaskingCondAlg("SCT_LinkMaskingCondAlg") -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_LinkMaskingSvc -LinkMaskingSvc = SCT_LinkMaskingSvc(name = "SCT_LinkMaskingSvc") -ServiceMgr += LinkMaskingSvc +from SCT_ConditionsServices.SCT_LinkMaskingSvcSetup import sct_LinkMaskingSvcSetup +sct_LinkMaskingSvcSetup.setFolderDb("<dbConnection>sqlite://;schema=LinkMasking.db;dbname=CONDBR2</dbConnection>/purple/pants") +# This folder can be created by SCT_ConditionsServices/python/createLinkMaskingSQLiteFile.py +sct_LinkMaskingSvcSetup.setup() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_LinkMaskingTestAlg LinkMaskingTestAlg = SCT_LinkMaskingTestAlg(name = "SCT_LinkMaskingTestAlg") -LinkMaskingTestAlg.LinkMaskingSvc = LinkMaskingSvc +LinkMaskingTestAlg.LinkMaskingSvc = sct_LinkMaskingSvcSetup.getSvc() job += LinkMaskingTestAlg import AthenaCommon.AtlasUnixGeneratorJob diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMajority.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMajority.py index 64cc34bc7e3ab7293d85cf53c3c2e66338914c4c..beeef4d2310e047d10c09d6f1b37a57e901e9de6 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMajority.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMajority.py @@ -2,15 +2,11 @@ import AthenaCommon.AtlasUnixStandardJob # use auditors from AthenaCommon.AppMgr import ServiceMgr - from GaudiSvc.GaudiSvcConf import AuditorSvc - ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True @@ -80,26 +76,17 @@ from IOVDbSvc.CondDB import conddb IOVDbSvc.GlobalTag="CONDBR2-BLKPA-2017-06" IOVDbSvc.OutputLevel = 3 -#--- For Conditions algorithm for Athena MT (start) -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MajorityCondAlg -condSeq += SCT_MajorityCondAlg("SCT_MajorityCondAlg", OutputLevel=2) -#--- For Conditions algorithm for Athena MT (end) - conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/ROD", "/SCT/DAQ/Config/ROD") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Geog", "/SCT/DAQ/Config/Geog") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/RODMUR", "/SCT/DAQ/Config/RODMUR") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/MUR", "/SCT/DAQ/Config/MUR") -conddb.addFolder('',"<db>COOLOFL_DCS/CONDBR2</db> /SCT/DCS/MAJ", className="CondAttrListCollection") -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MajorityConditionsSvc -MajorityConditionsSvc = SCT_MajorityConditionsSvc(name = "SCT_MajorityConditionsSvc") -#MajorityConditionsSvc.UseOverall = False -MajorityConditionsSvc.OutputLevel = DEBUG -ServiceMgr += MajorityConditionsSvc +from SCT_ConditionsServices.SCT_MajorityConditionsSvcSetup import sct_MajorityConditionsSvcSetup +sct_MajorityConditionsSvcSetup.setup() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MajorityConditionsTestAlg MajorityConditionsTestAlg = SCT_MajorityConditionsTestAlg(name = "SCT_MajorityConditionsTestAlg") -MajorityConditionsTestAlg.MajoritySvc = MajorityConditionsSvc +MajorityConditionsTestAlg.MajoritySvc = sct_MajorityConditionsSvcSetup.getSvc() job += MajorityConditionsTestAlg import AthenaCommon.AtlasUnixGeneratorJob @@ -109,7 +96,7 @@ ServiceMgr.EventSelector.RunNumber = 310809 # run 310809 Recording start/end 2016-Oct-17 21:39:18 / 2016-Oct-18 16:45:23 UTC ServiceMgr.EventSelector.InitialTimeStamp = 1476741326 # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC) -theApp.EvtMax = 1 +theApp.EvtMax = 1 -ServiceMgr.MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M" +ServiceMgr.MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M" ServiceMgr.MessageSvc.OutputLevel = 3 diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMonRead.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMonRead.py index 91bcf145df26c5967c6e703ce6fcfeea1a91a561..06f2b783533cc2ce88be79b1e109580aa83b9a84 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMonRead.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMonRead.py @@ -1,19 +1,4 @@ import AthenaCommon.AtlasUnixStandardJob -import os - -#get db password -authPath=os.environ["CORAL_AUTH_PATH"] +"/authentication.xml" -f=open(authPath) -signatureFound=False -pw="" -for line in f: - if "ATLAS_COOL_READER_U" in line: - signatureFound=True - if (signatureFound and "password" in line): - tokens=line.split('"') - pw=tokens[3] - break -#print pw # use auditors from AthenaCommon.AppMgr import ServiceMgr @@ -23,9 +8,7 @@ from GaudiSvc.GaudiSvcConf import AuditorSvc ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True from AthenaCommon.GlobalFlags import globalflags @@ -34,9 +17,14 @@ globalflags.DetGeo="atlas" globalflags.InputFormat="pool" globalflags.DataSource="data" -eventInfoKey = "ByteStreamEventInfo" -if globalflags.DataSource()=="geant4": - eventInfoKey = "McEventInfo" +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") + +from IOVSvc.IOVSvcConf import CondInputLoader +condSeq += CondInputLoader( "CondInputLoader",OutputLevel=2) + +from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg +condSeq+=xAODMaker__EventInfoCnvAlg(OutputLevel=2) #-------------------------------------------------------------- # Set Detector setup @@ -78,32 +66,18 @@ job = AlgSequence() #------------------------------------------------------------ # Local stuff #------------------------------------------------------------ -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MonitorConditionsSvc -ServiceMgr +=SCT_MonitorConditionsSvc(EventInfoKey=eventInfoKey) - -SCT_MonitorConditions=ServiceMgr.SCT_MonitorConditionsSvc -#SCT_MonitorConditions.BadModuleIdentifiers=["1","2"] -SCT_MonitorConditions.OutputLevel = DEBUG -SCT_MonitorConditions.WriteCondObjs = False -SCT_MonitorConditions.RegisterIOV = False -SCT_MonitorConditions.ReadWriteCool = True -#SCT_MonitorConditions.TagID4List = "list_v1" -#SCT_MonitorConditions.TagID4Eff = "eff_v1" -## -## if ManualIOV = false, then the IOV to store into DB is -## the one corresponding to the current run -## if ManualIOV = true, the user has to provide the -## run range for the proper IOV -SCT_MonitorConditions.ManualIOV = True -SCT_MonitorConditions.BeginRun = 310809 -SCT_MonitorConditions.EndRun = 310809 -SCT_MonitorConditions.VersionN = 0 + +from SCT_ConditionsServices.SCT_MonitorConditionsSvcSetup import sct_MonitorConditionsSvcSetup +sct_MonitorConditionsSvcSetup.setup() + +SCT_MonitorConditionsSvc=sct_MonitorConditionsSvcSetup.getSvc() +SCT_MonitorConditionsSvc.OutputLevel = DEBUG from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MonitorConditionsTestAlg job+= SCT_MonitorConditionsTestAlg() SCT_MonitorTest=job.SCT_MonitorConditionsTestAlg -SCT_MonitorTest.OutputLevel = 2 +SCT_MonitorTest.OutputLevel = 2 SCT_MonitorTest.RunNumber = 310809 SCT_MonitorTest.EventNumber = 5 @@ -114,12 +88,6 @@ SCT_MonitorTest.EventNumber = 5 #from IOVDbSvc.CondDB import conddb IOVDbSvc = Service("IOVDbSvc") IOVDbSvc.GlobalTag='CONDBR2-BLKPA-2017-10' -#IOVDbSvc.Folders+=["<dbConnection>oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_SCT;dbname=OFLP200;user=ATLAS_COOL_READER_U;password="+pw+"</dbConnection>/SCT/Derived/Monitoring <tag>SctDerivedMonitoring-NOMINAL</tag>" ] -#IOVDbSvc.Folders += ["<dbConnection>oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_SCT;dbname=OFLP200;user=ATLAS_COOL_READER_U</dbConnection>/SCT/Derived/NoiseOccupancy <tag>SctDerivedMonitoring-NOMINAL</tag>" ] -#IOVDbSvc.Folders += ["<dbConnection>oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_SCT;dbname=OFLP200;user=ATLAS_COOL_READER_</dbConnection>/SCT/Derived/Monitoring <tag>SctDerivedMonitoring-NOMINAL</tag>" ] - -from IOVDbSvc.CondDB import conddb -conddb.addFolderWithTag("SCT_OFL","/SCT/Derived/Monitoring","SctDerivedMonitoring-RUN2-UPD4-005") import RegistrationServices.IOVRegistrationSvc regSvc = ServiceMgr.IOVRegistrationSvc @@ -140,17 +108,9 @@ ServiceMgr.AthenaSealSvc.CheckDictionary = TRUE import AthenaCommon.AtlasUnixGeneratorJob ServiceMgr.EventSelector.RunNumber = 310809 +ServiceMgr.EventSelector.InitialTimeStamp = 1476741326 # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC) +ServiceMgr.EventSelector.TimeStampInterval = 180 # increment of 3 minutes theApp.EvtMax = 10 -#-------------------------------------------------------------- -# Use AthenaOutputStreamTool to write -# Must "turn off" standard AthenaOutputStream -#-------------------------------------------------------------- -#theApp.OutStream = [] - -from AthenaCommon.AppMgr import ToolSvc -SCT_MonitorConditions.StreamName = "CondStream2" -from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool -ToolSvc += AthenaPoolOutputStreamTool("CondStream2",OutputFile = "SimplePoolFile.root") MessageSvc.OutputLevel = INFO diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMonWrite.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMonWrite.py deleted file mode 100644 index 7080ad4241fbcebda700e3975e26326faa798344..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testMonWrite.py +++ /dev/null @@ -1,149 +0,0 @@ -import AthenaCommon.AtlasUnixStandardJob - -# use auditors -from AthenaCommon.AppMgr import ServiceMgr - -from GaudiSvc.GaudiSvcConf import AuditorSvc - -ServiceMgr += AuditorSvc() -theAuditorSvc = ServiceMgr.AuditorSvc -theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") -theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) -theApp.AuditAlgorithms=True - -from AthenaCommon.GlobalFlags import globalflags -# --- default is atlas geometry -globalflags.DetGeo="atlas" -# --- set defaults -globalflags.DataSource="geant4" -globalflags.InputFormat="pool" -# --- default is zero luminosity -globalflags.Luminosity="zero" -print globalflags - -#-------------------------------------------------------------- -# Set Detector setup -#-------------------------------------------------------------- -# --- switch on InnerDetector -from AthenaCommon.DetFlags import DetFlags -DetFlags.ID_setOn() -DetFlags.Calo_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.SCT_setOn() -DetFlags.TRT_setOff() - -# ---- switch parts of ID off/on as follows -#switch off tasks -DetFlags.pileup.all_setOff() -DetFlags.simulate.all_setOff() -DetFlags.makeRIO.all_setOff() -DetFlags.writeBS.all_setOff() -DetFlags.readRDOBS.all_setOff() -DetFlags.readRIOBS.all_setOff() -DetFlags.readRIOPool.all_setOff() -DetFlags.writeRIOPool.all_setOff() - -import AtlasGeoModel.SetGeometryVersion -import AtlasGeoModel.GeoModelInit - -# Disable SiLorentzAngleSvc to remove -# ERROR ServiceLocatorHelper::createService: wrong interface id IID_665279653 for service -ServiceMgr.GeoModelSvc.DetectorTools['PixelDetectorTool'].LorentzAngleSvc="" -ServiceMgr.GeoModelSvc.DetectorTools['SCT_DetectorTool'].LorentzAngleSvc="" - -#------------------------------------------------------------ - -from AthenaCommon.AlgSequence import AlgSequence -job = AlgSequence() - -#------------------------------------------------------------ -# Local stuff -#------------------------------------------------------------ - -eventInfoKey = "ByteStreamEventInfo" -if globalflags.DataSource()=="geant4": - eventInfoKey = "McEventInfo" - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MonitorConditionsSvc -ServiceMgr +=SCT_MonitorConditionsSvc(EventInfoKey=eventInfoKey) - -SCT_MonitorConditions=ServiceMgr.SCT_MonitorConditionsSvc -#SCT_MonitorConditions.BadModuleIdentifiers=["1","2"] -SCT_MonitorConditions.OutputLevel = DEBUG -SCT_MonitorConditions.WriteCondObjs = True -SCT_MonitorConditions.RegisterIOV = True -SCT_MonitorConditions.ReadWriteCool = True -#SCT_MonitorConditions.TagID4List = "list_v1" -#SCT_MonitorConditions.TagID4Eff = "eff_v1" -## -## if ManualIOV = false, then the IOV to store into DB is -## the one corresponding to the current run -## if ManualIOV = true, the user has to provide the -## run range for the proper IOV -SCT_MonitorConditions.ManualIOV = True -SCT_MonitorConditions.BeginRun = 3070 -SCT_MonitorConditions.EndRun = 3079 -SCT_MonitorConditions.VersionN = 0 - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_MonitorConditionsTestAlg -job+= SCT_MonitorConditionsTestAlg() - -SCT_MonitorTest=job.SCT_MonitorConditionsTestAlg -SCT_MonitorTest.OutputLevel = 2 -# SCT_MonitorTest.TestWrite = True -SCT_MonitorTest.RunNumber = 1 -SCT_MonitorTest.EventNumber = 5 - -#-------------------------------------------------------------- -# Load IOVDbSvc -# - access to COOL - -#-------------------------------------------------------------- -#from IOVDbSvc.CondDB import conddb -import IOVDbSvc.IOVDb - -ServiceMgr.IOVDbSvc.GlobalTag='OFLCOND-CSC-00-00-00' - -#try: -# ServiceMgr.IOVDbSvc.dbConnection = "impl=cool;techno=oracle;devdb10:" -# ServiceMgr.IOVDbSvc.dbConnection += "TESTCOOL" -# ServiceMgr.IOVDbSvc.dbConnection += ":ATLAS_COOL_MONTEST:pwd4sctmon" -#except: -# ServiceMgr.IOVDbSvc.dbConnection = "impl=cool;techno=oracle;devdb10:TESTCOOL:ATLAS_COOL_MONTEST" - -import RegistrationServices.IOVRegistrationSvc -regSvc = ServiceMgr.IOVRegistrationSvc -regSvc.RecreateFolders = False - -#-------------------------------------------------------------- -# Load POOL support -#-------------------------------------------------------------- -import AthenaPoolCnvSvc.WriteAthenaPool - -#-------------------------------------------------------------- -# AthenaPool details -#-------------------------------------------------------------- -# Check the dictionary in memory for completeness -ServiceMgr.AthenaSealSvc.CheckDictionary = TRUE - -#-------------------------------------------------------------- -import AthenaCommon.AtlasUnixGeneratorJob - -ServiceMgr.EventSelector.RunNumber = 1 -theApp.EvtMax = 10 - -#-------------------------------------------------------------- -# Use AthenaOutputStreamTool to write -# Must "turn off" standard AthenaOutputStream -#-------------------------------------------------------------- -#theApp.OutStream = [] - -from AthenaCommon.AppMgr import ToolSvc -SCT_MonitorConditions.StreamName = "CondStream2" -from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool -ToolSvc += AthenaPoolOutputStreamTool("CondStream2",OutputFile = "SimplePoolFile.root") - -MessageSvc.OutputLevel = DEBUG diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testParameters.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testParameters.py index 4bc586fc2e68b28f72ba161b9d75bbdc5607d14a..ca6cdef72b47392fa800154e9fade229035ea170 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testParameters.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testParameters.py @@ -13,10 +13,7 @@ import AthenaCommon.AtlasUnixStandardJob # use auditors #-------------------------------------------------------------- from AthenaCommon.AppMgr import ServiceMgr - from GaudiSvc.GaudiSvcConf import AuditorSvc -#from AthenaCommon.AppMgr import theApp - ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] @@ -71,39 +68,16 @@ import AtlasGeoModel.GeoModelInit ServiceMgr.GeoModelSvc.DetectorTools['PixelDetectorTool'].LorentzAngleSvc="" ServiceMgr.GeoModelSvc.DetectorTools['SCT_DetectorTool'].LorentzAngleSvc="" -#-------------------------------------------------------------- -# Load DCSConditions Alg and Service -#-------------------------------------------------------------- -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg -topSequence += xAODMaker__EventInfoCnvAlg(OutputLevel=2) - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsParameterTestAlg -topSequence+= SCT_ConditionsParameterTestAlg() - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsParameterSvc -ServiceMgr += SCT_ConditionsParameterSvc() - -#SCT_DCSConditionsSvc=ServiceMgr.SCT_DCSConditionsSvc -SCT_ConditionsParameterSvc.AttrListCollFolders=["/SCT/DAQ/Configuration/Chip"] - - #-------------------------------------------------------------- # Event selector settings. Use McEventSelector #-------------------------------------------------------------- import AthenaCommon.AtlasUnixGeneratorJob -#ServiceMgr+= EventSelector() -#ServiceMgr.EventSelector.FirstEvent = 1 -#ServiceMgr.EventSelector.EventsPerRun = 5 ServiceMgr.EventSelector.RunNumber = 215643 # initial time stamp - this is number of seconds since 1st Jan 1970 GMT ServiceMgr.EventSelector.InitialTimeStamp = 1354748400 # LB 469 of run 215643, 2012-12-05 @ 11:00pm (UTC) -# increment of 3 minutes -ServiceMgr.EventSelector.TimeStampInterval = 180 +ServiceMgr.EventSelector.TimeStampInterval = 180 # increment of 3 minutes -theApp.EvtMax = 10 +theApp.EvtMax = 10 #-------------------------------------------------------------- # Set output lvl (VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL) @@ -118,16 +92,22 @@ from IOVDbSvc.CondDB import conddb conddb.dbdata="COMP200" IOVDbSvc.GlobalTag=globalflags.ConditionsTag() IOVDbSvc.OutputLevel = 3 -conddb.addFolder('',"<db>COOLONL_SCT/COMP200</db> /SCT/DAQ/Configuration/Chip", className="CondAttrListVec") -conddb.addFolder("","<db>COOLONL_SCT/COMP200</db> /SCT/DAQ/Configuration/ROD") -conddb.addFolder("","<db>COOLONL_SCT/COMP200</db> /SCT/DAQ/Configuration/Geog") -conddb.addFolder("","<db>COOLONL_SCT/COMP200</db> /SCT/DAQ/Configuration/RODMUR") -conddb.addFolder("","<db>COOLONL_SCT/COMP200</db> /SCT/DAQ/Configuration/MUR") - -from IOVSvc.IOVSvcConf import CondSvc -ServiceMgr += CondSvc() -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsParameterCondAlg -condSeq += SCT_ConditionsParameterCondAlg( "SCT_ConditionsParameterCondAlg" ) +conddb.addFolder("SCT","/SCT/DAQ/Configuration/ROD") +conddb.addFolder("SCT","/SCT/DAQ/Configuration/Geog") +conddb.addFolder("SCT","/SCT/DAQ/Configuration/RODMUR") +conddb.addFolder("SCT","/SCT/DAQ/Configuration/MUR") + +#-------------------------------------------------------------- +# Load DCSConditions Alg and Service +#-------------------------------------------------------------- +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg +topSequence += xAODMaker__EventInfoCnvAlg(OutputLevel=2) + +from SCT_ConditionsServices.SCT_ConditionsParameterSvcSetup import sct_ConditionsParameterSvcSetup +sct_ConditionsParameterSvcSetup.setup() + +from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsParameterTestAlg +topSequence+= SCT_ConditionsParameterTestAlg() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testReadout.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testReadout.py index 34c7a3f6e3a9ac38c394067eb455f6bafa4d2f38..530ee764742d64b810b6b36efa9e2a11d8db83f0 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testReadout.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testReadout.py @@ -3,13 +3,10 @@ import AthenaCommon.AtlasUnixStandardJob # use auditors from AthenaCommon.AppMgr import ServiceMgr from GaudiSvc.GaudiSvcConf import AuditorSvc - ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testRodVeto.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testRodVeto.py index a401172d07de8443b2e2cbb1287c01ddad3a4e1a..4a6d7d0cad1738d4f179ce3f66952c3960379259 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testRodVeto.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testRodVeto.py @@ -8,9 +8,7 @@ from GaudiSvc.GaudiSvcConf import AuditorSvc ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True @@ -80,8 +78,8 @@ conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Geog", "/SCT/DAQ/Config/Geog") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/RODMUR", "/SCT/DAQ/Config/RODMUR") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/MUR", "/SCT/DAQ/Config/MUR") -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_RODVetoSvc -ServiceMgr += SCT_RODVetoSvc() +from SCT_ConditionsServices.SCT_RODVetoSvcSetup import sct_RODVetoSvcSetup +sct_RODVetoSvcSetup.setup() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_RODVetoTestWriteAlg job+= SCT_RODVetoTestWriteAlg() @@ -95,5 +93,5 @@ import AthenaCommon.AtlasUnixGeneratorJob ServiceMgr.SCT_CablingSvc.OutputLevel = INFO ServiceMgr.SCT_RODVetoSvc.OutputLevel=VERBOSE ServiceMgr.EventSelector.InitialTimeStamp = 1500000000 -ServiceMgr.EventSelector.RunNumber = 300000 # MC16c 2017 run number -theApp.EvtMax = 1 +ServiceMgr.EventSelector.RunNumber = 300000 # MC16c 2017 run number +theApp.EvtMax = 1 diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSensors.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSensors.py index 3fc70551dddc610171e66accb9d5444cf86c05a8..ea2e70f2f2d377b165ddb6fe4c21500825d90091 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSensors.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSensors.py @@ -29,22 +29,12 @@ print globalflags from RecExConfig.RecFlags import rec rec.projectName.set_Value_and_Lock("data12_8TeV") -from IOVSvc.IOVSvcConf import CondSvc -ServiceMgr += CondSvc() -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -from IOVDbSvc.CondDB import conddb - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SensorsCondAlg -condSeq += SCT_SensorsCondAlg( "SCT_SensorsCondAlg" ) - # Load IOVDbSvc IOVDbSvc = Service("IOVDbSvc") IOVDbSvc.GlobalTag=globalflags.ConditionsTag() IOVDbSvc.OutputLevel = 3 +from IOVDbSvc.CondDB import conddb conddb.dbdata="COMP200" -conddb.addFolderWithTag("SCT_OFL","/SCT/Sensors","SctSensors-Sep03-14", className="CondAttrListCollection") #-------------------------------------------------------------- # Set Detector setup @@ -80,8 +70,9 @@ import AtlasGeoModel.GeoModelInit ServiceMgr.GeoModelSvc.DetectorTools['PixelDetectorTool'].LorentzAngleSvc="" ServiceMgr.GeoModelSvc.DetectorTools['SCT_DetectorTool'].LorentzAngleSvc="" -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SensorsSvc -ServiceMgr +=SCT_SensorsSvc() +from SCT_ConditionsServices.SCT_SensorsSvcSetup import sct_SensorsSvcSetup +sct_SensorsSvcSetup.setFolderTag("SctSensors-Sep03-14") +sct_SensorsSvcSetup.setup() from AthenaCommon.AlgSequence import AlgSequence job = AlgSequence() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSilicon.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSilicon.py index e4ce85ef14e4ac8e3c910c54485cc8569e8fbdcb..295389fb31bf98a9c6e47e300ee366116bca4e9b 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSilicon.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSilicon.py @@ -4,15 +4,11 @@ import AthenaCommon.AtlasUnixStandardJob # use auditors from AthenaCommon.AppMgr import ServiceMgr - from GaudiSvc.GaudiSvcConf import AuditorSvc - ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True @@ -71,49 +67,14 @@ IOVDbSvc.GlobalTag="OFLCOND-MC16-SDR-18" IOVDbSvc.OutputLevel = 3 if useDB: - from IOVDbSvc.CondDB import conddb - sctDCSStateFolder = '/SCT/DCS/CHANSTAT' - sctDCSTempFolder = '/SCT/DCS/MODTEMP' - sctDCSHVFolder = '/SCT/DCS/HV' - if not conddb.folderRequested(sctDCSStateFolder): - conddb.addFolder("DCS_OFL", sctDCSStateFolder, className="CondAttrListCollection") - if not conddb.folderRequested(sctDCSTempFolder): - conddb.addFolder("DCS_OFL", sctDCSTempFolder, className="CondAttrListCollection") - if not conddb.folderRequested(sctDCSHVFolder): - conddb.addFolder("DCS_OFL", sctDCSHVFolder, className="CondAttrListCollection") - - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - # For SCT_DCSConditionsSvc - if not hasattr(condSeq, "SCT_DCSConditionsHVCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsHVCondAlg - condSeq += SCT_DCSConditionsHVCondAlg(name = "SCT_DCSConditionsHVCondAlg", - ReadKey = sctDCSHVFolder) - if not hasattr(condSeq, "SCT_DCSConditionsStatCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsStatCondAlg - condSeq += SCT_DCSConditionsStatCondAlg(name = "SCT_DCSConditionsStatCondAlg", - ReadKeyHV = sctDCSHVFolder, - ReadKeyState = sctDCSStateFolder) - if not hasattr(condSeq, "SCT_DCSConditionsTempCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsTempCondAlg - condSeq += SCT_DCSConditionsTempCondAlg(name = "SCT_DCSConditionsTempCondAlg", - ReadKey = sctDCSTempFolder) - # For SCT_SiliconConditionsSvc - if not hasattr(condSeq, "SCT_SiliconTempCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SiliconTempCondAlg - condSeq += SCT_SiliconTempCondAlg(name = "SCT_SiliconTempCondAlg") - if not hasattr(condSeq, "SCT_SiliconHVCondAlg"): - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SiliconHVCondAlg - condSeq += SCT_SiliconHVCondAlg(name = "SCT_SiliconHVCondAlg") - - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc - SCT_DCSConditionsSvc.AttrListCollFolders=[sctDCSStateFolder, sctDCSTempFolder, sctDCSHVFolder] - ServiceMgr += SCT_DCSConditionsSvc(name="InDetSCT_DCSConditionsSvc") - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SiliconConditionsSvc -ServiceMgr += SCT_SiliconConditionsSvc() -SCT_SiliconConditions=ServiceMgr.SCT_SiliconConditionsSvc -SCT_SiliconConditions.UseDB = useDB + # Set up SCT_DCSConditionsSvc and required conditions folders and conditions algorithms + from SCT_ConditionsServices.SCT_DCSConditionsSvcSetup import sct_DCSConditionsSvcSetup + sct_DCSConditionsSvcSetup.setup() + +# For SCT_SiliconConditionsSvc +from SCT_ConditionsServices.SCT_SiliconConditionsSvcSetup import sct_SiliconConditionsSvcSetup +sct_SiliconConditionsSvcSetup.setUseDB(useDB) +sct_SiliconConditionsSvcSetup.setup() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SiliconConditionsTestAlg job+= SCT_SiliconConditionsTestAlg() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSummary.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSummary.py index c93f9d58f7ff138b784afea9e663039e7456ba57..d3807d8e57f5269f836c7506f6e4f5192347c197 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSummary.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testSummary.py @@ -2,15 +2,11 @@ import AthenaCommon.AtlasUnixStandardJob # use auditors from AthenaCommon.AppMgr import ServiceMgr - from GaudiSvc.GaudiSvcConf import AuditorSvc - ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True @@ -24,20 +20,6 @@ globalflags.InputFormat="pool" globalflags.DataSource="data" print globalflags - - - -#from AthenaCommon.GlobalFlags import GlobalFlags -# --- default is atlas geometry -#GlobalFlags.DetGeo.set_atlas() -#globalflags.DetGeo.set_Value_and_Lock(blah) -# --- set defaults -#GlobalFlags.DataSource.set_geant4() -#GlobalFlags.InputFormat.set_pool() -# --- default is zero luminosity -#GlobalFlags.Luminosity.set_zero() -#GlobalFlags.Print() - #-------------------------------------------------------------- # Set Detector setup #-------------------------------------------------------------- @@ -83,43 +65,32 @@ from IOVDbSvc.CondDB import conddb IOVDbSvc.GlobalTag="CONDBR2-BLKPA-2017-06" print "conddb.dbdata", conddb.dbdata IOVDbSvc.OutputLevel = 3 -#-------------------------------------------------------------- -# Load AthCondSeq -#-------------------------------------------------------------- -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -conddb.addFolder("TDAQ", "/TDAQ/Resources/ATLAS/SCT/Robins", className="CondAttrListCollection") -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_TdaqEnabledCondAlg -condSeq += SCT_TdaqEnabledCondAlg(name="SCT_TdaqEnabledCondAlg") - -conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Chip", "/SCT/DAQ/Config/Chip", className="CondAttrListVec") -conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Module", "/SCT/DAQ/Config/Module", className="CondAttrListVec") -conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/MUR", "/SCT/DAQ/Config/MUR", className="CondAttrListVec") # Also for cabling -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationCondAlg -condSeq += SCT_ConfigurationCondAlg(name = "SCT_ConfigurationCondAlg", - ReadKeyChannel = "/SCT/DAQ/Config/Chip", - ReadKeyModule = "/SCT/DAQ/Config/Module", - ReadKeyMur = "/SCT/DAQ/Config/MUR") + +from SCT_ConditionsServices.SCT_TdaqEnabledSvcSetup import sct_TdaqEnabledSvcSetup +sct_TdaqEnabledSvcSetup.setup() + +from SCT_ConditionsServices.SCT_ConfigurationConditionsSvcSetup import sct_ConfigurationConditionsSvcSetup +sct_ConfigurationConditionsSvcSetup.setup() conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Geog", "/SCT/DAQ/Config/Geog") # Needed for cabling conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/RODMUR", "/SCT/DAQ/Config/RODMUR") # Needed for cabling conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/ROD", "/SCT/DAQ/Config/ROD") # Needed for cabling -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ModuleVetoSvc -ServiceMgr +=SCT_ModuleVetoSvc() -SCT_ModuleVeto=ServiceMgr.SCT_ModuleVetoSvc -SCT_ModuleVeto.BadModuleIdentifiers=["1","2"] - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConfigurationConditionsSvc -ServiceMgr +=SCT_ConfigurationConditionsSvc() - +from SCT_ConditionsServices.SCT_ModuleVetoSvcSetup import sct_ModuleVetoSvcSetup +sct_ModuleVetoSvcSetup.setUseDB(False) +sct_ModuleVetoSvcSetup.setup() +SCT_ModuleVetoSvc=sct_ModuleVetoSvcSetup.getSvc() +SCT_ModuleVetoSvc.BadModuleIdentifiers=["1", "2"] from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsSummarySvc ServiceMgr +=SCT_ConditionsSummarySvc() -SCT_ConditionsSummary=ServiceMgr.SCT_ConditionsSummarySvc -SCT_ConditionsSummary.ConditionsServices=["SCT_ModuleVetoSvc", "SCT_ConfigurationConditionsSvc","SCT_TdaqEnabledSvc"] +from SCT_ConditionsServices.SCT_ConditionsSummarySvcSetup import sct_ConditionsSummarySvcSetup +sct_ConditionsSummarySvcSetup.setup() +SCT_ConditionsSummarySvc = sct_ConditionsSummarySvcSetup.getSvc() +SCT_ConditionsSummarySvc.ConditionsServices=[sct_ModuleVetoSvcSetup.getSvcName(), + sct_ConfigurationConditionsSvcSetup.getSvcName(), + sct_TdaqEnabledSvcSetup.getSvcName()] from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsSummaryTestAlg job+= SCT_ConditionsSummaryTestAlg() @@ -128,11 +99,11 @@ import AthenaCommon.AtlasUnixGeneratorJob ServiceMgr.EventSelector.RunNumber = 310809 import time, calendar -#time in seconds , now -#ServiceMgr.EventSelector.InitialTimeStamp = calendar.timegm(time.gmtime()) # initial time stamp - this is number of seconds since 1st Jan 1970 GMT # run 310809 Recording start/end 2016-Oct-17 21:39:18 / 2016-Oct-18 16:45:23 UTC ServiceMgr.EventSelector.InitialTimeStamp = 1476741326 # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC) +#time in seconds , now +#ServiceMgr.EventSelector.InitialTimeStamp = calendar.timegm(time.gmtime()) theApp.EvtMax = 1 ServiceMgr.MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M" diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testTdaqEnabled.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testTdaqEnabled.py index 48417b8292b1583f68cd97e351a5a863bd595651..909325d2079ad4261c124898d74360a9bdc7472a 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testTdaqEnabled.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testTdaqEnabled.py @@ -15,14 +15,11 @@ import AthenaCommon.AtlasUnixStandardJob from AthenaCommon.AppMgr import ServiceMgr from GaudiSvc.GaudiSvcConf import AuditorSvc -#from AthenaCommon.AppMgr import theApp ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] -#ChronoStatSvc = Service ( "ChronoStatSvc") theAuditorSvc.Auditors += [ "MemStatAuditor" ] -#MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=False #-------------------------------------------------------------- @@ -78,13 +75,6 @@ condSeq = AthSequencer("AthCondSeq") from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg condSeq+=xAODMaker__EventInfoCnvAlg(OutputLevel=2) -from IOVSvc.IOVSvcConf import CondInputLoader -condSeq += CondInputLoader( "CondInputLoader",OutputLevel=2) -import StoreGate.StoreGateConf as StoreGateConf -ServiceMgr += StoreGateConf.StoreGateSvc("ConditionStore") -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_TdaqEnabledCondAlg -condSeq += SCT_TdaqEnabledCondAlg( "SCT_TdaqEnabledCondAlg" ) - #-------------------------------------------------------------- # Load DCSConditions Alg and Service #-------------------------------------------------------------- @@ -94,12 +84,6 @@ topSequence = AlgSequence() from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_TdaqEnabledTestAlg topSequence+= SCT_TdaqEnabledTestAlg() -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_TdaqEnabledSvc -ServiceMgr += SCT_TdaqEnabledSvc() - -SCT_TdaqEnabledSvc.AttrListCollFolders=["/TDAQ/Resources/ATLAS/SCT/Robins"] - - #-------------------------------------------------------------- # Event selector settings. Use McEventSelector #-------------------------------------------------------------- @@ -124,11 +108,12 @@ ServiceMgr.MessageSvc.OutputLevel = 3 #-------------------------------------------------------------- IOVDbSvc = Service("IOVDbSvc") from IOVDbSvc.CondDB import conddb -#IOVDbSvc.GlobalTag="HEAD" IOVDbSvc.GlobalTag="CONDBR2-BLKPA-2017-06" IOVDbSvc.OutputLevel = 3 -conddb.addFolder("TDAQ", "/TDAQ/Resources/ATLAS/SCT/Robins", className="CondAttrListCollection") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/ROD", "/SCT/DAQ/Config/ROD") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/Geog", "/SCT/DAQ/Config/Geog") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/RODMUR", "/SCT/DAQ/Config/RODMUR") conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/MUR", "/SCT/DAQ/Config/MUR") + +from SCT_ConditionsServices.SCT_TdaqEnabledSvcSetup import sct_TdaqEnabledSvcSetup +sct_TdaqEnabledSvcSetup.setup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testVeto.py b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testVeto.py index f7ee3ca28df379df93e0cbc26f46e95d3ab92b65..a590a9cc5a87bd63249ec87b7035de7ddccdf41f 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testVeto.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/testVeto.py @@ -2,9 +2,7 @@ import AthenaCommon.AtlasUnixStandardJob # use auditors from AthenaCommon.AppMgr import ServiceMgr - from GaudiSvc.GaudiSvcConf import AuditorSvc - ServiceMgr += AuditorSvc() theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += [ "ChronoAuditor"] @@ -75,17 +73,22 @@ SCT_ModuleVeto=ServiceMgr.SCT_ModuleVetoSvc ### Use COOL database for SCT_ModuleVetoSvc useDB = True # False + +from SCT_ConditionsServices.SCT_ModuleVetoSvcSetup import sct_ModuleVetoSvcSetup if useDB: - SCT_ModuleVeto.BadModuleIdentifiers=["database"] - from IOVSvc.IOVSvcConf import CondSvc - ServiceMgr += CondSvc() + sct_ModuleVetoSvcSetup.setFolderTag("SCTManualBadModules-000-00") from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") - from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ModuleVetoCondAlg - condSeq += SCT_ModuleVetoCondAlg( "SCT_ModuleVetoCondAlg" ) - conddb.addFolderWithTag("SCT_OFL", "/SCT/Manual/BadModules", "SCTManualBadModules-000-00", className="AthenaAttributeList") + from IOVSvc.IOVSvcConf import CondInputLoader + condSeq += CondInputLoader("CondInputLoader", OutputLevel=2) + +sct_ModuleVetoSvcSetup.setUseDB(useDB) +sct_ModuleVetoSvcSetup.setup() +SCT_ModuleVetoSvc = sct_ModuleVetoSvcSetup.getSvc() +if useDB: + SCT_ModuleVetoSvc.BadModuleIdentifiers=["database"] else: - SCT_ModuleVeto.BadModuleIdentifiers=["1", "2"] + SCT_ModuleVetoSvc.BadModuleIdentifiers=["1", "2"] SCT_ModuleVetoSvc.OutputLevel=DEBUG @@ -93,10 +96,9 @@ from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ModuleVetoTest job+= SCT_ModuleVetoTestAlg() - import AthenaCommon.AtlasUnixGeneratorJob -ServiceMgr.EventSelector.RunNumber = 300000 # MC16c 2017 run number -ServiceMgr.EventSelector.InitialTimeStamp = 1500000000 # MC16c 2017 time stamp -theApp.EvtMax = 1 +ServiceMgr.EventSelector.RunNumber = 300000 # MC16c 2017 run number +ServiceMgr.EventSelector.InitialTimeStamp = 1500000000 # MC16c 2017 time stamp +theApp.EvtMax = 1