예제 #1
0
def toolBTagTrackToVertexTool(name, useBTagFlagsDefaults=True, **options):
    """Sets up a BTagTrackToVertexTool tool and returns it.

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                             Note however that this tool has no BTaggingFlags defaults; the option is
                             here only for consistency.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then be added to ToolSvc via ToolSvc += output."""
    options['name'] = name
    from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
    return Reco__TrackToVertex(**options)
예제 #2
0
def getTrackToVertexTool():
    _name = sPrefix + 'TrackToVertexTool'
    
    if _name in cached_instances:
        return cached_instances[_name]
    
    from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
    TrackToVertexTool = Reco__TrackToVertex( name = _name,
                                             Extrapolator = getAtlasExtrapolator())
                                             
    from AthenaCommon.AppMgr import ToolSvc
    ToolSvc += TrackToVertexTool
    
    cached_instances[_name] = TrackToVertexTool
    return TrackToVertexTool
예제 #3
0
        name='egammaExtrapolationTool')
    ToolSvc += egammaExtrapolationTool
    topSequence.InDetConversionFinder.ExtrapolationTool = egammaExtrapolationTool
    topSequence.InDetConversionFinder.doExtrapolation = True

# [XXX JDC: problems with the association tool (Tracks already in SG)
# @TODO needs to be fixed.
if InDetFlags.doParticleCreation(
) and not InDetFlags.useExistingTracksAsInput():
    trackToVertexTool = None
    if InDetFlags.perigeeExpression() == 'Vertex':
        if hasattr(ToolSvc, 'TrackToVertex'):
            trackToVertexTool = ToolSvc.TrackToVertex
        else:
            from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
            trackToVertexTool = Reco__TrackToVertex('TrackToVertex')
            ToolSvc += trackToVertexTool

    from InDetPriVxFinder.InDetPriVxFinderConf import InDet__InDetVxLinksToTrackParticles
    InDetVxLinkSetter = InDet__InDetVxLinksToTrackParticles(
        name="InDetVxLinkSetter",
        TracksName=InDetKeys.xAODTrackParticleContainer(),
        VerticesName=InDetKeys.xAODVertexContainer(),
        TrackToVertex=trackToVertexTool)

    topSequence += InDetVxLinkSetter

    if InDetFlags.doPrintConfigurables():
        print InDetVxLinkSetter

if rec.doPhysicsValidationAugmentation():
from AthenaCommon.AlgSequence import AlgSequence
topSequencer = AlgSequence()

from AthenaCommon.AlgSequence import AthSequencer
Sequencer = AthSequencer("TileD3PDMaker")
Sequencer.StopOverride = False
topSequencer += Sequencer

# ATLAS EXTRAPOLATOR #
from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
ToolSvc += AtlasExtrapolator()

# VERTEXING TOOL
from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
TrackToVertexTool = Reco__TrackToVertex(name="TrackToVertexTool")
ToolSvc+=TrackToVertexTool

# ISOLATION TOOL
from IsolationTool.IsolationToolConf import xAOD__TrackIsolationTool
TrackIsoTool = xAOD__TrackIsolationTool()
ToolSvc += TrackIsoTool

# TRACK TOOLS
from TileD3PDMaker.TileD3PDMakerConf import TrackTools
TrackTools = TrackTools()
TrackTools.TrackIsolationTool = TrackIsoTool
ToolSvc += TrackTools

print "==============> TOOL ATTRIBUTES SET <=============="
##################
예제 #5
0
def trackIsolationTool(name,
                       doTrackIsolation=False,
                       doSumConversionTracks=True,
                       trackParticleCollection='TrackParticleCandidate',
                       conversionContainer='ConversionCandidate',
                       calorimeterCellContainer=None,
                       onlyEM=False,
                       coreDeltaR=0.05,
                       trackToVertexTool=None,
                       trackSummaryTool=None,
                       extrapolator=None,
                       trackSelector=None,
                       pTMin=1000 * MeV,
                       IPd0Max=10.0 * mm,
                       IPz0Max=10.0 * mm,
                       z0Max=10.0 * mm,
                       useTrackSummaryInfo=True,
                       nHitBLayer=0,
                       nHitPix=0,
                       nHitBLayerPlusPix=0,
                       nHitSct=0,
                       nHitSi=4,
                       nHitTrt=0,
                       useTrackQualityInfo=False,
                       **kw):

    from AthenaCommon.AppMgr import ToolSvc

    if calorimeterCellContainer == None:
        calorimeterCellContainer = \
          'AODCellContainer' if rec.readAOD() else 'AllCalo'

    if trackToVertexTool == None:
        from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
        trackToVertexTool = Reco__TrackToVertex()
        ToolSvc += trackToVertexTool

    if trackSummaryTool == None:
        from TrkTrackSummaryTool.AtlasTrackSummaryTool import AtlasTrackSummaryTool
        trackSummaryTool = AtlasTrackSummaryTool()
        ToolSvc += trackSummaryTool

    if extrapolator == None:
        from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
        extrapolator = AtlasExtrapolator()
        ToolSvc += extrapolator

    if trackSelector == None:
        selname = name + 'TrackSelector'
        from AthenaCommon.BeamFlags import jobproperties
        if (jobproperties.Beam.beamType() == 'cosmics'
                or jobproperties.Beam.beamType() == 'singlebeam'):

            trackSelector = InDet__InDetDetailedTrackSelectorTool(
                name=selname,
                pTMin=0 * MeV,
                IPd0Max=9999 * mm,
                IPz0Max=9999 * mm,
                z0Max=9999 * mm,
                useTrackSummaryInfo=False,
                useTrackQualityInfo=False,
                TrackSummaryTool=trackSummaryTool,
                Extrapolator=extrapolator)
        else:
            trackSelector = InDet__InDetDetailedTrackSelectorTool(
                name=selname,
                pTMin=pTMin,
                IPd0Max=IPd0Max,
                IPz0Max=IPz0Max,
                z0Max=z0Max,
                useTrackSummaryInfo=useTrackSummaryInfo,
                nHitBLayer=nHitBLayer,
                nHitPix=nHitPix,
                nHitBLayerPlusPix=nHitBLayerPlusPix,
                nHitSct=nHitSct,
                nHitSi=nHitSi,
                nHitTrt=nHitTrt,
                useTrackQualityInfo=useTrackQualityInfo,
                TrackSummaryTool=trackSummaryTool,
                Extrapolator=extrapolator,
                **kw)
        ToolSvc += trackSelector

    tool = TrackIsolationTool(name,
                              DoTrackIsolation=doTrackIsolation,
                              DoSumConversionTracks=doSumConversionTracks,
                              TrackParticleCollection=trackParticleCollection,
                              ConversionContainer=conversionContainer,
                              CaloCellContainer=calorimeterCellContainer,
                              OnlyEM=onlyEM,
                              CoreDeltaR=coreDeltaR,
                              ExtrapolTrackToCaloTool=ToolSvc.TrackInCaloTools,
                              TrackToVertex=trackToVertexTool,
                              TrackSelector=trackSelector)
    ToolSvc += tool
    return tool
예제 #6
0
            useVariableSizedTrackCone=False,
            OutputLevel=BTaggingFlags.OutputLevel  # does not work right now
        )
        ToolSvc += BTagElectronToJetAssociator
        if BTaggingFlags.OutputLevel < 3:
            print BTagElectronToJetAssociator
    else:
        BTagElectronToJetAssociator = None

    # -- extrapolation to propagate tracks to primary vertex:
    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
    AtlasExtrapolator = AtlasExtrapolator()
    ToolSvc += AtlasExtrapolator

    from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
    BTagTrackToVertexTool = Reco__TrackToVertex(name="BTagTrackToVertexTool",
                                                Extrapolator=AtlasExtrapolator)
    ToolSvc += BTagTrackToVertexTool
    if BTaggingFlags.OutputLevel < 3:
        print BTagTrackToVertexTool

    # -- tracking tools to sign the impact parameter:
    if (BTaggingFlags.IP1D | BTaggingFlags.IP2D | BTaggingFlags.IP3D
            | BTaggingFlags.JetProb | BTaggingFlags.TrackCounting
            | BTaggingFlags.SoftMu | BTaggingFlags.SoftMuChi2
            | BTaggingFlags.SoftEl):
        from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory
        BTagLinTrkFactory = Trk__FullLinearizedTrackFactory(
            name="BTagFullLinearizedTrackFactory",
            Extrapolator=AtlasExtrapolator)
        ToolSvc += BTagLinTrkFactory
        if BTaggingFlags.OutputLevel < 3:
