Ejemplo n.º 1
0
def setup(TOPQname, stream):
    DFisMC = (globalflags.DataSource() == 'geant4')

    TOPQSlimmingHelper = SlimmingHelper(TOPQname + "SlimmingHelper")

    #=====================================================
    # ADD BTagging_AntiKt4EMPFlow COLLECTION TO DICTIONARY
    #=====================================================
    TOPQSlimmingHelper.AppendToDictionary = {
        "BTagging_AntiKt4EMPFlow": "xAOD::BTaggingContainer",
        "BTagging_AntiKt4EMPFlowAux": "xAOD::BTaggingAuxContainer"
    }

    #================================
    # SMART SLIMMING
    #================================
    TOPQSlimmingHelper.SmartCollections = []
    TOPQSlimmingHelper.SmartCollections += TOPQSmartSlimmingCollections

    print("TOPQSlimmingHelper.SmartCollections: ",
          TOPQSlimmingHelper.SmartCollections)

    #=================================================================
    # EXTRA VARIABLES FROM DerivationFrameworkTop.TOPQCommonExtraContent
    #=================================================================
    TOPQSlimmingHelper.ExtraVariables = []
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesAntiKt4EMTopoJets
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesAntiKt4EMPFlowJets
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesBTagging_AntiKt4EMPFlow
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesBTagging_AntiKt4EMTopo
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesPhotons
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesElectrons
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesMuons
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesTaus
    TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesTrackJets
    TOPQSlimmingHelper.ExtraVariables += Config.GetExtraPromptVariablesForDxAOD(
    )
    #  TOPQSlimmingHelper.ExtraVariables += ["CaloCalTopoClusters.calE.calEta.calPhi.calM.rawM.rawE.rawEta.rawPhi.e_sampl.eta_sampl.etaCalo.phiCalo"]
    TOPQSlimmingHelper.ExtraVariables += [
        "CaloCalTopoClusters.calPt.calEta.calPhi.calM.calE.CENTER_MAG"
    ]

    if DFisMC:
        TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesPhotonsTruth
        TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesElectronsTruth
        TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesMuonsTruth
        TOPQSlimmingHelper.ExtraVariables += TOPQExtraVariablesTausTruth
        TOPQSlimmingHelper.ExtraVariables += TOPQExtraVarsBTag_HLT_Container
        TOPQSlimmingHelper.ExtraVariables += TOPQExtraVarsJet_EF_Container
        TOPQSlimmingHelper.ExtraVariables += TOPQExtraVarsJet_Split_Container

    print("TOPQSlimmingHelper.ExtraVariables: ",
          TOPQSlimmingHelper.ExtraVariables)

    #================================
    # EXTRA COLLECTIONS - user added
    #================================
    TOPQSlimmingHelper.AllVariables = []
    TOPQSlimmingHelper.AllVariables += TOPQExtraContainersStandard
    TOPQSlimmingHelper.AllVariables += TOPQExtraContainersTrigger

    if DFisMC:
        TOPQSlimmingHelper.AllVariables += TOPQExtraContainersTruth

    print("TOPQSlimmingHelper.AllVariables: ", TOPQSlimmingHelper.AllVariables)

    #================================
    # CREATED ON-THE-FLY COLLECTIONS
    #================================
    TOPQSlimmingHelper.StaticContent = []
    TOPQSlimmingHelper.StaticContent += TOPQStaticContent

    if DFisMC:
        TOPQSlimmingHelper.StaticContent += TOPQStaticContentTruth

    print("TOPQSlimmingHelper.StaticContent: ",
          TOPQSlimmingHelper.StaticContent)

    #================================
    # TRIGGER CONTENT
    #================================
    TOPQSlimmingHelper.IncludeMuonTriggerContent = True
    TOPQSlimmingHelper.IncludeEGammaTriggerContent = True
    TOPQSlimmingHelper.IncludeJetTriggerContent = True
    TOPQSlimmingHelper.IncludeTauTriggerContent = True
    TOPQSlimmingHelper.IncludeEtMissTriggerContent = True
    #TOPQSlimmingHelper.IncludeJetTauEtMissTriggerContent = True
    #TOPQSlimmingHelper.IncludeBJetTriggerContent         = True
    #TOPQSlimmingHelper.IncludeBPhysTriggerContent        = True
    #TOPQSlimmingHelper.IncludeMinBiasTriggerContent      = True

    #====================================
    # ADD AntiKT4EMPFlowJets MET OUTPUT
    #====================================
    # needs to be after where AllVaraibles[] and StaticContent[] are created
    # adds METAssoc_XXXX, MET_Core_XXXX, and MET_Reference_XXXX
    # uses DerivationFrameworkJetEtMiss.METCommon.py
    addMETOutputs(TOPQSlimmingHelper, ["AntiKt4EMPFlow"])

    #====================================
    # ADD CUSTOM JET OUTPUT (new rel 21 method)
    #====================================
    addJetOutputs(
        TOPQSlimmingHelper,
        ["SmallR", "LargeR", TOPQname],
        [],  # smart list
        [
            "AntiKt3PV0TrackJets",
            "AntiKt4PV0TrackJets",
            "AntiKt4LCTopoJets",
            "AntiKt10LCTopoJets",
            "AntiKt10TruthWZJets",
        ]  # veto list
    )

    #================================
    # THIS NEEDS TO BE THE LAST LINE
    #================================
    TOPQSlimmingHelper.AppendContentToStream(stream)
Ejemplo n.º 2
0
from DerivationFrameworkMuons import ConstituentPileupIso
ConstituentPileupIso.ConstituentPileupIso(MUON1Seq)
from DerivationFrameworkFlavourTag.FlavourTagCommon import FlavorTagInit
FlavorTagInit(JetCollections=['AntiKt4EMPFlowJets'], Sequencer=MUON1Seq)

#====================================================================
# Add the containers to the output stream - slimming done here
#====================================================================
from DerivationFrameworkMuons.StreamConfig import MuonsDxAODStreamConfigurer as conf
if hasattr(ToolSvc, "MUON1MuonTP_Reco_mumu"):
    conf.Items['MUON1'] += [
        "xAOD::VertexContainer#%s" %
        ToolSvc.MUON1MuonTP_Reco_mumu.OutputVtxContainerName
    ]
    conf.Items['MUON1'] += [
        "xAOD::VertexAuxContainer#%sAux." %
        ToolSvc.MUON1MuonTP_Reco_mumu.OutputVtxContainerName
    ]
    conf.Items['MUON1'] += [
        "xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" %
        ToolSvc.MUON1MuonTP_Reco_mumu.OutputVtxContainerName
    ]

conf.Items['MUON1'] += ["CaloCellContainer#DFMUONCellContainer"]
conf.Items['MUON1'] += [
    "CaloClusterCellLinkContainer#MuonClusterCollection_links"
]
conf.extraVariables['MUON1'] += JetTagConfig.GetExtraPromptVariablesForDxAOD()
conf.Config(MUON1Stream, 'MUON1')