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

Functions

list[strgetPrecisionSequenceTauIDs (flags, 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 50 of file TauConfigurationTools.py.

50 def getChainIDConfigName(chainPart) -> str:
51  '''Clean the ID configuration for a chainPart dict'''
52  sel = chainPart['selection']
53 
54  # Support for the Legacy trigger names:
55  if chainPart['reconstruction'] == 'tracktwoMVA':
56  if sel in rnn_wps:
57  return 'DeepSet'
58  elif sel in meson_selections:
59  return 'MesonCuts'
60  elif chainPart['reconstruction'] in ['tracktwoLLP', 'trackLRT'] and sel in rnn_wps:
61  return 'RNNLLP'
62 
63 
64  # Retrieve the TauID name from the selection string
65  if sel.startswith('veryloose'): sel = sel.removeprefix('veryloose')
66  if sel.startswith('loose'): sel = sel.removeprefix('loose')
67  if sel.startswith('medium'): sel = sel.removeprefix('medium')
68  if sel.startswith('tight'): sel = sel.removeprefix('tight')
69 
70  # Remap names (e.g. DS -> DeepSet)
71  name_mapping: dict[str, str] = {'DS': 'DeepSet', 'GNT': 'GNTau'}
72  if sel in name_mapping: sel = name_mapping[sel]
73 
74  return sel
75 
76 

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

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

◆ getChainSequenceConfigName()

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

Definition at line 77 of file TauConfigurationTools.py.

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

◆ 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.

15 def 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  }
31 
32  ret = tau_ids[precision_sequence]
33  if any(pfx in flags.Trigger.triggerMenuSetup for pfx in ['MC_', 'Dev_']) and precision_sequence in mc_tau_ids:
34  ret += mc_tau_ids[precision_sequence]
35  if 'Dev_' in flags.Trigger.triggerMenuSetup and precision_sequence in dev_tau_ids:
36  ret += dev_tau_ids[precision_sequence]
37  return ret
38 
39 

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

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

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

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

◆ noid_selections

python.HLT.Tau.TauConfigurationTools.noid_selections

Definition at line 47 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 46 of file TauConfigurationTools.py.

python.HLT.Tau.TauConfigurationTools.useBuiltInTauJetRNNScore
bool useBuiltInTauJetRNNScore(str tau_id, str precision_sequence)
Definition: TauConfigurationTools.py:97
python.HLT.Tau.TauConfigurationTools.getPrecisionSequenceTauIDs
list[str] getPrecisionSequenceTauIDs(flags, str precision_sequence)
Sequence TauIDs.
Definition: TauConfigurationTools.py:15
python.HLT.Tau.TauConfigurationTools.getChainPrecisionSeqName
str getChainPrecisionSeqName(chainPart)
Definition: TauConfigurationTools.py:82
python.HLT.Tau.TauConfigurationTools.getTauIDScoreVariables
tuple[str, str] getTauIDScoreVariables(str tau_id, str precision_sequence)
Definition: TauConfigurationTools.py:106
python.HLT.Tau.TauConfigurationTools.getChainIDConfigName
str getChainIDConfigName(chainPart)
Definition: TauConfigurationTools.py:50
python.HLT.Tau.TauConfigurationTools.getChainSequenceConfigName
str getChainSequenceConfigName(chainPart)
Definition: TauConfigurationTools.py:77