3 from AthenaCommon.Logging
import logging
4 log = logging.getLogger(__name__)
16 '''Get the list of TauIDs for each HLT tau trigger sequence'''
18 'MVA': [
'GNTau',
'MesonCuts'],
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]
46 rnn_wps = [
'verylooseRNN',
'looseRNN',
'mediumRNN',
'tightRNN']
47 noid_selections = [
'perf',
'idperf']
48 meson_selections = [
'kaonpi1',
'kaonpi2',
'dipion1',
'dipion2',
'dipion3',
'dipion4',
'dikaonmass',
'singlepion']
51 '''Clean the ID configuration for a chainPart dict'''
52 sel = chainPart[
'selection']
55 if chainPart[
'reconstruction'] ==
'tracktwoMVA':
58 elif sel
in meson_selections:
60 elif chainPart[
'reconstruction']
in [
'tracktwoLLP',
'trackLRT']
and sel
in rnn_wps:
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')
71 name_mapping: dict[str, str] = {
'DS':
'DeepSet',
'GNT':
'GNTau'}
72 if sel
in name_mapping: sel = name_mapping[sel]
78 '''Get the HLT Tau signature sequence name (e.g. ptonly, tracktwo, trackLRT, etc...)'''
79 return chainPart[
'reconstruction']
84 Get the HLT Tau Precision sequence name suffix.
85 This is also used for the HLT_TrigTauRecMerged_... and HLT_tautrack_... EDM collection names.
87 ret = chainPart[
'reconstruction']
90 if ret ==
'tracktwoMVA':
return 'MVA'
91 elif ret ==
'tracktwoLLP':
return 'LLP'
92 elif ret ==
'trackLRT':
return 'LRT'
98 '''Check if the TauJet's built-in RNN score and WP variables have to be used, instead of the decorator-based variables'''
100 if (tau_id ==
'DeepSet' and precision_sequence ==
'MVA')
or (tau_id ==
'RNNLLP' and precision_sequence
in [
'LLP',
'LRT']):
107 '''Return the (score, score_sig_trans) variable name pair for a given TauID/Sequence configuration'''
110 return (
'RNNJetScore',
'RNNJetScoreSigTrans')
112 return (f
'{tau_id}_Score', f
'{tau_id}_ScoreSigTrans')