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

Functions

list[str] getPrecisionSequenceTauIDs (flags, str precision_sequence)
 Sequence TauIDs.
str getChainIDConfigName (flags, chainPart)
str getChainSequenceConfigName (chainPart)
str getChainPrecisionSeqName (chainPart)
bool useBuiltInTauJetRNNScore (str tau_id, str precision_sequence)
tuple[str, str] getTauIDScoreVariables (str tau_id, str precision_sequence)

Variables

 log = logging.getLogger(__name__)
list rnn_wps = ['verylooseRNN', 'looseRNN', 'mediumRNN', 'tightRNN']
 This file contains helper functions for the Tau Trigger signature.
list noid_selections = ['perf', 'idperf']
list meson_selections = ['kaonpi1', 'kaonpi2', 'dipion1', 'dipion2', 'dipion3', 'dipion4', 'dikaonmass', 'singlepion']

Function Documentation

◆ getChainIDConfigName()

str python.HLT.Tau.TauConfigurationTools.getChainIDConfigName ( flags,
chainPart )
Clean the ID configuration for a chainPart dict

Definition at line 51 of file TauConfigurationTools.py.

51def getChainIDConfigName(flags, chainPart) -> str:
52 '''Clean the ID configuration for a chainPart dict'''
53 sel = chainPart['selection']
54
55 # Support for the Legacy trigger names:
56 if chainPart['reconstruction'] == 'tracktwoMVA':
57 if sel in rnn_wps:
58 return 'DeepSet'
59 elif sel in meson_selections:
60 return 'MesonCuts'
61 elif chainPart['reconstruction'] in ['tracktwoLLP', 'trackLRT'] and sel in rnn_wps:
62 return 'RNNLLP'
63
64 # Sort ID names from longest to shortest, to check for a full match
65 tau_ids = sorted(list(flags.Trigger.Offline.Tau), key=len, reverse=True)
66 for tau_id in tau_ids:
67 if sel.endswith(tau_id): return tau_id
68
69 # Remap names (e.g. DS -> DeepSet)
70 name_mapping: dict[str, str] = {'DS': 'DeepSet', 'GNT': 'GNTau'}
71 name_mapping = dict(sorted(name_mapping.items(), key=lambda p: len(p[0]), reverse=True))
72 for short_name, long_name in name_mapping.items():
73 if sel.endswith(short_name): return long_name
74
75 return sel
76
77

◆ getChainPrecisionSeqName()

str python.HLT.Tau.TauConfigurationTools.getChainPrecisionSeqName ( chainPart)
Get the HLT Tau Precision sequence name suffix.
This is also used for the HLT_TrigTauRecMerged_... and HLT_tautrack_... EDM collection names.

Definition at line 83 of file TauConfigurationTools.py.

83def getChainPrecisionSeqName(chainPart) -> str:
84 '''
85 Get the HLT Tau Precision sequence name suffix.
86 This is also used for the HLT_TrigTauRecMerged_... and HLT_tautrack_... EDM collection names.
87 '''
88 ret = chainPart['reconstruction']
89
90 # Support for the Legacy trigger names:
91 if ret == 'tracktwoMVA': return 'MVA'
92 elif ret == 'tracktwoLLP': return 'LLP'
93 elif ret == 'trackLRT': return 'LRT'
94
95 return ret
96
97

◆ getChainSequenceConfigName()

str python.HLT.Tau.TauConfigurationTools.getChainSequenceConfigName ( chainPart)
Get the HLT Tau signature sequence name (e.g. ptonly, tracktwo, trackLRT, etc...)

Definition at line 78 of file TauConfigurationTools.py.

78def getChainSequenceConfigName(chainPart) -> str:
79 '''Get the HLT Tau signature sequence name (e.g. ptonly, tracktwo, trackLRT, etc...)'''
80 return chainPart['reconstruction']
81
82

◆ getPrecisionSequenceTauIDs()

list[str] python.HLT.Tau.TauConfigurationTools.getPrecisionSequenceTauIDs ( flags,
str precision_sequence )

Sequence TauIDs.

Get the list of TauIDs for each HLT tau trigger sequence

Definition at line 15 of file TauConfigurationTools.py.

15def getPrecisionSequenceTauIDs(flags, precision_sequence: str) -> list[str]:
16 '''Get the list of TauIDs for each HLT tau trigger sequence'''
17 tau_ids = {
18 'MVA': ['GNTau', 'MesonCuts'],
19 'LLP': ['RNNLLP'],
20 'LRT': ['RNNLLP'],
21 }
22
23 # Additional Tau ID algorithms to run ONLY if we're using the MC (or Dev) menu
24 mc_tau_ids = {
25 'MVA': ['DeepSet'],
26 }
27
28 # Additional Tau ID algorithms to run ONLY if we're using the Dev menu
29 dev_tau_ids = {
30 'MVA': ['GNTauDev1'],
31 }
32
33 ret = tau_ids[precision_sequence]
34 if any(pfx in flags.Trigger.triggerMenuSetup for pfx in ['MC_', 'Dev_']) and precision_sequence in mc_tau_ids:
35 ret += mc_tau_ids[precision_sequence]
36 if 'Dev_' in flags.Trigger.triggerMenuSetup and precision_sequence in dev_tau_ids:
37 ret += dev_tau_ids[precision_sequence]
38 return ret
39
40

◆ getTauIDScoreVariables()

tuple[str, str] python.HLT.Tau.TauConfigurationTools.getTauIDScoreVariables ( str tau_id,
str precision_sequence )
Return the (score, score_sig_trans) variable name pair for a given TauID/Sequence configuration

Definition at line 107 of file TauConfigurationTools.py.

107def getTauIDScoreVariables(tau_id: str, precision_sequence: str) -> tuple[str, str]:
108 '''Return the (score, score_sig_trans) variable name pair for a given TauID/Sequence configuration'''
109 # Support for "legacy" algorithms, where the scores are stored in the built-in TauJet aux variables
110 if useBuiltInTauJetRNNScore(tau_id, precision_sequence):
111 return ('RNNJetScore', 'RNNJetScoreSigTrans')
112
113 return (f'{tau_id}_Score', f'{tau_id}_ScoreSigTrans')

◆ useBuiltInTauJetRNNScore()

bool python.HLT.Tau.TauConfigurationTools.useBuiltInTauJetRNNScore ( str tau_id,
str precision_sequence )
Check if the TauJet's built-in RNN score and WP variables have to be used, instead of the decorator-based variables

Definition at line 98 of file TauConfigurationTools.py.

98def useBuiltInTauJetRNNScore(tau_id: str, precision_sequence: str) -> bool:
99 '''Check if the TauJet's built-in RNN score and WP variables have to be used, instead of the decorator-based variables'''
100 # Support for "legacy" algorithms, where the scores are stored in the built-in TauJet aux variables
101 if (tau_id == 'DeepSet' and precision_sequence == 'MVA') or (tau_id == 'RNNLLP' and precision_sequence in ['LLP', 'LRT']):
102 return True
103
104 return False
105
106

Variable Documentation

◆ log

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

Definition at line 4 of file TauConfigurationTools.py.

◆ meson_selections

list python.HLT.Tau.TauConfigurationTools.meson_selections = ['kaonpi1', 'kaonpi2', 'dipion1', 'dipion2', 'dipion3', 'dipion4', 'dikaonmass', 'singlepion']

Definition at line 49 of file TauConfigurationTools.py.

◆ noid_selections

list python.HLT.Tau.TauConfigurationTools.noid_selections = ['perf', 'idperf']

Definition at line 48 of file TauConfigurationTools.py.

◆ rnn_wps

list python.HLT.Tau.TauConfigurationTools.rnn_wps = ['verylooseRNN', 'looseRNN', 'mediumRNN', 'tightRNN']

This file contains helper functions for the Tau Trigger signature.

Definition at line 47 of file TauConfigurationTools.py.