3 from TriggerMenuMT.HLT.Config.MenuComponents
import MenuSequence, SelectionCA, InViewRecoCA
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
6 from TrigEDMConfig.TriggerEDM
import recordable
7 from TrigInDetConfig.utils
import getFlagsForActiveConfig
9 from AthenaCommon.Logging
import logging
10 log = logging.getLogger(__name__)
22 '''Calorimeter-only reconstruction and hypothesis (BRT-calibrated pT cut)'''
27 recoAcc = InViewRecoCA(name=
'tauCaloMVA', InViewRoIs=
'CaloMVA_RoIs', isProbe=is_probe_leg)
28 RoIs = recoAcc.inputMaker().InViewRoIs
33 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
34 name=f
'{recoAcc.name}RecoVDV',
36 (
'TrigRoiDescriptorCollection', f
'StoreGateSvc+{RoIs}'),
37 (
'xAOD::EventInfo',
'StoreGateSvc+EventInfo'),
38 (
'SG::AuxElement',
'StoreGateSvc+EventInfo.actualInteractionsPerCrossing'),
39 (
'SG::AuxElement',
'StoreGateSvc+EventInfo.averageInteractionsPerCrossing'),
40 (
'CaloBCIDAverage',
'StoreGateSvc+CaloBCIDAverage'),
48 from TrigCaloRec.TrigCaloRecConfig
import tauTopoClusteringCfg
52 from TrigTauRec.TrigTauRoIToolsConfig
import tauCaloRoiUpdaterCfg
53 recoAcc.mergeReco(
tauCaloRoiUpdaterCfg(flags, inputRoIs=RoIs, clusters=
'HLT_TopoCaloClustersLC'))
56 from TrigTauRec.TrigTauRecConfig
import trigTauRecMergedCaloMVACfg
61 from TrigGenericAlgs.TrigGenericAlgsConfig
import ROBPrefetchingAlgCfg_Calo
62 robPrefetchAlg =
ROBPrefetchingAlgCfg_Calo(flags, nameSuffix=f
'IM_{recoAcc.name}_probe' if is_probe_leg
else f
'IM_{recoAcc.name}')
67 selAcc = SelectionCA(
'tauCalo', isProbe=is_probe_leg)
68 selAcc.mergeReco(recoAcc, robPrefetchCA=robPrefetchAlg)
73 selAcc.addHypoAlgo(CompFactory.TrigTauCaloHypoAlg(
'TauCaloMVAHypoAlg', TauJetsKey=
'HLT_TrigTauRecMerged_CaloMVAOnly'))
78 from TrigTauHypo.TrigTauHypoTool
import TrigTauCaloMVAHypoToolFromDict
79 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauCaloMVAHypoToolFromDict)
90 '''1st FTF step sequence, for both the tauCore and tauLRT RoIs'''
92 if name
not in [
'Core',
'LRT']:
93 raise ValueError(
'Invalid name')
97 newRoITool = CompFactory.ViewCreatorFetchFromViewROITool(
98 RoisWriteHandleKey=
recordable(flags.Tracking.ActiveConfig.roi),
99 InViewRoIs=
'UpdatedCaloRoI',
101 RoIEtaWidth=flags.Tracking.ActiveConfig.etaHalfWidth,
102 RoIPhiWidth=flags.Tracking.ActiveConfig.phiHalfWidth,
103 RoIZedWidth=flags.Tracking.ActiveConfig.zedHalfWidth,
109 from TriggerJobOpts.TriggerConfigFlags
import ROBPrefetching
110 if doExtraPrefetching := name ==
'Core' and ROBPrefetching.TauCoreLargeRoI
in flags.Trigger.ROBPrefetchingOptions:
111 prefetchRoIUpdater = CompFactory.RoiUpdaterTool(
114 EtaWidth=flags.Trigger.InDetTracking.tauIso.etaHalfWidth,
115 PhiWidth=flags.Trigger.InDetTracking.tauIso.phiHalfWidth,
116 ZedWidth=flags.Trigger.InDetTracking.tauIso.zedHalfWidth,
119 prefetchRoITool = CompFactory.ViewCreatorExtraPrefetchROITool(
120 RoiCreator=newRoITool,
121 RoiUpdater=prefetchRoIUpdater,
122 ExtraPrefetchRoIsKey=f
'{newRoITool.RoisWriteHandleKey}_forPrefetching',
123 PrefetchRoIsLinkName=
'prefetchRoI',
124 MergeWithOriginal=
True,
131 recoAcc = InViewRecoCA(
132 f
'tauFastTrack{name}',
133 RoITool=prefetchRoITool
if doExtraPrefetching
else newRoITool,
134 ViewFallThrough=
True,
135 RequireParentView=
True,
136 mergeUsingFeature=
True,
139 RoIs = recoAcc.inputMaker().InViewRoIs
144 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
145 name=f
'{recoAcc.name}RecoVDV',
147 (
'TrigRoiDescriptorCollection', f
'StoreGateSvc+{RoIs}'),
155 from TrigInDetConfig.TrigInDetConfig
import trigInDetFastTrackingCfg
159 TrackCollection = flags.Tracking.ActiveConfig.trkTracks_FTF
161 from TrigTauRec.TrigTauRoIToolsConfig
import tauTrackRoiUpdaterCfg
164 from TrigTauRec.TrigTauRoIToolsConfig
import tauLRTRoiUpdaterCfg
169 from TrigGenericAlgs.TrigGenericAlgsConfig
import ROBPrefetchingAlgCfg_Si
171 if doExtraPrefetching:
172 robPrefetchAlg.RoILinkName = prefetchRoITool.PrefetchRoIsLinkName
177 selAcc = SelectionCA(f
'tauFTF{name}', isProbe=is_probe_leg)
178 selAcc.mergeReco(recoAcc, robPrefetchCA=robPrefetchAlg)
183 selAcc.addHypoAlgo(CompFactory.TrigTauFastTrackHypoAlg(
184 f
'TauFastTrackHypoAlg_PassBy{name}',
185 RoIForIDReadHandleKey=
'UpdatedTrackLRTRoI' if name ==
'LRT' else '',
186 FastTracksKey=TrackCollection
192 from TrigTauHypo.TrigTauHypoTool
import TrigTauFastTrackHypoToolFromDict
193 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauFastTrackHypoToolFromDict)
203 return _ftfCoreSeq(newflags, name=
'Core', is_probe_leg=is_probe_leg)
211 return _ftfCoreSeq(newflags, name=
'LRT', is_probe_leg=is_probe_leg)
220 '''2nd FTF step sequence, for the tauIso RoI'''
222 if name
not in [
'Iso']:
223 raise ValueError(
'Invalid name')
227 newRoITool = CompFactory.ViewCreatorFetchFromViewROITool(
228 RoisWriteHandleKey=
recordable(flags.Tracking.ActiveConfig.roi),
229 InViewRoIs=
'UpdatedTrackRoI'
236 recoAcc = InViewRecoCA(
237 f
'tauFastTrack{name}',
239 RequireParentView=
True,
240 ViewFallThrough=
True,
243 RoIs = recoAcc.inputMaker().InViewRoIs
248 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
249 name=f
'{recoAcc.name}RecoVDV',
251 (
'TrigRoiDescriptorCollection', f
'StoreGateSvc+{RoIs}'),
252 (
'TrackCollection', f
'StoreGateSvc+{flags.Trigger.InDetTracking.tauCore.trkTracks_FTF}'),
260 from TrigInDetConfig.TrigInDetConfig
import trigInDetFastTrackingCfg
267 from TriggerJobOpts.TriggerConfigFlags
import ROBPrefetching
268 if name ==
'Iso' and ROBPrefetching.TauCoreLargeRoI
in flags.Trigger.ROBPrefetchingOptions:
269 robPrefetchAlg =
None
271 from TrigGenericAlgs.TrigGenericAlgsConfig
import ROBPrefetchingAlgCfg_Si
276 selAcc = SelectionCA(f
'tauFTF{name}', isProbe=is_probe_leg)
277 selAcc.mergeReco(recoAcc, robPrefetchCA=robPrefetchAlg)
282 selAcc.addHypoAlgo(CompFactory.TrigTauFastTrackHypoAlg(
283 f
'TauFastTrackHypoAlg_PassBy{name}',
284 FastTracksKey=flags.Tracking.ActiveConfig.trkTracks_FTF,
290 from TrigTauHypo.TrigTauHypoTool
import TrigTauFastTrackHypoToolFromDict
291 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauFastTrackHypoToolFromDict)
301 return _ftfTauIsoSeq(newflags, name=
'Iso', is_probe_leg=is_probe_leg)
310 '''Precision Tracking step sequence, for both the tauIso and tauLRT RoIs'''
312 if name
not in [
'Iso',
'LRT']:
313 raise ValueError(
'Invalid name')
319 recoAcc = InViewRecoCA(
320 name=f
'tauPrecTrack{name}',
321 RoITool=CompFactory.ViewCreatorPreviousROITool(),
322 InViewRoIs=f
'tauFastTrack{name}',
323 RequireParentView=
True,
324 ViewFallThrough=
True,
325 isProbe=is_probe_leg,
327 RoIs = recoAcc.inputMaker().InViewRoIs
332 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
333 name=f
'{recoAcc.name}RecoVDV',
335 (
'TrigRoiDescriptorCollection', f
'StoreGateSvc+{RoIs}'),
336 (
'SG::AuxElement',
'StoreGateSvc+EventInfo.averageInteractionsPerCrossing'),
344 from TrigInDetConfig.TrigInDetConfig
import trigInDetPrecisionTrackingCfg
348 from TrigInDetConfig.TrigInDetConfig
import trigInDetVertexingCfg
349 recoAcc.mergeReco(
trigInDetVertexingCfg(flags, flags.Tracking.ActiveConfig.tracks_IDTrig, flags.Tracking.ActiveConfig.vertex))
356 selAcc = SelectionCA(f
'tauPT{name}', isProbe=is_probe_leg)
357 selAcc.mergeReco(recoAcc)
362 selAcc.addHypoAlgo(CompFactory.TrigTauPrecTrackHypoAlg(
363 f
'TauPrecTrackHypoAlg_PassBy{name}',
364 TracksKey=flags.Tracking.ActiveConfig.tracks_IDTrig,
365 RoIForIDReadHandleKey=
'',
371 from TrigTauHypo.TrigTauHypoTool
import TrigTauPrecTrackHypoToolFromDict
372 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauPrecTrackHypoToolFromDict)
382 return _precTrackSeq(newflags, name=
'Iso', is_probe_leg=is_probe_leg)
390 return _precTrackSeq(newflags, name=
'LRT', is_probe_leg=is_probe_leg)
398 def _tauPrecisionSeq(flags, name, tau_ids: list[str], output_name=
None, is_probe_leg=
False):
399 '''Precision Tau step sequence, for all ID and reconstruction settings'''
402 InViewName =
'Iso' if 'LRT' not in name
else 'LRT'
407 recoAcc = InViewRecoCA(
408 name=f
'tauPrecisionReco_{name}',
409 RoITool=CompFactory.ViewCreatorPreviousROITool(),
410 InViewRoIs=f
'tauFastTrack{InViewName}',
411 RequireParentView=
True,
412 ViewFallThrough=
True,
413 isProbe=is_probe_leg,
415 RoIs = recoAcc.inputMaker().InViewRoIs
420 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
421 name=f
'{recoAcc.name}RecoVDV',
423 (
'TrigRoiDescriptorCollection', f
'StoreGateSvc+{RoIs}'),
424 (
'SG::AuxElement',
'StoreGateSvc+EventInfo.averageInteractionsPerCrossing'),
425 (
'xAOD::VertexContainer', f
'StoreGateSvc+{flags.Tracking.ActiveConfig.vertex}'),
426 (
'xAOD::TrackParticleContainer', f
'StoreGateSvc+{flags.Tracking.ActiveConfig.tracks_IDTrig}'),
427 (
'xAOD::TauTrackContainer',
'StoreGateSvc+HLT_tautrack_dummy'),
428 (
'xAOD::TauJetContainer',
'StoreGateSvc+HLT_TrigTauRecMerged_CaloMVAOnly'),
436 from TrigTauRec.TrigTauRecConfig
import trigTauRecMergedPrecisionMVACfg
442 input_tracks=flags.Tracking.ActiveConfig.tracks_IDTrig,
443 output_name=output_name,
449 selAcc = SelectionCA(f
'tauPrecision_{name}', isProbe=is_probe_leg)
450 selAcc.mergeReco(recoAcc)
456 selAcc.addHypoAlgo(CompFactory.TrigTauPrecisionHypoAlg(
457 f
'TauPrecisionHypoAlg_{name}',
458 TauJetsKey=f
'HLT_TrigTauRecMerged_{output_name if output_name else name}'
464 from TrigTauHypo.TrigTauHypoTool
import TrigTauPrecisionHypoToolFromDict
465 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauPrecisionHypoToolFromDict)
475 from TriggerMenuMT.HLT.Tau.TauConfigurationTools
import getPrecisionSequenceTauIDs
485 from TriggerMenuMT.HLT.Tau.TauConfigurationTools
import getPrecisionSequenceTauIDs