Exemplo n.º 1
0
def generateMuonSensitiveDetectorList():
    SensitiveDetectorList = []
    from AthenaCommon.DetFlags import DetFlags
    if DetFlags.simulate.Muon_on():
        from AthenaCommon.BeamFlags import jobproperties
        if jobproperties.Beam.beamType() == 'cosmics':
            if DetFlags.simulate.MDT_on():
                SensitiveDetectorList += ['MDTSensitiveDetectorCosmics']
            if DetFlags.simulate.RPC_on():
                SensitiveDetectorList += ['RPCSensitiveDetectorCosmics']
            if DetFlags.simulate.TGC_on():
                SensitiveDetectorList += ['TGCSensitiveDetectorCosmics']
            if MuonGeometryFlags.hasCSC() and DetFlags.simulate.CSC_on():
                SensitiveDetectorList += ['CSCSensitiveDetectorCosmics']
        else:
            if DetFlags.simulate.MDT_on():
                SensitiveDetectorList += ['MDTSensitiveDetector']
            if DetFlags.simulate.RPC_on():
                SensitiveDetectorList += ['RPCSensitiveDetector']
            if DetFlags.simulate.TGC_on():
                SensitiveDetectorList += ['TGCSensitiveDetector']
            if MuonGeometryFlags.hasCSC() and DetFlags.simulate.CSC_on():
                SensitiveDetectorList += ['CSCSensitiveDetector']
        if MuonGeometryFlags.hasSTGC() and DetFlags.simulate.sTGC_on():
            SensitiveDetectorList += ['sTGCSensitiveDetector']
        if MuonGeometryFlags.hasMM() and DetFlags.simulate.Micromegas_on():
            SensitiveDetectorList += ['MicromegasSensitiveDetector']
    return SensitiveDetectorList
Exemplo n.º 2
0
def MuidSegmentRegionRecoveryTool( name ='MuidSegmentRegionRecoveryTool', **kwargs ):
    kwargs.setdefault("Builder",  getPublicTool("CombinedMuonTrackBuilderFit") )
    import MuonCombinedRecExample.CombinedMuonTrackSummary
    from AthenaCommon.AppMgr import ToolSvc
    kwargs.setdefault("TrackSummaryTool", ToolSvc.CombinedMuonTrackSummary)

    from RegionSelector.RegSelToolConfig import makeRegSelTool_MDT, makeRegSelTool_RPC, makeRegSelTool_TGC
    kwargs.setdefault("MDTRegionSelector", makeRegSelTool_MDT())
    kwargs.setdefault("RPCRegionSelector", makeRegSelTool_RPC())
    kwargs.setdefault("TGCRegionSelector", makeRegSelTool_TGC())
    if MuonGeometryFlags.hasCSC():
        from RegionSelector.RegSelToolConfig import makeRegSelTool_CSC
        kwargs.setdefault("CSCRegionSelector", makeRegSelTool_CSC())
    else:
        kwargs.setdefault("CSCRegionSelector", "")
    if MuonGeometryFlags.hasSTGC():
        from RegionSelector.RegSelToolConfig import makeRegSelTool_sTGC
        kwargs.setdefault("STGCRegionSelector", makeRegSelTool_sTGC())
    else:
        kwargs.setdefault("STGCRegionSelector", "")
    if MuonGeometryFlags.hasMM():
        from RegionSelector.RegSelToolConfig import makeRegSelTool_MM
        kwargs.setdefault("MMRegionSelector", makeRegSelTool_MM())
    else:
        kwargs.setdefault("MMRegionSelector", "")

    return CfgMgr.Muon__MuonSegmentRegionRecoveryTool(name,**kwargs)
Exemplo n.º 3
0
    def __init__(self, name="MuonSegmentRegionRecoveryTool", **kwargs):
        #MDT conditions information not available online
        if (athenaCommonFlags.isOnline):
            kwargs.setdefault("MdtCondKey", "")
        from RegionSelector.RegSelToolConfig import makeRegSelTool_MDT, makeRegSelTool_RPC, makeRegSelTool_TGC
        kwargs.setdefault("MDTRegionSelector", makeRegSelTool_MDT())
        kwargs.setdefault("RPCRegionSelector", makeRegSelTool_RPC())
        kwargs.setdefault("TGCRegionSelector", makeRegSelTool_TGC())
        if MuonGeometryFlags.hasCSC():
            from RegionSelector.RegSelToolConfig import makeRegSelTool_CSC
            kwargs.setdefault("CSCRegionSelector", makeRegSelTool_CSC())
        else:
            kwargs.setdefault("CSCRegionSelector", "")
        if MuonGeometryFlags.hasSTGC():
            from RegionSelector.RegSelToolConfig import makeRegSelTool_sTGC
            kwargs.setdefault("STGCRegionSelector", makeRegSelTool_sTGC())
        else:
            kwargs.setdefault("STGCRegionSelector", "")
        if MuonGeometryFlags.hasMM():
            from RegionSelector.RegSelToolConfig import makeRegSelTool_MM
            kwargs.setdefault("MMRegionSelector", makeRegSelTool_MM())
        else:
            kwargs.setdefault("MMRegionSelector", "")

        self.applyUserDefaults(kwargs, name)
        super(MuonSegmentRegionRecoveryTool, self).__init__(name, **kwargs)
Exemplo n.º 4
0
def MuonPrdCacheCfg():
    # Use MuonGeometryFlags to identify which configuration is being used
    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags

    acc = ComponentAccumulator()

    MuonPRDCacheCreator = CompFactory.MuonPRDCacheCreator
    cacheCreator = MuonPRDCacheCreator(
        CscStripCacheKey=(MuonPrdCacheNames.CscStripCache
                          if MuonGeometryFlags.hasCSC() else ""),
        MdtCacheKey=MuonPrdCacheNames.MdtCache,
        CscCacheKey=(MuonPrdCacheNames.CscCache
                     if MuonGeometryFlags.hasCSC() else ""),
        RpcCacheKey=MuonPrdCacheNames.RpcCache,
        TgcCacheKey=MuonPrdCacheNames.TgcCache,
        sTgcCacheKey=(MuonPrdCacheNames.sTgcCache
                      if MuonGeometryFlags.hasSTGC() else ""),
        MmCacheKey=(MuonPrdCacheNames.MmCache
                    if MuonGeometryFlags.hasMM() else ""),
        TgcCoinCacheKey=MuonPrdCacheNames.TgcCoinCache,
        RpcCoinCacheKey=MuonPrdCacheNames.RpcCoinCache,
    )

    acc.addEventAlgo(cacheCreator, primary=True)
    return acc
Exemplo n.º 5
0
def MuonSeededSegmentFinder(name="MuonSeededSegmentFinder", **kwargs):

    if "SegmentMaker" not in kwargs or "SegmentMakerNoHoles" not in kwargs:
        if beamFlags.beamType() == 'collisions':

            segMaker = getPublicToolClone(
                "MCTBDCMathSegmentMaker",
                "DCMathSegmentMaker",
                MdtSegmentFinder="MCTBMdtMathSegmentFinder",
                SinAngleCut=0.04,
                DoGeometry=True)
        else:  # cosmics or singlebeam
            segMaker = getPublicToolClone(
                "MCTBDCMathSegmentMaker",
                "DCMathSegmentMaker",
                MdtSegmentFinder="MCTBMdtMathSegmentFinder",
                SinAngleCut=0.1,
                DoGeometry=False,
                AddUnassociatedPhiHits=True)

        kwargs.setdefault("SegmentMaker", segMaker)
        kwargs.setdefault("SegmentMakerNoHoles", segMaker)

        if not MuonGeometryFlags.hasCSC():
            kwargs.setdefault("CscPrepDataContainer", "")
        if not MuonGeometryFlags.hasSTGC():
            kwargs.setdefault("sTgcPrepDataContainer", "")
        if not MuonGeometryFlags.hasMM():
            kwargs.setdefault("MMPrepDataContainer", "")

    return CfgMgr.Muon__MuonSeededSegmentFinder(name, **kwargs)
Exemplo n.º 6
0
def MuonChamberHoleRecoveryTool(name="MuonChamberHoleRecoveryTool",
                                extraFlags=None,
                                **kwargs):
    doSegmentT0Fit = getattr(extraFlags, "doSegmentT0Fit",
                             muonRecFlags.doSegmentT0Fit())

    kwargs.setdefault("Extrapolator", "MuonExtrapolator")

    if doSegmentT0Fit:
        kwargs.setdefault("AddMeasurements", False)

    if muonRecFlags.doCSCs():
        if muonRecFlags.enableErrorTuning() or globalflags.DataSource(
        ) == 'data':
            kwargs.setdefault("CscRotCreator", "CscBroadClusterOnTrackCreator")
        else:
            kwargs.setdefault("CscRotCreator", "CscClusterOnTrackCreator")
    else:  # no CSCs
        # switch off whatever is set
        kwargs["CscRotCreator"] = ""
        kwargs["CscPrepDataContainer"] = ""

    # add in missing C++ dependency. TODO: fix in C++
    getPublicTool("ResidualPullCalculator")

    if not MuonGeometryFlags.hasSTGC():
        kwargs.setdefault("sTgcPrepDataContainer", "")
    if not MuonGeometryFlags.hasMM():
        kwargs.setdefault("MMPrepDataContainer", "")

    #MDT conditions information not available online
    if (athenaCommonFlags.isOnline):
        kwargs.setdefault("MdtCondKey", "")

    return CfgMgr.Muon__MuonChamberHoleRecoveryTool(name, **kwargs)
Exemplo n.º 7
0
def MuonStauSeededSegmentFinder( name="MuonStauSeededSegmentFinder", **kwargs ):
    kwargs.setdefault("MdtRotCreator", getPublicTool("MdtDriftCircleOnTrackCreatorStau") )
    kwargs.setdefault("SegmentMaker", getPublicTool("DCMathStauSegmentMaker") )
    kwargs.setdefault("SegmentMakerNoHoles", getPublicTool("DCMathStauSegmentMaker") )
    if not MuonGeometryFlags.hasCSC(): kwargs.setdefault("CscPrepDataContainer","")
    if not MuonGeometryFlags.hasSTGC(): kwargs.setdefault("sTgcPrepDataContainer","")
    if not MuonGeometryFlags.hasMM(): kwargs.setdefault("MMPrepDataContainer","")

    return MuonSeededSegmentFinder(name,**kwargs)
Exemplo n.º 8
0
def MuGirlStauAlg(name="MuGirlStauAlg", **kwargs):
    tools = [getPublicTool("MuonStauRecoTool")]
    kwargs.setdefault("MuonCombinedInDetExtensionTools", tools)
    kwargs.setdefault("TagMap", "stauTagMap")
    kwargs.setdefault("HasCSC", MuonGeometryFlags.hasCSC())
    kwargs.setdefault("HasSTgc", MuonGeometryFlags.hasSTGC())
    kwargs.setdefault("HasMM", MuonGeometryFlags.hasMM())
    kwargs.setdefault("CombinedTrackCollection", "MuGirlStauCombinedTracks")
    kwargs.setdefault("METrackCollection", "")
    kwargs.setdefault("SegmentCollection", "MuGirlStauSegments")
    return CfgMgr.MuonCombinedInDetExtensionAlg(name, **kwargs)
Exemplo n.º 9
0
def MuonCombinedInDetExtensionAlg(name="MuonCombinedInDetExtensionAlg",
                                  **kwargs):
    tools = []
    if muonCombinedRecFlags.doCaloTrkMuId():
        tools.append(getTool("MuonCaloTagTool"))
        kwargs.setdefault("TagMap", "caloTagMap")
    kwargs.setdefault("MuonCombinedInDetExtensionTools", tools)
    kwargs.setdefault("HasCSC", MuonGeometryFlags.hasCSC())
    kwargs.setdefault("HasSTgc", MuonGeometryFlags.hasSTGC())
    kwargs.setdefault("HasMM", MuonGeometryFlags.hasMM())
    return CfgMgr.MuonCombinedInDetExtensionAlg(name, **kwargs)
Exemplo n.º 10
0
def TMEF_MuonLayerSegmentFinderTool(name="TMEF_MuonLayerSegmentFinderTool",
                                    **kwargs):
    kwargs.setdefault('MuonRecoValidationTool', '')
    kwargs.setdefault('MuonPRDSelectionTool', 'TMEF_MuonPRDSelectionTool')
    kwargs.setdefault('MuonClusterSegmentFinder',
                      'TMEF_MuonClusterSegmentFinder')
    if not MuonGeometryFlags.hasCSC():
        kwargs.setdefault('Csc2DSegmentMaker', '')
        kwargs.setdefault('Csc4DSegmentMaker', '')
    if (MuonGeometryFlags.hasSTGC() and MuonGeometryFlags.hasMM()):
        kwargs.setdefault('NSWMuonClusterSegmentFinderTool',
                          'TMEF_MuonClusterSegmentFinderTool')
    return CfgMgr.Muon__MuonLayerSegmentFinderTool(name, **kwargs)
Exemplo n.º 11
0
def makeRegSelTool_sTGC():
    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
    from AthenaCommon.DetFlags import DetFlags
    enabled = False
    if MuonGeometryFlags.hasSTGC():
        enabled = DetFlags.detdescr.sTGC_on()
    from MuonRegionSelector.MuonRegionSelectorConf import sTGC_RegSelCondAlg
    return _makeRegSelTool("sTGC", enabled, sTGC_RegSelCondAlg)
Exemplo n.º 12
0
def makeRegSelTool_MM():
    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
    from AthenaCommon.DetFlags import DetFlags
    enabled = False
    if MuonGeometryFlags.hasMM():
        enabled = DetFlags.detdescr.Micromegas_on()
    from MuonRegionSelector.MuonRegionSelectorConf import MM_RegSelCondAlg
    return _makeRegSelTool("MM", enabled, MM_RegSelCondAlg)
Exemplo n.º 13
0
def MuonInsideOutRecoAlg(name="MuonInsideOutRecoAlg", **kwargs):
    tools = [getPublicTool("MuonInsideOutRecoTool")]
    from MuonLayerSegmentMakerTools.MuonLayerSegmentMakerToolsConf import Muon__MuonLayerSegmentFinderTool
    from AthenaCommon.AppMgr import ToolSvc
    MuonLayerSegmentFinderTool = Muon__MuonLayerSegmentFinderTool(
        "MuonLayerSegmentFinderTool",
        Csc2DSegmentMaker=(getPublicTool("Csc2dSegmentMaker")
                           if MuonGeometryFlags.hasCSC() else ""),
        Csc4DSegmentMaker=(getPublicTool("Csc4dSegmentMaker")
                           if MuonGeometryFlags.hasCSC() else ""))
    ToolSvc += MuonLayerSegmentFinderTool
    tools[0].MuonLayerSegmentFinderTool = MuonLayerSegmentFinderTool
    kwargs.setdefault("MuonCombinedInDetExtensionTools", tools)
    kwargs.setdefault("usePRDs", True)
    kwargs.setdefault("HasCSC", MuonGeometryFlags.hasCSC())
    kwargs.setdefault("HasSTgc", MuonGeometryFlags.hasSTGC())
    kwargs.setdefault("HasMM", MuonGeometryFlags.hasMM())
    kwargs.setdefault("TagMap", "muGirlTagMap")
    return CfgMgr.MuonCombinedInDetExtensionAlg(name, **kwargs)
Exemplo n.º 14
0
#### MDT ####

if DetFlags.detdescr.MDT_on():
    from MuonRegionSelector.MuonRegionSelectorConf import MDT_RegionSelectorTable
    MDT_RegionSelectorTable = MDT_RegionSelectorTable(
        name="MDT_RegionSelectorTable")

    ToolSvc += MDT_RegionSelectorTable
    print MDT_RegionSelectorTable
else:
    MDT_RegionSelectorTable = None

#### CSC ####

# could avoid first check in case DetFlags.detdescr.CSC_on() would take into account MuonGeometryFlags already
if MuonGeometryFlags.hasCSC() and DetFlags.detdescr.CSC_on():
    from MuonRegionSelector.MuonRegionSelectorConf import CSC_RegionSelectorTable
    CSC_RegionSelectorTable = CSC_RegionSelectorTable(
        name="CSC_RegionSelectorTable")

    ToolSvc += CSC_RegionSelectorTable
    print CSC_RegionSelectorTable
else:
    CSC_RegionSelectorTable = None

#### TGC ####

if DetFlags.detdescr.TGC_on():
    from MuonRegionSelector.MuonRegionSelectorConf import TGC_RegionSelectorTable
    TGC_RegionSelectorTable = TGC_RegionSelectorTable(
        name="TGC_RegionSelectorTable")
Exemplo n.º 15
0
def MuonStauChamberHoleRecoveryTool(name="MuonStauChamberHoleRecoveryTool",**kwargs):
   kwargs.setdefault("MdtRotCreator", getPublicTool("MdtDriftCircleOnTrackCreatorStau") )
   if not MuonGeometryFlags.hasCSC():
      kwargs.setdefault("CscRotCreator", "" )
      kwargs.setdefault("CscPrepDataContainer", "" )
   return MuonChamberHoleRecoveryTool(name,**kwargs)
Exemplo n.º 16
0
def MooSegmentFinderNCBAlg( name="MuonSegmentMaker_NCB",**kwargs ):
    kwargs.setdefault("SegmentFinder",getPublicToolClone("MooSegmentFinder_NCB","MuonSegmentFinder",
                                                         DoSummary=False,
                                                         Csc2dSegmentMaker = (getPublicToolClone("Csc2dSegmentMaker_NCB","Csc2dSegmentMaker",
                                                                                                 segmentTool = getPublicToolClone("CscSegmentUtilTool_NCB",
                                                                                                                                  "CscSegmentUtilTool",
                                                                                                                                  TightenChi2 = False, 
                                                                                                                                  IPconstraint=False)) if MuonGeometryFlags.hasCSC() else ""),
                                                         Csc4dSegmentMaker = (getPublicToolClone("Csc4dSegmentMaker_NCB","Csc4dSegmentMaker",
                                                                                                 segmentTool = getPublicTool("CscSegmentUtilTool_NCB")) if MuonGeometryFlags.hasCSC() else ""),
                                                         DoMdtSegments=False,DoSegmentCombinations=False,DoSegmentCombinationCleaning=False))
    kwargs.setdefault("MuonPatternCombinationLocation", "NCB_MuonHoughPatternCombinations")
    kwargs.setdefault("MuonSegmentOutputLocation", "NCB_MuonSegments")
    kwargs.setdefault("MuonSegmentOutputLocation", "NCB_MuonSegments")
    kwargs.setdefault("UseCSC", muonRecFlags.doCSCs())
    kwargs.setdefault("UseMDT", False)
    kwargs.setdefault("UseRPC", False)
    kwargs.setdefault("UseTGC", False)
    kwargs.setdefault("UseTGCPriorBC", False)
    kwargs.setdefault("UseTGCNextBC", False)
    kwargs.setdefault("doTGCClust", False)
    kwargs.setdefault("doRPCClust", False)

    return CfgMgr.MooSegmentFinderAlg(name,**kwargs)
Exemplo n.º 17
0
    def configure(self,keys=None):
        super(MuonStandalone,self).configure(keys)
        if not self.isEnabled(): return

        from AthenaCommon.BeamFlags import jobproperties
        beamFlags = jobproperties.Beam 
        SegmentLocation = "MuonSegments"
        if muonStandaloneFlags.segmentOrigin == 'TruthTracking':
            SegmentLocation = "ThirdChainSegments"

        # do the following in case of (at least one) NSW
        if (MuonGeometryFlags.hasSTGC() and MuonGeometryFlags.hasMM()):
            getPublicTool("MuonLayerHoughTool")
            self.addAlg( CfgMgr.MuonLayerHoughAlg( "MuonLayerHoughAlg", 
                PrintSummary = muonStandaloneFlags.printSummary(),
                CscPrepDataContainer = ("CSC_Clusters" if MuonGeometryFlags.hasCSC() else ""),
                sTgcPrepDataContainer = ("STGC_Measurements" if MuonGeometryFlags.hasSTGC() else ""),
                MMPrepDataContainer = ("MM_Measurements" if MuonGeometryFlags.hasMM() else "")  ) )
            if not muonStandaloneFlags.patternsOnly():
                SegmentFinder = getPublicTool("MuonClusterSegmentFinderTool")
                Cleaner = getPublicToolClone("MuonTrackCleaner_seg","MuonTrackCleaner")
                Cleaner.Extrapolator = getPublicTool("MuonStraightLineExtrapolator")
                Cleaner.Fitter = getPublicTool("MCTBSLFitterMaterialFromTrack")
                Cleaner.PullCut = 3
                Cleaner.PullCutPhi = 3
                Cleaner.UseSLFit = True
                SegmentFinder.TrackCleaner = Cleaner
            # for test purposes allow parallel running of truth segment finding and new segment finder
                MuonSegmentFinderAlg = CfgMgr.MuonSegmentFinderAlg( "MuonSegmentMaker",SegmentCollectionName=SegmentLocation, 
                                                                    MuonPatternCalibration = getPublicTool("MuonPatternCalibration"),
                                                                    MuonPatternSegmentMaker = getPublicTool("MuonPatternSegmentMaker"),
                                                                    MuonTruthSummaryTool = None,
                                                                    PrintSummary = muonStandaloneFlags.printSummary() )
                # we check whether the layout contains any CSC chamber and if yes, we check that the user also wants to use the CSCs in reconstruction
                if MuonGeometryFlags.hasCSC() and muonRecFlags.doCSCs():
                    getPublicTool("CscSegmentUtilTool")
                    getPublicTool("Csc2dSegmentMaker")
                    getPublicTool("Csc4dSegmentMaker")
                else:
                    MuonSegmentFinderAlg.Csc2dSegmentMaker = ""
                    MuonSegmentFinderAlg.Csc4dSegmentMaker = ""
                self.addAlg( MuonSegmentFinderAlg )
        else:
            getPublicTool("MuonLayerHoughTool")
            self.addAlg(MooSegmentFinderAlg("MuonSegmentMaker"))

            self.addAlg(MooSegmentFinderNCBAlg("MuonSegmentMaker_NCB"))

            if (not cfgKeyStore.isInInput ('xAOD::MuonSegmentContainer', 'MuonSegments_NCB')):
                self.addAlg( CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg_NCB",SegmentContainerName="NCB_MuonSegments",xAODContainerName="NCB_MuonSegments") )

        if (not cfgKeyStore.isInInput ('xAOD::MuonSegmentContainer', 'MuonSegments')):
            self.addAlg( CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg") )
        
        if muonStandaloneFlags.doSegmentsOnly():
            return	                    
        # Tracks builder
        #
        # add the algorithm (which uses the MuonTrackSteering)
        # 
        TrackBuilder = CfgMgr.MuPatTrackBuilder("MuPatTrackBuilder", TrackSteering = getPublicTool("MuonTrackSteering") )
        self.addAlg( TrackBuilder )
        
        self.registerOutputKey("MuonSpectrometerTracks",   self.MuPatTrackBuilder, "SpectrometerTrackOutputLocation")
        self.registerInputKey ("MuonSegments", self.MuPatTrackBuilder, "MuonSegmentCollection"   )

        
        if muonStandaloneFlags.createTrackParticles():
            xAODTrackParticleCnvAlg = MuonStandaloneTrackParticleCnvAlg("MuonStandaloneTrackParticleCnvAlg")
            self.addAlg( xAODTrackParticleCnvAlg )
Exemplo n.º 18
0
addTool("MuonRecExample.MuonRecTools.MuonRK_Propagator", "MuonRK_Propagator")
addTool("MuonRecExample.MuonRecTools.MuonSTEP_Propagator",
        "MuonSTEP_Propagator")
addTool("MuonRecExample.MuonRecTools.MuonSTEP_Propagator", "MuonPropagator")
addTool("MuonRecExample.MuonRecTools.MuonSTEP_Propagator", "MCTBPropagator")
addTool("Trk::STEP_Propagator", "MuonStraightLinePropagator")

addTool("MuonRecExample.MuonRecTools.MuonExtrapolator", "MuonExtrapolator")
addTool("MuonRecExample.MuonRecTools.MuonStraightLineExtrapolator",
        "MuonStraightLineExtrapolator")

addTool("Trk::KalmanUpdator", "MuonMeasUpdator")

addService("Muon::MuonIdHelperSvc",
           "MuonIdHelperSvc",
           HasCSC=MuonGeometryFlags.hasCSC(),
           HasSTgc=MuonGeometryFlags.hasSTGC(),
           HasMM=MuonGeometryFlags.hasMM())

addTool("Muon::MuonTrackTruthTool", "MuonTrackTruthTool")

addTool("MuonRecExample.MooreTools.MuonTrackToSegmentTool",
        "MuonTrackToSegmentTool")

addService("MuonRecExample.MuonRecTools.MuonEDMHelperSvc", "MuonEDMHelperSvc")

addTool("MuonRecExample.MuonRecTools.MuonEDMPrinterTool", "MuonEDMPrinterTool")

addTool("MuonRecExample.MuonRecTools.MuonKalmanTrackFitter",
        "MuonKalmanTrackFitter")
Exemplo n.º 19
0
jp.PerfMonFlags.doFastMon = True    # to only enable a lightweight monitoring

if hasattr(runArgs, "preExec") and runArgs.preExec != 'NONE':
    for cmd in runArgs.preExec:
        exec(cmd)

#TileFrameLength=7

from AthenaCommon.AppMgr import ServiceMgr
from AthenaCommon.GlobalFlags  import globalflags
from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
from OverlayCommonAlgs.OverlayFlags import overlayFlags

from MuonRecExample.MuonRecFlags import muonRecFlags
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
if MuonGeometryFlags.hasCSC(): muonRecFlags.doCSCs.set_Value_and_Lock(True)

from LArConditionsCommon.LArCondFlags import larCondFlags
larCondFlags.LArCoolChannelSelection.set_Value_and_Lock("")
larCondFlags.useShape.set_Value_and_Lock(True)
larCondFlags.OFCShapeFolder.set_Value_and_Lock("")

globalflags.isOverlay.set_Value_and_Lock(True)
overlayFlags.isDataOverlay.set_Value_and_Lock(True)

from AthenaCommon.BeamFlags import jobproperties
jobproperties.Beam.beamType.set_Value_and_Lock("collisions")

import AthenaCommon.AtlasUnixStandardJob #FIXME: Is this needed?

if hasattr(runArgs,"preInclude"):
Exemplo n.º 20
0
# call  setDefaults to update flags
muonRecFlags.setDefaults()

class MuPatCandidateTool(CfgMgr.Muon__MuPatCandidateTool,ConfiguredBase):
    __slots__ = ()

    def __init__(self,name='MuPatCandidateTool',**kwargs):
        self.applyUserDefaults(kwargs,name)
        if not MuonGeometryFlags.hasCSC():
            kwargs["CscRotCreator"] = ""
        super(MuPatCandidateTool,self).__init__(name,**kwargs)        


class MuPatHitTool(CfgMgr.Muon__MuPatHitTool,ConfiguredBase):
    __slots__ = ()
    
    def __init__(self,name="MuPatHitTool",**kwargs):
        self.applyUserDefaults(kwargs,name)
        if not muonRecFlags.doCSCs():
            # overwrite whatever is set
            kwargs["CscRotCreator"] = ""
        super(MuPatHitTool,self).__init__(name,**kwargs)
        getPublicTool("ResidualPullCalculator")


MuPatHitTool.setDefaultProperties(
    CscRotCreator = ("FixedErrorMuonClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else ""),
    MdtRotCreator = "MdtDriftCircleOnTrackCreatorPreFit" )
# end of class MuPatHitTool

Exemplo n.º 21
0
    def __init__(self, name="TrigMuonEFStandaloneTrackTool", **kwargs):
        super(TrigMuonEFStandaloneTrackToolConfig,
              self).__init__(name, **kwargs)

        if MuonGeometryFlags.hasCSC():
            self.CscClusterProvider = CfgGetter.getPublicTool(
                "CscThresholdClusterBuilderTool")

        self.SegmentsFinderTool = CfgGetter.getPublicToolClone(
            "TMEF_SegmentsFinderTool",
            "MooSegmentFinder",
            HoughPatternFinder=CfgGetter.getPublicTool("MuonLayerHoughTool"),
            Csc2dSegmentMaker=("Csc2dSegmentMaker/Csc2dSegmentMaker"
                               if MuonGeometryFlags.hasCSC() else ""),
            Csc4dSegmentMaker=("Csc4dSegmentMaker/Csc4dSegmentMaker"
                               if MuonGeometryFlags.hasCSC() else ""))

        CfgGetter.getPublicTool("MuonHoughPatternFinderTool").RecordAll = False
        CfgGetter.getPublicTool("MuonLayerHoughTool").DoTruth = False
        CfgGetter.getPublicTool("MooTrackFitter").SLFit = False

        self.MdtRawDataProvider = "TMEF_MdtRawDataProviderTool"
        self.CscRawDataProvider = "TMEF_CscRawDataProviderTool"
        self.RpcRawDataProvider = "TMEF_RpcRawDataProviderTool"
        self.TgcRawDataProvider = "TMEF_TgcRawDataProviderTool"

        #Need to run non-MT version of decoding tools in the trigger since the caching is not available in MT versions
        #Need different PRD container names to run offline and trigger in same jobs, but there are many tools that depend on these containers...
        #Since this is legacy code only used for validation comparisons against the Run 3 triggers, will do the not-particularly-nice solution of
        #creating containers with unique names only if we are running offline and trigger in the same jobs, and otherwise just use the default names.
        #This means that the trigger output when running the trigger as part of RAWtoESD is not 100% correct (the pattern finding uses the correct containers,
        #so it's a small effect overall anyway), but that's an use case not currently needed for trigger validation purposes
        from AthenaCommon.AppMgr import ToolSvc
        #MDT
        from MuonMDT_CnvTools.MuonMDT_CnvToolsConf import Muon__MdtRdoToPrepDataTool
        from MuonCSC_CnvTools.MuonCSC_CnvToolsConf import Muon__CscRdoToCscPrepDataTool
        from MuonTGC_CnvTools.MuonTGC_CnvToolsConf import Muon__TgcRdoToPrepDataTool
        from MuonRPC_CnvTools.MuonRPC_CnvToolsConf import Muon__RpcRdoToPrepDataTool
        MdtRdoToMdtPrepDataTool = Muon__MdtRdoToPrepDataTool(
            name="TrigEFMdtRdoToPrepDataTool")
        CscRdoToCscPrepDataTool = Muon__CscRdoToCscPrepDataTool(
            name="TrigEFCscRdoToPrepDataTool")
        TgcRdoToTgcPrepDataTool = Muon__TgcRdoToPrepDataTool(
            name="TrigEFTgcRdoToPrepDataTool")
        RpcRdoToRpcPrepDataTool = Muon__RpcRdoToPrepDataTool(
            name="TrigEFRpcRdoToPrepDataTool")
        if not rec.doRDOTrigger and rec.doESD:
            MdtRdoToMdtPrepDataTool.OutputCollection = "TrigMDT_DriftCircles"
            CscRdoToCscPrepDataTool.OutputCollection = "TrigCSC_Measurements"
            TgcRdoToTgcPrepDataTool.OutputCollection = "TrigTGC_Measurements"
            TgcRdoToTgcPrepDataTool.OutputCoinCollection = "TrigerT1CoinDataCollection"
            RpcRdoToRpcPrepDataTool.TriggerOutputCollection = "TrigRPC_Measurements"
            #InputCollection is really the output RPC coin collection...
            RpcRdoToRpcPrepDataTool.InputCollection = "TrigRPC_triggerHits"
        else:
            MdtRdoToMdtPrepDataTool.OutputCollection = "MDT_DriftCircles"
            CscRdoToCscPrepDataTool.OutputCollection = "CSC_Measurements"
            TgcRdoToTgcPrepDataTool.OutputCollection = "TGC_Measurements"
            TgcRdoToTgcPrepDataTool.OutputCoinCollection = "TrigT1CoinDataCollection"
            RpcRdoToRpcPrepDataTool.TriggerOutputCollection = "RPC_Measurements"
            RpcRdoToRpcPrepDataTool.InputCollection = "RPC_triggerHits"

        ToolSvc += MdtRdoToMdtPrepDataTool
        self.MdtPrepDataContainer = MdtRdoToMdtPrepDataTool.OutputCollection
        self.MdtPrepDataProvider = MdtRdoToMdtPrepDataTool
        #CSC
        ToolSvc += CscRdoToCscPrepDataTool
        self.CscPrepDataProvider = CscRdoToCscPrepDataTool
        #We use the clusters not the PRD hits directly for CSCs
        self.CscPrepDataContainer = "CSC_Clusters"
        #TGC
        ToolSvc += TgcRdoToTgcPrepDataTool
        self.TgcPrepDataProvider = TgcRdoToTgcPrepDataTool
        self.TgcPrepDataContainer = TgcRdoToTgcPrepDataTool.OutputCollection
        #RPC
        ToolSvc += RpcRdoToRpcPrepDataTool
        self.RpcPrepDataProvider = RpcRdoToRpcPrepDataTool
        self.RpcPrepDataContainer = RpcRdoToRpcPrepDataTool.TriggerOutputCollection

        self.DecodeMdtBS = DetFlags.readRDOBS.MDT_on()
        self.DecodeRpcBS = DetFlags.readRDOBS.RPC_on()
        self.DecodeTgcBS = DetFlags.readRDOBS.TGC_on()
        if MuonGeometryFlags.hasCSC():
            self.DecodeCscBS = DetFlags.readRDOBS.CSC_on()

        # use seeded decoding
        if (TriggerFlags.MuonSlice.doEFRoIDrivenAccess()):
            self.useMdtSeededDecoding = True
            self.useRpcSeededDecoding = True
            self.useTgcSeededDecoding = True
            if MuonGeometryFlags.hasCSC(): self.useCscSeededDecoding = True

            # use ROB based seeded decoding instead of PRD based
            self.useTgcRobDecoding = False  # neither available nor needed
            self.useCscRobDecoding = False  # neither available nor needed

        self.useRpcData = muonRecFlags.doRPCs()
        self.useTgcData = muonRecFlags.doTGCs()
        self.useCscData = muonRecFlags.doCSCs()
        # to select barrel(useMdtData=2), endcap(useMdtData=3)
        if muonRecFlags.doMDTs():
            self.useMdtData = 1
        else:
            self.useMdtData = 0

        self.useTGCInPriorNextBC = False

        self.doTimeOutChecks = False
        self.doTimeOutGuard = False
        self.maxTgcHits = 0
        self.maxCscHits = 0
        self.maxRpcHits = 0
        self.maxMdtHits = 0
        self.doCache = True
        self.IgnoreMisalginedCSCs = False

        self.TrackBuilderTool = "TMEF_TrackBuilderTool"
        self.TrkSummaryTool = "TMEF_TrackSummaryTool"
        self.MuonCandidateTool = "TMEF_MuonCandidateTool"

        self.TrackToTrackParticleConvTool = "MuonParticleCreatorTool"

        import MuonCondAlg.MdtCondDbAlgConfig  # noqa: F401 (MDT conditions, needed for the MuonStationIntersectSvc)
Exemplo n.º 22
0
    ToolSvc += muonErrorScaleDbTool
    muonErrorScalingTool = Muon__MuonRIO_OnTrackErrorScalingTool(
        "MuonRIO_OnTrackErrorScalingTool",
        OutputLevel=align.OutputLevel(),
        ErrorScaleDbTool=muonErrorScaleDbTool)
    ToolSvc += muonErrorScalingTool

    from MuonRecExample import MuonRecTools
    MdtDriftCircleOnTrackCreator = MuonRecTools.getPublicTool(
        "MdtDriftCircleOnTrackCreator")
    MdtDriftCircleOnTrackCreator.DoErrorScaling = True
    MdtDriftCircleOnTrackCreator.OutputLevel = align.OutputLevel()
    MdtDriftCircleOnTrackCreator.ErrorScalingTool = muonErrorScalingTool

    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
    if MuonGeometryFlags.hasCSC():
        CscClusterOnTrackCreator = MuonRecTools.getPublicTool(
            "CscClusterOnTrackCreator")
        CscClusterOnTrackCreator.DoErrorScaling = True
        CscClusterOnTrackCreator.OutputLevel = align.OutputLevel()
        CscClusterOnTrackCreator.ErrorScalingTool = muonErrorScalingTool

    MuonClusterOnTrackCreator = MuonRecTools.getPublicTool(
        "MuonClusterOnTrackCreator")
    MuonClusterOnTrackCreator.DoErrorScaling = True
    MuonClusterOnTrackCreator.OutputLevel = align.OutputLevel()
    MuonClusterOnTrackCreator.ErrorScalingTool = muonErrorScalingTool

try:
    doSetup
    doSetup()
Exemplo n.º 23
0
    from MuonCombinedRecExample import MuonCombinedCalibConfig

#--------------------------------------------------------------------------
# Do track truth
#--------------------------------------------------------------------------
if rec.doTruth() and muonCombinedRecFlags.doxAOD() and rec.doMuonCombined():

    from MuonTruthAlgs.MuonTruthAlgsConf import MuonDetailedTrackTruthMaker
    from TrkTruthAlgs.TrkTruthAlgsConf import TrackTruthSelector

    colsTP = [ "ExtrapolatedMuonTrackParticles", "CombinedMuonTrackParticles", "MSOnlyExtrapolatedMuonTrackParticles" ]
    cols = [ "ExtrapolatedMuonTracks", "CombinedMuonTracks", "MSOnlyExtrapolatedTracks" ]
    topSequence+= MuonDetailedTrackTruthMaker("MuonCombinedDetailedTrackTruthMaker")
    topSequence.MuonCombinedDetailedTrackTruthMaker.TrackCollectionNames = cols 
    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
    topSequence.MuonCombinedDetailedTrackTruthMaker.HasCSC = MuonGeometryFlags.hasCSC()
    topSequence.MuonCombinedDetailedTrackTruthMaker.HasSTgc = MuonGeometryFlags.hasSTGC()
    topSequence.MuonCombinedDetailedTrackTruthMaker.HasMM = MuonGeometryFlags.hasMM()
        
    from TrkTruthAlgs.TrkTruthAlgsConf import TrackParticleTruthAlg
    for i in range(0, len(cols)):
        topSequence += TrackTruthSelector(name= cols[i] + "Selector",
                                          DetailedTrackTruthName   = cols[i] + "DetailedTruth",
                                          OutputName               = cols[i] + "Truth" )
        topSequence += TrackParticleTruthAlg(name = cols[i]+"TruthAlg",
                                             TrackTruthName=cols[i]+"Truth",
                                             TrackParticleName = colsTP[i] )
        
    from MuonTruthAlgs.MuonTruthAlgsConf import MuonTruthAssociationAlg
    topSequence += MuonTruthAssociationAlg("MuonTruthAssociationAlg")
Exemplo n.º 24
0
include.block("MuonByteStreamCnvTest/jobOptions_MuonRDOToDigit.py")

from AthenaCommon.CfgGetter import getPublicTool

from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags

## configure the tool

from MuonByteStreamCnvTest.MuonByteStreamCnvTestConf import MuonRdoToMuonDigitTool
MuonRdoToMuonDigitTool = MuonRdoToMuonDigitTool(
    DecodeMdtRDO=True,
    DecodeRpcRDO=True,
    DecodeTgcRDO=True,
    DecodeCscRDO=MuonGeometryFlags.hasCSC(),
    DecodeSTGC_RDO=MuonGeometryFlags.hasSTGC(),
    DecodeMM_RDO=MuonGeometryFlags.hasMM(),
    cscRdoDecoderTool=("Muon::CscRDO_Decoder"
                       if MuonGeometryFlags.hasCSC() else ""),
    stgcRdoDecoderTool=("Muon::STGC_RDO_Decoder"
                        if MuonGeometryFlags.hasSTGC() else ""),
    mmRdoDecoderTool=("Muon::MM_RDO_Decoder"
                      if MuonGeometryFlags.hasMM() else ""))

if MuonGeometryFlags.hasCSC():
    MuonRdoToMuonDigitTool.cscCalibTool = getPublicTool("CscCalibTool")

ToolSvc += MuonRdoToMuonDigitTool

## configure the algorithm
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
Exemplo n.º 25
0
include.block("ISF_Config/AllDet_detDescr.py")
# also block alternatives
include.block("RecExCond/AllDet_detDescr.py")
include.block("RecExCommon/AllDet_detDescr.py")

from AthenaCommon.Resilience import protectedInclude
from AthenaCommon.DetFlags import DetFlags
if DetFlags.detdescr.any_on():
    from AtlasGeoModel import SetGeometryVersion
    from AtlasGeoModel import GeoModelInit
    from AtlasGeoModel import SetupRecoGeometry

    import os
    if "AthSimulation_DIR" not in os.environ:
        if DetFlags.detdescr.LAr_on():
            protectedInclude("LArDetDescr/LArDetDescr_joboptions.py")

        if DetFlags.detdescr.Tile_on():
            protectedInclude("TileConditions/TileConditions_jobOptions.py")

        if DetFlags.detdescr.Muon_on():
            protectedInclude("AmdcAth/AmdcAth_jobOptions.py")

    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
    if not MuonGeometryFlags.hasCSC():
        DetFlags.CSC_setOff()

    # MagneticField Service
    if DetFlags.detdescr.BField_on():
        import MagFieldServices.SetupField
Exemplo n.º 26
0
include.block('RecBackgroundAlgs/RecBackground_jobOptions.py')

from RecExConfig.RecFlags import rec
from AthenaCommon.DetFlags import DetFlags
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags

if rec.doInDet() and rec.doMuon() and rec.doCalo() and \
    DetFlags.detdescr.Muon_on() and DetFlags.detdescr.Calo_on() and DetFlags.detdescr.ID_on() :
    include("LArCellRec/LArCollisionTime_jobOptions.py")
    from RecBackgroundAlgs.RecBackgroundAlgsConf import BeamBackgroundFiller
    BeamBackgroundFiller = BeamBackgroundFiller(cscSegmentContainerKey=(
        "NCB_MuonSegments" if MuonGeometryFlags.hasCSC() else ""))
    topSequence += BeamBackgroundFiller

    from BCM_BackgroundAlgs.BCM_BackgroundAlgsConf import BcmCollisionTimeAlg
    BcmCollisionTimeAlg = BcmCollisionTimeAlg()
    topSequence += BcmCollisionTimeAlg

    from RecBackgroundAlgs.RecBackgroundAlgsConf import BackgroundWordFiller
    BackgroundWordFiller = BackgroundWordFiller()
    topSequence += BackgroundWordFiller
    BackgroundWordFiller.IsMC = (globalflags.DataSource.get_Value() != 'data')
Exemplo n.º 27
0
    def _do_external(self):
        """Place to handle the external services: GeoModel, IOVDb,
           frozen showers, etc
        """
        AtlasG4Eng.G4Eng.log.verbose(
            'AtlasSimSkeleton._do_external :: starting')
        from AthenaCommon.AppMgr import ToolSvc, ServiceMgr
        from Geo2G4.Geo2G4Conf import Geo2G4Svc
        geo2G4Svc = Geo2G4Svc()
        theApp.CreateSvc += ["Geo2G4Svc"]
        ServiceMgr += geo2G4Svc
        ## Enable top transforms for the ATLAS geometry
        geo2G4Svc.GetTopTransform = True

        ## Configure access to the BeamCondSvc if necessary.  Assuming
        ## it should be on always as BeamEffectTransformation is
        ## currently always switched on, else something like this will
        ## be required here.
        from G4AtlasApps.SimFlags import simFlags
        include("InDetBeamSpotService/BeamCondSvc.py")

        ## GeoModel stuff
        ## TODO: Tidy imports etc.
        from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
        from AthenaCommon.GlobalFlags import jobproperties
        from AtlasGeoModel import SetGeometryVersion

        ## Forward Region Twiss files - needed before geometry setup!
        if simFlags.ForwardDetectors.statusOn:
            if DetFlags.geometry.FwdRegion_on():
                from AthenaCommon.CfgGetter import getPublicTool
                from AthenaCommon.AppMgr import ToolSvc
                ToolSvc += getPublicTool("ForwardRegionProperties")

        from AtlasGeoModel import GeoModelInit
        from AtlasGeoModel import SimEnvelopes
        from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
        gms = GeoModelSvc()
        ## Cosmics GeoModel tweaks
        if jobproperties.Beam.beamType() == 'cosmics' or \
           (simFlags.CavernBG.statusOn and not 'Signal' in simFlags.CavernBG.get_Value() ):
            from CavernInfraGeoModel.CavernInfraGeoModelConf import CavernInfraDetectorTool
            gms.DetectorTools += [CavernInfraDetectorTool()]
        ## Protects GeoModelSvc in the simulation from the AlignCallbacks
        gms.AlignCallbacks = False
        ## Muon GeoModel tweaks
        if DetFlags.Muon_on():
            ## Turn off caching in the muon system
            from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool
            MuonDetectorTool = MuonDetectorTool()
            MuonDetectorTool.FillCacheInitTime = 0  # default is 1

            ## Additional material in the muon system
            from AGDD2GeoSvc.AGDD2GeoSvcConf import AGDDtoGeoSvc
            AGDD2Geo = AGDDtoGeoSvc()
            from AthenaCommon import CfgGetter
            if not "MuonAGDDTool/MuonSpectrometer" in AGDD2Geo.Builders:
                ToolSvc += CfgGetter.getPublicTool("MuonSpectrometer",
                                                   checkType=True)
                AGDD2Geo.Builders += ["MuonAGDDTool/MuonSpectrometer"]
            from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
            if (MuonGeometryFlags.hasSTGC() and MuonGeometryFlags.hasMM()):
                if not "NSWAGDDTool/NewSmallWheel" in AGDD2Geo.Builders:
                    ToolSvc += CfgGetter.getPublicTool("NewSmallWheel",
                                                       checkType=True)
                    AGDD2Geo.Builders += ["NSWAGDDTool/NewSmallWheel"]
            theApp.CreateSvc += ["AGDDtoGeoSvc"]
            ServiceMgr += AGDD2Geo

        ## Add configured GeoModelSvc to service manager
        ServiceMgr += gms

        ## Run the geometry envelope setup earlier than GeoSD
        self._do_GeoEnv()  #TODO remove
        AtlasG4Eng.G4Eng.log.verbose('AtlasSimSkeleton._do_external :: done')
Exemplo n.º 28
0
    job.G4TestAlg.SimTestTools += [
        CfgGetter.getPrivateTool("TileInactiveCellCaloCalibHitsTestTool",
                                 checkType=True)
    ]
    ##job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("TileDeadMaterialCaloCalibHitsTestTool", checkType=True)]
if DetFlags.Muon_on():
    job.G4TestAlg.SimTestTools += [
        CfgGetter.getPrivateTool("MDTHitsTestTool", checkType=True)
    ]
    job.G4TestAlg.SimTestTools += [
        CfgGetter.getPrivateTool("RPCHitsTestTool", checkType=True)
    ]
    job.G4TestAlg.SimTestTools += [
        CfgGetter.getPrivateTool("TGCHitsTestTool", checkType=True)
    ]
    if MuonGeometryFlags.hasCSC():
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("CSCHitsTestTool", checkType=True)
        ]
    if MuonGeometryFlags.hasMM():
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("MMHitsTestTool", checkType=True)
        ]
    if MuonGeometryFlags.hasSTGC():
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("sTGCHitsTestTool", checkType=True)
        ]
    if DetFlags.Truth_on():
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("MuonEntryLayerTestTool", checkType=True)
        ]
Exemplo n.º 29
0
 def __init__(self,name='MuPatCandidateTool',**kwargs):
     self.applyUserDefaults(kwargs,name)
     if not MuonGeometryFlags.hasCSC():
         kwargs["CscRotCreator"] = ""
     super(MuPatCandidateTool,self).__init__(name,**kwargs)        
Exemplo n.º 30
0
    def _do_jobproperties(self):
        """
        Place to handle JobProperties.
        """

        ## Import extra flags if it hasn't already been done
        from G4AtlasApps.SimFlags import simFlags
        if "atlas_flags" not in simFlags.extra_flags:
            simFlags.load_atlas_flags()
        if jobproperties.Beam.beamType(
        ) == "cosmics" and "cosmics_flags" not in simFlags.extra_flags:
            simFlags.load_cosmics_flags()

        AtlasG4Eng.G4Eng.log.verbose(
            'AtlasSimSkeleton._do_jobproperties :: starting')

        ## Tidy up DBM DetFlags: temporary measure
        DetFlags.DBM_setOff()

        from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
        if not MuonGeometryFlags.hasCSC(): DetFlags.CSC_setOff()
        if not MuonGeometryFlags.hasSTGC(): DetFlags.sTGC_setOff()
        if not MuonGeometryFlags.hasMM(): DetFlags.Micromegas_setOff()

        ## Switch off tasks
        DetFlags.pileup.all_setOff()
        DetFlags.simulateLVL1.all_setOff()
        DetFlags.digitize.all_setOff()
        if not simFlags.IsEventOverlayInputSim():
            DetFlags.overlay.all_setOff()
        DetFlags.readRDOPool.all_setOff()
        DetFlags.makeRIO.all_setOff()
        DetFlags.writeBS.all_setOff()
        DetFlags.readRDOBS.all_setOff()
        DetFlags.readRIOBS.all_setOff()
        DetFlags.readRIOPool.all_setOff()
        DetFlags.writeRIOPool.all_setOff()
        DetFlags.writeRDOPool.all_setOff()

        ## Global flags needed by externals
        from AthenaCommon.GlobalFlags import globalflags
        globalflags.DataSource = 'geant4'
        if jobproperties.Beam.beamType() == 'cosmics':
            globalflags.DetGeo = 'commis'
        else:
            globalflags.DetGeo = 'atlas'

        ## At this point we can set the global job properties flag
        globalflags.DetDescrVersion = simFlags.SimLayout.get_Value()

        # Switch off GeoModel Release in the case of parameterization
        if simFlags.LArParameterization.get_Value(
        ) > 0 and simFlags.ReleaseGeoModel():
            AtlasG4Eng.G4Eng.log.info(
                'AtlasSimSkeleton._do_jobproperties :: Running parameterization - switching off GeoModel release!'
            )
            simFlags.ReleaseGeoModel = False

        ## Translate conditions tag into IOVDbSvc global tag: must be done before job properties are locked!!!
        from AthenaCommon.AppMgr import ServiceMgr
        from IOVDbSvc.IOVDbSvcConf import IOVDbSvc
        ServiceMgr += IOVDbSvc()
        if not hasattr(
                globalflags,
                "ConditionsTag") or not globalflags.ConditionsTag.get_Value():
            msg = "AtlasSimSkeleton._do_jobproperties :: conditions tag has not been set and is no longer guessed by SimAtlasKernel. "
            msg += "You must set the globaltags.ConditionsTag flag in your job options."
            AtlasG4Eng.G4Eng.log.error(msg)
            raise SystemExit(
                "AtlasSimSkeleton._do_jobproperties :: Global ConditionsTag not set"
            )
        if not hasattr(ServiceMgr.IOVDbSvc,
                       'GlobalTag') or not ServiceMgr.IOVDbSvc.GlobalTag:
            ServiceMgr.IOVDbSvc.GlobalTag = globalflags.ConditionsTag.get_Value(
            )

        ## Enable floating point exception handling
        ## FIXME! This seems to cause the jobs to crash in the FpeControlSvc, so commenting this out for now...
        #from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        #athenaCommonFlags.RuntimeStrictness = 'abort'
        #AtlasG4Eng.G4Eng.log.debug('AtlasSimSkeleton._do_jobproperties :: Enabled floating point exceptions')

        if not simFlags.ISFRun:
            from G4AtlasApps.G4Atlas_Metadata import checkForSpecialConfigurationMetadata
            checkForSpecialConfigurationMetadata()

        ## Print flags
        if AtlasG4Eng.G4Eng.log.getEffectiveLevel() < 40:
            AtlasG4Eng.G4Eng.log.info(
                'AtlasSimSkeleton._do_jobproperties :: printing detector flags DetFlags'
            )
            DetFlags.Print()
            AtlasG4Eng.G4Eng.log.info(
                'AtlasSimSkeleton._do_jobproperties :: printing simulation flags simFlags'
            )
            jobproperties.print_JobProperties('tree&value')

        # Lock the job properties if not running ISF.
        if not simFlags.ISFRun:
            jobproperties.lock_JobProperties()
        AtlasG4Eng.G4Eng.log.verbose(
            'AtlasSimSkeleton._do_jobproperties :: done')