diff --git a/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py b/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py index 9b1168b0e8de2604526fb5659584150c59650700..857f58fdae7668f3bdf8e374e79789b5e3592dcc 100644 --- a/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py +++ b/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py @@ -59,8 +59,7 @@ def generateEmuMenu(): log = logging.getLogger('EmuMenuTest') log.debug("generateEmuMenu") - # overwrite LS2_v1 menu - TriggerFlags.triggerMenuSetup = 'LS2_v1' + # overwrite LS2_v1 LS2_v1.setupMenu = LS2_emu_v1.setupMenu # switch on only TestSlice diff --git a/Trigger/TrigSteer/DecisionHandling/share/EmuStepProcessingTest.py b/Trigger/TrigSteer/DecisionHandling/share/EmuStepProcessingTest.py index 54592624487fbfb210e384cb5dc6614adb584d6b..921417da2c9ffa43b3a8850351011a646442e012 100644 --- a/Trigger/TrigSteer/DecisionHandling/share/EmuStepProcessingTest.py +++ b/Trigger/TrigSteer/DecisionHandling/share/EmuStepProcessingTest.py @@ -42,6 +42,17 @@ for option in defaultOptions: TriggerFlags.generateMenuDiagnostics=True +from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc, getL1ConfigSvc +from AthenaCommon.AppMgr import ServiceMgr as svcMgr +from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable +from AthenaConfiguration.AllConfigFlags import ConfigFlags + +ConfigFlags.Trigger.triggerMenuSetup = TriggerFlags.triggerMenuSetup= 'LS2_v1' + +svcMgr += conf2toConfigurable( getHLTConfigSvc(ConfigFlags)) +svcMgr += conf2toConfigurable( getL1ConfigSvc(ConfigFlags)) + + topSequence = AlgSequence() if opt.doMenu is True: @@ -51,14 +62,7 @@ else: generateJSON() -from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc, getL1ConfigSvc -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable -from AthenaConfiguration.AllConfigFlags import ConfigFlags -ConfigFlags.Trigger.triggerMenuSetup = TriggerFlags.triggerMenuSetup = "LS2_v1" -svcMgr += conf2toConfigurable( getHLTConfigSvc(ConfigFlags)) -svcMgr += conf2toConfigurable( getL1ConfigSvc(ConfigFlags)) from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py index 6f8299cb522f534bca1b3ee08374e5c52619fe4b..78fdf7f6aaa1df2c78a82d0466f245c94b0509fd 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py @@ -212,10 +212,10 @@ def matrixDisplayOld( allCFSeq ): def __getHyposOfStep( s ): if len(s.step.sequences): if len(s.step.sequences)==1: - if type(s.step.sequences[0].hypo) is list: - return s.step.sequences[0].hypo[0].tools - else: - return s.step.sequences[0].hypo.tools + ## if type(s.step.sequences[0].hypo) is list: + ## return s.step.sequences[0].hypo[0].tools + ## else: + return s.step.sequences[0].hypo.tools else: return list(s.step.combo.getChains()) return [] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_emu_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_emu_v1.py index 7df26ae28d60e5b3ed43b6dc6e7c1028d2f86614..ef28350b2ef1627c9e6ebfcab9bc2c5b22643dd0 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_emu_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_emu_v1.py @@ -86,6 +86,7 @@ def setupMenu(): TriggerFlags.EnhancedBiasSlice.signatures = [ ] addSliceChainsToPrescales(TriggerFlags, Prescales.HLTPrescales_cosmics) + return Prescales return Prescales diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py index 5464d9c61ea92585ba3d593c148ff5daeb46a8d7..6d5a84fe862136d593b12873ffff7eb784158ed6 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py @@ -379,69 +379,35 @@ class MenuSequence(object): self._sequence = Node( Alg=Sequence) self._maker = InputMakerNode( Alg = Maker ) self._seed='' - - if isinstance(Hypo, list): # we will remove support for this and will issue error - log.warning("Sequence %s has more than one Hypo; correct your sequence in the next development cycle", self.name) - assert len(Hypo) == len(HypoToolGen), "The number of hypo algs {} and hypo tools {} not the same".format( len(Hypo), len(HypoToolGen) ) - input_maker_output= self.maker.readOutputList()[0] # only one since it's merged - #### Add input/output Decision to Hypo, handle first somewhat ill-defined case - if isinstance(Hypo, list): - self._hypo = [ HypoAlgNode( Alg = alg ) for alg in Hypo ] - self._hypoToolConf = [ HypoToolConf( tool ) for tool in HypoToolGen ] - self._name = [ CFNaming.menuSequenceName(compName(alg)) for alg in self._hypo ] - - hypo_input = input_maker_output - for hypo_alg_node in self._hypo: - hypo_output = CFNaming.hypoAlgOutName(compName(hypo_alg_node.Alg)) - hypo_alg_node.addOutput( hypo_output ) - hypo_alg_node.setPreviousDecision( hypo_input ) - hypo_input = hypo_output - - else: - self._name = CFNaming.menuSequenceName(compName(Hypo)) - self._hypoToolConf = HypoToolConf( HypoToolGen ) - self._hypo = HypoAlgNode( Alg = Hypo ) - hypo_output = CFNaming.hypoAlgOutName(compName(Hypo)) - self._hypo.addOutput(hypo_output) - self._hypo.setPreviousDecision( input_maker_output) + self._name = CFNaming.menuSequenceName(compName(Hypo)) + self._hypoToolConf = HypoToolConf( HypoToolGen ) + self._hypo = HypoAlgNode( Alg = Hypo ) + hypo_output = CFNaming.hypoAlgOutName(compName(Hypo)) + self._hypo.addOutput(hypo_output) + self._hypo.setPreviousDecision( input_maker_output) log.debug("MenuSequence.connect: connecting InputMaker and HypoAlg, adding: \n\ InputMaker::%s.output=%s",\ - compName(self.maker.Alg), input_maker_output) - - if type(self._hypo) is list: - hypo_input_total = [] - [ hypo_input_total.extend( alg_node.Alg.getInputList() ) for alg_node in self._hypo ] - hypo_output_total = [] - [ hypo_output_total.extend( alg_node.Alg.getOutputList() ) for alg_node in self._hypo ] - - for hp, hp_in, hp_out in zip( self._hypo, hypo_input_total, hypo_output_total): - log.debug("HypoAlg::%s.HypoInputDecisions=%s, \n\ - HypoAlg::%s.HypoOutputDecisions=%s",\ - compName(hp.Alg), hp_in, compName(hp.Alg), hp_out) - else: - log.debug("HypoAlg::%s.HypoInputDecisions=%s, \n \ - HypoAlg::%s.HypoOutputDecisions=%s",\ - compName(self.hypo.Alg), self.hypo.readInputList()[0], compName(self.hypo.Alg), self.hypo.readOutputList()[0]) + compName(self.maker.Alg), input_maker_output) + log.debug("HypoAlg::%s.HypoInputDecisions=%s, \n \ + HypoAlg::%s.HypoOutputDecisions=%s",\ + compName(self.hypo.Alg), self.hypo.readInputList()[0], compName(self.hypo.Alg), self.hypo.readOutputList()[0]) @property def seed(self): return self._seed - @property def name(self): return self._name - @property def sequence(self): return self._sequence - @property def maker(self): return self._maker @@ -450,70 +416,32 @@ class MenuSequence(object): def hypo(self): return self._hypo - def getOutputList(self): - outputlist = [] - if type(self._hypo) is list: - for hypo in self._hypo: - outputlist.append(hypo.readOutputList()[0]) - else: - outputlist.append(self._hypo.readOutputList()[0]) + outputlist = [] + outputlist.append(self._hypo.readOutputList()[0]) return outputlist - def connectToFilter(self, outfilter): """ Connect filter to the InputMaker""" self._maker.addInput(outfilter) - def connect(self, Hypo, HypoToolGen): """ Sets the input and output of the hypo, and links to the input maker """ input_maker_output= self._maker.readOutputList()[0] # only one since it's merged - #### Add input/output Decision to Hypo - if type(Hypo) is list: - self.name=[] - self.hypoToolConf=[] - self._hypo=[] - hypo_input_total=[] - hypo_output_total=[] - hypo_input = input_maker_output - for hypo_alg, hptool in zip(Hypo, HypoToolGen): - self.name.append( CFNaming.menuSequenceName(compName(hypo_alg)) ) - self.hypoToolConf.append( HypoToolConf( hptool ) ) - - hypo_input_total.append(hypo_input) - hypo_output = CFNaming.hypoAlgOutName(compName(hypo_alg)) - hypo_output_total.append(hypo_output) - - hypo_node = HypoAlgNode( Alg = hypo_alg ) - hypo_node.addOutput(hypo_output) - hypo_node.setPreviousDecision(hypo_input) - - self._hypo.append( hypo_node ) - hypo_input = hypo_output - log.warning("Sequence %s has more than one Hypo; correct your sequence for next develpments", self.name) - else: - self.name = CFNaming.menuSequenceName(compName(Hypo)) - self.hypoToolConf = HypoToolConf( HypoToolGen ) - self._hypo = HypoAlgNode( Alg = Hypo ) - hypo_output = CFNaming.hypoAlgOutName(compName(Hypo)) - self._hypo.addOutput(hypo_output) - self._hypo.setPreviousDecision( input_maker_output) - + #### Add input/output Decision to Hypo + self.name = CFNaming.menuSequenceName(compName(Hypo)) + self.hypoToolConf = HypoToolConf( HypoToolGen ) + self._hypo = HypoAlgNode( Alg = Hypo ) + hypo_output = CFNaming.hypoAlgOutName(compName(Hypo)) + self._hypo.addOutput(hypo_output) + self._hypo.setPreviousDecision( input_maker_output) log.debug("MenuSequence.connect: connecting InputMaker and HypoAlg and OverlapRemoverAlg, adding: \n\ InputMaker::%s.output=%s",\ - compName(self._maker.Alg), input_maker_output) - if type(self._hypo) is list: - for hp, hp_in, hp_out in zip( self._hypo, hypo_input_total, hypo_output_total): - log.debug("HypoAlg::%s.previousDecision=%s, \n\ - HypoAlg::%s.output=%s",\ - compName(hp.Alg), hp_in, compName(hp.Alg), hp_out) - else: - log.debug("HypoAlg::%s.previousDecision=%s, \n\ - HypoAlg::%s.output=%s",\ - compName(self._hypo.Alg), input_maker_output, compName(self._hypo.Alg), self._hypo.readOutputList()[0]) + compName(self._maker.Alg), input_maker_output) + log.debug("HypoAlg::%s.previousDecision=%s, \n HypoAlg::%s.output=%s",\ + compName(self._hypo.Alg), input_maker_output, compName(self._hypo.Alg), self._hypo.readOutputList()[0]) def createHypoTools(self, chainDict): @@ -538,48 +466,27 @@ class MenuSequence(object): file.write(" %s[fillcolor=%s]\n"%(self._maker.Alg.getName(), algColor(self._maker.Alg))) file.write(" %s[fillcolor=%s]\n"%(self.sequence.Alg.getName(), algColor(self.sequence.Alg))) - - if type(self._hypo) is list: - for hp in self._hypo: - cfseq_algs.append(hp) - file.write(" %s[color=%s]\n"%(hp.Alg.getName(), algColor(hp.Alg))) - all_hypos.append(hp) - else: - cfseq_algs.append(self._hypo) - file.write(" %s[color=%s]\n"%(self._hypo.Alg.getName(), algColor(self._hypo.Alg))) - all_hypos.append(self._hypo) - if not isCombo: - if type(self._hypo) is list: - last_step_hypo_nodes.append(self._hypo[-1]) - else: - last_step_hypo_nodes.append(self._hypo) + + cfseq_algs.append(self._hypo) + file.write(" %s[color=%s]\n"%(self._hypo.Alg.getName(), algColor(self._hypo.Alg))) + all_hypos.append(self._hypo) + if not isCombo: + last_step_hypo_nodes.append(self._hypo) return cfseq_algs, all_hypos, last_step_hypo_nodes - def getTools(self): - if type(self._hypo) is list: - return self._hypo[0].tools - else: - return self._hypo.tools + def getTools(self): + return self._hypo.tools def setSeed( self, seed ): self._seed = seed - def __repr__(self): - if type(self._hypo) is list: - hyponame=[] - hypotool=[] - for hp, hptool in zip(self._hypo, self._hypoToolConf): - hyponame.append( hp.Alg.getName() ) - hypotool.append( hptool.name ) - return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s \n HypoTool::%s"\ - %(self.name, hyponame, self._maker.Alg.getName(), self.sequence.Alg.getName(), hypotool) - else: - hyponame = self._hypo.Alg.getName() - hypotool = self._hypoToolConf.name - return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s \n HypoTool::%s\n"\ - %(self.name, hyponame, self._maker.Alg.getName(), self.sequence.Alg.getName(), hypotool) + def __repr__(self): + hyponame = self._hypo.Alg.getName() + hypotool = self._hypoToolConf.name + return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s \n HypoTool::%s\n"\ + %(self.name, hyponame, self._maker.Alg.getName(), self.sequence.Alg.getName(), hypotool) class CAMenuSequence(MenuSequence):