Ejemplo n.º 1
0
    def __init__(self,
                 instname='InDetAlignTrackSelTool',
                 propagatorType='RungeKutta'):

        # Load the Dlls
        if 'InDetAlignGenTools' not in theApp.Dlls:
            theApp.Dlls += ['InDetAlignGenTools']

        # Set names
        self.__instname__ = instname
        self.__svcname__ = 'InDetAlignTrackSelTool'

        self.__toolname__ = 'ToolSvc.' + self.__instname__
        self.__thistool__ = Service(self.__toolname__)

        # Set options for tool
        self.__thistool__.MinMomentum = 0
        self.__thistool__.MinPt = 2
        self.__thistool__.MaxShared = 0
        self.__thistool__.MaxHoles = 1
        self.__thistool__.MinChi2Prob = 0.2

        ToolSvc = Service("ToolSvc")

        # Propagator
        if propagatorType is "STEP":
            from TrkExSTEP_Propagator.TrkExSTEP_PropagatorConf import Trk__STEP_Propagator as Propagator
        else:
            from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator
        InDetAlignTrackSelPropagator = Propagator(
            name='InDetAlignTrackSelPropagator')
        ToolSvc += InDetAlignTrackSelPropagator
        print InDetAlignTrackSelPropagator

        # Navigator
        from TrkExTools.TrkExToolsConf import Trk__Navigator
        InDetAlignTrackSelNavigator = Trk__Navigator(
            name='InDetAlignTrackSelNavigator')
        ToolSvc += InDetAlignTrackSelNavigator
        print InDetAlignTrackSelNavigator

        # Material updator
        from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator
        InDetAlignTrackSelMaterialUpdator = Trk__MaterialEffectsUpdator(
            name="InDetAlignTrackSelMaterialEffectsUpdator")
        ToolSvc += InDetAlignTrackSelMaterialUpdator
        print InDetAlignTrackSelMaterialUpdator

        # Extrapolator
        from TrkExTools.TrkExToolsConf import Trk__Extrapolator
        InDetAlignTrackSelExtrapolator = Trk__Extrapolator(
            name='InDetAlignTrackSelExtrapolator',
            Propagators=[InDetAlignTrackSelPropagator.getType()],
            PropagatorInstances=[InDetAlignTrackSelPropagator.getName()],
            Navigator=InDetAlignTrackSelNavigator,
            MaterialEffectsUpdator=InDetAlignTrackSelMaterialUpdator)
        ToolSvc += InDetAlignTrackSelExtrapolator
        print InDetAlignTrackSelExtrapolator

        # associator
        from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
        InDetAlignTrackSelAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
        )
        ToolSvc += InDetAlignTrackSelAssociationTool

        # summary
        from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
        InDetAlignTrackSelSummaryTool = InDet__InDetTrackSummaryHelperTool(
            name="InDetAlignTrackSelSummaryTool",
            Extrapolator=InDetAlignTrackSelExtrapolator,
            AssoTool=InDetAlignTrackSelAssociationTool,
            DoSharedHits=True)
        ToolSvc += InDetAlignTrackSelSummaryTool
        print InDetAlignTrackSelSummaryTool
Ejemplo n.º 2
0
from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__VertexPointEstimator
VtxPointEstimator = InDet__VertexPointEstimator(
    name="VtxPointEstimator",
    MinDeltaR=[-10000., -10000., -10000.],
    MaxDeltaR=[10000., 10000., 10000.],
    MaxPhi=[10000., 10000., 10000.],
    MaxChi2OfVtxEstimation=2000.)
ToolSvc += VtxPointEstimator
print VtxPointEstimator

from InDetRecExample.InDetKeys import InDetKeys

from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
    name="CascadeInDetPrdAssociationTool",
    PixelClusterAmbiguitiesMapName=InDetKeys.GangedPixelMap())
ToolSvc += InDetPrdAssociationTool
print InDetPrdAssociationTool

from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
InDetTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(
    name="CascInDetSummaryHelper",
    AssoTool=InDetPrdAssociationTool,
    DoSharedHits=False,
    HoleSearch=InDetHoleSearchTool,
    usePixel=DetFlags.haveRIO.pixel_on(),
    useSCT=DetFlags.haveRIO.SCT_on(),
    useTRT=DetFlags.haveRIO.TRT_on())
