|
ATLAS Offline Software
|
|
def | __isCombo (alg) |
|
def | __stepNumber (stepName) |
|
def | collectHypos (steps) |
|
def | __decisionsFromHypo (hypo) |
|
def | collectViewMakers (steps) |
|
def | collectFilters (steps) |
|
def | collectHLTSeedingDecisionObjects (hltSeeding) |
|
def | collectHypoDecisionObjects (hypos, inputs=True, outputs=True) |
|
def | collectFilterDecisionObjects (filters, inputs=True, outputs=True) |
|
def | collectHLTSummaryDecisionObjects (hltSummary) |
|
def | collectDecisionObjects (hypos, filters, hltSeeding, hltSummary) |
|
def | triggerSummaryCfg (flags, hypos) |
|
def | triggerMonitoringCfg (flags, hypos, filters, hltSeeding) |
|
def | triggerOutputCfg (flags, hypos) |
|
def | triggerBSOutputCfg (flags, hypos, offline=False) |
|
def | triggerPOOLOutputCfg (flags) |
|
def | triggerMergeViewsCfg (flags, viewMakers) |
|
def | triggerEDMGapFillerCfg (flags, edmSet, decObj=[], decObjHypoOut=[], extraInputs=[], extraOutputs=[]) |
|
def | triggerRunCfg (flags, menu=None) |
|
def | triggerIDCCacheCreatorsCfg (flags, seqName=None) |
|
def | triggerEndOfEventCfg (flags) |
|
def | triggerPostRunCfg (flags) |
|
def | testMenu (flags) |
|
◆ __decisionsFromHypo()
def python.TriggerConfig.__decisionsFromHypo |
( |
|
hypo | ) |
|
|
private |
return all chains served by this hypo and the keys of produced decision object
Definition at line 57 of file TriggerConfig.py.
58 """ return all chains served by this hypo and the keys of produced decision object """
59 from TrigCompositeUtils.TrigCompositeUtils
import isLegId
60 __log.debug(
"Hypo type %s is combo %r", hypo.getName(),
__isCombo(hypo))
62 return [key
for key
in list(hypo.MultiplicitiesMap.keys())
if not isLegId(key)], hypo.HypoOutputDecisions
64 return [ t.getName()
for t
in hypo.HypoTools
if not isLegId(t.getName())], [
str(hypo.HypoOutputDecisions)]
◆ __isCombo()
def python.TriggerConfig.__isCombo |
( |
|
alg | ) |
|
|
private |
Definition at line 15 of file TriggerConfig.py.
16 return hasattr( alg,
"MultiplicitiesMap" )
◆ __stepNumber()
def python.TriggerConfig.__stepNumber |
( |
|
stepName | ) |
|
|
private |
extract step number frmo strings like Step2... -> 2
Definition at line 18 of file TriggerConfig.py.
19 """extract step number frmo strings like Step2... -> 2"""
20 return int(stepName.split(
'_')[0].
replace(
"Step",
""))
◆ collectDecisionObjects()
def python.TriggerConfig.collectDecisionObjects |
( |
|
hypos, |
|
|
|
filters, |
|
|
|
hltSeeding, |
|
|
|
hltSummary |
|
) |
| |
Returns the set of all decision objects of HLT
Definition at line 150 of file TriggerConfig.py.
152 Returns the set of all decision objects of HLT
161 decisionObjects =
set()
162 decisionObjects.update(decObjL1)
163 decisionObjects.update(decObjHypo)
164 decisionObjects.update(decObjFilter)
165 decisionObjects.update(decObjSummary)
166 __log.info(
"Number of decision objects found in HLT CF %d of which %d are the outputs of hypos",
167 len(decisionObjects), len(decObjHypo) )
168 __log.debug( decisionObjects )
169 return list(
sorted(decisionObjects)), decObjHypo
◆ collectFilterDecisionObjects()
def python.TriggerConfig.collectFilterDecisionObjects |
( |
|
filters, |
|
|
|
inputs = True , |
|
|
|
outputs = True |
|
) |
| |
Definition at line 133 of file TriggerConfig.py.
134 decisionObjects =
set()
135 for step, stepFilters
in filters.items():
136 for filt
in stepFilters:
137 if inputs
and hasattr( filt,
"Input" ):
138 decisionObjects.update(
str(i)
for i
in filt.Input )
139 if outputs
and hasattr( filt,
"Output" ):
140 decisionObjects.update(
str(o)
for o
in filt.Output )
141 __log.info(
"Collecting %i decision objects from filters", len(decisionObjects))
142 return decisionObjects
◆ collectFilters()
def python.TriggerConfig.collectFilters |
( |
|
steps | ) |
|
Similarly to collectHypos but works for filter algorithms
The logic is simpler as all filters are grouped in step filter sequences
Returns map: step name -> list of all filters of that step
Definition at line 85 of file TriggerConfig.py.
87 Similarly to collectHypos but works for filter algorithms
89 The logic is simpler as all filters are grouped in step filter sequences
90 Returns map: step name -> list of all filters of that step
92 __log.info(
"Collecting filters")
93 filters = defaultdict( list )
95 for stepSeq
in steps.Members:
96 if "filter" in stepSeq.getName():
97 filters[stepSeq.getName()] = stepSeq.Members
98 __log.debug(
"Found Filters in Step %s : %s", stepSeq.getName(), stepSeq.Members)
◆ collectHLTSeedingDecisionObjects()
def python.TriggerConfig.collectHLTSeedingDecisionObjects |
( |
|
hltSeeding | ) |
|
Definition at line 103 of file TriggerConfig.py.
104 decisionObjects =
set()
105 decisionObjects.update([
str(d.Decisions)
for d
in hltSeeding.RoIBRoIUnpackers + hltSeeding.xAODRoIUnpackers ])
106 decisionObjects.update([
str(d.DecisionsProbe)
for d
in hltSeeding.RoIBRoIUnpackers + hltSeeding.xAODRoIUnpackers ])
107 from HLTSeeding.HLTSeedingConfig
import mapThresholdToL1DecisionCollection
109 decisionObjects.discard(
'')
110 decisionObjects.discard(
'StoreGateSvc+')
111 __log.info(
"Collecting %i decision objects from HLTSeeding instance", len(decisionObjects))
112 return decisionObjects
◆ collectHLTSummaryDecisionObjects()
def python.TriggerConfig.collectHLTSummaryDecisionObjects |
( |
|
hltSummary | ) |
|
Definition at line 144 of file TriggerConfig.py.
145 decisionObjects =
set()
146 decisionObjects.add(
str(hltSummary.DecisionsSummaryKey) )
147 __log.info(
"Collecting %i decision objects from hltSummary", len(decisionObjects))
148 return decisionObjects
◆ collectHypoDecisionObjects()
def python.TriggerConfig.collectHypoDecisionObjects |
( |
|
hypos, |
|
|
|
inputs = True , |
|
|
|
outputs = True |
|
) |
| |
Definition at line 114 of file TriggerConfig.py.
115 decisionObjects =
set()
116 for step, stepHypos
in sorted(hypos.items()):
117 for hypoAlg
in stepHypos:
118 __log.debug(
"Hypo %s with input %s and output %s ",
119 hypoAlg.getName(), hypoAlg.HypoInputDecisions, hypoAlg.HypoOutputDecisions )
120 if isinstance( hypoAlg.HypoInputDecisions, GaudiConfig2.semantics._ListHelper):
122 [ decisionObjects.add(
str(d) )
for d
in hypoAlg.HypoInputDecisions ]
124 [ decisionObjects.add(
str(d) )
for d
in hypoAlg.HypoOutputDecisions ]
127 decisionObjects.add(
str(hypoAlg.HypoInputDecisions) )
129 decisionObjects.add(
str(hypoAlg.HypoOutputDecisions) )
130 __log.info(
"Collecting %i decision objects from hypos", len(decisionObjects))
131 return sorted(decisionObjects)
◆ collectHypos()
def python.TriggerConfig.collectHypos |
( |
|
steps | ) |
|
Method iterating over the CF and picking all the Hypothesis algorithms
Returned is a map with the step name and list of all instances of hypos in that step.
Input is top HLT sequencer.
Definition at line 23 of file TriggerConfig.py.
25 Method iterating over the CF and picking all the Hypothesis algorithms
27 Returned is a map with the step name and list of all instances of hypos in that step.
28 Input is top HLT sequencer.
30 __log.info(
"Collecting hypos from steps")
31 hypos = defaultdict( list )
33 for stepSeq
in steps.Members:
37 if "filter" in stepSeq.getName():
38 __log.debug(
"Skipping filtering steps %s", stepSeq.getName() )
41 __log.debug(
"collecting hypos from step %s", stepSeq.getName() )
43 for alg
in sorted(algs, key=
lambda t:
str(t.getName())):
47 if hasattr(alg,
'HypoInputDecisions'):
48 __log.debug(
"found hypo %s in %s", alg.getName(), stepSeq.getName())
49 if __isCombo( alg )
and len(alg.ComboHypoTools):
50 __log.debug(
" with %d comboHypoTools: %s", len(alg.ComboHypoTools),
' '.
join(map(str, [tool.getName()
for tool
in alg.ComboHypoTools])))
51 hypos[stepSeq.getName()].
append( alg )
53 __log.verbose(
"Not a hypo %s", alg.getName())
55 return OrderedDict(hypos)
◆ collectViewMakers()
def python.TriggerConfig.collectViewMakers |
( |
|
steps | ) |
|
collect all view maker algorithms in the configuration
Definition at line 67 of file TriggerConfig.py.
68 """ collect all view maker algorithms in the configuration """
75 for seq,algs
in algsInSeq.items():
77 if "EventViewCreator" in alg.getFullJobOptName():
80 __log.debug(
"Found ViewMakers: %s",
' '.
join([ maker.getName()
for maker
in makers ]))
◆ testMenu()
def python.TriggerConfig.testMenu |
( |
|
flags | ) |
|
◆ triggerBSOutputCfg()
def python.TriggerConfig.triggerBSOutputCfg |
( |
|
flags, |
|
|
|
hypos, |
|
|
|
offline = False |
|
) |
| |
Returns CA with algorithms and/or tools required to do the serialisation
decObj - list of all navigation objects
decObjHypoOut - list of decisions produced by hypos
hypos - the {stepName: hypoList} dictionary with all hypo algorithms - used to find the PEB decision keys
offline - if true CA contains algorithms that need to be merged to output stream sequence,
if false the CA contains a tool that needs to be added to HltEventLoopMgr
Definition at line 339 of file TriggerConfig.py.
341 Returns CA with algorithms and/or tools required to do the serialisation
343 decObj - list of all navigation objects
344 decObjHypoOut - list of decisions produced by hypos
345 hypos - the {stepName: hypoList} dictionary with all hypo algorithms - used to find the PEB decision keys
346 offline - if true CA contains algorithms that need to be merged to output stream sequence,
347 if false the CA contains a tool that needs to be added to HltEventLoopMgr
349 from TrigEDMConfig
import DataScoutingInfo
350 from TrigEDMConfig.TriggerEDM
import getRun3BSList
351 from TrigEDMConfig.TriggerEDMDefs
import allowTruncation
352 from TrigOutputHandling.TrigOutputHandlingConfig
import TriggerEDMSerialiserToolCfg, StreamTagMakerToolCfg, TriggerBitsMakerToolCfg
355 collectionsToBS =
getRun3BSList(flags, [
"BS"] + DataScoutingInfo.getAllDataScoutingIdentifiers())
360 for typekey, bsfragments, props
in collectionsToBS:
362 moduleIDs =
sorted(DataScoutingInfo.getFullHLTResultID()
if f ==
'BS' else
363 DataScoutingInfo.getDataScoutingResultID(f)
364 for f
in bsfragments)
366 __log.debug(
'adding to serialiser list: %s, modules: %s', typekey, moduleIDs)
367 serialiser.addCollection(typekey, moduleIDs, allowTruncation = allowTruncation
in props)
375 for hypoList
in hypos.values():
376 for hypo
in hypoList:
377 if hypo.getFullJobOptName().startswith(
'PEBInfoWriterAlg/'):
378 PEBKeys.append(
str(hypo.HypoOutputDecisions))
381 __log.debug(
'Setting StreamTagMakerTool.PEBDecisionKeys = %s', PEBKeys)
382 stmaker.PEBDecisionKeys = PEBKeys
388 from TrigOutputHandling.TrigOutputHandlingConfig
import HLTResultMTMakerCfg
389 HLTResultMTMakerAlg=CompFactory.HLTResultMTMakerAlg
391 hltResultMakerTool.StreamTagMaker = stmaker
392 hltResultMakerTool.MakerTools = [bitsmaker, serialiser]
394 hltResultMakerAlg.ResultMaker = hltResultMakerTool
397 if flags.Input.Format
is Format.BS:
398 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
400 readBSAcc.getEventAlgo(
'SGInputLoader').Load.add(
401 (
'ByteStreamMetadataContainer',
'InputMetaDataStore+ByteStreamMetadata'))
405 hltResultMakerAlg.ResultMaker.ExtraROBs = []
406 hltResultMakerAlg.ResultMaker.ExtraSubDets = []
409 decmaker = CompFactory.getComp(
"TrigDec::TrigDecisionMakerMT")(
"TrigDecMakerMT")
413 from TrigConfigSvc.TrigConfigSvcCfg
import L1PrescaleCondAlgCfg
417 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamWriteCfg
418 writingOutputs = [
"HLT::HLTResultMT#HLTResultMT"]
419 writingInputs = [(
"HLT::HLTResultMT",
"HLTResultMT"),
420 (
"xAOD::TrigDecision",
"xTrigDecision")]
423 if flags.Trigger.doLVL1:
424 if flags.Trigger.enableL1MuonPhase1
or flags.Trigger.enableL1CaloPhase1:
425 writingOutputs += [
'xAOD::TrigCompositeContainer#L1TriggerResult']
426 writingInputs += [(
'xAOD::TrigCompositeContainer',
'StoreGateSvc+L1TriggerResult')]
427 if flags.Trigger.enableL1CaloLegacy
or not flags.Trigger.enableL1MuonPhase1:
428 writingOutputs += [
'ROIB::RoIBResult#RoIBResult']
429 writingInputs += [(
'ROIB::RoIBResult',
'StoreGateSvc+RoIBResult')]
431 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig
import L1TriggerByteStreamEncoderCfg
434 writingAcc =
ByteStreamWriteCfg(flags, type_names=writingOutputs, extra_inputs=writingInputs)
435 writingAcc.addEventAlgo(hltResultMakerAlg)
436 writingAcc.addEventAlgo(decmaker)
437 acc.merge(writingAcc)
440 from TrigServices.TrigServicesConfig
import TrigServicesCfg
442 hltEventLoopMgr = onlineServicesAcc.getPrimary()
443 hltEventLoopMgr.ResultMaker.StreamTagMaker = stmaker
444 hltEventLoopMgr.ResultMaker.MakerTools = [serialiser, bitsmaker]
445 onlineServicesAcc.getEventAlgo(
'SGInputLoader').Load.add(
446 (
'ByteStreamMetadataContainer',
'InputMetaDataStore+ByteStreamMetadata'))
447 acc.merge(onlineServicesAcc)
◆ triggerEDMGapFillerCfg()
def python.TriggerConfig.triggerEDMGapFillerCfg |
( |
|
flags, |
|
|
|
edmSet, |
|
|
|
decObj = [] , |
|
|
|
decObjHypoOut = [] , |
|
|
|
extraInputs = [] , |
|
|
|
extraOutputs = [] |
|
) |
| |
Configure the EDM gap filler
Definition at line 553 of file TriggerConfig.py.
553 def triggerEDMGapFillerCfg( flags, edmSet, decObj=[], decObjHypoOut=[], extraInputs=[], extraOutputs=[] ):
554 """Configure the EDM gap filler"""
556 from TrigEDMConfig.TriggerEDMDefs
import Alias
557 from TrigEDMConfig.TriggerEDM
import getRawTriggerEDMList
563 ".*AuxContainer#.*",
".*AuxInfo#.*",
565 if flags.Trigger.doHLT:
567 ignore += [
"xAOD::TrigCompositeContainer#HLTNav_Summary_OnlineSlimmed",
568 "xAOD::TrigCompositeContainer#HLT_RuntimeMetadata"]
571 tool = CompFactory.HLTEDMCreator(f
"GapFiller{'' if edmSet==['BS'] else '_'+'_'.join(edmSet)}")
572 alg = CompFactory.HLTEDMCreatorAlg(
"EDMCreatorAlg",
573 OutputTools = [tool])
574 alg.ExtraInputs =
set(extraInputs)
575 alg.ExtraOutputs =
set(extraOutputs)
578 groupedByType = defaultdict( list )
579 re_ignore = [re.compile(x)
for x
in ignore]
583 if not any([ outputType
in el[1].
split()
for outputType
in edmSet ]):
585 if any(ign.fullmatch(el[0])
for ign
in re_ignore):
587 collType, collName = el[0].
split(
"#")
589 aliases = [
str(a)
for a
in el[3]
if isinstance(a, Alias) ]
590 if len(aliases) == 1:
591 __log.debug(
"GapFiller configuration found an aliased type '%s' for '%s'", aliases[0], collType)
592 collType = aliases[0]
593 elif len(aliases) > 1:
594 __log.error(
"GapFiller configuration found inconsistent '%s' (too many aliases?)", aliases)
596 groupedByType[collType].
append( collName )
598 for collType, collNameList
in groupedByType.items():
599 propName = collType.split(
":")[-1]
600 if hasattr( tool, propName ):
601 setattr( tool, propName, collNameList )
602 __log.debug(
"GapFiller will create EDM collection type '%s' for '%s'", collType, collNameList)
604 __log.debug(
"EDM collections of type %s are not going to be added to StoreGate, if not created by the HLT", collType )
606 if decObj
or decObjHypoOut:
607 __log.debug(
"GapFiller is ensuring the creation of all the decision object collections")
608 __log.debug(
"'%s'", decObj)
610 tool.FixLinks =
list(decObjHypoOut)
612 tool.TrigCompositeContainer +=
list(decObj)
614 acc.addEventAlgo(alg, primary=
True)
◆ triggerEndOfEventCfg()
def python.TriggerConfig.triggerEndOfEventCfg |
( |
|
flags | ) |
|
Definition at line 759 of file TriggerConfig.py.
760 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig
import HLTMenuConfig
762 acceptedEventChainDicts = [cd
for cd
in HLTMenuConfig.dictsList() \
763 if 'Calib' in cd[
'signatures'] \
764 and 'acceptedevts' in cd[
'chainParts'][0][
'purpose']]
769 if not (flags.Trigger.enableEndOfEventProcessing
and acceptedEventChainDicts):
773 endOfEventRoIMaker = CompFactory.EndOfEventROIConfirmerAlg(
'EndOfEventROIConfirmerAlg')
774 acc.addEventAlgo( endOfEventRoIMaker )
775 acc.addSequence(
parOR(
"acceptedEventTopSeq") )
776 acc.getSequence(
"acceptedEventTopSeq").IgnoreFilterPassed=
True
779 def EndOfEventSeqCfg(flags, prescaleChain, purposes):
781 seqLabel = prescaleChain.replace(
'HLT_acceptedevts',
'')
782 seqName =
'acceptedEventSeq'+seqLabel
783 acc.addSequence(
seqAND(seqName) )
785 endOfEventFilterAlg = CompFactory.EndOfEventFilterAlg(
'EndOfEventFilterAlg'+seqLabel, ChainName=prescaleChain)
786 acc.addEventAlgo(endOfEventFilterAlg, sequenceName=seqName)
788 if 'larnoiseburst' in purposes:
792 endOfEventFilterAlg.StreamFilter = [
'Main',
'VBFDelayed',
'TLA',
'DarkJetPEBTLA',
'FTagPEBTLA',
'CosmicCalo']
794 from TriggerMenuMT.HLT.CalibCosmicMon.CalibChainConfiguration
import getLArNoiseBurstRecoCfg
796 elif any(purpose.startswith(
"met")
for purpose
in purposes):
797 from TriggerMenuMT.HLT.MET.EndOfEvent
import getMETRecoSequences
799 endOfEventFilterAlg.StreamFilter = streams
800 endOfEventRoIMaker.RoIs = [x
for x
in rois
if x
not in endOfEventRoIMaker.RoIs]
801 acc.merge(metcfg, sequenceName=seqName)
806 for acceptedEventChainDict
in acceptedEventChainDicts:
808 prescaleChain = acceptedEventChainDict[
'chainName']
810 purposes = acceptedEventChainDict[
'chainParts'][0][
'purpose']
812 acc.merge(EndOfEventSeqCfg(flags, prescaleChain, purposes), sequenceName=
"acceptedEventTopSeq")
◆ triggerIDCCacheCreatorsCfg()
def python.TriggerConfig.triggerIDCCacheCreatorsCfg |
( |
|
flags, |
|
|
|
seqName = None |
|
) |
| |
Configures IDC cache loading
Returns: CA
Definition at line 735 of file TriggerConfig.py.
737 Configures IDC cache loading
742 if flags.Trigger.doMuon:
743 from MuonConfig.MuonBytestreamDecodeConfig
import MuonCacheCfg
744 acc.merge(
MuonCacheCfg(flags), sequenceName = seqName )
746 from MuonConfig.MuonRdoDecodeConfig
import MuonPrdCacheCfg
749 if flags.Trigger.doID:
750 from TrigInDetConfig.TrigInDetConfig
import InDetIDCCacheCreatorCfg
753 from TrigInDetConfig.TrigInDetConfig
import ActsIDCCacheCreatorCfg
◆ triggerMergeViewsCfg()
def python.TriggerConfig.triggerMergeViewsCfg |
( |
|
flags, |
|
|
|
viewMakers |
|
) |
| |
Configure the view merging algorithm
Definition at line 508 of file TriggerConfig.py.
509 """Configure the view merging algorithm"""
511 from TrigEDMConfig.TriggerEDMDefs
import InViews
512 from TrigEDMConfig.TriggerEDM
import getRawTriggerEDMList
515 mergingTool = CompFactory.HLTEDMCreator(
"ViewsMergingTool")
516 alg = CompFactory.HLTEDMCreatorAlg(
"EDMCreatorAlg",
517 OutputTools = [mergingTool])
521 any(isinstance(v, InViews)
for v
in x[3])]
522 __log.info(
"These collections need merging: %s",
" ".
join([ c[0]
for c
in needMerging ]))
524 for coll
in needMerging:
525 collType, collName = coll[0].
split(
"#")
526 collType = collType.split(
":")[-1]
527 possibleViews = [
str(v)
for v
in coll[3]
if isinstance(v, InViews) ]
528 for viewsColl
in possibleViews:
529 attrView = getattr(mergingTool, collType+
"Views", [])
530 attrInView = getattr(mergingTool, collType+
"InViews", [])
531 attrName = getattr(mergingTool, collType, [])
532 attrView.append( viewsColl )
533 attrInView.append( collName )
534 attrName.append( collName )
536 setattr(mergingTool, collType+
"Views", attrView )
537 setattr(mergingTool, collType+
"InViews", attrInView )
538 setattr(mergingTool, collType, attrName )
539 producer = [ maker
for maker
in viewMakers
if maker.Views == viewsColl ]
540 if len(producer) == 0:
541 __log.warning(
"The producer of %s for %s not in the menu, its outputs won't ever make it out of the HLT", viewsColl, coll)
543 if len(producer) > 1:
544 for pr
in producer[1:]:
545 if pr != producer[0]:
546 __log.error(
"Several View making algorithms produce the same output collection %s: %s", viewsColl,
' '.
join([p.getName()
for p
in producer ]))
549 acc.addEventAlgo(alg)
◆ triggerMonitoringCfg()
def python.TriggerConfig.triggerMonitoringCfg |
( |
|
flags, |
|
|
|
hypos, |
|
|
|
filters, |
|
|
|
hltSeeding |
|
) |
| |
Configures components needed for monitoring chains
Definition at line 229 of file TriggerConfig.py.
231 Configures components needed for monitoring chains
234 TrigSignatureMoni, DecisionCollectorTool=CompFactory.getComps(
"TrigSignatureMoni",
"DecisionCollectorTool",)
236 mon.L1Decisions =
"HLTSeedingSummary"
237 mon.FinalDecisionKey =
"HLTNav_Summary"
239 __log.warning(
"Menu is not configured")
246 assert __stepNumber(stepName) == stepCounter,
"There are steps that have no hypos, decisions counting is not going to work"
248 stepDecisionKeys = []
249 stepFeatureDecisionKeys = []
250 for hypo
in stepHypos:
253 stepDecisionKeys.extend( hypoOutputKeys )
255 stepFeatureDecisionKeys.extend( hypoOutputKeys )
257 dcEventTool =
DecisionCollectorTool(
"EventDecisionCollector" + stepName, Decisions=
list(OrderedDict.fromkeys(stepDecisionKeys)))
258 dcFeatureTool =
DecisionCollectorTool(
"FeatureDecisionCollector" + stepName, Decisions=
list(OrderedDict.fromkeys(stepFeatureDecisionKeys)))
259 __log.debug(
"The step monitoring decisions in %s %s", dcEventTool.getName(), dcEventTool.Decisions)
260 __log.debug(
"The step monitoring decisions in %s %s", dcFeatureTool.getName(), dcFeatureTool.Decisions)
261 mon.DecisionCollectorTools += [ dcEventTool ]
262 mon.FeatureCollectorTools += [ dcFeatureTool ]
265 if flags.Trigger.Online.isPartition:
266 from TrigServices.TrigServicesConfig
import TrigServicesCfg
268 hltEventLoopMgr = onlineServicesAcc.getPrimary()
270 hltEventLoopMgr.TrigErrorMonTool.AlgToChainTool = CompFactory.TrigCompositeUtils.AlgToChainTool()
271 hltEventLoopMgr.TrigErrorMonTool.MonTool.defineHistogram(
272 'ErrorChainName,ErrorCode', path=
'EXPERT', type=
'TH2I',
273 title=
'Error StatusCodes per chain;Chain name;StatusCode',
274 xbins=1, xmin=0, xmax=1, ybins=1, ymin=0, ymax=1)
276 acc.merge(onlineServicesAcc)
278 mon.L1Decisions = hltSeeding.HLTSeedingSummaryKey
280 from DecisionHandling.DecisionHandlingConfig
import setupFilterMonitoring
◆ triggerOutputCfg()
def python.TriggerConfig.triggerOutputCfg |
( |
|
flags, |
|
|
|
hypos |
|
) |
| |
Definition at line 287 of file TriggerConfig.py.
292 onlineWriteBS =
False
293 offlineWriteBS =
False
296 if flags.Trigger.writeBS:
297 if flags.Trigger.Online.isPartition:
300 offlineWriteBS =
True
301 if flags.Output.doWriteRDO
or flags.Output.doWriteESD
or flags.Output.doWriteAOD:
305 if offlineWriteBS
and not flags.Output.doWriteBS:
306 __log.error(
'flags.Trigger.writeBS is True but flags.Output.doWriteBS is False')
308 if writePOOL
and onlineWriteBS:
309 __log.error(
"POOL HLT output writing is configured online")
311 if writePOOL
and offlineWriteBS:
312 __log.error(
"Writing HLT output to both BS and POOL in one job is not supported at the moment")
318 edmSet = flags.Trigger.AODEDMSet
if flags.Output.doWriteAOD
else flags.Trigger.ESDEDMSet
319 elif onlineWriteBS
or offlineWriteBS:
324 __log.info(
"Configuring online ByteStream HLT output")
327 __log.info(
"Configuring offline ByteStream HLT output")
330 __log.info(
"Configuring POOL HLT output")
333 __log.info(
"No HLT output writing is configured")
◆ triggerPOOLOutputCfg()
def python.TriggerConfig.triggerPOOLOutputCfg |
( |
|
flags | ) |
|
Definition at line 451 of file TriggerConfig.py.
455 from TrigEDMConfig.TriggerEDM
import getTriggerEDMList
458 bitsmaker = CompFactory.TriggerBitsMakerTool()
459 decmaker = CompFactory.TrigDec.TrigDecisionMakerMT(
"TrigDecMakerMT", BitsMakerTool = bitsmaker)
460 acc.addEventAlgo( decmaker )
463 from .TriggerRecoConfig
import TriggerMetadataWriterCfg
465 acc.merge( metadataAcc )
468 from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig
import RoIBResultToxAODCfg
470 acc.merge(xRoIBResultAcc)
475 for doit, outputType, edmSet
in [( flags.Output.doWriteRDO,
'RDO', flags.Trigger.ESDEDMSet),
476 ( flags.Output.doWriteESD,
'ESD', flags.Trigger.ESDEDMSet),
477 ( flags.Output.doWriteAOD,
'AOD', flags.Trigger.AODEDMSet)]:
478 if not doit:
continue
484 for edmType, edmKeys
in edmList.items():
485 itemsToRecord.extend([edmType+
'#'+collKey
for collKey
in edmKeys])
488 itemsToRecord.append(
'xAOD::EventInfo#EventInfo')
489 itemsToRecord.append(
'xAOD::EventAuxInfo#EventInfoAux.')
492 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg, outputStreamName
494 disableEventTag=
True, takeItemsFromInput=(outputType ==
'RDO')))
495 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
497 createMetadata=[MetadataCategory.TriggerMenuMetaData]))
502 (
"xAOD::TrigDecision",
str(decmaker.TrigDecisionKey)),
503 (
"xAOD::TrigConfKeys", metadataOutputs)} |
set(xRoIBResultOutputs)
◆ triggerPostRunCfg()
def python.TriggerConfig.triggerPostRunCfg |
( |
|
flags | ) |
|
Configures components needed for processing trigger information in RAW/ESD step
Returns: ca only
Definition at line 816 of file TriggerConfig.py.
818 Configures components needed for processing trigger information in RAW/ESD step
◆ triggerRunCfg()
def python.TriggerConfig.triggerRunCfg |
( |
|
flags, |
|
|
|
menu = None |
|
) |
| |
top of the trigger config (for real triggering online or on MC)
Returns: ca only
Definition at line 618 of file TriggerConfig.py.
620 top of the trigger config (for real triggering online or on MC)
626 from TrigConfigSvc.TrigConfigSvcCfg
import L1ConfigSvcCfg
630 acc.addSequence(
seqOR(
"HLTTop") )
633 if flags.Trigger.CostMonitoring.doCostMonitoring:
634 acc.addSequence(
parOR(
"HLTPreSeq"), parentName=
"HLTTop" )
636 from TrigCostMonitor.TrigCostMonitorConfig
import TrigCostMonitorCfg
640 acc.addSequence(
parOR(
"HLTBeginSeq"), parentName=
"HLTTop" )
644 if flags.Trigger.doCFEmulationTest:
645 from TriggerMenuMT.CFtest.EmuStepProcessingConfig
import emulateHLTSeedingCfg
649 from HLTSeeding.HLTSeedingConfig
import HLTSeedingCfg
652 acc.merge( hltSeedingAcc, sequenceName=
"HLTBeginSeq" )
656 menuAcc =
menu( flags )
657 HLTSteps = menuAcc.getSequence(
"HLTAllSteps" )
658 __log.info(
"Configured menu with %d steps", len(HLTSteps.Members))
659 acc.merge( menuAcc, sequenceName=
"HLTTop")
664 acc.addSequence(
parOR(
"HLTEndSeq"), parentName=
"HLTTop" )
665 acc.addSequence(
seqAND(
"HLTFinalizeSeq"), parentName=
"HLTEndSeq" )
667 nfilters =
sum(len(v)
for v
in filters.values())
668 nhypos =
sum(len(v)
for v
in hypos.values())
669 __log.info(
"Algorithms counting: Number of Filter algorithms: %d - Number of Hypo algoirthms: %d", nfilters , nhypos)
672 acc.merge( summaryAcc, sequenceName=
"HLTFinalizeSeq" )
673 if flags.Trigger.doCFEmulationTest:
674 summaryAlg.Prescaler=CompFactory.PrescalingEmulationTool()
675 acc.addEventAlgo( summaryAlg, sequenceName=
"HLTFinalizeSeq" )
679 hltSeedingAlg = hltSeedingAcc.getEventAlgo(
"HLTSeeding")
682 acc.merge( monitoringAcc, sequenceName=
"HLTEndSeq" )
683 acc.addEventAlgo( monitoringAlg, sequenceName=
"HLTEndSeq" )
693 from TrigEDMConfig.TriggerEDMRun3
import TriggerHLTListRun3, addHLTNavigationToEDMList
694 __log.info(
"Number of EDM items before adding navigation: %d", len(TriggerHLTListRun3))
696 __log.info(
"Number of EDM items after adding navigation: %d", len(TriggerHLTListRun3))
700 if flags.Trigger.ExtraEDMList:
701 from TrigEDMConfig.TriggerEDM
import _addExtraCollectionsToEDMList
702 __log.info(
"Adding extra collections to EDM: %s",
str(flags.Trigger.ExtraEDMList))
707 acc.merge( outputAcc, sequenceName=
"HLTTop" )
710 from TrigCostMonitor.TrigCostMonitorConfig
import TrigCostMonitorFinalizeCfg
713 acc.addEventAlgo(costFinalizeAlg, sequenceName=
"HLTFinalizeSeq" )
721 decObj, decObjHypoOut), sequenceName=
"HLTFinalizeSeq" )
723 if flags.Trigger.doOnlineNavigationCompactification:
724 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import getTrigNavSlimmingMTOnlineConfig
726 acc.addEventAlgo( onlineSlimAlg, sequenceName=
"HLTFinalizeSeq" )
729 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig
import HLTMenuConfig
730 HLTMenuConfig.destroy()
◆ triggerSummaryCfg()
def python.TriggerConfig.triggerSummaryCfg |
( |
|
flags, |
|
|
|
hypos |
|
) |
| |
Configures an algorithm(s) that should be run after the selection process
Returns: ca, algorithm
Definition at line 171 of file TriggerConfig.py.
173 Configures an algorithm(s) that should be run after the selection process
174 Returns: ca, algorithm
177 from TrigOutputHandling.TrigOutputHandlingConfig
import DecisionSummaryMakerAlgCfg
179 chainToLastCollection = OrderedDict()
184 for stepName, stepHypos
in sorted( hypos.items(), key=
lambda x :
__stepNumber(x[0]) ):
191 orderedStepHypos =
sorted(stepHypos, key=
lambda hypo:
not __isCombo(hypo))
193 chainToCollectionInStep = OrderedDict()
194 for hypo
in orderedStepHypos:
196 for chain
in hypoChains:
197 if chain
not in chainToCollectionInStep:
198 chainToCollectionInStep[chain] = hypoOutputKeys
199 chainToLastCollection.update( chainToCollectionInStep )
201 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig
import HLTMenuConfig
202 from HLTSeeding.HLTSeedingConfig
import mapThresholdToL1DecisionCollection
203 if len(HLTMenuConfig.dicts()) == 0:
204 __log.warning(
"No HLT menu, chains w/o algorithms are not handled")
206 for chainName, chainDict
in HLTMenuConfig.dicts().
items():
207 if chainName
not in chainToLastCollection:
208 __log.debug(
"The chain %s is not mentioned in any step", chainName)
210 assert len(chainDict[
'chainParts']) == 1,
"Chains w/o the steps can not have multiple parts in chainDict, it makes no sense: %s"%chainName
213 for c, cont
in chainToLastCollection.items():
214 __log.debug(
"Final decision of chain %s will be read from %d %s", c, len(cont),
str(cont))
216 collectionsWithFinalDecisions = []
217 for chain, collections
in chainToLastCollection.items():
218 for c
in collections:
219 if c
not in collectionsWithFinalDecisions:
220 collectionsWithFinalDecisions.append(c)
221 __log.debug(
"Final keys %s", collectionsWithFinalDecisions)
222 decisionSummaryAlg.FinalDecisionKeys = collectionsWithFinalDecisions
223 decisionSummaryAlg.FinalStepDecisions = dict(chainToLastCollection)
224 decisionSummaryAlg.DecisionsSummaryKey =
"HLTNav_Summary"
225 decisionSummaryAlg.SetFilterStatus = flags.Trigger.writeBS
226 return acc, decisionSummaryAlg
◆ __log
python.TriggerConfig.__log |
|
private |
◆ acc
◆ AtlasVersion
python.TriggerConfig.AtlasVersion |
◆ Files
python.TriggerConfig.Files |
◆ flags
python.TriggerConfig.flags |
◆ forceEnableAllChains
python.TriggerConfig.forceEnableAllChains |
◆ menu
python.TriggerConfig.menu |
def triggerMonitoringCfg(flags, hypos, filters, hltSeeding)
std::string replace(std::string s, const std::string &s2, const std::string &s3)
def getRawTriggerEDMList(flags, runVersion=-1)
def MuonCacheCfg(flags)
This configuration function creates the IdentifiableCaches for RDO.
def triggerSummaryCfg(flags, hypos)
def flatAlgorithmSequences(start)
def TrigCostMonitorFinalizeCfg(flags, seqName="")
Simply calls the result maker tool to create HLTResultMT. The algorithm is meant to be used only offl...
def triggerEndOfEventCfg(flags)
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
def triggerBSOutputCfg(flags, hypos, offline=False)
def collectHLTSummaryDecisionObjects(hltSummary)
def triggerOutputCfg(flags, hypos)
def collectHLTSeedingDecisionObjects(hltSeeding)
def HLTResultMTMakerCfg(flags, name="HLTResultMTMaker")
def collectHypoDecisionObjects(hypos, inputs=True, outputs=True)
def emulateHLTSeedingCfg(flags, seqName=None)
L1 #################################################
def __stepNumber(stepName)
def getRun3BSList(flags, keys)
def triggerEDMGapFillerCfg(flags, edmSet, decObj=[], decObjHypoOut=[], extraInputs=[], extraOutputs=[])
def addHLTNavigationToEDMList(flags, edmList, allDecisions, hypoDecisions)
def getMETRecoSequences(flags, List[str] purposes)
def ByteStreamReadCfg(flags, type_names=None)
def RoIBResultToxAODCfg(flags)
def triggerMergeViewsCfg(flags, viewMakers)
def triggerPostRunCfg(flags)
def getTriggerEDMList(flags, key, runVersion=-1)
def collectFilterDecisionObjects(filters, inputs=True, outputs=True)
def __decisionsFromHypo(hypo)
def seqAND(name, subs=[])
def ByteStreamWriteCfg(flags, type_names=None)
def _addExtraCollectionsToEDMList(edmList, extraList)
def setupFilterMonitoring(flags, filterAlg)
def TriggerMetadataWriterCfg(flags)
def L1TriggerByteStreamEncoderCfg(flags)
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
def triggerRunCfg(flags, menu=None)
def ActsIDCCacheCreatorCfg(flags)
def collectDecisionObjects(hypos, filters, hltSeeding, hltSummary)
std::string join(const std::vector< std::string > &v, const char c=',')
def TriggerEDMSerialiserToolCfg(flags, name="Serialiser")
def getLArNoiseBurstRecoCfg(flags)
def TrigServicesCfg(flags)
def StreamTagMakerToolCfg(name="StreamTagMakerTool")
def collectViewMakers(steps)
def getTrigNavSlimmingMTOnlineConfig(flags)
def L1PrescaleCondAlgCfg(flags)
def L1ConfigSvcCfg(flags)
def triggerPOOLOutputCfg(flags)
def collectFilters(steps)
def TriggerBitsMakerToolCfg(name="TriggerBitsMakerTool")
def TrigCostMonitorCfg(flags, seqName="")
def mapThresholdToL1DecisionCollection(threshold)
def getSequenceChildren(comp)
def InDetIDCCacheCreatorCfg(flags)
def HLTSeedingCfg(flags, seqName=None)
def DecisionSummaryMakerAlgCfg(flags, name="DecisionSummaryMakerAlg")
def triggerIDCCacheCreatorsCfg(flags, seqName=None)
def MuonPrdCacheCfg(flags)
This configuration function creates the IdentifiableCaches for PRD.