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", stepName)
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)
57 return ChainStep(stepName, seqArray, [self.
mult], [self.
dict], comboHypoCfg = comboHypoCfg, comboToolConfs = comboTools)
60 raise RuntimeError(
"[getStep] No sequences generated for step %s!", stepName)
63 stepName =
'Step%s'%
str(stepID) +
'_' + stepPartName
64 log.debug(
"Configuring empty step %s", stepName)
65 return ChainStep(stepName, Sequences=[], multiplicity=[] ,chainDicts=[self.
dict])
71 alignmentGroups = [self.
chainPart[
'alignmentGroup']]
74 alignmentGroups = [cp[
'alignmentGroup']
for cp
in self.
chainPart]
75 testAlignGrps =
list(
set(alignmentGroups))
76 if not(len(testAlignGrps) == 1
and testAlignGrps[0] ==
'JetMET'):
77 log.error(
"ChainConfigurationBase.buildChain(): number of chainParts does not correspond chainSteps")
78 log.error(
'ChainConfigurationBase.buildChain() chainPart: %s',self.
chainPart)
79 log.error(
"ChainConfigurationBase.buildChain() alignmentGroups: %s", alignmentGroups)
80 log.error(
"ChainConfigurationBase.buildChain() chainName: %s", self.
chainName)
81 log.error(
"ChainConfigurationBase.buildChain() chainSteps: %s", chainSteps)
83 alignmentGroups = testAlignGrps
86 log.error(
"ChainConfigurationBase.buildChain(): chainPart is not a list or dict, not sure what to do here! %s ", self.
chainPart)
90 ChainSteps = chainSteps,
91 L1decisions = [L1decision],
92 nSteps = [len(chainSteps)],
93 alignmentGroups = alignmentGroups
103 return self.assembleChainImpl(flags)