Skip to content
Snippets Groups Projects
Commit 2a21893a authored by Tomasz Bold's avatar Tomasz Bold
Browse files

possiblie chage to current menu generation that makes it more New JO compliant

parent f14f3617
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
# 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) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment