Ejemplo n.º 1
0
def InDetGlobalChi2FitterBase(name='GlobalChi2FitterBase', **kwargs):
    from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc
    from InDetRecExample.TrackingCommon import setDefaults
    from AthenaCommon.AppMgr import ToolSvc
    from InDetRecExample.InDetJobProperties import InDetFlags
    import InDetRecExample.TrackingCommon as TrackingCommon

    kwargs = setDefaults(
        kwargs,
        ExtrapolationTool=TrackingCommon.getInDetExtrapolator(),
        NavigatorTool=TrackingCommon.getInDetNavigator(),
        PropagatorTool=TrackingCommon.getInDetPropagator(),
        MultipleScatteringTool=TrackingCommon.
        getInDetMultipleScatteringUpdator(),
        MeasurementUpdateTool=ToolSvc.InDetUpdator,
        TrackingGeometrySvc=AtlasTrackingGeometrySvc,
        MaterialUpdateTool=TrackingCommon.getInDetMaterialEffectsUpdator(),
        StraightLine=not InDetFlags.solenoidOn(),
        OutlierCut=4,
        SignedDriftRadius=True,
        ReintegrateOutliers=True,
        RecalibrateSilicon=True,
        RecalibrateTRT=True,
        TRTTubeHitCut=
        1.75,  # use tighter hit classification, old: TrackingCommon.default_ScaleHitUncertainty
        MaxIterations=40,
        Acceleration=True,
        RecalculateDerivatives=InDetFlags.doMinBias()
        or InDetFlags.doCosmics() or InDetFlags.doBeamHalo(),
        TRTExtensionCuts=True,
        TrackChi2PerNDFCut=7)
    from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter
    return Trk__GlobalChi2Fitter(name, **kwargs)
Ejemplo n.º 2
0
def InDetGlobalChi2FitterLowPt(name='InDetGlobalChi2FitterLowPt', **kwargs):
    # @TODO TrackingGeometrySvc was not set but is set now
    #       RotCreatorTool and BroadRotCreatorTool not set
    split_cluster_map_extension = kwargs.pop('SplitClusterMapExtension', '')

    from InDetRecExample import TrackingCommon as TrackingCommon
    if 'RotCreatorTool' not in kwargs:
        kwargs = setDefaults(
            kwargs,
            RotCreatorTool=TrackingCommon.getInDetRotCreator(
                nameSuffix=split_cluster_map_extension,
                SplitClusterMapExtension=split_cluster_map_extension))

    from InDetRecExample.InDetJobProperties import InDetFlags
    use_broad_cluster_any = InDetFlags.useBroadClusterErrors() and (
        not InDetFlags.doDBMstandalone())
    if 'BroadRotCreatorTool' not in kwargs and not InDetFlags.doRefit():
        kwargs = setDefaults(
            kwargs,
            BroadRotCreatorTool=TrackingCommon.getInDetBroadRotCreator(
                nameSuffix=split_cluster_map_extension,
                SplitClusterMapExtension=split_cluster_map_extension))

    return InDetGlobalChi2FitterBase(
        name,
        **setDefaults(
            kwargs,
            OutlierCut=5.0,
            Acceleration=False,  # default
            RecalculateDerivatives=True,
            TrackChi2PerNDFCut=10))
Ejemplo n.º 3
0
def GaussianSumFitter(name='GaussianSumFitter', **kwargs):
    split_cluster_map_extension = kwargs.pop('SplitClusterMapExtension', '')

    from InDetRecExample import TrackingCommon as TrackingCommon
    if 'ToolForROTCreation' not in kwargs:
        kwargs = setDefaults(
            kwargs,
            ToolForROTCreation=TrackingCommon.getInDetRotCreator(
                nameSuffix=split_cluster_map_extension,
                SplitClusterMapExtension=split_cluster_map_extension))

    if 'ToolForExtrapolation' not in kwargs:
        kwargs = setDefaults(
            kwargs,
            ToolForExtrapolation=TrackingCommon.getInDetGsfExtrapolator())

    if 'MeasurementUpdatorType' not in kwargs:
        kwargs = setDefaults(kwargs,
                             MeasurementUpdatorType=TrackingCommon.
                             getInDetGsfMeasurementUpdator())

    from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GaussianSumFitter
    return Trk__GaussianSumFitter(name=name,
                                  **setDefaults(kwargs,
                                                ReintegrateOutliers=False,
                                                MakePerigee=True,
                                                RefitOnMeasurementBase=True,
                                                DoHitSorting=True))
Ejemplo n.º 4
0
def getGSFTrackFitter():
    egRotCreator = TrackingCommon.getInDetRotCreator(name='egRotCreator',
                                                     private=True)

    TrackingCommon.createAndAddCondAlg(
        TrackingCommon.getRIO_OnTrackErrorScalingCondAlg,
        'RIO_OnTrackErrorScalingCondAlg')

    # get Rk propagator
    from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import (
        Trk__RungeKuttaPropagator as Propagator)

    egTrkPropagator = Propagator(name='egTrkPropagator')
    egTrkPropagator.AccuracyParameter = 0.0001

    # Setup the Navigator (default)
    from TrkDetDescrSvc.AtlasTrackingGeometrySvc import (
        AtlasTrackingGeometrySvc)

    from TrkExTools.TrkExToolsConf import Trk__Navigator
    egTrkNavigator = Trk__Navigator(
        name='egTrkNavigator', TrackingGeometrySvc=AtlasTrackingGeometrySvc)

    # Set up the GSF
    from TrkGaussianSumFilter.TrkGaussianSumFilterConf import (
        Trk__GsfMaterialMixtureConvolution)

    GsfMaterialUpdator = Trk__GsfMaterialMixtureConvolution(
        name='GsfMaterialUpdator', MaximumNumberOfComponents=12)

    from TrkGaussianSumFilter.TrkGaussianSumFilterConf import (
        Trk__GsfExtrapolator)

    GsfExtrapolator = Trk__GsfExtrapolator(
        name='GsfExtrapolator',
        Propagators=[egTrkPropagator],
        SearchLevelClosestParameters=10,
        StickyConfiguration=True,
        Navigator=egTrkNavigator,
        GsfMaterialConvolution=GsfMaterialUpdator,
        SurfaceBasedMaterialEffects=False)

    from TrkGaussianSumFilter.TrkGaussianSumFilterConf import (
        Trk__GaussianSumFitter)

    GSFTrackFitter = Trk__GaussianSumFitter(
        name='GSFTrackFitter',
        ToolForExtrapolation=GsfExtrapolator,
        ReintegrateOutliers=True,
        MakePerigee=True,
        RefitOnMeasurementBase=True,
        DoHitSorting=True,
        ToolForROTCreation=egRotCreator)
    # --- end of fitter loading
    return GSFTrackFitter
Ejemplo n.º 5
0
def InDetGlobalChi2Fitter(name='InDetGlobalChi2Fitter', **kwargs):
    split_cluster_map_extension = kwargs.pop('SplitClusterMapExtension', '')

    from InDetRecExample import TrackingCommon as TrackingCommon
    if 'RotCreatorTool' not in kwargs:
        kwargs = setDefaults(
            kwargs,
            RotCreatorTool=TrackingCommon.getInDetRotCreator(
                nameSuffix=split_cluster_map_extension,
                SplitClusterMapExtension=split_cluster_map_extension))

    from InDetRecExample.InDetJobProperties import InDetFlags
    use_broad_cluster_any = InDetFlags.useBroadClusterErrors() and (
        not InDetFlags.doDBMstandalone())
    if 'BroadRotCreatorTool' not in kwargs and not InDetFlags.doRefit():
        kwargs = setDefaults(
            kwargs,
            BroadRotCreatorTool=TrackingCommon.getInDetBroadRotCreator(
                nameSuffix=split_cluster_map_extension,
                SplitClusterMapExtension=split_cluster_map_extension))

    if InDetFlags.doDBMstandalone():
        kwargs = setDefaults(kwargs,
                             StraightLine=True,
                             OutlierCut=5,
                             RecalibrateTRT=False,
                             TRTExtensionCuts=False,
                             TrackChi2PerNDFCut=20)

    if InDetFlags.doRefit() or use_broad_cluster_any is True:
        kwargs = setDefaults(kwargs, RecalibrateSilicon=False)
    if InDetFlags.doRefit():
        kwargs = setDefaults(kwargs,
                             BroadRotCreatorTool=None,
                             ReintegrateOutliers=False,
                             RecalibrateTRT=False)
    if InDetFlags.doRobustReco():
        kwargs = setDefaults(
            kwargs,
            # BroadRotCreatorTool = None
            OutlierCut=10.0,
            TrackChi2PerNDFCut=20)

    if InDetFlags.doRobustReco() or InDetFlags.doCosmics():
        kwargs = setDefaults(kwargs, MaxOutliers=99)
    if InDetFlags.doCosmics() or InDetFlags.doBeamHalo():
        kwargs = setDefaults(kwargs, Acceleration=False)

    if InDetFlags.materialInteractions() and not InDetFlags.solenoidOn():
        kwargs = setDefaults(kwargs, Momentum=1000. * Units.MeV)
    return InDetGlobalChi2FitterBase(name, **kwargs)
Ejemplo n.º 6
0
def InDetMeasRecalibST(name='InDetMeasRecalibST', **kwargs):
    from TrkKalmanFitter.TrkKalmanFitterConf import Trk__MeasRecalibSteeringTool

    split_cluster_map_extension = kwargs.pop('SplitClusterMapExtension', '')

    from InDetRecExample import TrackingCommon as TrackingCommon
    if 'BroadPixelClusterOnTrackTool' not in kwargs:
        kwargs = setDefaults(
            kwargs,
            BroadPixelClusterOnTrackTool=TrackingCommon.
            getInDetBroadPixelClusterOnTrackTool(
                nameSuffix=split_cluster_map_extension,
                SplitClusterMapExtension=split_cluster_map_extension))
    if 'BroadSCT_ClusterOnTrackTool' not in kwargs:
        kwargs = setDefaults(kwargs,
                             BroadSCT_ClusterOnTrackTool=TrackingCommon.
                             getInDetBroadSCT_ClusterOnTrackTool())

    if 'CommonRotCreator' not in kwargs:
        kwargs = setDefaults(
            kwargs,
            CommonRotCreator=TrackingCommon.getInDetRefitRotCreator(
                SplitClusterMapExtension=split_cluster_map_extension))

    return Trk__MeasRecalibSteeringTool(name, **kwargs)
Ejemplo n.º 7
0
def DistributedKalmanFilter(name="DistributedKalmanFilter", **kwargs):
    split_cluster_map_extension = kwargs.pop('SplitClusterMapExtension', '')

    from InDetRecExample.TrackingCommon import setDefaults
    if 'ExtrapolatorTool' not in kwargs:
        kwargs = setDefaults(
            kwargs, ExtrapolatorTool=TrackingCommon.getInDetExtrapolator())

    from InDetRecExample import TrackingCommon as TrackingCommon
    if 'ROTcreator' not in kwargs:
        kwargs = setDefaults(
            kwargs,
            ROTcreator=TrackingCommon.getInDetRotCreator(
                nameSuffix=split_cluster_map_extension,
                SplitClusterMapExtension=split_cluster_map_extension))

    # @TODO set sortingReferencePoint = ???
    from TrkDistributedKalmanFilter.TrkDistributedKalmanFilterConf import Trk__DistributedKalmanFilter
    return Trk__DistributedKalmanFilter(name=name, **kwargs)
Ejemplo n.º 8
0
def TrigMuonAmbiProcessor(name="TrigMuonAmbiProcessor", **kwargs):
    # definition mostly copied from MuonRecExample/python/MooreTools.py
    import InDetRecExample.TrackingCommon as TrackingCommon
    kwargs.setdefault(
        "AssociationTool",
        TrackingCommon.getInDetTrigPRDtoTrackMapToolGangedPixels())
    kwargs.setdefault("DropDouble", False)
    kwargs.setdefault("ScoringTool", "MuonTrackScoringTool")
    kwargs.setdefault("SelectionTool", "MuonAmbiSelectionTool")
    return CfgMgr.Trk__TrackSelectionProcessorTool(name, **kwargs)
Ejemplo n.º 9
0
def TMEF_iPatFitter(name='TMEF_iPatFitter', **kwargs):
    kwargs.setdefault("AggregateMaterial", True)
    kwargs.setdefault("FullCombinedFit", True)
    if not TriggerFlags.run2Config == '2016':
        kwargs.setdefault("MaxIterations", 15)
    kwargs.setdefault("MaterialAllocator", "TMEF_MaterialAllocator")
    from InDetRecExample import TrackingCommon
    kwargs.setdefault("SolenoidalIntersector",
                      TrackingCommon.getSolenoidalIntersector())
    kwargs.setdefault("TrackSummaryTool", 'TMEF_TrackSummaryTool')
    return CfgMgr.Trk__iPatFitter(name, **kwargs)
Ejemplo n.º 10
0
def getInDetxAODParticleCreatorTool(prd_to_track_map=None, suffix=""):
    from AthenaCommon.AppMgr import ToolSvc
    if hasattr(ToolSvc, 'InDetxAODParticleCreatorTool' + suffix):
        return getattr(ToolSvc, 'InDetxAODParticleCreatorTool')

    _perigee_expression = InDetFlags.perigeeExpression()
    # need to treat Vertex specifically because at the time of
    # the track particle creation the primary vertex does not yet exist.
    # The problem is solved by first creating track particles wrt. the beam line
    # and correcting the parameters after the vertex finding.
    if _perigee_expression == 'Vertex':
        _perigee_expression = 'BeamLine'

    from InDetRecExample import TrackingCommon as TrackingCommon
    from InDetRecExample.TrackingCommon import setDefaults
    if prd_to_track_map is None:
        track_summary_tool = TrackingCommon.getInDetTrackSummaryToolSharedHits(
        )
    else:
        prop_args = setDefaults({}, nameSuffix=suffix)
        asso_tool = TrackingCommon.getConstPRD_AssociationTool(
            **setDefaults(prop_args, PRDtoTrackMap=prd_to_track_map))
        helper_tool = TrackingCommon.getInDetSummaryHelperSharedHits(
            **setDefaults(prop_args, AssoTool=asso_tool))
        track_summary_tool = TrackingCommon.getInDetTrackSummaryToolSharedHits(
            **setDefaults(prop_args, InDetSummaryHelperTool=helper_tool))

    from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
    InDetxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(
        name="InDetxAODParticleCreatorTool" + suffix,
        Extrapolator=InDetExtrapolator,
        TrackSummaryTool=track_summary_tool,
        BadClusterID=InDetFlags.pixelClusterBadClusterID(),
        KeepParameters=True,
        KeepFirstParameters=InDetFlags.KeepFirstParameters(),
        PerigeeExpression=_perigee_expression)

    ToolSvc += InDetxAODParticleCreatorTool
    if InDetFlags.doPrintConfigurables():
        printfunc(InDetxAODParticleCreatorTool)
    return InDetxAODParticleCreatorTool
Ejemplo n.º 11
0
def iPatFitter( name='iPatFitter', **kwargs): 
    kwargs.setdefault("AggregateMaterial",True)
    kwargs.setdefault("FullCombinedFit", True )
    kwargs.setdefault("MaterialAllocator",getPublicTool("MuidMaterialAllocator"))
    from InDetRecExample import TrackingCommon
    kwargs.setdefault("SolenoidalIntersector",TrackingCommon.getSolenoidalIntersector())
    if TriggerFlags.MuonSlice.doTrigMuonConfig:
        kwargs.setdefault("MaxIterations", 15)
    else:
        import MuonCombinedRecExample.CombinedMuonTrackSummary
        from AthenaCommon.AppMgr import ToolSvc
        kwargs.setdefault("TrackSummaryTool", ToolSvc.CombinedMuonTrackSummary)

    return CfgMgr.Trk__iPatFitter(name,**kwargs)
Ejemplo n.º 12
0
def InDetKalmanTrackFitterBase(name='InDetKalmanTrackFitterBase', **kwargs):
    from InDetRecExample import TrackingCommon as TrackingCommon
    from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanFitter
    from AthenaCommon.AppMgr import ToolSvc
    split_cluster_map_extension = kwargs.get('SplitClusterMapExtension', '')

    kwargs.setdefault('ExtrapolatorHandle',
                      TrackingCommon.getInDetExtrapolator())
    if 'RIO_OnTrackCreatorHandle' not in kwargs:
        from InDetRecExample import TrackingCommon as TrackingCommon
        kwargs = setDefaults(
            kwargs,
            RIO_OnTrackCreatorHandle=TrackingCommon.getInDetRefitRotCreator(
                SplitClusterMapExtension=split_cluster_map_extension))

    kwargs.setdefault('MeasurementUpdatorHandle', ToolSvc.InDetUpdator)
    setTool('KalmanSmootherHandle', 'InDetBKS', kwargs)
    setTool('KalmanOutlierLogicHandle', 'InDetKOL', kwargs)
    kwargs.setdefault('DynamicNoiseAdjustorHandle', None)
    kwargs.setdefault('BrempointAnalyserHandle', None)
    kwargs.setdefault('AlignableSurfaceProviderHandle', None)
    if len(split_cluster_map_extension) > 0:
        if 'RecalibratorHandle' not in kwargs:
            the_tool_name = 'InDetMeasRecalibST'
            kwargs.setdefault(
                'RecalibratorHandle',
                CfgGetter.getPublicToolClone(
                    the_tool_name + split_cluster_map_extension,
                    the_tool_name,
                    SplitClusterMapExtension=split_cluster_map_extension))
    else:
        setTool('RecalibratorHandle', 'InDetMeasRecalibST', kwargs)
    # setTool('InternalDAFHandle','KalmanInternalDAF',kwargs )
    # from InDetRecExample.InDetJobProperties import InDetFlags
    # kwargs.setdefault('DoDNAForElectronsOnly', True if InDetFlags.doBremRecovery() and InDetFlags.trackFitterType() is 'KalmanFitter' else False)
    return Trk__KalmanFitter(name, **kwargs)
Ejemplo n.º 13
0
    def __init__(self,
                 name="InDetTrigTrackPRD_Association_Photon_EF",
                 type="photon"):
        super(InDet__InDetTrigTrackPRD_Association, self).__init__(name)

        import os

        if name.rfind('TRTStandalone') != -1:
            self.TracksName = []
        else:
            self.TracksName = [
                'AmbigSolv', 'ExtProcTracks', 'TRTSeededAmbigSolv'
            ]
        import InDetRecExample.TrackingCommon as TrackingCommon
        self.AssociationTool = TrackingCommon.getInDetTrigPRDtoTrackMapToolGangedPixels(
        )  # @TODO correct tool ?
        self.AssociationMapName = "InDetTrigPRDtoTrackMap_Photon_EF"
Ejemplo n.º 14
0
def InDetGlobalChi2FitterDBM(name='InDetGlobalChi2FitterDBM', **kwargs):
    split_cluster_map_extension = kwargs.pop('SplitClusterMapExtension', '')
    if 'RotCreatorTool' not in kwargs:
        from InDetRecExample import TrackingCommon as TrackingCommon
        kwargs = setDefaults(
            kwargs,
            RotCreatorTool=TrackingCommon.getInDetRotCreatorDBM(
                SplitClusterMapExtension=split_cluster_map_extension))

    return InDetGlobalChi2FitterBase(
        name,
        **setDefaults(kwargs,
                      BroadRotCreatorTool=None,
                      StraightLine=True,
                      OutlierCut=5,
                      RecalibrateTRT=False,
                      RecalculateDerivatives=False,
                      TRTExtensionCuts=False,
                      TrackChi2PerNDFCut=20,
                      Momentum=1000. * Units.MeV))
Ejemplo n.º 15
0
def InDetGlobalChi2FitterTRT(name='InDetGlobalChi2FitterTRT', **kwargs):
    '''
    Global Chi2 Fitter for TRT segments with different settings
    '''
    split_cluster_map_extension = kwargs.pop('SplitClusterMapExtension', '')

    if 'RotCreatorTool' not in kwargs:
        from InDetRecExample import TrackingCommon as TrackingCommon
        kwargs = setDefaults(
            kwargs,
            RotCreatorTool=TrackingCommon.getInDetRefitRotCreator(
                nameSuffix=split_cluster_map_extension,
                SplitClusterMapExtension=split_cluster_map_extension))

    from InDetRecExample.InDetJobProperties import InDetFlags
    return InDetGlobalChi2FitterBase(
        name,
        **setDefaults(
            kwargs,
            MaterialUpdateTool='',  # default
            TrackingGeometrySvc='',  # default
            SignedDriftRadius=True,  # default,
            RecalibrateSilicon=False,  # default,
            RecalibrateTRT=False,  # default,
            TRTTubeHitCut=2.5,  # default,
            MaxIterations=10,
            Acceleration=False,  # default,
            RecalculateDerivatives=False,
            TRTExtensionCuts=True,  # default,
            TrackChi2PerNDFCut=999999,
            Momentum=1000. * Units.MeV if InDetFlags.materialInteractions()
            and not InDetFlags.solenoidOn() else 0,  # default,
            OutlierCut=5,  # default
            MaxOutliers=99 if InDetFlags.doRobustReco()
            or InDetFlags.doCosmics() else 10,  # default,
            ReintegrateOutliers=False
            if InDetFlags.doRefit() else False  # default
        ))
Ejemplo n.º 16
0
    def __init__(self,
                 extension="",
                 InputCollections=None,
                 NewTrackingCuts=None,
                 BarrelSegments=None,
                 TrackCollectionKeys=[],
                 TrackCollectionTruthKeys=[],
                 PRDtoTrackMap=''):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from InDetRecExample.InDetKeys import InDetKeys
        from AthenaCommon.DetFlags import DetFlags

        import InDetRecExample.TrackingCommon as TrackingCommon
        #
        # get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        # --- Always use PRD association tool (even if only 1 collection) to remove TRT
        #     segments with significant overlaping hits
        usePrdAssociationTool = True
        #usePrdAssociationTool = True if len(InputCollections) > 0 else False

        #
        # --- get list of already associated hits (always do this, even if no other tracking ran before)
        #
        prd_to_track_map = PRDtoTrackMap
        if usePrdAssociationTool and extension != "_TRT":
            prefix = 'InDetTRTonly_'
            InDetTRTonly_PRD_Association = TrackingCommon.getInDetTrackPRD_Association(
                namePrefix=prefix,
                nameSuffix=extension,
                TracksName=list(InputCollections))

            prd_to_track_map = prefix + 'PRDtoTrackMap' + extension
            topSequence += InDetTRTonly_PRD_Association
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRTonly_PRD_Association)

        #
        # Cut values and output key for the TRT segments standalone TRT track finder
        #
        if extension == "_TRT":
            # TRT track segments
            pTmin = NewTrackingCuts.minPT()
            self.__TRTStandaloneTracks = InDetKeys.TRTTracks()
        else:
            # TRT standalone
            # pTmin                      = NewTrackingCuts.minSecondaryPt()
            pTmin = NewTrackingCuts.minTRTonlyPt(
            )  # new cut parameter to make it flexible...
            self.__TRTStandaloneTracks = InDetKeys.TRTTracks_NewT()

        #
        # --- set up special Scoring Tool for standalone TRT tracks
        #
        from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetTrtTrackScoringTool
        InDetTRT_StandaloneScoringTool = InDet__InDetTrtTrackScoringTool(
            name='InDetTRT_StandaloneScoringTool' + extension,
            SummaryTool=TrackingCommon.getInDetTrackSummaryTool(),
            DriftCircleCutTool=InDetTRTDriftCircleCut,
            useAmbigFcn=True,
            useSigmaChi2=False,
            PtMin=pTmin,
            minTRTonTrk=NewTrackingCuts.minTRTonly(),
            maxEta=2.1,
            UseParameterization=NewTrackingCuts.useTRTonlyParamCuts(),
            OldTransitionLogic=NewTrackingCuts.useTRTonlyOldLogic(),
            minTRTPrecisionFraction=NewTrackingCuts.minSecondaryTRTPrecFrac())
        # InDetTRT_StandaloneScoringTool.OutputLevel = VERBOSE
        ToolSvc += InDetTRT_StandaloneScoringTool
        if (InDetFlags.doPrintConfigurables()):
            printfunc(InDetTRT_StandaloneScoringTool)

        #
        # set up TRT_SegmentToTrackTool
        #
        from AthenaCommon import CfgGetter
        from TRT_SegmentToTrackTool.TRT_SegmentToTrackToolConf import InDet__TRT_SegmentToTrackTool
        asso_tool = TrackingCommon.getInDetPRDtoTrackMapToolGangedPixels(
        ) if usePrdAssociationTool else None
        InDetTRT_SegmentToTrackTool = InDet__TRT_SegmentToTrackTool(
            name='InDetTRT_SegmentToTrackTool' + extension,
            RefitterTool=CfgGetter.getPublicTool('InDetTrackFitterTRT'),
            AssociationTool=asso_tool,
            TrackSummaryTool=TrackingCommon.getInDetTrackSummaryTool(),
            ScoringTool=InDetTRT_StandaloneScoringTool,
            Extrapolator=TrackingCommon.getInDetExtrapolator(),
            FinalRefit=True,
            MaxSharedHitsFraction=NewTrackingCuts.maxTRTonlyShared(),
            SuppressHoleSearch=True)

        ToolSvc += InDetTRT_SegmentToTrackTool
        if (InDetFlags.doPrintConfigurables()):
            printfunc(InDetTRT_SegmentToTrackTool)

        if not InDetFlags.doCosmics():
            #
            # --- TRT standalone tracks algorithm
            #

            from TRT_StandaloneTrackFinder.TRT_StandaloneTrackFinderConf import InDet__TRT_StandaloneTrackFinder
            InDetTRT_StandaloneTrackFinder = InDet__TRT_StandaloneTrackFinder(
                name='InDetTRT_StandaloneTrackFinder' + extension,
                MinNumDriftCircles=NewTrackingCuts.minTRTonly(),
                MinPt=NewTrackingCuts.minTRTonlyPt(),
                InputSegmentsLocation=BarrelSegments,
                MaterialEffects=0,
                PRDtoTrackMap=prd_to_track_map,
                OldTransitionLogic=NewTrackingCuts.useTRTonlyOldLogic(),
                OutputTracksLocation=self.__TRTStandaloneTracks,
                TRT_SegToTrackTool=InDetTRT_SegmentToTrackTool)
            #InDetTRT_StandaloneTrackFinder.OutputLevel = VERBOSE
            topSequence += InDetTRT_StandaloneTrackFinder
            if InDetFlags.doPrintConfigurables():
                printfunc(InDetTRT_StandaloneTrackFinder)

            # --- Delete TRT segments for the subdetector pattern only (back-tracking has already run by this point)
            from InDetRecExample.ConfiguredInDetSGDeletion import InDetSGDeletionAlg
            InDetSGDeletionAlg(container="Trk::SegmentCollection#",
                               key=BarrelSegments)

        else:
            #
            # --- cosmics segment to track conversion for Barrel
            #
            from AthenaCommon import CfgGetter
            from TRT_SegmentsToTrack.TRT_SegmentsToTrackConf import InDet__TRT_SegmentsToTrack
            InDetTrkSegmenttoTrk = InDet__TRT_SegmentsToTrack(
                name="InDetTRT_SegmentsToTrack_Barrel" + extension,
                InputSegmentsCollection=BarrelSegments,
                OutputTrackCollection=self.__TRTStandaloneTracks,
                TrackFitter=CfgGetter.getPublicTool('InDetTrackFitter'),
                SummaryTool=TrackingCommon.getInDetTrackSummaryToolTRTTracks(),
                AssociationTool=TrackingCommon.
                getInDetPRDtoTrackMapToolGangedPixels()
                if prd_to_track_map != '' else None,
                InputAssociationMapName=prd_to_track_map,
                MinNHit=NewTrackingCuts.minTRTonly(),
                OutlierRemoval=True,
                MaterialEffects=False)
            #InDetTrkSegmenttoTrk.OutputLevel = VERBOSE
            topSequence += InDetTrkSegmenttoTrk
            if InDetFlags.doPrintConfigurables():
                printfunc(InDetTrkSegmenttoTrk)

        #
        #
        # ------------ Track truth.
        #
        if (extension == "_TRT" or not InDetFlags.doSGDeletion()):
            if InDetFlags.doTruth():
                #
                # set up the truth info for this container
                #
                include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                InDetTracksTruth = ConfiguredInDetTrackTruth(
                    self.__TRTStandaloneTracks,
                    self.__TRTStandaloneTracks + "DetailedTruth",
                    self.__TRTStandaloneTracks + "TruthCollection")
                #
                # add final output for statistics
                #
                TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                TrackCollectionTruthKeys += [InDetTracksTruth.TracksTruth()]
            else:
                TrackCollectionKeys += [self.__TRTStandaloneTracks]
Ejemplo n.º 17
0
    def __init__(self,
                 extension="",
                 InputCollections=None,
                 NewTrackingCuts=None,
                 BarrelSegments=None,
                 EndcapSegments=None,
                 doPhase=False):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from InDetRecExample.InDetKeys import InDetKeys
        from AthenaCommon.DetFlags import DetFlags

        import InDetRecExample.TrackingCommon as TrackingCommon
        #
        # get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        #
        # --- decide if use the association tool
        #
        if len(InputCollections) > 0:
            usePrdAssociationTool = True
        else:
            usePrdAssociationTool = False
        #
        # --- get list of already associated hits (always do this, even if no other tracking ran before)
        #
        prefix = 'InDetSegment'
        suffix = extension
        if usePrdAssociationTool:
            InDetSegmentPRD_Association = TrackingCommon.getInDetTrackPRD_Association(
                namePrefix=prefix,
                nameSuffix=suffix,
                TracksName=list(InputCollections))
            topSequence += InDetSegmentPRD_Association
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetSegmentPRD_Association)

        # ---------------------------------------------------------------
        #
        # --- now the main steering of the TRT segments finding
        #
        # ---------------------------------------------------------------

        if InDetFlags.doCosmics():
            #
            # --- cosmics barrel segments (use TRT track segements even for NewT)
            #

            if doPhase:
                from TRT_TrackSegmentsTool_xk.TRT_TrackSegmentsTool_xkConf import InDet__TRT_TrackSegmentsMaker_BarrelCosmics
                InDetTRT_TrackSegmentsMakerPhase = InDet__TRT_TrackSegmentsMaker_BarrelCosmics(
                    name='InDetTRTSegmentsMakerPhase' + extension,
                    TrtManagerLocation=InDetKeys.TRT_Manager(),
                    TRT_ClustersContainer=InDetKeys.
                    TRT_DriftCirclesUncalibrated(),
                    IsMagneticFieldOn=InDetFlags.solenoidOn())
                ToolSvc += InDetTRT_TrackSegmentsMakerPhase
                #InDetTRT_TrackSegmentsMakerPhase.OutputLevel = VERBOSE
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetTRT_TrackSegmentsMakerPhase)

            else:
                from TRT_TrackSegmentsTool_xk.TRT_TrackSegmentsTool_xkConf import InDet__TRT_TrackSegmentsMaker_BarrelCosmics
                InDetTRT_TrackSegmentsMaker = InDet__TRT_TrackSegmentsMaker_BarrelCosmics(
                    name='InDetTRTSegmentsMaker' + extension,
                    TrtManagerLocation=InDetKeys.TRT_Manager(),
                    TRT_ClustersContainer=InDetKeys.TRT_DriftCircles(),
                    IsMagneticFieldOn=InDetFlags.solenoidOn())

                ToolSvc += InDetTRT_TrackSegmentsMaker
                #InDetTRT_TrackSegmentsMaker.OutputLevel = VERBOSE
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetTRT_TrackSegmentsMaker)

        else:
            #
            # --- cut values
            #
            if extension == "_TRT":
                # TRT Subdetector segment finding
                MinNumberDCs = NewTrackingCuts.minTRTonly()
                pTmin = NewTrackingCuts.minPT()
                sharedFrac = NewTrackingCuts.maxTRTonlyShared()
            else:
                # TRT-only/back-tracking segment finding
                MinNumberDCs = NewTrackingCuts.minSecondaryTRTonTrk()
                pTmin = NewTrackingCuts.minSecondaryPt()
                sharedFrac = NewTrackingCuts.maxSecondaryTRTShared()
            #
            # --- offline version  of TRT segemnt making
            #
            from TRT_TrackSegmentsTool_xk.TRT_TrackSegmentsTool_xkConf import InDet__TRT_TrackSegmentsMaker_ATLxk
            InDetTRT_TrackSegmentsMaker = InDet__TRT_TrackSegmentsMaker_ATLxk(name                    = 'InDetTRT_SeedsMaker'+extension,
                                                                              TRT_ClustersContainer   = InDetKeys.TRT_DriftCircles(),
                                                                              PropagatorTool          = InDetPatternPropagator,
                                                                              TrackExtensionTool      = InDetTRTExtensionTool,
                                                                              PRDtoTrackMap           = prefix+'PRDtoTrackMap'+suffix \
                                                                                                          if usePrdAssociationTool else '',
                                                                              RemoveNoiseDriftCircles = InDetFlags.removeTRTNoise(),
                                                                              MinNumberDriftCircles   = MinNumberDCs,
                                                                              NumberMomentumChannel   = NewTrackingCuts.TRTSegFinderPtBins(),
                                                                              pTmin                   = pTmin,
                                                                              sharedFrac              = sharedFrac)
            ToolSvc += InDetTRT_TrackSegmentsMaker
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_TrackSegmentsMaker)

            # Condition algorithm for InDet__TRT_TrackSegmentsMaker_ATLxk
            from AthenaCommon.AlgSequence import AthSequencer
            condSeq = AthSequencer("AthCondSeq")
            if not hasattr(condSeq,
                           "InDet__TRT_TrackSegmentsMakerCondAlg_ATLxk"):
                from TRT_TrackSegmentsTool_xk.TRT_TrackSegmentsTool_xkConf import InDet__TRT_TrackSegmentsMakerCondAlg_ATLxk
                InDetTRT_TrackSegmentsMakerCondAlg = InDet__TRT_TrackSegmentsMakerCondAlg_ATLxk(
                    name='InDetTRT_SeedsMakerCondAlg' + extension,
                    PropagatorTool=InDetPatternPropagator,
                    NumberMomentumChannel=NewTrackingCuts.TRTSegFinderPtBins(),
                    pTmin=pTmin)
                condSeq += InDetTRT_TrackSegmentsMakerCondAlg

        #
        # --- TRT track reconstruction
        #
        from TRT_TrackSegmentsFinder.TRT_TrackSegmentsFinderConf import InDet__TRT_TrackSegmentsFinder

        if doPhase:
            InDetTRT_TrackSegmentsFinderPhase = InDet__TRT_TrackSegmentsFinder(
                name='InDetTRT_TrackSegmentsFinderPhase' + extension,
                SegmentsMakerTool=InDetTRT_TrackSegmentsMakerPhase,
                SegmentsLocation=BarrelSegments)

            topSequence += InDetTRT_TrackSegmentsFinderPhase
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_TrackSegmentsFinderPhase)

        else:

            if InDetFlags.doCaloSeededTRTSegments(
            ) or NewTrackingCuts.RoISeededBackTracking():
                InDetTRT_TrackSegmentsFinder = InDet__TRT_TrackSegmentsFinder(
                    name='InDetTRT_TrackSegmentsFinder' + extension,
                    SegmentsMakerTool=InDetTRT_TrackSegmentsMaker,
                    SegmentsLocation=BarrelSegments,
                    useCaloSeeds=True,
                    CaloClusterEt=NewTrackingCuts.minRoIClusterEt(),
                    MinNumberDriftCircles=NewTrackingCuts.minSecondaryTRTonTrk(
                    ),
                    InputClusterContainerName=InDetKeys.
                    CaloClusterROIContainer())

            else:
                InDetTRT_TrackSegmentsFinder = InDet__TRT_TrackSegmentsFinder(
                    name='InDetTRT_TrackSegmentsFinder' + extension,
                    SegmentsMakerTool=InDetTRT_TrackSegmentsMaker,
                    SegmentsLocation=BarrelSegments,
                    InputClusterContainerName="")

            topSequence += InDetTRT_TrackSegmentsFinder
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_TrackSegmentsFinder)

        #
        # --- load TRT validation alg
        #
        if InDetFlags.doTruth() and not InDetFlags.doCosmics():
            from InDetSegmentDriftCircleAssValidation.InDetSegmentDriftCircleAssValidationConf import InDet__SegmentDriftCircleAssValidation
            InDetSegmentDriftCircleAssValidation = InDet__SegmentDriftCircleAssValidation(
                name="InDetSegmentDriftCircleAssValidation" + extension,
                OrigTracksLocation=BarrelSegments,
                TRT_DriftCirclesName=InDetKeys.TRT_DriftCircles(),
                pTmin=pTmin,
                Pseudorapidity=2.1,  # end of TRT
                RadiusMin=0.,
                RadiusMax=600.,
                MinNumberDCs=MinNumberDCs)
            topSequence += InDetSegmentDriftCircleAssValidation
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetSegmentDriftCircleAssValidation)
Ejemplo n.º 18
0
    def __init__(self,
                 InputCollections=None,
                 ResolvedTrackCollectionKey=None,
                 SiSPSeededTrackCollectionKey=None,
                 NewTrackingCuts=None,
                 TrackCollectionKeys=[],
                 TrackCollectionTruthKeys=[]):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from InDetRecExample.InDetKeys import InDetKeys

        import InDetRecExample.TrackingCommon as TrackingCommon
        #
        # --- get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        #
        # --- decide if use the association tool
        #
        if (len(InputCollections) > 0) and (
                NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode()
                == "VeryLowPt" or NewTrackingCuts.mode() == "LargeD0"
                or NewTrackingCuts.mode() == "R3LargeD0"
                or NewTrackingCuts.mode() == "LowPtLargeD0"
                or NewTrackingCuts.mode() == "BeamGas"
                or NewTrackingCuts.mode() == "ForwardTracks"
                or NewTrackingCuts.mode() == "ForwardSLHCTracks"
                or NewTrackingCuts.mode() == "Disappearing"
                or NewTrackingCuts.mode() == "VeryForwardSLHCTracks"
                or NewTrackingCuts.mode() == "SLHCConversionFinding"):
            usePrdAssociationTool = True
        else:
            usePrdAssociationTool = False

        #
        # --- get list of already associated hits (always do this, even if no other tracking ran before)
        #
        asso_tool = None
        if usePrdAssociationTool:
            prefix = 'InDet'
            suffix = NewTrackingCuts.extension()
            InDetPRD_Association = TrackingCommon.getInDetTrackPRD_Association(
                namePrefix=prefix,
                nameSuffix=suffix,
                TracksName=list(InputCollections))

            # asso_tool = TrackingCommon.getConstPRD_AssociationTool(namePrefix     = prefix, nameSuffix = suffix)

            topSequence += InDetPRD_Association
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetPRD_Association)

        # ------------------------------------------------------------
        #
        # ----------- SiSPSeededTrackFinder
        #
        # ------------------------------------------------------------

        if InDetFlags.doSiSPSeededTrackFinder():
            #
            # --- Space points seeds maker, use different ones for cosmics and collisions
            #
            if NewTrackingCuts.mode() == "DBM":
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ATLxk as SiSpacePointsSeedMaker
            elif InDetFlags.doCosmics():
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_Cosmic as SiSpacePointsSeedMaker
            elif InDetFlags.doHeavyIon():
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_HeavyIon as SiSpacePointsSeedMaker
            elif NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode(
            ) == "VeryLowPt" or (NewTrackingCuts.mode() == "Pixel"
                                 and InDetFlags.doMinBias()):
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_LowMomentum as SiSpacePointsSeedMaker
            elif NewTrackingCuts.mode() == "BeamGas":
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_BeamGas as SiSpacePointsSeedMaker
            elif NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode(
            ) == "ForwardSLHCTracks" or NewTrackingCuts.mode(
            ) == "VeryForwardSLHCTracks":
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ITK as SiSpacePointsSeedMaker
            else:
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ATLxk as SiSpacePointsSeedMaker

            InDetSiSpacePointsSeedMaker = SiSpacePointsSeedMaker(
                name="InDetSpSeedsMaker" + NewTrackingCuts.extension(),
                pTmin=NewTrackingCuts.minPT(),
                maxdImpact=NewTrackingCuts.maxPrimaryImpact(),
                maxZ=NewTrackingCuts.maxZImpact(),
                minZ=-NewTrackingCuts.maxZImpact(),
                usePixel=NewTrackingCuts.usePixel(),
                SpacePointsPixelName=InDetKeys.PixelSpacePoints(),
                # useSCT                 = NewTrackingCuts.useSCT(),
                useSCT=(NewTrackingCuts.useSCT()
                        and NewTrackingCuts.useSCTSeeding()),
                SpacePointsSCTName=InDetKeys.SCT_SpacePoints(),
                # useOverlapSpCollection = NewTrackingCuts.useSCT(),
                useOverlapSpCollection=(NewTrackingCuts.useSCT()
                                        and NewTrackingCuts.useSCTSeeding()),
                SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
                radMax=NewTrackingCuts.radMax(),
                RapidityCut=NewTrackingCuts.maxEta())

            if NewTrackingCuts.mode() == "Offline" or InDetFlags.doHeavyIon(
            ) or NewTrackingCuts.mode() == "ForwardTracks":
                InDetSiSpacePointsSeedMaker.maxdImpactPPS = NewTrackingCuts.maxdImpactPPSSeeds(
                )
                InDetSiSpacePointsSeedMaker.maxdImpactSSS = NewTrackingCuts.maxdImpactSSSSeeds(
                )
                if not InDetFlags.doHeavyIon():
                    InDetSiSpacePointsSeedMaker.maxSeedsForSpacePointStrips = NewTrackingCuts.MaxSeedsPerSP_Strips(
                    )
                    InDetSiSpacePointsSeedMaker.maxSeedsForSpacePointPixels = NewTrackingCuts.MaxSeedsPerSP_Pixels(
                    )
                    InDetSiSpacePointsSeedMaker.alwaysKeepConfirmedStripSeeds = NewTrackingCuts.KeepAllConfirmedStripSeeds(
                    )
                    InDetSiSpacePointsSeedMaker.alwaysKeepConfirmedPixelSeeds = NewTrackingCuts.KeepAllConfirmedPixelSeeds(
                    )

            if NewTrackingCuts.mode() == "R3LargeD0":
                InDetSiSpacePointsSeedMaker.optimisePhiBinning = False
                InDetSiSpacePointsSeedMaker.usePixel = False
                InDetSiSpacePointsSeedMaker.etaMax = NewTrackingCuts.maxEta()
                InDetSiSpacePointsSeedMaker.maxSeedsForSpacePointStrips = NewTrackingCuts.MaxSeedsPerSP_Strips(
                )
                InDetSiSpacePointsSeedMaker.alwaysKeepConfirmedStripSeeds = NewTrackingCuts.KeepAllConfirmedStripSeeds(
                )
                InDetSiSpacePointsSeedMaker.maxdRadius = 150
                InDetSiSpacePointsSeedMaker.seedScoreBonusConfirmationSeed = -2000  #let's be generous

            if usePrdAssociationTool:
                # not all classes have that property !!!
                InDetSiSpacePointsSeedMaker.PRDtoTrackMap      = prefix+'PRDtoTrackMap'+suffix \
                                                                    if usePrdAssociationTool else ''
            if not InDetFlags.doCosmics():
                InDetSiSpacePointsSeedMaker.maxRadius1 = 0.75 * NewTrackingCuts.radMax(
                )
                InDetSiSpacePointsSeedMaker.maxRadius2 = NewTrackingCuts.radMax(
                )
                InDetSiSpacePointsSeedMaker.maxRadius3 = NewTrackingCuts.radMax(
                )
            if NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode(
            ) == "VeryLowPt" or (NewTrackingCuts.mode() == "Pixel"
                                 and InDetFlags.doMinBias()):
                try:
                    InDetSiSpacePointsSeedMaker.pTmax = NewTrackingCuts.maxPT()
                except:
                    pass
                InDetSiSpacePointsSeedMaker.mindRadius = 4.0
            if NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode(
            ) == "SLHCConversionFinding":
                InDetSiSpacePointsSeedMaker.minRadius1 = 0
                InDetSiSpacePointsSeedMaker.minRadius2 = 0
                InDetSiSpacePointsSeedMaker.minRadius3 = 0
                InDetSiSpacePointsSeedMaker.maxRadius1 = 1000. * Units.mm
                InDetSiSpacePointsSeedMaker.maxRadius2 = 1000. * Units.mm
                InDetSiSpacePointsSeedMaker.maxRadius3 = 1000. * Units.mm
            if NewTrackingCuts.mode(
            ) == "ForwardTracks" or NewTrackingCuts.mode(
            ) == "ForwardSLHCTracks" or NewTrackingCuts.mode(
            ) == "VeryForwardSLHCTracks":
                InDetSiSpacePointsSeedMaker.checkEta = True
                InDetSiSpacePointsSeedMaker.etaMin = NewTrackingCuts.minEta()
                InDetSiSpacePointsSeedMaker.etaMax = NewTrackingCuts.maxEta()
                InDetSiSpacePointsSeedMaker.RapidityCut = NewTrackingCuts.maxEta(
                )
            if NewTrackingCuts.mode() == "DBM":
                InDetSiSpacePointsSeedMaker.etaMin = NewTrackingCuts.minEta()
                InDetSiSpacePointsSeedMaker.etaMax = NewTrackingCuts.maxEta()
                InDetSiSpacePointsSeedMaker.useDBM = True

            #InDetSiSpacePointsSeedMaker.OutputLevel = VERBOSE
            ToolSvc += InDetSiSpacePointsSeedMaker
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetSiSpacePointsSeedMaker)

            #
            # --- Z-coordinates primary vertices finder (only for collisions)
            #
            if InDetFlags.useZvertexTool() and NewTrackingCuts.mode() != "DBM":
                from SiZvertexTool_xk.SiZvertexTool_xkConf import InDet__SiZvertexMaker_xk
                InDetZvertexMaker = InDet__SiZvertexMaker_xk(
                    name='InDetZvertexMaker' + NewTrackingCuts.extension(),
                    Zmax=NewTrackingCuts.maxZImpact(),
                    Zmin=-NewTrackingCuts.maxZImpact(),
                    minRatio=0.17)  # not default
                InDetZvertexMaker.SeedMakerTool = InDetSiSpacePointsSeedMaker

                if InDetFlags.doHeavyIon():
                    InDetZvertexMaker.HistSize = 2000
                    ###InDetZvertexMaker.minContent = 200
                    InDetZvertexMaker.minContent = 30

                ToolSvc += InDetZvertexMaker
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetZvertexMaker)

            else:
                InDetZvertexMaker = None

            #
            # --- SCT and Pixel detector elements road builder
            #
            from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk
            InDetSiDetElementsRoadMaker = InDet__SiDetElementsRoadMaker_xk(
                name='InDetSiRoadMaker' + NewTrackingCuts.extension(),
                PropagatorTool=InDetPatternPropagator,
                usePixel=NewTrackingCuts.usePixel(),
                PixManagerLocation=InDetKeys.PixelManager(),
                useSCT=NewTrackingCuts.useSCT(),
                SCTManagerLocation=InDetKeys.SCT_Manager(),
                RoadWidth=NewTrackingCuts.RoadWidth())
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetSiDetElementsRoadMaker)
            # Condition algorithm for InDet__SiDetElementsRoadMaker_xk
            if DetFlags.haveRIO.pixel_on():
                # Condition algorithm for SiCombinatorialTrackFinder_xk
                from AthenaCommon.AlgSequence import AthSequencer
                condSeq = AthSequencer("AthCondSeq")
                if not hasattr(condSeq,
                               "InDetSiDetElementBoundaryLinksPixelCondAlg"):
                    from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk
                    condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk(
                        name="InDetSiDetElementBoundaryLinksPixelCondAlg",
                        ReadKey="PixelDetectorElementCollection",
                        WriteKey="PixelDetElementBoundaryLinks_xk",
                        UsePixelDetectorManager=True)

            if NewTrackingCuts.useSCT():
                from AthenaCommon.AlgSequence import AthSequencer
                condSeq = AthSequencer("AthCondSeq")
                if not hasattr(condSeq, "InDet__SiDetElementsRoadCondAlg_xk"):
                    from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadCondAlg_xk
                    condSeq += InDet__SiDetElementsRoadCondAlg_xk(
                        name="InDet__SiDetElementsRoadCondAlg_xk")

                if not hasattr(condSeq,
                               "InDetSiDetElementBoundaryLinksSCTCondAlg"):
                    from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk
                    condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk(
                        name="InDetSiDetElementBoundaryLinksSCTCondAlg",
                        ReadKey="SCT_DetectorElementCollection",
                        WriteKey="SCT_DetElementBoundaryLinks_xk")

            #
            # --- Local track finding using sdCaloSeededSSSpace point seed
            #
            # @TODO ensure that PRD association map is used if usePrdAssociationTool is set
            is_dbm = InDetFlags.doDBMstandalone() or NewTrackingCuts.extension(
            ) == 'DBM'
            rot_creator_digital = TrackingCommon.getInDetRotCreatorDigital(
            ) if not is_dbm else TrackingCommon.getInDetRotCreatorDBM()

            from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiCombinatorialTrackFinder_xk
            track_finder = InDet__SiCombinatorialTrackFinder_xk(
                name='InDetSiComTrackFinder' + NewTrackingCuts.extension(),
                PropagatorTool=InDetPatternPropagator,
                UpdatorTool=InDetPatternUpdator,
                RIOonTrackTool=rot_creator_digital,
                usePixel=DetFlags.haveRIO.pixel_on(),
                useSCT=DetFlags.haveRIO.SCT_on() if not is_dbm else False,
                PixelClusterContainer=InDetKeys.PixelClusters(),
                SCT_ClusterContainer=InDetKeys.SCT_Clusters())
            if is_dbm:
                track_finder.MagneticFieldMode = "NoField"
                track_finder.TrackQualityCut = 9.3

            if (DetFlags.haveRIO.SCT_on()):
                track_finder.SctSummaryTool = InDetSCT_ConditionsSummaryTool
            else:
                track_finder.SctSummaryTool = None

            ToolSvc += track_finder

            useBremMode = NewTrackingCuts.mode(
            ) == "Offline" or NewTrackingCuts.mode(
            ) == "SLHC" or NewTrackingCuts.mode() == "DBM"
            from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk as SiTrackMaker
            InDetSiTrackMaker = SiTrackMaker(
                name='InDetSiTrackMaker' + NewTrackingCuts.extension(),
                useSCT=NewTrackingCuts.useSCT(),
                usePixel=NewTrackingCuts.usePixel(),
                RoadTool=InDetSiDetElementsRoadMaker,
                CombinatorialTrackFinder=track_finder,
                pTmin=NewTrackingCuts.minPT(),
                pTminBrem=NewTrackingCuts.minPTBrem(),
                pTminSSS=InDetFlags.pT_SSScut(),
                nClustersMin=NewTrackingCuts.minClusters(),
                nHolesMax=NewTrackingCuts.nHolesMax(),
                nHolesGapMax=NewTrackingCuts.nHolesGapMax(),
                SeedsFilterLevel=NewTrackingCuts.seedFilterLevel(),
                Xi2max=NewTrackingCuts.Xi2max(),
                Xi2maxNoAdd=NewTrackingCuts.Xi2maxNoAdd(),
                nWeightedClustersMin=NewTrackingCuts.nWeightedClustersMin(),
                CosmicTrack=InDetFlags.doCosmics(),
                Xi2maxMultiTracks=NewTrackingCuts.Xi2max(),  # was 3.
                useSSSseedsFilter=InDetFlags.doSSSfilter(),
                doMultiTracksProd=True,
                useBremModel=InDetFlags.doBremRecovery() and
                useBremMode,  # only for NewTracking the brem is debugged !!!
                doCaloSeededBrem=InDetFlags.doCaloSeededBrem(),
                doHadCaloSeedSSS=InDetFlags.doHadCaloSeededSSS(),
                phiWidth=NewTrackingCuts.phiWidthBrem(),
                etaWidth=NewTrackingCuts.etaWidthBrem(),
                InputClusterContainerName=InDetKeys.CaloClusterROIContainer(
                ),  # "InDetCaloClusterROIs" 
                InputHadClusterContainerName=InDetKeys.
                HadCaloClusterROIContainer(),  # "InDetCaloClusterROIs" 
                UseAssociationTool=usePrdAssociationTool)

            if NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode(
            ) == "ForwardSLHCTracks" or NewTrackingCuts.mode(
            ) == "VeryForwardSLHCTracks":
                InDetSiTrackMaker.ITKGeometry = True

            if NewTrackingCuts.mode() == "DBM":
                InDetSiTrackMaker.MagneticFieldMode = "NoField"
                InDetSiTrackMaker.useBremModel = False
                InDetSiTrackMaker.doMultiTracksProd = False
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSPSeededFinder'
                InDetSiTrackMaker.pTminSSS = -1
                InDetSiTrackMaker.CosmicTrack = False
                InDetSiTrackMaker.useSSSseedsFilter = False
                InDetSiTrackMaker.doCaloSeededBrem = False
                InDetSiTrackMaker.doHadCaloSeedSSS = False

            elif InDetFlags.doCosmics():
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_Cosmic'

            elif InDetFlags.doHeavyIon():
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_HeavyIon'

            elif NewTrackingCuts.mode() == "LowPt":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_LowMomentum'

            elif NewTrackingCuts.mode() == "VeryLowPt" or (
                    NewTrackingCuts.mode() == "Pixel"
                    and InDetFlags.doMinBias()):
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_VeryLowMomentum'

            elif NewTrackingCuts.mode() == "BeamGas":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_BeamGas'

            elif NewTrackingCuts.mode() == "ForwardTracks":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_ForwardTracks'

            elif NewTrackingCuts.mode() == "ForwardSLHCTracks":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_ForwardSLHCTracks'

            elif NewTrackingCuts.mode() == "VeryForwardSLHCTracks":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_VeryForwardSLHCTracks'

            elif NewTrackingCuts.mode() == "SLHCConversionFinding":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_SLHCConversionTracks'

            elif NewTrackingCuts.mode() == "LargeD0" or NewTrackingCuts.mode(
            ) == "R3LargeD0" or NewTrackingCuts.mode() == "LowPtLargeD0":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_LargeD0'

            else:
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSPSeededFinder'

            if InDetFlags.doStoreTrackSeeds():
                from SeedToTrackConversionTool.SeedToTrackConversionToolConf import InDet__SeedToTrackConversionTool
                InDet_SeedToTrackConversion = InDet__SeedToTrackConversionTool(
                    name="InDet_SeedToTrackConversion",
                    OutputName=InDetKeys.SiSPSeedSegments() +
                    NewTrackingCuts.extension())
                InDetSiTrackMaker.SeedToTrackConversion = InDet_SeedToTrackConversion
                InDetSiTrackMaker.SeedSegmentsWrite = True

            #InDetSiTrackMaker.OutputLevel = VERBOSE
            ToolSvc += InDetSiTrackMaker
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetSiTrackMaker)
            #
            # set output track collection name
        #
            self.__SiTrackCollection = SiSPSeededTrackCollectionKey
            #
            # --- Setup Track finder using space points seeds
            #

            from SiSPSeededTrackFinder.SiSPSeededTrackFinderConf import InDet__SiSPSeededTrackFinder

            if NewTrackingCuts.mode(
            ) == "ForwardSLHCTracks" or NewTrackingCuts.mode(
            ) == "ForwardTracks":

                InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(name             = 'InDetSiSpTrackFinder'+NewTrackingCuts.extension(),
                                                                          TrackTool        = InDetSiTrackMaker,
                                                                          PRDtoTrackMap    = prefix+'PRDtoTrackMap'+suffix \
                                                                                             if usePrdAssociationTool else '',
                                                                          TrackSummaryTool = TrackingCommon.getInDetTrackSummaryToolNoHoleSearch(),
                                                                          TracksLocation   = self.__SiTrackCollection,
                                                                          SeedsTool        = InDetSiSpacePointsSeedMaker,
                                                                          useZvertexTool   = InDetFlags.useZvertexTool(),
                                                                          ZvertexTool      = InDetZvertexMaker,
                                                                          useNewStrategy   = False,
                                                                          useMBTSTimeDiff  = InDetFlags.useMBTSTimeDiff(),
                                                                          useZBoundFinding = False)
                if InDetFlags.doHeavyIon():
                    InDetSiSPSeededTrackFinder.FreeClustersCut = 2  #Heavy Ion optimization from Igor

            else:
                InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(name             = 'InDetSiSpTrackFinder'+NewTrackingCuts.extension(),
                                                                          TrackTool        = InDetSiTrackMaker,
                                                                          PRDtoTrackMap    = prefix+'PRDtoTrackMap'+suffix \
                                                                                             if usePrdAssociationTool else '',
                                                                          TrackSummaryTool = TrackingCommon.getInDetTrackSummaryToolNoHoleSearch(),
                                                                          TracksLocation   = self.__SiTrackCollection,
                                                                          SeedsTool        = InDetSiSpacePointsSeedMaker,
                                                                          useZvertexTool   = InDetFlags.useZvertexTool() and NewTrackingCuts.mode() != "DBM",
                                                                          ZvertexTool      = InDetZvertexMaker,
                                                                          useNewStrategy   = InDetFlags.useNewSiSPSeededTF() and NewTrackingCuts.mode() != "DBM",
                                                                          useMBTSTimeDiff  = InDetFlags.useMBTSTimeDiff(),
                                                                          useZBoundFinding = NewTrackingCuts.doZBoundary() and NewTrackingCuts.mode() != "DBM")

                if InDetFlags.doHeavyIon():
                    InDetSiSPSeededTrackFinder.FreeClustersCut = 2  #Heavy Ion optimization from Igor

            #InDetSiSPSeededTrackFinder.OutputLevel =VERBOSE
            topSequence += InDetSiSPSeededTrackFinder
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetSiSPSeededTrackFinder)

            if not InDetFlags.doSGDeletion():
                if InDetFlags.doTruth():
                    #
                    # set up the truth info for this container
                    #
                    include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                    InDetTracksTruth = ConfiguredInDetTrackTruth(
                        self.__SiTrackCollection,
                        self.__SiTrackCollection + "DetailedTruth",
                        self.__SiTrackCollection + "TruthCollection")
                    #
                    # add final output for statistics
                    #
                    TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                    TrackCollectionTruthKeys += [
                        InDetTracksTruth.TracksTruth()
                    ]
                else:
                    TrackCollectionKeys += [self.__SiTrackCollection]

        # ------------------------------------------------------------
        #
        # ---------- Ambiguity solving
        #
        # ------------------------------------------------------------

        if InDetFlags.doAmbiSolving():
            #
            # --- load InnerDetector TrackSelectionTool
            #

            prob1 = InDetFlags.pixelClusterSplitProb1()
            prob2 = InDetFlags.pixelClusterSplitProb2()
            nhitsToAllowSplitting = 9

            from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags
            if CommonGeometryFlags.Run() == 1:
                prob1 = InDetFlags.pixelClusterSplitProb1_run1()
                prob2 = InDetFlags.pixelClusterSplitProb2_run1()
                nhitsToAllowSplitting = 8

            if InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "DBM"):
                from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetDenseEnvAmbiTrackSelectionTool as AmbiTrackSelectionTool
            else:
                from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetAmbiTrackSelectionTool as AmbiTrackSelectionTool
            InDetAmbiTrackSelectionTool = AmbiTrackSelectionTool(
                name='InDetAmbiTrackSelectionTool' +
                NewTrackingCuts.extension(),
                DriftCircleCutTool=InDetTRTDriftCircleCut,
                AssociationTool=TrackingCommon.
                getInDetPRDtoTrackMapToolGangedPixels(),
                minHits=NewTrackingCuts.minClusters(),
                minNotShared=NewTrackingCuts.minSiNotShared(),
                maxShared=NewTrackingCuts.maxShared(),
                minTRTHits=0,  # used for Si only tracking !!!
                sharedProbCut=0.10,
                UseParameterization=False,
                Cosmics=InDetFlags.doCosmics(),
                doPixelSplitting=InDetFlags.doPixelClusterSplitting()
                and NewTrackingCuts.mode != "DBM")
            if InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "DBM"):
                InDetAmbiTrackSelectionTool.sharedProbCut = prob1
                InDetAmbiTrackSelectionTool.sharedProbCut2 = prob2
                InDetAmbiTrackSelectionTool.minSiHitsToAllowSplitting = nhitsToAllowSplitting
                InDetAmbiTrackSelectionTool.minUniqueSCTHits = 4
                InDetAmbiTrackSelectionTool.minTrackChi2ForSharedHits = 3
                InDetAmbiTrackSelectionTool.InputHadClusterContainerName = InDetKeys.HadCaloClusterROIContainer(
                ) + "Bjet"
                InDetAmbiTrackSelectionTool.doHadCaloSeed = InDetFlags.doCaloSeededAmbi(
                )  #Do special cuts in region of interest
                InDetAmbiTrackSelectionTool.minPtSplit = InDetFlags.pixelClusterSplitMinPt(
                )  #Only allow split clusters on track withe pt greater than this MeV
                InDetAmbiTrackSelectionTool.maxSharedModulesInROI = 3  #Maximum number of shared modules for tracks in ROI
                InDetAmbiTrackSelectionTool.minNotSharedInROI = 2  #Minimum number of unique modules for tracks in ROI
                InDetAmbiTrackSelectionTool.minSiHitsToAllowSplittingInROI = 7  #Minimum number of Si hits to allow splittings for tracks in ROI
                InDetAmbiTrackSelectionTool.phiWidth = 0.1  #Split cluster ROI size
                InDetAmbiTrackSelectionTool.etaWidth = 0.1  #Split cluster ROI size
                InDetAmbiTrackSelectionTool.InputEmClusterContainerName = InDetKeys.CaloClusterROIContainer(
                )
                InDetAmbiTrackSelectionTool.doEmCaloSeed = False  #Only split in cluster in region of interest
                InDetAmbiTrackSelectionTool.minPtConv = 10000  #Only allow split clusters on track withe pt greater than this MeV
                InDetAmbiTrackSelectionTool.phiWidthEM = 0.05  #Split cluster ROI size
                InDetAmbiTrackSelectionTool.etaWidthEM = 0.05  #Split cluster ROI size

            if NewTrackingCuts.mode() == "DBM":
                InDetAmbiTrackSelectionTool.Cosmics = False
                InDetAmbiTrackSelectionTool.UseParameterization = False
                InDetAmbiTrackSelectionTool.doPixelSplitting = False
                InDetAmbiTrackSelectionTool.maxShared = 1000
                InDetAmbiTrackSelectionTool.maxTracksPerSharedPRD = 2
                InDetAmbiTrackSelectionTool.minHits = 0
                InDetAmbiTrackSelectionTool.minNotShared = 0
                InDetAmbiTrackSelectionTool.minScoreShareTracks = 0.0
                InDetAmbiTrackSelectionTool.minTRTHits = 0
                InDetAmbiTrackSelectionTool.sharedProbCut = 0.1

            # if NewTrackingCuts.mode() == "ForwardTracks":
            #    InDetAmbiTrackSelectionTool.OutputLevel = VERBOSE

            ToolSvc += InDetAmbiTrackSelectionTool
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetAmbiTrackSelectionTool)
            #
            # --- set up different Scoring Tool for collisions and cosmics
            #
            if InDetFlags.doCosmics() and NewTrackingCuts.mode() != "DBM":
                InDetAmbiScoringTool = TrackingCommon.getInDetCosmicsScoringTool(
                    NewTrackingCuts)
            elif (NewTrackingCuts.mode() == "R3LargeD0"
                  and InDetFlags.nnCutLargeD0Threshold > 0):
                # Set up NN config
                InDetAmbiScoringTool = TrackingCommon.getInDetNNScoringTool(
                    NewTrackingCuts)
            else:
                InDetAmbiScoringTool = TrackingCommon.getInDetAmbiScoringTool(
                    NewTrackingCuts)

            #
            # --- load Ambiguity Processor
            #
            useBremMode = NewTrackingCuts.mode(
            ) == "Offline" or NewTrackingCuts.mode() == "SLHC"

            if InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "DBM"):
                # DenseEnvironmentsAmbiguityProcessorTool
                from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__DenseEnvironmentsAmbiguityProcessorTool as ProcessorTool
                use_low_pt_fitter = True if NewTrackingCuts.mode(
                ) == "LowPt" or NewTrackingCuts.mode() == "VeryLowPt" or (
                    NewTrackingCuts.mode() == "Pixel"
                    and InDetFlags.doMinBias()) else False

                from AthenaCommon import CfgGetter
                from InDetRecExample.TrackingCommon import setDefaults
                if len(NewTrackingCuts.extension()) > 0:
                    fitter_args = setDefaults(
                        {},
                        SplitClusterMapExtension=NewTrackingCuts.extension())
                    fitter_list=[     CfgGetter.getPublicToolClone('InDetTrackFitter'+NewTrackingCuts.extension(), 'InDetTrackFitter',**fitter_args)    if not use_low_pt_fitter \
                                 else CfgGetter.getPublicToolClone('InDetTrackFitterLowPt'+NewTrackingCuts.extension(), 'InDetTrackFitterLowPt',**fitter_args)]
                else:
                    fitter_list=[     CfgGetter.getPublicTool('InDetTrackFitter')    if not use_low_pt_fitter \
                                 else CfgGetter.getPublicTool('InDetTrackFitterLowPt')]

                if InDetFlags.doRefitInvalidCov():
                    from AthenaCommon import CfgGetter
                    if len(NewTrackingCuts.extension()) > 0:
                        fitter_args = setDefaults(
                            {},
                            SplitClusterMapExtension=NewTrackingCuts.extension(
                            ))
                        fitter_list.append(
                            CfgGetter.getPublicToolClone(
                                'KalmanFitter' + NewTrackingCuts.extension(),
                                'KalmanFitter', **fitter_args))
                        fitter_list.append(
                            CfgGetter.getPublicToolClone(
                                'ReferenceKalmanFitter' +
                                NewTrackingCuts.extension(),
                                'ReferenceKalmanFitter', **fitter_args))
                    else:
                        fitter_list.append(
                            CfgGetter.getPublicTool('KalmanFitter'))
                        fitter_list.append(
                            CfgGetter.getPublicTool('ReferenceKalmanFitter'))

                InDetAmbiguityProcessor = ProcessorTool(
                    name='InDetAmbiguityProcessor' +
                    NewTrackingCuts.extension(),
                    Fitter=fitter_list,
                    AssociationTool=TrackingCommon.
                    getInDetPRDtoTrackMapToolGangedPixels(),
                    AssociationMapName='PRDToTrackMap' +
                    NewTrackingCuts.extension(),
                    TrackSummaryTool=TrackingCommon.getInDetTrackSummaryTool(),
                    ScoringTool=InDetAmbiScoringTool,
                    SelectionTool=InDetAmbiTrackSelectionTool,
                    SuppressHoleSearch=False,
                    tryBremFit=InDetFlags.doBremRecovery() and useBremMode
                    and NewTrackingCuts.mode() != "DBM",
                    caloSeededBrem=InDetFlags.doCaloSeededBrem()
                    and NewTrackingCuts.mode() != "DBM",
                    pTminBrem=NewTrackingCuts.minPTBrem(),
                    RefitPrds=True,
                    doHadCaloSeed=InDetFlags.doCaloSeededRefit(),
                    InputHadClusterContainerName=InDetKeys.
                    HadCaloClusterROIContainer() + "Bjet")

                # DenseEnvironmentsAmbiguityScoreProcessorTool
                from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__DenseEnvironmentsAmbiguityScoreProcessorTool as ScoreProcessorTool
                InDetAmbiguityScoreProcessor = ScoreProcessorTool(
                    name='InDetAmbiguityScoreProcessor' +
                    NewTrackingCuts.extension(),
                    ScoringTool=InDetAmbiScoringTool,
                    SplitProbTool=NnPixelClusterSplitProbTool
                    if InDetFlags.doPixelClusterSplitting()
                    and 'NnPixelClusterSplitProbTool' in globals() else None,
                    AssociationTool=TrackingCommon.
                    getInDetPRDtoTrackMapToolGangedPixels(),
                    AssociationToolNotGanged=TrackingCommon.
                    getPRDtoTrackMapTool(),
                    AssociationMapName='PRDToTrackMap' +
                    NewTrackingCuts.extension(),
                    SelectionTool=InDetAmbiTrackSelectionTool)
                # hasScoreProcessorTool = True
            else:
                from AthenaCommon import CfgGetter
                from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool as ProcessorTool
                InDetAmbiguityProcessor = ProcessorTool(
                    name='InDetAmbiguityProcessor' +
                    NewTrackingCuts.extension(),
                    Fitter=CfgGetter.getPublicTool('InDetTrackFitter'),
                    AssociationTool=TrackingCommon.
                    getInDetPRDtoTrackMapToolGangedPixels(),
                    TrackSummaryTool=TrackingCommon.getInDetTrackSummaryTool(),
                    ScoringTool=InDetAmbiScoringTool,
                    SelectionTool=InDetAmbiTrackSelectionTool,
                    SuppressHoleSearch=False,
                    tryBremFit=InDetFlags.doBremRecovery() and useBremMode
                    and NewTrackingCuts.mode() != "DBM",
                    caloSeededBrem=InDetFlags.doCaloSeededBrem()
                    and NewTrackingCuts.mode() != "DBM",
                    pTminBrem=NewTrackingCuts.minPTBrem(),
                    RefitPrds=True)
                InDetAmbiguityScoreProcessor = None

            if InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode()
                    == "DBM") and 'NnPixelClusterSplitProbTool' in globals():
                if InDetAmbiguityScoreProcessor is not None:
                    InDetAmbiguityScoreProcessor.sharedProbCut = prob1
                    InDetAmbiguityScoreProcessor.sharedProbCut2 = prob2
                    if NewTrackingCuts.extension() == "":
                        InDetAmbiguityScoreProcessor.SplitClusterMap_old = ""
                    elif NewTrackingCuts.extension() == "Disappearing":
                        InDetAmbiguityScoreProcessor.SplitClusterMap_old = InDetKeys.SplitClusterAmbiguityMap(
                        )
                    InDetAmbiguityScoreProcessor.SplitClusterMap_new = InDetKeys.SplitClusterAmbiguityMap(
                    ) + NewTrackingCuts.extension()
                if InDetFlags.doTIDE_RescalePixelCovariances():
                    InDetAmbiguityProcessor.applydRcorrection = True

            if NewTrackingCuts.mode() == "Pixel" or NewTrackingCuts.mode(
            ) == "DBM":
                InDetAmbiguityProcessor.SuppressHoleSearch = True
            if NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode(
            ) == "VeryLowPt" or (NewTrackingCuts.mode() == "Pixel"
                                 and InDetFlags.doMinBias()):
                if InDetAmbiguityProcessor.getName().find('Dense'):
                    pass
                else:
                    from AthenaCommon import CfgGetter
                    InDetAmbiguityProcessor.Fitter = CfgGetter.getPublicTool(
                        'InDetTrackFitterLowPt')

            if InDetFlags.materialInteractions():
                InDetAmbiguityProcessor.MatEffects = InDetFlags.materialInteractionsType(
                )
            else:
                InDetAmbiguityProcessor.MatEffects = 0

            # if NewTrackingCuts.mode() == "ForwardTracks":
            #    InDetAmbiguityProcessor.OutputLevel = VERBOSE

            ToolSvc += InDetAmbiguityProcessor
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetAmbiguityProcessor)

            # add InDetAmbiguityScoreProcessor
            if InDetAmbiguityScoreProcessor is not None:
                ToolSvc += InDetAmbiguityScoreProcessor

            #
            # --- set input and output collection
            #
            InputTrackCollection = self.__SiTrackCollection
            self.__SiTrackCollection = ResolvedTrackCollectionKey

            #
            # --- configure Ambiguity (score) solver
            #
            from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguityScore
            # from RecExConfig.hideInput import hideInput
            # hideInput ('TrackCollection', self.__SiTrackCollection)
            InDetAmbiguityScore = Trk__TrkAmbiguityScore(
                name='InDetAmbiguityScore' + NewTrackingCuts.extension(),
                TrackInput=[InputTrackCollection],
                TrackOutput='ScoredMap' + 'InDetAmbiguityScore' +
                NewTrackingCuts.extension(),
                AmbiguityScoreProcessor=InDetAmbiguityScoreProcessor
            )  ## TODO: check the case when it is None object
            topSequence += InDetAmbiguityScore
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetAmbiguityScore)

            #
            # --- configure Ambiguity solver
            #
            from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguitySolver
            from RecExConfig.hideInput import hideInput
            hideInput('TrackCollection', self.__SiTrackCollection)
            InDetAmbiguitySolver = Trk__TrkAmbiguitySolver(
                name='InDetAmbiguitySolver' + NewTrackingCuts.extension(),
                TrackInput='ScoredMap' + 'InDetAmbiguityScore' +
                NewTrackingCuts.extension(),
                TrackOutput=self.__SiTrackCollection,
                AmbiguityProcessor=InDetAmbiguityProcessor)
            topSequence += InDetAmbiguitySolver
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetAmbiguitySolver)

            #
            # --- Delete Silicon Sp-Seeded tracks
            #
            from InDetRecExample.ConfiguredInDetSGDeletion import InDetSGDeletionAlg
            InDetSGDeletionAlg(key=SiSPSeededTrackCollectionKey)

            if ((NewTrackingCuts.mode() in ["Pixel", "SCT"])
                    or not InDetFlags.doSGDeletion()):
                if InDetFlags.doTruth():
                    #
                    # set up the truth info for this container
                    #
                    include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                    InDetTracksTruth = ConfiguredInDetTrackTruth(
                        self.__SiTrackCollection,
                        self.__SiTrackCollection + "DetailedTruth",
                        self.__SiTrackCollection + "TruthCollection")
                    #
                    # add final output for statistics
                    #
                    TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                    TrackCollectionTruthKeys += [
                        InDetTracksTruth.TracksTruth()
                    ]
                else:
                    TrackCollectionKeys += [self.__SiTrackCollection]
Ejemplo n.º 19
0
    svcMgr += CfgMgr.DecisionSvc()
svcMgr.DecisionSvc.CalcStats = True

from InDetRecExample import TrackingCommon
# Add the TSOS augmentation tool to the derivation framework
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackStateOnSurfaceDecorator
DFTSOS = DerivationFramework__TrackStateOnSurfaceDecorator(
    name="DFTrackStateOnSurfaceDecorator",
    ContainerName="InDetTrackParticles",
    DecorationPrefix=prefixName,
    StoreTRT=dumpTrtInfo,
    StoreSCT=dumpSctInfo,
    StorePixel=dumpPixInfo,
    IsSimulation=isIdTrkDxAODSimulation,
    PRDtoTrackMap="PRDtoTrackMap" + InDetKeys.UnslimmedTracks(),
    TRT_ToT_dEdx=TrackingCommon.getInDetTRT_dEdxTool() if dumpTrtInfo else "",
    OutputLevel=INFO)

if dumpTrtInfo:
    #Add tool to calculate TRT-based dEdx
    DFTSOS.TRT_ToT_dEdx = TRT_dEdx_Tool

ToolSvc += DFTSOS
augmentationTools += [DFTSOS]
if (printIdTrkDxAODConf):
    print(DFTSOS)
    print(DFTSOS.properties())

