Skip to content
Snippets Groups Projects
Commit 64cc40d2 authored by Krzysztof Jamrog's avatar Krzysztof Jamrog
Browse files

New JO menu accumulator generating flow

Former-commit-id: 9e5f2115
parent c0368cd8
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
from TrigUpgradeTest.ElectronMenuConfig import l2CaloRecoCfg
from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, ChainStep, Chain, RecoFragmentsPool
from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromName
from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlgMT
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
def generateChains( flags, chainDict ):
import pprint
pprint.pprint( chainDict )
acc = ComponentAccumulator()
l2CaloHypo = TrigL2CaloHypoAlgMT( 'L2ElectronCaloHypo' )
l2CaloHypo.CaloClusters = 'L2CaloEMClusters'
l2CaloReco = RecoFragmentsPool.retrieve( l2CaloRecoCfg, flags )
acc.merge( l2CaloReco )
return []
fastCaloSequence = MenuSequence( Sequence = l2CaloReco.sequence(),
Maker = l2CaloReco.inputMaker(),
Hypo = l2CaloHypo,
HypoToolGen = TrigL2CaloHypoToolFromName )
fastCaloStep = ChainStep("Electron_step1", [fastCaloSequence])
# # # fast ID
# # # EF calo
# # # EF ID
# # # offline egamma
chain = Chain(chainDict['chainName'], chainDict['L1item'], [fastCaloStep] )
return acc, chain # will be more steps here
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaCommon.CFElements import seqAND
from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import decisionTree_From_Chains
from AthenaCommon.Logging import logging
from AthenaCommon.Constants import VERBOSE,INFO,DEBUG
_log = logging.getLogger('GenerateMenuMT_newJO')
......@@ -33,11 +37,14 @@ def generateMenu( flags ):
from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import DictFromChainName
toChainDictTranslator = DictFromChainName()
flatChainDicts = []
counter = 0
signatureToGenerator = {}
menuChains = []
menuAcc = ComponentAccumulator()
mainSequenceName = 'HLTAllSteps'
menuAcc.addSequence( seqAND(mainSequenceName) )
for name, cfgFlag in flags._flagdict.iteritems():
if not 'Trigger.menu.' in name:
continue
......@@ -56,19 +63,24 @@ def generateMenu( flags ):
counter += 1
chainDict['chainCounter'] = counter
# todo topo threshold
flatChainDicts.append( chainDict )
# TODO topo threshold
# call generating function and pass to CF builder
menuChains.append( signatureToGenerator[signature](flags, chainDict) )
chainAcc, chain = signatureToGenerator[signature](flags, chainDict)
menuChains.append( chain )
menuAcc.merge(chainAcc)
_log.info('Obtained Menu Chain objects')
# pass all menuChain to CF builder
# pass all menuChain to CF builder
decisionTree_From_Chains( menuAcc.getSequence(mainSequenceName), menuChains )
menuAcc.printConfig()
_log.info('CF is built')
return None # will return once the CF build is realy invoked
return menuAcc
......@@ -31,7 +31,7 @@ def setupMenu(flags):
]
flags.Trigger.menu.egamma = [
get_flag_item('e20', 'L1_EM10', ['RATE:SingleElectron', 'BW:Electron'])
get_flag_item('HLT_e20_loose', 'L1_EM10', ['RATE:SingleElectron', 'BW:Electron'])
]
flags.Trigger.menu.combined = [
......@@ -41,12 +41,26 @@ def setupMenu(flags):
if __name__ == "__main__":
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
acc = ComponentAccumulator()
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior=True
from AthenaConfiguration.AllConfigFlags import ConfigFlags
setupMenu(ConfigFlags)
ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"]
ConfigFlags.lock()
ConfigFlags.dump()
from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT_newJO import generateMenu
menu = generateMenu( ConfigFlags )
acc.merge(menu)
f = open('newJOMenu.pkl', 'wb')
acc.store(f)
f.close()
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