def atlfast1D3PD(file,
                 tuplename='atlfast1',
                 seq=topSequence,
                 D3PDSvc='D3PD::RootD3PDSvc'):

    #--------------------------------------------------------------------------
    # Configuration
    #--------------------------------------------------------------------------
    if rec.doTruth():
        truthParticleConfig(seq)
        #TruthJetFilterConfig (seq, excludeWZdecays = False)
        # PartonJetConfig is used to build parton-level jets
        # PartonJetConfig requires JetSimTools-00-01-22 or higher
        PartonJetConfig(doPythia=True, doHerwig=False)

    #--------------------------------------------------------------------------
    # Make the D3PD
    #--------------------------------------------------------------------------
    alg = D3PDMakerCoreComps.MakerAlg(tuplename,
                                      seq,
                                      file=file,
                                      D3PDSvc=D3PDSvc)
    alg += EventInfoD3PDObject(10)
    alg += Atlfast1ElectronD3PDObject(10)
    alg += Atlfast1PhotonD3PDObject(10)
    alg += MuonD3PDObject(0)
    alg += JetD3PDObject(0)
    alg += Atlfast1MissingETD3PDObject(0)

    #alg += TauD3PDObject (0)
    #alg += TrackParticleD3PDObject (0)

    if rec.doTruth():
        alg += GenEventD3PDObject(1)
        alg += TruthParticleD3PDObject(1)
        alg += TruthMETD3PDObject(level=10)
        alg += TruthJetD3PDObject(level=10,
                                  sgkey='AntiKt4TruthJets',
                                  prefix='AntiKt4TruthJets_')
        alg += TruthJetD3PDObject(level=10,
                                  sgkey='AntiKt4TruthPartonJets',
                                  prefix='AntiKt4TruthPartonJets_')
        alg += HforD3PDObject(**_args(0, 'HforInfo', kw))

    return alg
Example #2
0
#TrackParticleD3PDObject.defineBlock(999, "Isolation_40_4GeV", TrackD3PDMaker.TrackIsolationFillerTool, ConeSize=.4, TrackIsolationTool="TrackIsolationTool/TrackIsolationTool4", prefix="cone40_ptmin4gev_")
#TrackParticleD3PDObject.defineBlock(999, "Isolation_50_5GeV", TrackD3PDMaker.TrackIsolationFillerTool, ConeSize=.4, TrackIsolationTool="TrackIsolationTool/TrackIsolationTool5", prefix="cone40_ptmin5gev_")

#IndexMultiAssociation(ExtendedJetD3PDObject, JetSubstructureD3PDMaker.JetSubstructureTagJetINavigable4MomentumAssociationTool,'el_',level = 99,
#                      prefix='Electron_', blockname='elecblockindex', AssociationName='jetsubstructure_electrons',
#                      IndexedMoments=['X', 'Y', 'Z','MINIISO', 'MINIISO10','DR','X_Prime', 'Y_Prime','Z_Prime', 'DR_Prime', 'contained'], IndexedMomentsSuffix = "_E" )
#IndexMultiAssociation(ExtendedJetD3PDObject, JetSubstructureD3PDMaker.JetSubstructureTagJetINavigable4MomentumAssociationTool,'mu_',level = 99,
#                      prefix='Muon_', blockname='muonblockindex', AssociationName='jetsubstructure_muons',
#                      IndexedMoments=['X', 'Y', 'Z','MINIISO', 'MINIISO10','DR', 'X_Prime', 'Y_Prime','Z_Prime', 'DR_Prime','contained'], IndexedMomentsSuffix = "_U")

if rec.doTruth():

    from TruthD3PDAnalysis.truthParticleConfig import truthParticleConfig
    truthParticleConfig(topSequence,
                        sgkey=D3PDMakerFlags.TruthParticlesSGKey(),
                        writeHadrons=True,
                        writePartons=True,
                        writeGeant=False)

JetROID3PDObject.defineBlock(0,
                             "myKinematics",
                             EventCommonD3PDMaker.FourMomFillerTool,
                             WriteM=False,
                             WritePt=True,
                             prefix="myKin_")
#TrackParticleD3PDObject.defineBlock( 99, "TJVAperigee",
#                                     TauD3PDMaker.TrackParticleAtTJVAFillerTool, prefix = 'atTJVA_')

# Special muon isolation variables
#from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.Include import include
Example #3
0
def evgenD3PD(file,
              tuplename='evgen',
              seq=topSequence,
              D3PDSvc='D3PD::RootD3PDSvc'):

    #--------------------------------------------------------------------------
    # Configuration
    #--------------------------------------------------------------------------
    if rec.doTruth():
        # compatibility with jets
        from RecExConfig.RecConfFlags import jobproperties
        jobproperties.RecConfFlags.AllowBackNavigation = True
        from JetRec.JetRecFlags import jobproperties as jobpropjet
        jobpropjet.JetRecFlags.inputFileType = "GEN"

        # Build list of particles stored in D3PD
        truthParticleConfig(seq)

        # Build list of particles used to jet building
        # Be careful, if doExcludeWZdecays == True,
        # then W and Z decays (including electrons, QCD FSRs) are excluded from jet building
        doExcludeWZdecays = True
        mysuffix = 'WZ' if doExcludeWZdecays else ''
        TruthJetFilterConfig(seq,
                             writePartons=True,
                             writeHadrons=True,
                             excludeWZdecays=doExcludeWZdecays)

        # PartonJetConfig is used to build parton-level jets
        # PartonJetConfig requires JetSimTools-00-01-22 or higher
        PartonJetConfig(doPythia=True,
                        doHerwig=False,
                        finder='AntiKt',
                        size=0.4,
                        suffix=mysuffix,
                        inputCollections=['FilteredD3PDTruth'])
        PartonJetConfig(doPythia=True,
                        doHerwig=False,
                        finder='AntiKt',
                        size=0.6,
                        suffix=mysuffix,
                        inputCollections=['FilteredD3PDTruth'])

        # Build truth particle (hadron-level) jets
        # flags for AOD
        from ParticleBuilderOptions.AODFlags import AODFlags
        AODFlags.MissingEtTruth = True
        AODFlags.TruthParticleJet = True
        AODFlags.McEventKey = "GEN_EVENT"
        # The function that makes the truth jets, with appropriate arguments
        antikt4truthAlg = make_StandardJetGetter(
            'AntiKt',
            0.4,
            'Truth',
            globalSuff=mysuffix,
            disable=False,
            includeMuons=True,
            useInteractingOnly=False).jetAlgorithmHandle()
        antikt4truthAlg.AlgTools['InputToJet'].InputCollectionKeys = [
            'FilteredD3PDTruth'
        ]
        print 'antikt4truthAlg', antikt4truthAlg
        antikt6truthAlg = make_StandardJetGetter(
            'AntiKt',
            0.6,
            'Truth',
            globalSuff=mysuffix,
            disable=False,
            includeMuons=True,
            useInteractingOnly=False).jetAlgorithmHandle()
        antikt6truthAlg.AlgTools['InputToJet'].InputCollectionKeys = [
            'FilteredD3PDTruth'
        ]
        if doExcludeWZdecays:
            # Reconstruct standard ATLAS truth jets
            antikt4truthAlgStd = make_StandardJetGetter(
                'AntiKt', 0.4, 'Truth', disable=False).jetAlgorithmHandle()
            antikt6truthAlgStd = make_StandardJetGetter(
                'AntiKt', 0.6, 'Truth', disable=False).jetAlgorithmHandle()

    #--------------------------------------------------------------------------
    # Make the D3PD
    #--------------------------------------------------------------------------
    alg = D3PDMakerCoreComps.MakerAlg(tuplename,
                                      seq,
                                      file=file,
                                      D3PDSvc=D3PDSvc)
    alg += EventInfoD3PDObject(10)

    if rec.doTruth():
        alg += GenEventD3PDObject(1)
        alg += TruthParticleD3PDObject(1)
        alg += TruthMETD3PDObject(level=10)
        alg += TruthJetD3PDObject(level=10,
                                  sgkey='AntiKt4Truth' + mysuffix + 'Jets',
                                  prefix='jet_antikt4truth' + mysuffix +
                                  'jets_')
        alg += TruthJetD3PDObject(level=10,
                                  sgkey='AntiKt6Truth' + mysuffix + 'Jets',
                                  prefix='jet_antikt6truth' + mysuffix +
                                  'jets_')
        if doExcludeWZdecays:
            alg += TruthJetD3PDObject(level=10,
                                      sgkey='AntiKt4TruthJets',
                                      prefix='jet_antikt4truthjets_')
            alg += TruthJetD3PDObject(level=10,
                                      sgkey='AntiKt6TruthJets',
                                      prefix='jet_antikt6truthjets_')
        alg += TruthJetD3PDObject(
            level=10,
            sgkey='AntiKt4TruthParton' + mysuffix + 'Jets',
            prefix='jet_antikt4truthparton' + mysuffix + 'jets_')
        alg += TruthJetD3PDObject(
            level=10,
            sgkey='AntiKt6TruthParton' + mysuffix + 'Jets',
            prefix='jet_antikt6truthparton' + mysuffix + 'jets_')

    return alg
Example #4
0
def JetD3PD(file,
            level=4,
            tuplename='jet',
            seq=topSequence,
            D3PDSvc='D3PD::RootD3PDSvc'):

    egammaUserDataConfig(seq)
    if rec.doTruth():
        truthParticleConfig(seq)

    JetIncludes = ['AssocTrackCont']

    alg = D3PDMakerCoreComps.MakerAlg(tuplename,
                                      seq,
                                      file=file,
                                      D3PDSvc=D3PDSvc)
    #-- General
    alg += EventInfoD3PDObject(level)
    alg += ElectronD3PDObject(0)
    alg += PhotonD3PDObject(0)
    alg += MuonD3PDObject(0)
    alg += PrimaryxAODVertexD3PDObject(4,
                                       allowMissing=True,
                                       sgkey=D3PDMakerFlags.VertexSGKey(),
                                       prefix='vxp_')
    #-- JET
    alg += JetD3PDObject(level,
                         sgkey='AntiKt4H1TopoJets',
                         include=JetIncludes,
                         prefix='AntiKt4H1Topo_')
    alg += JetD3PDObject(level,
                         sgkey='AntiKt6H1TopoJets',
                         include=JetIncludes,
                         prefix='AntiKt6H1Topo_')

    #alg += JetD3PDObject (level, sgkey='Cone4H1TopoJets',    include = JetIncludes, prefix='Cone4H1Topo_'   )

    #-- MET
    alg += RefFinalMETD3PDObject(level)
    alg += MuonMETD3PDObject(level)
    alg += MuonBoyMETD3PDObject(level)
    alg += FinalMETD3PDObject(level)
    alg += CryoMETD3PDObject(level)
    alg += CryoConeMETD3PDObject(level)
    alg += RefEleMETD3PDObject(level)
    alg += RefJetMETD3PDObject(level)
    alg += RefGammaMETD3PDObject(level)
    alg += RefTauMETD3PDObject(level)
    alg += CellOutMETD3PDObject(level)
    alg += BaseMETD3PDObject(level)
    alg += Base0METD3PDObject(level)
    alg += CalibMETD3PDObject(level)
    alg += MuonBoySpectroMETD3PDObject(level)
    alg += MuonBoyTrackMETD3PDObject(level)
    alg += TopoMETD3PDObject(level)
    alg += CorrTopoMETD3PDObject(level)
    alg += LocHadTopoMETD3PDObject(level)
    alg += TopoObjMETD3PDObject(level)

    #-- Trigger
    if D3PDMakerFlags.DoTrigger():
        alg += jetMETTriggerBitsD3PDObject(level)

    #-- Truth
    if rec.doTruth():
        alg += GenEventD3PDObject(1)
        #alg += TruthParticleD3PDObject (level)
        #alg += JetD3PDObject (level, sgkey='Cone4TruthJets'  , prefix='Cone4Truth_'    )
        alg += JetD3PDObject(3,
                             sgkey='AntiKt4TruthJets',
                             prefix='AntiKt4Truth_')
        #alg += JetD3PDObject (3, sgkey='AntiKt6TruthJets', prefix='AntiKt6Truth_'  )

    #-- Meta Data
    alg.MetadataTools += [LBMetadataConfig()]
    return alg
Example #5
0
METPartTruth.TruthCollectionName = "GEN_EVENT"
topSequence.METAlg += METPartTruth

###################################################################
# Make the D3PD.
#

#--------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------
from JetRec.JetRecFlags import jobproperties as jobpropjet
jobpropjet.JetRecFlags.inputFileType = "GEN"

# Build list of particles stored in D3PD
from TruthD3PDAnalysis.truthParticleConfig import truthParticleConfig
truthParticleConfig(topSequence)

# Build list of particles used to jet building
from TruthD3PDMaker.TruthJetFilterConfig import TruthJetFilterConfig
TruthJetFilterConfig(topSequence,
                     writePartons=False,
                     writeHadrons=True,
                     excludeWZdecays=True)
# Build list of particles used for WZ jet building
TruthJetFilterConfig(topSequence,
                     sgkey='FilteredWZD3PDTruth',
                     writePartons=False,
                     writeHadrons=True,
                     excludeWZdecays=True,
                     photonCone=0.1)
Example #6
0
def _truthPartAlgHook(c, prefix, sgkey, seq=AlgSequence(D3PDMakerFlags.PreD3PDAlgSeqName()), *args, **kw):
    truthParticleConfig(seq=seq, prefix=prefix, sgkey=sgkey)
    return