# If requested, decorate also split tracks (for cosmics)
if makeSplitTracks:
    DFTSOS_SplitTracks = DerivationFramework__TrackStateOnSurfaceDecorator(
Ejemplo n.º 20
0
        DecorationPrefix=prefixName,
        OutputLevel=INFO)
    ToolSvc += DFEI
    augmentationTools += [DFEI]
    if printSctDxAODConf:
        msg.info(DFEI)
        msg.info(DFEI.properties())

# Add Unassociated hits augmentation tool
if dumpUnassociatedHits:
    from InDetRecExample import TrackingCommon
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__UnassociatedHitsGetterTool
    unassociatedHitsGetterTool = DerivationFramework__UnassociatedHitsGetterTool(
        name='SCTxAOD_unassociatedHitsGetter',
        TrackCollection="Tracks",
        AssociationTool=TrackingCommon.getPRDtoTrackMapTool(),
        # @TODO consider ganged pixel and TRT outliers when searching for unassociated PRDs (enabled by props below) ?
        # AssociationTool = "",
        # PRDtoTrackMap = "PRDtoTrackMap" + InDetKeys.UnslimmedTracks(),
        PixelClusters="PixelClusters",
        SCTClusterContainer="SCT_Clusters",
        TRTDriftCircleContainer="TRT_DriftCircles")
    ToolSvc += unassociatedHitsGetterTool
    if printSctDxAODConf:
        msg.info(unassociatedHitsGetterTool)
        msg.info(unassociatedHitsGetterTool.properties())

    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__UnassociatedHitsDecorator
    unassociatedHitsDecorator = DerivationFramework__UnassociatedHitsDecorator(
        name='SCTxAOD_unassociatedHitsDecorator',
        UnassociatedHitsGetter=unassociatedHitsGetterTool,
Ejemplo n.º 21
0
   def __init__(self, NewTrackingCuts = None, SiTrackCollection = None, ExtendedTrackCollection = None, ExtendedTracksMap = None, TrackCollectionKeys=[], TrackCollectionTruthKeys=[] , doPhase = True):
      
      from InDetRecExample.InDetJobProperties import InDetFlags
      from AthenaCommon.DetFlags              import DetFlags
      from InDetRecExample.InDetKeys          import InDetKeys
      
      import InDetRecExample.TrackingCommon   as TrackingCommon
      #
      # get ToolSvc and topSequence
      #
      from AthenaCommon.AppMgr                import ToolSvc
      from AthenaCommon.AlgSequence           import AlgSequence
      topSequence = AlgSequence()
      
      #    
      # ---------- TRT_TrackExtension
      #
      if InDetFlags.doTRTExtension() and InDetFlags.doTRTExtensionNew():


         #
         # Track extension to TRT algorithm
         #
         # set output extension map name
         OutputExtendedTracks = ExtendedTracksMap

         if doPhase:

           from TRT_TrackExtensionTool_xk.TRT_TrackExtensionTool_xkConf import InDet__TRT_TrackExtensionToolCosmics
           InDetTRTExtensionToolPhase = TrackingCommon.getInDetTRT_ExtensionToolPhase()


           from TRT_TrackExtensionAlg.TRT_TrackExtensionAlgConf import InDet__TRT_TrackExtensionAlg
           InDetTRTExtensionPhase    = InDet__TRT_TrackExtensionAlg (name                   = 'InDetTRT_ExtensionPhase'+NewTrackingCuts.extension(),
                                                                     InputTracksLocation    = SiTrackCollection,
                                                                     ExtendedTracksLocation = OutputExtendedTracks,
                                                                     TrackExtensionTool     = InDetTRTExtensionToolPhase)

           topSequence += InDetTRTExtensionPhase
           if (InDetFlags.doPrintConfigurables()):
            printfunc (InDetTRTExtensionPhase)

         else:
          cuts_args = {}
          if NewTrackingCuts is not None :
             cuts_args={'TrackingCuts': NewTrackingCuts}
          from TRT_TrackExtensionAlg.TRT_TrackExtensionAlgConf import InDet__TRT_TrackExtensionAlg
          InDetTRTExtension = InDet__TRT_TrackExtensionAlg(name                   = 'InDetTRT_Extension'+NewTrackingCuts.extension(),
                                                           InputTracksLocation    = SiTrackCollection,
                                                           ExtendedTracksLocation = OutputExtendedTracks,
                                                           TrackExtensionTool     = TrackingCommon.getInDetTRT_ExtensionTool(**cuts_args))
          #InDetTRTExtension.OutputLevel = VERBOSE
          topSequence += InDetTRTExtension
          if (InDetFlags.doPrintConfigurables()):
            printfunc (InDetTRTExtension)
   
      #
      # ------------ Track Extension Processor
      #
      if InDetFlags.doExtensionProcessor() and InDetFlags.doTRTExtensionNew():
            
         if InDetFlags.trtExtensionType() == 'DAF' :
            #
            # --- DAF Fitter setup
            #
            from TrkCompetingRIOsOnTrackTool.TrkCompetingRIOsOnTrackToolConf import Trk__CompetingRIOsOnTrackTool
            InDetCompetingRotCreator =  Trk__CompetingRIOsOnTrackTool( name                        = 'InDetCompetingRotCreator'+NewTrackingCuts.extension(),
                                                                       ToolForCompPixelClusters    = None,      # default
                                                                       ToolForCompSCT_Clusters     = None,      # default
                                                                       ToolForCompTRT_DriftCircles = InDetCompetingTRT_DC_Tool )
            ToolSvc += InDetCompetingRotCreator
            if (InDetFlags.doPrintConfigurables()):
               printfunc (InDetCompetingRotCreator)
            #
            from TrkDeterministicAnnealingFilter.TrkDeterministicAnnealingFilterConf import Trk__DeterministicAnnealingFilter
            InDetExtensionFitter =  Trk__DeterministicAnnealingFilter( name = 'InDetDAF'+NewTrackingCuts.extension(),
                                                                       ToolForExtrapolation           = InDetExtrapolator,
                                                                       ToolForCompetingROTsCreation   = InDetCompetingRotCreator,
                                                                       ToolForUpdating                = InDetUpdator,
                                                                       AnnealingScheme                = [200., 81., 9., 4., 1., 1., 1.],
                                                                       DropOutlierCutValue            = 1.E-7,
                                                                       OutlierCutValue                = 0.01 )
            ToolSvc += InDetExtensionFitter
            if (InDetFlags.doPrintConfigurables()):
               printfunc (InDetExtensionFitter)
         else:
            from AthenaCommon import CfgGetter
            InDetExtensionFitter = CfgGetter.getPublicTool('InDetTrackFitter' if NewTrackingCuts.mode() != "LowPt" else  'InDetTrackFitterLowPt')

         #
         # --- load scoring for extension
         #
         if InDetFlags.doCosmics():
            InDetExtenScoringTool = TrackingCommon.getInDetCosmicExtenScoringTool(NewTrackingCuts)
         else:
            InDetExtenScoringTool = TrackingCommon.getInDetExtenScoringTool(NewTrackingCuts)

         #
         # --- output track collection
         #
         self.__ForwardTrackCollection = ExtendedTrackCollection 
         #
         # --- get configured track extension processor
         #
         if doPhase:
         
          from InDetExtensionProcessor.InDetExtensionProcessorConf import InDet__InDetExtensionProcessor   
          InDetExtensionProcessorPhase = InDet__InDetExtensionProcessor ( name               = "InDetExtensionProcessorPhase"+NewTrackingCuts.extension(),
                                                                    TrackName          = SiTrackCollection,
                                                                    Cosmics            = True,
                                                                    ExtensionMap       = OutputExtendedTracks,
                                                                    NewTrackName       = self.__ForwardTrackCollection,
                                                                    TrackFitter        = InDetExtensionFitter,
                                                                    TrackSummaryTool   = TrackingCommon.getInDetTrackSummaryTool(),
                                                                    ScoringTool        = InDetExtenScoringTool,
                                                                    suppressHoleSearch = False,  # does not work properly
                                                                    tryBremFit         = InDetFlags.doBremRecovery(),
                                                                    caloSeededBrem     = InDetFlags.doCaloSeededBrem(),
                                                                    pTminBrem          = NewTrackingCuts.minPTBrem(),
                                                                    RefitPrds          = not (InDetFlags.refitROT() or (InDetFlags.trtExtensionType() == 'DAF')))
         #InDetExtensionProcessor.OutputLevel = VERBOSE
          if InDetFlags.materialInteractions():
             InDetExtensionProcessorPhase.matEffects = InDetFlags.materialInteractionsType()
          else:
             InDetExtensionProcessorPhase.matEffects = 0
   
          topSequence += InDetExtensionProcessorPhase
          if (InDetFlags.doPrintConfigurables()):
              printfunc (InDetExtensionProcessorPhase)

         else:

          from InDetExtensionProcessor.InDetExtensionProcessorConf import InDet__InDetExtensionProcessor   
          InDetExtensionProcessor = InDet__InDetExtensionProcessor ( name               = "InDetExtensionProcessor"+NewTrackingCuts.extension(),
                                                                    TrackName          = SiTrackCollection,
                                                                    Cosmics            = InDetFlags.doCosmics(),
                                                                    ExtensionMap       = OutputExtendedTracks,
                                                                    NewTrackName       = self.__ForwardTrackCollection,
                                                                    TrackFitter        = InDetExtensionFitter,
                                                                    TrackSummaryTool   = TrackingCommon.getInDetTrackSummaryTool(),
                                                                    ScoringTool        = InDetExtenScoringTool,
                                                                    suppressHoleSearch = False,  # does not work properly
                                                                    tryBremFit         = InDetFlags.doBremRecovery(),
                                                                    caloSeededBrem     = InDetFlags.doCaloSeededBrem(),
                                                                    pTminBrem          = NewTrackingCuts.minPTBrem(),
                                                                    RefitPrds          = not (InDetFlags.refitROT() or (InDetFlags.trtExtensionType() == 'DAF')))
          #InDetExtensionProcessor.OutputLevel = VERBOSE
          if InDetFlags.materialInteractions():
             InDetExtensionProcessor.matEffects = InDetFlags.materialInteractionsType()
          else:
             InDetExtensionProcessor.matEffects = 0
   
          topSequence += InDetExtensionProcessor

          if (InDetFlags.doPrintConfigurables()):
             printfunc (InDetExtensionProcessor)
         
         # --- Delete Resolved Si tracks and extension map
         from InDetRecExample.ConfiguredInDetSGDeletion import InDetSGDeletionAlg         
         InDetSGDeletionAlg(container = "TrackExtensionMap#", key = OutputExtendedTracks)
         if not InDetFlags.doMonitoringAlignment():
            InDetSGDeletionAlg(key = SiTrackCollection)
         
         #
         # ------------ Track truth.
         #
         if not InDetFlags.doSGDeletion():
            if InDetFlags.doTruth():
               #
               # set up the truth info for this container
               #
               include ("InDetRecExample/ConfiguredInDetTrackTruth.py")
               InDetTracksTruth = ConfiguredInDetTrackTruth(self.__ForwardTrackCollection,
                                                            self.__ForwardTrackCollection+"DetailedTruth",
                                                            self.__ForwardTrackCollection+"TruthCollection")
               #
               # add final output for statistics
               #
               TrackCollectionKeys      += [ InDetTracksTruth.Tracks() ]
               TrackCollectionTruthKeys += [ InDetTracksTruth.TracksTruth() ]
            else:
               TrackCollectionKeys      += [ self.__ForwardTrackCollection ]
               
         #
      else:
         self.__ForwardTrackCollection = SiTrackCollection
Ejemplo n.º 22
0
def makeInDetPatternRecognition(whichSignature,
                                rois='EMViewRoIs',
                                InputCollections=None,
                                NewTrackingCuts=None):
    from InDetRecExample.InDetJobProperties import InDetFlags
    #Global keys/names for collections
    from InDetRecExample.InDetKeys import InDetKeys  #FIXME: to be replaced with Trig keys?
    from .InDetTrigCollectionKeys import TrigPixelKeys, TrigSCTKeys

    from AthenaCommon.DetFlags import DetFlags

    from AthenaCommon.AppMgr import ToolSvc

    prefix = 'InDetTrigMT'
    suffix = '_%s' % whichSignature if whichSignature else ''
    #Final output track collection
    #SiSPSeededTrackCollectionKey = "SiSPSeededTracks_%s"%whichSignature
    outEFIDTracks = "HLT_IDTrkTrack_%s_%s" % (whichSignature, 'EFID')
    outEFIDTrackParticles = "HLT_IDTrack_%s_%s" % (whichSignature, 'EFID')

    viewAlgs = []  #list of all algs running in this module
    #
    # --- decide if use the association tool
    #
    #FIXME: Make the same decision as offline (based on the tracking cuts)?
    #if (len(InputCollections) > 0) and (NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode() == "VeryLowPt" or NewTrackingCuts.mode() == "LargeD0" or NewTrackingCuts.mode() == "LowPtLargeD0" or NewTrackingCuts.mode() == "BeamGas" or NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "ForwardSLHCTracks"  or NewTrackingCuts.mode() == "Disappearing" or NewTrackingCuts.mode() == "VeryForwardSLHCTracks" or NewTrackingCuts.mode() == "SLHCConversionFinding"):

    #Why not use association tool? what are the cases when not needed?
    #usePrdAssociationTool = True
    #else:
    usePrdAssociationTool = False

    import InDetRecExample.TrackingCommon as TrackingCommon
    if usePrdAssociationTool:
        print('Running SiSPseedTrackFinder!')
        #FIXME: switch to naming based on tracking

        #FIXME: If so:
        # 1] Get a new association tool
        #associationTool = TrackingCommon.getInDetTrigPRDtoTrackMapToolGangedPixels(),

        # 2] Use the ganged pixel from here?
        #from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigPrdAssociationTool

        # 3] Create the new one as in offline tracking:
        InDetTrigPrdAssociation = TrackingCommon.getInDetTrackPRD_Association(
            namePrefix=prefix,
            nameSuffix=suffix,
            TracksName=list(InputCollections)
        )  #This is readHandle #What input collection Thought there are no tracks at this point??!
        # 4] if so do I use normal or ganged?
        #from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
        #InDetTrigPrdAssociationl = InDet__InDetPRD_AssociationToolGangedPixels(name = "%sPrdAssociationTool%s"%(prefix,suffix),
        #                                                                          PixelClusterAmbiguitiesMapName = TrigPixelKeys.PRDtoTrackMap )
        viewAlgs.append(InDetTrigPrdAssociation)

    #FIXME? use trigger flags?
    #if InDetFlags.doSiSPSeededTrackFinder():
    doSiSPSeededTrackFinder = True
    if doSiSPSeededTrackFinder:
        print('Running SiSPseedTrackFinder!')

        #FIXME: Need to add different options based on the
        from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ATLxk as SiSpacePointsSeedMaker

        InDetSiSpacePointsSeedMaker = SiSpacePointsSeedMaker(
            name="%sInDetSpSeedsMaker%s" %
            (prefix, suffix),  #+NewTrackingCuts.extension(),
            pTmin=NewTrackingCuts.minPT(),
            maxdImpact=NewTrackingCuts.maxPrimaryImpact(),
            maxZ=NewTrackingCuts.maxZImpact(),
            minZ=-NewTrackingCuts.maxZImpact(),
            usePixel=NewTrackingCuts.usePixel(),
            SpacePointsPixelName=TrigPixelKeys.SpacePoints,
            # useSCT                 = NewTrackingCuts.useSCT(),
            useSCT=(NewTrackingCuts.useSCT()
                    and NewTrackingCuts.useSCTSeeding()),
            SpacePointsSCTName=TrigSCTKeys.SpacePoints,
            # useOverlapSpCollection = NewTrackingCuts.useSCT(),
            useOverlapSpCollection=(NewTrackingCuts.useSCT()
                                    and NewTrackingCuts.useSCTSeeding()),
            SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
            radMax=NewTrackingCuts.radMax(),
            RapidityCut=NewTrackingCuts.maxEta())

        ToolSvc += InDetSiSpacePointsSeedMaker
        #FIXME consider specific settings here
        #if NewTrackingCuts.mode() == "Offline" or InDetFlags.doHeavyIon() or  NewTrackingCuts.mode() == "ForwardTracks":
        #        InDetSiSpacePointsSeedMaker.maxdImpactPPS = NewTrackingCuts.maxdImpactPPSSeeds()
        #        InDetSiSpacePointsSeedMaker.maxdImpactSSS = NewTrackingCuts.maxdImpactSSSSeeds()

        if usePrdAssociationTool:
            #   # not all classes have that property !!!
            InDetSiSpacePointsSeedMaker.PRDtoTrackMap = TrigPixelKeys.PRDtoTrackMap  #InDetTrigPrdAssociationTool

        #if not InDetFlags.doCosmics():
        #   InDetSiSpacePointsSeedMaker.maxRadius1         = 0.75*NewTrackingCuts.radMax()
        #   InDetSiSpacePointsSeedMaker.maxRadius2         = NewTrackingCuts.radMax()
        #   InDetSiSpacePointsSeedMaker.maxRadius3         = NewTrackingCuts.radMax()
        #if NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode() == "VeryLowPt" or (NewTrackingCuts.mode() == "Pixel" and InDetFlags.doMinBias()):
        #   try :
        #      InDetSiSpacePointsSeedMaker.pTmax              = NewTrackingCuts.maxPT()
        #   except:
        #      pass
        #   InDetSiSpacePointsSeedMaker.mindRadius         = 4.0
        #if NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode() == "SLHCConversionFinding":
        #   InDetSiSpacePointsSeedMaker.minRadius1         = 0
        #   InDetSiSpacePointsSeedMaker.minRadius2         = 0
        #   InDetSiSpacePointsSeedMaker.minRadius3         = 0
        #   InDetSiSpacePointsSeedMaker.maxRadius1         =1000.*Units.mm
        #   InDetSiSpacePointsSeedMaker.maxRadius2         =1000.*Units.mm
        #   InDetSiSpacePointsSeedMaker.maxRadius3         =1000.*Units.mm
        #if NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "VeryForwardSLHCTracks":
        #   InDetSiSpacePointsSeedMaker.checkEta           = True
        #   InDetSiSpacePointsSeedMaker.etaMin             = NewTrackingCuts.minEta()
        #   InDetSiSpacePointsSeedMaker.etaMax             = NewTrackingCuts.maxEta()
        #   InDetSiSpacePointsSeedMaker.RapidityCut        = NewTrackingCuts.maxEta()
        #if NewTrackingCuts.mode() == "DBM":
        #   InDetSiSpacePointsSeedMaker.etaMin             = NewTrackingCuts.minEta()
        #   InDetSiSpacePointsSeedMaker.etaMax             = NewTrackingCuts.maxEta()
        #   InDetSiSpacePointsSeedMaker.useDBM = True

        #Z finder for the vtx
        #
        # --- Z-coordinates primary vertices finder (only for collisions)
        #
        if InDetFlags.useZvertexTool() and NewTrackingCuts.mode() != "DBM":
            from SiZvertexTool_xk.SiZvertexTool_xkConf import InDet__SiZvertexMaker_xk
            InDetZvertexMaker = InDet__SiZvertexMaker_xk(
                name='%sInDetZvertexMaker%s' % (prefix, suffix),
                Zmax=NewTrackingCuts.maxZImpact(),
                Zmin=-NewTrackingCuts.maxZImpact(),
                minRatio=0.17)  # not default
            InDetZvertexMaker.SeedMakerTool = InDetSiSpacePointsSeedMaker

            if InDetFlags.doHeavyIon():
                InDetZvertexMaker.HistSize = 2000
                ###InDetZvertexMaker.minContent = 200
                InDetZvertexMaker.minContent = 30

            ToolSvc += InDetZvertexMaker
            #if (InDetFlags.doPrintConfigurables()):
            #   printfunc (InDetZvertexMaker)

        else:
            InDetZvertexMaker = None

        #
    #   # --- SCT and Pixel detector elements road builder
    #   #
    #FIXME which propagator
    # 1]
        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigPropagator

        # 2] How about offline

        from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk
        InDetSiDetElementsRoadMaker = InDet__SiDetElementsRoadMaker_xk(
            name='%sInDetSiRoadMaker%s' %
            (prefix, suffix),  #+NewTrackingCuts.extension(),
            PropagatorTool=InDetTrigPropagator,  #InDetPatternPropagator,
            usePixel=NewTrackingCuts.usePixel(),
            PixManagerLocation=InDetKeys.PixelManager(),
            useSCT=NewTrackingCuts.useSCT(),
            SCTManagerLocation=InDetKeys.SCT_Manager(
            ),  #FIXME change the name?        
            RoadWidth=NewTrackingCuts.RoadWidth())

        ToolSvc += InDetSiDetElementsRoadMaker
        #if (InDetFlags.doPrintConfigurables()):
        #   printfunc (     InDetSiDetElementsRoadMaker)
        # Condition algorithm for InDet__SiDetElementsRoadMaker_xk
        if DetFlags.haveRIO.pixel_on():
            #FIXME:
            #pixelOn = True
            #if pixelOn:
            # Condition algorithm for SiCombinatorialTrackFinder_xk
            from AthenaCommon.AlgSequence import AthSequencer
            condSeq = AthSequencer("AthCondSeq")
            if not hasattr(condSeq,
                           "InDetSiDetElementBoundaryLinksPixelCondAlg"):
                from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk
                condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk(
                    name="InDetSiDetElementBoundaryLinksPixelCondAlg",
                    ReadKey="PixelDetectorElementCollection",
                    WriteKey="PixelDetElementBoundaryLinks_xk",
                    UsePixelDetectorManager=True)

        if NewTrackingCuts.useSCT():
            from AthenaCommon.AlgSequence import AthSequencer
            condSeq = AthSequencer("AthCondSeq")
            if not hasattr(condSeq, "InDet__SiDetElementsRoadCondAlg_xk"):
                from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadCondAlg_xk
                condSeq += InDet__SiDetElementsRoadCondAlg_xk(
                    name="InDet__SiDetElementsRoadCondAlg_xk")

            if not hasattr(condSeq,
                           "InDetSiDetElementBoundaryLinksSCTCondAlg"):
                from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk
                condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk(
                    name="InDetSiDetElementBoundaryLinksSCTCondAlg",
                    ReadKey="SCT_DetectorElementCollection",
                    WriteKey="SCT_DetElementBoundaryLinks_xk")

    #   #
    #   # --- Local track finding using sdCaloSeededSSSpace point seed
    #   #
    #   # @TODO ensure that PRD association map is used if usePrdAssociationTool is set
        is_dbm = InDetFlags.doDBMstandalone() or NewTrackingCuts.extension(
        ) == 'DBM'
        rot_creator_digital = TrackingCommon.getInDetRotCreatorDigital(
        ) if not is_dbm else TrackingCommon.getInDetRotCreatorDBM()

        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigSCTConditionsSummaryTool, InDetTrigPatternUpdator

        from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiCombinatorialTrackFinder_xk
        track_finder = InDet__SiCombinatorialTrackFinder_xk(
            name='%sInDetSiComTrackFinder%s' %
            (prefix, suffix),  #+NewTrackingCuts.extension(),
            PropagatorTool=InDetTrigPropagator,  #InDetPatternPropagator,
            UpdatorTool=InDetTrigPatternUpdator,  #InDetPatternUpdator,
            SctSummaryTool=InDetTrigSCTConditionsSummaryTool,
            RIOonTrackTool=rot_creator_digital,
            usePixel=DetFlags.haveRIO.pixel_on(),
            useSCT=DetFlags.haveRIO.SCT_on() if not is_dbm else False,
            PixelClusterContainer=TrigPixelKeys.
            Clusters,  #InDetKeys.PixelClusters(),
            SCT_ClusterContainer=TrigSCTKeys.Clusters
        )  #InDetKeys.SCT_Clusters())

        ToolSvc += track_finder
        if is_dbm:
            track_finder.MagneticFieldMode = "NoField"
            track_finder.TrackQualityCut = 9.3

        #track_finder.SctSummaryTool = InDetTrigSCTConditionsSummaryTool
        #if (DetFlags.haveRIO.SCT_on()):
        #   track_finder.SctSummaryTool = InDetSCT_ConditionsSummaryTool
        #else:
        #   track_finder.SctSummaryTool = None

    #   ToolSvc += track_finder

        useBremMode = NewTrackingCuts.mode(
        ) == "Offline" or NewTrackingCuts.mode(
        ) == "SLHC" or NewTrackingCuts.mode() == "DBM"
        from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk as SiTrackMaker
        InDetSiTrackMaker = SiTrackMaker(
            name='%sInDetSiTrackMaker%s' %
            (prefix, suffix),  #+NewTrackingCuts.extension(),
            useSCT=NewTrackingCuts.useSCT(),
            usePixel=NewTrackingCuts.usePixel(),
            RoadTool=InDetSiDetElementsRoadMaker,
            CombinatorialTrackFinder=track_finder,
            pTmin=NewTrackingCuts.minPT(),
            pTminBrem=NewTrackingCuts.minPTBrem(),
            pTminSSS=InDetFlags.pT_SSScut(),
            nClustersMin=NewTrackingCuts.minClusters(),
            nHolesMax=NewTrackingCuts.nHolesMax(),
            nHolesGapMax=NewTrackingCuts.nHolesGapMax(),
            SeedsFilterLevel=NewTrackingCuts.seedFilterLevel(),
            Xi2max=NewTrackingCuts.Xi2max(),
            Xi2maxNoAdd=NewTrackingCuts.Xi2maxNoAdd(),
            nWeightedClustersMin=NewTrackingCuts.nWeightedClustersMin(),
            CosmicTrack=InDetFlags.doCosmics(),
            Xi2maxMultiTracks=NewTrackingCuts.Xi2max(),  # was 3.
            useSSSseedsFilter=InDetFlags.doSSSfilter(),
            doMultiTracksProd=True,
            useBremModel=InDetFlags.doBremRecovery()
            and useBremMode,  # only for NewTracking the brem is debugged !!!
            doCaloSeededBrem=InDetFlags.doCaloSeededBrem(),
            doHadCaloSeedSSS=InDetFlags.doHadCaloSeededSSS(),
            phiWidth=NewTrackingCuts.phiWidthBrem(),
            etaWidth=NewTrackingCuts.etaWidthBrem(),
            InputClusterContainerName=InDetKeys.CaloClusterROIContainer(
            ),  # "InDetCaloClusterROIs" 
            InputHadClusterContainerName=InDetKeys.HadCaloClusterROIContainer(
            ),  # "InDetCaloClusterROIs" 
            UseAssociationTool=usePrdAssociationTool)

        ToolSvc += InDetSiTrackMaker

        #FIXME: do only cosmics for now, but change later
        #   if NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "VeryForwardSLHCTracks" :
        #      InDetSiTrackMaker.ITKGeometry = True

        #   if NewTrackingCuts.mode() == "DBM":
        #      InDetSiTrackMaker.MagneticFieldMode = "NoField"
        #      InDetSiTrackMaker.useBremModel = False
        #      InDetSiTrackMaker.doMultiTracksProd = False
        #      InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSPSeededFinder'
        #      InDetSiTrackMaker.pTminSSS = -1
        #      InDetSiTrackMaker.CosmicTrack = False
        #      InDetSiTrackMaker.useSSSseedsFilter = False
        #      InDetSiTrackMaker.doCaloSeededBrem = False
        #      InDetSiTrackMaker.doHadCaloSeedSSS = False

        #elif InDetFlags.doCosmics():
        #  InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_Cosmic'
        InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_Cosmic'
        #
        #   elif InDetFlags.doHeavyIon():
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_HeavyIon'
        #
        #   elif NewTrackingCuts.mode() == "LowPt":
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_LowMomentum'

        #   elif NewTrackingCuts.mode() == "VeryLowPt" or (NewTrackingCuts.mode() == "Pixel" and InDetFlags.doMinBias()):
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_VeryLowMomentum'

        #   elif NewTrackingCuts.mode() == "BeamGas":
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_BeamGas'

        #   elif NewTrackingCuts.mode() == "ForwardTracks":
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_ForwardTracks'

        #   elif NewTrackingCuts.mode() == "ForwardSLHCTracks":
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_ForwardSLHCTracks'

        #   elif NewTrackingCuts.mode() == "VeryForwardSLHCTracks":
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_VeryForwardSLHCTracks'

        #   elif NewTrackingCuts.mode() == "SLHCConversionFinding":
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_SLHCConversionTracks'

        #   elif NewTrackingCuts.mode() == "LargeD0" or NewTrackingCuts.mode() == "LowPtLargeD0":
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_LargeD0'
        #
        #   else:
        #     InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSPSeededFinder'
        #
        if InDetFlags.doStoreTrackSeeds():
            from SeedToTrackConversionTool.SeedToTrackConversionToolConf import InDet__SeedToTrackConversionTool
            InDet_SeedToTrackConversion = InDet__SeedToTrackConversionTool(
                name="%sInDet_SeedToTrackConversion%s" % (prefix, suffix),
                OutputName=InDetKeys.SiSPSeedSegments() +
                NewTrackingCuts.extension())
            InDetSiTrackMaker.SeedToTrackConversion = InDet_SeedToTrackConversion
            InDetSiTrackMaker.SeedSegmentsWrite = True

    #   #InDetSiTrackMaker.OutputLevel = VERBOSE
    #   ToolSvc += InDetSiTrackMaker
    #   if (InDetFlags.doPrintConfigurables()):
    #      printfunc (InDetSiTrackMaker)
    #   #
    #   # set output track collection name
    #  #
    #   self.__SiTrackCollection = SiSPSeededTrackCollectionKey
    #   #
    #   # --- Setup Track finder using space points seeds
    #   #

    #FIXME: which summary tool to use??
    # trackSummaryTool = TrackingCommon.getInDetTrackSummaryToolNoHoleSearch()
    #ToolSvc += trackSummaryTool
        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryTool

        from SiSPSeededTrackFinder.SiSPSeededTrackFinderConf import InDet__SiSPSeededTrackFinder
        InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(
            name='%sInDetSiSpTrackFinder%s' %
            (prefix, suffix),  # +NewTrackingCuts.extension(),
            TrackTool=InDetSiTrackMaker,
            PRDtoTrackMap=TrigPixelKeys.PRDtoTrackMap
            if usePrdAssociationTool else '',
            SpacePointsPixelName=TrigPixelKeys.SpacePoints,
            SpacePointsSCTName=TrigSCTKeys.SpacePoints,
            TrackSummaryTool=InDetTrigTrackSummaryTool,
            TracksLocation=outEFIDTracks,
            SeedsTool=InDetSiSpacePointsSeedMaker,
            useZvertexTool=InDetFlags.useZvertexTool(),
            ZvertexTool=InDetZvertexMaker)

        if NewTrackingCuts.mode(
        ) == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "ForwardTracks":
            InDetSiSPSeededTrackFinder.useNewStrategy = False
            InDetSiSPSeededTrackFinder.useMBTSTimeDiff = InDetFlags.useMBTSTimeDiff(
            )
            InDetSiSPSeededTrackFinder.useZBoundFinding = False
    #    if InDetFlags.doHeavyIon() :
    #     InDetSiSPSeededTrackFinder.FreeClustersCut = 2 #Heavy Ion optimization from Igor
        else:
            InDetSiSPSeededTrackFinder.useZvertexTool = InDetFlags.useZvertexTool(
            ) and NewTrackingCuts.mode() != "DBM"
            InDetSiSPSeededTrackFinder.useNewStrategy = InDetFlags.useNewSiSPSeededTF(
            ) and NewTrackingCuts.mode() != "DBM"
            InDetSiSPSeededTrackFinder.useMBTSTimeDiff = InDetFlags.useMBTSTimeDiff(
            )
            InDetSiSPSeededTrackFinder.useZBoundFinding = NewTrackingCuts.doZBoundary(
            ) and NewTrackingCuts.mode() != "DBM"

        viewAlgs.append(InDetSiSPSeededTrackFinder)

        #for alg in viewAlgs:
        #   print alg

    #    if InDetFlags.doHeavyIon() :
    #     InDetSiSPSeededTrackFinder.FreeClustersCut = 2 #Heavy Ion optimization from Igor

    #   #InDetSiSPSeededTrackFinder.OutputLevel =VERBOSE
    #   topSequence += InDetSiSPSeededTrackFinder
    #   if (InDetFlags.doPrintConfigurables()):
    #      printfunc (InDetSiSPSeededTrackFinder)

    #   if not InDetFlags.doSGDeletion():
    #      if InDetFlags.doTruth():
    #         #
    #         # set up the truth info for this container
    #         #
    #         include ("InDetRecExample/ConfiguredInDetTrackTruth.py")
    #         InDetTracksTruth = ConfiguredInDetTrackTruth(self.__SiTrackCollection,
    #                                                      self.__SiTrackCollection+"DetailedTruth",
    #                                                      self.__SiTrackCollection+"TruthCollection")
    #         #
    #         # add final output for statistics
    #         #
    #         TrackCollectionKeys      += [ InDetTracksTruth.Tracks() ]
    #         TrackCollectionTruthKeys += [ InDetTracksTruth.TracksTruth() ]
    #      else:
    #         TrackCollectionKeys      += [ self.__SiTrackCollection ]
    #

    #Convert final track collection to xAOD track particles
    from .InDetTrigCommon import getTrackParticleCnv
    viewAlgs.append(
        getTrackParticleCnv(prefix, suffix + "_EFID", outEFIDTracks,
                            outEFIDTrackParticles))

    #print viewAlgs
    #print 'VIEWS!', len(viewAlgs)
    #print(len(viewAlgs))

    return viewAlgs
Ejemplo n.º 23
0
    Xi2max=EFIDTrackingCutsLowPt.Xi2max(),
    Xi2maxNoAdd=EFIDTrackingCutsLowPt.Xi2maxNoAdd(),
    nWeightedClustersMin=EFIDTrackingCutsLowPt.nWeightedClustersMin(),
    CosmicTrack=False,
    UseAssociationTool=True)