ToolSvc += InDetTrackSummaryHelperTool
print InDetTrackSummaryHelperTool
Ejemplo n.º 3
0
    def __init__(self,name = 'AtlasTrackSummaryTool'):
        from AthenaCommon.AppMgr import ToolSvc        

        #
        # Setup Atlas Extrapolator
        #
        from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
        AtlasExtrapolator = AtlasExtrapolator()
        ToolSvc += AtlasExtrapolator
        
        #
        # Setup Association Tool
        #
        from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
        AtlasPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
                                                                              name                           = "AtlasPrdAssociationTool",
                                                                              PixelClusterAmbiguitiesMapName = "PixelClusterAmbiguitiesMap"
                                                                             )
        ToolSvc += AtlasPrdAssociationTool
        #print      AtlasPrdAssociationTool
    
        # 
        # Setup Boundary Check Tool
        #
        from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool
        AtlasBoundaryCheckTool = InDet__InDetBoundaryCheckTool(
            name="AtlasBoundaryCheckTool",
            UsePixel      = DetFlags.haveRIO.pixel_on(),
            UseSCT        = DetFlags.haveRIO.SCT_on()
        )
        ToolSvc += AtlasBoundaryCheckTool
    
        #
        # Loading Configurable HoleSearchTool
        #
        from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
        AtlasHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "AtlasHoleSearchTool",
                                                              Extrapolator = AtlasExtrapolator,
                                                              BoundaryCheckTool=AtlasBoundaryCheckTool
                                                              )
        ToolSvc += AtlasHoleSearchTool
        #print      AtlasHoleSearchTool
        
        #
        # Configrable version of loading the AtlasTrackSummaryHelperTool
        #
        from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
        if DetFlags.haveRIO.TRT_on():
            AtlasTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(
                name         = "AtlasTrackSummaryHelperTool",
                HoleSearch   = AtlasHoleSearchTool,
                AssoTool     = AtlasPrdAssociationTool,
                DoSharedHits = False
                )
        else:
            AtlasTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(
                name         = "AtlasTrackSummaryHelperTool",
                HoleSearch   = AtlasHoleSearchTool,
                AssoTool     = AtlasPrdAssociationTool,
                DoSharedHits = False,
                TRTStrawSummarySvc = ""
                )     
            
        ToolSvc += AtlasTrackSummaryHelperTool
        #print      AtlasTrackSummaryHelperTool                                                                   
        
        #
        # Configurable version of TrkTrackSummaryTool
        #
        from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
        AtlasTrackSummaryTool = Trk__TrackSummaryTool(
                                                     )
        # call the base class constructor
        Trk__TrackSummaryTool.__init__(self, name = name,
                                             InDetSummaryHelperTool = AtlasTrackSummaryHelperTool,
                                             doHolesOnTrack    = True,
                                             doSharedHits      = AtlasTrackSummaryHelperTool.DoSharedHits
                                      )
Ejemplo n.º 4
0
def getPhotonConversionTool():

    if jobproperties.tauRecFlags.useVertexBasedConvFinder():
        from AthenaCommon.AppMgr import ToolSvc

        name = "_PhotonConversionVertex"

        ##

        from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator as MaterialEffectsUpdator
        AtlasMaterialEffectsUpdator = MaterialEffectsUpdator(
            name='AtlasMaterialEffectsUpdator')
        ToolSvc += AtlasMaterialEffectsUpdator  #default material effects updator
        NoElossMaterialEffectsUpdator = MaterialEffectsUpdator(
            name='NoElossMaterialEffectsUpdator')
        NoElossMaterialEffectsUpdator.EnergyLoss = False
        ToolSvc += NoElossMaterialEffectsUpdator

        # setup MaterialEffectsUpdator arrays
        MyUpdators = []
        MyUpdators += [AtlasMaterialEffectsUpdator]  # for ID
        MyUpdators += [NoElossMaterialEffectsUpdator]  # for Calo
        # MyUpdators += [NoElossMaterialEffectsUpdator] # for muon

        MySubUpdators = []
        MySubUpdators += [AtlasMaterialEffectsUpdator.name()]  # for ID
        MySubUpdators += [NoElossMaterialEffectsUpdator.name()]  # for Calo
        MySubUpdators += [NoElossMaterialEffectsUpdator.name()]  # for muon

        #Configure the extrapolator
        from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
        theAtlasExtrapolator = AtlasExtrapolator(name='theAtlasExtrapolator' +
                                                 name)
        theAtlasExtrapolator.DoCaloDynamic = False  # this turns off dynamic
        theAtlasExtrapolator.MaterialEffectsUpdators = MyUpdators
        theAtlasExtrapolator.SubMEUpdators = MySubUpdators
        ToolSvc += theAtlasExtrapolator

        #        from TrkMagFieldTools.TrkMagFieldToolsConf import Trk__MagneticFieldTool
        #        InDetMagField = Trk__MagneticFieldTool('InDetMagField'+name)
        #        ToolSvc += InDetMagField
        ### Ly S swith bellow off Oct 7
        #        from AthenaCommon.AppMgr import ServiceMgr
        #        from MagFieldServices.MagFieldServicesConf import MagField__AtlasFieldSvc
        #        ServiceMgr += MagField__AtlasFieldSvc("myAtlasFieldSvc")

        #
        # Setup track summary tool
        #
        from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
        tauInDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
            name="tauInDetPrdAssociationTool",
            PixelClusterAmbiguitiesMapName='PixelClusterAmbiguitiesMap')
        ToolSvc += tauInDetPrdAssociationTool
        from InDetRecExample.InDetJobProperties import InDetFlags
        from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
        tauInDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(
            name="tauInDetHoleSearchTool",
            Extrapolator=theAtlasExtrapolator,
            checkBadSCTChip=InDetFlags.checkDeadElementsOnTrack())
        ToolSvc += tauInDetHoleSearchTool

        from AthenaCommon.DetFlags import DetFlags
        from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
        tauInDetTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(
            name="tauInDetTrackSummaryHelper",
            AssoTool=tauInDetPrdAssociationTool,
            DoSharedHits=False,
            HoleSearch=tauInDetHoleSearchTool,
            usePixel=DetFlags.haveRIO.pixel_on(),
            useSCT=DetFlags.haveRIO.SCT_on(),
            useTRT=DetFlags.haveRIO.TRT_on())
        ToolSvc += tauInDetTrackSummaryHelperTool

        #        from TrkTrackSummaryTool.AtlasTrackSummaryTool import AtlasTrackSummaryTool
        #        MyInDetTrackSummaryTool = AtlasTrackSummaryTool(
        #                                       InDetSummaryHelperTool = tauInDetTrackSummaryHelperTool,
        #                                       doSharedHits           = False )
        from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
        MyInDetTrackSummaryTool = Trk__TrackSummaryTool(
            name="MyInDetTrackSummaryTool",
            InDetSummaryHelperTool=tauInDetTrackSummaryHelperTool,
            doSharedHits=False,
            InDetHoleSearchTool=tauInDetHoleSearchTool)
        ToolSvc += MyInDetTrackSummaryTool

        from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
        InDetConversionVxFitterTool = Trk__TrkVKalVrtFitter(
            name="InDetConversionVxFitter" + name,
            Extrapolator=theAtlasExtrapolator,
            #                                        Extrapolator        = "Trk::Extrapolator/AtlasExtrapolator",
            IterationNumber=30,
            MakeExtendedVertex=True,
            FirstMeasuredPoint=False,

            #                                        MagFieldSvc         = InDetMagField,
            ##                                       MagFieldSvc="Trk::MagneticFieldTool/InDetMagField",
            #                                        AtlasMagFieldSvc="myAtlasFieldSvc",
            Robustness=6,
            usePhiCnst=True,
            useThetaCnst=True,
            FirstMeasuredPointLimit=True,
            InputParticleMasses=[0.511, 0.511],
            VertexForConstraint=[0., 0., 0.],
            CovVrtForConstraint=[
                0.015 * 0.015, 0., 0.015 * 0.015, 0., 0., 10000. * 10000.
            ])
        ToolSvc += InDetConversionVxFitterTool
        print InDetConversionVxFitterTool

        # Distance of minimum approach utility
        #
        from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__SeedNewtonTrkDistanceFinder
        InDetConversionTrkDistanceFinder = Trk__SeedNewtonTrkDistanceFinder(
            name='InDetConversionTrkDistanceFinder' + name)
        ToolSvc += InDetConversionTrkDistanceFinder
        print InDetConversionTrkDistanceFinder

        # Straight line propagator needed to clean-up single track conversions
        #
        #        from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator

        # Helper Tool
        #
        from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__ConversionFinderUtils
        InDetConversionHelper = InDet__ConversionFinderUtils(
            name="InDetConversionFinderUtils" + name)
        ToolSvc += InDetConversionHelper
        print InDetConversionHelper

        # Track selector tool
        #
        from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetConversionTrackSelectorTool
        InDetConversionTrackSelector = InDet__InDetConversionTrackSelectorTool(
            name="InDetConversionTrackSelector" + name,
            TrackSummaryTool=MyInDetTrackSummaryTool,
            Extrapolator=theAtlasExtrapolator,
            maxSiD0=10000.,  #50.0,
            maxTrtD0=10000.,  #100.,
            maxSiZ0=10000.,  #350.0,
            maxTrtZ0=10000.,  #1400.,
            minPt=300,  #InDetNewTrackingCuts.minSecondaryPt()
            RatioCut1=0.0,  #0.5,
            RatioCut2=0.05,
            RatioCut3=0.05,
            RatioTRT=0.05,
            IsConversion=True,
            significanceD0_Si=-1.,
            RatioV0=-1.)

        ToolSvc += InDetConversionTrackSelector
        print InDetConversionTrackSelector

        # Track pairs selector
        #
        ## There are many tunings on Oct 5
        from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__TrackPairsSelector
        InDetConversionTrackPairsSelector = InDet__TrackPairsSelector(
            name="InDetConversionTrackPairsSelector" + name,
            ConversionFinderHelperTool=InDetConversionHelper,
            DistanceTool=InDetConversionTrkDistanceFinder,
            #                             MaxEta                     = [0.12,10000.,10000.],      #[0.5,1.0,0.5])
            MaxEta=[0.15, 0.3, 0.5],  #[0.5,1.0,0.5])
            #                             MaxDistBetweenTracks       = [6.6,10000.,10000.],     #[6.,80.,30.]
            MaxDistBetweenTracks=[7.5, 15., 30.],  #[6.,80.,30.]
            MaxInitDistance=[10000., 10000., 10000.],
            MinTrackAngle=0.)
        ToolSvc += InDetConversionTrackPairsSelector
        print InDetConversionTrackPairsSelector

        # Vertex point estimator
        #
        from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__VertexPointEstimator
        InDetConversionVtxPointEstimator = InDet__VertexPointEstimator(
            name="InDetConversionVtxPointEstimator" + name,
            MaxTrkXYDiffAtVtx=[10000., 10000., 10000.],
            MaxTrkZDiffAtVtx=[10000., 10000., 10000.],
            MaxTrkXYValue=[10000., 10000., 10000.],
            MinArcLength=[-10000., -10000., -10000.],
            MaxArcLength=[10000., 10000., 10000.],
            MinDeltaR=[-5., -25., -50.],
            #                                   MaxDeltaR              = [10000.,10000.,10000.],
            MaxDeltaR=[5., 10., 10.],
            #                                   MaxHl                  = [10000.,10000.,10000.],
            #                                   MaxPhi                 = [0.034, 10000., 10000.] #[0.05, 0.1, 0.1]
            #                                   MaxPhi                 = [ 10000., 10000., 10000.]
            MaxPhi=[0.05, 0.1, 0.2])
        ToolSvc += InDetConversionVtxPointEstimator
        print InDetConversionVtxPointEstimator

        # Conversion post selector
        #
        from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__ConversionPostSelector
        InDetConversionPostSelector = InDet__ConversionPostSelector(
            name="InDetConversionPostSelector" + name,
            #                                      MaxChi2Vtx       = [10000.,10000.,10000.],   #[40.,100.,80.],
            MaxChi2Vtx=[500., 700., 900.],  #[40.,100.,80.],
            #                                      MaxInvariantMass = [45.,25000.,25000.],     #[60.,60.,30.],
            MaxInvariantMass=[350., 400., 500.],  #[60.,60.,30.],
            MinFitMomentum=[0., 0., 0.],  #[2000.,2000.,2000.],
            MinRadius=[21, 20., 15.],  #[30.,35.,250.],
            #                                      MinRadius        = [ -10000.0, -10000.0, -10000.0 ],  #[30.,35.,250.],
            MinPt=0.,
            #                                      MaxdR            = 10000.,               #-250.,
            ## equivalent to InDetConversionFinderTools.MaxDistVtxHit
            MaxdR=-10000.,  #-250.,
            #                                      MaxPhiVtxTrk     = 0.046   #0.2
            MaxPhiVtxTrk=0.05)
        ToolSvc += InDetConversionPostSelector
        print InDetConversionPostSelector

        # Single track conversion tool
        #
        from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__SingleTrackConversionTool
        InDetSingleTrackConversion = InDet__SingleTrackConversionTool(
            name="InDetSingleTrackConversionTool" + name,
            ConversionFinderHelperTool=InDetConversionHelper,
            TrackSummaryTool=MyInDetTrackSummaryTool,
            Extrapolator=theAtlasExtrapolator,
            MaxBLayerHits=0,
            MinInitialHitRadius=70.,
            MinInitialHitRadius_noBlay=90.,
            MinRatioOfHLhits=0.95)
        ToolSvc += InDetSingleTrackConversion
        print InDetSingleTrackConversion
        ## Oct 5, following egamma
        from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__InDetConversionFinderTools
        MyInDetConversionFinderTools = InDet__InDetConversionFinderTools(
            name="InDetConversionFinderTools" + name,
            VertexFitterTool=InDetConversionVxFitterTool,
            TrackSelectorTool=InDetConversionTrackSelector,
            TrackPairsSelector=InDetConversionTrackPairsSelector,
            ConversionFinderHelperTool=InDetConversionHelper,
            VertexPointEstimator=InDetConversionVtxPointEstimator,
            PostSelector=InDetConversionPostSelector,
            SingleTrackConversionTool=InDetSingleTrackConversion,
            Extrapolator=theAtlasExtrapolator,
            TrackParticleCollection="InDetTrackParticles",
            #                                                MinDistVtxHit              = -10000.,
            MinDistVtxHit=-350.,
            MaxDistVtxHit=230.,
            MinFlightAngle=0.0,
            MinInitVtxR=0.0,
            RemoveTrtTracks=False,
            IsConversion=True)
        ToolSvc += MyInDetConversionFinderTools
        print MyInDetConversionFinderTools

        from tauRecTools.tauRecToolsConf import PhotonConversionVertex
        photonConv = PhotonConversionVertex(
            name="PhotonConversionVertex",
            TauRecContainer="TauJets",
            TrackParticleContainer="InDetTrackParticles",
            OutputConversionVertexContainerName="ConversionsVertex_Container",
            MaxTauJetDr=0.5,
            ConversionFinderTool=MyInDetConversionFinderTools)

        return photonConv

    else:
        from tauRecTools.tauRecToolsConf import PhotonConversionPID
        photonConv = PhotonConversionPID(
            ConversionCandidatesName="ConversionCandidate",
            ConversionOutputName="ConversionsPID_Container",
            ElectronProbability=0.9)
        return photonConv
Ejemplo n.º 5
0
        or NewTrackingCuts.mode() == "ForwardSLHCTracks"
        or NewTrackingCuts.mode() == "Disappearing"
        or NewTrackingCuts.mode() == "VeryForwardSLHCTracks"
        or NewTrackingCuts.mode() == "SLHCConversionFinding"):

    usePrdAssociationTool = True

else:
    usePrdAssociationTool = False

InDetPrdAssociationTool = None
if usePrdAssociationTool:
    # Taken from InDetRecExample/share/InDetRecLoadTools.py
    from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
    InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
        name="InDetPrdAssociationTool",
        PixelClusterAmbiguitiesMapName=InDetKeys.GangedPixelMap(),
        addTRToutliers=False)  ###
    ToolSvc += InDetPrdAssociationTool

# Set up InDet__SiSpacePointsSeedMaker_ATLxk (private)
# Taken from InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
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(),
Ejemplo n.º 6
0
    def __init__(self, name="EMBremCollectionBuilder", **kw):
        mlog = logging.getLogger(name + '::__init__')
        mlog.info("entering")

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

        # do the configuration
        import egammaRec.EMCommonRefitter
        GSFBuildInDetExtrapolator = egammaExtrapolator()

        from egammaTrackTools.egammaTrackToolsConf import egammaTrkRefitterTool
        GSFRefitterTool = egammaTrkRefitterTool(
            name='GSFRefitterTool',
            FitterTool=egammaRec.EMCommonRefitter.GSFTrackFitter,
            useBeamSpot=False,
            ReintegrateOutliers=True)
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += GSFRefitterTool

        # ----------- load association tool from Inner Detector to handle pixel ganged ambiguities
        #
        from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
        GSFBuildInDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
            name="GSFBuildInDetPrdAssociationTool",
            PixelClusterAmbiguitiesMapName='PixelClusterAmbiguitiesMap')
        ToolSvc += GSFBuildInDetPrdAssociationTool
        #
        # ----------- Load SummaryTool
        #
        # Loading Configurable HoleSearchTool
        #
        from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
        GSFBuildHoleSearchTool = InDet__InDetTrackHoleSearchTool(
            name="GSFBuildHoleSearchTool",
            Extrapolator=GSFBuildInDetExtrapolator,
            usePixel=DetFlags.haveRIO.pixel_on(),
            useSCT=DetFlags.haveRIO.SCT_on(),
            checkBadSCTChip=InDetFlags.checkDeadElementsOnTrack(),
            CountDeadModulesAfterLastHit=True)

        from AthenaCommon.AppMgr import ServiceMgr
        if (DetFlags.haveRIO.SCT_on()):
            from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsSummarySvc
            InDetSCT_ConditionsSummarySvc = SCT_ConditionsSummarySvc(
                name="InDetSCT_ConditionsSummarySvc")
            ServiceMgr += InDetSCT_ConditionsSummarySvc
            GSFBuildHoleSearchTool.SctSummarySvc = ServiceMgr.InDetSCT_ConditionsSummarySvc
        else:
            GSFBuildHoleSearchTool.SctSummarySvc = None

        ToolSvc += GSFBuildHoleSearchTool
        #
        # Load BLayer tool
        #
        GSFBuildTestBLayerTool = None
        if DetFlags.haveRIO.pixel_on():
            from InDetTestBLayer.InDetTestBLayerConf import InDet__InDetTestBLayerTool
            from PixelConditionsServices.PixelConditionsServicesConf import PixelConditionsSummarySvc
            ServiceMgr += PixelConditionsSummarySvc()
            GSFBuildTestBLayerTool = InDet__InDetTestBLayerTool(
                name="GSFBuildTestBLayerTool",
                PixelSummarySvc=ServiceMgr.PixelConditionsSummarySvc,
                Extrapolator=GSFBuildInDetExtrapolator)
            ToolSvc += GSFBuildTestBLayerTool

        # Configurable version of TRT_ElectronPidTools
        #
        GSFBuildTRT_ElectronPidTool = None
        if DetFlags.haveRIO.TRT_on(
        ) and not InDetFlags.doSLHC() and not InDetFlags.doHighPileup():

            from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
            GSFBuildTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(
                name="GSF_TRT_LocalOccupancy")
            ToolSvc += GSFBuildTRT_LocalOccupancy

            from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2
            GSFBuildTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2(
                name="GSFBuildTRT_ElectronPidTool",
                TRT_LocalOccupancyTool=GSFBuildTRT_LocalOccupancy,
                isData=(globalflags.DataSource == 'data'))

            ToolSvc += GSFBuildTRT_ElectronPidTool

        #
        # Configurable version of PixelToTPIDTOol
        #
        GSFBuildPixelToTPIDTool = None
        if DetFlags.haveRIO.pixel_on():
            from PixelToTPIDTool.PixelToTPIDToolConf import InDet__PixelToTPIDTool
            GSFBuildPixelToTPIDTool = InDet__PixelToTPIDTool(
                name="GSFBuildPixelToTPIDTool")
            GSFBuildPixelToTPIDTool.ReadFromCOOL = True
            ToolSvc += GSFBuildPixelToTPIDTool
        #
        # Configrable version of loading the InDetTrackSummaryHelperTool
        #
        from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
        GSFBuildTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(
            name="GSFBuildTrackSummaryHelperTool",
            AssoTool=GSFBuildInDetPrdAssociationTool,
            PixelToTPIDTool=GSFBuildPixelToTPIDTool,
            TestBLayerTool=GSFBuildTestBLayerTool,
            DoSharedHits=False,
            HoleSearch=GSFBuildHoleSearchTool,
            usePixel=DetFlags.haveRIO.pixel_on(),
            useSCT=DetFlags.haveRIO.SCT_on(),
            useTRT=DetFlags.haveRIO.TRT_on())
        ToolSvc += GSFBuildTrackSummaryHelperTool
        #
        # Configurable version of TrkTrackSummaryTool: no TRT_PID tool needed here (no shared hits)
        #
        from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
        GSFBuildInDetTrackSummaryTool = Trk__TrackSummaryTool(
            name="GSFBuildInDetTrackSummaryTool",
            InDetSummaryHelperTool=GSFBuildTrackSummaryHelperTool,
            doSharedHits=False,
            InDetHoleSearchTool=GSFBuildHoleSearchTool,
            TRT_ElectronPidTool=GSFBuildTRT_ElectronPidTool,
            PixelToTPIDTool=GSFBuildPixelToTPIDTool)
        ToolSvc += GSFBuildInDetTrackSummaryTool
        #
        # --- load patricle creator tool
        #
        from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
        GSFBuildInDetParticleCreatorTool = Trk__TrackParticleCreatorTool(
            name="GSFBuildInDetParticleCreatorTool",
            KeepParameters=True,
            Extrapolator=GSFBuildInDetExtrapolator,
            TrackSummaryTool=GSFBuildInDetTrackSummaryTool,
            UseTrackSummaryTool=False,
            ForceTrackSummaryUpdate=False)
        ToolSvc += GSFBuildInDetParticleCreatorTool
        #
        # --- do track slimming
        #
        from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool
        GSFBuildInDetTrkSlimmingTool = ConfigurableTrackSlimmingTool(
            name="GSFBuildInDetTrackSlimmingTool",
            KeepParameters=False,
            KeepOutliers=True)
        ToolSvc += GSFBuildInDetTrkSlimmingTool

        # do the configuration
        self.ClusterContainerName = "LArClusterEM"
        from InDetRecExample.InDetKeys import InDetKeys
        self.TrackParticleContainerName = InDetKeys.xAODTrackParticleContainer(
        )
        self.OutputTrkPartContainerName = "GSFTrackParticles"
        self.OutputTrackContainerName = "GSFTracks"
        self.TrackRefitTool = GSFRefitterTool
        self.TrackParticleCreatorTool = GSFBuildInDetParticleCreatorTool
        self.TrackSlimmingTool = GSFBuildInDetTrkSlimmingTool
        self.TrackSummaryTool = GSFBuildInDetTrackSummaryTool

        # do the configuration (from old EMBremCollectionBuilderBase)
        self.minNoSiHits = 4
        self.broadDeltaEta = 0.1  # this is multiplied by 2 for the Candidate Match , so +- 0.2 in eta
        self.broadDeltaPhi = 0.15  # this is multiplied by 2 for the Candidate Match , so +- 0.3 in phi
        self.narrowDeltaEta = 0.05
        #These have to be relaxed enough for the conversions
        self.narrowDeltaPhi = 0.05
        self.narrowDeltaPhiBrem = 0.20  #Dominated by the needs of assymetric conversions
        self.narrowDeltaPhiRescale = 0.05
        self.narrowDeltaPhiRescaleBrem = 0.1
Ejemplo n.º 7
0
    def __init__(self, name="FTF", type="eGamma"):
        TrigFastTrackFinderMT.__init__(self, name)
        remapped_type = "electron"
        from TrigOnlineSpacePointTool.TrigOnlineSpacePointToolConf import TrigL2LayerNumberTool

        self.retrieveBarCodes = False  #Look at truth information for spacepoints from barcodes
        #self.SignalBarCodes = [10001] #single particles
        self.SignalBarCodes = [11, 12]  #z->mumu

        self.useNewLayerNumberScheme = True

        self.OutputCollectionSuffix = type
        from AthenaCommon.AppMgr import ToolSvc

        numberingTool = TrigL2LayerNumberTool(name="TrigL2LayerNumberTool_FTF")
        numberingTool.UseNewLayerScheme = self.useNewLayerNumberScheme
        ToolSvc += numberingTool
        self.LayerNumberTool = numberingTool

        from InDetTrigRecExample.InDetTrigSliceSettings import InDetTrigSliceSettings
        if type == "FTK" or type == "FTKRefit":
            from TrigFTK_RecExample.TrigFTKLoadTools import theFTK_DataProviderSvc
            self.FTK_DataProviderSvc = theFTK_DataProviderSvc
            self.FTK_Mode = True
        if type == "FTKRefit":
            self.FTK_Refit = True
        else:
            #Spacepoint conversion
            from TrigOnlineSpacePointTool.TrigOnlineSpacePointToolConf import TrigSpacePointConversionTool
            spTool = TrigSpacePointConversionTool().clone(
                'TrigSpacePointConversionTool_' + remapped_type)
            spTool.DoPhiFiltering = InDetTrigSliceSettings[('doSpPhiFiltering',
                                                            remapped_type)]
            spTool.UseNewLayerScheme = self.useNewLayerNumberScheme
            spTool.UseBeamTilt = False
            spTool.PixelSP_ContainerName = 'PixelSpacePoints'
            spTool.SCT_SP_ContainerName = 'SCT_SpacePoints'
            spTool.layerNumberTool = numberingTool
            ToolSvc += spTool
            self.SpacePointProviderTool = spTool
            self.MinSPs = 5  #Only process RoI with more than 5 spacepoints

            self.Triplet_MinPtFrac = 1
            self.Triplet_nMaxPhiSlice = 53
            if remapped_type == "cosmics":
                self.Triplet_nMaxPhiSlice = 2  #Divide detector in 2 halves for cosmics

            self.Triplet_MaxBufferLength = 3
            self.doSeedRedundancyCheck = InDetTrigSliceSettings[(
                'checkRedundantSeeds', remapped_type)]
            self.Triplet_D0Max = InDetTrigSliceSettings[('d0SeedMax',
                                                         remapped_type)]
            self.Triplet_D0_PPS_Max = InDetTrigSliceSettings[('d0SeedPPSMax',
                                                              remapped_type)]
            self.TrackInitialD0Max = 20.
            if remapped_type == 'cosmics':
                self.TrackInitialD0Max = 1000.
                self.TrackZ0Max = 1000.
            self.TripletDoPSS = False
            self.pTmin = InDetTrigSliceSettings[('pTmin', remapped_type)]
            self.DoubletDR_Max = InDetTrigSliceSettings[('dRdoubletMax',
                                                         remapped_type)]
            self.SeedRadBinWidth = InDetTrigSliceSettings[('seedRadBinWidth',
                                                           remapped_type)]

            if remapped_type == "cosmics":
                self.Doublet_FilterRZ = False

            ## SCT and Pixel detector elements road builder
            from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigSiDetElementsRoadMaker
            InDetTrigSiDetElementsRoadMaker_FTF = InDetTrigSiDetElementsRoadMaker.clone(
                'InDetTrigSiDetElementsRoadMaker_FTF')
            InDetTrigSiDetElementsRoadMaker_FTF.RoadWidth = 10.0
            InDetTrigSiDetElementsRoadMaker_FTF.usePixel = True
            InDetTrigSiDetElementsRoadMaker_FTF.useSCT = True
            if remapped_type == "cosmics":
                from InDetTrigRecExample.InDetTrigConfigRecLoadToolsCosmics import InDetTrigSiDetElementsRoadMakerCosmics
                InDetTrigSiDetElementsRoadMaker_FTF = InDetTrigSiDetElementsRoadMakerCosmics.clone(
                    'InDetTrigSiDetElementsRoadMaker_FTF')
            ToolSvc += InDetTrigSiDetElementsRoadMaker_FTF

            from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigSiComTrackFinder
            InDetTrigSiComTrackFinder_FTF = InDetTrigSiComTrackFinder.clone(
                "InDetTrigSiComTrackFinder_FTF")
            ToolSvc += InDetTrigSiComTrackFinder_FTF
            print InDetTrigSiComTrackFinder_FTF

            from InDetTrigRecExample.ConfiguredNewTrackingTrigCuts import EFIDTrackingCuts
            TrackingCuts = EFIDTrackingCuts
            if remapped_type == "cosmics":
                from InDetTrigRecExample.ConfiguredNewTrackingTrigCuts import EFIDTrackingCutsCosmics
                TrackingCuts = EFIDTrackingCutsCosmics

            from InDetRecExample.InDetKeys import InDetKeys
            from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator
            InDetPatternPropagator = Propagator(name='InDetPatternPropagator')
            ToolSvc += InDetPatternPropagator
            from TrkMeasurementUpdator_xk.TrkMeasurementUpdator_xkConf import Trk__KalmanUpdator_xk
            InDetPatternUpdator = Trk__KalmanUpdator_xk(
                name='InDetPatternUpdator')
            ToolSvc += InDetPatternUpdator

            from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool
            PixelClusterOnTrackToolDigital = InDet__PixelClusterOnTrackTool(
                "InDetPixelClusterOnTrackToolDigital",
                DisableDistortions=False,
                applyNNcorrection=False,
                NNIBLcorrection=False,
                SplitClusterAmbiguityMap=InDetKeys.SplitClusterAmbiguityMap(),
                RunningTIDE_Ambi=False,
                ErrorStrategy=2,
                PositionStrategy=1)

            ToolSvc += PixelClusterOnTrackToolDigital
            from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__SCT_ClusterOnTrackTool
            SCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool(
                "InDetSCT_ClusterOnTrackTool",
                #CorrectionStrategy = -1,  # no position correction (test for bug #56477)
                CorrectionStrategy=0,  # do correct position bias
                ErrorStrategy=2)  # do use phi dependent errors
            ToolSvc += SCT_ClusterOnTrackTool
            from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator
            InDetRotCreatorDigital = Trk__RIO_OnTrackCreator(
                name='InDetRotCreatorDigital',
                ToolPixelCluster=PixelClusterOnTrackToolDigital,
                ToolSCT_Cluster=SCT_ClusterOnTrackTool,
                Mode='indet')
            ToolSvc += InDetRotCreatorDigital
            from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
            InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
                name="InDetPrdAssociationTool",
                PixelClusterAmbiguitiesMapName=InDetKeys.GangedPixelMap(),
                addTRToutliers=True)
            ToolSvc += InDetPrdAssociationTool

            from AthenaCommon.DetFlags import DetFlags
            from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiCombinatorialTrackFinder_xk
            InDetSiComTrackFinder = InDet__SiCombinatorialTrackFinder_xk(
                name='InDetSiComTrackFinder',
                PropagatorTool=InDetPatternPropagator,
                UpdatorTool=InDetPatternUpdator,
                RIOonTrackTool=InDetRotCreatorDigital,
                AssosiationTool=InDetPrdAssociationTool,
                usePixel=True,  #DetFlags.haveRIO.pixel_on(),
                useSCT=True,  #DetFlags.haveRIO.SCT_on(),
                PixManagerLocation=InDetKeys.PixelManager(),
                SCTManagerLocation=InDetKeys.SCT_Manager(),
                PixelClusterContainer=InDetKeys.PixelClusters(),
                SCT_ClusterContainer=InDetKeys.SCT_Clusters())
            ToolSvc += InDetSiComTrackFinder
            from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk
            InDetSiDetElementsRoadMaker = InDet__SiDetElementsRoadMaker_xk(
                name='InDetSiRoadMaker_' + remapped_type,
                PropagatorTool=InDetPatternPropagator,
                usePixel=True,  #DetFlags.haveRIO.pixel_on(),
                PixManagerLocation=InDetKeys.PixelManager(),
                useSCT=True,  #DetFlags.haveRIO.SCT_on(), 
                SCTManagerLocation=InDetKeys.SCT_Manager(),
                RoadWidth=10.0)
            print InDetSiDetElementsRoadMaker
            ToolSvc += InDetSiDetElementsRoadMaker

            from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk as SiTrackMaker
            TrackMaker_FTF = SiTrackMaker(
                name='InDetTrigSiTrackMaker_FTF_' + remapped_type,
                RoadTool=InDetSiDetElementsRoadMaker,
                CombinatorialTrackFinder=InDetSiComTrackFinder,
                pTmin=InDetTrigSliceSettings[('pTmin', remapped_type)],
                nClustersMin=TrackingCuts.minClusters(),
                nHolesMax=TrackingCuts.nHolesMax(),
                nHolesGapMax=TrackingCuts.nHolesGapMax(),
                SeedsFilterLevel=0,  # Do not use built-in seeds filter
                Xi2max=TrackingCuts.Xi2max(),
                Xi2maxNoAdd=TrackingCuts.Xi2maxNoAdd(),
                nWeightedClustersMin=TrackingCuts.nWeightedClustersMin(),
                Xi2maxMultiTracks=TrackingCuts.Xi2max(),
                UseAssociationTool=False)

            from InDetRecExample.InDetJobProperties import InDetFlags
            if not InDetFlags.doCaloSeededBrem():
                TrackMaker_FTF.InputClusterContainerName = ""
                TrackMaker_FTF.InputHadClusterContainerName = ""

            from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
            if type == 'eGamma' and InDetTrigFlags.doBremRecovery():
                TrackMaker_FTF.useBremModel = True

            if remapped_type == "cosmics":
                TrackMaker_FTF.RoadTool.CosmicTrack = True

            ToolSvc += TrackMaker_FTF
            self.initialTrackMaker = TrackMaker_FTF

            from TrigInDetTrackFitter.TrigInDetTrackFitterConf import TrigInDetTrackFitter
            theTrigInDetTrackFitter = TrigInDetTrackFitter()
            #theTrigInDetTrackFitter.correctClusterPos = False #Flag to control whether to correct cluster position
            theTrigInDetTrackFitter.correctClusterPos = True  #temporarily to true to improve err(z0) estimates

            from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigRotCreator
            theTrigInDetTrackFitter.ROTcreator = InDetTrigRotCreator
            ToolSvc += theTrigInDetTrackFitter
            self.trigInDetTrackFitter = theTrigInDetTrackFitter
            from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
            if type == 'eGamma' and InDetTrigFlags.doBremRecovery():
                theTrigInDetTrackFitterBrem = TrigInDetTrackFitter(
                    name='theTrigInDetTrackFitterBrem', doBremmCorrection=True)
                ToolSvc += theTrigInDetTrackFitterBrem
                self.trigInDetTrackFitter = theTrigInDetTrackFitterBrem

            self.doZFinder = InDetTrigSliceSettings[('doZFinder',
                                                     remapped_type)]
            if (self.doZFinder):
                from IDScanZFinder.IDScanZFinderConf import TrigZFinder
                theTrigZFinder = TrigZFinder()
                theTrigZFinder.NumberOfPeaks = 3
                theTrigZFinder.LayerNumberTool = numberingTool

                theTrigZFinder.FullScanMode = True  #TODO: know this from the RoI anyway - should set for every event
                ToolSvc += theTrigZFinder
                self.trigZFinder = theTrigZFinder
                self.doFastZVertexSeeding = True
                self.zVertexResolution = 7.5

            from TrigInDetConf.TrigInDetRecCommonTools import InDetTrigFastTrackSummaryTool
            self.TrackSummaryTool = InDetTrigFastTrackSummaryTool

            if remapped_type == "tauCore":
                from TrigInDetConf.TrigInDetRecCommonTools import InDetTrigTrackSummaryToolWithHoleSearch
                self.TrackSummaryTool = InDetTrigTrackSummaryToolWithHoleSearch

            from TrigInDetTrackFitter.TrigInDetTrackFitterConf import TrigL2ResidualCalculator
            resCalc = TrigL2ResidualCalculator(OfflineClusters=False)
            ToolSvc += resCalc
            self.TrigL2ResidualCalculator = resCalc
            self.doCloneRemoval = InDetTrigSliceSettings[('doCloneRemoval',
                                                          remapped_type)]