예제 #1
0
def _get_estimator (args, hookargs):
    from AthenaCommon.AppMgr import ToolSvc
    if hasattr(ToolSvc, 'AtlasExtrapolator'):
        AtlasExtrapolator = ToolSvc.AtlasExtrapolator
    else:
        from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
        AtlasExtrapolator = AtlasExtrapolator()
        ToolSvc += AtlasExtrapolator
    if hasattr(ToolSvc, 'TrackD3PDLinTrkFactory'):
        TrackD3PDLinTrkFactory = ToolSvc.TrackD3PDLinTrkFactory
    else:
        from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory
        TrackD3PDLinTrkFactory = Trk__FullLinearizedTrackFactory(
            name              = "TrackD3PDFullLinearizedTrackFactory",
            Extrapolator      = AtlasExtrapolator)
        ToolSvc += TrackD3PDLinTrkFactory

    if hasattr(ToolSvc, 'TrackD3PDTrackToVertexIPEstimator'):
        TrackD3PDTrackToVertexIPEstimator = ToolSvc.TrackD3PDTrackToVertexIPEstimator
    else:
        from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
        TrackD3PDTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(
            name="TrackD3PDTrackToVertexIPEstimator",
            Extrapolator=AtlasExtrapolator,
            LinearizedTrackFactory=TrackD3PDLinTrkFactory)
        ToolSvc += TrackD3PDTrackToVertexIPEstimator

    args['TrackToVertexIPEstimator'] = TrackD3PDTrackToVertexIPEstimator
    return
예제 #2
0
    def __init__(self, name = 'AtlasVKalVxInJetFinder'  ):        

        from __main__ import ToolSvc
        mlog = logging.getLogger( 'AtlasVKalVxInJetFinder::__init__ ' )
        mlog.info("entering")
        #----------------- ATLAS magnetic field
        from AthenaCommon.AppMgr import ServiceMgr
        from MagFieldServices.MagFieldServicesConf import MagField__AtlasFieldSvc
        ServiceMgr += MagField__AtlasFieldSvc("myAtlasFieldSvc");
        #----------------- ATLAS extrapolator
        from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
        SVAtlasExtrapolator=AtlasExtrapolator()
        ToolSvc+=SVAtlasExtrapolator

        #-------------------------- 
        from TrkTrackSummaryTool.AtlasTrackSummaryTool import AtlasTrackSummaryTool
        SVAtlasTrackSummaryTool = AtlasTrackSummaryTool()
        ToolSvc += SVAtlasTrackSummaryTool

        #-------------------------
        # TrackParticle creator
        #
        from TrkParticleCreator.TrkParticleCreatorConf     import Trk__TrackParticleCreatorTool
        SVParticleCreatorTool = Trk__TrackParticleCreatorTool(name="SVParticleCreatorTool",
                                                              TrackSummaryTool=SVAtlasTrackSummaryTool,
                                                              UseTrackSummaryTool=False
                                                             )
        ToolSvc += SVParticleCreatorTool
        #----------------------
        # VKalVrt vertex fitter
        # 
        from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
        SVertexFitterTool = Trk__TrkVKalVrtFitter(name="SVertexFitterTool",
                                                  Extrapolator=SVAtlasExtrapolator,
                                                  AtlasMagFieldSvc = "myAtlasFieldSvc"
                                                 )
        ToolSvc += SVertexFitterTool
        #----------------------
        # Secondary vertex finder itself
        #
        from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory
        SVLinearizedTrackFactory = Trk__FullLinearizedTrackFactory(name="SVLinearizedTrackFactory",Extrapolator = SVAtlasExtrapolator)
        ToolSvc += SVLinearizedTrackFactory             

        from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
        SVTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(name="SVTrackToVertexIPEstimator",
                                                                   Extrapolator = SVAtlasExtrapolator,
                                                                   LinearizedTrackFactory=SVLinearizedTrackFactory)
        ToolSvc += SVTrackToVertexIPEstimator

        InDet__InDetVKalVxInJetTool.__init__( self, name = name,
                                             VertexFitterTool     = SVertexFitterTool,
                                             TrackParticleCreator = SVParticleCreatorTool,
                                             TrackSummaryTool     = SVAtlasTrackSummaryTool,
                                             TrackToVertexTool    = SVTrackToVertexIPEstimator
                                            )
예제 #3
0
def getTauTrackToVertexIPEstimator():
    _name = sPrefix + 'TauTrackToVertexIPEstimator'
    
    from AthenaCommon.AppMgr import ToolSvc
    
    if _name in cached_instances:
        return cached_instances[_name]
    
    from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
    TauTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(name = _name,
                                                                Extrapolator=getAtlasExtrapolator(),
                                                                LinearizedTrackFactory=getTauFullLinearizedTrackFactory())
    cached_instances[_name] = TauTrackToVertexIPEstimator
    ToolSvc += TauTrackToVertexIPEstimator
    return TauTrackToVertexIPEstimator                                     
예제 #4
0
def toolBTagTrackToVertexIPEstimator(name,
                                     useBTagFlagsDefaults=True,
                                     **options):
    """Sets up a TrackToVertexIPEstimator tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then be added to ToolSvc via ToolSvc += output."""
    if useBTagFlagsDefaults:
        defaults = {'OutputLevel': BTaggingFlags.OutputLevel}
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
    return Trk__TrackToVertexIPEstimator(**options)
                          "AntiKt4EMTopo")

BTagConf.PrefixxAODBaseName(False)
BTagConf.PrefixVertexFinderxAODBaseName(False)
BTagConf.doNotCheckForTaggerObstacles()
NotInJetToolManager = []  # For jet collections

btagger = BTagConf.setupJetBTaggerTool(ToolSvc,
                                       "AntiKt4EMTopo",
                                       AddToToolSvc=True,
                                       SetupScheme="Trig",
                                       TaggerList=BTaggingFlags.TriggerTaggers)

from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator

ToolSvc += Trk__TrackToVertexIPEstimator("trkIPEstimator")

alg1 = CfgMgr.BTriggerTuning()
### For FTK
#alg1.TriggerName = "HLT_j35_boffperf_split_FTK"
#alg1.Trig_JetKey = "SplitJet"
#alg1.Trig_PriVtxKey = "HLT_PrimVertexFTK"  # Primary vertices are not attached to the trigger navigation yet. Should be solved by 21.0.18
#alg1.Trig_TrackKey = "InDetTrigTrackingxAODCnv_Bjet_FTK_IDTrig"

#alg1.TriggerName = "HLT_j35_boffperf_split"
alg1.TriggerName = "HLT_j15_gsc35_boffperf_split"
alg1.Stream = "TriggerJets"
alg1.Trig_JetKey = "JETTYPE"
alg1.BTagTool = BTagConf.getJetCollectionTool("AntiKt4EMTopo")
alg1.BTagTrackAssocTool = BTagConf.getJetCollectionMainAssociatorTool(
    "AntiKt4EMTopo")
    if hasattr(ToolSvc, 'BTagTrackToVertexIPEstimator'):
        JetTagD3PDTrackToVertexIPEstimator = ToolSvc.BTagTrackToVertexIPEstimator
        print "JetTagD3PD Info: found BTagTrackToVertexIPEstimator (for track d3pd)"
    elif hasattr(ToolSvc, 'JetTagD3PDTrackToVertexIPEstimator'):
        print "JetTagD3PD Info: found JetTagD3PDTrackToVertexIPEstimator (for track d3pd)"
        JetTagD3PDTrackToVertexIPEstimator = ToolSvc.JetTagD3PDTrackToVertexIPEstimator
    else:
        print "JetTagD3PD Info: configure TrackToVertexIPEstimator (for track d3pd)"
        from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory
        JetTagD3PDLinTrkFactory = Trk__FullLinearizedTrackFactory(
            name="JetTagD3PDFullLinearizedTrackFactory",
            Extrapolator=ToolSvc.AtlasExtrapolator)
        ToolSvc += JetTagD3PDLinTrkFactory
        from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
        JetTagD3PDTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(\
          name="JetTagD3PDTrackToVertexIPEstimator",
          Extrapolator=ToolSvc.AtlasExtrapolator,
          LinearizedTrackFactory=JetTagD3PDLinTrkFactory)
        ToolSvc += JetTagD3PDTrackToVertexIPEstimator

    if hasattr(alg, 'trk_Filler'):
        if hasattr(alg.trk_Filler,
                   'trk_Filler_D3PD__TrackParticlePerigeeAtOOAssociationTool'):
            if hasattr(
                    alg.trk_Filler.
                    trk_Filler_D3PD__TrackParticlePerigeeAtOOAssociationTool,
                    'trk_Filler_D3PD__TrackParticlePerigeeAtOOAssociationTool_trk_IPEstimate'
            ):
                alg.trk_Filler.trk_Filler_D3PD__TrackParticlePerigeeAtOOAssociationTool.trk_Filler_D3PD__TrackParticlePerigeeAtOOAssociationTool_trk_IPEstimate.TrackToVertexIPEstimator = JetTagD3PDTrackToVertexIPEstimator

### hack to change the PV collection for some of the tracking d3pd tools
if hasattr(alg, 'trk_Filler'):
예제 #7
0
    name="InDetDetailedTrackSelectionTool",
    CutLevel=InDetPrimaryVertexingCuts.TrackCutLevel(),
    minPt=InDetPrimaryVertexingCuts.minPT(),
    maxD0=InDetPrimaryVertexingCuts.IPd0Max(),
    maxZ0=InDetPrimaryVertexingCuts.z0Max(),
    maxZ0SinTheta=InDetPrimaryVertexingCuts.IPz0Max(),
    maxSigmaD0=InDetPrimaryVertexingCuts.sigIPd0Max(),
    maxSigmaZ0SinTheta=InDetPrimaryVertexingCuts.sigIPz0Max(),
    maxAbsEta=InDetPrimaryVertexingCuts.etaMax(),
    minNInnermostLayerHits=InDetPrimaryVertexingCuts.nHitInnermostLayer(),
    minNPixelHits=InDetPrimaryVertexingCuts.nHitPix(),
    maxNPixelHoles=InDetPrimaryVertexingCuts.nHolesPix(),
    minNSctHits=InDetPrimaryVertexingCuts.nHitSct(),
    minNTrtHits=InDetPrimaryVertexingCuts.nHitTrt(),
    minNSiHits=InDetPrimaryVertexingCuts.nHitSi(),
    TrackSummaryTool=InDetTrackSummaryTool,
    Extrapolator=InDetExtrapolator)
ToolSvc += InDetTrackSelectorTool

from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
IPTool = Trk__TrackToVertexIPEstimator(name="IPEstimator",
                                       Extrapolator=InDetExtrapolator)

from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__GaussianDensityTestAlg
myAlg = Trk__GaussianDensityTestAlg(name="TestAlg",
                                    Estimator=GaussianDensity,
                                    TrackSelector=InDetTrackSelectorTool,
                                    IPEstimator=IPTool)
myAlg.OutputLevel = DEBUG
algSeq += myAlg
예제 #8
0
idDxAOD_doPix=True
idDxAOD_doSct=True
idDxAOD_doTrt=False

# IsMonteCarlo=(globalflags.DataSource == 'geant4')

if 'DerivationFrameworkIsMonteCarlo' not in dir() :
  DerivationFrameworkIsMonteCarlo=( globalflags.DataSource=='geant4' )

IsMonteCarlo=DerivationFrameworkIsMonteCarlo

#====================================================================
# CP GROUP TOOLS
#====================================================================
from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
IDTIDE1IPETool = Trk__TrackToVertexIPEstimator(name = "IDTIDE1IPETool")
ToolSvc += IDTIDE1IPETool
print IDTIDE1IPETool

#Setup tools
if idDxAOD_doTrt:
  from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawNeighbourSvc
  TRTStrawNeighbourSvc=TRT_StrawNeighbourSvc()
  ServiceMgr += TRTStrawNeighbourSvc
  from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
  TRTCalibDBSvc=TRT_CalDbSvc()
  ServiceMgr += TRTCalibDBSvc


#====================================================================
# AUGMENTATION TOOLS
예제 #9
0
#====================================================================
# TRUTH SETUP
#====================================================================
if globalflags.DataSource() != 'data':
    from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents, addHFAndDownstreamParticles
    addStandardTruthContents()
    addHFAndDownstreamParticles()

#====================================================================
# AUGMENTATION TOOLS
# ( AUGMENTATION = adding information to the output DxAOD that is not found in the input file )
# Create IPE tool, then create augmenter and add to sequence
#====================================================================

#make IPE tool for BTagTrackAugmenter
FTAG2IPETool = Trk__TrackToVertexIPEstimator(name="FTAG2IPETool")
ToolSvc += FTAG2IPETool
printfunc(FTAG2IPETool)

#augment jets with track info
FTAG2Seq += CfgMgr.BTagVertexAugmenter()

#Add unbiased track parameters to track particles
#FTAG2TrackToVertexWrapper= DerivationFramework__TrackToVertexWrapper(name = "FTAG2TrackToVertexWrapper",
#        TrackToVertexIPEstimator = FTAG2IPETool,
#        DecorationPrefix = "FTAG2",
#        ContainerName = "InDetTrackParticles")
#ToolSvc += FTAG2TrackToVertexWrapper
#printfunc (FTAG2TrackToVertexWrapper)

#====================================================================
예제 #10
0
    # -- 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:
            print BTagLinTrkFactory
        from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
        BTagTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(
            name="BTagTrackToVertexIPEstimator",
            OutputLevel=BTaggingFlags.OutputLevel,
            Extrapolator=AtlasExtrapolator,
            LinearizedTrackFactory=BTagLinTrkFactory)
        ToolSvc += BTagTrackToVertexIPEstimator
        if BTaggingFlags.OutputLevel < 3:
            print BTagTrackToVertexIPEstimator

    # -- load secondary vertex tools:
    if (BTaggingFlags.SV1 | BTaggingFlags.SV2 | BTaggingFlags.IP1D
            | BTaggingFlags.IP2D | BTaggingFlags.IP3D | BTaggingFlags.JetProb
            | BTaggingFlags.TrackCounting):
        include("BTagging/BTagging_InDetVKalVxInJetTool.py")
        #  myBTagTool.SecVtxFinderList+= [ InDetVKalVxInJetTool ]
        #  myBTagTool.SecVtxFinderTrackNameList+=["Tracks"]
        thisBTagSecVertexing.SecVtxFinderList += [InDetVKalVxInJetTool]
        thisBTagSecVertexing.SecVtxFinderTrackNameList += ["Tracks"]
예제 #11
0
from PanTauAlgs.PanTauAlgsConf import PanTau__Tool_TauConstituentGetter
from PanTauAlgs.PanTauAlgsConf import PanTau__Tool_TauConstituentSelector
from PanTauAlgs.PanTauAlgsConf import PanTau__Tool_FeatureExtractor
from PanTauAlgs.PanTauAlgsConf import PanTau__Tool_HelperFunctions
from PanTauAlgs.PanTauAlgsConf import PanTau__Tool_ModeDiscriminator
from PanTauAlgs.PanTauAlgsConf import PanTau__Tool_DecayModeDeterminator
from PanTauAlgs.PanTauAlgsConf import PanTau__Tool_FourMomentumCalculator
from PanTauAlgs.PanTauAlgsConf import PanTau__Tool_DetailsArranger
from PanTauAlgs.PanTauAlgsConf import PanTau__Alg_SeedBuilder

from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
theAtlasExtrapolator = AtlasExtrapolator()
ToolSvc += theAtlasExtrapolator

python_Tool_TrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(
    Extrapolator=theAtlasExtrapolator)
ToolSvc += python_Tool_TrackToVertexIPEstimator

# ===> Information Store
python_Tool_InformationStore = PanTau__Tool_InformationStore(
    "PanTau_InformationStore",
    Infos_Int=infoHandler.m_Infos_Int,
    Infos_Double=infoHandler.m_Infos_Double,
    Infos_VecDouble=infoHandler.m_Infos_VecDouble,
    Infos_String=infoHandler.m_Infos_String,
    Infos_VecString=infoHandler.m_Infos_VecString)
python_Tool_InformationStore.OutputLevel = INFO
ToolSvc += python_Tool_InformationStore

# ===> Helper Functions
python_Tool_HelperFunctions = PanTau__Tool_HelperFunctions(
예제 #12
0
def addBTagInfoToJetObject(JetD3PDObject,
                           btagLevelOffset=0,
                           LocalFlags=JetTagD3PDFlags):

    ## first check if the blocks are already added to the JetD3PDObject
    ## the weight block is always added so check for it
    from AthenaCommon.Logging import logging
    addBTagInfoLogger = logging.getLogger("addBTagInfoToJetObject")

    if JetD3PDObject.allBlocknames().has_key(
            JetTagD3PDKeys.BTagWeightsBlockName()):
        addBTagInfoLogger.warning(
            "btag blocks already added to JetD3PDObject - ignore")
        return

    addBTagInfoLogger.info("Adding btag blocks to JetD3PDObject")

    #
    ## now add the block fillers
    ## basic info weights and truth if available
    ## specify a list of taggers via LocalFlags.Taggers()
    #

    JetD3PDObject.defineBlock(btagLevelOffset + 0,
                              JetTagD3PDKeys.BTagWeightsBlockName(),
                              JetTagD3PDMaker.JetTagBTagWeightsFillerTool,
                              prefix=JetTagD3PDKeys.BTagWeightsPrefix(),
                              TaggerNames=LocalFlags.Taggers())

    if rec.doTruth:

        JetD3PDObject.defineBlock(btagLevelOffset + 0,
                                  JetTagD3PDKeys.TruthInfoBlockName(),
                                  JetTagD3PDMaker.JetTagTruthInfoFillerTool,
                                  prefix=JetTagD3PDKeys.TruthInfoPrefix(),
                                  InfoType="TruthInfo")

        if LocalFlags.QGInfo():
            JetD3PDObject.defineBlock(
                btagLevelOffset + 0,
                JetTagD3PDKeys.QGPartonTruthInfoBlockName(),
                JetTagD3PDMaker.JetTagQGPartonTruthInfoFillerTool,
                prefix=JetTagD3PDKeys.QGPartonTruthInfoPrefix(),
                InfoType="QGPartonTruthInfo")

        if LocalFlags.PileupLabeling():
            JetD3PDObject.defineBlock(
                btagLevelOffset + 0,
                JetTagD3PDKeys.PUTruthInfoBlockName(),
                JetTagD3PDMaker.JetTagTruthInfoFillerTool,
                prefix=JetTagD3PDKeys.PUTruthInfoPrefix(),
                InfoType="TruthInfoPU")

            if LocalFlags.QGInfo():
                JetD3PDObject.defineBlock(
                    btagLevelOffset + 0,
                    JetTagD3PDKeys.PUQGPartonTruthInfoBlockName(),
                    JetTagD3PDMaker.JetTagQGPartonTruthInfoFillerTool,
                    prefix=JetTagD3PDKeys.PUQGPartonTruthInfoPrefix(),
                    InfoType="QGPartonTruthInfoPU")
    #
    ##association to tracks, electron, muons, and photons
    ##if the getter labels are not specified no association is done
    ##can add contained information if needed
    #

    if LocalFlags.JetTrackAssoc():

        JetTrackAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetTrackAssociationTool,
            '',  ## set target when calling the JetD3PDObject
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.JetTrackAssocPrefix(),
            blockname=JetTagD3PDKeys.JetTrackAssocBlockName(),
            FillVariables=False)

        JetTagD3PDTrackToVertexIPEstimator = None
        from AthenaCommon.AppMgr import ToolSvc
        if hasattr(ToolSvc, 'BTagTrackToVertexIPEstimator'):
            JetTagD3PDTrackToVertexIPEstimator = ToolSvc.BTagTrackToVertexIPEstimator
            print("JetTagD3PD Info: found BTagTrackToVertexIPEstimator")
        elif hasattr(ToolSvc, 'JetTagD3PDTrackToVertexIPEstimator'):
            print("JetTagD3PD Info: found JetTagD3PDTrackToVertexIPEstimator")
            JetTagD3PDTrackToVertexIPEstimator = ToolSvc.JetTagD3PDTrackToVertexIPEstimator
        else:
            print("JetTagD3PD Info: configure TrackToVertexIPEstimator")
            from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory
            extrap = AtlasExtrapolator()
            ToolSvc += extrap
            JetTagD3PDLinTrkFactory = Trk__FullLinearizedTrackFactory(
                name="JetTagD3PDFullLinearizedTrackFactory",
                Extrapolator=extrap)
            ToolSvc += JetTagD3PDLinTrkFactory
            from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
            JetTagD3PDTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(\
                name="JetTagD3PDTrackToVertexIPEstimator",
                Extrapolator=extrap,
                LinearizedTrackFactory=JetTagD3PDLinTrkFactory)
            ToolSvc += JetTagD3PDTrackToVertexIPEstimator

        JetTrack = ContainedVectorMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetTrackAssociationTool,
            level=btagLevelOffset + 4,
            prefix=JetTagD3PDKeys.JetTrackAssocPrefix(),
            blockname=JetTagD3PDKeys.JetTrackBlockName(),
            nrowName='',
            TrackToVertexIPEstimator=JetTagD3PDTrackToVertexIPEstimator,
            PrimaryVertexCollection=JetTagD3PDFlags.PrimaryVertexSGKey())

    if LocalFlags.JetTrackGhostAssoc():
        JetTrackAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetTrackAssociationTool,
            '',  ## set target when calling the JetD3PDObject
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.JetTrackGhostAssocPrefix(),
            blockname=JetTagD3PDKeys.JetTrackGhostAssocBlockName(),
            FillVariables=False,
            TrackAssocName=LocalFlags.JetTrackGhostAssocName())

    if LocalFlags.JetBHadronGhostAssoc():
        JetBHadronAssoc = ContainedVectorMultiAssociation(\
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetNavigable4MomentumAssociationTool,
            JetTagD3PDKeys.JetBHadronGhostAssocPrefix(),
            level = 900,
            blockname=JetTagD3PDKeys.JetBHadronGhostAssocBlockName()+"tmp",
            Navigable4MomentumAssocName=LocalFlags.JetBHadronGhostAssocName())

        IndexAssociation(
            JetBHadronAssoc,
            TruthD3PDMaker.TruthParticleGenParticleAssociationTool,
            '',
            level=_jetTagAssocLevel,
            blockname=JetTagD3PDKeys.JetBHadronGhostAssocBlockName(),
            prefix="")

    if LocalFlags.JetTruthGhostAssoc():
        JetTruthAssoc = ContainedVectorMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetNavigable4MomentumAssociationTool,
            JetTagD3PDKeys.JetTruthGhostAssocPrefix(),
            level=900,
            blockname=JetTagD3PDKeys.JetTruthGhostAssocBlockName() + "tmp",
            Navigable4MomentumAssocName=LocalFlags.JetTruthGhostAssocName())

        IndexAssociation(
            JetTruthAssoc,
            TruthD3PDMaker.TruthParticleGenParticleAssociationTool,
            '',
            level=_jetTagAssocLevel,
            blockname=JetTagD3PDKeys.JetTruthGhostAssocBlockName(),
            prefix="")

    if LocalFlags.JetConstituantTruthAssoc():
        ConstitAssoc = ContainedVectorMultiAssociation \
            (JetD3PDObject,
             EventCommonD3PDMaker.NavigableConstituentAssociationTool,
             'constit_',
             nrowName = '',
             TypeName = 'TruthParticle',
             blockname= JetTagD3PDKeys.JetConstituantTruthAssocBlockName()+"tmp",
             level = 900 )

        IndexAssociation(
            ConstitAssoc,
            TruthD3PDMaker.TruthParticleGenParticleAssociationTool,
            '',
            level=_jetTagAssocLevel,
            blockname=JetTagD3PDKeys.JetConstituantTruthAssocBlockName(),
            prefix="mcpart_")

    if LocalFlags.JetMuonAssoc():

        JetMuonAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetMuonAssociationTool,
            '',  ## set target when calling the JetD3PDObject
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.JetMuonAssocPrefix(),
            blockname=JetTagD3PDKeys.JetMuonAssocBlockName())

        if LocalFlags.AddSecondMuonCollection():

            JetMuon2Assoc = IndexMultiAssociation(
                JetD3PDObject,
                JetTagD3PDMaker.JetTagJetMuonAssociationTool,
                '',
                level=_jetTagAssocLevel,
                prefix=JetTagD3PDKeys.JetMuon2AssocPrefix(),
                blockname=JetTagD3PDKeys.JetMuon2AssocBlockName(),
                MuonsName="SecondMuons")

    if LocalFlags.JetElectronAssoc():

        JetElectronAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetElectronAssociationTool,
            '',
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.JetElectronAssocPrefix(),
            blockname=JetTagD3PDKeys.JetElectronAssocBlockName())

    if LocalFlags.JetPhotonAssoc():

        JetPhotonAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetPhotonAssociationTool,
            '',
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.JetPhotonAssocPrefix(),
            blockname=JetTagD3PDKeys.JetPhotonAssocBlockName())

    if rec.doTruth and LocalFlags.JetGenSoftLeptonAssoc():

        JetGenSoftLeptonAssoc = IndexMultiAssociation(\
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetGenSoftLeptonAssociationTool,
            '',
            level = _jetTagAssocLevel,
            prefix=JetTagD3PDKeys.JetGenSoftLeptonAssocPrefix(),
            blockname=JetTagD3PDKeys.JetGenSoftLeptonAssocBlockName(),
            MCCollections = D3PDMakerFlags.TruthSGKey(),
            FillVariables=False)



        JetGenSoftLepton = ContainedVectorMultiAssociation(\
            JetD3PDObject,
            JetTagD3PDMaker.JetTagJetGenSoftLeptonAssociationTool,
            level = btagLevelOffset+4,
            prefix=JetTagD3PDKeys.JetGenSoftLeptonAssocPrefix(),
            blockname=JetTagD3PDKeys.JetGenSoftLeptonBlockName(),
            nrowName = '',
            MCCollections = D3PDMakerFlags.TruthSGKey())

        JetGenSoftLepton.defineBlock(
            btagLevelOffset + 20,
            JetTagD3PDKeys.JetGenSoftLeptonPropBlockName(),
            EventCommonD3PDMaker.GenParticleFillerTool)

    #
    ## info base for each tagger: basicaly B/U/C probabilities
    #

    if LocalFlags.InfoBase():

        JetD3PDObject.defineBlock(btagLevelOffset + 1,
                                  JetTagD3PDKeys.IP2DInfoBaseBlockName(),
                                  JetTagD3PDMaker.JetTagInfoBaseFillerTool,
                                  prefix=JetTagD3PDKeys.IP2DInfoBasePrefix(),
                                  InfoType="IP2D",
                                  AddPC=True)

        JetD3PDObject.defineBlock(btagLevelOffset + 1,
                                  JetTagD3PDKeys.IP2DIPInfoBaseBlockName(),
                                  JetTagD3PDMaker.JetTagIPInfoBaseFillerTool,
                                  prefix=JetTagD3PDKeys.IP2DInfoBasePrefix(),
                                  InfoType="IP2D")

        JetD3PDObject.defineBlock(btagLevelOffset + 1,
                                  JetTagD3PDKeys.IP3DInfoBaseBlockName(),
                                  JetTagD3PDMaker.JetTagInfoBaseFillerTool,
                                  prefix=JetTagD3PDKeys.IP3DInfoBasePrefix(),
                                  InfoType="IP3D",
                                  AddPC=True)

        JetD3PDObject.defineBlock(btagLevelOffset + 1,
                                  JetTagD3PDKeys.IP3DIPInfoBaseBlockName(),
                                  JetTagD3PDMaker.JetTagIPInfoBaseFillerTool,
                                  prefix=JetTagD3PDKeys.IP3DInfoBasePrefix(),
                                  InfoType="IP3D")

        JetD3PDObject.defineBlock(
            btagLevelOffset + 1,
            JetTagD3PDKeys.JetProbInfoBaseBlockName(),
            JetTagD3PDMaker.JetTagJetProbInfoBaseFillerTool,
            prefix=JetTagD3PDKeys.JetProbInfoBasePrefix(),
            InfoType="JetProb",
            # This may be missing in 17.2 samples.
            AllowMissing=at_least_version('17.2.0'))

        JetD3PDObject.defineBlock(btagLevelOffset + 1,
                                  JetTagD3PDKeys.SV1InfoBaseBlockName(),
                                  JetTagD3PDMaker.JetTagInfoBaseFillerTool,
                                  prefix=JetTagD3PDKeys.SV1InfoBasePrefix(),
                                  InfoType="SV1",
                                  AddPC=True)

        JetD3PDObject.defineBlock(btagLevelOffset + 1,
                                  JetTagD3PDKeys.SV2InfoBaseBlockName(),
                                  JetTagD3PDMaker.JetTagInfoBaseFillerTool,
                                  prefix=JetTagD3PDKeys.SV2InfoBasePrefix(),
                                  InfoType="SV2")

        JetD3PDObject.defineBlock(
            btagLevelOffset + 0,
            JetTagD3PDKeys.JetFitterInfoBaseBlockName(),
            JetTagD3PDMaker.JetTagInfoBaseFillerTool,
            prefix=JetTagD3PDKeys.JetFitterTagInfoPrefix(),
            InfoType="JetFitterTagNN,JetFitterTag",
            AddPC=True)

        JetD3PDObject.defineBlock(
            btagLevelOffset + 0,
            JetTagD3PDKeys.JetFitterCombInfoBaseBlockName(),
            JetTagD3PDMaker.JetTagInfoBaseFillerTool,
            prefix=JetTagD3PDKeys.JetFitterCombInfoBasePrefix(),
            InfoType="JetFitterCOMBNN,JetFitterCOMB",
            AddPC=True)

        if LocalFlags.GbbNNInfo():
            JetD3PDObject.defineBlock(
                btagLevelOffset + 1,
                JetTagD3PDKeys.GbbNNInfoBlockName(),
                JetTagD3PDMaker.JetTagGbbNNInfoFillerTool,
                prefix=JetTagD3PDKeys.GbbNNInfoPrefix(),
                InfoType="GbbNN")

        if LocalFlags.NewGbbNNInfo():
            JetD3PDObject.defineBlock(
                btagLevelOffset + 1,
                JetTagD3PDKeys.NewGbbNNInfoBlockName(),
                JetTagD3PDMaker.JetTagHadFlavorTagInfoFillerTool,
                prefix=JetTagD3PDKeys.NewGbbNNInfoPrefix(),
                InfoType="NewGbbNN")

        if LocalFlags.QGInfo():
            JetD3PDObject.defineBlock(
                btagLevelOffset + 1,
                JetTagD3PDKeys.QGInfoBlockName(),
                JetTagD3PDMaker.JetTagHadFlavorTagInfoFillerTool,
                prefix=JetTagD3PDKeys.QGInfoPrefix(),
                InfoType="QG")

        if LocalFlags.InfoBaseCalib():

            JetD3PDObject.defineBlock(
                btagLevelOffset + 3,
                JetTagD3PDKeys.JetFitterFlipInfoBaseBlockName(),
                JetTagD3PDMaker.JetTagInfoBaseFillerTool,
                prefix=JetTagD3PDKeys.JetFitterTagFlipInfoPrefix(),
                InfoType="JetFitterTagNNFlip,JetFitterTagFlip",
                AddPC=True)

            JetD3PDObject.defineBlock(
                btagLevelOffset + 3,
                JetTagD3PDKeys.JetFitterCombIP3DPosInfoBaseBlockName(),
                JetTagD3PDMaker.JetTagInfoBaseFillerTool,
                prefix=JetTagD3PDKeys.JetFitterCombIP3DPosInfoBasePrefix(),
                InfoType="JetFitterCOMBNNIP3DPos,JetFitterCOMBIP3DPos",
                AddPC=True)

            JetD3PDObject.defineBlock(
                btagLevelOffset + 3,
                JetTagD3PDKeys.JetFitterCombIP3DNegInfoBaseBlockName(),
                JetTagD3PDMaker.JetTagInfoBaseFillerTool,
                prefix=JetTagD3PDKeys.JetFitterCombIP3DNegInfoBasePrefix(),
                InfoType="JetFitterCOMBNNIP3DNeg,JetFitterCOMBIP3DNeg",
                AddPC=True)

    # if LocalFlags.InfoBaseGaia():

    #     JetD3PDObject.defineBlock(
    #         btagLevelOffset+1, "JetTag_Gaia",
    #         JetTagD3PDMaker.JetTagInfoBaseFillerTool,
    #         prefix="flavor_component_gaia_",
    #         InfoType="Gaia",
    #         AddPC=True,
    #         AddPTau=False)

    #     JetD3PDObject.defineBlock(
    #         btagLevelOffset+1, "JetTag_GaiaNeg",
    #         JetTagD3PDMaker.JetTagInfoBaseFillerTool,
    #         prefix="flavor_component_gaianeg_",
    #         InfoType="GaiaNeg",
    #         AddPC=True,
    #         AddPTau=False)

    #     # TODO: this should get its own block
    #     JetD3PDObject.defineBlock(
    #         btagLevelOffset+1, "JetTag_IPFordG", # also needs a rename
    #         JetTagD3PDMaker.JetTagInfoBaseFillerTool,
    #         prefix="flavor_component_ip3dloose_",
    #         InfoType="IPFordG", # also needs to be changed in JetTagTools
    #         AddPC=True)

    ## some additional info for jet fitter
    #

    if LocalFlags.JetFitterTagInfo():

        JetD3PDObject.defineBlock(
            btagLevelOffset + 2,
            JetTagD3PDKeys.JetFitterTagInfoBlockName(),
            JetTagD3PDMaker.JetTagJetFitterTagInfoFillerTool,
            prefix=JetTagD3PDKeys.JetFitterTagInfoPrefix(),
            InfoType="JetFitterTagNN,JetFitterTag")

        if LocalFlags.JetFitterTagFlipInfo():

            JetD3PDObject.defineBlock(
                btagLevelOffset + 2,
                JetTagD3PDKeys.JetFitterTagFlipInfoBlockName(),
                JetTagD3PDMaker.JetTagJetFitterTagInfoFillerTool,
                prefix=JetTagD3PDKeys.JetFitterTagFlipInfoPrefix(),
                InfoType="JetFitterTagNNFlip,JetFitterTagFlip")

    if LocalFlags.JetFitterCharmTagInfo():

        JetD3PDObject.defineBlock(
            btagLevelOffset + 2,
            JetTagD3PDKeys.JetFitterCharmTagInfoBlockName(),
            JetTagD3PDMaker.JetTagJetFitterGenericTagInfoFillerTool,
            prefix=JetTagD3PDKeys.JetFitterCharmTagInfoPrefix(),
            InfoType="JetFitterCharm")

        JetD3PDObject.defineBlock(
            btagLevelOffset + 0,
            JetTagD3PDKeys.JetFitterCharmInfoBaseBlockName(),
            JetTagD3PDMaker.JetTagInfoBaseFillerTool,
            prefix=JetTagD3PDKeys.JetFitterCharmTagInfoPrefix(),
            InfoType="JetFitterCharm",
            AddPC=True)

        if LocalFlags.InfoBaseCalib():
            JetD3PDObject.defineBlock(
                btagLevelOffset + 0,
                JetTagD3PDKeys.JetFitterCharmInfoBaseBlockName() + "NEG",
                JetTagD3PDMaker.JetTagInfoBaseFillerTool,
                prefix="flavor_component_jfitcneg_",
                InfoType="JetFitterCharmNeg",
                AddPC=True)

    #
    ## track information used for IP taggers
    #

    if LocalFlags.IPInfoPlus():

        IPInfoPlusTrackAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagIPInfoPlusTrackAssociationTool,
            '',
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.IPInfoPlusTrackAssocPrefix(),
            blockname=JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName(),
            FillVariables=False,
            AllowMissing=True)

        IPInfoPlusTrack = ContainedVectorMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagIPInfoPlusTrackAssociationTool,
            level=btagLevelOffset + 2,
            prefix=JetTagD3PDKeys.IPInfoPlusTrackAssocPrefix(),
            blockname=JetTagD3PDKeys.IPInfoPlusTrackBlockName(),
            nrowName='',
            AllowMissing=True)

        IPInfoPlusTrack.defineBlock(btagLevelOffset + 20,
                                    JetTagD3PDKeys.IPInfoPlusTrkP4BlockName(),
                                    EventCommonD3PDMaker.FourMomFillerTool,
                                    prefix="",
                                    WriteM=False)

    #
    ## vertex information used for SV1/SV2 taggers
    #

    if LocalFlags.SVInfoPlus():
        JetD3PDObject.defineBlock(btagLevelOffset + 2,
                                  JetTagD3PDKeys.SVInfoPlusBlockName(),
                                  JetTagD3PDMaker.JetTagSVInfoPlusFillerTool,
                                  prefix=JetTagD3PDKeys.SVInfoPlusPrefix(),
                                  InfoType="SVInfoPlus",
                                  AllowMissing=True,
                                  AddNormDist=True)

        SVInfoPlusTrackAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSVInfoPlusTrackAssociationTool,
            '',
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.SVInfoPlusTrackAssocPrefix(),
            blockname=JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName(),
            AllowMissing=True)

        SVInfoPlusTrack = ContainedVectorMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSVInfoPlusTrackAssociationTool,
            level=btagLevelOffset + 20,
            prefix=JetTagD3PDKeys.SVInfoPlusTrackAssocPrefix(),
            blockname=JetTagD3PDKeys.SVInfoPlusTrackBlockName(),
            nrowName='',
            AllowMissing=True)

        SVInfoPlusTrack.defineBlock(btagLevelOffset + 20,
                                    JetTagD3PDKeys.SVInfoPlusTrkP4BlockName(),
                                    EventCommonD3PDMaker.FourMomFillerTool,
                                    prefix='',
                                    WriteM=False)

    #
    ## vertex information used for the SV0 tagger
    #

    if LocalFlags.SV0InfoPlus():

        JetD3PDObject.defineBlock(btagLevelOffset + 2,
                                  JetTagD3PDKeys.SV0InfoPlusBlockName(),
                                  JetTagD3PDMaker.JetTagSVInfoPlusFillerTool,
                                  prefix=JetTagD3PDKeys.SV0InfoPlusPrefix(),
                                  InfoType="SV0InfoPlus",
                                  AllowMissing=True)

        SV0InfoPlusTrackAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSVInfoPlusTrackAssociationTool,
            '',
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.SV0InfoPlusTrackAssocPrefix(),
            blockname=JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName(),
            InfoType="SV0InfoPlus",
            AllowMissing=True)

        SV0InfoPlusTrack = ContainedVectorMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSVInfoPlusTrackAssociationTool,
            level=btagLevelOffset + 20,
            prefix=JetTagD3PDKeys.SV0InfoPlusTrackAssocPrefix(),
            blockname=JetTagD3PDKeys.SV0InfoPlusTrackBlockName(),
            nrowName='',
            InfoType="SV0InfoPlus",
            AllowMissing=True)

        SV0InfoPlusTrack.defineBlock(
            btagLevelOffset + 20,
            JetTagD3PDKeys.SV0InfoPlusTrkP4BlockName(),
            EventCommonD3PDMaker.FourMomFillerTool,
            prefix='',
            WriteM=False)

    #
    ## muon information used for the soft muon tagger
    #

    if LocalFlags.SoftMuonInfo():

        SoftMuonInfoMuonAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool,
            '',
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.SoftMuonInfoMuonAssocPrefix(),
            blockname=JetTagD3PDKeys.SoftMuonInfoMuonAssocBlockName(),
            FillVariables=False,
            AllowMissing=True)

        SoftMuonInfoMuon = ContainedVectorMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool,
            level=btagLevelOffset + 2,
            prefix=JetTagD3PDKeys.SoftMuonInfoMuonAssocPrefix(),
            blockname=JetTagD3PDKeys.SoftMuonInfoMuonBlockName(),
            nrowName='',
            AllowMissing=True)

        leveloffset = 20
        if LocalFlags.AddInlineSoftMuonProperties():
            leveloffset = -btagLevelOffset

        SoftMuonInfoMuon.defineBlock(btagLevelOffset + leveloffset,
                                     JetTagD3PDKeys.SoftMuonInfoP4BlockName(),
                                     EventCommonD3PDMaker.FourMomFillerTool,
                                     prefix='',
                                     WriteM=False,
                                     WriteE=True)

        SoftMuonInfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonInfoChargeBlockName(),
            EventCommonD3PDMaker.ChargeFillerTool)
        SoftMuonInfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonInfoAuthorBlockName(),
            MuonD3PDMaker.MuonAuthorFillerTool)
        SoftMuonInfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonInfomatchChi2BlockName(),
            MuonD3PDMaker.MuonMatchQualityFillerTool)
        SoftMuonInfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonInfoAcceptBlockName(),
            MuonD3PDMaker.MuonAcceptMethodFillerTool)
        SoftMuonInfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonInfoELossBlockName(),
            MuonD3PDMaker.MuonELossFillerTool)
        SoftMuonInfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonInfoHitsBlockName(),
            MuonD3PDMaker.MuonTrkHitFillerTool,
            SaveIDMuonHitSummary=False)

        if LocalFlags.AddSecondMuonCollection():

            SoftMuon2InfoMuon2Assoc =  IndexMultiAssociation(\
                JetD3PDObject,
                JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool,
                '',
                level = _jetTagAssocLevel,
                prefix=JetTagD3PDKeys.SoftMuon2InfoMuon2AssocPrefix(),
                blockname=JetTagD3PDKeys.SoftMuon2InfoMuon2AssocBlockName(),
                InfoType="SecondSoftMuonTag",
                FillVariables=False,
                AllowMissing = True)

            SoftMuon2InfoMuon2 =  ContainedVectorMultiAssociation(\
                JetD3PDObject,
                JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool,
                level = btagLevelOffset+3,
                prefix=JetTagD3PDKeys.SoftMuon2InfoMuon2AssocPrefix(),
                blockname=JetTagD3PDKeys.SoftMuon2InfoMuon2BlockName(),
                nrowName = '',
                InfoType="SecondSoftMuonTag",
                AllowMissing = True)

            SoftMuon2InfoMuon2.defineBlock(
                btagLevelOffset + 20,
                JetTagD3PDKeys.SoftMuon2InfoP4BlockName(),
                EventCommonD3PDMaker.FourMomFillerTool,
                prefix='',
                WriteM=False)

    #
    ## muon information used for soft muon chi2 tagger
    #

    if LocalFlags.SoftMuonChi2Info():

        SoftMuonChi2InfoMuonAssoc = IndexMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool,
            '',
            level=_jetTagAssocLevel,
            prefix=JetTagD3PDKeys.SoftMuonChi2InfoMuonAssocPrefix(),
            blockname=JetTagD3PDKeys.SoftMuonChi2InfoMuonAssocBlockName(),
            InfoType="SoftMuonTagChi2",
            FillVariables=False,
            AllowMissing=True)

        SoftMuonChi2InfoMuon = ContainedVectorMultiAssociation(
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool,
            level=btagLevelOffset + 2,
            prefix=JetTagD3PDKeys.SoftMuonChi2InfoMuonAssocPrefix(),
            blockname=JetTagD3PDKeys.SoftMuonChi2InfoMuonBlockName(),
            InfoType="SoftMuonTagChi2",
            nrowName='',
            AllowMissing=True)

        leveloffset = 20
        if LocalFlags.AddInlineSoftMuonChi2Properties():
            leveloffset = -btagLevelOffset

        SoftMuonChi2InfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonChi2InfoP4BlockName(),
            EventCommonD3PDMaker.FourMomFillerTool,
            prefix='',
            WriteM=False,
            WriteE=True)

        SoftMuonChi2InfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonChi2InfoChargeBlockName(),
            EventCommonD3PDMaker.ChargeFillerTool)
        SoftMuonChi2InfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonChi2InfoAuthorBlockName(),
            MuonD3PDMaker.MuonAuthorFillerTool)
        SoftMuonChi2InfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonChi2InfomatchChi2BlockName(),
            MuonD3PDMaker.MuonMatchQualityFillerTool)
        SoftMuonChi2InfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonChi2InfoAcceptBlockName(),
            MuonD3PDMaker.MuonAcceptMethodFillerTool)
        SoftMuonChi2InfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonChi2InfoELossBlockName(),
            MuonD3PDMaker.MuonELossFillerTool)
        SoftMuonChi2InfoMuon.defineBlock(
            btagLevelOffset + leveloffset,
            JetTagD3PDKeys.SoftMuonChi2InfoHitsBlockName(),
            MuonD3PDMaker.MuonTrkHitFillerTool,
            SaveIDMuonHitSummary=False)

        if LocalFlags.AddSecondMuonCollection():

            SoftMuon2Chi2InfoMuon2Assoc =  IndexMultiAssociation(\
                JetD3PDObject,
                JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool,
                '',
                level = _jetTagAssocLevel,
                prefix=JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2AssocPrefix(),
                blockname=JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2AssocBlockName(),
                InfoType="SecondSoftMuonTagChi2",
                FillVariables=False,
                AllowMissing = True)

            SoftMuon2Chi2InfoMuon2 =  ContainedVectorMultiAssociation(\
                JetD3PDObject,
                JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool,
                level = btagLevelOffset+3,
                prefix=JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2AssocPrefix(),
                blockname=JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2BlockName(),
                nrowName = '',
                InfoType="SecondSoftMuonTagChi2",
                AllowMissing = True)

            SoftMuon2Chi2InfoMuon2.defineBlock(
                btagLevelOffset + 20,
                JetTagD3PDKeys.SoftMuon2Chi2InfoP4BlockName(),
                EventCommonD3PDMaker.FourMomFillerTool,
                prefix='',
                WriteM=False)

    #
    ## electron information used for the soft electron tagger
    #

    if LocalFlags.SoftElectronInfo():

        SoftElectronInfoElectronAssoc =  IndexMultiAssociation(\
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSoftElecInfoegammaAssociationTool,
            '',
            level = _jetTagAssocLevel,
            prefix=JetTagD3PDKeys.SoftElectronInfoElectronAssocPrefix(),
            blockname=JetTagD3PDKeys.SoftElectronInfoElectronAssocBlockName(),
            FillVariables=False,
            AllowMissing = True)


        SoftElectronInfoElectron =  ContainedVectorMultiAssociation(\
            JetD3PDObject,
            JetTagD3PDMaker.JetTagSoftElecInfoegammaAssociationTool,
            level = btagLevelOffset+2,
            prefix=JetTagD3PDKeys.SoftElectronInfoElectronAssocPrefix(),
            blockname=JetTagD3PDKeys.SoftElectronInfoElectronBlockName(),
            nrowName = '',
            AllowMissing = True)

        SoftElectronInfoElectron.defineBlock(\
            btagLevelOffset+20, JetTagD3PDKeys.SoftElectronInfoP4BlockName(),
            EventCommonD3PDMaker.FourMomFillerTool,
            prefix='',
            WriteM=False)

    if LocalFlags.MultiSVInfoPlus():

        JetD3PDObject.defineBlock(
            btagLevelOffset + 3,
            JetTagD3PDKeys.MultiSVInfoPlusBlockName(),
            JetTagD3PDMaker.JetTagMultiSVInfoPlusFillerTool,
            prefix=JetTagD3PDKeys.MultiSVInfoPlusPrefix(),
            InfoType="MultiSVInfoPlus",
            AllowMissing=True)


        MultiSVInfoPlusTrackAssoc = IndexMultiAssociation(\
            JetD3PDObject,
            JetTagD3PDMaker.JetTagMultiSVInfoMSVVtxInfoAssociationTool,
                '',
            level = _jetTagAssocLevel,
            prefix=JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocPrefix(),
            blockname=JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName(),
            AllowMissing = True)

#### from here keep the ifs for association labels. These are used only by btag.

#
## additional information about the VKal secondary vertex finder used for SV tagger
#

    if LocalFlags.JetVKalVxBadTrack():

        if LocalFlags.TrackAssocLabel() != "":

            JetVKalVxBadTrackAssoc = IndexMultiAssociation(\
                JetD3PDObject,
                JetTagD3PDMaker.JetTagVKalVxInJetBadTrackAssociationTool,
                LocalFlags.TrackAssocLabel(),
                level = btagLevelOffset+5,
                prefix=JetTagD3PDKeys.JetVKalVxBadTrackAssocPrefix(),
                blockname=JetTagD3PDKeys.JetVKalVxBadTrackAssocBlockName())

            if LocalFlags.AddContainedTrackP4():
                JetVKalVxBadTrackAssoc.defineBlock(
                    btagLevelOffset + 10,
                    JetTagD3PDKeys.SV0InfoPlusTrkP4BlockName(),
                    EventCommonD3PDMaker.FourMomFillerTool,
                    prefix='',
                    WriteM=False)

        else:
            JetVKalVxBadTrackAssoc = ContainedVectorMultiAssociation(\
                JetD3PDObject,
                JetTagD3PDMaker.JetTagVKalVxInJetBadTrackAssociationTool,
                level = btagLevelOffset+6,
                prefix=JetTagD3PDKeys.JetVKalVxBadTrackAssocPrefix(),
                blockname=JetTagD3PDKeys.JetVKalVxBadTrackAssocBlockName())

            JetVKalVxBadTrackAssoc.defineBlock(
                btagLevelOffset + 6,
                JetTagD3PDKeys.SV0InfoPlusTrkP4BlockName(),
                EventCommonD3PDMaker.FourMomFillerTool,
                prefix='',
                WriteM=False)

    #
    ## additional information about the vertex finding for JetFitter*
    ## need to be associated with three additional D3PD objects defined in:
    ## JetTagVxOnJetAxisD3PDObject.py
    ## JetTagTwoTrackVertexD3PDObject.py
    #

    if LocalFlags.JetFitterVertexFinderInfo():

        JetD3PDObject.defineBlock(
            btagLevelOffset + 5,
            JetTagD3PDKeys.JetFitterVxAssocBlockName(),
            JetTagD3PDMaker.JetTagJetFitterVxFillerTool,
            prefix=JetTagD3PDKeys.JetFitterVxAssocPrefix())

        if LocalFlags.JFVxOnJetAxisAssocLabel() != "":

            JetVxOnJetAxisAssoc = IndexMultiAssociation(
                JetD3PDObject,
                JetTagD3PDMaker.JetTagJetVxOnJetAxisAssociationTool,
                LocalFlags.JFVxOnJetAxisAssocLabel(),
                level=btagLevelOffset + 5,
                prefix=JetTagD3PDKeys.JetJFVxOnJetAxisAssocPrefix(),
                blockname=JetTagD3PDKeys.JetJFVxOnJetAxisAssocBlockName(),
                VxOnJetHolderName=LocalFlags.JetJFVxOnJetAxisAssocSGKey(),
                InfoName="NewJetFitterVxFinder")

            if LocalFlags.JetFitterFlipVxOnJetAxisAssoc():

                JFFlipJetVxOnJetAxisAssoc = IndexMultiAssociation(\
                    JetD3PDObject,
                    JetTagD3PDMaker.JetTagJetVxOnJetAxisAssociationTool,
                    LocalFlags.JFVxOnJetAxisAssocLabel(),
                    level = btagLevelOffset+6,
                    prefix=JetTagD3PDKeys.JetJFFlipVxOnJetAxisAssocPrefix(),
                    blockname=JetTagD3PDKeys.JetJFFlipVxOnJetAxisAssocBlockName(),
                    VxOnJetHolderName=LocalFlags.JetJFVxOnJetAxisAssocSGKey(),
                    InfoName="NewJetFitterVxFinderFlip")

        if LocalFlags.JFTwoTrackVertexAssocLabel() != "":

            JetJFTwoTrackVertexAssoc = IndexMultiAssociation(\
                JetD3PDObject,
                JetTagD3PDMaker.JetTagJetJFTwoTrackVertexAssociationTool,
                LocalFlags.JFTwoTrackVertexAssocLabel(),
                level = btagLevelOffset+5,
                prefix=JetTagD3PDKeys.JetJFTwoTrackVertexAssocPrefix(),
                blockname=JetTagD3PDKeys.JetJFTwoTrackVertexAssocBlockName(),
                TwoTrackVertexName=LocalFlags.JetJFTwoTrackVertexAssocSGKey(),
                InfoName="NewJetFitterVxFinder")

            if LocalFlags.JetFitterFlipTwoTrackVertexAssoc():

                JetJFFlipTwoTrackVertexAssoc = IndexMultiAssociation(\
                JetD3PDObject,
                JetTagD3PDMaker.JetTagJetJFTwoTrackVertexAssociationTool,
                LocalFlags.JFTwoTrackVertexAssocLabel(),
                level = btagLevelOffset+6,
                prefix=JetTagD3PDKeys.JetJFFlipTwoTrackVertexAssocPrefix(),
                blockname=JetTagD3PDKeys.JetJFFlipTwoTrackVertexAssocBlockName(),
                TwoTrackVertexName=LocalFlags.JetJFTwoTrackVertexAssocSGKey(),
                InfoName="NewJetFitterVxFinderFlip")
예제 #13
0
# MUON4.py keeps muon info and ID track info
# This requires the reductionConf flag MUON4 in Reco_tf.py
#====================================================================
# Set up common services and job object.
# This should appear in ALL derivation job options
from DerivationFrameworkCore.DerivationFrameworkMaster import *
from DerivationFrameworkMuons.MuonsCommon import *
# from DerivationFrameworkJetEtMiss.METCommon import *
#====================================================================
# AUGMENTATION TOOLS
#====================================================================
MUON4_aug_tools = []

### track to vertex tool
from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
MUON4IPETool = Trk__TrackToVertexIPEstimator(name="MUON4IPETool")
ToolSvc += MUON4IPETool
printfunc(MUON4IPETool)

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackToVertexWrapper
## ID tracks
MUON4TrackToVertexWrapper = DerivationFramework__TrackToVertexWrapper(
    name="MUON4TrackToVertexWrapper",
    TrackToVertexIPEstimator=MUON4IPETool,
    DecorationPrefix="MUON4",
    ContainerName="InDetTrackParticles")
printfunc(MUON4TrackToVertexWrapper)
ToolSvc += MUON4TrackToVertexWrapper
MUON4_aug_tools.append(MUON4TrackToVertexWrapper)
#====================================================================
# STRING BASED SKIMMING TOOL
예제 #14
0
from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
theAtlasExtrapolator = AtlasExtrapolator()
ToolSvc += theAtlasExtrapolator

from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__KalmanVertexUpdator
myVertexUpdator = Trk__KalmanVertexUpdator()
ToolSvc += myVertexUpdator

from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory
myLinearizedTrackFactory = Trk__FullLinearizedTrackFactory(
    name="myLinearizedTrackFactory", Extrapolator=theAtlasExtrapolator)
ToolSvc += myLinearizedTrackFactory

from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator
TrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(
    name="TrackToVertexIPEstimator",
    Extrapolator=theAtlasExtrapolator,
    LinearizedTrackFactory=myLinearizedTrackFactory)

ToolSvc += TrackToVertexIPEstimator
######################################################################

#Number of Events
theApp.EvtMax = 100
#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
#--------------------------------------------------------------
MessageSvc = Service("MessageSvc")
MessageSvc.OutputLevel = 5
svcMgr.EventSelector.InputCollections = ["AOD.pool.root"]

from HSG2DPDUtils.HSG2DPDUtilsConf import H4lAddUserData