ToolSvc += InDetTrigSiTrackMakerLowPt

if InDetTrigFlags.doAmbiSolving():

    import InDetRecExample.TrackingCommon as TrackingCommon
    from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetAmbiTrackSelectionTool
    InDetTrigAmbiTrackSelectionToolLowPt = \
        InDet__InDetAmbiTrackSelectionTool(name               = 'InDetTrigAmbiTrackSelectionToolLowPt',
                                           DriftCircleCutTool = InDetTrigTRTDriftCircleCut,
                                           AssociationTool    = TrackingCommon.getInDetTrigPRDtoTrackMapToolGangedPixels(),
                                           minHits         = EFIDTrackingCutsLowPt.minClusters()-2,
                                           minNotShared    = EFIDTrackingCutsLowPt.minSiNotShared(),
                                           maxShared       = EFIDTrackingCutsLowPt.maxShared(),
                                           minTRTHits      = 0,  # used for Si only tracking !!!
                                           Cosmics         = False,  #there is a different instance
                                           UseParameterization = False
                                           )

    ToolSvc += InDetTrigAmbiTrackSelectionToolLowPt
    if (InDetTrigFlags.doPrintConfigurables()):
        print(InDetTrigAmbiTrackSelectionToolLowPt)

    from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetAmbiScoringTool
    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTRTDriftCircleCut
    InDetTrigScoringToolLowPt = InDet__InDetAmbiScoringTool(
Ejemplo n.º 24
0
    InDetSiTrackMaker.BeamSpotKey = ""

# Set up SiSPSeededTrackFinder (alg)
# InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
from InDetRecExample import TrackingCommon as TrackingCommon
from SiSPSeededTrackFinder.SiSPSeededTrackFinderConf import InDet__SiSPSeededTrackFinder

InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(
    name="InDetSiSpTrackFinder" + NewTrackingCuts.extension(),
    TrackTool=InDetSiTrackMaker,
    TracksLocation=TracksLocation,
    SeedsTool=InDetSiSpacePointsSeedMaker,
    useZvertexTool=InDetFlags.useZvertexTool()
    and NewTrackingCuts.mode() != "DBM",
    ZvertexTool=InDetZvertexMaker,
    TrackSummaryTool=TrackingCommon.getInDetTrackSummaryToolNoHoleSearch(),
    useNewStrategy=InDetFlags.useNewSiSPSeededTF()
    and NewTrackingCuts.mode() != "DBM",
    useMBTSTimeDiff=InDetFlags.useMBTSTimeDiff(),
    useZBoundFinding=NewTrackingCuts.doZBoundary()
    and NewTrackingCuts.mode() != "DBM")
if not doBeamSpot:
    InDetSiSPSeededTrackFinder.BeamSpotKey = ""
if not doPixel:
    InDetSiSPSeededTrackFinder.SpacePointsPixelName = ""
if not doSCT:
    InDetSiSPSeededTrackFinder.SpacePointsSCTName = ""

if doPrint:
    printfunc(InDetSiSPSeededTrackFinder)
if numThreads >= 2:
Ejemplo n.º 25
0
    def __init__(self,
                 InputCollections=None,
                 NewTrackingCuts=None,
                 TrackCollectionKeys=[],
                 TrackCollectionTruthKeys=[]):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from InDetRecExample.InDetKeys import InDetKeys

        import InDetRecExample.TrackingCommon as TrackingCommon
        #
        # get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AppMgr import ServiceMgr
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        #
        # --- decide if use the association tool
        #
        asso_tool = None
        if len(InputCollections) > 0:
            usePrdAssociationTool = True
            prefix = 'InDetSegment'
            suffix = ''
            asso_tool = TrackingCommon.getConstPRD_AssociationTool(
                namePrefix=prefix, nameSuffix=suffix)
        else:
            prefix = ''
            suffix = ''
            usePrdAssociationTool = False

        # --- the PRD association tool is filled by the Segment making
        #     no need to run again

        # ------------------------------------------------------------
        #
        # ---------- TRT Seeded Tracking
        #
        # ------------------------------------------------------------

        if InDetFlags.doTRTSeededTrackFinder():
            #
            # --- decide which TRT seed space point finder to use
            #
            if InDetFlags.loadTRTSeededSPFinder():
                #
                # --- defaul space point finder
                #
                from TRT_SeededSpacePointFinderTool.TRT_SeededSpacePointFinderToolConf import InDet__TRT_SeededSpacePointFinder_ATL
                InDetTRT_SeededSpacePointFinder = \
                      InDet__TRT_SeededSpacePointFinder_ATL(name                   = 'InDetTRT_SeededSpFinder'  ,
                                                            SpacePointsSCTName     = InDetKeys.SCT_SpacePoints(),
                                                            SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(),
                                                            PRDtoTrackMap          = prefix+'PRDtoTrackMap'+suffix \
                                                                                        if usePrdAssociationTool else "",
                                                            NeighborSearch         = True,
                                                            LoadFull               = False,
                                                            DoCosmics              = InDetFlags.doCosmics(),
                                                            pTmin                  = NewTrackingCuts.minSecondaryPt())
                # InDetTRT_SeededSpacePointFinder.OutputLevel = VERBOSE

            elif InDetFlags.loadSimpleTRTSeededSPFinder():
                #
                # --- alternative version using the region selector
                #
                from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
                InDetRegSelSvc = RegSelSvcDefault()
                InDetRegSelSvc.enablePixel = DetFlags.pixel_on()
                InDetRegSelSvc.enableSCT = DetFlags.SCT_on()

                ServiceMgr += InDetRegSelSvc
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetRegSelSvc)

                from TRT_SeededSpacePointFinderTool.TRT_SeededSpacePointFinderToolConf import InDet__SimpleTRT_SeededSpacePointFinder_ATL
                InDetTRT_SeededSpacePointFinder = InDet__SimpleTRT_SeededSpacePointFinder_ATL(
                    name='InDetTRT_SeededSpFinder',
                    SpacePointsSCTName=InDetKeys.SCT_SpacePoints(),
                    SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
                    PerigeeCut=1000.,
                    DirectionPhiCut=.3,
                    DirectionEtaCut=1.,
                    MaxHoles=2,
                    AssociationTool=asso_tool,
                    RestrictROI=True)
                # InDetTRT_SeededSpacePointFinder.OutputLevel = VERBOSE
                if not usePrdAssociationTool:
                    InDetTRT_SeededSpacePointFinder.AssociationTool = None

            # add either into the Tool Service
            ToolSvc += InDetTRT_SeededSpacePointFinder
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_SeededSpacePointFinder)
            #
            # Silicon det elements road maker tool
            #
            from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk
            InDetTRT_SeededSiRoadMaker = InDet__SiDetElementsRoadMaker_xk(
                name='InDetTRT_SeededSiRoad',
                PropagatorTool=InDetPatternPropagator,
                usePixel=NewTrackingCuts.usePixel(),
                PixManagerLocation=InDetKeys.PixelManager(),
                useSCT=NewTrackingCuts.useSCT(),
                SCTManagerLocation=InDetKeys.SCT_Manager(),
                RoadWidth=35.,
                MaxStep=20.)  # NOT DEFAULT ?
            # InDetTRT_SeededSiRoadMaker.OutputLevel = VERBOSE
            if InDetFlags.doCosmics():
                InDetTRT_SeededSiRoadMaker.RoadWidth = 50
            # Condition algorithm for InDet__SiDetElementsRoadMaker_xk
            if NewTrackingCuts.useSCT():
                from AthenaCommon.AlgSequence import AthSequencer
                condSeq = AthSequencer("AthCondSeq")
                if not hasattr(condSeq, "InDet__SiDetElementsRoadCondAlg_xk"):
                    from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadCondAlg_xk
                    condSeq += InDet__SiDetElementsRoadCondAlg_xk(
                        name="InDet__SiDetElementsRoadCondAlg_xk")

            ToolSvc += InDetTRT_SeededSiRoadMaker
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_SeededSiRoadMaker)
            #
            # --- TRT seeded back tracking tool
            #
            from TRT_SeededTrackFinderTool.TRT_SeededTrackFinderToolConf import InDet__TRT_SeededTrackFinder_ATL
            InDetTRT_SeededTrackTool = InDet__TRT_SeededTrackFinder_ATL(
                name='InDetTRT_SeededTrackMaker',
                PropagatorTool=InDetPatternPropagator,
                UpdatorTool=InDetPatternUpdator,
                RoadTool=InDetTRT_SeededSiRoadMaker,
                SeedTool=InDetTRT_SeededSpacePointFinder,
                CombinatorialTrackFinder=InDetSiComTrackFinder,
                pTmin=NewTrackingCuts.minSecondaryPt(),
                nHolesMax=NewTrackingCuts.SecondarynHolesMax(),
                # ME bugfix: nHolesGapMax             = 2*NewTrackingCuts.SecondarynHolesGapMax(),
                nHolesGapMax=NewTrackingCuts.SecondarynHolesGapMax(),
                Xi2max=NewTrackingCuts.SecondaryXi2max(),
                Xi2maxNoAdd=NewTrackingCuts.SecondaryXi2maxNoAdd(),
                SearchInCaloROI=False,
                InputClusterContainerName=InDetKeys.CaloClusterROIContainer(),
                ConsistentSeeds=True,
                # BremCorrection           = True,
                BremCorrection=False)
            if InDetFlags.doCosmics():
                InDetTRT_SeededTrackTool.nWClustersMin = 0

            ToolSvc += InDetTRT_SeededTrackTool
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_SeededTrackTool)

            #
            # --- Output key for the finder
            #
            self.__TRTSeededTracks = InDetKeys.TRTSeededTracks()
            #
            # TRT seeded back tracking algorithm

            from AthenaCommon import CfgGetter
            from TRT_SeededTrackFinder.TRT_SeededTrackFinderConf import InDet__TRT_SeededTrackFinder
            import InDetRecExample.TrackingCommon as TrackingCommon
            InDetTRT_SeededTrackFinder = InDet__TRT_SeededTrackFinder(name                  = 'InDetTRT_SeededTrackFinder',
                                                                      RefitterTool          = CfgGetter.getPublicTool('InDetTrackFitter'),
                                                                      TrackTool             = InDetTRT_SeededTrackTool,
                                                                      PRDtoTrackMap         = prefix+'PRDtoTrackMap'+suffix \
                                                                                                  if usePrdAssociationTool else "",
                                                                      TrackSummaryTool      = TrackingCommon.getInDetTrackSummaryToolNoHoleSearch(),
                                                                      TrackExtensionTool    = InDetTRTExtensionTool,
                                                                      MinTRTonSegment       = NewTrackingCuts.minSecondaryTRTonTrk(),
                                                                      MinTRTonly            = NewTrackingCuts.minTRTonly(),
                                                                      TrtExtension          = True,
                                                                      SiExtensionCuts       = NewTrackingCuts.SiExtensionCuts(),
                                                                      minPt                 = NewTrackingCuts.minSecondaryPt(),
                                                                      maxRPhiImp            = NewTrackingCuts.maxSecondaryImpact(),
                                                                      maxZImp               = NewTrackingCuts.maxZImpact(),
                                                                      maxEta                = NewTrackingCuts.maxEta(),
                                                                      Extrapolator          = TrackingCommon.getInDetExtrapolator(),
                                                                      RejectShortExtension  = NewTrackingCuts.rejectShortExtensions(),
                                                                      FinalRefit            = False,
                                                                      FinalStatistics       = False,
                                                                      OutputSegments        = False,
                                                                      InputSegmentsLocation = InDetKeys.TRT_Segments(),
                                                                      OutputTracksLocation  = self.__TRTSeededTracks,
                                                                      CaloClusterEt         = NewTrackingCuts.minRoIClusterEt())

            if (NewTrackingCuts.RoISeededBackTracking()):
                from RegionSelector.RegSelToolConfig import makeRegSelTool_SCT
                InDetTRT_SeededTrackFinder.RegSelTool = makeRegSelTool_SCT()
                InDetTRT_SeededTrackFinder.CaloSeededRoI = True
            # InDetTRT_SeededTrackFinder.OutputLevel = VERBOSE
            topSequence += InDetTRT_SeededTrackFinder
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_SeededTrackFinder)

            #
            # ------------ Track truth.
            #
            if not InDetFlags.doSGDeletion():
                if InDetFlags.doTruth():
                    #
                    # set up the truth info for this container
                    #
                    include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                    InDetTracksTruth = ConfiguredInDetTrackTruth(
                        self.__TRTSeededTracks,
                        self.__TRTSeededTracks + "DetailedTruth",
                        self.__TRTSeededTracks + "TruthCollection")
                    #
                    # add final output for statistics
                    #
                    TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                    TrackCollectionTruthKeys += [
                        InDetTracksTruth.TracksTruth()
                    ]
                else:
                    TrackCollectionKeys += [self.__TRTSeededTracks]

            # --- output track collection
            self.__BackTrackingTracks = self.__TRTSeededTracks

        # ------------------------------------------------------------
        #
        # --- Resolve back tracking tracks ?
        #
        # ------------------------------------------------------------

        if InDetFlags.doResolveBackTracks():
            #
            # --- set up special Scoring Tool for TRT seeded tracks
            #
            if InDetFlags.doCosmics():
                InDetTRT_SeededScoringTool = TrackingCommon.getInDetCosmicScoringTool_TRT(
                    NewTrackingCuts)
                InDetTRT_SeededSummaryTool = TrackingCommon.getInDetTrackSummaryToolSharedHits(
                )
            else:
                InDetTRT_SeededScoringTool = TrackingCommon.getInDetTRT_SeededScoringTool(
                    NewTrackingCuts)
                InDetTRT_SeededSummaryTool = TrackingCommon.getInDetTrackSummaryTool(
                )

            #
            # --- Load selection tool
            #
            from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetAmbiTrackSelectionTool
            InDetTRT_SeededAmbiTrackSelectionTool = InDet__InDetAmbiTrackSelectionTool(
                name='InDetTRT_SeededAmbiTrackSelectionTool',
                DriftCircleCutTool=InDetTRTDriftCircleCut,
                AssociationTool=TrackingCommon.
                getInDetPRDtoTrackMapToolGangedPixels(),
                minScoreShareTracks=-1.,  # off !
                minHits=NewTrackingCuts.minSecondaryClusters(),
                minNotShared=NewTrackingCuts.minSecondarySiNotShared(),
                maxShared=NewTrackingCuts.maxSecondaryShared(),
                minTRTHits=NewTrackingCuts.minSecondaryTRTonTrk(),
                UseParameterization=NewTrackingCuts.useParameterizedTRTCuts(),
                Cosmics=InDetFlags.doCosmics(),
                doPixelSplitting=InDetFlags.doPixelClusterSplitting())

            # InDetTRT_SeededAmbiTrackSelectionTool.OutputLevel = DEBUG
            ToolSvc += InDetTRT_SeededAmbiTrackSelectionTool
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_SeededAmbiTrackSelectionTool)

            #
            # --- load Ambiguity Processor
            #
            from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool
            InDetTRT_SeededAmbiguityProcessor = Trk__SimpleAmbiguityProcessorTool(
                name='InDetTRT_SeededAmbiguityProcessor',
                Fitter=CfgGetter.getPublicTool('InDetTrackFitter'),
                AssociationTool=TrackingCommon.
                getInDetPRDtoTrackMapToolGangedPixels(),
                TrackSummaryTool=InDetTRT_SeededSummaryTool,
                SelectionTool=InDetTRT_SeededAmbiTrackSelectionTool,
                RefitPrds=not InDetFlags.refitROT(),
                SuppressTrackFit=False,
                SuppressHoleSearch=False,
                ScoringTool=InDetTRT_SeededScoringTool)
            # InDetTRT_SeededAmbiguityProcessor.OutputLevel = DEBUG
            if InDetFlags.materialInteractions():
                InDetTRT_SeededAmbiguityProcessor.MatEffects = InDetFlags.materialInteractionsType(
                )
            else:
                InDetTRT_SeededAmbiguityProcessor.MatEffects = 0
            #
            ToolSvc += InDetTRT_SeededAmbiguityProcessor
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_SeededAmbiguityProcessor)

            #
            # --- load the algorithm
            #

            from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguityScore
            InDetAmbiguityScore = Trk__TrkAmbiguityScore(
                name='InDetTRT_SeededAmbiguityScore',
                TrackInput=[self.__TRTSeededTracks],
                TrackOutput='ScoredMap' + 'InDetTRT_SeededAmbiguityScore')
            topSequence += InDetAmbiguityScore

            self.__ResolvedTRTSeededTracks = InDetKeys.ResolvedTRTSeededTracks(
            )
            #
            from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguitySolver
            InDetTRT_SeededAmbiguitySolver = Trk__TrkAmbiguitySolver(
                name='InDetTRT_SeededAmbiguitySolver',
                TrackInput='ScoredMap' + 'InDetTRT_SeededAmbiguityScore',
                TrackOutput=self.__ResolvedTRTSeededTracks,
                AmbiguityProcessor=InDetTRT_SeededAmbiguityProcessor)
            topSequence += InDetTRT_SeededAmbiguitySolver
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_SeededAmbiguitySolver)

            # --- Delete (non-resloved) TRT seeded tracks
            from InDetRecExample.ConfiguredInDetSGDeletion import InDetSGDeletionAlg
            InDetSGDeletionAlg(key=InDetKeys.TRTSeededTracks())

            #
            # ------------ Track truth.
            #
            if not InDetFlags.doSGDeletion():
                if InDetFlags.doTruth():
                    #
                    # set up the truth info for this container
                    #
                    include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                    InDetTracksTruth = ConfiguredInDetTrackTruth(
                        self.__ResolvedTRTSeededTracks,
                        self.__ResolvedTRTSeededTracks + "DetailedTruth",
                        self.__ResolvedTRTSeededTracks + "TruthCollection")
                    #
                    # add final output for statistics
                    #
                    TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                    TrackCollectionTruthKeys += [
                        InDetTracksTruth.TracksTruth()
                    ]
                else:
                    TrackCollectionKeys += [self.__ResolvedTRTSeededTracks]

            # --- output track collection
            self.__BackTrackingTracks = self.__ResolvedTRTSeededTracks
Ejemplo n.º 26
0
    def __init__(self, name="EMBremCollectionBuilder", **kw):
        mlog = logging.getLogger(name + '::__init__')
        mlog.info("entering")

        super(egammaBremCollectionBuilder, self).__init__(name, **kw)

        import egammaRec.EMCommonRefitter

        # Extrapolator to be used for GSF (private)
        GSFBuildInDetExtrapolator = egammaExtrapolator()

        # GsfReffiter (private not in ToolSvc)
        from egammaTrackTools.egammaTrackToolsConf import egammaTrkRefitterTool
        GSFRefitterTool = egammaTrkRefitterTool(
            name='GSFRefitterTool',
            FitterTool=egammaRec.EMCommonRefitter.getGSFTrackFitter(),
            useBeamSpot=False,
            Extrapolator=GSFBuildInDetExtrapolator,
            ReintegrateOutliers=True)

        #
        #  BLayer and Pixel Related Tools (private = True)
        #
        GSFBuildTestBLayerTool = None
        GSFBuildPixelToTPIDTool = None
        if DetFlags.haveRIO.pixel_on():
            GSFPixelConditionsSummaryTool = (
                TrackingCommon.getInDetPixelConditionsSummaryTool())
            if InDetFlags.usePixelDCS():
                GSFPixelConditionsSummaryTool.IsActiveStates = [
                    'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED'
                ]
                GSFPixelConditionsSummaryTool.IsActiveStatus = [
                    'OK', 'WARNING', 'ERROR', 'FATAL'
                ]

            GSFBuildTestBLayerTool = TrackingCommon.getInDetRecTestBLayerTool(
                name="GSFBuildTestBLayerTool",
                PixelSummaryTool=GSFPixelConditionsSummaryTool,
                Extrapolator=GSFBuildInDetExtrapolator,
                private=True)

            GSFBuildPixelToTPIDTool = TrackingCommon.getInDetPixelToTPIDTool(
                name="GSFBuildPixelToTPIDTool", private=True)
        #
        #  TRT_ElectronPidTool (private =True)
        #
        GSFBuildTRT_ElectronPidTool = None
        if DetFlags.haveRIO.TRT_on(
        ) and not InDetFlags.doSLHC() and not InDetFlags.doHighPileup():
            GSFBuildTRT_ElectronPidTool = (
                TrackingCommon.getInDetTRT_ElectronPidTool(
                    name="GSFBuildTRT_ElectronPidTool", private=True))

        #
        #  InDet Track Summary Helper, no Association and no hole
        #  as we do not redo them (private = true)
        #
        GSFBuildTrackSummaryHelperTool = TrackingCommon.getInDetSummaryHelper(
            name="GSFBuildTrackSummaryHelperTool",
            AssoTool=None,
            HoleSearch=None,
            PixelToTPIDTool=GSFBuildPixelToTPIDTool,
            TestBLayerTool=GSFBuildTestBLayerTool,
            DoSharedHits=False,
            private=True)

        #
        #  TrkTrackSummaryTool: no shared hits  no hole search
        #  still public due to TrackParticleCreatorTool
        #
        GSFBuildInDetTrackSummaryTool = (
            TrackingCommon.getInDetTrackSummaryTool(
                name="GSFBuildInDetTrackSummaryTool",
                InDetSummaryHelperTool=GSFBuildTrackSummaryHelperTool,
                doSharedHits=False,
                doHolesInDet=False,
                TRT_ElectronPidTool=GSFBuildTRT_ElectronPidTool,
                PixelToTPIDTool=GSFBuildPixelToTPIDTool))

        #
        #  Track Particle Creator tool (private not in ToolSvc)
        #  But needs a public extrapolator and
        #  InDetTrackSummaryTool still...
        #
        from TrkParticleCreator.TrkParticleCreatorConf import (
            Trk__TrackParticleCreatorTool)

        GSFBuildInDetParticleCreatorTool = Trk__TrackParticleCreatorTool(
            name="GSFBuildInDetParticleCreatorTool",
            KeepParameters=True,
            Extrapolator=AtlasPublicExtrapolator(),
            TrackSummaryTool=GSFBuildInDetTrackSummaryTool,
            UseTrackSummaryTool=False)
        #
        #  Track slimming (private not in ToolSvc)
        #
        from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import (
            Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool)
        GSFBuildInDetTrkSlimmingTool = ConfigurableTrackSlimmingTool(
            name="GSFBuildInDetTrackSlimmingTool",
            KeepParameters=False,
            KeepOutliers=True)
        #
        #  Default Configuration
        #
        self.TrackRefitTool = GSFRefitterTool
        self.TrackParticleCreatorTool = GSFBuildInDetParticleCreatorTool
        self.TrackSlimmingTool = GSFBuildInDetTrkSlimmingTool
        self.TrackSummaryTool = GSFBuildInDetTrackSummaryTool
Ejemplo n.º 27
0
def vertexFinderTool_builder( signature ) : 

    from AthenaCommon.AppMgr import ToolSvc

    # use the getters from TrackingCommon ... 
    import InDetRecExample.TrackingCommon as TrackingCommon
   
    # the track summary tool, and extrapolator will be needed by multiple 
    # tools so create them once and pass them into the builders ...  

    trackSummaryTool = TrackingCommon.getInDetTrackSummaryTool()
    extrapolator     = TrackingCommon.getInDetExtrapolator()

    # get the selection cuts use to select the actual tracks in the tool ...
    from InDetTrigRecExample.TrigInDetConfiguredVtxCuts import ConfiguredTrigVtxCuts 
    vtxcuts = ConfiguredTrigVtxCuts() 
    vtxcuts.printInfo()

    
    # now create the five sub tools needed ...

    linearTrackFactory     =     linearTrackFactory_builder( signature, extrapolator )
    vertexFitterTool       =       vertexFitterTool_builder( signature, linearTrackFactory, extrapolator )
    impactEstimator        =        impactEstimator_builder( signature, extrapolator )
    trackSelectorTool      =      trackSelectorTool_builder( signature, trackSummaryTool, extrapolator, vtxcuts )
    trackDensitySeedFinder = trackDensitySeedFinder_builder( signature )
    
    # now create the actual vertex finder tool ...
    # this is the main part of the actual working part of the code - 
    # the vertoces are found by this class, in this instance it includes
    # a beam line constraint - it we want this to allow this constrain 
    # to be disabled we can add a flag and some additional logic 

    from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetIterativePriVxFinderTool
    
    vertexFinderTool = InDet__InDetIterativePriVxFinderTool( name                     = "InDetTrigPriVxFinderTool" + signature,
                                                             VertexFitterTool         = vertexFitterTool,
                                                             TrackSelector            = trackSelectorTool,
                                                             SeedFinder               = trackDensitySeedFinder,
                                                             ImpactPoint3dEstimator   = impactEstimator,
                                                             LinearizedTrackFactory   = linearTrackFactory,
                                                             useBeamConstraint        = True,
                                                             significanceCutSeeding   = 12,
                                                             maximumChi2cutForSeeding = 49,
                                                             maxVertices              = 200,
                                                             createSplitVertices      = False,
                                                             doMaxTracksCut           = vtxcuts.doMaxTracksCut(),
                                                             MaxTracks                = vtxcuts.MaxTracks() )
                                                           
    
 # InDetAdaptiveMultiPriVxFinderTool job options for later 
 #  verxtexFinderTool = InDet__InDetAdaptiveMultiPriVxFinderTool( name = "InDetTrigPriVxFinderTool" + signature,
 #                                                             VertexFitterTool         = vertexFitterTool,
 #  ...

 # VertexFitterTool  = vertexFitterTool,
 # TrackSelector     = trackSelectorTool,
 # SeedFinder        = trackDensitySeedFinder,
 
 # IPEstimator       = Trk::ITrackToVertexIPEstimator  : impactEstimator is different type than for IterativeFinder 
 # BeamSpotKey       = InDet::BeamSpotData  : what is this ??

 # TracksMaxZinterval = 
 # maxVertexChi2 = 
 # finalCutMaxVertexChi2 = 
 # cutVertexDependence = 
 # MinWeight = 
 # realMultiVertex = 
 # useFastCompatibility = 
 # useBeamConstraint = 
 # addSingleTrackVertices = 
 # tracksMaxSignificance = 
 # m_useSeedConstraint = 
 # selectiontype = 
 # //==0 for sum p_t^2
 # //==1 for NN
 # //==2 for min bias compatibility estimation (in the future)
 # maxIterations = 
 # do3dSplitting = 
 # zBfieldApprox = 
 # maximumVertexContamination = 

    ToolSvc += vertexFinderTool
   
    return vertexFinderTool
Ejemplo n.º 28
0
      if (InDetFlags.doPrintConfigurables()):
          printfunc (InDetGlobalErrorMonTool)

  
  ##################################################
  #                                                #
  # TRACK MONITORING                               #
  #                                                #
  ##################################################
      
  from InDetGlobalMonitoring.InDetGlobalMonitoringConf import InDetGlobalTrackMonTool
  InDetGlobalTrackMonTool=InDetGlobalTrackMonTool( name          = "InDetGlobalTrackMonTool",
                                                   histoPathBase = "/GLOBAL",
                                                   DoIBL         = InDetFlags.doIBL(),
                                                   trackMax      = 75,
                                                   TrackToVertexIPEstimator = TrackingCommon.getTrackToVertexIPEstimator() )

  TrackCollection = InDetKeys.UnslimmedTracks()

  from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool 
  InDetTrackSelectionToolGlobalMon_Baseline = InDet__InDetTrackSelectionTool(name = "InDetTrackSelectionToolGlobalMon_Baseline",
                                                                                 UseTrkTrackTools = True,
                                                                                 CutLevel = "TightPrimary",
                                                                                 maxNPixelHoles = 1,
                                                                                 minPt = 5000,
                                                                                 TrackSummaryTool    = TrackingCommon.getInDetTrackSummaryTool(),
                                                                                 Extrapolator        = TrackingCommon.getInDetExtrapolator())

  InDetTrackSelectionToolGlobalMon_TightPrimary = InDet__InDetTrackSelectionTool(name = "InDetTrackSelectionToolGlobalMon_TightPrimary",
                                                                                 UseTrkTrackTools = True,
                                                                                 CutLevel = "TightPrimary",
Ejemplo n.º 29
0
CombinedMuonIDBoundaryCheckTool = InDet__InDetBoundaryCheckTool(
    name="CombinedMuonIDBoundaryCheckTool",
    UsePixel=DetFlags.haveRIO.pixel_on(),
    UseSCT=DetFlags.haveRIO.SCT_on())
ToolSvc += CombinedMuonIDBoundaryCheckTool

# load InDetHoleSearchTool
from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
ToolSvc += InDet__InDetTrackHoleSearchTool( \
  name                         = "CombinedMuonIDHoleSearch",
Extrapolator                 = atlasExtrapolator,
BoundaryCheckTool            = CombinedMuonIDBoundaryCheckTool,
CountDeadModulesAfterLastHit = True)

import InDetRecExample.TrackingCommon as TrackingCommon
InDetPixelConditionsSummaryTool = TrackingCommon.getInDetPixelConditionsSummaryTool(
)

if muonCombinedRecFlags.useDetailedPixelHoleSearch():
    # now get the InDet tools as used for InDet tracks
    #   (duplication for ESD running in case InDet not rerun)
    #   attention: defaults defined first with some DetFlag specific properties added further down
    from InDetTestPixelLayer.InDetTestPixelLayerConf import InDet__InDetTestPixelLayerTool
    ToolSvc += InDet__InDetTestPixelLayerTool(
        name="CombinedMuonInDetTestPixelLayerTool",
        Extrapolator=atlasExtrapolator,
        CheckActiveAreas=True,
        CheckDeadRegions=True)
    ToolSvc.CombinedMuonIDHoleSearch.PixelLayerTool = ToolSvc.CombinedMuonInDetTestPixelLayerTool

if beamFlags.beamType() == 'cosmics':
    ToolSvc.CombinedMuonIDHoleSearch.Cosmics = True
Ejemplo n.º 30
0
    def __init__(self, useTimeInfo=True, usePhase=False):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from AthenaCommon.DetFlags import DetFlags
        from AthenaCommon.GlobalFlags import globalflags
        from AthenaCommon.BeamFlags import jobproperties
        #
        # get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        if InDetFlags.doPRDFormation() and DetFlags.makeRIO.TRT_on(
        ) and InDetFlags.doTRT_PRDFormation():

            #
            # --- setup naming of tools and algs
            #
            if useTimeInfo:
                prefix = "InDetTRT_"
                collection = InDetKeys.TRT_DriftCircles()
                if InDetFlags.doSplitReco():
                    collectionPU = InDetKeys.TRT_PU_DriftCircles()
            else:
                prefix = "InDetTRT_noTime_"
                collection = InDetKeys.TRT_DriftCirclesUncalibrated()
                if InDetFlags.doSplitReco():
                    collectionPU = InDetKeys.TRT_PU_DriftCirclesUncalibrated()
            # Calibration DB Service
            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
            InDetTRTCalDbTool = TRT_CalDbTool(name="TRT_CalDbTool")

            #
            # --- TRT_DriftFunctionTool
            #

            from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
            InDetTRT_DriftFunctionTool = TRT_DriftFunctionTool(
                name=prefix + "DriftFunctionTool",
                TRTCalDbTool=InDetTRTCalDbTool)
            # --- overwrite for uncalibrated DC production
            if (not useTimeInfo) or InDetFlags.noTRTTiming():
                InDetTRT_DriftFunctionTool.DummyMode = True
                InDetTRT_DriftFunctionTool.UniversalError = 1.15

            # --- set Data/MC flag
            if (globalflags.DataSource != 'geant4'):
                InDetTRT_DriftFunctionTool.IsMC = False
            else:
                InDetTRT_DriftFunctionTool.IsMC = True

            # --- overwrite for calibration of MC
            if usePhase and jobproperties.Beam.beamType(
            ) == 'cosmics' and globalflags.DataSource == "geant4":
                InDetTRT_DriftFunctionTool.AllowDigiVersionOverride = True
                InDetTRT_DriftFunctionTool.ForcedDigiVersion = 9

            # --- set HT corrections
            InDetTRT_DriftFunctionTool.HTCorrectionBarrelXe = 1.5205
            InDetTRT_DriftFunctionTool.HTCorrectionEndcapXe = 1.2712
            InDetTRT_DriftFunctionTool.HTCorrectionBarrelAr = 1.5205
            InDetTRT_DriftFunctionTool.HTCorrectionEndcapAr = 1.2712

            # --- set ToT corrections
            InDetTRT_DriftFunctionTool.ToTCorrectionsBarrelXe = [
                0., 4.358121, 3.032195, 1.631892, 0.7408397, -0.004113,
                -0.613288, -0.73758, -0.623346, -0.561229, -0.29828, -0.21344,
                -0.322892, -0.386718, -0.534751, -0.874178, -1.231799,
                -1.503689, -1.896464, -2.385958
            ]
            InDetTRT_DriftFunctionTool.ToTCorrectionsEndcapXe = [
                0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979,
                -0.082819, -0.457485, -0.599706, -0.427493, -0.328962,
                -0.403399, -0.663656, -1.029428, -1.46008, -1.919092,
                -2.151582, -2.285481, -2.036822, -2.15805
            ]
            InDetTRT_DriftFunctionTool.ToTCorrectionsBarrelAr = [
                0., 4.358121, 3.032195, 1.631892, 0.7408397, -0.004113,
                -0.613288, -0.73758, -0.623346, -0.561229, -0.29828, -0.21344,
                -0.322892, -0.386718, -0.534751, -0.874178, -1.231799,
                -1.503689, -1.896464, -2.385958
            ]
            InDetTRT_DriftFunctionTool.ToTCorrectionsEndcapAr = [
                0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979,
                -0.082819, -0.457485, -0.599706, -0.427493, -0.328962,
                -0.403399, -0.663656, -1.029428, -1.46008, -1.919092,
                -2.151582, -2.285481, -2.036822, -2.15805
            ]
            # Second calibration DB Service in case pile-up and physics hits have different calibrations
            if DetFlags.overlay.TRT_on():
                InDetTRTCalDbTool2 = TRT_CalDbTool(name="TRT_CalDbTool2")
                InDetTRTCalDbTool2.RtFolderName = "/TRT/Calib/MC/RT"
                InDetTRTCalDbTool2.T0FolderName = "/TRT/Calib/MC/T0"
                InDetTRT_DriftFunctionTool.TRTCalDbTool2 = InDetTRTCalDbTool2
                InDetTRT_DriftFunctionTool.IsOverlay = True
                InDetTRT_DriftFunctionTool.IsMC = False

            ToolSvc += InDetTRT_DriftFunctionTool
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_DriftFunctionTool)

            # Straw status DB Tool
            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
            InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(
                name="TRT_StrawStatusSummaryTool",
                isGEANT4=(globalflags.DataSource == 'geant4'))

            #
            # --- TRT_DriftCircleTool
            #
            if usePhase:
                from TRT_DriftCircleTool.TRT_DriftCircleToolConf import InDet__TRT_DriftCircleToolCosmics as InDet__TRT_DriftCircleTool
            else:
                from TRT_DriftCircleTool.TRT_DriftCircleToolConf import InDet__TRT_DriftCircleTool

            #
            # set gating values for MC/DATA
            MinTrailingEdge = 11.0 * ns
            MaxDriftTime = 60.0 * ns
            LowGate = 14.0625 * ns  # 4.5*3.125 ns
            HighGate = 42.1875 * ns  # LowGate + 9*3.125 ns
            LowGateArgon = LowGate
            HighGateArgon = HighGate

            if InDetFlags.doCosmics():
                LowGate = 19.0 * ns
                HighGate = 44.0 * ns
                LowGateArgon = 19.0 * ns
                HighGateArgon = 44.0 * ns

            if globalflags.DataSource == 'data':
                MinTrailingEdge = 11.0 * ns
                MaxDriftTime = 60.0 * ns
                LowGate = 17.1875 * ns
                HighGate = 45.3125 * ns
                LowGateArgon = 18.75 * ns
                HighGateArgon = 43.75 * ns
                if InDetFlags.doCosmics():
                    LowGate = 19.0 * ns
                    HighGate = 44.0 * ns
                    LowGateArgon = 19.0 * ns
                    HighGateArgon = 44.0 * ns

            InDetTRT_DriftCircleTool = InDet__TRT_DriftCircleTool(
                name=prefix + "DriftCircleTool",
                TRTDriftFunctionTool=InDetTRT_DriftFunctionTool,
                ConditionsSummaryTool=InDetTRTStrawStatusSummaryTool,
                UseConditionsStatus=True,
                UseConditionsHTStatus=True,
                SimpleOutOfTimePileupSupression=False,
                RejectIfFirstBit=False,  # fixes 50 nsec issue 
                MinTrailingEdge=MinTrailingEdge,
                MaxDriftTime=MaxDriftTime,
                ValidityGateSuppression=InDetFlags.InDet25nsec(),
                LowGate=LowGate,
                HighGate=HighGate,
                SimpleOutOfTimePileupSupressionArgon=False,
                RejectIfFirstBitArgon=False,  # fixes 50 nsec issue 
                MinTrailingEdgeArgon=MinTrailingEdge,
                MaxDriftTimeArgon=MaxDriftTime,
                ValidityGateSuppressionArgon=InDetFlags.InDet25nsec(),
                LowGateArgon=LowGate,
                HighGateArgon=HighGate,
                useDriftTimeHTCorrection=True,
                useDriftTimeToTCorrection=True)
            if not usePhase:
                from InDetRecExample import TrackingCommon
                InDetTRT_DriftCircleTool.LumiDataKey = TrackingCommon.getLumiCondDataKeyForTRTMuScaling(
                )

            ToolSvc += InDetTRT_DriftCircleTool
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_DriftCircleTool)

            #
            # --- TRT_RIO_Maker Algorithm
            #
            from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__TRT_RIO_Maker
            InDetTRT_RIO_Maker = InDet__TRT_RIO_Maker(
                name=prefix + "RIO_Maker",
                TRT_DriftCircleTool=InDetTRT_DriftCircleTool,
                TrtDescrManageLocation=InDetKeys.TRT_Manager(),
                TRTRDOLocation=InDetKeys.TRT_RDOs(),
                TRTRIOLocation=collection)
            topSequence += InDetTRT_RIO_Maker
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_RIO_Maker)
            if InDetFlags.doSplitReco():
                InDetTRT_RIO_MakerPU = InDet__TRT_RIO_Maker(
                    name=prefix + "RIO_MakerPU",
                    TRT_DriftCircleTool=InDetTRT_DriftCircleTool,
                    TrtDescrManageLocation=InDetKeys.TRT_Manager(),
                    TRTRDOLocation=InDetKeys.TRT_PU_RDOs(),
                    TRTRIOLocation=collectionPU)
                topSequence += InDetTRT_RIO_MakerPU
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetTRT_RIO_MakerPU)

            #
            #    Include alg to save the local occupancy inside xAOD::EventInfo
            #
            if InDetFlags.doTRTGlobalOccupancy():
                from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
                InDetTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(
                    name="InDet_TRT_LocalOccupancy",
                    isTrigger=False,
                    TRTCalDbTool=InDetTRTCalDbTool,
                    TRTStrawStatusSummaryTool=InDetTRTStrawStatusSummaryTool)

                ToolSvc += InDetTRT_LocalOccupancy
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetTRT_LocalOccupancy)

                from TRT_CalibAlgs.TRT_CalibAlgsConf import TRTOccupancyInclude
                TRTOccupancyInclude = TRTOccupancyInclude(
                    name=prefix + "TRTOccupancyInclude",
                    TRT_LocalOccupancyTool=InDetTRT_LocalOccupancy)

                topSequence += TRTOccupancyInclude
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(TRTOccupancyInclude)

            #
            # --- we need to do truth association if requested (not for uncalibrated hits in cosmics)
            #
            if InDetFlags.doTruth() and useTimeInfo:
                from InDetTruthAlgs.InDetTruthAlgsConf import InDet__PRD_MultiTruthMaker
                InDetPRD_MultiTruthMakerTRT = InDet__PRD_MultiTruthMaker(
                    name=prefix + "PRD_MultiTruthMaker",
                    PixelClusterContainerName="",
                    SCTClusterContainerName="",
                    TRTDriftCircleContainerName=InDetKeys.TRT_DriftCircles(),
                    SimDataMapNamePixel="",
                    SimDataMapNameSCT="",
                    SimDataMapNameTRT=InDetKeys.TRT_SDOs(),
                    TruthNamePixel="",
                    TruthNameSCT="",
                    TruthNameTRT=InDetKeys.TRT_DriftCirclesTruth())
                topSequence += InDetPRD_MultiTruthMakerTRT
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetPRD_MultiTruthMakerTRT)

                if InDetFlags.doSplitReco():
                    InDetPRD_MultiTruthMakerTRTPU = InDet__PRD_MultiTruthMaker(
                        name=prefix + "PRD_MultiTruthMakerPU",
                        PixelClusterContainerName="",
                        SCTClusterContainerName="",
                        TRTDriftCircleContainerName=InDetKeys.
                        TRT_PU_DriftCircles(),
                        SimDataMapNamePixel="",
                        SimDataMapNameSCT="",
                        SimDataMapNameTRT=InDetKeys.TRT_PU_SDOs(),
                        TruthNamePixel="",
                        TruthNameSCT="",
                        TruthNameTRT=InDetKeys.TRT_PU_DriftCirclesTruth())
                    topSequence += InDetPRD_MultiTruthMakerTRTPU
                    if (InDetFlags.doPrintConfigurables()):
                        printfunc(InDetPRD_MultiTruthMakerTRTPU)