def initDcsTool(self, instanceName): "Init DCS conditions tool" from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() sct_DCSConditionsToolSetup.setToolName(instanceName) dcs_folder = "/SCT/DCS" db_loc = "DCS_OFL" if (not self.isMC): dcs_folder = "/SCT/HLT/DCS" db_loc = "SCT" sct_DCSConditionsToolSetup.setDbInstance(db_loc) sct_DCSConditionsToolSetup.setStateFolder(dcs_folder + "/CHANSTAT") sct_DCSConditionsToolSetup.setHVFolder(dcs_folder + "/HV") sct_DCSConditionsToolSetup.setTempFolder(dcs_folder + "/MODTEMP") readAllDBFolders = True if (not self.isMC): readAllDBFolders = False if self.onlineMode: readAllDBFolders = False sct_DCSConditionsToolSetup.setReadAllDBFolders(readAllDBFolders) sct_DCSConditionsToolSetup.setup() dcsTool = sct_DCSConditionsToolSetup.getTool() returnHVTemp = sct_DCSConditionsToolSetup.getReturnHVTemp() if ((readAllDBFolders and returnHVTemp) or (not readAllDBFolders and not returnHVTemp)): if not (dcsTool.getFullName() in self.summaryTool.ConditionsTools): self.summaryTool.ConditionsTools += [dcsTool.getFullName()] if self.isMC: if not self.condDB.folderRequested("/SCT/DCS/MPS/LV"): self.condDB.addFolder(db_loc, "/SCT/DCS/MPS/LV") return dcsTool
def __init__(self, forceUseDB=False, forceUseGeoModel=False): if forceUseDB and forceUseGeoModel: from AthenaCommon import Logging msg = Logging.logging.getLogger("SCTLorentzAngleToolSetup") msg.error( "Setting is wrong: both forceUseDB and forceUseGeoModel cannot be True at the same time" ) return # Set up SCT_DCSConditiosnTool if necessary if not forceUseGeoModel: from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() # For HLT and online monitoring from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if athenaCommonFlags.isOnline(): sct_DCSConditionsToolSetup.setReadAllDBFolders(False) from AthenaCommon.GlobalFlags import globalflags if globalflags.DataSource() == "data": sct_DCSConditionsToolSetup.setDbInstance("SCT") dcs_folder = "/SCT/HLT/DCS" sct_DCSConditionsToolSetup.setStateFolder(dcs_folder + "/CHANSTAT") sct_DCSConditionsToolSetup.setHVFolder(dcs_folder + "/HV") sct_DCSConditionsToolSetup.setTempFolder(dcs_folder + "/MODTEMP") sct_DCSConditionsToolSetup.setup() # Set up SCT_SiliconConditionsTool from SCT_ConditionsTools.SCT_SiliconConditionsToolSetup import SCT_SiliconConditionsToolSetup sct_SiliconConditionsToolSetup = SCT_SiliconConditionsToolSetup() if forceUseGeoModel: sct_SiliconConditionsToolSetup.setUseDB(False) sct_SiliconConditionsToolSetup.setForceUseGeoModel(True) else: sct_SiliconConditionsToolSetup.setDcsTool( sct_DCSConditionsToolSetup.getTool()) sct_SiliconConditionsToolSetup.setup() sctSiliconConditionsTool = sct_SiliconConditionsToolSetup.getTool() self.sctSiliconConditionsTool = sctSiliconConditionsTool self.SCT_SiliconConditionsTool = sctSiliconConditionsTool # Set up SCTSiLorentzAngleCondAlg from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") if not hasattr(condSeq, "SCTSiLorentzAngleCondAlg"): from SiLorentzAngleTool.SiLorentzAngleToolConf import SCTSiLorentzAngleCondAlg from AthenaCommon.AthenaCommonFlags import athenaCommonFlags condSeq += SCTSiLorentzAngleCondAlg( name="SCTSiLorentzAngleCondAlg", SiConditionsTool=sctSiliconConditionsTool, UseMagFieldCache=True, UseMagFieldDcs=(not athenaCommonFlags.isOnline()), UseGeoModel=forceUseGeoModel) sctSiLorentzAngleCondAlg = condSeq.SCTSiLorentzAngleCondAlg if forceUseDB: sctSiLorentzAngleCondAlg.useSctDefaults = False # Set up SCTLorentzAngleTool from AthenaCommon.CfgGetter import getPrivateTool sctLorentzAngleTool = getPrivateTool("SCTLorentzAngleTool") # Pass the silicon conditions tool to the Lorentz angle tool # Also make sure UseMagFieldTool is True as AtlasGeoModel sets this to False # if loaded first. sctLorentzAngleTool.UseMagFieldCache = True self.SCTLorentzAngleTool = sctLorentzAngleTool
printfunc(SCT_ByteStreamErrorsTool) if InDetFlags.useSctDCS(): from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() # For HLT and online monitoring if athenaCommonFlags.isOnline(): sct_DCSConditionsToolSetup.setReadAllDBFolders(False) if globalflags.DataSource() == "data": sct_DCSConditionsToolSetup.setDbInstance("SCT") dcs_folder = "/SCT/HLT/DCS" sct_DCSConditionsToolSetup.setStateFolder(dcs_folder + "/CHANSTAT") sct_DCSConditionsToolSetup.setHVFolder(dcs_folder + "/HV") sct_DCSConditionsToolSetup.setTempFolder(dcs_folder + "/MODTEMP") sct_DCSConditionsToolSetup.setup() InDetSCT_DCSConditionsTool = sct_DCSConditionsToolSetup.getTool() if InDetFlags.useHVForSctDCS(): sct_DCSConditionsToolSetup.getStateAlg( ).UseDefaultHV = True #Hack to use ~20V cut for SCT DCS rather than ChanStat for startup if (InDetFlags.doPrintConfigurables()): printfunc(InDetSCT_DCSConditionsTool) if (globalflags.DataSource() == 'data'): printfunc("Conditions db instance is ", conddb.dbdata) # Load Tdaq enabled tools for data only and add some to summary tool for data only tdaqFolder = '/TDAQ/EnabledResources/ATLAS/SCT/Robins' if (conddb.dbdata == "CONDBR2"): tdaqFolder = '/TDAQ/Resources/ATLAS/SCT/Robins'