22 """ Generates a list where the index corresponds to a Step number and the stored object is a list of Sequencers making up the Step
25 if HLTAllSteps
is not None:
26 for HLTStep
in HLTAllSteps.Members:
27 if "_reco" not in HLTStep.getName():
28 for Step
in getSequenceChildren( HLTStep ):
29 for View
in getSequenceChildren( Step ):
30 for Reco
in getSequenceChildren( View ):
31 if "_reco" in Reco.getName()
and HLTStep.getName()
not in stepsData:
32 stepsData.append( HLTStep.Members )
36 stepsData.append( HLTStep.Members )
38 __log.warn(
"No HLTAllSteps sequencer, will not export per-Step data for chains.")
50 """ Finds the Filter which is responsible for this Chain in each Step.
51 Return a list of the per-Step name() of the Sequencer which is unlocked by the Chain's Filter in the Step.
54 for counter, step
in enumerate(stepsData, 1):
56 for sequencer
in step:
58 sequencerFilter = sequencer.Members[0]
59 except (AttributeError, IndexError):
62 if mySequencer
is not None:
63 __log.error(
"Multiple Filters found (corresponding Sequencers %s, %s) for %s in Step %i!",
64 mySequencer.getName(), sequencer.getName(), chainName, counter)
65 mySequencer = sequencer
67 sequencers.append(mySequencer.getName()
if mySequencer
else "")
69 while len(sequencers) != 0
and sequencers[-1] ==
"":
84 """ Generates JSON given the ChainProps and sequences
87 menuDict = {
"filetype":
"hltmenu",
95 from TriggerMenuMT.HLT.Menu
import StreamInfo
96 for chain
in chainDicts:
99 for streamName
in chain[
"stream"]:
100 streamTag = StreamInfo.getStreamTag(streamName)
102 if streamTag
is None:
103 __log.error(
'Stream %s does not have StreamTags defined excluding from JSON', streamName)
106 chainStreamTags.append(streamName)
108 if streamName
not in menuDict[
"streams"]:
109 menuDict[
"streams"][streamName] = {
111 "type": streamTag.type(),
112 "obeyLB": streamTag.obeysLumiBlock(),
113 "forceFullEventBuilding": streamTag.forceFullEventBuilding()
119 [ l1Thresholds.append(p[
'L1threshold'])
for p
in chain[
'chainParts'] ]
122 chainName = chain[
"chainName"]
123 menuDict[
"chains"][chainName] = {
124 "counter": chain[
"chainCounter"],
125 "nameHash": chain[
"chainNameHash"],
126 "legMultiplicities": chain[
"chainMultiplicities"],
127 "l1item": chain[
"L1item"],
128 "l1thresholds": l1Thresholds,
129 "groups": chain[
"groups"],
130 "streams": chainStreamTags,
140 fileName = getHLTMenuFileName( flags)
141 __log.info(
"Writing HLT Menu JSON to %s", fileName )
142 with open( fileName,
'w' )
as fp:
143 json.dump( menuDict, fp, indent=4, sort_keys=
False )
153 """ Check that global algs only go into one Step
157 from AthenaConfiguration.ComponentFactory
import CompFactory
159 for seqName, seqeuncer
in menuDict[
"sequencers"].items():
160 stepNumber = int(re.search(
r'\d+', seqName).group())
161 fullEventMode =
False
162 for alg
in seqeuncer:
163 if isinstance(alg, CompFactory.EventViewCreatorAlgorithm):
164 fullEventMode =
False
165 elif isinstance(alg, CompFactory.InputMakerForRoI):
167 if not fullEventMode:
169 if alg
in algToStep
and algToStep[alg] != stepNumber:
170 __log.error(
"{} is a full-event context alg, it should only be running in one Step, however it is in both Steps {} and {}".format(alg, stepNumber, algToStep[alg]))
173 algToStep[alg] = stepNumber
175 raise Exception(
"[validateJSON] Problems detected in validateGlobalAlgs().")