ATLAS Offline Software
Loading...
Searching...
No Matches
python.HLT.Tau.TauMenuSequences Namespace Reference

Functions

MenuSequence tauCaloMVASequenceGenCfg (AthConfigFlags flags, bool is_probe_leg=False, str jet='lc')
MenuSequence tauCaloHitsSequenceGenCfg (AthConfigFlags orig_flags, str seq_name, str precision_seq_name, tuple[str, float]|None hitz_config=None, bool is_probe_leg=False, str jet='lc')
MenuSequence tauFTFCoreSequenceGenCfg (AthConfigFlags orig_flags, str|None calohits_seq_name=None, bool do_lrt=False, bool is_probe_leg=False, str jet='lc')
 tauFTFIsoSequenceGenCfg (AthConfigFlags orig_flags, str|None calohits_seq_name=None, bool is_probe_leg=False, str jet='lc')
MenuSequence tauPrecTrackSequenceGenCfg (AthConfigFlags orig_flags, str|None calohits_seq_name=None, bool do_lrt=False, bool is_probe_leg=False, str jet='lc')
MenuSequence tauPrecisionSequenceGenCfg (AthConfigFlags orig_flags, str seq_name, str|None calohits_seq_name=None, str|None output_name=None, bool do_lrt=False, bool is_probe_leg=False, str jet='lc')

Variables

 log = logging.getLogger(__name__)

Function Documentation

◆ tauCaloHitsSequenceGenCfg()

MenuSequence tauCaloHitsSequenceGenCfg ( AthConfigFlags orig_flags,
str seq_name,
str precision_seq_name,
tuple[str, float] | None hitz_config = None,
bool is_probe_leg = False,
str jet = 'lc' )
Calorimeter+Hits RoI updating and preselection hypothesis

Definition at line 93 of file TauMenuSequences.py.

93def tauCaloHitsSequenceGenCfg(orig_flags: AthConfigFlags, seq_name: str, precision_seq_name: str, hitz_config: tuple[str, float] | None = None, is_probe_leg: bool = False, jet: str = 'lc') -> MenuSequence:
94 '''Calorimeter+Hits RoI updating and preselection hypothesis'''
95
96 tracking_cfg = f'tauHits{seq_name}'
97 next_tracking_cfg = f'tauCore{seq_name}'
98
99 flags = getFlagsForActiveConfig(orig_flags, tracking_cfg, log)
100
101 # Create new RoIs from 'UpdatedCaloLCRoI', resized to the HitZ RoI before running the HitZ and other inference algorithms
102 newRoITool = CompFactory.ViewCreatorFetchFromViewROITool(
103 RoisWriteHandleKey=recordable(flags.Tracking.ActiveConfig.roi),
104 InViewRoIs='UpdatedCaloLCRoI',
105 doResize=True,
106 RoIEtaWidth=flags.Tracking.ActiveConfig.etaHalfWidth,
107 RoIPhiWidth=flags.Tracking.ActiveConfig.phiHalfWidth,
108 RoIZedWidth=flags.Tracking.ActiveConfig.zedHalfWidth,
109 )
110
111
112 # Reconstruction sequence CA (parOR), executting all reco algorithms within the View (from the RoI)
113 # in parallel whenever possible, according to their data dependencies.
114 # Create the EventViews from the resized RoIs, based on the 'UpdatedCaloLCRoI' created in the CaloMVA step
115 recoAcc = InViewRecoCA(
116 name=f'tauCaloHits_{seq_name}',
117 RoITool=newRoITool,
118 ViewFallThrough=True,
119 RequireParentView=True,
120 mergeUsingFeature=True,
121 isProbe=is_probe_leg
122 )
123 RoIs = recoAcc.inputMaker().InViewRoIs
124
125
126 # VDV with all the required collections/objects in the View
127 # (the VDV checks are disabled unless running with -l DEBUG)
128 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
129 name=f'{recoAcc.name}RecoVDV',
130 DataObjects={
131 ('TrigRoiDescriptorCollection', f'StoreGateSvc+{RoIs}'),
132 ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
133 ('xAOD::TauJetContainer', 'StoreGateSvc+HLT_TrigTauRecMerged_CaloMVAOnly'),
134 ('xAOD::TauTrackContainer', 'StoreGateSvc+HLT_tautrack_dummy'),
135 }
136 ))
137
138
139 # Reconstruction tools/algorithms:
140
141 # Construct ID space-points in the View
142 from TrigInDetConfig.TrigInDetConfig import trigInDetSPFormationCfg
143 recoAcc.mergeReco(trigInDetSPFormationCfg(flags, roisKey=RoIs, signatureName=tracking_cfg))
144
145 # Create the high-level xAOD::TrackParticleValidation container from the SPs
146 if flags.Detector.GeometryITk:
147 from InDetConfig.InDetPrepRawDataToxAODConfig import ITkPixelPrepDataToxAODCfg as PixelPrepDataToxAODCfg
148 pixel_cluster_container = 'ITkTrigPixelClusters'
149 else:
150 from InDetConfig.InDetPrepRawDataToxAODConfig import InDetPixelPrepDataToxAODCfg as PixelPrepDataToxAODCfg
151 pixel_cluster_container = 'PixelTrigClusters'
152
153 recoAcc.mergeReco(PixelPrepDataToxAODCfg(
154 flags,
155 SiClusterContainer=pixel_cluster_container, # From the FTF SP reco
156 OutputClusterContainer='PixelClusters', # Output xAOD::TrackParticleValidation container
157 WriteNNinformation=False,
158 UseTruthInfo=False,
159 ))
160
161 # Get the BeamSpot from the conditions database
162 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
163 recoAcc.mergeReco(BeamSpotCondAlgCfg(flags))
164
165 # Construct the calo+hits TauJet, and run the HitZ inference algorithms
166 from TrigTauRec.TrigTauRecConfig import trigTauRecMergedCaloHitsCfg
167 from .TauConfigurationTools import getHitZAlgs, getCaloHitsPreselAlgs
168 recoAcc.mergeReco(trigTauRecMergedCaloHitsCfg(
169 flags,
170 seq_name,
171 hitz_algs=getHitZAlgs(flags, f'{precision_seq_name}_{seq_name}', precision_seq_name),
172 presel_algs=getCaloHitsPreselAlgs(flags, f'{precision_seq_name}_{seq_name}', precision_seq_name),
173 input_rois=RoIs,
174 jet=jet
175 ))
176
177
178 if hitz_config:
179 # Create new RoIs with an updated position, based on the central axis of the clusters
180 from TrigTauRec.TrigTauRoIToolsConfig import tauHitZRoiUpdaterCfg
181 recoAcc.mergeReco(tauHitZRoiUpdaterCfg(
182 flags,
183 inputRoIs=RoIs,
184 outputRoIs=f'UpdatedCaloHits{seq_name}RoI',
185 taus='HLT_TrigTauRecMerged_CaloHits',
186 hitz_alg=hitz_config[0],
187 max_pt=1000e3,
188 max_sigma=hitz_config[1],
189 tracking_cfg=next_tracking_cfg,
190 ))
191
192
193 # Selection sequence CA (seqAND), executing the recoAcc view creation alg. first,
194 # the reco CA (with all the reco algs) second, and the Hypo alg. at last
195 selAcc = SelectionCA(f'tauCaloHits_{seq_name}', isProbe=is_probe_leg)
196 selAcc.mergeReco(recoAcc)
197
198
199 # Hypothesis:
200 # The Hypotools in the Hypo algorithm will execute the BRT-calibrated Tau pT cut
201 selAcc.addHypoAlgo(CompFactory.TrigTauJetHypoAlg(f'TauCaloHitsHypoAlg_{seq_name}', TauJetsKey='HLT_TrigTauRecMerged_CaloHits'))
202
203
204 # Menu sequence, connecting everything internally for the step, and configuring the tools for the Hypo alg.
205 # based on the partDict for each chain tau leg
206 from TrigTauHypo.TrigTauHypoTool import TrigTauCaloHitsHypoToolFromDict
207 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauCaloHitsHypoToolFromDict)
208
209 return menuSeq
210
211
212
213#================================================================
214# 1st FTF step: FTFCore / FTFLRT
215#================================================================
216
217@AccumulatorCache

◆ tauCaloMVASequenceGenCfg()

MenuSequence tauCaloMVASequenceGenCfg ( AthConfigFlags flags,
bool is_probe_leg = False,
str jet = 'lc' )
Calorimeter-only reconstruction and hypothesis (BRT-calibrated pT cut)

Definition at line 22 of file TauMenuSequences.py.

22def tauCaloMVASequenceGenCfg(flags: AthConfigFlags, is_probe_leg: bool = False, jet: str = 'lc') -> MenuSequence:
23 '''Calorimeter-only reconstruction and hypothesis (BRT-calibrated pT cut)'''
24
25 # Reconstruction sequence CA (parOR), executting all reco algorithms within the View (from the RoI)
26 # in parallel whenever possible, according to their data dependencies.
27 # Create the EventViews based on the HLTSeeding RoIs (from the input L1 TOBs)
28 recoAcc = InViewRecoCA(name=f'tauCalo{jet.upper()}MVA', InViewRoIs='CaloMVA_RoIs', isProbe=is_probe_leg)
29 RoIs = recoAcc.inputMaker().InViewRoIs
30
31
32 # VDV with all the required collections/objects in the View
33 # (the VDV checks are disabled unless running with -l DEBUG)
34 Objects={
35 ('TrigRoiDescriptorCollection', f'StoreGateSvc+{RoIs}'),
36 ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
37 ('SG::AuxElement', 'StoreGateSvc+EventInfo.actualInteractionsPerCrossing'),
38 ('SG::AuxElement', 'StoreGateSvc+EventInfo.averageInteractionsPerCrossing'),
39 ('CaloBCIDAverage', 'StoreGateSvc+CaloBCIDAverage')
40 }
41 if ( not flags.Input.isMC ):
42 Objects.add( ('LArDeadOTXFromSC' , 'StoreGateSvc+DeadOTXFromSC' ) )
43 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
44 name=f'{recoAcc.name}RecoVDV',
45 DataObjects=Objects
46 ))
47
48
49 # Reconstruction tools/algorithms:
50
51 if jet == 'lc':
52 # Topo-clustering
53 from TrigCaloRec.TrigCaloRecConfig import tauLCTopoClusteringCfg
54 recoAcc.mergeReco(tauLCTopoClusteringCfg(flags, RoIs=RoIs))
55 else:
56 # Topo-clustering
57 from TrigCaloRec.TrigCaloRecConfig import tauEMTopoClusteringCfg
58 recoAcc.mergeReco(tauEMTopoClusteringCfg(flags, RoIs=RoIs))
59
60 # Create new RoIs with an updated position, based on the central axis of the clusters
61 from TrigTauRec.TrigTauRoIToolsConfig import tauCaloRoiUpdaterCfg
62 recoAcc.mergeReco(tauCaloRoiUpdaterCfg(flags, inputRoIs=RoIs, clusters=f'HLT_TopoCaloClusters{jet.upper()}', jet=jet))
63
64 # Construct the calo-only TauJet (with BRT calibration)
65 from TrigTauRec.TrigTauRecConfig import trigTauRecMergedCaloMVACfg
66 recoAcc.mergeReco(trigTauRecMergedCaloMVACfg(flags, jet=jet))
67
68 # Selection sequence CA (seqAND), executing the recoAcc view creation alg. first, the rob prefetching alg. second,
69 # the reco CA (with all the reco algs) after, and the Hypo alg. at last
70 selAcc = SelectionCA(f'tauCalo{jet.upper()}', isProbe=is_probe_leg)
71 selAcc.mergeReco(recoAcc)
72
73 # Hypothesis:
74 # The Hypotools in the Hypo algorithm will execute the BRT-calibrated Tau pT cut
75 if jet == 'lc':
76 selAcc.addHypoAlgo(CompFactory.TrigTauJetHypoAlg('TauCaloMVAHypoAlg', TauJetsKey='HLT_TrigTauRecMerged_CaloMVAOnly'))
77 else:
78 selAcc.addHypoAlgo(CompFactory.TrigTauJetHypoAlg('TauCaloEMHypoAlg', TauJetsKey='HLT_TrigTauRecMerged_CaloEMOnly'))
79
80 # Menu sequence, connecting everything internally for the step, and configuring the tools for the Hypo alg.
81 # based on the partDict for each chain tau leg
82 from TrigTauHypo.TrigTauHypoTool import TrigTauCaloMVAHypoToolFromDict
83 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauCaloMVAHypoToolFromDict)
84
85 return menuSeq
86
87
88
89#================================================================
90# Calo + Hits step: HitZ + Calo+Hits preselection
91#================================================================
92@AccumulatorCache

◆ tauFTFCoreSequenceGenCfg()

MenuSequence tauFTFCoreSequenceGenCfg ( AthConfigFlags orig_flags,
str | None calohits_seq_name = None,
bool do_lrt = False,
bool is_probe_leg = False,
str jet = 'lc' )
1st FTF step sequence, for both the tauCore(Hits) and tauLRT RoIs

Definition at line 218 of file TauMenuSequences.py.

218def tauFTFCoreSequenceGenCfg(orig_flags: AthConfigFlags, calohits_seq_name: str | None = None, do_lrt: bool = False, is_probe_leg: bool = False, jet: str = 'lc') -> MenuSequence:
219 '''1st FTF step sequence, for both the tauCore(Hits) and tauLRT RoIs'''
220
221 if do_lrt:
222 name = 'LRT'
223 tracking_cfg = next_tracking_cfg = 'tauLRT'
224 output_rois = 'UpdatedTrackLRTRoI'
225 elif jet=='em':
226 name = 'CoreEM'
227 tracking_cfg = 'tauCoreEM'
228 next_tracking_cfg = 'tauIsoEM'
229 output_rois = 'UpdatedTrackEMRoI'
230 else:
231 name = 'Core'
232 tracking_cfg = 'tauCore'
233 next_tracking_cfg = 'tauIso'
234 output_rois = 'UpdatedTrackRoI'
235
236 if calohits_seq_name:
237 tracking_cfg = f'tauCore{calohits_seq_name}'
238 next_tracking_cfg = f'tauIso{calohits_seq_name}'
239
240 # Retrieve tracking configuration
241 flags = getFlagsForActiveConfig(orig_flags, tracking_cfg, log)
242
243 # Source-dependent configuration
244 if calohits_seq_name:
245 name = f'Core_{calohits_seq_name}'
246 input_rois = f'UpdatedCaloHits{calohits_seq_name}RoI'
247 output_rois = f'UpdatedTrack{calohits_seq_name}RoI'
248 else:
249 input_rois = 'UpdatedCaloEMRoI' if jet=='em' else 'UpdatedCaloLCRoI'
250
251
252 # Create new RoIs from 'UpdatedCaloLC/EMRoI' or 'UpdatedCaloHitsRoI, resized to 'tauCore/LRT'
253 # before running the FTF algorithms.
254 newRoITool = CompFactory.ViewCreatorFetchFromViewROITool(
255 RoisWriteHandleKey=recordable(flags.Tracking.ActiveConfig.roi),
256 InViewRoIs=input_rois,
257 doResize=not calohits_seq_name, # Do not resize if we're using the CaloHits RoI, which is already resized to the correct size for the FTF step
258 RoIEtaWidth=flags.Tracking.ActiveConfig.etaHalfWidth,
259 RoIPhiWidth=flags.Tracking.ActiveConfig.phiHalfWidth,
260 RoIZedWidth=flags.Tracking.ActiveConfig.zedHalfWidth,
261 )
262
263
264 # Reconstruction sequence CA (parOR), executting all reco algorithms within the View (from the RoI)
265 # in parallel whenever possible, according to their data dependencies.
266 # Create the EventViews from the resized RoIs, based on the upstream RoI created in the CaloMVA or CaloHits steps
267 recoAcc = InViewRecoCA(
268 f'tauFastTrack{name}',
269 RoITool=newRoITool,
270 ViewFallThrough=True,
271 RequireParentView=True,
272 mergeUsingFeature=True,
273 isProbe=is_probe_leg
274 )
275 RoIs = recoAcc.inputMaker().InViewRoIs
276
277
278 # VDV with all the required collections/objects in the View
279 # (the VDV checks are disabled unless running with -l DEBUG)
280 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
281 name=f'{recoAcc.name}RecoVDV',
282 DataObjects={
283 ('TrigRoiDescriptorCollection', f'StoreGateSvc+{RoIs}'),
284 }
285 ))
286
287
288 # Reconstruction tools/algorithms:
289
290 # Fast Track Finder (FTF) sequence (the main point of this step)
291 from TrigInDetConfig.TrigInDetConfig import trigInDetFastTrackingCfg
292 recoAcc.mergeReco(trigInDetFastTrackingCfg(flags, roisKey=RoIs, signatureName=tracking_cfg))
293
294 # Create new RoIs for the next tracking steps (FTFIso and PrecTrack), based on the found tracks
295 TrackCollection = flags.Tracking.ActiveConfig.tracks_FTF
296
297
298 from TrigTauRec.TrigTauRoIToolsConfig import tauTrackRoiUpdaterCfg
299 recoAcc.mergeReco(tauTrackRoiUpdaterCfg(
300 flags,
301 inputRoIs=RoIs,
302 outputRoIs=output_rois,
303 tracks=TrackCollection,
304
305 # Only pass the next tracking config if it's different from the current one (ActiveConfig),
306 tracking_cfg=next_tracking_cfg if next_tracking_cfg != tracking_cfg else None,
307 ))
308
309
310 # Selection sequence CA (seqAND), executing the recoAcc view creation alg. first,
311 # the reco CA (with all the reco algs) second, and the Hypo alg. at last
312 selAcc = SelectionCA(f'tauFTF{name}', isProbe=is_probe_leg)
313 selAcc.mergeReco(recoAcc)
314
315
316 # Hypothesis:
317 # The hypothesis algorithm/tool does not perform any action (online monitoring of tracks only)
318 selAcc.addHypoAlgo(CompFactory.TrigTauTrackingHypoAlg(
319 f'TauFastTrackHypoAlg_PassBy{name}',
320 RoIKey='UpdatedTrackLRTRoI' if do_lrt else '',
321 TracksKey=TrackCollection,
322 ))
323
324
325 # Menu sequence, connecting everything internally for the step, and configuring the tools for the Hypo alg.
326 # based on the partDict for each chain tau leg
327 from TrigTauHypo.TrigTauHypoTool import TrigTauTrackingHypoToolFromDict
328 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauTrackingHypoToolFromDict)
329
330 return menuSeq
331
332
333
334#================================================================
335# 2nd FTF step: FTFIso
336#================================================================
337
338@AccumulatorCache

◆ tauFTFIsoSequenceGenCfg()

tauFTFIsoSequenceGenCfg ( AthConfigFlags orig_flags,
str | None calohits_seq_name = None,
bool is_probe_leg = False,
str jet = 'lc' )
2nd FTF step sequence, for the tauIso RoI

Definition at line 339 of file TauMenuSequences.py.

339def tauFTFIsoSequenceGenCfg(orig_flags: AthConfigFlags, calohits_seq_name: str | None = None, is_probe_leg: bool = False, jet: str = 'lc'):
340 '''2nd FTF step sequence, for the tauIso RoI'''
341
342 name = 'IsoEM' if jet=='em' else 'Iso'
343
344 # Retrieve tracking configuration
345 previous_tracking_cfg = 'tauCoreEM' if jet=='em' else 'tauCore'
346 tracking_cfg = 'tauIsoEM' if jet=='em' else 'tauIso'
347 if calohits_seq_name:
348 tracking_cfg = f'tauIso{calohits_seq_name}'
349 previous_tracking_cfg = f'tauCore{calohits_seq_name}'
350
351 flags = getFlagsForActiveConfig(orig_flags, tracking_cfg, log)
352
353
354 # Source-dependent configuration
355 if calohits_seq_name:
356 name = f'Iso_{calohits_seq_name}'
357 input_rois = f'UpdatedTrack{calohits_seq_name}RoI'
358 else:
359 input_rois = 'UpdatedTrackEMRoI' if jet=='em' else 'UpdatedTrackRoI'
360
361
362 # Create new RoIs from , resized to 'tauCore/LRT' before running the FTF algorithms
363 newRoITool = CompFactory.ViewCreatorFetchFromViewROITool(
364 RoisWriteHandleKey=recordable(flags.Tracking.ActiveConfig.roi),
365 InViewRoIs=input_rois,
366 )
367
368
369 # Reconstruction sequence CA (parOR), executting all reco algorithms within the View (from the RoI)
370 # in parallel whenever possible, according to their data dependencies.
371 # Create the EventViews based on the RoIs created in the previous step
372 recoAcc = InViewRecoCA(
373 f'tauFastTrack{name}',
374 RoITool=newRoITool,
375 RequireParentView=True,
376 ViewFallThrough=True,
377 isProbe=is_probe_leg
378 )
379 RoIs = recoAcc.inputMaker().InViewRoIs
380
381
382 # VDV with all the required collections/objects in the View
383 # (the VDV checks are disabled unless running with -l DEBUG)
384 previous_step_flags = getFlagsForActiveConfig(orig_flags, previous_tracking_cfg, log)
385 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
386 name=f'{recoAcc.name}RecoVDV',
387 DataObjects={
388 ('TrigRoiDescriptorCollection', f'StoreGateSvc+{RoIs}'),
389 ('xAOD::TrackParticleContainer', f'StoreGateSvc+{previous_step_flags.Tracking.ActiveConfig.tracks_FTF}'),
390 }
391 ))
392
393
394 # Reconstruction tools/algorithms:
395
396 # Fast Track Finder (FTF) sequence (the main point of this step)
397 from TrigInDetConfig.TrigInDetConfig import trigInDetFastTrackingCfg
398 recoAcc.mergeReco(trigInDetFastTrackingCfg(flags, roisKey=RoIs, signatureName=tracking_cfg))
399
400 # Selection sequence CA (seqAND), executing the recoAcc view creation alg. first,
401 # the reco CA (with all the reco algs) second, and the Hypo alg. at last
402 selAcc = SelectionCA(f'tauFTF{name}', isProbe=is_probe_leg)
403 selAcc.mergeReco(recoAcc)
404
405
406 # Hypothesis:
407 # The hypothesis algorithm/tool does not perform any action (debug logging of number of tracks only)
408 selAcc.addHypoAlgo(CompFactory.TrigTauTrackingHypoAlg(
409 f'TauFastTrackHypoAlg_PassBy{name}',
410 TracksKey=flags.Tracking.ActiveConfig.tracks_FTF,
411 ))
412
413
414 # Menu sequence, connecting everything internally for the step, and configuring the tools for the Hypo alg.
415 # based on the partDict for each chain tau leg
416 from TrigTauHypo.TrigTauHypoTool import TrigTauTrackingHypoToolFromDict
417 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauTrackingHypoToolFromDict)
418
419 return menuSeq
420
421
422
423#================================================================
424# Precision Tracking step
425#================================================================
426
427@AccumulatorCache

◆ tauPrecisionSequenceGenCfg()

MenuSequence tauPrecisionSequenceGenCfg ( AthConfigFlags orig_flags,
str seq_name,
str | None calohits_seq_name = None,
str | None output_name = None,
bool do_lrt = False,
bool is_probe_leg = False,
str jet = 'lc' )
Precision Tau step sequence, for all ID and reconstruction settings

Definition at line 513 of file TauMenuSequences.py.

513def tauPrecisionSequenceGenCfg(orig_flags: AthConfigFlags, seq_name: str, calohits_seq_name: str | None = None, output_name: str | None = None, do_lrt: bool = False, is_probe_leg: bool = False, jet: str = 'lc') -> MenuSequence:
514 '''Precision Tau step sequence, for all ID and reconstruction settings'''
515
516 if jet=='em':
517 seq_name="EM"
518 output_name='EM'
519 orig_seq_name='EM'
520 orig_seq_name = seq_name
521 if output_name is None: output_name = orig_seq_name
522
523 if do_lrt:
524 tracking_cfg = 'tauLRT'
525 input_rois = 'tauFastTrackLRT'
526 else:
527 tracking_cfg = 'tauIsoEM' if jet=='em' else 'tauIso'
528 input_rois = 'tauFastTrackIsoEM' if jet=='em' else 'tauFastTrackIso'
529
530 if calohits_seq_name:
531 seq_name = f'MVA_{calohits_seq_name}'
532 tracking_cfg = f'tauIso{calohits_seq_name}'
533 input_rois = f'tauFastTrackIso{calohits_seq_name}'
534 input_taus = 'HLT_TrigTauRecMerged_CaloHits'
535 input_tau_tracks = 'HLT_tautrack_CaloHits_dummy'
536 else:
537 input_taus = 'HLT_TrigTauRecMerged_CaloEMOnly' if jet=='em' else 'HLT_TrigTauRecMerged_CaloMVAOnly'
538 input_tau_tracks = 'HLT_tautrack_dummy'
539
540 # Retrieve tracking configuration
541 flags = getFlagsForActiveConfig(orig_flags, tracking_cfg, log)
542
543
544 # Get the list of TauIDs to execute
545 from TriggerMenuMT.HLT.Tau.TauConfigurationTools import getPrecisionSequenceTauIDs
546 tau_ids = getPrecisionSequenceTauIDs(flags, seq_name, orig_seq_name)
547
548
549 # Get the list of the decorated variables from the previous step taus to be copied to the new precision taus
550 decors_to_copy = []
551 from .TauConfigurationTools import getHitZAlgs, getHitZVariables, getCaloHitsPreselAlgs, getTauIDScoreVariables
552 if calohits_seq_name:
553 decors_to_copy += [var for alg in getHitZAlgs(flags, seq_name, orig_seq_name) for var in getHitZVariables(alg)]
554 decors_to_copy += [var for alg in getCaloHitsPreselAlgs(flags, seq_name, orig_seq_name) for var in getTauIDScoreVariables(alg)]
555
556
557 # Reconstruction sequence CA (parOR), executting all reco algorithms within the View (from the RoI)
558 # in parallel whenever possible, according to their data dependencies.
559 # Create the EventViews based on the RoIs created in the previous steps (tauIso and tauLRT)
560 recoAcc = InViewRecoCA(
561 name=f'tauPrecisionReco_{seq_name}',
562 RoITool=CompFactory.ViewCreatorPreviousROITool(),
563 InViewRoIs=input_rois,
564 RequireParentView=True,
565 ViewFallThrough=True,
566 isProbe=is_probe_leg,
567 )
568 RoIs = recoAcc.inputMaker().InViewRoIs
569
570
571 # VDV with all the required collections/objects in the View
572 # (the VDV checks are disabled unless running with -l DEBUG)
573 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
574 name=f'{recoAcc.name}RecoVDV',
575 DataObjects={
576 ('TrigRoiDescriptorCollection', f'StoreGateSvc+{RoIs}'),
577 ('SG::AuxElement', 'StoreGateSvc+EventInfo.averageInteractionsPerCrossing'),
578 ('xAOD::VertexContainer', f'StoreGateSvc+{flags.Tracking.ActiveConfig.vertex}'),
579 ('xAOD::TrackParticleContainer', f'StoreGateSvc+{flags.Tracking.ActiveConfig.tracks_IDTrig}'),
580 ('xAOD::TauTrackContainer', f'StoreGateSvc+{input_tau_tracks}'),
581 ('xAOD::TauJetContainer', f'StoreGateSvc+{input_taus}'),
582 } | {
583 ('xAOD::TauJetContainer', f'StoreGateSvc+{input_taus}.{var}')
584 for var in decors_to_copy
585 }
586 ))
587
588
589 # Reconstruction tools/algorithms:
590
591 # Precision TauJet reconstruction sequence
592 from TrigTauRec.TrigTauRecConfig import trigTauRecMergedPrecisionMVACfg
593 recoAcc.mergeReco(trigTauRecMergedPrecisionMVACfg(
594 flags,
595 seq_name,
596 tau_ids=tau_ids,
597 input_rois=RoIs,
598 input_tracks=flags.Tracking.ActiveConfig.tracks_IDTrig,
599 input_taus=input_taus,
600 input_tau_tracks=input_tau_tracks,
601 output_name=output_name,
602 decors_to_copy=decors_to_copy,
603 ))
604
605
606 # Selection sequence CA (seqAND), executing the recoAcc view creation alg. first,
607 # the reco CA (with all the reco algs) after, and the Hypo alg. at last
608 selAcc = SelectionCA(f'tauPrecision_{seq_name}', isProbe=is_probe_leg)
609 selAcc.mergeReco(recoAcc)
610
611
612 # Hypothesis:
613 # The Hypotools in the Hypo algorithm will execute the calibrated Tau pT cut,
614 # NTrack cut, NWideTrack cut, and ID WP selections (or meson variable cuts)
615 selAcc.addHypoAlgo(CompFactory.TrigTauJetHypoAlg(
616 f'TauPrecisionHypoAlg_{seq_name}',
617 TauJetsKey=f'HLT_TrigTauRecMerged_{output_name}',
618 ))
619
620
621 # Menu sequence, connecting everything internally for the step, and configuring the tools for the Hypo alg.
622 # based on the partDict for each chain tau leg
623 from TrigTauHypo.TrigTauHypoTool import TrigTauPrecisionHypoToolFromDict
624 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauPrecisionHypoToolFromDict)
625
626 return menuSeq

◆ tauPrecTrackSequenceGenCfg()

MenuSequence tauPrecTrackSequenceGenCfg ( AthConfigFlags orig_flags,
str | None calohits_seq_name = None,
bool do_lrt = False,
bool is_probe_leg = False,
str jet = 'lc' )
Precision Tracking step sequence, for both the tauIso and tauLRT RoIs

Definition at line 428 of file TauMenuSequences.py.

428def tauPrecTrackSequenceGenCfg(orig_flags: AthConfigFlags, calohits_seq_name: str | None = None, do_lrt: bool = False, is_probe_leg: bool = False, jet: str = 'lc') -> MenuSequence:
429 '''Precision Tracking step sequence, for both the tauIso and tauLRT RoIs'''
430
431 if do_lrt:
432 name = 'LRT'
433 tracking_cfg = 'tauLRT'
434 else:
435 name = 'IsoEM' if jet=='em' else 'Iso'
436 tracking_cfg = 'tauIsoEM' if jet=='em' else 'tauIso'
437
438 if calohits_seq_name:
439 name = f'Iso_{calohits_seq_name}'
440 tracking_cfg = f'tauIso{calohits_seq_name}'
441 input_rois = f'tauFastTrackIso_{calohits_seq_name}'
442 else:
443 input_rois = f'tauFastTrack{name}'
444
445 # Retrieve tracking configuration
446 flags = getFlagsForActiveConfig(orig_flags, tracking_cfg, log)
447
448
449 # Reconstruction sequence CA (parOR), executting all reco algorithms within the View (from the RoI)
450 # in parallel whenever possible, according to their data dependencies.
451 # Create the EventViews based on the RoIs created in the previous steps (tauIso and tauLRT)
452 recoAcc = InViewRecoCA(
453 name=f'tauPrecTrack{name}',
454 RoITool=CompFactory.ViewCreatorPreviousROITool(),
455 InViewRoIs=input_rois,
456 RequireParentView=True,
457 ViewFallThrough=True,
458 isProbe=is_probe_leg,
459 )
460 RoIs = recoAcc.inputMaker().InViewRoIs
461
462
463 # VDV with all the required collections/objects in the View
464 # (the VDV checks are disabled unless running with -l DEBUG)
465 recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(
466 name=f'{recoAcc.name}RecoVDV',
467 DataObjects={
468 ('TrigRoiDescriptorCollection', f'StoreGateSvc+{RoIs}'),
469 ('SG::AuxElement', 'StoreGateSvc+EventInfo.averageInteractionsPerCrossing'),
470 }
471 ))
472
473
474 # Reconstruction tools/algorithms:
475
476 # Precision Tracking sequence (track extension to the TRT and refitting)
477 from TrigInDetConfig.TrigInDetConfig import trigInDetPrecisionTrackingCfg
478 recoAcc.mergeReco(trigInDetPrecisionTrackingCfg(flags, rois=RoIs, signatureName=tracking_cfg))
479
480 # Vertexing sequence
481 from TrigInDetConfig.TrigInDetConfig import trigInDetVertexingCfg
482 recoAcc.mergeReco(trigInDetVertexingCfg(flags, flags.Tracking.ActiveConfig.tracks_IDTrig, flags.Tracking.ActiveConfig.vertex))
483
484
485 # Selection sequence CA (seqAND), executing the recoAcc view creation alg. first,
486 # the reco CA (with all the reco algs) after, and the Hypo alg. at last
487 selAcc = SelectionCA(f'tauPT{name}', isProbe=is_probe_leg)
488 selAcc.mergeReco(recoAcc)
489
490
491 # Hypothesis:
492 # The hypothesis algorithm/tool does not perform any action (debug logging of number of tracks only)
493 selAcc.addHypoAlgo(CompFactory.TrigTauTrackingHypoAlg(
494 f'TauPrecTrackHypoAlg_PassBy{name}',
495 TracksKey=flags.Tracking.ActiveConfig.tracks_IDTrig,
496 ))
497
498
499 # Menu sequence, connecting everything internally for the step, and configuring the tools for the Hypo alg.
500 # based on the partDict for each chain tau leg
501 from TrigTauHypo.TrigTauHypoTool import TrigTauTrackingHypoToolFromDict
502 menuSeq = MenuSequence(flags, selAcc, HypoToolGen=TrigTauTrackingHypoToolFromDict)
503
504 return menuSeq
505
506
507
508#================================================================
509# Precision Tau step
510#================================================================
511
512@AccumulatorCache

Variable Documentation

◆ log

python.HLT.Tau.TauMenuSequences.log = logging.getLogger(__name__)

Definition at line 11 of file TauMenuSequences.py.