Skip to content
Snippets Groups Projects
Commit 20b4464b authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'master-JetRecConfig-inputfilechecks' into 'master'

Fix checks for preexisting inputs to jet finding

See merge request atlas/athena!38397
parents d1c82da4 f5d856e2
No related branches found
No related tags found
No related merge requests found
......@@ -329,10 +329,20 @@ class JetInputDef(object):
The function must return a tuple : (bool, "reason of failure")
- prereqs : a list of prerequisites (str) for this input definition.
"""
def __init__(self, name, objtype, algoBuilder=None, specs=None, filterfn= _condAlwaysPass, prereqs=[]):
def __init__(self, name, objtype, algoBuilder=None, specs=None, containername=None, filterfn= _condAlwaysPass, prereqs=[]):
self.name = name
self.basetype = objtype
self.algoBuilder = algoBuilder
# In certain cases (EventShape) we need to configure the concrete
# output container name based on the jetdef and specs, so can
# pass in a (lambda) function to define this.
if containername:
self.containername = containername
else:
# Ordinarily we just return the name
self.containername = lambda dummyjetdef,dummyspecs : self.name
self.specs = specs
self.filterfn = filterfn
self.prereqs = prereqs
......
......@@ -142,11 +142,10 @@ def JetInputCfg(jetOrConstitdef, configFlags, sequenceName='AthAlgSeq'):
jetdef = jetOrConstitdef
jetlog.info("Inspecting input file contents")
filecontents = configFlags.Input.Collections
filecontents = [coll for coll in configFlags.Input.Collections]
inputdeps = [ inputkey for inputkey in jetdef._prereqOrder if inputkey.startswith('input:')]
for inputfull in inputdeps:
inputInstance = jetdef._prereqDic[inputfull]
isprimary = False # actually not using it yet.
......@@ -163,13 +162,17 @@ def JetInputCfg(jetOrConstitdef, configFlags, sequenceName='AthAlgSeq'):
if constitalg:
components.addEventAlgo(constitalg, primary=isprimary)
else: # it must be a JetInputDef
jetlog.debug("Requesting input {} with function {} and specs {}".format(inputInstance.name, inputInstance.algoBuilder, inputInstance.specs) )
# check if it has something to build an Algorithm
if inputInstance.algoBuilder:
components.addEventAlgo( inputInstance.algoBuilder( jetdef, inputInstance.specs ), primary=isprimary )
cname = inputInstance.containername(jetdef,inputInstance.specs)
if cname in filecontents:
jetlog.debug("Input container {0} for prereq {1} already in input file.".format(cname, inputInstance.name))
else:
# for now just hope the input will be present...
pass
jetlog.debug("Requesting input {} with function {} and specs {}".format(inputInstance.name, inputInstance.algoBuilder, inputInstance.specs) )
# check if it has something to build an Algorithm
if inputInstance.algoBuilder:
components.addEventAlgo( inputInstance.algoBuilder( jetdef, inputInstance.specs ), primary=isprimary )
else:
# for now just hope the input will be present...
pass
return components
......
......@@ -52,9 +52,11 @@ _stdInputList = [
# *****************************
JetInputDef("EventDensity", "EventShape", algoBuilder = inputcfg.buildEventShapeAlg,
containername = lambda jetdef, specs : (specs or "")+"Kt4"+jetdef.inputdef.label+"EventShape",
prereqs = lambda jetdef : ["input:"+jetdef.inputdef.name] # this will force the input to be build *before* the EventDensity alg.
),
JetInputDef("HLT_EventDensity", "EventShape", algoBuilder = inputcfg.buildEventShapeAlg,
containername = lambda jetdef, specs : (specs or "")+"Kt4"+jetdef.inputdef.label+"EventShape",
prereqs = lambda jetdef : ["input:"+jetdef.inputdef.name], # this will force the input to be build *before* the EventDensity alg.
specs = 'HLT_'
),
......
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