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
 
   27         self.
dict.update(chainDict)
 
   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)
 
   58                     comboHypoCfg = functools.partial(comboHypoCfg)                
 
   59                 return ChainStep(stepName, seqArray, 
 
   60                                  [self.
dict], comboHypoCfg = comboHypoCfg, comboToolConfs = comboTools)
 
   63         raise RuntimeError(
"[getStep] No sequences generated for step %s!", stepName)
 
   66         log.debug(
'Configuring empty step %s', stepName)
 
   67         return ChainStep(stepName, chainDicts=[self.
dict], isEmpty=
True)
 
   73             alignmentGroups = [self.
chainPart[
'alignmentGroup']]
 
   76             alignmentGroups = [cp[
'alignmentGroup'] 
for cp 
in self.
chainPart]
 
   77             testAlignGrps = 
list(
set(alignmentGroups))
 
   78             if not(len(testAlignGrps) == 1 
and testAlignGrps[0] == 
'JetMET'):
 
   79                 log.error(
"ChainConfigurationBase.buildChain(): number of chainParts does not correspond chainSteps")    
 
   80                 log.error(
'ChainConfigurationBase.buildChain() chainPart: %s',self.
chainPart)
 
   81                 log.error(
"ChainConfigurationBase.buildChain() alignmentGroups: %s", alignmentGroups)
 
   82                 log.error(
"ChainConfigurationBase.buildChain() chainName: %s", self.
chainName)
 
   83                 log.error(
"ChainConfigurationBase.buildChain() chainSteps: %s", chainSteps)               
 
   85                 alignmentGroups = testAlignGrps            
 
   88             log.error(
"ChainConfigurationBase.buildChain(): chainPart is not a list or dict, not sure what to do here! %s   ", self.
chainPart)
 
   92                         ChainSteps = chainSteps,
 
   93                         L1decisions = [L1decision],
 
   94                         nSteps = [len(chainSteps)], 
 
   95                         alignmentGroups = alignmentGroups
 
  105         return self.assembleChainImpl(flags)