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)
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
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 sctCondAlgCardinality.set(numThreads) job.SCT_SiliconConditionsTestAlg.Cardinality = numThreads import AthenaCommon.AtlasUnixGeneratorJob ServiceMgr.EventSelector.RunNumber = 300000 # MC16c 2017 run number import time, calendar
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 sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() # Taken from InDetRecExample/share/InDetRecPreProcessingSilicon.py if not hasattr(condSeq, "InDetSiElementPropertiesTableCondAlg"): from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg condSeq += InDet__SiElementPropertiesTableCondAlg( name="InDetSiElementPropertiesTableCondAlg") # Taken from InDetRecExample/share/InDetRecLoadTools.py if not hasattr(condSeq, "InDetSiDetElementBoundaryLinksSCTCondAlg"): from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk( name="InDetSiDetElementBoundaryLinksSCTCondAlg", ReadKey="SCT_DetectorElementCollection", WriteKey="SCT_DetElementBoundaryLinks_xk")
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", OutputLevel=4, doTrigger=doTrigger, tracksName=tracksName)
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
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' # Load TdaqEnabled tool from SCT_ConditionsTools.SCT_TdaqEnabledToolSetup import SCT_TdaqEnabledToolSetup sct_TdaqEnabledToolSetup = SCT_TdaqEnabledToolSetup()