Skip to content
Snippets Groups Projects
Commit a6febce7 authored by William Keaton Balunas's avatar William Keaton Balunas
Browse files

Autoconfigure container-specific moments for PFlow jets

parent 59871376
No related branches found
No related tags found
No related merge requests found
......@@ -141,11 +141,14 @@ class JetToolManager:
# Configures any tools in the given modifier list with the property
# "JetContainer" to set that property to the given string containerName.
def configureContainerName(self, modifiers, containerName):
# Also handles any container-specific configuration needed.
def autoconfigureModifiers(self, modifiers, containerName):
for mod in modifiers:
if "JetContainer" in mod.properties():
print ("configuring " + mod.name() + " to have container name " + containerName)
mod.JetContainer = containerName
if "DoPFlowMoments" in mod.properties():
mod.DoPFlowMoments = ("PFlow" in containerName)
# Return the list of modifiers associated with a name.
# If the argument is a list, a copy is returned directly.
......@@ -419,7 +422,7 @@ class JetToolManager:
ptminSave = self.ptminFilter
if ptminFilter > 0.0: self.ptminFilter = ptminFilter
jetrec.JetModifiers = self.buildModifiers(modifiersin, lofinder, getters, gettersin, output, calibOpt)
self.configureContainerName(jetrec.JetModifiers, output)
self.autoconfigureModifiers(jetrec.JetModifiers, output)
if consumers != None:
jetrec.JetConsumers = consumers
self.ptminFilter = ptminSave
......@@ -467,7 +470,7 @@ class JetToolManager:
jetrec.InputContainer = input
jetrec.OutputContainer = output
jetrec.JetModifiers = self.getModifiers(modifiersin)
self.configureContainerName(jetrec.JetModifiers, output)
self.autoconfigureModifiers(jetrec.JetModifiers, output)
jetrec.Trigger = isTrigger or useTriggerStore
jetrec.Timer = jetFlags.timeJetRecTool()
self += jetrec
......@@ -502,7 +505,7 @@ class JetToolManager:
jetrec.InputContainer = input
jetrec.OutputContainer = output
jetrec.JetModifiers = self.getModifiers(modifiersin)
self.configureContainerName(jetrec.JetModifiers, output)
self.autoconfigureModifiers(jetrec.JetModifiers, output)
jetrec.Trigger = isTrigger or useTriggerStore
jetrec.Timer = jetFlags.timeJetRecTool()
if pseudojetRetriever in self.tools:
......@@ -550,7 +553,7 @@ class JetToolManager:
jetrec.InputContainer = input
jetrec.OutputContainer = output
jetrec.JetModifiers = self.getModifiers(modifiersin)
self.configureContainerName(jetrec.JetModifiers, output)
self.autoconfigureModifiers(jetrec.JetModifiers, output)
jetrec.Trigger = isTrigger or useTriggerStore
jetrec.Timer = jetFlags.timeJetRecTool()
self += jetrec
......@@ -609,7 +612,7 @@ class JetToolManager:
jetrec.OutputContainer = output
jetrec.JetGroomer = groomer
jetrec.JetModifiers = self.getModifiers(modifiersin)
self.configureContainerName(jetrec.JetModifiers, output)
self.autoconfigureModifiers(jetrec.JetModifiers, output)
if consumers != None:
jetrec.JetConsumers = consumers
jetrec.Trigger = isTrigger or useTriggerStore
......@@ -641,7 +644,7 @@ class JetToolManager:
Label = inp
getters = [get]
jetrec.JetModifiers = self.buildModifiers(modifiersin, finder, getters, None, output, calibOpt)
self.configureContainerName(jetrec.JetModifiers, output)
self.autoconfigureModifiers(jetrec.JetModifiers, output)
self.ptminFilter = ptminSave
jetrec.Trigger = isTrigger or useTriggerStore
jetrec.Timer = jetFlags.timeJetRecTool()
......@@ -796,7 +799,7 @@ class JetToolManager:
# Temporary hard-coded solution until this config is deprecated.
triggerPrefix = "HLT_xAOD__JetContainer_"
self.configureContainerName(modifiers, triggerPrefix + name.split('_')[1])
self.autoconfigureModifiers(modifiers, triggerPrefix + name.split('_')[1])
self.ptminFilter = ptminSave
......@@ -876,7 +879,7 @@ class JetToolManager:
triggerGroomerTool = TriggerJetGroomerTool(name)
triggerGroomerTool.JetGroomer = trimmerTool
triggerGroomerTool.JetModifiers = self.getModifiers(modifiersin)
self.configureContainerName(triggerGroomerTool.JetModifiers, name.split('_')[1])
self.autoconfigureModifiers(triggerGroomerTool.JetModifiers, name.split('_')[1])
triggerGroomerTool.OutputLevel = OutputLevel
# TriggerJetGroomerTool obtains a TriggerJetGroomerTool, will pass it
......
......@@ -213,10 +213,13 @@ def expandPrereqs(reqtype,prereqs):
########################################################################
# For each modifier in the given list with a configurable input container
# name ("JetContainer"), configure it to containerName.
def configureContainerName(modifiers, containerName):
# Also handle any container-specific configuration needed.
def autoconfigureModifiers(modifiers, containerName):
for mod in modifiers:
if "JetContainer" in mod.properties():
mod.JetContainer = containerName
if "DoPFlowMoments" in mod.properties():
mod.DoPFlowMoments = ("PFlow" in containerName)
########################################################################
......@@ -475,7 +478,7 @@ def getJetRecTool(jetname, finder, pjs, mods):
JetFinder = finder,
JetModifiers = mods
)
configureContainerName(jetrec.JetModifiers, jetname)
autoconfigureModifiers(jetrec.JetModifiers, jetname)
return jetrec
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment