Пример #1
0
def getPixelPhysicsRegionTool(name='PixelPhysicsRegionTool', **kwargs):
    kwargs.setdefault("RegionName", 'Pixel')
    volumeList = ['Pixel::siLog', 'Pixel::siBLayLog']
    from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
    if geoFlags.Run() == "RUN2" or (geoFlags.Run() == "UNDEFINED"
                                    and geoFlags.isIBL()):
        volumeList += ['Pixel::dbmDiamondLog']
    kwargs.setdefault("VolumeList", volumeList)
    kwargs.setdefault("ElectronCut", 0.05)
    kwargs.setdefault("PositronCut", 0.05)
    kwargs.setdefault("GammaCut", 0.05)
    return CfgMgr.RegionCreator(name, **kwargs)
Пример #2
0
def toolInDetVKalMultiVxInJetTool(name, useBTagFlagsDefaults = True, **options):
    """Sets up a InDetVKalMultiVxInJetTool tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel
    getNegativeTail                     default: False
    ConeForTag                          default: 1.0
    MultiVertex                         default: True

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then by added to ToolSvc via ToolSvc += output. Note however
    that this tool also needs to be added to the main B-tagging tool."""
    if useBTagFlagsDefaults:
        defaults = { 'OutputLevel'     : BTaggingFlags.OutputLevel,
                     'getNegativeTail' : False,
                     'ExistIBL'        : geoFlags.isIBL(),
                     'ConeForTag'      : 1.0,
                     'MultiVertex'     : True }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool
    return InDet__InDetVKalVxInJetTool(**options)
Пример #3
0
def toolInDetVKalVxNegativeTagInJetTool(name,
                                        useBTagFlagsDefaults=True,
                                        **options):
    """Sets up a InDetVKalVxNegativeTagInJetTool tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel
    getNegativeTag                      default: True
    CutA0                               default: 2.0 (new tuned cuts for SV0 (Sara))
    CutZVrt                             default: 2.0
    CutPixelHits                        default: 2

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then by added to ToolSvc via ToolSvc += output. Note however
    that this tool also needs to be added to the main B-tagging tool."""
    if useBTagFlagsDefaults:
        defaults = {
            'OutputLevel': BTaggingFlags.OutputLevel,
            'ExistIBL': geoFlags.isIBL(),
            #                     'TrackSummaryTool' : None,
            'getNegativeTag': True,
            'CutA0': 2.0,
            'CutZVrt': 2.0,
            'CutPixelHits': 2
        }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool
    return InDet__InDetVKalVxInJetTool(**options)
def toolInDetVKalMultiVxInJetTool(name, useBTagFlagsDefaults = True, **options):
    """Sets up a InDetVKalMultiVxInJetTool tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel
    getNegativeTail                     default: False
    ConeForTag                          default: 1.0
    MultiVertex                         default: True

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then by added to ToolSvc via ToolSvc += output. Note however
    that this tool also needs to be added to the main B-tagging tool."""
    if useBTagFlagsDefaults:
        defaults = { 'OutputLevel'     : BTaggingFlags.OutputLevel,
                     'getNegativeTail' : False,
                     'ExistIBL'        : geoFlags.isIBL(),
                     'ConeForTag'      : 1.0,
                     'MultiVertex'     : True }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool
    return InDet__InDetVKalVxInJetTool(**options)
def toolInDetVKalVxNegativeTagInJetTool(name, useBTagFlagsDefaults = True, **options):
    """Sets up a InDetVKalVxNegativeTagInJetTool tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel
    getNegativeTag                      default: True
    CutA0                               default: 2.0 (new tuned cuts for SV0 (Sara))
    CutZVrt                             default: 2.0
    CutPixelHits                        default: 2

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then by added to ToolSvc via ToolSvc += output. Note however
    that this tool also needs to be added to the main B-tagging tool."""
    if useBTagFlagsDefaults:
        defaults = { 'OutputLevel'      : BTaggingFlags.OutputLevel,
                     'ExistIBL'         : geoFlags.isIBL(),
#                     'TrackSummaryTool' : None,
                     'getNegativeTag'   : True,
                     'CutA0'            : 2.0,
                     'CutZVrt'          : 2.0,
                     'CutPixelHits'     : 2 }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool
    return InDet__InDetVKalVxInJetTool(**options)
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
Пример #7
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)
Пример #8
0
    def __init__(self, name="L1MuctpiTool"):

        LVL1MUCTPI__L1MuctpiTool.__init__(self, name)

        # Create a logger:
        from AthenaCommon.Logging import logging
        logger = logging.getLogger("L1MuctpiTool")

        # Set properties of the LUT overlap handling:
        self.OverlapStrategyName = "LUT"
        self.DumpLUT = False
        self.LUTXMLFile = "UNDEFINED"
        self.RunPeriod = "UNDEFINED"
        self.FlaggingMode = False
        self.MultiplicityStrategyName = "INCLUSIVE"

        # Decide which LUT to use, based on which run we are simulating:
        from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
        if (geoFlags.Run() == "RUN1") or ((geoFlags.Run() == "UNDEFINED") and
                                          (geoFlags.isIBL() == False)):
            self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml"
            self.RunPeriod = "RUN1"
            logger.info(
                "Configuring MuCTPI simulation with Run 1 configuration file:")
            logger.info(
                "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml"
            )
            logger.info("  with a RunPeriod=RUN1")
        elif (geoFlags.Run() == "RUN2") or ((geoFlags.Run() == "UNDEFINED") and
                                            (geoFlags.isIBL() == True)):
            self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
            self.RunPeriod = "RUN2"
            logger.info(
                "Configuring MuCTPI simulation with Run 2 configuration file:")
            logger.info(
                "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
            )
            logger.info("  with a RunPeriod=RUN2")
        else:
            self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
            self.RunPeriod = "RUN2"
            logger.warning(
                "Couldn't determine which run to simulate, using Run 2 configuration file:"
            )
            logger.warning(
                "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
            )
            logger.warning("  with a RunPeriod=RUN2")

            pass

        # Set properties for NIM outputs ot L1Topo conversion from RoI to eta/phi
        self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml"

        # Turn on the NIM output creation by default:
        self.DoNIMOutput = True
        # The bit settings were extracted from here:
        #   https://savannah.cern.ch/bugs/?90300#comment14
        self.NIMBarrelBit = 29
        self.NIMEndcapBit = 30
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)
Пример #10
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 SurfaceChargesTool(name="SurfaceChargesTool", **kwargs):
    if _doBichsel:
        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)
Пример #12
0
def getTRTSensitiveDetector(name="TRTSensitiveDetector", **kwargs):
    bare_collection_name = "TRTUncompressedHits"
    mergeable_collection_suffix = "_G4"
    merger_input_property = "TRTUncompressedHits"
    hits_collection_name = generate_mergeable_collection_name(
        bare_collection_name, mergeable_collection_suffix,
        merger_input_property)
    logicalVolumeNames = ["TRT::Gas", "TRT::GasMA"]
    from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
    if geoFlags.Run() == "RUN2":
        ## RUN2 configuration
        logicalVolumeNames += [
            "TRT::Gas_Ar", "TRT::GasMA_Ar", "TRT::Gas_Kr", "TRT::GasMA_Kr"
        ]
    kwargs.setdefault("LogicalVolumeNames", logicalVolumeNames)

    kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
    return CfgMgr.TRTSensitiveDetectorTool(name, **kwargs)
def toolInDetVKalVxInJetTool(name, useBTagFlagsDefaults = True, **options):
    """Sets up a InDetVKalVxInJetTool tool and returns it.

    The following options have BTaggingFlags defaults:

    TrackSummaryTool                    default: None (not needed for b-tagging)
    OutputLevel                         default: BTaggingFlags.OutputLevel

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then by added to ToolSvc via ToolSvc += output. Note however
    that this tool also needs to be added to the main B-tagging tool."""
    if useBTagFlagsDefaults:
        defaults = { 'OutputLevel'      : BTaggingFlags.OutputLevel,
                     'ExistIBL'         : geoFlags.isIBL(),
#                     'TrackSummaryTool' : None }
                     }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool
    return InDet__InDetVKalVxInJetTool(**options)
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)
Пример #15
0
def toolInDetVKalVxInJetTool(name, useBTagFlagsDefaults=True, **options):
    """Sets up a InDetVKalVxInJetTool tool and returns it.

    The following options have BTaggingFlags defaults:

    TrackSummaryTool                    default: None (not needed for b-tagging)
    OutputLevel                         default: BTaggingFlags.OutputLevel

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then by added to ToolSvc via ToolSvc += output. Note however
    that this tool also needs to be added to the main B-tagging tool."""
    if useBTagFlagsDefaults:
        defaults = {
            'OutputLevel': BTaggingFlags.OutputLevel,
            'ExistIBL': geoFlags.isIBL(),
            #                     'TrackSummaryTool' : None }
        }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool
    return InDet__InDetVKalVxInJetTool(**options)
                TemperatureFolder="/PIXEL/HLT/DCS/TEMPERATURE",
                HVFolder="/PIXEL/HLT/DCS/HV",
                TemperatureFieldName="temperature",
                HVFieldName="HV")
        else:
            if not conddb.folderRequested('/PIXEL/DCS/TEMPERATURE'):
                conddb.addFolder("DCS_OFL", "/PIXEL/DCS/TEMPERATURE")
            if not conddb.folderRequested('/PIXEL/DCS/HV'):
                conddb.addFolder("DCS_OFL", "/PIXEL/DCS/HV")
            if not conddb.folderRequested('/PIXEL/DCS/FSMSTATUS'):
                conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATUS")
            if not conddb.folderRequested('/PIXEL/DCS/FSMSTATE'):
                conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE")
            from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
            if (rec.doMonitoring() and globalflags.DataSource() == 'data'
                    and geoFlags.Run() == "RUN2"
                    and conddb.dbdata == "CONDBR2"):
                # geoFlags.isIBL() == True may work too instead of geoFlags.Run() == "RUN2"
                if not conddb.folderRequested('/PIXEL/DCS/PIPES'):
                    conddb.addFolder("DCS_OFL", "/PIXEL/DCS/PIPES")
                if not conddb.folderRequested('/PIXEL/DCS/LV'):
                    conddb.addFolder("DCS_OFL", "/PIXEL/DCS/LV")
                if not conddb.folderRequested('/PIXEL/DCS/HVCURRENT'):
                    conddb.addFolder("DCS_OFL", "/PIXEL/DCS/HVCURRENT")
                # not used anymore
                # if not conddb.folderRequested('/PIXEL/DCS/PLANTS'):
                #    conddb.addFolder("DCS_OFL","/PIXEL/DCS/PLANTS")

            InDetPixelDCSSvc = PixelDCSSvc(
                RegisterCallback=TRUE,
                TemperatureFolder="/PIXEL/DCS/TEMPERATURE",
                            "/TRT/Cond/StatusHT")
conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/Status", "/TRT/Cond/Status")
conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusPermanent",
                            "/TRT/Cond/StatusPermanent")
# Pixel module distortions
conddb.addFolderSplitOnline("INDET", "/Indet/Onl/PixelDist",
                            "/Indet/PixelDist")
# IBL stave distortions
conddb.addFolderSplitOnline("INDET", "/Indet/Onl/IBLDist", "/Indet/IBLDist")

# Adding protection against new dynamic folder scheme;
# In future we might want to add also to MC DB
# Solution below is not pretty but in response to JIRA ATLASSIM-2746

from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
if geoFlags.useDynamicAlignFolders():
    conddb.addFolderSplitOnline("INDET", "/Indet/Onl/AlignL1/ID",
                                "/Indet/AlignL1/ID")
    conddb.addFolderSplitOnline("INDET", "/Indet/Onl/AlignL2/PIX",
                                "/Indet/AlignL2/PIX")
    conddb.addFolderSplitOnline("INDET", "/Indet/Onl/AlignL2/SCT",
                                "/Indet/AlignL2/SCT")
    conddb.addFolderSplitOnline("INDET", "/Indet/Onl/AlignL3",
                                "/Indet/AlignL3")
    conddb.addFolderSplitOnline("TRT", "/TRT/Onl/AlignL1/TRT",
                                "/TRT/AlignL1/TRT")
    conddb.addFolderSplitOnline("TRT", "/TRT/Onl/AlignL2", "/TRT/AlignL2")
else:
    conddb.addFolderSplitOnline("INDET", "/Indet/Onl/Align", "/Indet/Align")
    conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Align", "/TRT/Align")
def Initiate(ConfInstance=None):
  """Sets up the basic global tools required for B-Tagging. This function is idempotent; it will not run again if it has run once. It is
  typically called by other functions in this file to make sure the basic global tools exist.

  The function returns True if B-Tagging is initialized or has been before. It returns False if it B-Tagging has been switched off for various
  reasons (these are checked in the checkFlagsUsingBTaggingFlags function).

  If the B-tagging calibration broker has been registered we assume initiation has already been performed; this allows users to setup their own initiation code."""

  if ConfInstance is None:
    from BTagging.BTaggingConfiguration import getConfiguration
    ConfInstance = getConfiguration()

  if ConfInstance._Initialized:
    return True
  
  from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
  # The Run() parameter only exists for ATLAS-R1(...) and ATLAS-R2(...) geo tags,
  # not for ATLAS-GEO(...) and ATLAS-IBL(...) ones. Hence if Run() is undefined,
  # presence of IBL is used to switch between Run1/Run2
  if (geoFlags.Run() == "RUN1" or (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL() == False)):
    print ConfInstance.BTagTag()+' - INFO - Setting up Run 1 configuration'
    BTaggingFlags.JetFitterNN=True
    BTaggingFlags.SV2    =True
    BTaggingFlags.JetFitterCharm=False
    
  if ConfInstance.getTool("BTagCalibrationBrokerTool"):
    print ConfInstance.BTagTag()+' - INFO - BTagCalibrationBrokerTool already exists prior to default initialization; assuming user set up entire initialization him/herself. Note however that if parts of the initalization were not set up, and a later tool requires them, they will be set up at that point automatically with default settings.'
    ConfInstance._Initialized = True
    return True

  print ConfInstance.BTagTag()+' - INFO - Initializing default basic tools'

  if ConfInstance.checkFlagsUsingBTaggingFlags():

    #Print the flags
    BTaggingFlags.Print()

    #If debugging do a check of the tool collection structure
    if(BTaggingFlags.OutputLevel < 3):
      from BTagging.BTaggingConfiguration import checkToolCollectionStructure
      checkToolCollectionStructure()

    #Get TheTruthCollectionKey from input
    TheTruthCollectionKey = 'TruthEvents'
    BTaggingFlags.RetagJets = BTaggingFlags.Jets
    if BTaggingFlags.AutoInspectInputFile:
      from AthenaCommon.GlobalFlags import globalflags
      if globalflags.InputFormat == 'pool':
        try:
          from RecExConfig.InputFilePeeker import inputFileSummary
          BTaggingFlags.RetagJets = []
          for i in inputFileSummary['eventdata_items']:
            if i[0] == 'McEventCollection':
              # TheTruthCollectionKey = i[1] # disable taking the name from the input file?
              pass
            elif i[0] == 'JetCollection':
              jetC1 = (i[1]).replace('AODJets','')
              jetC = jetC1.replace('Jets','')
              if jetC in BTaggingFlags.Jets:
                BTaggingFlags.RetagJets += [ jetC ]
        except Exception, err:
          print ConfInstance.BTagTag()+' - WARNING - Automatic inspection of input file failed (file too old?)'

    print ConfInstance.BTagTag()+' - Using ', TheTruthCollectionKey, ' as truth key'
#    print ConfInstance.BTagTag()+' - Re-tagging these jet collections: ', BTaggingFlags.RetagJets

    #
    # ============ Setup basic services
    #
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
    if not hasattr(svcMgr, 'THistSvc'):
      from GaudiSvc.GaudiSvcConf import THistSvc
      svcMgr += THistSvc()
    if not 'topSequence' in dir():
      from AthenaCommon.AlgSequence import AlgSequence
      topSequence = AlgSequence()

    # 
    # ========== Add tools now
    #
    
    # -------------- Calibration Broker --------------
    from AthenaCommon.AppMgr import ToolSvc
    from AthenaCommon.Resilience import treatException,protectedInclude
    if ConfInstance._name == "":
      protectedInclude("BTagging/BTagCalibBroker_jobOptions.py") # New file which includes the file from JetCalibration and also registers it via registerTool() so it will be recognized by the various addTool() functions.
      BTagCalibrationBrokerTool = ConfInstance.getTool("BTagCalibrationBrokerTool") # In case this variable is needed
    elif ConfInstance._name == "Trig":
      protectedInclude("BTagging/BTagCalibBroker_Trig_jobOptions.py")
      BTagCalibrationBrokerTool = ConfInstance.getTool("BTagCalibrationBrokerTool")
    else:
      print ConfInstance.BTagTag()+' - ERROR - Configuration instance "'+ConfInstance._name+'" has no calibration broker setup specified!'
      raise RuntimeError
    # -------------- \Calibration Broker --------------
    

    global BTagJetTruthMatching
    global BTagLeptonTruthTool
    global thisBTagLabeling
    # FF: disable cone-based labelling as this is now being done as a part of jet reconstruction
    BTagJetTruthMatching = None
    BTagLeptonTruthTool = None
    thisBTagLabeling = None

    # -- to label jets with truth information
    #from JetRec.JetRecFlags import jetFlags
    #if jetFlags.useTruth():
    #  # Jet Label
    #  if BTaggingFlags.jetTruthMatching == 'matchQuark' or BTaggingFlags.jetTruthMatching == 'jetTrackTruthMatching':
    #    BTagJetTruthMatching = addTool("BTagJetTruthMatching", 
    #                                   ToolSvc = ToolSvc, 
    #                                   Verbose = BTaggingFlags.OutputLevel < 3,
    #                                   options = {'subtype' : BTaggingFlags.jetTruthMatching},
    #                                   SuppressNonCloneWarning=True)        
    #    BTagJetTruthMatching.McEventCollection = TheTruthCollectionKey
    #  else:
    #    BTagJetTruthMatching = None
    #    print("#BTAG# - WARNING - BTaggingFlags.jetTruthMatching has unsupported value!")
    #  # Lepton Truth Match
    #  #BTagLeptonTruthTool = addTool('BTagLeptonTruthTool', ToolSvc = ToolSvc, Verbose = BTaggingFlags.OutputLevel < 3)
    #  #BTagLeptonTruthTool.McEventCollection = TheTruthCollectionKey
    #  BTagLeptonTruthTool = None # TEMPORARY: BTagLeptonTruthTool not implemented yet?
    #  # Labeling tool
    #  thisBTagLabeling = addTool("thisBTagLabeling", ToolSvc = ToolSvc, Verbose = BTaggingFlags.OutputLevel < 3,
    #                                        options = {'JetTruthMatchTool' : BTagJetTruthMatching,
    #                                                   #'LeptonTruthTool'   : BTagLeptonTruthTool}, TEMPORARY: BTagLeptonTruthTool not implemented yet?
    #                                                   },
    #                                        SuppressNonCloneWarning=True)
    #else:
    #  BTagJetTruthMatching = None
    #  BTagLeptonTruthTool  = None
    #  thisBTagLabeling = None
      # NOTE: These variables no longer serve any purpose, since any tool can be retrieved using getTool

    # -- for reference mode:
    if BTaggingFlags.Runmodus == 'reference':
      
      svcMgr.THistSvc.Output += ["RefFile DATAFILE='BTagCalibALL.root' OPT='RECREATE'"]
      #for key in BTaggingFlags.Jets:
      #  for tagger in ['JetProb','IP1D','IP2D','IP2DSpc','IP3D','IP3DSpc','SV1','SV2','SoftMu','SoftEl','JetFitterTagNN','JetFitterCOMBNN']:
      #    if BTaggingFlags.IsEnabled(tagger):
      #      RefileName = "BTaggingRef"+tagger+key+".root"
      #      svcMgr.THistSvc.Output += ["RefFile"+tagger+key+" DATAFILE='"+RefileName+"' OPT='RECREATE'"]

    ConfInstance._Initialized = True
    return True
Пример #19
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)
# Configuration functions for IP2DTag
# Author: Wouter van den Wollenberg (2013-2014)
from BTagging.BTaggingFlags import BTaggingFlags
from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
btagrun1 = (geoFlags.Run() == "RUN1" or (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL() == False))

metaIP2DTag = { 'IsATagger'         : True,
                'xAODBaseName'      : 'IP2D',
                'DependsOn'         : ['AtlasExtrapolator',
                                       'BTagTrackToVertexTool',
                                       'InDetVKalVxInJetTool',
                                       'BTagFullLinearizedTrackFactory',
                                       'BTagTrackToVertexIPEstimator',
                                       'IP2DDetailedTrackGradeFactory',
                                       'IP2DBasicTrackGradeFactory',
                                       'SVForIPTool_IP2D',
                                       'IP2DTrackSelector',
                                       'IP2DNewLikelihoodTool'],
                'PassByPointer'     : {'SVForIPTool'                : 'SVForIPTool_IP2D',
                                       'trackSelectorTool'          : 'IP2DTrackSelector',
                                       'trackGradeFactory'          : 'IP2DDetailedTrackGradeFactory',
#                                       'trackToVertexTool'          : 'BTagTrackToVertexTool',
                                       'TrackToVertexIPEstimator'   : 'BTagTrackToVertexIPEstimator',
                                       'LikelihoodTool'             : 'IP2DNewLikelihoodTool'},
#                'PassByName'        : {'SecVxFinderNameForV0Removal' : 'InDetVKalVxInJetTool',
#                                       'SecVxFinderNameForIPSign'    : 'InDetVKalVxInJetTool'},
#                'PassTracksAs'      : 'trackAssociation',
                'PassTracksAs'      : 'trackAssociationName',
                'JetCollectionList' : 'jetCollectionList',
                'ToolCollection'    : 'IP2DTag' }
#############rec.doApplyAODFix.set_Value_and_Lock(False)

include("RecExCommon/RecExCommon_topOptions.py")

from AthenaCommon.AlgSequence import AlgSequence
algSeq = AlgSequence()

##########################################################################################################################################################
##########################################################################################################################################################
### GEO Business 
from AthenaCommon.GlobalFlags import globalflags
print "detDescr from global flags= "+str(globalflags.DetDescrVersion)
from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
print "geoFlags.Run()   = "+geoFlags.Run()
print "geoFlags.isIBL() = "+str(  geoFlags.isIBL() )


##########################################################################################################################################################
##########################################################################################################################################################
### VD: this is if you want to re-tag with another calibration file
from BTagging.BTaggingFlags import BTaggingFlags

#### if the new file is already in the datatbase: simple edit the name
#BTaggingFlags.CalibrationTag = 'BTagCalibRUN12-08-07'

#### if you want to use your own calibration file use this part below
#BTaggingFlags.CalibrationFromLocalReplica = True
#BTaggingFlags.CalibrationFolderRoot = '/GLOBAL/BTagCalib/'
#BTaggingFlags.CalibrationTag = 'Run2DC14' ## '0801C' ##'k0002'
Пример #22
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
Пример #23
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()
Пример #24
0
    if rn is None:
        try:
            from G4AtlasApps.SimFlags import simFlags
            if simFlags.RunNumber.statusOn:
                rn = simFlags.RunNumber()
        except:
            msg.info("No SimFlags available - looks like HLT job")
    if rn is None:
        try:
            from RecExConfig.AutoConfiguration import GetRunNumber
            rn = GetRunNumber()
        except:
            msg.info("No Run Number available - assume latest cabling")

    from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
    if geoFlags.Run() == "RUN1":
        if rn > 219651:  # choose RUN2 cabling for old geometry tags starting from 26-MAR-2013
            TileCablingType = 4
            msg.warning("Forcing RUN2 cabling for run %s with geometry %s" %
                        (rn, gbltg))
    elif geoFlags.Run() == "RUN2":
        if (
                globalflags.DataSource() != 'data' and rn >= 310000
        ) or rn >= 343000 or rn < 1:  # choose RUN2a cabling for R2 geometry tags starting from 31-Jan-2018
            TileCablingType = 5
            msg.info(
                "Forcing RUN2a (2018) cabling for run %s with geometry %s" %
                (rn, gbltg))
        else:
            TileCablingType = 4
            msg.info(
Пример #25
0
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration

# Configuration functions for IP2DNegTag
# Author: Wouter van den Wollenberg (2013-2014)
from BTagging.BTaggingFlags import BTaggingFlags
from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
from IOVDbSvc.CondDB import conddb
btagrun1 = False
if conddb.dbdata == 'COMP200':
    btagrun1 = True
elif conddb.isMC:
    btagrun1 = (geoFlags.Run() == "RUN1" or
                (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL() == False))

metaIP2DNegTag = {
    'IsATagger':
    True,
    'xAODBaseName':
    'IP2DNeg',
    'DependsOn': [
        'AtlasExtrapolator', 'BTagTrackToVertexTool', 'InDetVKalVxInJetTool',
        'BTagFullLinearizedTrackFactory', 'BTagTrackToVertexIPEstimator',
        'IP2DNegNewLikelihoodTool', 'IP2DNegTrackSelector',
        'SVForIPTool_IP2DNeg', 'IP2DNegBasicTrackGradeFactory',
        'IP2DNegDetailedTrackGradeFactory'
    ],
    'PassByPointer': {
        'SVForIPTool': 'SVForIPTool_IP2DNeg',
        'trackSelectorTool': 'IP2DNegTrackSelector',
        'trackGradeFactory': 'IP2DNegDetailedTrackGradeFactory',
        #                                          'trackToVertexTool'          : 'BTagTrackToVertexTool',
def PixelCellDiscriminator(name="PixelCellDiscriminator", **kwargs):
    kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc())
    kwargs.setdefault("RndmEngine", "PixelDigitization")
    kwargs.setdefault("doITk", GeometryFlags.isSLHC())
    return CfgMgr.PixelCellDiscriminator(name, **kwargs)
        "AtlasDerivation"):
    rec.doApplyAODFix.set_Value_and_Lock(False)

include("RecExCommon/RecExCommon_topOptions.py")

from AthenaCommon.AlgSequence import AlgSequence

algSeq = AlgSequence()

### GEO Business
from AthenaCommon.GlobalFlags import globalflags

print "detDescr from global flags= " + str(globalflags.DetDescrVersion)
from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags

print "geoFlags.Run()   = " + geoFlags.Run()
print "geoFlags.isIBL() = " + str(geoFlags.isIBL())

###############################################################
### THIS is the full retagging configuration
### this is if you want to re-tag with another calibration file
from BTagging.BTaggingConfiguration import getConfiguration
from BTagging.BTaggingFlags import BTaggingFlags

#### if the new file is already in the datatbase: simple edit the name
#BTaggingFlags.CalibrationTag = 'BTagCalibRUN12-08-18'
#### if you want to use your own calibration file use this part below
if RETAG & (LocalCalibSuffix != 'WHATEVER'):
    BTaggingFlags.CalibrationFromLocalReplica = True
    BTaggingFlags.TrigCalibrationFolderRoot = '/GLOBAL/TrigBTagCalib/'
    BTaggingFlags.TrigCalibrationTag = LocalCalibSuffix
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")
    # HACK For PixelCablingSvc configuration
    # from PixelCabling.PixelCablingConf import PixelCablingSvc
    # pixelCablingSvc = PixelCablingSvc()
    # ServiceMgr += pixelCablingSvc
    # protectedInclude ("PixelCabling/SelectPixelMap.py" )
    # include.block( "PixelCabling/SelectPixelMap.py" )
    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")
    kwargs.setdefault("EnableNoise", digitizationFlags.doInDetNoise.get_Value())
    # Start of special cosmics tuning:
    if jobproperties.Beam.beamType == "cosmics":
        kwargs.setdefault("CosmicsRun", True)
        kwargs.setdefault("UseComTime", True)
    elif GeometryFlags.isSLHC():
        kwargs.setdefault("doITk", True)
        LVL1Latency = [255, 255, 255, 255, 255, 16, 255]
        ToTMinCut = [0, 0, 0, 0, 0, 0, 0]
        ApplyDupli = [0, 0, 0, 0, 0, 0, 0]
        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, 4, 4, 4, 4, 0]
        ApplyDupli = [True, True, True, True, True, True]
        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)