Esempio n. 1
0
def addStandardJetsForTop(algseq, outputGroup):
    from DerivationFrameworkJetEtMiss.JetCommon import OutputJets

    # Before any custom jet reconstruction, it's good to set up the output list
    OutputJets[outputGroup] = []

    #=======================================
    # RESTORE AOD-REDUCED JET COLLECTIONS
    #=======================================
    from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
    reducedJetList = [  # Only include those ones that you use. The order in the list is not significant.
        "AntiKt2PV0TrackJets",  # This collection will be flavour-tagged automatically
        "AntiKt4PV0TrackJets",
        "AntiKt10LCTopoJets",
        "AntiKt4TruthJets",
        "AntiKt4TruthWZJets",
        "AntiKt10TruthJets"
    ]
    replaceAODReducedJets(reducedJetList, algseq, outputGroup)

    # If you use AntiKt10*PtFrac5SmallR20Jets, these must be scheduled
    # *AFTER* the other collections are replaced
    from DerivationFrameworkJetEtMiss.ExtendedJetCommon import addDefaultTrimmedJets
    addDefaultTrimmedJets(algseq, outputGroup)
Esempio n. 2
0
    addStandardTruthContents()
    addHFAndDownstreamParticles()

#====================================================================
# Basic Jet Collections
#====================================================================

OutputJets["FTAG3"] = ["AntiKt4EMTopoJets"]

reducedJetList = [
    "AntiKt2PV0TrackJets", "AntiKt4PV0TrackJets", "AntiKt10TruthWZJets",
    "AntiKt4TruthJets"
]

extendedFlag = 0  # --- = 0 for Standard Taggers & =1 for ExpertTaggers
replaceAODReducedJets(reducedJetList, FTAG3Seq, "FTAG3", extendedFlag)

addDefaultTrimmedJets(FTAG3Seq, "FTAG3", dotruth=True)

#===================================================================
# Tag custom or pre-built jet collections
#===================================================================

FlavorTagInit(JetCollections=['AntiKt4EMTopoJets'], Sequencer=FTAG3Seq)

#====================================================================
# Add sequence (with all kernels needed) to DerivationFrameworkJob
#====================================================================

DerivationFrameworkJob += FTAG3Seq
Esempio n. 3
0
# CREATE THE DERIVATION KERNEL ALGORITHM
#=======================================
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
egam8Seq += CfgMgr.DerivationFramework__DerivationKernel("EGAM8Kernel",
                                                         AugmentationTools = [EGAM8_ZEEMassTool, EGAM8_ZMuEMassTool, EGAM8_GainDecoratorTool, EGAM8_MaxCellDecoratorTool] + EGAM8_ClusterEnergyPerLayerDecorators,
                                                         SkimmingTools = [EGAM8_SkimmingTool],
                                                         ThinningTools = thinningTools
                                                         )


#====================================================================
# RESTORE JET COLLECTIONS REMOVED BETWEEN r20 AND r21
#====================================================================
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
reducedJetList = ["AntiKt4TruthJets"]
replaceAODReducedJets(reducedJetList,egam8Seq,"EGAM8")


#====================================================================
# SET UP STREAM SELECTION
#====================================================================
# Only events that pass the filters listed below are written out.
# Name must match that of the kernel above
# AcceptAlgs  = logical OR of filters
# RequireAlgs = logical AND of filters
EGAM8Stream.AcceptAlgs(["EGAM8Kernel"])


#====================================================================
# SET UP SLIMMING
#====================================================================
Esempio n. 4
0
#=======================================

from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
egam9Seq += CfgMgr.DerivationFramework__DerivationKernel(
    "EGAM9Kernel",
    AugmentationTools=[EGAM9_GainDecoratorTool, EGAM9_MaxCellDecoratorTool] +
    EGAM9_ClusterEnergyPerLayerDecorators,
    SkimmingTools=[EGAM9_SkimmingTool],
    ThinningTools=thinningTools)

#====================================================================
# RESTORE JET COLLECTIONS REMOVED BETWEEN r20 AND r21
#====================================================================
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
reducedJetList = ["AntiKt4TruthJets"]
replaceAODReducedJets(reducedJetList, egam9Seq, "EGAM9")

#====================================================================
# SET UP STREAM SELECTION
#====================================================================
# Only events that pass the filters listed below are written out.
# Name must match that of the kernel above
# AcceptAlgs  = logical OR of filters
# RequireAlgs = logical AND of filters
EGAM9Stream.AcceptAlgs(["EGAM9Kernel"])

#============ Thin cells for EGAM9 ==================

