4 from AthenaCommon.Logging
import logging
5 log = logging.getLogger(__name__)
10 from TriggerMenuMT.HLT.Config.MenuComponents
import Chain, ChainStep
11 from DecisionHandling.DecisionHandlingConfig
import ComboHypoCfg
12 from HLTSeeding.HLTSeedingConfig
import mapThresholdToL1DecisionCollection
33 if len( self.
dict[
'chainParts'] ) != 1:
34 raise RuntimeError(
"Passed chain dictionary with %i chainParts to ChainConfigurationBase, but this constructor only supports chains with a single part" % len( self.
dict[
'chainParts'] ) )
46 def getStep(self, flags, stepName, sequenceCfgArray, comboHypoCfg=ComboHypoCfg, comboTools=[], **stepArgs):
47 log.debug(
"Configuring step %s with %d chainParts", stepName, len(self.
dict[
'chainParts']))
50 seqArray = [functools.partial(gen, flags, **stepArgs)
for gen
in sequenceCfgArray]
53 if inspect.signature(comboHypoCfg).parameters
and all(inspect.signature(comboTool).parameters
for comboTool
in comboTools):
55 if 'flags' in inspect.signature(comboHypoCfg).parameters:
56 comboHypoCfg = functools.partial(comboHypoCfg, flags)
59 return ChainStep(stepName, seqArray,
60 [self.
dict], comboHypoCfg = comboHypoCfg, comboToolConfs = comboTools)
63 raise RuntimeError(
"[getStep] No sequences generated for step %s!", stepName)
66 stepName =
'Step%s'%
str(stepID) +
'_' + stepPartName
67 log.debug(
"Configuring empty step %s", stepName)
68 return ChainStep(stepName, chainDicts=[self.
dict], isEmpty =
True)
74 alignmentGroups = [self.
chainPart[
'alignmentGroup']]
77 alignmentGroups = [cp[
'alignmentGroup']
for cp
in self.
chainPart]
78 testAlignGrps =
list(
set(alignmentGroups))
79 if not(len(testAlignGrps) == 1
and testAlignGrps[0] ==
'JetMET'):
80 log.error(
"ChainConfigurationBase.buildChain(): number of chainParts does not correspond chainSteps")
81 log.error(
'ChainConfigurationBase.buildChain() chainPart: %s',self.
chainPart)
82 log.error(
"ChainConfigurationBase.buildChain() alignmentGroups: %s", alignmentGroups)
83 log.error(
"ChainConfigurationBase.buildChain() chainName: %s", self.
chainName)
84 log.error(
"ChainConfigurationBase.buildChain() chainSteps: %s", chainSteps)
86 alignmentGroups = testAlignGrps
89 log.error(
"ChainConfigurationBase.buildChain(): chainPart is not a list or dict, not sure what to do here! %s ", self.
chainPart)
93 ChainSteps = chainSteps,
94 L1decisions = [L1decision],
95 nSteps = [len(chainSteps)],
96 alignmentGroups = alignmentGroups
106 return self.assembleChainImpl(flags)