def generateInDetSensitiveDetectorList():
    SensitiveDetectorList = []

    from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
    isUpgrade = geoFlags.Run() == "RUN3" or geoFlags.Run() == "RUN4" or (
        geoFlags.Run() == "UNDEFINED" and geoFlags.isSLHC())
    isRUN2 = geoFlags.Run() == "RUN2" or (geoFlags.Run() == "UNDEFINED"
                                          and geoFlags.isIBL())
    isRUN1 = not (isRUN2 or isUpgrade)

    from AthenaCommon.DetFlags import DetFlags
    if (isRUN1 or isRUN2) and DetFlags.simulate.BCM_on():
        SensitiveDetectorList += ['BCMSensorSD']
    #if isRUN2 and DetFlags.simulation.DBM_on():
    #    SensitiveDetectorList += [ 'DBMSensorSD' ]
    if DetFlags.simulate.pixel_on():
        if isRUN1 or isRUN2:
            SensitiveDetectorList += ['BLMSensorSD']
        SensitiveDetectorList += ['PixelSensorSD']
    if DetFlags.simulate.SCT_on():
        if isUpgrade:
            SensitiveDetectorList += ['SLHC_SctSensorSD']
        else:
            SensitiveDetectorList += ['SctSensorSD']
    if DetFlags.simulate.TRT_on() and not isUpgrade:
        SensitiveDetectorList += ['TRTSensitiveDetector']
    return SensitiveDetectorList
예제 #2
0
def getIDETEnvelope(name="IDET", **kwargs):
    from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
    isUpgrade = geoFlags.Run() == "RUN3" or geoFlags.Run() == "RUN4" or (
        geoFlags.Run() == "UNDEFINED" and geoFlags.isSLHC())
    isRUN2 = geoFlags.Run() == "RUN2" or (geoFlags.Run() == "UNDEFINED"
                                          and geoFlags.isIBL())
    isRUN1 = not (isRUN2 or isUpgrade)

    kwargs.setdefault("DetectorName", "IDET")
    innerRadius = 37. * mm  # RUN1 default
    if isRUN2:
        innerRadius = 28.9 * mm  #29.15*mm
    if isUpgrade:
        innerRadius = 32.15 * mm
    kwargs.setdefault("InnerRadius", innerRadius)
    kwargs.setdefault("OuterRadius", 1.148 * m)
    kwargs.setdefault("dZ", 347.5 * cm)
    SubDetectorList = []
    from AthenaCommon.DetFlags import DetFlags
    if DetFlags.geometry.pixel_on():
        SubDetectorList += ['Pixel']
    if DetFlags.geometry.SCT_on():
        SubDetectorList += ['SCT']
    if DetFlags.geometry.TRT_on() and not isUpgrade:
        SubDetectorList += ['TRT']
    SubDetectorList += ['IDetServicesMat']
    kwargs.setdefault("SubDetectors", SubDetectorList)
    return CfgMgr.CylindricalEnvelope(name, **kwargs)