예제 #7
0
                                             tracksName=tracksName)

    if jobproperties.Beam.beamType() == 'collisions':
        from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool
        InDetSCTTracksMonTool.FilterTools += [GetFilledBunchFilterTool()]

        if (InDetFlags.doPrintConfigurables()):
            printfunc(InDetSCTTracksMonTool)

    from SCT_Monitoring.SCT_MonitoringConf import SCTLorentzMonTool
    from BTagging.BTaggingConfiguration_CommonTools import toolAtlasExtrapolator
    atlasExtrapolator = toolAtlasExtrapolator('AtlasExtrapolator')
    options = {}
    options.setdefault('Extrapolator', atlasExtrapolator)
    from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
    trackToVertex = Reco__TrackToVertex(**options)
    InDetSCTLorentzMonTool = SCTLorentzMonTool(name="InDetSCTLorentzMonTool",
                                               OutputLevel=4,
                                               tracksName=tracksName)
    InDetSCTLorentzMonTool.AssociationTool = InDetPrdAssociationTool
    InDetSCTLorentzMonTool.RejectSharedHits = False

    if jobproperties.Beam.beamType() == 'collisions':
        from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool
        InDetSCTLorentzMonTool.FilterTools += [GetFilledBunchFilterTool()]

    if (InDetFlags.doPrintConfigurables()):
        printfunc(InDetSCTLorentzMonTool)

    if not hasattr(ServiceMgr, "TrigConfigSvc"):
        from TrigConfigSvc.TrigConfigSvcConfig import SetupTrigConfigSvc
예제 #8
0
    Robustness=6,
    #This line has no more meaning                      Constraint          = 12,
    usePhiCnst=True,
    useThetaCnst=True,
    InputParticleMasses=[0.511, 0.511],
    MassForConstraint=2.,
    VertexForConstraint=[0., 0., 0.],
    CovVrtForConstraint=[
        0.015 * 0.015, 0., 0.015 * 0.015, 0., 0., 10000. * 10000.
    ])
ToolSvc += InDetConversionVxFitterTool

####################################################################################################################

from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
TrackToVertexTool = Reco__TrackToVertex()
ToolSvc += TrackToVertexTool

from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
EMTrackIsolationExtrapolator = AtlasExtrapolator()
ToolSvc += EMTrackIsolationExtrapolator

from TrkTrackSummaryTool.AtlasTrackSummaryTool import AtlasTrackSummaryTool
EMTrackIsolationTrackSummaryTool = AtlasTrackSummaryTool()
ToolSvc += EMTrackIsolationTrackSummaryTool

from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool
OuterTrackIsolationTrackSelectorTool = InDet__InDetDetailedTrackSelectorTool(
    name="OuterTrackIsolationTrackSelectorTool",
    pTMin=1000.,
    IPd0Max=1. * mm,
예제 #9
0
    topSequence.InDetConversionFinder.doExtrapolation = True

# [XXX JDC: problems with the association tool (Tracks already in SG)
# @TODO needs to be fixed.
if InDetFlags.doParticleCreation(
) and not InDetFlags.useExistingTracksAsInput():
    trackToVertexTool = None
    if InDetFlags.perigeeExpression() == 'Vertex':
        if hasattr(ToolSvc, 'TrackToVertex'):
            trackToVertexTool = ToolSvc.TrackToVertex
        else:
            from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
            atlas_extrapolator = AtlasExtrapolator()

            from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
            trackToVertexTool = Reco__TrackToVertex(
                'TrackToVertex', Extrapolator=atlas_extrapolator)
            ToolSvc += trackToVertexTool

if rec.doPhysicsValidationAugmentation():
    try:
        import InDetPhysValMonitoring.InDetPhysValDecoration
        InDetPhysValMonitoring.InDetPhysValDecoration.addDecoratorIfNeeded()
    except ImportError:
        from AthenaCommon.Logging import logging
        log = logging.getLogger('InDetRecExample/InDetRecPostProcessing.py')
        log.info('Package InDetPhysValMonitoring.InDetPhysValDecoration is missing.'\
                   ' So, will not run the decoration. Module should become available in future'\
                   ' versions of InDetPhysValMonitoring')
        import traceback
        log.info(traceback.format_exc())
        import sys