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': [
'DeepSet',
'GNTau',
'MesonCuts'],
27 ret = tau_ids[precision_sequence]
28 if 'Dev_' in flags.Trigger.triggerMenuSetup
and precision_sequence
in dev_tau_ids: ret += dev_tau_ids[precision_sequence]
38 rnn_wps = [
'verylooseRNN',
'looseRNN',
'mediumRNN',
'tightRNN']
39 noid_selections = [
'perf',
'idperf']
40 meson_selections = [
'kaonpi1',
'kaonpi2',
'dipion1',
'dipion2',
'dipion3',
'dipion4',
'dikaonmass',
'singlepion']
43 '''Clean the ID configuration for a chainPart dict'''
44 sel = chainPart[
'selection']
47 if chainPart[
'reconstruction'] ==
'tracktwoMVA':
50 elif sel
in meson_selections:
52 elif chainPart[
'reconstruction']
in [
'tracktwoLLP',
'trackLRT']
and sel
in rnn_wps:
57 if sel.startswith(
'veryloose'): sel = sel.removeprefix(
'veryloose')
58 if sel.startswith(
'loose'): sel = sel.removeprefix(
'loose')
59 if sel.startswith(
'medium'): sel = sel.removeprefix(
'medium')
60 if sel.startswith(
'tight'): sel = sel.removeprefix(
'tight')
63 name_mapping: dict[str, str] = {
'DS':
'DeepSet',
'GNT':
'GNTau'}
64 if sel
in name_mapping: sel = name_mapping[sel]
70 '''Get the HLT Tau signature sequence name (e.g. ptonly, tracktwo, trackLRT, etc...)'''
71 return chainPart[
'reconstruction']
76 Get the HLT Tau Precision sequence name suffix.
77 This is also used for the HLT_TrigTauRecMerged_... and HLT_tautrack_... EDM collection names.
79 ret = chainPart[
'reconstruction']
82 if ret ==
'tracktwoMVA':
return 'MVA'
83 elif ret ==
'tracktwoLLP':
return 'LLP'
84 elif ret ==
'trackLRT':
return 'LRT'
90 '''Check if the TauJet's built-in RNN score and WP variables have to be used, instead of the decorator-based variables'''
92 if (tau_id ==
'DeepSet' and precision_sequence ==
'MVA')
or (tau_id ==
'RNNLLP' and precision_sequence
in [
'LLP',
'LRT']):
99 '''Return the (score, score_sig_trans) variable name pair for a given TauID/Sequence configuration'''
102 return (
'RNNJetScore',
'RNNJetScoreSigTrans')
104 return (f
'{tau_id}_Score', f
'{tau_id}_ScoreSigTrans')