# Create the D3PD streams:
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
SMDYEED3PDStream = MSMgr.NewRootStream(streamName, fileName, "physics")
SMDYEED3PDStream.D3PDSvc = ServiceMgr.SMDYEE_D3PDSvc

# Now add all the content to this stream:
from PhysicsD3PDMaker.SMWZLightD3PD import SMWZLightD3PD
SMWZLightD3PD(SMDYEED3PDStream, stdElectronContainer='LowPtElectrons')

# apply skim
SMDYEED3PDStream.AddAcceptAlgs(["SMWZ_JPsieeFilter"])

# add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
SMDYEED3PDStream.MetadataTools += [CutFlowMetadataConfig(SMDYEED3PDStream)]

# Silence tool warnings:

from AthenaCommon.AppMgr import ToolSvc
if not hasattr(ToolSvc, "TrigDecisionTool"):
    from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
    ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
    pass
ToolSvc.TrigDecisionTool.Navigation.OutputLevel = ERROR

if hasattr(ToolSvc, "SecondSoftMuonTagChi2"):
    ToolSvc.SecondSoftMuonTagChi2.OutputLevel = ERROR

if hasattr(ToolSvc, "myTrkUpdator"):
    ToolSvc.myTrkUpdator.OutputLevel = ERROR
예제 #2
0
TrigEgammaD3PDObjects(alg, 1)
from TrigJetD3PDMaker.TrigJetD3PD import *

TrigJetD3PDObjects(alg, 1)
from TrigMissingETD3PDMaker.TrigMETD3PD import TrigMETD3PDObjects

TrigMETD3PDObjects(alg, 1)
from TrigTauD3PDMaker.TrigTauD3PD import TrigTauD3PDObjects

TrigTauD3PDObjects(alg, 0, False, False)
from EventCommonD3PDMaker.LBMetadataConfig import LBMetadataConfig
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
from TriggerD3PDMaker.BunchStructureMetadata import addBunchStructureMetadata

alg.MetadataTools += [LBMetadataConfig()]
alg.MetadataTools += [CutFlowMetadataConfig(alg)]
addBunchStructureMetadata(alg)


#-------------------------------------------------------------------------------
def _args(level, name, kwin, **kw):
    kw = kw.copy()
    kw['level'] = level
    for (k, v) in kwin.items():
        if k.startswith(name + '_'):
            kw[k[len(name) + 1:]] = v
    return kw


# MET objects
from MissingETD3PDMaker.MissingETD3PDMakerFlags import MissingETD3PDMakerFlags
예제 #3
0
                                 inputCollection="ElectronAODCollection",
                                 outputCollection=NewElectronCollection,
                                 minNumberPassed=2,
                                 ptMin=20. * Units.GeV,
                                 etMin=20. * Units.GeV,
                                 clPtMin=20. * Units.GeV,
                                 reclPtMin=20. * Units.GeV)

# photon selection
from D2PDMaker.D2PDMakerConf import D2PDPhotonSelector
NewPhotonCollection = 'ZPrimeHighPtPhotons'
preseq += D2PDPhotonSelector(
    "ZPrimePhotonSelector",
    inputCollection="PhotonAODCollection",
    outputCollection=NewPhotonCollection,
    ptMin=20. * Units.GeV,
)

# Set require algorithm
ZPrimeEED3PDStream.RequireAlgs += ['ZPrimeElectronSelector']

# Now add all the content to this stream:
from ExoticsD3PDMaker.ZPrimeEED3PD import ZPrimeEED3PD
ZPrimeEED3PD(ZPrimeEED3PDStream,
             electronContainer=NewElectronCollection,
             photonContainer=NewPhotonCollection)

# Add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
ZPrimeEED3PDStream.MetadataTools += [CutFlowMetadataConfig(ZPrimeEED3PDStream)]
예제 #4
0
from PhysicsD3PDMaker.SMWZLightD3PD import SMWZLightD3PD
from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
SMWZLightD3PD(SMZMUMUD3PDStream,
              stdElectronContainer='HighPtElectrons',
              stacoMuonContainer='LowPtStacoMuons',
              muidMuonContainer='LowPtMuidMuons',
              photonContainer='HighPtPhotons',
              jetContainer='HighPtJets')

# apply skim
SMZMUMUD3PDStream.AddAcceptAlgs(
    ["SMWZ_ZmumuStacoFilter", "SMWZ_ZmumuMuidFilter"])

