Commit e8a06012 authored by James Catmore's avatar James Catmore
Browse files

Merge branch '21.2_DF_GenFilt_Migration' into '21.2'

21.2 DF GenFilt bugfixes

See merge request !4447

Former-commit-id: 4c6b64d4b017e72cb9df61e452fa0497b4c782d7
parents cb219a82 4db25991
......@@ -228,10 +228,10 @@ if DerivationFrameworkIsMonteCarlo:
#==============================================================================
# SUSY background generator filters
# background generator filters
#==============================================================================
if DerivationFrameworkIsMonteCarlo:
ToolSvc += CfgMgr.DerivationFramework__SUSYGenFilterTool("EXOT0GenFilt",SimBarcodeOffset = DerivationFrameworkSimBarcodeOffset)
ToolSvc += CfgMgr.DerivationFramework__GenFilterTool("EXOT0GenFilt",SimBarcodeOffset = DerivationFrameworkSimBarcodeOffset)
AugmentationTools.append(ToolSvc.EXOT0GenFilt)
......
......@@ -515,7 +515,7 @@ from JetRec.JetRecConf import JetAlgorithm
augTools = []
if globalflags.DataSource() == 'geant4':
from DerivationFrameworkMCTruth.GenFilterToolSetup import *
augTools.append(ToolSvc.DFCommonTruthGenFilter)
augTools.append(ToolSvc.DFCommonTruthGenFilt)
# this classifies leptons into background or signal leptons depending on
# where they come from
......
......@@ -71,7 +71,7 @@ if globalflags.DataSource()=='geant4':
#run GenFilterTool
if globalflags.DataSource() == 'geant4':
from DerivationFrameworkMCTruth.GenFilterToolSetup import *
augTools.append(ToolSvc.DFCommonTruthGenFilter)
augTools.append(ToolSvc.DFCommonTruthGenFilt)
from DerivationFrameworkExotics.JetDefinitions import *
......
......@@ -15,7 +15,6 @@ from DerivationFrameworkJetEtMiss.METCommon import *
#
if DerivationFrameworkIsMonteCarlo:
from DerivationFrameworkMCTruth.MCTruthCommon import *
from DerivationFrameworkTau.TauTruthCommon import *
#====================================================================
# SKIMMING TOOL
......@@ -172,7 +171,7 @@ replaceAODReducedJets(reducedJetList,jetm7Seq,"JETM7")
augmentationTools = []
if globalflags.DataSource() == 'geant4':
from DerivationFrameworkMCTruth.GenFilterToolSetup import *
augmentationTools.append(ToolSvc.DFCommonTruthGenFilter)
augmentationTools.append(ToolSvc.DFCommonTruthGenFilt)
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
jetm7Seq += CfgMgr.DerivationFramework__DerivationKernel( name = "JETM7Kernel",
......
......@@ -13,6 +13,6 @@ if not hasattr(ToolSvc,'DFCommonTruthClassifier'):
#Save the post-shower HT and MET filter values that will make combining filtered samples easier (adds to the EventInfo)
from AthenaCommon import CfgMgr
DFCommonTruthGenFilter = CfgMgr.DerivationFramework__GenFilterTool(
"DFCommonTruthMTandHTGenFilt",
"DFCommonTruthGenFilt",
)
ToolSvc += DFCommonTruthGenFilter
......@@ -35,24 +35,18 @@ if dfInputIsEVNT:
]
# Add jet algorithms if they aren't there
if not hasattr(DerivationFrameworkJob,'jetalg'):
from JetRec.JetAlgorithm import addJetRecoToAlgSequence
addJetRecoToAlgSequence(DerivationFrameworkJob,eventShapeTools=None)
# Set up jet collections that aren't in input
from JetRec.JetRecStandard import jtm
from JetRec.JetRecConf import JetAlgorithm
truth_modifiers = [jtm.truthpartondr, jtm.partontruthlabel, jtm.jetdrlabeler, jtm.trackjetdrlabeler]
if not objKeyStore.isInInput( "xAOD::JetContainer","AntiKt4TruthJets"):
# Standard truth jets
# To remove jet constituents add the modifier jtm.removeconstit
truth_modifiers = [jtm.truthpartondr, jtm.partontruthlabel, jtm.jetdrlabeler, jtm.trackjetdrlabeler]
akt4 = jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", ptmin=15000, modifiersin=truth_modifiers)
akt4alg = JetAlgorithm("jetalgAntiKt4TruthJets", Tools = [akt4] )
DerivationFrameworkJob += akt4alg
from DerivationFrameworkJetEtMiss.JetCommon import addStandardJets
addStandardJets("AntiKt", 0.4, "Truth", 15000, mods=truth_modifiers, algseq=DerivationFrameworkJob, outputGroup="DFCommonMCTruthJets")
if not objKeyStore.isInInput( "xAOD::JetContainer","AntiKt4TruthWZJets"):
# WZ Truth Jets
akt4wz = jtm.addJetFinder("AntiKt4TruthWZJets", "AntiKt", 0.4, "truthwz", ptmin=15000, modifiersin=truth_modifiers)
akt4wzalg = JetAlgorithm("jetalgAntiKt4TruthWZJets", Tools = [akt4wz] )
DerivationFrameworkJob += akt4wzalg
from DerivationFrameworkJetEtMiss.JetCommon import addStandardJets
addStandardJets("AntiKt", 0.4, "TruthWZ", 15000, mods=truth_modifiers, algseq=DerivationFrameworkJob, outputGroup="DFCommonMCTruthJets")
# Some examples of other truth jet collections
#akt6wz = jtm.addJetFinder("AntiKt6TruthWZJets", "AntiKt", 0.6, "truthwz", ptmin= 5000)
......@@ -60,12 +54,9 @@ if not objKeyStore.isInInput( "xAOD::JetContainer","AntiKt4TruthWZJets"):
if not objKeyStore.isInInput( "xAOD::JetContainer","TrimmedAntiKt10TruthJets"):
#Large R jets
akt10 = jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth",ptmin= 100000)
akt10alg = JetAlgorithm("jetalgAntiKt10TruthJets", Tools = [akt10] )
DerivationFrameworkJob += akt10alg
akt10trim = jtm.addJetTrimmer("TrimmedAntiKt10TruthJets", rclus=0.2, ptfrac=0.05, input='AntiKt10TruthJets', modifiersin=[jtm.nsubjettiness, jtm.removeconstit], doArea=False)
akt10trimalg = JetAlgorithm("jetalgTrimmedAntiKt10TruthJets", Tools = [akt10trim] )
DerivationFrameworkJob += akt10trimalg
from DerivationFrameworkJetEtMiss.JetCommon import addTrimmedJets
addTrimmedJets('AntiKt', 1.0, 'Truth', rclus=0.2, ptfrac=0.05, mods="groomed",
algseq=DerivationFrameworkJob, outputGroup="Trimmed", writeUngroomed=False)
# If we are running on EVNT, we also need some MET
if dfInputIsEVNT:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment