4 from DecisionHandling.DecisionHandlingConfig
import ComboHypoCfg
5 from TriggerMenuMT.HLT.Config.MenuComponents
import Chain, ChainStep
6 from TriggerMenuMT.HLT.Config.Utility.ChainDefInMenu
import ChainProp
7 from TriggerMenuMT.HLT.Config.Utility.ChainDictTools
import splitChainDictInLegs
8 from TriggerMenuMT.HLT.Config.Utility.DictFromChainName
import dictFromChainName
9 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig
import HLTMenuConfig
10 from HLTSeeding.HLTSeedingConfig
import mapThresholdToL1DecisionCollection
15 """Writes emulation files. key in the dict is a file name (+.dat), list which is value of each dict el is enetered into the file, one el. per line"""
16 for name, d
in data.items():
17 with open(name+
".dat",
"w")
as f:
24 """Used to store the step info, regardless of the chainDict"""
25 def __init__(self, name, seq=None, comboHypoCfg=None, comboToolConfs=None, chainDicts=None, isEmpty=False):
27 self.
seq = seq
if seq
is not None else []
28 self.
comboHypoCfg = comboHypoCfg
if comboHypoCfg
is not None else functools.partial(ComboHypoCfg)
36 def makeChain( flags, name, L1Thresholds, ChainSteps, Streams="physics:Main
", Groups=["RATE:TestRateGroup
", "BW:TestBW
"]):
38 In addition to making the chain object fills the flags that are used to generate MnuCOnfig JSON file
40 prop = ChainProp( name=name, l1SeedThresholds=L1Thresholds, groups=Groups )
43 chainDict[
"chainCounter"] = chainsCounter
47 chainDict[
'prescale'] = 1
53 for step
in ChainSteps:
54 StepConfig+=[ChainStep(step.name,
56 chainDicts=step.chainDicts
if step.chainDicts
else listOfChainDicts,
57 comboHypoCfg=step.comboHypoCfg,
58 comboToolConfs=step.comboToolConfs, isEmpty=step.isEmpty)]
60 chainConfig = Chain( name=name, L1decisions=L1decisions, ChainSteps=StepConfig )
61 HLTMenuConfig.registerChain( chainDict )