# add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
SMZMUMUD3PDStream.MetadataTools += [CutFlowMetadataConfig(SMZMUMUD3PDStream)]

# Silence tool warnings:

from AthenaCommon.AppMgr import ToolSvc
if not hasattr(ToolSvc, "TrigDecisionTool"):
    from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
    ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
    pass
ToolSvc.TrigDecisionTool.Navigation.OutputLevel = ERROR

if hasattr(ToolSvc, "SecondSoftMuonTagChi2"):
    ToolSvc.SecondSoftMuonTagChi2.OutputLevel = ERROR

if hasattr(ToolSvc, "myTrkUpdator"):
    ToolSvc.myTrkUpdator.OutputLevel = ERROR
예제 #5
0

# set flags
from HSG5DPDUtils.HSG5Flags import HSG5WHUFlags
HSG5WHUFlags.doTaus = True
HSG5WHUFlags.doPhotons = True

print "HSG5WHUFlags.doPhotons()=",HSG5WHUFlags.doPhotons()

from HSG5DPDUtils.HSG5D3PD import HSG5D3PD
print "after import of HSG5D3PD, HSG5WHUFlags.doPhotons()=",HSG5WHUFlags.doPhotons()
HSG5D3PD( HSG5D3PD_Stream, flags=HSG5WHUFlags )

include("HSG5DPDUtils/FatJetsConfig.py")

from HSG5DPDUtils.JSD3PD import JSD3PD    
for xx in myJetKeys:
    if xx[0] != None and xx[1] != None:
        JSD3PD(xx, HSG5D3PD_Stream )
        
# add filters
HSG5D3PD_Stream.AcceptAlgs=[]
HSG5D3PD_Stream.RequireAlgs=[]

include ("HSG5DPDUtils/WHlnubb_unboostedFilter.py")

from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
HSG5D3PD_Stream.MetadataTools += [CutFlowMetadataConfig(HSG5D3PD_Stream)]

ToolSvc.TrigDecisionTool.Navigation.OutputLevel=ERROR
SMWZD3PD(SMWMUNUJJD3PDStream,
         stdElectronContainer='HighPtElectrons',
         gsfElectronContainer='None',
         muonContainer='None',
         stacoMuonContainer='HighPtStacoMuons',
         muidMuonContainer='None',
         caloMuonContainer='None',
         photonContainer='None',
         tauContainer='None',
         jetEM4Container='HighPtJets',
         jetEM6Container='HighPtJetsEM6',
         jetLC4Container='HighPtJetsLC4',
         jetLC6Container='HighPtJetsLC6',
         jetDetails=2,
         METDetails=2)

# Define skims
from WZSkims.WZSkimsConf import WZSkimsMain
Wmunujj = WZSkimsMain("Wmunujj")
Wmunujj.doWmunujjSkim = True
Wmunujj.OutputLevel = INFO
SMWMUNUJJD3PDStream.filterSeq += Wmunujj

include("WZSkims/Wlnujj_branchSelection.py")

# add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
SMWMUNUJJD3PDStream.MetadataTools += [
    CutFlowMetadataConfig(SMWMUNUJJD3PDStream)
]
from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
SMTrilepD3PD(
    SMTRILEPD3PDStream,
    stdElectronContainer='TrilepElectrons',
    #gsfElectronContainer = 'HighPtGSFElectrons',
    stacoMuonContainer='TrilepStacoMuons',
    thirdMuonContainer='TrilepThirdMuons',
    caloMuonContainer='TrilepCaloMuons',
    #muidMuonContainer    = 'HighPtMuidMuons',
    photonContainer='HighPtPhotons',
    jetLC4Container="HighPtJetsLC4",
    jetContainer='HighPtJets')

# add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
SMTRILEPD3PDStream.MetadataTools += [CutFlowMetadataConfig(SMTRILEPD3PDStream)]

# Silence tool warnings:

from AthenaCommon.AppMgr import ToolSvc
if not hasattr(ToolSvc, "TrigDecisionTool"):
    from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
    ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
    pass
ToolSvc.TrigDecisionTool.Navigation.OutputLevel = ERROR

if hasattr(ToolSvc, "SecondSoftMuonTagChi2"):
    ToolSvc.SecondSoftMuonTagChi2.OutputLevel = ERROR

if hasattr(ToolSvc, "myTrkUpdator"):
    ToolSvc.myTrkUpdator.OutputLevel = ERROR
예제 #8
0
SMWZLightD3PD(SMWMUNUD3PDStream,
              stdElectronContainer='HighPtElectrons',
              stacoMuonContainer='HighPtStacoMuons',
              muidMuonContainer='HighPtMuidMuons',
              photonContainer='HighPtPhotons',
              jetContainer='HighPtJets')

# apply skim
SMWMUNUD3PDStream.AddAcceptAlgs(
    ["SMWZ_HighPtStacoMuonFilter", "SMWZ_HighPtMuidMuonFilter"])

# add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig

SMWMUNUD3PDStream.MetadataTools += [CutFlowMetadataConfig(SMWMUNUD3PDStream)]

# Silence tool warnings:

from AthenaCommon.AppMgr import ToolSvc
if not hasattr(ToolSvc, "TrigDecisionTool"):
    from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
    ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
    pass
ToolSvc.TrigDecisionTool.Navigation.OutputLevel = ERROR

if hasattr(ToolSvc, "SecondSoftMuonTagChi2"):
    ToolSvc.SecondSoftMuonTagChi2.OutputLevel = ERROR

if hasattr(ToolSvc, "myTrkUpdator"):
    ToolSvc.myTrkUpdator.OutputLevel = ERROR
SMWZD3PD(SMWENUJJD3PDStream,
         stdElectronContainer='HighPtElectrons',
         gsfElectronContainer='None',
         muonContainer='None',
         stacoMuonContainer='HighPtStacoMuons',
         muidMuonContainer='None',
         caloMuonContainer='None',
         photonContainer='None',
         tauContainer='None',
         jetEM4Container='HighPtJets',
         jetEM6Container='HighPtJetsEM6',
         jetLC4Container='HighPtJetsLC4',
         jetLC6Container='HighPtJetsLC6',
         jetDetails=2,
         METDetails=2)

# Define skims
from WZSkims.WZSkimsConf import WZSkimsMain

Wenujj = WZSkimsMain("Wenujj")
Wenujj.doWenujjSkim = True
Wenujj.OutputLevel = INFO
SMWENUJJD3PDStream.filterSeq += Wenujj

include("WZSkims/Wlnujj_branchSelection.py")

# add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig

SMWENUJJD3PDStream.MetadataTools += [CutFlowMetadataConfig(SMWENUJJD3PDStream)]
SMLIGHTD3PDStream.D3PDSvc = ServiceMgr.SMLIGHT_D3PDSvc

# Now add all the content to this stream:
from PhysicsD3PDMaker.SMWZLightD3PD import SMWZLightD3PD
from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
SMWZLightD3PD(SMLIGHTD3PDStream,
              stdElectronContainer='HighPtElectrons',
              gsfElectronContainer='HighPtGSFElectrons',
              stacoMuonContainer='HighPtStacoMuons',
              muidMuonContainer='HighPtMuidMuons',
              photonContainer='HighPtPhotons',
              jetContainer='HighPtJets')

# add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
SMLIGHTD3PDStream.MetadataTools += [CutFlowMetadataConfig(SMLIGHTD3PDStream)]

# Silence tool warnings:

from AthenaCommon.AppMgr import ToolSvc
if not hasattr(ToolSvc, "TrigDecisionTool"):
    from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
    ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
    pass
ToolSvc.TrigDecisionTool.Navigation.OutputLevel = ERROR

if hasattr(ToolSvc, "SecondSoftMuonTagChi2"):
    ToolSvc.SecondSoftMuonTagChi2.OutputLevel = ERROR

if hasattr(ToolSvc, "myTrkUpdator"):
    ToolSvc.myTrkUpdator.OutputLevel = ERROR
예제 #11
0
                  caloMuonContainer    = 'None',
                  photonContainer      = 'HighPtPhotons',
                  tauContainer         = 'HighPtTaus',
                  jetEM4Container      = 'HighPtJets',
                  jetEM6Container      = 'HighPtJetsEM6',
                  jetLC4Container      = 'HighPtJetsLC4',
                  jetLC6Container      = 'HighPtJetsLC6',
                  jetDetails           = 2,
                  METDetails           = 2)

else:
    from PhysicsD3PDMaker.SMWZD3PD import SMWZD3PD
    SMWZD3PD( SkimD3PDStream )

SkimD3PDStream.filterSeq += WZSkimsMain("WZSkimsMain")
SkimD3PDStream.MetadataTools += [ CutFlowMetadataConfig( SkimD3PDStream ) ]


# additional branch selection for W -> l nu j j 
if ('doWenujj' in dir() and doWenujj) or ('doWmunujj' in dir() and doWmunujj):
    include("WZSkims/Wlnujj_branchSelection.py")


# Debug output once again
from AthenaCommon.AppMgr import theApp
svcMgr = theApp.serviceMgr()
svcMgr.MessageSvc.OutputLevel = OL
svcMgr.MessageSvc.defaultLimit = 1000000
svcMgr.MessageSvc.Format = "% F%80W%S%7W%R%T %0W%M"
svcMgr.MessageSvc.useColors = False
예제 #12
0
def HSG2physicsD3PD(name, file, tuplename='physics', **kw):

    from AthenaCommon.AlgSequence import AlgSequence  # needed for attila's code
    from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags  # needed for attila's code

    # define track and cluster filters
    filter1 = makeTrackFilterAlg(TracksName=D3PDMakerFlags.TrackSGKey(),
                                 OutputTracksName='GoodTracks' + name,
                                 ptCut=0.,
                                 nSCTPix=4)

    filter2 = makeTrackFilterAlg(TracksName=D3PDMakerFlags.TrackSGKey(),
                                 OutputTracksName='HighPtTracks' + name,
                                 ptCut=5000.,
                                 nSCTPix=4)

    preseq = AlgSequence(D3PDMakerFlags.PreD3PDAlgSeqName())
    preseq += filter1
    preseq += filter2

    # now configure the D3PD
    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
    alg = MSMgr.NewRootStream(name, file, TreeName=tuplename)

    #alg = D3PDMakerCoreComps.MakerAlg(tuplename, seq,
    #                                  file = file,
    #                                  D3PDSvc = D3PDSvc,
    #                                  streamNameRoot = streamNameRoot)

    alg += EventInfoD3PDObject(**_args(10, 'EventInfo', kw))
    alg += LArCollisionTimeD3PDObject(**_args(10, 'LArCollisionTime', kw))

    from D3PDMakerCoreComps.D3PDObject import make_SG_D3PDObject

    import EventCommonD3PDMaker

    # Electron/Photon block
    alg += ElectronD3PDObject(
        **_args(10,
                'Electron',
                kw,
                exclude=[
                    'L1Index', 'L2Index', 'EMTrackFitDetails',
                    'EgammaJetSignedIPAndPTRelKin'
                ]))
    # Photon block
    alg += PhotonD3PDObject(**_args(10, 'Photon', kw))

    # Muon blocks
    alg += MuonD3PDObject(**_args(
        10,
        'MuidMuon',
        kw,
        sgkey='MuidMuonCollection',
        prefix='mu_muid_',
        include=["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex"],
        exclude=["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
        allowMissing=True))
    alg += MuonD3PDObject(**_args(
        10,
        'StacoMuon',
        kw,
        sgkey='StacoMuonCollection',
        prefix='mu_staco_',
        include=["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex"],
        exclude=["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
        allowMissing=True))
    alg += MuonD3PDObject(**_args(
        10,
        'CaloMuon',
        kw,
        sgkey='CaloMuonCollection',
        prefix='mu_calo_',
        include=["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex"],
        exclude=["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
        allowMissing=True))

    alg += MuonD3PDObject(**_args(
        10,
        'Muons',
        kw,
        sgkey='Muons',
        prefix='mu_muon_',
        include=["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex"],
        exclude=["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
        allowMissing=True))
    # Quadruplet vertex block
    from AthenaCommon.AlgSequence import AlgSequence
    from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
    from HSG2VertexCreation.HSG2VertexReconstruction import HSG2VertexReconstruction
    HSG2VertexReconstruction("HSG2VertexReconstruction",
                             AlgSequence(D3PDMakerFlags.PreD3PDAlgSeqName()))

    from HiggsD3PDMaker.HSG2VertexReconstruction import addHSG2VertexReconstruction
    addHSG2VertexReconstruction(alg,
                                electron_target="el_",
                                muid_target="mu_muid_",
                                staco_target="mu_staco_",
                                calo_target="mu_calo_",
                                muon_target="mu_muon_")

    # Tau block
    alg += TauD3PDObject(**_args(1, 'Tau', kw))

    # Jet blocks
    alg += JetD3PDObject(**_args(
        3,
        'AK4TopoEMJet',
        kw,
        sgkey='AntiKt4TopoEMJets' + JetTagD3PD_CollectionPostfix,
        prefix='jet_akt4topoem_',
        #include = ['BTag','TrueFlavorComponents','BTagComponents'],
        include=[
            JetTagD3PDKeys.BTagWeightsBlockName(),
            JetTagD3PDKeys.JetFitterCharmTagInfoBlockName(),
            JetTagD3PDKeys.JetFitterCharmInfoBaseBlockName(),
            JetTagD3PDKeys.TruthInfoBlockName(),
            "Constituents",
            'TracksMoments',
            'Samplings',  # For GSC corrections
        ],
        allowMissing=True))
    # For VBF and ZH(->inv) analyses
    alg += JetD3PDObject(**_args(
        3,
        'AK4LCTopoJet',
        kw,
        sgkey='AntiKt4LCTopoJets' + JetTagD3PD_CollectionPostfix,
        prefix='jet_AntiKt4LCTopo_',
        include=[
            JetTagD3PDKeys.BTagWeightsBlockName(),
            JetTagD3PDKeys.JetFitterCharmTagInfoBlockName(),
            JetTagD3PDKeys.JetFitterCharmInfoBaseBlockName(),
            JetTagD3PDKeys.TruthInfoBlockName(),
            "Constituents",
            "ConstituentScale",  # For ZH(->inv) analysis
            'TracksMoments',
            'Samplings',  # For GSC corrections
        ],
        allowMissing=True))

    # MET blocks
    # a whole mess to remove x,y components separately for all flavours
    alg += MissingETD3PDObject(**_args(
        10,
        'MissingET',
        kw,
        exclude=[
            'MET_Base', 'MET_Base0', 'MET_Truth_Int', 'MET_RefFinal_Comps',
            'MET_Calib_Comps', 'MET_CellOut_Comps', 'MET_CorrTopo_Comps',
            'MET_Cryo_Comps', 'MET_CryoCone_Comps', 'MET_Final_Comps',
            'MET_LocHadTopo_Comps', 'MET_LocHadTopoObj_Comps',
            'MET_Muid_Comps', 'MET_Muid_Spectro_Comps', 'MET_Muid_Track_Comps',
            'MET_MuonBoy_Comps', 'MET_MuonBoy_Spectro_Comps',
            'MET_MuonBoy_Track_Comps', 'MET_MuonMuid_Comps', 'MET_Muon_Comps',
            'MET_Muon_Isol_Muid_Comps', 'MET_Muon_Isol_Staco_Comps',
            'MET_Muon_NonIsol_Muid_Comps', 'MET_Muon_NonIsol_Staco_Comps',
            'MET_Muon_Total_Muid_Comps', 'MET_Muon_Total_Staco_Comps',
            'MET_RefEle_Comps', 'MET_RefEle_em_Comps', 'MET_RefGamma_Comps',
            'MET_RefGamma_em_Comps', 'MET_RefJet_Comps', 'MET_RefJet_em_Comps',
            'MET_RefMuon_Comps', 'MET_RefMuon_Muid_Comps',
            'MET_RefMuon_Staco_Comps', 'MET_RefMuon_Track_Muid_Comps',
            'MET_RefMuon_Track_Staco_Comps', 'MET_RefMuon_Track_em_Comps',
            'MET_RefMuon_Track_Comps', 'MET_RefMuon_em_Comps',
            'MET_RefTau_Comps', 'MET_RefTau_em_Comps', 'MET_SoftJets_Comps',
            'MET_SoftJets_em_Comps', 'MET_Topo_Comps', 'MET_TopoObj_Comps',
            'MET_Track_Comps'
        ],
        allowMissing=True))

    # Pileup-subtracted MET RefFinal for ZH(->inv) analysis
    alg += MissingETCompositionD3PDObject(level=4,
                                          sgkey='MET_RefComposition_STVF',
                                          suffix='STVF_',
                                          allowMissing=True,
                                          jetSGKey='AntiKt4LCTopoJets',
                                          jetPrefix='jet_AntiKt4LCTopo_MET_')

    # ... good tracks only (nSCT>3; no pt cut)
    alg += TrackParticleD3PDObject(**_args(3,
                                           'Tracks1',
                                           kw,
                                           sgkey='GoodTracks' + name,
                                           label='trk',
                                           prefix='trk_'))

    # ... high-pt tracks (nSCT>3; pt>5 GeV)
    from TrackD3PDMaker.TrackD3PDMakerFlags import TrackD3PDFlags as highPtFlags
    highPtFlags.doTruth = True
    highPtFlags.storeDiagonalCovarianceAsErrors = True
    highPtFlags.storeHitTruthMatching = True
    highPtFlags.storePixelHitsOnTrack = False
    highPtFlags.storePixelHolesOnTrack = False
    highPtFlags.storePixelOutliersOnTrack = False
    highPtFlags.storeSCTHitsOnTrack = False
    highPtFlags.storeSCTHolesOnTrack = False
    highPtFlags.storeSCTOutliersOnTrack = False
    highPtFlags.storeTRTHitsOnTrack = False
    highPtFlags.storeTRTHolesOnTrack = False
    highPtFlags.storeTRTOutliersOnTrack = False
    highPtFlags.storeTrackFitQuality = True
    highPtFlags.storeTrackMomentum = True
    highPtFlags.storeTrackSummary = True
    highPtFlags.trackParametersAtBeamSpotLevelOfDetails = 0
    highPtFlags.trackParametersAtGlobalPerigeeLevelOfDetails = 2
    highPtFlags.trackParametersAtPrimaryVertexLevelOfDetails = 3

    alg += TrackParticleD3PDObject(**_args(3,
                                           'Tracks2',
                                           kw,
                                           sgkey='HighPtTracks' + name,
                                           label='trkpt5',
                                           prefix='trkpt5_'))

    # Primary vertex block - May be missing in single-beam data.
    alg += PrimaryVertexD3PDObject(**_args(1,
                                           'PrimaryVertex',
                                           kw,
                                           allowMissing=True,
                                           sgkey=D3PDMakerFlags.VertexSGKey(),
                                           prefix='vxp_'))

    # Truth
    if rec.doTruth():

        from TruthD3PDMaker.GenEventD3PDObject import GenEventD3PDObject
        from TruthD3PDMaker.TruthParticleD3PDObject import TruthParticleD3PDObject
        from MuonD3PDMaker.TruthMuonD3PDObject import TruthMuonD3PDObject

        alg += TruthMuonD3PDObject(**_args(2, 'TruthMuon', kw))
        alg += GenEventD3PDObject(**_args(1, 'GenEvent', kw))
        alg += TruthParticleD3PDObject(**_args(1, 'TruthParticle', kw))

        # TruthJets
        alg += JetD3PDObject(**_args(1,
                                     'AK4TruthJet',
                                     kw,
                                     sgkey='AntiKt4TruthJets',
                                     prefix='jet_antikt4truth_',
                                     allowMissing=True))

        # add Heavy flavour overlap
        from TopInputsD3PDMaker.HforD3PDObject import HforD3PDObject
        alg += HforD3PDObject(**_args(0, 'HforD3PD', kw))

        # add mcVx information
        from TrackD3PDMaker.TruthVertexD3PDObject import TruthVertexD3PDObject
        alg += TruthVertexD3PDObject(**_args(0, 'TruthVertex', kw))

    if not rec.doTruth():
        alg += BeamSpotD3PDObject(10)

    if D3PDMakerFlags.DoTrigger():

        # Trigger Decision + metadata
        alg += TrigDecisionD3PDObject(**_args(10, 'TrigDecision', kw))
        addTrigConfMetadata(alg)

        from TrigMissingETD3PDMaker.TrigMETD3PD import TrigMETD3PDObjects
        TrigMETD3PDObjects(alg)

        from TrigEgammaD3PDMaker.TrigEgammaD3PD import TrigEgammaD3PDObjects
        TrigMuonD3PDObjects(alg, 1)
        TrigEgammaD3PDObjects(alg, level=10)

    # Event metadata
    alg.MetadataTools += [LBMetadataConfig()]

    from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
    alg.MetadataTools += [CutFlowMetadataConfig(alg)]

    # Bunch train information
    from TriggerD3PDMaker.BunchStructureMetadata import addBunchStructureMetadata
    addBunchStructureMetadata(alg)

    ## Silence the trigger navigation warnings about missing containers:
    from AthenaCommon.AppMgr import ToolSvc
    if not hasattr(ToolSvc, "TrigDecisionTool"):
        from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
        ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
        pass
    ToolSvc.TrigDecisionTool.Navigation.OutputLevel = 5

    # EventShape variables
    # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/D3PDVariablesForPileup#EventShape_variables
    from QcdD3PDMaker.QcdEventShapeD3PDObject import EventShapeD3PDObject
    alg += EventShapeD3PDObject(**_args(0, 'rho', kw))

    return alg