Commit 524b7c1a authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'refactor-ca-menu-sequence' into 'master'

Refactored CAMenuSequence ctor to simplify its use (related to HLT newJO config)

See merge request atlas/athena!38385
parents 57b26881 0a975987
......@@ -34,11 +34,8 @@ def generateChains( flags, chainDict ):
accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName())
fastCaloSequence = CAMenuSequence( Sequence = l2CaloReco.sequence(),
Maker = l2CaloReco.inputMaker(),
Hypo = l2CaloHypo,
HypoToolGen = TrigEgammaFastCaloHypoToolFromDict,
CA = accCalo)
fastCaloSequence = CAMenuSequence(accCalo,
HypoToolGen = TrigEgammaFastCaloHypoToolFromDict)
accCalo.printConfig()
# this cannot work for asymmetric combined chains....FP
......@@ -84,11 +81,8 @@ def generateChains( flags, chainDict ):
accTrk.addEventAlgo(fastElectronHypoAlg, sequenceName=stepView.getName())
from TrigEgammaHypo.TrigEgammaFastElectronHypoTool import TrigEgammaFastElectronHypoToolFromDict
fastInDetSequence = CAMenuSequence(Sequence = fastInDetReco.sequence(),
Maker = fastInDetReco.inputMaker(),
Hypo = fastElectronHypoAlg,
HypoToolGen = TrigEgammaFastElectronHypoToolFromDict,
CA = accTrk)
fastInDetSequence = CAMenuSequence(accTrk,
HypoToolGen = TrigEgammaFastElectronHypoToolFromDict)
fastInDetStep = ChainStep( name=secondStepName, Sequences=[fastInDetSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict))
......
......@@ -86,11 +86,8 @@ def generateChains( flags, chainDict ):
hypo.Jets = jetsfullname
acc.addEventAlgo(hypo, sequenceName=stepView.getName() )
jetSequence = CAMenuSequence( Sequence = inEventReco.sequence(),
Maker = inEventReco.inputMaker(),
Hypo = hypo,
HypoToolGen = trigJetHypoToolFromDict,
CA = acc)
jetSequence = CAMenuSequence(acc,
HypoToolGen = trigJetHypoToolFromDict)
jetStep = ChainStep(name=stepName, Sequences=[jetSequence], chainDicts=[chainDict])
......
......@@ -530,9 +530,16 @@ class MenuSequence(object):
class CAMenuSequence(MenuSequence):
''' MenuSequence with Compoment Accumulator '''
def __init__(self, Sequence, Maker, Hypo, HypoToolGen, CA):
self.ca = CA
MenuSequence.__init__(self, Sequence, Maker, Hypo, HypoToolGen)
def __init__(self, ca, HypoToolGen ):
self.ca = ca
allAlgs = ca.getEventAlgos()
inputMaker = [ a for a in allAlgs if isInputMakerBase(a)]
assert len(inputMaker) == 1, "Wrong number of input makers in the compnent accumulator {}".format(len(inputMaker))
inputMaker = inputMaker[0]
hypoAlg = [ a for a in allAlgs if isHypoAlg(a)]
assert len(hypoAlg) == 1, "Wrong number of hypo algs in the compnent accumulator {}".format(len(hypoAlg))
hypoAlg = hypoAlg[0]
MenuSequence.__init__(self, ca.getSequence(), inputMaker, hypoAlg, HypoToolGen)
@property
def sequence(self):
......@@ -873,13 +880,11 @@ class InEventReco( ComponentAccumulator ):
def mergeReco( self, ca ):
""" Merged CA movnig reconstruction algorithms into the right sequence """
return self.merge( ca, sequenceName=self.recoSeq.getName() )
return self.merge( ca, sequenceName=self.recoSeq.name )
def addHypoAlg(self, alg):
self.addEventAlgo( alg, self.mainSeq.name )
def sequence( self ):
return self.mainSeq
def addRecoAlgo( self, algo ):
""" Place algorithm in the correct reconstruction sequence """
return self.addEventAlgo( algo, sequenceName=self.recoSeq.name )
def inputMaker( self ):
return self.inputMakerAlg
......@@ -911,25 +916,13 @@ class InViewReco(ComponentAccumulator):
self.viewsSeq = parOR( self.viewMakerAlg.ViewNodeName )
self.addSequence( self.viewsSeq, self.mainSeq.name )
def addInput(self, inKey, outKey ):
"""Adds input (DecisionsContainer) from which the views should be created """
self.viewMakerAlg.InputMakerInputDecisions += [ inKey ]
self.viewMakerAlg.InputMakerOutputDecisions = outKey
def mergeReco( self, ca ):
""" Merge CA movnig reconstruction algorithms into the right sequence """
return self.merge( ca, sequenceName=self.viewsSeq.getName() )
return self.merge( ca, sequenceName=self.viewsSeq.name )
def addRecoAlgo( self, algo ):
""" Place algorithm in the correct reconstruction sequence """
return self.addEventAlgo( algo, sequenceName=self.viewsSeq.getName() )
def addHypoAlg(self, alg):
self.addEventAlgo( alg, self.mainSeq.name )
def sequence( self ):
return self.mainSeq
return self.addEventAlgo( algo, sequenceName=self.viewsSeq.name )
def inputMaker( self ):
return self.viewMakerAlg
......
......@@ -211,11 +211,8 @@ def generateChains( flags, chainDict ):
acc.addEventAlgo(l2muFastHypo, sequenceName=stepView.getName())
l2muFastSequence = CAMenuSequence( Sequence = reco.sequence(),
Maker = reco.inputMaker(),
Hypo = l2muFastHypo,
HypoToolGen = TrigMufastHypoToolFromDict,
CA = acc )
l2muFastSequence = CAMenuSequence(acc,
HypoToolGen = TrigMufastHypoToolFromDict )
l2muFastStep = ChainStep( name=stepName, Sequences=[l2muFastSequence], chainDicts=[chainDict] )
......@@ -240,17 +237,14 @@ def generateChains( flags, chainDict ):
accL2CB.merge(recoL2CB, sequenceName = stepL2CBReco.getName())
l2muCombHypo = l2MuCombHypoCfg( flags,
name = 'TrigL2MuCombHypo',
muCombInfo = 'HLT_MuonL2CBInfo' )
l2muCombHypo = l2MuCombHypoCfg(flags,
name = 'TrigL2MuCombHypo',
muCombInfo = 'HLT_MuonL2CBInfo' )
accL2CB.addEventAlgo(l2muCombHypo, sequenceName=stepL2CBView.getName())
l2muCombSequence = CAMenuSequence( Sequence = recoL2CB.sequence(),
Maker = recoL2CB.inputMaker(),
Hypo = l2muCombHypo,
HypoToolGen = TrigmuCombHypoToolFromDict,
CA = accL2CB )
l2muCombSequence = CAMenuSequence(accL2CB,
HypoToolGen = TrigmuCombHypoToolFromDict)
l2muCombStep = ChainStep( name=stepL2CBName, Sequences=[l2muCombSequence], chainDicts=[chainDict] )
......@@ -323,11 +317,8 @@ def generateChains( flags, chainDict ):
accMS.addEventAlgo(efmuMSHypo, sequenceName=stepEFMSView.getName())
efmuMSSequence = CAMenuSequence( Sequence = recoMS.sequence(),
Maker = recoMS.inputMaker(),
Hypo = efmuMSHypo,
HypoToolGen = TrigMuonEFMSonlyHypoToolFromDict,
CA = accMS )
efmuMSSequence = CAMenuSequence(accMS,
HypoToolGen = TrigMuonEFMSonlyHypoToolFromDict)
efmuMSStep = ChainStep( name=stepEFMSName, Sequences=[efmuMSSequence], chainDicts=[chainDict] )
......
......@@ -34,11 +34,8 @@ def generateChains(flags, chainDict):
accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName())
fastCaloSequence = CAMenuSequence( Sequence = l2CaloReco.sequence(),
Maker = l2CaloReco.inputMaker(),
Hypo = l2CaloHypo,
HypoToolGen = TrigEgammaFastCaloHypoToolFromDict,
CA = accCalo )
fastCaloSequence = CAMenuSequence(accCalo,
HypoToolGen = TrigEgammaFastCaloHypoToolFromDict)
fastCaloStep = ChainStep(firstStepName, [fastCaloSequence], multiplicity=[1],chainDicts=[chainDict] )
......@@ -58,11 +55,8 @@ def generateChains(flags, chainDict):
accPhoton.addEventAlgo(l2PhotonHypo, sequenceName=stepView.getName())
l2PhotonSequence = CAMenuSequence( Sequence = l2PhotonReco.sequence(),
Maker = l2PhotonReco.inputMaker(),
Hypo = l2PhotonHypo,
HypoToolGen = TrigEgammaFastPhotonHypoToolFromDict,
CA = accPhoton )
l2PhotonSequence = CAMenuSequence(accPhoton,
HypoToolGen = TrigEgammaFastPhotonHypoToolFromDict)
l2PhotonStep = ChainStep(secondStepName, [l2PhotonSequence], multiplicity=[1],chainDicts=[chainDict] )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment