|
ATLAS Offline Software
|
◆ Run1Run2BSExtractionCfg()
def python.TriggerRecoConfig.Run1Run2BSExtractionCfg |
( |
|
flags | ) |
|
Configures Trigger data from BS extraction
Definition at line 248 of file TriggerRecoConfig.py.
249 """Configures Trigger data from BS extraction """
250 from SGComps.AddressRemappingConfig
import InputRenameCfg
253 extr = CompFactory.TrigBSExtraction()
257 extr.ExtraOutputs.add((
"TrigBSExtractionOutput",
"StoreGateSvc+TrigBSExtractionOutput"))
259 if flags.Trigger.decodeHLT:
261 if flags.Trigger.EDMVersion == 1
and flags.Trigger.doxAODConversion:
264 serialiserTool = CompFactory.TrigTSerializer()
265 acc.addPublicTool(serialiserTool)
266 extr.NavigationForL2 = CompFactory.HLT.Navigation(
"NavigationForL2",
267 ClassesFromPayloadIgnore = [
"TrigPassBits#passbits"])
269 extr.Navigation = CompFactory.HLT.Navigation(
"Navigation")
270 from TrigEDMConfig.TriggerEDM
import getEDMLibraries
272 from TrigEDMConfig.TriggerEDM
import getPreregistrationList
273 extr.Navigation.ClassesToPreregister =
getPreregistrationList(flags.Trigger.EDMVersion, flags.Trigger.doxAODConversion)
274 from eformat
import helper
as efh
276 if flags.Trigger.EDMVersion == 1:
277 acc.merge(
InputRenameCfg(
"HLT::HLTResult",
"HLTResult_L2",
"HLTResult_L2_BS"))
278 acc.merge(
InputRenameCfg(
"HLT::HLTResult",
"HLTResult_EF",
"HLTResult_EF_BS"))
279 robIDMap[
"HLTResult_L2_BS"] = efh.SourceIdentifier(efh.SubDetector.TDAQ_LVL2, 0).
code()
280 robIDMap[
"HLTResult_EF_BS"] = efh.SourceIdentifier(efh.SubDetector.TDAQ_EVENT_FILTER, 0).
code()
281 extr.L2ResultKeyIn =
"HLTResult_L2_BS"
282 extr.L2ResultKeyOut =
"HLTResult_L2"
283 extr.HLTResultKeyIn =
"HLTResult_EF_BS"
284 extr.HLTResultKeyOut =
"HLTResult_EF"
286 acc.merge(
InputRenameCfg(
"HLT::HLTResult",
"HLTResult_HLT",
"HLTResult_HLT_BS"))
287 robIDMap[
"HLTResult_HLT_BS"] = efh.SourceIdentifier(efh.SubDetector.TDAQ_HLT, 0).
code()
288 extr.HLTResultKeyIn =
"HLTResult_HLT_BS"
289 extr.HLTResultKeyOut =
"HLTResult_HLT"
292 if flags.Trigger.EDMVersion == 2:
293 stream = flags.Input.TriggerStream
294 if stream.startswith(
'calibration_DataScouting_'):
295 ds_tag =
'_'.
join(stream.split(
'_')[1:3])
296 ds_id =
int(stream.split(
'_')[2])
298 robIDMap[ds_tag+
"_BS"] = efh.SourceIdentifier(efh.SubDetector.TDAQ_HLT, ds_id).
code()
299 extr.DSResultKeysIn += [ ds_tag+
"_BS" ]
300 extr.DSResultKeysOut += [ ds_tag ]
303 log.info(
"Will not schedule real HLT bytestream extraction, instead EDM gap filling is running")
306 extr.HLTResultKeyIn =
""
307 extr.HLTResultKeyOut =
""
309 HLTResults = [ f
"HLT::HLTResult/{k}" for k
in robIDMap.keys() ]
310 acc.addService( CompFactory.ByteStreamAddressProviderSvc( TypeNames = HLTResults) )
312 from TrigEDMConfig.TriggerEDM
import getTPList
313 acc.addPublicTool( CompFactory.TrigSerTPTool(TPMap =
getTPList((flags.Trigger.EDMVersion))) )
315 acc.addPublicTool( CompFactory.TrigSerializeConvHelper(doTP =
True) )
317 acc.addPublicTool( CompFactory.HLT.HLTResultByteStreamTool(HLTResultRobIdMap = robIDMap))
319 acc.addEventAlgo(extr)
◆ Run1xAODConversionCfg()
def python.TriggerRecoConfig.Run1xAODConversionCfg |
( |
|
flags | ) |
|
Convert Run 1 EDM collections to xAOD classes
Definition at line 323 of file TriggerRecoConfig.py.
324 """Convert Run 1 EDM collections to xAOD classes"""
327 log.info(
"Will configure Run 1 trigger EDM to xAOD conversion")
328 from TrigEDMConfig.TriggerEDM
import getEFRun1BSList,getEFRun2EquivalentList,getL2Run1BSList,getL2Run2EquivalentList
330 from TrkConfig.TrkParticleCreatorConfig
import TrackParticleCreatorToolCfg
335 acc.addPublicTool(partCreatorTool)
337 from xAODTrackingCnv.xAODTrackingCnvConfig
import TrackCollectionCnvToolCfg,RecTrackParticleContainerCnvToolCfg
339 name=
"TrackCollectionCnvTool",
340 TrackParticleCreator= partCreatorTool
345 name=
"RecParticleCnv",
346 TrackParticleCreator=partCreatorTool
350 bstoxaodTool = CompFactory.TrigBStoxAODTool(
"BStoxAOD",
353 TrackCollectionCnvTool = trackCollCnvTool,
354 TrackParticleContainerCnvTool = recPartCnvTool
356 acc.setPrivateTools(bstoxaodTool)
◆ Run2Run1NavigationSlimmingCfg()
def python.TriggerRecoConfig.Run2Run1NavigationSlimmingCfg |
( |
|
flags | ) |
|
Configures legacy Run1/2 navigation slimming
Definition at line 202 of file TriggerRecoConfig.py.
203 """Configures legacy Run1/2 navigation slimming"""
206 if flags.Trigger.decodeHLT
is False:
207 log.debug(
"Run2Run1NavigationSlimmingCfg: Nothing to do as Trigger.decodeHLT is False")
210 if flags.Trigger.doNavigationSlimming
is False:
211 log.debug(
"Run2Run1NavigationSlimmingCfg: Nothing to do as Trigger.doNavigationSlimming is False")
214 if flags.Trigger.EDMVersion >= 3:
215 log.debug(
"Run2Run1NavigationSlimmingCfg: Nothing to do for EDMVersion >= 3.")
218 if flags.Trigger.ExtraEDMList:
219 log.warning(
"Run2Run1NavigationSlimmingCfg: ExtraEDMList only works for Run 3 and beyond")
222 return list(y.split(
'-')[0]
for x
in edm.values()
for y
in x)
223 from TrigNavTools.TrigNavToolsConfig
import TrigNavigationThinningSvcCfg
225 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
227 if flags.Output.doWriteAOD:
230 {
'name' :
'HLTNav_StreamAOD',
231 'mode' :
'cleanup_noreload',
232 'result' :
'HLTResult_HLT',
233 'features' :
_flatten(_TriggerAODList)}))
234 acc.merge(
OutputStreamCfg(flags,
"AOD", trigNavThinningSvc = thinningSvc))
236 if flags.Output.doWriteESD:
239 {
'name' :
'HLTNav_StreamESD',
240 'mode' :
'cleanup_noreload',
241 'result' :
'HLTResult_HLT',
242 'features' :
_flatten(_TriggerESDList)}))
243 acc.merge(
OutputStreamCfg(flags,
"ESD", trigNavThinningSvc = thinningSvc))
◆ Run3TriggerBSUnpackingCfg()
def python.TriggerRecoConfig.Run3TriggerBSUnpackingCfg |
( |
|
flags | ) |
|
Configures conversions BS -> HLTResultMT -> Collections
Definition at line 364 of file TriggerRecoConfig.py.
365 """Configures conversions BS -> HLTResultMT -> Collections """
368 if flags.Trigger.decodeHLT
is False:
369 log.debug(
"Run3TriggerBSUnpackingCfg: Nothing to do as Trigger.decodeHLT is False")
372 from AthenaCommon.CFElements
import seqAND
373 from TrigEDMConfig.DataScoutingInfo
import (
374 getDataScoutingStreams, getDataScoutingTypeFromStream,
375 getFullHLTResultID, getDataScoutingResultID,
377 from TriggerJobOpts.TriggerConfig
import triggerEDMGapFillerCfg
378 from TrigDecisionTool.TrigDecisionToolConfig
import getRun3NavigationContainerFromInput
385 log.info(f
'Configuring BS decoding/deserialisation of HLT result for \'{dstype}\' only')
394 log.debug(
'Configuring BS decoding of all HLT results and deserialisation of full HLT')
395 partialHLT_streams = [
398 partialHLT_dstypes = [
404 log.debug(f
'Configuring BS decoding and deserialisation of all HLT results: full HLT + {partialHLT_dstypes}')
406 ids_to_decode += partialHLT_dsids
408 id_to_deserialise.update({
409 dstype:dsid
for dstype,dsid
in zip(partialHLT_dstypes, partialHLT_dsids)
412 decoder = CompFactory.HLTResultMTByteStreamDecoderAlg(ModuleIdsToDecode=ids_to_decode)
413 acc.addSequence(
seqAND(
"HLTDecodingSeq"))
414 acc.addEventAlgo( decoder,
"HLTDecodingSeq")
415 for dstype, id
in id_to_deserialise.items():
416 deserialiser = CompFactory.TriggerEDMDeserialiserAlg(
417 f
"TrigDeserialiser{dstype}",
422 deserialiser.ExtraOutputs.add((
'xAOD::TrigCompositeContainer' ,
'StoreGateSvc+DummyForGapFiller'))
424 deserialiser.SkipDuplicateRecords =
True
425 deserialiser.PermitMissingModule =
True
426 acc.addEventAlgo( deserialiser,
"HLTDecodingSeq")
432 flags, edmSet=[
'BS'],
433 extraInputs=[(
'xAOD::TrigCompositeContainer' ,
'StoreGateSvc+DummyForGapFiller')],
435 'xAOD::TrigCompositeContainer',
441 acc.merge( gapFiller,
"HLTDecodingSeq" )
443 log.debug(
"Configured HLT result BS decoding sequence")
◆ TriggerEDMCfg()
def python.TriggerRecoConfig.TriggerEDMCfg |
( |
|
flags | ) |
|
Configures which trigger collections are recorded
Definition at line 143 of file TriggerRecoConfig.py.
144 """Configures which trigger collections are recorded"""
148 if flags.Output.doWriteESD
is False and flags.Output.doWriteAOD
is False:
149 log.debug(
"TriggerEDMCfg: Nothing to do as both Output.doWriteAOD and Output.doWriteESD are False")
155 menuMetadata = [
"xAOD::TriggerMenuJsonContainer#*",
"xAOD::TriggerMenuJsonAuxContainer#*",]
156 if flags.Trigger.EDMVersion
in [1,2]:
157 menuMetadata += [
'xAOD::TriggerMenuAuxContainer#*',
'xAOD::TriggerMenuContainer#*',]
159 from TrigEDMConfig.TriggerEDM
import getLvl1ESDList, getLvl1AODList
163 edmVersion =
max(2, flags.Trigger.EDMVersion)
164 _TriggerESDList =
getTriggerEDMList(flags, key=flags.Trigger.ESDEDMSet, runVersion=edmVersion)
165 _TriggerAODList =
getTriggerEDMList(flags, key=flags.Trigger.AODEDMSet, runVersion=edmVersion)
166 log.debug(
"ESD EDM list: %s", _TriggerESDList)
167 log.debug(
"AOD EDM list: %s", _TriggerAODList)
173 not_in = [ element
for element
in _TriggerAODList
if element
not in _TriggerESDList ]
175 log.warning(
"In AOD list but not in ESD list: ")
178 log.info(
"AOD list is subset of ESD list - good.")
184 log.info(
"AOD content set according to the AODEDMSet flag: %s and EDM version %d", flags.Trigger.AODEDMSet, flags.Trigger.EDMVersion)
186 if flags.Trigger.EDMVersion == 3
and not flags.Trigger.doOnlineNavigationCompactification
and not flags.Trigger.doNavigationSlimming:
187 nav = [
'xAOD::TrigCompositeContainer#HLTNav*',
'xAOD::TrigCompositeAuxContainer#HLTNav*',]
191 jetSpecials = [
"JetKeyDescriptor#JetKeyMap",
"JetMomentMap#TrigJetRecMomentMap",]
192 acc.merge(
addToESD(flags, jetSpecials))
193 acc.merge(
addToAOD(flags, jetSpecials))
196 if flags.Output.doWriteAOD
and flags.Trigger.EDMVersion == 2:
197 from TrigRoiConversion.TrigRoiConversionConfig
import RoiWriterCfg
◆ TriggerMetadataWriterCfg()
def python.TriggerRecoConfig.TriggerMetadataWriterCfg |
( |
|
flags | ) |
|
Sets up access to HLT, L1, BGRP, Monitoring, HLT PS and L1 PS JSON files from 'FILE' or 'DB', writes JSON to metaStore and keys to eventStore
Definition at line 132 of file TriggerRecoConfig.py.
133 """Sets up access to HLT, L1, BGRP, Monitoring, HLT PS and L1 PS JSON files from 'FILE' or 'DB', writes JSON to metaStore and keys to eventStore"""
136 if flags.Trigger.triggerConfig !=
'INFILE':
138 keyWriterTool = CompFactory.TrigConf.KeyWriterTool(
"KeyWriterToolOffline")
139 keyWriterOutput =
str(keyWriterTool.ConfKeys)
140 acc.addEventAlgo( CompFactory.TrigConf.xAODMenuWriterMT(
"xAODMenuWriterMT", KeyWriterTool = keyWriterTool) )
141 return acc, keyWriterOutput
◆ TriggerRecoCfg()
def python.TriggerRecoConfig.TriggerRecoCfg |
( |
|
flags | ) |
|
◆ TriggerRecoCfgData()
def python.TriggerRecoConfig.TriggerRecoCfgData |
( |
|
flags | ) |
|
Configures trigger data decoding
Run 3 data:
HLTResultMTByteStreamDecoderAlg -> TriggerEDMDeserialiserAlg
Run 2 data:
TrigBSExtraction -> TrigDecisionMaker -> DecisionConv to xAOD -> NavigationConv to xAOD
Run 1 data:
as for Run 2 + Run 1 EDM to xAOD conversion
Definition at line 23 of file TriggerRecoConfig.py.
25 Configures trigger data decoding
27 HLTResultMTByteStreamDecoderAlg -> TriggerEDMDeserialiserAlg
30 TrigBSExtraction -> TrigDecisionMaker -> DecisionConv to xAOD -> NavigationConv to xAOD
33 as for Run 2 + Run 1 EDM to xAOD conversion
35 log.debug(
"TriggerRecoCfgData: Preparing the trigger handling of reconstruction of data")
38 if flags.Trigger.L1.doMuon
or flags.Trigger.L1.doCalo
or flags.Trigger.L1.doTopo
or flags.Trigger.L1.doCTP:
42 acc.merge( metadataAcc )
45 if flags.Trigger.EDMVersion >= 3:
48 from TrigDecisionMaker.TrigDecisionMakerConfig
import Run3DecisionMakerCfg
51 if flags.Trigger.doNavigationSlimming:
52 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import TrigNavSlimmingMTCfg
56 elif flags.Trigger.EDMVersion
in [1, 2]:
59 from TrigDecisionMaker.TrigDecisionMakerConfig
import Run1Run2DecisionMakerCfg
64 raise RuntimeError(
"Invalid EDMVersion=%s " % flags.Trigger.EDMVersion)
67 if flags.Trigger.enableL1CaloLegacy:
68 from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig
import RoIBResultToxAODCfg
70 acc.merge( xRoIBResultAcc )
72 if flags.Input.Format
is Format.BS
and flags.Input.DataYear < 2024:
73 from L1TopoByteStream.L1TopoByteStreamConfig
import L1TopoRawDataContainerBSCnvCfg
75 topoEDM = [
'xAOD::L1TopoRawDataContainer#L1TopoRawData',
76 'xAOD::L1TopoRawDataAuxContainer#L1TopoRawDataAux.']
◆ TriggerRecoCfgMC()
def python.TriggerRecoConfig.TriggerRecoCfgMC |
( |
|
flags | ) |
|
Configures trigger MC handing during reconstruction
Note that a lot of the T0 handling of the trigger output for data is bundled into
the RDO to RDO_TRIG sub-step for MC, hence there is much less to do here for MC.
Notably: the xAOD::TrigDecision and all metadata should already be in the RDO_TRIG.
Run 3 MC:
Propagation of Run 3 HLT collections from input RDO_TRIG to output POOL files.
Execution of Run-3 reconstruction-level trigger navigation slimming.
Run 2 MC:
Propagation of Run 2 HLT collections from input RDO_TRIG to output POOL files.
Execution of Run 2 style reconstruction-level trigger navigation slimming.
Optional conversion of Run 2 navigation to Run 3 navigation.
Optional execution of Run 3 reconstruction-level trigger navigation slimming on conversion output.
Run 1 MC:
No current workflows are able to run the Run 1 trigger MC simulation. Unsupported.
Work would be needed here to do the xAOD conversion (see Run1xAODConversionCfg for how this is done for data)
Definition at line 84 of file TriggerRecoConfig.py.
86 Configures trigger MC handing during reconstruction
87 Note that a lot of the T0 handling of the trigger output for data is bundled into
88 the RDO to RDO_TRIG sub-step for MC, hence there is much less to do here for MC.
89 Notably: the xAOD::TrigDecision and all metadata should already be in the RDO_TRIG.
92 Propagation of Run 3 HLT collections from input RDO_TRIG to output POOL files.
93 Execution of Run-3 reconstruction-level trigger navigation slimming.
96 Propagation of Run 2 HLT collections from input RDO_TRIG to output POOL files.
97 Execution of Run 2 style reconstruction-level trigger navigation slimming.
98 Optional conversion of Run 2 navigation to Run 3 navigation.
99 Optional execution of Run 3 reconstruction-level trigger navigation slimming on conversion output.
102 No current workflows are able to run the Run 1 trigger MC simulation. Unsupported.
103 Work would be needed here to do the xAOD conversion (see Run1xAODConversionCfg for how this is done for data)
107 if flags.Input.Format
is Format.BS:
108 log.warning(
"TriggerRecoCfgMC does not currently support MC files encoded as bytestream. Switching off handling of trigger inputs.")
110 if flags.Trigger.EDMVersion == 1:
111 log.warning(
"TriggerRecoCfgMC does not currently support MC files with Run 1 trigger payload. Switching off handling of trigger inputs.")
114 log.debug(
"TriggerRecoCfgMC: Preparing the trigger handling of reconstruction of MC")
121 from TrigNavTools.NavConverterConfig
import NavConverterCfg
125 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import TrigNavSlimmingMTCfg
◆ acc
python.TriggerRecoConfig.acc |
◆ args
python.TriggerRecoConfig.args |
◆ AtlasVersion
python.TriggerRecoConfig.AtlasVersion |
◆ Files
python.TriggerRecoConfig.Files |
◆ flags
python.TriggerRecoConfig.flags |
◆ log
python.TriggerRecoConfig.log |
◆ MaxEvents
python.TriggerRecoConfig.MaxEvents |
◆ withDetails
python.TriggerRecoConfig.withDetails |
def TrigConfigSvcCfg(flags)
def Run3DecisionMakerCfg(flags)
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
def TriggerRecoCfgMC(flags)
def TrackParticleCreatorToolCfg(flags, name="InDetxAODParticleCreatorTool", **kwargs)
InDet/ITk #####.
def triggerEDMGapFillerCfg(flags, edmSet, decObj=[], decObjHypoOut=[], extraInputs=[], extraOutputs=[])
def Run3TriggerBSUnpackingCfg(flags)
def edmDictToList(edmDict)
def TriggerRecoCfgData(flags)
def ByteStreamReadCfg(flags, type_names=None)
def RoIBResultToxAODCfg(flags)
def getDataScoutingResultID(name)
def getTriggerEDMList(flags, key, runVersion=-1)
def _flatten(l, fn, val=[])
def TrackCollectionCnvToolCfg(flags, name="TrackCollectionCnvTool", **kwargs)
TrackCollectionCnvTool.
def seqAND(name, subs=[])
def getDataScoutingTypeFromStream(streamname)
def L1TopoRawDataContainerBSCnvCfg(flags)
def getDataScoutingStreams()
def TriggerMetadataWriterCfg(flags)
def Run2Run1NavigationSlimmingCfg(flags)
def addToESD(flags, itemOrList, **kwargs)
def getL2Run2EquivalentList()
std::string join(const std::vector< std::string > &v, const char c=',')
def RecTrackParticleContainerCnvToolCfg(flags, name="RecTrackParticleContainerCnvTool", **kwargs)
RecTrackParticleContainerCnvTool.
def getEFRun2EquivalentList()
def getPreregistrationList(version=2, doxAODConversion=True)
def TrigNavSlimmingMTCfg(flags)
def Run1Run2DecisionMakerCfg(flags)
def TriggerRecoCfg(flags)
def addToAOD(flags, itemOrList, **kwargs)
def Run1Run2BSExtractionCfg(flags)
def L1TriggerByteStreamDecoderCfg(flags, returnEDM=False)
def Run1xAODConversionCfg(flags)
def NavConverterCfg(flags, chainsList=[], runTheChecker=False)
def InputRenameCfg(type, from_name, to_name)