def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs):
    from AthenaCommon import CfgGetter
    kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc())
    streamName = kwargs.setdefault("RndmEngine", "PixelDigitization")
    if not digitizationFlags.rndmSeedList.checkForExistingSeed(streamName):
        digitizationFlags.rndmSeedList.addSeed(streamName, 10513239, 492615104 )
    from AthenaCommon.BeamFlags import jobproperties
    from AthenaCommon.Resilience import protectedInclude
    from AthenaCommon.Include import include
    from AthenaCommon.AppMgr import ServiceMgr
    from AthenaCommon.CfgGetter import getService
    protectedInclude( "PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py" )
    include.block( "PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py" )
    protectedInclude( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" )
    include.block( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" )
    protectedInclude("PixelConditionsServices/PixelCalibSvc_jobOptions.py")
    from IOVDbSvc.CondDB import conddb
    conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed")
    PixelCablingSvc = getService("PixelCablingSvc")
    ServiceMgr += PixelCablingSvc
    print  PixelCablingSvc
    if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"):
      from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc
      from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc
      pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices = lorentzAngleSvc.pixelSiliconConditionsSvc)
      ServiceMgr += pixelSiPropertiesSvc
    kwargs.setdefault("InputObjectName", "PixelHits")
    procTools = []
    chargeTools = [] #Tools in array for flexibility
    feSimTools = []
    if GeometryFlags.isSLHC():
      procTools += ['PixelRadDamDiodeCrossTalkGenerator']
      chargeTools += ['RadDamSensorSimPlanarTool']
      feSimTools += ['RadDamRD53SimTool']
    else:
      procTools += ['PixelRadDamDiodeCrossTalkGenerator']
      procTools += ['PixelRadDamChargeSmearer']
      procTools += ['PixelRadDamNoisyCellGenerator']
      procTools += ['PixelRadDamRandomDisabledCellGenerator']
      chargeTools += ['RadDamSensorSimPlanarTool']
      chargeTools += ['RadDamSensorSim3DTool']
      feSimTools += ['RadDamFEI4SimTool']
      feSimTools += ['RadDamFEI3SimTool']
    kwargs.setdefault("PixelProcessorTools", procTools)
    kwargs.setdefault("ChargeTools", chargeTools)
    kwargs.setdefault("FrontEndSimTools", feSimTools)
    kwargs.setdefault("EnergyDepositionTool", "RadDamEnergyDepositionTool")
    if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach
        kwargs.setdefault("FirstXing", Pixel_FirstXing() )
        kwargs.setdefault("LastXing", Pixel_LastXing() )
    return CfgMgr.RadDam__PixelDigitizationTool(name, **kwargs)
예제 #4
0
def SurfaceChargesTool(name="SurfaceChargesTool", **kwargs):
    if hasattr(digitizationFlags, "doBichselSimulation") and digitizationFlags.doBichselSimulation():
        kwargs.setdefault("PixelBarrelChargeTool","PixelBarrelBichselChargeTool")
        kwargs.setdefault("PixelECChargeTool","PixelECBichselChargeTool")
        kwargs.setdefault("IblPlanarChargeTool","IblPlanarBichselChargeTool")
        kwargs.setdefault("Ibl3DChargeTool","Ibl3DBichselChargeTool")
    else:
        kwargs.setdefault("PixelBarrelChargeTool","PixelBarrelChargeTool")
        kwargs.setdefault("PixelECChargeTool","PixelECChargeTool")
        kwargs.setdefault("IblPlanarChargeTool","IblPlanarChargeTool")
        kwargs.setdefault("Ibl3DChargeTool","Ibl3DChargeTool")
    kwargs.setdefault("DBMChargeTool","DBMChargeTool") # No separate implementation when using Bichsel model
    kwargs.setdefault("doITk", GeometryFlags.isSLHC())
    return CfgMgr.SurfaceChargesTool(name, **kwargs)
def getPixelDetectorTool(name="PixelDetectorTool", **kwargs):
    from AtlasGeoModel.InDetGMJobProperties import GeometryFlags
    if GeometryFlags.isSLHC():
        kwargs.setdefault("ServiceBuilderTool", "InDetServMatBuilderToolSLHC")
    else:
        kwargs.setdefault("ServiceBuilderTool", "")
    from AthenaCommon.DetFlags import DetFlags
    if DetFlags.digitize.pixel_on() or DetFlags.haveRDO.pixel_on(
    ) or DetFlags.haveRIO.pixel_on():
        # PixelLorentzAngleSvc needed for digi and reco
        from AthenaCommon.AppMgr import ServiceMgr
        if not hasattr(ServiceMgr, 'PixelLorentzAngleSvc'):
            from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleSvc
            PixelLorentzAngleSvc = SiLorentzAngleSvc(
                name="PixelLorentzAngleSvc",
                SiConditionsServices=None,
                UseMagFieldSvc=False,
                DetectorName="Pixel")
            ServiceMgr += PixelLorentzAngleSvc
        kwargs.setdefault("LorentzAngleSvc", "PixelLorentzAngleSvc")
    else:
        # PixelLorentzAngleSvc not needed for simulation
        kwargs.setdefault("LorentzAngleSvc", "")
    return CfgMgr.PixelDetectorTool(name, **kwargs)
예제 #6
0
def getATLAS_RegionCreatorList():
    regionCreatorList = []
    from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
    isUpgrade = geoFlags.Run() == "RUN3" or geoFlags.Run() == "RUN4" or (
        geoFlags.Run() == "UNDEFINED" and geoFlags.isSLHC())
    isRUN2 = geoFlags.Run() == "RUN2" or (geoFlags.Run() == "UNDEFINED"
                                          and geoFlags.isIBL())

    from G4AtlasApps.SimFlags import simFlags
    from AthenaCommon.DetFlags import DetFlags
    from AthenaCommon.BeamFlags import jobproperties
    if jobproperties.Beam.beamType() == 'cosmics' or \
           (simFlags.CavernBG.statusOn and not 'Signal' in simFlags.CavernBG.get_Value() ):
        regionCreatorList += [
            'SX1PhysicsRegionTool', 'BedrockPhysicsRegionTool',
            'CavernShaftsConcretePhysicsRegionTool'
        ]
        #regionCreatorList += ['CavernShaftsAirPhysicsRegionTool'] # Not used currently
    if DetFlags.ID_on():
        if DetFlags.pixel_on():
            regionCreatorList += ['PixelPhysicsRegionTool']
        if DetFlags.SCT_on():
            regionCreatorList += ['SCTPhysicsRegionTool']
        if DetFlags.TRT_on() and not isUpgrade:
            regionCreatorList += ['TRTPhysicsRegionTool']
            if isRUN2:
                regionCreatorList += ['TRT_ArPhysicsRegionTool'
                                      ]  #'TRT_KrPhysicsRegionTool'
        # FIXME dislike the ordering here, but try to maintain the same ordering as in the old configuration.
        if DetFlags.bpipe_on():
            if simFlags.BeamPipeSimMode.statusOn and simFlags.BeamPipeSimMode(
            ) != "Normal":
                regionCreatorList += ['BeampipeFwdCutPhysicsRegionTool']
            if simFlags.ForwardDetectors.statusOn and simFlags.ForwardDetectors(
            ) == 2:
                regionCreatorList += ['FWDBeamLinePhysicsRegionTool']
    if DetFlags.Calo_on():
        if DetFlags.geometry.LAr_on():
            ## Shower parameterization overrides the calibration hit flag
            if simFlags.LArParameterization.statusOn and simFlags.LArParameterization() > 0 \
                    and simFlags.CalibrationRun.statusOn and simFlags.CalibrationRun.get_Value() in ['LAr','LAr+Tile','DeadLAr']:
                print 'You requested both calibration hits and frozen showers / parameterization in the LAr.'
                print '  Such a configuration is not allowed, and would give junk calibration hits where the showers are modified.'
                print '  Please try again with a different value of either simFlags.LArParameterization (' + str(
                    simFlags.LArParameterization(
                    )) + ') or simFlags.CalibrationRun (' + str(
                        simFlags.CalibrationRun.get_Value()) + ')'
                raise RuntimeError('Configuration not allowed')
            if simFlags.LArParameterization() > 0:
                regionCreatorList += [
                    'EMBPhysicsRegionTool', 'EMECPhysicsRegionTool',
                    'HECPhysicsRegionTool', 'FCALPhysicsRegionTool'
                ]
                # FIXME 'EMBPhysicsRegionTool' used for parametrization also - do we need a second instance??
                regionCreatorList += [
                    'EMECParaPhysicsRegionTool', 'FCALParaPhysicsRegionTool',
                    'FCAL2ParaPhysicsRegionTool'
                ]
                if simFlags.LArParameterization.get_Value() > 1:
                    regionCreatorList += [
                        'PreSampLArPhysicsRegionTool',
                        'DeadMaterialPhysicsRegionTool'
                    ]
            elif simFlags.LArParameterization(
            ) is None or simFlags.LArParameterization() == 0:
                regionCreatorList += [
                    'EMBPhysicsRegionTool', 'EMECPhysicsRegionTool',
                    'HECPhysicsRegionTool', 'FCALPhysicsRegionTool'
                ]
    ## FIXME _initPR never called for FwdRegion??
    #if simFlags.ForwardDetectors.statusOn:
    #    if DetFlags.geometry.FwdRegion_on():
    #        regionCreatorList += ['FwdRegionPhysicsRegionTool']
    if DetFlags.Muon_on():
        regionCreatorList += [
            'DriftWallPhysicsRegionTool', 'DriftWall1PhysicsRegionTool',
            'DriftWall2PhysicsRegionTool'
        ]
        if simFlags.CavernBG.statusOn and simFlags.CavernBG.get_Value(
        ) != 'Read' and not (simFlags.RecordFlux.statusOn
                             and simFlags.RecordFlux()):
            regionCreatorList += ['MuonSystemFastPhysicsRegionTool']
    return regionCreatorList
예제 #7
0
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration

#
# InDet GeoModel initialization
#
from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.JobProperties import jobproperties
from AthenaCommon.DetFlags      import DetFlags
from AthenaCommon.AppMgr        import ServiceMgr as svcMgr

from AtlasGeoModel.InDetGMJobProperties import GeometryFlags
if GeometryFlags.isSLHC():
    #SLHC specific code
    from AthenaCommon.AppMgr import ToolSvc

# Treat CTB separately
if ( jobproperties.Global.DetGeo() == "ctbh8" or jobproperties.Global.DetGeo() == "ctbh6" ):
    from AtlasGeoModel import InDetGMCTB

elif ( DetFlags.detdescr.ID_on() ):
    from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
    GeoModelSvc = GeoModelSvc()

    if not hasattr(svcMgr,'InDetGeometryDBSvc'):
        from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
        svcMgr+=GeometryDBSvc("InDetGeometryDBSvc")
        if GeometryFlags.isSLHC():
            #SLHC specific code
            # General service builder tool for SLHC
            from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatBuilderToolSLHC
            InDetServMatBuilderToolSLHC = InDetServMatBuilderToolSLHC()
예제 #8
0
def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs):
    from AthenaCommon import CfgGetter
    kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc())
    streamName = kwargs.setdefault("RndmEngine", "PixelDigitization")
    if not digitizationFlags.rndmSeedList.checkForExistingSeed(streamName):
        digitizationFlags.rndmSeedList.addSeed(streamName, 10513239, 492615104 )
    from AthenaCommon.BeamFlags import jobproperties
    from AthenaCommon.Resilience import protectedInclude
    from AthenaCommon.Include import include
    from AthenaCommon.AppMgr import ServiceMgr
    protectedInclude( "PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py" )
    include.block( "PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py" )
    protectedInclude( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" )
    include.block( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" )
    protectedInclude("PixelConditionsServices/PixelCalibSvc_jobOptions.py")
    from IOVDbSvc.CondDB import conddb
    conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed")
    kwargs.setdefault("PixelCablingSvc","PixelCablingSvc")
    if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"):
        from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc
        from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc
        pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices = lorentzAngleSvc.pixelSiliconConditionsSvc)
        ServiceMgr += pixelSiPropertiesSvc
    kwargs.setdefault("InputObjectName", "PixelHits")
    pixTools = []
    pixTools += ['PixelDiodeCrossTalkGenerator']
    pixTools += ['PixelChargeSmearer']
    if digitizationFlags.doInDetNoise.get_Value():
        pixTools += ['PixelNoisyCellGenerator']
    pixTools += ['PixelGangedMerger']
    pixTools += ['SpecialPixelGenerator']
    pixTools += ['PixelRandomDisabledCellGenerator']
    pixTools += ['PixelCellDiscriminator']
    kwargs.setdefault("PixelTools", pixTools)
    # Start of special cosmics tuning:
    if jobproperties.Beam.beamType == "cosmics" :
        kwargs.setdefault("UseComTime", True)
    if GeometryFlags.isSLHC():
        LVL1Latency = [255, 255, 255, 255, 255, 16, 255]
        ToTMinCut = [0, 0, 0, 0, 0, 0, 0]
        ApplyDupli = [False, False, False, False, False, False, False]
        LowTOTduplication = [0, 0, 0, 0, 0, 0, 0]
        kwargs.setdefault("LVL1Latency", LVL1Latency)
        kwargs.setdefault("ToTMinCut", ToTMinCut)
        kwargs.setdefault("ApplyDupli", ApplyDupli)
        kwargs.setdefault("LowTOTduplication", LowTOTduplication)
    else:
        # For LVL1Latency, ToTMinCut, ApplyDupli and LowTOTduplication, first component [0] is always for IBL, even for run 1 production.
        # The order is IBL, BL, L1, L2, EC, DBM
        # For IBL and DBM, values of LVL1Latency and LowToTDupli are superseded by values driven by HitDiscCnfg settings, in PixelDigitizationTool.cxx
        LVL1Latency = [16, 150, 255, 255, 255, 16]
        ToTMinCut = [0, 6, 6, 6, 6, 0]
        ApplyDupli = [True, False, False, False, False, False]
        LowTOTduplication = [0, 7, 7, 7, 7, 0]
        kwargs.setdefault("LVL1Latency", LVL1Latency)
        kwargs.setdefault("ToTMinCut", ToTMinCut)
        kwargs.setdefault("ApplyDupli", ApplyDupli)
        kwargs.setdefault("LowTOTduplication", LowTOTduplication)
    if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach
        kwargs.setdefault("FirstXing", Pixel_FirstXing() )
        kwargs.setdefault("LastXing", Pixel_LastXing() )
    return CfgMgr.PixelDigitizationTool(name, **kwargs)