|
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 56 of file TriggerConfig.py.
57 """ return all chains served by this hypo and the keys of produced decision object """
58 from TrigCompositeUtils.TrigCompositeUtils
import isLegId
59 __log.debug(
"Hypo type %s is combo %r", hypo.getName(),
__isCombo(hypo))
61 return [key
for key
in list(hypo.MultiplicitiesMap.keys())
if not isLegId(key)], hypo.HypoOutputDecisions
63 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 14 of file TriggerConfig.py.
15 return hasattr( alg,
"MultiplicitiesMap" )
◆ __stepNumber()
def python.TriggerConfig.__stepNumber |
( |
|
stepName | ) |
|
|
private |
extract step number frmo strings like Step2... -> 2
Definition at line 17 of file TriggerConfig.py.
18 """extract step number frmo strings like Step2... -> 2"""
19 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 148 of file TriggerConfig.py.
150 Returns the set of all decision objects of HLT
159 decisionObjects =
set()
160 decisionObjects.update(decObjL1)
161 decisionObjects.update(decObjHypo)
162 decisionObjects.update(decObjFilter)
163 decisionObjects.update(decObjSummary)
◆ collectFilterDecisionObjects()
def python.TriggerConfig.collectFilterDecisionObjects |
( |
|
filters, |
|
|
|
inputs = True , |
|
|
|
outputs = True |
|
) |
| |
Definition at line 131 of file TriggerConfig.py.
132 decisionObjects =
set()
133 for step, stepFilters
in filters.items():
134 for filt
in stepFilters:
135 if inputs
and hasattr( filt,
"Input" ):
136 decisionObjects.update(
str(i)
for i
in filt.Input )
137 if outputs
and hasattr( filt,
"Output" ):
138 decisionObjects.update(
str(o)
for o
in filt.Output )
139 __log.info(
"Collecting %i decision objects from filters", len(decisionObjects))
140 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 84 of file TriggerConfig.py.
86 Similarly to collectHypos but works for filter algorithms
88 The logic is simpler as all filters are grouped in step filter sequences
89 Returns map: step name -> list of all filters of that step
91 __log.info(
"Collecting filters")
92 filters = defaultdict( list )
94 for stepSeq
in steps.Members:
95 if "filter" in stepSeq.getName():
96 filters[stepSeq.getName()] = stepSeq.Members
97 __log.debug(
"Found Filters in Step %s : %s", stepSeq.getName(), stepSeq.Members)
◆ collectHLTSeedingDecisionObjects()
def python.TriggerConfig.collectHLTSeedingDecisionObjects |
( |
|
hltSeeding | ) |
|
Definition at line 102 of file TriggerConfig.py.
103 decisionObjects =
set()
104 decisionObjects.update([
str(d.Decisions)
for d
in hltSeeding.RoIBRoIUnpackers + hltSeeding.xAODRoIUnpackers ])
105 decisionObjects.update([
str(d.DecisionsProbe)
for d
in hltSeeding.RoIBRoIUnpackers + hltSeeding.xAODRoIUnpackers ])
106 from HLTSeeding.HLTSeedingConfig
import mapThresholdToL1DecisionCollection
108 decisionObjects.discard(
'')
109 __log.info(
"Collecting %i decision objects from HLTSeeding instance", len(decisionObjects))
110 return decisionObjects
◆ collectHLTSummaryDecisionObjects()
def python.TriggerConfig.collectHLTSummaryDecisionObjects |
( |
|
hltSummary | ) |
|
Definition at line 142 of file TriggerConfig.py.
143 decisionObjects =
set()
144 decisionObjects.add(
str(hltSummary.DecisionsSummaryKey) )
145 __log.info(
"Collecting %i decision objects from hltSummary", len(decisionObjects))
146 return decisionObjects
◆ collectHypoDecisionObjects()
def python.TriggerConfig.collectHypoDecisionObjects |
( |
|
hypos, |
|
|
|
inputs = True , |
|
|
|
outputs = True |
|
) |
| |
Definition at line 112 of file TriggerConfig.py.
113 decisionObjects =
set()
114 for step, stepHypos
in sorted(hypos.items()):
115 for hypoAlg
in stepHypos:
116 __log.debug(
"Hypo %s with input %s and output %s ",
117 hypoAlg.getName(), hypoAlg.HypoInputDecisions, hypoAlg.HypoOutputDecisions )
118 if isinstance( hypoAlg.HypoInputDecisions, list):
120 [ decisionObjects.add(
str(d) )
for d
in hypoAlg.HypoInputDecisions ]
122 [ decisionObjects.add(
str(d) )
for d
in hypoAlg.HypoOutputDecisions ]
125 decisionObjects.add(
str(hypoAlg.HypoInputDecisions) )
127 decisionObjects.add(
str(hypoAlg.HypoOutputDecisions) )
128 __log.info(
"Collecting %i decision objects from hypos", len(decisionObjects))
129 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 22 of file TriggerConfig.py.
24 Method iterating over the CF and picking all the Hypothesis algorithms
26 Returned is a map with the step name and list of all instances of hypos in that step.
27 Input is top HLT sequencer.
29 __log.info(
"Collecting hypos from steps")
30 hypos = defaultdict( list )
32 for stepSeq
in steps.Members:
36 if "filter" in stepSeq.getName():
37 __log.debug(
"Skipping filtering steps %s", stepSeq.getName() )
40 __log.debug(
"collecting hypos from step %s", stepSeq.getName() )
42 for alg
in sorted(algs, key=
lambda t:
str(t.getName())):
46 if hasattr(alg,
'HypoInputDecisions'):
47 __log.debug(
"found hypo %s in %s", alg.getName(), stepSeq.getName())
48 if __isCombo( alg )
and len(alg.ComboHypoTools):
49 __log.debug(
" with %d comboHypoTools: %s", len(alg.ComboHypoTools),
' '.
join(map(str, [tool.getName()
for tool
in alg.ComboHypoTools])))
50 hypos[stepSeq.getName()].
append( alg )
52 __log.verbose(
"Not a hypo %s", alg.getName())
54 return OrderedDict(hypos)
◆ collectViewMakers()
def python.TriggerConfig.collectViewMakers |
( |
|
steps | ) |
|
collect all view maker algorithms in the configuration
Definition at line 66 of file TriggerConfig.py.
67 """ collect all view maker algorithms in the configuration """
74 for seq,algs
in algsInSeq.items():
76 if "EventViewCreator" in alg.getFullJobOptName():
79 __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 334 of file TriggerConfig.py.
336 Returns CA with algorithms and/or tools required to do the serialisation
338 decObj - list of all navigation objects
339 decObjHypoOut - list of decisions produced by hypos
340 hypos - the {stepName: hypoList} dictionary with all hypo algorithms - used to find the PEB decision keys
341 offline - if true CA contains algorithms that need to be merged to output stream sequence,
342 if false the CA contains a tool that needs to be added to HltEventLoopMgr
344 from TrigEDMConfig
import DataScoutingInfo
345 from TrigEDMConfig.TriggerEDM
import getRun3BSList
346 from TrigEDMConfig.TriggerEDMDefs
import allowTruncation
347 from TrigOutputHandling.TrigOutputHandlingConfig
import TriggerEDMSerialiserToolCfg, StreamTagMakerToolCfg, TriggerBitsMakerToolCfg
350 collectionsToBS =
getRun3BSList([
"BS"] + DataScoutingInfo.getAllDataScoutingIdentifiers())
355 for typekey, bsfragments, props
in collectionsToBS:
357 moduleIDs =
sorted(DataScoutingInfo.getFullHLTResultID()
if f ==
'BS' else
358 DataScoutingInfo.getDataScoutingResultID(f)
359 for f
in bsfragments)
361 __log.debug(
'adding to serialiser list: %s, modules: %s', typekey, moduleIDs)
362 serialiser.addCollection(typekey, moduleIDs, allowTruncation = allowTruncation
in props)
370 for hypoList
in hypos.values():
371 for hypo
in hypoList:
372 if hypo.getFullJobOptName().startswith(
'PEBInfoWriterAlg/'):
373 PEBKeys.append(
str(hypo.HypoOutputDecisions))
376 __log.debug(
'Setting StreamTagMakerTool.PEBDecisionKeys = %s', PEBKeys)
377 stmaker.PEBDecisionKeys = PEBKeys
383 from TrigOutputHandling.TrigOutputHandlingConfig
import HLTResultMTMakerCfg
384 HLTResultMTMakerAlg=CompFactory.HLTResultMTMakerAlg
386 hltResultMakerTool.StreamTagMaker = stmaker
387 hltResultMakerTool.MakerTools = [bitsmaker, serialiser]
389 hltResultMakerAlg.ResultMaker = hltResultMakerTool
392 if flags.Input.Format
is Format.BS:
393 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
395 readBSAcc.getEventAlgo(
'SGInputLoader').Load.add(
396 (
'ByteStreamMetadataContainer',
'InputMetaDataStore+ByteStreamMetadata'))
400 hltResultMakerAlg.ResultMaker.ExtraROBs = []
401 hltResultMakerAlg.ResultMaker.ExtraSubDets = []
404 decmaker = CompFactory.getComp(
"TrigDec::TrigDecisionMakerMT")(
"TrigDecMakerMT")
408 from TrigConfigSvc.TrigConfigSvcCfg
import L1PrescaleCondAlgCfg
412 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamWriteCfg
413 writingOutputs = [
"HLT::HLTResultMT#HLTResultMT"]
414 writingInputs = [(
"HLT::HLTResultMT",
"HLTResultMT"),
415 (
"xAOD::TrigDecision",
"xTrigDecision")]
418 if flags.Trigger.doLVL1:
419 if flags.Trigger.enableL1MuonPhase1
or flags.Trigger.enableL1CaloPhase1:
420 writingOutputs += [
'xAOD::TrigCompositeContainer#L1TriggerResult']
421 writingInputs += [(
'xAOD::TrigCompositeContainer',
'StoreGateSvc+L1TriggerResult')]
422 if flags.Trigger.enableL1CaloLegacy
or not flags.Trigger.enableL1MuonPhase1:
423 writingOutputs += [
'ROIB::RoIBResult#RoIBResult']
424 writingInputs += [(
'ROIB::RoIBResult',
'StoreGateSvc+RoIBResult')]
426 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig
import L1TriggerByteStreamEncoderCfg
429 writingAcc =
ByteStreamWriteCfg(flags, type_names=writingOutputs, extra_inputs=writingInputs)
430 writingAcc.addEventAlgo(hltResultMakerAlg)
431 writingAcc.addEventAlgo(decmaker)
432 acc.merge(writingAcc)
435 from TrigServices.TrigServicesConfig
import TrigServicesCfg
437 hltEventLoopMgr = onlineServicesAcc.getPrimary()
438 hltEventLoopMgr.ResultMaker.StreamTagMaker = stmaker
439 hltEventLoopMgr.ResultMaker.MakerTools = [serialiser, bitsmaker]
440 onlineServicesAcc.getEventAlgo(
'SGInputLoader').Load.add(
441 (
'ByteStreamMetadataContainer',
'InputMetaDataStore+ByteStreamMetadata'))
442 acc.merge(onlineServicesAcc)
◆ triggerEDMGapFillerCfg()
def python.TriggerConfig.triggerEDMGapFillerCfg |
( |
|
flags, |
|
|
|
edmSet, |
|
|
|
decObj = [] , |
|
|
|
decObjHypoOut = [] , |
|
|
|
extraInputs = [] , |
|
|
|
extraOutputs = [] |
|
) |
| |
Configure the EDM gap filler
Definition at line 547 of file TriggerConfig.py.
547 def triggerEDMGapFillerCfg( flags, edmSet, decObj=[], decObjHypoOut=[], extraInputs=[], extraOutputs=[] ):
548 """Configure the EDM gap filler"""
550 from TrigEDMConfig.TriggerEDMRun3
import TriggerHLTListRun3, Alias
556 ".*AuxContainer#.*",
".*AuxInfo#.*",
558 if flags.Trigger.doHLT:
560 ignore += [
"xAOD::TrigCompositeContainer#HLTNav_Summary_OnlineSlimmed",
561 "xAOD::TrigCompositeContainer#HLT_RuntimeMetadata"]
564 tool = CompFactory.HLTEDMCreator(f
"GapFiller{'' if edmSet==['BS'] else '_'+'_'.join(edmSet)}")
565 alg = CompFactory.HLTEDMCreatorAlg(
"EDMCreatorAlg",
566 OutputTools = [tool])
567 alg.ExtraInputs =
set(extraInputs)
568 alg.ExtraOutputs =
set(extraOutputs)
571 groupedByType = defaultdict( list )
572 re_ignore = [re.compile(x)
for x
in ignore]
575 for el
in TriggerHLTListRun3:
576 if not any([ outputType
in el[1].
split()
for outputType
in edmSet ]):
578 if any(ign.fullmatch(el[0])
for ign
in re_ignore):
580 collType, collName = el[0].
split(
"#")
582 aliases = [
str(a)
for a
in el[3]
if isinstance(a, Alias) ]
583 if len(aliases) == 1:
584 __log.debug(
"GapFiller configuration found an aliased type '%s' for '%s'", aliases[0], collType)
585 collType = aliases[0]
586 elif len(aliases) > 1:
587 __log.error(
"GapFiller configuration found inconsistent '%s' (too many aliases?)", aliases)
589 groupedByType[collType].
append( collName )
591 for collType, collNameList
in groupedByType.items():
592 propName = collType.split(
":")[-1]
593 if hasattr( tool, propName ):
594 setattr( tool, propName, collNameList )
595 __log.debug(
"GapFiller will create EDM collection type '%s' for '%s'", collType, collNameList)
597 __log.debug(
"EDM collections of type %s are not going to be added to StoreGate, if not created by the HLT", collType )
599 if decObj
or decObjHypoOut:
600 __log.debug(
"GapFiller is ensuring the creation of all the decision object collections")
601 __log.debug(
"'%s'", decObj)
603 tool.FixLinks =
list(decObjHypoOut)
605 tool.TrigCompositeContainer +=
list(decObj)
607 acc.addEventAlgo(alg, primary=
True)
◆ triggerEndOfEventCfg()
def python.TriggerConfig.triggerEndOfEventCfg |
( |
|
flags | ) |
|
Definition at line 753 of file TriggerConfig.py.
754 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig
import HLTMenuConfig
756 acceptedEventChainDicts = [cd
for cd
in HLTMenuConfig.dictsList() \
757 if 'Calib' in cd[
'signatures'] \
758 and 'acceptedevts' in cd[
'chainParts'][0][
'purpose']]
763 if not (flags.Trigger.enableEndOfEventProcessing
and acceptedEventChainDicts):
767 endOfEventRoIMaker = CompFactory.EndOfEventROIConfirmerAlg(
'EndOfEventROIConfirmerAlg')
768 acc.addEventAlgo( endOfEventRoIMaker )
769 acc.addSequence(
parOR(
"acceptedEventTopSeq") )
770 acc.getSequence(
"acceptedEventTopSeq").IgnoreFilterPassed=
True
773 def EndOfEventSeqCfg(flags, prescaleChain, purposes):
775 seqLabel = prescaleChain.replace(
'HLT_acceptedevts',
'')
776 seqName =
'acceptedEventSeq'+seqLabel
777 acc.addSequence(
seqAND(seqName) )
779 endOfEventFilterAlg = CompFactory.EndOfEventFilterAlg(
'EndOfEventFilterAlg'+seqLabel, ChainName=prescaleChain)
780 acc.addEventAlgo(endOfEventFilterAlg, sequenceName=seqName)
782 if 'larnoiseburst' in purposes:
786 endOfEventFilterAlg.StreamFilter = [
'Main',
'VBFDelayed',
'TLA',
'DarkJetPEBTLA',
'FTagPEBTLA',
'CosmicCalo']
788 from TriggerMenuMT.HLT.CalibCosmicMon.CalibChainConfiguration
import getLArNoiseBurstRecoCfg
790 elif any(purpose.startswith(
"met")
for purpose
in purposes):
791 from TriggerMenuMT.HLT.MET.EndOfEvent
import getMETRecoSequences
793 endOfEventFilterAlg.StreamFilter = streams
794 endOfEventRoIMaker.RoIs = [x
for x
in rois
if x
not in endOfEventRoIMaker.RoIs]
795 acc.merge(metcfg, sequenceName=seqName)
800 for acceptedEventChainDict
in acceptedEventChainDicts:
802 prescaleChain = acceptedEventChainDict[
'chainName']
804 purposes = acceptedEventChainDict[
'chainParts'][0][
'purpose']
806 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 729 of file TriggerConfig.py.
731 Configures IDC cache loading
736 if flags.Trigger.doMuon:
737 from MuonConfig.MuonBytestreamDecodeConfig
import MuonCacheCfg
738 acc.merge(
MuonCacheCfg(flags), sequenceName = seqName )
740 from MuonConfig.MuonRdoDecodeConfig
import MuonPrdCacheCfg
743 if flags.Trigger.doID:
744 from TrigInDetConfig.TrigInDetConfig
import InDetIDCCacheCreatorCfg
747 from TrigInDetConfig.TrigInDetConfig
import ActsIDCCacheCreatorCfg
◆ triggerMergeViewsCfg()
def python.TriggerConfig.triggerMergeViewsCfg |
( |
|
flags, |
|
|
|
viewMakers |
|
) |
| |
Configure the view merging algorithm
Definition at line 503 of file TriggerConfig.py.
504 """Configure the view merging algorithm"""
506 from TrigEDMConfig.TriggerEDMRun3
import TriggerHLTListRun3, InViews
509 mergingTool = CompFactory.HLTEDMCreator(
"ViewsMergingTool")
510 alg = CompFactory.HLTEDMCreatorAlg(
"EDMCreatorAlg",
511 OutputTools = [mergingTool])
514 needMerging = [x
for x
in TriggerHLTListRun3
if len(x) >= 4
and
515 any(isinstance(v, InViews)
for v
in x[3])]
516 __log.info(
"These collections need merging: %s",
" ".
join([ c[0]
for c
in needMerging ]))
518 for coll
in needMerging:
519 collType, collName = coll[0].
split(
"#")
520 collType = collType.split(
":")[-1]
521 possibleViews = [
str(v)
for v
in coll[3]
if isinstance(v, InViews) ]
522 for viewsColl
in possibleViews:
523 attrView = getattr(mergingTool, collType+
"Views", [])
524 attrInView = getattr(mergingTool, collType+
"InViews", [])
525 attrName = getattr(mergingTool, collType, [])
526 attrView.append( viewsColl )
527 attrInView.append( collName )
528 attrName.append( collName )
530 setattr(mergingTool, collType+
"Views", attrView )
531 setattr(mergingTool, collType+
"InViews", attrInView )
532 setattr(mergingTool, collType, attrName )
533 producer = [ maker
for maker
in viewMakers
if maker.Views == viewsColl ]
534 if len(producer) == 0:
535 __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)
537 if len(producer) > 1:
538 for pr
in producer[1:]:
539 if pr != producer[0]:
540 __log.error(
"Several View making algorithms produce the same output collection %s: %s", viewsColl,
' '.
join([p.getName()
for p
in producer ]))
543 acc.addEventAlgo(alg)
◆ triggerMonitoringCfg()
def python.TriggerConfig.triggerMonitoringCfg |
( |
|
flags, |
|
|
|
hypos, |
|
|
|
filters, |
|
|
|
hltSeeding |
|
) |
| |
Configures components needed for monitoring chains
Definition at line 224 of file TriggerConfig.py.
226 Configures components needed for monitoring chains
229 TrigSignatureMoni, DecisionCollectorTool=CompFactory.getComps(
"TrigSignatureMoni",
"DecisionCollectorTool",)
231 mon.L1Decisions =
"HLTSeedingSummary"
232 mon.FinalDecisionKey =
"HLTNav_Summary"
234 __log.warning(
"Menu is not configured")
241 assert __stepNumber(stepName) == stepCounter,
"There are steps that have no hypos, decisions counting is not going to work"
243 stepDecisionKeys = []
244 stepFeatureDecisionKeys = []
245 for hypo
in stepHypos:
248 stepDecisionKeys.extend( hypoOutputKeys )
250 stepFeatureDecisionKeys.extend( hypoOutputKeys )
252 dcEventTool =
DecisionCollectorTool(
"EventDecisionCollector" + stepName, Decisions=
list(OrderedDict.fromkeys(stepDecisionKeys)))
253 dcFeatureTool =
DecisionCollectorTool(
"FeatureDecisionCollector" + stepName, Decisions=
list(OrderedDict.fromkeys(stepFeatureDecisionKeys)))
254 __log.debug(
"The step monitoring decisions in %s %s", dcEventTool.getName(), dcEventTool.Decisions)
255 __log.debug(
"The step monitoring decisions in %s %s", dcFeatureTool.getName(), dcFeatureTool.Decisions)
256 mon.DecisionCollectorTools += [ dcEventTool ]
257 mon.FeatureCollectorTools += [ dcFeatureTool ]
260 if flags.Trigger.Online.isPartition:
261 from TrigServices.TrigServicesConfig
import TrigServicesCfg
263 hltEventLoopMgr = onlineServicesAcc.getPrimary()
265 hltEventLoopMgr.TrigErrorMonTool.AlgToChainTool = CompFactory.TrigCompositeUtils.AlgToChainTool()
266 hltEventLoopMgr.TrigErrorMonTool.MonTool.defineHistogram(
267 'ErrorChainName,ErrorCode', path=
'EXPERT', type=
'TH2I',
268 title=
'Error StatusCodes per chain;Chain name;StatusCode',
269 xbins=1, xmin=0, xmax=1, ybins=1, ymin=0, ymax=1)
271 acc.merge(onlineServicesAcc)
273 mon.L1Decisions = hltSeeding.HLTSeedingSummaryKey
275 from DecisionHandling.DecisionHandlingConfig
import setupFilterMonitoring
◆ triggerOutputCfg()
def python.TriggerConfig.triggerOutputCfg |
( |
|
flags, |
|
|
|
hypos |
|
) |
| |
Definition at line 282 of file TriggerConfig.py.
287 onlineWriteBS =
False
288 offlineWriteBS =
False
291 if flags.Trigger.writeBS:
292 if flags.Trigger.Online.isPartition:
295 offlineWriteBS =
True
296 if flags.Output.doWriteRDO
or flags.Output.doWriteESD
or flags.Output.doWriteAOD:
300 if offlineWriteBS
and not flags.Output.doWriteBS:
301 __log.error(
'flags.Trigger.writeBS is True but flags.Output.doWriteBS is False')
303 if writePOOL
and onlineWriteBS:
304 __log.error(
"POOL HLT output writing is configured online")
306 if writePOOL
and offlineWriteBS:
307 __log.error(
"Writing HLT output to both BS and POOL in one job is not supported at the moment")
313 edmSet = flags.Trigger.AODEDMSet
if flags.Output.doWriteAOD
else flags.Trigger.ESDEDMSet
314 elif onlineWriteBS
or offlineWriteBS:
319 __log.info(
"Configuring online ByteStream HLT output")
322 __log.info(
"Configuring offline ByteStream HLT output")
325 __log.info(
"Configuring POOL HLT output")
328 __log.info(
"No HLT output writing is configured")
◆ triggerPOOLOutputCfg()
def python.TriggerConfig.triggerPOOLOutputCfg |
( |
|
flags | ) |
|
Definition at line 446 of file TriggerConfig.py.
450 from TrigEDMConfig.TriggerEDM
import getTriggerEDMList
453 bitsmaker = CompFactory.TriggerBitsMakerTool()
454 decmaker = CompFactory.TrigDec.TrigDecisionMakerMT(
"TrigDecMakerMT", BitsMakerTool = bitsmaker)
455 acc.addEventAlgo( decmaker )
458 from .TriggerRecoConfig
import TriggerMetadataWriterCfg
460 acc.merge( metadataAcc )
463 from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig
import RoIBResultToxAODCfg
465 acc.merge(xRoIBResultAcc)
470 for doit, outputType, edmSet
in [( flags.Output.doWriteRDO,
'RDO', flags.Trigger.ESDEDMSet),
471 ( flags.Output.doWriteESD,
'ESD', flags.Trigger.ESDEDMSet),
472 ( flags.Output.doWriteAOD,
'AOD', flags.Trigger.AODEDMSet)]:
473 if not doit:
continue
475 edmList =
getTriggerEDMList(edmSet, flags.Trigger.EDMVersion, flags.Trigger.ExtraEDMList)
479 for edmType, edmKeys
in edmList.items():
480 itemsToRecord.extend([edmType+
'#'+collKey
for collKey
in edmKeys])
483 itemsToRecord.append(
'xAOD::EventInfo#EventInfo')
484 itemsToRecord.append(
'xAOD::EventAuxInfo#EventInfoAux.')
487 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg, outputStreamName
489 disableEventTag=
True, takeItemsFromInput=(outputType ==
'RDO')))
490 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
492 createMetadata=[MetadataCategory.TriggerMenuMetaData]))
497 (
"xAOD::TrigDecision",
str(decmaker.TrigDecisionKey)),
498 (
"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 810 of file TriggerConfig.py.
812 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 611 of file TriggerConfig.py.
613 top of the trigger config (for real triggering online or on MC)
619 from TrigConfigSvc.TrigConfigSvcCfg
import L1ConfigSvcCfg
623 acc.addSequence(
seqOR(
"HLTTop") )
626 if flags.Trigger.CostMonitoring.doCostMonitoring:
627 acc.addSequence(
parOR(
"HLTPreSeq"), parentName=
"HLTTop" )
629 from TrigCostMonitor.TrigCostMonitorConfig
import TrigCostMonitorCfg
633 acc.addSequence(
parOR(
"HLTBeginSeq"), parentName=
"HLTTop" )
637 if flags.Trigger.doCFEmulationTest:
638 from TriggerMenuMT.CFtest.EmuStepProcessingConfig
import emulateHLTSeedingCfg
642 from HLTSeeding.HLTSeedingConfig
import HLTSeedingCfg
645 acc.merge( hltSeedingAcc, sequenceName=
"HLTBeginSeq" )
649 menuAcc =
menu( flags )
650 HLTSteps = menuAcc.getSequence(
"HLTAllSteps" )
651 __log.info(
"Configured menu with %d steps", len(HLTSteps.Members))
652 acc.merge( menuAcc, sequenceName=
"HLTTop")
657 acc.addSequence(
parOR(
"HLTEndSeq"), parentName=
"HLTTop" )
658 acc.addSequence(
seqAND(
"HLTFinalizeSeq"), parentName=
"HLTEndSeq" )
660 nfilters =
sum(len(v)
for v
in filters.values())
661 nhypos =
sum(len(v)
for v
in hypos.values())
662 __log.info(
"Algorithms counting: Number of Filter algorithms: %d - Number of Hypo algoirthms: %d", nfilters , nhypos)
665 acc.merge( summaryAcc, sequenceName=
"HLTFinalizeSeq" )
666 if flags.Trigger.doCFEmulationTest:
667 summaryAlg.Prescaler=CompFactory.PrescalingEmulationTool()
668 acc.addEventAlgo( summaryAlg, sequenceName=
"HLTFinalizeSeq" )
672 hltSeedingAlg = hltSeedingAcc.getEventAlgo(
"HLTSeeding")
675 acc.merge( monitoringAcc, sequenceName=
"HLTEndSeq" )
676 acc.addEventAlgo( monitoringAlg, sequenceName=
"HLTEndSeq" )
680 __log.info(
"Number of decision objects found in HLT CF %d of which %d are the outputs of hypos",
681 len(decObj), len(decObjHypoOut) )
682 __log.debug( decObj )
688 from TrigEDMConfig.TriggerEDMRun3
import TriggerHLTListRun3, addHLTNavigationToEDMList
689 __log.info(
"Number of EDM items before adding navigation: %d", len(TriggerHLTListRun3))
691 __log.info(
"Number of EDM items after adding navigation: %d", len(TriggerHLTListRun3))
694 if flags.Trigger.ExtraEDMList:
695 from TrigEDMConfig.TriggerEDMRun3
import addExtraCollectionsToEDMList
696 __log.info(
"Adding extra collections to EDM: %s",
str(flags.Trigger.ExtraEDMList))
701 acc.merge( outputAcc, sequenceName=
"HLTTop" )
704 from TrigCostMonitor.TrigCostMonitorConfig
import TrigCostMonitorFinalizeCfg
707 acc.addEventAlgo(costFinalizeAlg, sequenceName=
"HLTFinalizeSeq" )
715 decObj, decObjHypoOut), sequenceName=
"HLTFinalizeSeq" )
717 if flags.Trigger.doOnlineNavigationCompactification:
718 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import getTrigNavSlimmingMTOnlineConfig
720 acc.addEventAlgo( onlineSlimAlg, sequenceName=
"HLTFinalizeSeq" )
723 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig
import HLTMenuConfig
724 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 166 of file TriggerConfig.py.
168 Configures an algorithm(s) that should be run after the selection process
169 Returns: ca, algorithm
172 from TrigOutputHandling.TrigOutputHandlingConfig
import DecisionSummaryMakerAlgCfg
174 chainToLastCollection = OrderedDict()
179 for stepName, stepHypos
in sorted( hypos.items(), key=
lambda x :
__stepNumber(x[0]) ):
186 orderedStepHypos =
sorted(stepHypos, key=
lambda hypo:
not __isCombo(hypo))
188 chainToCollectionInStep = OrderedDict()
189 for hypo
in orderedStepHypos:
191 for chain
in hypoChains:
192 if chain
not in chainToCollectionInStep:
193 chainToCollectionInStep[chain] = hypoOutputKeys
194 chainToLastCollection.update( chainToCollectionInStep )
196 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig
import HLTMenuConfig
197 from HLTSeeding.HLTSeedingConfig
import mapThresholdToL1DecisionCollection
198 if len(HLTMenuConfig.dicts()) == 0:
199 __log.warning(
"No HLT menu, chains w/o algorithms are not handled")
201 for chainName, chainDict
in HLTMenuConfig.dicts().
items():
202 if chainName
not in chainToLastCollection:
203 __log.debug(
"The chain %s is not mentioned in any step", chainName)
205 assert len(chainDict[
'chainParts']) == 1,
"Chains w/o the steps can not have multiple parts in chainDict, it makes no sense: %s"%chainName
208 for c, cont
in chainToLastCollection.items():
209 __log.debug(
"Final decision of chain %s will be read from %d %s", c, len(cont),
str(cont))
211 collectionsWithFinalDecisions = []
212 for chain, collections
in chainToLastCollection.items():
213 for c
in collections:
214 if c
not in collectionsWithFinalDecisions:
215 collectionsWithFinalDecisions.append(c)
216 __log.debug(
"Final keys %s", collectionsWithFinalDecisions)
217 decisionSummaryAlg.FinalDecisionKeys = collectionsWithFinalDecisions
218 decisionSummaryAlg.FinalStepDecisions = dict(chainToLastCollection)
219 decisionSummaryAlg.DecisionsSummaryKey =
"HLTNav_Summary"
220 decisionSummaryAlg.SetFilterStatus = flags.Trigger.writeBS
221 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 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 triggerEDMGapFillerCfg(flags, edmSet, decObj=[], decObjHypoOut=[], extraInputs=[], extraOutputs=[])
def addHLTNavigationToEDMList(flags, edmList, allDecisions, hypoDecisions)
def getMETRecoSequences(flags, List[str] purposes)
def addExtraCollectionsToEDMList(edmList, extraList)
def ByteStreamReadCfg(flags, type_names=None)
def RoIBResultToxAODCfg(flags)
def triggerMergeViewsCfg(flags, viewMakers)
def triggerPostRunCfg(flags)
def collectFilterDecisionObjects(filters, inputs=True, outputs=True)
def __decisionsFromHypo(hypo)
def seqAND(name, subs=[])
def ByteStreamWriteCfg(flags, type_names=None)
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)
def getTriggerEDMList(key, runVersion, extraEDMList=[])
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.