Esempio n. 1
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
Esempio n. 2
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
Esempio 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)
Esempio n. 4
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)
Esempio 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)
Esempio n. 6
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)
Esempio n. 7
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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio n. 11
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
Esempio n. 12
0
def MuonIdHelperSvc(name="MuonIdHelperSvc", **kwargs):
    from MuonIdHelpers.MuonIdHelpersConf import Muon__MuonIdHelperSvc
    kwargs.setdefault("HasCSC", MuonGeometryFlags.hasCSC())
    kwargs.setdefault("HasSTgc", MuonGeometryFlags.hasSTGC())
    kwargs.setdefault("HasMM", MuonGeometryFlags.hasMM())
    return Muon__MuonIdHelperSvc(name, **kwargs)
Esempio n. 13
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")
Esempio n. 14
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)
Esempio 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)
Esempio n. 16
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

Esempio n. 17
0
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()

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

from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
if not MuonGeometryFlags.hasSTGC(): DetFlags.sTGC_setOff()
if not MuonGeometryFlags.hasMM(): DetFlags.Micromegas_setOff()
if not MuonGeometryFlags.hasCSC(): DetFlags.CSC_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()
Esempio n. 18
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')
Esempio n. 19
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)
        ]
Esempio n. 20
0
    DetFlags.Muon_setOn()
    DetFlags.LAr_setOn()
    DetFlags.Tile_setOn()
    DetFlags.BCM_setOn()
    DetFlags.Lucid_setOn()
    DetFlags.Truth_setOn()

    if hasattr(runArgs, "triggerConfig") and runArgs.triggerConfig == "NONE":
        DetFlags.LVL1_setOff()
    else:
        DetFlags.LVL1_setOn()

    DetFlags.digitize.LVL1_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()

DetFlags.pileup.all_setOff()
DetFlags.readRDOBS.all_setOff()
DetFlags.readRDOPool.all_setOff()
DetFlags.readRIOBS.all_setOff()
DetFlags.readRIOPool.all_setOff()
DetFlags.simulate.all_setOff()
DetFlags.writeBS.all_setOff()
DetFlags.writeRIOPool.all_setOff()

DetFlags.Print()

globalflags.DataSource.set_Value_and_Lock('geant4')
Esempio 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)
Esempio n. 22
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")
Esempio n. 23
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')
Esempio n. 24
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")
Esempio n. 25
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"):
Esempio n. 26
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()
Esempio n. 27
0
# initialize the geometry
#######################################
from AthenaCommon.GlobalFlags import jobproperties

jobproperties.Global.DetDescrVersion = "ATLAS-R3S-2021-01-00-00"
from AtlasGeoModel import SetGeometryVersion
from AtlasGeoModel import GeoModelInit
from GeoModelSvc.GeoModelSvcConf import GeoModelSvc

GeoModelSvc = GeoModelSvc()
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
# initialize the MuonIdHelperService
from MuonIdHelpers.MuonIdHelpersConf import Muon__MuonIdHelperSvc

svcMgr += Muon__MuonIdHelperSvc("MuonIdHelperSvc",
                                HasCSC=MuonGeometryFlags.hasCSC(),
                                HasSTgc=MuonGeometryFlags.hasSTGC(),
                                HasMM=MuonGeometryFlags.hasMM())
# create the MuonDetectorTool (which creates the MuonDetectorManager needed by PadTdsOfflineTool)
from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool

GeoModelSvc.DetectorTools += [
    MuonDetectorTool(HasCSC=MuonGeometryFlags.hasCSC(),
                     HasSTgc=MuonGeometryFlags.hasSTGC(),
                     HasMM=MuonGeometryFlags.hasMM())
]
#######################################

#######################################
# now the trigger related things
#######################################
Esempio n. 28
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 )
Esempio 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)        
Esempio n. 30
0
    def hits_persistency():
        """ HITS POOL file persistency
        """
        from G4AtlasApps.SimFlags import simFlags
        from AthenaCommon.DetFlags import DetFlags
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream

        ## Not yet understood, but need to treat StreamHITS as alg in Hive.
        ## Seems to also work fine outside of Hive, but to be extra safe I'm
        ## only changing it in Hive.
        from AthenaCommon.ConcurrencyFlags import jobproperties as concurrencyProps
        if concurrencyProps.ConcurrencyFlags.NumThreads() > 0:
            as_alg = True
        else:
            as_alg = False
        ## NB. Two-arg constructor is needed, since otherwise metadata writing fails!
        stream1 = AthenaPoolOutputStream("StreamHITS",
                                         athenaCommonFlags.PoolHitsOutput(),
                                         asAlg=as_alg,
                                         noTag=True)

        ## Write geometry tag info - move to main method
        #import EventInfoMgt.EventInfoMgtInit

        ## EventInfo & TruthEvent always written by default
        stream1.ItemList = [
            "EventInfo#*", "McEventCollection#TruthEvent", "JetCollection#*"
        ]

        ## If we are running quasi-stable particle simulation, include the original event record
        if hasattr(
                simFlags, 'IncludeParentsInG4Event'
        ) and simFlags.IncludeParentsInG4Event.statusOn and simFlags.IncludeParentsInG4Event(
        ):
            stream1.ItemList += ["McEventCollection#GEN_EVENT"]

        stream1.ItemList += ["xAOD::JetContainer#*", "xAOD::JetAuxContainer#*"]

        ## Make stream aware of aborted events
        stream1.AcceptAlgs = ["G4AtlasAlg"]

        ## Detectors

        ## Inner Detector
        if DetFlags.ID_on():
            stream1.ItemList += [
                "SiHitCollection#*", "TRTUncompressedHitCollection#*",
                "TrackRecordCollection#CaloEntryLayer"
            ]
        ## Calo
        if DetFlags.Calo_on():
            stream1.ItemList += [
                "CaloCalibrationHitContainer#*",
                "LArHitContainer#*",
                "TileHitVector#*",
                #"SimpleScintillatorHitCollection#*",
                "TrackRecordCollection#MuonEntryLayer"
            ]
        ## Muon
        if DetFlags.Muon_on():
            stream1.ItemList += [
                "RPCSimHitCollection#*", "TGCSimHitCollection#*",
                "MDTSimHitCollection#*", "TrackRecordCollection#MuonExitLayer"
            ]
            if MuonGeometryFlags.hasCSC():
                stream1.ItemList += ["CSCSimHitCollection#*"]
            if MuonGeometryFlags.hasSTGC():
                stream1.ItemList += ["sTGCSimHitCollection#*"]
            if MuonGeometryFlags.hasMM():
                stream1.ItemList += ["MMSimHitCollection#*"]

        ## Lucid
        if DetFlags.Lucid_on():
            stream1.ItemList += ["LUCID_SimHitCollection#*"]

        ## FwdRegion
        if DetFlags.FwdRegion_on():
            stream1.ItemList += ["SimulationHitCollection#*"]

        ## ZDC
        if DetFlags.ZDC_on():
            stream1.ItemList += [
                "ZDC_SimPixelHit_Collection#*", "ZDC_SimStripHit_Collection#*"
            ]
        ## ALFA
        if DetFlags.ALFA_on():
            stream1.ItemList += [
                "ALFA_HitCollection#*", "ALFA_ODHitCollection#*"
            ]

        ## AFP
        if DetFlags.AFP_on():
            stream1.ItemList += [
                "AFP_TDSimHitCollection#*", "AFP_SIDSimHitCollection#*"
            ]

        ### Ancillary scintillators
        #stream1.ItemList += ["ScintillatorHitCollection#*"]

        ## TimingAlg
        stream1.ItemList += ["RecoTimingObj#EVNTtoHITS_timings"]

        ## Add cosmics and test beam configuration hit persistency if required cf. geom tag
        layout = simFlags.SimLayout.get_Value()
        if "tb" not in layout:
            from AthenaCommon.BeamFlags import jobproperties
            if jobproperties.Beam.beamType() == 'cosmics' or \
                    (hasattr(simFlags, "WriteTR") and simFlags.WriteTR.statusOn) or \
                    (hasattr(simFlags, "ReadTR") and simFlags.ReadTR.statusOn):
                stream1.ItemList += [
                    "TrackRecordCollection#CosmicRecord",
                    "TrackRecordCollection#CosmicPerigee"
                ]
        else:
            ## CTB-specific
            if layout.startswith("ctb"):
                if simFlags.LArFarUpstreamMaterial.statusOn and simFlags.LArFarUpstreamMaterial.get_Value(
                ):
                    stream1.ItemList.append(
                        "TrackRecordCollection#LArFarUpstreamMaterialExitLayer"
                    )
            ## Persistency of test-beam layout
            if layout.startswith('ctb') or layout.startswith('tb_Tile2000_'):
                stream1.ItemList += ["TBElementContainer#*"]