diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py index a5b804e581b4a485d21b34a75c4dfb4ac7b605c2..ea220ff0878460e68d91f8c6b85e3bd71e2ff57a 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py @@ -5,10 +5,43 @@ logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef") -from TrigUpgradeTest.electronMenuDefs import fastCaloSequence, electronSequence -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep + +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT + +# fragments generating configuration will be functions in New JO, so let's make them functions already now +def fastCaloSequenceCfg( flags ): + from TrigUpgradeTest.electronMenuDefs import fastCaloSequence + return fastCaloSequence + +def electronSequenceCfg( flags ): + from TrigUpgradeTest.electronMenuDefs import electronSequence + return electronSequence + +def generateChain(flags, chainDict ): # in New JO we will add flags here + chainDict = type("chainDict", (object,), chainDict) + # translation from chainDict["chainName"] to chainDict.chainName (less typing), + # it is not exact as the things like the multiplicity are not converted to int, however they should be made int in the first place + # + + if 'etcut' ins chainDict.chainName: + # this is the cache, we hope we will be able to get rid of it in future + fastCalo = RecoFragmentsPool.retrieve( fastCaloSequenceCfg, None ) # the None will be used for flags in future + electronReco = RecoFragmentsPool.retrieve( electronSequenceCfg, None ) + + return Chain(name = 'HLT_'+chainDict.chainName, + Seed = chainDict.L1Item, + ChainSteps = [ + ChainStep('ElectronStep1', [fastCalo]), + ChainStep('ElectronStep2', [electronReco]) + ]) + else: + raise RuntimeError("Unhandled chain %s" % chainDict.chainName) + + + + class Chain_electron: def __init__(self, chainDict): diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateElectronChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateElectronChainDefs.py index 84bc075d92fd3e27c397d09085fa13fddbe58a1d..1d0e5090a568bcc34e5c84af6867a369d190b0e7 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateElectronChainDefs.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateElectronChainDefs.py @@ -1,6 +1,6 @@ # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import Chain_electron as Chain_electron +from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import generteChain as generateElectronChain from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain from TriggerMenuMT.HLTMenuConfig.Menu.MenuUtils import splitChainDict @@ -20,8 +20,8 @@ def generateChainConfigs( chainDict ): for subChainDict in listOfChainDicts: log.debug("IN ELECTRON GENERATION CODE") - Electron = Chain_electron(subChainDict).assembleChain() - log.debug('Electron object: type name of class: %s', Electron.__class__.__name__) + Electron = generateElectronChain( subChainDict ) + listOfChainDefs += [Electron] log.debug('length of chaindefs %s', len(listOfChainDefs) )