def getSCT_SurfaceChargesGenerator(name="SCT_SurfaceChargesGenerator", **kwargs): ## Set up services used by SCT_SurfaceChargesGenerator # Set up SCT_DCSConditiosnTool from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() sct_DCSConditionsToolSetup.setup() # Set up SCT_SiliconConditionsTool from SCT_ConditionsTools.SCT_SiliconConditionsToolSetup import SCT_SiliconConditionsToolSetup sct_SiliconConditionsToolSetup = SCT_SiliconConditionsToolSetup() sct_SiliconConditionsToolSetup.setDcsTool( sct_DCSConditionsToolSetup.getTool()) sct_SiliconConditionsToolSetup.setup() # Set up SCT_SiPropertiesTool from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup() sct_SiPropertiesToolSetup.setSiliconTool( sct_SiliconConditionsToolSetup.getTool()) sct_SiPropertiesToolSetup.setup() ## Charge trapping tool - used by SCT_SurfaceChargesGenerator from AthenaCommon.AppMgr import ToolSvc ## SiLorentzAngleTool for SCT_SurfaceChargesGenerator from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() kwargs.setdefault("FixedTime", -999) kwargs.setdefault("SubtractTime", -999) kwargs.setdefault("SurfaceDriftTime", 10 * Units.ns) kwargs.setdefault("NumberOfCharges", 1) kwargs.setdefault("SmallStepLength", 5 * Units.micrometer) kwargs.setdefault("DepletionVoltage", 70) kwargs.setdefault("BiasVoltage", 150) kwargs.setdefault("SiPropertiesTool", sct_SiPropertiesToolSetup.getTool()) kwargs.setdefault("LorentzAngleTool", sctLorentzAngleToolSetup.SCTLorentzAngleTool) from AthenaCommon.GlobalFlags import globalflags kwargs.setdefault("isOverlay", globalflags.isOverlay()) # kwargs.setdefault("doTrapping", True) # ATL-INDET-INT-2016-019 from Digitization.DigitizationFlags import digitizationFlags if 'doDetailedSurfChargesGen' in digitizationFlags.experimentalDigi(): kwargs.setdefault("ChargeDriftModel", 1) kwargs.setdefault("EFieldModel", 2) kwargs.setdefault("MagneticField", -2.0) kwargs.setdefault("SensorTemperature", 273.15) kwargs.setdefault("TransportTimeStep", 0.25) kwargs.setdefault("TransportTimeMax", 25.0) from SCT_Digitization.SCT_DigitizationConf import SCT_DetailedSurfaceChargesGenerator return SCT_DetailedSurfaceChargesGenerator(name, **kwargs) else: from SCT_ConditionsTools.SCT_ConditionsToolsConf import SCT_RadDamageSummaryTool kwargs.setdefault( "RadDamageSummaryTool", SCT_RadDamageSummaryTool(name="InDetSCT_RadDamageSummaryTool")) from SCT_Digitization.SCT_DigitizationConf import SCT_SurfaceChargesGenerator return SCT_SurfaceChargesGenerator(name, **kwargs)
def commonSCT_FastDigitizationConfig(name,**kwargs): # Setup the DCS folders and tool used in the sctSiliconConditionsTool from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() sct_DCSConditionsToolSetup.setup() kwargs.setdefault("ClusterMaker", "FastClusterMakerTool") # Import Digitization job properties from Digitization.DigitizationFlags import digitizationFlags # set the random service, stream name streamName = kwargs.setdefault("RndmEngine", "FastSCT_Digitization") kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc() ) # set rndm seeds if not digitizationFlags.rndmSeedList.checkForExistingSeed(streamName): digitizationFlags.rndmSeedList.addSeed(streamName, 49261510, 105132394 ) if digitizationFlags.doXingByXingPileUp(): kwargs.setdefault("FirstXing", FastSCT_FirstXing()) kwargs.setdefault("LastXing", FastSCT_LastXing() ) # Set up SCT_SiliconConditionsTool from SCT_ConditionsTools.SCT_SiliconConditionsToolSetup import SCT_SiliconConditionsToolSetup sct_SiliconConditionsToolSetup = SCT_SiliconConditionsToolSetup() sct_SiliconConditionsToolSetup.setDcsTool(sct_DCSConditionsToolSetup.getTool()) sct_SiliconConditionsToolSetup.setup() # Set up SCT_SiPropertiesTool from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup() sct_SiPropertiesToolSetup.setSiliconTool(sct_SiliconConditionsToolSetup.getTool()) sct_SiPropertiesToolSetup.setup() # SiLorentzAngleTool for SCT_FastDigitizationTool from AthenaCommon.AppMgr import ToolSvc from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() kwargs.setdefault("LorentzAngleTool", sctLorentzAngleToolSetup.SCTLorentzAngleTool) from AthenaCommon import CfgMgr return CfgMgr.SCT_FastDigitizationTool(name,**kwargs)
from AthenaCommon.AlgSequence import AlgSequence job = AlgSequence() #-------------------------------------------------------------- # Load IOVDbSvc #-------------------------------------------------------------- IOVDbSvc = Service("IOVDbSvc") from IOVDbSvc.CondDB import conddb IOVDbSvc.GlobalTag = "OFLCOND-MC16-SDR-18" IOVDbSvc.OutputLevel = 3 if useDB: # Set up SCT_DCSConditionsTool and required conditions folders and conditions algorithms from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() sct_DCSConditionsToolSetup.setup() # For SCT_SiliconConditionsTool from SCT_ConditionsTools.SCT_SiliconConditionsToolSetup import SCT_SiliconConditionsToolSetup sct_SiliconConditionsToolSetup = SCT_SiliconConditionsToolSetup() sct_SiliconConditionsToolSetup.setUseDB(useDB) sct_SiliconConditionsToolSetup.setDcsTool(sct_DCSConditionsToolSetup.getTool()) sct_SiliconConditionsToolSetup.setup() from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_SiliconConditionsTestAlg job += SCT_SiliconConditionsTestAlg( SCT_SiliconConditionsTool=sct_SiliconConditionsToolSetup.getTool()) if numThreads >= 2: from SCT_ConditionsAlgorithms.SCTCondAlgCardinality import sctCondAlgCardinality
if numThreads >= 2: condSeq.InDetSiDetElementBoundaryLinksPixelCondAlg.Cardinality = numThreads # Set up SCT conditions SCT_ConditionsSummaryTool = None if doSCT: # Taken from InDetRecExample/share/InDetRecConditionsAccess.py from SCT_ConditionsTools.SCT_ConfigurationConditionsToolSetup import SCT_ConfigurationConditionsToolSetup sct_ConfigurationConditionsToolSetup = SCT_ConfigurationConditionsToolSetup( ) sct_ConfigurationConditionsToolSetup.setup() from SCT_ConditionsTools.SCT_ReadCalibDataToolSetup import SCT_ReadCalibDataToolSetup sct_ReadCalibDataToolSetup = SCT_ReadCalibDataToolSetup() sct_ReadCalibDataToolSetup.setup() from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() sct_DCSConditionsToolSetup.setup() from SCT_ConditionsTools.SCT_ConditionsSummaryToolSetup import SCT_ConditionsSummaryToolSetup from SCT_ConditionsTools.SCT_FlaggedConditionToolSetup import SCT_FlaggedConditionToolSetup sct_FlaggedConditionToolSetup = SCT_FlaggedConditionToolSetup() sct_FlaggedConditionToolSetup.setup() sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup() sct_ConditionsSummaryToolSetup.setup() SCT_ConditionsSummaryTool = sct_ConditionsSummaryToolSetup.getTool() SCT_ConditionsSummaryTool.ConditionsTools = [ sct_ConfigurationConditionsToolSetup.getTool().getFullName(), sct_FlaggedConditionToolSetup.getTool().getFullName(), sct_ReadCalibDataToolSetup.getTool().getFullName(), sct_DCSConditionsToolSetup.getTool().getFullName() ] from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
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
OutputLevel=4, doTrigger=doTrigger, TrigDecisionTool=TrigDecisionTool_InDetSCTHitsTool, tracksName=tracksName) if (InDetFlags.doPrintConfigurables()): printfunc(InDetSCTHitsTool) from SCT_Monitoring.SCT_MonitoringConf import SCTErrMonTool InDetSCTErrMonTool = SCTErrMonTool(name="InDetSCTErrMonTool", OutputLevel=4, histoPathBase="/stat", UseDCS=InDetFlags.useDCS()) if InDetFlags.useDCS(): from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() sct_DCSConditionsToolSetup.setup() InDetSCTErrMonTool.SCT_DCSConditionsTool = sct_DCSConditionsToolSetup.getTool( ) else: InDetSCTErrMonTool.SCT_DCSConditionsTool = None if jobproperties.Beam.beamType() == 'collisions': from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool InDetSCTErrMonTool.FilterTools += [GetFilledBunchFilterTool()] if (InDetFlags.doPrintConfigurables()): printfunc(InDetSCTErrMonTool) from SCT_Monitoring.SCT_MonitoringConf import SCTTracksMonTool InDetSCTTracksMonTool = SCTTracksMonTool(name="InDetSCTTracksMonTool",
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(InDetSCT_ModuleVetoTool) # Load bytestream errors tool (use default instance without "InDet") # @TODO find a better to solution to get the correct tool for the current job. from SCT_ConditionsTools.SCT_ByteStreamErrorsToolSetup import SCT_ByteStreamErrorsToolSetup sct_ByteStreamErrorsToolSetup = SCT_ByteStreamErrorsToolSetup() sct_ByteStreamErrorsToolSetup.setConfigTool( InDetSCT_ConfigurationConditionsTool) sct_ByteStreamErrorsToolSetup.setup() SCT_ByteStreamErrorsTool = sct_ByteStreamErrorsToolSetup.getTool() if (InDetFlags.doPrintConfigurables()): 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()
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 # Set up SCT_DCSConditionsTool and required conditions folders and conditions algorithms from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() sct_DCSConditionsToolSetup.setup() #-------------------------------------------------------------- # Load DCSConditions Alg and Service #-------------------------------------------------------------- from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_DCSConditionsTestAlg topSequence += SCT_DCSConditionsTestAlg( SCT_DCSConditionsTool=sct_DCSConditionsToolSetup.getTool()) if numThreads >= 2: