ATLAS Offline Software
Loading...
Searching...
No Matches
python.TriggerConfig Namespace Reference

Functions

 __isCombo (alg)
 __stepNumber (stepName)
 collectHypos (steps)
 __decisionsFromHypo (hypo)
 collectViewMakers (steps)
 collectFilters (steps)
 collectHLTSeedingDecisionObjects (hltSeeding)
 collectHypoDecisionObjects (hypos, inputs=True, outputs=True)
 collectFilterDecisionObjects (filters, inputs=True, outputs=True)
 collectHLTSummaryDecisionObjects (hltSummary)
 collectDecisionObjects (hypos, filters, hltSeeding, hltSummary)
 triggerSummaryCfg (flags, hypos)
 triggerMonitoringCfg (flags, hypos, filters, hltSeeding)
 triggerOutputCfg (flags, hypos)
 triggerBSOutputCfg (flags, hypos, offline=False)
 triggerPOOLOutputCfg (flags)
 triggerMergeViewsCfg (flags, viewMakers)
 triggerEDMGapFillerCfg (flags, edmSet, decObj=[], decObjHypoOut=[], extraInputs=[], extraOutputs=[])
 triggerRunCfg (flags, menu=None)
 triggerIDCCacheCreatorsCfg (flags, seqName=None)
 triggerEndOfEventCfg (flags)
 triggerPostRunCfg (flags)
 testMenu (flags)

Variables

 __log = logging.getLogger('TriggerConfig')
 flags = initConfigFlags()
 forceEnableAllChains
 Files
 AtlasVersion
 acc = triggerRunCfg( flags, menu = testMenu )
 f = open("TriggerRunConf.pkl","wb")

Function Documentation

◆ __decisionsFromHypo()

__decisionsFromHypo ( hypo)
private
return all chains served by this hypo and the keys of produced decision object 

Definition at line 58 of file TriggerConfig.py.

58def __decisionsFromHypo( hypo ):
59 """ return all chains served by this hypo and the keys of produced decision object """
60 from TrigCompositeUtils.TrigCompositeUtils import isLegId
61 __log.debug("Hypo type %s is combo %r", hypo.getName(), __isCombo(hypo))
62 if __isCombo(hypo):
63 return [key for key in list(hypo.MultiplicitiesMap.keys()) if not isLegId(key)], hypo.HypoOutputDecisions
64 else: # regular hypos
65 return [ t.getName() for t in hypo.HypoTools if not isLegId(t.getName())], [str(hypo.HypoOutputDecisions)]
66
67
bool isLegId(const HLT::Identifier &legIdentifier)
Recognise whether the chain ID is a leg ID.

◆ __isCombo()

__isCombo ( alg)
private

Definition at line 16 of file TriggerConfig.py.

16def __isCombo(alg):
17 return hasattr( alg, "MultiplicitiesMap" )
18

◆ __stepNumber()

__stepNumber ( stepName)
private
extract step number frmo strings like Step2... -> 2

Definition at line 19 of file TriggerConfig.py.

19def __stepNumber(stepName):
20 """extract step number frmo strings like Step2... -> 2"""
21 return int(stepName.split('_')[0].replace("Step",""))
22
23
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:312

◆ collectDecisionObjects()

collectDecisionObjects ( hypos,
filters,
hltSeeding,
hltSummary )
Returns the set of all decision objects of HLT

Definition at line 150 of file TriggerConfig.py.

150def collectDecisionObjects( hypos, filters, hltSeeding, hltSummary ):
151 """
152 Returns the set of all decision objects of HLT
153 """
154 decObjL1 = collectHLTSeedingDecisionObjects(hltSeeding)
155 decObjHypo = collectHypoDecisionObjects(hypos, inputs = True, outputs = True)
156 decObjFilter = collectFilterDecisionObjects(filters, inputs = True, outputs = True)
157 # InputMaker are not needed explicitly as the Filter Outputs = InputMaker Inputs
158 # and InputMaker Outputs = Hypo Inputs
159 # Therefore we implicitly collect all navigaiton I/O of all InputMakers
160 decObjSummary = collectHLTSummaryDecisionObjects(hltSummary)
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
170
STL class.

◆ collectFilterDecisionObjects()

collectFilterDecisionObjects ( filters,
inputs = True,
outputs = True )

Definition at line 133 of file TriggerConfig.py.

133def collectFilterDecisionObjects(filters, inputs = True, outputs = True):
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
143

◆ collectFilters()

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.

85def collectFilters( steps ):
86 """
87 Similarly to collectHypos but works for filter algorithms
88
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
91 """
92 __log.info("Collecting filters")
93 filters = defaultdict( list )
94
95 for stepSeq in steps.Members:
96 if CFNaming.FILTER_POSTFIX in stepSeq.getName():
97 filters[stepSeq.getName()] = stepSeq.Members
98 __log.debug("Found Filters in Step %s : %s", stepSeq.getName(), stepSeq.Members)
99
100 return filters
101
102

◆ collectHLTSeedingDecisionObjects()

collectHLTSeedingDecisionObjects ( hltSeeding)

Definition at line 103 of file TriggerConfig.py.

103def collectHLTSeedingDecisionObjects(hltSeeding):
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
108 decisionObjects.add( mapThresholdToL1DecisionCollection("FSNOSEED") ) # Include also Full Scan
109 decisionObjects.discard('') # Unpackers which do not use the PROBE container have an empty string for their WriteHandleKey
110 decisionObjects.discard('StoreGateSvc+') # Unpackers which do not use the PROBE container have an empty string for their WriteHandleKey
111 __log.info("Collecting %i decision objects from HLTSeeding instance", len(decisionObjects))
112 return decisionObjects
113

◆ collectHLTSummaryDecisionObjects()

collectHLTSummaryDecisionObjects ( hltSummary)

Definition at line 144 of file TriggerConfig.py.

144def collectHLTSummaryDecisionObjects(hltSummary):
145 decisionObjects = set()
146 decisionObjects.add( str(hltSummary.DecisionsSummaryKey) )
147 __log.info("Collecting %i decision objects from hltSummary", len(decisionObjects))
148 return decisionObjects
149

◆ collectHypoDecisionObjects()

collectHypoDecisionObjects ( hypos,
inputs = True,
outputs = True )

Definition at line 114 of file TriggerConfig.py.

114def collectHypoDecisionObjects(hypos, inputs = True, outputs = True):
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):
121 if inputs:
122 [ decisionObjects.add( str(d) ) for d in hypoAlg.HypoInputDecisions ]
123 if outputs:
124 [ decisionObjects.add( str(d) ) for d in hypoAlg.HypoOutputDecisions ]
125 else:
126 if inputs:
127 decisionObjects.add( str(hypoAlg.HypoInputDecisions) )
128 if outputs:
129 decisionObjects.add( str(hypoAlg.HypoOutputDecisions) )
130 __log.info("Collecting %i decision objects from hypos", len(decisionObjects))
131 return sorted(decisionObjects)
132

◆ collectHypos()

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 24 of file TriggerConfig.py.

24def collectHypos( steps ):
25 """
26 Method iterating over the CF and picking all the Hypothesis algorithms
27
28 Returned is a map with the step name and list of all instances of hypos in that step.
29 Input is top HLT sequencer.
30 """
31 __log.info("Collecting hypos from steps")
32 hypos = defaultdict( list )
33
34 for stepSeq in steps.Members:
35 if not isSequence( stepSeq ):
36 continue
37
38 if CFNaming.FILTER_POSTFIX in stepSeq.getName():
39 __log.debug("Skipping filtering steps %s", stepSeq.getName() )
40 continue
41
42 __log.debug( "collecting hypos from step %s", stepSeq.getName() )
43 for seq,algs in flatAlgorithmSequences(stepSeq).items():
44 for alg in sorted(algs, key=lambda t: str(t.getName())):
45 if isSequence( alg ):
46 continue
47 # will replace by function once dependencies are sorted
48 if hasattr(alg, 'HypoInputDecisions'):
49 __log.debug("found hypo %s in %s", alg.getName(), stepSeq.getName())
50 if __isCombo( alg ) and len(alg.ComboHypoTools):
51 __log.debug( " with %d comboHypoTools: %s", len(alg.ComboHypoTools), ' '.join(map(str, [tool.getName() for tool in alg.ComboHypoTools])))
52 hypos[stepSeq.getName()].append( alg )
53 else:
54 __log.verbose("Not a hypo %s", alg.getName())
55
56 return hypos
57
STL class.

◆ collectViewMakers()

collectViewMakers ( steps)
collect all EventViewCreatorAlgorithm algorithms in the configuration 

Definition at line 68 of file TriggerConfig.py.

68def collectViewMakers( steps ):
69 """ collect all EventViewCreatorAlgorithm algorithms in the configuration """
70 makers = set() # map with name, instance and encompasing recoSequence
71 for stepSeq in getSequenceChildren( steps ):
72 for recoSeq in getSequenceChildren( stepSeq ):
73 if not isSequence( recoSeq ):
74 continue
75 algsInSeq = flatAlgorithmSequences( recoSeq )
76 for seq,algs in algsInSeq.items():
77 for alg in algs:
78 if "Views" in alg._properties:
79 makers.add(alg)
80 __log.debug("Found ViewMakers: %s", ' '.join([ maker.getName() for maker in makers ]))
81 return makers
82
83
84

◆ testMenu()

testMenu ( flags)

Definition at line 884 of file TriggerConfig.py.

884 def testMenu(flags):
885 menuCA = ComponentAccumulator()
886 menuCA.addSequence( seqAND("HLTAllSteps") )
887 return menuCA
888

◆ triggerBSOutputCfg()

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 345 of file TriggerConfig.py.

345def triggerBSOutputCfg(flags, hypos, offline=False):
346 """
347 Returns CA with algorithms and/or tools required to do the serialisation
348
349 decObj - list of all navigation objects
350 decObjHypoOut - list of decisions produced by hypos
351 hypos - the {stepName: hypoList} dictionary with all hypo algorithms - used to find the PEB decision keys
352 offline - if true CA contains algorithms that need to be merged to output stream sequence,
353 if false the CA contains a tool that needs to be added to HltEventLoopMgr
354 """
355 from TrigEDMConfig import DataScoutingInfo
356 from TrigEDMConfig.TriggerEDM import getRun3BSList
357 from TrigEDMConfig.TriggerEDMDefs import allowTruncation
358 from TrigOutputHandling.TrigOutputHandlingConfig import TriggerEDMSerialiserToolCfg, StreamTagMakerToolCfg, TriggerBitsMakerToolCfg
359
360 # Get list of all output collections for ByteStream (including DataScouting)
361 collectionsToBS = getRun3BSList(flags, ["BS"] + DataScoutingInfo.getAllDataScoutingIdentifiers())
362
363 # Tool serialising EDM objects to fill the HLT result
364 serialiser = TriggerEDMSerialiserToolCfg(flags)
365
366 for typekey, bsfragments, props in collectionsToBS:
367 # Translate fragment names like BS, CostMonDS to ROB fragment IDs 0 (full result), 1, ... (DS results)
368 moduleIDs = sorted(DataScoutingInfo.getFullHLTResultID() if f == 'BS' else
369 DataScoutingInfo.getDataScoutingResultID(f)
370 for f in bsfragments)
371
372 __log.debug('adding to serialiser list: %s, modules: %s', typekey, moduleIDs)
373 serialiser.addCollection(typekey, moduleIDs, allowTruncation = allowTruncation in props)
374
375 # Tools adding stream tags and trigger bits to HLT result
376 stmaker = StreamTagMakerToolCfg()
377 bitsmaker = TriggerBitsMakerToolCfg()
378
379 # Map hypo decisions producing PEBInfo to StreamTagMakerTool.PEBDecisionKeys
380 PEBKeys = []
381 for hypoList in hypos.values():
382 for hypo in hypoList:
383 if hypo.getFullJobOptName().startswith('PEBInfoWriterAlg/'):
384 PEBKeys.append(str(hypo.HypoOutputDecisions))
385
386 PEBKeys = sorted(set(PEBKeys))
387 __log.debug('Setting StreamTagMakerTool.PEBDecisionKeys = %s', PEBKeys)
388 stmaker.PEBDecisionKeys = PEBKeys
389
390 acc = ComponentAccumulator()
391
392 if offline:
393 # Create HLT result maker and alg
394 from TrigOutputHandling.TrigOutputHandlingConfig import HLTResultMTMakerCfg
395 HLTResultMTMakerAlg=CompFactory.HLTResultMTMakerAlg
396 hltResultMakerTool = HLTResultMTMakerCfg(flags)
397 hltResultMakerTool.StreamTagMaker = stmaker
398 hltResultMakerTool.MakerTools = [bitsmaker, serialiser]
399 hltResultMakerAlg = HLTResultMTMakerAlg()
400 hltResultMakerAlg.ResultMaker = hltResultMakerTool
401
402 # Provide ByteStreamMetaData from input, required by the result maker tool
403 if flags.Input.Format is Format.BS:
404 from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
405 readBSAcc = ByteStreamReadCfg(flags)
406 readBSAcc.getEventAlgo('SGInputLoader').Load.add(
407 ('ByteStreamMetadataContainer', 'InputMetaDataStore+ByteStreamMetadata'))
408 acc.merge(readBSAcc)
409 else:
410 # No BS metadata (thus no DetectorMask) in POOL files, need to disable the checks using it
411 hltResultMakerAlg.ResultMaker.ExtraROBs = []
412 hltResultMakerAlg.ResultMaker.ExtraSubDets = []
413
414 # Transfer trigger bits to xTrigDecision which is read by offline BS writing ByteStreamCnvSvc
415 decmaker = CompFactory.getComp("TrigDec::TrigDecisionMakerMT")("TrigDecMakerMT")
416
417 # Schedule the insertion of L1 prescales into the conditions store
418 # Required for writing L1 trigger bits to xTrigDecision
419 from TrigConfigSvc.TrigConfigSvcCfg import L1PrescaleCondAlgCfg
420 acc.merge(L1PrescaleCondAlgCfg(flags))
421
422 # Create OutputStream alg
423 from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamWriteCfg
424 writingOutputs = ["HLT::HLTResultMT#HLTResultMT"]
425 writingInputs = [("HLT::HLTResultMT", "HLTResultMT"),
426 ("xAOD::TrigDecision", "xTrigDecision")]
427
428 # Rewrite LVL1 result if LVL1 simulation is enabled
429 if flags.Trigger.doLVL1:
430 if flags.Trigger.enableL1MuonPhase1 or flags.Trigger.enableL1CaloPhase1:
431 writingOutputs += ['xAOD::TrigCompositeContainer#L1TriggerResult']
432 writingInputs += [('xAOD::TrigCompositeContainer', 'StoreGateSvc+L1TriggerResult')]
433 if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1MuonPhase1:
434 writingOutputs += ['ROIB::RoIBResult#RoIBResult']
435 writingInputs += [('ROIB::RoIBResult', 'StoreGateSvc+RoIBResult')]
436 if flags.Trigger.CTP.UseEDMxAOD:
437 writingOutputs += ['xAOD::CTPResult#CTPResult']
438 writingInputs += [('xAOD::CTPResult', 'StoreGateSvc+CTPResult')]
439
440 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamEncoderCfg
441 acc.merge(L1TriggerByteStreamEncoderCfg(flags))
442
443 writingAcc = ByteStreamWriteCfg(flags, type_names=writingOutputs, extra_inputs=writingInputs)
444 writingAcc.addEventAlgo(hltResultMakerAlg)
445 writingAcc.addEventAlgo(decmaker)
446 acc.merge(writingAcc)
447
448 else:
449 from TrigServices.TrigServicesConfig import TrigServicesCfg
450 onlineServicesAcc = TrigServicesCfg(flags)
451 hltEventLoopMgr = onlineServicesAcc.getPrimary()
452 hltEventLoopMgr.ResultMaker.StreamTagMaker = stmaker
453 hltEventLoopMgr.ResultMaker.MakerTools = [serialiser, bitsmaker]
454 onlineServicesAcc.getEventAlgo('SGInputLoader').Load.add(
455 ('ByteStreamMetadataContainer', 'InputMetaDataStore+ByteStreamMetadata'))
456 acc.merge(onlineServicesAcc)
457 return acc
458
459
Simply calls the result maker tool to create HLTResultMT.

◆ triggerEDMGapFillerCfg()

triggerEDMGapFillerCfg ( flags,
edmSet,
decObj = [],
decObjHypoOut = [],
extraInputs = [],
extraOutputs = [] )
Configure the EDM gap filler

Definition at line 562 of file TriggerConfig.py.

562def triggerEDMGapFillerCfg( flags, edmSet, decObj=[], decObjHypoOut=[], extraInputs=[], extraOutputs=[] ):
563 """Configure the EDM gap filler"""
564
565 from TrigEDMConfig.TriggerEDMDefs import Alias
566 from TrigEDMConfig.TriggerEDM import getRawTriggerEDMList
567
568 # Ignore the following collections in the GapFiller. List of regular expressions
569 # that are fully matched against the EDM entry ("type#key").
570 ignore = [
571 # GapFiller always creates Aux stores unless it doesn't end in a ., then there are extra decorations that need declaring
572 ".*AuxContainer#.*", ".*AuxInfo#.*",
573 ]
574 if flags.Trigger.doHLT:
575 # Online, these collections will be created after the EDMCreator runs
576 ignore += ["xAOD::TrigCompositeContainer#HLTNav_Summary_OnlineSlimmed",
577 "xAOD::TrigCompositeContainer#HLT_RuntimeMetadata"]
578
579 acc = ComponentAccumulator()
580 tool = CompFactory.HLTEDMCreator(f"GapFiller{'' if edmSet==['BS'] else '_'+'_'.join(edmSet)}")
581 alg = CompFactory.HLTEDMCreatorAlg("EDMCreatorAlg",
582 OutputTools = [tool])
583 alg.ExtraInputs = set(extraInputs)
584 alg.ExtraOutputs = set(extraOutputs)
585 alg.ExtraOutputs.add(("xAOD::TrigConfKeys","TrigConfKeysOnline")) # declare keys which are always produced
586
587 # adding the following extra outputs, which can come out of old data but need to eliminate
588 # remaining dependencies on them (e.g. FwdAFPHLTPFlowJetMonitoringAlg)
589 # TODO: Remove dependent algs on these non-existent objects
590 alg.ExtraOutputs.add(('xAOD::JetContainer','HLT_AntiKt4EMTopoJets_subjesIS' ))
591 alg.ExtraOutputs.add(('xAOD::JetContainer','HLT_AntiKt4EMTopoJets_subjesgscIS_ftf' ))
592 alg.ExtraOutputs.add(('xAOD::JetContainer','HLT_AntiKt4EMTopoJets_subresjesgscIS_ftf' ))
593 alg.ExtraOutputs.add(('xAOD::JetContainer','HLT_AntiKt4EMTopoJets_subjesIS_fastftag'))
594 alg.ExtraOutputs.add(('xAOD::JetContainer','HLT_AntiKt4EMPFlowJets_subjesgscIS_ftf' ))
595 alg.ExtraOutputs.add(('xAOD::JetContainer','HLT_AntiKt4EMPFlowJets_subjesIS_ftf'))
596 alg.ExtraOutputs.add(('xAOD::JetContainer','HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf' ))
597 alg.ExtraOutputs.add(('xAOD::JetContainer','HLT_AntiKt10LCTopoJets_subjes'))
598 alg.ExtraOutputs.add(('xAOD::CaloClusterContainer','HLT_TopoCaloClustersLCFS'))
599
600
601 tool.RenounceOutputs = flags.Trigger.doHLT # if running trigger in HLT then renounce outputs to prevent dependencies on this tool/alg
602
603 if len(edmSet) != 0:
604 groupedByType = defaultdict( list )
605 re_ignore = [re.compile(x) for x in ignore]
606
607 # scan the EDM
608 for el in getRawTriggerEDMList(flags):
609 if not any([ outputType in el[1].split() for outputType in edmSet ]):
610 continue
611 if any(ign.fullmatch(el[0]) for ign in re_ignore):
612 # aux container or aux info .. need to see if we have decorations to declare
613 collType, collName = el[0].split("#")
614 if collName[-1] != ".":
615 collType = collType.replace("AuxInfo","Info").replace("AuxContainer","Container")
616 __log.debug("GapFiller will create EDM decorations on type '%s' of '%s'", collType, collName)
617 collNameList = collName.split(".") # first will be the collection name with Aux. added
618 collName = (collNameList[0] + ".").replace("Aux.",".")
619 for decorName in collNameList[1:]:
620 alg.ExtraOutputs.add((collType,"StoreGateSvc+"+collName+decorName))
621 continue
622 collType, collName = el[0].split("#")
623 if len(el) >= 4: # see if there is an alias
624 aliases = [ str(a) for a in el[3] if isinstance(a, Alias) ]
625 if len(aliases) == 1:
626 __log.debug("GapFiller configuration found an aliased type '%s' for '%s'", aliases[0], collType)
627 collType = aliases[0]
628 elif len(aliases) > 1:
629 __log.error("GapFiller configuration found inconsistent '%s' (too many aliases?)", aliases)
630
631 groupedByType[collType].append( collName )
632
633 for collType, collNameList in groupedByType.items():
634 propName = collType.split(":")[-1]
635 if hasattr( tool, propName ):
636 setattr( tool, propName, collNameList )
637 __log.debug("GapFiller will create EDM collection type '%s' for '%s'", collType, collNameList)
638 else:
639 __log.debug("EDM collections of type %s are not going to be added to StoreGate, if not created by the HLT", collType )
640
641 if decObj or decObjHypoOut:
642 __log.debug("GapFiller is ensuring the creation of all the decision object collections")
643 __log.debug("'%s'", decObj)
644 # Gap filler is also used to perform re-mapping of the HypoAlg outputs which is a sub-set of decObj
645 tool.FixLinks = list(decObjHypoOut)
646 # Append and hence confirm all TrigComposite collections
647 tool.TrigCompositeContainer += list(decObj)
648
649 acc.addEventAlgo(alg, primary=True)
650 return acc
651
652

◆ triggerEndOfEventCfg()

triggerEndOfEventCfg ( flags)

Definition at line 806 of file TriggerConfig.py.

806def triggerEndOfEventCfg(flags):
807 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig import HLTMenuConfig
808
809 acceptedEventChainDicts = [cd for cd in HLTMenuConfig.dictsList() \
810 if 'Calib' in cd['signatures'] \
811 and 'acceptedevts' in cd['chainParts'][0]['purpose']]
812
813 acc = ComponentAccumulator()
814
815 # If no relevant chains or just not desired, can shortcut and return empty CA
816 if not (flags.Trigger.enableEndOfEventProcessing and acceptedEventChainDicts):
817 return acc
818
819 # Add end-of-event sequences executed conditionally on the DecisionSummaryMakerAlg filter status
820 endOfEventRoIMaker = CompFactory.EndOfEventROIConfirmerAlg('EndOfEventROIConfirmerAlg')
821 acc.addEventAlgo( endOfEventRoIMaker )
822 acc.addSequence( parOR("acceptedEventTopSeq") )
823 acc.getSequence("acceptedEventTopSeq").IgnoreFilterPassed=True
824
825 # Define the alg configuration by purpose
826 def EndOfEventSeqCfg(flags, prescaleChain, purposes):
827 acc = ComponentAccumulator()
828 seqLabel = prescaleChain.replace('HLT_acceptedevts','')
829 seqName = 'acceptedEventSeq'+seqLabel
830 acc.addSequence( seqAND(seqName) )
831
832 endOfEventFilterAlg = CompFactory.EndOfEventFilterAlg('EndOfEventFilterAlg'+seqLabel, ChainName=prescaleChain)
833 acc.addEventAlgo(endOfEventFilterAlg, sequenceName=seqName)
834 # The LAr Noise Burst end-of-event sequence
835 if 'larnoiseburst' in purposes:
836 # Add stream filter to EndOfEventFilterAlg
837 # Only accept events going to streams that already do full calo reco
838 # CosmicCalo explicitly requested [ATR-26096]
839 endOfEventFilterAlg.StreamFilter = ['Main','VBFDelayed','TLA','DarkJetPEBTLA','FTagPEBTLA','CosmicCalo']
840
841 from TriggerMenuMT.HLT.CalibCosmicMon.CalibChainConfiguration import getLArNoiseBurstRecoCfg
842 acc.merge(getLArNoiseBurstRecoCfg(flags), sequenceName=seqName)
843 elif any(purpose.startswith("met") for purpose in purposes):
844 from TriggerMenuMT.HLT.MET.EndOfEvent import getMETRecoSequences
845 metcfg, rois, streams = getMETRecoSequences(flags, purposes)
846 endOfEventFilterAlg.StreamFilter = streams
847 endOfEventRoIMaker.RoIs = [x for x in rois if x not in endOfEventRoIMaker.RoIs]
848 acc.merge(metcfg, sequenceName=seqName)
849
850 return acc
851
852
853 for acceptedEventChainDict in acceptedEventChainDicts:
854 # Common config for each chain
855 prescaleChain = acceptedEventChainDict['chainName']
856 # Now add chain-specific end-of-event sequences executed conditionally on the prescale
857 purposes = acceptedEventChainDict['chainParts'][0]['purpose']
858
859 acc.merge(EndOfEventSeqCfg(flags, prescaleChain, purposes), sequenceName="acceptedEventTopSeq")
860
861 return acc
862

◆ triggerIDCCacheCreatorsCfg()

triggerIDCCacheCreatorsCfg ( flags,
seqName = None )
Configures IDC cache loading
Returns: CA

Definition at line 781 of file TriggerConfig.py.

781def triggerIDCCacheCreatorsCfg(flags, seqName = None):
782 """
783 Configures IDC cache loading
784 Returns: CA
785 """
786 acc = ComponentAccumulator(seqName)
787
788 if flags.Trigger.doMuon:
789 from MuonConfig.MuonBytestreamDecodeConfig import MuonCacheCfg
790 acc.merge( MuonCacheCfg(flags), sequenceName = seqName )
791
792 from MuonConfig.MuonRdoDecodeConfig import MuonPrdCacheCfg
793 acc.merge( MuonPrdCacheCfg(flags), sequenceName = seqName )
794
795 if flags.Trigger.doID:
796 from TrigInDetConfig.TrigInDetConfig import InDetIDCCacheCreatorCfg
797 acc.merge( InDetIDCCacheCreatorCfg(flags), sequenceName = seqName )
798
799 if flags.Trigger.useActsTracking:
800 from TrigInDetConfig.TrigInDetConfig import ActsIDCCacheCreatorCfg
801 acc.merge( ActsIDCCacheCreatorCfg(flags), sequenceName = seqName )
802
803 return acc
804
805

◆ triggerMergeViewsCfg()

triggerMergeViewsCfg ( flags,
viewMakers )
Configure the view merging algorithm

Definition at line 517 of file TriggerConfig.py.

517def triggerMergeViewsCfg( flags, viewMakers ):
518 """Configure the view merging algorithm"""
519
520 from TrigEDMConfig.TriggerEDMDefs import InViews
521 from TrigEDMConfig.TriggerEDM import getRawTriggerEDMList
522
523 acc = ComponentAccumulator()
524 mergingTool = CompFactory.HLTEDMCreator("ViewsMergingTool")
525 alg = CompFactory.HLTEDMCreatorAlg("EDMCreatorAlg",
526 OutputTools = [mergingTool])
527
528 # configure views merging
529 needMerging = [x for x in getRawTriggerEDMList(flags) if len(x) >= 4 and
530 any(isinstance(v, InViews) for v in x[3])]
531 __log.info("These collections need merging: %s", " ".join([ c[0] for c in needMerging ]))
532
533 for coll in needMerging:
534 collType, collName = coll[0].split("#")
535 collType = collType.split(":")[-1]
536 possibleViews = [ str(v) for v in coll[3] if isinstance(v, InViews) ]
537 for viewsColl in possibleViews:
538 attrView = getattr(mergingTool, collType+"Views", [])
539 attrInView = getattr(mergingTool, collType+"InViews", [])
540 attrName = getattr(mergingTool, collType, [])
541 attrView.append( viewsColl )
542 attrInView.append( collName )
543 attrName.append( collName )
544
545 setattr(mergingTool, collType+"Views", attrView )
546 setattr(mergingTool, collType+"InViews", attrInView )
547 setattr(mergingTool, collType, attrName )
548 producer = [ maker for maker in viewMakers if maker.Views == viewsColl ]
549 if len(producer) == 0:
550 __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)
551 continue
552 if len(producer) > 1:
553 for pr in producer[1:]:
554 if pr != producer[0]:
555 __log.error("Several View making algorithms produce the same output collection %s: %s", viewsColl, ' '.join([p.getName() for p in producer ]))
556 continue
557
558 acc.addEventAlgo(alg)
559 return acc
560
561
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:179

◆ triggerMonitoringCfg()

triggerMonitoringCfg ( flags,
hypos,
filters,
hltSeeding )
Configures components needed for monitoring chains

Definition at line 228 of file TriggerConfig.py.

228def triggerMonitoringCfg(flags, hypos, filters, hltSeeding):
229 """
230 Configures components needed for monitoring chains
231 """
232 acc = ComponentAccumulator()
233 TrigSignatureMoni, DecisionCollectorTool=CompFactory.getComps("TrigSignatureMoni","DecisionCollectorTool",)
234 mon = TrigSignatureMoni()
235 mon.CountLegFeatures = flags.Trigger.doPerLegFeatureCounts
236 mon.L1Decisions = "HLTSeedingSummary"
237 mon.FinalDecisionKey = "HLTNav_Summary" # Input
238 if len(hypos) == 0:
239 __log.warning("Menu is not configured")
240 return acc, mon
241
242 # lambda sort because we have strings Step1 Step2 ... Step10 Step11 and python sorts that
243 # to Step10 Step11 Step1 Step2
244 stepCounter = 1
245 for stepName, stepHypos in sorted( hypos.items(), key=lambda x : __stepNumber(x[0])):
246 assert __stepNumber(stepName) == stepCounter, "There are steps that have no hypos, decisions counting is not going to work"
247 stepCounter += 1
248 stepDecisionKeys = []
249 stepFeatureDecisionKeys = []
250 stepLegFeatureDecisionKeys = []
251 for hypo in stepHypos:
252 hypoChains, hypoOutputKeys = __decisionsFromHypo( hypo )
253 if __isCombo(hypo):
254 stepDecisionKeys.extend( hypoOutputKeys )
255 stepFeatureDecisionKeys.extend( hypoOutputKeys )
256
257 # Event and total feature counts are read from the ComboHypo
258 dcEventTool = DecisionCollectorTool( "EventDecisionCollector" + stepName, Decisions=list(dict.fromkeys(stepDecisionKeys)))
259 dcFeatureTool = DecisionCollectorTool( "FeatureDecisionCollector" + stepName, Decisions=list(dict.fromkeys(stepFeatureDecisionKeys)))
260 if flags.Trigger.doPerLegFeatureCounts: # Add the hypo decision outputs
261 dcFeatureTool.Decisions = list(dcFeatureTool.Decisions) + list(dict.fromkeys(stepLegFeatureDecisionKeys))
262 __log.debug( "The step monitoring decisions in %s %s", dcEventTool.getName(), dcEventTool.Decisions)
263 __log.debug( "The step monitoring decisions in %s %s", dcFeatureTool.getName(), dcFeatureTool.Decisions)
264 mon.DecisionCollectorTools += [ dcEventTool ]
265 mon.FeatureCollectorTools += [ dcFeatureTool ]
266
267 # Configure additional chain error monitoring for athenaHLT/online:
268 if flags.Trigger.Online.isPartition:
269 from TrigServices.TrigServicesConfig import TrigServicesCfg
270 onlineServicesAcc = TrigServicesCfg(flags)
271 hltEventLoopMgr = onlineServicesAcc.getPrimary()
272
273 hltEventLoopMgr.TrigErrorMonTool.AlgToChainTool = CompFactory.TrigCompositeUtils.AlgToChainTool()
274 hltEventLoopMgr.TrigErrorMonTool.MonTool.defineHistogram(
275 'ErrorChainName,ErrorCode', path='EXPERT', type='TH2I',
276 title='Error StatusCodes per chain;Chain name;StatusCode',
277 xbins=1, xmin=0, xmax=1, ybins=1, ymin=0, ymax=1)
278
279 acc.merge(onlineServicesAcc)
280
281 mon.L1Decisions = hltSeeding.HLTSeedingSummaryKey
282
283 if flags.Trigger.doValidationMonitoring:
284 from DecisionHandling.DecisionHandlingConfig import setupFilterMonitoring
285 for algs in filters.values():
286 for alg in algs:
287 setupFilterMonitoring( flags, alg )
288
289 return acc, mon
290
291
292

◆ triggerOutputCfg()

triggerOutputCfg ( flags,
hypos )

Definition at line 293 of file TriggerConfig.py.

293def triggerOutputCfg(flags, hypos):
294 # Following cases are considered:
295 # 1) Running in partition or athenaHLT - configure BS output written by the HLT framework
296 # 2) Running offline athena and writing BS - configure BS output written by OutputStream alg
297 # 3) Running offline athena with POOL output - configure POOL output written by OutputStream alg
298 onlineWriteBS = False
299 offlineWriteBS = False
300 writePOOL = False
301
302 if flags.Trigger.writeBS:
303 if flags.Trigger.Online.isPartition:
304 onlineWriteBS = True
305 else:
306 offlineWriteBS = True
307 if flags.Output.doWriteRDO or flags.Output.doWriteESD or flags.Output.doWriteAOD:
308 writePOOL = True
309
310 # Consistency checks
311 if offlineWriteBS and not flags.Output.doWriteBS:
312 __log.error('flags.Trigger.writeBS is True but flags.Output.doWriteBS is False')
313 return None, ''
314 if writePOOL and onlineWriteBS:
315 __log.error("POOL HLT output writing is configured online")
316 return None, ''
317 if writePOOL and offlineWriteBS:
318 __log.error("Writing HLT output to both BS and POOL in one job is not supported at the moment")
319 return None, ''
320
321 # Determine EDM set name
322 edmSet = ''
323 if writePOOL:
324 edmSet = flags.Trigger.AODEDMSet if flags.Output.doWriteAOD else flags.Trigger.ESDEDMSet
325 elif onlineWriteBS or offlineWriteBS:
326 edmSet = 'BS'
327
328 # Create the configuration
329 if onlineWriteBS:
330 __log.info("Configuring online ByteStream HLT output")
331 acc = triggerBSOutputCfg(flags, hypos)
332 elif offlineWriteBS:
333 __log.info("Configuring offline ByteStream HLT output")
334 acc = triggerBSOutputCfg(flags, hypos, offline=True)
335 elif writePOOL:
336 __log.info("Configuring POOL HLT output")
337 acc = triggerPOOLOutputCfg(flags)
338 else:
339 __log.info("No HLT output writing is configured")
340 acc = ComponentAccumulator()
341
342 return acc, edmSet
343
344

◆ triggerPOOLOutputCfg()

triggerPOOLOutputCfg ( flags)

Definition at line 460 of file TriggerConfig.py.

460def triggerPOOLOutputCfg(flags):
461 # Get the list of output collections from TriggerEDM
462 acc = ComponentAccumulator()
463
464 from TrigEDMConfig.TriggerEDM import getTriggerEDMList
465
466 # Produce trigger bits
467 bitsmaker = CompFactory.TriggerBitsMakerTool()
468 decmaker = CompFactory.TrigDec.TrigDecisionMakerMT("TrigDecMakerMT", BitsMakerTool = bitsmaker, UseEDMxAOD=flags.Trigger.CTP.UseEDMxAOD)
469 acc.addEventAlgo( decmaker )
470
471 # Export trigger metadata during the trigger execution when running with POOL output.
472 from .TriggerRecoConfig import TriggerMetadataWriterCfg
473 metadataAcc, metadataOutputs = TriggerMetadataWriterCfg(flags)
474 acc.merge( metadataAcc )
475
476 # Produce xAOD L1 RoIs from RoIBResult
477 from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig import RoIBResultToxAODCfg
478 xRoIBResultAcc, xRoIBResultOutputs = RoIBResultToxAODCfg(flags)
479 acc.merge(xRoIBResultAcc)
480 # Ensure outputs are produced before streamAlg runs
481
482
483 # Create OutputStream
484 for doit, outputType, edmSet in [( flags.Output.doWriteRDO, 'RDO', flags.Trigger.ESDEDMSet), # not a mistake, RDO content is meant to be as ESD
485 ( flags.Output.doWriteESD, 'ESD', flags.Trigger.ESDEDMSet),
486 ( flags.Output.doWriteAOD, 'AOD', flags.Trigger.AODEDMSet)]:
487 if not doit: continue
488
489 edmList = getTriggerEDMList(flags, key=edmSet)
490
491 # Build the output ItemList
492 itemsToRecord = []
493 for edmType, edmKeys in edmList.items():
494 itemsToRecord.extend([edmType+'#'+collKey for collKey in edmKeys])
495
496 # Add EventInfo
497 itemsToRecord.append('xAOD::EventInfo#EventInfo')
498 itemsToRecord.append('xAOD::EventAuxInfo#EventInfoAux.')
499
500
501 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg, outputStreamName
502 acc.merge(OutputStreamCfg(flags, outputType, ItemList=itemsToRecord,
503 disableEventTag=True, takeItemsFromInput=(outputType == 'RDO')))
504 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
505 acc.merge(SetupMetaDataForStreamCfg(flags, outputType,
506 createMetadata=[MetadataCategory.TriggerMenuMetaData]))
507
508 alg = acc.getEventAlgo(outputStreamName(outputType))
509 # Ensure OutputStream runs after TrigDecisionMakerMT and xAODMenuWriter
510 alg.ExtraInputs |= {
511 ("xAOD::TrigDecision", str(decmaker.TrigDecisionKey)),
512 ("xAOD::TrigConfKeys", metadataOutputs)} | set(xRoIBResultOutputs)
513
514 return acc
515
516

◆ triggerPostRunCfg()

triggerPostRunCfg ( flags)
Configures components needed for processing trigger information in RAW/ESD step
Returns: ca only

Definition at line 863 of file TriggerConfig.py.

863def triggerPostRunCfg(flags):
864 """
865 Configures components needed for processing trigger information in RAW/ESD step
866 Returns: ca only
867 """
868 acc = ComponentAccumulator()
869 # configure in order BS decodnig, EDM gap filling, insertion of trigger metadata to ESD
870
871 return acc
872
873

◆ triggerRunCfg()

triggerRunCfg ( flags,
menu = None )
top of the trigger config (for real triggering online or on MC)
Returns: ca only

Definition at line 653 of file TriggerConfig.py.

653def triggerRunCfg( flags, menu=None ):
654 """
655 top of the trigger config (for real triggering online or on MC)
656 Returns: ca only
657 """
658 acc = ComponentAccumulator()
659
660 # L1ConfigSvc needed for HLTSeeding
661 from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
662
663 acc.merge( L1ConfigSvcCfg(flags) )
664
665 acc.addSequence( seqOR( "HLTTop") )
666
667 # HLTPreSeq only used for CostMon so far, skip if CostMon disabled
668 if flags.Trigger.CostMonitoring.doCostMonitoring:
669 acc.addSequence( parOR("HLTPreSeq"), parentName="HLTTop" )
670
671 from TrigCostMonitor.TrigCostMonitorConfig import TrigCostMonitorCfg
672 acc.merge( TrigCostMonitorCfg( flags ), sequenceName="HLTPreSeq" )
673
674
675 acc.addSequence( parOR("HLTBeginSeq"), parentName="HLTTop" )
676 # bit of a hack as for "legacy" type JO a seq name for cache creators has to be given,
677 # in newJO realm the seqName will be removed as a comp fragment shoudl be unaware of where it will be attached
678
679 if flags.Trigger.doCFEmulationTest:
680 from TriggerMenuMT.CFtest.EmuStepProcessingConfig import emulateHLTSeedingCfg
681 hltSeedingAcc = emulateHLTSeedingCfg(flags)
682 else:
683 acc.merge( triggerIDCCacheCreatorsCfg( flags, seqName="AthAlgSeq" ), sequenceName="HLTBeginSeq" )
684
685 if flags.Trigger.doRuntimeNaviVal: # Validate we can parse the menu with the standalone chain parser
686 acc.addEventAlgo( CompFactory.TrigChainNameParserChecker(), sequenceName="HLTBeginSeq" )
687
688 from HLTSeeding.HLTSeedingConfig import HLTSeedingCfg
689 hltSeedingAcc = HLTSeedingCfg( flags )
690
691 if flags.Input.isMC and (flags.Input.Format is not Format.BS):
692 from AthenaConfiguration.Enums import LHCPeriod
693 if flags.GeoModel.Run > LHCPeriod.Run3:
694 from InDetConfig.TrackRecoConfig import SiDetectorElementStatusCfg
695 acc.merge(SiDetectorElementStatusCfg( flags), sequenceName="HLTBeginSeq")
696
697 # TODO, once moved to newJO the algorithm can be added to hltSeedingAcc and merging will be sufficient here
698 acc.merge( hltSeedingAcc, sequenceName="HLTBeginSeq" )
699
700 # detour to the menu here, (missing now, instead a temporary hack)
701 if menu:
702 menuAcc = menu( flags )
703 HLTSteps = menuAcc.getSequence( "HLTAllSteps" )
704 __log.info( "Configured menu with %d steps", len(HLTSteps.Members))
705 acc.merge( menuAcc, sequenceName="HLTTop")
706
707 # collect hypothesis algorithms from all sequence
708 hypos = collectHypos( HLTSteps )
709 filters = collectFilters( HLTSteps )
710 acc.addSequence( parOR("HLTEndSeq"), parentName="HLTTop" )
711 acc.addSequence( seqAND("HLTFinalizeSeq"), parentName="HLTEndSeq" )
712
713 nfilters = sum(len(v) for v in filters.values())
714 nhypos = sum(len(v) for v in hypos.values())
715 __log.info( "Algorithms counting: Number of Filter algorithms: %d - Number of Hypo algoirthms: %d", nfilters , nhypos)
716
717 summaryAcc, summaryAlg = triggerSummaryCfg( flags, hypos )
718 acc.merge( summaryAcc, sequenceName="HLTFinalizeSeq" )
719 if flags.Trigger.doCFEmulationTest:
720 summaryAlg.Prescaler=CompFactory.PrescalingEmulationTool()
721 acc.addEventAlgo( summaryAlg, sequenceName="HLTFinalizeSeq" )
722 acc.merge( triggerEndOfEventCfg(flags), sequenceName="HLTFinalizeSeq" )
723
724 #once menu is included we should configure monitoring here as below
725 hltSeedingAlg = hltSeedingAcc.getEventAlgo("HLTSeeding")
726
727 monitoringAcc, monitoringAlg = triggerMonitoringCfg( flags, hypos, filters, hltSeedingAlg )
728 acc.merge( monitoringAcc, sequenceName="HLTEndSeq" )
729 acc.addEventAlgo( monitoringAlg, sequenceName="HLTEndSeq" )
730
731 decObj, decObjHypoOut = collectDecisionObjects( hypos, filters, hltSeedingAlg, summaryAlg )
732
733
734 # configure components need to normalise output before writing out
735 viewMakers = collectViewMakers( HLTSteps )
736
737 # Add HLT Navigation to EDM list
738 # TODO: DO NOT directly modify TriggerHLTListRun3
739 from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTListRun3, addHLTNavigationToEDMList
740 __log.info( "Number of EDM items before adding navigation: %d", len(TriggerHLTListRun3))
741 addHLTNavigationToEDMList(flags, TriggerHLTListRun3, decObj, decObjHypoOut)
742 __log.info( "Number of EDM items after adding navigation: %d", len(TriggerHLTListRun3))
743
744 # Add Extra to EDM list
745 # TODO: DO NOT directly modify TriggerHLTListRun3
746 if flags.Trigger.ExtraEDMList:
747 from TrigEDMConfig.TriggerEDM import _addExtraCollectionsToEDMList
748 __log.info( "Adding extra collections to EDM: %s", str(flags.Trigger.ExtraEDMList))
749 _addExtraCollectionsToEDMList(TriggerHLTListRun3, flags.Trigger.ExtraEDMList)
750
751 # Configure output writing
752 outputAcc, edmSet = triggerOutputCfg( flags, hypos )
753 acc.merge( outputAcc, sequenceName="HLTTop" )
754
755 # Cost monitoring should be finished between acceptedEventTopSeq and EDMCreator
756 from TrigCostMonitor.TrigCostMonitorConfig import TrigCostMonitorFinalizeCfg
757 costFinalizeAlg = TrigCostMonitorFinalizeCfg(flags)
758 if costFinalizeAlg: # None if Cost Monitoring is turned off
759 acc.addEventAlgo(costFinalizeAlg, sequenceName="HLTFinalizeSeq" )
760
761 if edmSet:
762 # The order is important: 1) view merging, 2) gap filling
763 acc.merge( triggerMergeViewsCfg(flags, viewMakers), sequenceName="HLTFinalizeSeq" )
764 # For BS output, the EDM gap-filling is done in Reco. Online we only ensure a
765 # consistent set of decision objects (TrigCompositeContainer):
766 acc.merge( triggerEDMGapFillerCfg(flags, [edmSet] if edmSet!='BS' else [],
767 decObj, decObjHypoOut), sequenceName="HLTFinalizeSeq" )
768
769 if flags.Trigger.doOnlineNavigationCompactification:
770 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import getTrigNavSlimmingMTOnlineConfig
771 onlineSlimAlg = getTrigNavSlimmingMTOnlineConfig(flags)
772 acc.addEventAlgo( onlineSlimAlg, sequenceName="HLTFinalizeSeq" )
773
774 # Cleanup menu config to allow garbage collection (ATR-28855)
775 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig import HLTMenuConfig
776 HLTMenuConfig.destroy()
777
778 return acc
779
780
make the sidebar many part of the config
Definition hcg.cxx:554

◆ triggerSummaryCfg()

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.

171def triggerSummaryCfg(flags, hypos):
172 """
173 Configures an algorithm(s) that should be run after the selection process
174 Returns: ca, algorithm
175 """
176 acc = ComponentAccumulator()
177 from TrigOutputHandling.TrigOutputHandlingConfig import DecisionSummaryMakerAlgCfg
178 decisionSummaryAlg = DecisionSummaryMakerAlgCfg(flags)
179 chainToLastCollection = {} # keys are chain names, values are lists of collections
180
181 # sort steps according to the step number i.e. strings Step1 Step2 ... Step10 Step11 rather than
182 # alphabetic order Step10 Step11 Step1 Step2
183 for stepName, stepHypos in sorted( hypos.items(), key=lambda x : __stepNumber(x[0]) ):
184 # While filling the chainToLastCollection dict we will replace the content intentionally
185 # i.e. the chain has typically multiple steps and we want the collections from the last one
186 # In a step the chain is handled by hypo or hypo followed by the combo,
187 # in second case we want out of the later.
188 # For that we process first ComboHypo and then regular Hypos
189 # (TODO, review this whn config is symmetrised by addition of ComboHypos always)
190 orderedStepHypos = sorted(stepHypos, key=lambda hypo: not __isCombo(hypo))
191
192 chainToCollectionInStep = {}
193 for hypo in orderedStepHypos:
194 hypoChains, hypoOutputKeys = __decisionsFromHypo( hypo )
195 for chain in hypoChains:
196 if chain not in chainToCollectionInStep:
197 chainToCollectionInStep[chain] = hypoOutputKeys
198 chainToLastCollection.update( chainToCollectionInStep )
199
200 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig import HLTMenuConfig
201 from HLTSeeding.HLTSeedingConfig import mapThresholdToL1DecisionCollection
202 if len(HLTMenuConfig.dicts()) == 0:
203 __log.warning("No HLT menu, chains w/o algorithms are not handled")
204 else:
205 for chainName, chainDict in HLTMenuConfig.dicts().items():
206 if chainName not in chainToLastCollection:
207 __log.debug("The chain %s is not mentioned in any step", chainName)
208 # TODO once sequences available in the menu we need to crosscheck it here
209 assert len(chainDict['chainParts']) == 1, "Chains w/o the steps can not have multiple parts in chainDict, it makes no sense: %s"%chainName
210 chainToLastCollection[chainName] = [ mapThresholdToL1DecisionCollection( chainDict['chainParts'][0]['L1threshold'] ) ]
211
212 for c, cont in chainToLastCollection.items():
213 __log.debug("Final decision of chain %s will be read from %d %s", c, len(cont), str(cont))
214 # Flatten all the collections preserving the order
215 collectionsWithFinalDecisions = []
216 for chain, collections in chainToLastCollection.items():
217 for c in collections:
218 if c not in collectionsWithFinalDecisions:
219 collectionsWithFinalDecisions.append(c)
220 __log.debug("Final keys %s", collectionsWithFinalDecisions)
221 decisionSummaryAlg.FinalDecisionKeys = collectionsWithFinalDecisions
222 decisionSummaryAlg.FinalStepDecisions = dict(chainToLastCollection)
223 decisionSummaryAlg.DecisionsSummaryKey = "HLTNav_Summary" # Output
224 decisionSummaryAlg.SetFilterStatus = flags.Trigger.writeBS
225 return acc, decisionSummaryAlg
226
227

Variable Documentation

◆ __log

python.TriggerConfig.__log = logging.getLogger('TriggerConfig')
private

Definition at line 13 of file TriggerConfig.py.

◆ acc

python.TriggerConfig.acc = triggerRunCfg( flags, menu = testMenu )

Definition at line 889 of file TriggerConfig.py.

◆ AtlasVersion

python.TriggerConfig.AtlasVersion

Definition at line 881 of file TriggerConfig.py.

◆ f

python.TriggerConfig.f = open("TriggerRunConf.pkl","wb")

Definition at line 891 of file TriggerConfig.py.

◆ Files

python.TriggerConfig.Files

Definition at line 879 of file TriggerConfig.py.

◆ flags

python.TriggerConfig.flags = initConfigFlags()

Definition at line 877 of file TriggerConfig.py.

◆ forceEnableAllChains

python.TriggerConfig.forceEnableAllChains

Definition at line 878 of file TriggerConfig.py.