ATLAS Offline Software
Functions | Variables
python.HLT.Tau.TauConfigurationTools Namespace Reference

Functions

list[strgetPrecisionSequenceTauIDs (str precision_sequence)
 Sequence TauIDs. More...
 
str getChainIDConfigName (chainPart)
 
str getChainSequenceConfigName (chainPart)
 
str getChainPrecisionSeqName (chainPart)
 
bool useBuiltInTauJetRNNScore (str tau_id, str precision_sequence)
 
tuple[str, strgetTauIDScoreVariables (str tau_id, str precision_sequence)
 

Variables

 log
 
 rnn_wps
 This file contains helper functions for the Tau Trigger signature. More...
 
 noid_selections
 
 meson_selections
 

Function Documentation

◆ getChainIDConfigName()

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

Definition at line 35 of file TauConfigurationTools.py.

35 def getChainIDConfigName(chainPart) -> str:
36  '''Clean the ID configuration for a chainPart dict'''
37  sel = chainPart['selection']
38 
39  # Support for the Legacy trigger names:
40  if chainPart['reconstruction'] == 'tracktwoMVA':
41  if sel in rnn_wps:
42  return 'DeepSet'
43  elif sel in meson_selections:
44  return 'MesonCuts'
45  elif chainPart['reconstruction'] in ['tracktwoLLP', 'trackLRT'] and sel in rnn_wps:
46  return 'RNNLLP'
47 
48 
49  # Retrieve the TauID name from the selection string
50  if sel.startswith('veryloose'): sel = sel.removeprefix('veryloose')
51  if sel.startswith('loose'): sel = sel.removeprefix('loose')
52  if sel.startswith('medium'): sel = sel.removeprefix('medium')
53  if sel.startswith('tight'): sel = sel.removeprefix('tight')
54 
55  # Remap names (e.g. DS -> DeepSet)
56  name_mapping: dict[str, str] = {'DS': 'DeepSet', 'GNT': 'GNTau'}
57  if sel in name_mapping: sel = name_mapping[sel]
58 
59  return sel
60 
61 

◆ 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 67 of file TauConfigurationTools.py.

67 def getChainPrecisionSeqName(chainPart) -> str:
68  '''
69  Get the HLT Tau Precision sequence name suffix.
70  This is also used for the HLT_TrigTauRecMerged_... and HLT_tautrack_... EDM collection names.
71  '''
72  ret = chainPart['reconstruction']
73 
74  # Support for the Legacy trigger names:
75  if ret == 'tracktwoMVA': return 'MVA'
76  elif ret == 'tracktwoLLP': return 'LLP'
77  elif ret == 'trackLRT': return 'LRT'
78 
79  return ret
80 
81 

◆ getChainSequenceConfigName()

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

Definition at line 62 of file TauConfigurationTools.py.

62 def getChainSequenceConfigName(chainPart) -> str:
63  '''Get the HLT Tau signature sequence name (e.g. ptonly, tracktwo, trackLRT, etc...)'''
64  return chainPart['reconstruction']
65 
66 

◆ getPrecisionSequenceTauIDs()

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

Sequence TauIDs.

Get the list of TauIDs for each HLT tau trigger sequence

Definition at line 15 of file TauConfigurationTools.py.

15 def getPrecisionSequenceTauIDs(precision_sequence: str) -> list[str]:
16  '''Get the list of TauIDs for each HLT tau trigger sequence'''
17  tau_ids = {
18  'MVA': ['DeepSet', 'MesonCuts'],
19  'LLP': ['RNNLLP'],
20  'LRT': ['RNNLLP'],
21  }
22 
23  return tau_ids[precision_sequence]
24 

◆ 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 91 of file TauConfigurationTools.py.

91 def getTauIDScoreVariables(tau_id: str, precision_sequence: str) -> tuple[str, str]:
92  '''Return the (score, score_sig_trans) variable name pair for a given TauID/Sequence configuration'''
93  # Support for "legacy" algorithms, where the scores are stored in the built-in TauJet aux variables
94  if useBuiltInTauJetRNNScore(tau_id, precision_sequence):
95  return ('RNNJetScore', 'RNNJetScoreSigTrans')
96 
97  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 82 of file TauConfigurationTools.py.

82 def useBuiltInTauJetRNNScore(tau_id: str, precision_sequence: str) -> bool:
83  '''Check if the TauJet's built-in RNN score and WP variables have to be used, instead of the decorator-based variables'''
84  # Support for "legacy" algorithms, where the scores are stored in the built-in TauJet aux variables
85  if (tau_id == 'DeepSet' and precision_sequence == 'MVA') or (tau_id == 'RNNLLP' and precision_sequence in ['LLP', 'LRT']):
86  return True
87 
88  return False
89 
90 

Variable Documentation

◆ log

python.HLT.Tau.TauConfigurationTools.log

Definition at line 4 of file TauConfigurationTools.py.

◆ meson_selections

python.HLT.Tau.TauConfigurationTools.meson_selections

Definition at line 33 of file TauConfigurationTools.py.

◆ noid_selections

python.HLT.Tau.TauConfigurationTools.noid_selections

Definition at line 32 of file TauConfigurationTools.py.

◆ rnn_wps

python.HLT.Tau.TauConfigurationTools.rnn_wps

This file contains helper functions for the Tau Trigger signature.

Definition at line 31 of file TauConfigurationTools.py.

python.HLT.Tau.TauConfigurationTools.useBuiltInTauJetRNNScore
bool useBuiltInTauJetRNNScore(str tau_id, str precision_sequence)
Definition: TauConfigurationTools.py:82
python.HLT.Tau.TauConfigurationTools.getChainPrecisionSeqName
str getChainPrecisionSeqName(chainPart)
Definition: TauConfigurationTools.py:67
python.HLT.Tau.TauConfigurationTools.getTauIDScoreVariables
tuple[str, str] getTauIDScoreVariables(str tau_id, str precision_sequence)
Definition: TauConfigurationTools.py:91
python.HLT.Tau.TauConfigurationTools.getPrecisionSequenceTauIDs
list[str] getPrecisionSequenceTauIDs(str precision_sequence)
Sequence TauIDs.
Definition: TauConfigurationTools.py:15
python.HLT.Tau.TauConfigurationTools.getChainIDConfigName
str getChainIDConfigName(chainPart)
Definition: TauConfigurationTools.py:35
python.HLT.Tau.TauConfigurationTools.getChainSequenceConfigName
str getChainSequenceConfigName(chainPart)
Definition: TauConfigurationTools.py:62