Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
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
    sctCondAlgCardinality.set(numThreads)
Exemplo n.º 5
0
    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