# Keep only calo cells associated with the egammaClusters collection
from DerivationFrameworkCalo.CaloCellDFGetter import thinCaloCellsForDF
thinCaloCellsForDF(inputClusterKeys=["egammaClusters"],
Esempio n. 5
0
#=======================================
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
egam5Seq += CfgMgr.DerivationFramework__DerivationKernel(
    "EGAM5Kernel",
    AugmentationTools=[
        EGAM5_MTTool, EGAM5_GainDecoratorTool, EGAM5_MaxCellDecoratorTool
    ] + EGAM5_ClusterEnergyPerLayerDecorators,
    SkimmingTools=[EGAM5_SkimmingTool],
    ThinningTools=thinningTools)

#====================================================================
# RESTORE JET COLLECTIONS REMOVED BETWEEN r20 AND r21
#====================================================================
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
reducedJetList = ["AntiKt4TruthJets"]
replaceAODReducedJets(reducedJetList, egam5Seq, "EGAM5")

#====================================================================
# SET UP STREAM SELECTION
#====================================================================
# Only events that pass the filters listed below are written out.
# Name must match that of the kernel above
# AcceptAlgs  = logical OR of filters
# RequireAlgs = logical AND of filters
EGAM5Stream.AcceptAlgs(["EGAM5Kernel"])

#====================================================================
# SET UP SKIMMING
#====================================================================
from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
EGAM5SlimmingHelper = SlimmingHelper("EGAM5SlimmingHelper")
Esempio n. 6
0
print "EGAM1 skimming tools", [EGAM1SkimmingTool]
print "EGAM1 thinning tools", thinningTools
print "EGAM1 augmentation tools", augmentationTools
egam1Seq += CfgMgr.DerivationFramework__DerivationKernel(
    "EGAM1Kernel",
    AugmentationTools=augmentationTools,
    SkimmingTools=[EGAM1SkimmingTool],
    ThinningTools=thinningTools)

#====================================================================
# RESTORE JET COLLECTIONS REMOVED BETWEEN r20 AND r21
#====================================================================
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
#reducedJetList = ["AntiKt4PV0TrackJets", "AntiKt4TruthJets"]
reducedJetList = ["AntiKt4TruthJets"]
replaceAODReducedJets(reducedJetList, egam1Seq, "EGAM1")

#=======================================
# ADD NON-PROMPT LEPTON VETO ALGORITHMS
#=======================================
import JetTagNonPromptLepton.JetTagNonPromptLeptonConfig as JetTagConfig
JetTagConfig.ConfigureAntiKt4PV0TrackJets(egam1Seq, "EGAM1")
egam1Seq += JetTagConfig.GetDecoratePromptLeptonAlgs(name="Electrons")

#====================================================================
# SET UP STREAM SELECTION
#====================================================================
# Only events that pass the filters listed below are written out.
# Name must match that of the kernel above
# AcceptAlgs  = logical OR of filters
# RequireAlgs = logical AND of filters
Esempio n. 7
0
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
egam7Seq += CfgMgr.DerivationFramework__DerivationKernel("EGAM7Kernel",
                                                         AugmentationTools = [EGAM7_GainDecoratorTool, EGAM7_MaxCellDecoratorTool] + EGAM7_ClusterEnergyPerLayerDecorators,
                                                         SkimmingTools = [EGAM7_SkimmingTool],
                                                         ThinningTools = thinningTools
                                                         )

#====================================================================
# RESTORE JET COLLECTIONS REMOVED BETWEEN r20 AND r21
#====================================================================
# od syntax
# addStandardJets("AntiKt", 0.4, "PV0Track", 2000, mods="track_ungroomed", algseq=egam7Seq, outputGroup="EGAM7")
# new syntax
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
reducedJetList = ["AntiKt4PV0TrackJets", "AntiKt4TruthJets"]
replaceAODReducedJets(reducedJetList,egam7Seq,"EGAM7")


#====================================================================
# SET UP STREAM SELECTION
#====================================================================
# Only events that pass the filters listed below are written out.
# Name must match that of the kernel above
# AcceptAlgs  = logical OR of filters
# RequireAlgs = logical AND of filters
EGAM7Stream.AcceptAlgs(["EGAM7Kernel"])


#============ Thin cells for EGAM7 ==================

# Keep only calo cells associated with the egammaClusters collection
Esempio n. 8
0
            EGAM4_MinVarClusterDecoratorTool, EGAM4_EGammaMinVarReweightTool
        ]

augmentationTools += EGAM4_ClusterEnergyPerLayerDecorators
egam4Seq += CfgMgr.DerivationFramework__DerivationKernel(
    "EGAM4Kernel",
    AugmentationTools=augmentationTools,
    SkimmingTools=[EGAM4_SkimmingTool],
    ThinningTools=thinningTools)

#====================================================================
# RESTORE JET COLLECTIONS REMOVED BETWEEN r20 AND r21
#====================================================================
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
reducedJetList = ["AntiKt4TruthJets"]
replaceAODReducedJets(reducedJetList, egam4Seq, "EGAM4")

#====================================================================
# SET UP STREAM SELECTION
#====================================================================
# Only events that pass the filters listed below are written out.
# Name must match that of the kernel above
# AcceptAlgs  = logical OR of filters
# RequireAlgs = logical AND of filters
EGAM4Stream.AcceptAlgs(["EGAM4Kernel"])

#====================================================================
# SET UP SLIMMING
#====================================================================
from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
EGAM4SlimmingHelper = SlimmingHelper("EGAM4SlimmingHelper")
Esempio n. 9
0
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
egam6Seq += CfgMgr.DerivationFramework__DerivationKernel(
    "EGAM6Kernel",
    AugmentationTools=[
        EGAM6_ZEEMassTool1, EGAM6_ZEEMassTool2, EGAM6_ZEEMassTool3,
        EGAM6_ZEGMassTool, EGAM6_GainDecoratorTool, EGAM6_MaxCellDecoratorTool
    ] + EGAM6_ClusterEnergyPerLayerDecorators,
    SkimmingTools=[EGAM6_SkimmingTool],
    ThinningTools=thinningTools)

#====================================================================
# RESTORE JET COLLECTIONS REMOVED BETWEEN r20 AND r21
#====================================================================
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
reducedJetList = ["AntiKt4TruthJets"]
replaceAODReducedJets(reducedJetList, egam6Seq, "EGAM6")

#====================================================================
# SET UP STREAM SELECTION
#====================================================================
# Only events that pass the filters listed below are written out.
# Name must match that of the kernel above
# AcceptAlgs  = logical OR of filters
# RequireAlgs = logical AND of filters
EGAM6Stream.AcceptAlgs(["EGAM6Kernel"])

#====================================================================
# SET UP SLIMMING
#====================================================================
from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
EGAM6SlimmingHelper = SlimmingHelper("EGAM6SlimmingHelper")
Esempio n. 10
0
#addStandardJets("AntiKt", 0.4, "PV0Track", 2000, mods="track_ungroomed", algseq=bphy5Seq, outputGroup="MUON2")

# Added by ASC
# Truth information for MC only
if isSimulation:
    AllVariables += [
        "TruthEvents", "TruthParticles", "TruthVertices", "MuonTruthParticles",
        "egammaTruthParticles"
    ]
    AllVariables += ["AntiKt4TruthJets", "AntiKt4TruthWZJets"]
    #    addStandardJets("AntiKt", 0.4, "Truth", 5000, mods="truth_ungroomed", algseq=bphy5Seq, outputGroup="MUON2")
    #    addStandardJets("AntiKt", 0.4, "TruthWZ", 5000, mods="truth_ungroomed", algseq=bphy5Seq, outputGroup="MUON2")
    tagJetCollections += ["AntiKt4TruthJets", "AntiKt4TruthWZJets"]

from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
replaceAODReducedJets(tagJetCollections, bphy5Seq, "MUON2")

AllVariables = list(set(AllVariables))  # remove duplicates

ExtraVariables = [
    "InDetTrackParticles.numberOfTRTHits.numberOfTRTOutliers.numberOfTRTHoles.numberOfTRTHighThresholdHits.numberOfTRTHighThresholdHitsTotal.numberOfTRTHighThresholdOutliers.numberOfTRTDeadStraws.numberOfTRTTubeHits.numberOfTRTXenonHits.TRTTrackOccupancy.numberOfTRTSharedHits.vx.vy.vz"
]

MUON2SlimmingHelper.AllVariables = AllVariables
MUON2SlimmingHelper.ExtraVariables = ExtraVariables
MUON2SlimmingHelper.StaticContent = StaticContent
MUON2SlimmingHelper.SmartCollections = SmartVar

MUON2SlimmingHelper.AppendContentToStream(MUON2Stream)
Esempio n. 11
0
        ]

augmentationTools += EGAM3_ClusterEnergyPerLayerDecorators
print "EGAM3 augmentationTools", augmentationTools
egam3Seq += CfgMgr.DerivationFramework__DerivationKernel(
    "EGAM3Kernel",
    AugmentationTools=augmentationTools,
    SkimmingTools=[EGAM3_SkimmingTool],
    ThinningTools=thinningTools)

#====================================================================
# RESTORE JET COLLECTIONS REMOVED BETWEEN r20 AND r21
#====================================================================
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets
reducedJetList = ["AntiKt4TruthJets"]
replaceAODReducedJets(reducedJetList, egam3Seq, "EGAM3")

#====================================================================
# SET UP STREAM SELECTION
#====================================================================
# Only events that pass the filters listed below are written out.
# Name must match that of the kernel above
# AcceptAlgs  = logical OR of filters
# RequireAlgs = logical AND of filters
EGAM3Stream.AcceptAlgs(["EGAM3Kernel"])

#====================================================================
# SET UP SLIMMING
#====================================================================
from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper